Plugin Directory

Changeset 3720851


Ignore:
Timestamp:
09/30/2026 09:46:31 AM (8 weeks ago)
Author:
optimizza
Message:

Release 3.0.1

Location:
seo-local-rank
Files:
26 added
26 edited

Legend:

Unmodified
Added
Removed
  • seo-local-rank/trunk/assets/src/app/App.js

    r3706047 r3720851  
    77import DashboardPage from './pages/DashboardPage';
    88import OnboardingWizard from './pages/OnboardingWizard';
     9import AiVisibilityPage from './pages/AiVisibilityPage';
    910import RankTrackerPage from './pages/RankTrackerPage';
    1011import SettingsPage from './pages/SettingsPage';
    … …  
    1314        const isSettings = page === 'seolocalrank-settings';
    1415        const isRankTracker = page === 'seolocalrank-rank-tracker';
     16        const isAiVisibility = page === 'seolocalrank-ai-visibility';
    1517        const [ loading, setLoading ] = useState( true );
    1618        const [ settings, setSettings ] = useState( null );
    … …  
    126128                                        onProjectChange={ loadDomains }
    127129                                />
     130                        ) : isAiVisibility ? (
     131                                <AiVisibilityPage
     132                                        domainsPayload={ domainsPayload }
     133                                        selectedProject={ selectedProject }
     134                                        onProjectChange={ loadDomains }
     135                                />
    128136                        ) : (
    129137                                <DashboardPage
  • seo-local-rank/trunk/assets/src/app/components/dashboard/KpiGrid.js

    r3706047 r3720851  
    117117        const viCurrent = kpi.vi_current;
    118118        const rankTrackerUrl = pluginAdminUrl( 'seolocalrank-rank-tracker' );
     119        const aiVisibilityUrl = pluginAdminUrl( 'seolocalrank-ai-visibility' );
    119120
    120121        const openTrueRanker = async ( page ) => {
    … …  
    181182                                emptyMessage={ __( 'Add prompts to measure AI visibility.', 'seo-local-rank' ) }
    182183                                waitingMessage={ __( 'AI visibility data will appear after the first scan.', 'seo-local-rank' ) }
    183                                 onActivate={ () => openTrueRanker( 'ai_visibility' ) }
    184                                 disabled={ Boolean( openingPage ) || ! projectDomainId }
     184                                href={ aiVisibilityUrl }
    185185                                main={ (
    186186                                        <>
  • seo-local-rank/trunk/assets/src/app/components/dashboard/ProjectToolbar.js

    r3706047 r3720851  
    116116 * @param {number=}  props.keywordCount
    117117 * @param {object=}  props.keywordSync
     118 * @param {number=}  props.promptCount
    118119 */
    119120export default function ProjectToolbar( {
    … …  
    124125        keywordCount = null,
    125126        keywordSync = null,
     127        promptCount = null,
    126128} ) {
    127129        const [ saving, setSaving ] = useState( false );
    … …  
    272274                                </div>
    273275                                <KeywordSyncInfo count={ keywordCount } sync={ keywordSync } />
     276                                { promptCount !== null && promptCount !== undefined && (
     277                                        <div className="slr-toolbar__keywords">
     278                                                <span>
     279                                                        { sprintf(
     280                                                                /* translators: %d: number of prompts */
     281                                                                _n( '%d Prompt', '%d Prompts', promptCount, 'seo-local-rank' ),
     282                                                                promptCount
     283                                                        ) }
     284                                                </span>
     285                                        </div>
     286                                ) }
    274287                        </div>
    275288
  • seo-local-rank/trunk/assets/src/app/components/rank-tracker/DateRangePicker.js

    r3706047 r3720851  
    2424        '2months': __( '2 months', 'seo-local-rank' ),
    2525        '3months': __( '3 months', 'seo-local-rank' ),
     26        '6months': __( '6 months', 'seo-local-rank' ),
     27        '1year': __( '1 year', 'seo-local-rank' ),
    2628};
    2729
    … …  
    148150}
    149151
    150 export default function DateRangePicker( { start, end, minDate, maxDate, projectDays, onChange } ) {
     152export default function DateRangePicker( { start, end, minDate, maxDate, projectDays, onChange, presetKeys } ) {
    151153        const locale = getLocale();
    152154        const firstDay = getFirstDayOfWeek( locale );
    … …  
    161163        );
    162164
    163         const presets = useMemo( () => getVisiblePresets( projectDays ), [ projectDays ] );
     165        const presets = useMemo(
     166                () => ( Array.isArray( presetKeys ) && presetKeys.length
     167                        ? presetKeys
     168                        : getVisiblePresets( projectDays ) ),
     169                [ presetKeys, projectDays ]
     170        );
    164171        const weekdayLabels = useMemo(
    165172                () => getWeekdayLabels( locale, firstDay ),
    … …  
    167174        );
    168175        const today = todayUtc();
    169         const activePreset = detectPreset( start, end, today, projectDays );
     176        const activePreset = detectPreset( start, end, today, projectDays, presets );
    170177        const label = formatRangeLabel( start, end, locale );
    171178
  • seo-local-rank/trunk/assets/src/app/utils/pluginLogin.js

    r3706047 r3720851  
    1515                es: '/admin/dominio/visibilidad-ia/%d',
    1616                en: '/en/admin/domain/ai-visibility/%d',
     17                de: '/de/admin/domain/ki-sichtbarkeit/%d',
     18                fr: '/fr/admin/domain/visibilite-ia/%d',
     19                pt: '/pt/admin/domain/visibilidade-ia/%d',
     20                it: '/it/admin/domain/visibilita-ia/%d',
     21                nl: '/nl/admin/domain/ai-zichtbaarheid/%d',
    1722        },
    1823        backlinks: {
    … …  
    2732
    2833function appLang() {
    29         return window.slrAdmin?.lang === 'es' ? 'es' : 'en';
     34        const pageLang = String( window.slrAdmin?.pageLang || window.slrAdmin?.lang || 'en' ).toLowerCase();
     35        const supported = [ 'es', 'en', 'de', 'fr', 'pt', 'it', 'nl' ];
     36
     37        return supported.includes( pageLang ) ? pageLang : 'en';
    3038}
    3139
    … …  
    3543
    3644function appPagePtg( page, projectDomainId ) {
    37         const template = APP_PAGE_PTG[ page ]?.[ appLang() ];
     45        const templates = APP_PAGE_PTG[ page ];
     46
     47        if ( ! templates ) {
     48                return '';
     49        }
     50
     51        const lang = appLang();
     52        const template = templates[ lang ] || templates.en || templates.es || '';
    3853
    3954        if ( ! template ) {
  • seo-local-rank/trunk/assets/src/app/utils/rankTrackerDates.js

    r3706047 r3720851  
    190190                case '3months':
    191191                        return { start: addMonths( today, -3 ), end: today };
     192                case '6months':
     193                        return { start: addMonths( today, -6 ), end: today };
     194                case '1year':
     195                        return { start: addMonths( today, -12 ), end: today };
    192196                default:
    193197                        return { start: addMonths( today, -1 ), end: today };
    … …  
    195199}
    196200
    197 export function detectPreset( start, end, today, projectDays ) {
    198         const presets = getVisiblePresets( projectDays );
     201export function detectPreset( start, end, today, projectDays, presetKeys ) {
     202        const presets = Array.isArray( presetKeys ) && presetKeys.length
     203                ? presetKeys
     204                : getVisiblePresets( projectDays );
    199205
    200206        for ( const preset of presets ) {
  • seo-local-rank/trunk/assets/src/index.js

    r3706047 r3720851  
    33import './styles/tokens.css';
    44import './styles/admin.css';
     5import './styles/ai-visibility.css';
    56
    67// WordPress already registers apiFetch root URL + nonce middleware for wp-api-fetch.
  • seo-local-rank/trunk/assets/src/styles/admin.css

    r3706047 r3720851  
    179179
    180180.slr-app:has(.slr-dashboard),
    181 .slr-app:has(.slr-rank-tracker) {
     181.slr-app:has(.slr-rank-tracker),
     182.slr-app:has(.slr-ai-visibility) {
    182183        padding: 0;
    183184}
  • seo-local-rank/trunk/build/index-rtl.css

    r3706047 r3720851  
    11.tabulator{background-color:#888;border:1px solid #999;font-size:14px;overflow:hidden;position:relative;text-align:right;transform:translateZ(0)}.tabulator[tabulator-layout=fitDataFill] .tabulator-tableholder .tabulator-table{min-width:100%}.tabulator[tabulator-layout=fitDataTable]{display:inline-block}.tabulator.tabulator-block-select,.tabulator.tabulator-ranges .tabulator-cell:not(.tabulator-editing){-webkit-user-select:none;user-select:none}.tabulator .tabulator-header{background-color:#e6e6e6;border-bottom:1px solid #999;box-sizing:border-box;color:#555;font-weight:700;outline:none;overflow:hidden;position:relative;-moz-user-select:none;-khtml-user-select:none;-webkit-user-select:none;-o-user-select:none;white-space:nowrap;width:100%}.tabulator .tabulator-header.tabulator-header-hidden{display:none}.tabulator .tabulator-header .tabulator-header-contents{overflow:hidden;position:relative}.tabulator .tabulator-header .tabulator-header-contents .tabulator-headers{display:inline-block}.tabulator .tabulator-header .tabulator-col{background:#e6e6e6;border-left:1px solid #aaa;box-sizing:border-box;display:inline-flex;flex-direction:column;justify-content:flex-start;overflow:hidden;position:relative;text-align:right;vertical-align:bottom}.tabulator .tabulator-header .tabulator-col.tabulator-moving{background:#cdcdcd;border:1px solid #999;pointer-events:none;position:absolute}.tabulator .tabulator-header .tabulator-col.tabulator-range-highlight{background-color:#d6d6d6;color:#000}.tabulator .tabulator-header .tabulator-col.tabulator-range-selected{background-color:#3876ca;color:#fff}.tabulator .tabulator-header .tabulator-col .tabulator-col-content{box-sizing:border-box;padding:4px;position:relative}.tabulator .tabulator-header .tabulator-col .tabulator-col-content .tabulator-header-popup-button{padding:0 8px}.tabulator .tabulator-header .tabulator-col .tabulator-col-content .tabulator-header-popup-button:hover{cursor:pointer;opacity:.6}.tabulator .tabulator-header .tabulator-col .tabulator-col-content .tabulator-col-title-holder{position:relative}.tabulator .tabulator-header .tabulator-col .tabulator-col-content .tabulator-col-title{box-sizing:border-box;overflow:hidden;text-overflow:ellipsis;vertical-align:bottom;white-space:nowrap;width:100%}.tabulator .tabulator-header .tabulator-col .tabulator-col-content .tabulator-col-title.tabulator-col-title-wrap{text-overflow:clip;white-space:normal}.tabulator .tabulator-header .tabulator-col .tabulator-col-content .tabulator-col-title .tabulator-title-editor{background:#fff;border:1px solid #999;box-sizing:border-box;padding:1px;width:100%}.tabulator .tabulator-header .tabulator-col .tabulator-col-content .tabulator-col-title .tabulator-header-popup-button+.tabulator-title-editor{width:calc(100% - 22px)}.tabulator .tabulator-header .tabulator-col .tabulator-col-content .tabulator-col-sorter{align-items:center;bottom:0;display:flex;position:absolute;left:4px;top:0}.tabulator .tabulator-header .tabulator-col .tabulator-col-content .tabulator-col-sorter .tabulator-arrow{border-bottom:6px solid #bbb;border-right:6px solid transparent;border-left:6px solid transparent;height:0;width:0}.tabulator .tabulator-header .tabulator-col.tabulator-col-group .tabulator-col-group-cols{border-top:1px solid #aaa;display:flex;margin-left:-1px;overflow:hidden;position:relative}.tabulator .tabulator-header .tabulator-col .tabulator-header-filter{box-sizing:border-box;margin-top:2px;position:relative;text-align:center;width:100%}.tabulator .tabulator-header .tabulator-col .tabulator-header-filter textarea{height:auto!important}.tabulator .tabulator-header .tabulator-col .tabulator-header-filter svg{margin-top:3px}.tabulator .tabulator-header .tabulator-col .tabulator-header-filter input::-ms-clear{height:0;width:0}.tabulator .tabulator-header .tabulator-col.tabulator-sortable .tabulator-col-title{padding-left:25px}@media (hover:hover) and (pointer:fine){.tabulator .tabulator-header .tabulator-col.tabulator-sortable.tabulator-col-sorter-element:hover{background-color:#cdcdcd;cursor:pointer}}.tabulator .tabulator-header .tabulator-col.tabulator-sortable[aria-sort=none] .tabulator-col-content .tabulator-col-sorter{color:#bbb}@media (hover:hover) and (pointer:fine){.tabulator .tabulator-header .tabulator-col.tabulator-sortable[aria-sort=none] .tabulator-col-content .tabulator-col-sorter.tabulator-col-sorter-element .tabulator-arrow:hover{border-bottom:6px solid #555;cursor:pointer}}.tabulator .tabulator-header .tabulator-col.tabulator-sortable[aria-sort=none] .tabulator-col-content .tabulator-col-sorter .tabulator-arrow{border-bottom:6px solid #bbb;border-top:none}.tabulator .tabulator-header .tabulator-col.tabulator-sortable[aria-sort=ascending] .tabulator-col-content .tabulator-col-sorter{color:#666}@media (hover:hover) and (pointer:fine){.tabulator .tabulator-header .tabulator-col.tabulator-sortable[aria-sort=ascending] .tabulator-col-content .tabulator-col-sorter.tabulator-col-sorter-element .tabulator-arrow:hover{border-bottom:6px solid #555;cursor:pointer}}.tabulator .tabulator-header .tabulator-col.tabulator-sortable[aria-sort=ascending] .tabulator-col-content .tabulator-col-sorter .tabulator-arrow{border-bottom:6px solid #666;border-top:none}.tabulator .tabulator-header .tabulator-col.tabulator-sortable[aria-sort=descending] .tabulator-col-content .tabulator-col-sorter{color:#666}@media (hover:hover) and (pointer:fine){.tabulator .tabulator-header .tabulator-col.tabulator-sortable[aria-sort=descending] .tabulator-col-content .tabulator-col-sorter.tabulator-col-sorter-element .tabulator-arrow:hover{border-top:6px solid #555;cursor:pointer}}.tabulator .tabulator-header .tabulator-col.tabulator-sortable[aria-sort=descending] .tabulator-col-content .tabulator-col-sorter .tabulator-arrow{border-bottom:none;border-top:6px solid #666;color:#666}.tabulator .tabulator-header .tabulator-col.tabulator-col-vertical .tabulator-col-content .tabulator-col-title{align-items:center;display:flex;justify-content:center;text-orientation:mixed;writing-mode:vertical-rl}.tabulator .tabulator-header .tabulator-col.tabulator-col-vertical.tabulator-col-vertical-flip .tabulator-col-title{transform:rotate(-180deg)}.tabulator .tabulator-header .tabulator-col.tabulator-col-vertical.tabulator-sortable .tabulator-col-title{padding-left:0;padding-top:20px}.tabulator .tabulator-header .tabulator-col.tabulator-col-vertical.tabulator-sortable.tabulator-col-vertical-flip .tabulator-col-title{padding-bottom:20px;padding-left:0}.tabulator .tabulator-header .tabulator-col.tabulator-col-vertical.tabulator-sortable .tabulator-col-sorter{bottom:auto;justify-content:center;right:0;left:0;top:4px}.tabulator .tabulator-header .tabulator-frozen{right:0;position:sticky;z-index:11}.tabulator .tabulator-header .tabulator-frozen.tabulator-frozen-left{border-left:2px solid #aaa}.tabulator .tabulator-header .tabulator-frozen.tabulator-frozen-right{border-right:2px solid #aaa}.tabulator .tabulator-header .tabulator-calcs-holder{background:#f3f3f3!important;border-bottom:1px solid #aaa;border-top:1px solid #aaa;box-sizing:border-box;display:inline-block}.tabulator .tabulator-header .tabulator-calcs-holder .tabulator-row{background:#f3f3f3!important}.tabulator .tabulator-header .tabulator-calcs-holder .tabulator-row .tabulator-col-resize-handle{display:none}.tabulator .tabulator-header .tabulator-frozen-rows-holder{display:inline-block;padding-top:1em}.tabulator .tabulator-header .tabulator-frozen-rows-holder:empty{display:none}.tabulator .tabulator-tableholder{-webkit-overflow-scrolling:touch;overflow:auto;position:relative;white-space:nowrap;width:100%}.tabulator .tabulator-tableholder:focus{outline:none}.tabulator .tabulator-tableholder .tabulator-placeholder{align-items:center;box-sizing:border-box;display:flex;justify-content:center;min-width:100%;width:100%}.tabulator .tabulator-tableholder .tabulator-placeholder[tabulator-render-mode=virtual]{min-height:100%}.tabulator .tabulator-tableholder .tabulator-placeholder .tabulator-placeholder-contents{color:#ccc;display:inline-block;font-size:20px;font-weight:700;padding:10px;text-align:center;white-space:normal}.tabulator .tabulator-tableholder .tabulator-table{background-color:#fff;color:#333;display:inline-block;overflow:visible;position:relative;white-space:nowrap}.tabulator .tabulator-tableholder .tabulator-table .tabulator-row.tabulator-calcs{background:#e2e2e2!important;font-weight:700}.tabulator .tabulator-tableholder .tabulator-table .tabulator-row.tabulator-calcs.tabulator-calcs-top{border-bottom:2px solid #aaa}.tabulator .tabulator-tableholder .tabulator-table .tabulator-row.tabulator-calcs.tabulator-calcs-bottom{border-top:2px solid #aaa}.tabulator .tabulator-tableholder .tabulator-range-overlay{inset:0;pointer-events:none;position:absolute;z-index:10}.tabulator .tabulator-tableholder .tabulator-range-overlay .tabulator-range{border:1px solid #2975dd;box-sizing:border-box;position:absolute}.tabulator .tabulator-tableholder .tabulator-range-overlay .tabulator-range.tabulator-range-active:after{background-color:#2975dd;border-radius:999px;bottom:-3px;content:"";height:6px;position:absolute;left:-3px;width:6px}.tabulator .tabulator-tableholder .tabulator-range-overlay .tabulator-range-cell-active{border:2px solid #2975dd;box-sizing:border-box;position:absolute}.tabulator .tabulator-footer{background-color:#e6e6e6;border-top:1px solid #999;color:#555;font-weight:700;user-select:none;-moz-user-select:none;-khtml-user-select:none;-webkit-user-select:none;-o-user-select:none;white-space:nowrap}.tabulator .tabulator-footer .tabulator-footer-contents{align-items:center;display:flex;flex-direction:row;justify-content:space-between;padding:5px 10px}.tabulator .tabulator-footer .tabulator-footer-contents:empty{display:none}.tabulator .tabulator-footer .tabulator-spreadsheet-tabs{margin-top:-5px;overflow-x:auto}.tabulator .tabulator-footer .tabulator-spreadsheet-tabs .tabulator-spreadsheet-tab{border:1px solid #999;border-bottom-right-radius:5px;border-bottom-left-radius:5px;border-top:none;display:inline-block;font-size:.9em;padding:5px}.tabulator .tabulator-footer .tabulator-spreadsheet-tabs .tabulator-spreadsheet-tab:hover{cursor:pointer;opacity:.7}.tabulator .tabulator-footer .tabulator-spreadsheet-tabs .tabulator-spreadsheet-tab.tabulator-spreadsheet-tab-active{background:#fff}.tabulator .tabulator-footer .tabulator-calcs-holder{background:#f3f3f3!important;border-bottom:1px solid #aaa;border-top:1px solid #aaa;box-sizing:border-box;overflow:hidden;text-align:right;width:100%}.tabulator .tabulator-footer .tabulator-calcs-holder .tabulator-row{background:#f3f3f3!important;display:inline-block}.tabulator .tabulator-footer .tabulator-calcs-holder .tabulator-row .tabulator-col-resize-handle{display:none}.tabulator .tabulator-footer .tabulator-calcs-holder:only-child{border-bottom:none;margin-bottom:-5px}.tabulator .tabulator-footer>*+.tabulator-page-counter{margin-right:10px}.tabulator .tabulator-footer .tabulator-page-counter{font-weight:400}.tabulator .tabulator-footer .tabulator-paginator{color:#555;flex:1;font-family:inherit;font-size:inherit;font-weight:inherit;text-align:left}.tabulator .tabulator-footer .tabulator-page-size{border:1px solid #aaa;border-radius:3px;display:inline-block;margin:0 5px;padding:2px 5px}.tabulator .tabulator-footer .tabulator-pages{margin:0 7px}.tabulator .tabulator-footer .tabulator-page{background:hsla(0,0%,100%,.2);border:1px solid #aaa;border-radius:3px;display:inline-block;margin:0 2px;padding:2px 5px}.tabulator .tabulator-footer .tabulator-page.active{color:#d00}.tabulator .tabulator-footer .tabulator-page:disabled{opacity:.5}@media (hover:hover) and (pointer:fine){.tabulator .tabulator-footer .tabulator-page:not(disabled):hover{background:rgba(0,0,0,.2);color:#fff;cursor:pointer}}.tabulator .tabulator-col-resize-handle{display:inline-block;margin-right:-3px;margin-left:-3px;position:relative;vertical-align:middle;width:6px;z-index:11}@media (hover:hover) and (pointer:fine){.tabulator .tabulator-col-resize-handle:hover{cursor:ew-resize}}.tabulator .tabulator-col-resize-handle:last-of-type{margin-left:0;width:3px}.tabulator .tabulator-col-resize-guide{background-color:#999;height:100%;margin-right:-.5px;opacity:.5;position:absolute;top:0;width:4px}.tabulator .tabulator-row-resize-guide{background-color:#999;height:4px;right:0;margin-top:-.5px;opacity:.5;position:absolute;width:100%}.tabulator .tabulator-alert{align-items:center;background:rgba(0,0,0,.4);display:flex;height:100%;right:0;position:absolute;text-align:center;top:0;width:100%;z-index:100}.tabulator .tabulator-alert .tabulator-alert-msg{background:#fff;border-radius:10px;display:inline-block;font-size:16px;font-weight:700;margin:0 auto;padding:10px 20px}.tabulator .tabulator-alert .tabulator-alert-msg.tabulator-alert-state-msg{border:4px solid #333;color:#000}.tabulator .tabulator-alert .tabulator-alert-msg.tabulator-alert-state-error{border:4px solid #d00;color:#590000}.tabulator-row{background-color:#fff;box-sizing:border-box;min-height:22px;position:relative}.tabulator-row.tabulator-row-even{background-color:#efefef}@media (hover:hover) and (pointer:fine){.tabulator-row.tabulator-selectable:hover{background-color:#bbb;cursor:pointer}}.tabulator-row.tabulator-selected{background-color:#9abcea}@media (hover:hover) and (pointer:fine){.tabulator-row.tabulator-selected:hover{background-color:#769bcc;cursor:pointer}}.tabulator-row.tabulator-row-moving{background:#fff;border:1px solid #000}.tabulator-row.tabulator-moving{border-bottom:1px solid #aaa;border-top:1px solid #aaa;pointer-events:none;position:absolute;z-index:15}.tabulator-row.tabulator-range-highlight .tabulator-cell.tabulator-range-row-header{background-color:#d6d6d6;color:#000}.tabulator-row.tabulator-range-highlight.tabulator-range-selected .tabulator-cell.tabulator-range-row-header,.tabulator-row.tabulator-range-selected .tabulator-cell.tabulator-range-row-header{background-color:#3876ca;color:#fff}.tabulator-row .tabulator-row-resize-handle{bottom:0;height:5px;right:0;position:absolute;left:0}.tabulator-row .tabulator-row-resize-handle.prev{bottom:auto;top:0}@media (hover:hover) and (pointer:fine){.tabulator-row .tabulator-row-resize-handle:hover{cursor:ns-resize}}.tabulator-row .tabulator-responsive-collapse{border-bottom:1px solid #aaa;border-top:1px solid #aaa;box-sizing:border-box;padding:5px}.tabulator-row .tabulator-responsive-collapse:empty{display:none}.tabulator-row .tabulator-responsive-collapse table{font-size:14px}.tabulator-row .tabulator-responsive-collapse table tr td{position:relative}.tabulator-row .tabulator-responsive-collapse table tr td:first-of-type{padding-left:10px}.tabulator-row .tabulator-cell{border-left:1px solid #aaa;box-sizing:border-box;display:inline-block;outline:none;overflow:hidden;padding:4px;position:relative;text-overflow:ellipsis;vertical-align:middle;white-space:nowrap}.tabulator-row .tabulator-cell .tabulator-tick{fill:#2dc214}.tabulator-row .tabulator-cell .tabulator-cross{fill:#ce1515}.tabulator-row .tabulator-cell.tabulator-row-header{background:#e6e6e6;border-bottom:1px solid #aaa;border-left:1px solid #999}.tabulator-row .tabulator-cell.tabulator-frozen{background-color:inherit;display:inline-block;right:0;position:sticky;z-index:11}.tabulator-row .tabulator-cell.tabulator-frozen.tabulator-frozen-left{border-left:2px solid #aaa}.tabulator-row .tabulator-cell.tabulator-frozen.tabulator-frozen-right{border-right:2px solid #aaa}.tabulator-row .tabulator-cell.tabulator-editing{border:1px solid #1d68cd;outline:none;padding:0}.tabulator-row .tabulator-cell.tabulator-editing input,.tabulator-row .tabulator-cell.tabulator-editing select{background:transparent;border:1px;outline:none}.tabulator-row .tabulator-cell.tabulator-validation-fail{border:1px solid #d00}.tabulator-row .tabulator-cell.tabulator-validation-fail input,.tabulator-row .tabulator-cell.tabulator-validation-fail select{background:transparent;border:1px;color:#d00}.tabulator-row .tabulator-cell.tabulator-row-handle{align-items:center;display:inline-flex;justify-content:center;-moz-user-select:none;-khtml-user-select:none;-webkit-user-select:none;-o-user-select:none}.tabulator-row .tabulator-cell.tabulator-row-handle .tabulator-row-handle-box{width:80%}.tabulator-row .tabulator-cell.tabulator-row-handle .tabulator-row-handle-box .tabulator-row-handle-bar{background:#666;height:3px;margin-top:2px;width:100%}.tabulator-row .tabulator-cell.tabulator-range-selected:not(.tabulator-range-only-cell-selected):not(.tabulator-range-row-header){background-color:#9abcea}.tabulator-row .tabulator-cell .tabulator-data-tree-branch-empty{display:inline-block;width:7px}.tabulator-row .tabulator-cell .tabulator-data-tree-branch{border-bottom:2px solid #aaa;border-bottom-right-radius:1px;border-right:2px solid #aaa;display:inline-block;height:9px;margin-left:5px;margin-top:-9px;vertical-align:middle;width:7px}.tabulator-row .tabulator-cell .tabulator-data-tree-control{align-items:center;background:rgba(0,0,0,.1);border:1px solid #333;border-radius:2px;display:inline-flex;height:11px;justify-content:center;margin-left:5px;overflow:hidden;vertical-align:middle;width:11px}@media (hover:hover) and (pointer:fine){.tabulator-row .tabulator-cell .tabulator-data-tree-control:hover{background:rgba(0,0,0,.2);cursor:pointer}}.tabulator-row .tabulator-cell .tabulator-data-tree-control .tabulator-data-tree-control-collapse{background:transparent;display:inline-block;height:7px;position:relative;width:1px}.tabulator-row .tabulator-cell .tabulator-data-tree-control .tabulator-data-tree-control-collapse:after{background:#333;content:"";height:1px;right:-3px;position:absolute;top:3px;width:7px}.tabulator-row .tabulator-cell .tabulator-data-tree-control .tabulator-data-tree-control-expand{background:#333;display:inline-block;height:7px;position:relative;width:1px}.tabulator-row .tabulator-cell .tabulator-data-tree-control .tabulator-data-tree-control-expand:after{background:#333;content:"";height:1px;right:-3px;position:absolute;top:3px;width:7px}.tabulator-row .tabulator-cell .tabulator-responsive-collapse-toggle{align-items:center;background:#666;border-radius:20px;color:#fff;display:inline-flex;font-size:1.1em;font-weight:700;height:15px;justify-content:center;-moz-user-select:none;-khtml-user-select:none;-webkit-user-select:none;-o-user-select:none;width:15px}@media (hover:hover) and (pointer:fine){.tabulator-row .tabulator-cell .tabulator-responsive-collapse-toggle:hover{cursor:pointer;opacity:.7}}.tabulator-row .tabulator-cell .tabulator-responsive-collapse-toggle.open .tabulator-responsive-collapse-toggle-close{display:initial}.tabulator-row .tabulator-cell .tabulator-responsive-collapse-toggle.open .tabulator-responsive-collapse-toggle-open{display:none}.tabulator-row .tabulator-cell .tabulator-responsive-collapse-toggle svg{stroke:#fff}.tabulator-row .tabulator-cell .tabulator-responsive-collapse-toggle .tabulator-responsive-collapse-toggle-close{display:none}.tabulator-row .tabulator-cell .tabulator-traffic-light{border-radius:14px;display:inline-block;height:14px;width:14px}.tabulator-row.tabulator-group{background:#ccc;border-bottom:1px solid #999;border-left:1px solid #aaa;border-top:1px solid #999;box-sizing:border-box;font-weight:700;min-width:100%;padding:5px 10px 5px 5px}@media (hover:hover) and (pointer:fine){.tabulator-row.tabulator-group:hover{background-color:rgba(0,0,0,.1);cursor:pointer}}.tabulator-row.tabulator-group.tabulator-group-visible .tabulator-arrow{border-bottom:0;border-right:6px solid transparent;border-left:6px solid transparent;border-top:6px solid #666;margin-left:10px}.tabulator-row.tabulator-group.tabulator-group-level-1{padding-right:30px}.tabulator-row.tabulator-group.tabulator-group-level-2{padding-right:50px}.tabulator-row.tabulator-group.tabulator-group-level-3{padding-right:70px}.tabulator-row.tabulator-group.tabulator-group-level-4{padding-right:90px}.tabulator-row.tabulator-group.tabulator-group-level-5{padding-right:110px}.tabulator-row.tabulator-group .tabulator-group-toggle{display:inline-block}.tabulator-row.tabulator-group .tabulator-arrow{border-bottom:6px solid transparent;border-right:6px solid #666;border-left:0;border-top:6px solid transparent;display:inline-block;height:0;margin-left:16px;vertical-align:middle;width:0}.tabulator-row.tabulator-group span{color:#d00;margin-right:10px}.tabulator-toggle{background:#dcdcdc;border:1px solid #ccc;box-sizing:border-box;display:flex;flex-direction:row}.tabulator-toggle.tabulator-toggle-on{background:#1c6cc2}.tabulator-toggle .tabulator-toggle-switch{background:#fff;border:1px solid #ccc;box-sizing:border-box}.tabulator-popup-container{-webkit-overflow-scrolling:touch;background:#fff;border:1px solid #aaa;box-shadow:0 0 5px 0 rgba(0,0,0,.2);box-sizing:border-box;display:inline-block;font-size:14px;overflow-y:auto;position:absolute;z-index:10000}.tabulator-popup{border-radius:3px;padding:5px}.tabulator-tooltip{border-radius:2px;box-shadow:none;font-size:12px;max-width:min(500px,100%);padding:3px 5px;pointer-events:none}.tabulator-menu .tabulator-menu-item{box-sizing:border-box;padding:5px 10px;position:relative;-webkit-user-select:none;user-select:none}.tabulator-menu .tabulator-menu-item.tabulator-menu-item-disabled{opacity:.5}@media (hover:hover) and (pointer:fine){.tabulator-menu .tabulator-menu-item:not(.tabulator-menu-item-disabled):hover{background:#efefef;cursor:pointer}}.tabulator-menu .tabulator-menu-item.tabulator-menu-item-submenu{padding-left:25px}.tabulator-menu .tabulator-menu-item.tabulator-menu-item-submenu:after{border-color:#aaa;border-style:solid;border-width:1px 0 0 1px;content:"";display:inline-block;height:7px;position:absolute;left:10px;top:calc(5px + .4em);transform:rotate(-45deg);vertical-align:top;width:7px}.tabulator-menu .tabulator-menu-separator{border-top:1px solid #aaa}.tabulator-edit-list{-webkit-overflow-scrolling:touch;font-size:14px;max-height:200px;overflow-y:auto}.tabulator-edit-list .tabulator-edit-list-item{color:#333;outline:none;padding:4px}.tabulator-edit-list .tabulator-edit-list-item.active{background:#1d68cd;color:#fff}.tabulator-edit-list .tabulator-edit-list-item.active.focused{outline:1px solid hsla(0,0%,100%,.5)}.tabulator-edit-list .tabulator-edit-list-item.focused{outline:1px solid #1d68cd}@media (hover:hover) and (pointer:fine){.tabulator-edit-list .tabulator-edit-list-item:hover{background:#1d68cd;color:#fff;cursor:pointer}}.tabulator-edit-list .tabulator-edit-list-placeholder{color:#333;padding:4px;text-align:center}.tabulator-edit-list .tabulator-edit-list-group{border-bottom:1px solid #aaa;color:#333;font-weight:700;padding:6px 4px 4px}.tabulator-edit-list .tabulator-edit-list-group.tabulator-edit-list-group-level-2,.tabulator-edit-list .tabulator-edit-list-item.tabulator-edit-list-group-level-2{padding-right:12px}.tabulator-edit-list .tabulator-edit-list-group.tabulator-edit-list-group-level-3,.tabulator-edit-list .tabulator-edit-list-item.tabulator-edit-list-group-level-3{padding-right:20px}.tabulator-edit-list .tabulator-edit-list-group.tabulator-edit-list-group-level-4,.tabulator-edit-list .tabulator-edit-list-item.tabulator-edit-list-group-level-4{padding-right:28px}.tabulator-edit-list .tabulator-edit-list-group.tabulator-edit-list-group-level-5,.tabulator-edit-list .tabulator-edit-list-item.tabulator-edit-list-group-level-5{padding-right:36px}.tabulator.tabulator-ltr{direction:rtl}.tabulator.tabulator-rtl{direction:ltr;text-align:initial}.tabulator.tabulator-rtl .tabulator-header .tabulator-col{border-right:1px solid #aaa;border-left:initial;text-align:initial}.tabulator.tabulator-rtl .tabulator-header .tabulator-col.tabulator-col-group .tabulator-col-group-cols{margin-right:-1px;margin-left:0}.tabulator.tabulator-rtl .tabulator-header .tabulator-col.tabulator-sortable .tabulator-col-title{padding-right:25px;padding-left:0}.tabulator.tabulator-rtl .tabulator-header .tabulator-col .tabulator-col-content .tabulator-col-sorter{right:8px;left:auto}.tabulator.tabulator-rtl .tabulator-tableholder .tabulator-range-overlay .tabulator-range.tabulator-range-active:after{background-color:#2975dd;border-radius:999px;bottom:-3px;content:"";height:6px;right:-3px;position:absolute;left:auto;width:6px}.tabulator.tabulator-rtl .tabulator-row .tabulator-cell{border-right:1px solid #aaa;border-left:initial}.tabulator.tabulator-rtl .tabulator-row .tabulator-cell .tabulator-data-tree-branch{border-bottom-right-radius:0;border-bottom-left-radius:1px;border-right:initial;border-left:2px solid #aaa;margin-right:5px;margin-left:0}.tabulator.tabulator-rtl .tabulator-row .tabulator-cell .tabulator-data-tree-control{margin-right:5px;margin-left:0}.tabulator.tabulator-rtl .tabulator-row .tabulator-cell.tabulator-frozen.tabulator-frozen-left{border-right:2px solid #aaa}.tabulator.tabulator-rtl .tabulator-row .tabulator-cell.tabulator-frozen.tabulator-frozen-right{border-left:2px solid #aaa}.tabulator.tabulator-rtl .tabulator-row .tabulator-col-resize-handle:last-of-type{margin-right:0;margin-left:-3px;width:3px}.tabulator.tabulator-rtl .tabulator-footer .tabulator-calcs-holder{text-align:initial}.tabulator-print-fullscreen{bottom:0;right:0;position:absolute;left:0;top:0;z-index:10000}body.tabulator-print-fullscreen-hide>:not(.tabulator-print-fullscreen){display:none!important}.tabulator-print-table{border-collapse:collapse}.tabulator-print-table .tabulator-data-tree-branch{border-bottom:2px solid #aaa;border-bottom-right-radius:1px;border-right:2px solid #aaa;display:inline-block;height:9px;margin-left:5px;margin-top:-9px;vertical-align:middle;width:7px}.tabulator-print-table .tabulator-print-table-group{background:#ccc;border-bottom:1px solid #999;border-left:1px solid #aaa;border-top:1px solid #999;box-sizing:border-box;font-weight:700;min-width:100%;padding:5px 10px 5px 5px}@media (hover:hover) and (pointer:fine){.tabulator-print-table .tabulator-print-table-group:hover{background-color:rgba(0,0,0,.1);cursor:pointer}}.tabulator-print-table .tabulator-print-table-group.tabulator-group-visible .tabulator-arrow{border-bottom:0;border-right:6px solid transparent;border-left:6px solid transparent;border-top:6px solid #666;margin-left:10px}.tabulator-print-table .tabulator-print-table-group.tabulator-group-level-1 td{padding-right:30px!important}.tabulator-print-table .tabulator-print-table-group.tabulator-group-level-2 td{padding-right:50px!important}.tabulator-print-table .tabulator-print-table-group.tabulator-group-level-3 td{padding-right:70px!important}.tabulator-print-table .tabulator-print-table-group.tabulator-group-level-4 td{padding-right:90px!important}.tabulator-print-table .tabulator-print-table-group.tabulator-group-level-5 td{padding-right:110px!important}.tabulator-print-table .tabulator-print-table-group .tabulator-group-toggle{display:inline-block}.tabulator-print-table .tabulator-print-table-group .tabulator-arrow{border-bottom:6px solid transparent;border-right:6px solid #666;border-left:0;border-top:6px solid transparent;display:inline-block;height:0;margin-left:16px;vertical-align:middle;width:0}.tabulator-print-table .tabulator-print-table-group span{color:#d00;margin-right:10px}.tabulator-print-table .tabulator-data-tree-control{align-items:center;background:rgba(0,0,0,.1);border:1px solid #333;border-radius:2px;display:inline-flex;height:11px;justify-content:center;margin-left:5px;overflow:hidden;vertical-align:middle;width:11px}@media (hover:hover) and (pointer:fine){.tabulator-print-table .tabulator-data-tree-control:hover{background:rgba(0,0,0,.2);cursor:pointer}}.tabulator-print-table .tabulator-data-tree-control .tabulator-data-tree-control-collapse{background:transparent;display:inline-block;height:7px;position:relative;width:1px}.tabulator-print-table .tabulator-data-tree-control .tabulator-data-tree-control-collapse:after{background:#333;content:"";height:1px;right:-3px;position:absolute;top:3px;width:7px}.tabulator-print-table .tabulator-data-tree-control .tabulator-data-tree-control-expand{background:#333;display:inline-block;height:7px;position:relative;width:1px}.tabulator-print-table .tabulator-data-tree-control .tabulator-data-tree-control-expand:after{background:#333;content:"";height:1px;right:-3px;position:absolute;top:3px;width:7px}
    22:root{--slr-black:#000;--slr-black-light:#0b172b;--slr-blue-10:#0b172b;--slr-blue-25:#153770;--slr-blue-40:#0062cc;--slr-blue-50:#007bff;--slr-blue-95:#e7f2fe;--slr-blue-97:#f0f7fe;--slr-blue:#507ff1;--slr-gray-30:#4d4d4d;--slr-gray-50:#767676;--slr-gray-60:#a1aab3;--slr-gray-85:#d7d7d7;--slr-gray-90:#ddd;--slr-gray-95:#efefef;--slr-bg-page:#edeef0;--slr-white:#fff;--slr-green:#50b142;--slr-orange:#ed922f;--slr-red:#da3737;--slr-purple:#673ab7;--slr-font-family:"Poppins",-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;--slr-radius-sm:8px;--slr-radius-md:10px;--slr-radius-lg:13px;--slr-shadow-panel:0 2px 15px 0 rgba(0,0,0,.14);--slr-green-bg:#e8f6ec;--slr-red-bg:#fbe4e4;--slr-gray-bg:#efefef;--slr-border-dashed:#d7d7d7;--slr-grid-line:#f3f4f6;--slr-gradient:linear-gradient(209.09deg,#4e78f4 1.64%,#4ef4b9 98.45%);--slr-teal:#4ef4b9;--slr-chart-orange:#ef7a35;--slr-chart-blue:#4e78f4;--slr-shadow-card:0 4px 24px 0 rgba(214,225,234,.95)}
    3 .wrap.slr-admin-wrap{background:transparent;color:var(--slr-black-light);font-family:var(--slr-font-family);margin:0;max-width:none;padding:0}body.slr-admin #wpcontent{padding-right:0}body.slr-admin #wpbody-content{padding-bottom:0}.slr-admin-wrap .components-notice{border-radius:var(--slr-radius-sm)}.slr-panel{background:var(--slr-white);border-radius:var(--slr-radius-lg);box-shadow:var(--slr-shadow-panel);margin-bottom:24px;padding:24px}.slr-panel__title{color:var(--slr-black-light);font-size:16px;font-weight:600;margin:0 0 16px}.slr-header{justify-content:space-between;margin-bottom:24px}.slr-header,.slr-header__brand{align-items:center;display:flex}.slr-header__brand{gap:12px}.slr-header__logo{background:linear-gradient(-209deg,#4e78f4 1.64%,#4ef4b9 98.45%);border-radius:var(--slr-radius-sm);height:36px;width:36px}.slr-header__title{color:var(--slr-black-light);font-size:24px;font-weight:700;margin:0}.slr-header__meta{color:var(--slr-gray-50);font-size:14px;margin:0}.slr-kpi-grid{display:grid;gap:16px;grid-template-columns:repeat(auto-fit,minmax(180px,1fr));margin-bottom:24px}.slr-kpi-card{background:var(--slr-white);border-radius:var(--slr-radius-lg);box-shadow:var(--slr-shadow-panel);padding:16px 20px}.slr-kpi-card__label{color:var(--slr-gray-50);font-size:13px;font-weight:500;margin:0 0 8px}.slr-status--connected{color:var(--slr-green);font-weight:600}.slr-status--disconnected{color:var(--slr-red);font-weight:600}.slr-domain-list{list-style:none;margin:0;padding:0}.slr-domain-list__item{align-items:center;border-bottom:1px solid var(--slr-gray-95);display:flex;justify-content:space-between;padding:12px 0}.slr-domain-list__item:last-child{border-bottom:none}.slr-domain-list__name{font-weight:500}.slr-domain-list__meta{color:var(--slr-gray-50);font-size:12px}.slr-empty-state{color:var(--slr-gray-50);padding:48px 24px;text-align:center}.slr-admin-wrap .components-button.is-primary{background:var(--slr-blue-50);border-color:var(--slr-blue-50);border-radius:var(--slr-radius-sm)}.slr-admin-wrap .components-button.is-primary:hover:not(:disabled){background:var(--slr-blue-40);border-color:var(--slr-blue-40)}.slr-admin-wrap .components-button.is-secondary{background:var(--slr-white);border:1px solid var(--slr-blue-50);border-radius:4px;color:var(--slr-blue-50)}.slr-admin-wrap .components-button.is-secondary:hover:not(:disabled){background:var(--slr-white);color:var(--slr-blue-50);opacity:.85}.slr-admin-wrap .components-select-control__input,.slr-admin-wrap .components-text-control__input{border-radius:var(--slr-radius-sm)}.slr-admin-wrap .dataviews-wrapper{border-radius:var(--slr-radius-sm);box-shadow:var(--slr-shadow-panel);overflow:hidden}.slr-app{padding:20px 24px 40px}.slr-app:has(.slr-dashboard),.slr-app:has(.slr-rank-tracker){padding:0}.slr-app--loading{align-items:center;display:flex;justify-content:center;min-height:240px}.slr-onboarding{margin:0 auto;max-width:560px;padding:24px 0 48px}.slr-create-project{max-width:620px}.slr-create-project__title{color:var(--slr-blue-10);font-size:22px;font-weight:600;line-height:1.3;margin:0 0 8px}.slr-create-project__lead{color:var(--slr-gray-50);font-size:14px;line-height:1.55;margin:0 0 28px}.slr-create-project__fields{display:flex;flex-direction:column;gap:20px}.slr-create-project .components-base-control__label,.slr-create-project .components-input-control__label,.slr-create-project__label{color:var(--slr-blue-10);display:block;font-size:13px;font-weight:500;letter-spacing:0;line-height:1.4;margin:0 0 6px;text-transform:none}.slr-create-project .components-base-control__help,.slr-create-project__hint{color:var(--slr-gray-50);font-size:12px;line-height:1.45;margin:6px 0 0}.slr-create-project .components-input-control__input,.slr-create-project .components-select-control__input,.slr-create-project .components-text-control__input{border-color:var(--slr-gray-90);border-radius:var(--slr-radius-sm);color:var(--slr-blue-10);min-height:40px}.slr-create-project__domain .components-text-control__input:disabled{background:var(--slr-blue-97);box-shadow:none;color:var(--slr-blue-10);opacity:1}.slr-create-project__tracking{border:0;margin:4px 0 0;min-width:0;padding:0}.slr-create-project__tracking .slr-create-project__hint{margin:0 0 12px}.slr-tracking-options{display:flex;flex-direction:column;gap:10px}.slr-tracking-option{align-items:center;background:var(--slr-white);border:1px solid var(--slr-gray-95);border-radius:var(--slr-radius-sm);box-shadow:none;color:inherit;cursor:pointer;display:flex;gap:16px;justify-content:space-between;margin:0;padding:14px 16px;text-align:right;width:100%}.slr-tracking-option:hover:not(:disabled){border-color:var(--slr-blue-50)}.slr-tracking-option:focus{outline:none}.slr-tracking-option:focus-visible{border-color:var(--slr-blue-50);box-shadow:0 0 0 2px var(--slr-blue-95)}.slr-tracking-option.is-selected{background:var(--slr-blue-97);border-color:var(--slr-blue-50)}.slr-tracking-option:disabled{cursor:default;opacity:.7}.slr-tracking-option__text{display:flex;flex-direction:column;gap:4px;min-width:0}.slr-tracking-option__title{color:var(--slr-blue-10);font-size:14px;font-weight:600;line-height:1.3}.slr-tracking-option__desc{color:var(--slr-gray-50);font-size:12px;font-weight:400;line-height:1.45}.slr-tracking-option__check{background:var(--slr-white);border:2px solid var(--slr-gray-85);border-radius:50%;box-shadow:inset 0 0 0 3px var(--slr-white);flex:0 0 auto;height:18px;width:18px}.slr-tracking-option.is-selected .slr-tracking-option__check{background:var(--slr-blue-50);border-color:var(--slr-blue-50)}.slr-create-project__actions{margin-top:8px}.slr-create-project__actions .components-button{font-weight:500;min-height:40px;padding:0 20px}.slr-onboarding__hero{margin-bottom:32px;text-align:center}.slr-onboarding__logo{height:48px;margin:0 auto 16px;width:48px}.slr-onboarding__title{color:var(--slr-black-light);font-size:28px;font-weight:700;margin:0}.slr-onboarding__panel{padding:32px}.slr-onboarding__panel>.components-notice{margin:0 0 24px}.slr-onboarding__lead{color:var(--slr-gray-50);font-size:15px;line-height:1.6;margin:0 0 24px}.slr-onboarding__question{color:var(--slr-black-light);font-size:16px;font-weight:600;margin:0 0 24px}.slr-onboarding__help{color:var(--slr-gray-50);font-size:14px;line-height:1.5;margin:0 0 12px}.slr-onboarding__help a{color:var(--slr-blue-50)}.slr-onboarding__actions{display:flex;flex-wrap:wrap;gap:12px;margin-top:24px}.slr-onboarding__divider{border:0;border-top:1px dashed var(--slr-gray-90);margin:28px 0}.slr-onboarding__loader{display:flex;justify-content:center;padding:24px 0}.slr-settings__actions{margin-top:16px}.slr-project-modal__lead{font-size:14px;line-height:1.5;margin:0 0 8px}.slr-project-modal__hint{color:var(--slr-gray-50);font-size:13px;margin:0 0 16px}.slr-project-modal__error{color:var(--slr-red);margin:12px 0 0}.slr-project-modal__actions{display:flex;justify-content:flex-end;margin-top:20px}.slr-project-summary{list-style:none;margin:0;padding:0}.slr-project-summary li{border-bottom:1px solid var(--slr-gray-95);display:flex;gap:12px;padding:8px 0}.slr-project-summary li:last-child{border-bottom:none}.slr-project-summary__label{color:var(--slr-gray-50);font-weight:600;min-width:100px}.slr-dashboard{max-width:none}.slr-dashboard__body{max-width:1600px;padding:20px 24px 40px}.slr-toolbar{align-items:center;background:var(--slr-white);border-bottom:1px solid var(--slr-gray-95);box-sizing:border-box;display:flex;gap:16px;height:60px;justify-content:space-between;margin:0;min-height:60px;padding:0 24px;width:100%}.slr-toolbar__left{align-items:center;display:flex;min-width:0}.slr-toolbar__keywords{align-items:center;color:var(--slr-black);column-gap:4px;display:flex;font-size:13px;font-weight:500;height:24px;line-height:19px;margin-right:20px;white-space:nowrap}.slr-toolbar__sync{align-items:center;column-gap:4px;display:inline-flex}.slr-toolbar__sync--ok{color:var(--slr-green)}.slr-toolbar__sync--warn{color:var(--slr-red)}.slr-toolbar__sync .dashicons{font-size:13px;height:13px;line-height:13px;margin-right:5px;width:13px}@media screen and (max-width:782px){.slr-toolbar{flex-wrap:wrap;height:auto;min-height:60px;padding:10px 16px}}.slr-project-selector{position:relative}.slr-project-selector__toggle{align-items:center;background:var(--slr-white);border:1px solid var(--slr-gray-90);border-radius:10px;color:var(--slr-black);column-gap:8px;cursor:pointer;display:flex;font-family:inherit;font-size:13px;font-weight:500;height:40px;line-height:24px;padding:8px 10px;text-align:right;width:280px}.slr-project-selector__toggle:disabled{cursor:default;opacity:1}.slr-project-selector__toggle:hover:not(:disabled),.slr-project-selector__toggle[aria-expanded=true]{border-color:var(--slr-gray-85)}.slr-project-selector__favicon{border:1px solid var(--slr-gray-90);border-radius:50%;flex-shrink:0;height:24px;object-fit:cover;width:24px}.slr-project-selector__item .slr-project-selector__favicon{height:20px;width:20px}.slr-project-selector__favicon--fallback{align-items:center;background:var(--slr-blue-95);color:var(--slr-blue-50);display:inline-flex;font-size:11px;font-weight:600;justify-content:center}.slr-project-selector__name{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.slr-project-selector__chevron{color:var(--slr-black-light);flex-shrink:0;font-size:14px;height:14px;width:14px}.slr-project-selector__menu{background:var(--slr-white);border:1px solid var(--slr-gray-95);border-radius:10px;box-shadow:var(--slr-shadow-panel);right:0;max-height:430px;overflow:auto;overflow-x:hidden;position:absolute;top:calc(100% + 6px);width:280px;z-index:20}.slr-project-selector__search{background:var(--slr-white);border-bottom:1px solid #eee;padding:10px;position:sticky;top:0;z-index:1}.slr-project-selector__search .dashicons{color:#999;font-size:14px;height:14px;right:20px;pointer-events:none;position:absolute;top:18px;width:14px}.slr-project-selector__search input{border:1px solid #dfe1e6;border-radius:6px;box-sizing:border-box;font-family:inherit;font-size:13px;height:32px;padding:0 30px 0 10px;width:100%}.slr-project-selector__search input:focus{border-color:var(--slr-blue-50);box-shadow:0 0 0 2px rgba(0,123,255,.1);outline:none}.slr-project-selector__list{list-style:none;margin:0;padding:6px 0 8px}.slr-project-selector__item{align-items:center;background:transparent;border:0;color:var(--slr-black-light);cursor:pointer;display:flex;font-family:inherit;font-size:12px;gap:8px;height:32px;padding:6px 10px;text-align:right;width:100%}.slr-project-selector__item:hover{background:var(--slr-blue-97)}.slr-project-selector__item.is-selected{color:var(--slr-blue-50);font-weight:500}.slr-project-selector__item-name{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.slr-project-selector__check{color:var(--slr-blue-50);flex-shrink:0;font-size:16px;height:16px;width:16px}.slr-project-selector__empty{color:var(--slr-gray-50);font-size:12px;padding:12px 10px}.slr-upgrade-button{align-items:center;background:linear-gradient(-209.09deg,#4e78f4 42.6%,#4ef4b9 98.45%);border:none;border-radius:4px;box-sizing:border-box;color:var(--slr-white)!important;column-gap:6px;cursor:pointer;display:inline-flex;font-family:inherit;font-size:13px;font-weight:500;height:40px;line-height:1;min-width:132px;padding:10px 24px;text-decoration:none!important;white-space:nowrap}.slr-upgrade-button:focus,.slr-upgrade-button:hover{color:var(--slr-white)!important;opacity:.9;text-decoration:none!important}.slr-upgrade-button:disabled{cursor:wait;opacity:.7}.slr-upgrade-button__icon{background:url(data:image/svg+xml;base64,PCEtLSBPcmlnaW5hbCBUcnVlUmFua2VyIHJvY2tldCBpY29uLiBMaWNlbnNlOiBHUEwtMi4wLW9yLWxhdGVyLiAtLT4KPHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIj4KCTxwYXRoIGZpbGw9IiNmZmYiIGZpbGwtcnVsZT0iZXZlbm9kZCIgZD0iTTEyIDJjLjUgMCAxIC4zIDEuMy43TDE2IDYuMlYxNWEyIDIgMCAwIDEtMiAyaC0uMmwxLjQgMy42YS43NS43NSAwIDEgMS0xLjQuNkwxMiAxNy44bC0xLjggMy42YS43NS43NSAwIDEgMS0xLjQtLjZMMTAuMiAxN0gxMGEyIDIgMCAwIDEtMi0yVjYuMkwxMC43IDIuN0MxMSAyLjMgMTEuNSAyIDEyIDJabTAgNS4yNWExLjUgMS41IDAgMSAwIDAgMyAxLjUgMS41IDAgMCAwIDAtM1oiLz4KCTxwYXRoIGZpbGw9IiNmZmYiIGQ9Ik04IDExLjUgNC4yIDE2LjJhLjYuNiAwIDAgMCAuNSAxbDMuMy0uOVYxMS41Wm04IDB2NC44bDMuMy45YS42LjYgMCAwIDAgLjUtMUwxNiAxMS41WiIvPgo8L3N2Zz4K) no-repeat 50%/contain;display:inline-block;flex-shrink:0;height:16px;width:16px}.slr-kpi-grid--dashboard{grid-template-columns:repeat(4,minmax(0,1fr))}@media (max-width:1200px){.slr-kpi-grid--dashboard{grid-template-columns:repeat(2,minmax(0,1fr))}}@media (max-width:640px){.slr-kpi-grid--dashboard{grid-template-columns:1fr}}.slr-kpi-card--rich{display:flex;flex-direction:column;justify-content:space-between;min-height:220px;padding:20px;position:relative}.slr-kpi-card--clickable{cursor:pointer}.slr-kpi-card--clickable:hover{box-shadow:var(--slr-shadow-card)}.slr-kpi-card__hit{appearance:none;background:transparent;border:0;border-radius:inherit;box-shadow:none;color:transparent;cursor:pointer;font-size:0;height:auto;inset:0;line-height:0;margin:0;min-height:0;min-width:0;padding:0;position:absolute;text-decoration:none;width:auto;z-index:1}.slr-kpi-card__hit:focus{box-shadow:none;outline:none}.slr-kpi-card__hit:focus-visible{outline:2px solid var(--slr-blue-50);outline-offset:2px}.slr-kpi-card__hit:disabled{cursor:wait}.slr-kpi-card__header{align-items:center;color:var(--slr-black-light);display:flex;font-size:13px;font-weight:500;gap:7px;padding:0}.slr-kpi-card__icon{color:var(--slr-blue-50);font-size:18px;height:18px;width:18px}.slr-kpi-card__main{flex:1;padding:12px 0 8px}.slr-kpi-card__footer{border-top:1px solid var(--slr-gray-95);margin-top:auto;padding-top:10px}.slr-kpi-card__value-row{align-items:baseline;display:flex;flex-wrap:wrap;gap:8px}.slr-kpi-card__value{color:var(--slr-black-light);font-size:26px;font-weight:700;line-height:30px;margin:0}.slr-kpi-card__metric-label{color:var(--slr-gray-60);font-size:12px;margin:4px 0 0}.slr-kpi-card__value-suffix{color:var(--slr-gray-50);font-size:16px;font-weight:500}.slr-kpi-card__value--good{color:var(--slr-green)}.slr-kpi-card__value--ok{color:var(--slr-blue-50)}.slr-kpi-card__value--warn{color:var(--slr-orange)}.slr-kpi-card__value--bad{color:var(--slr-red)}.slr-kpi-card__row{align-items:center;display:flex;font-size:12px;gap:8px;justify-content:space-between;padding:8px 0}.slr-kpi-card__row-label{color:var(--slr-gray-60);margin-left:5px}.slr-kpi-card__row-value{align-items:center;color:var(--slr-black-light);display:inline-flex;font-size:17px;font-weight:600;gap:6px}.slr-kpi-card__state{align-items:center;color:var(--slr-gray-60);display:flex;flex:1;flex-direction:column;font-size:13px;justify-content:center;padding:16px 0;text-align:center}.slr-kpi-card__state-title{color:var(--slr-black-light);font-size:15px;font-weight:600;margin:0 0 6px}.slr-kpi-card__state-desc{line-height:1.5;margin:0;max-width:260px}.slr-kpi-card__empty-icon,.slr-kpi-card__pulse{color:var(--slr-blue-50);font-size:32px;height:32px;margin-bottom:12px;width:32px}.slr-kpi-card__empty-icon{color:var(--slr-gray-60)}.slr-pulse{animation:slr-pulse-soft 2s ease-in-out infinite}@keyframes slr-pulse-soft{0%,to{opacity:.5;transform:scale(.95)}50%{opacity:1;transform:scale(1.05)}}.slr-trend{align-items:center;border-radius:12px;display:inline-flex;font-size:11px;font-weight:600;gap:2px;line-height:normal;padding:0 8px}.slr-kpi-card__value-row .slr-trend{font-size:13px}.slr-trend--up{color:var(--slr-green)}.slr-trend--down{color:var(--slr-red)}.slr-trend--solid.slr-trend--up{background-color:var(--slr-green);color:var(--slr-white)}.slr-trend--solid.slr-trend--down{background-color:var(--slr-red);color:var(--slr-white)}.slr-trend--issues{background:rgba(218,55,55,.1);font-weight:500}.slr-dash-section{margin-bottom:40px}.slr-dash-section+.slr-dash-section{margin-top:8px}.slr-dash-section__header{align-items:center;border-bottom:none;display:flex;margin:30px 0 15px;padding:0}.slr-dash-section__icon{align-items:center;background:var(--slr-blue-95);border-radius:var(--slr-radius-sm);color:var(--slr-blue-50);display:flex;flex-shrink:0;font-size:18px;height:36px;justify-content:center;width:36px}.slr-dash-section__title{color:var(--slr-black-light);font-size:20px;font-weight:600;margin:0 12px 0 0;white-space:nowrap}.slr-dash-section__line{background-color:var(--slr-gray-60);flex-grow:1;height:1px;margin-right:20px}.slr-dash-grid{align-items:stretch;display:grid;gap:16px;grid-template-columns:2fr 1fr}.slr-dash-grid--backlinks{grid-template-columns:1fr 2fr}@media (max-width:960px){.slr-dash-grid,.slr-dash-grid--backlinks{grid-template-columns:1fr}}.slr-dash-panel{display:flex;flex-direction:column;margin-bottom:0;min-height:0;padding:20px}.slr-dash-grid .slr-panel.slr-dash-panel{margin-bottom:0}.slr-dash-panel__title{flex-shrink:0;font-size:14px;font-weight:600;margin:0 0 4px}.slr-dash-panel__subtitle{color:var(--slr-gray-50);flex-shrink:0;font-size:12px;line-height:1.4;margin:0 0 16px}.slr-dash-panel__content{flex:1;min-height:220px}.slr-chart{height:260px;max-height:260px;overflow:hidden;position:relative}.slr-chart--donut-sm{height:120px;margin:0 auto;max-width:140px}.slr-chart-empty{align-items:center;border:2px dashed var(--slr-border-dashed);border-radius:12px;color:var(--slr-gray-50);display:flex;justify-content:center;min-height:250px;overflow:hidden;position:relative;text-align:center}.slr-chart-empty__grid{background-image:linear-gradient(to left,var(--slr-grid-line) 1px,transparent 1px),linear-gradient(to bottom,var(--slr-grid-line) 1px,transparent 1px);background-size:40px 40px;inset:0;position:absolute;z-index:1}.slr-chart-empty__content{padding:20px;position:relative;z-index:2}.slr-chart-empty__icon{color:var(--slr-blue-50);font-size:40px;height:40px;margin-bottom:15px;width:40px}.slr-chart-empty:not(.slr-chart-empty--waiting) .slr-chart-empty__icon{color:var(--slr-gray-60);font-size:32px;height:32px;width:32px}.slr-chart-empty__title{color:#1f2937;font-size:18px;font-weight:600;margin:0 0 8px}.slr-chart-empty__desc{color:#6b7280;font-size:14px;line-height:1.5;margin:0;max-width:300px}.slr-ai-score__header{align-items:baseline;display:flex;gap:10px;margin-bottom:16px}.slr-ai-score__value{color:var(--slr-blue-50);font-size:36px;font-weight:700;line-height:1}.slr-ai-score__delta{align-items:center;border-radius:2px;display:inline-flex;font-size:12px;font-weight:500;padding:3px 10px}.slr-ai-score__delta--up{background:var(--slr-green-bg);color:var(--slr-green)}.slr-ai-score__delta--down{background:var(--slr-red-bg);color:var(--slr-red)}.slr-ai-score__delta--flat{background:var(--slr-gray-bg);color:var(--slr-gray-30)}.slr-ai-score__breakdown{list-style:none;margin:0;padding:0}.slr-ai-score__row{align-items:center;border-top:1px dashed var(--slr-gray-95);display:flex;gap:10px;justify-content:space-between;padding:8px 0}.slr-ai-score__row:first-child{border-top:none;padding-top:0}.slr-ai-score__row-main{flex:1;min-width:0}.slr-ai-score__row-head{align-items:center;color:var(--slr-gray-50);display:flex;flex-wrap:wrap;font-size:12px;gap:6px}.slr-ai-score__row-weight{color:var(--slr-gray-60)}.slr-ai-score__bar{background:var(--slr-gray-95);border-radius:3px;height:6px;margin-top:4px;overflow:hidden;width:100%}.slr-ai-score__bar-fill{background:var(--slr-blue-50);border-radius:3px;height:100%}.slr-ai-score__row-value{color:var(--slr-gray-50);flex-shrink:0;font-size:13px;font-weight:500;min-width:28px;text-align:left}.slr-bl-dr{align-items:center;display:flex;flex-direction:column;gap:12px}.slr-bl-dr__score{align-items:baseline;display:flex;gap:8px}.slr-bl-dr__value{color:var(--slr-black-light);font-size:32px;font-weight:700}.slr-bl-metrics{display:flex;flex-wrap:wrap;gap:12px 24px;list-style:none;margin:0 0 16px;padding:0}.slr-bl-metrics__item{display:flex;flex-direction:column;gap:2px;min-width:120px}.slr-bl-metrics__label{color:var(--slr-gray-50);font-size:11px;letter-spacing:.02em;text-transform:uppercase}.slr-bl-metrics__value{align-items:center;color:var(--slr-black-light);display:inline-flex;font-size:16px;font-weight:700;gap:6px}.slr-chart--area{height:180px}.slr-skeleton{animation:slr-shimmer 1.4s ease infinite;background:linear-gradient(-90deg,var(--slr-gray-95) 25%,var(--slr-gray-90) 50%,var(--slr-gray-95) 75%);background-size:200% 100%;border-radius:6px}@keyframes slr-shimmer{0%{background-position:-100% 0}to{background-position:300% 0}}.slr-skeleton--avatar{border-radius:50%;flex-shrink:0;height:24px;width:24px}.slr-skeleton--title{height:20px;width:200px}.slr-skeleton--line{height:12px;margin-bottom:10px}.slr-skeleton--sm{width:40%}.slr-skeleton--md{width:65%}.slr-skeleton--lg{height:28px;width:50%}.slr-skeleton--chart{border-radius:var(--slr-radius-sm);height:220px;margin-top:12px;width:100%}.slr-skeleton--chart-sm{height:160px}.slr-toolbar--skeleton{margin-bottom:0}.slr-skeleton--selector{border-radius:10px;height:40px;width:280px}.slr-skeleton--upgrade{border-radius:4px;height:40px;width:132px}.slr-dash-panel--skeleton,.slr-kpi-card--skeleton{pointer-events:none}.slr-kpi-card--skeleton{gap:12px;justify-content:flex-start}.slr-rank-tracker{max-width:none}.slr-rank-tracker__body{max-width:1600px;padding:20px 24px 40px}.slr-rt-filters{margin-bottom:20px;overflow:visible;padding:16px 20px;position:relative;z-index:5}.slr-rt-filters__left,.slr-rt-filters__row{align-items:center;column-gap:10px;display:flex}.slr-rt-filters__left{flex-wrap:wrap}.slr-rt-filters__right{margin-right:auto}.slr-rt-filters__hidden{display:none!important}.slr-rt-filter-input,.slr-rt-filter-select{background:var(--slr-white);border:1px solid var(--slr-gray-90);border-radius:var(--slr-radius-sm);color:var(--slr-blue-10);font-family:inherit;font-size:13px;height:38px;padding:8px 10px}.slr-rt-daterange{position:relative}.slr-rt-daterange__trigger{align-items:center;background:var(--slr-white);border:1px solid var(--slr-gray-90);border-radius:var(--slr-radius-sm);color:var(--slr-blue-10);column-gap:6px;cursor:pointer;display:inline-flex;font-family:inherit;font-size:13px;font-weight:400;height:38px;line-height:20px;padding:8px 10px;white-space:nowrap}.slr-rt-daterange__trigger .dashicons{color:var(--slr-blue-50);font-size:16px;height:16px;width:16px}.slr-rt-daterange__popover{background:var(--slr-white);border:1px solid var(--slr-gray-90);border-radius:var(--slr-radius-md);box-shadow:var(--slr-shadow-panel);min-width:640px;padding:12px 16px 16px;position:absolute;left:0;top:calc(100% + 8px);z-index:30}.slr-rt-daterange__close{background:transparent;border:none;color:var(--slr-gray-50);cursor:pointer;font-family:inherit;font-size:12px;position:absolute;left:10px;top:8px}.slr-rt-daterange__body{column-gap:12px;display:flex;padding-top:12px}.slr-rt-daterange__presets{border-left:1px solid var(--slr-gray-95);list-style:none;margin:0;min-width:130px;padding:0 0 0 8px}.slr-rt-daterange__preset{background:transparent;border:none;border-radius:4px;color:var(--slr-blue-10);cursor:pointer;display:block;font-family:inherit;font-size:13px;font-weight:500;padding:8px 10px;text-align:right;width:100%}.slr-rt-daterange__preset.is-active,.slr-rt-daterange__preset:hover{background:var(--slr-blue-50);color:var(--slr-white)}.slr-rt-daterange__save{color:var(--slr-gray-50);font-size:12px;margin-top:12px;padding:8px 10px 0}.slr-rt-daterange__save label{align-items:center;cursor:pointer;display:flex;gap:6px}.slr-rt-daterange__calendars{column-gap:16px;display:flex}.slr-rt-cal{width:230px}.slr-rt-cal__nav{align-items:center;display:flex;justify-content:space-between;margin-bottom:8px}.slr-rt-cal__caption{column-gap:4px;display:flex}.slr-rt-cal__caption select{background:var(--slr-white);border:1px solid var(--slr-gray-90);border-radius:4px;font-family:inherit;font-size:12px;height:26px;padding:0 8px}.slr-rt-cal__nav-btn{background:transparent;border:none;color:var(--slr-blue-10);cursor:pointer;height:24px;padding:0;width:24px}.slr-rt-cal__grid{display:grid;gap:2px;grid-template-columns:repeat(7,1fr)}.slr-rt-cal__weekday{color:var(--slr-gray-50);font-size:11px;padding:4px 0;text-align:center}.slr-rt-cal__day{background:transparent;border:none;border-radius:4px;color:var(--slr-blue-10);cursor:pointer;font-family:inherit;font-size:12px;height:28px}.slr-rt-cal__day.is-empty{cursor:default}.slr-rt-cal__day.is-disabled{color:var(--slr-gray-85);cursor:default}.slr-rt-cal__day.is-in-range{background:rgba(53,136,230,.15)}.slr-rt-cal__day.is-edge,.slr-rt-cal__day.is-edge.is-in-range{background:var(--slr-blue-50);color:var(--slr-white)}.slr-rt-cal__day:not(.is-disabled):not(.is-empty):hover{background:var(--slr-blue-95)}.slr-skeleton--daterange{border-radius:var(--slr-radius-sm);height:38px;margin-right:auto;width:220px}.slr-rt-summary{align-items:stretch;column-gap:18px;display:grid;grid-template-columns:minmax(0,1fr) minmax(0,2fr) minmax(0,1fr);margin-bottom:20px}.slr-rt-summary__card{box-sizing:border-box;margin-bottom:0;min-height:210px;min-width:0;padding:16px 18px 12px}.slr-rt-summary__title{color:var(--slr-blue-10);font-size:13px;font-weight:500;line-height:20px;margin:0 0 12px}.slr-rt-summary__value-row{align-items:center;column-gap:10px;display:flex;margin-bottom:8px}.slr-rt-summary__value{color:var(--slr-blue-10);font-size:26px;font-weight:700;line-height:1.2}.slr-rt-summary__empty{color:var(--slr-gray-50);font-size:13px;line-height:20px;margin:0}.slr-rt-avg-chart{height:120px;min-width:0}.slr-rt-donut{flex-shrink:0;height:140px;max-width:100%;width:140px}.slr-rt-spark{height:28px;min-width:60px}.slr-rt-dist-row__lost,.slr-rt-dist-row__new,.slr-rt-dist-row__num{text-align:center}.slr-rt-dist-row__new{color:var(--slr-green)}.slr-rt-dist-row__lost{color:var(--slr-red)}.slr-rt-aio-meta,.slr-rt-aio-stat{color:var(--slr-gray-30);font-size:12px;font-weight:500;line-height:18px;margin:0}.slr-rt-aio-stat{align-items:center;column-gap:8px;display:flex;margin-top:8px}.slr-rt-aio-progress{background:var(--slr-gray-95);border-radius:6px;height:11px;margin:10px 0;overflow:hidden}.slr-rt-aio-progress__bar{background:var(--slr-green);border-radius:6px;height:100%;min-width:0}.slr-rt-summary__distribution-body{align-items:center;column-gap:16px;display:flex;min-width:0}.slr-rt-summary__rows{flex:1}.slr-rt-dist-table{display:flex;flex:1;flex-direction:column;gap:8px;min-width:0}.slr-rt-dist-row{align-items:center;color:var(--slr-blue-10);column-gap:8px;display:grid;font-size:13px;grid-template-columns:minmax(90px,1.2fr) .6fr .5fr .5fr minmax(60px,1fr);line-height:20px}.slr-rt-dist-row--head{color:var(--slr-gray-50);font-size:13px;font-weight:500;text-align:center}.slr-rt-dist-row--head span:first-child{text-align:right}.slr-rt-dist-row__label{align-items:center;display:inline-flex;gap:6px;white-space:nowrap}.slr-rt-dist-row__dot{border-radius:50%;flex-shrink:0;height:10px;width:10px}.slr-skeleton--donut{border-radius:50%;flex-shrink:0;height:96px;width:96px}.slr-skeleton--bar{border-radius:6px;height:11px;margin:10px 0;width:100%}.slr-skeleton--button{border-radius:var(--slr-radius-sm);height:40px;margin-bottom:16px;width:160px}.slr-skeleton--search{width:240px}.slr-skeleton--search,.slr-skeleton--select{border-radius:var(--slr-radius-sm);height:36px}.slr-skeleton--select{width:160px}.slr-skeleton--cell{height:12px;margin:0 auto;width:28px}.slr-skeleton--spark{height:18px;margin:0;width:100%}.slr-rt-actions{margin-bottom:16px}.slr-rt-add-keywords.components-button{font-size:14px;font-weight:500;height:40px;padding:0 18px}.slr-rt-table-panel{background:var(--slr-white);border:1px solid var(--slr-gray-90);border-radius:var(--slr-radius-md);box-shadow:var(--slr-shadow-panel);overflow:hidden;padding:0}.slr-rt-table-toolbar{background:#fbfcfe;border-bottom:1px solid var(--slr-gray-95);justify-content:flex-end;padding:10px 12px}.slr-rt-table-toolbar,.slr-rt-table-toolbar__left{align-items:center;display:flex;flex-wrap:wrap;gap:10px}.slr-rt-table-toolbar__left{margin-left:auto}.slr-rt-table-toolbar__search{background:var(--slr-white);border:1px solid var(--slr-gray-90);border-radius:var(--slr-radius-sm);box-sizing:border-box;color:var(--slr-gray-30);font-family:var(--slr-font-family);font-size:13px;height:40px;max-width:280px;min-width:200px;padding:0 10px}.slr-rt-table-toolbar__search:focus{border-color:var(--slr-blue-50);box-shadow:0 0 0 2px rgba(0,123,255,.12);outline:none}.slr-rt-table-toolbar__search::placeholder{color:var(--slr-gray-60)}.slr-rt-table{background:var(--slr-white);padding:0 0 4px;width:100%}.slr-rt-table .tabulator{background:transparent;border:none;color:var(--slr-gray-30);font-family:var(--slr-font-family);font-size:13px;font-weight:400;width:100%}.slr-rt-table .tabulator[tabulator-layout=fitColumns] .tabulator-tableholder .tabulator-table{min-width:100%}.slr-rt-table .tabulator-tableholder{scrollbar-gutter:stable}.slr-rt-table .tabulator .tabulator-header{background:var(--slr-blue-95);border-bottom:1px solid var(--slr-gray-90);font-weight:500}.slr-rt-table .tabulator .tabulator-header .tabulator-col{background:var(--slr-blue-95);border-left:1px solid var(--slr-gray-95);box-sizing:border-box;justify-content:flex-start;min-height:55px}.slr-rt-table .tabulator .tabulator-header .tabulator-col.tabulator-sortable.tabulator-col-sorter-element:hover,.slr-rt-table .tabulator .tabulator-header .tabulator-col:hover{background:#d0e6fc!important;background-color:#d0e6fc!important}.slr-rt-table .tabulator .tabulator-header .tabulator-col .tabulator-col-content{align-items:center;box-sizing:border-box;display:flex;height:100%;justify-content:flex-start;min-height:55px;padding-bottom:10px;padding-top:10px;width:100%}.slr-rt-table .tabulator .tabulator-header .tabulator-col .tabulator-col-title-holder{align-items:center;display:flex;min-height:28px;width:100%}.slr-rt-table .tabulator .tabulator-header .tabulator-col.text-center .tabulator-col-content,.slr-rt-table .tabulator .tabulator-header .tabulator-col[style*="text-align: center"] .tabulator-col-content,.slr-rt-table .tabulator .tabulator-header .tabulator-col[style*="text-align:center"] .tabulator-col-content{justify-content:center}.slr-rt-table .tabulator .tabulator-header .tabulator-col.text-left .tabulator-col-content,.slr-rt-table .tabulator .tabulator-header .tabulator-col[style*="text-align: left"] .tabulator-col-content,.slr-rt-table .tabulator .tabulator-header .tabulator-col[style*="text-align:left"] .tabulator-col-content{justify-content:flex-start}.slr-rt-table .tabulator .tabulator-header .tabulator-col .tabulator-col-title{color:var(--slr-gray-30);font-size:13px;font-weight:500;line-height:28px;white-space:nowrap}.slr-rt-table .tabulator-row{background:var(--slr-white);border-bottom:1px solid var(--slr-gray-95);min-height:55px!important}.slr-rt-table .tabulator-row.tabulator-row-even{background:var(--slr-white)}.slr-rt-table .tabulator-row:hover{background:var(--slr-blue-97)!important}.slr-rt-table .tabulator-row .tabulator-cell{border-left:1px solid var(--slr-gray-95);box-sizing:border-box;color:var(--slr-gray-30);font-size:13px!important;font-weight:400;line-height:20px;overflow:hidden;padding:12px 10px!important;text-overflow:ellipsis;vertical-align:middle;white-space:nowrap}.slr-rt-table .tabulator-row .tabulator-cell.text-center{text-align:center}.slr-rt-table .tabulator-row .tabulator-cell.text-left{text-align:right}.slr-rt-table .tabulator-placeholder-contents{color:var(--slr-gray-50);font-size:13px;padding:48px 16px;text-align:center}.slr-rt-table .tabulator .tabulator-footer{background:var(--slr-white);border-top:1px solid var(--slr-gray-90);color:var(--slr-gray-50);font-family:var(--slr-font-family);font-weight:400;white-space:normal}.slr-rt-table .tabulator .tabulator-footer .tabulator-footer-contents{align-items:center;box-sizing:border-box;display:flex;flex-wrap:wrap;gap:12px 20px;justify-content:space-between;min-height:72px;padding:16px 20px!important}.slr-rt-table .tabulator .tabulator-footer .tabulator-page-counter{color:var(--slr-gray-50);flex:0 0 auto;font-size:12px;font-weight:500;line-height:18px;margin:0!important;order:1}.slr-rt-table .tabulator .tabulator-footer .tabulator-paginator{align-items:center;color:var(--slr-gray-50);display:flex;flex:1 1 auto;flex-wrap:wrap;font-family:inherit;font-size:13px;font-weight:500;gap:6px;justify-content:flex-end;margin:0;order:2;text-align:left}.slr-rt-table .tabulator .tabulator-footer .tabulator-paginator label{color:var(--slr-gray-50);font-size:12px;font-weight:400;margin:0 0 0 4px}.slr-rt-table .tabulator .tabulator-footer .tabulator-page-size,.slr-rt-table .tabulator .tabulator-footer select.tabulator-page-size{appearance:none;background-color:var(--slr-white);background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 width=%2710%27 height=%276%27%3E%3Cpath fill=%27%23767676%27 d=%27m1 1 4 4 4-4%27/%3E%3C/svg%3E");background-position:left 12px center;background-repeat:no-repeat;border:1px solid var(--slr-gray-90)!important;border-radius:10px!important;box-shadow:none;color:var(--slr-gray-50);cursor:pointer;display:inline-block;font-family:var(--slr-font-family);font-size:13px!important;font-weight:400!important;height:40px;line-height:18px!important;margin:0 0 0 12px!important;min-width:72px;outline:none;padding:0 12px 0 32px!important;vertical-align:middle}.slr-rt-table .tabulator .tabulator-footer .tabulator-page-size:focus,.slr-rt-table .tabulator .tabulator-footer .tabulator-page-size:hover{border-color:var(--slr-blue-50)!important}.slr-rt-table .tabulator .tabulator-footer .tabulator-pages{align-items:center;display:inline-flex;gap:4px;margin:0 4px!important;vertical-align:middle}.slr-rt-table .tabulator .tabulator-footer .tabulator-page{align-items:center;background:var(--slr-white)!important;border:1px solid var(--slr-gray-90)!important;border-radius:10px!important;box-shadow:none;color:var(--slr-gray-50)!important;cursor:pointer;display:inline-flex!important;font-family:var(--slr-font-family);font-size:13px;font-weight:500;height:36px;justify-content:center;line-height:1;margin:0 2px!important;min-width:36px;padding:0 12px!important;transition:background-color .15s ease,color .15s ease,border-color .15s ease;vertical-align:middle}.slr-rt-table .tabulator .tabulator-footer .tabulator-page:not(:disabled):hover{background:var(--slr-blue-97)!important;border-color:var(--slr-blue-50)!important;color:var(--slr-blue-50)!important}.slr-rt-table .tabulator .tabulator-footer .tabulator-page.active{background:var(--slr-blue-50)!important;border-color:var(--slr-blue-50)!important;color:var(--slr-white)!important}.slr-rt-table .tabulator .tabulator-footer .tabulator-page.disabled,.slr-rt-table .tabulator .tabulator-footer .tabulator-page:disabled{background:var(--slr-white)!important;color:var(--slr-gray-50)!important;cursor:default;opacity:.35}.slr-rt-table .tabulator-cell.slr-rt-col--keyword{overflow:hidden;white-space:nowrap}.slr-rt-keyword{align-items:center;color:var(--slr-blue-50);display:inline-flex;font-weight:500;gap:4px;max-width:100%;min-width:0;vertical-align:middle}.slr-rt-keyword__text{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.slr-rt-keyword__icon{color:var(--slr-red);flex-shrink:0;font-size:16px;height:16px;width:16px}.slr-rt-keyword__icon--target{color:var(--slr-blue)}.slr-rt-location{align-items:center;display:inline-flex;gap:6px;white-space:nowrap}.slr-rt-flag{font-size:14px;line-height:1}.slr-rt-device{font-size:18px;height:18px;width:18px}.slr-rt-device--desktop{color:var(--slr-orange)}.slr-rt-device--mobile{color:var(--slr-blue-50)}.slr-rt-rank{align-items:center;display:inline-flex;font-weight:700;gap:4px;justify-content:center}.slr-rt-rank__new{color:#e91e8c;font-size:9px;font-weight:700}.slr-rt-change{align-items:center;border-radius:4px;display:inline-flex;font-size:10px;font-weight:500;gap:2px;line-height:15px;padding:1px 5px}.slr-rt-change--up{background:var(--slr-green);color:var(--slr-white)}.slr-rt-change--down{background:var(--slr-red);color:var(--slr-white)}.slr-rt-change--up-text{background:transparent;color:var(--slr-green);padding:0}.slr-rt-change--down-text{background:transparent;color:var(--slr-red);padding:0}.slr-rt-change--empty,.slr-rt-change--zero{background:transparent;color:var(--slr-gray-60);padding:0}.slr-rt-dates{align-items:center;display:inline-flex;gap:4px}.slr-rt-dates--stack{flex-wrap:wrap;justify-content:center}.slr-rt-table .tabulator-cell[tabulator-field=ai_overview],.slr-rt-table .tabulator-cell[tabulator-field=snippets],.slr-rt-table .tabulator-cell[tabulator-field=tags]{overflow:hidden;white-space:normal}.slr-rt-aio{align-items:flex-start;color:var(--slr-gray-30);display:inline-flex;flex-direction:column;font-size:10px;font-weight:400;gap:2px;line-height:15px}.slr-rt-aio__presence{color:var(--slr-green)}.slr-rt-aio__links,.slr-rt-aio__presence{align-items:center;display:inline-flex;gap:2px}.slr-rt-aio .dashicons{font-size:15px;height:15px;width:15px}.slr-rt-aio__brand{background:rgba(80,177,66,.21);border-radius:4px;color:var(--slr-green);font-weight:400;padding:1px 3px}.slr-rt-url{display:block;max-width:100%;min-width:0;overflow:hidden;text-align:right;text-overflow:ellipsis;white-space:nowrap}.slr-rt-url a{color:var(--slr-blue-50);text-decoration:none}.slr-rt-tags{align-items:center;display:flex;flex-wrap:wrap;gap:2px;justify-content:flex-start;max-width:100%;min-width:0}.slr-rt-tag{border-radius:10px;color:var(--slr-blue-10);display:inline-block;font-size:11px;line-height:18px;max-width:100%;overflow:hidden;padding:1px 8px;text-overflow:ellipsis;white-space:nowrap}.slr-rt-local,.slr-rt-snippets{align-items:center;display:inline-flex;gap:4px}.slr-rt-snippet{font-size:16px;height:16px;width:16px}.slr-rt-snippet--muted{color:var(--slr-gray-60)}.slr-rt-snippet--user{color:var(--slr-blue-50)}.slr-rt-snippet--competitor{color:#edc92f}.slr-rt-cell-icon{font-size:16px;height:16px;width:16px}.slr-rt-cell-icon--muted{color:var(--slr-gray-60)}.slr-rt-cell-icon--danger{color:var(--slr-red)}.slr-rt-cell-icon--warn{color:#e91e8c}.slr-rt-local-link{color:inherit;text-decoration:none}.slr-rt-local-pos{font-weight:600}@media screen and (max-width:768px){.slr-rt-table-toolbar{justify-content:stretch}.slr-rt-table-toolbar__left,.slr-rt-table-toolbar__search{max-width:none;width:100%}.slr-rt-table .tabulator .tabulator-footer .tabulator-footer-contents{justify-content:center;min-height:0;padding:14px 12px!important}.slr-rt-table .tabulator .tabulator-footer .tabulator-page-counter,.slr-rt-table .tabulator .tabulator-footer .tabulator-paginator{flex:0 0 100%;justify-content:center;text-align:center}}@media screen and (max-width:1100px){.slr-rt-table-toolbar{flex-wrap:wrap}}.slr-rt-table .tabulator-row.slr-rt-row--clickable{cursor:pointer}.slr-rt-table .tabulator-row.slr-rt-row--active{background:var(--slr-blue-97)!important}.slr-kw-stats-modal.components-modal__frame{display:flex;flex-direction:column;max-height:94vh;max-width:94vw;width:min(1280px,94vw)}.slr-kw-stats-modal .components-modal__header{background:var(--slr-white);border-bottom:none;height:auto;justify-content:flex-end;min-height:44px;padding:12px 20px 0;position:relative!important;top:auto}.slr-kw-stats-modal .components-modal__header-heading{display:none}.slr-kw-stats-modal .components-modal__content{display:flex;flex-direction:column;margin-top:0!important;overflow:auto;padding:4px 32px 24px!important}.slr-kw-stats{min-height:360px;position:relative}.slr-kw-stats .slr-panel{margin-bottom:0;padding:16px 20px}.slr-kw-stats__heading{align-items:baseline;column-gap:8px;display:flex;font-size:18px;font-weight:600;line-height:1.3;margin:0 0 12px;padding:0}.slr-kw-stats__heading-label{color:var(--slr-gray-50);font-weight:500}.slr-kw-stats__heading-value{color:var(--slr-blue-10);font-weight:600}.slr-kw-stats__top{align-items:center;display:flex;flex-wrap:wrap;gap:16px;justify-content:space-between;margin:0 0 20px}.slr-kw-stats__attrs,.slr-kw-stats__target{align-items:center;background:var(--slr-white);border:1px solid var(--slr-gray-90);border-radius:4px;color:var(--slr-blue-10);display:flex;font-size:13px;line-height:1.3;padding:12px 20px}.slr-kw-stats__attrs{column-gap:20px}.slr-kw-stats__attr{align-items:center;column-gap:8px;display:inline-flex;white-space:nowrap}.slr-kw-stats__attr .dashicons{font-size:18px;height:18px;width:18px}.slr-kw-stats__attr--rank{font-weight:500}.slr-kw-stats__attr--rank strong{font-weight:600}.slr-kw-stats__target{column-gap:8px;max-width:42%}.slr-kw-stats__target-label{font-weight:500;white-space:nowrap}.slr-kw-stats__target-url{color:var(--slr-gray-50);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.slr-kw-stats__body{align-items:stretch;column-gap:12px;display:flex}.slr-kw-stats__body.is-loading{opacity:0;pointer-events:none}.slr-kw-stats__left{min-width:0;width:70%}.slr-kw-stats__right{display:flex;flex-direction:column;gap:12px;min-width:0;width:30%}.slr-kw-stats .slr-kw-stats-chart{height:280px;margin:8px 0 28px;overflow:hidden;position:relative}.slr-kw-stats-chart__canvas{height:248px;overflow:hidden}.slr-kw-stats-top10__title{align-items:center;color:var(--slr-blue-10);display:flex;flex-wrap:wrap;font-size:13px;font-weight:500;gap:8px;margin:8px 0 16px}.slr-kw-stats-top10__serp{align-items:center;color:var(--slr-blue-50);display:inline-flex;font-weight:500;gap:4px;text-decoration:none}.slr-kw-stats-top10__serp:hover{color:var(--slr-blue-50)}.slr-kw-stats-top10__serp .dashicons{font-size:16px;height:16px;width:16px}.slr-kw-stats-top10__panel{background:var(--slr-blue-95);border-radius:13px;height:280px;overflow:auto}.slr-kw-stats-modal .slr-kw-stats-top10__table{background:var(--slr-white);border-collapse:collapse;border-spacing:0;margin:0;width:100%}.slr-kw-stats-top10__table thead{background:var(--slr-blue-95);position:sticky;top:0;z-index:1}.slr-kw-stats-top10__table td,.slr-kw-stats-top10__table th{font-size:13px;font-weight:500;line-height:22px;padding:8px 12px;text-align:right;vertical-align:middle}.slr-kw-stats-top10__table th{background:var(--slr-blue-95);color:var(--slr-gray-30)}.slr-kw-stats-top10__table td{border-top:1px solid var(--slr-gray-95);color:var(--slr-blue-50)}.slr-kw-stats-top10__pos{text-align:center!important;width:88px}.slr-kw-stats-top10__row--strong td{font-weight:700}.slr-kw-stats-top10__link{color:var(--slr-blue-50);display:inline-block;max-width:100%;overflow:hidden;text-decoration:none;text-overflow:ellipsis;vertical-align:middle;white-space:nowrap}.slr-kw-stats-top10__link:hover{color:var(--slr-blue-50)}.slr-kw-stats-top10__link--mine{color:var(--slr-chart-orange)}.slr-kw-stats-top10__icon{font-size:16px;height:16px;margin-right:6px;vertical-align:middle;width:16px}.slr-kw-stats-top10__icon--target{color:var(--slr-blue)}.slr-kw-stats-top10__icon--cann{color:var(--slr-red)}.slr-kw-stats-stats__metrics{display:flex;flex-wrap:wrap;gap:8px 20px}.slr-kw-stats-stats__metric{align-items:baseline;column-gap:6px;display:inline-flex}.slr-kw-stats-stats__label{color:var(--slr-gray-50);font-size:12px;font-weight:500;line-height:16px}.slr-kw-stats-stats__value{color:var(--slr-blue-10);font-size:12px;font-weight:500;line-height:16px}.slr-kw-stats-stats__trend-title,.slr-kw-stats-tags__title{color:var(--slr-blue-10);font-size:13px;font-weight:500;margin-bottom:0;margin-top:16px}.slr-kw-stats-stats__trend{height:142px;margin-top:8px;overflow:hidden}.slr-kw-stats-tags{min-height:120px}.slr-kw-stats-tags__title{margin-bottom:12px;margin-top:0}.slr-kw-stats__empty{color:var(--slr-gray-50);font-size:13px;margin:8px 0 0}.slr-kw-stats__loader{align-items:center;display:flex;flex-direction:column;gap:12px;inset:80px 0 64px;justify-content:flex-start;padding-top:40px;position:absolute}.slr-kw-stats__loader p{color:var(--slr-gray-50);font-size:13px;margin:0}.slr-kw-stats__footer{align-items:center;display:flex;justify-content:space-between;margin-top:20px}.slr-kw-stats__nav.components-button.is-link{align-items:center;box-shadow:none;color:var(--slr-blue-50);column-gap:6px;display:inline-flex;font-size:13px;font-weight:500;text-decoration:none}.slr-kw-stats__nav.components-button.is-link:hover{color:var(--slr-blue-50)}@media screen and (max-width:960px){.slr-kw-stats__body{flex-direction:column;row-gap:12px}.slr-kw-stats__left,.slr-kw-stats__right{width:100%}.slr-kw-stats__target{display:none}.slr-kw-stats__attrs{flex-wrap:wrap;justify-content:space-between;row-gap:8px;width:100%}}.slr-addkw-modal.components-modal__frame{display:flex;flex-direction:column;max-height:94vh;max-width:80vw;width:min(1120px,80vw)}.slr-addkw-modal .components-modal__header{background:transparent;border-bottom:none;height:auto;justify-content:flex-end;right:auto;min-height:0;padding:16px 0 0 16px;position:absolute!important;left:0;top:0;width:auto}.slr-addkw-modal .components-modal__header-heading{display:none}.slr-addkw-modal .components-modal__content{display:flex;flex-direction:column;margin-top:0!important;overflow:auto;padding:20px 40px 28px!important}.slr-addkw{position:relative}.slr-addkw__busy{align-items:center;background:hsla(0,0%,100%,.65);display:flex;inset:0;justify-content:center;position:absolute;z-index:30}.slr-addkw-upgrade__title{font-size:16px;font-weight:600;margin:0 0 8px}.slr-addkw__header{align-items:center;column-gap:24px;display:flex;margin:0 0 20px;padding-left:36px}.slr-addkw__title{color:var(--slr-blue-10);font-size:18px;font-weight:600;line-height:1.3;margin:0}.slr-addkw__remaining{background:var(--slr-blue-95);border:1px solid var(--slr-blue-50);border-radius:4px;color:var(--slr-blue-10);font-size:12px;font-weight:400;padding:8px 12px}.slr-addkw__remaining-count{color:var(--slr-blue-40);font-weight:500}.slr-addkw__remaining.is-danger{background:#cb333354;border-color:var(--slr-red)}.slr-addkw__remaining.is-danger .slr-addkw__remaining-count{color:var(--slr-red)}.slr-addkw__body{align-items:stretch;display:flex}.slr-addkw__col{min-width:0;width:50%}.slr-addkw__col--left{border-left:1px solid var(--slr-gray-90);padding-left:40px}.slr-addkw__col--right{padding-right:40px}.slr-addkw-section__title{align-items:flex-start;color:var(--slr-blue-10);column-gap:10px;display:flex;font-size:13px;font-weight:500;line-height:1.4}.slr-addkw-section__number{border:1px solid var(--slr-blue-50);border-radius:4px;color:var(--slr-blue-50);flex:0 0 auto;font-size:13px;font-weight:500;line-height:20px;padding:0 7px}.slr-addkw-section__heading{font-weight:500}.slr-addkw-section__desc,.slr-addkw-section__optional{color:var(--slr-gray-50);font-weight:400}.slr-addkw-section__desc{font-size:11px;line-height:1.4;margin:6px 0 0}.slr-addkw-section--spaced{margin-top:48px}.slr-addkw-lined{background:var(--slr-white);border:1px solid var(--slr-gray-90);border-radius:10px;display:flex;margin-top:10px;min-height:210px;overflow:hidden}.slr-addkw-lined__nums{color:var(--slr-gray-50);display:flex;flex-direction:column;font-size:13px;font-weight:400;line-height:22px;margin-left:5px;min-width:29px;padding:8px 6px;text-align:left;-webkit-user-select:none;user-select:none}.slr-addkw-lined__input{background:transparent;border:none;box-shadow:none;color:var(--slr-blue-10);flex:1;font-size:13px;line-height:22px;margin:0;min-width:0;padding:8px 0 8px 12px;resize:none;width:100%}.slr-addkw-lined__input:focus{border:none;box-shadow:none;outline:none}.slr-addkw-error{color:var(--slr-red);font-size:11px;line-height:1.4;margin:6px 0 0}.slr-addkw-input{background:var(--slr-white);border:1px solid var(--slr-gray-90);border-radius:10px;box-shadow:none;color:var(--slr-blue-10);display:block;font-size:13px;line-height:1.4;margin-top:10px;padding:10px 12px;width:100%}.slr-addkw-input:focus{border-color:var(--slr-blue-50);box-shadow:none;outline:none}.slr-addkw-suggest{position:relative}.slr-addkw-suggest__list{background:var(--slr-white);border:1px solid var(--slr-gray-90);border-radius:0 0 10px 10px;box-shadow:var(--slr-shadow-panel);right:0;max-height:240px;overflow:auto;position:absolute;left:0;top:calc(100% - 2px);z-index:20}.slr-addkw-suggest__status{align-items:center;color:var(--slr-gray-50);display:flex;font-size:13px;justify-content:center;min-height:48px;padding:12px}.slr-addkw-suggest__item{align-items:flex-start;background:transparent;border:none;cursor:pointer;display:flex;flex-direction:column;padding:8px 12px;text-align:right;width:100%}.slr-addkw-suggest__item:focus,.slr-addkw-suggest__item:hover{background:var(--slr-blue-95)}.slr-addkw-suggest__item-main{align-items:center;color:var(--slr-blue-10);column-gap:8px;display:inline-flex;font-size:13px}.slr-addkw-suggest__item-meta{color:var(--slr-gray-50);font-size:11px;font-style:italic;margin-right:26px}.slr-addkw-chips{display:flex;flex-wrap:wrap;gap:8px;margin-top:16px}.slr-addkw-chip{align-items:center;background:var(--slr-white);border:1px solid #c7cadc;border-radius:10px;color:var(--slr-blue-10);column-gap:8px;display:inline-flex;font-size:14px;font-weight:400;padding:4px 10px;white-space:nowrap}.slr-addkw-chip__remove{background:transparent;border:none;color:var(--slr-blue-10);cursor:pointer;font-size:18px;line-height:1;padding:0 2px}.slr-addkw-device{border:1px solid var(--slr-gray-90);border-radius:10px;display:flex;height:38px;margin-top:10px;max-width:100%;overflow:hidden;width:338px}.slr-addkw-device__btn{align-items:center;background:var(--slr-white);border:none;color:var(--slr-gray-50);column-gap:8px;cursor:pointer;display:inline-flex;flex:1;font-size:13px;font-weight:500;justify-content:center}.slr-addkw-device__btn:first-child{border-radius:0 10px 10px 0}.slr-addkw-device__btn:last-child{border-radius:10px 0 0 10px}.slr-addkw-device__btn.is-selected,.slr-addkw-device__btn:hover{background:#3588e626;color:var(--slr-blue-50)}.slr-addkw-device__btn .dashicons{font-size:16px;height:16px;width:16px}.slr-addkw__footer{align-items:center;display:flex;flex-direction:column;margin-top:28px}.slr-addkw__submit.components-button{font-size:14px;font-weight:500;height:40px;justify-content:center;min-width:280px}.slr-addkw__note{align-items:center;background:var(--slr-gray-95);border-radius:10px;color:var(--slr-gray-30);column-gap:10px;display:flex;font-size:13px;justify-content:center;line-height:1.4;margin-top:24px;padding:16px;width:100%}.slr-addkw__note .dashicons{color:var(--slr-gray-30);font-size:18px;height:18px;width:18px}@media screen and (max-width:960px){.slr-addkw-modal.components-modal__frame{max-height:100vh;max-width:none;width:100%}.slr-addkw-modal .components-modal__content{padding:8px 16px 20px!important}.slr-addkw__body{flex-direction:column}.slr-addkw__col{width:100%}.slr-addkw__col--left{border-left:none;padding-left:0}.slr-addkw__col--right{margin-top:32px;padding-right:0}.slr-addkw-device,.slr-addkw__submit.components-button{width:100%}}
     3.wrap.slr-admin-wrap{background:transparent;color:var(--slr-black-light);font-family:var(--slr-font-family);margin:0;max-width:none;padding:0}body.slr-admin #wpcontent{padding-right:0}body.slr-admin #wpbody-content{padding-bottom:0}.slr-admin-wrap .components-notice{border-radius:var(--slr-radius-sm)}.slr-panel{background:var(--slr-white);border-radius:var(--slr-radius-lg);box-shadow:var(--slr-shadow-panel);margin-bottom:24px;padding:24px}.slr-panel__title{color:var(--slr-black-light);font-size:16px;font-weight:600;margin:0 0 16px}.slr-header{justify-content:space-between;margin-bottom:24px}.slr-header,.slr-header__brand{align-items:center;display:flex}.slr-header__brand{gap:12px}.slr-header__logo{background:linear-gradient(-209deg,#4e78f4 1.64%,#4ef4b9 98.45%);border-radius:var(--slr-radius-sm);height:36px;width:36px}.slr-header__title{color:var(--slr-black-light);font-size:24px;font-weight:700;margin:0}.slr-header__meta{color:var(--slr-gray-50);font-size:14px;margin:0}.slr-kpi-grid{display:grid;gap:16px;grid-template-columns:repeat(auto-fit,minmax(180px,1fr));margin-bottom:24px}.slr-kpi-card{background:var(--slr-white);border-radius:var(--slr-radius-lg);box-shadow:var(--slr-shadow-panel);padding:16px 20px}.slr-kpi-card__label{color:var(--slr-gray-50);font-size:13px;font-weight:500;margin:0 0 8px}.slr-status--connected{color:var(--slr-green);font-weight:600}.slr-status--disconnected{color:var(--slr-red);font-weight:600}.slr-domain-list{list-style:none;margin:0;padding:0}.slr-domain-list__item{align-items:center;border-bottom:1px solid var(--slr-gray-95);display:flex;justify-content:space-between;padding:12px 0}.slr-domain-list__item:last-child{border-bottom:none}.slr-domain-list__name{font-weight:500}.slr-domain-list__meta{color:var(--slr-gray-50);font-size:12px}.slr-empty-state{color:var(--slr-gray-50);padding:48px 24px;text-align:center}.slr-admin-wrap .components-button.is-primary{background:var(--slr-blue-50);border-color:var(--slr-blue-50);border-radius:var(--slr-radius-sm)}.slr-admin-wrap .components-button.is-primary:hover:not(:disabled){background:var(--slr-blue-40);border-color:var(--slr-blue-40)}.slr-admin-wrap .components-button.is-secondary{background:var(--slr-white);border:1px solid var(--slr-blue-50);border-radius:4px;color:var(--slr-blue-50)}.slr-admin-wrap .components-button.is-secondary:hover:not(:disabled){background:var(--slr-white);color:var(--slr-blue-50);opacity:.85}.slr-admin-wrap .components-select-control__input,.slr-admin-wrap .components-text-control__input{border-radius:var(--slr-radius-sm)}.slr-admin-wrap .dataviews-wrapper{border-radius:var(--slr-radius-sm);box-shadow:var(--slr-shadow-panel);overflow:hidden}.slr-app{padding:20px 24px 40px}.slr-app:has(.slr-ai-visibility),.slr-app:has(.slr-dashboard),.slr-app:has(.slr-rank-tracker){padding:0}.slr-app--loading{align-items:center;display:flex;justify-content:center;min-height:240px}.slr-onboarding{margin:0 auto;max-width:560px;padding:24px 0 48px}.slr-create-project{max-width:620px}.slr-create-project__title{color:var(--slr-blue-10);font-size:22px;font-weight:600;line-height:1.3;margin:0 0 8px}.slr-create-project__lead{color:var(--slr-gray-50);font-size:14px;line-height:1.55;margin:0 0 28px}.slr-create-project__fields{display:flex;flex-direction:column;gap:20px}.slr-create-project .components-base-control__label,.slr-create-project .components-input-control__label,.slr-create-project__label{color:var(--slr-blue-10);display:block;font-size:13px;font-weight:500;letter-spacing:0;line-height:1.4;margin:0 0 6px;text-transform:none}.slr-create-project .components-base-control__help,.slr-create-project__hint{color:var(--slr-gray-50);font-size:12px;line-height:1.45;margin:6px 0 0}.slr-create-project .components-input-control__input,.slr-create-project .components-select-control__input,.slr-create-project .components-text-control__input{border-color:var(--slr-gray-90);border-radius:var(--slr-radius-sm);color:var(--slr-blue-10);min-height:40px}.slr-create-project__domain .components-text-control__input:disabled{background:var(--slr-blue-97);box-shadow:none;color:var(--slr-blue-10);opacity:1}.slr-create-project__tracking{border:0;margin:4px 0 0;min-width:0;padding:0}.slr-create-project__tracking .slr-create-project__hint{margin:0 0 12px}.slr-tracking-options{display:flex;flex-direction:column;gap:10px}.slr-tracking-option{align-items:center;background:var(--slr-white);border:1px solid var(--slr-gray-95);border-radius:var(--slr-radius-sm);box-shadow:none;color:inherit;cursor:pointer;display:flex;gap:16px;justify-content:space-between;margin:0;padding:14px 16px;text-align:right;width:100%}.slr-tracking-option:hover:not(:disabled){border-color:var(--slr-blue-50)}.slr-tracking-option:focus{outline:none}.slr-tracking-option:focus-visible{border-color:var(--slr-blue-50);box-shadow:0 0 0 2px var(--slr-blue-95)}.slr-tracking-option.is-selected{background:var(--slr-blue-97);border-color:var(--slr-blue-50)}.slr-tracking-option:disabled{cursor:default;opacity:.7}.slr-tracking-option__text{display:flex;flex-direction:column;gap:4px;min-width:0}.slr-tracking-option__title{color:var(--slr-blue-10);font-size:14px;font-weight:600;line-height:1.3}.slr-tracking-option__desc{color:var(--slr-gray-50);font-size:12px;font-weight:400;line-height:1.45}.slr-tracking-option__check{background:var(--slr-white);border:2px solid var(--slr-gray-85);border-radius:50%;box-shadow:inset 0 0 0 3px var(--slr-white);flex:0 0 auto;height:18px;width:18px}.slr-tracking-option.is-selected .slr-tracking-option__check{background:var(--slr-blue-50);border-color:var(--slr-blue-50)}.slr-create-project__actions{margin-top:8px}.slr-create-project__actions .components-button{font-weight:500;min-height:40px;padding:0 20px}.slr-onboarding__hero{margin-bottom:32px;text-align:center}.slr-onboarding__logo{height:48px;margin:0 auto 16px;width:48px}.slr-onboarding__title{color:var(--slr-black-light);font-size:28px;font-weight:700;margin:0}.slr-onboarding__panel{padding:32px}.slr-onboarding__panel>.components-notice{margin:0 0 24px}.slr-onboarding__lead{color:var(--slr-gray-50);font-size:15px;line-height:1.6;margin:0 0 24px}.slr-onboarding__question{color:var(--slr-black-light);font-size:16px;font-weight:600;margin:0 0 24px}.slr-onboarding__help{color:var(--slr-gray-50);font-size:14px;line-height:1.5;margin:0 0 12px}.slr-onboarding__help a{color:var(--slr-blue-50)}.slr-onboarding__actions{display:flex;flex-wrap:wrap;gap:12px;margin-top:24px}.slr-onboarding__divider{border:0;border-top:1px dashed var(--slr-gray-90);margin:28px 0}.slr-onboarding__loader{display:flex;justify-content:center;padding:24px 0}.slr-settings__actions{margin-top:16px}.slr-project-modal__lead{font-size:14px;line-height:1.5;margin:0 0 8px}.slr-project-modal__hint{color:var(--slr-gray-50);font-size:13px;margin:0 0 16px}.slr-project-modal__error{color:var(--slr-red);margin:12px 0 0}.slr-project-modal__actions{display:flex;justify-content:flex-end;margin-top:20px}.slr-project-summary{list-style:none;margin:0;padding:0}.slr-project-summary li{border-bottom:1px solid var(--slr-gray-95);display:flex;gap:12px;padding:8px 0}.slr-project-summary li:last-child{border-bottom:none}.slr-project-summary__label{color:var(--slr-gray-50);font-weight:600;min-width:100px}.slr-dashboard{max-width:none}.slr-dashboard__body{max-width:1600px;padding:20px 24px 40px}.slr-toolbar{align-items:center;background:var(--slr-white);border-bottom:1px solid var(--slr-gray-95);box-sizing:border-box;display:flex;gap:16px;height:60px;justify-content:space-between;margin:0;min-height:60px;padding:0 24px;width:100%}.slr-toolbar__left{align-items:center;display:flex;min-width:0}.slr-toolbar__keywords{align-items:center;color:var(--slr-black);column-gap:4px;display:flex;font-size:13px;font-weight:500;height:24px;line-height:19px;margin-right:20px;white-space:nowrap}.slr-toolbar__sync{align-items:center;column-gap:4px;display:inline-flex}.slr-toolbar__sync--ok{color:var(--slr-green)}.slr-toolbar__sync--warn{color:var(--slr-red)}.slr-toolbar__sync .dashicons{font-size:13px;height:13px;line-height:13px;margin-right:5px;width:13px}@media screen and (max-width:782px){.slr-toolbar{flex-wrap:wrap;height:auto;min-height:60px;padding:10px 16px}}.slr-project-selector{position:relative}.slr-project-selector__toggle{align-items:center;background:var(--slr-white);border:1px solid var(--slr-gray-90);border-radius:10px;color:var(--slr-black);column-gap:8px;cursor:pointer;display:flex;font-family:inherit;font-size:13px;font-weight:500;height:40px;line-height:24px;padding:8px 10px;text-align:right;width:280px}.slr-project-selector__toggle:disabled{cursor:default;opacity:1}.slr-project-selector__toggle:hover:not(:disabled),.slr-project-selector__toggle[aria-expanded=true]{border-color:var(--slr-gray-85)}.slr-project-selector__favicon{border:1px solid var(--slr-gray-90);border-radius:50%;flex-shrink:0;height:24px;object-fit:cover;width:24px}.slr-project-selector__item .slr-project-selector__favicon{height:20px;width:20px}.slr-project-selector__favicon--fallback{align-items:center;background:var(--slr-blue-95);color:var(--slr-blue-50);display:inline-flex;font-size:11px;font-weight:600;justify-content:center}.slr-project-selector__name{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.slr-project-selector__chevron{color:var(--slr-black-light);flex-shrink:0;font-size:14px;height:14px;width:14px}.slr-project-selector__menu{background:var(--slr-white);border:1px solid var(--slr-gray-95);border-radius:10px;box-shadow:var(--slr-shadow-panel);right:0;max-height:430px;overflow:auto;overflow-x:hidden;position:absolute;top:calc(100% + 6px);width:280px;z-index:20}.slr-project-selector__search{background:var(--slr-white);border-bottom:1px solid #eee;padding:10px;position:sticky;top:0;z-index:1}.slr-project-selector__search .dashicons{color:#999;font-size:14px;height:14px;right:20px;pointer-events:none;position:absolute;top:18px;width:14px}.slr-project-selector__search input{border:1px solid #dfe1e6;border-radius:6px;box-sizing:border-box;font-family:inherit;font-size:13px;height:32px;padding:0 30px 0 10px;width:100%}.slr-project-selector__search input:focus{border-color:var(--slr-blue-50);box-shadow:0 0 0 2px rgba(0,123,255,.1);outline:none}.slr-project-selector__list{list-style:none;margin:0;padding:6px 0 8px}.slr-project-selector__item{align-items:center;background:transparent;border:0;color:var(--slr-black-light);cursor:pointer;display:flex;font-family:inherit;font-size:12px;gap:8px;height:32px;padding:6px 10px;text-align:right;width:100%}.slr-project-selector__item:hover{background:var(--slr-blue-97)}.slr-project-selector__item.is-selected{color:var(--slr-blue-50);font-weight:500}.slr-project-selector__item-name{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.slr-project-selector__check{color:var(--slr-blue-50);flex-shrink:0;font-size:16px;height:16px;width:16px}.slr-project-selector__empty{color:var(--slr-gray-50);font-size:12px;padding:12px 10px}.slr-upgrade-button{align-items:center;background:linear-gradient(-209.09deg,#4e78f4 42.6%,#4ef4b9 98.45%);border:none;border-radius:4px;box-sizing:border-box;color:var(--slr-white)!important;column-gap:6px;cursor:pointer;display:inline-flex;font-family:inherit;font-size:13px;font-weight:500;height:40px;line-height:1;min-width:132px;padding:10px 24px;text-decoration:none!important;white-space:nowrap}.slr-upgrade-button:focus,.slr-upgrade-button:hover{color:var(--slr-white)!important;opacity:.9;text-decoration:none!important}.slr-upgrade-button:disabled{cursor:wait;opacity:.7}.slr-upgrade-button__icon{background:url(data:image/svg+xml;base64,PCEtLSBPcmlnaW5hbCBUcnVlUmFua2VyIHJvY2tldCBpY29uLiBMaWNlbnNlOiBHUEwtMi4wLW9yLWxhdGVyLiAtLT4KPHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIj4KCTxwYXRoIGZpbGw9IiNmZmYiIGZpbGwtcnVsZT0iZXZlbm9kZCIgZD0iTTEyIDJjLjUgMCAxIC4zIDEuMy43TDE2IDYuMlYxNWEyIDIgMCAwIDEtMiAyaC0uMmwxLjQgMy42YS43NS43NSAwIDEgMS0xLjQuNkwxMiAxNy44bC0xLjggMy42YS43NS43NSAwIDEgMS0xLjQtLjZMMTAuMiAxN0gxMGEyIDIgMCAwIDEtMi0yVjYuMkwxMC43IDIuN0MxMSAyLjMgMTEuNSAyIDEyIDJabTAgNS4yNWExLjUgMS41IDAgMSAwIDAgMyAxLjUgMS41IDAgMCAwIDAtM1oiLz4KCTxwYXRoIGZpbGw9IiNmZmYiIGQ9Ik04IDExLjUgNC4yIDE2LjJhLjYuNiAwIDAgMCAuNSAxbDMuMy0uOVYxMS41Wm04IDB2NC44bDMuMy45YS42LjYgMCAwIDAgLjUtMUwxNiAxMS41WiIvPgo8L3N2Zz4K) no-repeat 50%/contain;display:inline-block;flex-shrink:0;height:16px;width:16px}.slr-kpi-grid--dashboard{grid-template-columns:repeat(4,minmax(0,1fr))}@media (max-width:1200px){.slr-kpi-grid--dashboard{grid-template-columns:repeat(2,minmax(0,1fr))}}@media (max-width:640px){.slr-kpi-grid--dashboard{grid-template-columns:1fr}}.slr-kpi-card--rich{display:flex;flex-direction:column;justify-content:space-between;min-height:220px;padding:20px;position:relative}.slr-kpi-card--clickable{cursor:pointer}.slr-kpi-card--clickable:hover{box-shadow:var(--slr-shadow-card)}.slr-kpi-card__hit{appearance:none;background:transparent;border:0;border-radius:inherit;box-shadow:none;color:transparent;cursor:pointer;font-size:0;height:auto;inset:0;line-height:0;margin:0;min-height:0;min-width:0;padding:0;position:absolute;text-decoration:none;width:auto;z-index:1}.slr-kpi-card__hit:focus{box-shadow:none;outline:none}.slr-kpi-card__hit:focus-visible{outline:2px solid var(--slr-blue-50);outline-offset:2px}.slr-kpi-card__hit:disabled{cursor:wait}.slr-kpi-card__header{align-items:center;color:var(--slr-black-light);display:flex;font-size:13px;font-weight:500;gap:7px;padding:0}.slr-kpi-card__icon{color:var(--slr-blue-50);font-size:18px;height:18px;width:18px}.slr-kpi-card__main{flex:1;padding:12px 0 8px}.slr-kpi-card__footer{border-top:1px solid var(--slr-gray-95);margin-top:auto;padding-top:10px}.slr-kpi-card__value-row{align-items:baseline;display:flex;flex-wrap:wrap;gap:8px}.slr-kpi-card__value{color:var(--slr-black-light);font-size:26px;font-weight:700;line-height:30px;margin:0}.slr-kpi-card__metric-label{color:var(--slr-gray-60);font-size:12px;margin:4px 0 0}.slr-kpi-card__value-suffix{color:var(--slr-gray-50);font-size:16px;font-weight:500}.slr-kpi-card__value--good{color:var(--slr-green)}.slr-kpi-card__value--ok{color:var(--slr-blue-50)}.slr-kpi-card__value--warn{color:var(--slr-orange)}.slr-kpi-card__value--bad{color:var(--slr-red)}.slr-kpi-card__row{align-items:center;display:flex;font-size:12px;gap:8px;justify-content:space-between;padding:8px 0}.slr-kpi-card__row-label{color:var(--slr-gray-60);margin-left:5px}.slr-kpi-card__row-value{align-items:center;color:var(--slr-black-light);display:inline-flex;font-size:17px;font-weight:600;gap:6px}.slr-kpi-card__state{align-items:center;color:var(--slr-gray-60);display:flex;flex:1;flex-direction:column;font-size:13px;justify-content:center;padding:16px 0;text-align:center}.slr-kpi-card__state-title{color:var(--slr-black-light);font-size:15px;font-weight:600;margin:0 0 6px}.slr-kpi-card__state-desc{line-height:1.5;margin:0;max-width:260px}.slr-kpi-card__empty-icon,.slr-kpi-card__pulse{color:var(--slr-blue-50);font-size:32px;height:32px;margin-bottom:12px;width:32px}.slr-kpi-card__empty-icon{color:var(--slr-gray-60)}.slr-pulse{animation:slr-pulse-soft 2s ease-in-out infinite}@keyframes slr-pulse-soft{0%,to{opacity:.5;transform:scale(.95)}50%{opacity:1;transform:scale(1.05)}}.slr-trend{align-items:center;border-radius:12px;display:inline-flex;font-size:11px;font-weight:600;gap:2px;line-height:normal;padding:0 8px}.slr-kpi-card__value-row .slr-trend{font-size:13px}.slr-trend--up{color:var(--slr-green)}.slr-trend--down{color:var(--slr-red)}.slr-trend--solid.slr-trend--up{background-color:var(--slr-green);color:var(--slr-white)}.slr-trend--solid.slr-trend--down{background-color:var(--slr-red);color:var(--slr-white)}.slr-trend--issues{background:rgba(218,55,55,.1);font-weight:500}.slr-dash-section{margin-bottom:40px}.slr-dash-section+.slr-dash-section{margin-top:8px}.slr-dash-section__header{align-items:center;border-bottom:none;display:flex;margin:30px 0 15px;padding:0}.slr-dash-section__icon{align-items:center;background:var(--slr-blue-95);border-radius:var(--slr-radius-sm);color:var(--slr-blue-50);display:flex;flex-shrink:0;font-size:18px;height:36px;justify-content:center;width:36px}.slr-dash-section__title{color:var(--slr-black-light);font-size:20px;font-weight:600;margin:0 12px 0 0;white-space:nowrap}.slr-dash-section__line{background-color:var(--slr-gray-60);flex-grow:1;height:1px;margin-right:20px}.slr-dash-grid{align-items:stretch;display:grid;gap:16px;grid-template-columns:2fr 1fr}.slr-dash-grid--backlinks{grid-template-columns:1fr 2fr}@media (max-width:960px){.slr-dash-grid,.slr-dash-grid--backlinks{grid-template-columns:1fr}}.slr-dash-panel{display:flex;flex-direction:column;margin-bottom:0;min-height:0;padding:20px}.slr-dash-grid .slr-panel.slr-dash-panel{margin-bottom:0}.slr-dash-panel__title{flex-shrink:0;font-size:14px;font-weight:600;margin:0 0 4px}.slr-dash-panel__subtitle{color:var(--slr-gray-50);flex-shrink:0;font-size:12px;line-height:1.4;margin:0 0 16px}.slr-dash-panel__content{flex:1;min-height:220px}.slr-chart{height:260px;max-height:260px;overflow:hidden;position:relative}.slr-chart--donut-sm{height:120px;margin:0 auto;max-width:140px}.slr-chart-empty{align-items:center;border:2px dashed var(--slr-border-dashed);border-radius:12px;color:var(--slr-gray-50);display:flex;justify-content:center;min-height:250px;overflow:hidden;position:relative;text-align:center}.slr-chart-empty__grid{background-image:linear-gradient(to left,var(--slr-grid-line) 1px,transparent 1px),linear-gradient(to bottom,var(--slr-grid-line) 1px,transparent 1px);background-size:40px 40px;inset:0;position:absolute;z-index:1}.slr-chart-empty__content{padding:20px;position:relative;z-index:2}.slr-chart-empty__icon{color:var(--slr-blue-50);font-size:40px;height:40px;margin-bottom:15px;width:40px}.slr-chart-empty:not(.slr-chart-empty--waiting) .slr-chart-empty__icon{color:var(--slr-gray-60);font-size:32px;height:32px;width:32px}.slr-chart-empty__title{color:#1f2937;font-size:18px;font-weight:600;margin:0 0 8px}.slr-chart-empty__desc{color:#6b7280;font-size:14px;line-height:1.5;margin:0;max-width:300px}.slr-ai-score__header{align-items:baseline;display:flex;gap:10px;margin-bottom:16px}.slr-ai-score__value{color:var(--slr-blue-50);font-size:36px;font-weight:700;line-height:1}.slr-ai-score__delta{align-items:center;border-radius:2px;display:inline-flex;font-size:12px;font-weight:500;padding:3px 10px}.slr-ai-score__delta--up{background:var(--slr-green-bg);color:var(--slr-green)}.slr-ai-score__delta--down{background:var(--slr-red-bg);color:var(--slr-red)}.slr-ai-score__delta--flat{background:var(--slr-gray-bg);color:var(--slr-gray-30)}.slr-ai-score__breakdown{list-style:none;margin:0;padding:0}.slr-ai-score__row{align-items:center;border-top:1px dashed var(--slr-gray-95);display:flex;gap:10px;justify-content:space-between;padding:8px 0}.slr-ai-score__row:first-child{border-top:none;padding-top:0}.slr-ai-score__row-main{flex:1;min-width:0}.slr-ai-score__row-head{align-items:center;color:var(--slr-gray-50);display:flex;flex-wrap:wrap;font-size:12px;gap:6px}.slr-ai-score__row-weight{color:var(--slr-gray-60)}.slr-ai-score__bar{background:var(--slr-gray-95);border-radius:3px;height:6px;margin-top:4px;overflow:hidden;width:100%}.slr-ai-score__bar-fill{background:var(--slr-blue-50);border-radius:3px;height:100%}.slr-ai-score__row-value{color:var(--slr-gray-50);flex-shrink:0;font-size:13px;font-weight:500;min-width:28px;text-align:left}.slr-bl-dr{align-items:center;display:flex;flex-direction:column;gap:12px}.slr-bl-dr__score{align-items:baseline;display:flex;gap:8px}.slr-bl-dr__value{color:var(--slr-black-light);font-size:32px;font-weight:700}.slr-bl-metrics{display:flex;flex-wrap:wrap;gap:12px 24px;list-style:none;margin:0 0 16px;padding:0}.slr-bl-metrics__item{display:flex;flex-direction:column;gap:2px;min-width:120px}.slr-bl-metrics__label{color:var(--slr-gray-50);font-size:11px;letter-spacing:.02em;text-transform:uppercase}.slr-bl-metrics__value{align-items:center;color:var(--slr-black-light);display:inline-flex;font-size:16px;font-weight:700;gap:6px}.slr-chart--area{height:180px}.slr-skeleton{animation:slr-shimmer 1.4s ease infinite;background:linear-gradient(-90deg,var(--slr-gray-95) 25%,var(--slr-gray-90) 50%,var(--slr-gray-95) 75%);background-size:200% 100%;border-radius:6px}@keyframes slr-shimmer{0%{background-position:-100% 0}to{background-position:300% 0}}.slr-skeleton--avatar{border-radius:50%;flex-shrink:0;height:24px;width:24px}.slr-skeleton--title{height:20px;width:200px}.slr-skeleton--line{height:12px;margin-bottom:10px}.slr-skeleton--sm{width:40%}.slr-skeleton--md{width:65%}.slr-skeleton--lg{height:28px;width:50%}.slr-skeleton--chart{border-radius:var(--slr-radius-sm);height:220px;margin-top:12px;width:100%}.slr-skeleton--chart-sm{height:160px}.slr-toolbar--skeleton{margin-bottom:0}.slr-skeleton--selector{border-radius:10px;height:40px;width:280px}.slr-skeleton--upgrade{border-radius:4px;height:40px;width:132px}.slr-dash-panel--skeleton,.slr-kpi-card--skeleton{pointer-events:none}.slr-kpi-card--skeleton{gap:12px;justify-content:flex-start}.slr-rank-tracker{max-width:none}.slr-rank-tracker__body{max-width:1600px;padding:20px 24px 40px}.slr-rt-filters{margin-bottom:20px;overflow:visible;padding:16px 20px;position:relative;z-index:5}.slr-rt-filters__left,.slr-rt-filters__row{align-items:center;column-gap:10px;display:flex}.slr-rt-filters__left{flex-wrap:wrap}.slr-rt-filters__right{margin-right:auto}.slr-rt-filters__hidden{display:none!important}.slr-rt-filter-input,.slr-rt-filter-select{background:var(--slr-white);border:1px solid var(--slr-gray-90);border-radius:var(--slr-radius-sm);color:var(--slr-blue-10);font-family:inherit;font-size:13px;height:38px;padding:8px 10px}.slr-rt-daterange{position:relative}.slr-rt-daterange__trigger{align-items:center;background:var(--slr-white);border:1px solid var(--slr-gray-90);border-radius:var(--slr-radius-sm);color:var(--slr-blue-10);column-gap:6px;cursor:pointer;display:inline-flex;font-family:inherit;font-size:13px;font-weight:400;height:38px;line-height:20px;padding:8px 10px;white-space:nowrap}.slr-rt-daterange__trigger .dashicons{color:var(--slr-blue-50);font-size:16px;height:16px;width:16px}.slr-rt-daterange__popover{background:var(--slr-white);border:1px solid var(--slr-gray-90);border-radius:var(--slr-radius-md);box-shadow:var(--slr-shadow-panel);min-width:640px;padding:12px 16px 16px;position:absolute;left:0;top:calc(100% + 8px);z-index:30}.slr-rt-daterange__close{background:transparent;border:none;color:var(--slr-gray-50);cursor:pointer;font-family:inherit;font-size:12px;position:absolute;left:10px;top:8px}.slr-rt-daterange__body{column-gap:12px;display:flex;padding-top:12px}.slr-rt-daterange__presets{border-left:1px solid var(--slr-gray-95);list-style:none;margin:0;min-width:130px;padding:0 0 0 8px}.slr-rt-daterange__preset{background:transparent;border:none;border-radius:4px;color:var(--slr-blue-10);cursor:pointer;display:block;font-family:inherit;font-size:13px;font-weight:500;padding:8px 10px;text-align:right;width:100%}.slr-rt-daterange__preset.is-active,.slr-rt-daterange__preset:hover{background:var(--slr-blue-50);color:var(--slr-white)}.slr-rt-daterange__save{color:var(--slr-gray-50);font-size:12px;margin-top:12px;padding:8px 10px 0}.slr-rt-daterange__save label{align-items:center;cursor:pointer;display:flex;gap:6px}.slr-rt-daterange__calendars{column-gap:16px;display:flex}.slr-rt-cal{width:230px}.slr-rt-cal__nav{align-items:center;display:flex;justify-content:space-between;margin-bottom:8px}.slr-rt-cal__caption{column-gap:4px;display:flex}.slr-rt-cal__caption select{background:var(--slr-white);border:1px solid var(--slr-gray-90);border-radius:4px;font-family:inherit;font-size:12px;height:26px;padding:0 8px}.slr-rt-cal__nav-btn{background:transparent;border:none;color:var(--slr-blue-10);cursor:pointer;height:24px;padding:0;width:24px}.slr-rt-cal__grid{display:grid;gap:2px;grid-template-columns:repeat(7,1fr)}.slr-rt-cal__weekday{color:var(--slr-gray-50);font-size:11px;padding:4px 0;text-align:center}.slr-rt-cal__day{background:transparent;border:none;border-radius:4px;color:var(--slr-blue-10);cursor:pointer;font-family:inherit;font-size:12px;height:28px}.slr-rt-cal__day.is-empty{cursor:default}.slr-rt-cal__day.is-disabled{color:var(--slr-gray-85);cursor:default}.slr-rt-cal__day.is-in-range{background:rgba(53,136,230,.15)}.slr-rt-cal__day.is-edge,.slr-rt-cal__day.is-edge.is-in-range{background:var(--slr-blue-50);color:var(--slr-white)}.slr-rt-cal__day:not(.is-disabled):not(.is-empty):hover{background:var(--slr-blue-95)}.slr-skeleton--daterange{border-radius:var(--slr-radius-sm);height:38px;margin-right:auto;width:220px}.slr-rt-summary{align-items:stretch;column-gap:18px;display:grid;grid-template-columns:minmax(0,1fr) minmax(0,2fr) minmax(0,1fr);margin-bottom:20px}.slr-rt-summary__card{box-sizing:border-box;margin-bottom:0;min-height:210px;min-width:0;padding:16px 18px 12px}.slr-rt-summary__title{color:var(--slr-blue-10);font-size:13px;font-weight:500;line-height:20px;margin:0 0 12px}.slr-rt-summary__value-row{align-items:center;column-gap:10px;display:flex;margin-bottom:8px}.slr-rt-summary__value{color:var(--slr-blue-10);font-size:26px;font-weight:700;line-height:1.2}.slr-rt-summary__empty{color:var(--slr-gray-50);font-size:13px;line-height:20px;margin:0}.slr-rt-avg-chart{height:120px;min-width:0}.slr-rt-donut{flex-shrink:0;height:140px;max-width:100%;width:140px}.slr-rt-spark{height:28px;min-width:60px}.slr-rt-dist-row__lost,.slr-rt-dist-row__new,.slr-rt-dist-row__num{text-align:center}.slr-rt-dist-row__new{color:var(--slr-green)}.slr-rt-dist-row__lost{color:var(--slr-red)}.slr-rt-aio-meta,.slr-rt-aio-stat{color:var(--slr-gray-30);font-size:12px;font-weight:500;line-height:18px;margin:0}.slr-rt-aio-stat{align-items:center;column-gap:8px;display:flex;margin-top:8px}.slr-rt-aio-progress{background:var(--slr-gray-95);border-radius:6px;height:11px;margin:10px 0;overflow:hidden}.slr-rt-aio-progress__bar{background:var(--slr-green);border-radius:6px;height:100%;min-width:0}.slr-rt-summary__distribution-body{align-items:center;column-gap:16px;display:flex;min-width:0}.slr-rt-summary__rows{flex:1}.slr-rt-dist-table{display:flex;flex:1;flex-direction:column;gap:8px;min-width:0}.slr-rt-dist-row{align-items:center;color:var(--slr-blue-10);column-gap:8px;display:grid;font-size:13px;grid-template-columns:minmax(90px,1.2fr) .6fr .5fr .5fr minmax(60px,1fr);line-height:20px}.slr-rt-dist-row--head{color:var(--slr-gray-50);font-size:13px;font-weight:500;text-align:center}.slr-rt-dist-row--head span:first-child{text-align:right}.slr-rt-dist-row__label{align-items:center;display:inline-flex;gap:6px;white-space:nowrap}.slr-rt-dist-row__dot{border-radius:50%;flex-shrink:0;height:10px;width:10px}.slr-skeleton--donut{border-radius:50%;flex-shrink:0;height:96px;width:96px}.slr-skeleton--bar{border-radius:6px;height:11px;margin:10px 0;width:100%}.slr-skeleton--button{border-radius:var(--slr-radius-sm);height:40px;margin-bottom:16px;width:160px}.slr-skeleton--search{width:240px}.slr-skeleton--search,.slr-skeleton--select{border-radius:var(--slr-radius-sm);height:36px}.slr-skeleton--select{width:160px}.slr-skeleton--cell{height:12px;margin:0 auto;width:28px}.slr-skeleton--spark{height:18px;margin:0;width:100%}.slr-rt-actions{margin-bottom:16px}.slr-rt-add-keywords.components-button{font-size:14px;font-weight:500;height:40px;padding:0 18px}.slr-rt-table-panel{background:var(--slr-white);border:1px solid var(--slr-gray-90);border-radius:var(--slr-radius-md);box-shadow:var(--slr-shadow-panel);overflow:hidden;padding:0}.slr-rt-table-toolbar{background:#fbfcfe;border-bottom:1px solid var(--slr-gray-95);justify-content:flex-end;padding:10px 12px}.slr-rt-table-toolbar,.slr-rt-table-toolbar__left{align-items:center;display:flex;flex-wrap:wrap;gap:10px}.slr-rt-table-toolbar__left{margin-left:auto}.slr-rt-table-toolbar__search{background:var(--slr-white);border:1px solid var(--slr-gray-90);border-radius:var(--slr-radius-sm);box-sizing:border-box;color:var(--slr-gray-30);font-family:var(--slr-font-family);font-size:13px;height:40px;max-width:280px;min-width:200px;padding:0 10px}.slr-rt-table-toolbar__search:focus{border-color:var(--slr-blue-50);box-shadow:0 0 0 2px rgba(0,123,255,.12);outline:none}.slr-rt-table-toolbar__search::placeholder{color:var(--slr-gray-60)}.slr-rt-table{background:var(--slr-white);padding:0 0 4px;width:100%}.slr-rt-table .tabulator{background:transparent;border:none;color:var(--slr-gray-30);font-family:var(--slr-font-family);font-size:13px;font-weight:400;width:100%}.slr-rt-table .tabulator[tabulator-layout=fitColumns] .tabulator-tableholder .tabulator-table{min-width:100%}.slr-rt-table .tabulator-tableholder{scrollbar-gutter:stable}.slr-rt-table .tabulator .tabulator-header{background:var(--slr-blue-95);border-bottom:1px solid var(--slr-gray-90);font-weight:500}.slr-rt-table .tabulator .tabulator-header .tabulator-col{background:var(--slr-blue-95);border-left:1px solid var(--slr-gray-95);box-sizing:border-box;justify-content:flex-start;min-height:55px}.slr-rt-table .tabulator .tabulator-header .tabulator-col.tabulator-sortable.tabulator-col-sorter-element:hover,.slr-rt-table .tabulator .tabulator-header .tabulator-col:hover{background:#d0e6fc!important;background-color:#d0e6fc!important}.slr-rt-table .tabulator .tabulator-header .tabulator-col .tabulator-col-content{align-items:center;box-sizing:border-box;display:flex;height:100%;justify-content:flex-start;min-height:55px;padding-bottom:10px;padding-top:10px;width:100%}.slr-rt-table .tabulator .tabulator-header .tabulator-col .tabulator-col-title-holder{align-items:center;display:flex;min-height:28px;width:100%}.slr-rt-table .tabulator .tabulator-header .tabulator-col.text-center .tabulator-col-content,.slr-rt-table .tabulator .tabulator-header .tabulator-col[style*="text-align: center"] .tabulator-col-content,.slr-rt-table .tabulator .tabulator-header .tabulator-col[style*="text-align:center"] .tabulator-col-content{justify-content:center}.slr-rt-table .tabulator .tabulator-header .tabulator-col.text-left .tabulator-col-content,.slr-rt-table .tabulator .tabulator-header .tabulator-col[style*="text-align: left"] .tabulator-col-content,.slr-rt-table .tabulator .tabulator-header .tabulator-col[style*="text-align:left"] .tabulator-col-content{justify-content:flex-start}.slr-rt-table .tabulator .tabulator-header .tabulator-col .tabulator-col-title{color:var(--slr-gray-30);font-size:13px;font-weight:500;line-height:28px;white-space:nowrap}.slr-rt-table .tabulator-row{background:var(--slr-white);border-bottom:1px solid var(--slr-gray-95);min-height:55px!important}.slr-rt-table .tabulator-row.tabulator-row-even{background:var(--slr-white)}.slr-rt-table .tabulator-row:hover{background:var(--slr-blue-97)!important}.slr-rt-table .tabulator-row .tabulator-cell{border-left:1px solid var(--slr-gray-95);box-sizing:border-box;color:var(--slr-gray-30);font-size:13px!important;font-weight:400;line-height:20px;overflow:hidden;padding:12px 10px!important;text-overflow:ellipsis;vertical-align:middle;white-space:nowrap}.slr-rt-table .tabulator-row .tabulator-cell.text-center{text-align:center}.slr-rt-table .tabulator-row .tabulator-cell.text-left{text-align:right}.slr-rt-table .tabulator-placeholder-contents{color:var(--slr-gray-50);font-size:13px;padding:48px 16px;text-align:center}.slr-rt-table .tabulator .tabulator-footer{background:var(--slr-white);border-top:1px solid var(--slr-gray-90);color:var(--slr-gray-50);font-family:var(--slr-font-family);font-weight:400;white-space:normal}.slr-rt-table .tabulator .tabulator-footer .tabulator-footer-contents{align-items:center;box-sizing:border-box;display:flex;flex-wrap:wrap;gap:12px 20px;justify-content:space-between;min-height:72px;padding:16px 20px!important}.slr-rt-table .tabulator .tabulator-footer .tabulator-page-counter{color:var(--slr-gray-50);flex:0 0 auto;font-size:12px;font-weight:500;line-height:18px;margin:0!important;order:1}.slr-rt-table .tabulator .tabulator-footer .tabulator-paginator{align-items:center;color:var(--slr-gray-50);display:flex;flex:1 1 auto;flex-wrap:wrap;font-family:inherit;font-size:13px;font-weight:500;gap:6px;justify-content:flex-end;margin:0;order:2;text-align:left}.slr-rt-table .tabulator .tabulator-footer .tabulator-paginator label{color:var(--slr-gray-50);font-size:12px;font-weight:400;margin:0 0 0 4px}.slr-rt-table .tabulator .tabulator-footer .tabulator-page-size,.slr-rt-table .tabulator .tabulator-footer select.tabulator-page-size{appearance:none;background-color:var(--slr-white);background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 width=%2710%27 height=%276%27%3E%3Cpath fill=%27%23767676%27 d=%27m1 1 4 4 4-4%27/%3E%3C/svg%3E");background-position:left 12px center;background-repeat:no-repeat;border:1px solid var(--slr-gray-90)!important;border-radius:10px!important;box-shadow:none;color:var(--slr-gray-50);cursor:pointer;display:inline-block;font-family:var(--slr-font-family);font-size:13px!important;font-weight:400!important;height:40px;line-height:18px!important;margin:0 0 0 12px!important;min-width:72px;outline:none;padding:0 12px 0 32px!important;vertical-align:middle}.slr-rt-table .tabulator .tabulator-footer .tabulator-page-size:focus,.slr-rt-table .tabulator .tabulator-footer .tabulator-page-size:hover{border-color:var(--slr-blue-50)!important}.slr-rt-table .tabulator .tabulator-footer .tabulator-pages{align-items:center;display:inline-flex;gap:4px;margin:0 4px!important;vertical-align:middle}.slr-rt-table .tabulator .tabulator-footer .tabulator-page{align-items:center;background:var(--slr-white)!important;border:1px solid var(--slr-gray-90)!important;border-radius:10px!important;box-shadow:none;color:var(--slr-gray-50)!important;cursor:pointer;display:inline-flex!important;font-family:var(--slr-font-family);font-size:13px;font-weight:500;height:36px;justify-content:center;line-height:1;margin:0 2px!important;min-width:36px;padding:0 12px!important;transition:background-color .15s ease,color .15s ease,border-color .15s ease;vertical-align:middle}.slr-rt-table .tabulator .tabulator-footer .tabulator-page:not(:disabled):hover{background:var(--slr-blue-97)!important;border-color:var(--slr-blue-50)!important;color:var(--slr-blue-50)!important}.slr-rt-table .tabulator .tabulator-footer .tabulator-page.active{background:var(--slr-blue-50)!important;border-color:var(--slr-blue-50)!important;color:var(--slr-white)!important}.slr-rt-table .tabulator .tabulator-footer .tabulator-page.disabled,.slr-rt-table .tabulator .tabulator-footer .tabulator-page:disabled{background:var(--slr-white)!important;color:var(--slr-gray-50)!important;cursor:default;opacity:.35}.slr-rt-table .tabulator-cell.slr-rt-col--keyword{overflow:hidden;white-space:nowrap}.slr-rt-keyword{align-items:center;color:var(--slr-blue-50);display:inline-flex;font-weight:500;gap:4px;max-width:100%;min-width:0;vertical-align:middle}.slr-rt-keyword__text{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.slr-rt-keyword__icon{color:var(--slr-red);flex-shrink:0;font-size:16px;height:16px;width:16px}.slr-rt-keyword__icon--target{color:var(--slr-blue)}.slr-rt-location{align-items:center;display:inline-flex;gap:6px;white-space:nowrap}.slr-rt-flag{font-size:14px;line-height:1}.slr-rt-device{font-size:18px;height:18px;width:18px}.slr-rt-device--desktop{color:var(--slr-orange)}.slr-rt-device--mobile{color:var(--slr-blue-50)}.slr-rt-rank{align-items:center;display:inline-flex;font-weight:700;gap:4px;justify-content:center}.slr-rt-rank__new{color:#e91e8c;font-size:9px;font-weight:700}.slr-rt-change{align-items:center;border-radius:4px;display:inline-flex;font-size:10px;font-weight:500;gap:2px;line-height:15px;padding:1px 5px}.slr-rt-change--up{background:var(--slr-green);color:var(--slr-white)}.slr-rt-change--down{background:var(--slr-red);color:var(--slr-white)}.slr-rt-change--up-text{background:transparent;color:var(--slr-green);padding:0}.slr-rt-change--down-text{background:transparent;color:var(--slr-red);padding:0}.slr-rt-change--empty,.slr-rt-change--zero{background:transparent;color:var(--slr-gray-60);padding:0}.slr-rt-dates{align-items:center;display:inline-flex;gap:4px}.slr-rt-dates--stack{flex-wrap:wrap;justify-content:center}.slr-rt-table .tabulator-cell[tabulator-field=ai_overview],.slr-rt-table .tabulator-cell[tabulator-field=snippets],.slr-rt-table .tabulator-cell[tabulator-field=tags]{overflow:hidden;white-space:normal}.slr-rt-aio{align-items:flex-start;color:var(--slr-gray-30);display:inline-flex;flex-direction:column;font-size:10px;font-weight:400;gap:2px;line-height:15px}.slr-rt-aio__presence{color:var(--slr-green)}.slr-rt-aio__links,.slr-rt-aio__presence{align-items:center;display:inline-flex;gap:2px}.slr-rt-aio .dashicons{font-size:15px;height:15px;width:15px}.slr-rt-aio__brand{background:rgba(80,177,66,.21);border-radius:4px;color:var(--slr-green);font-weight:400;padding:1px 3px}.slr-rt-url{display:block;max-width:100%;min-width:0;overflow:hidden;text-align:right;text-overflow:ellipsis;white-space:nowrap}.slr-rt-url a{color:var(--slr-blue-50);text-decoration:none}.slr-rt-tags{align-items:center;display:flex;flex-wrap:wrap;gap:2px;justify-content:flex-start;max-width:100%;min-width:0}.slr-rt-tag{border-radius:10px;color:var(--slr-blue-10);display:inline-block;font-size:11px;line-height:18px;max-width:100%;overflow:hidden;padding:1px 8px;text-overflow:ellipsis;white-space:nowrap}.slr-rt-local,.slr-rt-snippets{align-items:center;display:inline-flex;gap:4px}.slr-rt-snippet{font-size:16px;height:16px;width:16px}.slr-rt-snippet--muted{color:var(--slr-gray-60)}.slr-rt-snippet--user{color:var(--slr-blue-50)}.slr-rt-snippet--competitor{color:#edc92f}.slr-rt-cell-icon{font-size:16px;height:16px;width:16px}.slr-rt-cell-icon--muted{color:var(--slr-gray-60)}.slr-rt-cell-icon--danger{color:var(--slr-red)}.slr-rt-cell-icon--warn{color:#e91e8c}.slr-rt-local-link{color:inherit;text-decoration:none}.slr-rt-local-pos{font-weight:600}@media screen and (max-width:768px){.slr-rt-table-toolbar{justify-content:stretch}.slr-rt-table-toolbar__left,.slr-rt-table-toolbar__search{max-width:none;width:100%}.slr-rt-table .tabulator .tabulator-footer .tabulator-footer-contents{justify-content:center;min-height:0;padding:14px 12px!important}.slr-rt-table .tabulator .tabulator-footer .tabulator-page-counter,.slr-rt-table .tabulator .tabulator-footer .tabulator-paginator{flex:0 0 100%;justify-content:center;text-align:center}}@media screen and (max-width:1100px){.slr-rt-table-toolbar{flex-wrap:wrap}}.slr-rt-table .tabulator-row.slr-rt-row--clickable{cursor:pointer}.slr-rt-table .tabulator-row.slr-rt-row--active{background:var(--slr-blue-97)!important}.slr-kw-stats-modal.components-modal__frame{display:flex;flex-direction:column;max-height:94vh;max-width:94vw;width:min(1280px,94vw)}.slr-kw-stats-modal .components-modal__header{background:var(--slr-white);border-bottom:none;height:auto;justify-content:flex-end;min-height:44px;padding:12px 20px 0;position:relative!important;top:auto}.slr-kw-stats-modal .components-modal__header-heading{display:none}.slr-kw-stats-modal .components-modal__content{display:flex;flex-direction:column;margin-top:0!important;overflow:auto;padding:4px 32px 24px!important}.slr-kw-stats{min-height:360px;position:relative}.slr-kw-stats .slr-panel{margin-bottom:0;padding:16px 20px}.slr-kw-stats__heading{align-items:baseline;column-gap:8px;display:flex;font-size:18px;font-weight:600;line-height:1.3;margin:0 0 12px;padding:0}.slr-kw-stats__heading-label{color:var(--slr-gray-50);font-weight:500}.slr-kw-stats__heading-value{color:var(--slr-blue-10);font-weight:600}.slr-kw-stats__top{align-items:center;display:flex;flex-wrap:wrap;gap:16px;justify-content:space-between;margin:0 0 20px}.slr-kw-stats__attrs,.slr-kw-stats__target{align-items:center;background:var(--slr-white);border:1px solid var(--slr-gray-90);border-radius:4px;color:var(--slr-blue-10);display:flex;font-size:13px;line-height:1.3;padding:12px 20px}.slr-kw-stats__attrs{column-gap:20px}.slr-kw-stats__attr{align-items:center;column-gap:8px;display:inline-flex;white-space:nowrap}.slr-kw-stats__attr .dashicons{font-size:18px;height:18px;width:18px}.slr-kw-stats__attr--rank{font-weight:500}.slr-kw-stats__attr--rank strong{font-weight:600}.slr-kw-stats__target{column-gap:8px;max-width:42%}.slr-kw-stats__target-label{font-weight:500;white-space:nowrap}.slr-kw-stats__target-url{color:var(--slr-gray-50);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.slr-kw-stats__body{align-items:stretch;column-gap:12px;display:flex}.slr-kw-stats__body.is-loading{opacity:0;pointer-events:none}.slr-kw-stats__left{min-width:0;width:70%}.slr-kw-stats__right{display:flex;flex-direction:column;gap:12px;min-width:0;width:30%}.slr-kw-stats .slr-kw-stats-chart{height:280px;margin:8px 0 28px;overflow:hidden;position:relative}.slr-kw-stats-chart__canvas{height:248px;overflow:hidden}.slr-kw-stats-top10__title{align-items:center;color:var(--slr-blue-10);display:flex;flex-wrap:wrap;font-size:13px;font-weight:500;gap:8px;margin:8px 0 16px}.slr-kw-stats-top10__serp{align-items:center;color:var(--slr-blue-50);display:inline-flex;font-weight:500;gap:4px;text-decoration:none}.slr-kw-stats-top10__serp:hover{color:var(--slr-blue-50)}.slr-kw-stats-top10__serp .dashicons{font-size:16px;height:16px;width:16px}.slr-kw-stats-top10__panel{background:var(--slr-blue-95);border-radius:13px;height:280px;overflow:auto}.slr-kw-stats-modal .slr-kw-stats-top10__table{background:var(--slr-white);border-collapse:collapse;border-spacing:0;margin:0;width:100%}.slr-kw-stats-top10__table thead{background:var(--slr-blue-95);position:sticky;top:0;z-index:1}.slr-kw-stats-top10__table td,.slr-kw-stats-top10__table th{font-size:13px;font-weight:500;line-height:22px;padding:8px 12px;text-align:right;vertical-align:middle}.slr-kw-stats-top10__table th{background:var(--slr-blue-95);color:var(--slr-gray-30)}.slr-kw-stats-top10__table td{border-top:1px solid var(--slr-gray-95);color:var(--slr-blue-50)}.slr-kw-stats-top10__pos{text-align:center!important;width:88px}.slr-kw-stats-top10__row--strong td{font-weight:700}.slr-kw-stats-top10__link{color:var(--slr-blue-50);display:inline-block;max-width:100%;overflow:hidden;text-decoration:none;text-overflow:ellipsis;vertical-align:middle;white-space:nowrap}.slr-kw-stats-top10__link:hover{color:var(--slr-blue-50)}.slr-kw-stats-top10__link--mine{color:var(--slr-chart-orange)}.slr-kw-stats-top10__icon{font-size:16px;height:16px;margin-right:6px;vertical-align:middle;width:16px}.slr-kw-stats-top10__icon--target{color:var(--slr-blue)}.slr-kw-stats-top10__icon--cann{color:var(--slr-red)}.slr-kw-stats-stats__metrics{display:flex;flex-wrap:wrap;gap:8px 20px}.slr-kw-stats-stats__metric{align-items:baseline;column-gap:6px;display:inline-flex}.slr-kw-stats-stats__label{color:var(--slr-gray-50);font-size:12px;font-weight:500;line-height:16px}.slr-kw-stats-stats__value{color:var(--slr-blue-10);font-size:12px;font-weight:500;line-height:16px}.slr-kw-stats-stats__trend-title,.slr-kw-stats-tags__title{color:var(--slr-blue-10);font-size:13px;font-weight:500;margin-bottom:0;margin-top:16px}.slr-kw-stats-stats__trend{height:142px;margin-top:8px;overflow:hidden}.slr-kw-stats-tags{min-height:120px}.slr-kw-stats-tags__title{margin-bottom:12px;margin-top:0}.slr-kw-stats__empty{color:var(--slr-gray-50);font-size:13px;margin:8px 0 0}.slr-kw-stats__loader{align-items:center;display:flex;flex-direction:column;gap:12px;inset:80px 0 64px;justify-content:flex-start;padding-top:40px;position:absolute}.slr-kw-stats__loader p{color:var(--slr-gray-50);font-size:13px;margin:0}.slr-kw-stats__footer{align-items:center;display:flex;justify-content:space-between;margin-top:20px}.slr-kw-stats__nav.components-button.is-link{align-items:center;box-shadow:none;color:var(--slr-blue-50);column-gap:6px;display:inline-flex;font-size:13px;font-weight:500;text-decoration:none}.slr-kw-stats__nav.components-button.is-link:hover{color:var(--slr-blue-50)}@media screen and (max-width:960px){.slr-kw-stats__body{flex-direction:column;row-gap:12px}.slr-kw-stats__left,.slr-kw-stats__right{width:100%}.slr-kw-stats__target{display:none}.slr-kw-stats__attrs{flex-wrap:wrap;justify-content:space-between;row-gap:8px;width:100%}}.slr-addkw-modal.components-modal__frame{display:flex;flex-direction:column;max-height:94vh;max-width:80vw;width:min(1120px,80vw)}.slr-addkw-modal .components-modal__header{background:transparent;border-bottom:none;height:auto;justify-content:flex-end;right:auto;min-height:0;padding:16px 0 0 16px;position:absolute!important;left:0;top:0;width:auto}.slr-addkw-modal .components-modal__header-heading{display:none}.slr-addkw-modal .components-modal__content{display:flex;flex-direction:column;margin-top:0!important;overflow:auto;padding:20px 40px 28px!important}.slr-addkw{position:relative}.slr-addkw__busy{align-items:center;background:hsla(0,0%,100%,.65);display:flex;inset:0;justify-content:center;position:absolute;z-index:30}.slr-addkw-upgrade__title{font-size:16px;font-weight:600;margin:0 0 8px}.slr-addkw__header{align-items:center;column-gap:24px;display:flex;margin:0 0 20px;padding-left:36px}.slr-addkw__title{color:var(--slr-blue-10);font-size:18px;font-weight:600;line-height:1.3;margin:0}.slr-addkw__remaining{background:var(--slr-blue-95);border:1px solid var(--slr-blue-50);border-radius:4px;color:var(--slr-blue-10);font-size:12px;font-weight:400;padding:8px 12px}.slr-addkw__remaining-count{color:var(--slr-blue-40);font-weight:500}.slr-addkw__remaining.is-danger{background:#cb333354;border-color:var(--slr-red)}.slr-addkw__remaining.is-danger .slr-addkw__remaining-count{color:var(--slr-red)}.slr-addkw__body{align-items:stretch;display:flex}.slr-addkw__col{min-width:0;width:50%}.slr-addkw__col--left{border-left:1px solid var(--slr-gray-90);padding-left:40px}.slr-addkw__col--right{padding-right:40px}.slr-addkw-section__title{align-items:flex-start;color:var(--slr-blue-10);column-gap:10px;display:flex;font-size:13px;font-weight:500;line-height:1.4}.slr-addkw-section__number{border:1px solid var(--slr-blue-50);border-radius:4px;color:var(--slr-blue-50);flex:0 0 auto;font-size:13px;font-weight:500;line-height:20px;padding:0 7px}.slr-addkw-section__heading{font-weight:500}.slr-addkw-section__desc,.slr-addkw-section__optional{color:var(--slr-gray-50);font-weight:400}.slr-addkw-section__desc{font-size:11px;line-height:1.4;margin:6px 0 0}.slr-addkw-section--spaced{margin-top:48px}.slr-addkw-lined{background:var(--slr-white);border:1px solid var(--slr-gray-90);border-radius:10px;display:flex;margin-top:10px;min-height:210px;overflow:hidden}.slr-addkw-lined__nums{color:var(--slr-gray-50);display:flex;flex-direction:column;font-size:13px;font-weight:400;line-height:22px;margin-left:5px;min-width:29px;padding:8px 6px;text-align:left;-webkit-user-select:none;user-select:none}.slr-addkw-lined__input{background:transparent;border:none;box-shadow:none;color:var(--slr-blue-10);flex:1;font-size:13px;line-height:22px;margin:0;min-width:0;padding:8px 0 8px 12px;resize:none;width:100%}.slr-addkw-lined__input:focus{border:none;box-shadow:none;outline:none}.slr-addkw-error{color:var(--slr-red);font-size:11px;line-height:1.4;margin:6px 0 0}.slr-addkw-input{background:var(--slr-white);border:1px solid var(--slr-gray-90);border-radius:10px;box-shadow:none;color:var(--slr-blue-10);display:block;font-size:13px;line-height:1.4;margin-top:10px;padding:10px 12px;width:100%}.slr-addkw-input:focus{border-color:var(--slr-blue-50);box-shadow:none;outline:none}.slr-addkw-suggest{position:relative}.slr-addkw-suggest__list{background:var(--slr-white);border:1px solid var(--slr-gray-90);border-radius:0 0 10px 10px;box-shadow:var(--slr-shadow-panel);right:0;max-height:240px;overflow:auto;position:absolute;left:0;top:calc(100% - 2px);z-index:20}.slr-addkw-suggest__status{align-items:center;color:var(--slr-gray-50);display:flex;font-size:13px;justify-content:center;min-height:48px;padding:12px}.slr-addkw-suggest__item{align-items:flex-start;background:transparent;border:none;cursor:pointer;display:flex;flex-direction:column;padding:8px 12px;text-align:right;width:100%}.slr-addkw-suggest__item:focus,.slr-addkw-suggest__item:hover{background:var(--slr-blue-95)}.slr-addkw-suggest__item-main{align-items:center;color:var(--slr-blue-10);column-gap:8px;display:inline-flex;font-size:13px}.slr-addkw-suggest__item-meta{color:var(--slr-gray-50);font-size:11px;font-style:italic;margin-right:26px}.slr-addkw-chips{display:flex;flex-wrap:wrap;gap:8px;margin-top:16px}.slr-addkw-chip{align-items:center;background:var(--slr-white);border:1px solid #c7cadc;border-radius:10px;color:var(--slr-blue-10);column-gap:8px;display:inline-flex;font-size:14px;font-weight:400;padding:4px 10px;white-space:nowrap}.slr-addkw-chip__remove{background:transparent;border:none;color:var(--slr-blue-10);cursor:pointer;font-size:18px;line-height:1;padding:0 2px}.slr-addkw-device{border:1px solid var(--slr-gray-90);border-radius:10px;display:flex;height:38px;margin-top:10px;max-width:100%;overflow:hidden;width:338px}.slr-addkw-device__btn{align-items:center;background:var(--slr-white);border:none;color:var(--slr-gray-50);column-gap:8px;cursor:pointer;display:inline-flex;flex:1;font-size:13px;font-weight:500;justify-content:center}.slr-addkw-device__btn:first-child{border-radius:0 10px 10px 0}.slr-addkw-device__btn:last-child{border-radius:10px 0 0 10px}.slr-addkw-device__btn.is-selected,.slr-addkw-device__btn:hover{background:#3588e626;color:var(--slr-blue-50)}.slr-addkw-device__btn .dashicons{font-size:16px;height:16px;width:16px}.slr-addkw__footer{align-items:center;display:flex;flex-direction:column;margin-top:28px}.slr-addkw__submit.components-button{font-size:14px;font-weight:500;height:40px;justify-content:center;min-width:280px}.slr-addkw__note{align-items:center;background:var(--slr-gray-95);border-radius:10px;color:var(--slr-gray-30);column-gap:10px;display:flex;font-size:13px;justify-content:center;line-height:1.4;margin-top:24px;padding:16px;width:100%}.slr-addkw__note .dashicons{color:var(--slr-gray-30);font-size:18px;height:18px;width:18px}@media screen and (max-width:960px){.slr-addkw-modal.components-modal__frame{max-height:100vh;max-width:none;width:100%}.slr-addkw-modal .components-modal__content{padding:8px 16px 20px!important}.slr-addkw__body{flex-direction:column}.slr-addkw__col{width:100%}.slr-addkw__col--left{border-left:none;padding-left:0}.slr-addkw__col--right{margin-top:32px;padding-right:0}.slr-addkw-device,.slr-addkw__submit.components-button{width:100%}}
     4.slr-ai-visibility{max-width:none}.slr-ai-visibility__body{max-width:1600px;padding:20px 24px 40px}.slr-ai-visibility[aria-busy=true] .slr-ai-visibility__body{opacity:.65;pointer-events:none;transition:opacity .2s ease}.slr-aiv-card{margin-bottom:0;padding:20px;position:relative}.slr-aiv-card.is-collecting>:not(.slr-aiv-collecting){opacity:.35;pointer-events:none}.slr-aiv-collecting{align-items:center;background:hsla(0,0%,100%,.88);border-radius:var(--slr-radius-lg);display:flex;flex-direction:column;inset:0;justify-content:center;padding:24px;position:absolute;text-align:center;z-index:2}.slr-aiv-collecting--compact{padding:16px}.slr-aiv-collecting__spinner{animation:slr-aiv-spin .9s linear infinite;border:3px solid #e5e7eb;border-radius:50%;border-top:3px solid var(--slr-blue-50);display:inline-block;height:42px;margin-bottom:16px;width:42px}.slr-aiv-collecting--compact .slr-aiv-collecting__spinner{margin-bottom:0}.slr-aiv-collecting__text{color:var(--slr-gray-60);font-size:13px;margin:0}@keyframes slr-aiv-spin{to{transform:rotate(-1turn)}}.slr-aiv-top{align-items:stretch;column-gap:20px;display:flex;margin-bottom:20px}.slr-aiv-middle,.slr-aiv-top>.slr-aiv-card{flex:1 1 0;min-height:0;min-width:0}.slr-aiv-middle,.slr-aiv-top>.slr-aiv-card{display:flex;flex-direction:column}.slr-aiv-middle{row-gap:20px}.slr-aiv-middle>.slr-aiv-card{display:flex;flex-direction:column}.slr-aiv-mentions{flex:0 0 auto}.slr-aiv-coverage{flex:1 1 auto;min-height:0}.slr-aiv-comp__head>span:first-child,.slr-aiv-score__label,.slr-aiv-trend__label{color:var(--slr-gray-60);font-size:14px;font-weight:500}.slr-aiv-score__main{align-items:baseline;display:flex;gap:12px;margin-top:8px}.slr-aiv-score__value{color:var(--slr-blue-50);font-size:64px;font-weight:700;line-height:1}.slr-aiv-score__delta{align-items:center;border-radius:2px;display:inline-flex;font-size:13px;font-weight:500;padding:3px 10px}.slr-aiv-score__delta--up{background:var(--slr-green-bg);color:var(--slr-green)}.slr-aiv-score__delta--down{background:var(--slr-red-bg);color:var(--slr-red)}.slr-aiv-score__delta--flat{background:#efefef;color:var(--slr-gray-60)}.slr-aiv-score__breakdown{margin-top:20px}.slr-aiv-breakdown{align-items:center;border-top:1px dashed var(--slr-border-dashed);display:flex;justify-content:space-between;padding:10px 0}.slr-aiv-breakdown:first-child{border-top:none}.slr-aiv-breakdown__main{flex:1}.slr-aiv-breakdown__label{align-items:center;color:var(--slr-gray-60);display:flex;font-size:12px;gap:4px}.slr-aiv-breakdown__weight{color:#c2c7cf;font-weight:500}.slr-aiv-breakdown__bar{background:#eee;border-radius:3px;height:6px;margin-top:4px;overflow:hidden;width:100%}.slr-aiv-breakdown__bar>div{background:var(--slr-blue-50);height:100%}.slr-aiv-breakdown__value{color:var(--slr-gray-60);font-weight:500;margin-right:10px;text-align:left;width:40px}.slr-aiv-mentions__row{align-items:stretch;display:flex;flex:1;min-height:110px}.slr-aiv-metric{display:flex;flex:1;flex-direction:column;justify-content:center;text-align:center}.slr-aiv-metric__label{color:var(--slr-gray-60);font-size:12px;margin-bottom:8px}.slr-aiv-metric__num{font-size:40px;font-weight:800;letter-spacing:-.03em;line-height:1}.slr-aiv-metric__den{color:#c2c7cf;font-size:16px;font-weight:600}.slr-aiv-mentions__divider{background:#eee;margin:0 4px;width:1px}.slr-aiv-coverage__kicker{color:var(--slr-gray-60);font-size:11px;font-weight:700;letter-spacing:.6px;margin-bottom:8px;text-transform:uppercase}.slr-aiv-coverage__count{align-items:baseline;display:flex;flex-wrap:wrap;gap:8px;margin-bottom:14px}.slr-aiv-coverage__num{font-size:40px;font-weight:800;letter-spacing:-.03em;line-height:1}.slr-aiv-coverage__den{color:#c2c7cf;font-size:18px;font-weight:700}.slr-aiv-coverage__sub{color:var(--slr-gray-60);font-size:13px;font-weight:500}.slr-aiv-coverage__bar{display:flex;gap:5px;margin-bottom:16px}.slr-aiv-coverage__seg{border-radius:3px;flex:1;height:10px}.slr-aiv-coverage__list{display:grid;gap:8px 12px;grid-template-columns:repeat(auto-fit,minmax(120px,1fr))}.slr-aiv-coverage__item{align-items:center;display:flex;font-size:12px;gap:6px;min-width:0}.slr-aiv-coverage__item.is-muted{opacity:.55}.slr-aiv-coverage__name{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.slr-aiv-llm-icon{background:no-repeat 50%/contain;display:inline-block;flex:none;height:16px;width:16px}.slr-aiv-llm-icon--chatgpt{background-image:url(data:image/svg+xml;base64,PHN2ZyBmaWxsPSJjdXJyZW50Q29sb3IiIGZpbGwtcnVsZT0iZXZlbm9kZCIgaGVpZ2h0PSIxZW0iIHN0eWxlPSJmbGV4Om5vbmU7bGluZS1oZWlnaHQ6MSIgdmlld0JveD0iMCAwIDI0IDI0IiB3aWR0aD0iMWVtIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjx0aXRsZT5PcGVuQUk8L3RpdGxlPjxwYXRoIGQ9Ik05LjIwNSA4LjY1OHYtMi4yNmMwLS4xOS4wNzItLjMzMy4yMzgtLjQyOGw0LjU0My0yLjYxNmMuNjE5LS4zNTcgMS4zNTYtLjUyMyAyLjExNy0uNTIzIDIuODU0IDAgNC42NjIgMi4yMTIgNC42NjIgNC41NjYgMCAuMTY3IDAgLjM1Ny0uMDI0LjU0N2wtNC43MS0yLjc1OWEuNzk3Ljc5NyAwIDAwLS44NTYgMGwtNS45NyAzLjQ3M3ptMTAuNjA5IDguOFYxMi4wNmMwLS4zMzMtLjE0My0uNTctLjQyOS0uNzM3bC01Ljk3LTMuNDczIDEuOTUtMS4xMThhLjQzMy40MzMgMCAwMS40NzYgMGw0LjU0MyAyLjYxN2MxLjMwOS43NiAyLjE4OSAyLjM3OCAyLjE4OSAzLjk0OCAwIDEuODA4LTEuMDcgMy40NzMtMi43NiA0LjE2M3pNNy44MDIgMTIuNzAzbC0xLjk1LTEuMTQyYy0uMTY3LS4wOTUtLjIzOS0uMjM4LS4yMzktLjQyOFY1Ljg5OWMwLTIuNTQ1IDEuOTUtNC40NzIgNC41OTEtNC40NzIgMSAwIDEuOTI3LjMzMyAyLjcxMi45MjhMOC4yMyA1LjA2N2MtLjI4NS4xNjYtLjQyOC40MDQtLjQyOC43Mzd2Ni44OTh6TTEyIDE1LjEyOGwtMi43OTUtMS41N3YtMy4zM0wxMiA4LjY1OGwyLjc5NSAxLjU3djMuMzNMMTIgMTUuMTI4em0xLjc5NiA3LjIzYy0xIDAtMS45MjctLjMzMi0yLjcxMi0uOTI3bDQuNjg2LTIuNzEyYy4yODUtLjE2Ni40MjgtLjQwNC40MjgtLjczN3YtNi44OThsMS45NzQgMS4xNDJjLjE2Ny4wOTUuMjM4LjIzOC4yMzguNDI4djUuMjMzYzAgMi41NDUtMS45NzQgNC40NzItNC42MTQgNC40NzJ6bS01LjYzNy01LjMwM2wtNC41NDQtMi42MTdjLTEuMzA4LS43NjEtMi4xODgtMi4zNzgtMi4xODgtMy45NDhBNC40ODIgNC40ODIgMCAwMTQuMjEgNi4zMjd2NS40MjNjMCAuMzMzLjE0My41NzEuNDI4LjczOGw1Ljk0NyAzLjQ0OS0xLjk1IDEuMTE4YS40MzIuNDMyIDAgMDEtLjQ3NiAwem0tLjI2MiAzLjljLTIuNjg4IDAtNC42NjItMi4wMjEtNC42NjItNC41MTkgMC0uMTkuMDI0LS4zOC4wNDctLjU3bDQuNjg2IDIuNzFjLjI4Ni4xNjcuNTcxLjE2Ny44NTYgMGw1Ljk3LTMuNDQ4djIuMjZjMCAuMTktLjA3LjMzMy0uMjM3LjQyOGwtNC41NDMgMi42MTZjLS42MTkuMzU3LTEuMzU2LjUyMy0yLjExNy41MjN6bTUuODk5IDIuODNhNS45NDcgNS45NDcgMCAwMDUuODI3LTQuNzU2QzIyLjI4NyAxOC4zMzkgMjQgMTUuODQgMjQgMTMuMjk2YzAtMS42NjUtLjcxMy0zLjI4Mi0xLjk5OC00LjQ0OC4xMTktLjUuMTktLjk5OS4xOS0xLjQ5OCAwLTMuNDAxLTIuNzU5LTUuOTQ3LTUuOTQ2LTUuOTQ3LS42NDIgMC0xLjI2LjA5NS0xLjg4LjMxQTUuOTYyIDUuOTYyIDAgMDAxMC4yMDUgMGE1Ljk0NyA1Ljk0NyAwIDAwLTUuODI3IDQuNzU3QzEuNzEzIDUuNDQ3IDAgNy45NDUgMCAxMC40OWMwIDEuNjY2LjcxMyAzLjI4MyAxLjk5OCA0LjQ0OC0uMTE5LjUtLjE5IDEtLjE5IDEuNDk5IDAgMy40MDEgMi43NTkgNS45NDYgNS45NDYgNS45NDYuNjQyIDAgMS4yNi0uMDk1IDEuODgtLjMwOWE1Ljk2IDUuOTYgMCAwMDQuMTYyIDEuNzEzeiI+PC9wYXRoPjwvc3ZnPg==)}.slr-aiv-llm-icon--claude{background-image:url(data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjFlbSIgc3R5bGU9ImZsZXg6bm9uZTtsaW5lLWhlaWdodDoxIiB2aWV3Qm94PSIwIDAgMjQgMjQiIHdpZHRoPSIxZW0iIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHRpdGxlPkNsYXVkZTwvdGl0bGU+PHBhdGggZD0iTTQuNzA5IDE1Ljk1NWw0LjcyLTIuNjQ3LjA4LS4yMy0uMDgtLjEyOEg5LjJsLS43OS0uMDQ4LTIuNjk4LS4wNzMtMi4zMzktLjA5Ny0yLjI2Ni0uMTIyLS41NzEtLjEyMUwwIDExLjc4NGwuMDU1LS4zNTIuNDgtLjMyMS42ODYuMDYgMS41Mi4xMDMgMi4yNzguMTU4IDEuNjUyLjA5NyAyLjQ0OS4yNTVoLjM4OWwuMDU1LS4xNTctLjEzNC0uMDk4LS4xMDMtLjA5Ny0yLjM1OC0xLjU5Ni0yLjU1Mi0xLjY4OC0xLjMzNi0uOTcyLS43MjQtLjQ5MS0uMzY0LS40NjItLjE1OC0xLjAwOC42NTYtLjcyMi44ODEuMDYuMjI1LjA2MS44OTMuNjg2IDEuOTA4IDEuNDc2IDIuNDkxIDEuODMzLjM2NS4zMDQuMTQ1LS4xMDMuMDE5LS4wNzMtLjE2NC0uMjc0LTEuMzU1LTIuNDQ2LTEuNDQ2LTIuNDktLjY0NC0xLjAzMi0uMTctLjYxOWEyLjk3IDIuOTcgMCAwMS0uMTA0LS43MjlMNi4yODMuMTM0IDYuNjk2IDBsLjk5Ni4xMzQuNDIuMzY0LjYyIDEuNDE0IDEuMDAyIDIuMjI5IDEuNTU1IDMuMDMuNDU2Ljg5OC4yNDMuODMyLjA5MS4yNTVoLjE1OFY5LjAxbC4xMjgtMS43MDYuMjM3LTIuMDk1LjIzLTIuNjk1LjA4LS43Ni4zNzYtLjkxLjc0Ny0uNDkyLjU4NC4yOC40OC42ODUtLjA2Ny40NDQtLjI4NiAxLjg1MS0uNTU5IDIuOTAzLS4zNjQgMS45NDJoLjIxMmwuMjQzLS4yNDIuOTg1LTEuMzA2IDEuNjUyLTIuMDY0LjczLS44Mi44NS0uOTA0LjU0Ny0uNDMxaDEuMDMzbC43NiAxLjEyOS0uMzQgMS4xNjYtMS4wNjQgMS4zNDctLjg4MSAxLjE0Mi0xLjI2NCAxLjctLjc5IDEuMzYuMDczLjExLjE4OC0uMDIgMi44NTYtLjYwNiAxLjU0My0uMjggMS44NDEtLjMxNS44MzMuMzg4LjA5MS4zOTUtLjMyOC44MDctMS45NjkuNDg2LTIuMzA5LjQ2Mi0zLjQzOS44MTMtLjA0Mi4wMy4wNDkuMDYxIDEuNTQ5LjE0Ni42NjIuMDM2aDEuNjIybDMuMDIuMjI1Ljc5LjUyMi40NzQuNjM4LS4wNzkuNDg1LTEuMjE1LjYyLTEuNjQtLjM4OS0zLjgyOS0uOTEtMS4zMTItLjMyOWgtLjE4MnYuMTFsMS4wOTMgMS4wNjggMi4wMDYgMS44MSAyLjUwOSAyLjMzLjEyNy41NzgtLjMyMi40NTUtLjM0LS4wNDktMi4yMDUtMS42NTctLjg1MS0uNzQ3LTEuOTI2LTEuNjJoLS4xMjh2LjE3bC40NDQuNjQ5IDIuMzQ1IDMuNTIxLjEyMiAxLjA4LS4xNy4zNTMtLjYwOC4yMTMtLjY2OC0uMTIyLTEuMzc0LTEuOTI1LTEuNDE1LTIuMTY3LTEuMTQzLTEuOTQzLS4xNC4wOC0uNjc0IDcuMjU0LS4zMTYuMzctLjcyOS4yOC0uNjA3LS40NjEtLjMyMi0uNzQ3LjMyMi0xLjQ3Ni4zODktMS45MjQuMzE1LTEuNTMuMjg2LTEuOS4xNy0uNjMyLS4wMTItLjA0Mi0uMTQuMDE4LTEuNDM0IDEuOTY3LTIuMTggMi45NDUtMS43MjYgMS44NDUtLjQxNC4xNjQtLjcxNy0uMzcuMDY3LS42NjIuNDAxLS41ODkgMi4zODgtMy4wMzYgMS40NC0xLjg4Mi45My0xLjA4Ni0uMDA2LS4xNThoLS4wNTVMNC4xMzIgMTguNTZsLTEuMTMuMTQ2LS40ODctLjQ1Ni4wNjEtLjc0Ni4yMzEtLjI0MyAxLjkwOC0xLjMxMi0uMDA2LjAwNnoiIGZpbGw9IiNEOTc3NTciIGZpbGwtcnVsZT0ibm9uemVybyI+PC9wYXRoPjwvc3ZnPg==)}.slr-aiv-llm-icon--gemini{background-image:url(data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjFlbSIgc3R5bGU9ImZsZXg6bm9uZTtsaW5lLWhlaWdodDoxIiB2aWV3Qm94PSIwIDAgMjQgMjQiIHdpZHRoPSIxZW0iIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHRpdGxlPkdlbWluaTwvdGl0bGU+PHBhdGggZD0iTTIwLjYxNiAxMC44MzVhMTQuMTQ3IDE0LjE0NyAwIDAxLTQuNDUtMy4wMDEgMTQuMTExIDE0LjExMSAwIDAxLTMuNjc4LTYuNDUyLjUwMy41MDMgMCAwMC0uOTc1IDAgMTQuMTM0IDE0LjEzNCAwIDAxLTMuNjc5IDYuNDUyIDE0LjE1NSAxNC4xNTUgMCAwMS00LjQ1IDMuMDAxYy0uNjUuMjgtMS4zMTguNTA1LTIuMDAyLjY3OGEuNTAyLjUwMiAwIDAwMCAuOTc1Yy42ODQuMTcyIDEuMzUuMzk3IDIuMDAyLjY3N2ExNC4xNDcgMTQuMTQ3IDAgMDE0LjQ1IDMuMDAxIDE0LjExMiAxNC4xMTIgMCAwMTMuNjc5IDYuNDUzLjUwMi41MDIgMCAwMC45NzUgMGMuMTcyLS42ODUuMzk3LTEuMzUxLjY3Ny0yLjAwM2ExNC4xNDUgMTQuMTQ1IDAgMDEzLjAwMS00LjQ1IDE0LjExMyAxNC4xMTMgMCAwMTYuNDUzLTMuNjc4LjUwMy41MDMgMCAwMDAtLjk3NSAxMy4yNDUgMTMuMjQ1IDAgMDEtMi4wMDMtLjY3OHoiIGZpbGw9IiMzMTg2RkYiPjwvcGF0aD48cGF0aCBkPSJNMjAuNjE2IDEwLjgzNWExNC4xNDcgMTQuMTQ3IDAgMDEtNC40NS0zLjAwMSAxNC4xMTEgMTQuMTExIDAgMDEtMy42NzgtNi40NTIuNTAzLjUwMyAwIDAwLS45NzUgMCAxNC4xMzQgMTQuMTM0IDAgMDEtMy42NzkgNi40NTIgMTQuMTU1IDE0LjE1NSAwIDAxLTQuNDUgMy4wMDFjLS42NS4yOC0xLjMxOC41MDUtMi4wMDIuNjc4YS41MDIuNTAyIDAgMDAwIC45NzVjLjY4NC4xNzIgMS4zNS4zOTcgMi4wMDIuNjc3YTE0LjE0NyAxNC4xNDcgMCAwMTQuNDUgMy4wMDEgMTQuMTEyIDE0LjExMiAwIDAxMy42NzkgNi40NTMuNTAyLjUwMiAwIDAwLjk3NSAwYy4xNzItLjY4NS4zOTctMS4zNTEuNjc3LTIuMDAzYTE0LjE0NSAxNC4xNDUgMCAwMTMuMDAxLTQuNDUgMTQuMTEzIDE0LjExMyAwIDAxNi40NTMtMy42NzguNTAzLjUwMyAwIDAwMC0uOTc1IDEzLjI0NSAxMy4yNDUgMCAwMS0yLjAwMy0uNjc4eiIgZmlsbD0idXJsKCNsb2JlLWljb25zLWdlbWluaS0wLV9SXzBfKSI+PC9wYXRoPjxwYXRoIGQ9Ik0yMC42MTYgMTAuODM1YTE0LjE0NyAxNC4xNDcgMCAwMS00LjQ1LTMuMDAxIDE0LjExMSAxNC4xMTEgMCAwMS0zLjY3OC02LjQ1Mi41MDMuNTAzIDAgMDAtLjk3NSAwIDE0LjEzNCAxNC4xMzQgMCAwMS0zLjY3OSA2LjQ1MiAxNC4xNTUgMTQuMTU1IDAgMDEtNC40NSAzLjAwMWMtLjY1LjI4LTEuMzE4LjUwNS0yLjAwMi42NzhhLjUwMi41MDIgMCAwMDAgLjk3NWMuNjg0LjE3MiAxLjM1LjM5NyAyLjAwMi42NzdhMTQuMTQ3IDE0LjE0NyAwIDAxNC40NSAzLjAwMSAxNC4xMTIgMTQuMTEyIDAgMDEzLjY3OSA2LjQ1My41MDIuNTAyIDAgMDAuOTc1IDBjLjE3Mi0uNjg1LjM5Ny0xLjM1MS42NzctMi4wMDNhMTQuMTQ1IDE0LjE0NSAwIDAxMy4wMDEtNC40NSAxNC4xMTMgMTQuMTEzIDAgMDE2LjQ1My0zLjY3OC41MDMuNTAzIDAgMDAwLS45NzUgMTMuMjQ1IDEzLjI0NSAwIDAxLTIuMDAzLS42Nzh6IiBmaWxsPSJ1cmwoI2xvYmUtaWNvbnMtZ2VtaW5pLTEtX1JfMF8pIj48L3BhdGg+PHBhdGggZD0iTTIwLjYxNiAxMC44MzVhMTQuMTQ3IDE0LjE0NyAwIDAxLTQuNDUtMy4wMDEgMTQuMTExIDE0LjExMSAwIDAxLTMuNjc4LTYuNDUyLjUwMy41MDMgMCAwMC0uOTc1IDAgMTQuMTM0IDE0LjEzNCAwIDAxLTMuNjc5IDYuNDUyIDE0LjE1NSAxNC4xNTUgMCAwMS00LjQ1IDMuMDAxYy0uNjUuMjgtMS4zMTguNTA1LTIuMDAyLjY3OGEuNTAyLjUwMiAwIDAwMCAuOTc1Yy42ODQuMTcyIDEuMzUuMzk3IDIuMDAyLjY3N2ExNC4xNDcgMTQuMTQ3IDAgMDE0LjQ1IDMuMDAxIDE0LjExMiAxNC4xMTIgMCAwMTMuNjc5IDYuNDUzLjUwMi41MDIgMCAwMC45NzUgMGMuMTcyLS42ODUuMzk3LTEuMzUxLjY3Ny0yLjAwM2ExNC4xNDUgMTQuMTQ1IDAgMDEzLjAwMS00LjQ1IDE0LjExMyAxNC4xMTMgMCAwMTYuNDUzLTMuNjc4LjUwMy41MDMgMCAwMDAtLjk3NSAxMy4yNDUgMTMuMjQ1IDAgMDEtMi4wMDMtLjY3OHoiIGZpbGw9InVybCgjbG9iZS1pY29ucy1nZW1pbmktMi1fUl8wXykiPjwvcGF0aD48ZGVmcz48bGluZWFyR3JhZGllbnQgZ3JhZGllbnRVbml0cz0idXNlclNwYWNlT25Vc2UiIGlkPSJsb2JlLWljb25zLWdlbWluaS0wLV9SXzBfIiB4MT0iNyIgeDI9IjExIiB5MT0iMTUuNSIgeTI9IjEyIj48c3RvcCBzdG9wLWNvbG9yPSIjMDhCOTYyIj48L3N0b3A+PHN0b3Agb2Zmc2V0PSIxIiBzdG9wLWNvbG9yPSIjMDhCOTYyIiBzdG9wLW9wYWNpdHk9IjAiPjwvc3RvcD48L2xpbmVhckdyYWRpZW50PjxsaW5lYXJHcmFkaWVudCBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSIgaWQ9ImxvYmUtaWNvbnMtZ2VtaW5pLTEtX1JfMF8iIHgxPSI4IiB4Mj0iMTEuNSIgeTE9IjUuNSIgeTI9IjExIj48c3RvcCBzdG9wLWNvbG9yPSIjRjk0NTQzIj48L3N0b3A+PHN0b3Agb2Zmc2V0PSIxIiBzdG9wLWNvbG9yPSIjRjk0NTQzIiBzdG9wLW9wYWNpdHk9IjAiPjwvc3RvcD48L2xpbmVhckdyYWRpZW50PjxsaW5lYXJHcmFkaWVudCBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSIgaWQ9ImxvYmUtaWNvbnMtZ2VtaW5pLTItX1JfMF8iIHgxPSIzLjUiIHgyPSIxNy41IiB5MT0iMTMuNSIgeTI9IjEyIj48c3RvcCBzdG9wLWNvbG9yPSIjRkFCQzEyIj48L3N0b3A+PHN0b3Agb2Zmc2V0PSIuNDYiIHN0b3AtY29sb3I9IiNGQUJDMTIiIHN0b3Atb3BhY2l0eT0iMCI+PC9zdG9wPjwvbGluZWFyR3JhZGllbnQ+PC9kZWZzPjwvc3ZnPg==)}.slr-aiv-llm-icon--perplexity{background-image:url(data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjFlbSIgc3R5bGU9ImZsZXg6bm9uZTtsaW5lLWhlaWdodDoxIiB2aWV3Qm94PSIwIDAgMjQgMjQiIHdpZHRoPSIxZW0iIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHRpdGxlPlBlcnBsZXhpdHk8L3RpdGxlPjxwYXRoIGQ9Ik0xOS43ODUgMHY3LjI3MkgyMi41VjE3LjYyaC0yLjkzNVYyNGwtNy4wMzctNi4xOTR2Ni4xNDVoLTEuMDkxdi02LjE1Mkw0LjM5MiAyNHYtNi40NjVIMS41VjcuMTg4aDIuODg0VjBsNy4wNTMgNi40OTRWLjE5aDEuMDl2Ni40OUwxOS43ODYgMHptLTcuMjU3IDkuMDQ0djcuMzE5bDUuOTQ2IDUuMjM0VjE0LjQ0bC01Ljk0Ni01LjM5N3ptLTEuMDk5LS4wOGwtNS45NDYgNS4zOTh2Ny4yMzVsNS45NDYtNS4yMzRWOC45NjV6bTguMTM2IDcuNThoMS44NDRWOC4zNDlIMTMuNDZsNi4xMDUgNS41NHYyLjY1NXptLTguOTgyLTguMjhIMi41OXY4LjE5NWgxLjh2LTIuNTc2bDYuMTkyLTUuNjJ6TTUuNDc1IDIuNDc2djQuNzFoNS4xMTVsLTUuMTE1LTQuNzF6bTEzLjIxOSAwbC01LjExNSA0LjcxaDUuMTE1di00LjcxeiIgZmlsbD0iIzIyQjhDRCIgZmlsbC1ydWxlPSJub256ZXJvIj48L3BhdGg+PC9zdmc+)}.slr-aiv-llm-icon--grok{background-image:url(data:image/svg+xml;base64,PHN2ZyBmaWxsPSJjdXJyZW50Q29sb3IiIGZpbGwtcnVsZT0iZXZlbm9kZCIgaGVpZ2h0PSIxZW0iIHN0eWxlPSJmbGV4Om5vbmU7bGluZS1oZWlnaHQ6MSIgdmlld0JveD0iMCAwIDI0IDI0IiB3aWR0aD0iMWVtIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjx0aXRsZT5Hcm9rPC90aXRsZT48cGF0aCBkPSJNOS4yNyAxNS4yOWw3Ljk3OC01Ljg5N2MuMzkxLS4yOS45NS0uMTc3IDEuMTM3LjI3Mi45OCAyLjM2OS41NDIgNS4yMTUtMS40MSA3LjE2OS0xLjk1MSAxLjk1NC00LjY2NyAyLjM4Mi03LjE0OSAxLjQwNmwtMi43MTEgMS4yNTdjMy44ODkgMi42NjEgOC42MTEgMi4wMDMgMTEuNTYyLS45NTMgMi4zNDEtMi4zNDQgMy4wNjYtNS41MzkgMi4zODgtOC40MmwuMDA2LjAwN2MtLjk4My00LjIzMi4yNDItNS45MjQgMi43NS05LjM4My4wNi0uMDgyLjEyLS4xNjQuMTc5LS4yNDhsLTMuMzAxIDMuMzA1di0uMDFMOS4yNjcgMTUuMjkyTTcuNjIzIDE2LjcyM2MtMi43OTItMi42Ny0yLjMxLTYuODAxLjA3MS05LjE4NCAxLjc2MS0xLjc2MyA0LjY0Ny0yLjQ4MyA3LjE2Ni0xLjQyNWwyLjcwNS0xLjI1YTcuODA4IDcuODA4IDAgMDAtMS44MjktMUE4Ljk3NSA4Ljk3NSAwIDAwNS45ODQgNS44M2MtMi41MzMgMi41MzYtMy4zMyA2LjQzNi0xLjk2MiA5Ljc2NCAxLjAyMiAyLjQ4Ny0uNjUzIDQuMjQ2LTIuMzQgNi4wMjItLjU5OS42My0xLjE5OSAxLjI1OS0xLjY4MiAxLjkyNWw3LjYyLTYuODE1Ij48L3BhdGg+PC9zdmc+)}.slr-aiv-llm-icon--deepseek{background-image:url(data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjFlbSIgc3R5bGU9ImZsZXg6bm9uZTtsaW5lLWhlaWdodDoxIiB2aWV3Qm94PSIwIDAgMjQgMjQiIHdpZHRoPSIxZW0iIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHRpdGxlPkRlZXBTZWVrPC90aXRsZT48cGF0aCBkPSJNMjMuNzQ4IDQuNDgyYy0uMjU0LS4xMjQtLjM2NC4xMTMtLjUxMi4yMzQtLjA1MS4wMzktLjA5NC4wOS0uMTM3LjEzNi0uMzcyLjM5Ny0uODA2LjY1Ny0xLjM3My42MjYtLjgyOS0uMDQ2LTEuNTM3LjIxNC0yLjE2My44NDgtLjEzMy0uNzgyLS41NzUtMS4yNDgtMS4yNDctMS41NDgtLjM1Mi0uMTU2LS43MDgtLjMxMS0uOTU1LS42NS0uMTcyLS4yNDEtLjIxOS0uNTEtLjMwNS0uNzc0LS4wNTUtLjE2LS4xMS0uMzIzLS4yOTMtLjM1LS4yLS4wMzEtLjI3OC4xMzYtLjM1Ni4yNzYtLjMxMy41NzItLjQzNCAxLjIwMi0uNDIyIDEuODQuMDI3IDEuNDM2LjYzMyAyLjU4IDEuODM4IDMuMzkzLjEzNy4wOTMuMTcyLjE4Ny4xMjkuMzIzLS4wODIuMjgtLjE4LjU1Mi0uMjY2LjgzMy0uMDU1LjE3OS0uMTM3LjIxNy0uMzI5LjE0YTUuNTI2IDUuNTI2IDAgMDEtMS43MzYtMS4xOGMtLjg1Ny0uODI4LTEuNjMxLTEuNzQyLTIuNTk3LTIuNDU4YTExLjM2NSAxMS4zNjUgMCAwMC0uNjg5LS40NzFjLS45ODUtLjk1Ny4xMy0xLjc0My4zODgtMS44MzYuMjctLjA5OC4wOTMtLjQzMi0uNzc5LS40MjgtLjg3Mi4wMDQtMS42Ny4yOTUtMi42ODcuNjg0YTMuMDU1IDMuMDU1IDAgMDEtLjQ2NS4xMzcgOS41OTcgOS41OTcgMCAwMC0yLjg4My0uMTAyYy0xLjg4NS4yMS0zLjM5IDEuMTAyLTQuNDk3IDIuNjIzQy4wODIgOC42MDYtLjIzMSAxMC42ODQuMTUyIDEyLjg1Yy40MDMgMi4yODQgMS41NjkgNC4xNzUgMy4zNiA1LjY1MyAxLjg1OCAxLjUzMyAzLjk5NyAyLjI4NCA2LjQzOCAyLjE0IDEuNDgyLS4wODUgMy4xMzMtLjI4NCA0Ljk5NC0xLjg2LjQ3LjIzNC45NjIuMzI3IDEuNzguMzk3LjYzLjA1OSAxLjIzNi0uMDMgMS43MDUtLjEyOC43MzUtLjE1Ni42ODQtLjgzNy40MTktLjk2MS0yLjE1NS0xLjAwNC0xLjY4Mi0uNTk1LTIuMTEzLS45MjYgMS4wOTYtMS4yOTYgMi43NDYtMi42NDIgMy4zOTItNy4wMDMuMDUtLjM0Ny4wMDctLjU2NSAwLS44NDUtLjAwNC0uMTcuMDM1LS4yMzcuMjMtLjI1NmE0LjE3MyA0LjE3MyAwIDAwMS41NDUtLjQ3NWMxLjM5Ni0uNzYzIDEuOTYtMi4wMTUgMi4wOTMtMy41MTcuMDItLjIzLS4wMDQtLjQ2Ny0uMjQ3LS41ODh6TTExLjU4MSAxOGMtMi4wODktMS42NDItMy4xMDItMi4xODMtMy41Mi0yLjE2LS4zOTIuMDI0LS4zMjEuNDcxLS4yMzUuNzYzLjA5LjI4OC4yMDcuNDg2LjM3MS43MzkuMTE0LjE2Ny4xOTIuNDE2LS4xMTMuNjAzLS42NzMuNDE2LTEuODQyLS4xNC0xLjg5Ny0uMTY3LTEuMzYxLS44MDItMi41LTEuODYtMy4zMDEtMy4zMDctLjc3NC0xLjM5My0xLjIyNC0yLjg4Ny0xLjI5OC00LjQ4Mi0uMDItLjM4Ni4wOTMtLjUyMi40NzctLjU5MmE0LjY5NiA0LjY5NiAwIDAxMS41MjktLjAzOWMyLjEzMi4zMTIgMy45NDYgMS4yNjUgNS40NjggMi43NzQuODY4Ljg2IDEuNTI1IDEuODg3IDIuMjAyIDIuODkxLjcyIDEuMDY2IDEuNDk0IDIuMDgyIDIuNDggMi45MTQuMzQ4LjI5Mi42MjUuNTE0Ljg5MS42NzctLjgwMi4wOS0yLjE0LjExLTMuMDU0LS42MTR6bTEtNi40NGEuMzA2LjMwNiAwIDAxLjQxNS0uMjg3LjMwMi4zMDIgMCAwMS4yLjI4OC4zMDYuMzA2IDAgMDEtLjMxLjMwNy4zMDMuMzAzIDAgMDEtLjMwNC0uMzA4em0zLjExIDEuNTk2Yy0uMi4wODEtLjM5OS4xNTEtLjU5LjE2YTEuMjQ1IDEuMjQ1IDAgMDEtLjc5OC0uMjU0Yy0uMjc0LS4yMy0uNDctLjM1OC0uNTUyLS43NThhMS43MyAxLjczIDAgMDEuMDE2LS41ODhjLjA3LS4zMjctLjAwOC0uNTM3LS4yMzktLjcyNy0uMTg3LS4xNTYtLjQyNi0uMTk5LS42ODgtLjE5OWEuNTU5LjU1OSAwIDAxLS4yNTQtLjA3OGMtLjExLS4wNTQtLjItLjE5LS4xMTQtLjM1OC4wMjgtLjA1NC4xNi0uMTg2LjE5Mi0uMjEuMzU2LS4yMDIuNzY3LS4xMzYgMS4xNDYuMDE2LjM1Mi4xNDQuNjE4LjQwOCAxLjAwMS43ODIuMzkxLjQ1MS40NjIuNTc2LjY4NS45MTQuMTc2LjI2NS4zMzYuNTM3LjQ0NS44NDguMDY3LjE5NS0uMDE5LjM1NC0uMjUuNDUyeiIgZmlsbD0iIzRENkJGRSI+PC9wYXRoPjwvc3ZnPg==)}.slr-aiv-llm-icon--google{background-image:url(data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjFlbSIgc3R5bGU9ImZsZXg6bm9uZTtsaW5lLWhlaWdodDoxIiB2aWV3Qm94PSIwIDAgMjQgMjQiIHdpZHRoPSIxZW0iIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHRpdGxlPkdvb2dsZTwvdGl0bGU+PHBhdGggZD0iTTIzIDEyLjI0NWMwLS45MDUtLjA3NS0xLjU2NS0uMjM2LTIuMjVoLTEwLjU0djQuMDgzaDYuMTg2Yy0uMTI0IDEuMDE0LS43OTcgMi41NDItMi4yOTQgMy41NjlsLS4wMjEuMTM2IDMuMzMyIDIuNTMuMjMuMDIyQzIxLjc3OSAxOC40MTcgMjMgMTUuNTkzIDIzIDEyLjI0NXoiIGZpbGw9IiM0Mjg1RjQiPjwvcGF0aD48cGF0aCBkPSJNMTIuMjI1IDIzYzMuMDMgMCA1LjU3NC0uOTc4IDcuNDMzLTIuNjY1bC0zLjU0Mi0yLjY4OGMtLjk0OC42NDgtMi4yMiAxLjEtMy44OTEgMS4xYTYuNzQ1IDYuNzQ1IDAgMDEtNi4zODYtNC41NzJsLS4xMzIuMDExLTMuNDY1IDIuNjI4LS4wNDUuMTI0QzQuMDQzIDIwLjUzMSA3LjgzNSAyMyAxMi4yMjUgMjN6IiBmaWxsPSIjMzRBODUzIj48L3BhdGg+PHBhdGggZD0iTTUuODQgMTQuMTc1QTYuNjUgNi42NSAwIDAxNS40NjMgMTJjMC0uNzU4LjEzOC0xLjQ5MS4zNjEtMi4xNzVsLS4wMDYtLjE0Ny0zLjUwOC0yLjY3LS4xMTUuMDU0QTEwLjgzMSAxMC44MzEgMCAwMDEgMTJjMCAxLjc3Mi40MzYgMy40NDcgMS4xOTcgNC45MzhsMy42NDItMi43NjN6IiBmaWxsPSIjRkJCQzA1Ij48L3BhdGg+PHBhdGggZD0iTTEyLjIyNSA1LjI1M2MyLjEwOCAwIDMuNTI5Ljg5MiA0LjM0IDEuNjM4bDMuMTY3LTMuMDMxQzE3Ljc4NyAyLjA4OCAxNS4yNTUgMSAxMi4yMjUgMSA3LjgzNCAxIDQuMDQzIDMuNDY5IDIuMTk3IDcuMDYybDMuNjMgMi43NjNhNi43NyA2Ljc3IDAgMDE2LjM5OC00LjU3MnoiIGZpbGw9IiNFQjQzMzUiPjwvcGF0aD48L3N2Zz4=)}.slr-aiv-comp{display:flex;flex-direction:column;min-height:0}.slr-aiv-comp__head{align-items:center;display:flex;flex-wrap:wrap;gap:10px;justify-content:space-between}.slr-aiv-comp__head-actions{align-items:center;column-gap:10px;display:flex}.slr-aiv-comp__count{color:var(--slr-gray-60);font-size:11px}.slr-aiv-comp__empty{align-items:center;display:flex;flex:1;justify-content:center;min-height:0}.slr-aiv-comp__table-wrap{flex:1;margin-top:10px;min-height:0;overflow:auto}.slr-aiv-comp__table{border-collapse:collapse;font-size:13px;width:100%}.slr-aiv-comp__table th{color:var(--slr-gray-60);font-weight:500;padding:6px 0;text-align:right}.slr-aiv-comp__table td{padding:8px 0}.slr-aiv-comp__table tr.is-brand{background:var(--slr-blue-95)}.slr-aiv-comp__name{align-items:center;display:flex;gap:8px}.slr-aiv-comp__dot{border-radius:50%;flex:none;height:10px;width:10px}.slr-aiv-comp__sov{align-items:center;column-gap:8px;display:flex}.slr-aiv-comp__sov-track{background:#f3f4f6;border-radius:4px;flex:1;height:8px;overflow:hidden}.slr-aiv-comp__sov-fill{border-radius:4px;height:100%}.slr-aiv-trend{margin-bottom:12px}.slr-aiv-trend__chart{height:260px;margin-top:10px}.slr-aiv-actions{margin:0 0 8px}.slr-aiv-tabs{align-items:stretch;background:#fff;border:0;border-radius:10px 10px 0 0;box-shadow:var(--slr-shadow-panel);line-height:0;margin:20px 0 0;overflow:hidden}.slr-aiv-tabs,.slr-aiv-tabs>li{display:flex;list-style:none;padding:0}.slr-aiv-tabs>li{margin:0}.slr-aiv-tabs button{appearance:none;background:transparent;border:0;border-radius:0;box-shadow:none;color:var(--slr-blue-10);cursor:pointer;font-size:14px;height:100%;line-height:1.4;margin:0;min-height:0;padding:16px 20px}.slr-aiv-tabs button.is-active{background:var(--slr-blue-95);color:var(--slr-blue-50)}.slr-aiv-tabs button:focus,.slr-aiv-tabs button:hover{box-shadow:none;color:var(--slr-blue-50);outline:none}.slr-aiv-table-panel{margin-top:20px;overflow:hidden;padding:0}.slr-aiv-table--clickable .tabulator-row{cursor:pointer}.slr-aiv-prompt-text{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}.slr-aiv-table .tabulator-row .tabulator-cell.slr-aiv-llm-col{overflow:visible;padding-right:6px!important;padding-left:6px!important;white-space:nowrap}.slr-aiv-llm-cell{align-items:center;display:inline-flex;gap:8px;justify-content:center}.slr-aiv-llm-cell--statuses{min-width:68px}.slr-aiv-status{align-items:center;border-radius:6px;box-sizing:border-box;display:inline-flex;flex:0 0 26px;height:26px;justify-content:center;width:26px}.slr-aiv-status .dashicons{font-size:16px;height:16px;width:16px}.slr-aiv-status.is-active{background:rgba(80,177,66,.14);border:1px solid rgba(80,177,66,.28);color:var(--slr-green)}.slr-aiv-status.is-inactive{background:transparent;border:1px dashed #c2c7cf;color:var(--slr-gray-60);opacity:.45}.slr-aiv-llm-cell--pending{color:#d4a017}.slr-aiv-sentiment{align-items:center;display:inline-flex;font-size:12px;gap:6px}.slr-aiv-sentiment__dot{border-radius:50%;height:8px;width:8px}.slr-aiv-sentiment--positive .slr-aiv-sentiment__dot{background:var(--slr-green)}.slr-aiv-sentiment--neutral .slr-aiv-sentiment__dot{background:#f0b429}.slr-aiv-sentiment--negative .slr-aiv-sentiment__dot{background:var(--slr-red)}.slr-aiv-sov{display:flex;flex-direction:column;gap:20px;margin-top:20px;position:relative}.slr-aiv-sov__top{display:grid;gap:20px;grid-template-columns:5fr 7fr}.slr-aiv-sov__top>*{min-width:0}.slr-aiv-sov__chart{height:320px;margin-top:10px;min-width:0;position:relative}.slr-aiv-sov__chart>div{height:100%}.slr-aiv-sov__chart--wide{height:320px}.slr-aiv-sov-empty,.slr-aiv-sov__loading{align-items:center;display:flex;justify-content:center;margin-top:20px;min-height:320px}.slr-aiv-changes{margin-top:20px;min-height:200px}.slr-aiv-changes__empty{color:var(--slr-gray-60);padding:40px 20px;text-align:center}.slr-aiv-changes__group+.slr-aiv-changes__group{padding-top:24px}.slr-aiv-changes__date{font-size:14px;font-weight:600;margin-bottom:10px}.slr-aiv-changes__rows{border-radius:8px;overflow:hidden}.slr-aiv-changes__row{align-items:center;column-gap:20px;display:flex;padding:12px 16px}.slr-aiv-changes__row:nth-child(odd){background:#fff}.slr-aiv-changes__row:nth-child(2n){background:#f8f9fa}.slr-aiv-changes__badge{align-items:center;border-radius:4px;display:inline-flex;flex:0 0 118px;font-size:11px;font-weight:600;justify-content:center;letter-spacing:.3px;padding:4px 10px;text-transform:uppercase;white-space:nowrap}.slr-aiv-changes__badge--traction{background:#e8f6ec;color:#1f8a4c}.slr-aiv-changes__badge--alert{background:#fbe4e4;color:#c0392b}.slr-aiv-changes__badge--competition{background:#fff0e0;color:#d35400}.slr-aiv-changes__badge--milestone{background:var(--slr-blue-95);color:var(--slr-blue-50)}.slr-aiv-changes__message{flex:1;line-height:1.45;min-width:0}.slr-aiv-changes__delta{flex:0 0 auto;font-weight:500;min-width:72px;text-align:left;white-space:nowrap}.slr-aiv-empty{align-items:center;display:flex;flex-direction:column;margin:40px auto;max-width:720px;padding:56px 32px;text-align:center}.slr-aiv-empty__badge{align-items:center;background:var(--slr-gradient);border-radius:16px;color:#fff;display:flex;height:56px;justify-content:center;margin-bottom:20px;width:56px}.slr-aiv-empty__head h2{font-size:22px;margin:0 0 8px}.slr-aiv-empty__head p{color:var(--slr-gray-60);margin:0}.slr-aiv-empty__features{display:flex;flex-direction:column;gap:12px;margin:28px 0;max-width:460px;text-align:right;width:100%}.slr-aiv-empty__feature{align-items:flex-start;background:#f8f9fa;border-radius:10px;display:flex;gap:12px;padding:12px}.slr-aiv-empty__feature-icon{align-items:center;border-radius:10px;display:flex;flex:none;height:36px;justify-content:center;width:36px}.slr-aiv-empty__feature-icon--blue{background:#e7f2fe;color:var(--slr-blue-50)}.slr-aiv-empty__feature-icon--cyan{background:#e1f7f3;color:#0aa}.slr-aiv-empty__feature-icon--violet{background:#eeeafe;color:#6b4eff}.slr-aiv-empty__feature strong{display:block;margin-bottom:2px}.slr-aiv-empty__feature span,.slr-aiv-empty__hint{color:var(--slr-gray-60);font-size:13px}.slr-aiv-empty__hint{align-items:center;display:flex;gap:6px;margin-top:16px}@media (max-width:1100px){.slr-aiv-sov__top,.slr-aiv-top{display:flex;flex-direction:column;row-gap:16px}.slr-aiv-middle,.slr-aiv-top>.slr-aiv-card{flex:none;width:100%}.slr-aiv-coverage{flex:none}}@media (max-width:782px){.slr-ai-visibility__body{padding:16px}.slr-aiv-score__value{font-size:48px}.slr-aiv-changes__row{flex-wrap:wrap;row-gap:8px}.slr-aiv-changes__badge{flex:0 0 auto}.slr-aiv-changes__delta{text-align:right;width:100%}}
  • seo-local-rank/trunk/build/index.asset.php

    r3706047 r3720851  
    1 <?php return array('dependencies' => array('react', 'react-jsx-runtime', 'wp-api-fetch', 'wp-components', 'wp-element', 'wp-i18n'), 'version' => '49e998adfd08cb736962');
     1<?php return array('dependencies' => array('react', 'react-jsx-runtime', 'wp-api-fetch', 'wp-components', 'wp-element', 'wp-i18n'), 'version' => '888a4bfadae8a0bb77f9');
  • seo-local-rank/trunk/build/index.css

    r3706047 r3720851  
    11.tabulator{background-color:#888;border:1px solid #999;font-size:14px;overflow:hidden;position:relative;text-align:left;transform:translateZ(0)}.tabulator[tabulator-layout=fitDataFill] .tabulator-tableholder .tabulator-table{min-width:100%}.tabulator[tabulator-layout=fitDataTable]{display:inline-block}.tabulator.tabulator-block-select,.tabulator.tabulator-ranges .tabulator-cell:not(.tabulator-editing){-webkit-user-select:none;user-select:none}.tabulator .tabulator-header{background-color:#e6e6e6;border-bottom:1px solid #999;box-sizing:border-box;color:#555;font-weight:700;outline:none;overflow:hidden;position:relative;-moz-user-select:none;-khtml-user-select:none;-webkit-user-select:none;-o-user-select:none;white-space:nowrap;width:100%}.tabulator .tabulator-header.tabulator-header-hidden{display:none}.tabulator .tabulator-header .tabulator-header-contents{overflow:hidden;position:relative}.tabulator .tabulator-header .tabulator-header-contents .tabulator-headers{display:inline-block}.tabulator .tabulator-header .tabulator-col{background:#e6e6e6;border-right:1px solid #aaa;box-sizing:border-box;display:inline-flex;flex-direction:column;justify-content:flex-start;overflow:hidden;position:relative;text-align:left;vertical-align:bottom}.tabulator .tabulator-header .tabulator-col.tabulator-moving{background:#cdcdcd;border:1px solid #999;pointer-events:none;position:absolute}.tabulator .tabulator-header .tabulator-col.tabulator-range-highlight{background-color:#d6d6d6;color:#000}.tabulator .tabulator-header .tabulator-col.tabulator-range-selected{background-color:#3876ca;color:#fff}.tabulator .tabulator-header .tabulator-col .tabulator-col-content{box-sizing:border-box;padding:4px;position:relative}.tabulator .tabulator-header .tabulator-col .tabulator-col-content .tabulator-header-popup-button{padding:0 8px}.tabulator .tabulator-header .tabulator-col .tabulator-col-content .tabulator-header-popup-button:hover{cursor:pointer;opacity:.6}.tabulator .tabulator-header .tabulator-col .tabulator-col-content .tabulator-col-title-holder{position:relative}.tabulator .tabulator-header .tabulator-col .tabulator-col-content .tabulator-col-title{box-sizing:border-box;overflow:hidden;text-overflow:ellipsis;vertical-align:bottom;white-space:nowrap;width:100%}.tabulator .tabulator-header .tabulator-col .tabulator-col-content .tabulator-col-title.tabulator-col-title-wrap{text-overflow:clip;white-space:normal}.tabulator .tabulator-header .tabulator-col .tabulator-col-content .tabulator-col-title .tabulator-title-editor{background:#fff;border:1px solid #999;box-sizing:border-box;padding:1px;width:100%}.tabulator .tabulator-header .tabulator-col .tabulator-col-content .tabulator-col-title .tabulator-header-popup-button+.tabulator-title-editor{width:calc(100% - 22px)}.tabulator .tabulator-header .tabulator-col .tabulator-col-content .tabulator-col-sorter{align-items:center;bottom:0;display:flex;position:absolute;right:4px;top:0}.tabulator .tabulator-header .tabulator-col .tabulator-col-content .tabulator-col-sorter .tabulator-arrow{border-bottom:6px solid #bbb;border-left:6px solid transparent;border-right:6px solid transparent;height:0;width:0}.tabulator .tabulator-header .tabulator-col.tabulator-col-group .tabulator-col-group-cols{border-top:1px solid #aaa;display:flex;margin-right:-1px;overflow:hidden;position:relative}.tabulator .tabulator-header .tabulator-col .tabulator-header-filter{box-sizing:border-box;margin-top:2px;position:relative;text-align:center;width:100%}.tabulator .tabulator-header .tabulator-col .tabulator-header-filter textarea{height:auto!important}.tabulator .tabulator-header .tabulator-col .tabulator-header-filter svg{margin-top:3px}.tabulator .tabulator-header .tabulator-col .tabulator-header-filter input::-ms-clear{height:0;width:0}.tabulator .tabulator-header .tabulator-col.tabulator-sortable .tabulator-col-title{padding-right:25px}@media (hover:hover) and (pointer:fine){.tabulator .tabulator-header .tabulator-col.tabulator-sortable.tabulator-col-sorter-element:hover{background-color:#cdcdcd;cursor:pointer}}.tabulator .tabulator-header .tabulator-col.tabulator-sortable[aria-sort=none] .tabulator-col-content .tabulator-col-sorter{color:#bbb}@media (hover:hover) and (pointer:fine){.tabulator .tabulator-header .tabulator-col.tabulator-sortable[aria-sort=none] .tabulator-col-content .tabulator-col-sorter.tabulator-col-sorter-element .tabulator-arrow:hover{border-bottom:6px solid #555;cursor:pointer}}.tabulator .tabulator-header .tabulator-col.tabulator-sortable[aria-sort=none] .tabulator-col-content .tabulator-col-sorter .tabulator-arrow{border-bottom:6px solid #bbb;border-top:none}.tabulator .tabulator-header .tabulator-col.tabulator-sortable[aria-sort=ascending] .tabulator-col-content .tabulator-col-sorter{color:#666}@media (hover:hover) and (pointer:fine){.tabulator .tabulator-header .tabulator-col.tabulator-sortable[aria-sort=ascending] .tabulator-col-content .tabulator-col-sorter.tabulator-col-sorter-element .tabulator-arrow:hover{border-bottom:6px solid #555;cursor:pointer}}.tabulator .tabulator-header .tabulator-col.tabulator-sortable[aria-sort=ascending] .tabulator-col-content .tabulator-col-sorter .tabulator-arrow{border-bottom:6px solid #666;border-top:none}.tabulator .tabulator-header .tabulator-col.tabulator-sortable[aria-sort=descending] .tabulator-col-content .tabulator-col-sorter{color:#666}@media (hover:hover) and (pointer:fine){.tabulator .tabulator-header .tabulator-col.tabulator-sortable[aria-sort=descending] .tabulator-col-content .tabulator-col-sorter.tabulator-col-sorter-element .tabulator-arrow:hover{border-top:6px solid #555;cursor:pointer}}.tabulator .tabulator-header .tabulator-col.tabulator-sortable[aria-sort=descending] .tabulator-col-content .tabulator-col-sorter .tabulator-arrow{border-bottom:none;border-top:6px solid #666;color:#666}.tabulator .tabulator-header .tabulator-col.tabulator-col-vertical .tabulator-col-content .tabulator-col-title{align-items:center;display:flex;justify-content:center;text-orientation:mixed;writing-mode:vertical-rl}.tabulator .tabulator-header .tabulator-col.tabulator-col-vertical.tabulator-col-vertical-flip .tabulator-col-title{transform:rotate(180deg)}.tabulator .tabulator-header .tabulator-col.tabulator-col-vertical.tabulator-sortable .tabulator-col-title{padding-right:0;padding-top:20px}.tabulator .tabulator-header .tabulator-col.tabulator-col-vertical.tabulator-sortable.tabulator-col-vertical-flip .tabulator-col-title{padding-bottom:20px;padding-right:0}.tabulator .tabulator-header .tabulator-col.tabulator-col-vertical.tabulator-sortable .tabulator-col-sorter{bottom:auto;justify-content:center;left:0;right:0;top:4px}.tabulator .tabulator-header .tabulator-frozen{left:0;position:sticky;z-index:11}.tabulator .tabulator-header .tabulator-frozen.tabulator-frozen-left{border-right:2px solid #aaa}.tabulator .tabulator-header .tabulator-frozen.tabulator-frozen-right{border-left:2px solid #aaa}.tabulator .tabulator-header .tabulator-calcs-holder{background:#f3f3f3!important;border-bottom:1px solid #aaa;border-top:1px solid #aaa;box-sizing:border-box;display:inline-block}.tabulator .tabulator-header .tabulator-calcs-holder .tabulator-row{background:#f3f3f3!important}.tabulator .tabulator-header .tabulator-calcs-holder .tabulator-row .tabulator-col-resize-handle{display:none}.tabulator .tabulator-header .tabulator-frozen-rows-holder{display:inline-block;padding-top:1em}.tabulator .tabulator-header .tabulator-frozen-rows-holder:empty{display:none}.tabulator .tabulator-tableholder{-webkit-overflow-scrolling:touch;overflow:auto;position:relative;white-space:nowrap;width:100%}.tabulator .tabulator-tableholder:focus{outline:none}.tabulator .tabulator-tableholder .tabulator-placeholder{align-items:center;box-sizing:border-box;display:flex;justify-content:center;min-width:100%;width:100%}.tabulator .tabulator-tableholder .tabulator-placeholder[tabulator-render-mode=virtual]{min-height:100%}.tabulator .tabulator-tableholder .tabulator-placeholder .tabulator-placeholder-contents{color:#ccc;display:inline-block;font-size:20px;font-weight:700;padding:10px;text-align:center;white-space:normal}.tabulator .tabulator-tableholder .tabulator-table{background-color:#fff;color:#333;display:inline-block;overflow:visible;position:relative;white-space:nowrap}.tabulator .tabulator-tableholder .tabulator-table .tabulator-row.tabulator-calcs{background:#e2e2e2!important;font-weight:700}.tabulator .tabulator-tableholder .tabulator-table .tabulator-row.tabulator-calcs.tabulator-calcs-top{border-bottom:2px solid #aaa}.tabulator .tabulator-tableholder .tabulator-table .tabulator-row.tabulator-calcs.tabulator-calcs-bottom{border-top:2px solid #aaa}.tabulator .tabulator-tableholder .tabulator-range-overlay{inset:0;pointer-events:none;position:absolute;z-index:10}.tabulator .tabulator-tableholder .tabulator-range-overlay .tabulator-range{border:1px solid #2975dd;box-sizing:border-box;position:absolute}.tabulator .tabulator-tableholder .tabulator-range-overlay .tabulator-range.tabulator-range-active:after{background-color:#2975dd;border-radius:999px;bottom:-3px;content:"";height:6px;position:absolute;right:-3px;width:6px}.tabulator .tabulator-tableholder .tabulator-range-overlay .tabulator-range-cell-active{border:2px solid #2975dd;box-sizing:border-box;position:absolute}.tabulator .tabulator-footer{background-color:#e6e6e6;border-top:1px solid #999;color:#555;font-weight:700;user-select:none;-moz-user-select:none;-khtml-user-select:none;-webkit-user-select:none;-o-user-select:none;white-space:nowrap}.tabulator .tabulator-footer .tabulator-footer-contents{align-items:center;display:flex;flex-direction:row;justify-content:space-between;padding:5px 10px}.tabulator .tabulator-footer .tabulator-footer-contents:empty{display:none}.tabulator .tabulator-footer .tabulator-spreadsheet-tabs{margin-top:-5px;overflow-x:auto}.tabulator .tabulator-footer .tabulator-spreadsheet-tabs .tabulator-spreadsheet-tab{border:1px solid #999;border-bottom-left-radius:5px;border-bottom-right-radius:5px;border-top:none;display:inline-block;font-size:.9em;padding:5px}.tabulator .tabulator-footer .tabulator-spreadsheet-tabs .tabulator-spreadsheet-tab:hover{cursor:pointer;opacity:.7}.tabulator .tabulator-footer .tabulator-spreadsheet-tabs .tabulator-spreadsheet-tab.tabulator-spreadsheet-tab-active{background:#fff}.tabulator .tabulator-footer .tabulator-calcs-holder{background:#f3f3f3!important;border-bottom:1px solid #aaa;border-top:1px solid #aaa;box-sizing:border-box;overflow:hidden;text-align:left;width:100%}.tabulator .tabulator-footer .tabulator-calcs-holder .tabulator-row{background:#f3f3f3!important;display:inline-block}.tabulator .tabulator-footer .tabulator-calcs-holder .tabulator-row .tabulator-col-resize-handle{display:none}.tabulator .tabulator-footer .tabulator-calcs-holder:only-child{border-bottom:none;margin-bottom:-5px}.tabulator .tabulator-footer>*+.tabulator-page-counter{margin-left:10px}.tabulator .tabulator-footer .tabulator-page-counter{font-weight:400}.tabulator .tabulator-footer .tabulator-paginator{color:#555;flex:1;font-family:inherit;font-size:inherit;font-weight:inherit;text-align:right}.tabulator .tabulator-footer .tabulator-page-size{border:1px solid #aaa;border-radius:3px;display:inline-block;margin:0 5px;padding:2px 5px}.tabulator .tabulator-footer .tabulator-pages{margin:0 7px}.tabulator .tabulator-footer .tabulator-page{background:hsla(0,0%,100%,.2);border:1px solid #aaa;border-radius:3px;display:inline-block;margin:0 2px;padding:2px 5px}.tabulator .tabulator-footer .tabulator-page.active{color:#d00}.tabulator .tabulator-footer .tabulator-page:disabled{opacity:.5}@media (hover:hover) and (pointer:fine){.tabulator .tabulator-footer .tabulator-page:not(disabled):hover{background:rgba(0,0,0,.2);color:#fff;cursor:pointer}}.tabulator .tabulator-col-resize-handle{display:inline-block;margin-left:-3px;margin-right:-3px;position:relative;vertical-align:middle;width:6px;z-index:11}@media (hover:hover) and (pointer:fine){.tabulator .tabulator-col-resize-handle:hover{cursor:ew-resize}}.tabulator .tabulator-col-resize-handle:last-of-type{margin-right:0;width:3px}.tabulator .tabulator-col-resize-guide{background-color:#999;height:100%;margin-left:-.5px;opacity:.5;position:absolute;top:0;width:4px}.tabulator .tabulator-row-resize-guide{background-color:#999;height:4px;left:0;margin-top:-.5px;opacity:.5;position:absolute;width:100%}.tabulator .tabulator-alert{align-items:center;background:rgba(0,0,0,.4);display:flex;height:100%;left:0;position:absolute;text-align:center;top:0;width:100%;z-index:100}.tabulator .tabulator-alert .tabulator-alert-msg{background:#fff;border-radius:10px;display:inline-block;font-size:16px;font-weight:700;margin:0 auto;padding:10px 20px}.tabulator .tabulator-alert .tabulator-alert-msg.tabulator-alert-state-msg{border:4px solid #333;color:#000}.tabulator .tabulator-alert .tabulator-alert-msg.tabulator-alert-state-error{border:4px solid #d00;color:#590000}.tabulator-row{background-color:#fff;box-sizing:border-box;min-height:22px;position:relative}.tabulator-row.tabulator-row-even{background-color:#efefef}@media (hover:hover) and (pointer:fine){.tabulator-row.tabulator-selectable:hover{background-color:#bbb;cursor:pointer}}.tabulator-row.tabulator-selected{background-color:#9abcea}@media (hover:hover) and (pointer:fine){.tabulator-row.tabulator-selected:hover{background-color:#769bcc;cursor:pointer}}.tabulator-row.tabulator-row-moving{background:#fff;border:1px solid #000}.tabulator-row.tabulator-moving{border-bottom:1px solid #aaa;border-top:1px solid #aaa;pointer-events:none;position:absolute;z-index:15}.tabulator-row.tabulator-range-highlight .tabulator-cell.tabulator-range-row-header{background-color:#d6d6d6;color:#000}.tabulator-row.tabulator-range-highlight.tabulator-range-selected .tabulator-cell.tabulator-range-row-header,.tabulator-row.tabulator-range-selected .tabulator-cell.tabulator-range-row-header{background-color:#3876ca;color:#fff}.tabulator-row .tabulator-row-resize-handle{bottom:0;height:5px;left:0;position:absolute;right:0}.tabulator-row .tabulator-row-resize-handle.prev{bottom:auto;top:0}@media (hover:hover) and (pointer:fine){.tabulator-row .tabulator-row-resize-handle:hover{cursor:ns-resize}}.tabulator-row .tabulator-responsive-collapse{border-bottom:1px solid #aaa;border-top:1px solid #aaa;box-sizing:border-box;padding:5px}.tabulator-row .tabulator-responsive-collapse:empty{display:none}.tabulator-row .tabulator-responsive-collapse table{font-size:14px}.tabulator-row .tabulator-responsive-collapse table tr td{position:relative}.tabulator-row .tabulator-responsive-collapse table tr td:first-of-type{padding-right:10px}.tabulator-row .tabulator-cell{border-right:1px solid #aaa;box-sizing:border-box;display:inline-block;outline:none;overflow:hidden;padding:4px;position:relative;text-overflow:ellipsis;vertical-align:middle;white-space:nowrap}.tabulator-row .tabulator-cell .tabulator-tick{fill:#2dc214}.tabulator-row .tabulator-cell .tabulator-cross{fill:#ce1515}.tabulator-row .tabulator-cell.tabulator-row-header{background:#e6e6e6;border-bottom:1px solid #aaa;border-right:1px solid #999}.tabulator-row .tabulator-cell.tabulator-frozen{background-color:inherit;display:inline-block;left:0;position:sticky;z-index:11}.tabulator-row .tabulator-cell.tabulator-frozen.tabulator-frozen-left{border-right:2px solid #aaa}.tabulator-row .tabulator-cell.tabulator-frozen.tabulator-frozen-right{border-left:2px solid #aaa}.tabulator-row .tabulator-cell.tabulator-editing{border:1px solid #1d68cd;outline:none;padding:0}.tabulator-row .tabulator-cell.tabulator-editing input,.tabulator-row .tabulator-cell.tabulator-editing select{background:transparent;border:1px;outline:none}.tabulator-row .tabulator-cell.tabulator-validation-fail{border:1px solid #d00}.tabulator-row .tabulator-cell.tabulator-validation-fail input,.tabulator-row .tabulator-cell.tabulator-validation-fail select{background:transparent;border:1px;color:#d00}.tabulator-row .tabulator-cell.tabulator-row-handle{align-items:center;display:inline-flex;justify-content:center;-moz-user-select:none;-khtml-user-select:none;-webkit-user-select:none;-o-user-select:none}.tabulator-row .tabulator-cell.tabulator-row-handle .tabulator-row-handle-box{width:80%}.tabulator-row .tabulator-cell.tabulator-row-handle .tabulator-row-handle-box .tabulator-row-handle-bar{background:#666;height:3px;margin-top:2px;width:100%}.tabulator-row .tabulator-cell.tabulator-range-selected:not(.tabulator-range-only-cell-selected):not(.tabulator-range-row-header){background-color:#9abcea}.tabulator-row .tabulator-cell .tabulator-data-tree-branch-empty{display:inline-block;width:7px}.tabulator-row .tabulator-cell .tabulator-data-tree-branch{border-bottom:2px solid #aaa;border-bottom-left-radius:1px;border-left:2px solid #aaa;display:inline-block;height:9px;margin-right:5px;margin-top:-9px;vertical-align:middle;width:7px}.tabulator-row .tabulator-cell .tabulator-data-tree-control{align-items:center;background:rgba(0,0,0,.1);border:1px solid #333;border-radius:2px;display:inline-flex;height:11px;justify-content:center;margin-right:5px;overflow:hidden;vertical-align:middle;width:11px}@media (hover:hover) and (pointer:fine){.tabulator-row .tabulator-cell .tabulator-data-tree-control:hover{background:rgba(0,0,0,.2);cursor:pointer}}.tabulator-row .tabulator-cell .tabulator-data-tree-control .tabulator-data-tree-control-collapse{background:transparent;display:inline-block;height:7px;position:relative;width:1px}.tabulator-row .tabulator-cell .tabulator-data-tree-control .tabulator-data-tree-control-collapse:after{background:#333;content:"";height:1px;left:-3px;position:absolute;top:3px;width:7px}.tabulator-row .tabulator-cell .tabulator-data-tree-control .tabulator-data-tree-control-expand{background:#333;display:inline-block;height:7px;position:relative;width:1px}.tabulator-row .tabulator-cell .tabulator-data-tree-control .tabulator-data-tree-control-expand:after{background:#333;content:"";height:1px;left:-3px;position:absolute;top:3px;width:7px}.tabulator-row .tabulator-cell .tabulator-responsive-collapse-toggle{align-items:center;background:#666;border-radius:20px;color:#fff;display:inline-flex;font-size:1.1em;font-weight:700;height:15px;justify-content:center;-moz-user-select:none;-khtml-user-select:none;-webkit-user-select:none;-o-user-select:none;width:15px}@media (hover:hover) and (pointer:fine){.tabulator-row .tabulator-cell .tabulator-responsive-collapse-toggle:hover{cursor:pointer;opacity:.7}}.tabulator-row .tabulator-cell .tabulator-responsive-collapse-toggle.open .tabulator-responsive-collapse-toggle-close{display:initial}.tabulator-row .tabulator-cell .tabulator-responsive-collapse-toggle.open .tabulator-responsive-collapse-toggle-open{display:none}.tabulator-row .tabulator-cell .tabulator-responsive-collapse-toggle svg{stroke:#fff}.tabulator-row .tabulator-cell .tabulator-responsive-collapse-toggle .tabulator-responsive-collapse-toggle-close{display:none}.tabulator-row .tabulator-cell .tabulator-traffic-light{border-radius:14px;display:inline-block;height:14px;width:14px}.tabulator-row.tabulator-group{background:#ccc;border-bottom:1px solid #999;border-right:1px solid #aaa;border-top:1px solid #999;box-sizing:border-box;font-weight:700;min-width:100%;padding:5px 5px 5px 10px}@media (hover:hover) and (pointer:fine){.tabulator-row.tabulator-group:hover{background-color:rgba(0,0,0,.1);cursor:pointer}}.tabulator-row.tabulator-group.tabulator-group-visible .tabulator-arrow{border-bottom:0;border-left:6px solid transparent;border-right:6px solid transparent;border-top:6px solid #666;margin-right:10px}.tabulator-row.tabulator-group.tabulator-group-level-1{padding-left:30px}.tabulator-row.tabulator-group.tabulator-group-level-2{padding-left:50px}.tabulator-row.tabulator-group.tabulator-group-level-3{padding-left:70px}.tabulator-row.tabulator-group.tabulator-group-level-4{padding-left:90px}.tabulator-row.tabulator-group.tabulator-group-level-5{padding-left:110px}.tabulator-row.tabulator-group .tabulator-group-toggle{display:inline-block}.tabulator-row.tabulator-group .tabulator-arrow{border-bottom:6px solid transparent;border-left:6px solid #666;border-right:0;border-top:6px solid transparent;display:inline-block;height:0;margin-right:16px;vertical-align:middle;width:0}.tabulator-row.tabulator-group span{color:#d00;margin-left:10px}.tabulator-toggle{background:#dcdcdc;border:1px solid #ccc;box-sizing:border-box;display:flex;flex-direction:row}.tabulator-toggle.tabulator-toggle-on{background:#1c6cc2}.tabulator-toggle .tabulator-toggle-switch{background:#fff;border:1px solid #ccc;box-sizing:border-box}.tabulator-popup-container{-webkit-overflow-scrolling:touch;background:#fff;border:1px solid #aaa;box-shadow:0 0 5px 0 rgba(0,0,0,.2);box-sizing:border-box;display:inline-block;font-size:14px;overflow-y:auto;position:absolute;z-index:10000}.tabulator-popup{border-radius:3px;padding:5px}.tabulator-tooltip{border-radius:2px;box-shadow:none;font-size:12px;max-width:min(500px,100%);padding:3px 5px;pointer-events:none}.tabulator-menu .tabulator-menu-item{box-sizing:border-box;padding:5px 10px;position:relative;-webkit-user-select:none;user-select:none}.tabulator-menu .tabulator-menu-item.tabulator-menu-item-disabled{opacity:.5}@media (hover:hover) and (pointer:fine){.tabulator-menu .tabulator-menu-item:not(.tabulator-menu-item-disabled):hover{background:#efefef;cursor:pointer}}.tabulator-menu .tabulator-menu-item.tabulator-menu-item-submenu{padding-right:25px}.tabulator-menu .tabulator-menu-item.tabulator-menu-item-submenu:after{border-color:#aaa;border-style:solid;border-width:1px 1px 0 0;content:"";display:inline-block;height:7px;position:absolute;right:10px;top:calc(5px + .4em);transform:rotate(45deg);vertical-align:top;width:7px}.tabulator-menu .tabulator-menu-separator{border-top:1px solid #aaa}.tabulator-edit-list{-webkit-overflow-scrolling:touch;font-size:14px;max-height:200px;overflow-y:auto}.tabulator-edit-list .tabulator-edit-list-item{color:#333;outline:none;padding:4px}.tabulator-edit-list .tabulator-edit-list-item.active{background:#1d68cd;color:#fff}.tabulator-edit-list .tabulator-edit-list-item.active.focused{outline:1px solid hsla(0,0%,100%,.5)}.tabulator-edit-list .tabulator-edit-list-item.focused{outline:1px solid #1d68cd}@media (hover:hover) and (pointer:fine){.tabulator-edit-list .tabulator-edit-list-item:hover{background:#1d68cd;color:#fff;cursor:pointer}}.tabulator-edit-list .tabulator-edit-list-placeholder{color:#333;padding:4px;text-align:center}.tabulator-edit-list .tabulator-edit-list-group{border-bottom:1px solid #aaa;color:#333;font-weight:700;padding:6px 4px 4px}.tabulator-edit-list .tabulator-edit-list-group.tabulator-edit-list-group-level-2,.tabulator-edit-list .tabulator-edit-list-item.tabulator-edit-list-group-level-2{padding-left:12px}.tabulator-edit-list .tabulator-edit-list-group.tabulator-edit-list-group-level-3,.tabulator-edit-list .tabulator-edit-list-item.tabulator-edit-list-group-level-3{padding-left:20px}.tabulator-edit-list .tabulator-edit-list-group.tabulator-edit-list-group-level-4,.tabulator-edit-list .tabulator-edit-list-item.tabulator-edit-list-group-level-4{padding-left:28px}.tabulator-edit-list .tabulator-edit-list-group.tabulator-edit-list-group-level-5,.tabulator-edit-list .tabulator-edit-list-item.tabulator-edit-list-group-level-5{padding-left:36px}.tabulator.tabulator-ltr{direction:ltr}.tabulator.tabulator-rtl{direction:rtl;text-align:initial}.tabulator.tabulator-rtl .tabulator-header .tabulator-col{border-left:1px solid #aaa;border-right:initial;text-align:initial}.tabulator.tabulator-rtl .tabulator-header .tabulator-col.tabulator-col-group .tabulator-col-group-cols{margin-left:-1px;margin-right:0}.tabulator.tabulator-rtl .tabulator-header .tabulator-col.tabulator-sortable .tabulator-col-title{padding-left:25px;padding-right:0}.tabulator.tabulator-rtl .tabulator-header .tabulator-col .tabulator-col-content .tabulator-col-sorter{left:8px;right:auto}.tabulator.tabulator-rtl .tabulator-tableholder .tabulator-range-overlay .tabulator-range.tabulator-range-active:after{background-color:#2975dd;border-radius:999px;bottom:-3px;content:"";height:6px;left:-3px;position:absolute;right:auto;width:6px}.tabulator.tabulator-rtl .tabulator-row .tabulator-cell{border-left:1px solid #aaa;border-right:initial}.tabulator.tabulator-rtl .tabulator-row .tabulator-cell .tabulator-data-tree-branch{border-bottom-left-radius:0;border-bottom-right-radius:1px;border-left:initial;border-right:2px solid #aaa;margin-left:5px;margin-right:0}.tabulator.tabulator-rtl .tabulator-row .tabulator-cell .tabulator-data-tree-control{margin-left:5px;margin-right:0}.tabulator.tabulator-rtl .tabulator-row .tabulator-cell.tabulator-frozen.tabulator-frozen-left{border-left:2px solid #aaa}.tabulator.tabulator-rtl .tabulator-row .tabulator-cell.tabulator-frozen.tabulator-frozen-right{border-right:2px solid #aaa}.tabulator.tabulator-rtl .tabulator-row .tabulator-col-resize-handle:last-of-type{margin-left:0;margin-right:-3px;width:3px}.tabulator.tabulator-rtl .tabulator-footer .tabulator-calcs-holder{text-align:initial}.tabulator-print-fullscreen{bottom:0;left:0;position:absolute;right:0;top:0;z-index:10000}body.tabulator-print-fullscreen-hide>:not(.tabulator-print-fullscreen){display:none!important}.tabulator-print-table{border-collapse:collapse}.tabulator-print-table .tabulator-data-tree-branch{border-bottom:2px solid #aaa;border-bottom-left-radius:1px;border-left:2px solid #aaa;display:inline-block;height:9px;margin-right:5px;margin-top:-9px;vertical-align:middle;width:7px}.tabulator-print-table .tabulator-print-table-group{background:#ccc;border-bottom:1px solid #999;border-right:1px solid #aaa;border-top:1px solid #999;box-sizing:border-box;font-weight:700;min-width:100%;padding:5px 5px 5px 10px}@media (hover:hover) and (pointer:fine){.tabulator-print-table .tabulator-print-table-group:hover{background-color:rgba(0,0,0,.1);cursor:pointer}}.tabulator-print-table .tabulator-print-table-group.tabulator-group-visible .tabulator-arrow{border-bottom:0;border-left:6px solid transparent;border-right:6px solid transparent;border-top:6px solid #666;margin-right:10px}.tabulator-print-table .tabulator-print-table-group.tabulator-group-level-1 td{padding-left:30px!important}.tabulator-print-table .tabulator-print-table-group.tabulator-group-level-2 td{padding-left:50px!important}.tabulator-print-table .tabulator-print-table-group.tabulator-group-level-3 td{padding-left:70px!important}.tabulator-print-table .tabulator-print-table-group.tabulator-group-level-4 td{padding-left:90px!important}.tabulator-print-table .tabulator-print-table-group.tabulator-group-level-5 td{padding-left:110px!important}.tabulator-print-table .tabulator-print-table-group .tabulator-group-toggle{display:inline-block}.tabulator-print-table .tabulator-print-table-group .tabulator-arrow{border-bottom:6px solid transparent;border-left:6px solid #666;border-right:0;border-top:6px solid transparent;display:inline-block;height:0;margin-right:16px;vertical-align:middle;width:0}.tabulator-print-table .tabulator-print-table-group span{color:#d00;margin-left:10px}.tabulator-print-table .tabulator-data-tree-control{align-items:center;background:rgba(0,0,0,.1);border:1px solid #333;border-radius:2px;display:inline-flex;height:11px;justify-content:center;margin-right:5px;overflow:hidden;vertical-align:middle;width:11px}@media (hover:hover) and (pointer:fine){.tabulator-print-table .tabulator-data-tree-control:hover{background:rgba(0,0,0,.2);cursor:pointer}}.tabulator-print-table .tabulator-data-tree-control .tabulator-data-tree-control-collapse{background:transparent;display:inline-block;height:7px;position:relative;width:1px}.tabulator-print-table .tabulator-data-tree-control .tabulator-data-tree-control-collapse:after{background:#333;content:"";height:1px;left:-3px;position:absolute;top:3px;width:7px}.tabulator-print-table .tabulator-data-tree-control .tabulator-data-tree-control-expand{background:#333;display:inline-block;height:7px;position:relative;width:1px}.tabulator-print-table .tabulator-data-tree-control .tabulator-data-tree-control-expand:after{background:#333;content:"";height:1px;left:-3px;position:absolute;top:3px;width:7px}
    22:root{--slr-black:#000;--slr-black-light:#0b172b;--slr-blue-10:#0b172b;--slr-blue-25:#153770;--slr-blue-40:#0062cc;--slr-blue-50:#007bff;--slr-blue-95:#e7f2fe;--slr-blue-97:#f0f7fe;--slr-blue:#507ff1;--slr-gray-30:#4d4d4d;--slr-gray-50:#767676;--slr-gray-60:#a1aab3;--slr-gray-85:#d7d7d7;--slr-gray-90:#ddd;--slr-gray-95:#efefef;--slr-bg-page:#edeef0;--slr-white:#fff;--slr-green:#50b142;--slr-orange:#ed922f;--slr-red:#da3737;--slr-purple:#673ab7;--slr-font-family:"Poppins",-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;--slr-radius-sm:8px;--slr-radius-md:10px;--slr-radius-lg:13px;--slr-shadow-panel:0 2px 15px 0 rgba(0,0,0,.14);--slr-green-bg:#e8f6ec;--slr-red-bg:#fbe4e4;--slr-gray-bg:#efefef;--slr-border-dashed:#d7d7d7;--slr-grid-line:#f3f4f6;--slr-gradient:linear-gradient(209.09deg,#4e78f4 1.64%,#4ef4b9 98.45%);--slr-teal:#4ef4b9;--slr-chart-orange:#ef7a35;--slr-chart-blue:#4e78f4;--slr-shadow-card:0 4px 24px 0 rgba(214,225,234,.95)}
    3 .wrap.slr-admin-wrap{background:transparent;color:var(--slr-black-light);font-family:var(--slr-font-family);margin:0;max-width:none;padding:0}body.slr-admin #wpcontent{padding-left:0}body.slr-admin #wpbody-content{padding-bottom:0}.slr-admin-wrap .components-notice{border-radius:var(--slr-radius-sm)}.slr-panel{background:var(--slr-white);border-radius:var(--slr-radius-lg);box-shadow:var(--slr-shadow-panel);margin-bottom:24px;padding:24px}.slr-panel__title{color:var(--slr-black-light);font-size:16px;font-weight:600;margin:0 0 16px}.slr-header{justify-content:space-between;margin-bottom:24px}.slr-header,.slr-header__brand{align-items:center;display:flex}.slr-header__brand{gap:12px}.slr-header__logo{background:linear-gradient(209deg,#4e78f4 1.64%,#4ef4b9 98.45%);border-radius:var(--slr-radius-sm);height:36px;width:36px}.slr-header__title{color:var(--slr-black-light);font-size:24px;font-weight:700;margin:0}.slr-header__meta{color:var(--slr-gray-50);font-size:14px;margin:0}.slr-kpi-grid{display:grid;gap:16px;grid-template-columns:repeat(auto-fit,minmax(180px,1fr));margin-bottom:24px}.slr-kpi-card{background:var(--slr-white);border-radius:var(--slr-radius-lg);box-shadow:var(--slr-shadow-panel);padding:16px 20px}.slr-kpi-card__label{color:var(--slr-gray-50);font-size:13px;font-weight:500;margin:0 0 8px}.slr-status--connected{color:var(--slr-green);font-weight:600}.slr-status--disconnected{color:var(--slr-red);font-weight:600}.slr-domain-list{list-style:none;margin:0;padding:0}.slr-domain-list__item{align-items:center;border-bottom:1px solid var(--slr-gray-95);display:flex;justify-content:space-between;padding:12px 0}.slr-domain-list__item:last-child{border-bottom:none}.slr-domain-list__name{font-weight:500}.slr-domain-list__meta{color:var(--slr-gray-50);font-size:12px}.slr-empty-state{color:var(--slr-gray-50);padding:48px 24px;text-align:center}.slr-admin-wrap .components-button.is-primary{background:var(--slr-blue-50);border-color:var(--slr-blue-50);border-radius:var(--slr-radius-sm)}.slr-admin-wrap .components-button.is-primary:hover:not(:disabled){background:var(--slr-blue-40);border-color:var(--slr-blue-40)}.slr-admin-wrap .components-button.is-secondary{background:var(--slr-white);border:1px solid var(--slr-blue-50);border-radius:4px;color:var(--slr-blue-50)}.slr-admin-wrap .components-button.is-secondary:hover:not(:disabled){background:var(--slr-white);color:var(--slr-blue-50);opacity:.85}.slr-admin-wrap .components-select-control__input,.slr-admin-wrap .components-text-control__input{border-radius:var(--slr-radius-sm)}.slr-admin-wrap .dataviews-wrapper{border-radius:var(--slr-radius-sm);box-shadow:var(--slr-shadow-panel);overflow:hidden}.slr-app{padding:20px 24px 40px}.slr-app:has(.slr-dashboard),.slr-app:has(.slr-rank-tracker){padding:0}.slr-app--loading{align-items:center;display:flex;justify-content:center;min-height:240px}.slr-onboarding{margin:0 auto;max-width:560px;padding:24px 0 48px}.slr-create-project{max-width:620px}.slr-create-project__title{color:var(--slr-blue-10);font-size:22px;font-weight:600;line-height:1.3;margin:0 0 8px}.slr-create-project__lead{color:var(--slr-gray-50);font-size:14px;line-height:1.55;margin:0 0 28px}.slr-create-project__fields{display:flex;flex-direction:column;gap:20px}.slr-create-project .components-base-control__label,.slr-create-project .components-input-control__label,.slr-create-project__label{color:var(--slr-blue-10);display:block;font-size:13px;font-weight:500;letter-spacing:0;line-height:1.4;margin:0 0 6px;text-transform:none}.slr-create-project .components-base-control__help,.slr-create-project__hint{color:var(--slr-gray-50);font-size:12px;line-height:1.45;margin:6px 0 0}.slr-create-project .components-input-control__input,.slr-create-project .components-select-control__input,.slr-create-project .components-text-control__input{border-color:var(--slr-gray-90);border-radius:var(--slr-radius-sm);color:var(--slr-blue-10);min-height:40px}.slr-create-project__domain .components-text-control__input:disabled{background:var(--slr-blue-97);box-shadow:none;color:var(--slr-blue-10);opacity:1}.slr-create-project__tracking{border:0;margin:4px 0 0;min-width:0;padding:0}.slr-create-project__tracking .slr-create-project__hint{margin:0 0 12px}.slr-tracking-options{display:flex;flex-direction:column;gap:10px}.slr-tracking-option{align-items:center;background:var(--slr-white);border:1px solid var(--slr-gray-95);border-radius:var(--slr-radius-sm);box-shadow:none;color:inherit;cursor:pointer;display:flex;gap:16px;justify-content:space-between;margin:0;padding:14px 16px;text-align:left;width:100%}.slr-tracking-option:hover:not(:disabled){border-color:var(--slr-blue-50)}.slr-tracking-option:focus{outline:none}.slr-tracking-option:focus-visible{border-color:var(--slr-blue-50);box-shadow:0 0 0 2px var(--slr-blue-95)}.slr-tracking-option.is-selected{background:var(--slr-blue-97);border-color:var(--slr-blue-50)}.slr-tracking-option:disabled{cursor:default;opacity:.7}.slr-tracking-option__text{display:flex;flex-direction:column;gap:4px;min-width:0}.slr-tracking-option__title{color:var(--slr-blue-10);font-size:14px;font-weight:600;line-height:1.3}.slr-tracking-option__desc{color:var(--slr-gray-50);font-size:12px;font-weight:400;line-height:1.45}.slr-tracking-option__check{background:var(--slr-white);border:2px solid var(--slr-gray-85);border-radius:50%;box-shadow:inset 0 0 0 3px var(--slr-white);flex:0 0 auto;height:18px;width:18px}.slr-tracking-option.is-selected .slr-tracking-option__check{background:var(--slr-blue-50);border-color:var(--slr-blue-50)}.slr-create-project__actions{margin-top:8px}.slr-create-project__actions .components-button{font-weight:500;min-height:40px;padding:0 20px}.slr-onboarding__hero{margin-bottom:32px;text-align:center}.slr-onboarding__logo{height:48px;margin:0 auto 16px;width:48px}.slr-onboarding__title{color:var(--slr-black-light);font-size:28px;font-weight:700;margin:0}.slr-onboarding__panel{padding:32px}.slr-onboarding__panel>.components-notice{margin:0 0 24px}.slr-onboarding__lead{color:var(--slr-gray-50);font-size:15px;line-height:1.6;margin:0 0 24px}.slr-onboarding__question{color:var(--slr-black-light);font-size:16px;font-weight:600;margin:0 0 24px}.slr-onboarding__help{color:var(--slr-gray-50);font-size:14px;line-height:1.5;margin:0 0 12px}.slr-onboarding__help a{color:var(--slr-blue-50)}.slr-onboarding__actions{display:flex;flex-wrap:wrap;gap:12px;margin-top:24px}.slr-onboarding__divider{border:0;border-top:1px dashed var(--slr-gray-90);margin:28px 0}.slr-onboarding__loader{display:flex;justify-content:center;padding:24px 0}.slr-settings__actions{margin-top:16px}.slr-project-modal__lead{font-size:14px;line-height:1.5;margin:0 0 8px}.slr-project-modal__hint{color:var(--slr-gray-50);font-size:13px;margin:0 0 16px}.slr-project-modal__error{color:var(--slr-red);margin:12px 0 0}.slr-project-modal__actions{display:flex;justify-content:flex-end;margin-top:20px}.slr-project-summary{list-style:none;margin:0;padding:0}.slr-project-summary li{border-bottom:1px solid var(--slr-gray-95);display:flex;gap:12px;padding:8px 0}.slr-project-summary li:last-child{border-bottom:none}.slr-project-summary__label{color:var(--slr-gray-50);font-weight:600;min-width:100px}.slr-dashboard{max-width:none}.slr-dashboard__body{max-width:1600px;padding:20px 24px 40px}.slr-toolbar{align-items:center;background:var(--slr-white);border-bottom:1px solid var(--slr-gray-95);box-sizing:border-box;display:flex;gap:16px;height:60px;justify-content:space-between;margin:0;min-height:60px;padding:0 24px;width:100%}.slr-toolbar__left{align-items:center;display:flex;min-width:0}.slr-toolbar__keywords{align-items:center;color:var(--slr-black);column-gap:4px;display:flex;font-size:13px;font-weight:500;height:24px;line-height:19px;margin-left:20px;white-space:nowrap}.slr-toolbar__sync{align-items:center;column-gap:4px;display:inline-flex}.slr-toolbar__sync--ok{color:var(--slr-green)}.slr-toolbar__sync--warn{color:var(--slr-red)}.slr-toolbar__sync .dashicons{font-size:13px;height:13px;line-height:13px;margin-left:5px;width:13px}@media screen and (max-width:782px){.slr-toolbar{flex-wrap:wrap;height:auto;min-height:60px;padding:10px 16px}}.slr-project-selector{position:relative}.slr-project-selector__toggle{align-items:center;background:var(--slr-white);border:1px solid var(--slr-gray-90);border-radius:10px;color:var(--slr-black);column-gap:8px;cursor:pointer;display:flex;font-family:inherit;font-size:13px;font-weight:500;height:40px;line-height:24px;padding:8px 10px;text-align:left;width:280px}.slr-project-selector__toggle:disabled{cursor:default;opacity:1}.slr-project-selector__toggle:hover:not(:disabled),.slr-project-selector__toggle[aria-expanded=true]{border-color:var(--slr-gray-85)}.slr-project-selector__favicon{border:1px solid var(--slr-gray-90);border-radius:50%;flex-shrink:0;height:24px;object-fit:cover;width:24px}.slr-project-selector__item .slr-project-selector__favicon{height:20px;width:20px}.slr-project-selector__favicon--fallback{align-items:center;background:var(--slr-blue-95);color:var(--slr-blue-50);display:inline-flex;font-size:11px;font-weight:600;justify-content:center}.slr-project-selector__name{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.slr-project-selector__chevron{color:var(--slr-black-light);flex-shrink:0;font-size:14px;height:14px;width:14px}.slr-project-selector__menu{background:var(--slr-white);border:1px solid var(--slr-gray-95);border-radius:10px;box-shadow:var(--slr-shadow-panel);left:0;max-height:430px;overflow:auto;overflow-x:hidden;position:absolute;top:calc(100% + 6px);width:280px;z-index:20}.slr-project-selector__search{background:var(--slr-white);border-bottom:1px solid #eee;padding:10px;position:sticky;top:0;z-index:1}.slr-project-selector__search .dashicons{color:#999;font-size:14px;height:14px;left:20px;pointer-events:none;position:absolute;top:18px;width:14px}.slr-project-selector__search input{border:1px solid #dfe1e6;border-radius:6px;box-sizing:border-box;font-family:inherit;font-size:13px;height:32px;padding:0 10px 0 30px;width:100%}.slr-project-selector__search input:focus{border-color:var(--slr-blue-50);box-shadow:0 0 0 2px rgba(0,123,255,.1);outline:none}.slr-project-selector__list{list-style:none;margin:0;padding:6px 0 8px}.slr-project-selector__item{align-items:center;background:transparent;border:0;color:var(--slr-black-light);cursor:pointer;display:flex;font-family:inherit;font-size:12px;gap:8px;height:32px;padding:6px 10px;text-align:left;width:100%}.slr-project-selector__item:hover{background:var(--slr-blue-97)}.slr-project-selector__item.is-selected{color:var(--slr-blue-50);font-weight:500}.slr-project-selector__item-name{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.slr-project-selector__check{color:var(--slr-blue-50);flex-shrink:0;font-size:16px;height:16px;width:16px}.slr-project-selector__empty{color:var(--slr-gray-50);font-size:12px;padding:12px 10px}.slr-upgrade-button{align-items:center;background:linear-gradient(209.09deg,#4e78f4 42.6%,#4ef4b9 98.45%);border:none;border-radius:4px;box-sizing:border-box;color:var(--slr-white)!important;column-gap:6px;cursor:pointer;display:inline-flex;font-family:inherit;font-size:13px;font-weight:500;height:40px;line-height:1;min-width:132px;padding:10px 24px;text-decoration:none!important;white-space:nowrap}.slr-upgrade-button:focus,.slr-upgrade-button:hover{color:var(--slr-white)!important;opacity:.9;text-decoration:none!important}.slr-upgrade-button:disabled{cursor:wait;opacity:.7}.slr-upgrade-button__icon{background:url(data:image/svg+xml;base64,PCEtLSBPcmlnaW5hbCBUcnVlUmFua2VyIHJvY2tldCBpY29uLiBMaWNlbnNlOiBHUEwtMi4wLW9yLWxhdGVyLiAtLT4KPHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIj4KCTxwYXRoIGZpbGw9IiNmZmYiIGZpbGwtcnVsZT0iZXZlbm9kZCIgZD0iTTEyIDJjLjUgMCAxIC4zIDEuMy43TDE2IDYuMlYxNWEyIDIgMCAwIDEtMiAyaC0uMmwxLjQgMy42YS43NS43NSAwIDEgMS0xLjQuNkwxMiAxNy44bC0xLjggMy42YS43NS43NSAwIDEgMS0xLjQtLjZMMTAuMiAxN0gxMGEyIDIgMCAwIDEtMi0yVjYuMkwxMC43IDIuN0MxMSAyLjMgMTEuNSAyIDEyIDJabTAgNS4yNWExLjUgMS41IDAgMSAwIDAgMyAxLjUgMS41IDAgMCAwIDAtM1oiLz4KCTxwYXRoIGZpbGw9IiNmZmYiIGQ9Ik04IDExLjUgNC4yIDE2LjJhLjYuNiAwIDAgMCAuNSAxbDMuMy0uOVYxMS41Wm04IDB2NC44bDMuMy45YS42LjYgMCAwIDAgLjUtMUwxNiAxMS41WiIvPgo8L3N2Zz4K) no-repeat 50%/contain;display:inline-block;flex-shrink:0;height:16px;width:16px}.slr-kpi-grid--dashboard{grid-template-columns:repeat(4,minmax(0,1fr))}@media (max-width:1200px){.slr-kpi-grid--dashboard{grid-template-columns:repeat(2,minmax(0,1fr))}}@media (max-width:640px){.slr-kpi-grid--dashboard{grid-template-columns:1fr}}.slr-kpi-card--rich{display:flex;flex-direction:column;justify-content:space-between;min-height:220px;padding:20px;position:relative}.slr-kpi-card--clickable{cursor:pointer}.slr-kpi-card--clickable:hover{box-shadow:var(--slr-shadow-card)}.slr-kpi-card__hit{appearance:none;background:transparent;border:0;border-radius:inherit;box-shadow:none;color:transparent;cursor:pointer;font-size:0;height:auto;inset:0;line-height:0;margin:0;min-height:0;min-width:0;padding:0;position:absolute;text-decoration:none;width:auto;z-index:1}.slr-kpi-card__hit:focus{box-shadow:none;outline:none}.slr-kpi-card__hit:focus-visible{outline:2px solid var(--slr-blue-50);outline-offset:2px}.slr-kpi-card__hit:disabled{cursor:wait}.slr-kpi-card__header{align-items:center;color:var(--slr-black-light);display:flex;font-size:13px;font-weight:500;gap:7px;padding:0}.slr-kpi-card__icon{color:var(--slr-blue-50);font-size:18px;height:18px;width:18px}.slr-kpi-card__main{flex:1;padding:12px 0 8px}.slr-kpi-card__footer{border-top:1px solid var(--slr-gray-95);margin-top:auto;padding-top:10px}.slr-kpi-card__value-row{align-items:baseline;display:flex;flex-wrap:wrap;gap:8px}.slr-kpi-card__value{color:var(--slr-black-light);font-size:26px;font-weight:700;line-height:30px;margin:0}.slr-kpi-card__metric-label{color:var(--slr-gray-60);font-size:12px;margin:4px 0 0}.slr-kpi-card__value-suffix{color:var(--slr-gray-50);font-size:16px;font-weight:500}.slr-kpi-card__value--good{color:var(--slr-green)}.slr-kpi-card__value--ok{color:var(--slr-blue-50)}.slr-kpi-card__value--warn{color:var(--slr-orange)}.slr-kpi-card__value--bad{color:var(--slr-red)}.slr-kpi-card__row{align-items:center;display:flex;font-size:12px;gap:8px;justify-content:space-between;padding:8px 0}.slr-kpi-card__row-label{color:var(--slr-gray-60);margin-right:5px}.slr-kpi-card__row-value{align-items:center;color:var(--slr-black-light);display:inline-flex;font-size:17px;font-weight:600;gap:6px}.slr-kpi-card__state{align-items:center;color:var(--slr-gray-60);display:flex;flex:1;flex-direction:column;font-size:13px;justify-content:center;padding:16px 0;text-align:center}.slr-kpi-card__state-title{color:var(--slr-black-light);font-size:15px;font-weight:600;margin:0 0 6px}.slr-kpi-card__state-desc{line-height:1.5;margin:0;max-width:260px}.slr-kpi-card__empty-icon,.slr-kpi-card__pulse{color:var(--slr-blue-50);font-size:32px;height:32px;margin-bottom:12px;width:32px}.slr-kpi-card__empty-icon{color:var(--slr-gray-60)}.slr-pulse{animation:slr-pulse-soft 2s ease-in-out infinite}@keyframes slr-pulse-soft{0%,to{opacity:.5;transform:scale(.95)}50%{opacity:1;transform:scale(1.05)}}.slr-trend{align-items:center;border-radius:12px;display:inline-flex;font-size:11px;font-weight:600;gap:2px;line-height:normal;padding:0 8px}.slr-kpi-card__value-row .slr-trend{font-size:13px}.slr-trend--up{color:var(--slr-green)}.slr-trend--down{color:var(--slr-red)}.slr-trend--solid.slr-trend--up{background-color:var(--slr-green);color:var(--slr-white)}.slr-trend--solid.slr-trend--down{background-color:var(--slr-red);color:var(--slr-white)}.slr-trend--issues{background:rgba(218,55,55,.1);font-weight:500}.slr-dash-section{margin-bottom:40px}.slr-dash-section+.slr-dash-section{margin-top:8px}.slr-dash-section__header{align-items:center;border-bottom:none;display:flex;margin:30px 0 15px;padding:0}.slr-dash-section__icon{align-items:center;background:var(--slr-blue-95);border-radius:var(--slr-radius-sm);color:var(--slr-blue-50);display:flex;flex-shrink:0;font-size:18px;height:36px;justify-content:center;width:36px}.slr-dash-section__title{color:var(--slr-black-light);font-size:20px;font-weight:600;margin:0 0 0 12px;white-space:nowrap}.slr-dash-section__line{background-color:var(--slr-gray-60);flex-grow:1;height:1px;margin-left:20px}.slr-dash-grid{align-items:stretch;display:grid;gap:16px;grid-template-columns:2fr 1fr}.slr-dash-grid--backlinks{grid-template-columns:1fr 2fr}@media (max-width:960px){.slr-dash-grid,.slr-dash-grid--backlinks{grid-template-columns:1fr}}.slr-dash-panel{display:flex;flex-direction:column;margin-bottom:0;min-height:0;padding:20px}.slr-dash-grid .slr-panel.slr-dash-panel{margin-bottom:0}.slr-dash-panel__title{flex-shrink:0;font-size:14px;font-weight:600;margin:0 0 4px}.slr-dash-panel__subtitle{color:var(--slr-gray-50);flex-shrink:0;font-size:12px;line-height:1.4;margin:0 0 16px}.slr-dash-panel__content{flex:1;min-height:220px}.slr-chart{height:260px;max-height:260px;overflow:hidden;position:relative}.slr-chart--donut-sm{height:120px;margin:0 auto;max-width:140px}.slr-chart-empty{align-items:center;border:2px dashed var(--slr-border-dashed);border-radius:12px;color:var(--slr-gray-50);display:flex;justify-content:center;min-height:250px;overflow:hidden;position:relative;text-align:center}.slr-chart-empty__grid{background-image:linear-gradient(to right,var(--slr-grid-line) 1px,transparent 1px),linear-gradient(to bottom,var(--slr-grid-line) 1px,transparent 1px);background-size:40px 40px;inset:0;position:absolute;z-index:1}.slr-chart-empty__content{padding:20px;position:relative;z-index:2}.slr-chart-empty__icon{color:var(--slr-blue-50);font-size:40px;height:40px;margin-bottom:15px;width:40px}.slr-chart-empty:not(.slr-chart-empty--waiting) .slr-chart-empty__icon{color:var(--slr-gray-60);font-size:32px;height:32px;width:32px}.slr-chart-empty__title{color:#1f2937;font-size:18px;font-weight:600;margin:0 0 8px}.slr-chart-empty__desc{color:#6b7280;font-size:14px;line-height:1.5;margin:0;max-width:300px}.slr-ai-score__header{align-items:baseline;display:flex;gap:10px;margin-bottom:16px}.slr-ai-score__value{color:var(--slr-blue-50);font-size:36px;font-weight:700;line-height:1}.slr-ai-score__delta{align-items:center;border-radius:2px;display:inline-flex;font-size:12px;font-weight:500;padding:3px 10px}.slr-ai-score__delta--up{background:var(--slr-green-bg);color:var(--slr-green)}.slr-ai-score__delta--down{background:var(--slr-red-bg);color:var(--slr-red)}.slr-ai-score__delta--flat{background:var(--slr-gray-bg);color:var(--slr-gray-30)}.slr-ai-score__breakdown{list-style:none;margin:0;padding:0}.slr-ai-score__row{align-items:center;border-top:1px dashed var(--slr-gray-95);display:flex;gap:10px;justify-content:space-between;padding:8px 0}.slr-ai-score__row:first-child{border-top:none;padding-top:0}.slr-ai-score__row-main{flex:1;min-width:0}.slr-ai-score__row-head{align-items:center;color:var(--slr-gray-50);display:flex;flex-wrap:wrap;font-size:12px;gap:6px}.slr-ai-score__row-weight{color:var(--slr-gray-60)}.slr-ai-score__bar{background:var(--slr-gray-95);border-radius:3px;height:6px;margin-top:4px;overflow:hidden;width:100%}.slr-ai-score__bar-fill{background:var(--slr-blue-50);border-radius:3px;height:100%}.slr-ai-score__row-value{color:var(--slr-gray-50);flex-shrink:0;font-size:13px;font-weight:500;min-width:28px;text-align:right}.slr-bl-dr{align-items:center;display:flex;flex-direction:column;gap:12px}.slr-bl-dr__score{align-items:baseline;display:flex;gap:8px}.slr-bl-dr__value{color:var(--slr-black-light);font-size:32px;font-weight:700}.slr-bl-metrics{display:flex;flex-wrap:wrap;gap:12px 24px;list-style:none;margin:0 0 16px;padding:0}.slr-bl-metrics__item{display:flex;flex-direction:column;gap:2px;min-width:120px}.slr-bl-metrics__label{color:var(--slr-gray-50);font-size:11px;letter-spacing:.02em;text-transform:uppercase}.slr-bl-metrics__value{align-items:center;color:var(--slr-black-light);display:inline-flex;font-size:16px;font-weight:700;gap:6px}.slr-chart--area{height:180px}.slr-skeleton{animation:slr-shimmer 1.4s ease infinite;background:linear-gradient(90deg,var(--slr-gray-95) 25%,var(--slr-gray-90) 50%,var(--slr-gray-95) 75%);background-size:200% 100%;border-radius:6px}@keyframes slr-shimmer{0%{background-position:200% 0}to{background-position:-200% 0}}.slr-skeleton--avatar{border-radius:50%;flex-shrink:0;height:24px;width:24px}.slr-skeleton--title{height:20px;width:200px}.slr-skeleton--line{height:12px;margin-bottom:10px}.slr-skeleton--sm{width:40%}.slr-skeleton--md{width:65%}.slr-skeleton--lg{height:28px;width:50%}.slr-skeleton--chart{border-radius:var(--slr-radius-sm);height:220px;margin-top:12px;width:100%}.slr-skeleton--chart-sm{height:160px}.slr-toolbar--skeleton{margin-bottom:0}.slr-skeleton--selector{border-radius:10px;height:40px;width:280px}.slr-skeleton--upgrade{border-radius:4px;height:40px;width:132px}.slr-dash-panel--skeleton,.slr-kpi-card--skeleton{pointer-events:none}.slr-kpi-card--skeleton{gap:12px;justify-content:flex-start}.slr-rank-tracker{max-width:none}.slr-rank-tracker__body{max-width:1600px;padding:20px 24px 40px}.slr-rt-filters{margin-bottom:20px;overflow:visible;padding:16px 20px;position:relative;z-index:5}.slr-rt-filters__left,.slr-rt-filters__row{align-items:center;column-gap:10px;display:flex}.slr-rt-filters__left{flex-wrap:wrap}.slr-rt-filters__right{margin-left:auto}.slr-rt-filters__hidden{display:none!important}.slr-rt-filter-input,.slr-rt-filter-select{background:var(--slr-white);border:1px solid var(--slr-gray-90);border-radius:var(--slr-radius-sm);color:var(--slr-blue-10);font-family:inherit;font-size:13px;height:38px;padding:8px 10px}.slr-rt-daterange{position:relative}.slr-rt-daterange__trigger{align-items:center;background:var(--slr-white);border:1px solid var(--slr-gray-90);border-radius:var(--slr-radius-sm);color:var(--slr-blue-10);column-gap:6px;cursor:pointer;display:inline-flex;font-family:inherit;font-size:13px;font-weight:400;height:38px;line-height:20px;padding:8px 10px;white-space:nowrap}.slr-rt-daterange__trigger .dashicons{color:var(--slr-blue-50);font-size:16px;height:16px;width:16px}.slr-rt-daterange__popover{background:var(--slr-white);border:1px solid var(--slr-gray-90);border-radius:var(--slr-radius-md);box-shadow:var(--slr-shadow-panel);min-width:640px;padding:12px 16px 16px;position:absolute;right:0;top:calc(100% + 8px);z-index:30}.slr-rt-daterange__close{background:transparent;border:none;color:var(--slr-gray-50);cursor:pointer;font-family:inherit;font-size:12px;position:absolute;right:10px;top:8px}.slr-rt-daterange__body{column-gap:12px;display:flex;padding-top:12px}.slr-rt-daterange__presets{border-right:1px solid var(--slr-gray-95);list-style:none;margin:0;min-width:130px;padding:0 8px 0 0}.slr-rt-daterange__preset{background:transparent;border:none;border-radius:4px;color:var(--slr-blue-10);cursor:pointer;display:block;font-family:inherit;font-size:13px;font-weight:500;padding:8px 10px;text-align:left;width:100%}.slr-rt-daterange__preset.is-active,.slr-rt-daterange__preset:hover{background:var(--slr-blue-50);color:var(--slr-white)}.slr-rt-daterange__save{color:var(--slr-gray-50);font-size:12px;margin-top:12px;padding:8px 10px 0}.slr-rt-daterange__save label{align-items:center;cursor:pointer;display:flex;gap:6px}.slr-rt-daterange__calendars{column-gap:16px;display:flex}.slr-rt-cal{width:230px}.slr-rt-cal__nav{align-items:center;display:flex;justify-content:space-between;margin-bottom:8px}.slr-rt-cal__caption{column-gap:4px;display:flex}.slr-rt-cal__caption select{background:var(--slr-white);border:1px solid var(--slr-gray-90);border-radius:4px;font-family:inherit;font-size:12px;height:26px;padding:0 8px}.slr-rt-cal__nav-btn{background:transparent;border:none;color:var(--slr-blue-10);cursor:pointer;height:24px;padding:0;width:24px}.slr-rt-cal__grid{display:grid;gap:2px;grid-template-columns:repeat(7,1fr)}.slr-rt-cal__weekday{color:var(--slr-gray-50);font-size:11px;padding:4px 0;text-align:center}.slr-rt-cal__day{background:transparent;border:none;border-radius:4px;color:var(--slr-blue-10);cursor:pointer;font-family:inherit;font-size:12px;height:28px}.slr-rt-cal__day.is-empty{cursor:default}.slr-rt-cal__day.is-disabled{color:var(--slr-gray-85);cursor:default}.slr-rt-cal__day.is-in-range{background:rgba(53,136,230,.15)}.slr-rt-cal__day.is-edge,.slr-rt-cal__day.is-edge.is-in-range{background:var(--slr-blue-50);color:var(--slr-white)}.slr-rt-cal__day:not(.is-disabled):not(.is-empty):hover{background:var(--slr-blue-95)}.slr-skeleton--daterange{border-radius:var(--slr-radius-sm);height:38px;margin-left:auto;width:220px}.slr-rt-summary{align-items:stretch;column-gap:18px;display:grid;grid-template-columns:minmax(0,1fr) minmax(0,2fr) minmax(0,1fr);margin-bottom:20px}.slr-rt-summary__card{box-sizing:border-box;margin-bottom:0;min-height:210px;min-width:0;padding:16px 18px 12px}.slr-rt-summary__title{color:var(--slr-blue-10);font-size:13px;font-weight:500;line-height:20px;margin:0 0 12px}.slr-rt-summary__value-row{align-items:center;column-gap:10px;display:flex;margin-bottom:8px}.slr-rt-summary__value{color:var(--slr-blue-10);font-size:26px;font-weight:700;line-height:1.2}.slr-rt-summary__empty{color:var(--slr-gray-50);font-size:13px;line-height:20px;margin:0}.slr-rt-avg-chart{height:120px;min-width:0}.slr-rt-donut{flex-shrink:0;height:140px;max-width:100%;width:140px}.slr-rt-spark{height:28px;min-width:60px}.slr-rt-dist-row__lost,.slr-rt-dist-row__new,.slr-rt-dist-row__num{text-align:center}.slr-rt-dist-row__new{color:var(--slr-green)}.slr-rt-dist-row__lost{color:var(--slr-red)}.slr-rt-aio-meta,.slr-rt-aio-stat{color:var(--slr-gray-30);font-size:12px;font-weight:500;line-height:18px;margin:0}.slr-rt-aio-stat{align-items:center;column-gap:8px;display:flex;margin-top:8px}.slr-rt-aio-progress{background:var(--slr-gray-95);border-radius:6px;height:11px;margin:10px 0;overflow:hidden}.slr-rt-aio-progress__bar{background:var(--slr-green);border-radius:6px;height:100%;min-width:0}.slr-rt-summary__distribution-body{align-items:center;column-gap:16px;display:flex;min-width:0}.slr-rt-summary__rows{flex:1}.slr-rt-dist-table{display:flex;flex:1;flex-direction:column;gap:8px;min-width:0}.slr-rt-dist-row{align-items:center;color:var(--slr-blue-10);column-gap:8px;display:grid;font-size:13px;grid-template-columns:minmax(90px,1.2fr) .6fr .5fr .5fr minmax(60px,1fr);line-height:20px}.slr-rt-dist-row--head{color:var(--slr-gray-50);font-size:13px;font-weight:500;text-align:center}.slr-rt-dist-row--head span:first-child{text-align:left}.slr-rt-dist-row__label{align-items:center;display:inline-flex;gap:6px;white-space:nowrap}.slr-rt-dist-row__dot{border-radius:50%;flex-shrink:0;height:10px;width:10px}.slr-skeleton--donut{border-radius:50%;flex-shrink:0;height:96px;width:96px}.slr-skeleton--bar{border-radius:6px;height:11px;margin:10px 0;width:100%}.slr-skeleton--button{border-radius:var(--slr-radius-sm);height:40px;margin-bottom:16px;width:160px}.slr-skeleton--search{width:240px}.slr-skeleton--search,.slr-skeleton--select{border-radius:var(--slr-radius-sm);height:36px}.slr-skeleton--select{width:160px}.slr-skeleton--cell{height:12px;margin:0 auto;width:28px}.slr-skeleton--spark{height:18px;margin:0;width:100%}.slr-rt-actions{margin-bottom:16px}.slr-rt-add-keywords.components-button{font-size:14px;font-weight:500;height:40px;padding:0 18px}.slr-rt-table-panel{background:var(--slr-white);border:1px solid var(--slr-gray-90);border-radius:var(--slr-radius-md);box-shadow:var(--slr-shadow-panel);overflow:hidden;padding:0}.slr-rt-table-toolbar{background:#fbfcfe;border-bottom:1px solid var(--slr-gray-95);justify-content:flex-end;padding:10px 12px}.slr-rt-table-toolbar,.slr-rt-table-toolbar__left{align-items:center;display:flex;flex-wrap:wrap;gap:10px}.slr-rt-table-toolbar__left{margin-right:auto}.slr-rt-table-toolbar__search{background:var(--slr-white);border:1px solid var(--slr-gray-90);border-radius:var(--slr-radius-sm);box-sizing:border-box;color:var(--slr-gray-30);font-family:var(--slr-font-family);font-size:13px;height:40px;max-width:280px;min-width:200px;padding:0 10px}.slr-rt-table-toolbar__search:focus{border-color:var(--slr-blue-50);box-shadow:0 0 0 2px rgba(0,123,255,.12);outline:none}.slr-rt-table-toolbar__search::placeholder{color:var(--slr-gray-60)}.slr-rt-table{background:var(--slr-white);padding:0 0 4px;width:100%}.slr-rt-table .tabulator{background:transparent;border:none;color:var(--slr-gray-30);font-family:var(--slr-font-family);font-size:13px;font-weight:400;width:100%}.slr-rt-table .tabulator[tabulator-layout=fitColumns] .tabulator-tableholder .tabulator-table{min-width:100%}.slr-rt-table .tabulator-tableholder{scrollbar-gutter:stable}.slr-rt-table .tabulator .tabulator-header{background:var(--slr-blue-95);border-bottom:1px solid var(--slr-gray-90);font-weight:500}.slr-rt-table .tabulator .tabulator-header .tabulator-col{background:var(--slr-blue-95);border-right:1px solid var(--slr-gray-95);box-sizing:border-box;justify-content:flex-start;min-height:55px}.slr-rt-table .tabulator .tabulator-header .tabulator-col.tabulator-sortable.tabulator-col-sorter-element:hover,.slr-rt-table .tabulator .tabulator-header .tabulator-col:hover{background:#d0e6fc!important;background-color:#d0e6fc!important}.slr-rt-table .tabulator .tabulator-header .tabulator-col .tabulator-col-content{align-items:center;box-sizing:border-box;display:flex;height:100%;justify-content:flex-start;min-height:55px;padding-bottom:10px;padding-top:10px;width:100%}.slr-rt-table .tabulator .tabulator-header .tabulator-col .tabulator-col-title-holder{align-items:center;display:flex;min-height:28px;width:100%}.slr-rt-table .tabulator .tabulator-header .tabulator-col.text-center .tabulator-col-content,.slr-rt-table .tabulator .tabulator-header .tabulator-col[style*="text-align: center"] .tabulator-col-content,.slr-rt-table .tabulator .tabulator-header .tabulator-col[style*="text-align:center"] .tabulator-col-content{justify-content:center}.slr-rt-table .tabulator .tabulator-header .tabulator-col.text-left .tabulator-col-content,.slr-rt-table .tabulator .tabulator-header .tabulator-col[style*="text-align: left"] .tabulator-col-content,.slr-rt-table .tabulator .tabulator-header .tabulator-col[style*="text-align:left"] .tabulator-col-content{justify-content:flex-start}.slr-rt-table .tabulator .tabulator-header .tabulator-col .tabulator-col-title{color:var(--slr-gray-30);font-size:13px;font-weight:500;line-height:28px;white-space:nowrap}.slr-rt-table .tabulator-row{background:var(--slr-white);border-bottom:1px solid var(--slr-gray-95);min-height:55px!important}.slr-rt-table .tabulator-row.tabulator-row-even{background:var(--slr-white)}.slr-rt-table .tabulator-row:hover{background:var(--slr-blue-97)!important}.slr-rt-table .tabulator-row .tabulator-cell{border-right:1px solid var(--slr-gray-95);box-sizing:border-box;color:var(--slr-gray-30);font-size:13px!important;font-weight:400;line-height:20px;overflow:hidden;padding:12px 10px!important;text-overflow:ellipsis;vertical-align:middle;white-space:nowrap}.slr-rt-table .tabulator-row .tabulator-cell.text-center{text-align:center}.slr-rt-table .tabulator-row .tabulator-cell.text-left{text-align:left}.slr-rt-table .tabulator-placeholder-contents{color:var(--slr-gray-50);font-size:13px;padding:48px 16px;text-align:center}.slr-rt-table .tabulator .tabulator-footer{background:var(--slr-white);border-top:1px solid var(--slr-gray-90);color:var(--slr-gray-50);font-family:var(--slr-font-family);font-weight:400;white-space:normal}.slr-rt-table .tabulator .tabulator-footer .tabulator-footer-contents{align-items:center;box-sizing:border-box;display:flex;flex-wrap:wrap;gap:12px 20px;justify-content:space-between;min-height:72px;padding:16px 20px!important}.slr-rt-table .tabulator .tabulator-footer .tabulator-page-counter{color:var(--slr-gray-50);flex:0 0 auto;font-size:12px;font-weight:500;line-height:18px;margin:0!important;order:1}.slr-rt-table .tabulator .tabulator-footer .tabulator-paginator{align-items:center;color:var(--slr-gray-50);display:flex;flex:1 1 auto;flex-wrap:wrap;font-family:inherit;font-size:13px;font-weight:500;gap:6px;justify-content:flex-end;margin:0;order:2;text-align:right}.slr-rt-table .tabulator .tabulator-footer .tabulator-paginator label{color:var(--slr-gray-50);font-size:12px;font-weight:400;margin:0 4px 0 0}.slr-rt-table .tabulator .tabulator-footer .tabulator-page-size,.slr-rt-table .tabulator .tabulator-footer select.tabulator-page-size{appearance:none;background-color:var(--slr-white);background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 width=%2710%27 height=%276%27%3E%3Cpath fill=%27%23767676%27 d=%27m1 1 4 4 4-4%27/%3E%3C/svg%3E");background-position:right 12px center;background-repeat:no-repeat;border:1px solid var(--slr-gray-90)!important;border-radius:10px!important;box-shadow:none;color:var(--slr-gray-50);cursor:pointer;display:inline-block;font-family:var(--slr-font-family);font-size:13px!important;font-weight:400!important;height:40px;line-height:18px!important;margin:0 12px 0 0!important;min-width:72px;outline:none;padding:0 32px 0 12px!important;vertical-align:middle}.slr-rt-table .tabulator .tabulator-footer .tabulator-page-size:focus,.slr-rt-table .tabulator .tabulator-footer .tabulator-page-size:hover{border-color:var(--slr-blue-50)!important}.slr-rt-table .tabulator .tabulator-footer .tabulator-pages{align-items:center;display:inline-flex;gap:4px;margin:0 4px!important;vertical-align:middle}.slr-rt-table .tabulator .tabulator-footer .tabulator-page{align-items:center;background:var(--slr-white)!important;border:1px solid var(--slr-gray-90)!important;border-radius:10px!important;box-shadow:none;color:var(--slr-gray-50)!important;cursor:pointer;display:inline-flex!important;font-family:var(--slr-font-family);font-size:13px;font-weight:500;height:36px;justify-content:center;line-height:1;margin:0 2px!important;min-width:36px;padding:0 12px!important;transition:background-color .15s ease,color .15s ease,border-color .15s ease;vertical-align:middle}.slr-rt-table .tabulator .tabulator-footer .tabulator-page:not(:disabled):hover{background:var(--slr-blue-97)!important;border-color:var(--slr-blue-50)!important;color:var(--slr-blue-50)!important}.slr-rt-table .tabulator .tabulator-footer .tabulator-page.active{background:var(--slr-blue-50)!important;border-color:var(--slr-blue-50)!important;color:var(--slr-white)!important}.slr-rt-table .tabulator .tabulator-footer .tabulator-page.disabled,.slr-rt-table .tabulator .tabulator-footer .tabulator-page:disabled{background:var(--slr-white)!important;color:var(--slr-gray-50)!important;cursor:default;opacity:.35}.slr-rt-table .tabulator-cell.slr-rt-col--keyword{overflow:hidden;white-space:nowrap}.slr-rt-keyword{align-items:center;color:var(--slr-blue-50);display:inline-flex;font-weight:500;gap:4px;max-width:100%;min-width:0;vertical-align:middle}.slr-rt-keyword__text{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.slr-rt-keyword__icon{color:var(--slr-red);flex-shrink:0;font-size:16px;height:16px;width:16px}.slr-rt-keyword__icon--target{color:var(--slr-blue)}.slr-rt-location{align-items:center;display:inline-flex;gap:6px;white-space:nowrap}.slr-rt-flag{font-size:14px;line-height:1}.slr-rt-device{font-size:18px;height:18px;width:18px}.slr-rt-device--desktop{color:var(--slr-orange)}.slr-rt-device--mobile{color:var(--slr-blue-50)}.slr-rt-rank{align-items:center;display:inline-flex;font-weight:700;gap:4px;justify-content:center}.slr-rt-rank__new{color:#e91e8c;font-size:9px;font-weight:700}.slr-rt-change{align-items:center;border-radius:4px;display:inline-flex;font-size:10px;font-weight:500;gap:2px;line-height:15px;padding:1px 5px}.slr-rt-change--up{background:var(--slr-green);color:var(--slr-white)}.slr-rt-change--down{background:var(--slr-red);color:var(--slr-white)}.slr-rt-change--up-text{background:transparent;color:var(--slr-green);padding:0}.slr-rt-change--down-text{background:transparent;color:var(--slr-red);padding:0}.slr-rt-change--empty,.slr-rt-change--zero{background:transparent;color:var(--slr-gray-60);padding:0}.slr-rt-dates{align-items:center;display:inline-flex;gap:4px}.slr-rt-dates--stack{flex-wrap:wrap;justify-content:center}.slr-rt-table .tabulator-cell[tabulator-field=ai_overview],.slr-rt-table .tabulator-cell[tabulator-field=snippets],.slr-rt-table .tabulator-cell[tabulator-field=tags]{overflow:hidden;white-space:normal}.slr-rt-aio{align-items:flex-start;color:var(--slr-gray-30);display:inline-flex;flex-direction:column;font-size:10px;font-weight:400;gap:2px;line-height:15px}.slr-rt-aio__presence{color:var(--slr-green)}.slr-rt-aio__links,.slr-rt-aio__presence{align-items:center;display:inline-flex;gap:2px}.slr-rt-aio .dashicons{font-size:15px;height:15px;width:15px}.slr-rt-aio__brand{background:rgba(80,177,66,.21);border-radius:4px;color:var(--slr-green);font-weight:400;padding:1px 3px}.slr-rt-url{display:block;max-width:100%;min-width:0;overflow:hidden;text-align:left;text-overflow:ellipsis;white-space:nowrap}.slr-rt-url a{color:var(--slr-blue-50);text-decoration:none}.slr-rt-tags{align-items:center;display:flex;flex-wrap:wrap;gap:2px;justify-content:flex-start;max-width:100%;min-width:0}.slr-rt-tag{border-radius:10px;color:var(--slr-blue-10);display:inline-block;font-size:11px;line-height:18px;max-width:100%;overflow:hidden;padding:1px 8px;text-overflow:ellipsis;white-space:nowrap}.slr-rt-local,.slr-rt-snippets{align-items:center;display:inline-flex;gap:4px}.slr-rt-snippet{font-size:16px;height:16px;width:16px}.slr-rt-snippet--muted{color:var(--slr-gray-60)}.slr-rt-snippet--user{color:var(--slr-blue-50)}.slr-rt-snippet--competitor{color:#edc92f}.slr-rt-cell-icon{font-size:16px;height:16px;width:16px}.slr-rt-cell-icon--muted{color:var(--slr-gray-60)}.slr-rt-cell-icon--danger{color:var(--slr-red)}.slr-rt-cell-icon--warn{color:#e91e8c}.slr-rt-local-link{color:inherit;text-decoration:none}.slr-rt-local-pos{font-weight:600}@media screen and (max-width:768px){.slr-rt-table-toolbar{justify-content:stretch}.slr-rt-table-toolbar__left,.slr-rt-table-toolbar__search{max-width:none;width:100%}.slr-rt-table .tabulator .tabulator-footer .tabulator-footer-contents{justify-content:center;min-height:0;padding:14px 12px!important}.slr-rt-table .tabulator .tabulator-footer .tabulator-page-counter,.slr-rt-table .tabulator .tabulator-footer .tabulator-paginator{flex:0 0 100%;justify-content:center;text-align:center}}@media screen and (max-width:1100px){.slr-rt-table-toolbar{flex-wrap:wrap}}.slr-rt-table .tabulator-row.slr-rt-row--clickable{cursor:pointer}.slr-rt-table .tabulator-row.slr-rt-row--active{background:var(--slr-blue-97)!important}.slr-kw-stats-modal.components-modal__frame{display:flex;flex-direction:column;max-height:94vh;max-width:94vw;width:min(1280px,94vw)}.slr-kw-stats-modal .components-modal__header{background:var(--slr-white);border-bottom:none;height:auto;justify-content:flex-end;min-height:44px;padding:12px 20px 0;position:relative!important;top:auto}.slr-kw-stats-modal .components-modal__header-heading{display:none}.slr-kw-stats-modal .components-modal__content{display:flex;flex-direction:column;margin-top:0!important;overflow:auto;padding:4px 32px 24px!important}.slr-kw-stats{min-height:360px;position:relative}.slr-kw-stats .slr-panel{margin-bottom:0;padding:16px 20px}.slr-kw-stats__heading{align-items:baseline;column-gap:8px;display:flex;font-size:18px;font-weight:600;line-height:1.3;margin:0 0 12px;padding:0}.slr-kw-stats__heading-label{color:var(--slr-gray-50);font-weight:500}.slr-kw-stats__heading-value{color:var(--slr-blue-10);font-weight:600}.slr-kw-stats__top{align-items:center;display:flex;flex-wrap:wrap;gap:16px;justify-content:space-between;margin:0 0 20px}.slr-kw-stats__attrs,.slr-kw-stats__target{align-items:center;background:var(--slr-white);border:1px solid var(--slr-gray-90);border-radius:4px;color:var(--slr-blue-10);display:flex;font-size:13px;line-height:1.3;padding:12px 20px}.slr-kw-stats__attrs{column-gap:20px}.slr-kw-stats__attr{align-items:center;column-gap:8px;display:inline-flex;white-space:nowrap}.slr-kw-stats__attr .dashicons{font-size:18px;height:18px;width:18px}.slr-kw-stats__attr--rank{font-weight:500}.slr-kw-stats__attr--rank strong{font-weight:600}.slr-kw-stats__target{column-gap:8px;max-width:42%}.slr-kw-stats__target-label{font-weight:500;white-space:nowrap}.slr-kw-stats__target-url{color:var(--slr-gray-50);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.slr-kw-stats__body{align-items:stretch;column-gap:12px;display:flex}.slr-kw-stats__body.is-loading{opacity:0;pointer-events:none}.slr-kw-stats__left{min-width:0;width:70%}.slr-kw-stats__right{display:flex;flex-direction:column;gap:12px;min-width:0;width:30%}.slr-kw-stats .slr-kw-stats-chart{height:280px;margin:8px 0 28px;overflow:hidden;position:relative}.slr-kw-stats-chart__canvas{height:248px;overflow:hidden}.slr-kw-stats-top10__title{align-items:center;color:var(--slr-blue-10);display:flex;flex-wrap:wrap;font-size:13px;font-weight:500;gap:8px;margin:8px 0 16px}.slr-kw-stats-top10__serp{align-items:center;color:var(--slr-blue-50);display:inline-flex;font-weight:500;gap:4px;text-decoration:none}.slr-kw-stats-top10__serp:hover{color:var(--slr-blue-50)}.slr-kw-stats-top10__serp .dashicons{font-size:16px;height:16px;width:16px}.slr-kw-stats-top10__panel{background:var(--slr-blue-95);border-radius:13px;height:280px;overflow:auto}.slr-kw-stats-modal .slr-kw-stats-top10__table{background:var(--slr-white);border-collapse:collapse;border-spacing:0;margin:0;width:100%}.slr-kw-stats-top10__table thead{background:var(--slr-blue-95);position:sticky;top:0;z-index:1}.slr-kw-stats-top10__table td,.slr-kw-stats-top10__table th{font-size:13px;font-weight:500;line-height:22px;padding:8px 12px;text-align:left;vertical-align:middle}.slr-kw-stats-top10__table th{background:var(--slr-blue-95);color:var(--slr-gray-30)}.slr-kw-stats-top10__table td{border-top:1px solid var(--slr-gray-95);color:var(--slr-blue-50)}.slr-kw-stats-top10__pos{text-align:center!important;width:88px}.slr-kw-stats-top10__row--strong td{font-weight:700}.slr-kw-stats-top10__link{color:var(--slr-blue-50);display:inline-block;max-width:100%;overflow:hidden;text-decoration:none;text-overflow:ellipsis;vertical-align:middle;white-space:nowrap}.slr-kw-stats-top10__link:hover{color:var(--slr-blue-50)}.slr-kw-stats-top10__link--mine{color:var(--slr-chart-orange)}.slr-kw-stats-top10__icon{font-size:16px;height:16px;margin-left:6px;vertical-align:middle;width:16px}.slr-kw-stats-top10__icon--target{color:var(--slr-blue)}.slr-kw-stats-top10__icon--cann{color:var(--slr-red)}.slr-kw-stats-stats__metrics{display:flex;flex-wrap:wrap;gap:8px 20px}.slr-kw-stats-stats__metric{align-items:baseline;column-gap:6px;display:inline-flex}.slr-kw-stats-stats__label{color:var(--slr-gray-50);font-size:12px;font-weight:500;line-height:16px}.slr-kw-stats-stats__value{color:var(--slr-blue-10);font-size:12px;font-weight:500;line-height:16px}.slr-kw-stats-stats__trend-title,.slr-kw-stats-tags__title{color:var(--slr-blue-10);font-size:13px;font-weight:500;margin-bottom:0;margin-top:16px}.slr-kw-stats-stats__trend{height:142px;margin-top:8px;overflow:hidden}.slr-kw-stats-tags{min-height:120px}.slr-kw-stats-tags__title{margin-bottom:12px;margin-top:0}.slr-kw-stats__empty{color:var(--slr-gray-50);font-size:13px;margin:8px 0 0}.slr-kw-stats__loader{align-items:center;display:flex;flex-direction:column;gap:12px;inset:80px 0 64px;justify-content:flex-start;padding-top:40px;position:absolute}.slr-kw-stats__loader p{color:var(--slr-gray-50);font-size:13px;margin:0}.slr-kw-stats__footer{align-items:center;display:flex;justify-content:space-between;margin-top:20px}.slr-kw-stats__nav.components-button.is-link{align-items:center;box-shadow:none;color:var(--slr-blue-50);column-gap:6px;display:inline-flex;font-size:13px;font-weight:500;text-decoration:none}.slr-kw-stats__nav.components-button.is-link:hover{color:var(--slr-blue-50)}@media screen and (max-width:960px){.slr-kw-stats__body{flex-direction:column;row-gap:12px}.slr-kw-stats__left,.slr-kw-stats__right{width:100%}.slr-kw-stats__target{display:none}.slr-kw-stats__attrs{flex-wrap:wrap;justify-content:space-between;row-gap:8px;width:100%}}.slr-addkw-modal.components-modal__frame{display:flex;flex-direction:column;max-height:94vh;max-width:80vw;width:min(1120px,80vw)}.slr-addkw-modal .components-modal__header{background:transparent;border-bottom:none;height:auto;justify-content:flex-end;left:auto;min-height:0;padding:16px 16px 0 0;position:absolute!important;right:0;top:0;width:auto}.slr-addkw-modal .components-modal__header-heading{display:none}.slr-addkw-modal .components-modal__content{display:flex;flex-direction:column;margin-top:0!important;overflow:auto;padding:20px 40px 28px!important}.slr-addkw{position:relative}.slr-addkw__busy{align-items:center;background:hsla(0,0%,100%,.65);display:flex;inset:0;justify-content:center;position:absolute;z-index:30}.slr-addkw-upgrade__title{font-size:16px;font-weight:600;margin:0 0 8px}.slr-addkw__header{align-items:center;column-gap:24px;display:flex;margin:0 0 20px;padding-right:36px}.slr-addkw__title{color:var(--slr-blue-10);font-size:18px;font-weight:600;line-height:1.3;margin:0}.slr-addkw__remaining{background:var(--slr-blue-95);border:1px solid var(--slr-blue-50);border-radius:4px;color:var(--slr-blue-10);font-size:12px;font-weight:400;padding:8px 12px}.slr-addkw__remaining-count{color:var(--slr-blue-40);font-weight:500}.slr-addkw__remaining.is-danger{background:#cb333354;border-color:var(--slr-red)}.slr-addkw__remaining.is-danger .slr-addkw__remaining-count{color:var(--slr-red)}.slr-addkw__body{align-items:stretch;display:flex}.slr-addkw__col{min-width:0;width:50%}.slr-addkw__col--left{border-right:1px solid var(--slr-gray-90);padding-right:40px}.slr-addkw__col--right{padding-left:40px}.slr-addkw-section__title{align-items:flex-start;color:var(--slr-blue-10);column-gap:10px;display:flex;font-size:13px;font-weight:500;line-height:1.4}.slr-addkw-section__number{border:1px solid var(--slr-blue-50);border-radius:4px;color:var(--slr-blue-50);flex:0 0 auto;font-size:13px;font-weight:500;line-height:20px;padding:0 7px}.slr-addkw-section__heading{font-weight:500}.slr-addkw-section__desc,.slr-addkw-section__optional{color:var(--slr-gray-50);font-weight:400}.slr-addkw-section__desc{font-size:11px;line-height:1.4;margin:6px 0 0}.slr-addkw-section--spaced{margin-top:48px}.slr-addkw-lined{background:var(--slr-white);border:1px solid var(--slr-gray-90);border-radius:10px;display:flex;margin-top:10px;min-height:210px;overflow:hidden}.slr-addkw-lined__nums{color:var(--slr-gray-50);display:flex;flex-direction:column;font-size:13px;font-weight:400;line-height:22px;margin-right:5px;min-width:29px;padding:8px 6px;text-align:right;-webkit-user-select:none;user-select:none}.slr-addkw-lined__input{background:transparent;border:none;box-shadow:none;color:var(--slr-blue-10);flex:1;font-size:13px;line-height:22px;margin:0;min-width:0;padding:8px 12px 8px 0;resize:none;width:100%}.slr-addkw-lined__input:focus{border:none;box-shadow:none;outline:none}.slr-addkw-error{color:var(--slr-red);font-size:11px;line-height:1.4;margin:6px 0 0}.slr-addkw-input{background:var(--slr-white);border:1px solid var(--slr-gray-90);border-radius:10px;box-shadow:none;color:var(--slr-blue-10);display:block;font-size:13px;line-height:1.4;margin-top:10px;padding:10px 12px;width:100%}.slr-addkw-input:focus{border-color:var(--slr-blue-50);box-shadow:none;outline:none}.slr-addkw-suggest{position:relative}.slr-addkw-suggest__list{background:var(--slr-white);border:1px solid var(--slr-gray-90);border-radius:0 0 10px 10px;box-shadow:var(--slr-shadow-panel);left:0;max-height:240px;overflow:auto;position:absolute;right:0;top:calc(100% - 2px);z-index:20}.slr-addkw-suggest__status{align-items:center;color:var(--slr-gray-50);display:flex;font-size:13px;justify-content:center;min-height:48px;padding:12px}.slr-addkw-suggest__item{align-items:flex-start;background:transparent;border:none;cursor:pointer;display:flex;flex-direction:column;padding:8px 12px;text-align:left;width:100%}.slr-addkw-suggest__item:focus,.slr-addkw-suggest__item:hover{background:var(--slr-blue-95)}.slr-addkw-suggest__item-main{align-items:center;color:var(--slr-blue-10);column-gap:8px;display:inline-flex;font-size:13px}.slr-addkw-suggest__item-meta{color:var(--slr-gray-50);font-size:11px;font-style:italic;margin-left:26px}.slr-addkw-chips{display:flex;flex-wrap:wrap;gap:8px;margin-top:16px}.slr-addkw-chip{align-items:center;background:var(--slr-white);border:1px solid #c7cadc;border-radius:10px;color:var(--slr-blue-10);column-gap:8px;display:inline-flex;font-size:14px;font-weight:400;padding:4px 10px;white-space:nowrap}.slr-addkw-chip__remove{background:transparent;border:none;color:var(--slr-blue-10);cursor:pointer;font-size:18px;line-height:1;padding:0 2px}.slr-addkw-device{border:1px solid var(--slr-gray-90);border-radius:10px;display:flex;height:38px;margin-top:10px;max-width:100%;overflow:hidden;width:338px}.slr-addkw-device__btn{align-items:center;background:var(--slr-white);border:none;color:var(--slr-gray-50);column-gap:8px;cursor:pointer;display:inline-flex;flex:1;font-size:13px;font-weight:500;justify-content:center}.slr-addkw-device__btn:first-child{border-radius:10px 0 0 10px}.slr-addkw-device__btn:last-child{border-radius:0 10px 10px 0}.slr-addkw-device__btn.is-selected,.slr-addkw-device__btn:hover{background:#3588e626;color:var(--slr-blue-50)}.slr-addkw-device__btn .dashicons{font-size:16px;height:16px;width:16px}.slr-addkw__footer{align-items:center;display:flex;flex-direction:column;margin-top:28px}.slr-addkw__submit.components-button{font-size:14px;font-weight:500;height:40px;justify-content:center;min-width:280px}.slr-addkw__note{align-items:center;background:var(--slr-gray-95);border-radius:10px;color:var(--slr-gray-30);column-gap:10px;display:flex;font-size:13px;justify-content:center;line-height:1.4;margin-top:24px;padding:16px;width:100%}.slr-addkw__note .dashicons{color:var(--slr-gray-30);font-size:18px;height:18px;width:18px}@media screen and (max-width:960px){.slr-addkw-modal.components-modal__frame{max-height:100vh;max-width:none;width:100%}.slr-addkw-modal .components-modal__content{padding:8px 16px 20px!important}.slr-addkw__body{flex-direction:column}.slr-addkw__col{width:100%}.slr-addkw__col--left{border-right:none;padding-right:0}.slr-addkw__col--right{margin-top:32px;padding-left:0}.slr-addkw-device,.slr-addkw__submit.components-button{width:100%}}
     3.wrap.slr-admin-wrap{background:transparent;color:var(--slr-black-light);font-family:var(--slr-font-family);margin:0;max-width:none;padding:0}body.slr-admin #wpcontent{padding-left:0}body.slr-admin #wpbody-content{padding-bottom:0}.slr-admin-wrap .components-notice{border-radius:var(--slr-radius-sm)}.slr-panel{background:var(--slr-white);border-radius:var(--slr-radius-lg);box-shadow:var(--slr-shadow-panel);margin-bottom:24px;padding:24px}.slr-panel__title{color:var(--slr-black-light);font-size:16px;font-weight:600;margin:0 0 16px}.slr-header{justify-content:space-between;margin-bottom:24px}.slr-header,.slr-header__brand{align-items:center;display:flex}.slr-header__brand{gap:12px}.slr-header__logo{background:linear-gradient(209deg,#4e78f4 1.64%,#4ef4b9 98.45%);border-radius:var(--slr-radius-sm);height:36px;width:36px}.slr-header__title{color:var(--slr-black-light);font-size:24px;font-weight:700;margin:0}.slr-header__meta{color:var(--slr-gray-50);font-size:14px;margin:0}.slr-kpi-grid{display:grid;gap:16px;grid-template-columns:repeat(auto-fit,minmax(180px,1fr));margin-bottom:24px}.slr-kpi-card{background:var(--slr-white);border-radius:var(--slr-radius-lg);box-shadow:var(--slr-shadow-panel);padding:16px 20px}.slr-kpi-card__label{color:var(--slr-gray-50);font-size:13px;font-weight:500;margin:0 0 8px}.slr-status--connected{color:var(--slr-green);font-weight:600}.slr-status--disconnected{color:var(--slr-red);font-weight:600}.slr-domain-list{list-style:none;margin:0;padding:0}.slr-domain-list__item{align-items:center;border-bottom:1px solid var(--slr-gray-95);display:flex;justify-content:space-between;padding:12px 0}.slr-domain-list__item:last-child{border-bottom:none}.slr-domain-list__name{font-weight:500}.slr-domain-list__meta{color:var(--slr-gray-50);font-size:12px}.slr-empty-state{color:var(--slr-gray-50);padding:48px 24px;text-align:center}.slr-admin-wrap .components-button.is-primary{background:var(--slr-blue-50);border-color:var(--slr-blue-50);border-radius:var(--slr-radius-sm)}.slr-admin-wrap .components-button.is-primary:hover:not(:disabled){background:var(--slr-blue-40);border-color:var(--slr-blue-40)}.slr-admin-wrap .components-button.is-secondary{background:var(--slr-white);border:1px solid var(--slr-blue-50);border-radius:4px;color:var(--slr-blue-50)}.slr-admin-wrap .components-button.is-secondary:hover:not(:disabled){background:var(--slr-white);color:var(--slr-blue-50);opacity:.85}.slr-admin-wrap .components-select-control__input,.slr-admin-wrap .components-text-control__input{border-radius:var(--slr-radius-sm)}.slr-admin-wrap .dataviews-wrapper{border-radius:var(--slr-radius-sm);box-shadow:var(--slr-shadow-panel);overflow:hidden}.slr-app{padding:20px 24px 40px}.slr-app:has(.slr-ai-visibility),.slr-app:has(.slr-dashboard),.slr-app:has(.slr-rank-tracker){padding:0}.slr-app--loading{align-items:center;display:flex;justify-content:center;min-height:240px}.slr-onboarding{margin:0 auto;max-width:560px;padding:24px 0 48px}.slr-create-project{max-width:620px}.slr-create-project__title{color:var(--slr-blue-10);font-size:22px;font-weight:600;line-height:1.3;margin:0 0 8px}.slr-create-project__lead{color:var(--slr-gray-50);font-size:14px;line-height:1.55;margin:0 0 28px}.slr-create-project__fields{display:flex;flex-direction:column;gap:20px}.slr-create-project .components-base-control__label,.slr-create-project .components-input-control__label,.slr-create-project__label{color:var(--slr-blue-10);display:block;font-size:13px;font-weight:500;letter-spacing:0;line-height:1.4;margin:0 0 6px;text-transform:none}.slr-create-project .components-base-control__help,.slr-create-project__hint{color:var(--slr-gray-50);font-size:12px;line-height:1.45;margin:6px 0 0}.slr-create-project .components-input-control__input,.slr-create-project .components-select-control__input,.slr-create-project .components-text-control__input{border-color:var(--slr-gray-90);border-radius:var(--slr-radius-sm);color:var(--slr-blue-10);min-height:40px}.slr-create-project__domain .components-text-control__input:disabled{background:var(--slr-blue-97);box-shadow:none;color:var(--slr-blue-10);opacity:1}.slr-create-project__tracking{border:0;margin:4px 0 0;min-width:0;padding:0}.slr-create-project__tracking .slr-create-project__hint{margin:0 0 12px}.slr-tracking-options{display:flex;flex-direction:column;gap:10px}.slr-tracking-option{align-items:center;background:var(--slr-white);border:1px solid var(--slr-gray-95);border-radius:var(--slr-radius-sm);box-shadow:none;color:inherit;cursor:pointer;display:flex;gap:16px;justify-content:space-between;margin:0;padding:14px 16px;text-align:left;width:100%}.slr-tracking-option:hover:not(:disabled){border-color:var(--slr-blue-50)}.slr-tracking-option:focus{outline:none}.slr-tracking-option:focus-visible{border-color:var(--slr-blue-50);box-shadow:0 0 0 2px var(--slr-blue-95)}.slr-tracking-option.is-selected{background:var(--slr-blue-97);border-color:var(--slr-blue-50)}.slr-tracking-option:disabled{cursor:default;opacity:.7}.slr-tracking-option__text{display:flex;flex-direction:column;gap:4px;min-width:0}.slr-tracking-option__title{color:var(--slr-blue-10);font-size:14px;font-weight:600;line-height:1.3}.slr-tracking-option__desc{color:var(--slr-gray-50);font-size:12px;font-weight:400;line-height:1.45}.slr-tracking-option__check{background:var(--slr-white);border:2px solid var(--slr-gray-85);border-radius:50%;box-shadow:inset 0 0 0 3px var(--slr-white);flex:0 0 auto;height:18px;width:18px}.slr-tracking-option.is-selected .slr-tracking-option__check{background:var(--slr-blue-50);border-color:var(--slr-blue-50)}.slr-create-project__actions{margin-top:8px}.slr-create-project__actions .components-button{font-weight:500;min-height:40px;padding:0 20px}.slr-onboarding__hero{margin-bottom:32px;text-align:center}.slr-onboarding__logo{height:48px;margin:0 auto 16px;width:48px}.slr-onboarding__title{color:var(--slr-black-light);font-size:28px;font-weight:700;margin:0}.slr-onboarding__panel{padding:32px}.slr-onboarding__panel>.components-notice{margin:0 0 24px}.slr-onboarding__lead{color:var(--slr-gray-50);font-size:15px;line-height:1.6;margin:0 0 24px}.slr-onboarding__question{color:var(--slr-black-light);font-size:16px;font-weight:600;margin:0 0 24px}.slr-onboarding__help{color:var(--slr-gray-50);font-size:14px;line-height:1.5;margin:0 0 12px}.slr-onboarding__help a{color:var(--slr-blue-50)}.slr-onboarding__actions{display:flex;flex-wrap:wrap;gap:12px;margin-top:24px}.slr-onboarding__divider{border:0;border-top:1px dashed var(--slr-gray-90);margin:28px 0}.slr-onboarding__loader{display:flex;justify-content:center;padding:24px 0}.slr-settings__actions{margin-top:16px}.slr-project-modal__lead{font-size:14px;line-height:1.5;margin:0 0 8px}.slr-project-modal__hint{color:var(--slr-gray-50);font-size:13px;margin:0 0 16px}.slr-project-modal__error{color:var(--slr-red);margin:12px 0 0}.slr-project-modal__actions{display:flex;justify-content:flex-end;margin-top:20px}.slr-project-summary{list-style:none;margin:0;padding:0}.slr-project-summary li{border-bottom:1px solid var(--slr-gray-95);display:flex;gap:12px;padding:8px 0}.slr-project-summary li:last-child{border-bottom:none}.slr-project-summary__label{color:var(--slr-gray-50);font-weight:600;min-width:100px}.slr-dashboard{max-width:none}.slr-dashboard__body{max-width:1600px;padding:20px 24px 40px}.slr-toolbar{align-items:center;background:var(--slr-white);border-bottom:1px solid var(--slr-gray-95);box-sizing:border-box;display:flex;gap:16px;height:60px;justify-content:space-between;margin:0;min-height:60px;padding:0 24px;width:100%}.slr-toolbar__left{align-items:center;display:flex;min-width:0}.slr-toolbar__keywords{align-items:center;color:var(--slr-black);column-gap:4px;display:flex;font-size:13px;font-weight:500;height:24px;line-height:19px;margin-left:20px;white-space:nowrap}.slr-toolbar__sync{align-items:center;column-gap:4px;display:inline-flex}.slr-toolbar__sync--ok{color:var(--slr-green)}.slr-toolbar__sync--warn{color:var(--slr-red)}.slr-toolbar__sync .dashicons{font-size:13px;height:13px;line-height:13px;margin-left:5px;width:13px}@media screen and (max-width:782px){.slr-toolbar{flex-wrap:wrap;height:auto;min-height:60px;padding:10px 16px}}.slr-project-selector{position:relative}.slr-project-selector__toggle{align-items:center;background:var(--slr-white);border:1px solid var(--slr-gray-90);border-radius:10px;color:var(--slr-black);column-gap:8px;cursor:pointer;display:flex;font-family:inherit;font-size:13px;font-weight:500;height:40px;line-height:24px;padding:8px 10px;text-align:left;width:280px}.slr-project-selector__toggle:disabled{cursor:default;opacity:1}.slr-project-selector__toggle:hover:not(:disabled),.slr-project-selector__toggle[aria-expanded=true]{border-color:var(--slr-gray-85)}.slr-project-selector__favicon{border:1px solid var(--slr-gray-90);border-radius:50%;flex-shrink:0;height:24px;object-fit:cover;width:24px}.slr-project-selector__item .slr-project-selector__favicon{height:20px;width:20px}.slr-project-selector__favicon--fallback{align-items:center;background:var(--slr-blue-95);color:var(--slr-blue-50);display:inline-flex;font-size:11px;font-weight:600;justify-content:center}.slr-project-selector__name{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.slr-project-selector__chevron{color:var(--slr-black-light);flex-shrink:0;font-size:14px;height:14px;width:14px}.slr-project-selector__menu{background:var(--slr-white);border:1px solid var(--slr-gray-95);border-radius:10px;box-shadow:var(--slr-shadow-panel);left:0;max-height:430px;overflow:auto;overflow-x:hidden;position:absolute;top:calc(100% + 6px);width:280px;z-index:20}.slr-project-selector__search{background:var(--slr-white);border-bottom:1px solid #eee;padding:10px;position:sticky;top:0;z-index:1}.slr-project-selector__search .dashicons{color:#999;font-size:14px;height:14px;left:20px;pointer-events:none;position:absolute;top:18px;width:14px}.slr-project-selector__search input{border:1px solid #dfe1e6;border-radius:6px;box-sizing:border-box;font-family:inherit;font-size:13px;height:32px;padding:0 10px 0 30px;width:100%}.slr-project-selector__search input:focus{border-color:var(--slr-blue-50);box-shadow:0 0 0 2px rgba(0,123,255,.1);outline:none}.slr-project-selector__list{list-style:none;margin:0;padding:6px 0 8px}.slr-project-selector__item{align-items:center;background:transparent;border:0;color:var(--slr-black-light);cursor:pointer;display:flex;font-family:inherit;font-size:12px;gap:8px;height:32px;padding:6px 10px;text-align:left;width:100%}.slr-project-selector__item:hover{background:var(--slr-blue-97)}.slr-project-selector__item.is-selected{color:var(--slr-blue-50);font-weight:500}.slr-project-selector__item-name{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.slr-project-selector__check{color:var(--slr-blue-50);flex-shrink:0;font-size:16px;height:16px;width:16px}.slr-project-selector__empty{color:var(--slr-gray-50);font-size:12px;padding:12px 10px}.slr-upgrade-button{align-items:center;background:linear-gradient(209.09deg,#4e78f4 42.6%,#4ef4b9 98.45%);border:none;border-radius:4px;box-sizing:border-box;color:var(--slr-white)!important;column-gap:6px;cursor:pointer;display:inline-flex;font-family:inherit;font-size:13px;font-weight:500;height:40px;line-height:1;min-width:132px;padding:10px 24px;text-decoration:none!important;white-space:nowrap}.slr-upgrade-button:focus,.slr-upgrade-button:hover{color:var(--slr-white)!important;opacity:.9;text-decoration:none!important}.slr-upgrade-button:disabled{cursor:wait;opacity:.7}.slr-upgrade-button__icon{background:url(data:image/svg+xml;base64,PCEtLSBPcmlnaW5hbCBUcnVlUmFua2VyIHJvY2tldCBpY29uLiBMaWNlbnNlOiBHUEwtMi4wLW9yLWxhdGVyLiAtLT4KPHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIj4KCTxwYXRoIGZpbGw9IiNmZmYiIGZpbGwtcnVsZT0iZXZlbm9kZCIgZD0iTTEyIDJjLjUgMCAxIC4zIDEuMy43TDE2IDYuMlYxNWEyIDIgMCAwIDEtMiAyaC0uMmwxLjQgMy42YS43NS43NSAwIDEgMS0xLjQuNkwxMiAxNy44bC0xLjggMy42YS43NS43NSAwIDEgMS0xLjQtLjZMMTAuMiAxN0gxMGEyIDIgMCAwIDEtMi0yVjYuMkwxMC43IDIuN0MxMSAyLjMgMTEuNSAyIDEyIDJabTAgNS4yNWExLjUgMS41IDAgMSAwIDAgMyAxLjUgMS41IDAgMCAwIDAtM1oiLz4KCTxwYXRoIGZpbGw9IiNmZmYiIGQ9Ik04IDExLjUgNC4yIDE2LjJhLjYuNiAwIDAgMCAuNSAxbDMuMy0uOVYxMS41Wm04IDB2NC44bDMuMy45YS42LjYgMCAwIDAgLjUtMUwxNiAxMS41WiIvPgo8L3N2Zz4K) no-repeat 50%/contain;display:inline-block;flex-shrink:0;height:16px;width:16px}.slr-kpi-grid--dashboard{grid-template-columns:repeat(4,minmax(0,1fr))}@media (max-width:1200px){.slr-kpi-grid--dashboard{grid-template-columns:repeat(2,minmax(0,1fr))}}@media (max-width:640px){.slr-kpi-grid--dashboard{grid-template-columns:1fr}}.slr-kpi-card--rich{display:flex;flex-direction:column;justify-content:space-between;min-height:220px;padding:20px;position:relative}.slr-kpi-card--clickable{cursor:pointer}.slr-kpi-card--clickable:hover{box-shadow:var(--slr-shadow-card)}.slr-kpi-card__hit{appearance:none;background:transparent;border:0;border-radius:inherit;box-shadow:none;color:transparent;cursor:pointer;font-size:0;height:auto;inset:0;line-height:0;margin:0;min-height:0;min-width:0;padding:0;position:absolute;text-decoration:none;width:auto;z-index:1}.slr-kpi-card__hit:focus{box-shadow:none;outline:none}.slr-kpi-card__hit:focus-visible{outline:2px solid var(--slr-blue-50);outline-offset:2px}.slr-kpi-card__hit:disabled{cursor:wait}.slr-kpi-card__header{align-items:center;color:var(--slr-black-light);display:flex;font-size:13px;font-weight:500;gap:7px;padding:0}.slr-kpi-card__icon{color:var(--slr-blue-50);font-size:18px;height:18px;width:18px}.slr-kpi-card__main{flex:1;padding:12px 0 8px}.slr-kpi-card__footer{border-top:1px solid var(--slr-gray-95);margin-top:auto;padding-top:10px}.slr-kpi-card__value-row{align-items:baseline;display:flex;flex-wrap:wrap;gap:8px}.slr-kpi-card__value{color:var(--slr-black-light);font-size:26px;font-weight:700;line-height:30px;margin:0}.slr-kpi-card__metric-label{color:var(--slr-gray-60);font-size:12px;margin:4px 0 0}.slr-kpi-card__value-suffix{color:var(--slr-gray-50);font-size:16px;font-weight:500}.slr-kpi-card__value--good{color:var(--slr-green)}.slr-kpi-card__value--ok{color:var(--slr-blue-50)}.slr-kpi-card__value--warn{color:var(--slr-orange)}.slr-kpi-card__value--bad{color:var(--slr-red)}.slr-kpi-card__row{align-items:center;display:flex;font-size:12px;gap:8px;justify-content:space-between;padding:8px 0}.slr-kpi-card__row-label{color:var(--slr-gray-60);margin-right:5px}.slr-kpi-card__row-value{align-items:center;color:var(--slr-black-light);display:inline-flex;font-size:17px;font-weight:600;gap:6px}.slr-kpi-card__state{align-items:center;color:var(--slr-gray-60);display:flex;flex:1;flex-direction:column;font-size:13px;justify-content:center;padding:16px 0;text-align:center}.slr-kpi-card__state-title{color:var(--slr-black-light);font-size:15px;font-weight:600;margin:0 0 6px}.slr-kpi-card__state-desc{line-height:1.5;margin:0;max-width:260px}.slr-kpi-card__empty-icon,.slr-kpi-card__pulse{color:var(--slr-blue-50);font-size:32px;height:32px;margin-bottom:12px;width:32px}.slr-kpi-card__empty-icon{color:var(--slr-gray-60)}.slr-pulse{animation:slr-pulse-soft 2s ease-in-out infinite}@keyframes slr-pulse-soft{0%,to{opacity:.5;transform:scale(.95)}50%{opacity:1;transform:scale(1.05)}}.slr-trend{align-items:center;border-radius:12px;display:inline-flex;font-size:11px;font-weight:600;gap:2px;line-height:normal;padding:0 8px}.slr-kpi-card__value-row .slr-trend{font-size:13px}.slr-trend--up{color:var(--slr-green)}.slr-trend--down{color:var(--slr-red)}.slr-trend--solid.slr-trend--up{background-color:var(--slr-green);color:var(--slr-white)}.slr-trend--solid.slr-trend--down{background-color:var(--slr-red);color:var(--slr-white)}.slr-trend--issues{background:rgba(218,55,55,.1);font-weight:500}.slr-dash-section{margin-bottom:40px}.slr-dash-section+.slr-dash-section{margin-top:8px}.slr-dash-section__header{align-items:center;border-bottom:none;display:flex;margin:30px 0 15px;padding:0}.slr-dash-section__icon{align-items:center;background:var(--slr-blue-95);border-radius:var(--slr-radius-sm);color:var(--slr-blue-50);display:flex;flex-shrink:0;font-size:18px;height:36px;justify-content:center;width:36px}.slr-dash-section__title{color:var(--slr-black-light);font-size:20px;font-weight:600;margin:0 0 0 12px;white-space:nowrap}.slr-dash-section__line{background-color:var(--slr-gray-60);flex-grow:1;height:1px;margin-left:20px}.slr-dash-grid{align-items:stretch;display:grid;gap:16px;grid-template-columns:2fr 1fr}.slr-dash-grid--backlinks{grid-template-columns:1fr 2fr}@media (max-width:960px){.slr-dash-grid,.slr-dash-grid--backlinks{grid-template-columns:1fr}}.slr-dash-panel{display:flex;flex-direction:column;margin-bottom:0;min-height:0;padding:20px}.slr-dash-grid .slr-panel.slr-dash-panel{margin-bottom:0}.slr-dash-panel__title{flex-shrink:0;font-size:14px;font-weight:600;margin:0 0 4px}.slr-dash-panel__subtitle{color:var(--slr-gray-50);flex-shrink:0;font-size:12px;line-height:1.4;margin:0 0 16px}.slr-dash-panel__content{flex:1;min-height:220px}.slr-chart{height:260px;max-height:260px;overflow:hidden;position:relative}.slr-chart--donut-sm{height:120px;margin:0 auto;max-width:140px}.slr-chart-empty{align-items:center;border:2px dashed var(--slr-border-dashed);border-radius:12px;color:var(--slr-gray-50);display:flex;justify-content:center;min-height:250px;overflow:hidden;position:relative;text-align:center}.slr-chart-empty__grid{background-image:linear-gradient(to right,var(--slr-grid-line) 1px,transparent 1px),linear-gradient(to bottom,var(--slr-grid-line) 1px,transparent 1px);background-size:40px 40px;inset:0;position:absolute;z-index:1}.slr-chart-empty__content{padding:20px;position:relative;z-index:2}.slr-chart-empty__icon{color:var(--slr-blue-50);font-size:40px;height:40px;margin-bottom:15px;width:40px}.slr-chart-empty:not(.slr-chart-empty--waiting) .slr-chart-empty__icon{color:var(--slr-gray-60);font-size:32px;height:32px;width:32px}.slr-chart-empty__title{color:#1f2937;font-size:18px;font-weight:600;margin:0 0 8px}.slr-chart-empty__desc{color:#6b7280;font-size:14px;line-height:1.5;margin:0;max-width:300px}.slr-ai-score__header{align-items:baseline;display:flex;gap:10px;margin-bottom:16px}.slr-ai-score__value{color:var(--slr-blue-50);font-size:36px;font-weight:700;line-height:1}.slr-ai-score__delta{align-items:center;border-radius:2px;display:inline-flex;font-size:12px;font-weight:500;padding:3px 10px}.slr-ai-score__delta--up{background:var(--slr-green-bg);color:var(--slr-green)}.slr-ai-score__delta--down{background:var(--slr-red-bg);color:var(--slr-red)}.slr-ai-score__delta--flat{background:var(--slr-gray-bg);color:var(--slr-gray-30)}.slr-ai-score__breakdown{list-style:none;margin:0;padding:0}.slr-ai-score__row{align-items:center;border-top:1px dashed var(--slr-gray-95);display:flex;gap:10px;justify-content:space-between;padding:8px 0}.slr-ai-score__row:first-child{border-top:none;padding-top:0}.slr-ai-score__row-main{flex:1;min-width:0}.slr-ai-score__row-head{align-items:center;color:var(--slr-gray-50);display:flex;flex-wrap:wrap;font-size:12px;gap:6px}.slr-ai-score__row-weight{color:var(--slr-gray-60)}.slr-ai-score__bar{background:var(--slr-gray-95);border-radius:3px;height:6px;margin-top:4px;overflow:hidden;width:100%}.slr-ai-score__bar-fill{background:var(--slr-blue-50);border-radius:3px;height:100%}.slr-ai-score__row-value{color:var(--slr-gray-50);flex-shrink:0;font-size:13px;font-weight:500;min-width:28px;text-align:right}.slr-bl-dr{align-items:center;display:flex;flex-direction:column;gap:12px}.slr-bl-dr__score{align-items:baseline;display:flex;gap:8px}.slr-bl-dr__value{color:var(--slr-black-light);font-size:32px;font-weight:700}.slr-bl-metrics{display:flex;flex-wrap:wrap;gap:12px 24px;list-style:none;margin:0 0 16px;padding:0}.slr-bl-metrics__item{display:flex;flex-direction:column;gap:2px;min-width:120px}.slr-bl-metrics__label{color:var(--slr-gray-50);font-size:11px;letter-spacing:.02em;text-transform:uppercase}.slr-bl-metrics__value{align-items:center;color:var(--slr-black-light);display:inline-flex;font-size:16px;font-weight:700;gap:6px}.slr-chart--area{height:180px}.slr-skeleton{animation:slr-shimmer 1.4s ease infinite;background:linear-gradient(90deg,var(--slr-gray-95) 25%,var(--slr-gray-90) 50%,var(--slr-gray-95) 75%);background-size:200% 100%;border-radius:6px}@keyframes slr-shimmer{0%{background-position:200% 0}to{background-position:-200% 0}}.slr-skeleton--avatar{border-radius:50%;flex-shrink:0;height:24px;width:24px}.slr-skeleton--title{height:20px;width:200px}.slr-skeleton--line{height:12px;margin-bottom:10px}.slr-skeleton--sm{width:40%}.slr-skeleton--md{width:65%}.slr-skeleton--lg{height:28px;width:50%}.slr-skeleton--chart{border-radius:var(--slr-radius-sm);height:220px;margin-top:12px;width:100%}.slr-skeleton--chart-sm{height:160px}.slr-toolbar--skeleton{margin-bottom:0}.slr-skeleton--selector{border-radius:10px;height:40px;width:280px}.slr-skeleton--upgrade{border-radius:4px;height:40px;width:132px}.slr-dash-panel--skeleton,.slr-kpi-card--skeleton{pointer-events:none}.slr-kpi-card--skeleton{gap:12px;justify-content:flex-start}.slr-rank-tracker{max-width:none}.slr-rank-tracker__body{max-width:1600px;padding:20px 24px 40px}.slr-rt-filters{margin-bottom:20px;overflow:visible;padding:16px 20px;position:relative;z-index:5}.slr-rt-filters__left,.slr-rt-filters__row{align-items:center;column-gap:10px;display:flex}.slr-rt-filters__left{flex-wrap:wrap}.slr-rt-filters__right{margin-left:auto}.slr-rt-filters__hidden{display:none!important}.slr-rt-filter-input,.slr-rt-filter-select{background:var(--slr-white);border:1px solid var(--slr-gray-90);border-radius:var(--slr-radius-sm);color:var(--slr-blue-10);font-family:inherit;font-size:13px;height:38px;padding:8px 10px}.slr-rt-daterange{position:relative}.slr-rt-daterange__trigger{align-items:center;background:var(--slr-white);border:1px solid var(--slr-gray-90);border-radius:var(--slr-radius-sm);color:var(--slr-blue-10);column-gap:6px;cursor:pointer;display:inline-flex;font-family:inherit;font-size:13px;font-weight:400;height:38px;line-height:20px;padding:8px 10px;white-space:nowrap}.slr-rt-daterange__trigger .dashicons{color:var(--slr-blue-50);font-size:16px;height:16px;width:16px}.slr-rt-daterange__popover{background:var(--slr-white);border:1px solid var(--slr-gray-90);border-radius:var(--slr-radius-md);box-shadow:var(--slr-shadow-panel);min-width:640px;padding:12px 16px 16px;position:absolute;right:0;top:calc(100% + 8px);z-index:30}.slr-rt-daterange__close{background:transparent;border:none;color:var(--slr-gray-50);cursor:pointer;font-family:inherit;font-size:12px;position:absolute;right:10px;top:8px}.slr-rt-daterange__body{column-gap:12px;display:flex;padding-top:12px}.slr-rt-daterange__presets{border-right:1px solid var(--slr-gray-95);list-style:none;margin:0;min-width:130px;padding:0 8px 0 0}.slr-rt-daterange__preset{background:transparent;border:none;border-radius:4px;color:var(--slr-blue-10);cursor:pointer;display:block;font-family:inherit;font-size:13px;font-weight:500;padding:8px 10px;text-align:left;width:100%}.slr-rt-daterange__preset.is-active,.slr-rt-daterange__preset:hover{background:var(--slr-blue-50);color:var(--slr-white)}.slr-rt-daterange__save{color:var(--slr-gray-50);font-size:12px;margin-top:12px;padding:8px 10px 0}.slr-rt-daterange__save label{align-items:center;cursor:pointer;display:flex;gap:6px}.slr-rt-daterange__calendars{column-gap:16px;display:flex}.slr-rt-cal{width:230px}.slr-rt-cal__nav{align-items:center;display:flex;justify-content:space-between;margin-bottom:8px}.slr-rt-cal__caption{column-gap:4px;display:flex}.slr-rt-cal__caption select{background:var(--slr-white);border:1px solid var(--slr-gray-90);border-radius:4px;font-family:inherit;font-size:12px;height:26px;padding:0 8px}.slr-rt-cal__nav-btn{background:transparent;border:none;color:var(--slr-blue-10);cursor:pointer;height:24px;padding:0;width:24px}.slr-rt-cal__grid{display:grid;gap:2px;grid-template-columns:repeat(7,1fr)}.slr-rt-cal__weekday{color:var(--slr-gray-50);font-size:11px;padding:4px 0;text-align:center}.slr-rt-cal__day{background:transparent;border:none;border-radius:4px;color:var(--slr-blue-10);cursor:pointer;font-family:inherit;font-size:12px;height:28px}.slr-rt-cal__day.is-empty{cursor:default}.slr-rt-cal__day.is-disabled{color:var(--slr-gray-85);cursor:default}.slr-rt-cal__day.is-in-range{background:rgba(53,136,230,.15)}.slr-rt-cal__day.is-edge,.slr-rt-cal__day.is-edge.is-in-range{background:var(--slr-blue-50);color:var(--slr-white)}.slr-rt-cal__day:not(.is-disabled):not(.is-empty):hover{background:var(--slr-blue-95)}.slr-skeleton--daterange{border-radius:var(--slr-radius-sm);height:38px;margin-left:auto;width:220px}.slr-rt-summary{align-items:stretch;column-gap:18px;display:grid;grid-template-columns:minmax(0,1fr) minmax(0,2fr) minmax(0,1fr);margin-bottom:20px}.slr-rt-summary__card{box-sizing:border-box;margin-bottom:0;min-height:210px;min-width:0;padding:16px 18px 12px}.slr-rt-summary__title{color:var(--slr-blue-10);font-size:13px;font-weight:500;line-height:20px;margin:0 0 12px}.slr-rt-summary__value-row{align-items:center;column-gap:10px;display:flex;margin-bottom:8px}.slr-rt-summary__value{color:var(--slr-blue-10);font-size:26px;font-weight:700;line-height:1.2}.slr-rt-summary__empty{color:var(--slr-gray-50);font-size:13px;line-height:20px;margin:0}.slr-rt-avg-chart{height:120px;min-width:0}.slr-rt-donut{flex-shrink:0;height:140px;max-width:100%;width:140px}.slr-rt-spark{height:28px;min-width:60px}.slr-rt-dist-row__lost,.slr-rt-dist-row__new,.slr-rt-dist-row__num{text-align:center}.slr-rt-dist-row__new{color:var(--slr-green)}.slr-rt-dist-row__lost{color:var(--slr-red)}.slr-rt-aio-meta,.slr-rt-aio-stat{color:var(--slr-gray-30);font-size:12px;font-weight:500;line-height:18px;margin:0}.slr-rt-aio-stat{align-items:center;column-gap:8px;display:flex;margin-top:8px}.slr-rt-aio-progress{background:var(--slr-gray-95);border-radius:6px;height:11px;margin:10px 0;overflow:hidden}.slr-rt-aio-progress__bar{background:var(--slr-green);border-radius:6px;height:100%;min-width:0}.slr-rt-summary__distribution-body{align-items:center;column-gap:16px;display:flex;min-width:0}.slr-rt-summary__rows{flex:1}.slr-rt-dist-table{display:flex;flex:1;flex-direction:column;gap:8px;min-width:0}.slr-rt-dist-row{align-items:center;color:var(--slr-blue-10);column-gap:8px;display:grid;font-size:13px;grid-template-columns:minmax(90px,1.2fr) .6fr .5fr .5fr minmax(60px,1fr);line-height:20px}.slr-rt-dist-row--head{color:var(--slr-gray-50);font-size:13px;font-weight:500;text-align:center}.slr-rt-dist-row--head span:first-child{text-align:left}.slr-rt-dist-row__label{align-items:center;display:inline-flex;gap:6px;white-space:nowrap}.slr-rt-dist-row__dot{border-radius:50%;flex-shrink:0;height:10px;width:10px}.slr-skeleton--donut{border-radius:50%;flex-shrink:0;height:96px;width:96px}.slr-skeleton--bar{border-radius:6px;height:11px;margin:10px 0;width:100%}.slr-skeleton--button{border-radius:var(--slr-radius-sm);height:40px;margin-bottom:16px;width:160px}.slr-skeleton--search{width:240px}.slr-skeleton--search,.slr-skeleton--select{border-radius:var(--slr-radius-sm);height:36px}.slr-skeleton--select{width:160px}.slr-skeleton--cell{height:12px;margin:0 auto;width:28px}.slr-skeleton--spark{height:18px;margin:0;width:100%}.slr-rt-actions{margin-bottom:16px}.slr-rt-add-keywords.components-button{font-size:14px;font-weight:500;height:40px;padding:0 18px}.slr-rt-table-panel{background:var(--slr-white);border:1px solid var(--slr-gray-90);border-radius:var(--slr-radius-md);box-shadow:var(--slr-shadow-panel);overflow:hidden;padding:0}.slr-rt-table-toolbar{background:#fbfcfe;border-bottom:1px solid var(--slr-gray-95);justify-content:flex-end;padding:10px 12px}.slr-rt-table-toolbar,.slr-rt-table-toolbar__left{align-items:center;display:flex;flex-wrap:wrap;gap:10px}.slr-rt-table-toolbar__left{margin-right:auto}.slr-rt-table-toolbar__search{background:var(--slr-white);border:1px solid var(--slr-gray-90);border-radius:var(--slr-radius-sm);box-sizing:border-box;color:var(--slr-gray-30);font-family:var(--slr-font-family);font-size:13px;height:40px;max-width:280px;min-width:200px;padding:0 10px}.slr-rt-table-toolbar__search:focus{border-color:var(--slr-blue-50);box-shadow:0 0 0 2px rgba(0,123,255,.12);outline:none}.slr-rt-table-toolbar__search::placeholder{color:var(--slr-gray-60)}.slr-rt-table{background:var(--slr-white);padding:0 0 4px;width:100%}.slr-rt-table .tabulator{background:transparent;border:none;color:var(--slr-gray-30);font-family:var(--slr-font-family);font-size:13px;font-weight:400;width:100%}.slr-rt-table .tabulator[tabulator-layout=fitColumns] .tabulator-tableholder .tabulator-table{min-width:100%}.slr-rt-table .tabulator-tableholder{scrollbar-gutter:stable}.slr-rt-table .tabulator .tabulator-header{background:var(--slr-blue-95);border-bottom:1px solid var(--slr-gray-90);font-weight:500}.slr-rt-table .tabulator .tabulator-header .tabulator-col{background:var(--slr-blue-95);border-right:1px solid var(--slr-gray-95);box-sizing:border-box;justify-content:flex-start;min-height:55px}.slr-rt-table .tabulator .tabulator-header .tabulator-col.tabulator-sortable.tabulator-col-sorter-element:hover,.slr-rt-table .tabulator .tabulator-header .tabulator-col:hover{background:#d0e6fc!important;background-color:#d0e6fc!important}.slr-rt-table .tabulator .tabulator-header .tabulator-col .tabulator-col-content{align-items:center;box-sizing:border-box;display:flex;height:100%;justify-content:flex-start;min-height:55px;padding-bottom:10px;padding-top:10px;width:100%}.slr-rt-table .tabulator .tabulator-header .tabulator-col .tabulator-col-title-holder{align-items:center;display:flex;min-height:28px;width:100%}.slr-rt-table .tabulator .tabulator-header .tabulator-col.text-center .tabulator-col-content,.slr-rt-table .tabulator .tabulator-header .tabulator-col[style*="text-align: center"] .tabulator-col-content,.slr-rt-table .tabulator .tabulator-header .tabulator-col[style*="text-align:center"] .tabulator-col-content{justify-content:center}.slr-rt-table .tabulator .tabulator-header .tabulator-col.text-left .tabulator-col-content,.slr-rt-table .tabulator .tabulator-header .tabulator-col[style*="text-align: left"] .tabulator-col-content,.slr-rt-table .tabulator .tabulator-header .tabulator-col[style*="text-align:left"] .tabulator-col-content{justify-content:flex-start}.slr-rt-table .tabulator .tabulator-header .tabulator-col .tabulator-col-title{color:var(--slr-gray-30);font-size:13px;font-weight:500;line-height:28px;white-space:nowrap}.slr-rt-table .tabulator-row{background:var(--slr-white);border-bottom:1px solid var(--slr-gray-95);min-height:55px!important}.slr-rt-table .tabulator-row.tabulator-row-even{background:var(--slr-white)}.slr-rt-table .tabulator-row:hover{background:var(--slr-blue-97)!important}.slr-rt-table .tabulator-row .tabulator-cell{border-right:1px solid var(--slr-gray-95);box-sizing:border-box;color:var(--slr-gray-30);font-size:13px!important;font-weight:400;line-height:20px;overflow:hidden;padding:12px 10px!important;text-overflow:ellipsis;vertical-align:middle;white-space:nowrap}.slr-rt-table .tabulator-row .tabulator-cell.text-center{text-align:center}.slr-rt-table .tabulator-row .tabulator-cell.text-left{text-align:left}.slr-rt-table .tabulator-placeholder-contents{color:var(--slr-gray-50);font-size:13px;padding:48px 16px;text-align:center}.slr-rt-table .tabulator .tabulator-footer{background:var(--slr-white);border-top:1px solid var(--slr-gray-90);color:var(--slr-gray-50);font-family:var(--slr-font-family);font-weight:400;white-space:normal}.slr-rt-table .tabulator .tabulator-footer .tabulator-footer-contents{align-items:center;box-sizing:border-box;display:flex;flex-wrap:wrap;gap:12px 20px;justify-content:space-between;min-height:72px;padding:16px 20px!important}.slr-rt-table .tabulator .tabulator-footer .tabulator-page-counter{color:var(--slr-gray-50);flex:0 0 auto;font-size:12px;font-weight:500;line-height:18px;margin:0!important;order:1}.slr-rt-table .tabulator .tabulator-footer .tabulator-paginator{align-items:center;color:var(--slr-gray-50);display:flex;flex:1 1 auto;flex-wrap:wrap;font-family:inherit;font-size:13px;font-weight:500;gap:6px;justify-content:flex-end;margin:0;order:2;text-align:right}.slr-rt-table .tabulator .tabulator-footer .tabulator-paginator label{color:var(--slr-gray-50);font-size:12px;font-weight:400;margin:0 4px 0 0}.slr-rt-table .tabulator .tabulator-footer .tabulator-page-size,.slr-rt-table .tabulator .tabulator-footer select.tabulator-page-size{appearance:none;background-color:var(--slr-white);background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 width=%2710%27 height=%276%27%3E%3Cpath fill=%27%23767676%27 d=%27m1 1 4 4 4-4%27/%3E%3C/svg%3E");background-position:right 12px center;background-repeat:no-repeat;border:1px solid var(--slr-gray-90)!important;border-radius:10px!important;box-shadow:none;color:var(--slr-gray-50);cursor:pointer;display:inline-block;font-family:var(--slr-font-family);font-size:13px!important;font-weight:400!important;height:40px;line-height:18px!important;margin:0 12px 0 0!important;min-width:72px;outline:none;padding:0 32px 0 12px!important;vertical-align:middle}.slr-rt-table .tabulator .tabulator-footer .tabulator-page-size:focus,.slr-rt-table .tabulator .tabulator-footer .tabulator-page-size:hover{border-color:var(--slr-blue-50)!important}.slr-rt-table .tabulator .tabulator-footer .tabulator-pages{align-items:center;display:inline-flex;gap:4px;margin:0 4px!important;vertical-align:middle}.slr-rt-table .tabulator .tabulator-footer .tabulator-page{align-items:center;background:var(--slr-white)!important;border:1px solid var(--slr-gray-90)!important;border-radius:10px!important;box-shadow:none;color:var(--slr-gray-50)!important;cursor:pointer;display:inline-flex!important;font-family:var(--slr-font-family);font-size:13px;font-weight:500;height:36px;justify-content:center;line-height:1;margin:0 2px!important;min-width:36px;padding:0 12px!important;transition:background-color .15s ease,color .15s ease,border-color .15s ease;vertical-align:middle}.slr-rt-table .tabulator .tabulator-footer .tabulator-page:not(:disabled):hover{background:var(--slr-blue-97)!important;border-color:var(--slr-blue-50)!important;color:var(--slr-blue-50)!important}.slr-rt-table .tabulator .tabulator-footer .tabulator-page.active{background:var(--slr-blue-50)!important;border-color:var(--slr-blue-50)!important;color:var(--slr-white)!important}.slr-rt-table .tabulator .tabulator-footer .tabulator-page.disabled,.slr-rt-table .tabulator .tabulator-footer .tabulator-page:disabled{background:var(--slr-white)!important;color:var(--slr-gray-50)!important;cursor:default;opacity:.35}.slr-rt-table .tabulator-cell.slr-rt-col--keyword{overflow:hidden;white-space:nowrap}.slr-rt-keyword{align-items:center;color:var(--slr-blue-50);display:inline-flex;font-weight:500;gap:4px;max-width:100%;min-width:0;vertical-align:middle}.slr-rt-keyword__text{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.slr-rt-keyword__icon{color:var(--slr-red);flex-shrink:0;font-size:16px;height:16px;width:16px}.slr-rt-keyword__icon--target{color:var(--slr-blue)}.slr-rt-location{align-items:center;display:inline-flex;gap:6px;white-space:nowrap}.slr-rt-flag{font-size:14px;line-height:1}.slr-rt-device{font-size:18px;height:18px;width:18px}.slr-rt-device--desktop{color:var(--slr-orange)}.slr-rt-device--mobile{color:var(--slr-blue-50)}.slr-rt-rank{align-items:center;display:inline-flex;font-weight:700;gap:4px;justify-content:center}.slr-rt-rank__new{color:#e91e8c;font-size:9px;font-weight:700}.slr-rt-change{align-items:center;border-radius:4px;display:inline-flex;font-size:10px;font-weight:500;gap:2px;line-height:15px;padding:1px 5px}.slr-rt-change--up{background:var(--slr-green);color:var(--slr-white)}.slr-rt-change--down{background:var(--slr-red);color:var(--slr-white)}.slr-rt-change--up-text{background:transparent;color:var(--slr-green);padding:0}.slr-rt-change--down-text{background:transparent;color:var(--slr-red);padding:0}.slr-rt-change--empty,.slr-rt-change--zero{background:transparent;color:var(--slr-gray-60);padding:0}.slr-rt-dates{align-items:center;display:inline-flex;gap:4px}.slr-rt-dates--stack{flex-wrap:wrap;justify-content:center}.slr-rt-table .tabulator-cell[tabulator-field=ai_overview],.slr-rt-table .tabulator-cell[tabulator-field=snippets],.slr-rt-table .tabulator-cell[tabulator-field=tags]{overflow:hidden;white-space:normal}.slr-rt-aio{align-items:flex-start;color:var(--slr-gray-30);display:inline-flex;flex-direction:column;font-size:10px;font-weight:400;gap:2px;line-height:15px}.slr-rt-aio__presence{color:var(--slr-green)}.slr-rt-aio__links,.slr-rt-aio__presence{align-items:center;display:inline-flex;gap:2px}.slr-rt-aio .dashicons{font-size:15px;height:15px;width:15px}.slr-rt-aio__brand{background:rgba(80,177,66,.21);border-radius:4px;color:var(--slr-green);font-weight:400;padding:1px 3px}.slr-rt-url{display:block;max-width:100%;min-width:0;overflow:hidden;text-align:left;text-overflow:ellipsis;white-space:nowrap}.slr-rt-url a{color:var(--slr-blue-50);text-decoration:none}.slr-rt-tags{align-items:center;display:flex;flex-wrap:wrap;gap:2px;justify-content:flex-start;max-width:100%;min-width:0}.slr-rt-tag{border-radius:10px;color:var(--slr-blue-10);display:inline-block;font-size:11px;line-height:18px;max-width:100%;overflow:hidden;padding:1px 8px;text-overflow:ellipsis;white-space:nowrap}.slr-rt-local,.slr-rt-snippets{align-items:center;display:inline-flex;gap:4px}.slr-rt-snippet{font-size:16px;height:16px;width:16px}.slr-rt-snippet--muted{color:var(--slr-gray-60)}.slr-rt-snippet--user{color:var(--slr-blue-50)}.slr-rt-snippet--competitor{color:#edc92f}.slr-rt-cell-icon{font-size:16px;height:16px;width:16px}.slr-rt-cell-icon--muted{color:var(--slr-gray-60)}.slr-rt-cell-icon--danger{color:var(--slr-red)}.slr-rt-cell-icon--warn{color:#e91e8c}.slr-rt-local-link{color:inherit;text-decoration:none}.slr-rt-local-pos{font-weight:600}@media screen and (max-width:768px){.slr-rt-table-toolbar{justify-content:stretch}.slr-rt-table-toolbar__left,.slr-rt-table-toolbar__search{max-width:none;width:100%}.slr-rt-table .tabulator .tabulator-footer .tabulator-footer-contents{justify-content:center;min-height:0;padding:14px 12px!important}.slr-rt-table .tabulator .tabulator-footer .tabulator-page-counter,.slr-rt-table .tabulator .tabulator-footer .tabulator-paginator{flex:0 0 100%;justify-content:center;text-align:center}}@media screen and (max-width:1100px){.slr-rt-table-toolbar{flex-wrap:wrap}}.slr-rt-table .tabulator-row.slr-rt-row--clickable{cursor:pointer}.slr-rt-table .tabulator-row.slr-rt-row--active{background:var(--slr-blue-97)!important}.slr-kw-stats-modal.components-modal__frame{display:flex;flex-direction:column;max-height:94vh;max-width:94vw;width:min(1280px,94vw)}.slr-kw-stats-modal .components-modal__header{background:var(--slr-white);border-bottom:none;height:auto;justify-content:flex-end;min-height:44px;padding:12px 20px 0;position:relative!important;top:auto}.slr-kw-stats-modal .components-modal__header-heading{display:none}.slr-kw-stats-modal .components-modal__content{display:flex;flex-direction:column;margin-top:0!important;overflow:auto;padding:4px 32px 24px!important}.slr-kw-stats{min-height:360px;position:relative}.slr-kw-stats .slr-panel{margin-bottom:0;padding:16px 20px}.slr-kw-stats__heading{align-items:baseline;column-gap:8px;display:flex;font-size:18px;font-weight:600;line-height:1.3;margin:0 0 12px;padding:0}.slr-kw-stats__heading-label{color:var(--slr-gray-50);font-weight:500}.slr-kw-stats__heading-value{color:var(--slr-blue-10);font-weight:600}.slr-kw-stats__top{align-items:center;display:flex;flex-wrap:wrap;gap:16px;justify-content:space-between;margin:0 0 20px}.slr-kw-stats__attrs,.slr-kw-stats__target{align-items:center;background:var(--slr-white);border:1px solid var(--slr-gray-90);border-radius:4px;color:var(--slr-blue-10);display:flex;font-size:13px;line-height:1.3;padding:12px 20px}.slr-kw-stats__attrs{column-gap:20px}.slr-kw-stats__attr{align-items:center;column-gap:8px;display:inline-flex;white-space:nowrap}.slr-kw-stats__attr .dashicons{font-size:18px;height:18px;width:18px}.slr-kw-stats__attr--rank{font-weight:500}.slr-kw-stats__attr--rank strong{font-weight:600}.slr-kw-stats__target{column-gap:8px;max-width:42%}.slr-kw-stats__target-label{font-weight:500;white-space:nowrap}.slr-kw-stats__target-url{color:var(--slr-gray-50);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.slr-kw-stats__body{align-items:stretch;column-gap:12px;display:flex}.slr-kw-stats__body.is-loading{opacity:0;pointer-events:none}.slr-kw-stats__left{min-width:0;width:70%}.slr-kw-stats__right{display:flex;flex-direction:column;gap:12px;min-width:0;width:30%}.slr-kw-stats .slr-kw-stats-chart{height:280px;margin:8px 0 28px;overflow:hidden;position:relative}.slr-kw-stats-chart__canvas{height:248px;overflow:hidden}.slr-kw-stats-top10__title{align-items:center;color:var(--slr-blue-10);display:flex;flex-wrap:wrap;font-size:13px;font-weight:500;gap:8px;margin:8px 0 16px}.slr-kw-stats-top10__serp{align-items:center;color:var(--slr-blue-50);display:inline-flex;font-weight:500;gap:4px;text-decoration:none}.slr-kw-stats-top10__serp:hover{color:var(--slr-blue-50)}.slr-kw-stats-top10__serp .dashicons{font-size:16px;height:16px;width:16px}.slr-kw-stats-top10__panel{background:var(--slr-blue-95);border-radius:13px;height:280px;overflow:auto}.slr-kw-stats-modal .slr-kw-stats-top10__table{background:var(--slr-white);border-collapse:collapse;border-spacing:0;margin:0;width:100%}.slr-kw-stats-top10__table thead{background:var(--slr-blue-95);position:sticky;top:0;z-index:1}.slr-kw-stats-top10__table td,.slr-kw-stats-top10__table th{font-size:13px;font-weight:500;line-height:22px;padding:8px 12px;text-align:left;vertical-align:middle}.slr-kw-stats-top10__table th{background:var(--slr-blue-95);color:var(--slr-gray-30)}.slr-kw-stats-top10__table td{border-top:1px solid var(--slr-gray-95);color:var(--slr-blue-50)}.slr-kw-stats-top10__pos{text-align:center!important;width:88px}.slr-kw-stats-top10__row--strong td{font-weight:700}.slr-kw-stats-top10__link{color:var(--slr-blue-50);display:inline-block;max-width:100%;overflow:hidden;text-decoration:none;text-overflow:ellipsis;vertical-align:middle;white-space:nowrap}.slr-kw-stats-top10__link:hover{color:var(--slr-blue-50)}.slr-kw-stats-top10__link--mine{color:var(--slr-chart-orange)}.slr-kw-stats-top10__icon{font-size:16px;height:16px;margin-left:6px;vertical-align:middle;width:16px}.slr-kw-stats-top10__icon--target{color:var(--slr-blue)}.slr-kw-stats-top10__icon--cann{color:var(--slr-red)}.slr-kw-stats-stats__metrics{display:flex;flex-wrap:wrap;gap:8px 20px}.slr-kw-stats-stats__metric{align-items:baseline;column-gap:6px;display:inline-flex}.slr-kw-stats-stats__label{color:var(--slr-gray-50);font-size:12px;font-weight:500;line-height:16px}.slr-kw-stats-stats__value{color:var(--slr-blue-10);font-size:12px;font-weight:500;line-height:16px}.slr-kw-stats-stats__trend-title,.slr-kw-stats-tags__title{color:var(--slr-blue-10);font-size:13px;font-weight:500;margin-bottom:0;margin-top:16px}.slr-kw-stats-stats__trend{height:142px;margin-top:8px;overflow:hidden}.slr-kw-stats-tags{min-height:120px}.slr-kw-stats-tags__title{margin-bottom:12px;margin-top:0}.slr-kw-stats__empty{color:var(--slr-gray-50);font-size:13px;margin:8px 0 0}.slr-kw-stats__loader{align-items:center;display:flex;flex-direction:column;gap:12px;inset:80px 0 64px;justify-content:flex-start;padding-top:40px;position:absolute}.slr-kw-stats__loader p{color:var(--slr-gray-50);font-size:13px;margin:0}.slr-kw-stats__footer{align-items:center;display:flex;justify-content:space-between;margin-top:20px}.slr-kw-stats__nav.components-button.is-link{align-items:center;box-shadow:none;color:var(--slr-blue-50);column-gap:6px;display:inline-flex;font-size:13px;font-weight:500;text-decoration:none}.slr-kw-stats__nav.components-button.is-link:hover{color:var(--slr-blue-50)}@media screen and (max-width:960px){.slr-kw-stats__body{flex-direction:column;row-gap:12px}.slr-kw-stats__left,.slr-kw-stats__right{width:100%}.slr-kw-stats__target{display:none}.slr-kw-stats__attrs{flex-wrap:wrap;justify-content:space-between;row-gap:8px;width:100%}}.slr-addkw-modal.components-modal__frame{display:flex;flex-direction:column;max-height:94vh;max-width:80vw;width:min(1120px,80vw)}.slr-addkw-modal .components-modal__header{background:transparent;border-bottom:none;height:auto;justify-content:flex-end;left:auto;min-height:0;padding:16px 16px 0 0;position:absolute!important;right:0;top:0;width:auto}.slr-addkw-modal .components-modal__header-heading{display:none}.slr-addkw-modal .components-modal__content{display:flex;flex-direction:column;margin-top:0!important;overflow:auto;padding:20px 40px 28px!important}.slr-addkw{position:relative}.slr-addkw__busy{align-items:center;background:hsla(0,0%,100%,.65);display:flex;inset:0;justify-content:center;position:absolute;z-index:30}.slr-addkw-upgrade__title{font-size:16px;font-weight:600;margin:0 0 8px}.slr-addkw__header{align-items:center;column-gap:24px;display:flex;margin:0 0 20px;padding-right:36px}.slr-addkw__title{color:var(--slr-blue-10);font-size:18px;font-weight:600;line-height:1.3;margin:0}.slr-addkw__remaining{background:var(--slr-blue-95);border:1px solid var(--slr-blue-50);border-radius:4px;color:var(--slr-blue-10);font-size:12px;font-weight:400;padding:8px 12px}.slr-addkw__remaining-count{color:var(--slr-blue-40);font-weight:500}.slr-addkw__remaining.is-danger{background:#cb333354;border-color:var(--slr-red)}.slr-addkw__remaining.is-danger .slr-addkw__remaining-count{color:var(--slr-red)}.slr-addkw__body{align-items:stretch;display:flex}.slr-addkw__col{min-width:0;width:50%}.slr-addkw__col--left{border-right:1px solid var(--slr-gray-90);padding-right:40px}.slr-addkw__col--right{padding-left:40px}.slr-addkw-section__title{align-items:flex-start;color:var(--slr-blue-10);column-gap:10px;display:flex;font-size:13px;font-weight:500;line-height:1.4}.slr-addkw-section__number{border:1px solid var(--slr-blue-50);border-radius:4px;color:var(--slr-blue-50);flex:0 0 auto;font-size:13px;font-weight:500;line-height:20px;padding:0 7px}.slr-addkw-section__heading{font-weight:500}.slr-addkw-section__desc,.slr-addkw-section__optional{color:var(--slr-gray-50);font-weight:400}.slr-addkw-section__desc{font-size:11px;line-height:1.4;margin:6px 0 0}.slr-addkw-section--spaced{margin-top:48px}.slr-addkw-lined{background:var(--slr-white);border:1px solid var(--slr-gray-90);border-radius:10px;display:flex;margin-top:10px;min-height:210px;overflow:hidden}.slr-addkw-lined__nums{color:var(--slr-gray-50);display:flex;flex-direction:column;font-size:13px;font-weight:400;line-height:22px;margin-right:5px;min-width:29px;padding:8px 6px;text-align:right;-webkit-user-select:none;user-select:none}.slr-addkw-lined__input{background:transparent;border:none;box-shadow:none;color:var(--slr-blue-10);flex:1;font-size:13px;line-height:22px;margin:0;min-width:0;padding:8px 12px 8px 0;resize:none;width:100%}.slr-addkw-lined__input:focus{border:none;box-shadow:none;outline:none}.slr-addkw-error{color:var(--slr-red);font-size:11px;line-height:1.4;margin:6px 0 0}.slr-addkw-input{background:var(--slr-white);border:1px solid var(--slr-gray-90);border-radius:10px;box-shadow:none;color:var(--slr-blue-10);display:block;font-size:13px;line-height:1.4;margin-top:10px;padding:10px 12px;width:100%}.slr-addkw-input:focus{border-color:var(--slr-blue-50);box-shadow:none;outline:none}.slr-addkw-suggest{position:relative}.slr-addkw-suggest__list{background:var(--slr-white);border:1px solid var(--slr-gray-90);border-radius:0 0 10px 10px;box-shadow:var(--slr-shadow-panel);left:0;max-height:240px;overflow:auto;position:absolute;right:0;top:calc(100% - 2px);z-index:20}.slr-addkw-suggest__status{align-items:center;color:var(--slr-gray-50);display:flex;font-size:13px;justify-content:center;min-height:48px;padding:12px}.slr-addkw-suggest__item{align-items:flex-start;background:transparent;border:none;cursor:pointer;display:flex;flex-direction:column;padding:8px 12px;text-align:left;width:100%}.slr-addkw-suggest__item:focus,.slr-addkw-suggest__item:hover{background:var(--slr-blue-95)}.slr-addkw-suggest__item-main{align-items:center;color:var(--slr-blue-10);column-gap:8px;display:inline-flex;font-size:13px}.slr-addkw-suggest__item-meta{color:var(--slr-gray-50);font-size:11px;font-style:italic;margin-left:26px}.slr-addkw-chips{display:flex;flex-wrap:wrap;gap:8px;margin-top:16px}.slr-addkw-chip{align-items:center;background:var(--slr-white);border:1px solid #c7cadc;border-radius:10px;color:var(--slr-blue-10);column-gap:8px;display:inline-flex;font-size:14px;font-weight:400;padding:4px 10px;white-space:nowrap}.slr-addkw-chip__remove{background:transparent;border:none;color:var(--slr-blue-10);cursor:pointer;font-size:18px;line-height:1;padding:0 2px}.slr-addkw-device{border:1px solid var(--slr-gray-90);border-radius:10px;display:flex;height:38px;margin-top:10px;max-width:100%;overflow:hidden;width:338px}.slr-addkw-device__btn{align-items:center;background:var(--slr-white);border:none;color:var(--slr-gray-50);column-gap:8px;cursor:pointer;display:inline-flex;flex:1;font-size:13px;font-weight:500;justify-content:center}.slr-addkw-device__btn:first-child{border-radius:10px 0 0 10px}.slr-addkw-device__btn:last-child{border-radius:0 10px 10px 0}.slr-addkw-device__btn.is-selected,.slr-addkw-device__btn:hover{background:#3588e626;color:var(--slr-blue-50)}.slr-addkw-device__btn .dashicons{font-size:16px;height:16px;width:16px}.slr-addkw__footer{align-items:center;display:flex;flex-direction:column;margin-top:28px}.slr-addkw__submit.components-button{font-size:14px;font-weight:500;height:40px;justify-content:center;min-width:280px}.slr-addkw__note{align-items:center;background:var(--slr-gray-95);border-radius:10px;color:var(--slr-gray-30);column-gap:10px;display:flex;font-size:13px;justify-content:center;line-height:1.4;margin-top:24px;padding:16px;width:100%}.slr-addkw__note .dashicons{color:var(--slr-gray-30);font-size:18px;height:18px;width:18px}@media screen and (max-width:960px){.slr-addkw-modal.components-modal__frame{max-height:100vh;max-width:none;width:100%}.slr-addkw-modal .components-modal__content{padding:8px 16px 20px!important}.slr-addkw__body{flex-direction:column}.slr-addkw__col{width:100%}.slr-addkw__col--left{border-right:none;padding-right:0}.slr-addkw__col--right{margin-top:32px;padding-left:0}.slr-addkw-device,.slr-addkw__submit.components-button{width:100%}}
     4.slr-ai-visibility{max-width:none}.slr-ai-visibility__body{max-width:1600px;padding:20px 24px 40px}.slr-ai-visibility[aria-busy=true] .slr-ai-visibility__body{opacity:.65;pointer-events:none;transition:opacity .2s ease}.slr-aiv-card{margin-bottom:0;padding:20px;position:relative}.slr-aiv-card.is-collecting>:not(.slr-aiv-collecting){opacity:.35;pointer-events:none}.slr-aiv-collecting{align-items:center;background:hsla(0,0%,100%,.88);border-radius:var(--slr-radius-lg);display:flex;flex-direction:column;inset:0;justify-content:center;padding:24px;position:absolute;text-align:center;z-index:2}.slr-aiv-collecting--compact{padding:16px}.slr-aiv-collecting__spinner{animation:slr-aiv-spin .9s linear infinite;border:3px solid #e5e7eb;border-radius:50%;border-top:3px solid var(--slr-blue-50);display:inline-block;height:42px;margin-bottom:16px;width:42px}.slr-aiv-collecting--compact .slr-aiv-collecting__spinner{margin-bottom:0}.slr-aiv-collecting__text{color:var(--slr-gray-60);font-size:13px;margin:0}@keyframes slr-aiv-spin{to{transform:rotate(1turn)}}.slr-aiv-top{align-items:stretch;column-gap:20px;display:flex;margin-bottom:20px}.slr-aiv-middle,.slr-aiv-top>.slr-aiv-card{flex:1 1 0;min-height:0;min-width:0}.slr-aiv-middle,.slr-aiv-top>.slr-aiv-card{display:flex;flex-direction:column}.slr-aiv-middle{row-gap:20px}.slr-aiv-middle>.slr-aiv-card{display:flex;flex-direction:column}.slr-aiv-mentions{flex:0 0 auto}.slr-aiv-coverage{flex:1 1 auto;min-height:0}.slr-aiv-comp__head>span:first-child,.slr-aiv-score__label,.slr-aiv-trend__label{color:var(--slr-gray-60);font-size:14px;font-weight:500}.slr-aiv-score__main{align-items:baseline;display:flex;gap:12px;margin-top:8px}.slr-aiv-score__value{color:var(--slr-blue-50);font-size:64px;font-weight:700;line-height:1}.slr-aiv-score__delta{align-items:center;border-radius:2px;display:inline-flex;font-size:13px;font-weight:500;padding:3px 10px}.slr-aiv-score__delta--up{background:var(--slr-green-bg);color:var(--slr-green)}.slr-aiv-score__delta--down{background:var(--slr-red-bg);color:var(--slr-red)}.slr-aiv-score__delta--flat{background:#efefef;color:var(--slr-gray-60)}.slr-aiv-score__breakdown{margin-top:20px}.slr-aiv-breakdown{align-items:center;border-top:1px dashed var(--slr-border-dashed);display:flex;justify-content:space-between;padding:10px 0}.slr-aiv-breakdown:first-child{border-top:none}.slr-aiv-breakdown__main{flex:1}.slr-aiv-breakdown__label{align-items:center;color:var(--slr-gray-60);display:flex;font-size:12px;gap:4px}.slr-aiv-breakdown__weight{color:#c2c7cf;font-weight:500}.slr-aiv-breakdown__bar{background:#eee;border-radius:3px;height:6px;margin-top:4px;overflow:hidden;width:100%}.slr-aiv-breakdown__bar>div{background:var(--slr-blue-50);height:100%}.slr-aiv-breakdown__value{color:var(--slr-gray-60);font-weight:500;margin-left:10px;text-align:right;width:40px}.slr-aiv-mentions__row{align-items:stretch;display:flex;flex:1;min-height:110px}.slr-aiv-metric{display:flex;flex:1;flex-direction:column;justify-content:center;text-align:center}.slr-aiv-metric__label{color:var(--slr-gray-60);font-size:12px;margin-bottom:8px}.slr-aiv-metric__num{font-size:40px;font-weight:800;letter-spacing:-.03em;line-height:1}.slr-aiv-metric__den{color:#c2c7cf;font-size:16px;font-weight:600}.slr-aiv-mentions__divider{background:#eee;margin:0 4px;width:1px}.slr-aiv-coverage__kicker{color:var(--slr-gray-60);font-size:11px;font-weight:700;letter-spacing:.6px;margin-bottom:8px;text-transform:uppercase}.slr-aiv-coverage__count{align-items:baseline;display:flex;flex-wrap:wrap;gap:8px;margin-bottom:14px}.slr-aiv-coverage__num{font-size:40px;font-weight:800;letter-spacing:-.03em;line-height:1}.slr-aiv-coverage__den{color:#c2c7cf;font-size:18px;font-weight:700}.slr-aiv-coverage__sub{color:var(--slr-gray-60);font-size:13px;font-weight:500}.slr-aiv-coverage__bar{display:flex;gap:5px;margin-bottom:16px}.slr-aiv-coverage__seg{border-radius:3px;flex:1;height:10px}.slr-aiv-coverage__list{display:grid;gap:8px 12px;grid-template-columns:repeat(auto-fit,minmax(120px,1fr))}.slr-aiv-coverage__item{align-items:center;display:flex;font-size:12px;gap:6px;min-width:0}.slr-aiv-coverage__item.is-muted{opacity:.55}.slr-aiv-coverage__name{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.slr-aiv-llm-icon{background:no-repeat 50%/contain;display:inline-block;flex:none;height:16px;width:16px}.slr-aiv-llm-icon--chatgpt{background-image:url(data:image/svg+xml;base64,PHN2ZyBmaWxsPSJjdXJyZW50Q29sb3IiIGZpbGwtcnVsZT0iZXZlbm9kZCIgaGVpZ2h0PSIxZW0iIHN0eWxlPSJmbGV4Om5vbmU7bGluZS1oZWlnaHQ6MSIgdmlld0JveD0iMCAwIDI0IDI0IiB3aWR0aD0iMWVtIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjx0aXRsZT5PcGVuQUk8L3RpdGxlPjxwYXRoIGQ9Ik05LjIwNSA4LjY1OHYtMi4yNmMwLS4xOS4wNzItLjMzMy4yMzgtLjQyOGw0LjU0My0yLjYxNmMuNjE5LS4zNTcgMS4zNTYtLjUyMyAyLjExNy0uNTIzIDIuODU0IDAgNC42NjIgMi4yMTIgNC42NjIgNC41NjYgMCAuMTY3IDAgLjM1Ny0uMDI0LjU0N2wtNC43MS0yLjc1OWEuNzk3Ljc5NyAwIDAwLS44NTYgMGwtNS45NyAzLjQ3M3ptMTAuNjA5IDguOFYxMi4wNmMwLS4zMzMtLjE0My0uNTctLjQyOS0uNzM3bC01Ljk3LTMuNDczIDEuOTUtMS4xMThhLjQzMy40MzMgMCAwMS40NzYgMGw0LjU0MyAyLjYxN2MxLjMwOS43NiAyLjE4OSAyLjM3OCAyLjE4OSAzLjk0OCAwIDEuODA4LTEuMDcgMy40NzMtMi43NiA0LjE2M3pNNy44MDIgMTIuNzAzbC0xLjk1LTEuMTQyYy0uMTY3LS4wOTUtLjIzOS0uMjM4LS4yMzktLjQyOFY1Ljg5OWMwLTIuNTQ1IDEuOTUtNC40NzIgNC41OTEtNC40NzIgMSAwIDEuOTI3LjMzMyAyLjcxMi45MjhMOC4yMyA1LjA2N2MtLjI4NS4xNjYtLjQyOC40MDQtLjQyOC43Mzd2Ni44OTh6TTEyIDE1LjEyOGwtMi43OTUtMS41N3YtMy4zM0wxMiA4LjY1OGwyLjc5NSAxLjU3djMuMzNMMTIgMTUuMTI4em0xLjc5NiA3LjIzYy0xIDAtMS45MjctLjMzMi0yLjcxMi0uOTI3bDQuNjg2LTIuNzEyYy4yODUtLjE2Ni40MjgtLjQwNC40MjgtLjczN3YtNi44OThsMS45NzQgMS4xNDJjLjE2Ny4wOTUuMjM4LjIzOC4yMzguNDI4djUuMjMzYzAgMi41NDUtMS45NzQgNC40NzItNC42MTQgNC40NzJ6bS01LjYzNy01LjMwM2wtNC41NDQtMi42MTdjLTEuMzA4LS43NjEtMi4xODgtMi4zNzgtMi4xODgtMy45NDhBNC40ODIgNC40ODIgMCAwMTQuMjEgNi4zMjd2NS40MjNjMCAuMzMzLjE0My41NzEuNDI4LjczOGw1Ljk0NyAzLjQ0OS0xLjk1IDEuMTE4YS40MzIuNDMyIDAgMDEtLjQ3NiAwem0tLjI2MiAzLjljLTIuNjg4IDAtNC42NjItMi4wMjEtNC42NjItNC41MTkgMC0uMTkuMDI0LS4zOC4wNDctLjU3bDQuNjg2IDIuNzFjLjI4Ni4xNjcuNTcxLjE2Ny44NTYgMGw1Ljk3LTMuNDQ4djIuMjZjMCAuMTktLjA3LjMzMy0uMjM3LjQyOGwtNC41NDMgMi42MTZjLS42MTkuMzU3LTEuMzU2LjUyMy0yLjExNy41MjN6bTUuODk5IDIuODNhNS45NDcgNS45NDcgMCAwMDUuODI3LTQuNzU2QzIyLjI4NyAxOC4zMzkgMjQgMTUuODQgMjQgMTMuMjk2YzAtMS42NjUtLjcxMy0zLjI4Mi0xLjk5OC00LjQ0OC4xMTktLjUuMTktLjk5OS4xOS0xLjQ5OCAwLTMuNDAxLTIuNzU5LTUuOTQ3LTUuOTQ2LTUuOTQ3LS42NDIgMC0xLjI2LjA5NS0xLjg4LjMxQTUuOTYyIDUuOTYyIDAgMDAxMC4yMDUgMGE1Ljk0NyA1Ljk0NyAwIDAwLTUuODI3IDQuNzU3QzEuNzEzIDUuNDQ3IDAgNy45NDUgMCAxMC40OWMwIDEuNjY2LjcxMyAzLjI4MyAxLjk5OCA0LjQ0OC0uMTE5LjUtLjE5IDEtLjE5IDEuNDk5IDAgMy40MDEgMi43NTkgNS45NDYgNS45NDYgNS45NDYuNjQyIDAgMS4yNi0uMDk1IDEuODgtLjMwOWE1Ljk2IDUuOTYgMCAwMDQuMTYyIDEuNzEzeiI+PC9wYXRoPjwvc3ZnPg==)}.slr-aiv-llm-icon--claude{background-image:url(data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjFlbSIgc3R5bGU9ImZsZXg6bm9uZTtsaW5lLWhlaWdodDoxIiB2aWV3Qm94PSIwIDAgMjQgMjQiIHdpZHRoPSIxZW0iIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHRpdGxlPkNsYXVkZTwvdGl0bGU+PHBhdGggZD0iTTQuNzA5IDE1Ljk1NWw0LjcyLTIuNjQ3LjA4LS4yMy0uMDgtLjEyOEg5LjJsLS43OS0uMDQ4LTIuNjk4LS4wNzMtMi4zMzktLjA5Ny0yLjI2Ni0uMTIyLS41NzEtLjEyMUwwIDExLjc4NGwuMDU1LS4zNTIuNDgtLjMyMS42ODYuMDYgMS41Mi4xMDMgMi4yNzguMTU4IDEuNjUyLjA5NyAyLjQ0OS4yNTVoLjM4OWwuMDU1LS4xNTctLjEzNC0uMDk4LS4xMDMtLjA5Ny0yLjM1OC0xLjU5Ni0yLjU1Mi0xLjY4OC0xLjMzNi0uOTcyLS43MjQtLjQ5MS0uMzY0LS40NjItLjE1OC0xLjAwOC42NTYtLjcyMi44ODEuMDYuMjI1LjA2MS44OTMuNjg2IDEuOTA4IDEuNDc2IDIuNDkxIDEuODMzLjM2NS4zMDQuMTQ1LS4xMDMuMDE5LS4wNzMtLjE2NC0uMjc0LTEuMzU1LTIuNDQ2LTEuNDQ2LTIuNDktLjY0NC0xLjAzMi0uMTctLjYxOWEyLjk3IDIuOTcgMCAwMS0uMTA0LS43MjlMNi4yODMuMTM0IDYuNjk2IDBsLjk5Ni4xMzQuNDIuMzY0LjYyIDEuNDE0IDEuMDAyIDIuMjI5IDEuNTU1IDMuMDMuNDU2Ljg5OC4yNDMuODMyLjA5MS4yNTVoLjE1OFY5LjAxbC4xMjgtMS43MDYuMjM3LTIuMDk1LjIzLTIuNjk1LjA4LS43Ni4zNzYtLjkxLjc0Ny0uNDkyLjU4NC4yOC40OC42ODUtLjA2Ny40NDQtLjI4NiAxLjg1MS0uNTU5IDIuOTAzLS4zNjQgMS45NDJoLjIxMmwuMjQzLS4yNDIuOTg1LTEuMzA2IDEuNjUyLTIuMDY0LjczLS44Mi44NS0uOTA0LjU0Ny0uNDMxaDEuMDMzbC43NiAxLjEyOS0uMzQgMS4xNjYtMS4wNjQgMS4zNDctLjg4MSAxLjE0Mi0xLjI2NCAxLjctLjc5IDEuMzYuMDczLjExLjE4OC0uMDIgMi44NTYtLjYwNiAxLjU0My0uMjggMS44NDEtLjMxNS44MzMuMzg4LjA5MS4zOTUtLjMyOC44MDctMS45NjkuNDg2LTIuMzA5LjQ2Mi0zLjQzOS44MTMtLjA0Mi4wMy4wNDkuMDYxIDEuNTQ5LjE0Ni42NjIuMDM2aDEuNjIybDMuMDIuMjI1Ljc5LjUyMi40NzQuNjM4LS4wNzkuNDg1LTEuMjE1LjYyLTEuNjQtLjM4OS0zLjgyOS0uOTEtMS4zMTItLjMyOWgtLjE4MnYuMTFsMS4wOTMgMS4wNjggMi4wMDYgMS44MSAyLjUwOSAyLjMzLjEyNy41NzgtLjMyMi40NTUtLjM0LS4wNDktMi4yMDUtMS42NTctLjg1MS0uNzQ3LTEuOTI2LTEuNjJoLS4xMjh2LjE3bC40NDQuNjQ5IDIuMzQ1IDMuNTIxLjEyMiAxLjA4LS4xNy4zNTMtLjYwOC4yMTMtLjY2OC0uMTIyLTEuMzc0LTEuOTI1LTEuNDE1LTIuMTY3LTEuMTQzLTEuOTQzLS4xNC4wOC0uNjc0IDcuMjU0LS4zMTYuMzctLjcyOS4yOC0uNjA3LS40NjEtLjMyMi0uNzQ3LjMyMi0xLjQ3Ni4zODktMS45MjQuMzE1LTEuNTMuMjg2LTEuOS4xNy0uNjMyLS4wMTItLjA0Mi0uMTQuMDE4LTEuNDM0IDEuOTY3LTIuMTggMi45NDUtMS43MjYgMS44NDUtLjQxNC4xNjQtLjcxNy0uMzcuMDY3LS42NjIuNDAxLS41ODkgMi4zODgtMy4wMzYgMS40NC0xLjg4Mi45My0xLjA4Ni0uMDA2LS4xNThoLS4wNTVMNC4xMzIgMTguNTZsLTEuMTMuMTQ2LS40ODctLjQ1Ni4wNjEtLjc0Ni4yMzEtLjI0MyAxLjkwOC0xLjMxMi0uMDA2LjAwNnoiIGZpbGw9IiNEOTc3NTciIGZpbGwtcnVsZT0ibm9uemVybyI+PC9wYXRoPjwvc3ZnPg==)}.slr-aiv-llm-icon--gemini{background-image:url(data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjFlbSIgc3R5bGU9ImZsZXg6bm9uZTtsaW5lLWhlaWdodDoxIiB2aWV3Qm94PSIwIDAgMjQgMjQiIHdpZHRoPSIxZW0iIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHRpdGxlPkdlbWluaTwvdGl0bGU+PHBhdGggZD0iTTIwLjYxNiAxMC44MzVhMTQuMTQ3IDE0LjE0NyAwIDAxLTQuNDUtMy4wMDEgMTQuMTExIDE0LjExMSAwIDAxLTMuNjc4LTYuNDUyLjUwMy41MDMgMCAwMC0uOTc1IDAgMTQuMTM0IDE0LjEzNCAwIDAxLTMuNjc5IDYuNDUyIDE0LjE1NSAxNC4xNTUgMCAwMS00LjQ1IDMuMDAxYy0uNjUuMjgtMS4zMTguNTA1LTIuMDAyLjY3OGEuNTAyLjUwMiAwIDAwMCAuOTc1Yy42ODQuMTcyIDEuMzUuMzk3IDIuMDAyLjY3N2ExNC4xNDcgMTQuMTQ3IDAgMDE0LjQ1IDMuMDAxIDE0LjExMiAxNC4xMTIgMCAwMTMuNjc5IDYuNDUzLjUwMi41MDIgMCAwMC45NzUgMGMuMTcyLS42ODUuMzk3LTEuMzUxLjY3Ny0yLjAwM2ExNC4xNDUgMTQuMTQ1IDAgMDEzLjAwMS00LjQ1IDE0LjExMyAxNC4xMTMgMCAwMTYuNDUzLTMuNjc4LjUwMy41MDMgMCAwMDAtLjk3NSAxMy4yNDUgMTMuMjQ1IDAgMDEtMi4wMDMtLjY3OHoiIGZpbGw9IiMzMTg2RkYiPjwvcGF0aD48cGF0aCBkPSJNMjAuNjE2IDEwLjgzNWExNC4xNDcgMTQuMTQ3IDAgMDEtNC40NS0zLjAwMSAxNC4xMTEgMTQuMTExIDAgMDEtMy42NzgtNi40NTIuNTAzLjUwMyAwIDAwLS45NzUgMCAxNC4xMzQgMTQuMTM0IDAgMDEtMy42NzkgNi40NTIgMTQuMTU1IDE0LjE1NSAwIDAxLTQuNDUgMy4wMDFjLS42NS4yOC0xLjMxOC41MDUtMi4wMDIuNjc4YS41MDIuNTAyIDAgMDAwIC45NzVjLjY4NC4xNzIgMS4zNS4zOTcgMi4wMDIuNjc3YTE0LjE0NyAxNC4xNDcgMCAwMTQuNDUgMy4wMDEgMTQuMTEyIDE0LjExMiAwIDAxMy42NzkgNi40NTMuNTAyLjUwMiAwIDAwLjk3NSAwYy4xNzItLjY4NS4zOTctMS4zNTEuNjc3LTIuMDAzYTE0LjE0NSAxNC4xNDUgMCAwMTMuMDAxLTQuNDUgMTQuMTEzIDE0LjExMyAwIDAxNi40NTMtMy42NzguNTAzLjUwMyAwIDAwMC0uOTc1IDEzLjI0NSAxMy4yNDUgMCAwMS0yLjAwMy0uNjc4eiIgZmlsbD0idXJsKCNsb2JlLWljb25zLWdlbWluaS0wLV9SXzBfKSI+PC9wYXRoPjxwYXRoIGQ9Ik0yMC42MTYgMTAuODM1YTE0LjE0NyAxNC4xNDcgMCAwMS00LjQ1LTMuMDAxIDE0LjExMSAxNC4xMTEgMCAwMS0zLjY3OC02LjQ1Mi41MDMuNTAzIDAgMDAtLjk3NSAwIDE0LjEzNCAxNC4xMzQgMCAwMS0zLjY3OSA2LjQ1MiAxNC4xNTUgMTQuMTU1IDAgMDEtNC40NSAzLjAwMWMtLjY1LjI4LTEuMzE4LjUwNS0yLjAwMi42NzhhLjUwMi41MDIgMCAwMDAgLjk3NWMuNjg0LjE3MiAxLjM1LjM5NyAyLjAwMi42NzdhMTQuMTQ3IDE0LjE0NyAwIDAxNC40NSAzLjAwMSAxNC4xMTIgMTQuMTEyIDAgMDEzLjY3OSA2LjQ1My41MDIuNTAyIDAgMDAuOTc1IDBjLjE3Mi0uNjg1LjM5Ny0xLjM1MS42NzctMi4wMDNhMTQuMTQ1IDE0LjE0NSAwIDAxMy4wMDEtNC40NSAxNC4xMTMgMTQuMTEzIDAgMDE2LjQ1My0zLjY3OC41MDMuNTAzIDAgMDAwLS45NzUgMTMuMjQ1IDEzLjI0NSAwIDAxLTIuMDAzLS42Nzh6IiBmaWxsPSJ1cmwoI2xvYmUtaWNvbnMtZ2VtaW5pLTEtX1JfMF8pIj48L3BhdGg+PHBhdGggZD0iTTIwLjYxNiAxMC44MzVhMTQuMTQ3IDE0LjE0NyAwIDAxLTQuNDUtMy4wMDEgMTQuMTExIDE0LjExMSAwIDAxLTMuNjc4LTYuNDUyLjUwMy41MDMgMCAwMC0uOTc1IDAgMTQuMTM0IDE0LjEzNCAwIDAxLTMuNjc5IDYuNDUyIDE0LjE1NSAxNC4xNTUgMCAwMS00LjQ1IDMuMDAxYy0uNjUuMjgtMS4zMTguNTA1LTIuMDAyLjY3OGEuNTAyLjUwMiAwIDAwMCAuOTc1Yy42ODQuMTcyIDEuMzUuMzk3IDIuMDAyLjY3N2ExNC4xNDcgMTQuMTQ3IDAgMDE0LjQ1IDMuMDAxIDE0LjExMiAxNC4xMTIgMCAwMTMuNjc5IDYuNDUzLjUwMi41MDIgMCAwMC45NzUgMGMuMTcyLS42ODUuMzk3LTEuMzUxLjY3Ny0yLjAwM2ExNC4xNDUgMTQuMTQ1IDAgMDEzLjAwMS00LjQ1IDE0LjExMyAxNC4xMTMgMCAwMTYuNDUzLTMuNjc4LjUwMy41MDMgMCAwMDAtLjk3NSAxMy4yNDUgMTMuMjQ1IDAgMDEtMi4wMDMtLjY3OHoiIGZpbGw9InVybCgjbG9iZS1pY29ucy1nZW1pbmktMi1fUl8wXykiPjwvcGF0aD48ZGVmcz48bGluZWFyR3JhZGllbnQgZ3JhZGllbnRVbml0cz0idXNlclNwYWNlT25Vc2UiIGlkPSJsb2JlLWljb25zLWdlbWluaS0wLV9SXzBfIiB4MT0iNyIgeDI9IjExIiB5MT0iMTUuNSIgeTI9IjEyIj48c3RvcCBzdG9wLWNvbG9yPSIjMDhCOTYyIj48L3N0b3A+PHN0b3Agb2Zmc2V0PSIxIiBzdG9wLWNvbG9yPSIjMDhCOTYyIiBzdG9wLW9wYWNpdHk9IjAiPjwvc3RvcD48L2xpbmVhckdyYWRpZW50PjxsaW5lYXJHcmFkaWVudCBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSIgaWQ9ImxvYmUtaWNvbnMtZ2VtaW5pLTEtX1JfMF8iIHgxPSI4IiB4Mj0iMTEuNSIgeTE9IjUuNSIgeTI9IjExIj48c3RvcCBzdG9wLWNvbG9yPSIjRjk0NTQzIj48L3N0b3A+PHN0b3Agb2Zmc2V0PSIxIiBzdG9wLWNvbG9yPSIjRjk0NTQzIiBzdG9wLW9wYWNpdHk9IjAiPjwvc3RvcD48L2xpbmVhckdyYWRpZW50PjxsaW5lYXJHcmFkaWVudCBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSIgaWQ9ImxvYmUtaWNvbnMtZ2VtaW5pLTItX1JfMF8iIHgxPSIzLjUiIHgyPSIxNy41IiB5MT0iMTMuNSIgeTI9IjEyIj48c3RvcCBzdG9wLWNvbG9yPSIjRkFCQzEyIj48L3N0b3A+PHN0b3Agb2Zmc2V0PSIuNDYiIHN0b3AtY29sb3I9IiNGQUJDMTIiIHN0b3Atb3BhY2l0eT0iMCI+PC9zdG9wPjwvbGluZWFyR3JhZGllbnQ+PC9kZWZzPjwvc3ZnPg==)}.slr-aiv-llm-icon--perplexity{background-image:url(data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjFlbSIgc3R5bGU9ImZsZXg6bm9uZTtsaW5lLWhlaWdodDoxIiB2aWV3Qm94PSIwIDAgMjQgMjQiIHdpZHRoPSIxZW0iIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHRpdGxlPlBlcnBsZXhpdHk8L3RpdGxlPjxwYXRoIGQ9Ik0xOS43ODUgMHY3LjI3MkgyMi41VjE3LjYyaC0yLjkzNVYyNGwtNy4wMzctNi4xOTR2Ni4xNDVoLTEuMDkxdi02LjE1Mkw0LjM5MiAyNHYtNi40NjVIMS41VjcuMTg4aDIuODg0VjBsNy4wNTMgNi40OTRWLjE5aDEuMDl2Ni40OUwxOS43ODYgMHptLTcuMjU3IDkuMDQ0djcuMzE5bDUuOTQ2IDUuMjM0VjE0LjQ0bC01Ljk0Ni01LjM5N3ptLTEuMDk5LS4wOGwtNS45NDYgNS4zOTh2Ny4yMzVsNS45NDYtNS4yMzRWOC45NjV6bTguMTM2IDcuNThoMS44NDRWOC4zNDlIMTMuNDZsNi4xMDUgNS41NHYyLjY1NXptLTguOTgyLTguMjhIMi41OXY4LjE5NWgxLjh2LTIuNTc2bDYuMTkyLTUuNjJ6TTUuNDc1IDIuNDc2djQuNzFoNS4xMTVsLTUuMTE1LTQuNzF6bTEzLjIxOSAwbC01LjExNSA0LjcxaDUuMTE1di00LjcxeiIgZmlsbD0iIzIyQjhDRCIgZmlsbC1ydWxlPSJub256ZXJvIj48L3BhdGg+PC9zdmc+)}.slr-aiv-llm-icon--grok{background-image:url(data:image/svg+xml;base64,PHN2ZyBmaWxsPSJjdXJyZW50Q29sb3IiIGZpbGwtcnVsZT0iZXZlbm9kZCIgaGVpZ2h0PSIxZW0iIHN0eWxlPSJmbGV4Om5vbmU7bGluZS1oZWlnaHQ6MSIgdmlld0JveD0iMCAwIDI0IDI0IiB3aWR0aD0iMWVtIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjx0aXRsZT5Hcm9rPC90aXRsZT48cGF0aCBkPSJNOS4yNyAxNS4yOWw3Ljk3OC01Ljg5N2MuMzkxLS4yOS45NS0uMTc3IDEuMTM3LjI3Mi45OCAyLjM2OS41NDIgNS4yMTUtMS40MSA3LjE2OS0xLjk1MSAxLjk1NC00LjY2NyAyLjM4Mi03LjE0OSAxLjQwNmwtMi43MTEgMS4yNTdjMy44ODkgMi42NjEgOC42MTEgMi4wMDMgMTEuNTYyLS45NTMgMi4zNDEtMi4zNDQgMy4wNjYtNS41MzkgMi4zODgtOC40MmwuMDA2LjAwN2MtLjk4My00LjIzMi4yNDItNS45MjQgMi43NS05LjM4My4wNi0uMDgyLjEyLS4xNjQuMTc5LS4yNDhsLTMuMzAxIDMuMzA1di0uMDFMOS4yNjcgMTUuMjkyTTcuNjIzIDE2LjcyM2MtMi43OTItMi42Ny0yLjMxLTYuODAxLjA3MS05LjE4NCAxLjc2MS0xLjc2MyA0LjY0Ny0yLjQ4MyA3LjE2Ni0xLjQyNWwyLjcwNS0xLjI1YTcuODA4IDcuODA4IDAgMDAtMS44MjktMUE4Ljk3NSA4Ljk3NSAwIDAwNS45ODQgNS44M2MtMi41MzMgMi41MzYtMy4zMyA2LjQzNi0xLjk2MiA5Ljc2NCAxLjAyMiAyLjQ4Ny0uNjUzIDQuMjQ2LTIuMzQgNi4wMjItLjU5OS42My0xLjE5OSAxLjI1OS0xLjY4MiAxLjkyNWw3LjYyLTYuODE1Ij48L3BhdGg+PC9zdmc+)}.slr-aiv-llm-icon--deepseek{background-image:url(data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjFlbSIgc3R5bGU9ImZsZXg6bm9uZTtsaW5lLWhlaWdodDoxIiB2aWV3Qm94PSIwIDAgMjQgMjQiIHdpZHRoPSIxZW0iIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHRpdGxlPkRlZXBTZWVrPC90aXRsZT48cGF0aCBkPSJNMjMuNzQ4IDQuNDgyYy0uMjU0LS4xMjQtLjM2NC4xMTMtLjUxMi4yMzQtLjA1MS4wMzktLjA5NC4wOS0uMTM3LjEzNi0uMzcyLjM5Ny0uODA2LjY1Ny0xLjM3My42MjYtLjgyOS0uMDQ2LTEuNTM3LjIxNC0yLjE2My44NDgtLjEzMy0uNzgyLS41NzUtMS4yNDgtMS4yNDctMS41NDgtLjM1Mi0uMTU2LS43MDgtLjMxMS0uOTU1LS42NS0uMTcyLS4yNDEtLjIxOS0uNTEtLjMwNS0uNzc0LS4wNTUtLjE2LS4xMS0uMzIzLS4yOTMtLjM1LS4yLS4wMzEtLjI3OC4xMzYtLjM1Ni4yNzYtLjMxMy41NzItLjQzNCAxLjIwMi0uNDIyIDEuODQuMDI3IDEuNDM2LjYzMyAyLjU4IDEuODM4IDMuMzkzLjEzNy4wOTMuMTcyLjE4Ny4xMjkuMzIzLS4wODIuMjgtLjE4LjU1Mi0uMjY2LjgzMy0uMDU1LjE3OS0uMTM3LjIxNy0uMzI5LjE0YTUuNTI2IDUuNTI2IDAgMDEtMS43MzYtMS4xOGMtLjg1Ny0uODI4LTEuNjMxLTEuNzQyLTIuNTk3LTIuNDU4YTExLjM2NSAxMS4zNjUgMCAwMC0uNjg5LS40NzFjLS45ODUtLjk1Ny4xMy0xLjc0My4zODgtMS44MzYuMjctLjA5OC4wOTMtLjQzMi0uNzc5LS40MjgtLjg3Mi4wMDQtMS42Ny4yOTUtMi42ODcuNjg0YTMuMDU1IDMuMDU1IDAgMDEtLjQ2NS4xMzcgOS41OTcgOS41OTcgMCAwMC0yLjg4My0uMTAyYy0xLjg4NS4yMS0zLjM5IDEuMTAyLTQuNDk3IDIuNjIzQy4wODIgOC42MDYtLjIzMSAxMC42ODQuMTUyIDEyLjg1Yy40MDMgMi4yODQgMS41NjkgNC4xNzUgMy4zNiA1LjY1MyAxLjg1OCAxLjUzMyAzLjk5NyAyLjI4NCA2LjQzOCAyLjE0IDEuNDgyLS4wODUgMy4xMzMtLjI4NCA0Ljk5NC0xLjg2LjQ3LjIzNC45NjIuMzI3IDEuNzguMzk3LjYzLjA1OSAxLjIzNi0uMDMgMS43MDUtLjEyOC43MzUtLjE1Ni42ODQtLjgzNy40MTktLjk2MS0yLjE1NS0xLjAwNC0xLjY4Mi0uNTk1LTIuMTEzLS45MjYgMS4wOTYtMS4yOTYgMi43NDYtMi42NDIgMy4zOTItNy4wMDMuMDUtLjM0Ny4wMDctLjU2NSAwLS44NDUtLjAwNC0uMTcuMDM1LS4yMzcuMjMtLjI1NmE0LjE3MyA0LjE3MyAwIDAwMS41NDUtLjQ3NWMxLjM5Ni0uNzYzIDEuOTYtMi4wMTUgMi4wOTMtMy41MTcuMDItLjIzLS4wMDQtLjQ2Ny0uMjQ3LS41ODh6TTExLjU4MSAxOGMtMi4wODktMS42NDItMy4xMDItMi4xODMtMy41Mi0yLjE2LS4zOTIuMDI0LS4zMjEuNDcxLS4yMzUuNzYzLjA5LjI4OC4yMDcuNDg2LjM3MS43MzkuMTE0LjE2Ny4xOTIuNDE2LS4xMTMuNjAzLS42NzMuNDE2LTEuODQyLS4xNC0xLjg5Ny0uMTY3LTEuMzYxLS44MDItMi41LTEuODYtMy4zMDEtMy4zMDctLjc3NC0xLjM5My0xLjIyNC0yLjg4Ny0xLjI5OC00LjQ4Mi0uMDItLjM4Ni4wOTMtLjUyMi40NzctLjU5MmE0LjY5NiA0LjY5NiAwIDAxMS41MjktLjAzOWMyLjEzMi4zMTIgMy45NDYgMS4yNjUgNS40NjggMi43NzQuODY4Ljg2IDEuNTI1IDEuODg3IDIuMjAyIDIuODkxLjcyIDEuMDY2IDEuNDk0IDIuMDgyIDIuNDggMi45MTQuMzQ4LjI5Mi42MjUuNTE0Ljg5MS42NzctLjgwMi4wOS0yLjE0LjExLTMuMDU0LS42MTR6bTEtNi40NGEuMzA2LjMwNiAwIDAxLjQxNS0uMjg3LjMwMi4zMDIgMCAwMS4yLjI4OC4zMDYuMzA2IDAgMDEtLjMxLjMwNy4zMDMuMzAzIDAgMDEtLjMwNC0uMzA4em0zLjExIDEuNTk2Yy0uMi4wODEtLjM5OS4xNTEtLjU5LjE2YTEuMjQ1IDEuMjQ1IDAgMDEtLjc5OC0uMjU0Yy0uMjc0LS4yMy0uNDctLjM1OC0uNTUyLS43NThhMS43MyAxLjczIDAgMDEuMDE2LS41ODhjLjA3LS4zMjctLjAwOC0uNTM3LS4yMzktLjcyNy0uMTg3LS4xNTYtLjQyNi0uMTk5LS42ODgtLjE5OWEuNTU5LjU1OSAwIDAxLS4yNTQtLjA3OGMtLjExLS4wNTQtLjItLjE5LS4xMTQtLjM1OC4wMjgtLjA1NC4xNi0uMTg2LjE5Mi0uMjEuMzU2LS4yMDIuNzY3LS4xMzYgMS4xNDYuMDE2LjM1Mi4xNDQuNjE4LjQwOCAxLjAwMS43ODIuMzkxLjQ1MS40NjIuNTc2LjY4NS45MTQuMTc2LjI2NS4zMzYuNTM3LjQ0NS44NDguMDY3LjE5NS0uMDE5LjM1NC0uMjUuNDUyeiIgZmlsbD0iIzRENkJGRSI+PC9wYXRoPjwvc3ZnPg==)}.slr-aiv-llm-icon--google{background-image:url(data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjFlbSIgc3R5bGU9ImZsZXg6bm9uZTtsaW5lLWhlaWdodDoxIiB2aWV3Qm94PSIwIDAgMjQgMjQiIHdpZHRoPSIxZW0iIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHRpdGxlPkdvb2dsZTwvdGl0bGU+PHBhdGggZD0iTTIzIDEyLjI0NWMwLS45MDUtLjA3NS0xLjU2NS0uMjM2LTIuMjVoLTEwLjU0djQuMDgzaDYuMTg2Yy0uMTI0IDEuMDE0LS43OTcgMi41NDItMi4yOTQgMy41NjlsLS4wMjEuMTM2IDMuMzMyIDIuNTMuMjMuMDIyQzIxLjc3OSAxOC40MTcgMjMgMTUuNTkzIDIzIDEyLjI0NXoiIGZpbGw9IiM0Mjg1RjQiPjwvcGF0aD48cGF0aCBkPSJNMTIuMjI1IDIzYzMuMDMgMCA1LjU3NC0uOTc4IDcuNDMzLTIuNjY1bC0zLjU0Mi0yLjY4OGMtLjk0OC42NDgtMi4yMiAxLjEtMy44OTEgMS4xYTYuNzQ1IDYuNzQ1IDAgMDEtNi4zODYtNC41NzJsLS4xMzIuMDExLTMuNDY1IDIuNjI4LS4wNDUuMTI0QzQuMDQzIDIwLjUzMSA3LjgzNSAyMyAxMi4yMjUgMjN6IiBmaWxsPSIjMzRBODUzIj48L3BhdGg+PHBhdGggZD0iTTUuODQgMTQuMTc1QTYuNjUgNi42NSAwIDAxNS40NjMgMTJjMC0uNzU4LjEzOC0xLjQ5MS4zNjEtMi4xNzVsLS4wMDYtLjE0Ny0zLjUwOC0yLjY3LS4xMTUuMDU0QTEwLjgzMSAxMC44MzEgMCAwMDEgMTJjMCAxLjc3Mi40MzYgMy40NDcgMS4xOTcgNC45MzhsMy42NDItMi43NjN6IiBmaWxsPSIjRkJCQzA1Ij48L3BhdGg+PHBhdGggZD0iTTEyLjIyNSA1LjI1M2MyLjEwOCAwIDMuNTI5Ljg5MiA0LjM0IDEuNjM4bDMuMTY3LTMuMDMxQzE3Ljc4NyAyLjA4OCAxNS4yNTUgMSAxMi4yMjUgMSA3LjgzNCAxIDQuMDQzIDMuNDY5IDIuMTk3IDcuMDYybDMuNjMgMi43NjNhNi43NyA2Ljc3IDAgMDE2LjM5OC00LjU3MnoiIGZpbGw9IiNFQjQzMzUiPjwvcGF0aD48L3N2Zz4=)}.slr-aiv-comp{display:flex;flex-direction:column;min-height:0}.slr-aiv-comp__head{align-items:center;display:flex;flex-wrap:wrap;gap:10px;justify-content:space-between}.slr-aiv-comp__head-actions{align-items:center;column-gap:10px;display:flex}.slr-aiv-comp__count{color:var(--slr-gray-60);font-size:11px}.slr-aiv-comp__empty{align-items:center;display:flex;flex:1;justify-content:center;min-height:0}.slr-aiv-comp__table-wrap{flex:1;margin-top:10px;min-height:0;overflow:auto}.slr-aiv-comp__table{border-collapse:collapse;font-size:13px;width:100%}.slr-aiv-comp__table th{color:var(--slr-gray-60);font-weight:500;padding:6px 0;text-align:left}.slr-aiv-comp__table td{padding:8px 0}.slr-aiv-comp__table tr.is-brand{background:var(--slr-blue-95)}.slr-aiv-comp__name{align-items:center;display:flex;gap:8px}.slr-aiv-comp__dot{border-radius:50%;flex:none;height:10px;width:10px}.slr-aiv-comp__sov{align-items:center;column-gap:8px;display:flex}.slr-aiv-comp__sov-track{background:#f3f4f6;border-radius:4px;flex:1;height:8px;overflow:hidden}.slr-aiv-comp__sov-fill{border-radius:4px;height:100%}.slr-aiv-trend{margin-bottom:12px}.slr-aiv-trend__chart{height:260px;margin-top:10px}.slr-aiv-actions{margin:0 0 8px}.slr-aiv-tabs{align-items:stretch;background:#fff;border:0;border-radius:10px 10px 0 0;box-shadow:var(--slr-shadow-panel);line-height:0;margin:20px 0 0;overflow:hidden}.slr-aiv-tabs,.slr-aiv-tabs>li{display:flex;list-style:none;padding:0}.slr-aiv-tabs>li{margin:0}.slr-aiv-tabs button{appearance:none;background:transparent;border:0;border-radius:0;box-shadow:none;color:var(--slr-blue-10);cursor:pointer;font-size:14px;height:100%;line-height:1.4;margin:0;min-height:0;padding:16px 20px}.slr-aiv-tabs button.is-active{background:var(--slr-blue-95);color:var(--slr-blue-50)}.slr-aiv-tabs button:focus,.slr-aiv-tabs button:hover{box-shadow:none;color:var(--slr-blue-50);outline:none}.slr-aiv-table-panel{margin-top:20px;overflow:hidden;padding:0}.slr-aiv-table--clickable .tabulator-row{cursor:pointer}.slr-aiv-prompt-text{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}.slr-aiv-table .tabulator-row .tabulator-cell.slr-aiv-llm-col{overflow:visible;padding-left:6px!important;padding-right:6px!important;white-space:nowrap}.slr-aiv-llm-cell{align-items:center;display:inline-flex;gap:8px;justify-content:center}.slr-aiv-llm-cell--statuses{min-width:68px}.slr-aiv-status{align-items:center;border-radius:6px;box-sizing:border-box;display:inline-flex;flex:0 0 26px;height:26px;justify-content:center;width:26px}.slr-aiv-status .dashicons{font-size:16px;height:16px;width:16px}.slr-aiv-status.is-active{background:rgba(80,177,66,.14);border:1px solid rgba(80,177,66,.28);color:var(--slr-green)}.slr-aiv-status.is-inactive{background:transparent;border:1px dashed #c2c7cf;color:var(--slr-gray-60);opacity:.45}.slr-aiv-llm-cell--pending{color:#d4a017}.slr-aiv-sentiment{align-items:center;display:inline-flex;font-size:12px;gap:6px}.slr-aiv-sentiment__dot{border-radius:50%;height:8px;width:8px}.slr-aiv-sentiment--positive .slr-aiv-sentiment__dot{background:var(--slr-green)}.slr-aiv-sentiment--neutral .slr-aiv-sentiment__dot{background:#f0b429}.slr-aiv-sentiment--negative .slr-aiv-sentiment__dot{background:var(--slr-red)}.slr-aiv-sov{display:flex;flex-direction:column;gap:20px;margin-top:20px;position:relative}.slr-aiv-sov__top{display:grid;gap:20px;grid-template-columns:5fr 7fr}.slr-aiv-sov__top>*{min-width:0}.slr-aiv-sov__chart{height:320px;margin-top:10px;min-width:0;position:relative}.slr-aiv-sov__chart>div{height:100%}.slr-aiv-sov__chart--wide{height:320px}.slr-aiv-sov-empty,.slr-aiv-sov__loading{align-items:center;display:flex;justify-content:center;margin-top:20px;min-height:320px}.slr-aiv-changes{margin-top:20px;min-height:200px}.slr-aiv-changes__empty{color:var(--slr-gray-60);padding:40px 20px;text-align:center}.slr-aiv-changes__group+.slr-aiv-changes__group{padding-top:24px}.slr-aiv-changes__date{font-size:14px;font-weight:600;margin-bottom:10px}.slr-aiv-changes__rows{border-radius:8px;overflow:hidden}.slr-aiv-changes__row{align-items:center;column-gap:20px;display:flex;padding:12px 16px}.slr-aiv-changes__row:nth-child(odd){background:#fff}.slr-aiv-changes__row:nth-child(2n){background:#f8f9fa}.slr-aiv-changes__badge{align-items:center;border-radius:4px;display:inline-flex;flex:0 0 118px;font-size:11px;font-weight:600;justify-content:center;letter-spacing:.3px;padding:4px 10px;text-transform:uppercase;white-space:nowrap}.slr-aiv-changes__badge--traction{background:#e8f6ec;color:#1f8a4c}.slr-aiv-changes__badge--alert{background:#fbe4e4;color:#c0392b}.slr-aiv-changes__badge--competition{background:#fff0e0;color:#d35400}.slr-aiv-changes__badge--milestone{background:var(--slr-blue-95);color:var(--slr-blue-50)}.slr-aiv-changes__message{flex:1;line-height:1.45;min-width:0}.slr-aiv-changes__delta{flex:0 0 auto;font-weight:500;min-width:72px;text-align:right;white-space:nowrap}.slr-aiv-empty{align-items:center;display:flex;flex-direction:column;margin:40px auto;max-width:720px;padding:56px 32px;text-align:center}.slr-aiv-empty__badge{align-items:center;background:var(--slr-gradient);border-radius:16px;color:#fff;display:flex;height:56px;justify-content:center;margin-bottom:20px;width:56px}.slr-aiv-empty__head h2{font-size:22px;margin:0 0 8px}.slr-aiv-empty__head p{color:var(--slr-gray-60);margin:0}.slr-aiv-empty__features{display:flex;flex-direction:column;gap:12px;margin:28px 0;max-width:460px;text-align:left;width:100%}.slr-aiv-empty__feature{align-items:flex-start;background:#f8f9fa;border-radius:10px;display:flex;gap:12px;padding:12px}.slr-aiv-empty__feature-icon{align-items:center;border-radius:10px;display:flex;flex:none;height:36px;justify-content:center;width:36px}.slr-aiv-empty__feature-icon--blue{background:#e7f2fe;color:var(--slr-blue-50)}.slr-aiv-empty__feature-icon--cyan{background:#e1f7f3;color:#0aa}.slr-aiv-empty__feature-icon--violet{background:#eeeafe;color:#6b4eff}.slr-aiv-empty__feature strong{display:block;margin-bottom:2px}.slr-aiv-empty__feature span,.slr-aiv-empty__hint{color:var(--slr-gray-60);font-size:13px}.slr-aiv-empty__hint{align-items:center;display:flex;gap:6px;margin-top:16px}@media (max-width:1100px){.slr-aiv-sov__top,.slr-aiv-top{display:flex;flex-direction:column;row-gap:16px}.slr-aiv-middle,.slr-aiv-top>.slr-aiv-card{flex:none;width:100%}.slr-aiv-coverage{flex:none}}@media (max-width:782px){.slr-ai-visibility__body{padding:16px}.slr-aiv-score__value{font-size:48px}.slr-aiv-changes__row{flex-wrap:wrap;row-gap:8px}.slr-aiv-changes__badge{flex:0 0 auto}.slr-aiv-changes__delta{text-align:left;width:100%}}
  • seo-local-rank/trunk/build/index.js

    r3706047 r3720851  
    1 (()=>{"use strict";const t={n:e=>{const i=e&&e.__esModule?()=>e.default:()=>e;return t.d(i,{a:i}),i},d:(e,i)=>{if(Array.isArray(i))for(var s=0;s<i.length;){var n=i[s++],o=i[s++];t.o(e,n)?0===o&&s++:0===o?Object.defineProperty(e,n,{enumerable:!0,value:i[s++]}):Object.defineProperty(e,n,{enumerable:!0,get:o})}else for(var n in i)t.o(i,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:i[n]})},o:(t,e)=>Object.hasOwn(t,e)},e=window.wp.element,i=window.wp.apiFetch;var s=t.n(i);const n=window.wp.components,o=t=>`/seo-local-rank/v1${t.startsWith("/")?t:`/${t}`}`;function r(t){if(!t||"string"!=typeof t)return"";const e=t.trim();return e?/^https?:\/\//i.test(e)?e:e.startsWith("//")?`https:${e}`:`${(window.slrAdmin?.appOrigin||"https://app.trueranker.com").replace(/\/$/,"")}${e.startsWith("/")?e:`/${e}`}`:""}const a=window.wp.i18n,l=window.ReactJSXRuntime;function h({domains:t,onSelected:i}){const r=t.length>0?String(c(t[0])):"",[h,d]=(0,e.useState)(r),[u,p]=(0,e.useState)(!1),[m,g]=(0,e.useState)(null),b=t.map(t=>{const e=c(t),i=t.project_name||t.name||`#${e}`,s=t.name_displayed||t.name||"",n=Number(t.num_keywords),o=Number.isFinite(n)?n:0;return{label:(0,a.sprintf)(/* translators: 1: project name, 2: hostname, 3: keyword count */ /* translators: 1: project name, 2: hostname, 3: keyword count */
    2 (0,a._n)("%1$s (%2$s) — %3$d keyword","%1$s (%2$s) — %3$d keywords",o,"seo-local-rank"),i,s,o),value:String(e)}});return(0,l.jsxs)(n.Modal,{title:(0,a.__)("Choose a project","seo-local-rank"),onRequestClose:()=>{},shouldCloseOnClickOutside:!1,shouldCloseOnEsc:!1,className:"slr-project-modal",children:[(0,l.jsx)("p",{className:"slr-project-modal__lead",children:(0,a.__)("There are several projects for this domain. Choose which one to use in WordPress.","seo-local-rank")}),(0,l.jsx)("p",{className:"slr-project-modal__hint",children:(0,a.__)("You can change it at any time from Settings.","seo-local-rank")}),(0,l.jsx)(n.RadioControl,{selected:h,options:b,onChange:d}),m&&(0,l.jsx)("p",{className:"slr-project-modal__error",children:m}),(0,l.jsx)("div",{className:"slr-project-modal__actions",children:(0,l.jsx)(n.Button,{variant:"primary",onClick:async()=>{const t=parseInt(h,10);if(t){p(!0),g(null);try{await s()({path:o(`/domains/${t}/select`),method:"POST"}),i()}catch(t){g(t?.message||(0,a.__)("Could not save the selection.","seo-local-rank"))}finally{p(!1)}}},isBusy:u,disabled:u||!h,children:(0,a.__)("Use this project","seo-local-rank")})})]})}function c(t){return t.project_domain_id||t.id||0}const d="top20 every day";function u({settings:t,domainsPayload:i,onCreated:r}){const[h,c]=(0,e.useState)("string"==typeof t?.site_name?t.site_name:""),[u,p]=(0,e.useState)(""),[m,g]=(0,e.useState)(d),[b,f]=(0,e.useState)([]),[v,w]=(0,e.useState)(!0),[y,_]=(0,e.useState)(!1),[x,C]=(0,e.useState)(null),k=function(t,e){if("string"==typeof e?.domain&&e.domain)return e.domain;const i="string"==typeof t?.site_url?t.site_url:"";try{return new URL(i).hostname||i}catch{return i}}(t,i),E=[{value:d,label:(0,a.__)("TOP 20 every day","seo-local-rank"),description:(0,a.__)("We will monitor the TOP 20 of your keywords in Google every day.","seo-local-rank")},{value:"top50 every 3 days",label:(0,a.__)("TOP 50 every 3 days","seo-local-rank"),description:(0,a.__)("We will monitor the TOP 50 of your keywords in Google every 3 days.","seo-local-rank")},{value:"top100 every 7 days",label:(0,a.__)("TOP 100 every 7 days","seo-local-rank"),description:(0,a.__)("We will monitor the TOP 100 of your keywords in Google every 7 days.","seo-local-rank")}];(0,e.useEffect)(()=>{let t=!1;return(async()=>{w(!0);try{const e=await s()({path:o("/domains/countries")}),i=Array.isArray(e?.data)?e.data:[];t||f(i)}catch(e){t||(f([]),C({status:"error",message:e?.message||(0,a.__)("Could not load countries.","seo-local-rank")}))}finally{t||w(!1)}})(),()=>{t=!0}},[]);const R=[{label:(0,a.__)("Choose a country","seo-local-rank"),value:""},...b.map(t=>({label:t.name||`#${t.id}`,value:String(t.id)}))];return(0,l.jsx)("div",{className:"slr-onboarding slr-create-project",children:(0,l.jsxs)("div",{className:"slr-panel slr-onboarding__panel",children:[x&&(0,l.jsx)(n.Notice,{status:x.status,isDismissible:!0,onRemove:()=>C(null),children:x.message}),(0,l.jsx)("h2",{className:"slr-create-project__title",children:(0,a.__)("Create your project","seo-local-rank")}),(0,l.jsx)("p",{className:"slr-create-project__lead",children:(0,a.__)("There is no TrueRanker project for this site. Fill in the brand, country and tracking frequency to get started.","seo-local-rank")}),v?(0,l.jsx)("div",{className:"slr-onboarding__loader",children:(0,l.jsx)(n.Spinner,{})}):(0,l.jsxs)("div",{className:"slr-create-project__fields",children:[(0,l.jsx)(n.TextControl,{className:"slr-create-project__domain",label:(0,a.__)("Domain","seo-local-rank"),help:(0,a.__)("Taken from this WordPress site and cannot be changed.","seo-local-rank"),value:k,onChange:()=>{},disabled:!0,readOnly:!0,__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0}),(0,l.jsx)(n.TextControl,{label:(0,a.__)("Brand","seo-local-rank"),help:(0,a.__)("Enter your brand to monitor its appearances in AI-generated answers.","seo-local-rank"),value:h,onChange:c,disabled:y,__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0}),(0,l.jsx)(n.SelectControl,{label:(0,a.__)("Country","seo-local-rank"),help:(0,a.__)("Choose the country where you want to measure visibility. Later, for each keyword, you can pick any location (even in another country).","seo-local-rank"),value:u,options:R,onChange:p,disabled:y,__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0}),(0,l.jsxs)("fieldset",{className:"slr-create-project__tracking",disabled:y,children:[(0,l.jsx)("legend",{className:"slr-create-project__label",children:(0,a.__)("Tracking","seo-local-rank")}),(0,l.jsx)("p",{className:"slr-create-project__hint",children:(0,a.__)("Choose the tracking options you want to apply to your project.","seo-local-rank")}),(0,l.jsx)("div",{className:"slr-tracking-options",role:"radiogroup","aria-label":(0,a.__)("Tracking options","seo-local-rank"),children:E.map(t=>{const e=m===t.value;return(0,l.jsxs)("button",{type:"button",role:"radio","aria-checked":e,className:e?"slr-tracking-option is-selected":"slr-tracking-option",disabled:y,onClick:()=>g(t.value),children:[(0,l.jsxs)("span",{className:"slr-tracking-option__text",children:[(0,l.jsx)("span",{className:"slr-tracking-option__title",children:t.label}),(0,l.jsx)("span",{className:"slr-tracking-option__desc",children:t.description})]}),(0,l.jsx)("span",{className:"slr-tracking-option__check","aria-hidden":"true"})]},t.value)})})]}),(0,l.jsx)("div",{className:"slr-onboarding__actions slr-create-project__actions",children:(0,l.jsx)(n.Button,{variant:"primary",onClick:async()=>{if(h.trim())if(u){_(!0),C(null);try{await s()({path:o("/domains/create"),method:"POST",data:{brand_name:h.trim(),country_id:parseInt(u,10),tracking_options:m}}),r()}catch(t){C({status:"error",message:t?.message||(0,a.__)("Could not create the project.","seo-local-rank")})}finally{_(!1)}}else C({status:"error",message:(0,a.__)("Choose a country.","seo-local-rank")});else C({status:"error",message:(0,a.__)("Enter the brand name.","seo-local-rank")})},isBusy:y,disabled:y||0===b.length,children:(0,a.__)("Create project","seo-local-rank")})})]})]})})}const p=window.React;function m(t){return t+.5|0}const g=(t,e,i)=>Math.max(Math.min(t,i),e);function b(t){return g(m(2.55*t),0,255)}function f(t){return g(m(255*t),0,255)}function v(t){return g(m(t/2.55)/100,0,1)}function w(t){return g(m(100*t),0,100)}const y={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,A:10,B:11,C:12,D:13,E:14,F:15,a:10,b:11,c:12,d:13,e:14,f:15},_=[..."0123456789ABCDEF"],x=t=>_[15&t],C=t=>_[(240&t)>>4]+_[15&t],k=t=>(240&t)>>4==(15&t);const E=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function R(t,e,i){const s=e*Math.min(i,1-i),n=(e,n=(e+t/30)%12)=>i-s*Math.max(Math.min(n-3,9-n,1),-1);return[n(0),n(8),n(4)]}function M(t,e,i){const s=(s,n=(s+t/60)%6)=>i-i*e*Math.max(Math.min(n,4-n,1),0);return[s(5),s(3),s(1)]}function T(t,e,i){const s=R(t,1,.5);let n;for(e+i>1&&(n=1/(e+i),e*=n,i*=n),n=0;n<3;n++)s[n]*=1-e-i,s[n]+=e;return s}function S(t){const e=t.r/255,i=t.g/255,s=t.b/255,n=Math.max(e,i,s),o=Math.min(e,i,s),r=(n+o)/2;let a,l,h;return n!==o&&(h=n-o,l=r>.5?h/(2-n-o):h/(n+o),a=function(t,e,i,s,n){return t===n?(e-i)/s+(e<i?6:0):e===n?(i-t)/s+2:(t-e)/s+4}(e,i,s,h,n),a=60*a+.5),[0|a,l||0,r]}function D(t,e,i,s){return(Array.isArray(e)?t(e[0],e[1],e[2]):t(e,i,s)).map(f)}function L(t,e,i){return D(R,t,e,i)}function P(t){return(t%360+360)%360}const j={x:"dark",Z:"light",Y:"re",X:"blu",W:"gr",V:"medium",U:"slate",A:"ee",T:"ol",S:"or",B:"ra",C:"lateg",D:"ights",R:"in",Q:"turquois",E:"hi",P:"ro",O:"al",N:"le",M:"de",L:"yello",F:"en",K:"ch",G:"arks",H:"ea",I:"ightg",J:"wh"},N={OiceXe:"f0f8ff",antiquewEte:"faebd7",aqua:"ffff",aquamarRe:"7fffd4",azuY:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"0",blanKedOmond:"ffebcd",Xe:"ff",XeviTet:"8a2be2",bPwn:"a52a2a",burlywood:"deb887",caMtXe:"5f9ea0",KartYuse:"7fff00",KocTate:"d2691e",cSO:"ff7f50",cSnflowerXe:"6495ed",cSnsilk:"fff8dc",crimson:"dc143c",cyan:"ffff",xXe:"8b",xcyan:"8b8b",xgTMnPd:"b8860b",xWay:"a9a9a9",xgYF:"6400",xgYy:"a9a9a9",xkhaki:"bdb76b",xmagFta:"8b008b",xTivegYF:"556b2f",xSange:"ff8c00",xScEd:"9932cc",xYd:"8b0000",xsOmon:"e9967a",xsHgYF:"8fbc8f",xUXe:"483d8b",xUWay:"2f4f4f",xUgYy:"2f4f4f",xQe:"ced1",xviTet:"9400d3",dAppRk:"ff1493",dApskyXe:"bfff",dimWay:"696969",dimgYy:"696969",dodgerXe:"1e90ff",fiYbrick:"b22222",flSOwEte:"fffaf0",foYstWAn:"228b22",fuKsia:"ff00ff",gaRsbSo:"dcdcdc",ghostwEte:"f8f8ff",gTd:"ffd700",gTMnPd:"daa520",Way:"808080",gYF:"8000",gYFLw:"adff2f",gYy:"808080",honeyMw:"f0fff0",hotpRk:"ff69b4",RdianYd:"cd5c5c",Rdigo:"4b0082",ivSy:"fffff0",khaki:"f0e68c",lavFMr:"e6e6fa",lavFMrXsh:"fff0f5",lawngYF:"7cfc00",NmoncEffon:"fffacd",ZXe:"add8e6",ZcSO:"f08080",Zcyan:"e0ffff",ZgTMnPdLw:"fafad2",ZWay:"d3d3d3",ZgYF:"90ee90",ZgYy:"d3d3d3",ZpRk:"ffb6c1",ZsOmon:"ffa07a",ZsHgYF:"20b2aa",ZskyXe:"87cefa",ZUWay:"778899",ZUgYy:"778899",ZstAlXe:"b0c4de",ZLw:"ffffe0",lime:"ff00",limegYF:"32cd32",lRF:"faf0e6",magFta:"ff00ff",maPon:"800000",VaquamarRe:"66cdaa",VXe:"cd",VScEd:"ba55d3",VpurpN:"9370db",VsHgYF:"3cb371",VUXe:"7b68ee",VsprRggYF:"fa9a",VQe:"48d1cc",VviTetYd:"c71585",midnightXe:"191970",mRtcYam:"f5fffa",mistyPse:"ffe4e1",moccasR:"ffe4b5",navajowEte:"ffdead",navy:"80",Tdlace:"fdf5e6",Tive:"808000",TivedBb:"6b8e23",Sange:"ffa500",SangeYd:"ff4500",ScEd:"da70d6",pOegTMnPd:"eee8aa",pOegYF:"98fb98",pOeQe:"afeeee",pOeviTetYd:"db7093",papayawEp:"ffefd5",pHKpuff:"ffdab9",peru:"cd853f",pRk:"ffc0cb",plum:"dda0dd",powMrXe:"b0e0e6",purpN:"800080",YbeccapurpN:"663399",Yd:"ff0000",Psybrown:"bc8f8f",PyOXe:"4169e1",saddNbPwn:"8b4513",sOmon:"fa8072",sandybPwn:"f4a460",sHgYF:"2e8b57",sHshell:"fff5ee",siFna:"a0522d",silver:"c0c0c0",skyXe:"87ceeb",UXe:"6a5acd",UWay:"708090",UgYy:"708090",snow:"fffafa",sprRggYF:"ff7f",stAlXe:"4682b4",tan:"d2b48c",teO:"8080",tEstN:"d8bfd8",tomato:"ff6347",Qe:"40e0d0",viTet:"ee82ee",JHt:"f5deb3",wEte:"ffffff",wEtesmoke:"f5f5f5",Lw:"ffff00",LwgYF:"9acd32"};let A;const z=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/,O=t=>t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055,F=t=>t<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4);function H(t,e,i){if(t){let s=S(t);s[e]=Math.max(0,Math.min(s[e]+s[e]*i,0===e?360:1)),s=L(s),t.r=s[0],t.g=s[1],t.b=s[2]}}function I(t,e){return t?Object.assign(e||{},t):t}function B(t){var e={r:0,g:0,b:0,a:255};return Array.isArray(t)?t.length>=3&&(e={r:t[0],g:t[1],b:t[2],a:255},t.length>3&&(e.a=f(t[3]))):(e=I(t,{r:0,g:0,b:0,a:1})).a=f(e.a),e}function V(t){return"r"===t.charAt(0)?function(t){const e=z.exec(t);let i,s,n,o=255;if(e){if(e[7]!==i){const t=+e[7];o=e[8]?b(t):g(255*t,0,255)}return i=+e[1],s=+e[3],n=+e[5],i=255&(e[2]?b(i):g(i,0,255)),s=255&(e[4]?b(s):g(s,0,255)),n=255&(e[6]?b(n):g(n,0,255)),{r:i,g:s,b:n,a:o}}}(t):function(t){const e=E.exec(t);let i,s=255;if(!e)return;e[5]!==i&&(s=e[6]?b(+e[5]):f(+e[5]));const n=P(+e[2]),o=+e[3]/100,r=+e[4]/100;return i="hwb"===e[1]?function(t,e,i){return D(T,t,e,i)}(n,o,r):"hsv"===e[1]?function(t,e,i){return D(M,t,e,i)}(n,o,r):L(n,o,r),{r:i[0],g:i[1],b:i[2],a:s}}(t)}class W{constructor(t){if(t instanceof W)return t;const e=typeof t;let i;var s,n,o;"object"===e?i=B(t):"string"===e&&(o=(s=t).length,"#"===s[0]&&(4===o||5===o?n={r:255&17*y[s[1]],g:255&17*y[s[2]],b:255&17*y[s[3]],a:5===o?17*y[s[4]]:255}:7!==o&&9!==o||(n={r:y[s[1]]<<4|y[s[2]],g:y[s[3]]<<4|y[s[4]],b:y[s[5]]<<4|y[s[6]],a:9===o?y[s[7]]<<4|y[s[8]]:255})),i=n||function(t){A||(A=function(){const t={},e=Object.keys(N),i=Object.keys(j);let s,n,o,r,a;for(s=0;s<e.length;s++){for(r=a=e[s],n=0;n<i.length;n++)o=i[n],a=a.replace(o,j[o]);o=parseInt(N[r],16),t[a]=[o>>16&255,o>>8&255,255&o]}return t}(),A.transparent=[0,0,0,0]);const e=A[t.toLowerCase()];return e&&{r:e[0],g:e[1],b:e[2],a:4===e.length?e[3]:255}}(t)||V(t)),this._rgb=i,this._valid=!!i}get valid(){return this._valid}get rgb(){var t=I(this._rgb);return t&&(t.a=v(t.a)),t}set rgb(t){this._rgb=B(t)}rgbString(){return this._valid?(t=this._rgb)&&(t.a<255?`rgba(${t.r}, ${t.g}, ${t.b}, ${v(t.a)})`:`rgb(${t.r}, ${t.g}, ${t.b})`):void 0;var t}hexString(){return this._valid?(t=this._rgb,e=(t=>k(t.r)&&k(t.g)&&k(t.b)&&k(t.a))(t)?x:C,t?"#"+e(t.r)+e(t.g)+e(t.b)+((t,e)=>t<255?e(t):"")(t.a,e):void 0):void 0;var t,e}hslString(){return this._valid?function(t){if(!t)return;const e=S(t),i=e[0],s=w(e[1]),n=w(e[2]);return t.a<255?`hsla(${i}, ${s}%, ${n}%, ${v(t.a)})`:`hsl(${i}, ${s}%, ${n}%)`}(this._rgb):void 0}mix(t,e){if(t){const i=this.rgb,s=t.rgb;let n;const o=e===n?.5:e,r=2*o-1,a=i.a-s.a,l=((r*a===-1?r:(r+a)/(1+r*a))+1)/2;n=1-l,i.r=255&l*i.r+n*s.r+.5,i.g=255&l*i.g+n*s.g+.5,i.b=255&l*i.b+n*s.b+.5,i.a=o*i.a+(1-o)*s.a,this.rgb=i}return this}interpolate(t,e){return t&&(this._rgb=function(t,e,i){const s=F(v(t.r)),n=F(v(t.g)),o=F(v(t.b));return{r:f(O(s+i*(F(v(e.r))-s))),g:f(O(n+i*(F(v(e.g))-n))),b:f(O(o+i*(F(v(e.b))-o))),a:t.a+i*(e.a-t.a)}}(this._rgb,t._rgb,e)),this}clone(){return new W(this.rgb)}alpha(t){return this._rgb.a=f(t),this}clearer(t){return this._rgb.a*=1-t,this}greyscale(){const t=this._rgb,e=m(.3*t.r+.59*t.g+.11*t.b);return t.r=t.g=t.b=e,this}opaquer(t){return this._rgb.a*=1+t,this}negate(){const t=this._rgb;return t.r=255-t.r,t.g=255-t.g,t.b=255-t.b,this}lighten(t){return H(this._rgb,2,t),this}darken(t){return H(this._rgb,2,-t),this}saturate(t){return H(this._rgb,1,t),this}desaturate(t){return H(this._rgb,1,-t),this}rotate(t){return function(t,e){var i=S(t);i[0]=P(i[0]+e),i=L(i),t.r=i[0],t.g=i[1],t.b=i[2]}(this._rgb,t),this}}function G(){}const U=(()=>{let t=0;return()=>t++})();function $(t){return null==t}function Y(t){if(Array.isArray&&Array.isArray(t))return!0;const e=Object.prototype.toString.call(t);return"[object"===e.slice(0,7)&&"Array]"===e.slice(-6)}function K(t){return null!==t&&"[object Object]"===Object.prototype.toString.call(t)}function X(t){return("number"==typeof t||t instanceof Number)&&isFinite(+t)}function q(t,e){return X(t)?t:e}function J(t,e){return void 0===t?e:t}const Z=(t,e)=>"string"==typeof t&&t.endsWith("%")?parseFloat(t)/100*e:+t;function Q(t,e,i){if(t&&"function"==typeof t.call)return t.apply(i,e)}function tt(t,e,i,s){let n,o,r;if(Y(t))if(o=t.length,s)for(n=o-1;n>=0;n--)e.call(i,t[n],n);else for(n=0;n<o;n++)e.call(i,t[n],n);else if(K(t))for(r=Object.keys(t),o=r.length,n=0;n<o;n++)e.call(i,t[r[n]],r[n])}function et(t,e){let i,s,n,o;if(!t||!e||t.length!==e.length)return!1;for(i=0,s=t.length;i<s;++i)if(n=t[i],o=e[i],n.datasetIndex!==o.datasetIndex||n.index!==o.index)return!1;return!0}function it(t){if(Y(t))return t.map(it);if(K(t)){const e=Object.create(null),i=Object.keys(t),s=i.length;let n=0;for(;n<s;++n)e[i[n]]=it(t[i[n]]);return e}return t}function st(t){return-1===["__proto__","prototype","constructor"].indexOf(t)}function nt(t,e,i,s){if(!st(t))return;const n=e[t],o=i[t];K(n)&&K(o)?ot(n,o,s):e[t]=it(o)}function ot(t,e,i){const s=Y(e)?e:[e],n=s.length;if(!K(t))return t;const o=(i=i||{}).merger||nt;let r;for(let e=0;e<n;++e){if(r=s[e],!K(r))continue;const n=Object.keys(r);for(let e=0,s=n.length;e<s;++e)o(n[e],t,r,i)}return t}function rt(t,e){return ot(t,e,{merger:at})}function at(t,e,i){if(!st(t))return;const s=e[t],n=i[t];K(s)&&K(n)?rt(s,n):Object.prototype.hasOwnProperty.call(e,t)||(e[t]=it(n))}const lt={"":t=>t,x:t=>t.x,y:t=>t.y};function ht(t,e){const i=lt[e]||(lt[e]=function(t){const e=function(t){const e=t.split("."),i=[];let s="";for(const t of e)s+=t,s.endsWith("\\")?s=s.slice(0,-1)+".":(i.push(s),s="");return i}(t);return t=>{for(const i of e){if(""===i)break;t=t&&t[i]}return t}}(e));return i(t)}function ct(t){return t.charAt(0).toUpperCase()+t.slice(1)}const dt=t=>void 0!==t,ut=t=>"function"==typeof t,pt=(t,e)=>{if(t.size!==e.size)return!1;for(const i of t)if(!e.has(i))return!1;return!0},mt=Math.PI,gt=2*mt,bt=gt+mt,ft=Number.POSITIVE_INFINITY,vt=mt/180,wt=mt/2,yt=mt/4,_t=2*mt/3,xt=Math.log10,Ct=Math.sign;function kt(t,e,i){return Math.abs(t-e)<i}function Et(t){const e=Math.round(t);t=kt(t,e,t/1e3)?e:t;const i=Math.pow(10,Math.floor(xt(t))),s=t/i;return(s<=1?1:s<=2?2:s<=5?5:10)*i}function Rt(t){return!function(t){return"symbol"==typeof t||"object"==typeof t&&null!==t&&!(Symbol.toPrimitive in t||"toString"in t||"valueOf"in t)}(t)&&!isNaN(parseFloat(t))&&isFinite(t)}function Mt(t){return t*(mt/180)}function Tt(t){if(!X(t))return;let e=1,i=0;for(;Math.round(t*e)/e!==t;)e*=10,i++;return i}function St(t,e){const i=e.x-t.x,s=e.y-t.y,n=Math.sqrt(i*i+s*s);let o=Math.atan2(s,i);return o<-.5*mt&&(o+=gt),{angle:o,distance:n}}function Dt(t,e){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function Lt(t,e){return(t-e+bt)%gt-mt}function Pt(t){return(t%gt+gt)%gt}function jt(t,e,i,s){const n=Pt(t),o=Pt(e),r=Pt(i),a=Pt(o-n),l=Pt(r-n),h=Pt(n-o),c=Pt(n-r);return n===o||n===r||s&&o===r||a>l&&h<c}function Nt(t,e,i){return Math.max(e,Math.min(i,t))}function At(t,e,i,s=1e-6){return t>=Math.min(e,i)-s&&t<=Math.max(e,i)+s}function zt(t,e,i){i=i||(i=>t[i]<e);let s,n=t.length-1,o=0;for(;n-o>1;)s=o+n>>1,i(s)?o=s:n=s;return{lo:o,hi:n}}const Ot=(t,e,i,s)=>zt(t,i,s?s=>{const n=t[s][e];return n<i||n===i&&t[s+1][e]===i}:s=>t[s][e]<i),Ft=(t,e,i)=>zt(t,i,s=>t[s][e]>=i),Ht=["push","pop","shift","splice","unshift"];function It(t,e){const i=t._chartjs;if(!i)return;const s=i.listeners,n=s.indexOf(e);-1!==n&&s.splice(n,1),s.length>0||(Ht.forEach(e=>{delete t[e]}),delete t._chartjs)}const Bt="undefined"==typeof window?function(t){return t()}:window.requestAnimationFrame;function Vt(t,e){let i=[],s=!1;return function(...n){i=n,s||(s=!0,Bt.call(window,()=>{s=!1,t.apply(e,i)}))}}const Wt=t=>"start"===t?"left":"end"===t?"right":"center",Gt=(t,e,i)=>"start"===t?e:"end"===t?i:(e+i)/2,Ut=t=>0===t||1===t,$t=(t,e,i)=>-Math.pow(2,10*(t-=1))*Math.sin((t-e)*gt/i),Yt=(t,e,i)=>Math.pow(2,-10*t)*Math.sin((t-e)*gt/i)+1,Kt={linear:t=>t,easeInQuad:t=>t*t,easeOutQuad:t=>-t*(t-2),easeInOutQuad:t=>(t/=.5)<1?.5*t*t:-.5*(--t*(t-2)-1),easeInCubic:t=>t*t*t,easeOutCubic:t=>(t-=1)*t*t+1,easeInOutCubic:t=>(t/=.5)<1?.5*t*t*t:.5*((t-=2)*t*t+2),easeInQuart:t=>t*t*t*t,easeOutQuart:t=>-((t-=1)*t*t*t-1),easeInOutQuart:t=>(t/=.5)<1?.5*t*t*t*t:-.5*((t-=2)*t*t*t-2),easeInQuint:t=>t*t*t*t*t,easeOutQuint:t=>(t-=1)*t*t*t*t+1,easeInOutQuint:t=>(t/=.5)<1?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2),easeInSine:t=>1-Math.cos(t*wt),easeOutSine:t=>Math.sin(t*wt),easeInOutSine:t=>-.5*(Math.cos(mt*t)-1),easeInExpo:t=>0===t?0:Math.pow(2,10*(t-1)),easeOutExpo:t=>1===t?1:1-Math.pow(2,-10*t),easeInOutExpo:t=>Ut(t)?t:t<.5?.5*Math.pow(2,10*(2*t-1)):.5*(2-Math.pow(2,-10*(2*t-1))),easeInCirc:t=>t>=1?t:-(Math.sqrt(1-t*t)-1),easeOutCirc:t=>Math.sqrt(1-(t-=1)*t),easeInOutCirc:t=>(t/=.5)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1),easeInElastic:t=>Ut(t)?t:$t(t,.075,.3),easeOutElastic:t=>Ut(t)?t:Yt(t,.075,.3),easeInOutElastic(t){const e=.1125;return Ut(t)?t:t<.5?.5*$t(2*t,e,.45):.5+.5*Yt(2*t-1,e,.45)},easeInBack(t){const e=1.70158;return t*t*((e+1)*t-e)},easeOutBack(t){const e=1.70158;return(t-=1)*t*((e+1)*t+e)+1},easeInOutBack(t){let e=1.70158;return(t/=.5)<1?t*t*((1+(e*=1.525))*t-e)*.5:.5*((t-=2)*t*((1+(e*=1.525))*t+e)+2)},easeInBounce:t=>1-Kt.easeOutBounce(1-t),easeOutBounce(t){const e=7.5625,i=2.75;return t<1/i?e*t*t:t<2/i?e*(t-=1.5/i)*t+.75:t<2.5/i?e*(t-=2.25/i)*t+.9375:e*(t-=2.625/i)*t+.984375},easeInOutBounce:t=>t<.5?.5*Kt.easeInBounce(2*t):.5*Kt.easeOutBounce(2*t-1)+.5};function Xt(t){if(t&&"object"==typeof t){const e=t.toString();return"[object CanvasPattern]"===e||"[object CanvasGradient]"===e}return!1}function qt(t){return Xt(t)?t:new W(t)}function Jt(t){return Xt(t)?t:new W(t).saturate(.5).darken(.1).hexString()}const Zt=["x","y","borderWidth","radius","tension"],Qt=["color","borderColor","backgroundColor"],te=new Map;function ee(t,e,i){return function(t,e){e=e||{};const i=t+JSON.stringify(e);let s=te.get(i);return s||(s=new Intl.NumberFormat(t,e),te.set(i,s)),s}(e,i).format(t)}const ie={values:t=>Y(t)?t:""+t,numeric(t,e,i){if(0===t)return"0";const s=this.chart.options.locale;let n,o=t;if(i.length>1){const e=Math.max(Math.abs(i[0].value),Math.abs(i[i.length-1].value));(e<1e-4||e>1e15)&&(n="scientific"),o=function(t,e){let i=e.length>3?e[2].value-e[1].value:e[1].value-e[0].value;return Math.abs(i)>=1&&t!==Math.floor(t)&&(i=t-Math.floor(t)),i}(t,i)}const r=xt(Math.abs(o)),a=isNaN(r)?1:Math.max(Math.min(-1*Math.floor(r),20),0),l={notation:n,minimumFractionDigits:a,maximumFractionDigits:a};return Object.assign(l,this.options.ticks.format),ee(t,s,l)},logarithmic(t,e,i){if(0===t)return"0";const s=i[e].significand||t/Math.pow(10,Math.floor(xt(t)));return[1,2,3,5,10,15].includes(s)||e>.8*i.length?ie.numeric.call(this,t,e,i):""}};var se={formatters:ie};const ne=Object.create(null),oe=Object.create(null);function re(t,e){if(!e)return t;const i=e.split(".");for(let e=0,s=i.length;e<s;++e){const s=i[e];t=t[s]||(t[s]=Object.create(null))}return t}function ae(t,e,i){return"string"==typeof e?ot(re(t,e),i):ot(re(t,""),e)}class le{constructor(t,e){this.animation=void 0,this.backgroundColor="rgba(0,0,0,0.1)",this.borderColor="rgba(0,0,0,0.1)",this.color="#666",this.datasets={},this.devicePixelRatio=t=>t.chart.platform.getDevicePixelRatio(),this.elements={},this.events=["mousemove","mouseout","click","touchstart","touchmove"],this.font={family:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",size:12,style:"normal",lineHeight:1.2,weight:null},this.hover={},this.hoverBackgroundColor=(t,e)=>Jt(e.backgroundColor),this.hoverBorderColor=(t,e)=>Jt(e.borderColor),this.hoverColor=(t,e)=>Jt(e.color),this.indexAxis="x",this.interaction={mode:"nearest",intersect:!0,includeInvisible:!1},this.maintainAspectRatio=!0,this.onHover=null,this.onClick=null,this.parsing=!0,this.plugins={},this.responsive=!0,this.scale=void 0,this.scales={},this.showLine=!0,this.drawActiveElementsOnTop=!0,this.describe(t),this.apply(e)}set(t,e){return ae(this,t,e)}get(t){return re(this,t)}describe(t,e){return ae(oe,t,e)}override(t,e){return ae(ne,t,e)}route(t,e,i,s){const n=re(this,t),o=re(this,i),r="_"+e;Object.defineProperties(n,{[r]:{value:n[e],writable:!0},[e]:{enumerable:!0,get(){const t=this[r],e=o[s];return K(t)?Object.assign({},e,t):J(t,e)},set(t){this[r]=t}}})}apply(t){t.forEach(t=>t(this))}}var he=new le({_scriptable:t=>!t.startsWith("on"),_indexable:t=>"events"!==t,hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[function(t){t.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0}),t.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:t=>"onProgress"!==t&&"onComplete"!==t&&"fn"!==t}),t.set("animations",{colors:{type:"color",properties:Qt},numbers:{type:"number",properties:Zt}}),t.describe("animations",{_fallback:"animation"}),t.set("transitions",{active:{animation:{duration:400}},resize:{animation:{duration:0}},show:{animations:{colors:{from:"transparent"},visible:{type:"boolean",duration:0}}},hide:{animations:{colors:{to:"transparent"},visible:{type:"boolean",easing:"linear",fn:t=>0|t}}}})},function(t){t.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})},function(t){t.set("scale",{display:!0,offset:!1,reverse:!1,beginAtZero:!1,bounds:"ticks",clip:!0,grace:0,grid:{display:!0,lineWidth:1,drawOnChartArea:!0,drawTicks:!0,tickLength:8,tickWidth:(t,e)=>e.lineWidth,tickColor:(t,e)=>e.color,offset:!1},border:{display:!0,dash:[],dashOffset:0,width:1},title:{display:!1,text:"",padding:{top:4,bottom:4}},ticks:{minRotation:0,maxRotation:50,mirror:!1,textStrokeWidth:0,textStrokeColor:"",padding:3,display:!0,autoSkip:!0,autoSkipPadding:3,labelOffset:0,callback:se.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),t.route("scale.ticks","color","","color"),t.route("scale.grid","color","","borderColor"),t.route("scale.border","color","","borderColor"),t.route("scale.title","color","","color"),t.describe("scale",{_fallback:!1,_scriptable:t=>!t.startsWith("before")&&!t.startsWith("after")&&"callback"!==t&&"parser"!==t,_indexable:t=>"borderDash"!==t&&"tickBorderDash"!==t&&"dash"!==t}),t.describe("scales",{_fallback:"scale"}),t.describe("scale.ticks",{_scriptable:t=>"backdropPadding"!==t&&"callback"!==t,_indexable:t=>"backdropPadding"!==t})}]);function ce(t,e,i,s,n){let o=e[n];return o||(o=e[n]=t.measureText(n).width,i.push(n)),o>s&&(s=o),s}function de(t,e,i){const s=t.currentDevicePixelRatio,n=0!==i?Math.max(i/2,.5):0;return Math.round((e-n)*s)/s+n}function ue(t,e){(e||t)&&((e=e||t.getContext("2d")).save(),e.resetTransform(),e.clearRect(0,0,t.width,t.height),e.restore())}function pe(t,e,i,s){me(t,e,i,s,null)}function me(t,e,i,s,n){let o,r,a,l,h,c,d,u;const p=e.pointStyle,m=e.rotation,g=e.radius;let b=(m||0)*vt;if(p&&"object"==typeof p&&(o=p.toString(),"[object HTMLImageElement]"===o||"[object HTMLCanvasElement]"===o))return t.save(),t.translate(i,s),t.rotate(b),t.drawImage(p,-p.width/2,-p.height/2,p.width,p.height),void t.restore();if(!(isNaN(g)||g<=0)){switch(t.beginPath(),p){default:n?t.ellipse(i,s,n/2,g,0,0,gt):t.arc(i,s,g,0,gt),t.closePath();break;case"triangle":c=n?n/2:g,t.moveTo(i+Math.sin(b)*c,s-Math.cos(b)*g),b+=_t,t.lineTo(i+Math.sin(b)*c,s-Math.cos(b)*g),b+=_t,t.lineTo(i+Math.sin(b)*c,s-Math.cos(b)*g),t.closePath();break;case"rectRounded":h=.516*g,l=g-h,r=Math.cos(b+yt)*l,d=Math.cos(b+yt)*(n?n/2-h:l),a=Math.sin(b+yt)*l,u=Math.sin(b+yt)*(n?n/2-h:l),t.arc(i-d,s-a,h,b-mt,b-wt),t.arc(i+u,s-r,h,b-wt,b),t.arc(i+d,s+a,h,b,b+wt),t.arc(i-u,s+r,h,b+wt,b+mt),t.closePath();break;case"rect":if(!m){l=Math.SQRT1_2*g,c=n?n/2:l,t.rect(i-c,s-l,2*c,2*l);break}b+=yt;case"rectRot":d=Math.cos(b)*(n?n/2:g),r=Math.cos(b)*g,a=Math.sin(b)*g,u=Math.sin(b)*(n?n/2:g),t.moveTo(i-d,s-a),t.lineTo(i+u,s-r),t.lineTo(i+d,s+a),t.lineTo(i-u,s+r),t.closePath();break;case"crossRot":b+=yt;case"cross":d=Math.cos(b)*(n?n/2:g),r=Math.cos(b)*g,a=Math.sin(b)*g,u=Math.sin(b)*(n?n/2:g),t.moveTo(i-d,s-a),t.lineTo(i+d,s+a),t.moveTo(i+u,s-r),t.lineTo(i-u,s+r);break;case"star":d=Math.cos(b)*(n?n/2:g),r=Math.cos(b)*g,a=Math.sin(b)*g,u=Math.sin(b)*(n?n/2:g),t.moveTo(i-d,s-a),t.lineTo(i+d,s+a),t.moveTo(i+u,s-r),t.lineTo(i-u,s+r),b+=yt,d=Math.cos(b)*(n?n/2:g),r=Math.cos(b)*g,a=Math.sin(b)*g,u=Math.sin(b)*(n?n/2:g),t.moveTo(i-d,s-a),t.lineTo(i+d,s+a),t.moveTo(i+u,s-r),t.lineTo(i-u,s+r);break;case"line":r=n?n/2:Math.cos(b)*g,a=Math.sin(b)*g,t.moveTo(i-r,s-a),t.lineTo(i+r,s+a);break;case"dash":t.moveTo(i,s),t.lineTo(i+Math.cos(b)*(n?n/2:g),s+Math.sin(b)*g);break;case!1:t.closePath()}t.fill(),e.borderWidth>0&&t.stroke()}}function ge(t,e,i){return i=i||.5,!e||t&&t.x>e.left-i&&t.x<e.right+i&&t.y>e.top-i&&t.y<e.bottom+i}function be(t,e){t.save(),t.beginPath(),t.rect(e.left,e.top,e.right-e.left,e.bottom-e.top),t.clip()}function fe(t){t.restore()}function ve(t,e,i,s,n){if(!e)return t.lineTo(i.x,i.y);if("middle"===n){const s=(e.x+i.x)/2;t.lineTo(s,e.y),t.lineTo(s,i.y)}else"after"===n!=!!s?t.lineTo(e.x,i.y):t.lineTo(i.x,e.y);t.lineTo(i.x,i.y)}function we(t,e,i,s){if(!e)return t.lineTo(i.x,i.y);t.bezierCurveTo(s?e.cp1x:e.cp2x,s?e.cp1y:e.cp2y,s?i.cp2x:i.cp1x,s?i.cp2y:i.cp1y,i.x,i.y)}function ye(t,e,i,s,n){if(n.strikethrough||n.underline){const o=t.measureText(s),r=e-o.actualBoundingBoxLeft,a=e+o.actualBoundingBoxRight,l=i-o.actualBoundingBoxAscent,h=i+o.actualBoundingBoxDescent,c=n.strikethrough?(l+h)/2:h;t.strokeStyle=t.fillStyle,t.beginPath(),t.lineWidth=n.decorationWidth||2,t.moveTo(r,c),t.lineTo(a,c),t.stroke()}}function _e(t,e){const i=t.fillStyle;t.fillStyle=e.color,t.fillRect(e.left,e.top,e.width,e.height),t.fillStyle=i}function xe(t,e,i,s,n,o={}){const r=Y(e)?e:[e],a=o.strokeWidth>0&&""!==o.strokeColor;let l,h;for(t.save(),t.font=n.string,function(t,e){e.translation&&t.translate(e.translation[0],e.translation[1]),$(e.rotation)||t.rotate(e.rotation),e.color&&(t.fillStyle=e.color),e.textAlign&&(t.textAlign=e.textAlign),e.textBaseline&&(t.textBaseline=e.textBaseline)}(t,o),l=0;l<r.length;++l)h=r[l],o.backdrop&&_e(t,o.backdrop),a&&(o.strokeColor&&(t.strokeStyle=o.strokeColor),$(o.strokeWidth)||(t.lineWidth=o.strokeWidth),t.strokeText(h,i,s,o.maxWidth)),t.fillText(h,i,s,o.maxWidth),ye(t,i,s,h,o),s+=Number(n.lineHeight);t.restore()}function Ce(t,e){const{x:i,y:s,w:n,h:o,radius:r}=e;t.arc(i+r.topLeft,s+r.topLeft,r.topLeft,1.5*mt,mt,!0),t.lineTo(i,s+o-r.bottomLeft),t.arc(i+r.bottomLeft,s+o-r.bottomLeft,r.bottomLeft,mt,wt,!0),t.lineTo(i+n-r.bottomRight,s+o),t.arc(i+n-r.bottomRight,s+o-r.bottomRight,r.bottomRight,wt,0,!0),t.lineTo(i+n,s+r.topRight),t.arc(i+n-r.topRight,s+r.topRight,r.topRight,0,-wt,!0),t.lineTo(i+r.topLeft,s)}const ke=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,Ee=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;function Re(t,e){const i=(""+t).match(ke);if(!i||"normal"===i[1])return 1.2*e;switch(t=+i[2],i[3]){case"px":return t;case"%":t/=100}return e*t}const Me=t=>+t||0;function Te(t,e){const i={},s=K(e),n=s?Object.keys(e):e,o=K(t)?s?i=>J(t[i],t[e[i]]):e=>t[e]:()=>t;for(const t of n)i[t]=Me(o(t));return i}function Se(t){return Te(t,{top:"y",right:"x",bottom:"y",left:"x"})}function De(t){return Te(t,["topLeft","topRight","bottomLeft","bottomRight"])}function Le(t){const e=Se(t);return e.width=e.left+e.right,e.height=e.top+e.bottom,e}function Pe(t,e){t=t||{},e=e||he.font;let i=J(t.size,e.size);"string"==typeof i&&(i=parseInt(i,10));let s=J(t.style,e.style);s&&!(""+s).match(Ee)&&(console.warn('Invalid font style specified: "'+s+'"'),s=void 0);const n={family:J(t.family,e.family),lineHeight:Re(J(t.lineHeight,e.lineHeight),i),size:i,style:s,weight:J(t.weight,e.weight),string:""};return n.string=function(t){return!t||$(t.size)||$(t.family)?null:(t.style?t.style+" ":"")+(t.weight?t.weight+" ":"")+t.size+"px "+t.family}(n),n}function je(t,e,i,s){let n,o,r,a=!0;for(n=0,o=t.length;n<o;++n)if(r=t[n],void 0!==r&&(void 0!==e&&"function"==typeof r&&(r=r(e),a=!1),void 0!==i&&Y(r)&&(r=r[i%r.length],a=!1),void 0!==r))return s&&!a&&(s.cacheable=!1),r}function Ne(t,e){return Object.assign(Object.create(t),e)}function Ae(t,e=[""],i,s,n=()=>t[0]){const o=i||t;void 0===s&&(s=$e("_fallback",t));const r={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:t,_rootScopes:o,_fallback:s,_getTarget:n,override:i=>Ae([i,...t],e,o,s)};return new Proxy(r,{deleteProperty:(e,i)=>(delete e[i],delete e._keys,delete t[0][i],!0),get:(i,s)=>Ie(i,s,()=>function(t,e,i,s){let n;for(const o of e)if(n=$e(Fe(o,t),i),void 0!==n)return He(t,n)?Ge(i,s,t,n):n}(s,e,t,i)),getOwnPropertyDescriptor:(t,e)=>Reflect.getOwnPropertyDescriptor(t._scopes[0],e),getPrototypeOf:()=>Reflect.getPrototypeOf(t[0]),has:(t,e)=>Ye(t).includes(e),ownKeys:t=>Ye(t),set(t,e,i){const s=t._storage||(t._storage=n());return t[e]=s[e]=i,delete t._keys,!0}})}function ze(t,e,i,s){const n={_cacheable:!1,_proxy:t,_context:e,_subProxy:i,_stack:new Set,_descriptors:Oe(t,s),setContext:e=>ze(t,e,i,s),override:n=>ze(t.override(n),e,i,s)};return new Proxy(n,{deleteProperty:(e,i)=>(delete e[i],delete t[i],!0),get:(t,e,i)=>Ie(t,e,()=>function(t,e,i){const{_proxy:s,_context:n,_subProxy:o,_descriptors:r}=t;let a=s[e];return ut(a)&&r.isScriptable(e)&&(a=function(t,e,i,s){const{_proxy:n,_context:o,_subProxy:r,_stack:a}=i;if(a.has(t))throw new Error("Recursion detected: "+Array.from(a).join("->")+"->"+t);a.add(t);let l=e(o,r||s);return a.delete(t),He(t,l)&&(l=Ge(n._scopes,n,t,l)),l}(e,a,t,i)),Y(a)&&a.length&&(a=function(t,e,i,s){const{_proxy:n,_context:o,_subProxy:r,_descriptors:a}=i;if(void 0!==o.index&&s(t))return e[o.index%e.length];if(K(e[0])){const i=e,s=n._scopes.filter(t=>t!==i);e=[];for(const l of i){const i=Ge(s,n,t,l);e.push(ze(i,o,r&&r[t],a))}}return e}(e,a,t,r.isIndexable)),He(e,a)&&(a=ze(a,n,o&&o[e],r)),a}(t,e,i)),getOwnPropertyDescriptor:(e,i)=>e._descriptors.allKeys?Reflect.has(t,i)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(t,i),getPrototypeOf:()=>Reflect.getPrototypeOf(t),has:(e,i)=>Reflect.has(t,i),ownKeys:()=>Reflect.ownKeys(t),set:(e,i,s)=>(t[i]=s,delete e[i],!0)})}function Oe(t,e={scriptable:!0,indexable:!0}){const{_scriptable:i=e.scriptable,_indexable:s=e.indexable,_allKeys:n=e.allKeys}=t;return{allKeys:n,scriptable:i,indexable:s,isScriptable:ut(i)?i:()=>i,isIndexable:ut(s)?s:()=>s}}const Fe=(t,e)=>t?t+ct(e):e,He=(t,e)=>K(e)&&"adapters"!==t&&(null===Object.getPrototypeOf(e)||e.constructor===Object);function Ie(t,e,i){if(Object.prototype.hasOwnProperty.call(t,e)||"constructor"===e)return t[e];const s=i();return t[e]=s,s}function Be(t,e,i){return ut(t)?t(e,i):t}const Ve=(t,e)=>!0===t?e:"string"==typeof t?ht(e,t):void 0;function We(t,e,i,s,n){for(const o of e){const e=Ve(i,o);if(e){t.add(e);const o=Be(e._fallback,i,n);if(void 0!==o&&o!==i&&o!==s)return o}else if(!1===e&&void 0!==s&&i!==s)return null}return!1}function Ge(t,e,i,s){const n=e._rootScopes,o=Be(e._fallback,i,s),r=[...t,...n],a=new Set;a.add(s);let l=Ue(a,r,i,o||i,s);return null!==l&&(void 0===o||o===i||(l=Ue(a,r,o,l,s),null!==l))&&Ae(Array.from(a),[""],n,o,()=>function(t,e,i){const s=t._getTarget();e in s||(s[e]={});const n=s[e];return Y(n)&&K(i)?i:n||{}}(e,i,s))}function Ue(t,e,i,s,n){for(;i;)i=We(t,e,i,s,n);return i}function $e(t,e){for(const i of e){if(!i)continue;const e=i[t];if(void 0!==e)return e}}function Ye(t){let e=t._keys;return e||(e=t._keys=function(t){const e=new Set;for(const i of t)for(const t of Object.keys(i).filter(t=>!t.startsWith("_")))e.add(t);return Array.from(e)}(t._scopes)),e}const Ke=Number.EPSILON||1e-14,Xe=(t,e)=>e<t.length&&!t[e].skip&&t[e],qe=t=>"x"===t?"y":"x";function Je(t,e,i,s){const n=t.skip?e:t,o=e,r=i.skip?e:i,a=Dt(o,n),l=Dt(r,o);let h=a/(a+l),c=l/(a+l);h=isNaN(h)?0:h,c=isNaN(c)?0:c;const d=s*h,u=s*c;return{previous:{x:o.x-d*(r.x-n.x),y:o.y-d*(r.y-n.y)},next:{x:o.x+u*(r.x-n.x),y:o.y+u*(r.y-n.y)}}}function Ze(t,e,i){return Math.max(Math.min(t,i),e)}function Qe(t,e,i,s,n){let o,r,a,l;if(e.spanGaps&&(t=t.filter(t=>!t.skip)),"monotone"===e.cubicInterpolationMode)!function(t,e="x"){const i=qe(e),s=t.length,n=Array(s).fill(0),o=Array(s);let r,a,l,h=Xe(t,0);for(r=0;r<s;++r)if(a=l,l=h,h=Xe(t,r+1),l){if(h){const t=h[e]-l[e];n[r]=0!==t?(h[i]-l[i])/t:0}o[r]=a?h?Ct(n[r-1])!==Ct(n[r])?0:(n[r-1]+n[r])/2:n[r-1]:n[r]}!function(t,e,i){const s=t.length;let n,o,r,a,l,h=Xe(t,0);for(let c=0;c<s-1;++c)l=h,h=Xe(t,c+1),l&&h&&(kt(e[c],0,Ke)?i[c]=i[c+1]=0:(n=i[c]/e[c],o=i[c+1]/e[c],a=Math.pow(n,2)+Math.pow(o,2),a<=9||(r=3/Math.sqrt(a),i[c]=n*r*e[c],i[c+1]=o*r*e[c])))}(t,n,o),function(t,e,i="x"){const s=qe(i),n=t.length;let o,r,a,l=Xe(t,0);for(let h=0;h<n;++h){if(r=a,a=l,l=Xe(t,h+1),!a)continue;const n=a[i],c=a[s];r&&(o=(n-r[i])/3,a[`cp1${i}`]=n-o,a[`cp1${s}`]=c-o*e[h]),l&&(o=(l[i]-n)/3,a[`cp2${i}`]=n+o,a[`cp2${s}`]=c+o*e[h])}}(t,o,e)}(t,n);else{let i=s?t[t.length-1]:t[0];for(o=0,r=t.length;o<r;++o)a=t[o],l=Je(i,a,t[Math.min(o+1,r-(s?0:1))%r],e.tension),a.cp1x=l.previous.x,a.cp1y=l.previous.y,a.cp2x=l.next.x,a.cp2y=l.next.y,i=a}e.capBezierPoints&&function(t,e){let i,s,n,o,r,a=ge(t[0],e);for(i=0,s=t.length;i<s;++i)r=o,o=a,a=i<s-1&&ge(t[i+1],e),o&&(n=t[i],r&&(n.cp1x=Ze(n.cp1x,e.left,e.right),n.cp1y=Ze(n.cp1y,e.top,e.bottom)),a&&(n.cp2x=Ze(n.cp2x,e.left,e.right),n.cp2y=Ze(n.cp2y,e.top,e.bottom)))}(t,i)}function ti(){return"undefined"!=typeof window&&"undefined"!=typeof document}function ei(t){let e=t.parentNode;return e&&"[object ShadowRoot]"===e.toString()&&(e=e.host),e}function ii(t,e,i){let s;return"string"==typeof t?(s=parseInt(t,10),-1!==t.indexOf("%")&&(s=s/100*e.parentNode[i])):s=t,s}const si=t=>t.ownerDocument.defaultView.getComputedStyle(t,null),ni=["top","right","bottom","left"];function oi(t,e,i){const s={};i=i?"-"+i:"";for(let n=0;n<4;n++){const o=ni[n];s[o]=parseFloat(t[e+"-"+o+i])||0}return s.width=s.left+s.right,s.height=s.top+s.bottom,s}function ri(t,e){if("native"in t)return t;const{canvas:i,currentDevicePixelRatio:s}=e,n=si(i),o="border-box"===n.boxSizing,r=oi(n,"padding"),a=oi(n,"border","width"),{x:l,y:h,box:c}=function(t,e){const i=t.touches,s=i&&i.length?i[0]:t,{offsetX:n,offsetY:o}=s;let r,a,l=!1;if(((t,e,i)=>(t>0||e>0)&&(!i||!i.shadowRoot))(n,o,t.target))r=n,a=o;else{const t=e.getBoundingClientRect();r=s.clientX-t.left,a=s.clientY-t.top,l=!0}return{x:r,y:a,box:l}}(t,i),d=r.left+(c&&a.left),u=r.top+(c&&a.top);let{width:p,height:m}=e;return o&&(p-=r.width+a.width,m-=r.height+a.height),{x:Math.round((l-d)/p*i.width/s),y:Math.round((h-u)/m*i.height/s)}}const ai=t=>Math.round(10*t)/10;function li(t,e,i){const s=e||1,n=ai(t.height*s),o=ai(t.width*s);t.height=ai(t.height),t.width=ai(t.width);const r=t.canvas;return r.style&&(i||!r.style.height&&!r.style.width)&&(r.style.height=`${t.height}px`,r.style.width=`${t.width}px`),(t.currentDevicePixelRatio!==s||r.height!==n||r.width!==o)&&(t.currentDevicePixelRatio=s,r.height=n,r.width=o,t.ctx.setTransform(s,0,0,s,0,0),!0)}const hi=function(){let t=!1;try{const e={get passive(){return t=!0,!1}};ti()&&(window.addEventListener("test",null,e),window.removeEventListener("test",null,e))}catch(t){}return t}();function ci(t,e){const i=function(t,e){return si(t).getPropertyValue(e)}(t,e),s=i&&i.match(/^(\d+)(\.\d+)?px$/);return s?+s[1]:void 0}function di(t,e,i,s){return{x:t.x+i*(e.x-t.x),y:t.y+i*(e.y-t.y)}}function ui(t,e,i,s){return{x:t.x+i*(e.x-t.x),y:"middle"===s?i<.5?t.y:e.y:"after"===s?i<1?t.y:e.y:i>0?e.y:t.y}}function pi(t,e,i,s){const n={x:t.cp2x,y:t.cp2y},o={x:e.cp1x,y:e.cp1y},r=di(t,n,i),a=di(n,o,i),l=di(o,e,i),h=di(r,a,i),c=di(a,l,i);return di(h,c,i)}function mi(t,e,i){return t?function(t,e){return{x:i=>t+t+e-i,setWidth(t){e=t},textAlign:t=>"center"===t?t:"right"===t?"left":"right",xPlus:(t,e)=>t-e,leftForLtr:(t,e)=>t-e}}(e,i):{x:t=>t,setWidth(t){},textAlign:t=>t,xPlus:(t,e)=>t+e,leftForLtr:(t,e)=>t}}function gi(t,e){let i,s;"ltr"!==e&&"rtl"!==e||(i=t.canvas.style,s=[i.getPropertyValue("direction"),i.getPropertyPriority("direction")],i.setProperty("direction",e,"important"),t.prevTextDirection=s)}function bi(t,e){void 0!==e&&(delete t.prevTextDirection,t.canvas.style.setProperty("direction",e[0],e[1]))}function fi(t){return"angle"===t?{between:jt,compare:Lt,normalize:Pt}:{between:At,compare:(t,e)=>t-e,normalize:t=>t}}function vi({start:t,end:e,count:i,loop:s,style:n}){return{start:t%i,end:e%i,loop:s&&(e-t+1)%i==0,style:n}}function wi(t,e,i){if(!i)return[t];const{property:s,start:n,end:o}=i,r=e.length,{compare:a,between:l,normalize:h}=fi(s),{start:c,end:d,loop:u,style:p}=function(t,e,i){const{property:s,start:n,end:o}=i,{between:r,normalize:a}=fi(s),l=e.length;let h,c,{start:d,end:u,loop:p}=t;if(p){for(d+=l,u+=l,h=0,c=l;h<c&&r(a(e[d%l][s]),n,o);++h)d--,u--;d%=l,u%=l}return u<d&&(u+=l),{start:d,end:u,loop:p,style:t.style}}(t,e,i),m=[];let g,b,f,v=!1,w=null;const y=()=>v||l(n,f,g)&&0!==a(n,f),_=()=>!v||0===a(o,g)||l(o,f,g);for(let t=c,i=c;t<=d;++t)b=e[t%r],b.skip||(g=h(b[s]),g!==f&&(v=l(g,n,o),null===w&&y()&&(w=0===a(g,n)?t:i),null!==w&&_()&&(m.push(vi({start:w,end:t,loop:u,count:r,style:p})),w=null),i=t,f=g));return null!==w&&m.push(vi({start:w,end:d,loop:u,count:r,style:p})),m}function yi(t,e){const i=[],s=t.segments;for(let n=0;n<s.length;n++){const o=wi(s[n],t.points,e);o.length&&i.push(...o)}return i}function _i(t){return{backgroundColor:t.backgroundColor,borderCapStyle:t.borderCapStyle,borderDash:t.borderDash,borderDashOffset:t.borderDashOffset,borderJoinStyle:t.borderJoinStyle,borderWidth:t.borderWidth,borderColor:t.borderColor}}function xi(t,e){if(!e)return!1;const i=[],s=function(t,e){return Xt(e)?(i.includes(e)||i.push(e),i.indexOf(e)):e};return JSON.stringify(t,s)!==JSON.stringify(e,s)}function Ci(t,e,i){return t.options.clip?t[i]:e[i]}function ki(t,e){const i=e._clip;if(i.disabled)return!1;const s=function(t,e){const{xScale:i,yScale:s}=t;return i&&s?{left:Ci(i,e,"left"),right:Ci(i,e,"right"),top:Ci(s,e,"top"),bottom:Ci(s,e,"bottom")}:e}(e,t.chartArea);return{left:!1===i.left?0:s.left-(!0===i.left?0:i.left),right:!1===i.right?t.width:s.right+(!0===i.right?0:i.right),top:!1===i.top?0:s.top-(!0===i.top?0:i.top),bottom:!1===i.bottom?t.height:s.bottom+(!0===i.bottom?0:i.bottom)}}class Ei{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(t,e,i,s){const n=e.listeners[s],o=e.duration;n.forEach(s=>s({chart:t,initial:e.initial,numSteps:o,currentStep:Math.min(i-e.start,o)}))}_refresh(){this._request||(this._running=!0,this._request=Bt.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(t=Date.now()){let e=0;this._charts.forEach((i,s)=>{if(!i.running||!i.items.length)return;const n=i.items;let o,r=n.length-1,a=!1;for(;r>=0;--r)o=n[r],o._active?(o._total>i.duration&&(i.duration=o._total),o.tick(t),a=!0):(n[r]=n[n.length-1],n.pop());a&&(s.draw(),this._notify(s,i,t,"progress")),n.length||(i.running=!1,this._notify(s,i,t,"complete"),i.initial=!1),e+=n.length}),this._lastDate=t,0===e&&(this._running=!1)}_getAnims(t){const e=this._charts;let i=e.get(t);return i||(i={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},e.set(t,i)),i}listen(t,e,i){this._getAnims(t).listeners[e].push(i)}add(t,e){e&&e.length&&this._getAnims(t).items.push(...e)}has(t){return this._getAnims(t).items.length>0}start(t){const e=this._charts.get(t);e&&(e.running=!0,e.start=Date.now(),e.duration=e.items.reduce((t,e)=>Math.max(t,e._duration),0),this._refresh())}running(t){if(!this._running)return!1;const e=this._charts.get(t);return!!(e&&e.running&&e.items.length)}stop(t){const e=this._charts.get(t);if(!e||!e.items.length)return;const i=e.items;let s=i.length-1;for(;s>=0;--s)i[s].cancel();e.items=[],this._notify(t,e,Date.now(),"complete")}remove(t){return this._charts.delete(t)}}var Ri=new Ei;const Mi="transparent",Ti={boolean:(t,e,i)=>i>.5?e:t,color(t,e,i){const s=qt(t||Mi),n=s.valid&&qt(e||Mi);return n&&n.valid?n.mix(s,i).hexString():e},number:(t,e,i)=>t+(e-t)*i};class Si{constructor(t,e,i,s){const n=e[i];s=je([t.to,s,n,t.from]);const o=je([t.from,n,s]);this._active=!0,this._fn=t.fn||Ti[t.type||typeof o],this._easing=Kt[t.easing]||Kt.linear,this._start=Math.floor(Date.now()+(t.delay||0)),this._duration=this._total=Math.floor(t.duration),this._loop=!!t.loop,this._target=e,this._prop=i,this._from=o,this._to=s,this._promises=void 0}active(){return this._active}update(t,e,i){if(this._active){this._notify(!1);const s=this._target[this._prop],n=i-this._start,o=this._duration-n;this._start=i,this._duration=Math.floor(Math.max(o,t.duration)),this._total+=n,this._loop=!!t.loop,this._to=je([t.to,e,s,t.from]),this._from=je([t.from,s,e])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){const e=t-this._start,i=this._duration,s=this._prop,n=this._from,o=this._loop,r=this._to;let a;if(this._active=n!==r&&(o||e<i),!this._active)return this._target[s]=r,void this._notify(!0);e<0?this._target[s]=n:(a=e/i%2,a=o&&a>1?2-a:a,a=this._easing(Math.min(1,Math.max(0,a))),this._target[s]=this._fn(n,r,a))}wait(){const t=this._promises||(this._promises=[]);return new Promise((e,i)=>{t.push({res:e,rej:i})})}_notify(t){const e=t?"res":"rej",i=this._promises||[];for(let t=0;t<i.length;t++)i[t][e]()}}class Di{constructor(t,e){this._chart=t,this._properties=new Map,this.configure(e)}configure(t){if(!K(t))return;const e=Object.keys(he.animation),i=this._properties;Object.getOwnPropertyNames(t).forEach(s=>{const n=t[s];if(!K(n))return;const o={};for(const t of e)o[t]=n[t];(Y(n.properties)&&n.properties||[s]).forEach(t=>{t!==s&&i.has(t)||i.set(t,o)})})}_animateOptions(t,e){const i=e.options,s=function(t,e){if(!e)return;let i=t.options;if(i)return i.$shared&&(t.options=i=Object.assign({},i,{$shared:!1,$animations:{}})),i;t.options=e}(t,i);if(!s)return[];const n=this._createAnimations(s,i);return i.$shared&&function(t,e){const i=[],s=Object.keys(e);for(let e=0;e<s.length;e++){const n=t[s[e]];n&&n.active()&&i.push(n.wait())}return Promise.all(i)}(t.options.$animations,i).then(()=>{t.options=i},()=>{}),n}_createAnimations(t,e){const i=this._properties,s=[],n=t.$animations||(t.$animations={}),o=Object.keys(e),r=Date.now();let a;for(a=o.length-1;a>=0;--a){const l=o[a];if("$"===l.charAt(0))continue;if("options"===l){s.push(...this._animateOptions(t,e));continue}const h=e[l];let c=n[l];const d=i.get(l);if(c){if(d&&c.active()){c.update(d,h,r);continue}c.cancel()}d&&d.duration?(n[l]=c=new Si(d,t,l,h),s.push(c)):t[l]=h}return s}update(t,e){if(0===this._properties.size)return void Object.assign(t,e);const i=this._createAnimations(t,e);return i.length?(Ri.add(this._chart,i),!0):void 0}}function Li(t,e){const i=t&&t.options||{},s=i.reverse,n=void 0===i.min?e:0,o=void 0===i.max?e:0;return{start:s?o:n,end:s?n:o}}function Pi(t,e){const i=[],s=t._getSortedDatasetMetas(e);let n,o;for(n=0,o=s.length;n<o;++n)i.push(s[n].index);return i}function ji(t,e,i,s={}){const n=t.keys,o="single"===s.mode;let r,a,l,h;if(null===e)return;let c=!1;for(r=0,a=n.length;r<a;++r){if(l=+n[r],l===i){if(c=!0,s.all)continue;break}h=t.values[l],X(h)&&(o||0===e||Ct(e)===Ct(h))&&(e+=h)}return c||s.all?e:0}function Ni(t,e){const i=t&&t.options.stacked;return i||void 0===i&&void 0!==e.stack}function Ai(t,e,i){const s=t[e]||(t[e]={});return s[i]||(s[i]={})}function zi(t,e,i,s){for(const n of e.getMatchingVisibleMetas(s).reverse()){const e=t[n.index];if(i&&e>0||!i&&e<0)return n.index}return null}function Oi(t,e){const{chart:i,_cachedMeta:s}=t,n=i._stacks||(i._stacks={}),{iScale:o,vScale:r,index:a}=s,l=o.axis,h=r.axis,c=function(t,e,i){return`${t.id}.${e.id}.${i.stack||i.type}`}(o,r,s),d=e.length;let u;for(let t=0;t<d;++t){const i=e[t],{[l]:o,[h]:d}=i;u=(i._stacks||(i._stacks={}))[h]=Ai(n,c,o),u[a]=d,u._top=zi(u,r,!0,s.type),u._bottom=zi(u,r,!1,s.type),(u._visualValues||(u._visualValues={}))[a]=d}}function Fi(t,e){const i=t.scales;return Object.keys(i).filter(t=>i[t].axis===e).shift()}function Hi(t,e){const i=t.controller.index,s=t.vScale&&t.vScale.axis;if(s){e=e||t._parsed;for(const t of e){const e=t._stacks;if(!e||void 0===e[s]||void 0===e[s][i])return;delete e[s][i],void 0!==e[s]._visualValues&&void 0!==e[s]._visualValues[i]&&delete e[s]._visualValues[i]}}}const Ii=t=>"reset"===t||"none"===t,Bi=(t,e)=>e?t:Object.assign({},t);class Vi{static defaults={};static datasetElementType=null;static dataElementType=null;constructor(t,e){this.chart=t,this._ctx=t.ctx,this.index=e,this._cachedDataOpts={},this._cachedMeta=this.getMeta(),this._type=this._cachedMeta.type,this.options=void 0,this._parsing=!1,this._data=void 0,this._objectData=void 0,this._sharedOptions=void 0,this._drawStart=void 0,this._drawCount=void 0,this.enableOptionSharing=!1,this.supportsDecimation=!1,this.$context=void 0,this._syncList=[],this.datasetElementType=new.target.datasetElementType,this.dataElementType=new.target.dataElementType,this.initialize()}initialize(){const t=this._cachedMeta;this.configure(),this.linkScales(),t._stacked=Ni(t.vScale,t),this.addElements(),this.options.fill&&!this.chart.isPluginEnabled("filler")&&console.warn("Tried to use the 'fill' option without the 'Filler' plugin enabled. Please import and register the 'Filler' plugin and make sure it is not disabled in the options")}updateIndex(t){this.index!==t&&Hi(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,e=this._cachedMeta,i=this.getDataset(),s=(t,e,i,s)=>"x"===t?e:"r"===t?s:i,n=e.xAxisID=J(i.xAxisID,Fi(t,"x")),o=e.yAxisID=J(i.yAxisID,Fi(t,"y")),r=e.rAxisID=J(i.rAxisID,Fi(t,"r")),a=e.indexAxis,l=e.iAxisID=s(a,n,o,r),h=e.vAxisID=s(a,o,n,r);e.xScale=this.getScaleForId(n),e.yScale=this.getScaleForId(o),e.rScale=this.getScaleForId(r),e.iScale=this.getScaleForId(l),e.vScale=this.getScaleForId(h)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(t){return this.chart.scales[t]}_getOtherScale(t){const e=this._cachedMeta;return t===e.iScale?e.vScale:e.iScale}reset(){this._update("reset")}_destroy(){const t=this._cachedMeta;this._data&&It(this._data,this),t._stacked&&Hi(t)}_dataCheck(){const t=this.getDataset(),e=t.data||(t.data=[]),i=this._data;if(K(e)){const t=this._cachedMeta;this._data=function(t,e){const{iScale:i,vScale:s}=e,n="x"===i.axis?"x":"y",o="x"===s.axis?"x":"y",r=Object.keys(t),a=new Array(r.length);let l,h,c;for(l=0,h=r.length;l<h;++l)c=r[l],a[l]={[n]:c,[o]:t[c]};return a}(e,t)}else if(i!==e){if(i){It(i,this);const t=this._cachedMeta;Hi(t),t._parsed=[]}e&&Object.isExtensible(e)&&(n=this,(s=e)._chartjs?s._chartjs.listeners.push(n):(Object.defineProperty(s,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[n]}}),Ht.forEach(t=>{const e="_onData"+ct(t),i=s[t];Object.defineProperty(s,t,{configurable:!0,enumerable:!1,value(...t){const n=i.apply(this,t);return s._chartjs.listeners.forEach(i=>{"function"==typeof i[e]&&i[e](...t)}),n}})}))),this._syncList=[],this._data=e}var s,n}addElements(){const t=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(t.dataset=new this.datasetElementType)}buildOrUpdateElements(t){const e=this._cachedMeta,i=this.getDataset();let s=!1;this._dataCheck();const n=e._stacked;e._stacked=Ni(e.vScale,e),e.stack!==i.stack&&(s=!0,Hi(e),e.stack=i.stack),this._resyncElements(t),(s||n!==e._stacked)&&(Oi(this,e._parsed),e._stacked=Ni(e.vScale,e))}configure(){const t=this.chart.config,e=t.datasetScopeKeys(this._type),i=t.getOptionScopes(this.getDataset(),e,!0);this.options=t.createResolver(i,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(t,e){const{_cachedMeta:i,_data:s}=this,{iScale:n,_stacked:o}=i,r=n.axis;let a,l,h,c=0===t&&e===s.length||i._sorted,d=t>0&&i._parsed[t-1];if(!1===this._parsing)i._parsed=s,i._sorted=!0,h=s;else{h=Y(s[t])?this.parseArrayData(i,s,t,e):K(s[t])?this.parseObjectData(i,s,t,e):this.parsePrimitiveData(i,s,t,e);const n=()=>null===l[r]||d&&l[r]<d[r];for(a=0;a<e;++a)i._parsed[a+t]=l=h[a],c&&(n()&&(c=!1),d=l);i._sorted=c}o&&Oi(this,h)}parsePrimitiveData(t,e,i,s){const{iScale:n,vScale:o}=t,r=n.axis,a=o.axis,l=n.getLabels(),h=n===o,c=new Array(s);let d,u,p;for(d=0,u=s;d<u;++d)p=d+i,c[d]={[r]:h||n.parse(l[p],p),[a]:o.parse(e[p],p)};return c}parseArrayData(t,e,i,s){const{xScale:n,yScale:o}=t,r=new Array(s);let a,l,h,c;for(a=0,l=s;a<l;++a)h=a+i,c=e[h],r[a]={x:n.parse(c[0],h),y:o.parse(c[1],h)};return r}parseObjectData(t,e,i,s){const{xScale:n,yScale:o}=t,{xAxisKey:r="x",yAxisKey:a="y"}=this._parsing,l=new Array(s);let h,c,d,u;for(h=0,c=s;h<c;++h)d=h+i,u=e[d],l[h]={x:n.parse(ht(u,r),d),y:o.parse(ht(u,a),d)};return l}getParsed(t){return this._cachedMeta._parsed[t]}getDataElement(t){return this._cachedMeta.data[t]}applyStack(t,e,i){const s=this.chart,n=this._cachedMeta,o=e[t.axis];return ji({keys:Pi(s,!0),values:e._stacks[t.axis]._visualValues},o,n.index,{mode:i})}updateRangeFromParsed(t,e,i,s){const n=i[e.axis];let o=null===n?NaN:n;const r=s&&i._stacks[e.axis];s&&r&&(s.values=r,o=ji(s,n,this._cachedMeta.index)),t.min=Math.min(t.min,o),t.max=Math.max(t.max,o)}getMinMax(t,e){const i=this._cachedMeta,s=i._parsed,n=i._sorted&&t===i.iScale,o=s.length,r=this._getOtherScale(t),a=((t,e,i)=>t&&!e.hidden&&e._stacked&&{keys:Pi(i,!0),values:null})(e,i,this.chart),l={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:h,max:c}=function(t){const{min:e,max:i,minDefined:s,maxDefined:n}=t.getUserBounds();return{min:s?e:Number.NEGATIVE_INFINITY,max:n?i:Number.POSITIVE_INFINITY}}(r);let d,u;function p(){u=s[d];const e=u[r.axis];return!X(u[t.axis])||h>e||c<e}for(d=0;d<o&&(p()||(this.updateRangeFromParsed(l,t,u,a),!n));++d);if(n)for(d=o-1;d>=0;--d)if(!p()){this.updateRangeFromParsed(l,t,u,a);break}return l}getAllParsedValues(t){const e=this._cachedMeta._parsed,i=[];let s,n,o;for(s=0,n=e.length;s<n;++s)o=e[s][t.axis],X(o)&&i.push(o);return i}getMaxOverflow(){return!1}getLabelAndValue(t){const e=this._cachedMeta,i=e.iScale,s=e.vScale,n=this.getParsed(t);return{label:i?""+i.getLabelForValue(n[i.axis]):"",value:s?""+s.getLabelForValue(n[s.axis]):""}}_update(t){const e=this._cachedMeta;this.update(t||"default"),e._clip=function(t){let e,i,s,n;return K(t)?(e=t.top,i=t.right,s=t.bottom,n=t.left):e=i=s=n=t,{top:e,right:i,bottom:s,left:n,disabled:!1===t}}(J(this.options.clip,function(t,e,i){if(!1===i)return!1;const s=Li(t,i),n=Li(e,i);return{top:n.end,right:s.end,bottom:n.start,left:s.start}}(e.xScale,e.yScale,this.getMaxOverflow())))}update(t){}draw(){const t=this._ctx,e=this.chart,i=this._cachedMeta,s=i.data||[],n=e.chartArea,o=[],r=this._drawStart||0,a=this._drawCount||s.length-r,l=this.options.drawActiveElementsOnTop;let h;for(i.dataset&&i.dataset.draw(t,n,r,a),h=r;h<r+a;++h){const e=s[h];e.hidden||(e.active&&l?o.push(e):e.draw(t,n))}for(h=0;h<o.length;++h)o[h].draw(t,n)}getStyle(t,e){const i=e?"active":"default";return void 0===t&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(i):this.resolveDataElementOptions(t||0,i)}getContext(t,e,i){const s=this.getDataset();let n;if(t>=0&&t<this._cachedMeta.data.length){const e=this._cachedMeta.data[t];n=e.$context||(e.$context=function(t,e,i){return Ne(t,{active:!1,dataIndex:e,parsed:void 0,raw:void 0,element:i,index:e,mode:"default",type:"data"})}(this.getContext(),t,e)),n.parsed=this.getParsed(t),n.raw=s.data[t],n.index=n.dataIndex=t}else n=this.$context||(this.$context=function(t,e){return Ne(t,{active:!1,dataset:void 0,datasetIndex:e,index:e,mode:"default",type:"dataset"})}(this.chart.getContext(),this.index)),n.dataset=s,n.index=n.datasetIndex=this.index;return n.active=!!e,n.mode=i,n}resolveDatasetElementOptions(t){return this._resolveElementOptions(this.datasetElementType.id,t)}resolveDataElementOptions(t,e){return this._resolveElementOptions(this.dataElementType.id,e,t)}_resolveElementOptions(t,e="default",i){const s="active"===e,n=this._cachedDataOpts,o=t+"-"+e,r=n[o],a=this.enableOptionSharing&&dt(i);if(r)return Bi(r,a);const l=this.chart.config,h=l.datasetElementScopeKeys(this._type,t),c=s?[`${t}Hover`,"hover",t,""]:[t,""],d=l.getOptionScopes(this.getDataset(),h),u=Object.keys(he.elements[t]),p=l.resolveNamedOptions(d,u,()=>this.getContext(i,s,e),c);return p.$shared&&(p.$shared=a,n[o]=Object.freeze(Bi(p,a))),p}_resolveAnimations(t,e,i){const s=this.chart,n=this._cachedDataOpts,o=`animation-${e}`,r=n[o];if(r)return r;let a;if(!1!==s.options.animation){const s=this.chart.config,n=s.datasetAnimationScopeKeys(this._type,e),o=s.getOptionScopes(this.getDataset(),n);a=s.createResolver(o,this.getContext(t,i,e))}const l=new Di(s,a&&a.animations);return a&&a._cacheable&&(n[o]=Object.freeze(l)),l}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,e){return!e||Ii(t)||this.chart._animationsDisabled}_getSharedOptions(t,e){const i=this.resolveDataElementOptions(t,e),s=this._sharedOptions,n=this.getSharedOptions(i),o=this.includeOptions(e,n)||n!==s;return this.updateSharedOptions(n,e,i),{sharedOptions:n,includeOptions:o}}updateElement(t,e,i,s){Ii(s)?Object.assign(t,i):this._resolveAnimations(e,s).update(t,i)}updateSharedOptions(t,e,i){t&&!Ii(e)&&this._resolveAnimations(void 0,e).update(t,i)}_setStyle(t,e,i,s){t.active=s;const n=this.getStyle(e,s);this._resolveAnimations(e,i,s).update(t,{options:!s&&this.getSharedOptions(n)||n})}removeHoverStyle(t,e,i){this._setStyle(t,i,"active",!1)}setHoverStyle(t,e,i){this._setStyle(t,i,"active",!0)}_removeDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!1)}_setDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!0)}_resyncElements(t){const e=this._data,i=this._cachedMeta.data;for(const[t,e,i]of this._syncList)this[t](e,i);this._syncList=[];const s=i.length,n=e.length,o=Math.min(n,s);o&&this.parse(0,o),n>s?this._insertElements(s,n-s,t):n<s&&this._removeElements(n,s-n)}_insertElements(t,e,i=!0){const s=this._cachedMeta,n=s.data,o=t+e;let r;const a=t=>{for(t.length+=e,r=t.length-1;r>=o;r--)t[r]=t[r-e]};for(a(n),r=t;r<o;++r)n[r]=new this.dataElementType;this._parsing&&a(s._parsed),this.parse(t,e),i&&this.updateElements(n,t,e,"reset")}updateElements(t,e,i,s){}_removeElements(t,e){const i=this._cachedMeta;if(this._parsing){const s=i._parsed.splice(t,e);i._stacked&&Hi(i,s)}i.data.splice(t,e)}_sync(t){if(this._parsing)this._syncList.push(t);else{const[e,i,s]=t;this[e](i,s)}this.chart._dataChanges.push([this.index,...t])}_onDataPush(){const t=arguments.length;this._sync(["_insertElements",this.getDataset().data.length-t,t])}_onDataPop(){this._sync(["_removeElements",this._cachedMeta.data.length-1,1])}_onDataShift(){this._sync(["_removeElements",0,1])}_onDataSplice(t,e){e&&this._sync(["_removeElements",t,e]);const i=arguments.length-2;i&&this._sync(["_insertElements",t,i])}_onDataUnshift(){this._sync(["_insertElements",0,arguments.length])}}function Wi(t){const e=t.iScale,i=function(t,e){if(!t._cache.$bar){const i=t.getMatchingVisibleMetas(e);let s=[];for(let e=0,n=i.length;e<n;e++)s=s.concat(i[e].controller.getAllParsedValues(t));t._cache.$bar=function(t){const e=new Set(t);return e.size===t.length?t:Array.from(e)}(s.sort((t,e)=>t-e))}return t._cache.$bar}(e,t.type);let s,n,o,r,a=e._length;const l=()=>{32767!==o&&-32768!==o&&(dt(r)&&(a=Math.min(a,Math.abs(o-r)||a)),r=o)};for(s=0,n=i.length;s<n;++s)o=e.getPixelForValue(i[s]),l();for(r=void 0,s=0,n=e.ticks.length;s<n;++s)o=e.getPixelForTick(s),l();return a}function Gi(t,e,i,s){return Y(t)?function(t,e,i,s){const n=i.parse(t[0],s),o=i.parse(t[1],s),r=Math.min(n,o),a=Math.max(n,o);let l=r,h=a;Math.abs(r)>Math.abs(a)&&(l=a,h=r),e[i.axis]=h,e._custom={barStart:l,barEnd:h,start:n,end:o,min:r,max:a}}(t,e,i,s):e[i.axis]=i.parse(t,s),e}function Ui(t,e,i,s){const n=t.iScale,o=t.vScale,r=n.getLabels(),a=n===o,l=[];let h,c,d,u;for(h=i,c=i+s;h<c;++h)u=e[h],d={},d[n.axis]=a||n.parse(r[h],h),l.push(Gi(u,d,o,h));return l}function $i(t){return t&&void 0!==t.barStart&&void 0!==t.barEnd}function Yi(t,e,i,s){let n=e.borderSkipped;const o={};if(!n)return void(t.borderSkipped=o);if(!0===n)return void(t.borderSkipped={top:!0,right:!0,bottom:!0,left:!0});const{start:r,end:a,reverse:l,top:h,bottom:c}=function(t){let e,i,s,n,o;return t.horizontal?(e=t.base>t.x,i="left",s="right"):(e=t.base<t.y,i="bottom",s="top"),e?(n="end",o="start"):(n="start",o="end"),{start:i,end:s,reverse:e,top:n,bottom:o}}(t);"middle"===n&&i&&(t.enableBorderRadius=!0,(i._top||0)===s?n=h:(i._bottom||0)===s?n=c:(o[Ki(c,r,a,l)]=!0,n=h)),o[Ki(n,r,a,l)]=!0,t.borderSkipped=o}function Ki(t,e,i,s){var n,o,r;return s?(r=i,t=Xi(t=(n=t)===(o=e)?r:n===r?o:n,i,e)):t=Xi(t,e,i),t}function Xi(t,e,i){return"start"===t?e:"end"===t?i:t}function qi(t,{inflateAmount:e},i){t.inflateAmount="auto"===e?1===i?.33:0:e}class Ji extends Vi{static id="bar";static defaults={datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}};static overrides={scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}};parsePrimitiveData(t,e,i,s){return Ui(t,e,i,s)}parseArrayData(t,e,i,s){return Ui(t,e,i,s)}parseObjectData(t,e,i,s){const{iScale:n,vScale:o}=t,{xAxisKey:r="x",yAxisKey:a="y"}=this._parsing,l="x"===n.axis?r:a,h="x"===o.axis?r:a,c=[];let d,u,p,m;for(d=i,u=i+s;d<u;++d)m=e[d],p={},p[n.axis]=n.parse(ht(m,l),d),c.push(Gi(ht(m,h),p,o,d));return c}updateRangeFromParsed(t,e,i,s){super.updateRangeFromParsed(t,e,i,s);const n=i._custom;n&&e===this._cachedMeta.vScale&&(t.min=Math.min(t.min,n.min),t.max=Math.max(t.max,n.max))}getMaxOverflow(){return 0}getLabelAndValue(t){const e=this._cachedMeta,{iScale:i,vScale:s}=e,n=this.getParsed(t),o=n._custom,r=$i(o)?"["+o.start+", "+o.end+"]":""+s.getLabelForValue(n[s.axis]);return{label:""+i.getLabelForValue(n[i.axis]),value:r}}initialize(){this.enableOptionSharing=!0,super.initialize(),this._cachedMeta.stack=this.getDataset().stack}update(t){const e=this._cachedMeta;this.updateElements(e.data,0,e.data.length,t)}updateElements(t,e,i,s){const n="reset"===s,{index:o,_cachedMeta:{vScale:r}}=this,a=r.getBasePixel(),l=r.isHorizontal(),h=this._getRuler(),{sharedOptions:c,includeOptions:d}=this._getSharedOptions(e,s);for(let u=e;u<e+i;u++){const e=this.getParsed(u),i=n||$(e[r.axis])?{base:a,head:a}:this._calculateBarValuePixels(u),p=this._calculateBarIndexPixels(u,h),m=(e._stacks||{})[r.axis],g={horizontal:l,base:i.base,enableBorderRadius:!m||$i(e._custom)||o===m._top||o===m._bottom,x:l?i.head:p.center,y:l?p.center:i.head,height:l?p.size:Math.abs(i.size),width:l?Math.abs(i.size):p.size};d&&(g.options=c||this.resolveDataElementOptions(u,t[u].active?"active":s));const b=g.options||t[u].options;Yi(g,b,m,o),qi(g,b,h.ratio),this.updateElement(t[u],u,g,s)}}_getStacks(t,e){const{iScale:i}=this._cachedMeta,s=i.getMatchingVisibleMetas(this._type).filter(t=>t.controller.options.grouped),n=i.options.stacked,o=[],r=this._cachedMeta.controller.getParsed(e),a=r&&r[i.axis],l=t=>{const e=t._parsed.find(t=>t[i.axis]===a),s=e&&e[t.vScale.axis];if($(s)||isNaN(s))return!0};for(const i of s)if((void 0===e||!l(i))&&((!1===n||-1===o.indexOf(i.stack)||void 0===n&&void 0===i.stack)&&o.push(i.stack),i.index===t))break;return o.length||o.push(void 0),o}_getStackCount(t){return this._getStacks(void 0,t).length}_getAxisCount(){return this._getAxis().length}getFirstScaleIdForIndexAxis(){const t=this.chart.scales,e=this.chart.options.indexAxis;return Object.keys(t).filter(i=>t[i].axis===e).shift()}_getAxis(){const t={},e=this.getFirstScaleIdForIndexAxis();for(const i of this.chart.data.datasets)t[J("x"===this.chart.options.indexAxis?i.xAxisID:i.yAxisID,e)]=!0;return Object.keys(t)}_getStackIndex(t,e,i){const s=this._getStacks(t,i),n=void 0!==e?s.indexOf(e):-1;return-1===n?s.length-1:n}_getRuler(){const t=this.options,e=this._cachedMeta,i=e.iScale,s=[];let n,o;for(n=0,o=e.data.length;n<o;++n)s.push(i.getPixelForValue(this.getParsed(n)[i.axis],n));const r=t.barThickness;return{min:r||Wi(e),pixels:s,start:i._startPixel,end:i._endPixel,stackCount:this._getStackCount(),scale:i,grouped:t.grouped,ratio:r?1:t.categoryPercentage*t.barPercentage}}_calculateBarValuePixels(t){const{_cachedMeta:{vScale:e,_stacked:i,index:s},options:{base:n,minBarLength:o}}=this,r=n||0,a=this.getParsed(t),l=a._custom,h=$i(l);let c,d,u=a[e.axis],p=0,m=i?this.applyStack(e,a,i):u;m!==u&&(p=m-u,m=u),h&&(u=l.barStart,m=l.barEnd-l.barStart,0!==u&&Ct(u)!==Ct(l.barEnd)&&(p=0),p+=u);const g=$(n)||h?p:n;let b=e.getPixelForValue(g);if(c=this.chart.getDataVisibility(t)?e.getPixelForValue(p+m):b,d=c-b,Math.abs(d)<o){d=function(t,e,i){return 0!==t?Ct(t):(e.isHorizontal()?1:-1)*(e.min>=i?1:-1)}(d,e,r)*o,u===r&&(b-=d/2);const t=e.getPixelForDecimal(0),n=e.getPixelForDecimal(1),l=Math.min(t,n),p=Math.max(t,n);b=Math.max(Math.min(b,p),l),c=b+d,i&&!h&&(a._stacks[e.axis]._visualValues[s]=e.getValueForPixel(c)-e.getValueForPixel(b))}if(b===e.getPixelForValue(r)){const t=Ct(d)*e.getLineWidthForValue(r)/2;b+=t,d-=t}return{size:d,base:b,head:c,center:c+d/2}}_calculateBarIndexPixels(t,e){const i=e.scale,s=this.options,n=s.skipNull,o=J(s.maxBarThickness,1/0);let r,a;const l=this._getAxisCount();if(e.grouped){const i=n?this._getStackCount(t):e.stackCount,h="flex"===s.barThickness?function(t,e,i,s){const n=e.pixels,o=n[t];let r=t>0?n[t-1]:null,a=t<n.length-1?n[t+1]:null;const l=i.categoryPercentage;null===r&&(r=o-(null===a?e.end-e.start:a-o)),null===a&&(a=o+o-r);const h=o-(o-Math.min(r,a))/2*l;return{chunk:Math.abs(a-r)/2*l/s,ratio:i.barPercentage,start:h}}(t,e,s,i*l):function(t,e,i,s){const n=i.barThickness;let o,r;return $(n)?(o=e.min*i.categoryPercentage,r=i.barPercentage):(o=n*s,r=1),{chunk:o/s,ratio:r,start:e.pixels[t]-o/2}}(t,e,s,i*l),c="x"===this.chart.options.indexAxis?this.getDataset().xAxisID:this.getDataset().yAxisID,d=this._getAxis().indexOf(J(c,this.getFirstScaleIdForIndexAxis())),u=this._getStackIndex(this.index,this._cachedMeta.stack,n?t:void 0)+d;r=h.start+h.chunk*u+h.chunk/2,a=Math.min(o,h.chunk*h.ratio)}else r=i.getPixelForValue(this.getParsed(t)[i.axis],t),a=Math.min(o,e.min*e.ratio);return{base:r-a/2,head:r+a/2,center:r,size:a}}draw(){const t=this._cachedMeta,e=t.vScale,i=t.data,s=i.length;let n=0;for(;n<s;++n)null===this.getParsed(n)[e.axis]||i[n].hidden||i[n].draw(this._ctx)}}class Zi extends Vi{static id="doughnut";static defaults={datasetElementType:!1,dataElementType:"arc",animation:{animateRotate:!0,animateScale:!1},animations:{numbers:{type:"number",properties:["circumference","endAngle","innerRadius","outerRadius","startAngle","x","y","offset","borderWidth","spacing"]}},cutout:"50%",rotation:0,circumference:360,radius:"100%",spacing:0,indexAxis:"r"};static descriptors={_scriptable:t=>"spacing"!==t,_indexable:t=>"spacing"!==t&&!t.startsWith("borderDash")&&!t.startsWith("hoverBorderDash")};static overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const e=t.data,{labels:{pointStyle:i,textAlign:s,color:n,useBorderRadius:o,borderRadius:r}}=t.legend.options;return e.labels.length&&e.datasets.length?e.labels.map((e,a)=>{const l=t.getDatasetMeta(0).controller.getStyle(a);return{text:e,fillStyle:l.backgroundColor,fontColor:n,hidden:!t.getDataVisibility(a),lineDash:l.borderDash,lineDashOffset:l.borderDashOffset,lineJoin:l.borderJoinStyle,lineWidth:l.borderWidth,strokeStyle:l.borderColor,textAlign:s,pointStyle:i,borderRadius:o&&(r||l.borderRadius),index:a}}):[]}},onClick(t,e,i){i.chart.toggleDataVisibility(e.index),i.chart.update()}}}};constructor(t,e){super(t,e),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(t,e){const i=this.getDataset().data,s=this._cachedMeta;if(!1===this._parsing)s._parsed=i;else{let n,o,r=t=>+i[t];if(K(i[t])){const{key:t="value"}=this._parsing;r=e=>+ht(i[e],t)}for(n=t,o=t+e;n<o;++n)s._parsed[n]=r(n)}}_getRotation(){return Mt(this.options.rotation-90)}_getCircumference(){return Mt(this.options.circumference)}_getRotationExtents(){let t=gt,e=-gt;for(let i=0;i<this.chart.data.datasets.length;++i)if(this.chart.isDatasetVisible(i)&&this.chart.getDatasetMeta(i).type===this._type){const s=this.chart.getDatasetMeta(i).controller,n=s._getRotation(),o=s._getCircumference();t=Math.min(t,n),e=Math.max(e,n+o)}return{rotation:t,circumference:e-t}}update(t){const e=this.chart,{chartArea:i}=e,s=this._cachedMeta,n=s.data,o=this.getMaxBorderWidth()+this.getMaxOffset(n)+this.options.spacing,r=Math.max((Math.min(i.width,i.height)-o)/2,0),a=Math.min((h=r,"string"==typeof(l=this.options.cutout)&&l.endsWith("%")?parseFloat(l)/100:+l/h),1);var l,h;const c=this._getRingWeight(this.index),{circumference:d,rotation:u}=this._getRotationExtents(),{ratioX:p,ratioY:m,offsetX:g,offsetY:b}=function(t,e,i){let s=1,n=1,o=0,r=0;if(e<gt){const a=t,l=a+e,h=Math.cos(a),c=Math.sin(a),d=Math.cos(l),u=Math.sin(l),p=(t,e,s)=>jt(t,a,l,!0)?1:Math.max(e,e*i,s,s*i),m=(t,e,s)=>jt(t,a,l,!0)?-1:Math.min(e,e*i,s,s*i),g=p(0,h,d),b=p(wt,c,u),f=m(mt,h,d),v=m(mt+wt,c,u);s=(g-f)/2,n=(b-v)/2,o=-(g+f)/2,r=-(b+v)/2}return{ratioX:s,ratioY:n,offsetX:o,offsetY:r}}(u,d,a),f=(i.width-o)/p,v=(i.height-o)/m,w=Math.max(Math.min(f,v)/2,0),y=Z(this.options.radius,w),_=(y-Math.max(y*a,0))/this._getVisibleDatasetWeightTotal();this.offsetX=g*y,this.offsetY=b*y,s.total=this.calculateTotal(),this.outerRadius=y-_*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-_*c,0),this.updateElements(n,0,n.length,t)}_circumference(t,e){const i=this.options,s=this._cachedMeta,n=this._getCircumference();return e&&i.animation.animateRotate||!this.chart.getDataVisibility(t)||null===s._parsed[t]||s.data[t].hidden?0:this.calculateCircumference(s._parsed[t]*n/gt)}updateElements(t,e,i,s){const n="reset"===s,o=this.chart,r=o.chartArea,a=o.options.animation,l=(r.left+r.right)/2,h=(r.top+r.bottom)/2,c=n&&a.animateScale,d=c?0:this.innerRadius,u=c?0:this.outerRadius,{sharedOptions:p,includeOptions:m}=this._getSharedOptions(e,s);let g,b=this._getRotation();for(g=0;g<e;++g)b+=this._circumference(g,n);for(g=e;g<e+i;++g){const e=this._circumference(g,n),i=t[g],o={x:l+this.offsetX,y:h+this.offsetY,startAngle:b,endAngle:b+e,circumference:e,outerRadius:u,innerRadius:d};m&&(o.options=p||this.resolveDataElementOptions(g,i.active?"active":s)),b+=e,this.updateElement(i,g,o,s)}}calculateTotal(){const t=this._cachedMeta,e=t.data;let i,s=0;for(i=0;i<e.length;i++){const n=t._parsed[i];null===n||isNaN(n)||!this.chart.getDataVisibility(i)||e[i].hidden||(s+=Math.abs(n))}return s}calculateCircumference(t){const e=this._cachedMeta.total;return e>0&&!isNaN(t)?gt*(Math.abs(t)/e):0}getLabelAndValue(t){const e=this._cachedMeta,i=this.chart,s=i.data.labels||[],n=ee(e._parsed[t],i.options.locale);return{label:s[t]||"",value:n}}getMaxBorderWidth(t){let e=0;const i=this.chart;let s,n,o,r,a;if(!t)for(s=0,n=i.data.datasets.length;s<n;++s)if(i.isDatasetVisible(s)){o=i.getDatasetMeta(s),t=o.data,r=o.controller;break}if(!t)return 0;for(s=0,n=t.length;s<n;++s)a=r.resolveDataElementOptions(s),"inner"!==a.borderAlign&&(e=Math.max(e,a.borderWidth||0,a.hoverBorderWidth||0));return e}getMaxOffset(t){let e=0;for(let i=0,s=t.length;i<s;++i){const t=this.resolveDataElementOptions(i);e=Math.max(e,t.offset||0,t.hoverOffset||0)}return e}_getRingWeightOffset(t){let e=0;for(let i=0;i<t;++i)this.chart.isDatasetVisible(i)&&(e+=this._getRingWeight(i));return e}_getRingWeight(t){return Math.max(J(this.chart.data.datasets[t].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}}class Qi extends Vi{static id="line";static defaults={datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1};static overrides={scales:{_index_:{type:"category"},_value_:{type:"linear"}}};initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(t){const e=this._cachedMeta,{dataset:i,data:s=[],_dataset:n}=e,o=this.chart._animationsDisabled;let{start:r,count:a}=function(t,e,i){const s=e.length;let n=0,o=s;if(t._sorted){const{iScale:r,vScale:a,_parsed:l}=t,h=t.dataset&&t.dataset.options?t.dataset.options.spanGaps:null,c=r.axis,{min:d,max:u,minDefined:p,maxDefined:m}=r.getUserBounds();if(p){if(n=Math.min(Ot(l,c,d).lo,i?s:Ot(e,c,r.getPixelForValue(d)).lo),h){const t=l.slice(0,n+1).reverse().findIndex(t=>!$(t[a.axis]));n-=Math.max(0,t)}n=Nt(n,0,s-1)}if(m){let t=Math.max(Ot(l,r.axis,u,!0).hi+1,i?0:Ot(e,c,r.getPixelForValue(u),!0).hi+1);if(h){const e=l.slice(t-1).findIndex(t=>!$(t[a.axis]));t+=Math.max(0,e)}o=Nt(t,n,s)-n}else o=s-n}return{start:n,count:o}}(e,s,o);this._drawStart=r,this._drawCount=a,function(t){const{xScale:e,yScale:i,_scaleRanges:s}=t,n={xmin:e.min,xmax:e.max,ymin:i.min,ymax:i.max};if(!s)return t._scaleRanges=n,!0;const o=s.xmin!==e.min||s.xmax!==e.max||s.ymin!==i.min||s.ymax!==i.max;return Object.assign(s,n),o}(e)&&(r=0,a=s.length),i._chart=this.chart,i._datasetIndex=this.index,i._decimated=!!n._decimated,i.points=s;const l=this.resolveDatasetElementOptions(t);this.options.showLine||(l.borderWidth=0),l.segment=this.options.segment,this.updateElement(i,void 0,{animated:!o,options:l},t),this.updateElements(s,r,a,t)}updateElements(t,e,i,s){const n="reset"===s,{iScale:o,vScale:r,_stacked:a,_dataset:l}=this._cachedMeta,{sharedOptions:h,includeOptions:c}=this._getSharedOptions(e,s),d=o.axis,u=r.axis,{spanGaps:p,segment:m}=this.options,g=Rt(p)?p:Number.POSITIVE_INFINITY,b=this.chart._animationsDisabled||n||"none"===s,f=e+i,v=t.length;let w=e>0&&this.getParsed(e-1);for(let i=0;i<v;++i){const p=t[i],v=b?p:{};if(i<e||i>=f){v.skip=!0;continue}const y=this.getParsed(i),_=$(y[u]),x=v[d]=o.getPixelForValue(y[d],i),C=v[u]=n||_?r.getBasePixel():r.getPixelForValue(a?this.applyStack(r,y,a):y[u],i);v.skip=isNaN(x)||isNaN(C)||_,v.stop=i>0&&Math.abs(y[d]-w[d])>g,m&&(v.parsed=y,v.raw=l.data[i]),c&&(v.options=h||this.resolveDataElementOptions(i,p.active?"active":s)),b||this.updateElement(p,i,v,s),w=y}}getMaxOverflow(){const t=this._cachedMeta,e=t.dataset,i=e.options&&e.options.borderWidth||0,s=t.data||[];if(!s.length)return i;const n=s[0].size(this.resolveDataElementOptions(0)),o=s[s.length-1].size(this.resolveDataElementOptions(s.length-1));return Math.max(i,n,o)/2}draw(){const t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw()}}function ts(t,e,i,s){const{controller:n,data:o,_sorted:r}=t,a=n._cachedMeta.iScale,l=t.dataset&&t.dataset.options?t.dataset.options.spanGaps:null;if(a&&e===a.axis&&"r"!==e&&r&&o.length){const r=a._reversePixels?Ft:Ot;if(!s){const s=r(o,e,i);if(l){const{vScale:e}=n._cachedMeta,{_parsed:i}=t,o=i.slice(0,s.lo+1).reverse().findIndex(t=>!$(t[e.axis]));s.lo-=Math.max(0,o);const r=i.slice(s.hi).findIndex(t=>!$(t[e.axis]));s.hi+=Math.max(0,r)}return s}if(n._sharedOptions){const t=o[0],s="function"==typeof t.getRange&&t.getRange(e);if(s){const t=r(o,e,i-s),n=r(o,e,i+s);return{lo:t.lo,hi:n.hi}}}}return{lo:0,hi:o.length-1}}function es(t,e,i,s,n){const o=t.getSortedVisibleDatasetMetas(),r=i[e];for(let t=0,i=o.length;t<i;++t){const{index:i,data:a}=o[t],{lo:l,hi:h}=ts(o[t],e,r,n);for(let t=l;t<=h;++t){const e=a[t];e.skip||s(e,i,t)}}}function is(t,e,i,s,n){const o=[];return n||t.isPointInArea(e)?(es(t,i,e,function(i,r,a){(n||ge(i,t.chartArea,0))&&i.inRange(e.x,e.y,s)&&o.push({element:i,datasetIndex:r,index:a})},!0),o):o}function ss(t,e,i,s,n,o){return o||t.isPointInArea(e)?"r"!==i||s?function(t,e,i,s,n,o){let r=[];const a=function(t){const e=-1!==t.indexOf("x"),i=-1!==t.indexOf("y");return function(t,s){const n=e?Math.abs(t.x-s.x):0,o=i?Math.abs(t.y-s.y):0;return Math.sqrt(Math.pow(n,2)+Math.pow(o,2))}}(i);let l=Number.POSITIVE_INFINITY;return es(t,i,e,function(i,h,c){const d=i.inRange(e.x,e.y,n);if(s&&!d)return;const u=i.getCenterPoint(n);if(!o&&!t.isPointInArea(u)&&!d)return;const p=a(e,u);p<l?(r=[{element:i,datasetIndex:h,index:c}],l=p):p===l&&r.push({element:i,datasetIndex:h,index:c})}),r}(t,e,i,s,n,o):function(t,e,i,s){let n=[];return es(t,i,e,function(t,i,o){const{startAngle:r,endAngle:a}=t.getProps(["startAngle","endAngle"],s),{angle:l}=St(t,{x:e.x,y:e.y});jt(l,r,a)&&n.push({element:t,datasetIndex:i,index:o})}),n}(t,e,i,n):[]}function ns(t,e,i,s,n){const o=[],r="x"===i?"inXRange":"inYRange";let a=!1;return es(t,i,e,(t,s,l)=>{t[r]&&t[r](e[i],n)&&(o.push({element:t,datasetIndex:s,index:l}),a=a||t.inRange(e.x,e.y,n))}),s&&!a?[]:o}var os={evaluateInteractionItems:es,modes:{index(t,e,i,s){const n=ri(e,t),o=i.axis||"x",r=i.includeInvisible||!1,a=i.intersect?is(t,n,o,s,r):ss(t,n,o,!1,s,r),l=[];return a.length?(t.getSortedVisibleDatasetMetas().forEach(t=>{const e=a[0].index,i=t.data[e];i&&!i.skip&&l.push({element:i,datasetIndex:t.index,index:e})}),l):[]},dataset(t,e,i,s){const n=ri(e,t),o=i.axis||"xy",r=i.includeInvisible||!1;let a=i.intersect?is(t,n,o,s,r):ss(t,n,o,!1,s,r);if(a.length>0){const e=a[0].datasetIndex,i=t.getDatasetMeta(e).data;a=[];for(let t=0;t<i.length;++t)a.push({element:i[t],datasetIndex:e,index:t})}return a},point:(t,e,i,s)=>is(t,ri(e,t),i.axis||"xy",s,i.includeInvisible||!1),nearest(t,e,i,s){const n=ri(e,t),o=i.axis||"xy",r=i.includeInvisible||!1;return ss(t,n,o,i.intersect,s,r)},x:(t,e,i,s)=>ns(t,ri(e,t),"x",i.intersect,s),y:(t,e,i,s)=>ns(t,ri(e,t),"y",i.intersect,s)}};const rs=["left","top","right","bottom"];function as(t,e){return t.filter(t=>t.pos===e)}function ls(t,e){return t.filter(t=>-1===rs.indexOf(t.pos)&&t.box.axis===e)}function hs(t,e){return t.sort((t,i)=>{const s=e?i:t,n=e?t:i;return s.weight===n.weight?s.index-n.index:s.weight-n.weight})}function cs(t,e,i,s){return Math.max(t[i],e[i])+Math.max(t[s],e[s])}function ds(t,e){t.top=Math.max(t.top,e.top),t.left=Math.max(t.left,e.left),t.bottom=Math.max(t.bottom,e.bottom),t.right=Math.max(t.right,e.right)}function us(t,e,i,s){const{pos:n,box:o}=i,r=t.maxPadding;if(!K(n)){i.size&&(t[n]-=i.size);const e=s[i.stack]||{size:0,count:1};e.size=Math.max(e.size,i.horizontal?o.height:o.width),i.size=e.size/e.count,t[n]+=i.size}o.getPadding&&ds(r,o.getPadding());const a=Math.max(0,e.outerWidth-cs(r,t,"left","right")),l=Math.max(0,e.outerHeight-cs(r,t,"top","bottom")),h=a!==t.w,c=l!==t.h;return t.w=a,t.h=l,i.horizontal?{same:h,other:c}:{same:c,other:h}}function ps(t,e){const i=e.maxPadding;return function(t){const s={left:0,top:0,right:0,bottom:0};return t.forEach(t=>{s[t]=Math.max(e[t],i[t])}),s}(t?["left","right"]:["top","bottom"])}function ms(t,e,i,s){const n=[];let o,r,a,l,h,c;for(o=0,r=t.length,h=0;o<r;++o){a=t[o],l=a.box,l.update(a.width||e.w,a.height||e.h,ps(a.horizontal,e));const{same:r,other:d}=us(e,i,a,s);h|=r&&n.length,c=c||d,l.fullSize||n.push(a)}return h&&ms(n,e,i,s)||c}function gs(t,e,i,s,n){t.top=i,t.left=e,t.right=e+s,t.bottom=i+n,t.width=s,t.height=n}function bs(t,e,i,s){const n=i.padding;let{x:o,y:r}=e;for(const a of t){const t=a.box,l=s[a.stack]||{count:1,placed:0,weight:1},h=a.stackWeight/l.weight||1;if(a.horizontal){const s=e.w*h,o=l.size||t.height;dt(l.start)&&(r=l.start),t.fullSize?gs(t,n.left,r,i.outerWidth-n.right-n.left,o):gs(t,e.left+l.placed,r,s,o),l.start=r,l.placed+=s,r=t.bottom}else{const s=e.h*h,r=l.size||t.width;dt(l.start)&&(o=l.start),t.fullSize?gs(t,o,n.top,r,i.outerHeight-n.bottom-n.top):gs(t,o,e.top+l.placed,r,s),l.start=o,l.placed+=s,o=t.right}}e.x=o,e.y=r}var fs={addBox(t,e){t.boxes||(t.boxes=[]),e.fullSize=e.fullSize||!1,e.position=e.position||"top",e.weight=e.weight||0,e._layers=e._layers||function(){return[{z:0,draw(t){e.draw(t)}}]},t.boxes.push(e)},removeBox(t,e){const i=t.boxes?t.boxes.indexOf(e):-1;-1!==i&&t.boxes.splice(i,1)},configure(t,e,i){e.fullSize=i.fullSize,e.position=i.position,e.weight=i.weight},update(t,e,i,s){if(!t)return;const n=Le(t.options.layout.padding),o=Math.max(e-n.width,0),r=Math.max(i-n.height,0),a=function(t){const e=function(t){const e=[];let i,s,n,o,r,a;for(i=0,s=(t||[]).length;i<s;++i)n=t[i],({position:o,options:{stack:r,stackWeight:a=1}}=n),e.push({index:i,box:n,pos:o,horizontal:n.isHorizontal(),weight:n.weight,stack:r&&o+r,stackWeight:a});return e}(t),i=hs(e.filter(t=>t.box.fullSize),!0),s=hs(as(e,"left"),!0),n=hs(as(e,"right")),o=hs(as(e,"top"),!0),r=hs(as(e,"bottom")),a=ls(e,"x"),l=ls(e,"y");return{fullSize:i,leftAndTop:s.concat(o),rightAndBottom:n.concat(l).concat(r).concat(a),chartArea:as(e,"chartArea"),vertical:s.concat(n).concat(l),horizontal:o.concat(r).concat(a)}}(t.boxes),l=a.vertical,h=a.horizontal;tt(t.boxes,t=>{"function"==typeof t.beforeLayout&&t.beforeLayout()});const c=l.reduce((t,e)=>e.box.options&&!1===e.box.options.display?t:t+1,0)||1,d=Object.freeze({outerWidth:e,outerHeight:i,padding:n,availableWidth:o,availableHeight:r,vBoxMaxWidth:o/2/c,hBoxMaxHeight:r/2}),u=Object.assign({},n);ds(u,Le(s));const p=Object.assign({maxPadding:u,w:o,h:r,x:n.left,y:n.top},n),m=function(t,e){const i=function(t){const e={};for(const i of t){const{stack:t,pos:s,stackWeight:n}=i;if(!t||!rs.includes(s))continue;const o=e[t]||(e[t]={count:0,placed:0,weight:0,size:0});o.count++,o.weight+=n}return e}(t),{vBoxMaxWidth:s,hBoxMaxHeight:n}=e;let o,r,a;for(o=0,r=t.length;o<r;++o){a=t[o];const{fullSize:r}=a.box,l=i[a.stack],h=l&&a.stackWeight/l.weight;a.horizontal?(a.width=h?h*s:r&&e.availableWidth,a.height=n):(a.width=s,a.height=h?h*n:r&&e.availableHeight)}return i}(l.concat(h),d);ms(a.fullSize,p,d,m),ms(l,p,d,m),ms(h,p,d,m)&&ms(l,p,d,m),function(t){const e=t.maxPadding;function i(i){const s=Math.max(e[i]-t[i],0);return t[i]+=s,s}t.y+=i("top"),t.x+=i("left"),i("right"),i("bottom")}(p),bs(a.leftAndTop,p,d,m),p.x+=p.w,p.y+=p.h,bs(a.rightAndBottom,p,d,m),t.chartArea={left:p.left,top:p.top,right:p.left+p.w,bottom:p.top+p.h,height:p.h,width:p.w},tt(a.chartArea,e=>{const i=e.box;Object.assign(i,t.chartArea),i.update(p.w,p.h,{left:0,top:0,right:0,bottom:0})})}};class vs{acquireContext(t,e){}releaseContext(t){return!1}addEventListener(t,e,i){}removeEventListener(t,e,i){}getDevicePixelRatio(){return 1}getMaximumSize(t,e,i,s){return e=Math.max(0,e||t.width),i=i||t.height,{width:e,height:Math.max(0,s?Math.floor(e/s):i)}}isAttached(t){return!0}updateConfig(t){}}class ws extends vs{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const ys="$chartjs",_s={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},xs=t=>null===t||""===t,Cs=!!hi&&{passive:!0};function ks(t,e,i){t&&t.canvas&&t.canvas.removeEventListener(e,i,Cs)}function Es(t,e){for(const i of t)if(i===e||i.contains(e))return!0}function Rs(t,e,i){const s=t.canvas,n=new MutationObserver(t=>{let e=!1;for(const i of t)e=e||Es(i.addedNodes,s),e=e&&!Es(i.removedNodes,s);e&&i()});return n.observe(document,{childList:!0,subtree:!0}),n}function Ms(t,e,i){const s=t.canvas,n=new MutationObserver(t=>{let e=!1;for(const i of t)e=e||Es(i.removedNodes,s),e=e&&!Es(i.addedNodes,s);e&&i()});return n.observe(document,{childList:!0,subtree:!0}),n}const Ts=new Map;let Ss=0;function Ds(){const t=window.devicePixelRatio;t!==Ss&&(Ss=t,Ts.forEach((e,i)=>{i.currentDevicePixelRatio!==t&&e()}))}function Ls(t,e,i){const s=t.canvas,n=s&&ei(s);if(!n)return;const o=Vt((t,e)=>{const s=n.clientWidth;i(t,e),s<n.clientWidth&&i()},window),r=new ResizeObserver(t=>{const e=t[0],i=e.contentRect.width,s=e.contentRect.height;0===i&&0===s||o(i,s)});return r.observe(n),function(t,e){Ts.size||window.addEventListener("resize",Ds),Ts.set(t,e)}(t,o),r}function Ps(t,e,i){i&&i.disconnect(),"resize"===e&&function(t){Ts.delete(t),Ts.size||window.removeEventListener("resize",Ds)}(t)}function js(t,e,i){const s=t.canvas,n=Vt(e=>{null!==t.ctx&&i(function(t,e){const i=_s[t.type]||t.type,{x:s,y:n}=ri(t,e);return{type:i,chart:e,native:t,x:void 0!==s?s:null,y:void 0!==n?n:null}}(e,t))},t);return function(t,e,i){t&&t.addEventListener(e,i,Cs)}(s,e,n),n}class Ns extends vs{acquireContext(t,e){const i=t&&t.getContext&&t.getContext("2d");return i&&i.canvas===t?(function(t,e){const i=t.style,s=t.getAttribute("height"),n=t.getAttribute("width");if(t[ys]={initial:{height:s,width:n,style:{display:i.display,height:i.height,width:i.width}}},i.display=i.display||"block",i.boxSizing=i.boxSizing||"border-box",xs(n)){const e=ci(t,"width");void 0!==e&&(t.width=e)}if(xs(s))if(""===t.style.height)t.height=t.width/(e||2);else{const e=ci(t,"height");void 0!==e&&(t.height=e)}}(t,e),i):null}releaseContext(t){const e=t.canvas;if(!e[ys])return!1;const i=e[ys].initial;["height","width"].forEach(t=>{const s=i[t];$(s)?e.removeAttribute(t):e.setAttribute(t,s)});const s=i.style||{};return Object.keys(s).forEach(t=>{e.style[t]=s[t]}),e.width=e.width,delete e[ys],!0}addEventListener(t,e,i){this.removeEventListener(t,e);const s=t.$proxies||(t.$proxies={}),n={attach:Rs,detach:Ms,resize:Ls}[e]||js;s[e]=n(t,e,i)}removeEventListener(t,e){const i=t.$proxies||(t.$proxies={}),s=i[e];s&&(({attach:Ps,detach:Ps,resize:Ps}[e]||ks)(t,e,s),i[e]=void 0)}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,e,i,s){return function(t,e,i,s){const n=si(t),o=oi(n,"margin"),r=ii(n.maxWidth,t,"clientWidth")||ft,a=ii(n.maxHeight,t,"clientHeight")||ft,l=function(t,e,i){let s,n;if(void 0===e||void 0===i){const o=t&&ei(t);if(o){const t=o.getBoundingClientRect(),r=si(o),a=oi(r,"border","width"),l=oi(r,"padding");e=t.width-l.width-a.width,i=t.height-l.height-a.height,s=ii(r.maxWidth,o,"clientWidth"),n=ii(r.maxHeight,o,"clientHeight")}else e=t.clientWidth,i=t.clientHeight}return{width:e,height:i,maxWidth:s||ft,maxHeight:n||ft}}(t,e,i);let{width:h,height:c}=l;if("content-box"===n.boxSizing){const t=oi(n,"border","width"),e=oi(n,"padding");h-=e.width+t.width,c-=e.height+t.height}return h=Math.max(0,h-o.width),c=Math.max(0,s?h/s:c-o.height),h=ai(Math.min(h,r,l.maxWidth)),c=ai(Math.min(c,a,l.maxHeight)),h&&!c&&(c=ai(h/2)),(void 0!==e||void 0!==i)&&s&&l.height&&c>l.height&&(c=l.height,h=ai(Math.floor(c*s))),{width:h,height:c}}(t,e,i,s)}isAttached(t){const e=t&&ei(t);return!(!e||!e.isConnected)}}class As{static defaults={};static defaultRoutes=void 0;x;y;active=!1;options;$animations;tooltipPosition(t){const{x:e,y:i}=this.getProps(["x","y"],t);return{x:e,y:i}}hasValue(){return Rt(this.x)&&Rt(this.y)}getProps(t,e){const i=this.$animations;if(!e||!i)return this;const s={};return t.forEach(t=>{s[t]=i[t]&&i[t].active()?i[t]._to:this[t]}),s}}function zs(t,e,i,s,n){const o=J(s,0),r=Math.min(J(n,t.length),t.length);let a,l,h,c=0;for(i=Math.ceil(i),n&&(a=n-s,i=a/Math.floor(a/i)),h=o;h<0;)c++,h=Math.round(o+c*i);for(l=Math.max(o,0);l<r;l++)l===h&&(e.push(t[l]),c++,h=Math.round(o+c*i))}const Os=(t,e,i)=>"top"===e||"left"===e?t[e]+i:t[e]-i,Fs=(t,e)=>Math.min(e||t,t);function Hs(t,e){const i=[],s=t.length/e,n=t.length;let o=0;for(;o<n;o+=s)i.push(t[Math.floor(o)]);return i}function Is(t,e,i){const s=t.ticks.length,n=Math.min(e,s-1),o=t._startPixel,r=t._endPixel,a=1e-6;let l,h=t.getPixelForTick(n);if(!(i&&(l=1===s?Math.max(h-o,r-h):0===e?(t.getPixelForTick(1)-h)/2:(h-t.getPixelForTick(n-1))/2,h+=n<e?l:-l,h<o-a||h>r+a)))return h}function Bs(t){return t.drawTicks?t.tickLength:0}function Vs(t,e){if(!t.display)return 0;const i=Pe(t.font,e),s=Le(t.padding);return(Y(t.text)?t.text.length:1)*i.lineHeight+s.height}function Ws(t,e,i){let s=Wt(t);return(i&&"right"!==e||!i&&"right"===e)&&(s=(t=>"left"===t?"right":"right"===t?"left":t)(s)),s}class Gs extends As{constructor(t){super(),this.id=t.id,this.type=t.type,this.options=void 0,this.ctx=t.ctx,this.chart=t.chart,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this._margins={left:0,right:0,top:0,bottom:0},this.maxWidth=void 0,this.maxHeight=void 0,this.paddingTop=void 0,this.paddingBottom=void 0,this.paddingLeft=void 0,this.paddingRight=void 0,this.axis=void 0,this.labelRotation=void 0,this.min=void 0,this.max=void 0,this._range=void 0,this.ticks=[],this._gridLineItems=null,this._labelItems=null,this._labelSizes=null,this._length=0,this._maxLength=0,this._longestTextCache={},this._startPixel=void 0,this._endPixel=void 0,this._reversePixels=!1,this._userMax=void 0,this._userMin=void 0,this._suggestedMax=void 0,this._suggestedMin=void 0,this._ticksLength=0,this._borderValue=0,this._cache={},this._dataLimitsCached=!1,this.$context=void 0}init(t){this.options=t.setContext(this.getContext()),this.axis=t.axis,this._userMin=this.parse(t.min),this._userMax=this.parse(t.max),this._suggestedMin=this.parse(t.suggestedMin),this._suggestedMax=this.parse(t.suggestedMax)}parse(t,e){return t}getUserBounds(){let{_userMin:t,_userMax:e,_suggestedMin:i,_suggestedMax:s}=this;return t=q(t,Number.POSITIVE_INFINITY),e=q(e,Number.NEGATIVE_INFINITY),i=q(i,Number.POSITIVE_INFINITY),s=q(s,Number.NEGATIVE_INFINITY),{min:q(t,i),max:q(e,s),minDefined:X(t),maxDefined:X(e)}}getMinMax(t){let e,{min:i,max:s,minDefined:n,maxDefined:o}=this.getUserBounds();if(n&&o)return{min:i,max:s};const r=this.getMatchingVisibleMetas();for(let a=0,l=r.length;a<l;++a)e=r[a].controller.getMinMax(this,t),n||(i=Math.min(i,e.min)),o||(s=Math.max(s,e.max));return i=o&&i>s?s:i,s=n&&i>s?i:s,{min:q(i,q(s,i)),max:q(s,q(i,s))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){const t=this.chart.data;return this.options.labels||(this.isHorizontal()?t.xLabels:t.yLabels)||t.labels||[]}getLabelItems(t=this.chart.chartArea){return this._labelItems||(this._labelItems=this._computeLabelItems(t))}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){Q(this.options.beforeUpdate,[this])}update(t,e,i){const{beginAtZero:s,grace:n,ticks:o}=this.options,r=o.sampleSize;this.beforeUpdate(),this.maxWidth=t,this.maxHeight=e,this._margins=i=Object.assign({left:0,right:0,top:0,bottom:0},i),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+i.left+i.right:this.height+i.top+i.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=function(t,e,i){const{min:s,max:n}=t,o=Z(e,(n-s)/2),r=(t,e)=>i&&0===t?0:t+e;return{min:r(s,-Math.abs(o)),max:r(n,o)}}(this,n,s),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const a=r<this.ticks.length;this._convertTicksToLabels(a?Hs(this.ticks,r):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),o.display&&(o.autoSkip||"auto"===o.source)&&(this.ticks=function(t,e){const i=t.options.ticks,s=function(t){const e=t.options.offset,i=t._tickSize(),s=t._length/i+(e?0:1),n=t._maxLength/i;return Math.floor(Math.min(s,n))}(t),n=Math.min(i.maxTicksLimit||s,s),o=i.major.enabled?function(t){const e=[];let i,s;for(i=0,s=t.length;i<s;i++)t[i].major&&e.push(i);return e}(e):[],r=o.length,a=o[0],l=o[r-1],h=[];if(r>n)return function(t,e,i,s){let n,o=0,r=i[0];for(s=Math.ceil(s),n=0;n<t.length;n++)n===r&&(e.push(t[n]),o++,r=i[o*s])}(e,h,o,r/n),h;const c=function(t,e,i){const s=function(t){const e=t.length;let i,s;if(e<2)return!1;for(s=t[0],i=1;i<e;++i)if(t[i]-t[i-1]!==s)return!1;return s}(t),n=e.length/i;if(!s)return Math.max(n,1);const o=function(t){const e=[],i=Math.sqrt(t);let s;for(s=1;s<i;s++)t%s===0&&(e.push(s),e.push(t/s));return i===(0|i)&&e.push(i),e.sort((t,e)=>t-e).pop(),e}(s);for(let t=0,e=o.length-1;t<e;t++){const e=o[t];if(e>n)return e}return Math.max(n,1)}(o,e,n);if(r>0){let t,i;const s=r>1?Math.round((l-a)/(r-1)):null;for(zs(e,h,c,$(s)?0:a-s,a),t=0,i=r-1;t<i;t++)zs(e,h,c,o[t],o[t+1]);return zs(e,h,c,l,$(s)?e.length:l+s),h}return zs(e,h,c),h}(this,this.ticks),this._labelSizes=null,this.afterAutoSkip()),a&&this._convertTicksToLabels(this.ticks),this.beforeFit(),this.fit(),this.afterFit(),this.afterUpdate()}configure(){let t,e,i=this.options.reverse;this.isHorizontal()?(t=this.left,e=this.right):(t=this.top,e=this.bottom,i=!i),this._startPixel=t,this._endPixel=e,this._reversePixels=i,this._length=e-t,this._alignToPixels=this.options.alignToPixels}afterUpdate(){Q(this.options.afterUpdate,[this])}beforeSetDimensions(){Q(this.options.beforeSetDimensions,[this])}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=0,this.right=this.width):(this.height=this.maxHeight,this.top=0,this.bottom=this.height),this.paddingLeft=0,this.paddingTop=0,this.paddingRight=0,this.paddingBottom=0}afterSetDimensions(){Q(this.options.afterSetDimensions,[this])}_callHooks(t){this.chart.notifyPlugins(t,this.getContext()),Q(this.options[t],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){Q(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(t){const e=this.options.ticks;let i,s,n;for(i=0,s=t.length;i<s;i++)n=t[i],n.label=Q(e.callback,[n.value,i,t],this)}afterTickToLabelConversion(){Q(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){Q(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){const t=this.options,e=t.ticks,i=Fs(this.ticks.length,t.ticks.maxTicksLimit),s=e.minRotation||0,n=e.maxRotation;let o,r,a,l=s;if(!this._isVisible()||!e.display||s>=n||i<=1||!this.isHorizontal())return void(this.labelRotation=s);const h=this._getLabelSizes(),c=h.widest.width,d=h.highest.height,u=Nt(this.chart.width-c,0,this.maxWidth);o=t.offset?this.maxWidth/i:u/(i-1),c+6>o&&(o=u/(i-(t.offset?.5:1)),r=this.maxHeight-Bs(t.grid)-e.padding-Vs(t.title,this.chart.options.font),a=Math.sqrt(c*c+d*d),l=Math.min(Math.asin(Nt((h.highest.height+6)/o,-1,1)),Math.asin(Nt(r/a,-1,1))-Math.asin(Nt(d/a,-1,1)))*(180/mt),l=Math.max(s,Math.min(n,l))),this.labelRotation=l}afterCalculateLabelRotation(){Q(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){Q(this.options.beforeFit,[this])}fit(){const t={width:0,height:0},{chart:e,options:{ticks:i,title:s,grid:n}}=this,o=this._isVisible(),r=this.isHorizontal();if(o){const o=Vs(s,e.options.font);if(r?(t.width=this.maxWidth,t.height=Bs(n)+o):(t.height=this.maxHeight,t.width=Bs(n)+o),i.display&&this.ticks.length){const{first:e,last:s,widest:n,highest:o}=this._getLabelSizes(),a=2*i.padding,l=Mt(this.labelRotation),h=Math.cos(l),c=Math.sin(l);if(r){const e=i.mirror?0:c*n.width+h*o.height;t.height=Math.min(this.maxHeight,t.height+e+a)}else{const e=i.mirror?0:h*n.width+c*o.height;t.width=Math.min(this.maxWidth,t.width+e+a)}this._calculatePadding(e,s,c,h)}}this._handleMargins(),r?(this.width=this._length=e.width-this._margins.left-this._margins.right,this.height=t.height):(this.width=t.width,this.height=this._length=e.height-this._margins.top-this._margins.bottom)}_calculatePadding(t,e,i,s){const{ticks:{align:n,padding:o},position:r}=this.options,a=0!==this.labelRotation,l="top"!==r&&"x"===this.axis;if(this.isHorizontal()){const r=this.getPixelForTick(0)-this.left,h=this.right-this.getPixelForTick(this.ticks.length-1);let c=0,d=0;a?l?(c=s*t.width,d=i*e.height):(c=i*t.height,d=s*e.width):"start"===n?d=e.width:"end"===n?c=t.width:"inner"!==n&&(c=t.width/2,d=e.width/2),this.paddingLeft=Math.max((c-r+o)*this.width/(this.width-r),0),this.paddingRight=Math.max((d-h+o)*this.width/(this.width-h),0)}else{let i=e.height/2,s=t.height/2;"start"===n?(i=0,s=t.height):"end"===n&&(i=e.height,s=0),this.paddingTop=i+o,this.paddingBottom=s+o}}_handleMargins(){this._margins&&(this._margins.left=Math.max(this.paddingLeft,this._margins.left),this._margins.top=Math.max(this.paddingTop,this._margins.top),this._margins.right=Math.max(this.paddingRight,this._margins.right),this._margins.bottom=Math.max(this.paddingBottom,this._margins.bottom))}afterFit(){Q(this.options.afterFit,[this])}isHorizontal(){const{axis:t,position:e}=this.options;return"top"===e||"bottom"===e||"x"===t}isFullSize(){return this.options.fullSize}_convertTicksToLabels(t){let e,i;for(this.beforeTickToLabelConversion(),this.generateTickLabels(t),e=0,i=t.length;e<i;e++)$(t[e].label)&&(t.splice(e,1),i--,e--);this.afterTickToLabelConversion()}_getLabelSizes(){let t=this._labelSizes;if(!t){const e=this.options.ticks.sampleSize;let i=this.ticks;e<i.length&&(i=Hs(i,e)),this._labelSizes=t=this._computeLabelSizes(i,i.length,this.options.ticks.maxTicksLimit)}return t}_computeLabelSizes(t,e,i){const{ctx:s,_longestTextCache:n}=this,o=[],r=[],a=Math.floor(e/Fs(e,i));let l,h,c,d,u,p,m,g,b,f,v,w=0,y=0;for(l=0;l<e;l+=a){if(d=t[l].label,u=this._resolveTickFontOptions(l),s.font=p=u.string,m=n[p]=n[p]||{data:{},gc:[]},g=u.lineHeight,b=f=0,$(d)||Y(d)){if(Y(d))for(h=0,c=d.length;h<c;++h)v=d[h],$(v)||Y(v)||(b=ce(s,m.data,m.gc,b,v),f+=g)}else b=ce(s,m.data,m.gc,b,d),f=g;o.push(b),r.push(f),w=Math.max(b,w),y=Math.max(f,y)}!function(t,e){tt(t,t=>{const i=t.gc,s=i.length/2;let n;if(s>e){for(n=0;n<s;++n)delete t.data[i[n]];i.splice(0,s)}})}(n,e);const _=o.indexOf(w),x=r.indexOf(y),C=t=>({width:o[t]||0,height:r[t]||0});return{first:C(0),last:C(e-1),widest:C(_),highest:C(x),widths:o,heights:r}}getLabelForValue(t){return t}getPixelForValue(t,e){return NaN}getValueForPixel(t){}getPixelForTick(t){const e=this.ticks;return t<0||t>e.length-1?null:this.getPixelForValue(e[t].value)}getPixelForDecimal(t){this._reversePixels&&(t=1-t);const e=this._startPixel+t*this._length;return Nt(this._alignToPixels?de(this.chart,e,0):e,-32768,32767)}getDecimalForPixel(t){const e=(t-this._startPixel)/this._length;return this._reversePixels?1-e:e}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:t,max:e}=this;return t<0&&e<0?e:t>0&&e>0?t:0}getContext(t){const e=this.ticks||[];if(t>=0&&t<e.length){const i=e[t];return i.$context||(i.$context=function(t,e,i){return Ne(t,{tick:i,index:e,type:"tick"})}(this.getContext(),t,i))}return this.$context||(this.$context=Ne(this.chart.getContext(),{scale:this,type:"scale"}))}_tickSize(){const t=this.options.ticks,e=Mt(this.labelRotation),i=Math.abs(Math.cos(e)),s=Math.abs(Math.sin(e)),n=this._getLabelSizes(),o=t.autoSkipPadding||0,r=n?n.widest.width+o:0,a=n?n.highest.height+o:0;return this.isHorizontal()?a*i>r*s?r/i:a/s:a*s<r*i?a/i:r/s}_isVisible(){const t=this.options.display;return"auto"!==t?!!t:this.getMatchingVisibleMetas().length>0}_computeGridLineItems(t){const e=this.axis,i=this.chart,s=this.options,{grid:n,position:o,border:r}=s,a=n.offset,l=this.isHorizontal(),h=this.ticks.length+(a?1:0),c=Bs(n),d=[],u=r.setContext(this.getContext()),p=u.display?u.width:0,m=p/2,g=function(t){return de(i,t,p)};let b,f,v,w,y,_,x,C,k,E,R,M;if("top"===o)b=g(this.bottom),_=this.bottom-c,C=b-m,E=g(t.top)+m,M=t.bottom;else if("bottom"===o)b=g(this.top),E=t.top,M=g(t.bottom)-m,_=b+m,C=this.top+c;else if("left"===o)b=g(this.right),y=this.right-c,x=b-m,k=g(t.left)+m,R=t.right;else if("right"===o)b=g(this.left),k=t.left,R=g(t.right)-m,y=b+m,x=this.left+c;else if("x"===e){if("center"===o)b=g((t.top+t.bottom)/2+.5);else if(K(o)){const t=Object.keys(o)[0],e=o[t];b=g(this.chart.scales[t].getPixelForValue(e))}E=t.top,M=t.bottom,_=b+m,C=_+c}else if("y"===e){if("center"===o)b=g((t.left+t.right)/2);else if(K(o)){const t=Object.keys(o)[0],e=o[t];b=g(this.chart.scales[t].getPixelForValue(e))}y=b-m,x=y-c,k=t.left,R=t.right}const T=J(s.ticks.maxTicksLimit,h),S=Math.max(1,Math.ceil(h/T));for(f=0;f<h;f+=S){const t=this.getContext(f),e=n.setContext(t),s=r.setContext(t),o=e.lineWidth,h=e.color,c=s.dash||[],u=s.dashOffset,p=e.tickWidth,m=e.tickColor,g=e.tickBorderDash||[],b=e.tickBorderDashOffset;v=Is(this,f,a),void 0!==v&&(w=de(i,v,o),l?y=x=k=R=w:_=C=E=M=w,d.push({tx1:y,ty1:_,tx2:x,ty2:C,x1:k,y1:E,x2:R,y2:M,width:o,color:h,borderDash:c,borderDashOffset:u,tickWidth:p,tickColor:m,tickBorderDash:g,tickBorderDashOffset:b}))}return this._ticksLength=h,this._borderValue=b,d}_computeLabelItems(t){const e=this.axis,i=this.options,{position:s,ticks:n}=i,o=this.isHorizontal(),r=this.ticks,{align:a,crossAlign:l,padding:h,mirror:c}=n,d=Bs(i.grid),u=d+h,p=c?-h:u,m=-Mt(this.labelRotation),g=[];let b,f,v,w,y,_,x,C,k,E,R,M,T="middle";if("top"===s)_=this.bottom-p,x=this._getXAxisLabelAlignment();else if("bottom"===s)_=this.top+p,x=this._getXAxisLabelAlignment();else if("left"===s){const t=this._getYAxisLabelAlignment(d);x=t.textAlign,y=t.x}else if("right"===s){const t=this._getYAxisLabelAlignment(d);x=t.textAlign,y=t.x}else if("x"===e){if("center"===s)_=(t.top+t.bottom)/2+u;else if(K(s)){const t=Object.keys(s)[0],e=s[t];_=this.chart.scales[t].getPixelForValue(e)+u}x=this._getXAxisLabelAlignment()}else if("y"===e){if("center"===s)y=(t.left+t.right)/2-u;else if(K(s)){const t=Object.keys(s)[0],e=s[t];y=this.chart.scales[t].getPixelForValue(e)}x=this._getYAxisLabelAlignment(d).textAlign}"y"===e&&("start"===a?T="top":"end"===a&&(T="bottom"));const S=this._getLabelSizes();for(b=0,f=r.length;b<f;++b){v=r[b],w=v.label;const t=n.setContext(this.getContext(b));C=this.getPixelForTick(b)+n.labelOffset,k=this._resolveTickFontOptions(b),E=k.lineHeight,R=Y(w)?w.length:1;const e=R/2,i=t.color,a=t.textStrokeColor,h=t.textStrokeWidth;let d,u=x;if(o?(y=C,"inner"===x&&(u=b===f-1?this.options.reverse?"left":"right":0===b?this.options.reverse?"right":"left":"center"),M="top"===s?"near"===l||0!==m?-R*E+E/2:"center"===l?-S.highest.height/2-e*E+E:-S.highest.height+E/2:"near"===l||0!==m?E/2:"center"===l?S.highest.height/2-e*E:S.highest.height-R*E,c&&(M*=-1),0===m||t.showLabelBackdrop||(y+=E/2*Math.sin(m))):(_=C,M=(1-R)*E/2),t.showLabelBackdrop){const e=Le(t.backdropPadding),i=S.heights[b],s=S.widths[b];let n=M-e.top,o=0-e.left;switch(T){case"middle":n-=i/2;break;case"bottom":n-=i}switch(x){case"center":o-=s/2;break;case"right":o-=s;break;case"inner":b===f-1?o-=s:b>0&&(o-=s/2)}d={left:o,top:n,width:s+e.width,height:i+e.height,color:t.backdropColor}}g.push({label:w,font:k,textOffset:M,options:{rotation:m,color:i,strokeColor:a,strokeWidth:h,textAlign:u,textBaseline:T,translation:[y,_],backdrop:d}})}return g}_getXAxisLabelAlignment(){const{position:t,ticks:e}=this.options;if(-Mt(this.labelRotation))return"top"===t?"left":"right";let i="center";return"start"===e.align?i="left":"end"===e.align?i="right":"inner"===e.align&&(i="inner"),i}_getYAxisLabelAlignment(t){const{position:e,ticks:{crossAlign:i,mirror:s,padding:n}}=this.options,o=t+n,r=this._getLabelSizes().widest.width;let a,l;return"left"===e?s?(l=this.right+n,"near"===i?a="left":"center"===i?(a="center",l+=r/2):(a="right",l+=r)):(l=this.right-o,"near"===i?a="right":"center"===i?(a="center",l-=r/2):(a="left",l=this.left)):"right"===e?s?(l=this.left+n,"near"===i?a="right":"center"===i?(a="center",l-=r/2):(a="left",l-=r)):(l=this.left+o,"near"===i?a="left":"center"===i?(a="center",l+=r/2):(a="right",l=this.right)):a="right",{textAlign:a,x:l}}_computeLabelArea(){if(this.options.ticks.mirror)return;const t=this.chart,e=this.options.position;return"left"===e||"right"===e?{top:0,left:this.left,bottom:t.height,right:this.right}:"top"===e||"bottom"===e?{top:this.top,left:0,bottom:this.bottom,right:t.width}:void 0}drawBackground(){const{ctx:t,options:{backgroundColor:e},left:i,top:s,width:n,height:o}=this;e&&(t.save(),t.fillStyle=e,t.fillRect(i,s,n,o),t.restore())}getLineWidthForValue(t){const e=this.options.grid;if(!this._isVisible()||!e.display)return 0;const i=this.ticks.findIndex(e=>e.value===t);return i>=0?e.setContext(this.getContext(i)).lineWidth:0}drawGrid(t){const e=this.options.grid,i=this.ctx,s=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t));let n,o;const r=(t,e,s)=>{s.width&&s.color&&(i.save(),i.lineWidth=s.width,i.strokeStyle=s.color,i.setLineDash(s.borderDash||[]),i.lineDashOffset=s.borderDashOffset,i.beginPath(),i.moveTo(t.x,t.y),i.lineTo(e.x,e.y),i.stroke(),i.restore())};if(e.display)for(n=0,o=s.length;n<o;++n){const t=s[n];e.drawOnChartArea&&r({x:t.x1,y:t.y1},{x:t.x2,y:t.y2},t),e.drawTicks&&r({x:t.tx1,y:t.ty1},{x:t.tx2,y:t.ty2},{color:t.tickColor,width:t.tickWidth,borderDash:t.tickBorderDash,borderDashOffset:t.tickBorderDashOffset})}}drawBorder(){const{chart:t,ctx:e,options:{border:i,grid:s}}=this,n=i.setContext(this.getContext()),o=i.display?n.width:0;if(!o)return;const r=s.setContext(this.getContext(0)).lineWidth,a=this._borderValue;let l,h,c,d;this.isHorizontal()?(l=de(t,this.left,o)-o/2,h=de(t,this.right,r)+r/2,c=d=a):(c=de(t,this.top,o)-o/2,d=de(t,this.bottom,r)+r/2,l=h=a),e.save(),e.lineWidth=n.width,e.strokeStyle=n.color,e.beginPath(),e.moveTo(l,c),e.lineTo(h,d),e.stroke(),e.restore()}drawLabels(t){if(!this.options.ticks.display)return;const e=this.ctx,i=this._computeLabelArea();i&&be(e,i);const s=this.getLabelItems(t);for(const t of s){const i=t.options,s=t.font;xe(e,t.label,0,t.textOffset,s,i)}i&&fe(e)}drawTitle(){const{ctx:t,options:{position:e,title:i,reverse:s}}=this;if(!i.display)return;const n=Pe(i.font),o=Le(i.padding),r=i.align;let a=n.lineHeight/2;"bottom"===e||"center"===e||K(e)?(a+=o.bottom,Y(i.text)&&(a+=n.lineHeight*(i.text.length-1))):a+=o.top;const{titleX:l,titleY:h,maxWidth:c,rotation:d}=function(t,e,i,s){const{top:n,left:o,bottom:r,right:a,chart:l}=t,{chartArea:h,scales:c}=l;let d,u,p,m=0;const g=r-n,b=a-o;if(t.isHorizontal()){if(u=Gt(s,o,a),K(i)){const t=Object.keys(i)[0],s=i[t];p=c[t].getPixelForValue(s)+g-e}else p="center"===i?(h.bottom+h.top)/2+g-e:Os(t,i,e);d=a-o}else{if(K(i)){const t=Object.keys(i)[0],s=i[t];u=c[t].getPixelForValue(s)-b+e}else u="center"===i?(h.left+h.right)/2-b+e:Os(t,i,e);p=Gt(s,r,n),m="left"===i?-wt:wt}return{titleX:u,titleY:p,maxWidth:d,rotation:m}}(this,a,e,r);xe(t,i.text,0,0,n,{color:i.color,maxWidth:c,rotation:d,textAlign:Ws(r,e,s),textBaseline:"middle",translation:[l,h]})}draw(t){this._isVisible()&&(this.drawBackground(),this.drawGrid(t),this.drawBorder(),this.drawTitle(),this.drawLabels(t))}_layers(){const t=this.options,e=t.ticks&&t.ticks.z||0,i=J(t.grid&&t.grid.z,-1),s=J(t.border&&t.border.z,0);return this._isVisible()&&this.draw===Gs.prototype.draw?[{z:i,draw:t=>{this.drawBackground(),this.drawGrid(t),this.drawTitle()}},{z:s,draw:()=>{this.drawBorder()}},{z:e,draw:t=>{this.drawLabels(t)}}]:[{z:e,draw:t=>{this.draw(t)}}]}getMatchingVisibleMetas(t){const e=this.chart.getSortedVisibleDatasetMetas(),i=this.axis+"AxisID",s=[];let n,o;for(n=0,o=e.length;n<o;++n){const o=e[n];o[i]!==this.id||t&&o.type!==t||s.push(o)}return s}_resolveTickFontOptions(t){return Pe(this.options.ticks.setContext(this.getContext(t)).font)}_maxDigits(){const t=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/t}}class Us{constructor(t,e,i){this.type=t,this.scope=e,this.override=i,this.items=Object.create(null)}isForType(t){return Object.prototype.isPrototypeOf.call(this.type.prototype,t.prototype)}register(t){const e=Object.getPrototypeOf(t);let i;(function(t){return"id"in t&&"defaults"in t})(e)&&(i=this.register(e));const s=this.items,n=t.id,o=this.scope+"."+n;if(!n)throw new Error("class does not have id: "+t);return n in s||(s[n]=t,function(t,e,i){const s=ot(Object.create(null),[i?he.get(i):{},he.get(e),t.defaults]);he.set(e,s),t.defaultRoutes&&function(t,e){Object.keys(e).forEach(i=>{const s=i.split("."),n=s.pop(),o=[t].concat(s).join("."),r=e[i].split("."),a=r.pop(),l=r.join(".");he.route(o,n,l,a)})}(e,t.defaultRoutes),t.descriptors&&he.describe(e,t.descriptors)}(t,o,i),this.override&&he.override(t.id,t.overrides)),o}get(t){return this.items[t]}unregister(t){const e=this.items,i=t.id,s=this.scope;i in e&&delete e[i],s&&i in he[s]&&(delete he[s][i],this.override&&delete ne[i])}}class $s{constructor(){this.controllers=new Us(Vi,"datasets",!0),this.elements=new Us(As,"elements"),this.plugins=new Us(Object,"plugins"),this.scales=new Us(Gs,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...t){this._each("register",t)}remove(...t){this._each("unregister",t)}addControllers(...t){this._each("register",t,this.controllers)}addElements(...t){this._each("register",t,this.elements)}addPlugins(...t){this._each("register",t,this.plugins)}addScales(...t){this._each("register",t,this.scales)}getController(t){return this._get(t,this.controllers,"controller")}getElement(t){return this._get(t,this.elements,"element")}getPlugin(t){return this._get(t,this.plugins,"plugin")}getScale(t){return this._get(t,this.scales,"scale")}removeControllers(...t){this._each("unregister",t,this.controllers)}removeElements(...t){this._each("unregister",t,this.elements)}removePlugins(...t){this._each("unregister",t,this.plugins)}removeScales(...t){this._each("unregister",t,this.scales)}_each(t,e,i){[...e].forEach(e=>{const s=i||this._getRegistryForType(e);i||s.isForType(e)||s===this.plugins&&e.id?this._exec(t,s,e):tt(e,e=>{const s=i||this._getRegistryForType(e);this._exec(t,s,e)})})}_exec(t,e,i){const s=ct(t);Q(i["before"+s],[],i),e[t](i),Q(i["after"+s],[],i)}_getRegistryForType(t){for(let e=0;e<this._typedRegistries.length;e++){const i=this._typedRegistries[e];if(i.isForType(t))return i}return this.plugins}_get(t,e,i){const s=e.get(t);if(void 0===s)throw new Error('"'+t+'" is not a registered '+i+".");return s}}var Ys=new $s;class Ks{constructor(){this._init=void 0}notify(t,e,i,s){if("beforeInit"===e&&(this._init=this._createDescriptors(t,!0),this._notify(this._init,t,"install")),void 0===this._init)return;const n=s?this._descriptors(t).filter(s):this._descriptors(t),o=this._notify(n,t,e,i);return"afterDestroy"===e&&(this._notify(n,t,"stop"),this._notify(this._init,t,"uninstall"),this._init=void 0),o}_notify(t,e,i,s){s=s||{};for(const n of t){const t=n.plugin;if(!1===Q(t[i],[e,s,n.options],t)&&s.cancelable)return!1}return!0}invalidate(){$(this._cache)||(this._oldCache=this._cache,this._cache=void 0)}_descriptors(t){if(this._cache)return this._cache;const e=this._cache=this._createDescriptors(t);return this._notifyStateChanges(t),e}_createDescriptors(t,e){const i=t&&t.config,s=J(i.options&&i.options.plugins,{}),n=function(t){const e={},i=[],s=Object.keys(Ys.plugins.items);for(let t=0;t<s.length;t++)i.push(Ys.getPlugin(s[t]));const n=t.plugins||[];for(let t=0;t<n.length;t++){const s=n[t];-1===i.indexOf(s)&&(i.push(s),e[s.id]=!0)}return{plugins:i,localIds:e}}(i);return!1!==s||e?function(t,{plugins:e,localIds:i},s,n){const o=[],r=t.getContext();for(const a of e){const e=a.id,l=Xs(s[e],n);null!==l&&o.push({plugin:a,options:qs(t.config,{plugin:a,local:i[e]},l,r)})}return o}(t,n,s,e):[]}_notifyStateChanges(t){const e=this._oldCache||[],i=this._cache,s=(t,e)=>t.filter(t=>!e.some(e=>t.plugin.id===e.plugin.id));this._notify(s(e,i),t,"stop"),this._notify(s(i,e),t,"start")}}function Xs(t,e){return e||!1!==t?!0===t?{}:t:null}function qs(t,{plugin:e,local:i},s,n){const o=t.pluginScopeKeys(e),r=t.getOptionScopes(s,o);return i&&e.defaults&&r.push(e.defaults),t.createResolver(r,n,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function Js(t,e){const i=he.datasets[t]||{};return((e.datasets||{})[t]||{}).indexAxis||e.indexAxis||i.indexAxis||"x"}function Zs(t){if("x"===t||"y"===t||"r"===t)return t}function Qs(t){return"top"===t||"bottom"===t?"x":"left"===t||"right"===t?"y":void 0}function tn(t,...e){if(Zs(t))return t;for(const i of e){const e=i.axis||Qs(i.position)||t.length>1&&Zs(t[0].toLowerCase());if(e)return e}throw new Error(`Cannot determine type of '${t}' axis. Please provide 'axis' or 'position' option.`)}function en(t,e,i){if(i[e+"AxisID"]===t)return{axis:e}}function sn(t){const e=t.options||(t.options={});e.plugins=J(e.plugins,{}),e.scales=function(t,e){const i=ne[t.type]||{scales:{}},s=e.scales||{},n=Js(t.type,e),o=Object.create(null);return Object.keys(s).forEach(e=>{const r=s[e];if(!K(r))return console.error(`Invalid scale configuration for scale: ${e}`);if(r._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${e}`);const a=tn(e,r,function(t,e){if(e.data&&e.data.datasets){const i=e.data.datasets.filter(e=>e.xAxisID===t||e.yAxisID===t);if(i.length)return en(t,"x",i[0])||en(t,"y",i[0])}return{}}(e,t),he.scales[r.type]),l=function(t,e){return t===e?"_index_":"_value_"}(a,n),h=i.scales||{};o[e]=rt(Object.create(null),[{axis:a},r,h[a],h[l]])}),t.data.datasets.forEach(i=>{const n=i.type||t.type,r=i.indexAxis||Js(n,e),a=(ne[n]||{}).scales||{};Object.keys(a).forEach(t=>{const e=function(t,e){let i=t;return"_index_"===t?i=e:"_value_"===t&&(i="x"===e?"y":"x"),i}(t,r),n=i[e+"AxisID"]||e;o[n]=o[n]||Object.create(null),rt(o[n],[{axis:e},s[n],a[t]])})}),Object.keys(o).forEach(t=>{const e=o[t];rt(e,[he.scales[e.type],he.scale])}),o}(t,e)}function nn(t){return(t=t||{}).datasets=t.datasets||[],t.labels=t.labels||[],t}const on=new Map,rn=new Set;function an(t,e){let i=on.get(t);return i||(i=e(),on.set(t,i),rn.add(i)),i}const ln=(t,e,i)=>{const s=ht(e,i);void 0!==s&&t.add(s)};class hn{constructor(t){this._config=function(t){return(t=t||{}).data=nn(t.data),sn(t),t}(t),this._scopeCache=new Map,this._resolverCache=new Map}get platform(){return this._config.platform}get type(){return this._config.type}set type(t){this._config.type=t}get data(){return this._config.data}set data(t){this._config.data=nn(t)}get options(){return this._config.options}set options(t){this._config.options=t}get plugins(){return this._config.plugins}update(){const t=this._config;this.clearCache(),sn(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return an(t,()=>[[`datasets.${t}`,""]])}datasetAnimationScopeKeys(t,e){return an(`${t}.transition.${e}`,()=>[[`datasets.${t}.transitions.${e}`,`transitions.${e}`],[`datasets.${t}`,""]])}datasetElementScopeKeys(t,e){return an(`${t}-${e}`,()=>[[`datasets.${t}.elements.${e}`,`datasets.${t}`,`elements.${e}`,""]])}pluginScopeKeys(t){const e=t.id;return an(`${this.type}-plugin-${e}`,()=>[[`plugins.${e}`,...t.additionalOptionScopes||[]]])}_cachedScopes(t,e){const i=this._scopeCache;let s=i.get(t);return s&&!e||(s=new Map,i.set(t,s)),s}getOptionScopes(t,e,i){const{options:s,type:n}=this,o=this._cachedScopes(t,i),r=o.get(e);if(r)return r;const a=new Set;e.forEach(e=>{t&&(a.add(t),e.forEach(e=>ln(a,t,e))),e.forEach(t=>ln(a,s,t)),e.forEach(t=>ln(a,ne[n]||{},t)),e.forEach(t=>ln(a,he,t)),e.forEach(t=>ln(a,oe,t))});const l=Array.from(a);return 0===l.length&&l.push(Object.create(null)),rn.has(e)&&o.set(e,l),l}chartOptionScopes(){const{options:t,type:e}=this;return[t,ne[e]||{},he.datasets[e]||{},{type:e},he,oe]}resolveNamedOptions(t,e,i,s=[""]){const n={$shared:!0},{resolver:o,subPrefixes:r}=cn(this._resolverCache,t,s);let a=o;(function(t,e){const{isScriptable:i,isIndexable:s}=Oe(t);for(const n of e){const e=i(n),o=s(n),r=(o||e)&&t[n];if(e&&(ut(r)||dn(r))||o&&Y(r))return!0}return!1})(o,e)&&(n.$shared=!1,a=ze(o,i=ut(i)?i():i,this.createResolver(t,i,r)));for(const t of e)n[t]=a[t];return n}createResolver(t,e,i=[""],s){const{resolver:n}=cn(this._resolverCache,t,i);return K(e)?ze(n,e,void 0,s):n}}function cn(t,e,i){let s=t.get(e);s||(s=new Map,t.set(e,s));const n=i.join();let o=s.get(n);return o||(o={resolver:Ae(e,i),subPrefixes:i.filter(t=>!t.toLowerCase().includes("hover"))},s.set(n,o)),o}const dn=t=>K(t)&&Object.getOwnPropertyNames(t).some(e=>ut(t[e])),un=["top","bottom","left","right","chartArea"];function pn(t,e){return"top"===t||"bottom"===t||-1===un.indexOf(t)&&"x"===e}function mn(t,e){return function(i,s){return i[t]===s[t]?i[e]-s[e]:i[t]-s[t]}}function gn(t){const e=t.chart,i=e.options.animation;e.notifyPlugins("afterRender"),Q(i&&i.onComplete,[t],e)}function bn(t){const e=t.chart,i=e.options.animation;Q(i&&i.onProgress,[t],e)}function fn(t){return ti()&&"string"==typeof t?t=document.getElementById(t):t&&t.length&&(t=t[0]),t&&t.canvas&&(t=t.canvas),t}const vn={},wn=t=>{const e=fn(t);return Object.values(vn).filter(t=>t.canvas===e).pop()};function yn(t,e,i){const s=Object.keys(t);for(const n of s){const s=+n;if(s>=e){const o=t[n];delete t[n],(i>0||s>e)&&(t[s+i]=o)}}}class xn{static defaults=he;static instances=vn;static overrides=ne;static registry=Ys;static version="4.5.1";static getChart=wn;static register(...t){Ys.add(...t),Cn()}static unregister(...t){Ys.remove(...t),Cn()}constructor(t,e){const i=this.config=new hn(e),s=fn(t),n=wn(s);if(n)throw new Error("Canvas is already in use. Chart with ID '"+n.id+"' must be destroyed before the canvas with ID '"+n.canvas.id+"' can be reused.");const o=i.createResolver(i.chartOptionScopes(),this.getContext());this.platform=new(i.platform||function(t){return!ti()||"undefined"!=typeof OffscreenCanvas&&t instanceof OffscreenCanvas?ws:Ns}(s)),this.platform.updateConfig(i);const r=this.platform.acquireContext(s,o.aspectRatio),a=r&&r.canvas,l=a&&a.height,h=a&&a.width;this.id=U(),this.ctx=r,this.canvas=a,this.width=h,this.height=l,this._options=o,this._aspectRatio=this.aspectRatio,this._layers=[],this._metasets=[],this._stacks=void 0,this.boxes=[],this.currentDevicePixelRatio=void 0,this.chartArea=void 0,this._active=[],this._lastEvent=void 0,this._listeners={},this._responsiveListeners=void 0,this._sortedMetasets=[],this.scales={},this._plugins=new Ks,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=function(t,e){let i;return function(...s){return e?(clearTimeout(i),i=setTimeout(t,e,s)):t.apply(this,s),e}}(t=>this.update(t),o.resizeDelay||0),this._dataChanges=[],vn[this.id]=this,r&&a?(Ri.listen(this,"complete",gn),Ri.listen(this,"progress",bn),this._initialize(),this.attached&&this.update()):console.error("Failed to create chart: can't acquire context from the given item")}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:e},width:i,height:s,_aspectRatio:n}=this;return $(t)?e&&n?n:s?i/s:null:t}get data(){return this.config.data}set data(t){this.config.data=t}get options(){return this._options}set options(t){this.config.options=t}get registry(){return Ys}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():li(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return ue(this.canvas,this.ctx),this}stop(){return Ri.stop(this),this}resize(t,e){Ri.running(this)?this._resizeBeforeDraw={width:t,height:e}:this._resize(t,e)}_resize(t,e){const i=this.options,s=this.canvas,n=i.maintainAspectRatio&&this.aspectRatio,o=this.platform.getMaximumSize(s,t,e,n),r=i.devicePixelRatio||this.platform.getDevicePixelRatio(),a=this.width?"resize":"attach";this.width=o.width,this.height=o.height,this._aspectRatio=this.aspectRatio,li(this,r,!0)&&(this.notifyPlugins("resize",{size:o}),Q(i.onResize,[this,o],this),this.attached&&this._doResize(a)&&this.render())}ensureScalesHaveIDs(){tt(this.options.scales||{},(t,e)=>{t.id=e})}buildOrUpdateScales(){const t=this.options,e=t.scales,i=this.scales,s=Object.keys(i).reduce((t,e)=>(t[e]=!1,t),{});let n=[];e&&(n=n.concat(Object.keys(e).map(t=>{const i=e[t],s=tn(t,i),n="r"===s,o="x"===s;return{options:i,dposition:n?"chartArea":o?"bottom":"left",dtype:n?"radialLinear":o?"category":"linear"}}))),tt(n,e=>{const n=e.options,o=n.id,r=tn(o,n),a=J(n.type,e.dtype);void 0!==n.position&&pn(n.position,r)===pn(e.dposition)||(n.position=e.dposition),s[o]=!0;let l=null;o in i&&i[o].type===a?l=i[o]:(l=new(Ys.getScale(a))({id:o,type:a,ctx:this.ctx,chart:this}),i[l.id]=l),l.init(n,t)}),tt(s,(t,e)=>{t||delete i[e]}),tt(i,t=>{fs.configure(this,t,t.options),fs.addBox(this,t)})}_updateMetasets(){const t=this._metasets,e=this.data.datasets.length,i=t.length;if(t.sort((t,e)=>t.index-e.index),i>e){for(let t=e;t<i;++t)this._destroyDatasetMeta(t);t.splice(e,i-e)}this._sortedMetasets=t.slice(0).sort(mn("order","index"))}_removeUnreferencedMetasets(){const{_metasets:t,data:{datasets:e}}=this;t.length>e.length&&delete this._stacks,t.forEach((t,i)=>{0===e.filter(e=>e===t._dataset).length&&this._destroyDatasetMeta(i)})}buildOrUpdateControllers(){const t=[],e=this.data.datasets;let i,s;for(this._removeUnreferencedMetasets(),i=0,s=e.length;i<s;i++){const s=e[i];let n=this.getDatasetMeta(i);const o=s.type||this.config.type;if(n.type&&n.type!==o&&(this._destroyDatasetMeta(i),n=this.getDatasetMeta(i)),n.type=o,n.indexAxis=s.indexAxis||Js(o,this.options),n.order=s.order||0,n.index=i,n.label=""+s.label,n.visible=this.isDatasetVisible(i),n.controller)n.controller.updateIndex(i),n.controller.linkScales();else{const e=Ys.getController(o),{datasetElementType:s,dataElementType:r}=he.datasets[o];Object.assign(e,{dataElementType:Ys.getElement(r),datasetElementType:s&&Ys.getElement(s)}),n.controller=new e(this,i),t.push(n.controller)}}return this._updateMetasets(),t}_resetElements(){tt(this.data.datasets,(t,e)=>{this.getDatasetMeta(e).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(t){const e=this.config;e.update();const i=this._options=e.createResolver(e.chartOptionScopes(),this.getContext()),s=this._animationsDisabled=!i.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),!1===this.notifyPlugins("beforeUpdate",{mode:t,cancelable:!0}))return;const n=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let o=0;for(let t=0,e=this.data.datasets.length;t<e;t++){const{controller:e}=this.getDatasetMeta(t),i=!s&&-1===n.indexOf(e);e.buildOrUpdateElements(i),o=Math.max(+e.getMaxOverflow(),o)}o=this._minPadding=i.layout.autoPadding?o:0,this._updateLayout(o),s||tt(n,t=>{t.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(mn("z","_idx"));const{_active:r,_lastEvent:a}=this;a?this._eventHandler(a,!0):r.length&&this._updateHoverStyles(r,r,!0),this.render()}_updateScales(){tt(this.scales,t=>{fs.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,e=new Set(Object.keys(this._listeners)),i=new Set(t.events);pt(e,i)&&!!this._responsiveListeners===t.responsive||(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:t}=this,e=this._getUniformDataChanges()||[];for(const{method:i,start:s,count:n}of e)yn(t,s,"_removeElements"===i?-n:n)}_getUniformDataChanges(){const t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];const e=this.data.datasets.length,i=e=>new Set(t.filter(t=>t[0]===e).map((t,e)=>e+","+t.splice(1).join(","))),s=i(0);for(let t=1;t<e;t++)if(!pt(s,i(t)))return;return Array.from(s).map(t=>t.split(",")).map(t=>({method:t[1],start:+t[2],count:+t[3]}))}_updateLayout(t){if(!1===this.notifyPlugins("beforeLayout",{cancelable:!0}))return;fs.update(this,this.width,this.height,t);const e=this.chartArea,i=e.width<=0||e.height<=0;this._layers=[],tt(this.boxes,t=>{i&&"chartArea"===t.position||(t.configure&&t.configure(),this._layers.push(...t._layers()))},this),this._layers.forEach((t,e)=>{t._idx=e}),this.notifyPlugins("afterLayout")}_updateDatasets(t){if(!1!==this.notifyPlugins("beforeDatasetsUpdate",{mode:t,cancelable:!0})){for(let t=0,e=this.data.datasets.length;t<e;++t)this.getDatasetMeta(t).controller.configure();for(let e=0,i=this.data.datasets.length;e<i;++e)this._updateDataset(e,ut(t)?t({datasetIndex:e}):t);this.notifyPlugins("afterDatasetsUpdate",{mode:t})}}_updateDataset(t,e){const i=this.getDatasetMeta(t),s={meta:i,index:t,mode:e,cancelable:!0};!1!==this.notifyPlugins("beforeDatasetUpdate",s)&&(i.controller._update(e),s.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",s))}render(){!1!==this.notifyPlugins("beforeRender",{cancelable:!0})&&(Ri.has(this)?this.attached&&!Ri.running(this)&&Ri.start(this):(this.draw(),gn({chart:this})))}draw(){let t;if(this._resizeBeforeDraw){const{width:t,height:e}=this._resizeBeforeDraw;this._resizeBeforeDraw=null,this._resize(t,e)}if(this.clear(),this.width<=0||this.height<=0)return;if(!1===this.notifyPlugins("beforeDraw",{cancelable:!0}))return;const e=this._layers;for(t=0;t<e.length&&e[t].z<=0;++t)e[t].draw(this.chartArea);for(this._drawDatasets();t<e.length;++t)e[t].draw(this.chartArea);this.notifyPlugins("afterDraw")}_getSortedDatasetMetas(t){const e=this._sortedMetasets,i=[];let s,n;for(s=0,n=e.length;s<n;++s){const n=e[s];t&&!n.visible||i.push(n)}return i}getSortedVisibleDatasetMetas(){return this._getSortedDatasetMetas(!0)}_drawDatasets(){if(!1===this.notifyPlugins("beforeDatasetsDraw",{cancelable:!0}))return;const t=this.getSortedVisibleDatasetMetas();for(let e=t.length-1;e>=0;--e)this._drawDataset(t[e]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(t){const e=this.ctx,i={meta:t,index:t.index,cancelable:!0},s=ki(this,t);!1!==this.notifyPlugins("beforeDatasetDraw",i)&&(s&&be(e,s),t.controller.draw(),s&&fe(e),i.cancelable=!1,this.notifyPlugins("afterDatasetDraw",i))}isPointInArea(t){return ge(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,e,i,s){const n=os.modes[e];return"function"==typeof n?n(this,t,i,s):[]}getDatasetMeta(t){const e=this.data.datasets[t],i=this._metasets;let s=i.filter(t=>t&&t._dataset===e).pop();return s||(s={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:e&&e.order||0,index:t,_dataset:e,_parsed:[],_sorted:!1},i.push(s)),s}getContext(){return this.$context||(this.$context=Ne(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){const e=this.data.datasets[t];if(!e)return!1;const i=this.getDatasetMeta(t);return"boolean"==typeof i.hidden?!i.hidden:!e.hidden}setDatasetVisibility(t,e){this.getDatasetMeta(t).hidden=!e}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}getDataVisibility(t){return!this._hiddenIndices[t]}_updateVisibility(t,e,i){const s=i?"show":"hide",n=this.getDatasetMeta(t),o=n.controller._resolveAnimations(void 0,s);dt(e)?(n.data[e].hidden=!i,this.update()):(this.setDatasetVisibility(t,i),o.update(n,{visible:i}),this.update(e=>e.datasetIndex===t?s:void 0))}hide(t,e){this._updateVisibility(t,e,!1)}show(t,e){this._updateVisibility(t,e,!0)}_destroyDatasetMeta(t){const e=this._metasets[t];e&&e.controller&&e.controller._destroy(),delete this._metasets[t]}_stop(){let t,e;for(this.stop(),Ri.remove(this),t=0,e=this.data.datasets.length;t<e;++t)this._destroyDatasetMeta(t)}destroy(){this.notifyPlugins("beforeDestroy");const{canvas:t,ctx:e}=this;this._stop(),this.config.clearCache(),t&&(this.unbindEvents(),ue(t,e),this.platform.releaseContext(e),this.canvas=null,this.ctx=null),delete vn[this.id],this.notifyPlugins("afterDestroy")}toBase64Image(...t){return this.canvas.toDataURL(...t)}bindEvents(){this.bindUserEvents(),this.options.responsive?this.bindResponsiveEvents():this.attached=!0}bindUserEvents(){const t=this._listeners,e=this.platform,i=(i,s)=>{e.addEventListener(this,i,s),t[i]=s},s=(t,e,i)=>{t.offsetX=e,t.offsetY=i,this._eventHandler(t)};tt(this.options.events,t=>i(t,s))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const t=this._responsiveListeners,e=this.platform,i=(i,s)=>{e.addEventListener(this,i,s),t[i]=s},s=(i,s)=>{t[i]&&(e.removeEventListener(this,i,s),delete t[i])},n=(t,e)=>{this.canvas&&this.resize(t,e)};let o;const r=()=>{s("attach",r),this.attached=!0,this.resize(),i("resize",n),i("detach",o)};o=()=>{this.attached=!1,s("resize",n),this._stop(),this._resize(0,0),i("attach",r)},e.isAttached(this.canvas)?r():o()}unbindEvents(){tt(this._listeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._listeners={},tt(this._responsiveListeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._responsiveListeners=void 0}updateHoverStyle(t,e,i){const s=i?"set":"remove";let n,o,r,a;for("dataset"===e&&(n=this.getDatasetMeta(t[0].datasetIndex),n.controller["_"+s+"DatasetHoverStyle"]()),r=0,a=t.length;r<a;++r){o=t[r];const e=o&&this.getDatasetMeta(o.datasetIndex).controller;e&&e[s+"HoverStyle"](o.element,o.datasetIndex,o.index)}}getActiveElements(){return this._active||[]}setActiveElements(t){const e=this._active||[],i=t.map(({datasetIndex:t,index:e})=>{const i=this.getDatasetMeta(t);if(!i)throw new Error("No dataset found at index "+t);return{datasetIndex:t,element:i.data[e],index:e}});!et(i,e)&&(this._active=i,this._lastEvent=null,this._updateHoverStyles(i,e))}notifyPlugins(t,e,i){return this._plugins.notify(this,t,e,i)}isPluginEnabled(t){return 1===this._plugins._cache.filter(e=>e.plugin.id===t).length}_updateHoverStyles(t,e,i){const s=this.options.hover,n=(t,e)=>t.filter(t=>!e.some(e=>t.datasetIndex===e.datasetIndex&&t.index===e.index)),o=n(e,t),r=i?t:n(t,e);o.length&&this.updateHoverStyle(o,s.mode,!1),r.length&&s.mode&&this.updateHoverStyle(r,s.mode,!0)}_eventHandler(t,e){const i={event:t,replay:e,cancelable:!0,inChartArea:this.isPointInArea(t)},s=e=>(e.options.events||this.options.events).includes(t.native.type);if(!1===this.notifyPlugins("beforeEvent",i,s))return;const n=this._handleEvent(t,e,i.inChartArea);return i.cancelable=!1,this.notifyPlugins("afterEvent",i,s),(n||i.changed)&&this.render(),this}_handleEvent(t,e,i){const{_active:s=[],options:n}=this,o=e,r=this._getActiveElements(t,s,i,o),a=function(t){return"mouseup"===t.type||"click"===t.type||"contextmenu"===t.type}(t),l=function(t,e,i,s){return i&&"mouseout"!==t.type?s?e:t:null}(t,this._lastEvent,i,a);i&&(this._lastEvent=null,Q(n.onHover,[t,r,this],this),a&&Q(n.onClick,[t,r,this],this));const h=!et(r,s);return(h||e)&&(this._active=r,this._updateHoverStyles(r,s,e)),this._lastEvent=l,h}_getActiveElements(t,e,i,s){if("mouseout"===t.type)return[];if(!i)return e;const n=this.options.hover;return this.getElementsAtEventForMode(t,n.mode,n,s)}}function Cn(){return tt(xn.instances,t=>t._plugins.invalidate())}function kn(t,e,i,s){return{x:i+t*Math.cos(e),y:s+t*Math.sin(e)}}function En(t,e,i,s,n,o){const{x:r,y:a,startAngle:l,pixelMargin:h,innerRadius:c}=e,d=Math.max(e.outerRadius+s+i-h,0),u=c>0?c+s+i+h:0;let p=0;const m=n-l;if(s){const t=((c>0?c-s:0)+(d>0?d-s:0))/2;p=(m-(0!==t?m*t/(t+s):m))/2}const g=(m-Math.max(.001,m*d-i/mt)/d)/2,b=l+g+p,f=n-g-p,{outerStart:v,outerEnd:w,innerStart:y,innerEnd:_}=function(t,e,i,s){const n=Te(t.options.borderRadius,["outerStart","outerEnd","innerStart","innerEnd"]),o=(i-e)/2,r=Math.min(o,s*e/2),a=t=>{const e=(i-Math.min(o,t))*s/2;return Nt(t,0,Math.min(o,e))};return{outerStart:a(n.outerStart),outerEnd:a(n.outerEnd),innerStart:Nt(n.innerStart,0,r),innerEnd:Nt(n.innerEnd,0,r)}}(e,u,d,f-b),x=d-v,C=d-w,k=b+v/x,E=f-w/C,R=u+y,M=u+_,T=b+y/R,S=f-_/M;if(t.beginPath(),o){const e=(k+E)/2;if(t.arc(r,a,d,k,e),t.arc(r,a,d,e,E),w>0){const e=kn(C,E,r,a);t.arc(e.x,e.y,w,E,f+wt)}const i=kn(M,f,r,a);if(t.lineTo(i.x,i.y),_>0){const e=kn(M,S,r,a);t.arc(e.x,e.y,_,f+wt,S+Math.PI)}const s=(f-_/u+(b+y/u))/2;if(t.arc(r,a,u,f-_/u,s,!0),t.arc(r,a,u,s,b+y/u,!0),y>0){const e=kn(R,T,r,a);t.arc(e.x,e.y,y,T+Math.PI,b-wt)}const n=kn(x,b,r,a);if(t.lineTo(n.x,n.y),v>0){const e=kn(x,k,r,a);t.arc(e.x,e.y,v,b-wt,k)}}else{t.moveTo(r,a);const e=Math.cos(k)*d+r,i=Math.sin(k)*d+a;t.lineTo(e,i);const s=Math.cos(E)*d+r,n=Math.sin(E)*d+a;t.lineTo(s,n)}t.closePath()}function Rn(t,e,i=e){t.lineCap=J(i.borderCapStyle,e.borderCapStyle),t.setLineDash(J(i.borderDash,e.borderDash)),t.lineDashOffset=J(i.borderDashOffset,e.borderDashOffset),t.lineJoin=J(i.borderJoinStyle,e.borderJoinStyle),t.lineWidth=J(i.borderWidth,e.borderWidth),t.strokeStyle=J(i.borderColor,e.borderColor)}function Mn(t,e,i){t.lineTo(i.x,i.y)}function Tn(t,e,i={}){const s=t.length,{start:n=0,end:o=s-1}=i,{start:r,end:a}=e,l=Math.max(n,r),h=Math.min(o,a),c=n<r&&o<r||n>a&&o>a;return{count:s,start:l,loop:e.loop,ilen:h<l&&!c?s+h-l:h-l}}function Sn(t,e,i,s){const{points:n,options:o}=e,{count:r,start:a,loop:l,ilen:h}=Tn(n,i,s),c=function(t){return t.stepped?ve:t.tension||"monotone"===t.cubicInterpolationMode?we:Mn}(o);let d,u,p,{move:m=!0,reverse:g}=s||{};for(d=0;d<=h;++d)u=n[(a+(g?h-d:d))%r],u.skip||(m?(t.moveTo(u.x,u.y),m=!1):c(t,p,u,g,o.stepped),p=u);return l&&(u=n[(a+(g?h:0))%r],c(t,p,u,g,o.stepped)),!!l}function Dn(t,e,i,s){const n=e.points,{count:o,start:r,ilen:a}=Tn(n,i,s),{move:l=!0,reverse:h}=s||{};let c,d,u,p,m,g,b=0,f=0;const v=t=>(r+(h?a-t:t))%o,w=()=>{p!==m&&(t.lineTo(b,m),t.lineTo(b,p),t.lineTo(b,g))};for(l&&(d=n[v(0)],t.moveTo(d.x,d.y)),c=0;c<=a;++c){if(d=n[v(c)],d.skip)continue;const e=d.x,i=d.y,s=0|e;s===u?(i<p?p=i:i>m&&(m=i),b=(f*b+e)/++f):(w(),t.lineTo(e,i),u=s,f=0,p=m=i),g=i}w()}function Ln(t){const e=t.options,i=e.borderDash&&e.borderDash.length;return t._decimated||t._loop||e.tension||"monotone"===e.cubicInterpolationMode||e.stepped||i?Sn:Dn}const Pn="function"==typeof Path2D;class jn extends As{static id="line";static defaults={borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0};static defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};static descriptors={_scriptable:!0,_indexable:t=>"borderDash"!==t&&"fill"!==t};constructor(t){super(),this.animated=!0,this.options=void 0,this._chart=void 0,this._loop=void 0,this._fullLoop=void 0,this._path=void 0,this._points=void 0,this._segments=void 0,this._decimated=!1,this._pointsUpdated=!1,this._datasetIndex=void 0,t&&Object.assign(this,t)}updateControlPoints(t,e){const i=this.options;if((i.tension||"monotone"===i.cubicInterpolationMode)&&!i.stepped&&!this._pointsUpdated){const s=i.spanGaps?this._loop:this._fullLoop;Qe(this._points,i,t,s,e),this._pointsUpdated=!0}}set points(t){this._points=t,delete this._segments,delete this._path,this._pointsUpdated=!1}get points(){return this._points}get segments(){return this._segments||(this._segments=function(t,e){const i=t.points,s=t.options.spanGaps,n=i.length;if(!n)return[];const o=!!t._loop,{start:r,end:a}=function(t,e,i,s){let n=0,o=e-1;if(i&&!s)for(;n<e&&!t[n].skip;)n++;for(;n<e&&t[n].skip;)n++;for(n%=e,i&&(o+=n);o>n&&t[o%e].skip;)o--;return o%=e,{start:n,end:o}}(i,n,o,s);return function(t,e,i,s){return s&&s.setContext&&i?function(t,e,i,s){const n=t._chart.getContext(),o=_i(t.options),{_datasetIndex:r,options:{spanGaps:a}}=t,l=i.length,h=[];let c=o,d=e[0].start,u=d;function p(t,e,s,n){const o=a?-1:1;if(t!==e){for(t+=l;i[t%l].skip;)t-=o;for(;i[e%l].skip;)e+=o;t%l!==e%l&&(h.push({start:t%l,end:e%l,loop:s,style:n}),c=n,d=e%l)}}for(const t of e){d=a?d:t.start;let e,o=i[d%l];for(u=d+1;u<=t.end;u++){const a=i[u%l];e=_i(s.setContext(Ne(n,{type:"segment",p0:o,p1:a,p0DataIndex:(u-1)%l,p1DataIndex:u%l,datasetIndex:r}))),xi(e,c)&&p(d,u-1,t.loop,c),o=a,c=e}d<u-1&&p(d,u-1,t.loop,c)}return h}(t,e,i,s):e}(t,!0===s?[{start:r,end:a,loop:o}]:function(t,e,i,s){const n=t.length,o=[];let r,a=e,l=t[e];for(r=e+1;r<=i;++r){const i=t[r%n];i.skip||i.stop?l.skip||(s=!1,o.push({start:e%n,end:(r-1)%n,loop:s}),e=a=i.stop?r:null):(a=r,l.skip&&(e=r)),l=i}return null!==a&&o.push({start:e%n,end:a%n,loop:s}),o}(i,r,a<r?a+n:a,!!t._fullLoop&&0===r&&a===n-1),i,e)}(this,this.options.segment))}first(){const t=this.segments,e=this.points;return t.length&&e[t[0].start]}last(){const t=this.segments,e=this.points,i=t.length;return i&&e[t[i-1].end]}interpolate(t,e){const i=this.options,s=t[e],n=this.points,o=yi(this,{property:e,start:s,end:s});if(!o.length)return;const r=[],a=function(t){return t.stepped?ui:t.tension||"monotone"===t.cubicInterpolationMode?pi:di}(i);let l,h;for(l=0,h=o.length;l<h;++l){const{start:h,end:c}=o[l],d=n[h],u=n[c];if(d===u){r.push(d);continue}const p=a(d,u,Math.abs((s-d[e])/(u[e]-d[e])),i.stepped);p[e]=t[e],r.push(p)}return 1===r.length?r[0]:r}pathSegment(t,e,i){return Ln(this)(t,this,e,i)}path(t,e,i){const s=this.segments,n=Ln(this);let o=this._loop;e=e||0,i=i||this.points.length-e;for(const r of s)o&=n(t,this,r,{start:e,end:e+i-1});return!!o}draw(t,e,i,s){const n=this.options||{};(this.points||[]).length&&n.borderWidth&&(t.save(),function(t,e,i,s){Pn&&!e.options.segment?function(t,e,i,s){let n=e._path;n||(n=e._path=new Path2D,e.path(n,i,s)&&n.closePath()),Rn(t,e.options),t.stroke(n)}(t,e,i,s):function(t,e,i,s){const{segments:n,options:o}=e,r=Ln(e);for(const a of n)Rn(t,o,a.style),t.beginPath(),r(t,e,a,{start:i,end:i+s-1})&&t.closePath(),t.stroke()}(t,e,i,s)}(t,this,i,s),t.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}function Nn(t,e,i,s){const n=t.options,{[i]:o}=t.getProps([i],s);return Math.abs(e-o)<n.radius+n.hitRadius}function An(t,e){const{x:i,y:s,base:n,width:o,height:r}=t.getProps(["x","y","base","width","height"],e);let a,l,h,c,d;return t.horizontal?(d=r/2,a=Math.min(i,n),l=Math.max(i,n),h=s-d,c=s+d):(d=o/2,a=i-d,l=i+d,h=Math.min(s,n),c=Math.max(s,n)),{left:a,top:h,right:l,bottom:c}}function zn(t,e,i,s){return t?0:Nt(e,i,s)}function On(t,e,i,s){const n=null===e,o=null===i,r=t&&!(n&&o)&&An(t,s);return r&&(n||At(e,r.left,r.right))&&(o||At(i,r.top,r.bottom))}function Fn(t,e){t.rect(e.x,e.y,e.w,e.h)}function Hn(t,e,i={}){const s=t.x!==i.x?-e:0,n=t.y!==i.y?-e:0,o=(t.x+t.w!==i.x+i.w?e:0)-s,r=(t.y+t.h!==i.y+i.h?e:0)-n;return{x:t.x+s,y:t.y+n,w:t.w+o,h:t.h+r,radius:t.radius}}function In(t,e,i,s){if(s)return;let n=e[t],o=i[t];return"angle"===t&&(n=Pt(n),o=Pt(o)),{property:t,start:n,end:o}}function Bn(t,e,i){for(;e>t;e--){const t=i[e];if(!isNaN(t.x)&&!isNaN(t.y))break}return e}function Vn(t,e,i,s){return t&&e?s(t[i],e[i]):t?t[i]:e?e[i]:0}function Wn(t,e){let i=[],s=!1;return Y(t)?(s=!0,i=t):i=function(t,e){const{x:i=null,y:s=null}=t||{},n=e.points,o=[];return e.segments.forEach(({start:t,end:e})=>{e=Bn(t,e,n);const r=n[t],a=n[e];null!==s?(o.push({x:r.x,y:s}),o.push({x:a.x,y:s})):null!==i&&(o.push({x:i,y:r.y}),o.push({x:i,y:a.y}))}),o}(t,e),i.length?new jn({points:i,options:{tension:0},_loop:s,_fullLoop:s}):null}function Gn(t){return t&&!1!==t.fill}function Un(t,e,i){let s=t[e].fill;const n=[e];let o;if(!i)return s;for(;!1!==s&&-1===n.indexOf(s);){if(!X(s))return s;if(o=t[s],!o)return!1;if(o.visible)return s;n.push(s),s=o.fill}return!1}function $n(t,e,i){const s=function(t){const e=t.options,i=e.fill;let s=J(i&&i.target,i);return void 0===s&&(s=!!e.backgroundColor),!1!==s&&null!==s&&(!0===s?"origin":s)}(t);if(K(s))return!isNaN(s.value)&&s;let n=parseFloat(s);return X(n)&&Math.floor(n)===n?function(t,e,i,s){return"-"!==t&&"+"!==t||(i=e+i),!(i===e||i<0||i>=s)&&i}(s[0],e,n,i):["origin","start","end","stack","shape"].indexOf(s)>=0&&s}function Yn(t,e,i){const s=[];for(let n=0;n<i.length;n++){const o=i[n],{first:r,last:a,point:l}=Kn(o,e,"x");if(!(!l||r&&a))if(r)s.unshift(l);else if(t.push(l),!a)break}t.push(...s)}function Kn(t,e,i){const s=t.interpolate(e,i);if(!s)return{};const n=s[i],o=t.segments,r=t.points;let a=!1,l=!1;for(let t=0;t<o.length;t++){const e=o[t],s=r[e.start][i],h=r[e.end][i];if(At(n,s,h)){a=n===s,l=n===h;break}}return{first:a,last:l,point:s}}class Xn{constructor(t){this.x=t.x,this.y=t.y,this.radius=t.radius}pathSegment(t,e,i){const{x:s,y:n,radius:o}=this;return e=e||{start:0,end:gt},t.arc(s,n,o,e.end,e.start,!0),!i.bounds}interpolate(t){const{x:e,y:i,radius:s}=this,n=t.angle;return{x:e+Math.cos(n)*s,y:i+Math.sin(n)*s,angle:n}}}function qn(t,e,i){const s=function(t){const{chart:e,fill:i,line:s}=t;if(X(i))return function(t,e){const i=t.getDatasetMeta(e);return i&&t.isDatasetVisible(e)?i.dataset:null}(e,i);if("stack"===i)return function(t){const{scale:e,index:i,line:s}=t,n=[],o=s.segments,r=s.points,a=function(t,e){const i=[],s=t.getMatchingVisibleMetas("line");for(let t=0;t<s.length;t++){const n=s[t];if(n.index===e)break;n.hidden||i.unshift(n.dataset)}return i}(e,i);a.push(Wn({x:null,y:e.bottom},s));for(let t=0;t<o.length;t++){const e=o[t];for(let t=e.start;t<=e.end;t++)Yn(n,r[t],a)}return new jn({points:n,options:{}})}(t);if("shape"===i)return!0;const n=function(t){return(t.scale||{}).getPointPositionForValue?function(t){const{scale:e,fill:i}=t,s=e.options,n=e.getLabels().length,o=s.reverse?e.max:e.min,r=function(t,e,i){let s;return s="start"===t?i:"end"===t?e.options.reverse?e.min:e.max:K(t)?t.value:e.getBaseValue(),s}(i,e,o),a=[];if(s.grid.circular){const t=e.getPointPositionForValue(0,o);return new Xn({x:t.x,y:t.y,radius:e.getDistanceFromCenterForValue(r)})}for(let t=0;t<n;++t)a.push(e.getPointPositionForValue(t,r));return a}(t):function(t){const{scale:e={},fill:i}=t,s=function(t,e){let i=null;return"start"===t?i=e.bottom:"end"===t?i=e.top:K(t)?i=e.getPixelForValue(t.value):e.getBasePixel&&(i=e.getBasePixel()),i}(i,e);if(X(s)){const t=e.isHorizontal();return{x:t?s:null,y:t?null:s}}return null}(t)}(t);return n instanceof Xn?n:Wn(n,s)}(e),{chart:n,index:o,line:r,scale:a,axis:l}=e,h=r.options,c=h.fill,d=h.backgroundColor,{above:u=d,below:p=d}=c||{},m=n.getDatasetMeta(o),g=ki(n,m);s&&r.points.length&&(be(t,i),function(t,e){const{line:i,target:s,above:n,below:o,area:r,scale:a,clip:l}=e,h=i._loop?"angle":e.axis;t.save();let c=o;o!==n&&("x"===h?(Jn(t,s,r.top),Qn(t,{line:i,target:s,color:n,scale:a,property:h,clip:l}),t.restore(),t.save(),Jn(t,s,r.bottom)):"y"===h&&(Zn(t,s,r.left),Qn(t,{line:i,target:s,color:o,scale:a,property:h,clip:l}),t.restore(),t.save(),Zn(t,s,r.right),c=n)),Qn(t,{line:i,target:s,color:c,scale:a,property:h,clip:l}),t.restore()}(t,{line:r,target:s,above:u,below:p,area:i,scale:a,axis:l,clip:g}),fe(t))}function Jn(t,e,i){const{segments:s,points:n}=e;let o=!0,r=!1;t.beginPath();for(const a of s){const{start:s,end:l}=a,h=n[s],c=n[Bn(s,l,n)];o?(t.moveTo(h.x,h.y),o=!1):(t.lineTo(h.x,i),t.lineTo(h.x,h.y)),r=!!e.pathSegment(t,a,{move:r}),r?t.closePath():t.lineTo(c.x,i)}t.lineTo(e.first().x,i),t.closePath(),t.clip()}function Zn(t,e,i){const{segments:s,points:n}=e;let o=!0,r=!1;t.beginPath();for(const a of s){const{start:s,end:l}=a,h=n[s],c=n[Bn(s,l,n)];o?(t.moveTo(h.x,h.y),o=!1):(t.lineTo(i,h.y),t.lineTo(h.x,h.y)),r=!!e.pathSegment(t,a,{move:r}),r?t.closePath():t.lineTo(i,c.y)}t.lineTo(i,e.first().y),t.closePath(),t.clip()}function Qn(t,e){const{line:i,target:s,property:n,color:o,scale:r,clip:a}=e,l=function(t,e,i){const s=t.segments,n=t.points,o=e.points,r=[];for(const t of s){let{start:s,end:a}=t;a=Bn(s,a,n);const l=In(i,n[s],n[a],t.loop);if(!e.segments){r.push({source:t,target:l,start:n[s],end:n[a]});continue}const h=yi(e,l);for(const e of h){const s=In(i,o[e.start],o[e.end],e.loop),a=wi(t,n,s);for(const t of a)r.push({source:t,target:e,start:{[i]:Vn(l,s,"start",Math.max)},end:{[i]:Vn(l,s,"end",Math.min)}})}}return r}(i,s,n);for(const{source:e,target:h,start:c,end:d}of l){const{style:{backgroundColor:l=o}={}}=e,u=!0!==s;t.save(),t.fillStyle=l,to(t,r,a,u&&In(n,c,d)),t.beginPath();const p=!!i.pathSegment(t,e);let m;if(u){p?t.closePath():eo(t,s,d,n);const e=!!s.pathSegment(t,h,{move:p,reverse:!0});m=p&&e,m||eo(t,s,c,n)}t.closePath(),t.fill(m?"evenodd":"nonzero"),t.restore()}}function to(t,e,i,s){const n=e.chart.chartArea,{property:o,start:r,end:a}=s||{};if("x"===o||"y"===o){let e,s,l,h;"x"===o?(e=r,s=n.top,l=a,h=n.bottom):(e=n.left,s=r,l=n.right,h=a),t.beginPath(),i&&(e=Math.max(e,i.left),l=Math.min(l,i.right),s=Math.max(s,i.top),h=Math.min(h,i.bottom)),t.rect(e,s,l-e,h-s),t.clip()}}function eo(t,e,i,s){const n=e.interpolate(i,s);n&&t.lineTo(n.x,n.y)}var io={id:"filler",afterDatasetsUpdate(t,e,i){const s=(t.data.datasets||[]).length,n=[];let o,r,a,l;for(r=0;r<s;++r)o=t.getDatasetMeta(r),a=o.dataset,l=null,a&&a.options&&a instanceof jn&&(l={visible:t.isDatasetVisible(r),index:r,fill:$n(a,r,s),chart:t,axis:o.controller.options.indexAxis,scale:o.vScale,line:a}),o.$filler=l,n.push(l);for(r=0;r<s;++r)l=n[r],l&&!1!==l.fill&&(l.fill=Un(n,r,i.propagate))},beforeDraw(t,e,i){const s="beforeDraw"===i.drawTime,n=t.getSortedVisibleDatasetMetas(),o=t.chartArea;for(let e=n.length-1;e>=0;--e){const i=n[e].$filler;i&&(i.line.updateControlPoints(o,i.axis),s&&i.fill&&qn(t.ctx,i,o))}},beforeDatasetsDraw(t,e,i){if("beforeDatasetsDraw"!==i.drawTime)return;const s=t.getSortedVisibleDatasetMetas();for(let e=s.length-1;e>=0;--e){const i=s[e].$filler;Gn(i)&&qn(t.ctx,i,t.chartArea)}},beforeDatasetDraw(t,e,i){const s=e.meta.$filler;Gn(s)&&"beforeDatasetDraw"===i.drawTime&&qn(t.ctx,s,t.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const so=(t,e)=>{let{boxHeight:i=e,boxWidth:s=e}=t;return t.usePointStyle&&(i=Math.min(i,e),s=t.pointStyleWidth||Math.min(s,e)),{boxWidth:s,boxHeight:i,itemHeight:Math.max(e,i)}};class no extends As{constructor(t){super(),this._added=!1,this.legendHitBoxes=[],this._hoveredItem=null,this.doughnutMode=!1,this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this.legendItems=void 0,this.columnSizes=void 0,this.lineWidths=void 0,this.maxHeight=void 0,this.maxWidth=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.height=void 0,this.width=void 0,this._margins=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,e,i){this.maxWidth=t,this.maxHeight=e,this._margins=i,this.setDimensions(),this.buildLabels(),this.fit()}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=this._margins.left,this.right=this.width):(this.height=this.maxHeight,this.top=this._margins.top,this.bottom=this.height)}buildLabels(){const t=this.options.labels||{};let e=Q(t.generateLabels,[this.chart],this)||[];t.filter&&(e=e.filter(e=>t.filter(e,this.chart.data))),t.sort&&(e=e.sort((e,i)=>t.sort(e,i,this.chart.data))),this.options.reverse&&e.reverse(),this.legendItems=e}fit(){const{options:t,ctx:e}=this;if(!t.display)return void(this.width=this.height=0);const i=t.labels,s=Pe(i.font),n=s.size,o=this._computeTitleHeight(),{boxWidth:r,itemHeight:a}=so(i,n);let l,h;e.font=s.string,this.isHorizontal()?(l=this.maxWidth,h=this._fitRows(o,n,r,a)+10):(h=this.maxHeight,l=this._fitCols(o,s,r,a)+10),this.width=Math.min(l,t.maxWidth||this.maxWidth),this.height=Math.min(h,t.maxHeight||this.maxHeight)}_fitRows(t,e,i,s){const{ctx:n,maxWidth:o,options:{labels:{padding:r}}}=this,a=this.legendHitBoxes=[],l=this.lineWidths=[0],h=s+r;let c=t;n.textAlign="left",n.textBaseline="middle";let d=-1,u=-h;return this.legendItems.forEach((t,p)=>{const m=i+e/2+n.measureText(t.text).width;(0===p||l[l.length-1]+m+2*r>o)&&(c+=h,l[l.length-(p>0?0:1)]=0,u+=h,d++),a[p]={left:0,top:u,row:d,width:m,height:s},l[l.length-1]+=m+r}),c}_fitCols(t,e,i,s){const{ctx:n,maxHeight:o,options:{labels:{padding:r}}}=this,a=this.legendHitBoxes=[],l=this.columnSizes=[],h=o-t;let c=r,d=0,u=0,p=0,m=0;return this.legendItems.forEach((t,o)=>{const{itemWidth:g,itemHeight:b}=function(t,e,i,s,n){const o=function(t,e,i,s){let n=t.text;return n&&"string"!=typeof n&&(n=n.reduce((t,e)=>t.length>e.length?t:e)),e+i.size/2+s.measureText(n).width}(s,t,e,i),r=function(t,e,i){let s=t;return"string"!=typeof e.text&&(s=oo(e,i)),s}(n,s,e.lineHeight);return{itemWidth:o,itemHeight:r}}(i,e,n,t,s);o>0&&u+b+2*r>h&&(c+=d+r,l.push({width:d,height:u}),p+=d+r,m++,d=u=0),a[o]={left:p,top:u,col:m,width:g,height:b},d=Math.max(d,g),u+=b+r}),c+=d,l.push({width:d,height:u}),c}adjustHitBoxes(){if(!this.options.display)return;const t=this._computeTitleHeight(),{legendHitBoxes:e,options:{align:i,labels:{padding:s},rtl:n}}=this,o=mi(n,this.left,this.width);if(this.isHorizontal()){let n=0,r=Gt(i,this.left+s,this.right-this.lineWidths[n]);for(const a of e)n!==a.row&&(n=a.row,r=Gt(i,this.left+s,this.right-this.lineWidths[n])),a.top+=this.top+t+s,a.left=o.leftForLtr(o.x(r),a.width),r+=a.width+s}else{let n=0,r=Gt(i,this.top+t+s,this.bottom-this.columnSizes[n].height);for(const a of e)a.col!==n&&(n=a.col,r=Gt(i,this.top+t+s,this.bottom-this.columnSizes[n].height)),a.top=r,a.left+=this.left+s,a.left=o.leftForLtr(o.x(a.left),a.width),r+=a.height+s}}isHorizontal(){return"top"===this.options.position||"bottom"===this.options.position}draw(){if(this.options.display){const t=this.ctx;be(t,this),this._draw(),fe(t)}}_draw(){const{options:t,columnSizes:e,lineWidths:i,ctx:s}=this,{align:n,labels:o}=t,r=he.color,a=mi(t.rtl,this.left,this.width),l=Pe(o.font),{padding:h}=o,c=l.size,d=c/2;let u;this.drawTitle(),s.textAlign=a.textAlign("left"),s.textBaseline="middle",s.lineWidth=.5,s.font=l.string;const{boxWidth:p,boxHeight:m,itemHeight:g}=so(o,c),b=this.isHorizontal(),f=this._computeTitleHeight();u=b?{x:Gt(n,this.left+h,this.right-i[0]),y:this.top+h+f,line:0}:{x:this.left+h,y:Gt(n,this.top+f+h,this.bottom-e[0].height),line:0},gi(this.ctx,t.textDirection);const v=g+h;this.legendItems.forEach((w,y)=>{s.strokeStyle=w.fontColor,s.fillStyle=w.fontColor;const _=s.measureText(w.text).width,x=a.textAlign(w.textAlign||(w.textAlign=o.textAlign)),C=p+d+_;let k=u.x,E=u.y;if(a.setWidth(this.width),b?y>0&&k+C+h>this.right&&(E=u.y+=v,u.line++,k=u.x=Gt(n,this.left+h,this.right-i[u.line])):y>0&&E+v>this.bottom&&(k=u.x=k+e[u.line].width+h,u.line++,E=u.y=Gt(n,this.top+f+h,this.bottom-e[u.line].height)),function(t,e,i){if(isNaN(p)||p<=0||isNaN(m)||m<0)return;s.save();const n=J(i.lineWidth,1);if(s.fillStyle=J(i.fillStyle,r),s.lineCap=J(i.lineCap,"butt"),s.lineDashOffset=J(i.lineDashOffset,0),s.lineJoin=J(i.lineJoin,"miter"),s.lineWidth=n,s.strokeStyle=J(i.strokeStyle,r),s.setLineDash(J(i.lineDash,[])),o.usePointStyle){const r={radius:m*Math.SQRT2/2,pointStyle:i.pointStyle,rotation:i.rotation,borderWidth:n},l=a.xPlus(t,p/2);me(s,r,l,e+d,o.pointStyleWidth&&p)}else{const o=e+Math.max((c-m)/2,0),r=a.leftForLtr(t,p),l=De(i.borderRadius);s.beginPath(),Object.values(l).some(t=>0!==t)?Ce(s,{x:r,y:o,w:p,h:m,radius:l}):s.rect(r,o,p,m),s.fill(),0!==n&&s.stroke()}s.restore()}(a.x(k),E,w),k=((t,e,i,s)=>t===(s?"left":"right")?i:"center"===t?(e+i)/2:e)(x,k+p+d,b?k+C:this.right,t.rtl),function(t,e,i){xe(s,i.text,t,e+g/2,l,{strikethrough:i.hidden,textAlign:a.textAlign(i.textAlign)})}(a.x(k),E,w),b)u.x+=C+h;else if("string"!=typeof w.text){const t=l.lineHeight;u.y+=oo(w,t)+h}else u.y+=v}),bi(this.ctx,t.textDirection)}drawTitle(){const t=this.options,e=t.title,i=Pe(e.font),s=Le(e.padding);if(!e.display)return;const n=mi(t.rtl,this.left,this.width),o=this.ctx,r=e.position,a=i.size/2,l=s.top+a;let h,c=this.left,d=this.width;if(this.isHorizontal())d=Math.max(...this.lineWidths),h=this.top+l,c=Gt(t.align,c,this.right-d);else{const e=this.columnSizes.reduce((t,e)=>Math.max(t,e.height),0);h=l+Gt(t.align,this.top,this.bottom-e-t.labels.padding-this._computeTitleHeight())}const u=Gt(r,c,c+d);o.textAlign=n.textAlign(Wt(r)),o.textBaseline="middle",o.strokeStyle=e.color,o.fillStyle=e.color,o.font=i.string,xe(o,e.text,u,h,i)}_computeTitleHeight(){const t=this.options.title,e=Pe(t.font),i=Le(t.padding);return t.display?e.lineHeight+i.height:0}_getLegendItemAt(t,e){let i,s,n;if(At(t,this.left,this.right)&&At(e,this.top,this.bottom))for(n=this.legendHitBoxes,i=0;i<n.length;++i)if(s=n[i],At(t,s.left,s.left+s.width)&&At(e,s.top,s.top+s.height))return this.legendItems[i];return null}handleEvent(t){const e=this.options;if(!function(t,e){return!("mousemove"!==t&&"mouseout"!==t||!e.onHover&&!e.onLeave)||!(!e.onClick||"click"!==t&&"mouseup"!==t)}(t.type,e))return;const i=this._getLegendItemAt(t.x,t.y);if("mousemove"===t.type||"mouseout"===t.type){const o=this._hoveredItem,r=(n=i,null!==(s=o)&&null!==n&&s.datasetIndex===n.datasetIndex&&s.index===n.index);o&&!r&&Q(e.onLeave,[t,o,this],this),this._hoveredItem=i,i&&!r&&Q(e.onHover,[t,i,this],this)}else i&&Q(e.onClick,[t,i,this],this);var s,n}}function oo(t,e){return e*(t.text?t.text.length:0)}var ro={id:"legend",_element:no,start(t,e,i){const s=t.legend=new no({ctx:t.ctx,options:i,chart:t});fs.configure(t,s,i),fs.addBox(t,s)},stop(t){fs.removeBox(t,t.legend),delete t.legend},beforeUpdate(t,e,i){const s=t.legend;fs.configure(t,s,i),s.options=i},afterUpdate(t){const e=t.legend;e.buildLabels(),e.adjustHitBoxes()},afterEvent(t,e){e.replay||t.legend.handleEvent(e.event)},defaults:{display:!0,position:"top",align:"center",fullSize:!0,reverse:!1,weight:1e3,onClick(t,e,i){const s=e.datasetIndex,n=i.chart;n.isDatasetVisible(s)?(n.hide(s),e.hidden=!0):(n.show(s),e.hidden=!1)},onHover:null,onLeave:null,labels:{color:t=>t.chart.options.color,boxWidth:40,padding:10,generateLabels(t){const e=t.data.datasets,{labels:{usePointStyle:i,pointStyle:s,textAlign:n,color:o,useBorderRadius:r,borderRadius:a}}=t.legend.options;return t._getSortedDatasetMetas().map(t=>{const l=t.controller.getStyle(i?0:void 0),h=Le(l.borderWidth);return{text:e[t.index].label,fillStyle:l.backgroundColor,fontColor:o,hidden:!t.visible,lineCap:l.borderCapStyle,lineDash:l.borderDash,lineDashOffset:l.borderDashOffset,lineJoin:l.borderJoinStyle,lineWidth:(h.width+h.height)/4,strokeStyle:l.borderColor,pointStyle:s||l.pointStyle,rotation:l.rotation,textAlign:n||l.textAlign,borderRadius:r&&(a||l.borderRadius),datasetIndex:t.index}},this)}},title:{color:t=>t.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:t=>!t.startsWith("on"),labels:{_scriptable:t=>!["generateLabels","filter","sort"].includes(t)}}};new WeakMap;const ao={average(t){if(!t.length)return!1;let e,i,s=new Set,n=0,o=0;for(e=0,i=t.length;e<i;++e){const i=t[e].element;if(i&&i.hasValue()){const t=i.tooltipPosition();s.add(t.x),n+=t.y,++o}}return 0!==o&&0!==s.size&&{x:[...s].reduce((t,e)=>t+e)/s.size,y:n/o}},nearest(t,e){if(!t.length)return!1;let i,s,n,o=e.x,r=e.y,a=Number.POSITIVE_INFINITY;for(i=0,s=t.length;i<s;++i){const s=t[i].element;if(s&&s.hasValue()){const t=Dt(e,s.getCenterPoint());t<a&&(a=t,n=s)}}if(n){const t=n.tooltipPosition();o=t.x,r=t.y}return{x:o,y:r}}};function lo(t,e){return e&&(Y(e)?Array.prototype.push.apply(t,e):t.push(e)),t}function ho(t){return("string"==typeof t||t instanceof String)&&t.indexOf("\n")>-1?t.split("\n"):t}function co(t,e){const{element:i,datasetIndex:s,index:n}=e,o=t.getDatasetMeta(s).controller,{label:r,value:a}=o.getLabelAndValue(n);return{chart:t,label:r,parsed:o.getParsed(n),raw:t.data.datasets[s].data[n],formattedValue:a,dataset:o.getDataset(),dataIndex:n,datasetIndex:s,element:i}}function uo(t,e){const i=t.chart.ctx,{body:s,footer:n,title:o}=t,{boxWidth:r,boxHeight:a}=e,l=Pe(e.bodyFont),h=Pe(e.titleFont),c=Pe(e.footerFont),d=o.length,u=n.length,p=s.length,m=Le(e.padding);let g=m.height,b=0,f=s.reduce((t,e)=>t+e.before.length+e.lines.length+e.after.length,0);f+=t.beforeBody.length+t.afterBody.length,d&&(g+=d*h.lineHeight+(d-1)*e.titleSpacing+e.titleMarginBottom),f&&(g+=p*(e.displayColors?Math.max(a,l.lineHeight):l.lineHeight)+(f-p)*l.lineHeight+(f-1)*e.bodySpacing),u&&(g+=e.footerMarginTop+u*c.lineHeight+(u-1)*e.footerSpacing);let v=0;const w=function(t){b=Math.max(b,i.measureText(t).width+v)};return i.save(),i.font=h.string,tt(t.title,w),i.font=l.string,tt(t.beforeBody.concat(t.afterBody),w),v=e.displayColors?r+2+e.boxPadding:0,tt(s,t=>{tt(t.before,w),tt(t.lines,w),tt(t.after,w)}),v=0,i.font=c.string,tt(t.footer,w),i.restore(),b+=m.width,{width:b,height:g}}function po(t,e,i,s){const{x:n,width:o}=i,{width:r,chartArea:{left:a,right:l}}=t;let h="center";return"center"===s?h=n<=(a+l)/2?"left":"right":n<=o/2?h="left":n>=r-o/2&&(h="right"),function(t,e,i,s){const{x:n,width:o}=s,r=i.caretSize+i.caretPadding;return"left"===t&&n+o+r>e.width||"right"===t&&n-o-r<0||void 0}(h,t,e,i)&&(h="center"),h}function mo(t,e,i){const s=i.yAlign||e.yAlign||function(t,e){const{y:i,height:s}=e;return i<s/2?"top":i>t.height-s/2?"bottom":"center"}(t,i);return{xAlign:i.xAlign||e.xAlign||po(t,e,i,s),yAlign:s}}function go(t,e,i,s){const{caretSize:n,caretPadding:o,cornerRadius:r}=t,{xAlign:a,yAlign:l}=i,h=n+o,{topLeft:c,topRight:d,bottomLeft:u,bottomRight:p}=De(r);let m=function(t,e){let{x:i,width:s}=t;return"right"===e?i-=s:"center"===e&&(i-=s/2),i}(e,a);const g=function(t,e,i){let{y:s,height:n}=t;return"top"===e?s+=i:s-="bottom"===e?n+i:n/2,s}(e,l,h);return"center"===l?"left"===a?m+=h:"right"===a&&(m-=h):"left"===a?m-=Math.max(c,u)+n:"right"===a&&(m+=Math.max(d,p)+n),{x:Nt(m,0,s.width-e.width),y:Nt(g,0,s.height-e.height)}}function bo(t,e,i){const s=Le(i.padding);return"center"===e?t.x+t.width/2:"right"===e?t.x+t.width-s.right:t.x+s.left}function fo(t){return lo([],ho(t))}function vo(t,e){const i=e&&e.dataset&&e.dataset.tooltip&&e.dataset.tooltip.callbacks;return i?t.override(i):t}const wo={beforeTitle:G,title(t){if(t.length>0){const e=t[0],i=e.chart.data.labels,s=i?i.length:0;if(this&&this.options&&"dataset"===this.options.mode)return e.dataset.label||"";if(e.label)return e.label;if(s>0&&e.dataIndex<s)return i[e.dataIndex]}return""},afterTitle:G,beforeBody:G,beforeLabel:G,label(t){if(this&&this.options&&"dataset"===this.options.mode)return t.label+": "+t.formattedValue||t.formattedValue;let e=t.dataset.label||"";e&&(e+=": ");const i=t.formattedValue;return $(i)||(e+=i),e},labelColor(t){const e=t.chart.getDatasetMeta(t.datasetIndex).controller.getStyle(t.dataIndex);return{borderColor:e.borderColor,backgroundColor:e.backgroundColor,borderWidth:e.borderWidth,borderDash:e.borderDash,borderDashOffset:e.borderDashOffset,borderRadius:0}},labelTextColor(){return this.options.bodyColor},labelPointStyle(t){const e=t.chart.getDatasetMeta(t.datasetIndex).controller.getStyle(t.dataIndex);return{pointStyle:e.pointStyle,rotation:e.rotation}},afterLabel:G,afterBody:G,beforeFooter:G,footer:G,afterFooter:G};function yo(t,e,i,s){const n=t[e].call(i,s);return void 0===n?wo[e].call(i,s):n}class _o extends As{static positioners=ao;constructor(t){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=t.chart,this.options=t.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(t){this.options=t,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const t=this._cachedAnimations;if(t)return t;const e=this.chart,i=this.options.setContext(this.getContext()),s=i.enabled&&e.options.animation&&i.animations,n=new Di(this.chart,s);return s._cacheable&&(this._cachedAnimations=Object.freeze(n)),n}getContext(){return this.$context||(this.$context=Ne(this.chart.getContext(),{tooltip:this,tooltipItems:this._tooltipItems,type:"tooltip"}))}getTitle(t,e){const{callbacks:i}=e,s=yo(i,"beforeTitle",this,t),n=yo(i,"title",this,t),o=yo(i,"afterTitle",this,t);let r=[];return r=lo(r,ho(s)),r=lo(r,ho(n)),r=lo(r,ho(o)),r}getBeforeBody(t,e){return fo(yo(e.callbacks,"beforeBody",this,t))}getBody(t,e){const{callbacks:i}=e,s=[];return tt(t,t=>{const e={before:[],lines:[],after:[]},n=vo(i,t);lo(e.before,ho(yo(n,"beforeLabel",this,t))),lo(e.lines,yo(n,"label",this,t)),lo(e.after,ho(yo(n,"afterLabel",this,t))),s.push(e)}),s}getAfterBody(t,e){return fo(yo(e.callbacks,"afterBody",this,t))}getFooter(t,e){const{callbacks:i}=e,s=yo(i,"beforeFooter",this,t),n=yo(i,"footer",this,t),o=yo(i,"afterFooter",this,t);let r=[];return r=lo(r,ho(s)),r=lo(r,ho(n)),r=lo(r,ho(o)),r}_createItems(t){const e=this._active,i=this.chart.data,s=[],n=[],o=[];let r,a,l=[];for(r=0,a=e.length;r<a;++r)l.push(co(this.chart,e[r]));return t.filter&&(l=l.filter((e,s,n)=>t.filter(e,s,n,i))),t.itemSort&&(l=l.sort((e,s)=>t.itemSort(e,s,i))),tt(l,e=>{const i=vo(t.callbacks,e);s.push(yo(i,"labelColor",this,e)),n.push(yo(i,"labelPointStyle",this,e)),o.push(yo(i,"labelTextColor",this,e))}),this.labelColors=s,this.labelPointStyles=n,this.labelTextColors=o,this.dataPoints=l,l}update(t,e){const i=this.options.setContext(this.getContext()),s=this._active;let n,o=[];if(s.length){const t=ao[i.position].call(this,s,this._eventPosition);o=this._createItems(i),this.title=this.getTitle(o,i),this.beforeBody=this.getBeforeBody(o,i),this.body=this.getBody(o,i),this.afterBody=this.getAfterBody(o,i),this.footer=this.getFooter(o,i);const e=this._size=uo(this,i),r=Object.assign({},t,e),a=mo(this.chart,i,r),l=go(i,r,a,this.chart);this.xAlign=a.xAlign,this.yAlign=a.yAlign,n={opacity:1,x:l.x,y:l.y,width:e.width,height:e.height,caretX:t.x,caretY:t.y}}else 0!==this.opacity&&(n={opacity:0});this._tooltipItems=o,this.$context=void 0,n&&this._resolveAnimations().update(this,n),t&&i.external&&i.external.call(this,{chart:this.chart,tooltip:this,replay:e})}drawCaret(t,e,i,s){const n=this.getCaretPosition(t,i,s);e.lineTo(n.x1,n.y1),e.lineTo(n.x2,n.y2),e.lineTo(n.x3,n.y3)}getCaretPosition(t,e,i){const{xAlign:s,yAlign:n}=this,{caretSize:o,cornerRadius:r}=i,{topLeft:a,topRight:l,bottomLeft:h,bottomRight:c}=De(r),{x:d,y:u}=t,{width:p,height:m}=e;let g,b,f,v,w,y;return"center"===n?(w=u+m/2,"left"===s?(g=d,b=g-o,v=w+o,y=w-o):(g=d+p,b=g+o,v=w-o,y=w+o),f=g):(b="left"===s?d+Math.max(a,h)+o:"right"===s?d+p-Math.max(l,c)-o:this.caretX,"top"===n?(v=u,w=v-o,g=b-o,f=b+o):(v=u+m,w=v+o,g=b+o,f=b-o),y=v),{x1:g,x2:b,x3:f,y1:v,y2:w,y3:y}}drawTitle(t,e,i){const s=this.title,n=s.length;let o,r,a;if(n){const l=mi(i.rtl,this.x,this.width);for(t.x=bo(this,i.titleAlign,i),e.textAlign=l.textAlign(i.titleAlign),e.textBaseline="middle",o=Pe(i.titleFont),r=i.titleSpacing,e.fillStyle=i.titleColor,e.font=o.string,a=0;a<n;++a)e.fillText(s[a],l.x(t.x),t.y+o.lineHeight/2),t.y+=o.lineHeight+r,a+1===n&&(t.y+=i.titleMarginBottom-r)}}_drawColorBox(t,e,i,s,n){const o=this.labelColors[i],r=this.labelPointStyles[i],{boxHeight:a,boxWidth:l}=n,h=Pe(n.bodyFont),c=bo(this,"left",n),d=s.x(c),u=a<h.lineHeight?(h.lineHeight-a)/2:0,p=e.y+u;if(n.usePointStyle){const e={radius:Math.min(l,a)/2,pointStyle:r.pointStyle,rotation:r.rotation,borderWidth:1},i=s.leftForLtr(d,l)+l/2,h=p+a/2;t.strokeStyle=n.multiKeyBackground,t.fillStyle=n.multiKeyBackground,pe(t,e,i,h),t.strokeStyle=o.borderColor,t.fillStyle=o.backgroundColor,pe(t,e,i,h)}else{t.lineWidth=K(o.borderWidth)?Math.max(...Object.values(o.borderWidth)):o.borderWidth||1,t.strokeStyle=o.borderColor,t.setLineDash(o.borderDash||[]),t.lineDashOffset=o.borderDashOffset||0;const e=s.leftForLtr(d,l),i=s.leftForLtr(s.xPlus(d,1),l-2),r=De(o.borderRadius);Object.values(r).some(t=>0!==t)?(t.beginPath(),t.fillStyle=n.multiKeyBackground,Ce(t,{x:e,y:p,w:l,h:a,radius:r}),t.fill(),t.stroke(),t.fillStyle=o.backgroundColor,t.beginPath(),Ce(t,{x:i,y:p+1,w:l-2,h:a-2,radius:r}),t.fill()):(t.fillStyle=n.multiKeyBackground,t.fillRect(e,p,l,a),t.strokeRect(e,p,l,a),t.fillStyle=o.backgroundColor,t.fillRect(i,p+1,l-2,a-2))}t.fillStyle=this.labelTextColors[i]}drawBody(t,e,i){const{body:s}=this,{bodySpacing:n,bodyAlign:o,displayColors:r,boxHeight:a,boxWidth:l,boxPadding:h}=i,c=Pe(i.bodyFont);let d=c.lineHeight,u=0;const p=mi(i.rtl,this.x,this.width),m=function(i){e.fillText(i,p.x(t.x+u),t.y+d/2),t.y+=d+n},g=p.textAlign(o);let b,f,v,w,y,_,x;for(e.textAlign=o,e.textBaseline="middle",e.font=c.string,t.x=bo(this,g,i),e.fillStyle=i.bodyColor,tt(this.beforeBody,m),u=r&&"right"!==g?"center"===o?l/2+h:l+2+h:0,w=0,_=s.length;w<_;++w){for(b=s[w],f=this.labelTextColors[w],e.fillStyle=f,tt(b.before,m),v=b.lines,r&&v.length&&(this._drawColorBox(e,t,w,p,i),d=Math.max(c.lineHeight,a)),y=0,x=v.length;y<x;++y)m(v[y]),d=c.lineHeight;tt(b.after,m)}u=0,d=c.lineHeight,tt(this.afterBody,m),t.y-=n}drawFooter(t,e,i){const s=this.footer,n=s.length;let o,r;if(n){const a=mi(i.rtl,this.x,this.width);for(t.x=bo(this,i.footerAlign,i),t.y+=i.footerMarginTop,e.textAlign=a.textAlign(i.footerAlign),e.textBaseline="middle",o=Pe(i.footerFont),e.fillStyle=i.footerColor,e.font=o.string,r=0;r<n;++r)e.fillText(s[r],a.x(t.x),t.y+o.lineHeight/2),t.y+=o.lineHeight+i.footerSpacing}}drawBackground(t,e,i,s){const{xAlign:n,yAlign:o}=this,{x:r,y:a}=t,{width:l,height:h}=i,{topLeft:c,topRight:d,bottomLeft:u,bottomRight:p}=De(s.cornerRadius);e.fillStyle=s.backgroundColor,e.strokeStyle=s.borderColor,e.lineWidth=s.borderWidth,e.beginPath(),e.moveTo(r+c,a),"top"===o&&this.drawCaret(t,e,i,s),e.lineTo(r+l-d,a),e.quadraticCurveTo(r+l,a,r+l,a+d),"center"===o&&"right"===n&&this.drawCaret(t,e,i,s),e.lineTo(r+l,a+h-p),e.quadraticCurveTo(r+l,a+h,r+l-p,a+h),"bottom"===o&&this.drawCaret(t,e,i,s),e.lineTo(r+u,a+h),e.quadraticCurveTo(r,a+h,r,a+h-u),"center"===o&&"left"===n&&this.drawCaret(t,e,i,s),e.lineTo(r,a+c),e.quadraticCurveTo(r,a,r+c,a),e.closePath(),e.fill(),s.borderWidth>0&&e.stroke()}_updateAnimationTarget(t){const e=this.chart,i=this.$animations,s=i&&i.x,n=i&&i.y;if(s||n){const i=ao[t.position].call(this,this._active,this._eventPosition);if(!i)return;const o=this._size=uo(this,t),r=Object.assign({},i,this._size),a=mo(e,t,r),l=go(t,r,a,e);s._to===l.x&&n._to===l.y||(this.xAlign=a.xAlign,this.yAlign=a.yAlign,this.width=o.width,this.height=o.height,this.caretX=i.x,this.caretY=i.y,this._resolveAnimations().update(this,l))}}_willRender(){return!!this.opacity}draw(t){const e=this.options.setContext(this.getContext());let i=this.opacity;if(!i)return;this._updateAnimationTarget(e);const s={width:this.width,height:this.height},n={x:this.x,y:this.y};i=Math.abs(i)<.001?0:i;const o=Le(e.padding),r=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;e.enabled&&r&&(t.save(),t.globalAlpha=i,this.drawBackground(n,t,s,e),gi(t,e.textDirection),n.y+=o.top,this.drawTitle(n,t,e),this.drawBody(n,t,e),this.drawFooter(n,t,e),bi(t,e.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,e){const i=this._active,s=t.map(({datasetIndex:t,index:e})=>{const i=this.chart.getDatasetMeta(t);if(!i)throw new Error("Cannot find a dataset at index "+t);return{datasetIndex:t,element:i.data[e],index:e}}),n=!et(i,s),o=this._positionChanged(s,e);(n||o)&&(this._active=s,this._eventPosition=e,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,e,i=!0){if(e&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const s=this.options,n=this._active||[],o=this._getActiveElements(t,n,e,i),r=this._positionChanged(o,t),a=e||!et(o,n)||r;return a&&(this._active=o,(s.enabled||s.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,e))),a}_getActiveElements(t,e,i,s){const n=this.options;if("mouseout"===t.type)return[];if(!s)return e.filter(t=>this.chart.data.datasets[t.datasetIndex]&&void 0!==this.chart.getDatasetMeta(t.datasetIndex).controller.getParsed(t.index));const o=this.chart.getElementsAtEventForMode(t,n.mode,n,i);return n.reverse&&o.reverse(),o}_positionChanged(t,e){const{caretX:i,caretY:s,options:n}=this,o=ao[n.position].call(this,t,e);return!1!==o&&(i!==o.x||s!==o.y)}}var xo={id:"tooltip",_element:_o,positioners:ao,afterInit(t,e,i){i&&(t.tooltip=new _o({chart:t,options:i}))},beforeUpdate(t,e,i){t.tooltip&&t.tooltip.initialize(i)},reset(t,e,i){t.tooltip&&t.tooltip.initialize(i)},afterDraw(t){const e=t.tooltip;if(e&&e._willRender()){const i={tooltip:e};if(!1===t.notifyPlugins("beforeTooltipDraw",{...i,cancelable:!0}))return;e.draw(t.ctx),t.notifyPlugins("afterTooltipDraw",i)}},afterEvent(t,e){if(t.tooltip){const i=e.replay;t.tooltip.handleEvent(e.event,i,e.inChartArea)&&(e.changed=!0)}},defaults:{enabled:!0,external:null,position:"average",backgroundColor:"rgba(0,0,0,0.8)",titleColor:"#fff",titleFont:{weight:"bold"},titleSpacing:2,titleMarginBottom:6,titleAlign:"left",bodyColor:"#fff",bodySpacing:2,bodyFont:{},bodyAlign:"left",footerColor:"#fff",footerSpacing:2,footerMarginTop:6,footerFont:{weight:"bold"},footerAlign:"left",padding:6,caretPadding:2,caretSize:5,cornerRadius:6,boxHeight:(t,e)=>e.bodyFont.size,boxWidth:(t,e)=>e.bodyFont.size,multiKeyBackground:"#fff",displayColors:!0,boxPadding:0,borderColor:"rgba(0,0,0,0)",borderWidth:0,animation:{duration:400,easing:"easeOutQuart"},animations:{numbers:{type:"number",properties:["x","y","width","height","caretX","caretY"]},opacity:{easing:"linear",duration:200}},callbacks:wo},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:t=>"filter"!==t&&"itemSort"!==t&&"external"!==t,_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]};function Co(t){const e=this.getLabels();return t>=0&&t<e.length?e[t]:t}function ko(t,e,{horizontal:i,minRotation:s}){const n=Mt(s),o=(i?Math.sin(n):Math.cos(n))||.001,r=.75*e*(""+t).length;return Math.min(e/o,r)}class Eo extends Gs{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}parse(t,e){return $(t)||("number"==typeof t||t instanceof Number)&&!isFinite(+t)?null:+t}handleTickRangeOptions(){const{beginAtZero:t}=this.options,{minDefined:e,maxDefined:i}=this.getUserBounds();let{min:s,max:n}=this;const o=t=>s=e?s:t,r=t=>n=i?n:t;if(t){const t=Ct(s),e=Ct(n);t<0&&e<0?r(0):t>0&&e>0&&o(0)}if(s===n){let e=0===n?1:Math.abs(.05*n);r(n+e),t||o(s-e)}this.min=s,this.max=n}getTickLimit(){const t=this.options.ticks;let e,{maxTicksLimit:i,stepSize:s}=t;return s?(e=Math.ceil(this.max/s)-Math.floor(this.min/s)+1,e>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${s} would result generating up to ${e} ticks. Limiting to 1000.`),e=1e3)):(e=this.computeTickLimit(),i=i||11),i&&(e=Math.min(i,e)),e}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const t=this.options,e=t.ticks;let i=this.getTickLimit();i=Math.max(2,i);const s=function(t,e){const i=[],{bounds:s,step:n,min:o,max:r,precision:a,count:l,maxTicks:h,maxDigits:c,includeBounds:d}=t,u=n||1,p=h-1,{min:m,max:g}=e,b=!$(o),f=!$(r),v=!$(l),w=(g-m)/(c+1);let y,_,x,C,k=Et((g-m)/p/u)*u;if(k<1e-14&&!b&&!f)return[{value:m},{value:g}];C=Math.ceil(g/k)-Math.floor(m/k),C>p&&(k=Et(C*k/p/u)*u),$(a)||(y=Math.pow(10,a),k=Math.ceil(k*y)/y),"ticks"===s?(_=Math.floor(m/k)*k,x=Math.ceil(g/k)*k):(_=m,x=g),b&&f&&n&&function(t,e){const i=Math.round(t);return i-e<=t&&i+e>=t}((r-o)/n,k/1e3)?(C=Math.round(Math.min((r-o)/k,h)),k=(r-o)/C,_=o,x=r):v?(_=b?o:_,x=f?r:x,C=l-1,k=(x-_)/C):(C=(x-_)/k,C=kt(C,Math.round(C),k/1e3)?Math.round(C):Math.ceil(C));const E=Math.max(Tt(k),Tt(_));y=Math.pow(10,$(a)?E:a),_=Math.round(_*y)/y,x=Math.round(x*y)/y;let R=0;for(b&&(d&&_!==o?(i.push({value:o}),_<o&&R++,kt(Math.round((_+R*k)*y)/y,o,ko(o,w,t))&&R++):_<o&&R++);R<C;++R){const t=Math.round((_+R*k)*y)/y;if(f&&t>r)break;i.push({value:t})}return f&&d&&x!==r?i.length&&kt(i[i.length-1].value,r,ko(r,w,t))?i[i.length-1].value=r:i.push({value:r}):f&&x!==r||i.push({value:x}),i}({maxTicks:i,bounds:t.bounds,min:t.min,max:t.max,precision:e.precision,step:e.stepSize,count:e.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:e.minRotation||0,includeBounds:!1!==e.includeBounds},this._range||this);return"ticks"===t.bounds&&function(t,e,i){let s,n,o;for(s=0,n=t.length;s<n;s++)o=t[s][i],isNaN(o)||(e.min=Math.min(e.min,o),e.max=Math.max(e.max,o))}(s,this,"value"),t.reverse?(s.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),s}configure(){const t=this.ticks;let e=this.min,i=this.max;if(super.configure(),this.options.offset&&t.length){const s=(i-e)/Math.max(t.length-1,1)/2;e-=s,i+=s}this._startValue=e,this._endValue=i,this._valueRange=i-e}getLabelForValue(t){return ee(t,this.chart.options.locale,this.options.ticks.format)}}class Ro extends Eo{static id="linear";static defaults={ticks:{callback:se.formatters.numeric}};determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=X(t)?t:0,this.max=X(e)?e:1,this.handleTickRangeOptions()}computeTickLimit(){const t=this.isHorizontal(),e=t?this.width:this.height,i=Mt(this.options.ticks.minRotation),s=(t?Math.sin(i):Math.cos(i))||.001,n=this._resolveTickFontOptions(0);return Math.ceil(e/Math.min(40,n.lineHeight/s))}getPixelForValue(t){return null===t?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getValueForPixel(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange}}se.formatters.logarithmic,se.formatters.numeric;const Mo="label";function To(t,e){"function"==typeof t?t(e):t&&(t.current=e)}function So(t,e){t.labels=e}function Do(t,e,i=Mo){const s=[];t.datasets=e.map(e=>{const n=t.datasets.find(t=>t[i]===e[i]);return n&&e.data&&!s.includes(n)?(s.push(n),Object.assign(n,e),n):{...e}})}function Lo(t,e=Mo){const i={labels:[],datasets:[]};return So(i,t.labels),Do(i,t.datasets,e),i}function Po(t,e){const{height:i=150,width:s=300,redraw:n=!1,datasetIdKey:o,type:r,data:a,options:h,plugins:c=[],fallbackContent:d,updateMode:u,...m}=t,g=(0,p.useRef)(null),b=(0,p.useRef)(null),f=()=>{g.current&&(b.current=new xn(g.current,{type:r,data:Lo(a,o),options:h&&{...h},plugins:c}),To(e,b.current))},v=()=>{To(e,null),b.current&&(b.current.destroy(),b.current=null)};return(0,p.useEffect)(()=>{!n&&b.current&&h&&function(t,e){const i=t.options;i&&e&&Object.assign(i,e)}(b.current,h)},[n,h]),(0,p.useEffect)(()=>{!n&&b.current&&So(b.current.config.data,a.labels)},[n,a.labels]),(0,p.useEffect)(()=>{!n&&b.current&&a.datasets&&Do(b.current.config.data,a.datasets,o)},[n,a.datasets]),(0,p.useEffect)(()=>{b.current&&(n?(v(),setTimeout(f)):b.current.update(u))},[n,h,a.labels,a.datasets,u]),(0,p.useEffect)(()=>{b.current&&(v(),setTimeout(f))},[r]),(0,p.useEffect)(()=>(f(),()=>v()),[]),(0,l.jsx)("canvas",{ref:g,role:"img",height:i,width:s,...m,children:d})}const jo=(0,p.forwardRef)(Po);function No(t,e){return xn.register(e),(0,p.forwardRef)((e,i)=>(0,l.jsx)(jo,{...e,ref:i,type:t}))}const Ao=No("line",Qi),zo=No("bar",Ji),Oo=No("doughnut",Zi);function Fo({waiting:t,title:e,message:i}){return(0,l.jsxs)("div",{className:"slr-chart-empty"+(t?" slr-chart-empty--waiting":""),children:[(0,l.jsx)("div",{className:"slr-chart-empty__grid","aria-hidden":"true"}),(0,l.jsxs)("div",{className:"slr-chart-empty__content",children:[t?(0,l.jsx)("span",{className:"slr-chart-empty__icon dashicons dashicons-update slr-pulse","aria-hidden":"true"}):(0,l.jsx)("span",{className:"slr-chart-empty__icon dashicons dashicons-chart-area","aria-hidden":"true"}),t&&e&&(0,l.jsx)("p",{className:"slr-chart-empty__title",children:e}),i&&(0,l.jsx)("p",{className:"slr-chart-empty__desc",children:i})]})]})}function Ho({title:t,subtitle:e,state:i="content",emptyMessage:s,waitingMessage:n,children:o}){return(0,l.jsxs)("div",{className:"slr-panel slr-dash-panel",children:[t&&(0,l.jsx)("h3",{className:"slr-dash-panel__title",children:t}),e&&(0,l.jsx)("p",{className:"slr-dash-panel__subtitle",children:e}),"waiting"===i&&(0,l.jsx)(Fo,{waiting:!0,title:(0,a.__)("Collecting data","seo-local-rank"),message:n}),"empty"===i&&(0,l.jsx)(Fo,{message:s}),"content"===i&&(0,l.jsx)("div",{className:"slr-dash-panel__content",children:o})]})}function Io({icon:t,title:e}){return(0,l.jsxs)("div",{className:"slr-dash-section__header",children:[(0,l.jsx)("span",{className:`slr-dash-section__icon dashicons ${t}`,"aria-hidden":"true"}),(0,l.jsx)("h2",{className:"slr-dash-section__title",children:e}),(0,l.jsx)("span",{className:"slr-dash-section__line","aria-hidden":"true"})]})}let Bo=!1;const Vo={x:{grid:{display:!1},border:{display:!1},ticks:{color:"#666",font:{size:11}}},y:{grid:{color:"#f5f5f5",drawTicks:!1},border:{display:!1},ticks:{color:"#aaa",font:{size:11}}}},Wo={position:"top",align:"end"};let Go=!1;function Uo(t,e=0){return null==t||Number.isNaN(Number(t))?"—":Number(t).toLocaleString(void 0,{minimumFractionDigits:e,maximumFractionDigits:e})}function $o(t,e=0){if(null==t||Number.isNaN(Number(t)))return"—";const i=Number(t),s=Math.abs(i);return s>=1e6?`${(i/1e6).toFixed(e)}M`:s>=1e3?`${(i/1e3).toFixed(e)}K`:Uo(i,e)}function Yo(t){if(!t)return"";const e=String(t).substring(0,10),i=e.split("-");return 3!==i.length?e:new Date(Date.UTC(Number(i[0]),Number(i[1])-1,Number(i[2]))).toLocaleDateString(void 0,{month:"short",day:"numeric"})}function Ko(t){const e=Math.max(0,Math.min(100,Math.round(t)));return e>=80?"good":e>=60?"ok":e>=40?"warn":"bad"}function Xo({data:t}){const e=t?.kpi_data||{},i=Array.isArray(t?.score_trend)?t.score_trend:[],s=t?.visibility_score||{};let n="content";0===Number(e.num_tracking_prompts||0)?n="empty":0===i.length&&(n="waiting");const o={labels:i.map(t=>Yo(t.date)),datasets:[{label:(0,a.__)("Score","seo-local-rank"),data:i.map(t=>t.score),borderColor:"#4E78F4",backgroundColor:"rgba(78, 120, 244, 0.12)",fill:!0,yAxisID:"yScore",tension:.3,pointRadius:2},{label:(0,a.__)("Mentions","seo-local-rank"),data:i.map(t=>t.mentions),borderColor:"#50B142",backgroundColor:"transparent",yAxisID:"yCount",tension:.3,pointRadius:2},{label:(0,a.__)("Citations","seo-local-rank"),data:i.map(t=>t.citations),borderColor:"#ED922F",backgroundColor:"transparent",yAxisID:"yCount",tension:.3,pointRadius:2}]},r={responsive:!0,maintainAspectRatio:!1,interaction:{mode:"index",intersect:!1},plugins:{legend:Wo},scales:{x:Vo.x,yScore:{...Vo.y,min:0,max:100,position:"left"},yCount:{...Vo.y,position:"right",grid:{drawOnChartArea:!1}}}},h=Array.isArray(s.breakdown)?s.breakdown:[],c="up"===s.trend?(0,a.sprintf)(/* translators: %d: visibility score points gained */ /* translators: %d: visibility score points gained */
    3 (0,a.__)("+%d pts","seo-local-rank"),s.delta||0):"down"===s.trend?(0,a.sprintf)(/* translators: %d: visibility score points lost */ /* translators: %d: visibility score points lost */
    4 (0,a.__)("-%d pts","seo-local-rank"),s.delta||0):null;return(0,l.jsxs)("section",{className:"slr-dash-section",children:[(0,l.jsx)(Io,{icon:"dashicons-star-filled",title:(0,a.__)("AI Visibility","seo-local-rank")}),(0,l.jsxs)("div",{className:"slr-dash-grid",children:[(0,l.jsx)(Ho,{title:(0,a.__)("Score trend","seo-local-rank"),state:n,emptyMessage:(0,a.__)("Add prompts to see AI visibility trends.","seo-local-rank"),waitingMessage:(0,a.__)("AI visibility data will appear after the first scan.","seo-local-rank"),children:(0,l.jsx)("div",{className:"slr-chart slr-chart--line",children:(0,l.jsx)(Ao,{data:o,options:r})})}),(0,l.jsx)(Ho,{title:(0,a.__)("AI visibility score","seo-local-rank"),state:n,emptyMessage:(0,a.__)("Add prompts to see the visibility score.","seo-local-rank"),waitingMessage:(0,a.__)("Score breakdown will appear after the first scan.","seo-local-rank"),children:(0,l.jsxs)("div",{className:"slr-ai-score",children:[(0,l.jsxs)("div",{className:"slr-ai-score__header",children:[(0,l.jsx)("span",{className:"slr-ai-score__value",children:s.score??"—"}),c&&(0,l.jsx)("span",{className:`slr-ai-score__delta slr-ai-score__delta--${s.trend||"flat"}`,children:c})]}),(0,l.jsx)("ul",{className:"slr-ai-score__breakdown",children:h.map(t=>{return(0,l.jsxs)("li",{className:"slr-ai-score__row",children:[(0,l.jsxs)("div",{className:"slr-ai-score__row-main",children:[(0,l.jsxs)("div",{className:"slr-ai-score__row-head",children:[(0,l.jsx)("span",{children:(e=t.key,{mention_rate:(0,a.__)("Mention rate","seo-local-rank"),citation_rate:(0,a.__)("Citation rate","seo-local-rank"),sentiment_score:(0,a.__)("Sentiment score","seo-local-rank"),share_of_voice:(0,a.__)("Share of voice","seo-local-rank"),llm_coverage:(0,a.__)("LLM coverage","seo-local-rank")}[e]||e)}),(0,l.jsxs)("span",{className:"slr-ai-score__row-weight",children:[t.weight,"%"]})]}),(0,l.jsx)("div",{className:"slr-ai-score__bar",children:(0,l.jsx)("div",{className:"slr-ai-score__bar-fill",style:{width:`${Math.min(100,Number(t.value))}%`}})})]}),(0,l.jsx)("span",{className:"slr-ai-score__row-value",children:t.value})]},t.key);var e})})]})})]})]})}function qo({value:t,positive:e,compact:i=!1,suffix:s="",variant:n="text"}){const o=Number(t);if(!o)return null;const r=e?"up":"down",a=i?$o(Math.abs(o),1):Uo(Math.abs(o),1),h="solid"===n?" slr-trend--solid":"";return(0,l.jsxs)("span",{className:`slr-trend slr-trend--${r}${h}`,"aria-hidden":"true",children:[(0,l.jsx)("span",{className:"slr-trend__arrow",children:e?"▲":"▼"}),a,s]})}function Jo({data:t}){if(3===Number(t?.project_domain?.type_id??0))return null;const e=t?.kpi_data||{},i=t?.current_bl_summary||{},s=t?.prev_bl_summary||{},n=t?.days_since_last_update;let o="content";null===n&&(o="waiting");const r=Number(i.rank||0),h=null!=s?.rank?Number(i.rank)-Number(s.rank):0,c=[{label:(0,a.__)("Backlinks","seo-local-rank"),value:$o(i.backlinks,1),change:null!=s?.backlinks?Number(i.backlinks)-Number(s.backlinks):0,positive:Number(i.backlinks)-Number(s?.backlinks||0)>0},{label:(0,a.__)("Pages","seo-local-rank"),value:$o(i.pages,1),change:null!=s?.pages?Number(i.pages)-Number(s.pages):0,positive:Number(i.pages)-Number(s?.pages||0)>0},{label:(0,a.__)("Referring domains","seo-local-rank"),value:$o(i.main_domains,1),change:Number(e.bl_change_main_domains||0),positive:Number(e.bl_change_main_domains)>0},{label:(0,a.__)("Unique IPs","seo-local-rank"),value:$o(i.ips,1),change:null!=s?.ips?Number(i.ips)-Number(s.ips):0,positive:Number(i.ips)-Number(s?.ips||0)>0}],d={labels:[(0,a.__)("Domain rank","seo-local-rank"),(0,a.__)("Remaining","seo-local-rank")],datasets:[{data:[r,Math.max(0,100-r)],backgroundColor:["#50B142","#EFEFEF"],borderWidth:0}]},u=[Number(i.backlinks||0),Number(i.pages||0),Number(i.main_domains||0),Number(i.ips||0)],p={labels:c.map(t=>t.label),datasets:[{label:(0,a.__)("Backlink metrics","seo-local-rank"),data:u,borderColor:"#4E78F4",backgroundColor:"rgba(78, 120, 244, 0.15)",fill:!0,tension:.4,pointRadius:0}]},m={responsive:!0,maintainAspectRatio:!1,plugins:{legend:{display:!1}},scales:{x:{...Vo.x,ticks:{...Vo.x.ticks,maxRotation:0}},y:{display:!1,min:0}}};return(0,l.jsxs)("section",{className:"slr-dash-section",children:[(0,l.jsx)(Io,{icon:"dashicons-admin-links",title:(0,a.__)("Backlinks","seo-local-rank")}),(0,l.jsxs)("div",{className:"slr-dash-grid slr-dash-grid--backlinks",children:[(0,l.jsx)(Ho,{title:(0,a.__)("Domain rank (DR)","seo-local-rank"),state:o,waitingMessage:(0,a.__)("Backlink summary is being prepared.","seo-local-rank"),children:(0,l.jsxs)("div",{className:"slr-bl-dr",children:[(0,l.jsxs)("div",{className:"slr-bl-dr__score",children:[(0,l.jsx)("span",{className:"slr-bl-dr__value",children:Uo(r)}),(0,l.jsx)(qo,{value:h,positive:h>0,variant:"solid"})]}),(0,l.jsx)("div",{className:"slr-chart slr-chart--donut slr-chart--donut-sm",children:(0,l.jsx)(Oo,{data:d,options:{responsive:!0,maintainAspectRatio:!1,cutout:"55%",plugins:{legend:{display:!1},tooltip:{enabled:!1}}}})})]})}),(0,l.jsxs)(Ho,{title:(0,a.__)("Backlink trends","seo-local-rank"),state:o,waitingMessage:(0,a.__)("Backlink summary is being prepared.","seo-local-rank"),children:[(0,l.jsx)("ul",{className:"slr-bl-metrics",children:c.map(t=>(0,l.jsxs)("li",{className:"slr-bl-metrics__item",children:[(0,l.jsx)("span",{className:"slr-bl-metrics__label",children:t.label}),(0,l.jsxs)("span",{className:"slr-bl-metrics__value",children:[t.value,(0,l.jsx)(qo,{value:t.change,positive:t.positive,compact:!0})]})]},t.label))}),(0,l.jsx)("div",{className:"slr-chart slr-chart--area",children:(0,l.jsx)(Ao,{data:p,options:m})})]})]})]})}function Zo(){return(0,l.jsxs)("div",{className:"slr-dashboard slr-dashboard--loading","aria-busy":"true","aria-label":(0,a.__)("Loading dashboard","seo-local-rank"),children:[(0,l.jsxs)("div",{className:"slr-toolbar slr-toolbar--skeleton",children:[(0,l.jsx)("div",{className:"slr-skeleton slr-skeleton--selector"}),(0,l.jsx)("div",{className:"slr-skeleton slr-skeleton--upgrade"})]}),(0,l.jsxs)("div",{className:"slr-dashboard__body",children:[(0,l.jsx)("div",{className:"slr-kpi-grid slr-kpi-grid--dashboard",children:[1,2,3,4].map(t=>(0,l.jsxs)("div",{className:"slr-kpi-card slr-kpi-card--rich slr-kpi-card--skeleton",children:[(0,l.jsx)("div",{className:"slr-skeleton slr-skeleton--line slr-skeleton--sm"}),(0,l.jsx)("div",{className:"slr-skeleton slr-skeleton--line slr-skeleton--lg"}),(0,l.jsx)("div",{className:"slr-skeleton slr-skeleton--line slr-skeleton--md"})]},t))}),(0,l.jsxs)("div",{className:"slr-dash-grid",children:[(0,l.jsxs)("div",{className:"slr-panel slr-dash-panel slr-dash-panel--skeleton",children:[(0,l.jsx)("div",{className:"slr-skeleton slr-skeleton--line slr-skeleton--sm"}),(0,l.jsx)("div",{className:"slr-skeleton slr-skeleton--chart"})]}),(0,l.jsxs)("div",{className:"slr-panel slr-dash-panel slr-dash-panel--skeleton",children:[(0,l.jsx)("div",{className:"slr-skeleton slr-skeleton--line slr-skeleton--sm"}),(0,l.jsx)("div",{className:"slr-skeleton slr-skeleton--chart slr-skeleton--chart-sm"})]})]})]})]})}Go||(xn.register(class extends Gs{static id="category";static defaults={ticks:{callback:Co}};constructor(t){super(t),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(t){const e=this._addedLabels;if(e.length){const t=this.getLabels();for(const{index:i,label:s}of e)t[i]===s&&t.splice(i,1);this._addedLabels=[]}super.init(t)}parse(t,e){if($(t))return null;const i=this.getLabels();return((t,e)=>null===t?null:Nt(Math.round(t),0,e))(e=isFinite(e)&&i[e]===t?e:function(t,e,i,s){const n=t.indexOf(e);return-1===n?((t,e,i,s)=>("string"==typeof e?(i=t.push(e)-1,s.unshift({index:i,label:e})):isNaN(e)&&(i=null),i))(t,e,i,s):n!==t.lastIndexOf(e)?i:n}(i,t,J(e,t),this._addedLabels),i.length-1)}determineDataLimits(){const{minDefined:t,maxDefined:e}=this.getUserBounds();let{min:i,max:s}=this.getMinMax(!0);"ticks"===this.options.bounds&&(t||(i=0),e||(s=this.getLabels().length-1)),this.min=i,this.max=s}buildTicks(){const t=this.min,e=this.max,i=this.options.offset,s=[];let n=this.getLabels();n=0===t&&e===n.length-1?n:n.slice(t,e+1),this._valueRange=Math.max(n.length-(i?0:1),1),this._startValue=this.min-(i?.5:0);for(let i=t;i<=e;i++)s.push({value:i});return s}getLabelForValue(t){return Co.call(this,t)}configure(){super.configure(),this.isHorizontal()||(this._reversePixels=!this._reversePixels)}getPixelForValue(t){return"number"!=typeof t&&(t=this.parse(t)),null===t?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getPixelForTick(t){const e=this.ticks;return t<0||t>e.length-1?null:this.getPixelForValue(e[t].value)}getValueForPixel(t){return Math.round(this._startValue+this.getDecimalForPixel(t)*this._valueRange)}getBasePixel(){return this.bottom}},Ro,class extends As{static id="point";parsed;skip;stop;static defaults={borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0};static defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};constructor(t){super(),this.options=void 0,this.parsed=void 0,this.skip=void 0,this.stop=void 0,t&&Object.assign(this,t)}inRange(t,e,i){const s=this.options,{x:n,y:o}=this.getProps(["x","y"],i);return Math.pow(t-n,2)+Math.pow(e-o,2)<Math.pow(s.hitRadius+s.radius,2)}inXRange(t,e){return Nn(this,t,"x",e)}inYRange(t,e){return Nn(this,t,"y",e)}getCenterPoint(t){const{x:e,y:i}=this.getProps(["x","y"],t);return{x:e,y:i}}size(t){let e=(t=t||this.options||{}).radius||0;return e=Math.max(e,e&&t.hoverRadius||0),2*(e+(e&&t.borderWidth||0))}draw(t,e){const i=this.options;this.skip||i.radius<.1||!ge(this,e,this.size(i)/2)||(t.strokeStyle=i.borderColor,t.lineWidth=i.borderWidth,t.fillStyle=i.backgroundColor,pe(t,i,this.x,this.y))}getRange(){const t=this.options||{};return t.radius+t.hitRadius}},jn,class extends As{static id="bar";static defaults={borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0};static defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};constructor(t){super(),this.options=void 0,this.horizontal=void 0,this.base=void 0,this.width=void 0,this.height=void 0,this.inflateAmount=void 0,t&&Object.assign(this,t)}draw(t){const{inflateAmount:e,options:{borderColor:i,backgroundColor:s}}=this,{inner:n,outer:o}=function(t){const e=An(t),i=e.right-e.left,s=e.bottom-e.top,n=function(t,e,i){const s=t.options.borderWidth,n=t.borderSkipped,o=Se(s);return{t:zn(n.top,o.top,0,i),r:zn(n.right,o.right,0,e),b:zn(n.bottom,o.bottom,0,i),l:zn(n.left,o.left,0,e)}}(t,i/2,s/2),o=function(t,e,i){const{enableBorderRadius:s}=t.getProps(["enableBorderRadius"]),n=t.options.borderRadius,o=De(n),r=Math.min(e,i),a=t.borderSkipped,l=s||K(n);return{topLeft:zn(!l||a.top||a.left,o.topLeft,0,r),topRight:zn(!l||a.top||a.right,o.topRight,0,r),bottomLeft:zn(!l||a.bottom||a.left,o.bottomLeft,0,r),bottomRight:zn(!l||a.bottom||a.right,o.bottomRight,0,r)}}(t,i/2,s/2);return{outer:{x:e.left,y:e.top,w:i,h:s,radius:o},inner:{x:e.left+n.l,y:e.top+n.t,w:i-n.l-n.r,h:s-n.t-n.b,radius:{topLeft:Math.max(0,o.topLeft-Math.max(n.t,n.l)),topRight:Math.max(0,o.topRight-Math.max(n.t,n.r)),bottomLeft:Math.max(0,o.bottomLeft-Math.max(n.b,n.l)),bottomRight:Math.max(0,o.bottomRight-Math.max(n.b,n.r))}}}}(this),r=(a=o.radius).topLeft||a.topRight||a.bottomLeft||a.bottomRight?Ce:Fn;var a;t.save(),o.w===n.w&&o.h===n.h||(t.beginPath(),r(t,Hn(o,e,n)),t.clip(),r(t,Hn(n,-e,o)),t.fillStyle=i,t.fill("evenodd")),t.beginPath(),r(t,Hn(n,e)),t.fillStyle=s,t.fill(),t.restore()}inRange(t,e,i){return On(this,t,e,i)}inXRange(t,e){return On(this,t,null,e)}inYRange(t,e){return On(this,null,t,e)}getCenterPoint(t){const{x:e,y:i,base:s,horizontal:n}=this.getProps(["x","y","base","horizontal"],t);return{x:n?(e+s)/2:e,y:n?i:(i+s)/2}}getRange(t){return"x"===t?this.width/2:this.height/2}},class extends As{static id="arc";static defaults={borderAlign:"center",borderColor:"#fff",borderDash:[],borderDashOffset:0,borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:!0,selfJoin:!1};static defaultRoutes={backgroundColor:"backgroundColor"};static descriptors={_scriptable:!0,_indexable:t=>"borderDash"!==t};circumference;endAngle;fullCircles;innerRadius;outerRadius;pixelMargin;startAngle;constructor(t){super(),this.options=void 0,this.circumference=void 0,this.startAngle=void 0,this.endAngle=void 0,this.innerRadius=void 0,this.outerRadius=void 0,this.pixelMargin=0,this.fullCircles=0,t&&Object.assign(this,t)}inRange(t,e,i){const s=this.getProps(["x","y"],i),{angle:n,distance:o}=St(s,{x:t,y:e}),{startAngle:r,endAngle:a,innerRadius:l,outerRadius:h,circumference:c}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],i),d=(this.options.spacing+this.options.borderWidth)/2,u=J(c,a-r),p=jt(n,r,a)&&r!==a,m=u>=gt||p,g=At(o,l+d,h+d);return m&&g}getCenterPoint(t){const{x:e,y:i,startAngle:s,endAngle:n,innerRadius:o,outerRadius:r}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius"],t),{offset:a,spacing:l}=this.options,h=(s+n)/2,c=(o+r+l+a)/2;return{x:e+Math.cos(h)*c,y:i+Math.sin(h)*c}}tooltipPosition(t){return this.getCenterPoint(t)}draw(t){const{options:e,circumference:i}=this,s=(e.offset||0)/4,n=(e.spacing||0)/2,o=e.circular;if(this.pixelMargin="inner"===e.borderAlign?.33:0,this.fullCircles=i>gt?Math.floor(i/gt):0,0===i||this.innerRadius<0||this.outerRadius<0)return;t.save();const r=(this.startAngle+this.endAngle)/2;t.translate(Math.cos(r)*s,Math.sin(r)*s);const a=s*(1-Math.sin(Math.min(mt,i||0)));t.fillStyle=e.backgroundColor,t.strokeStyle=e.borderColor,function(t,e,i,s,n){const{fullCircles:o,startAngle:r,circumference:a}=e;let l=e.endAngle;if(o){En(t,e,i,s,l,n);for(let e=0;e<o;++e)t.fill();isNaN(a)||(l=r+(a%gt||gt))}En(t,e,i,s,l,n),t.fill()}(t,this,a,n,o),function(t,e,i,s,n){const{fullCircles:o,startAngle:r,circumference:a,options:l}=e,{borderWidth:h,borderJoinStyle:c,borderDash:d,borderDashOffset:u,borderRadius:p}=l,m="inner"===l.borderAlign;if(!h)return;t.setLineDash(d||[]),t.lineDashOffset=u,m?(t.lineWidth=2*h,t.lineJoin=c||"round"):(t.lineWidth=h,t.lineJoin=c||"bevel");let g=e.endAngle;if(o){En(t,e,i,s,g,n);for(let e=0;e<o;++e)t.stroke();isNaN(a)||(g=r+(a%gt||gt))}m&&function(t,e,i){const{startAngle:s,pixelMargin:n,x:o,y:r,outerRadius:a,innerRadius:l}=e;let h=n/a;t.beginPath(),t.arc(o,r,a,s-h,i+h),l>n?(h=n/l,t.arc(o,r,l,i+h,s-h,!0)):t.arc(o,r,n,i+wt,s-wt),t.closePath(),t.clip()}(t,e,g),l.selfJoin&&g-r>=mt&&0===p&&"miter"!==c&&function(t,e,i){const{startAngle:s,x:n,y:o,outerRadius:r,innerRadius:a,options:l}=e,{borderWidth:h,borderJoinStyle:c}=l,d=Math.min(h/r,Pt(s-i));if(t.beginPath(),t.arc(n,o,r-h/2,s+d/2,i-d/2),a>0){const e=Math.min(h/a,Pt(s-i));t.arc(n,o,a+h/2,i-e/2,s+e/2,!0)}else{const e=Math.min(h/2,r*Pt(s-i));if("round"===c)t.arc(n,o,e,i-mt/2,s+mt/2,!0);else if("bevel"===c){const r=2*e*e,a=-r*Math.cos(i+mt/2)+n,l=-r*Math.sin(i+mt/2)+o,h=r*Math.cos(s+mt/2)+n,c=r*Math.sin(s+mt/2)+o;t.lineTo(a,l),t.lineTo(h,c)}}t.closePath(),t.moveTo(0,0),t.rect(0,0,t.canvas.width,t.canvas.height),t.clip("evenodd")}(t,e,g),o||(En(t,e,i,s,g,n),t.stroke())}(t,this,a,n,o),t.restore()}},io,xo,ro),Bo||(xn.defaults.font.family="Poppins, sans-serif",xn.defaults.font.size=11,xn.defaults.color="#767676",xn.defaults.plugins.legend.labels.boxWidth=8,xn.defaults.plugins.legend.labels.usePointStyle=!0,xn.defaults.plugins.legend.labels.padding=12,xn.defaults.plugins.tooltip.backgroundColor="#fff",xn.defaults.plugins.tooltip.titleColor="#0b172b",xn.defaults.plugins.tooltip.bodyColor="#0b172b",xn.defaults.plugins.tooltip.borderColor="#efefef",xn.defaults.plugins.tooltip.borderWidth=1,xn.defaults.plugins.tooltip.padding=10,xn.defaults.plugins.tooltip.displayColors=!0,xn.defaults.plugins.tooltip.cornerRadius=6,xn.defaults.plugins.tooltip.boxPadding=4,Bo=!0),Go=!0);const Qo={upgrade:{es:"/admin/precios",en:"/en/admin/pricing"},ai_visibility:{es:"/admin/dominio/visibilidad-ia/%d",en:"/en/admin/domain/ai-visibility/%d"},backlinks:{es:"/admin/dominio/enlaces/%d",en:"/en/admin/domain/backlinks/%d"},seo_audits:{es:"/admin/dominio/auditorias-seo/%d",en:"/en/admin/domain/seo-audits/%d"}};function tr(){return(window.slrAdmin?.appOrigin||"https://app.trueranker.com").replace(/\/$/,"")}function er(t,e){const i=Qo[t]?.["es"===window.slrAdmin?.lang?"es":"en"];if(!i)return"";if(i.includes("%d")){const t=parseInt(e,10);return t?i.replace("%d",String(t)):""}return i}function ir(t,e){if(t&&!t.closed)return t.opener=null,void(t.location.href=e);window.open(e,"_blank")}async function sr(t="upgrade",e=0){const i=window.open("about:blank","_blank"),n={page:t};e&&(n.project_domain_id=e);try{const t=await s()({path:o("/connection/plugin-login-url"),method:"POST",data:n});if(t?.url&&"string"==typeof t.url)return void ir(i,t.url)}catch(t){}const r=function(t,e){if("upgrade"===t)return window.slrAdmin?.upgradeUrl||`${tr()}${er("upgrade",0)}`;const i=er(t,e);return i?`${tr()}${i}`:""}(t,e);r?ir(i,r):function(t){t&&!t.closed&&t.close()}(i)}function nr({icon:t,title:e,state:i,emptyMessage:s,waitingMessage:n,main:o,footer:r,href:h,onActivate:c,disabled:d}){const u=["slr-kpi-card","slr-kpi-card--rich",Boolean(h||c)?"slr-kpi-card--clickable":""].filter(Boolean).join(" ");return(0,l.jsxs)("div",{className:u,children:[h?(0,l.jsx)("a",{className:"slr-kpi-card__hit",href:h,children:(0,l.jsx)("span",{className:"screen-reader-text",children:e})}):null,c?(0,l.jsx)("button",{type:"button",className:"slr-kpi-card__hit",onClick:c,disabled:d,"aria-label":e}):null,(0,l.jsxs)("div",{className:"slr-kpi-card__header",children:[(0,l.jsx)("span",{className:`slr-kpi-card__icon dashicons ${t}`,"aria-hidden":"true"}),(0,l.jsx)("span",{className:"slr-kpi-card__title",children:e})]}),"waiting"===i&&(0,l.jsxs)("div",{className:"slr-kpi-card__state slr-kpi-card__state--waiting",children:[(0,l.jsx)("span",{className:"slr-kpi-card__pulse dashicons dashicons-update slr-pulse","aria-hidden":"true"}),(0,l.jsx)("p",{className:"slr-kpi-card__state-title",children:(0,a.__)("Collecting data","seo-local-rank")}),n&&(0,l.jsx)("p",{className:"slr-kpi-card__state-desc",children:n})]}),"empty"===i&&(0,l.jsxs)("div",{className:"slr-kpi-card__state slr-kpi-card__state--empty",children:[(0,l.jsx)("span",{className:"slr-kpi-card__empty-icon dashicons dashicons-chart-area","aria-hidden":"true"}),(0,l.jsx)("p",{className:"slr-kpi-card__state-desc",children:s})]}),"content"===i&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)("div",{className:"slr-kpi-card__main",children:o}),r&&(0,l.jsx)("div",{className:"slr-kpi-card__footer",children:r})]})]})}function or({label:t,value:e,trend:i}){return(0,l.jsxs)("div",{className:"slr-kpi-card__row",children:[(0,l.jsx)("span",{className:"slr-kpi-card__row-label",children:t}),(0,l.jsxs)("span",{className:"slr-kpi-card__row-value",children:[e,i]})]})}function rr({data:t,projectDomainId:i}){const[s,n]=(0,e.useState)(""),o=t?.kpi_data||{},r=t?.visibility_score||{},h=t?.mentions_summary||{},c=t?.project_seo_audit_data||{},d=Boolean(t?.seo_audit_enabled),u=Number(t?.project_domain?.type_id??0),p=t?.keywords_data?Object.keys(t.keywords_data).length:0,m=Array.isArray(t?.score_trend)?t.score_trend:[],g=Number(h.mentions_total||0)-Number(h.mentions_previous||0),b=Number(h.citations_total||0)-Number(h.citations_previous||0);let f="content";0===Number(o.num_tracking_keywords)?f="empty":0===p&&(f="waiting");let v="content";0===Number(o.num_tracking_prompts)?v="empty":0===m.length&&(v="waiting");let w="content";3===u?w="hidden":null===t?.days_since_last_update&&(w="waiting");const y=Number(c.audits_count||0),_=o.vi_current,x=function(){const t=new URL(window.location.href);return t.searchParams.set("page","seolocalrank-rank-tracker"),t.href}(),C=async t=>{if(!s&&i){n(t);try{await sr(t,i)}finally{n("")}}};return(0,l.jsxs)("div",{className:"slr-kpi-grid slr-kpi-grid--dashboard",children:[(0,l.jsx)(nr,{icon:"dashicons-chart-line",title:(0,a.__)("Rank Tracker","seo-local-rank"),state:f,emptyMessage:(0,a.__)("Add keywords to start tracking rankings.","seo-local-rank"),waitingMessage:(0,a.__)("Rank data will appear after the first update.","seo-local-rank"),href:x,main:(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)("div",{className:"slr-kpi-card__value-row",children:[(0,l.jsx)("span",{className:"slr-kpi-card__value",children:Uo(o.tk_avg_rank,1)}),(0,l.jsx)(qo,{value:o.tk_change_avg_rank,positive:Number(o.tk_change_avg_rank)<0,variant:"solid"})]}),(0,l.jsx)("p",{className:"slr-kpi-card__metric-label",children:(0,a.__)("Average position","seo-local-rank")})]}),footer:(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(or,{label:(0,a.__)("Organic visibility","seo-local-rank"),value:`${Uo(o.tk_avg_ov,2)}%`,trend:(0,l.jsx)(qo,{value:o.tk_change_avg_ov,positive:Number(o.tk_change_avg_ov)>0,suffix:"%"})}),(0,l.jsx)(or,{label:(0,a.__)("Keywords","seo-local-rank"),value:Uo(o.num_tracking_keywords)})]})}),(0,l.jsx)(nr,{icon:"dashicons-star-filled",title:(0,a.__)("AI Visibility","seo-local-rank"),state:v,emptyMessage:(0,a.__)("Add prompts to measure AI visibility.","seo-local-rank"),waitingMessage:(0,a.__)("AI visibility data will appear after the first scan.","seo-local-rank"),onActivate:()=>C("ai_visibility"),disabled:Boolean(s)||!i,main:(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)("div",{className:"slr-kpi-card__value-row",children:[(0,l.jsx)("span",{className:"slr-kpi-card__value",children:Uo(r.score)}),(0,l.jsx)(qo,{value:r.delta,positive:"up"===r.trend,variant:"solid"})]}),(0,l.jsx)("p",{className:"slr-kpi-card__metric-label",children:(0,a.__)("AI visibility score","seo-local-rank")})]}),footer:(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(or,{label:(0,a.__)("Mentions","seo-local-rank"),value:Uo(h.mentions_total),trend:(0,l.jsx)(qo,{value:g,positive:g>0})}),(0,l.jsx)(or,{label:(0,a.__)("Citations","seo-local-rank"),value:Uo(h.citations_total),trend:(0,l.jsx)(qo,{value:b,positive:b>0})}),(0,l.jsx)(or,{label:(0,a.__)("Prompts","seo-local-rank"),value:Uo(o.num_tracking_prompts)})]})}),"hidden"!==w&&(0,l.jsx)(nr,{icon:"dashicons-admin-links",title:(0,a.__)("Backlinks","seo-local-rank"),state:w,waitingMessage:(0,a.__)("Backlink summary is being prepared.","seo-local-rank"),onActivate:()=>C("backlinks"),disabled:Boolean(s)||!i,main:(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)("div",{className:"slr-kpi-card__value-row",children:[(0,l.jsx)("span",{className:"slr-kpi-card__value",children:$o(o.bl_main_domains,1)}),(0,l.jsx)(qo,{value:o.bl_change_main_domains,positive:Number(o.bl_change_main_domains)>0,compact:!0,variant:"solid"})]}),(0,l.jsx)("p",{className:"slr-kpi-card__metric-label",children:(0,a.__)("Referring domains","seo-local-rank")})]}),footer:(0,l.jsx)(or,{label:(0,a.__)("Tracked backlinks","seo-local-rank"),value:Uo(o.num_tracked_backlinks),trend:Number(o.num_tracked_backlinks_with_issues)>0?(0,l.jsxs)("span",{className:"slr-trend slr-trend--down slr-trend--issues",children:[Uo(o.num_tracked_backlinks_with_issues)," ",(0,a.__)("with issues","seo-local-rank")]}):null})}),d?(0,l.jsx)(nr,{icon:"dashicons-search",title:(0,a.__)("SEO Audits","seo-local-rank"),state:y>0?"content":"empty",emptyMessage:(0,a.__)("No audits yet for this project.","seo-local-rank"),onActivate:()=>C("seo_audits"),disabled:Boolean(s)||!i,main:(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)("div",{className:"slr-kpi-card__value-row",children:[(0,l.jsx)("span",{className:`slr-kpi-card__value slr-kpi-card__value--${Ko(c.avg_score)}`,children:Uo(c.avg_score,1)}),(0,l.jsx)("span",{className:"slr-kpi-card__value-suffix",children:"/100"})]}),(0,l.jsx)("p",{className:"slr-kpi-card__metric-label",children:(0,a.__)("Average score","seo-local-rank")})]}),footer:(0,l.jsx)(or,{label:(0,a.__)("URLs audited","seo-local-rank"),value:Uo(y)})}):(0,l.jsx)(nr,{icon:"dashicons-heart",title:(0,a.__)("Visibility index","seo-local-rank"),state:null!=_?"content":"empty",emptyMessage:(0,a.__)("Visibility index data is not available yet.","seo-local-rank"),main:(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)("div",{className:"slr-kpi-card__value-row",children:[(0,l.jsx)("span",{className:"slr-kpi-card__value",children:Uo(_,4)}),(0,l.jsx)(qo,{value:o.vi_change_one_month,positive:Number(o.vi_change_one_month)>0,suffix:"%",variant:"solid"})]}),(0,l.jsx)("p",{className:"slr-kpi-card__metric-label",children:(0,a.__)("Mobile visibility","seo-local-rank")})]})})]})}function ar(t){return t?.project_domain_id||t?.id||0}function lr(t,e=""){return t?.project_name||t?.name_displayed||t?.name||e}function hr({domain:t,size:e=24}){const i=r(t?.favicon||""),s=lr(t);return i?(0,l.jsx)("img",{className:"slr-project-selector__favicon",src:i,alt:"",width:e,height:e}):(0,l.jsx)("span",{className:"slr-project-selector__favicon slr-project-selector__favicon--fallback","aria-hidden":"true",children:(n=s,n&&"string"==typeof n?n.charAt(0).toUpperCase():"?")});var n}function cr(){return(0,l.jsx)("span",{className:"slr-upgrade-button__icon","aria-hidden":"true"})}function dr({count:t,sync:e}){if(null==t)return null;let i="",s="",n="";return e&&(e.paused>0?(i="warn",s="dashicons-controls-pause",n=(0,a.sprintf)(/* translators: %d: number of paused keywords */ /* translators: %d: number of paused keywords */
    5 (0,a._n)("%d paused","%d paused",e.paused,"seo-local-rank"),e.paused)):t>0&&(n=(0,a.sprintf)(/* translators: %d: percent of keywords updated */ /* translators: %d: percent of keywords updated */
    6 (0,a.__)("%d%% updated","seo-local-rank"),Math.round(Number(e.percent)||0)),e.withoutEndData>0?(i="warn",s="dashicons-update"):i="ok")),(0,l.jsxs)("div",{className:"slr-toolbar__keywords",children:[(0,l.jsx)("span",{children:(0,a.sprintf)(/* translators: %d: number of keywords */ /* translators: %d: number of keywords */
    7 (0,a._n)("%d Keyword","%d Keywords",t,"seo-local-rank"),t)}),n&&(0,l.jsxs)("span",{className:`slr-toolbar__sync slr-toolbar__sync--${i}`,children:["(",n,s&&(0,l.jsx)("span",{className:`dashicons ${s}`,"aria-hidden":"true"}),")"]})]})}function ur({selectedProject:t,domains:i,siteDomain:n,onProjectChange:r,keywordCount:h=null,keywordSync:c=null}){const[d,u]=(0,e.useState)(!1),[p,m]=(0,e.useState)(!1),[g,b]=(0,e.useState)(""),[f,v]=(0,e.useState)(!1),w=(0,e.useRef)(null),y=ar(t),_=lr(t,n),x=i.length>1,C=i.length>0,k=(0,e.useMemo)(()=>{const t=g.trim().toLowerCase();return t?i.filter(e=>[e.project_name,e.name_displayed,e.name].filter(Boolean).join(" ").toLowerCase().includes(t)):i},[i,g]);return(0,e.useEffect)(()=>{if(!p)return;const t=t=>{w.current&&!w.current.contains(t.target)&&(m(!1),b(""))};return document.addEventListener("mousedown",t),()=>document.removeEventListener("mousedown",t)},[p]),(0,l.jsxs)("div",{className:"slr-toolbar",children:[(0,l.jsxs)("div",{className:"slr-toolbar__left",children:[(0,l.jsxs)("div",{className:"slr-project-selector",ref:w,children:[(0,l.jsxs)("button",{type:"button",className:"slr-project-selector__toggle","aria-expanded":p,"aria-haspopup":"listbox",disabled:d||0===i.length,onClick:()=>C&&m(t=>!t),children:[(0,l.jsx)(hr,{domain:t}),(0,l.jsx)("span",{className:"slr-project-selector__name",children:_}),(0,l.jsx)("span",{className:"dashicons dashicons-arrow-down-alt2 slr-project-selector__chevron","aria-hidden":"true"})]}),p&&C&&(0,l.jsxs)("div",{className:"slr-project-selector__menu",role:"listbox",children:[x&&(0,l.jsxs)("div",{className:"slr-project-selector__search",children:[(0,l.jsx)("span",{className:"dashicons dashicons-search","aria-hidden":"true"}),(0,l.jsx)("input",{type:"search",value:g,onChange:t=>b(t.target.value),placeholder:(0,a.__)("Search project…","seo-local-rank"),autoComplete:"off"})]}),(0,l.jsxs)("ul",{className:"slr-project-selector__list",children:[k.map(t=>{const e=ar(t),i=e===y;return(0,l.jsx)("li",{children:(0,l.jsxs)("button",{type:"button",role:"option","aria-selected":i,className:"slr-project-selector__item"+(i?" is-selected":""),onClick:()=>(async t=>{if(!d&&t&&t!==y){u(!0),m(!1),b("");try{await s()({path:o(`/domains/${t}/select`),method:"POST"}),r()}finally{u(!1)}}else m(!1)})(e),children:[(0,l.jsx)(hr,{domain:t,size:20}),(0,l.jsx)("span",{className:"slr-project-selector__item-name",children:lr(t)}),i&&(0,l.jsx)("span",{className:"dashicons dashicons-yes slr-project-selector__check","aria-hidden":"true"})]})},e)}),0===k.length&&(0,l.jsx)("li",{className:"slr-project-selector__empty",children:(0,a.__)("No projects found.","seo-local-rank")})]})]})]}),(0,l.jsx)(dr,{count:h,sync:c})]}),(0,l.jsxs)("button",{type:"button",className:"slr-upgrade-button",disabled:f,onClick:async()=>{if(!f){v(!0);try{await sr()}finally{v(!1)}}},children:[(0,l.jsx)(cr,{}),(0,l.jsx)("span",{children:(0,a.__)("Upgrade","seo-local-rank")})]})]})}function pr({data:t}){const e=t?.kpi_data||{},i=(s=t?.keywords_data,s?(Array.isArray(s)?s:Object.values(s)).filter(t=>t&&"object"==typeof t).sort((t,e)=>String(e.date).localeCompare(String(t.date))):[]);var s;let n="content";0===Number(e.num_tracking_keywords||0)?n="empty":0===i.length&&(n="waiting");const o=[...i].reverse().filter(t=>Number(t.count)>0),r=function(t){if(!t||!t.count)return[];const e=Number(t.count),i=t=>Math.round(100*Number(t)/e*10)/10,s=["#EDC92F","#69B5EB","#3A8AD5","#1F78B4","#CCCCCC"],n=[{label:(0,a.__)("Top 1–3","seo-local-rank"),value:i(t.top_1_3)},{label:(0,a.__)("Top 4–10","seo-local-rank"),value:i(t.top_4_10)}];return 1===Number(t.max_depth)?n.push({label:(0,a.__)("Top 11+","seo-local-rank"),value:i((t.top_11_20||0)+(t.top_21_50||0)+(t.top_51_100||0)+(t.top_101||0))}):(n.push({label:(0,a.__)("Top 11–20","seo-local-rank"),value:i(t.top_11_20)}),Number(t.max_depth)>5?(n.push({label:(0,a.__)("Top 21–100","seo-local-rank"),value:i((t.top_21_50||0)+(t.top_51_100||0))}),n.push({label:(0,a.__)("Top 101+","seo-local-rank"),value:i(t.top_101)})):Number(t.max_depth)>2?(n.push({label:(0,a.__)("Top 21–50","seo-local-rank"),value:i(t.top_21_50)}),n.push({label:(0,a.__)("Top 51+","seo-local-rank"),value:i((t.top_51_100||0)+(t.top_101||0))})):n.push({label:(0,a.__)("Top 21+","seo-local-rank"),value:i((t.top_21_50||0)+(t.top_51_100||0)+(t.top_101||0))})),n.filter(t=>t.value>0).map((t,e)=>({...t,color:s[e]||s[s.length-1]}))}(i[0]||null),h={labels:o.map(t=>Yo(t.date)),datasets:[{label:(0,a.__)("Average position","seo-local-rank"),data:o.map(t=>Math.round(t.sum_rank/t.count*10)/10),borderColor:"#EF7A35",backgroundColor:"transparent",yAxisID:"yRank",tension:.3,pointRadius:3},{label:(0,a.__)("Organic visibility","seo-local-rank"),data:o.map(t=>Math.round(t.sum_ov/t.count*10)/10),borderColor:"#4E78F4",backgroundColor:"transparent",yAxisID:"yOv",tension:.3,pointRadius:3}]},c=h.datasets[0].data,d=h.datasets[1].data,u={responsive:!0,maintainAspectRatio:!1,interaction:{mode:"index",intersect:!1},plugins:{legend:Wo},scales:{x:Vo.x,yRank:{...Vo.y,position:"left",reverse:!0,min:c.length?Math.max(1,Math.min(...c)-2):1,max:c.length?Math.max(...c)+2:100},yOv:{...Vo.y,position:"right",min:d.length?Math.max(0,Math.min(...d)-1):0,max:d.length?Math.max(...d)+1:100,grid:{drawOnChartArea:!1}}}},p={labels:r.map(t=>t.label),datasets:[{data:r.map(t=>t.value),backgroundColor:r.map(t=>t.color),borderWidth:0}]};return(0,l.jsxs)("section",{className:"slr-dash-section",children:[(0,l.jsx)(Io,{icon:"dashicons-chart-line",title:(0,a.__)("Rank Tracker","seo-local-rank")}),(0,l.jsxs)("div",{className:"slr-dash-grid",children:[(0,l.jsx)(Ho,{title:(0,a.__)("Evolution","seo-local-rank"),subtitle:(0,a.__)("Positioning and organic visibility over the last 30 days.","seo-local-rank"),state:n,emptyMessage:(0,a.__)("Add keywords to see rank evolution.","seo-local-rank"),waitingMessage:(0,a.__)("Rank data will appear after the first update.","seo-local-rank"),children:(0,l.jsx)("div",{className:"slr-chart slr-chart--line",children:(0,l.jsx)(Ao,{data:h,options:u})})}),(0,l.jsx)(Ho,{title:(0,a.__)("Keywords distribution","seo-local-rank"),state:"content"===n&&0===r.length?"empty":n,emptyMessage:(0,a.__)("No distribution data yet.","seo-local-rank"),waitingMessage:(0,a.__)("Distribution will appear after the first update.","seo-local-rank"),children:(0,l.jsx)("div",{className:"slr-chart slr-chart--donut",children:(0,l.jsx)(Oo,{data:p,options:{responsive:!0,maintainAspectRatio:!1,cutout:"55%",plugins:{legend:{position:"bottom",labels:{boxWidth:10,padding:12}},tooltip:{callbacks:{label:t=>`${t.label}: ${t.parsed}%`}}}}})})})]})]})}function mr({domainsPayload:t,selectedProject:i,onProjectChange:r}){const h=t?.domains||[],c=t?.domain||"",d=i?.project_domain_id||i?.id||0,[u,p]=(0,e.useState)(null),[m,g]=(0,e.useState)(!1),[b,f]=(0,e.useState)(""),v=(0,e.useCallback)(async()=>{if(d){g(!0),f("");try{const t=await s()({path:o(`/domains/dashboard?project_domain_id=${d}`)});p(t?.data||null)}catch(t){p(null),f(t?.message||(0,a.__)("Could not load the dashboard. Try again later.","seo-local-rank"))}finally{g(!1)}}else p(null)},[d]);return(0,e.useEffect)(()=>{v()},[v]),0===h.length?(0,l.jsxs)("div",{className:"slr-panel slr-empty-state",children:[(0,l.jsx)("h2",{className:"slr-panel__title",children:(0,a.__)("No project for this domain","seo-local-rank")}),(0,l.jsx)("p",{children:(0,e.createInterpolateElement)((0,a.sprintf)(/* translators: %s: site domain */ /* translators: %s: site domain */
    8 (0,a.__)("There is no TrueRanker project for <strong>%s</strong>.","seo-local-rank"),c),{strong:(0,l.jsx)("strong",{})})}),(0,l.jsx)(n.Notice,{status:"info",isDismissible:!1,children:(0,a.__)("Creating a project from scratch will be available soon.","seo-local-rank")})]}):i?m&&!u?(0,l.jsx)(Zo,{}):(0,l.jsxs)("div",{className:"slr-dashboard",children:[(0,l.jsx)(ur,{selectedProject:i,domains:h,siteDomain:c,onProjectChange:r}),(0,l.jsxs)("div",{className:"slr-dashboard__body",children:[b&&(0,l.jsx)(n.Notice,{status:"error",isDismissible:!1,children:b}),u&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(rr,{data:u,projectDomainId:d}),(0,l.jsx)(pr,{data:u}),(0,l.jsx)(Xo,{data:u}),(0,l.jsx)(Jo,{data:u})]})]})]}):(0,l.jsx)("div",{className:"slr-panel slr-empty-state",children:(0,l.jsx)("p",{children:(0,a.__)("No project selected.","seo-local-rank")})})}const gr="welcome",br="api-key",fr="start-fresh";function vr({settings:t,onConnected:i}){const r="string"==typeof t?.wp_user_email?t.wp_user_email:"",[h,c]=(0,e.useState)(gr),[d,u]=(0,e.useState)(""),[p,m]=(0,e.useState)(r),[g,b]=(0,e.useState)(!1),[f,v]=(0,e.useState)(!1),[w,y]=(0,e.useState)(!1),[_,x]=(0,e.useState)(null),C=t?.api_key_url||"https://app.trueranker.com/es/admin/api-key",k=f||w,E=()=>{c(gr),x(null),u(""),m(r),b(!1)},R=async()=>{if(d.trim()){v(!0),x(null);try{await s()({path:o("/settings"),method:"POST",data:{api_key:d.trim()}}),u(""),i()}catch(t){x({status:"error",message:t?.message||(0,a.__)("Could not connect with this API key.","seo-local-rank")})}finally{v(!1)}}else x({status:"error",message:(0,a.__)("Enter your API key.","seo-local-rank")})};return(0,l.jsx)("div",{className:"slr-onboarding",children:(0,l.jsxs)("div",{className:"slr-panel slr-onboarding__panel",children:[_&&(0,l.jsx)(n.Notice,{status:_.status,isDismissible:!0,onRemove:()=>x(null),children:_.message}),h===gr&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)("p",{className:"slr-onboarding__lead",children:(0,a.__)("TrueRanker helps you track keyword rankings, monitor backlinks and measure your AI visibility — all from WordPress.","seo-local-rank")}),(0,l.jsx)("p",{className:"slr-onboarding__question",children:(0,a.__)("How do you want to get started?","seo-local-rank")}),(0,l.jsxs)("div",{className:"slr-onboarding__actions",children:[(0,l.jsx)(n.Button,{variant:"primary",onClick:()=>{x(null),c(br)},children:(0,a.__)("Connect existing account","seo-local-rank")}),(0,l.jsx)(n.Button,{variant:"secondary",onClick:()=>{x(null),c(fr)},children:(0,a.__)("Start from scratch","seo-local-rank")})]})]}),h===br&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)("h2",{className:"slr-panel__title",children:(0,a.__)("Connect your account","seo-local-rank")}),(0,l.jsx)("p",{className:"slr-onboarding__help",children:(0,a.__)("Paste your TrueRanker API key to link this WordPress site with your account.","seo-local-rank")}),(0,l.jsx)("p",{className:"slr-onboarding__help",children:(0,l.jsx)("a",{href:C,target:"_blank",rel:"noopener noreferrer",children:(0,a.__)("Get API key in TrueRanker","seo-local-rank")})}),(0,l.jsx)(n.TextControl,{label:(0,a.__)("API Key","seo-local-rank"),value:d,onChange:u,type:"password",disabled:k}),(0,l.jsxs)("div",{className:"slr-onboarding__actions",children:[(0,l.jsx)(n.Button,{variant:"primary",onClick:R,isBusy:f,disabled:k,children:(0,a.__)("Connect","seo-local-rank")}),(0,l.jsx)(n.Button,{variant:"secondary",onClick:E,disabled:k,children:(0,a.__)("Back","seo-local-rank")})]})]}),h===fr&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)("h2",{className:"slr-panel__title",children:(0,a.__)("Start from scratch","seo-local-rank")}),(0,l.jsx)("p",{className:"slr-onboarding__help",children:g?(0,a.__)("We have sent the API key to this email. The field can no longer be changed.","seo-local-rank"):(0,a.__)("Enter your email. TrueRanker will send you an API key to connect this site. The key is not shown here: it arrives by email only.","seo-local-rank")}),(0,l.jsx)(n.TextControl,{label:(0,a.__)("Email","seo-local-rank"),value:p,onChange:m,type:"email",disabled:k||g,readOnly:g}),!g&&(0,l.jsxs)("div",{className:"slr-onboarding__actions",children:[(0,l.jsx)(n.Button,{variant:"primary",onClick:async()=>{if(p.trim()){y(!0),x(null);try{const t=await s()({path:o("/connection/send-api-key"),method:"POST",data:{email:p.trim()}});x({status:"success",message:t?.message||(0,a.__)("Check your inbox: we have sent you the API key. Paste it below to connect.","seo-local-rank")}),b(!0)}catch(t){x({status:"error",message:t?.message||(0,a.__)("Could not send the API key. Please try again.","seo-local-rank")})}finally{y(!1)}}else x({status:"error",message:(0,a.__)("Enter a valid email.","seo-local-rank")})},isBusy:w,disabled:k,children:(0,a.__)("Send API key","seo-local-rank")}),(0,l.jsx)(n.Button,{variant:"secondary",onClick:E,disabled:k,children:(0,a.__)("Back","seo-local-rank")})]}),g&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)("hr",{className:"slr-onboarding__divider"}),(0,l.jsx)("p",{className:"slr-onboarding__help",children:(0,a.__)("When you receive the email, paste the API key here to connect.","seo-local-rank")}),(0,l.jsx)(n.TextControl,{label:(0,a.__)("API Key","seo-local-rank"),value:d,onChange:u,type:"password",disabled:k}),(0,l.jsxs)("div",{className:"slr-onboarding__actions",children:[(0,l.jsx)(n.Button,{variant:"primary",onClick:R,isBusy:f,disabled:k,children:(0,a.__)("Connect","seo-local-rank")}),(0,l.jsx)(n.Button,{variant:"secondary",onClick:E,disabled:k,children:(0,a.__)("Back","seo-local-rank")})]})]})]})]})})}function wr(t){if(!t||"string"!=typeof t)return null;const e=t.trim().match(/^(\d{4})-(\d{2})-(\d{2})/);if(!e)return null;const i=new Date(Date.UTC(Number(e[1]),Number(e[2])-1,Number(e[3])));return Number.isNaN(i.getTime())?null:i}function yr(t){if(!t)return"";if("string"==typeof t){const e=wr(t);return e?yr(e):""}return t instanceof Date&&!Number.isNaN(t.getTime())?`${t.getUTCFullYear()}-${String(t.getUTCMonth()+1).padStart(2,"0")}-${String(t.getUTCDate()).padStart(2,"0")}`:""}function _r(){const t=new Date;return new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate()))}function xr(t,e){const i=new Date(t.getTime());return i.setUTCDate(i.getUTCDate()+e),i}function Cr(t,e){const i=new Date(t.getTime());return i.setUTCMonth(i.getUTCMonth()+e),i}function kr(t){return new Date(Date.UTC(t.getUTCFullYear(),t.getUTCMonth(),1))}function Er(t,e,i){return t<e?e:t>i?i:t}function Rr(t,e){return Boolean(t&&e&&yr(t)===yr(e))}function Mr(t){const e=[];return t>=2&&e.push("1day"),t>=7&&e.push("7days"),t>=31&&e.push("1month"),t>=61&&e.push("2months"),t>=92&&e.push("3months"),e}function Tr(t,e){switch(t){case"1day":return{start:xr(e,-1),end:e};case"7days":return{start:xr(e,-6),end:e};case"1month":default:return{start:Cr(e,-1),end:e};case"2months":return{start:Cr(e,-2),end:e};case"3months":return{start:Cr(e,-3),end:e}}}function Sr(){return document.documentElement.lang||void 0}const Dr={"1day":(0,a.__)("1 day","seo-local-rank"),"7days":(0,a.__)("7 days","seo-local-rank"),"1month":(0,a.__)("1 month","seo-local-rank"),"2months":(0,a.__)("2 months","seo-local-rank"),"3months":(0,a.__)("3 months","seo-local-rank")};function Lr({year:t,month:e,start:i,end:s,minDate:n,maxDate:o,firstDay:r,weekdayLabels:h,onSelect:c,onMonthChange:d}){const u=Sr(),p=new Intl.DateTimeFormat(u,{month:"short",year:"numeric",timeZone:"UTC"}).format(new Date(Date.UTC(t,e,1))),m=function(t,e,i){const s=(new Date(Date.UTC(t,e,1)).getUTCDay()-i+7)%7,n=new Date(Date.UTC(t,e+1,0)).getUTCDate(),o=[];for(let t=0;t<s;t++)o.push(null);for(let i=1;i<=n;i++)o.push(new Date(Date.UTC(t,e,i)));return o}(t,e,r),g=[],b=n.getUTCFullYear(),f=o.getUTCFullYear();for(let t=b;t<=f;t++)g.push(t);return(0,l.jsxs)("div",{className:"slr-rt-cal",children:[(0,l.jsxs)("div",{className:"slr-rt-cal__nav",children:[(0,l.jsx)("button",{type:"button",className:"slr-rt-cal__nav-btn","aria-label":(0,a.__)("Previous month","seo-local-rank"),onClick:()=>d(Cr(new Date(Date.UTC(t,e,1)),-1)),children:(0,l.jsx)("span",{className:"dashicons dashicons-arrow-left-alt2","aria-hidden":"true"})}),(0,l.jsxs)("div",{className:"slr-rt-cal__caption",children:[(0,l.jsx)("select",{value:e,"aria-label":(0,a.__)("Month","seo-local-rank"),onChange:e=>d(new Date(Date.UTC(t,Number(e.target.value),1))),children:Array.from({length:12},(t,e)=>(0,l.jsx)("option",{value:e,children:new Intl.DateTimeFormat(u,{month:"short",timeZone:"UTC"}).format(new Date(Date.UTC(2021,e,1)))},e))}),(0,l.jsx)("select",{value:t,"aria-label":(0,a.__)("Year","seo-local-rank"),onChange:t=>d(new Date(Date.UTC(Number(t.target.value),e,1))),children:g.map(t=>(0,l.jsx)("option",{value:t,children:t},t))}),(0,l.jsx)("span",{className:"screen-reader-text",children:p})]}),(0,l.jsx)("button",{type:"button",className:"slr-rt-cal__nav-btn","aria-label":(0,a.__)("Next month","seo-local-rank"),onClick:()=>d(Cr(new Date(Date.UTC(t,e,1)),1)),children:(0,l.jsx)("span",{className:"dashicons dashicons-arrow-right-alt2","aria-hidden":"true"})})]}),(0,l.jsxs)("div",{className:"slr-rt-cal__grid",children:[h.map((t,e)=>(0,l.jsx)("span",{className:"slr-rt-cal__weekday",children:t},e)),m.map((t,e)=>{if(!t)return(0,l.jsx)("span",{className:"slr-rt-cal__day is-empty"},`empty-${e}`);const r=(t=>t<n||t>o)(t),a=Rr(t,i),h=Rr(t,s),d=function(t,e,i){if(!t||!e||!i)return!1;const s=t.getTime();return s>=e.getTime()&&s<=i.getTime()}(t,i,s),u=["slr-rt-cal__day",r?"is-disabled":"",a||h?"is-edge":"",d?"is-in-range":""].filter(Boolean).join(" ");return(0,l.jsx)("button",{type:"button",className:u,disabled:r,onClick:()=>c(t),children:t.getUTCDate()},t.toISOString())})]})]})}function Pr({start:t,end:i,minDate:s,maxDate:n,projectDays:o,onChange:r}){const h=Sr(),c=function(t){return String(t||"").toLowerCase().startsWith("en")?0:1}(h),d=(0,e.useRef)(null),[u,p]=(0,e.useState)(!1),[m,g]=(0,e.useState)(t),[b,f]=(0,e.useState)(i),[v,w]=(0,e.useState)(!1),[y,_]=(0,e.useState)(kr(t||_r())),[x,C]=(0,e.useState)(Cr(kr(t||_r()),1)),k=(0,e.useMemo)(()=>Mr(o),[o]),E=(0,e.useMemo)(()=>function(t,e){const i=new Intl.DateTimeFormat(t||void 0,{weekday:"short",timeZone:"UTC"}),s=[];for(let t=0;t<7;t++){const n=(e+t)%7,o=new Date(Date.UTC(2021,7,1+n));s.push(i.format(o))}return s}(h,c),[h,c]),R=_r(),M=function(t,e,i,s){const n=Mr(s);for(const s of n){const n=Tr(s,i);if(Rr(n.start,t)&&Rr(n.end,e))return s}return"custom"}(t,i,R,o),T=function(t,e,i){if(!t||!e)return"";const s=new Intl.DateTimeFormat(i||void 0,{day:"numeric",month:"short",year:"numeric",timeZone:"UTC"});return`${s.format(t)} – ${s.format(e)}`}(t,i,h);(0,e.useEffect)(()=>{if(!u)return;const t=t=>{d.current&&!d.current.contains(t.target)&&p(!1)};return document.addEventListener("mousedown",t),()=>document.removeEventListener("mousedown",t)},[u]);const S=(t,e)=>{const i=Er(t,s,n),o=Er(e,s,n);r(i,o),p(!1)},D=t=>{if(!v||!m)return g(t),f(null),void w(!0);t<m?S(t,m):S(m,t)};return(0,l.jsxs)("div",{className:"slr-rt-daterange",ref:d,children:[(0,l.jsxs)("button",{type:"button",className:"slr-rt-daterange__trigger","aria-expanded":u,"aria-haspopup":"dialog",onClick:()=>{g(t),f(i),w(!1),_(kr(t||R)),C(Cr(kr(t||R),1)),p(t=>!t)},children:[(0,l.jsx)("span",{className:"dashicons dashicons-calendar-alt","aria-hidden":"true"}),(0,l.jsx)("span",{children:T})]}),u&&(0,l.jsxs)("div",{className:"slr-rt-daterange__popover",role:"dialog","aria-label":(0,a.__)("Date range","seo-local-rank"),children:[(0,l.jsx)("button",{type:"button",className:"slr-rt-daterange__close",onClick:()=>p(!1),children:(0,a.__)("Close","seo-local-rank")}),(0,l.jsxs)("div",{className:"slr-rt-daterange__body",children:[(0,l.jsx)("ul",{className:"slr-rt-daterange__presets",children:k.map(t=>(0,l.jsx)("li",{children:(0,l.jsx)("button",{type:"button",className:M===t?"slr-rt-daterange__preset is-active":"slr-rt-daterange__preset",onClick:()=>(t=>{const e=Tr(t,R);S(e.start,e.end)})(t),children:Dr[t]})},t))}),(0,l.jsxs)("div",{className:"slr-rt-daterange__calendars",children:[(0,l.jsx)(Lr,{year:y.getUTCFullYear(),month:y.getUTCMonth(),start:m,end:b,minDate:s,maxDate:n,firstDay:c,weekdayLabels:E,onSelect:D,onMonthChange:_}),(0,l.jsx)(Lr,{year:x.getUTCFullYear(),month:x.getUTCMonth(),start:m,end:b,minDate:s,maxDate:n,firstDay:c,weekdayLabels:E,onSelect:D,onMonthChange:C})]})]})]})]})}function jr(t){return t.is_country?t.name:t.google_search_location?`${t.name} (${t.google_search_location})`:t.name}function Nr({bootstrap:t,start:e,end:i,minDate:s,maxDate:n,projectDays:o,onRangeChange:r}){const h=Array.isArray(t?.tags_list)?t.tags_list:[],c=Array.isArray(t?.locations)?t.locations:[];return(0,l.jsxs)("div",{className:"slr-panel slr-rt-filters",children:[(0,l.jsxs)("div",{className:"slr-rt-filters__row",children:[(0,l.jsxs)("div",{className:"slr-rt-filters__left slr-rt-filters__hidden",children:[(0,l.jsxs)("div",{className:"slr-rt-device",role:"group","aria-label":(0,a.__)("Device","seo-local-rank"),children:[(0,l.jsx)("button",{type:"button",className:"slr-rt-device__btn is-selected","data-value":"0",children:(0,a.__)("All","seo-local-rank")}),(0,l.jsx)("button",{type:"button",className:"slr-rt-device__btn","data-value":"1","aria-label":(0,a.__)("Desktop","seo-local-rank"),children:(0,l.jsx)("span",{className:"dashicons dashicons-desktop","aria-hidden":"true"})}),(0,l.jsx)("button",{type:"button",className:"slr-rt-device__btn","data-value":"2","aria-label":(0,a.__)("Mobile","seo-local-rank"),children:(0,l.jsx)("span",{className:"dashicons dashicons-smartphone","aria-hidden":"true"})})]}),(0,l.jsx)("button",{type:"button",className:"slr-rt-icon-btn","aria-label":(0,a.__)("Favorites","seo-local-rank"),children:(0,l.jsx)("span",{className:"dashicons dashicons-heart","aria-hidden":"true"})}),(0,l.jsxs)("div",{className:"slr-rt-combo",children:[(0,l.jsxs)("select",{className:"slr-rt-filter-select slr-rt-combo__mode","aria-label":(0,a.__)("Tag match","seo-local-rank"),defaultValue:"1",children:[(0,l.jsx)("option",{value:"1",children:(0,a.__)("Include all tags","seo-local-rank")}),(0,l.jsx)("option",{value:"0",children:(0,a.__)("Include one tag","seo-local-rank")}),(0,l.jsx)("option",{value:"2",children:(0,a.__)("Does not have this tag","seo-local-rank")}),(0,l.jsx)("option",{value:"3",children:(0,a.__)("Does not have one of those tags","seo-local-rank")})]}),(0,l.jsx)("select",{className:"slr-rt-filter-select slr-rt-combo__value","aria-label":(0,a.__)("Tags","seo-local-rank"),multiple:!0,children:h.filter(t=>Number(t.num_keywords)>0).map(t=>(0,l.jsx)("option",{value:t.id,"data-color":t.color,children:t.description},t.id))})]}),(0,l.jsxs)("select",{className:"slr-rt-filter-select slr-rt-filter-select--location","aria-label":(0,a.__)("Location","seo-local-rank"),defaultValue:"0",children:[(0,l.jsx)("option",{value:"0",children:(0,a.__)("All locations","seo-local-rank")}),c.map(t=>(0,l.jsx)("option",{value:t.id,"data-region":t.region_code,children:jr(t)},t.id))]}),(0,l.jsxs)("button",{type:"button",className:"slr-rt-more-filters",children:[(0,l.jsx)("span",{className:"dashicons dashicons-admin-generic","aria-hidden":"true"}),(0,l.jsx)("span",{children:(0,a.__)("More filters","seo-local-rank")}),(0,l.jsx)("span",{className:"dashicons dashicons-arrow-down-alt2","aria-hidden":"true"})]})]}),(0,l.jsx)("div",{className:"slr-rt-filters__right",children:(0,l.jsx)(Pr,{start:e,end:i,minDate:s,maxDate:n,projectDays:o,onChange:r})})]}),(0,l.jsxs)("div",{className:"slr-rt-filters__row slr-rt-filters__hidden",children:[(0,l.jsxs)("div",{className:"slr-rt-combo",children:[(0,l.jsxs)("select",{className:"slr-rt-filter-select slr-rt-combo__mode","aria-label":(0,a.__)("URL match","seo-local-rank"),defaultValue:"0",children:[(0,l.jsx)("option",{value:"0",children:(0,a.__)("URL contains","seo-local-rank")}),(0,l.jsx)("option",{value:"2",children:(0,a.__)("URL not contains","seo-local-rank")}),(0,l.jsx)("option",{value:"1",children:(0,a.__)("Exact URL","seo-local-rank")}),(0,l.jsx)("option",{value:"3",children:(0,a.__)("Exact URL different","seo-local-rank")})]}),(0,l.jsx)("input",{type:"text",className:"slr-rt-filter-input slr-rt-combo__value",placeholder:(0,a.__)("Word","seo-local-rank")})]}),(0,l.jsx)("input",{type:"text",className:"slr-rt-filter-input",placeholder:(0,a.__)("Volume","seo-local-rank")}),(0,l.jsx)("input",{type:"text",className:"slr-rt-filter-input",placeholder:(0,a.__)("Position","seo-local-rank")}),(0,l.jsxs)("select",{className:"slr-rt-filter-select","aria-label":(0,a.__)("Rank change","seo-local-rank"),defaultValue:"",children:[(0,l.jsx)("option",{value:"",children:(0,a.__)("All","seo-local-rank")}),(0,l.jsx)("option",{value:"1",children:(0,a.__)("Keywords up","seo-local-rank")}),(0,l.jsx)("option",{value:"-1",children:(0,a.__)("Keywords down","seo-local-rank")}),(0,l.jsx)("option",{value:"0",children:(0,a.__)("No changes","seo-local-rank")})]}),(0,l.jsx)("input",{type:"text",className:"slr-rt-filter-input",placeholder:(0,a.__)("No. of words","seo-local-rank")}),(0,l.jsxs)("select",{className:"slr-rt-filter-select","aria-label":(0,a.__)("Cannibalizations","seo-local-rank"),defaultValue:"0",children:[(0,l.jsx)("option",{value:"0",children:(0,a.__)("Cannibalizations","seo-local-rank")}),(0,l.jsx)("option",{value:"1",children:(0,a.__)("All cannibalizations","seo-local-rank")}),(0,l.jsx)("option",{value:"-1",children:(0,a.__)("No cannibalizations","seo-local-rank")}),(0,l.jsx)("option",{value:"2",children:(0,a.__)("Target URL is not ranking higher","seo-local-rank")}),(0,l.jsx)("option",{value:"3",children:(0,a.__)("Target URL is ranking higher","seo-local-rank")}),(0,l.jsx)("option",{value:"4",children:(0,a.__)("Target URL is set","seo-local-rank")}),(0,l.jsx)("option",{value:"5",children:(0,a.__)("Target URL is not set","seo-local-rank")})]}),(0,l.jsxs)("select",{className:"slr-rt-filter-select","aria-label":(0,a.__)("AI Overview","seo-local-rank"),defaultValue:"",children:[(0,l.jsx)("option",{value:"",children:(0,a.__)("All keywords","seo-local-rank")}),(0,l.jsx)("option",{value:"0",children:(0,a.__)("No AI Overview keywords","seo-local-rank")}),(0,l.jsx)("option",{value:"1",children:(0,a.__)("AI Overview keywords","seo-local-rank")}),(0,l.jsx)("option",{value:"2",children:(0,a.__)("Mentions keywords","seo-local-rank")}),(0,l.jsx)("option",{value:"3",children:(0,a.__)("Citations keywords","seo-local-rank")})]})]}),(0,l.jsxs)("div",{className:"slr-rt-filters__row slr-rt-filters__row--center slr-rt-filters__hidden",children:[(0,l.jsx)("div",{className:"slr-rt-filtered-count"}),(0,l.jsxs)("button",{type:"button",className:"slr-rt-clear-filters",children:[(0,l.jsx)("span",{className:"dashicons dashicons-dismiss","aria-hidden":"true"}),(0,a.__)("Clear filters","seo-local-rank")]}),(0,l.jsxs)("button",{type:"button",className:"slr-rt-save-view",children:[(0,l.jsx)("span",{className:"dashicons dashicons-category","aria-hidden":"true"}),(0,a.__)("Save as view","seo-local-rank")]}),(0,l.jsxs)("button",{type:"button",className:"slr-rt-delete-view",children:[(0,l.jsx)("span",{className:"dashicons dashicons-trash","aria-hidden":"true"}),(0,a.__)("Delete view","seo-local-rank")]})]})]})}function Ar(t){const e=new Set,i=[];return String(t||"").split("\n").forEach(t=>{let s=t.trim();if(s.endsWith(".")&&(s=s.slice(0,-1).trim()),!s)return;const n=s.toLowerCase();e.has(n)||(e.add(n),i.push(s))}),i}function zr(t,e,i){const s=Number(t)||0,n=Number(e)||0,o=0===i?2:1;return s<=0?0:n>0?s*n*o:s*o}function Or(t,e=!1){return t&&"object"==typeof t?e&&1===Number(t.is_country)&&t.english_name?String(t.english_name):String(t.name||t.description||t.english_name||""):""}function Fr(t){const e=String(t||"").toUpperCase();return/^[A-Z]{2}$/.test(e)?String.fromCodePoint(...[...e].map(t=>127397+t.charCodeAt(0))):""}function Hr(){return String(document.documentElement.lang||"").toLowerCase().startsWith("en")}function Ir(t){return Number(t?.id||t?.province_id||0)}function Br({number:t,children:e}){return(0,l.jsxs)("div",{className:"slr-addkw-section__title",children:[(0,l.jsx)("span",{className:"slr-addkw-section__number",children:t}),(0,l.jsx)("span",{className:"slr-addkw-section__heading",children:e})]})}function Vr({bootstrap:t,projectDomainId:i,onClose:r,onAdded:h}){const c=function(t){const e=Number(t?.available_keywords);if(Number.isFinite(e)&&e>=0)return e;const i=Number(t?.max_tracking_keywords),s=Number(t?.num_tracking_keywords??t?.num_keywords);return Number.isFinite(i)&&Number.isFinite(s)?Math.max(0,i-s):null}(t),d=function(t){return t?.domain?.name||t?.selected_domain?.name||""}(t),[u,p]=(0,e.useState)(""),[m,g]=(0,e.useState)(1),[b,f]=(0,e.useState)(()=>function(t){const e=t?.main_country;if(!e||"object"!=typeof e)return[];const i=Number(e.province_id);return!Number.isFinite(i)||i<=0?[]:[{id:i,name:(Hr()?e.english_name||e.name:e.name||e.english_name)||"",region_code:e.region_code||"",google_search_location:e.google_search_location||""}]}(t)),[v,w]=(0,e.useState)(""),[y,_]=(0,e.useState)([]),[x,C]=(0,e.useState)(!1),[k,E]=(0,e.useState)(!1),[R,M]=(0,e.useState)(!1),[T,S]=(0,e.useState)(!1),[D,L]=(0,e.useState)(""),[P,j]=(0,e.useState)(!1),N=(0,e.useRef)(0),A=(0,e.useRef)(null),z=(0,e.useRef)(!0),O=(0,e.useMemo)(()=>Ar(u),[u]),F=zr(O.length,b.length,m),H=null===c?null:c-F,I=null!==c&&F>c,B=I||R,V=O.length>0&&b.length>0&&!I&&!T&&Number(i)>0,W=Array.from({length:Math.max(9,u.split("\n").length)},(t,e)=>e+1),G=(0,e.useMemo)(()=>new Set(b.map(t=>Ir(t))),[b]),U=(0,e.useMemo)(()=>y.filter(t=>{const e=Ir(t);return e>0&&!G.has(e)}),[y,G]);(0,e.useEffect)(()=>{const t=v.trim();if(t.length<3)return N.current+=1,_([]),void C(!1);C(!0);const e=++N.current,i=setTimeout(async()=>{try{const i=new URLSearchParams({description:t}),n=await s()({path:o(`/locations/search?${i.toString()}`)});if(e!==N.current)return;_(Array.isArray(n?.data)?n.data:[])}catch(t){if(e!==N.current)return;_([])}finally{e===N.current&&C(!1)}},250);return()=>{clearTimeout(i)}},[v]),(0,e.useEffect)(()=>{const t=t=>{A.current&&!A.current.contains(t.target)&&E(!1)};return document.addEventListener("mousedown",t),()=>{document.removeEventListener("mousedown",t)}},[]),(0,e.useEffect)(()=>{B&&z.current&&(z.current=!1,j(!0)),B||(z.current=!0)},[B]);const $=()=>{p(t=>Ar(t).join("\n"))};return(0,l.jsxs)(n.Modal,{title:(0,a.__)("Add keywords","seo-local-rank"),onRequestClose:T?()=>{}:r,className:"slr-addkw-modal",children:[P?(0,l.jsxs)(n.__experimentalConfirmDialog,{isOpen:!0,onConfirm:()=>{sr(),j(!1)},onCancel:()=>j(!1),confirmButtonText:(0,a.__)("Go to plans","seo-local-rank"),cancelButtonText:(0,a.__)("Cancel","seo-local-rank"),children:[(0,l.jsx)("h2",{className:"slr-addkw-upgrade__title",children:(0,a.__)("Keyword limit reached","seo-local-rank")}),(0,l.jsx)("p",{children:(0,a.__)("You should consider upgrade your plan to add more keywords.","seo-local-rank")})]}):null,(0,l.jsxs)("div",{className:"slr-addkw"+(T?" is-busy":""),children:[T?(0,l.jsx)("div",{className:"slr-addkw__busy","aria-live":"polite",children:(0,l.jsx)(n.Spinner,{})}):null,(0,l.jsxs)("div",{className:"slr-addkw__header",children:[(0,l.jsx)("h2",{className:"slr-addkw__title",children:(0,a.__)("Add keywords","seo-local-rank")}),null!==H?(0,l.jsxs)("div",{className:"slr-addkw__remaining"+(B?" is-danger":""),children:[(0,l.jsx)("span",{className:"slr-addkw__remaining-count",children:Uo(H)})," ",(0,a.__)("keywords left","seo-local-rank")]}):null]}),(0,l.jsxs)("div",{className:"slr-addkw__body",children:[(0,l.jsx)("div",{className:"slr-addkw__col slr-addkw__col--left",children:(0,l.jsxs)("section",{className:"slr-addkw-section",children:[(0,l.jsx)(Br,{number:"1",children:d?(0,a.sprintf)(/* translators: %s: project hostname */ /* translators: %s: project hostname */
    9 (0,a.__)("Add keywords to %s","seo-local-rank"),d):(0,a.__)("Add keywords","seo-local-rank")}),(0,l.jsx)("p",{className:"slr-addkw-section__desc",children:(0,a.__)("One keyword per line","seo-local-rank")}),B?(0,l.jsx)("p",{className:"slr-addkw-error",role:"alert",children:(0,a.__)("Number of keywords is above the available keywords.","seo-local-rank")}):null,D&&!B?(0,l.jsx)("p",{className:"slr-addkw-error",role:"alert",children:D}):null,(0,l.jsxs)("div",{className:"slr-addkw-lined",children:[(0,l.jsx)("div",{className:"slr-addkw-lined__nums","aria-hidden":"true",children:W.map(t=>(0,l.jsx)("span",{children:t},t))}),(0,l.jsx)("textarea",{className:"slr-addkw-lined__input",rows:9,value:u,onChange:t=>{M(!1),p(t.target.value)},onBlur:$,onPaste:()=>{window.setTimeout($,200)}})]})]})}),(0,l.jsxs)("div",{className:"slr-addkw__col slr-addkw__col--right",children:[(0,l.jsxs)("section",{className:"slr-addkw-section",children:[(0,l.jsx)(Br,{number:"2",children:(0,a.__)("Where do you want to track your keywords?","seo-local-rank")}),(0,l.jsx)("p",{className:"slr-addkw-section__desc",children:(0,a.__)("Countries, provinces, cities…","seo-local-rank")}),(0,l.jsxs)("div",{className:"slr-addkw-suggest",ref:A,children:[(0,l.jsx)("input",{type:"text",className:"slr-addkw-input",value:v,placeholder:(0,a.__)("Write a country, province or city","seo-local-rank"),onChange:t=>{w(t.target.value),E(!0)},onFocus:()=>E(!0),autoComplete:"off"}),k&&v.trim().length>=3?(0,l.jsx)("div",{className:"slr-addkw-suggest__list",role:"listbox",children:x?(0,l.jsx)("div",{className:"slr-addkw-suggest__status",children:(0,l.jsx)(n.Spinner,{})}):0===U.length?(0,l.jsx)("div",{className:"slr-addkw-suggest__status",children:(0,a.__)("No locations found.","seo-local-rank")}):U.map(t=>{const e=Ir(t),i=Or(t,Hr()),s=Fr(t.region_code);return(0,l.jsxs)("button",{type:"button",className:"slr-addkw-suggest__item",onClick:()=>(t=>{const e=Ir(t);if(e<=0||G.has(e))return;const i=zr(O.length,b.length+1,m);null!==c&&i>c?M(!0):(M(!1),f(i=>[...i,{id:e,name:Or(t,Hr()),region_code:t.region_code||"",google_search_location:t.google_search_location||""}]),w(""),_([]),E(!1),$())})(t),children:[(0,l.jsxs)("span",{className:"slr-addkw-suggest__item-main",children:[s?(0,l.jsx)("span",{className:"slr-rt-flag","aria-hidden":"true",children:s}):null,i]}),t.google_search_location?(0,l.jsx)("span",{className:"slr-addkw-suggest__item-meta",children:t.google_search_location}):null]},e)})}):null]}),b.length>0?(0,l.jsx)("div",{className:"slr-addkw-chips",children:b.map(t=>{const e=Fr(t.region_code);return(0,l.jsxs)("span",{className:"slr-addkw-chip",children:[e?(0,l.jsx)("span",{className:"slr-rt-flag","aria-hidden":"true",children:e}):null,t.name,(0,l.jsx)("button",{type:"button",className:"slr-addkw-chip__remove","aria-label":(0,a.__)("Remove location","seo-local-rank"),onClick:()=>{return e=t.id,M(!1),f(t=>t.filter(t=>Ir(t)!==e)),void $();var e},children:"×"})]},t.id)})}):null]}),(0,l.jsxs)("section",{className:"slr-addkw-section slr-addkw-section--spaced",children:[(0,l.jsx)(Br,{number:"3",children:(0,a.__)("On what type of device do you want to track the results?","seo-local-rank")}),(0,l.jsx)("p",{className:"slr-addkw-section__desc",children:(0,a.__)("When selecting two devices, the number of used keywords doubles","seo-local-rank")}),(0,l.jsxs)("div",{className:"slr-addkw-device",role:"group","aria-label":(0,a.__)("Device","seo-local-rank"),children:[(0,l.jsxs)("button",{type:"button",className:"slr-addkw-device__btn"+(1===m?" is-selected":""),onClick:()=>g(1),children:[(0,l.jsx)("span",{className:"dashicons dashicons-desktop","aria-hidden":"true"}),(0,a.__)("Desktop","seo-local-rank")]}),(0,l.jsxs)("button",{type:"button",className:"slr-addkw-device__btn"+(2===m?" is-selected":""),onClick:()=>g(2),children:[(0,l.jsx)("span",{className:"dashicons dashicons-smartphone","aria-hidden":"true"}),(0,a.__)("Mobile","seo-local-rank")]}),(0,l.jsx)("button",{type:"button",className:"slr-addkw-device__btn"+(0===m?" is-selected":""),onClick:()=>g(0),children:(0,a.__)("Both","seo-local-rank")})]})]})]})]}),(0,l.jsxs)("div",{className:"slr-addkw__footer",children:[(0,l.jsx)(n.Button,{variant:"primary",className:"slr-addkw__submit",disabled:!V,onClick:async()=>{if(!V)return;const t=Ar(u),e=b.map(t=>Ir(t)).filter(t=>t>0);if(0!==t.length&&0!==e.length){S(!0),L("");try{await s()({path:o("/keywords/add-multi"),method:"POST",data:{project_domain_id:Number(i),keywords:t,cities:e,screen_type:m}}),"function"==typeof h?h():r()}catch(t){!function(t){const e=t?.data&&"object"==typeof t.data?t.data:t||{},i=e.data&&"object"==typeof e.data?e.data:{},s=i.error_code??e.error_code??t?.code,n=String(i.error||e.error||e.message||t?.message||"");return 1===Number(s)||"ER_MAX_TRACKING_KEYWORDS"===s||n.includes("ER_MAX_TRACKING_KEYWORDS")}(t)?L(t?.message||(0,a.__)("Could not add keywords. Try again later.","seo-local-rank")):j(!0)}finally{S(!1)}}},children:(0,a.__)("Add keywords to your project","seo-local-rank")}),(0,l.jsxs)("div",{className:"slr-addkw__note",children:[(0,l.jsx)("span",{className:"dashicons dashicons-info-outline","aria-hidden":"true"}),(0,l.jsx)("span",{children:(0,a.__)("You can add multiple words and multiple locations, creating combinations between all of them.","seo-local-rank")})]})]})]})]})}const Wr="#EF7A35";function Gr(t){const e=parseInt(t?.depth,10),i=10*(Number.isFinite(e)&&e>0?e:10)+1,s=parseInt(t?.rank,10),n=Number.isFinite(s)&&s>0;return{y:n?s:i,label:n?String(s):`+${i}`,url:t?.url?String(t.url):"",date:String(t?.formatted_date2||t?.formatted_date||"")}}function Ur(t){const e=t.length>7?Math.round(t.length/7):1;return{responsive:!0,maintainAspectRatio:!1,animation:!1,interaction:{mode:"nearest",intersect:!1},layout:{padding:{top:4,right:8,bottom:0,left:0}},plugins:{legend:{display:!1},tooltip:{callbacks:{title:t=>t[0]?.label||"",label(t){const e=t.dataset.meta?.[t.dataIndex],i=e?.label||t.formattedValue,s=[`${t.dataset.label}: ${i}`];return e?.url&&s.push(e.url),s}}}},elements:{line:{tension:0}},scales:{x:{grid:{display:!1},border:{display:!1},ticks:{color:"#666",font:{size:11},maxRotation:0,callback:(i,s)=>0===s||s===t.length-1||t.length<=7||s%e===0?t[s]:""}},y:{reverse:!0,min:1,grace:0,ticks:{stepSize:2,color:"#aaa",font:{size:11}},grid:{display:!1},border:{display:!1}}}}}function $r(t,e){const i=t?.data&&"object"==typeof t.data?t.data:{};return new URLSearchParams({keyword_province_id:String(i.keyword_province_id||0),domain_id:String(i.domain_id||e.domainId||0),tracking_keyword_id:String(i.id||0),project_domain_id:String(e.projectDomainId||0),screen_type:String(2===parseInt(i.screen_type,10)?2:1),start:e.start||"",end:e.end||"",competitors:"false"}).toString()}function Yr(t){if(!t)return"";try{const e=new URL(t),i=e.pathname.replace(/\/+$/,"")||"/";return`${e.protocol}//${e.hostname}${i}`}catch(e){return String(t).replace(/\/+$/,"")}}function Kr(t){return String(t?.name||t?.competitor_domain||t?.domain||"").toLowerCase()}function Xr({history:t,projectName:i}){const s=(0,e.useMemo)(()=>function(t,e){const i=function(t){return(e=t,Array.isArray(e)?e:[]).slice().reverse();var e}(t).map(Gr),s=i.map(t=>t.date),n=[];return function(t){return t.some(t=>t.y<101)}(i)&&n.push({label:e||"",data:i.map(t=>t.y),meta:i,borderColor:Wr,backgroundColor:Wr,borderWidth:3,tension:0,pointRadius:3,pointHoverRadius:5,spanGaps:!0}),{labels:s,datasets:n}}(t?.data,i),[t,i]);return s.datasets.length?(0,l.jsx)(Ao,{data:{labels:s.labels,datasets:s.datasets},options:Ur(s.labels)}):(0,l.jsx)("p",{className:"slr-kw-stats__empty",children:(0,a.__)("No ranking history for this range.","seo-local-rank")})}function qr({trend:t}){const i=(0,e.useMemo)(()=>function(t){if(!t||"object"!=typeof t)return{labels:[],values:[]};const e=Object.entries(t).reverse();return{labels:e.map(([t])=>t),values:e.map(([,t])=>{const e=parseInt(t,10);return Number.isFinite(e)&&e>0?e:0})}}(t),[t]);return i.labels.length?(0,l.jsx)(zo,{data:{labels:i.labels,datasets:[{data:i.values,backgroundColor:"#4a89dc",borderWidth:0,barPercentage:.9,categoryPercentage:1}]},options:{responsive:!0,maintainAspectRatio:!1,animation:!1,plugins:{legend:{display:!1},tooltip:{callbacks:{title:t=>t[0]?.label||"",label:t=>String(t.parsed.y??"")}}},layout:{padding:0},scales:{x:{grid:{display:!1},border:{display:!1},ticks:{color:"#666",font:{size:10},maxRotation:0,autoSkip:!0,maxTicksLimit:6}},y:{display:!1,min:0}}}}):null}function Jr({rows:t,targetUrl:e,competitors:i,serpUrl:s}){const n=Array.isArray(t)?t:[],o=Yr(e),h=(Array.isArray(i)?i:[]).map(Kr).filter(Boolean);return(0,l.jsxs)("section",{className:"slr-kw-stats-top10",children:[(0,l.jsxs)("h3",{className:"slr-kw-stats-top10__title",children:[(0,l.jsx)("span",{children:(0,a.__)("Google's top 10 for your keyword indexed URL","seo-local-rank")}),s?(0,l.jsxs)("a",{className:"slr-kw-stats-top10__serp",href:r(s),target:"_blank",rel:"noopener noreferrer",children:[(0,a.__)("(Show SERP)","seo-local-rank"),(0,l.jsx)("span",{className:"dashicons dashicons-external","aria-hidden":"true"})]}):null]}),(0,l.jsx)("div",{className:"slr-kw-stats-top10__panel",children:(0,l.jsxs)("table",{className:"slr-kw-stats-top10__table",children:[(0,l.jsx)("thead",{children:(0,l.jsxs)("tr",{children:[(0,l.jsx)("th",{className:"slr-kw-stats-top10__pos",children:(0,a.__)("Position","seo-local-rank")}),(0,l.jsx)("th",{children:(0,a.__)("URL","seo-local-rank")})]})}),(0,l.jsx)("tbody",{children:0===n.length?(0,l.jsx)("tr",{children:(0,l.jsx)("td",{colSpan:2,children:(0,a.__)("No SERP data.","seo-local-rank")})}):n.map((t,e)=>{const i=t.url||"",s=t.url_encoded||i,n=Boolean(t.my_domain),r=function(t){try{return new URL(t).hostname.toLowerCase()}catch(t){return""}}(i),c=!n&&h.some(t=>r.includes(t)),d=Yr(i),u=Boolean(o)&&d===o,p=n&&(!0===t.cannibalization||Array.isArray(t.cannibalization)&&t.cannibalization.length>0||Boolean(o)&&!u);return(0,l.jsxs)("tr",{className:n||c?"slr-kw-stats-top10__row slr-kw-stats-top10__row--strong":"slr-kw-stats-top10__row",children:[(0,l.jsx)("td",{className:"slr-kw-stats-top10__pos",children:t.position}),(0,l.jsxs)("td",{children:[i?(0,l.jsx)("a",{href:i,target:"_blank",rel:"noopener noreferrer",className:n?"slr-kw-stats-top10__link slr-kw-stats-top10__link--mine":"slr-kw-stats-top10__link",children:s}):"—",u?(0,l.jsx)("span",{className:"dashicons dashicons-flag slr-kw-stats-top10__icon slr-kw-stats-top10__icon--target",title:(0,a.__)("Target URL","seo-local-rank")}):null,p&&!u?(0,l.jsx)("span",{className:"dashicons dashicons-warning slr-kw-stats-top10__icon slr-kw-stats-top10__icon--cann",title:(0,a.__)("Cannibalization","seo-local-rank")}):null]})]},`${t.position||e}-${i}`)})})]})})]})}function Zr({stats:t}){if(!1===t)return null;if(!t||"object"!=typeof t)return null;const e=function(t){if(null==t?.competition||""===t?.competition)return null;const e=Number(t.competition);if(Number.isNaN(e))return null;const i=e<=1?100*e:e;return`${Math.round(i)} %`}(t);return(0,l.jsxs)("div",{className:"slr-panel slr-kw-stats-stats",children:[(0,l.jsxs)("div",{className:"slr-kw-stats-stats__metrics",children:[(0,l.jsxs)("div",{className:"slr-kw-stats-stats__metric",children:[(0,l.jsx)("span",{className:"slr-kw-stats-stats__label",children:(0,a.__)("Volume:","seo-local-rank")}),(0,l.jsx)("span",{className:"slr-kw-stats-stats__value",children:Uo(t.volume)})]}),(0,l.jsxs)("div",{className:"slr-kw-stats-stats__metric",children:[(0,l.jsx)("span",{className:"slr-kw-stats-stats__label",children:(0,a.__)("CPC:","seo-local-rank")}),(0,l.jsx)("span",{className:"slr-kw-stats-stats__value",children:t.cpc_formatted||Uo(t.cpc,2)})]}),null!==e?(0,l.jsxs)("div",{className:"slr-kw-stats-stats__metric",children:[(0,l.jsx)("span",{className:"slr-kw-stats-stats__label",children:(0,a.__)("Competition:","seo-local-rank")}),(0,l.jsx)("span",{className:"slr-kw-stats-stats__value",children:e})]}):null]}),(0,l.jsx)("div",{className:"slr-kw-stats-stats__trend-title",children:(0,a.__)("Search trend","seo-local-rank")}),(0,l.jsx)("div",{className:"slr-kw-stats-stats__trend",children:(0,l.jsx)(qr,{trend:t.trend})})]})}function Qr({tags:t}){const e=Array.isArray(t)?t:[];return(0,l.jsxs)("div",{className:"slr-panel slr-kw-stats-tags",children:[(0,l.jsx)("div",{className:"slr-kw-stats-tags__title",children:(0,a.__)("Keyword tags","seo-local-rank")}),0===e.length?(0,l.jsx)("p",{className:"slr-kw-stats__empty",children:(0,a.__)("No tags.","seo-local-rank")}):(0,l.jsx)("div",{className:"slr-rt-tags",children:e.map((t,e)=>(0,l.jsx)("span",{className:"slr-rt-tag",style:{backgroundColor:t.color||"#efefef"},children:t.description||t.tag_description||""},`${t.id||t.description||e}`))})]})}function ta({row:t,projectDomainId:i,domainId:r,projectName:h,start:c,end:d,onClose:u,onPrev:p,onNext:m}){const g=function(t){return t?.data&&"object"==typeof t.data?t.data:{}}(t),b=g.keyword||"",[f,v]=(0,e.useState)(null),[w,y]=(0,e.useState)(!0),[_,x]=(0,e.useState)("");(0,e.useEffect)(()=>{if(!t)return;const e="undefined"!=typeof AbortController?new AbortController:null;let n=!1;return(async()=>{y(!0),x(""),v(null);try{const a=await s()({path:o(`/keywords/history?${$r(t,{projectDomainId:i,domainId:r,start:c,end:d})}`),signal:e?.signal});if(n)return;v(a)}catch(t){if(n||"AbortError"===t?.name)return;v(null),x(t?.message||(0,a.__)("Could not load keyword history. Try again later.","seo-local-rank"))}finally{n||y(!1)}})(),()=>{n=!0,e?.abort()}},[t,i,r,c,d]);const C=Fr(g.region_code),k=g.province||g.google_search_location||g.region_code||"",E=2===parseInt(g.screen_type,10),R=function(t){if(null==t?.rank||""===t?.rank)return(0,a.__)("Pending","seo-local-rank");const e=parseInt(t.rank,10);if(e>0)return String(e);const i=parseInt(t.depth,10);return 10*(Number.isFinite(i)&&i>0?i:10)+"+"}(g),M=parseInt(g.rank,10),T=g.target_url||"";return(0,l.jsx)(n.Modal,{title:(0,a.sprintf)(/* translators: %s: keyword */ /* translators: %s: keyword */
    10 (0,a.__)("Keyword: %s","seo-local-rank"),b),onRequestClose:u,className:"slr-kw-stats-modal",children:(0,l.jsxs)("div",{className:"slr-kw-stats",children:[(0,l.jsxs)("h2",{className:"slr-kw-stats__heading",children:[(0,l.jsx)("span",{className:"slr-kw-stats__heading-label",children:(0,a.__)("Keyword:","seo-local-rank")}),(0,l.jsx)("span",{className:"slr-kw-stats__heading-value",children:b})]}),(0,l.jsxs)("div",{className:"slr-kw-stats__top",children:[(0,l.jsxs)("div",{className:"slr-kw-stats__attrs",children:[C||k?(0,l.jsxs)("span",{className:"slr-kw-stats__attr",children:[C?(0,l.jsx)("span",{className:"slr-rt-flag","aria-hidden":"true",children:C}):null,k]}):null,(0,l.jsxs)("span",{className:"slr-kw-stats__attr",children:[(0,l.jsx)("span",{className:"dashicons "+(E?"dashicons-smartphone slr-rt-device--mobile":"dashicons-desktop slr-rt-device--desktop"),"aria-hidden":"true"}),E?(0,a.__)("Mobile","seo-local-rank"):(0,a.__)("Desktop","seo-local-rank")]}),(0,l.jsxs)("span",{className:"slr-kw-stats__attr slr-kw-stats__attr--rank",children:[(0,a.__)("Position","seo-local-rank"),(0,l.jsx)("strong",{children:R}),1===M?(0,l.jsx)("span",{"aria-hidden":"true",children:"👑"}):null]})]}),T?(0,l.jsxs)("div",{className:"slr-kw-stats__target",children:[(0,l.jsx)("span",{className:"dashicons dashicons-flag","aria-hidden":"true"}),(0,l.jsx)("span",{className:"slr-kw-stats__target-label",children:(0,a.__)("Target URL","seo-local-rank")}),(0,l.jsx)("span",{className:"slr-kw-stats__target-url",children:T})]}):null]}),_?(0,l.jsx)(n.Notice,{status:"error",isDismissible:!1,children:_}):null,(0,l.jsxs)("div",{className:"slr-kw-stats__body"+(w?" is-loading":""),children:[(0,l.jsxs)("div",{className:"slr-kw-stats__left",children:[(0,l.jsx)("div",{className:"slr-panel slr-kw-stats-chart",children:(0,l.jsx)("div",{className:"slr-kw-stats-chart__canvas",children:!w&&f?(0,l.jsx)(Xr,{history:f,projectName:h}):null})}),!w&&f?(0,l.jsx)(Jr,{rows:f.top_10,targetUrl:T,competitors:f.competitors,serpUrl:f.serp_url}):null]}),(0,l.jsx)("div",{className:"slr-kw-stats__right",children:!w&&f?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(Zr,{stats:f.search_stats}),(0,l.jsx)(Qr,{tags:f.keyword_tags})]}):null})]}),w?(0,l.jsxs)("div",{className:"slr-kw-stats__loader",children:[(0,l.jsx)(n.Spinner,{}),(0,l.jsx)("p",{children:(0,a.__)("Loading keyword stats…","seo-local-rank")})]}):null,(0,l.jsxs)("div",{className:"slr-kw-stats__footer",children:[(0,l.jsx)(n.Button,{variant:"link",className:"slr-kw-stats__nav",icon:"arrow-left-alt2",onClick:p,children:(0,a.__)("Previous keyword","seo-local-rank")}),(0,l.jsx)(n.Button,{variant:"link",className:"slr-kw-stats__nav",icon:"arrow-right-alt2",iconPosition:"right",onClick:m,children:(0,a.__)("Next keyword","seo-local-rank")})]})]})})}class ea{constructor(t){this.table=t}reloadData(t,e,i){return this.table.dataLoader.load(t,void 0,void 0,void 0,e,i)}langText(){return this.table.modules.localize.getText(...arguments)}langBind(){return this.table.modules.localize.bind(...arguments)}langLocale(){return this.table.modules.localize.getLocale(...arguments)}commsConnections(){return this.table.modules.comms.getConnections(...arguments)}commsSend(){return this.table.modules.comms.send(...arguments)}layoutMode(){return this.table.modules.layout.getMode()}layoutRefresh(t){return this.table.modules.layout.layout(t)}subscribe(){return this.table.eventBus.subscribe(...arguments)}unsubscribe(){return this.table.eventBus.unsubscribe(...arguments)}subscribed(t){return this.table.eventBus.subscribed(t)}subscriptionChange(){return this.table.eventBus.subscriptionChange(...arguments)}dispatch(){return this.table.eventBus.dispatch(...arguments)}chain(){return this.table.eventBus.chain(...arguments)}confirm(){return this.table.eventBus.confirm(...arguments)}dispatchExternal(){return this.table.externalEvents.dispatch(...arguments)}subscribedExternal(t){return this.table.externalEvents.subscribed(t)}subscriptionChangeExternal(){return this.table.externalEvents.subscriptionChange(...arguments)}options(t){return this.table.options[t]}setOption(t,e){return void 0!==e&&(this.table.options[t]=e),this.table.options[t]}deprecationCheck(t,e,i){return this.table.deprecationAdvisor.check(t,e,i)}deprecationCheckMsg(t,e){return this.table.deprecationAdvisor.checkMsg(t,e)}deprecationMsg(t){return this.table.deprecationAdvisor.msg(t)}module(t){return this.table.module(t)}}class ia{static elVisible(t){return!(t.offsetWidth<=0&&t.offsetHeight<=0)}static elOffset(t){var e=t.getBoundingClientRect();return{top:e.top+window.pageYOffset-document.documentElement.clientTop,left:e.left+window.pageXOffset-document.documentElement.clientLeft}}static retrieveNestedData(t,e,i){var s,n=t?e.split(t):[e],o=n.length;for(let t=0;t<o&&(s=i=i[n[t]],i);t++);return s}static deepClone(t,e,i=[]){var s={}.__proto__,n=[].__proto__;for(var o in e||(e=Object.assign(Array.isArray(t)?[]:{},t)),t){let r,a,l=t[o];null==l||"object"!=typeof l||l.__proto__!==s&&l.__proto__!==n||(r=i.findIndex(t=>t.subject===l),r>-1?e[o]=i[r].copy:(a=Object.assign(Array.isArray(l)?[]:{},l),i.unshift({subject:l,copy:a}),e[o]=this.deepClone(l,a,i)))}return e}}let sa=class t extends ea{constructor(t,e,i){super(t),this.element=e,this.container=this._lookupContainer(),this.parent=i,this.reversedX=!1,this.childPopup=null,this.blurable=!1,this.blurCallback=null,this.blurEventsBound=!1,this.renderedCallback=null,this.visible=!1,this.hideable=!0,this.element.classList.add("tabulator-popup-container"),this.blurEvent=this.hide.bind(this,!1),this.escEvent=this._escapeCheck.bind(this),this.destroyBinding=this.tableDestroyed.bind(this),this.destroyed=!1}tableDestroyed(){this.destroyed=!0,this.hide(!0)}_lookupContainer(){var t=this.table.options.popupContainer;return"string"==typeof t?(t=document.querySelector(t))||console.warn("Menu Error - no container element found matching selector:",this.table.options.popupContainer,"(defaulting to document body)"):!0===t&&(t=this.table.element),t&&!this._checkContainerIsParent(t)&&(t=!1,console.warn("Menu Error - container element does not contain this table:",this.table.options.popupContainer,"(defaulting to document body)")),t||(t=document.body),t}_checkContainerIsParent(t,e=this.table.element){return t===e||!!e.parentNode&&this._checkContainerIsParent(t,e.parentNode)}renderCallback(t){this.renderedCallback=t}containerEventCoords(t){var e=!(t instanceof MouseEvent),i=e?t.touches[0].pageX:t.pageX,s=e?t.touches[0].pageY:t.pageY;if(this.container!==document.body){let t=ia.elOffset(this.container);i-=t.left,s-=t.top}return{x:i,y:s}}elementPositionCoords(t,e="right"){var i,s,n,o=ia.elOffset(t);switch(this.container!==document.body&&(i=ia.elOffset(this.container),o.left-=i.left,o.top-=i.top),e){case"right":s=o.left+t.offsetWidth,n=o.top-1;break;case"bottom":s=o.left,n=o.top+t.offsetHeight;break;case"left":s=o.left,n=o.top-1;break;case"top":s=o.left,n=o.top;break;case"center":s=o.left+t.offsetWidth/2,n=o.top+t.offsetHeight/2}return{x:s,y:n,offset:o}}show(t,e){var i,s,n,o,r;return this.destroyed||this.table.destroyed||(t instanceof HTMLElement?(n=t,o=(r=this.elementPositionCoords(t,e)).offset,i=r.x,s=r.y):"number"==typeof t?(o={top:0,left:0},i=t,s=e):(i=(r=this.containerEventCoords(t)).x,s=r.y,this.reversedX=!1),this.element.style.top=s+"px",this.element.style.left=i+"px",this.container.appendChild(this.element),"function"==typeof this.renderedCallback&&this.renderedCallback(),this._fitToScreen(i,s,n,o,e),this.visible=!0,this.subscribe("table-destroy",this.destroyBinding),this.element.addEventListener("mousedown",t=>{t.stopPropagation()})),this}_fitToScreen(t,e,i,s,n){var o=this.container===document.body?document.documentElement.scrollTop:this.container.scrollTop;(t+this.element.offsetWidth>=this.container.offsetWidth||this.reversedX)&&(this.element.style.left="",this.element.style.right=i?this.container.offsetWidth-s.left+"px":this.container.offsetWidth-t+"px",this.reversedX=!0);let r=Math.max(this.container.offsetHeight,o?this.container.scrollHeight:0);if(e+this.element.offsetHeight>r)if(i)this.element.style.top="bottom"===n?parseInt(this.element.style.top)-this.element.offsetHeight-i.offsetHeight-1+"px":parseInt(this.element.style.top)-this.element.offsetHeight+i.offsetHeight+1+"px";else{let t=this.element.offsetHeight;if(t>r)this.element.style.top="0px",this.element.style.height=r+"px";else{let i=e-t;i<0&&(i=r-t),this.element.style.top=i+"px"}}}isVisible(){return this.visible}hideOnBlur(t){return this.blurable=!0,this.visible&&(setTimeout(()=>{this.visible&&(this.table.rowManager.element.addEventListener("scroll",this.blurEvent),this.subscribe("cell-editing",this.blurEvent),document.body.addEventListener("click",this.blurEvent),document.body.addEventListener("contextmenu",this.blurEvent),document.body.addEventListener("mousedown",this.blurEvent),window.addEventListener("resize",this.blurEvent),document.body.addEventListener("keydown",this.escEvent),this.blurEventsBound=!0)},100),this.blurCallback=t),this}_escapeCheck(t){27==t.key&&this.hide()}blockHide(){this.hideable=!1}restoreHide(){this.hideable=!0}hide(t=!1){return this.visible&&this.hideable&&(this.blurable&&this.blurEventsBound&&(document.body.removeEventListener("keydown",this.escEvent),document.body.removeEventListener("click",this.blurEvent),document.body.removeEventListener("contextmenu",this.blurEvent),document.body.removeEventListener("mousedown",this.blurEvent),window.removeEventListener("resize",this.blurEvent),this.table.rowManager.element.removeEventListener("scroll",this.blurEvent),this.unsubscribe("cell-editing",this.blurEvent),this.blurEventsBound=!1),this.childPopup&&this.childPopup.hide(),this.parent&&(this.parent.childPopup=null),this.element.parentNode&&this.element.parentNode.removeChild(this.element),this.visible=!1,this.blurCallback&&!t&&this.blurCallback(),this.unsubscribe("table-destroy",this.destroyBinding)),this}child(e){return this.childPopup&&this.childPopup.hide(),this.childPopup=new t(this.table,e,this),this.childPopup}};class na extends ea{constructor(t,e){super(t),this._handler=null}initialize(){}registerTableOption(t,e){this.table.optionsList.register(t,e)}registerColumnOption(t,e){this.table.columnManager.optionsList.register(t,e)}registerTableFunction(t,e){void 0===this.table[t]?this.table[t]=(...i)=>(this.table.initGuard(t),e(...i)):console.warn("Unable to bind table function, name already in use",t)}registerComponentFunction(t,e,i){return this.table.componentFunctionBinder.bind(t,e,i)}registerDataHandler(t,e){this.table.rowManager.registerDataPipelineHandler(t,e),this._handler=t}registerDisplayHandler(t,e){this.table.rowManager.registerDisplayPipelineHandler(t,e),this._handler=t}displayRows(t){var e,i=this.table.rowManager.displayRows.length-1;if(this._handler&&(e=this.table.rowManager.displayPipeline.findIndex(t=>t.handler===this._handler))>-1&&(i=e),t&&(i+=t),this._handler)return i>-1?this.table.rowManager.getDisplayRows(i):this.activeRows()}activeRows(){return this.table.rowManager.activeRows}refreshData(t,e){e||(e=this._handler),e&&this.table.rowManager.refreshActiveData(e,!1,t)}footerAppend(t){return this.table.footerManager.append(t)}footerPrepend(t){return this.table.footerManager.prepend(t)}footerRemove(t){return this.table.footerManager.remove(t)}popup(t,e){return new sa(this.table,t,e)}alert(t,e){return this.table.alertManager.alert(t,e)}clearAlert(){return this.table.alertManager.clear()}}var oa={rownum:function(t,e,i,s,n,o){return o.getPosition()}};class ra extends na{static moduleName="accessor";static accessors=oa;constructor(t){super(t),this.allowedTypes=["","data","download","clipboard","print","htmlOutput"],this.registerColumnOption("accessor"),this.registerColumnOption("accessorParams"),this.registerColumnOption("accessorData"),this.registerColumnOption("accessorDataParams"),this.registerColumnOption("accessorDownload"),this.registerColumnOption("accessorDownloadParams"),this.registerColumnOption("accessorClipboard"),this.registerColumnOption("accessorClipboardParams"),this.registerColumnOption("accessorPrint"),this.registerColumnOption("accessorPrintParams"),this.registerColumnOption("accessorHtmlOutput"),this.registerColumnOption("accessorHtmlOutputParams")}initialize(){this.subscribe("column-layout",this.initializeColumn.bind(this)),this.subscribe("row-data-retrieve",this.transformRow.bind(this))}initializeColumn(t){var e=!1,i={};this.allowedTypes.forEach(s=>{var n,o="accessor"+(s.charAt(0).toUpperCase()+s.slice(1));t.definition[o]&&(n=this.lookupAccessor(t.definition[o]))&&(e=!0,i[o]={accessor:n,params:t.definition[o+"Params"]||{}})}),e&&(t.modules.accessor=i)}lookupAccessor(t){var e=!1;switch(typeof t){case"string":ra.accessors[t]?e=ra.accessors[t]:console.warn("Accessor Error - No such accessor found, ignoring: ",t);break;case"function":e=t}return e}transformRow(t,e){var i="accessor"+(e.charAt(0).toUpperCase()+e.slice(1)),s=t.getComponent(),n=ia.deepClone(t.data||{});return this.table.columnManager.traverse(function(t){var o,r,a,l;t.modules.accessor&&(r=t.modules.accessor[i]||t.modules.accessor.accessor||!1)&&"undefined"!=(o=t.getFieldValue(n))&&(l=t.getComponent(),a="function"==typeof r.params?r.params(o,n,e,l,s):r.params,t.setFieldValue(n,r.accessor(o,n,e,a,l,s)))}),n}}var aa={method:"GET"};function la(t,e){var i=[];if(e=e||"",Array.isArray(t))t.forEach((t,s)=>{i=i.concat(la(t,e?e+"["+s+"]":s))});else if("object"==typeof t)for(var s in t)i=i.concat(la(t[s],e?e+"["+s+"]":s));else i.push({key:e,value:t});return i}function ha(t){var e=la(t),i=[];return e.forEach(function(t){i.push(encodeURIComponent(t.key)+"="+encodeURIComponent(t.value))}),i.join("&")}function ca(t,e,i){return t&&i&&Object.keys(i).length&&(e.method&&"get"!=e.method.toLowerCase()||(e.method="get",t+=(t.includes("?")?"&":"?")+ha(i))),t}function da(t,e,i){var s;return new Promise((n,o)=>{if(t=this.urlGenerator.call(this.table,t,e,i),"GET"!=e.method.toUpperCase())if(s="object"==typeof this.table.options.ajaxContentType?this.table.options.ajaxContentType:this.contentTypeFormatters[this.table.options.ajaxContentType]){for(var r in s.headers)e.headers||(e.headers={}),void 0===e.headers[r]&&(e.headers[r]=s.headers[r]);e.body=s.body.call(this,t,e,i)}else console.warn("Ajax Error - Invalid ajaxContentType value:",this.table.options.ajaxContentType);t?(void 0===e.headers&&(e.headers={}),void 0===e.headers.Accept&&(e.headers.Accept="application/json"),void 0===e.headers["X-Requested-With"]&&(e.headers["X-Requested-With"]="XMLHttpRequest"),void 0===e.mode&&(e.mode="cors"),"cors"==e.mode?(void 0===e.headers.Origin&&(e.headers.Origin=window.location.origin),void 0===e.credentials&&(e.credentials="same-origin")):void 0===e.credentials&&(e.credentials="include"),fetch(t,e).then(t=>{t.ok?t.json().then(t=>{n(t)}).catch(t=>{o(t),console.warn("Ajax Load Error - Invalid JSON returned",t)}):(console.error("Ajax Load Error - Connection Error: "+t.status,t.statusText),o(t))}).catch(t=>{console.error("Ajax Load Error - Connection Error: ",t),o(t)})):(console.warn("Ajax Load Error - No URL Set"),n([]))})}function ua(t,e){var i=[];if(e=e||"",Array.isArray(t))t.forEach((t,s)=>{i=i.concat(ua(t,e?e+"["+s+"]":s))});else if("object"==typeof t)for(var s in t)i=i.concat(ua(t[s],e?e+"["+s+"]":s));else i.push({key:e,value:t});return i}var pa={json:{headers:{"Content-Type":"application/json"},body:function(t,e,i){return JSON.stringify(i)}},form:{headers:{},body:function(t,e,i){var s=ua(i),n=new FormData;return s.forEach(function(t){n.append(t.key,t.value)}),n}}};class ma extends na{static moduleName="ajax";static defaultConfig=aa;static defaultURLGenerator=ca;static defaultLoaderPromise=da;static contentTypeFormatters=pa;constructor(t){super(t),this.config={},this.url="",this.urlGenerator=!1,this.params=!1,this.loaderPromise=!1,this.registerTableOption("ajaxURL",!1),this.registerTableOption("ajaxURLGenerator",!1),this.registerTableOption("ajaxParams",{}),this.registerTableOption("ajaxConfig","get"),this.registerTableOption("ajaxContentType","form"),this.registerTableOption("ajaxRequestFunc",!1),this.registerTableOption("ajaxRequesting",function(){}),this.registerTableOption("ajaxResponse",!1),this.contentTypeFormatters=ma.contentTypeFormatters}initialize(){this.loaderPromise=this.table.options.ajaxRequestFunc||ma.defaultLoaderPromise,this.urlGenerator=this.table.options.ajaxURLGenerator||ma.defaultURLGenerator,this.table.options.ajaxURL&&this.setUrl(this.table.options.ajaxURL),this.setDefaultConfig(this.table.options.ajaxConfig),this.registerTableFunction("getAjaxUrl",this.getUrl.bind(this)),this.subscribe("data-loading",this.requestDataCheck.bind(this)),this.subscribe("data-params",this.requestParams.bind(this)),this.subscribe("data-load",this.requestData.bind(this))}requestParams(t,e,i,s){var n=this.table.options.ajaxParams;return n&&("function"==typeof n&&(n=n.call(this.table)),s=Object.assign(Object.assign({},n),s)),s}requestDataCheck(t,e,i,s){return!((t||!this.url)&&"string"!=typeof t)}requestData(t,e,i,s,n){var o;return!n&&this.requestDataCheck(t)?(t&&this.setUrl(t),o=this.generateConfig(i),this.sendRequest(this.url,e,o)):n}setDefaultConfig(t={}){this.config=Object.assign({},ma.defaultConfig),"string"==typeof t?this.config.method=t:Object.assign(this.config,t)}generateConfig(t={}){var e=Object.assign({},this.config);return"string"==typeof t?e.method=t:Object.assign(e,t),e}setUrl(t){this.url=t}getUrl(){return this.url}sendRequest(t,e,i){return!1!==this.table.options.ajaxRequesting.call(this.table,t,e)?this.loaderPromise(t,i,e).then(i=>(this.table.options.ajaxResponse&&(i=this.table.options.ajaxResponse.call(this.table,t,e,i)),i)):Promise.reject()}}var ga={replace:function(t){return this.table.setData(t)},update:function(t){return this.table.updateOrAddData(t)},insert:function(t){return this.table.addData(t)}},ba={table:function(t){var e=[],i=!0,s=this.table.columnManager.columns,n=[],o=[];return(t=t.split("\n")).forEach(function(t){e.push(t.split("\t"))}),!(!e.length||1===e.length&&e[0].length<2)&&(e[0].forEach(function(t){var e=s.find(function(e){return t&&e.definition.title&&t.trim()&&e.definition.title.trim()===t.trim()});e?n.push(e):i=!1}),i||(i=!0,n=[],e[0].forEach(function(t){var e=s.find(function(e){return t&&e.field&&t.trim()&&e.field.trim()===t.trim()});e?n.push(e):i=!1}),i||(n=this.table.columnManager.columnsByIndex)),i&&e.shift(),e.forEach(function(t){var e={};t.forEach(function(t,i){n[i]&&(e[n[i].field]=t)}),o.push(e)}),o)}},fa={keybindings:{bindings:{copyToClipboard:["ctrl + 67","meta + 67"]},actions:{copyToClipboard:function(t){this.table.modules.edit.currentCell||this.table.modExists("clipboard",!0)&&this.table.modules.clipboard.copy(!1,!0)}}}};class va extends na{static moduleName="clipboard";static moduleExtensions=fa;static pasteActions=ga;static pasteParsers=ba;constructor(t){super(t),this.mode=!0,this.pasteParser=function(){},this.pasteAction=function(){},this.customSelection=!1,this.rowRange=!1,this.blocked=!0,this.registerTableOption("clipboard",!1),this.registerTableOption("clipboardCopyStyled",!0),this.registerTableOption("clipboardCopyConfig",!1),this.registerTableOption("clipboardCopyFormatter",!1),this.registerTableOption("clipboardCopyRowRange","active"),this.registerTableOption("clipboardPasteParser","table"),this.registerTableOption("clipboardPasteAction","insert"),this.registerColumnOption("clipboard"),this.registerColumnOption("titleClipboard")}initialize(){this.mode=this.table.options.clipboard,this.rowRange=this.table.options.clipboardCopyRowRange,!0!==this.mode&&"copy"!==this.mode||this.table.element.addEventListener("copy",t=>{var e,i,s;this.blocked||(t.preventDefault(),this.customSelection?(e=this.customSelection,this.table.options.clipboardCopyFormatter&&(e=this.table.options.clipboardCopyFormatter("plain",e))):(s=this.table.modules.export.generateExportList(this.table.options.clipboardCopyConfig,this.table.options.clipboardCopyStyled,this.rowRange,"clipboard"),e=(i=this.table.modules.export.generateHTMLTable(s))?this.generatePlainContent(s):"",this.table.options.clipboardCopyFormatter&&(e=this.table.options.clipboardCopyFormatter("plain",e),i=this.table.options.clipboardCopyFormatter("html",i))),window.clipboardData&&window.clipboardData.setData?window.clipboardData.setData("Text",e):t.clipboardData&&t.clipboardData.setData?(t.clipboardData.setData("text/plain",e),i&&t.clipboardData.setData("text/html",i)):t.originalEvent&&t.originalEvent.clipboardData.setData&&(t.originalEvent.clipboardData.setData("text/plain",e),i&&t.originalEvent.clipboardData.setData("text/html",i)),this.dispatchExternal("clipboardCopied",e,i),this.reset())}),!0!==this.mode&&"paste"!==this.mode||this.table.element.addEventListener("paste",t=>{this.paste(t)}),this.setPasteParser(this.table.options.clipboardPasteParser),this.setPasteAction(this.table.options.clipboardPasteAction),this.registerTableFunction("copyToClipboard",this.copy.bind(this))}reset(){this.blocked=!0,this.customSelection=!1}generatePlainContent(t){var e=[];return t.forEach(t=>{var i=[];t.columns.forEach(e=>{var s="";if(e)if("group"===t.type&&(e.value=e.component.getKey()),null===e.value)s="";else switch(typeof e.value){case"object":s=JSON.stringify(e.value);break;case"undefined":s="";break;default:s=e.value}i.push(s)}),e.push(i.join("\t"))}),e.join("\n")}copy(t,e){var i,s;this.blocked=!1,this.customSelection=!1,!0!==this.mode&&"copy"!==this.mode||(this.rowRange=t||this.table.options.clipboardCopyRowRange,void 0!==window.getSelection&&void 0!==document.createRange?((t=document.createRange()).selectNodeContents(this.table.element),(i=window.getSelection()).toString()&&e&&(this.customSelection=i.toString()),i.removeAllRanges(),i.addRange(t)):void 0!==document.selection&&void 0!==document.body.createTextRange&&((s=document.body.createTextRange()).moveToElementText(this.table.element),s.select()),document.execCommand("copy"),i&&i.removeAllRanges())}setPasteAction(t){switch(typeof t){case"string":this.pasteAction=va.pasteActions[t],this.pasteAction||console.warn("Clipboard Error - No such paste action found:",t);break;case"function":this.pasteAction=t}}setPasteParser(t){switch(typeof t){case"string":this.pasteParser=va.pasteParsers[t],this.pasteParser||console.warn("Clipboard Error - No such paste parser found:",t);break;case"function":this.pasteParser=t}}paste(t){var e,i,s;this.checkPasteOrigin(t)&&(e=this.getPasteData(t),(i=this.pasteParser.call(this,e))?(t.preventDefault(),this.table.modExists("mutator")&&(i=this.mutateData(i)),s=this.pasteAction.call(this,i),this.dispatchExternal("clipboardPasted",e,i,s)):this.dispatchExternal("clipboardPasteError",e))}mutateData(t){var e=[];return Array.isArray(t)?t.forEach(t=>{e.push(this.table.modules.mutator.transformRow(t,"clipboard"))}):e=t,e}checkPasteOrigin(t){var e=!0;return!this.confirm("clipboard-paste",[t])&&["DIV","SPAN"].includes(t.target.tagName)||(e=!1),e}getPasteData(t){var e;return window.clipboardData&&window.clipboardData.getData?e=window.clipboardData.getData("Text"):t.clipboardData&&t.clipboardData.getData?e=t.clipboardData.getData("text/plain"):t.originalEvent&&t.originalEvent.clipboardData.getData&&(e=t.originalEvent.clipboardData.getData("text/plain")),e}}class wa{constructor(t){return this._row=t,new Proxy(this,{get:function(t,e,i){return void 0!==t[e]?t[e]:t._row.table.componentFunctionBinder.handle("row",t._row,e)}})}getData(t){return this._row.getData(t)}getElement(){return this._row.getElement()}getTable(){return this._row.table}getCells(){var t=[];return this._row.getCells().forEach(function(e){t.push(e.getComponent())}),t}getCell(t){var e=this._row.getCell(t);return!!e&&e.getComponent()}_getSelf(){return this._row}}class ya{constructor(t){return this._cell=t,new Proxy(this,{get:function(t,e,i){return void 0!==t[e]?t[e]:t._cell.table.componentFunctionBinder.handle("cell",t._cell,e)}})}getValue(){return this._cell.getValue()}getOldValue(){return this._cell.getOldValue()}getInitialValue(){return this._cell.initialValue}getElement(){return this._cell.getElement()}getRow(){return this._cell.row.getComponent()}getData(t){return this._cell.row.getData(t)}getType(){return"cell"}getField(){return this._cell.column.getField()}getColumn(){return this._cell.column.getComponent()}setValue(t,e){void 0===e&&(e=!0),this._cell.setValue(t,e)}restoreOldValue(){this._cell.setValueActual(this._cell.getOldValue())}restoreInitialValue(){this._cell.setValueActual(this._cell.initialValue)}checkHeight(){this._cell.checkHeight()}getTable(){return this._cell.table}_getSelf(){return this._cell}}class _a extends ea{constructor(t,e){super(t.table),this.table=t.table,this.column=t,this.row=e,this.element=null,this.value=null,this.initialValue,this.oldValue=null,this.modules={},this.height=null,this.width=null,this.minWidth=null,this.component=null,this.loaded=!1,this.build()}build(){this.generateElement(),this.setWidth(),this._configureCell(),this.setValueActual(this.column.getFieldValue(this.row.data)),this.initialValue=this.value}generateElement(){this.element=document.createElement("div"),this.element.className="tabulator-cell",this.element.setAttribute("role","gridcell"),this.column.isRowHeader&&this.element.classList.add("tabulator-row-header")}_configureCell(){var t=this.element,e=this.column.getField();t.style.textAlign=this.column.hozAlign,this.column.vertAlign&&(t.style.display="inline-flex",t.style.alignItems={top:"flex-start",bottom:"flex-end",middle:"center"}[this.column.vertAlign]||"",this.column.hozAlign&&(t.style.justifyContent={left:"flex-start",right:"flex-end",center:"center"}[this.column.hozAlign]||"")),e&&t.setAttribute("tabulator-field",e),this.column.definition.cssClass&&this.column.definition.cssClass.split(" ").forEach(e=>{t.classList.add(e)}),this.dispatch("cell-init",this),this.column.visible||this.hide()}_generateContents(){var t;switch(typeof(t=this.chain("cell-format",this,null,()=>this.element.innerHTML=this.value))){case"object":if(t instanceof Node){for(;this.element.firstChild;)this.element.removeChild(this.element.firstChild);this.element.appendChild(t)}else this.element.innerHTML="",null!=t&&console.warn("Format Error - Formatter has returned a type of object, the only valid formatter object return is an instance of Node, the formatter returned:",t);break;case"undefined":this.element.innerHTML="";break;default:this.element.innerHTML=t}}cellRendered(){this.dispatch("cell-rendered",this)}getElement(t){return this.loaded||(this.loaded=!0,t||this.layoutElement()),this.element}getValue(){return this.value}getOldValue(){return this.oldValue}setValue(t,e,i){this.setValueProcessData(t,e,i)&&(this.dispatch("cell-value-updated",this),this.cellRendered(),this.column.definition.cellEdited&&this.column.definition.cellEdited.call(this.table,this.getComponent()),this.dispatchExternal("cellEdited",this.getComponent()),this.subscribedExternal("dataChanged")&&this.dispatchExternal("dataChanged",this.table.rowManager.getData()))}setValueProcessData(t,e,i){var s=!1;return(this.value!==t||i)&&(s=!0,e&&(t=this.chain("cell-value-changing",[this,t],null,t))),this.setValueActual(t),s&&this.dispatch("cell-value-changed",this),s}setValueActual(t){this.oldValue=this.value,this.value=t,this.dispatch("cell-value-save-before",this),this.column.setFieldValue(this.row.data,t),this.dispatch("cell-value-save-after",this),this.loaded&&this.layoutElement()}layoutElement(){this._generateContents(),this.dispatch("cell-layout",this)}setWidth(){this.width=this.column.width,this.element.style.width=this.column.widthStyled}clearWidth(){this.width="",this.element.style.width=""}getWidth(){return this.width||this.element.offsetWidth}setMinWidth(){this.minWidth=this.column.minWidth,this.element.style.minWidth=this.column.minWidthStyled}setMaxWidth(){this.maxWidth=this.column.maxWidth,this.element.style.maxWidth=this.column.maxWidthStyled}checkHeight(){this.row.reinitializeHeight()}clearHeight(){this.element.style.height="",this.height=null,this.dispatch("cell-height",this,"")}setHeight(){this.height=this.row.height,this.element.style.height=this.row.heightStyled,this.dispatch("cell-height",this,this.row.heightStyled)}getHeight(){return this.height||this.element.offsetHeight}show(){this.element.style.display=this.column.vertAlign?"inline-flex":""}hide(){this.element.style.display="none"}delete(){this.dispatch("cell-delete",this),!this.table.rowManager.redrawBlock&&this.element.parentNode&&this.element.parentNode.removeChild(this.element),this.element=!1,this.column.deleteCell(this),this.row.deleteCell(this),this.calcs={}}getIndex(){return this.row.getCellIndex(this)}getComponent(){return this.component||(this.component=new ya(this)),this.component}}class xa{constructor(t){return this._column=t,this.type="ColumnComponent",new Proxy(this,{get:function(t,e,i){return void 0!==t[e]?t[e]:t._column.table.componentFunctionBinder.handle("column",t._column,e)}})}getElement(){return this._column.getElement()}getDefinition(){return this._column.getDefinition()}getField(){return this._column.getField()}getTitleDownload(){return this._column.getTitleDownload()}getCells(){var t=[];return this._column.cells.forEach(function(e){t.push(e.getComponent())}),t}isVisible(){return this._column.visible}show(){this._column.isGroup?this._column.columns.forEach(function(t){t.show()}):this._column.show()}hide(){this._column.isGroup?this._column.columns.forEach(function(t){t.hide()}):this._column.hide()}toggle(){this._column.visible?this.hide():this.show()}delete(){return this._column.delete()}getSubColumns(){var t=[];return this._column.columns.length&&this._column.columns.forEach(function(e){t.push(e.getComponent())}),t}getParentColumn(){return this._column.getParentComponent()}_getSelf(){return this._column}scrollTo(t,e){return this._column.table.columnManager.scrollToColumn(this._column,t,e)}getTable(){return this._column.table}move(t,e){var i=this._column.table.columnManager.findColumn(t);i?this._column.table.columnManager.moveColumn(this._column,i,e):console.warn("Move Error - No matching column found:",i)}getNextColumn(){var t=this._column.nextColumn();return!!t&&t.getComponent()}getPrevColumn(){var t=this._column.prevColumn();return!!t&&t.getComponent()}updateDefinition(t){return this._column.updateDefinition(t)}getWidth(){return this._column.getWidth()}setWidth(t){var e;return e=!0===t?this._column.reinitializeWidth(!0):this._column.setWidth(t),this._column.table.columnManager.rerenderColumns(!0),e}}var Ca={title:void 0,field:void 0,columns:void 0,visible:void 0,hozAlign:void 0,vertAlign:void 0,width:void 0,minWidth:40,maxWidth:void 0,maxInitialWidth:void 0,cssClass:void 0,variableHeight:void 0,headerVertical:void 0,headerHozAlign:void 0,headerWordWrap:!1,editableTitle:void 0};class ka extends ea{static defaultOptionList=Ca;constructor(t,e,i){super(e.table),this.definition=t,this.parent=e,this.type="column",this.columns=[],this.cells=[],this.isGroup=!1,this.isRowHeader=i,this.element=this.createElement(),this.contentElement=!1,this.titleHolderElement=!1,this.titleElement=!1,this.groupElement=this.createGroupElement(),this.hozAlign="",this.vertAlign="",this.field="",this.fieldStructure="",this.getFieldValue="",this.setFieldValue="",this.titleDownload=null,this.titleFormatterRendered=!1,this.mapDefinitions(),this.setField(this.definition.field),this.modules={},this.width=null,this.widthStyled="",this.maxWidth=null,this.maxWidthStyled="",this.maxInitialWidth=null,this.minWidth=null,this.minWidthStyled="",this.widthFixed=!1,this.visible=!0,this.component=null,this.definition.columns?(this.isGroup=!0,this.definition.columns.forEach((t,e)=>{var i=new ka(t,this);this.attachColumn(i)}),this.checkColumnVisibility()):e.registerColumnField(this),this._initialize()}createElement(){var t=document.createElement("div");switch(t.classList.add("tabulator-col"),t.setAttribute("role","columnheader"),t.setAttribute("aria-sort","none"),this.isRowHeader&&t.classList.add("tabulator-row-header"),this.table.options.columnHeaderVertAlign){case"middle":t.style.justifyContent="center";break;case"bottom":t.style.justifyContent="flex-end"}return t}createGroupElement(){var t=document.createElement("div");return t.classList.add("tabulator-col-group-cols"),t}mapDefinitions(){var t=this.table.options.columnDefaults;if(t)for(let e in t)void 0===this.definition[e]&&(this.definition[e]=t[e]);this.definition=this.table.columnManager.optionsList.generate(ka.defaultOptionList,this.definition)}checkDefinition(){Object.keys(this.definition).forEach(t=>{-1===ka.defaultOptionList.indexOf(t)&&console.warn("Invalid column definition option in '"+(this.field||this.definition.title)+"' column:",t)})}setField(t){this.field=t,this.fieldStructure=t?this.table.options.nestedFieldSeparator?t.split(this.table.options.nestedFieldSeparator):[t]:[],this.getFieldValue=this.fieldStructure.length>1?this._getNestedData:this._getFlatData,this.setFieldValue=this.fieldStructure.length>1?this._setNestedData:this._setFlatData}registerColumnPosition(t){this.parent.registerColumnPosition(t)}registerColumnField(t){this.parent.registerColumnField(t)}reRegisterPosition(){this.isGroup?this.columns.forEach(function(t){t.reRegisterPosition()}):this.registerColumnPosition(this)}_initialize(){for(var t=this.definition;this.element.firstChild;)this.element.removeChild(this.element.firstChild);t.headerVertical&&(this.element.classList.add("tabulator-col-vertical"),"flip"===t.headerVertical&&this.element.classList.add("tabulator-col-vertical-flip")),this.contentElement=this._buildColumnHeaderContent(),this.element.appendChild(this.contentElement),this.isGroup?this._buildGroupHeader():this._buildColumnHeader(),this.dispatch("column-init",this)}_buildColumnHeader(){var t=this.definition;this.dispatch("column-layout",this),void 0!==t.visible&&(t.visible?this.show(!0):this.hide(!0)),t.cssClass&&t.cssClass.split(" ").forEach(t=>{this.element.classList.add(t)}),t.field&&this.element.setAttribute("tabulator-field",t.field),this.setMinWidth(parseInt(t.minWidth)),t.maxInitialWidth&&(this.maxInitialWidth=parseInt(t.maxInitialWidth)),t.maxWidth&&this.setMaxWidth(parseInt(t.maxWidth)),this.reinitializeWidth(),this.hozAlign=this.definition.hozAlign,this.vertAlign=this.definition.vertAlign,this.titleElement.style.textAlign=this.definition.headerHozAlign}_buildColumnHeaderContent(){var t=document.createElement("div");return t.classList.add("tabulator-col-content"),this.titleHolderElement=document.createElement("div"),this.titleHolderElement.classList.add("tabulator-col-title-holder"),t.appendChild(this.titleHolderElement),this.titleElement=this._buildColumnHeaderTitle(),this.titleHolderElement.appendChild(this.titleElement),t}_buildColumnHeaderTitle(){var t=this.definition,e=document.createElement("div");if(e.classList.add("tabulator-col-title"),t.headerWordWrap&&e.classList.add("tabulator-col-title-wrap"),t.editableTitle){var i=document.createElement("input");i.classList.add("tabulator-title-editor"),i.addEventListener("click",t=>{t.stopPropagation(),i.focus()}),i.addEventListener("mousedown",t=>{t.stopPropagation()}),i.addEventListener("change",()=>{t.title=i.value,this.dispatchExternal("columnTitleChanged",this.getComponent())}),e.appendChild(i),t.field?this.langBind("columns|"+t.field,e=>{i.value=e||t.title||"&nbsp;"}):i.value=t.title||"&nbsp;"}else t.field?this.langBind("columns|"+t.field,i=>{this._formatColumnHeaderTitle(e,i||t.title||"&nbsp;")}):this._formatColumnHeaderTitle(e,t.title||"&nbsp;");return e}_formatColumnHeaderTitle(t,e){var i=this.chain("column-format",[this,e,t],null,()=>e);switch(typeof i){case"object":i instanceof Node?t.appendChild(i):(t.innerHTML="",console.warn("Format Error - Title formatter has returned a type of object, the only valid formatter object return is an instance of Node, the formatter returned:",i));break;case"undefined":t.innerHTML="";break;default:t.innerHTML=i}}_buildGroupHeader(){this.element.classList.add("tabulator-col-group"),this.element.setAttribute("role","columngroup"),this.element.setAttribute("aria-title",this.definition.title),this.definition.cssClass&&this.definition.cssClass.split(" ").forEach(t=>{this.element.classList.add(t)}),this.titleElement.style.textAlign=this.definition.headerHozAlign,this.element.appendChild(this.groupElement)}_getFlatData(t){return t[this.field]}_getNestedData(t){var e,i=t,s=this.fieldStructure,n=s.length;for(let t=0;t<n&&(e=i=i[s[t]],i);t++);return e}_setFlatData(t,e){this.field&&(t[this.field]=e)}_setNestedData(t,e){var i=t,s=this.fieldStructure,n=s.length;for(let t=0;t<n;t++)if(t==n-1)i[s[t]]=e;else{if(!i[s[t]]){if(void 0===e)break;i[s[t]]={}}i=i[s[t]]}}attachColumn(t){this.groupElement?(this.columns.push(t),this.groupElement.appendChild(t.getElement()),t.columnRendered()):console.warn("Column Warning - Column being attached to another column instead of column group")}verticalAlign(t,e){var i=this.parent.isGroup?this.parent.getGroupElement().clientHeight:e||this.parent.getHeadersElement().clientHeight;this.element.style.height=i+"px",this.dispatch("column-height",this,this.element.style.height),this.isGroup&&(this.groupElement.style.minHeight=i-this.contentElement.offsetHeight+"px"),this.columns.forEach(function(e){e.verticalAlign(t)})}clearVerticalAlign(){this.element.style.paddingTop="",this.element.style.height="",this.element.style.minHeight="",this.groupElement.style.minHeight="",this.columns.forEach(function(t){t.clearVerticalAlign()}),this.dispatch("column-height",this,"")}getElement(){return this.element}getGroupElement(){return this.groupElement}getField(){return this.field}getTitleDownload(){return this.titleDownload}getFirstColumn(){return this.isGroup?!!this.columns.length&&this.columns[0].getFirstColumn():this}getLastColumn(){return this.isGroup?!!this.columns.length&&this.columns[this.columns.length-1].getLastColumn():this}getColumns(t){var e=[];return t?this.columns.forEach(t=>{e.push(t),e=e.concat(t.getColumns(!0))}):e=this.columns,e}getCells(){return this.cells}getTopColumn(){return this.parent.isGroup?this.parent.getTopColumn():this}getDefinition(t){var e=[];return this.isGroup&&t&&(this.columns.forEach(function(t){e.push(t.getDefinition(!0))}),this.definition.columns=e),this.definition}checkColumnVisibility(){var t=!1;this.columns.forEach(function(e){e.visible&&(t=!0)}),t?(this.show(),this.dispatchExternal("columnVisibilityChanged",this.getComponent(),!1)):this.hide()}show(t,e){this.visible||(this.visible=!0,this.element.style.display="",this.parent.isGroup&&this.parent.checkColumnVisibility(),this.cells.forEach(function(t){t.show()}),this.isGroup||null!==this.width||this.reinitializeWidth(),this.table.columnManager.verticalAlignHeaders(),this.dispatch("column-show",this,e),t||this.dispatchExternal("columnVisibilityChanged",this.getComponent(),!0),this.parent.isGroup&&this.parent.matchChildWidths(),this.silent||this.table.columnManager.rerenderColumns())}hide(t,e){this.visible&&(this.visible=!1,this.element.style.display="none",this.table.columnManager.verticalAlignHeaders(),this.parent.isGroup&&this.parent.checkColumnVisibility(),this.cells.forEach(function(t){t.hide()}),this.dispatch("column-hide",this,e),t||this.dispatchExternal("columnVisibilityChanged",this.getComponent(),!1),this.parent.isGroup&&this.parent.matchChildWidths(),this.silent||this.table.columnManager.rerenderColumns())}matchChildWidths(){var t=0;this.contentElement&&this.columns.length&&(this.columns.forEach(function(e){e.visible&&(t+=e.getWidth())}),this.contentElement.style.maxWidth=t-1+"px",this.table.initialized&&(this.element.style.width=t+"px"),this.parent.isGroup&&this.parent.matchChildWidths())}removeChild(t){var e=this.columns.indexOf(t);e>-1&&this.columns.splice(e,1),this.columns.length||this.delete()}setWidth(t){this.widthFixed=!0,this.setWidthActual(t)}setWidthActual(t){isNaN(t)&&(t=Math.floor(this.table.element.clientWidth/100*parseInt(t))),t=Math.max(this.minWidth,t),this.maxWidth&&(t=Math.min(this.maxWidth,t)),this.width=t,this.widthStyled=t?t+"px":"",this.element.style.width=this.widthStyled,this.isGroup||this.cells.forEach(function(t){t.setWidth()}),this.parent.isGroup&&this.parent.matchChildWidths(),this.dispatch("column-width",this),this.subscribedExternal("columnWidth")&&this.dispatchExternal("columnWidth",this.getComponent())}checkCellHeights(){var t=[];this.cells.forEach(function(e){e.row.heightInitialized&&(null!==e.row.getElement().offsetParent?(t.push(e.row),e.row.clearCellHeight()):e.row.heightInitialized=!1)}),t.forEach(function(t){t.calcHeight()}),t.forEach(function(t){t.setCellHeight()})}getWidth(){var t=0;return this.isGroup?this.columns.forEach(function(e){e.visible&&(t+=e.getWidth())}):t=this.width,t}getLeftOffset(){var t=this.element.offsetLeft;return this.parent.isGroup&&(t+=this.parent.getLeftOffset()),t}getHeight(){return Math.ceil(this.element.getBoundingClientRect().height)}setMinWidth(t){this.maxWidth&&t>this.maxWidth&&(t=this.maxWidth,console.warn("the minWidth ("+t+"px) for column '"+this.field+"' cannot be bigger that its maxWidth ("+this.maxWidthStyled+")")),this.minWidth=t,this.minWidthStyled=t?t+"px":"",this.element.style.minWidth=this.minWidthStyled,this.cells.forEach(function(t){t.setMinWidth()})}setMaxWidth(t){this.minWidth&&t<this.minWidth&&(t=this.minWidth,console.warn("the maxWidth ("+t+"px) for column '"+this.field+"' cannot be smaller that its minWidth ("+this.minWidthStyled+")")),this.maxWidth=t,this.maxWidthStyled=t?t+"px":"",this.element.style.maxWidth=this.maxWidthStyled,this.cells.forEach(function(t){t.setMaxWidth()})}delete(){return new Promise((t,e)=>{this.isGroup&&this.columns.forEach(function(t){t.delete()}),this.dispatch("column-delete",this);var i=this.cells.length;for(let t=0;t<i;t++)this.cells[0].delete();this.element.parentNode&&this.element.parentNode.removeChild(this.element),this.element=!1,this.contentElement=!1,this.titleElement=!1,this.groupElement=!1,this.parent.isGroup&&this.parent.removeChild(this),this.table.columnManager.deregisterColumn(this),this.table.columnManager.rerenderColumns(!0),this.dispatch("column-deleted",this),t()})}columnRendered(){this.titleFormatterRendered&&this.titleFormatterRendered(),this.dispatch("column-rendered",this)}generateCell(t){var e=new _a(this,t);return this.cells.push(e),e}nextColumn(){var t=this.table.columnManager.findColumnIndex(this);return t>-1&&this._nextVisibleColumn(t+1)}_nextVisibleColumn(t){var e=this.table.columnManager.getColumnByIndex(t);return!e||e.visible?e:this._nextVisibleColumn(t+1)}prevColumn(){var t=this.table.columnManager.findColumnIndex(this);return t>-1&&this._prevVisibleColumn(t-1)}_prevVisibleColumn(t){var e=this.table.columnManager.getColumnByIndex(t);return!e||e.visible?e:this._prevVisibleColumn(t-1)}reinitializeWidth(t){this.widthFixed=!1,void 0===this.definition.width||t||this.setWidth(this.definition.width),this.dispatch("column-width-fit-before",this),this.fitToData(t),this.dispatch("column-width-fit-after",this)}fitToData(t){if(!this.isGroup){this.widthFixed||(this.element.style.width="",this.cells.forEach(t=>{t.clearWidth()}));var e=this.element.offsetWidth;if((!this.width||!this.widthFixed)&&(this.cells.forEach(t=>{var i=t.getWidth();i>e&&(e=i)}),e)){var i=e+1;t?this.setWidth(i):(this.maxInitialWidth&&!t&&(i=Math.min(i,this.maxInitialWidth)),this.setWidthActual(i))}}}updateDefinition(t){var e;return this.isGroup||this.parent.isGroup?(console.error("Column Update Error - The updateDefinition function is only available on ungrouped columns"),Promise.reject("Column Update Error - The updateDefinition function is only available on columns, not column groups")):(e=Object.assign({},this.getDefinition()),e=Object.assign(e,t),this.table.columnManager.addColumn(e,!1,this).then(t=>(e.field==this.field&&(this.field=!1),this.delete().then(()=>t.getComponent()))))}deleteCell(t){var e=this.cells.indexOf(t);e>-1&&this.cells.splice(e,1)}getComponent(){return this.component||(this.component=new xa(this)),this.component}getPosition(){return this.table.columnManager.getVisibleColumnsByIndex().indexOf(this)+1}getParentComponent(){return this.parent instanceof ka&&this.parent.getComponent()}}class Ea{constructor(t){return this._row=t,new Proxy(this,{get:function(t,e,i){return void 0!==t[e]?t[e]:t._row.table.componentFunctionBinder.handle("row",t._row,e)}})}getData(t){return this._row.getData(t)}getElement(){return this._row.getElement()}getCells(){var t=[];return this._row.getCells().forEach(function(e){t.push(e.getComponent())}),t}getCell(t){var e=this._row.getCell(t);return!!e&&e.getComponent()}getIndex(){return this._row.getData("data")[this._row.table.options.index]}getPosition(){return this._row.getPosition()}watchPosition(t){return this._row.watchPosition(t)}delete(){return this._row.delete()}scrollTo(t,e){return this._row.table.rowManager.scrollToRow(this._row,t,e)}move(t,e){this._row.moveToRow(t,e)}update(t){return this._row.updateData(t)}normalizeHeight(){this._row.normalizeHeight(!0)}_getSelf(){return this._row}reformat(){return this._row.reinitialize()}getTable(){return this._row.table}getNextRow(){var t=this._row.nextRow();return t?t.getComponent():t}getPrevRow(){var t=this._row.prevRow();return t?t.getComponent():t}}class Ra extends ea{constructor(t,e,i="row"){super(e.table),this.parent=e,this.data={},this.type=i,this.element=!1,this.modules={},this.cells=[],this.height=0,this.heightStyled="",this.manualHeight=!1,this.outerHeight=0,this.initialized=!1,this.heightInitialized=!1,this.position=0,this.positionWatchers=[],this.component=null,this.created=!1,this.setData(t)}create(){this.created||(this.created=!0,this.generateElement())}createElement(){var t=document.createElement("div");t.classList.add("tabulator-row"),t.setAttribute("role","row"),this.element=t}getElement(){return this.create(),this.element}detachElement(){this.element&&this.element.parentNode&&this.element.parentNode.removeChild(this.element)}generateElement(){this.createElement(),this.dispatch("row-init",this)}generateCells(){this.cells=this.table.columnManager.generateCells(this)}initialize(t,e){if(this.create(),!this.initialized||t){for(this.deleteCells();this.element.firstChild;)this.element.removeChild(this.element.firstChild);this.dispatch("row-layout-before",this),this.generateCells(),this.initialized=!0,this.table.columnManager.renderer.renderRowCells(this,e),t&&this.normalizeHeight(),this.dispatch("row-layout",this),this.table.options.rowFormatter&&this.table.options.rowFormatter(this.getComponent()),this.dispatch("row-layout-after",this)}else this.table.columnManager.renderer.rerenderRowCells(this,e)}rendered(){this.cells.forEach(t=>{t.cellRendered()})}reinitializeHeight(){this.heightInitialized=!1,this.element&&null!==this.element.offsetParent&&this.normalizeHeight(!0)}deinitialize(){this.initialized=!1}deinitializeHeight(){this.heightInitialized=!1}reinitialize(t){this.initialized=!1,this.heightInitialized=!1,this.manualHeight||(this.height=0,this.heightStyled=""),this.element&&null!==this.element.offsetParent&&this.initialize(!0),this.dispatch("row-relayout",this)}calcHeight(t){var e=0,i=0;this.table.options.rowHeight?this.height=this.table.options.rowHeight:(i=this.calcMinHeight(),e=this.calcMaxHeight(),this.height=t?Math.max(e,i):this.manualHeight?this.height:Math.max(e,i)),this.heightStyled=this.height?this.height+"px":"",this.outerHeight=this.element.offsetHeight}calcMinHeight(){return this.table.options.resizableRows?this.element.clientHeight:0}calcMaxHeight(){var t=0;return this.cells.forEach(function(e){var i=e.getHeight();i>t&&(t=i)}),t}setCellHeight(){this.cells.forEach(function(t){t.setHeight()}),this.heightInitialized=!0}clearCellHeight(){this.cells.forEach(function(t){t.clearHeight()})}normalizeHeight(t){t&&!this.table.options.rowHeight&&this.clearCellHeight(),this.calcHeight(t),this.setCellHeight()}setHeight(t,e){(this.height!=t||e)&&(this.manualHeight=!0,this.height=t,this.heightStyled=t?t+"px":"",this.setCellHeight(),this.outerHeight=this.element.offsetHeight,this.subscribedExternal("rowHeight")&&this.dispatchExternal("rowHeight",this.getComponent()))}getHeight(){return this.outerHeight}getWidth(){return this.element.offsetWidth}deleteCell(t){var e=this.cells.indexOf(t);e>-1&&this.cells.splice(e,1)}setData(t){this.data=this.chain("row-data-init-before",[this,t],void 0,t),this.dispatch("row-data-init-after",this)}updateData(t){var e,i=this.element&&ia.elVisible(this.element),s={};return new Promise((n,o)=>{"string"==typeof t&&(t=JSON.parse(t)),this.dispatch("row-data-save-before",this),this.subscribed("row-data-changing")&&(s=Object.assign(s,this.data),s=Object.assign(s,t)),e=this.chain("row-data-changing",[this,s,t],null,t);const r=[];for(let i in t)this.table.columnManager.getColumnsByFieldRoot(i).forEach(t=>{let i=this.getCell(t.getField());if(i){let s=t.getFieldValue(e);i.getValue()!==s&&r.push([i,s])}});for(let t in e)this.data[t]=e[t];this.dispatch("row-data-save-after",this),r.forEach(([t,e])=>{t.setValueProcessData(e),i&&t.cellRendered()}),i?(this.normalizeHeight(!0),this.table.options.rowFormatter&&this.table.options.rowFormatter(this.getComponent())):(this.initialized=!1,this.height=0,this.heightStyled=""),this.dispatch("row-data-changed",this,i,t),this.dispatchExternal("rowUpdated",this.getComponent()),this.subscribedExternal("dataChanged")&&this.dispatchExternal("dataChanged",this.table.rowManager.getData()),n()})}getData(t){return t?this.chain("row-data-retrieve",[this,t],null,this.data):this.data}getCell(t){return t=this.table.columnManager.findColumn(t),this.initialized||0!==this.cells.length||this.generateCells(),this.cells.find(function(e){return e.column===t})}getCellIndex(t){return this.cells.findIndex(function(e){return e===t})}findCell(t){return this.cells.find(e=>e.element===t)}getCells(){return this.initialized||0!==this.cells.length||this.generateCells(),this.cells}nextRow(){return this.table.rowManager.nextDisplayRow(this,!0)||!1}prevRow(){return this.table.rowManager.prevDisplayRow(this,!0)||!1}moveToRow(t,e){var i=this.table.rowManager.findRow(t);i?(this.table.rowManager.moveRowActual(this,i,!e),this.table.rowManager.refreshActiveData("display",!1,!0)):console.warn("Move Error - No matching row found:",t)}delete(){return this.dispatch("row-delete",this),this.deleteActual(),Promise.resolve()}deleteActual(t){this.detachModules(),this.table.rowManager.deleteRow(this,t),this.deleteCells(),this.initialized=!1,this.heightInitialized=!1,this.element=!1,this.dispatch("row-deleted",this)}detachModules(){this.dispatch("row-deleting",this)}deleteCells(){var t=this.cells.length;for(let e=0;e<t;e++)this.cells[0].delete()}wipe(){if(this.detachModules(),this.deleteCells(),this.element){for(;this.element.firstChild;)this.element.removeChild(this.element.firstChild);this.element.parentNode&&this.element.parentNode.removeChild(this.element)}this.element=!1,this.modules={}}isDisplayed(){return this.table.rowManager.getDisplayRows().includes(this)}getPosition(){return!!this.isDisplayed()&&this.position}setPosition(t){t!=this.position&&(this.position=t,this.positionWatchers.forEach(t=>{t(this.position)}))}watchPosition(t){this.positionWatchers.push(t),t(this.position)}getGroup(){return this.modules.group||!1}getComponent(){return this.component||(this.component=new Ea(this)),this.component}}var Ma={avg:function(t,e,i){var s=0,n=void 0!==i.precision?i.precision:2;return t.length&&(s=t.reduce(function(t,e){return Number(t)+Number(e)}),s/=t.length,s=!1!==n?s.toFixed(n):s),parseFloat(s).toString()},max:function(t,e,i){var s=null,n=void 0!==i.precision&&i.precision;return t.forEach(function(t){((t=Number(t))>s||null===s)&&(s=t)}),null!==s?!1!==n?s.toFixed(n):s:""},min:function(t,e,i){var s=null,n=void 0!==i.precision&&i.precision;return t.forEach(function(t){((t=Number(t))<s||null===s)&&(s=t)}),null!==s?!1!==n?s.toFixed(n):s:""},sum:function(t,e,i){var s=0,n=void 0!==i.precision&&i.precision;return t.length&&t.forEach(function(t){t=Number(t),s+=isNaN(t)?0:Number(t)}),!1!==n?s.toFixed(n):s},concat:function(t,e,i){var s=0;return t.length&&(s=t.reduce(function(t,e){return String(t)+String(e)})),s},count:function(t,e,i){var s=0;return t.length&&t.forEach(function(t){t&&s++}),s},unique:function(t,e,i){var s=t.filter((e,i)=>(t||0===e)&&t.indexOf(e)===i);return s.length}};class Ta extends na{static moduleName="columnCalcs";static calculations=Ma;constructor(t){super(t),this.topCalcs=[],this.botCalcs=[],this.genColumn=!1,this.topElement=this.createElement(),this.botElement=this.createElement(),this.topRow=!1,this.botRow=!1,this.topInitialized=!1,this.botInitialized=!1,this.blocked=!1,this.recalcAfterBlock=!1,this.registerTableOption("columnCalcs",!0),this.registerColumnOption("topCalc"),this.registerColumnOption("topCalcParams"),this.registerColumnOption("topCalcFormatter"),this.registerColumnOption("topCalcFormatterParams"),this.registerColumnOption("bottomCalc"),this.registerColumnOption("bottomCalcParams"),this.registerColumnOption("bottomCalcFormatter"),this.registerColumnOption("bottomCalcFormatterParams")}createElement(){var t=document.createElement("div");return t.classList.add("tabulator-calcs-holder"),t}initialize(){this.genColumn=new ka({field:"value"},this),this.subscribe("cell-value-changed",this.cellValueChanged.bind(this)),this.subscribe("column-init",this.initializeColumnCheck.bind(this)),this.subscribe("row-deleted",this.rowsUpdated.bind(this)),this.subscribe("scroll-horizontal",this.scrollHorizontal.bind(this)),this.subscribe("row-added",this.rowsUpdated.bind(this)),this.subscribe("column-moved",this.recalcActiveRows.bind(this)),this.subscribe("column-add",this.recalcActiveRows.bind(this)),this.subscribe("data-refreshed",this.recalcActiveRowsRefresh.bind(this)),this.subscribe("table-redraw",this.tableRedraw.bind(this)),this.subscribe("rows-visible",this.visibleRows.bind(this)),this.subscribe("scrollbar-vertical",this.adjustForScrollbar.bind(this)),this.subscribe("redraw-blocked",this.blockRedraw.bind(this)),this.subscribe("redraw-restored",this.restoreRedraw.bind(this)),this.subscribe("table-redrawing",this.resizeHolderWidth.bind(this)),this.subscribe("column-resized",this.resizeHolderWidth.bind(this)),this.subscribe("column-show",this.resizeHolderWidth.bind(this)),this.subscribe("column-hide",this.resizeHolderWidth.bind(this)),this.registerTableFunction("getCalcResults",this.getResults.bind(this)),this.registerTableFunction("recalc",this.userRecalc.bind(this)),this.resizeHolderWidth()}resizeHolderWidth(){this.topElement.style.minWidth=this.table.columnManager.headersElement.offsetWidth+"px"}tableRedraw(t){this.recalc(this.table.rowManager.activeRows),t&&this.redraw()}blockRedraw(){this.blocked=!0,this.recalcAfterBlock=!1}restoreRedraw(){this.blocked=!1,this.recalcAfterBlock&&(this.recalcAfterBlock=!1,this.recalcActiveRowsRefresh())}userRecalc(){this.recalc(this.table.rowManager.activeRows)}blockCheck(){return this.blocked&&(this.recalcAfterBlock=!0),this.blocked}visibleRows(t,e){return this.topRow&&e.unshift(this.topRow),this.botRow&&e.push(this.botRow),e}rowsUpdated(t){this.table.options.groupBy?this.recalcRowGroup(t):this.recalcActiveRows()}recalcActiveRowsRefresh(){this.table.options.groupBy&&this.table.options.dataTreeStartExpanded&&this.table.options.dataTree?this.recalcAll():this.recalcActiveRows()}recalcActiveRows(){this.recalc(this.table.rowManager.activeRows)}cellValueChanged(t){(t.column.definition.topCalc||t.column.definition.bottomCalc)&&(this.table.options.groupBy?("table"!=this.table.options.columnCalcs&&"both"!=this.table.options.columnCalcs||this.recalcActiveRows(),"table"!=this.table.options.columnCalcs&&this.recalcRowGroup(t.row)):this.recalcActiveRows())}initializeColumnCheck(t){(t.definition.topCalc||t.definition.bottomCalc)&&this.initializeColumn(t)}initializeColumn(t){var e=t.definition,i={topCalcParams:e.topCalcParams||{},botCalcParams:e.bottomCalcParams||{}};if(e.topCalc){switch(typeof e.topCalc){case"string":Ta.calculations[e.topCalc]?i.topCalc=Ta.calculations[e.topCalc]:console.warn("Column Calc Error - No such calculation found, ignoring: ",e.topCalc);break;case"function":i.topCalc=e.topCalc}i.topCalc&&(t.modules.columnCalcs=i,this.topCalcs.push(t),"group"!=this.table.options.columnCalcs&&this.initializeTopRow())}if(e.bottomCalc){switch(typeof e.bottomCalc){case"string":Ta.calculations[e.bottomCalc]?i.botCalc=Ta.calculations[e.bottomCalc]:console.warn("Column Calc Error - No such calculation found, ignoring: ",e.bottomCalc);break;case"function":i.botCalc=e.bottomCalc}i.botCalc&&(t.modules.columnCalcs=i,this.botCalcs.push(t),"group"!=this.table.options.columnCalcs&&this.initializeBottomRow())}}registerColumnField(){}removeCalcs(){var t=!1;this.topInitialized&&(this.topInitialized=!1,this.topElement.parentNode.removeChild(this.topElement),t=!0),this.botInitialized&&(this.botInitialized=!1,this.footerRemove(this.botElement),t=!0),t&&this.table.rowManager.adjustTableSize()}reinitializeCalcs(){this.topCalcs.length&&this.initializeTopRow(),this.botCalcs.length&&this.initializeBottomRow()}initializeTopRow(){var t=document.createDocumentFragment();this.topInitialized||(t.appendChild(document.createElement("br")),t.appendChild(this.topElement),this.table.columnManager.getContentsElement().insertBefore(t,this.table.columnManager.headersElement.nextSibling),this.topInitialized=!0)}initializeBottomRow(){this.botInitialized||(this.footerPrepend(this.botElement),this.botInitialized=!0)}scrollHorizontal(t){this.botInitialized&&this.botRow&&(this.botElement.scrollLeft=t)}recalc(t){var e,i;if(!this.blockCheck()&&(this.topInitialized||this.botInitialized)){if(e=this.rowsToData(t),this.topInitialized){for(this.topRow&&this.topRow.deleteCells(),i=this.generateRow("top",e),this.topRow=i;this.topElement.firstChild;)this.topElement.removeChild(this.topElement.firstChild);this.topElement.appendChild(i.getElement()),i.initialize(!0)}if(this.botInitialized){for(this.botRow&&this.botRow.deleteCells(),i=this.generateRow("bottom",e),this.botRow=i;this.botElement.firstChild;)this.botElement.removeChild(this.botElement.firstChild);this.botElement.appendChild(i.getElement()),i.initialize(!0)}this.table.rowManager.adjustTableSize(),this.table.modExists("frozenColumns")&&this.table.modules.frozenColumns.layout()}}recalcRowGroup(t){this.recalcGroup(this.table.modules.groupRows.getRowGroup(t))}recalcAll(){(this.topCalcs.length||this.botCalcs.length)&&("group"!==this.table.options.columnCalcs&&this.recalcActiveRows(),this.table.options.groupBy&&"table"!==this.table.options.columnCalcs&&this.table.modules.groupRows.getChildGroups().forEach(t=>{this.recalcGroup(t)}))}recalcGroup(t){var e,i;this.blockCheck()||t&&t.calcs&&(t.calcs.bottom&&(e=this.rowsToData(t.rows),i=this.generateRowData("bottom",e),t.calcs.bottom.updateData(i),t.calcs.bottom.reinitialize()),t.calcs.top&&(e=this.rowsToData(t.rows),i=this.generateRowData("top",e),t.calcs.top.updateData(i),t.calcs.top.reinitialize()))}generateTopRow(t){return this.generateRow("top",this.rowsToData(t))}generateBottomRow(t){return this.generateRow("bottom",this.rowsToData(t))}rowsToData(t){var e=[],i=this.table.options.dataTree&&this.table.options.dataTreeChildColumnCalcs,s=this.table.modules.dataTree;return t.forEach(t=>{e.push(t.getData()),i&&t.modules.dataTree?.open&&this.rowsToData(s.getFilteredTreeChildren(t)).forEach(t=>{e.push(t)})}),e}generateRow(t,e){var i,s=this.generateRowData(t,e);return this.table.modExists("mutator")&&this.table.modules.mutator.disable(),i=new Ra(s,this,"calc"),this.table.modExists("mutator")&&this.table.modules.mutator.enable(),i.getElement().classList.add("tabulator-calcs","tabulator-calcs-"+t),i.component=!1,i.getComponent=()=>(i.component||(i.component=new wa(i)),i.component),i.generateCells=()=>{var e=[];this.table.columnManager.columnsByIndex.forEach(s=>{this.genColumn.setField(s.getField()),this.genColumn.hozAlign=s.hozAlign,s.definition[t+"CalcFormatter"]&&this.table.modExists("format")?this.genColumn.modules.format={formatter:this.table.modules.format.lookupFormatter(s.definition[t+"CalcFormatter"]),params:s.definition[t+"CalcFormatterParams"]||{}}:this.genColumn.modules.format={formatter:this.table.modules.format.lookupFormatter("plaintext"),params:{}},this.genColumn.definition.cssClass=s.definition.cssClass;var n=new _a(this.genColumn,i);n.getElement(),n.column=s,n.setWidth(),s.cells.push(n),e.push(n),s.visible||n.hide()}),i.cells=e},i}generateRowData(t,e){var i,s,n={},o="top"==t?this.topCalcs:this.botCalcs,r="top"==t?"topCalc":"botCalc";return o.forEach(function(t){var o=[];t.modules.columnCalcs&&t.modules.columnCalcs[r]&&(e.forEach(function(e){o.push(t.getFieldValue(e))}),s=r+"Params",i="function"==typeof t.modules.columnCalcs[s]?t.modules.columnCalcs[s](o,e):t.modules.columnCalcs[s],t.setFieldValue(n,t.modules.columnCalcs[r](o,e,i)))}),n}hasTopCalcs(){return!!this.topCalcs.length}hasBottomCalcs(){return!!this.botCalcs.length}redraw(){this.topRow&&this.topRow.normalizeHeight(!0),this.botRow&&this.botRow.normalizeHeight(!0)}getResults(){var t={};return this.table.options.groupBy&&this.table.modExists("groupRows")?this.table.modules.groupRows.getGroups(!0).forEach(e=>{t[e.getKey()]=this.getGroupResults(e)}):t={top:this.topRow?this.topRow.getData():{},bottom:this.botRow?this.botRow.getData():{}},t}getGroupResults(t){var e=t._getSelf(),i=t.getSubGroups(),s={};return i.forEach(t=>{s[t.getKey()]=this.getGroupResults(t)}),{top:e.calcs.top?e.calcs.top.getData():{},bottom:e.calcs.bottom?e.calcs.bottom.getData():{},groups:s}}adjustForScrollbar(t){this.botRow&&(this.table.rtl?this.botElement.style.paddingLeft=t+"px":this.botElement.style.paddingRight=t+"px")}}var Sa={csv:function(t,e={},i){var s=e.delimiter?e.delimiter:",",n=[],o=[];t.forEach(t=>{var e=[];switch(t.type){case"group":console.warn("Download Warning - CSV downloader cannot process row groups");break;case"calc":console.warn("Download Warning - CSV downloader cannot process column calculations");break;case"header":t.columns.forEach((t,e)=>{t&&1===t.depth&&(o[e]=void 0===t.value||null===t.value?"":'"'+String(t.value).split('"').join('""')+'"')});break;case"row":t.columns.forEach(t=>{if(t){switch(typeof t.value){case"object":t.value=null!==t.value?JSON.stringify(t.value):"";break;case"undefined":t.value=""}e.push('"'+String(t.value).split('"').join('""')+'"')}}),n.push(e.join(s))}}),o.length&&n.unshift(o.join(s)),n=n.join("\n"),e.bom&&(n="\ufeff"+n),i(n,"text/csv")},json:function(t,e,i){var s=[];t.forEach(t=>{var e={};switch(t.type){case"header":break;case"group":console.warn("Download Warning - JSON downloader cannot process row groups");break;case"calc":console.warn("Download Warning - JSON downloader cannot process column calculations");break;case"row":t.columns.forEach(t=>{t&&(e[t.component.getTitleDownload()||t.component.getField()]=t.value)}),s.push(e)}}),i(s=JSON.stringify(s,null,"\t"),"application/json")},jsonLines:function(t,e,i){const s=[];t.forEach(t=>{const e={};switch(t.type){case"header":break;case"group":console.warn("Download Warning - JSON downloader cannot process row groups");break;case"calc":console.warn("Download Warning - JSON downloader cannot process column calculations");break;case"row":t.columns.forEach(t=>{t&&(e[t.component.getTitleDownload()||t.component.getField()]=t.value)}),s.push(JSON.stringify(e))}}),i(s.join("\n"),"application/x-ndjson")},pdf:function(t,e={},i){var s,n,o=[],r=[],a={},l=e.rowGroupStyles||{fontStyle:"bold",fontSize:12,cellPadding:6,fillColor:220},h=e.rowCalcStyles||{fontStyle:"bold",fontSize:10,cellPadding:4,fillColor:232},c=e.jsPDF||{},d=e.title?e.title:"";function u(t,e){var i=[];return t.columns.forEach(t=>{var s;if(t){switch(typeof t.value){case"object":t.value=null!==t.value?JSON.stringify(t.value):"";break;case"undefined":t.value=""}s={content:t.value,colSpan:t.width,rowSpan:t.height},e&&(s.styles=e),i.push(s)}}),i}c.orientation||(c.orientation=e.orientation||"landscape"),c.unit||(c.unit="pt"),t.forEach(t=>{switch(t.type){case"header":o.push(u(t));break;case"group":r.push(u(t,l));break;case"calc":r.push(u(t,h));break;case"row":r.push(u(t))}}),s=this.dependencyRegistry.lookup("jspdf","jsPDF"),n=new s(c),e.autoTable&&(a="function"==typeof e.autoTable?e.autoTable(n)||{}:e.autoTable),d&&(a.didDrawPage=function(t){n.text(d,40,30)}),a.head=o,a.body=r,n.autoTable(a),e.documentProcessing&&e.documentProcessing(n),i(n.output("arraybuffer"),"application/pdf")},xlsx:function(t,e,i){var s=e.sheetName||"Sheet1",n=this.dependencyRegistry.lookup("XLSX"),o=n.utils.book_new(),r=new ea(this),a=!("compress"in e)||e.compress,l=e.writeOptions||{bookType:"xlsx",bookSST:!0,compression:a};function h(){var e=[],i=[],s={},o={s:{c:0,r:0},e:{c:t[0]?t[0].columns.reduce((t,e)=>t+(e&&e.width?e.width:1),0):0,r:t.length}};return t.forEach((t,s)=>{var n=[];t.columns.forEach(function(t,e){t?(n.push(t.value instanceof Date||"object"!=typeof t.value?t.value:JSON.stringify(t.value)),(t.width>1||t.height>-1)&&(t.height>1||t.width>1)&&i.push({s:{r:s,c:e},e:{r:s+t.height-1,c:e+t.width-1}})):n.push("")}),e.push(n)}),n.utils.sheet_add_aoa(s,e),s["!ref"]=n.utils.encode_range(o),i.length&&(s["!merges"]=i),s}if(l.type="binary",o.SheetNames=[],o.Sheets={},e.sheetOnly)i(h());else{if(e.sheets)for(var c in e.sheets)!0===e.sheets[c]?(o.SheetNames.push(c),o.Sheets[c]=h()):(o.SheetNames.push(c),r.commsSend(e.sheets[c],"download","intercept",{type:"xlsx",options:{sheetOnly:!0},active:this.active,intercept:function(t){o.Sheets[c]=t}}));else o.SheetNames.push(s),o.Sheets[s]=h();e.documentProcessing&&(o=e.documentProcessing(o)),i(function(t){for(var e=new ArrayBuffer(t.length),i=new Uint8Array(e),s=0;s!=t.length;++s)i[s]=255&t.charCodeAt(s);return e}(n.write(o,l)),"application/octet-stream")}},html:function(t,e,i){this.modExists("export",!0)&&i(this.modules.export.generateHTMLTable(t),"text/html")}};class Da extends na{static moduleName="download";static downloaders=Sa;constructor(t){super(t),this.registerTableOption("downloadEncoder",function(t,e){return new Blob([t],{type:e})}),this.registerTableOption("downloadConfig",{}),this.registerTableOption("downloadRowRange","active"),this.registerColumnOption("download"),this.registerColumnOption("titleDownload")}initialize(){this.deprecatedOptionsCheck(),this.registerTableFunction("download",this.download.bind(this)),this.registerTableFunction("downloadToTab",this.downloadToTab.bind(this))}deprecatedOptionsCheck(){}downloadToTab(t,e,i,s){this.download(t,e,i,s,!0)}download(t,e,i,s,n){var o=!1;if("function"==typeof t?o=t:Da.downloaders[t]?o=Da.downloaders[t]:console.warn("Download Error - No such download type found: ",t),o){var r=this.generateExportList(s);o.call(this.table,r,i||{},function(i,s){n?!0===n?this.triggerDownload(i,s,t,e,!0):n(i):this.triggerDownload(i,s,t,e)}.bind(this))}}generateExportList(t){var e=this.table.modules.export.generateExportList(this.table.options.downloadConfig,!1,t||this.table.options.downloadRowRange,"download"),i=this.table.options.groupHeaderDownload;return i&&!Array.isArray(i)&&(i=[i]),e.forEach(t=>{var e;"group"===t.type&&(e=t.columns[0],i&&i[t.indent]&&(e.value=i[t.indent](e.value,t.component._group.getRowCount(),t.component._group.getData(),t.component)))}),e}triggerDownload(t,e,i,s,n){var o=document.createElement("a"),r=this.table.options.downloadEncoder(t,e);r&&(n?window.open(window.URL.createObjectURL(r)):(s=s||"Tabulator."+("function"==typeof i?"txt":i),navigator.msSaveOrOpenBlob?navigator.msSaveOrOpenBlob(r,s):(o.setAttribute("href",window.URL.createObjectURL(r)),o.setAttribute("download",s),o.style.display="none",document.body.appendChild(o),o.click(),document.body.removeChild(o))),this.dispatchExternal("downloadComplete"))}commsReceived(t,e,i){"intercept"===e&&this.download(i.type,"",i.options,i.active,i.intercept)}}function La(t,e){var i=e.mask,s=void 0!==e.maskLetterChar?e.maskLetterChar:"A",n=void 0!==e.maskNumberChar?e.maskNumberChar:"9",o=void 0!==e.maskWildcardChar?e.maskWildcardChar:"*";function r(e){var a=i[e];void 0!==a&&a!==o&&a!==s&&a!==n&&(t.value=t.value+""+a,r(e+1))}t.addEventListener("keydown",e=>{var r=t.value.length,a=e.key;if(1===e.key.length&&!e.ctrlKey&&!e.metaKey){if(r>=i.length)return e.preventDefault(),e.stopPropagation(),!1;switch(i[r]){case s:if(a.toUpperCase()==a.toLowerCase())return e.preventDefault(),e.stopPropagation(),!1;break;case n:if(isNaN(a))return e.preventDefault(),e.stopPropagation(),!1;break;case o:break;default:if(a!==i[r])return e.preventDefault(),e.stopPropagation(),!1}}}),t.addEventListener("keyup",i=>{1===i.key.length&&e.maskAutoFill&&r(t.value.length)}),t.placeholder||(t.placeholder=i),e.maskAutoFill&&r(t.value.length)}let Pa=class{constructor(t,e,i,s,n,o){this.edit=t,this.table=t.table,this.cell=e,this.params=this._initializeParams(o),this.data=[],this.displayItems=[],this.currentItems=[],this.focusedItem=null,this.input=this._createInputElement(),this.listEl=this._createListElement(),this.initialValues=null,this.isFilter="header"===e.getType(),this.filterTimeout=null,this.filtered=!1,this.typing=!1,this.values=[],this.popup=null,this.listIteration=0,this.lastAction="",this.filterTerm="",this.blurable=!0,this.actions={success:s,cancel:n},this._deprecatedOptionsCheck(),this._initializeValue(),i(this._onRendered.bind(this))}_deprecatedOptionsCheck(){}_initializeValue(){var t=this.cell.getValue();void 0===t&&void 0!==this.params.defaultValue&&(t=this.params.defaultValue),this.initialValues=this.params.multiselect?t:[t],this.isFilter&&(this.input.value=this.initialValues?this.initialValues.join(","):"",this.headerFilterInitialListGen())}_onRendered(){var t=this.cell.getElement();function e(t){t.stopPropagation()}this.isFilter||(this.input.style.height="100%",this.input.focus({preventScroll:!0})),t.addEventListener("click",e),setTimeout(()=>{t.removeEventListener("click",e)},1e3),this.input.addEventListener("mousedown",this._preventPopupBlur.bind(this))}_createListElement(){var t=document.createElement("div");return t.classList.add("tabulator-edit-list"),t.addEventListener("mousedown",this._preventBlur.bind(this)),t.addEventListener("keydown",this._inputKeyDown.bind(this)),t}_setListWidth(){var t=this.isFilter?this.input:this.cell.getElement();this.listEl.style.minWidth=t.offsetWidth+"px",this.params.maxWidth&&(!0===this.params.maxWidth?this.listEl.style.maxWidth=t.offsetWidth+"px":"number"==typeof this.params.maxWidth?this.listEl.style.maxWidth=this.params.maxWidth+"px":this.listEl.style.maxWidth=this.params.maxWidth)}_createInputElement(){var t=this.params.elementAttributes,e=document.createElement("input");if(e.setAttribute("type",this.params.clearable?"search":"text"),e.style.padding="4px",e.style.width="100%",e.style.boxSizing="border-box",this.params.autocomplete||(e.style.cursor="default",e.style.caretColor="transparent"),t&&"object"==typeof t)for(let i in t)"+"==i.charAt(0)?(i=i.slice(1),e.setAttribute(i,e.getAttribute(i)+t["+"+i])):e.setAttribute(i,t[i]);return this.params.mask&&La(e,this.params),this._bindInputEvents(e),e}_initializeParams(t){var e,i=["values","valuesURL","valuesLookup"];return(t=Object.assign({},t)).verticalNavigation=t.verticalNavigation||"editor",t.placeholderLoading=void 0===t.placeholderLoading?"Searching ...":t.placeholderLoading,t.placeholderEmpty=void 0===t.placeholderEmpty?"No Results Found":t.placeholderEmpty,t.filterDelay=void 0===t.filterDelay?300:t.filterDelay,t.emptyValue=Object.keys(t).includes("emptyValue")?t.emptyValue:"",(e=Object.keys(t).filter(t=>i.includes(t)).length)?e>1&&console.warn("list editor config error - only one of the values, valuesURL, or valuesLookup options can be set on the same editor"):console.warn("list editor config error - either the values, valuesURL, or valuesLookup option must be set"),t.autocomplete?t.multiselect&&(t.multiselect=!1,console.warn("list editor config error - multiselect option is not available when autocomplete is enabled")):(t.freetext&&(t.freetext=!1,console.warn("list editor config error - freetext option is only available when autocomplete is enabled")),t.filterFunc&&(t.filterFunc=!1,console.warn("list editor config error - filterFunc option is only available when autocomplete is enabled")),t.filterRemote&&(t.filterRemote=!1,console.warn("list editor config error - filterRemote option is only available when autocomplete is enabled")),t.mask&&(t.mask=!1,console.warn("list editor config error - mask option is only available when autocomplete is enabled")),t.allowEmpty&&(t.allowEmpty=!1,console.warn("list editor config error - allowEmpty option is only available when autocomplete is enabled")),t.listOnEmpty&&(t.listOnEmpty=!1,console.warn("list editor config error - listOnEmpty option is only available when autocomplete is enabled"))),t.filterRemote&&"function"!=typeof t.valuesLookup&&!t.valuesURL&&(t.filterRemote=!1,console.warn("list editor config error - filterRemote option should only be used when values list is populated from a remote source")),t}_bindInputEvents(t){t.addEventListener("focus",this._inputFocus.bind(this)),t.addEventListener("click",this._inputClick.bind(this)),t.addEventListener("blur",this._inputBlur.bind(this)),t.addEventListener("keydown",this._inputKeyDown.bind(this)),t.addEventListener("search",this._inputSearch.bind(this)),this.params.autocomplete&&t.addEventListener("keyup",this._inputKeyUp.bind(this))}_inputFocus(t){this.rebuildOptionsList()}_filter(){this.params.filterRemote?(clearTimeout(this.filterTimeout),this.filterTimeout=setTimeout(()=>{this.rebuildOptionsList()},this.params.filterDelay)):this._filterList()}_inputClick(t){t.stopPropagation()}_inputBlur(t){this.blurable&&(this.popup?this.popup.hide():this._resolveValue(!0))}_inputSearch(){this._clearChoices()}_inputKeyDown(t){switch(t.key){case"ArrowUp":this._keyUp(t);break;case"ArrowDown":this._keyDown(t);break;case"ArrowLeft":case"ArrowRight":this._keySide(t);break;case"Enter":this._keyEnter();break;case"Escape":this._keyEsc();break;case"Home":case"End":this._keyHomeEnd(t);break;case"Tab":this._keyTab(t);break;default:this._keySelectLetter(t)}}_inputKeyUp(t){switch(t.key){case"ArrowUp":case"ArrowLeft":case"ArrowRight":case"ArrowDown":case"Enter":case"Escape":break;default:this._keyAutoCompLetter(t)}}_preventPopupBlur(){this.popup&&this.popup.blockHide(),setTimeout(()=>{this.popup&&this.popup.restoreHide()},10)}_preventBlur(){this.blurable=!1,setTimeout(()=>{this.blurable=!0},10)}_keyTab(t){this.params.autocomplete&&"typing"===this.lastAction?this._resolveValue(!0):this.focusedItem&&this._chooseItem(this.focusedItem,!0)}_keyUp(t){var e=this.displayItems.indexOf(this.focusedItem);("editor"==this.params.verticalNavigation||"hybrid"==this.params.verticalNavigation&&e)&&(t.stopImmediatePropagation(),t.stopPropagation(),t.preventDefault(),e>0&&this._focusItem(this.displayItems[e-1]))}_keyDown(t){var e=this.displayItems.indexOf(this.focusedItem);("editor"==this.params.verticalNavigation||"hybrid"==this.params.verticalNavigation&&e<this.displayItems.length-1)&&(t.stopImmediatePropagation(),t.stopPropagation(),t.preventDefault(),e<this.displayItems.length-1&&(-1==e?this._focusItem(this.displayItems[0]):this._focusItem(this.displayItems[e+1])))}_keySide(t){this.params.autocomplete||(t.stopImmediatePropagation(),t.stopPropagation(),t.preventDefault())}_keyEnter(t){this.params.autocomplete&&"typing"===this.lastAction?this._resolveValue(!0):this.focusedItem&&this._chooseItem(this.focusedItem)}_keyEsc(t){this._cancel()}_keyHomeEnd(t){this.params.autocomplete&&t.stopImmediatePropagation()}_keySelectLetter(t){this.params.autocomplete||(t.preventDefault(),1===t.key.length&&this._scrollToValue(t.key.toUpperCase().charCodeAt(0)))}_keyAutoCompLetter(t){this._filter(),this.lastAction="typing",this.typing=!0}_scrollToValue(t){clearTimeout(this.filterTimeout);var e=String.fromCharCode(t).toLowerCase();this.filterTerm+=e.toLowerCase();var i=this.displayItems.find(t=>void 0!==t.label&&t.label.toLowerCase().startsWith(this.filterTerm));i&&this._focusItem(i),this.filterTimeout=setTimeout(()=>{this.filterTerm=""},800)}_focusItem(t){this.lastAction="focus",this.focusedItem&&this.focusedItem.element&&this.focusedItem.element.classList.remove("focused"),this.focusedItem=t,t&&t.element&&(t.element.classList.add("focused"),t.element.scrollIntoView({behavior:"smooth",block:"nearest",inline:"start"}))}headerFilterInitialListGen(){this._generateOptions(!0)}rebuildOptionsList(){this._generateOptions().then(this._sortOptions.bind(this)).then(this._buildList.bind(this)).then(this._showList.bind(this)).catch(t=>{Number.isInteger(t)||console.error("List generation error",t)})}_filterList(){this._buildList(this._filterOptions()),this._showList()}_generateOptions(t){var e=[],i=++this.listIteration;return this.filtered=!1,this.params.values?e=this.params.values:this.params.valuesURL?e=this._ajaxRequest(this.params.valuesURL,this.input.value):"function"==typeof this.params.valuesLookup?e=this.params.valuesLookup(this.cell,this.input.value):this.params.valuesLookup&&(e=this._uniqueColumnValues(this.params.valuesLookupField)),e instanceof Promise?(t||this._addPlaceholder(this.params.placeholderLoading),e.then().then(t=>this.listIteration===i?this._parseList(t):Promise.reject(i))):Promise.resolve(this._parseList(e))}_addPlaceholder(t){var e=document.createElement("div");"function"==typeof t&&(t=t(this.cell.getComponent(),this.listEl)),t&&(this._clearList(),t instanceof HTMLElement?e=t:(e.classList.add("tabulator-edit-list-placeholder"),e.innerHTML=t),this.listEl.appendChild(e),this._showList())}_ajaxRequest(t,e){return t=ca(t,{},this.params.filterRemote?{term:e}:{}),fetch(t).then(t=>t.ok?t.json().catch(t=>(console.warn("List Ajax Load Error - Invalid JSON returned",t),Promise.reject(t))):(console.error("List Ajax Load Error - Connection Error: "+t.status,t.statusText),Promise.reject(t))).catch(t=>(console.error("List Ajax Load Error - Connection Error: ",t),Promise.reject(t)))}_uniqueColumnValues(t){var e,i={},s=this.table.getData(this.params.valuesLookup);return(e=t?this.table.columnManager.getColumnByField(t):this.cell.getColumn()._getSelf())?s.forEach(t=>{var s=e.getFieldValue(t);this._emptyValueCheck(s)||(this.params.multiselect&&Array.isArray(s)?s.forEach(t=>{this._emptyValueCheck(t)||(i[t]=!0)}):i[s]=!0)}):(console.warn("unable to find matching column to create select lookup list:",t),i=[]),Object.keys(i)}_emptyValueCheck(t){return null==t||""===t}_parseList(t){var e=[];return Array.isArray(t)||(t=Object.entries(t).map(([t,e])=>({label:e,value:t}))),t.forEach(t=>{"object"!=typeof t&&(t={label:t,value:t}),this._parseListItem(t,e,0)}),!this.currentItems.length&&this.params.freetext&&(this.input.value=this.initialValues,this.typing=!0,this.lastAction="typing"),this.data=e,e}_parseListItem(t,e,i){var s={};t.options?s=this._parseListGroup(t,i+1):(s={label:t.label,value:t.value,itemParams:t.itemParams,elementAttributes:t.elementAttributes,element:!1,selected:!1,visible:!0,level:i,original:t},this.initialValues&&this.initialValues.indexOf(t.value)>-1&&this._chooseItem(s,!0)),e.push(s)}_parseListGroup(t,e){var i={label:t.label,group:!0,itemParams:t.itemParams,elementAttributes:t.elementAttributes,element:!1,visible:!0,level:e,options:[],original:t};return t.options.forEach(t=>{this._parseListItem(t,i.options,e)}),i}_sortOptions(t){var e;return this.params.sort&&(e="function"==typeof this.params.sort?this.params.sort:this._defaultSortFunction.bind(this),this._sortGroup(e,t)),t}_sortGroup(t,e){e.sort((e,i)=>t(e.label,i.label,e.value,i.value,e.original,i.original)),e.forEach(e=>{e.group&&this._sortGroup(t,e.options)})}_defaultSortFunction(t,e){var i,s,n,o,r,a=0,l=/(\d+)|(\D+)/g,h=/\d/,c=0;if("desc"===this.params.sort&&([t,e]=[e,t]),t||0===t){if(e||0===e){if(isFinite(t)&&isFinite(e))return t-e;if((i=String(t).toLowerCase())===(s=String(e).toLowerCase()))return 0;if(!h.test(i)||!h.test(s))return i>s?1:-1;for(i=i.match(l),s=s.match(l),r=i.length>s.length?s.length:i.length;a<r;)if((n=i[a])!==(o=s[a++]))return isFinite(n)&&isFinite(o)?("0"===n.charAt(0)&&(n="."+n),"0"===o.charAt(0)&&(o="."+o),n-o):n>o?1:-1;return i.length>s.length}c=1}else c=e||0===e?-1:0;return c}_filterOptions(){var t=this.params.filterFunc||this._defaultFilterFunc,e=this.input.value;return e?(this.filtered=!0,this.data.forEach(i=>{this._filterItem(t,e,i)})):this.filtered=!1,this.data}_filterItem(t,e,i){var s=!1;return i.group?(i.options.forEach(i=>{this._filterItem(t,e,i)&&(s=!0)}),i.visible=s):i.visible=t(e,i.label,i.value,i.original),i.visible}_defaultFilterFunc(t,e,i,s){return t=String(t).toLowerCase(),null!=e&&(String(e).toLowerCase().indexOf(t)>-1||String(i).toLowerCase().indexOf(t)>-1)}_clearList(){for(;this.listEl.firstChild;)this.listEl.removeChild(this.listEl.firstChild);this.displayItems=[]}_buildList(t){this._clearList(),t.forEach(t=>{this._buildItem(t)}),this.displayItems.length||this._addPlaceholder(this.params.placeholderEmpty)}_buildItem(t){var e,i=t.element;if(!this.filtered||t.visible){if(!i){if((i=document.createElement("div")).tabIndex=0,(e=this.params.itemFormatter?this.params.itemFormatter(t.label,t.value,t.original,i):t.label)instanceof HTMLElement?i.appendChild(e):i.innerHTML=e,t.group?i.classList.add("tabulator-edit-list-group"):i.classList.add("tabulator-edit-list-item"),i.classList.add("tabulator-edit-list-group-level-"+t.level),t.elementAttributes&&"object"==typeof t.elementAttributes)for(let e in t.elementAttributes)"+"==e.charAt(0)?(e=e.slice(1),i.setAttribute(e,this.input.getAttribute(e)+t.elementAttributes["+"+e])):i.setAttribute(e,t.elementAttributes[e]);t.group?i.addEventListener("click",this._groupClick.bind(this,t)):i.addEventListener("click",this._itemClick.bind(this,t)),i.addEventListener("mousedown",this._preventBlur.bind(this)),t.element=i}this._styleItem(t),this.listEl.appendChild(i),t.group?t.options.forEach(t=>{this._buildItem(t)}):this.displayItems.push(t)}}_showList(){var t=this.popup&&this.popup.isVisible();if(this.input.parentNode){if(this.params.autocomplete&&""===this.input.value&&!this.params.listOnEmpty)return void(this.popup&&this.popup.hide(!0));this._setListWidth(),this.popup||(this.popup=this.edit.popup(this.listEl)),this.popup.show(this.cell.getElement(),"bottom"),t||setTimeout(()=>{this.popup.hideOnBlur(this._resolveValue.bind(this,!0))},10)}}_styleItem(t){t&&t.element&&(t.selected?t.element.classList.add("active"):t.element.classList.remove("active"))}_itemClick(t,e){e.stopPropagation(),this._chooseItem(t)}_groupClick(t,e){e.stopPropagation()}_cancel(){this.popup.hide(!0),this.actions.cancel()}_clearChoices(){this.typing=!0,this.currentItems.forEach(t=>{t.selected=!1,this._styleItem(t)}),this.currentItems=[],this.focusedItem=null}_chooseItem(t,e){var i;this.typing=!1,this.params.multiselect?((i=this.currentItems.indexOf(t))>-1?(this.currentItems.splice(i,1),t.selected=!1):(this.currentItems.push(t),t.selected=!0),this.input.value=this.currentItems.map(t=>t.label).join(","),this._styleItem(t)):(this.currentItems=[t],t.selected=!0,this.input.value=t.label,this._styleItem(t),e||this._resolveValue()),this._focusItem(t)}_resolveValue(t){var e,i;if(this.popup&&this.popup.hide(!0),this.params.multiselect)e=this.currentItems.map(t=>t.value);else if(t&&this.params.autocomplete&&this.typing){if(!(this.params.freetext||this.params.allowEmpty&&""===this.input.value))return void this.actions.cancel();e=this.input.value}else e=this.currentItems[0]?this.currentItems[0].value:null==(i=Array.isArray(this.initialValues)?this.initialValues[0]:this.initialValues)||""===i?i:this.params.emptyValue;""===e&&(e=this.params.emptyValue),this.actions.success(e),this.isFilter&&(this.initialValues=e&&!Array.isArray(e)?[e]:e,this.currentItems=[])}};var ja={input:function(t,e,i,s,n){var o=t.getValue(),r=document.createElement("input");if(r.setAttribute("type",n.search?"search":"text"),r.style.padding="4px",r.style.width="100%",r.style.boxSizing="border-box",n.elementAttributes&&"object"==typeof n.elementAttributes)for(let t in n.elementAttributes)"+"==t.charAt(0)?(t=t.slice(1),r.setAttribute(t,r.getAttribute(t)+n.elementAttributes["+"+t])):r.setAttribute(t,n.elementAttributes[t]);function a(t){null==o&&""!==r.value||r.value!==o?i(r.value)&&(o=r.value):s()}return r.value=void 0!==o?o:"",e(function(){"cell"===t.getType()&&(r.focus({preventScroll:!0}),r.style.height="100%",n.selectContents&&r.select())}),r.addEventListener("change",a),r.addEventListener("blur",a),r.addEventListener("keydown",function(t){switch(t.key){case"Enter":a();break;case"Escape":s();break;case"End":case"Home":t.stopPropagation()}}),n.mask&&La(r,n),r},textarea:function(t,e,i,s,n){var o=t.getValue(),r=n.verticalNavigation||"hybrid",a=String(null!=o?o:""),l=document.createElement("textarea"),h=0;if(l.style.display="block",l.style.padding="2px",l.style.height="100%",l.style.width="100%",l.style.boxSizing="border-box",l.style.whiteSpace="pre-wrap",l.style.resize="none",n.elementAttributes&&"object"==typeof n.elementAttributes)for(let t in n.elementAttributes)"+"==t.charAt(0)?(t=t.slice(1),l.setAttribute(t,l.getAttribute(t)+n.elementAttributes["+"+t])):l.setAttribute(t,n.elementAttributes[t]);function c(e){null==o&&""!==l.value||l.value!==o?(i(l.value)&&(o=l.value),setTimeout(function(){t.getRow().normalizeHeight()},300)):s()}return l.value=a,e(function(){"cell"===t.getType()&&(l.focus({preventScroll:!0}),l.style.height="100%",l.scrollHeight,l.style.height=l.scrollHeight+"px",t.getRow().normalizeHeight(),n.selectContents&&l.select())}),l.addEventListener("change",c),l.addEventListener("blur",c),l.addEventListener("keyup",function(){l.style.height="";var e=l.scrollHeight;l.style.height=e+"px",e!=h&&(h=e,t.getRow().normalizeHeight())}),l.addEventListener("keydown",function(t){switch(t.key){case"Enter":t.shiftKey&&n.shiftEnterSubmit&&c();break;case"Escape":s();break;case"ArrowUp":("editor"==r||"hybrid"==r&&l.selectionStart)&&(t.stopImmediatePropagation(),t.stopPropagation());break;case"ArrowDown":("editor"==r||"hybrid"==r&&l.selectionStart!==l.value.length)&&(t.stopImmediatePropagation(),t.stopPropagation());break;case"End":case"Home":t.stopPropagation()}}),n.mask&&La(l,n),l},number:function(t,e,i,s,n){var o=t.getValue(),r=n.verticalNavigation||"editor",a=document.createElement("input");if(a.setAttribute("type","number"),void 0!==n.max&&a.setAttribute("max",n.max),void 0!==n.min&&a.setAttribute("min",n.min),void 0!==n.step&&a.setAttribute("step",n.step),a.style.padding="4px",a.style.width="100%",a.style.boxSizing="border-box",n.elementAttributes&&"object"==typeof n.elementAttributes)for(let t in n.elementAttributes)"+"==t.charAt(0)?(t=t.slice(1),a.setAttribute(t,a.getAttribute(t)+n.elementAttributes["+"+t])):a.setAttribute(t,n.elementAttributes[t]);a.value=o;var l=function(t){h()};function h(){var t=a.value;isNaN(t)||""===t||(t=Number(t)),t!==o?i(t)&&(o=t):s()}return e(function(){"cell"===t.getType()&&(a.removeEventListener("blur",l),a.focus({preventScroll:!0}),a.style.height="100%",a.addEventListener("blur",l),n.selectContents&&a.select())}),a.addEventListener("keydown",function(t){switch(t.key){case"Enter":h();break;case"Escape":s();break;case"ArrowUp":case"ArrowDown":"editor"==r&&(t.stopImmediatePropagation(),t.stopPropagation());break;case"End":case"Home":t.stopPropagation()}}),n.mask&&La(a,n),a},range:function(t,e,i,s,n){var o=t.getValue(),r=document.createElement("input");if(r.setAttribute("type","range"),void 0!==n.max&&r.setAttribute("max",n.max),void 0!==n.min&&r.setAttribute("min",n.min),void 0!==n.step&&r.setAttribute("step",n.step),r.style.padding="4px",r.style.width="100%",r.style.boxSizing="border-box",n.elementAttributes&&"object"==typeof n.elementAttributes)for(let t in n.elementAttributes)"+"==t.charAt(0)?(t=t.slice(1),r.setAttribute(t,r.getAttribute(t)+n.elementAttributes["+"+t])):r.setAttribute(t,n.elementAttributes[t]);function a(){var t=r.value;isNaN(t)||""===t||(t=Number(t)),t!=o?i(t)&&(o=t):s()}return r.value=o,e(function(){"cell"===t.getType()&&(r.focus({preventScroll:!0}),r.style.height="100%")}),r.addEventListener("blur",function(t){a()}),r.addEventListener("keydown",function(t){switch(t.key){case"Enter":a();break;case"Escape":s()}}),r},date:function(t,e,i,s,n){var o=n.format,r=n.verticalNavigation||"editor",a=o?window.DateTime||luxon.DateTime:null,l=t.getValue(),h=document.createElement("input");function c(t){return(a.isDateTime(t)?t:"x"===o?a.fromMillis(t):"iso"===o?a.fromISO(String(t)):a.fromFormat(String(t),o)).toFormat("yyyy-MM-dd")}if(h.type="date",h.style.padding="4px",h.style.width="100%",h.style.boxSizing="border-box",n.max&&h.setAttribute("max",o?c(n.max):n.max),n.min&&h.setAttribute("min",o?c(n.min):n.min),n.elementAttributes&&"object"==typeof n.elementAttributes)for(let t in n.elementAttributes)"+"==t.charAt(0)?(t=t.slice(1),h.setAttribute(t,h.getAttribute(t)+n.elementAttributes["+"+t])):h.setAttribute(t,n.elementAttributes[t]);function d(){var t,e=h.value;if(null==l&&""!==e||e!==l){if(e&&o)switch(t=a.fromFormat(String(e),"yyyy-MM-dd"),o){case!0:e=t;break;case"x":e=t.toMillis();break;case"iso":e=t.toISO();break;default:e=t.toFormat(o)}i(e)&&(l=h.value)}else s()}return l=void 0!==l?l:"",o&&(a?l=c(l):console.error("Editor Error - 'date' editor 'format' param is dependant on luxon.js")),h.value=l,e(function(){"cell"===t.getType()&&(h.focus({preventScroll:!0}),h.style.height="100%",n.selectContents&&h.select())}),h.addEventListener("blur",function(t){(t.relatedTarget||t.rangeParent||t.explicitOriginalTarget!==h)&&d()}),h.addEventListener("keydown",function(t){switch(t.key){case"Enter":d();break;case"Escape":s();break;case"End":case"Home":t.stopPropagation();break;case"ArrowUp":case"ArrowDown":"editor"==r&&(t.stopImmediatePropagation(),t.stopPropagation())}}),h},time:function(t,e,i,s,n){var o,r=n.format,a=n.verticalNavigation||"editor",l=r?window.DateTime||luxon.DateTime:null,h=t.getValue(),c=document.createElement("input");if(c.type="time",c.style.padding="4px",c.style.width="100%",c.style.boxSizing="border-box",n.elementAttributes&&"object"==typeof n.elementAttributes)for(let t in n.elementAttributes)"+"==t.charAt(0)?(t=t.slice(1),c.setAttribute(t,c.getAttribute(t)+n.elementAttributes["+"+t])):c.setAttribute(t,n.elementAttributes[t]);function d(){var t,e=c.value;if(null==h&&""!==e||e!==h){if(e&&r)switch(t=l.fromFormat(String(e),"hh:mm"),r){case!0:e=t;break;case"x":e=t.toMillis();break;case"iso":e=t.toISO();break;default:e=t.toFormat(r)}i(e)&&(h=c.value)}else s()}return h=void 0!==h?h:"",r&&(l?(o=l.isDateTime(h)?h:"x"===r?l.fromMillis(h):"iso"===r?l.fromISO(String(h)):l.fromFormat(String(h),r),h=o.toFormat("HH:mm")):console.error("Editor Error - 'date' editor 'format' param is dependant on luxon.js")),c.value=h,e(function(){"cell"==t.getType()&&(c.focus({preventScroll:!0}),c.style.height="100%",n.selectContents&&c.select())}),c.addEventListener("blur",function(t){(t.relatedTarget||t.rangeParent||t.explicitOriginalTarget!==c)&&d()}),c.addEventListener("keydown",function(t){switch(t.key){case"Enter":d();break;case"Escape":s();break;case"End":case"Home":t.stopPropagation();break;case"ArrowUp":case"ArrowDown":"editor"==a&&(t.stopImmediatePropagation(),t.stopPropagation())}}),c},datetime:function(t,e,i,s,n){var o,r=n.format,a=n.verticalNavigation||"editor",l=r?this.table.dependencyRegistry.lookup(["luxon","DateTime"],"DateTime"):null,h=t.getValue(),c=document.createElement("input");if(c.type="datetime-local",c.style.padding="4px",c.style.width="100%",c.style.boxSizing="border-box",n.elementAttributes&&"object"==typeof n.elementAttributes)for(let t in n.elementAttributes)"+"==t.charAt(0)?(t=t.slice(1),c.setAttribute(t,c.getAttribute(t)+n.elementAttributes["+"+t])):c.setAttribute(t,n.elementAttributes[t]);function d(){var t,e=c.value;if(null==h&&""!==e||e!==h){if(e&&r)switch(t=l.fromISO(String(e)),r){case!0:e=t;break;case"x":e=t.toMillis();break;case"iso":e=t.toISO();break;default:e=t.toFormat(r)}i(e)&&(h=c.value)}else s()}return h=void 0!==h?h:"",r&&(l?(o=l.isDateTime(h)?h:"x"===r?l.fromMillis(h):"iso"===r?l.fromISO(String(h)):l.fromFormat(String(h),r),h=o.toFormat("yyyy-MM-dd")+"T"+o.toFormat("HH:mm")):console.error("Editor Error - 'date' editor 'format' param is dependant on luxon.js")),c.value=h,e(function(){"cell"===t.getType()&&(c.focus({preventScroll:!0}),c.style.height="100%",n.selectContents&&c.select())}),c.addEventListener("blur",function(t){(t.relatedTarget||t.rangeParent||t.explicitOriginalTarget!==c)&&d()}),c.addEventListener("keydown",function(t){switch(t.key){case"Enter":d();break;case"Escape":s();break;case"End":case"Home":t.stopPropagation();break;case"ArrowUp":case"ArrowDown":"editor"==a&&(t.stopImmediatePropagation(),t.stopPropagation())}}),c},list:function(t,e,i,s,n){return new Pa(this,t,e,i,s,n).input},star:function(t,e,i,s,n){var o=this,r=t.getElement(),a=t.getValue(),l=r.getElementsByTagName("svg").length||5,h=r.getElementsByTagName("svg")[0]?r.getElementsByTagName("svg")[0].getAttribute("width"):14,c=[],d=document.createElement("div"),u=document.createElementNS("http://www.w3.org/2000/svg","svg");function p(t){c.forEach(function(e,i){i<t?("ie"==o.table.browser?e.setAttribute("class","tabulator-star-active"):e.classList.replace("tabulator-star-inactive","tabulator-star-active"),e.innerHTML='<polygon fill="#488CE9" stroke="#014AAE" stroke-width="37.6152" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" points="259.216,29.942 330.27,173.919 489.16,197.007 374.185,309.08 401.33,467.31 259.216,392.612 117.104,467.31 144.25,309.08 29.274,197.007 188.165,173.919 "/>'):("ie"==o.table.browser?e.setAttribute("class","tabulator-star-inactive"):e.classList.replace("tabulator-star-active","tabulator-star-inactive"),e.innerHTML='<polygon fill="#010155" stroke="#686868" stroke-width="37.6152" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" points="259.216,29.942 330.27,173.919 489.16,197.007 374.185,309.08 401.33,467.31 259.216,392.612 117.104,467.31 144.25,309.08 29.274,197.007 188.165,173.919 "/>')})}function m(t){var e=document.createElement("span"),s=u.cloneNode(!0);c.push(s),e.addEventListener("mouseenter",function(e){e.stopPropagation(),e.stopImmediatePropagation(),p(t)}),e.addEventListener("mousemove",function(t){t.stopPropagation(),t.stopImmediatePropagation()}),e.addEventListener("click",function(e){e.stopPropagation(),e.stopImmediatePropagation(),i(t),r.blur()}),e.appendChild(s),d.appendChild(e)}function g(t){a=t,p(t)}if(r.style.whiteSpace="nowrap",r.style.overflow="hidden",r.style.textOverflow="ellipsis",d.style.verticalAlign="middle",d.style.display="inline-block",d.style.padding="4px",u.setAttribute("width",h),u.setAttribute("height",h),u.setAttribute("viewBox","0 0 512 512"),u.setAttribute("xml:space","preserve"),u.style.padding="0 1px",n.elementAttributes&&"object"==typeof n.elementAttributes)for(let t in n.elementAttributes)"+"==t.charAt(0)?(t=t.slice(1),d.setAttribute(t,d.getAttribute(t)+n.elementAttributes["+"+t])):d.setAttribute(t,n.elementAttributes[t]);for(var b=1;b<=l;b++)m(b);return p(a=Math.min(parseInt(a),l)),d.addEventListener("mousemove",function(t){p(0)}),d.addEventListener("click",function(t){i(0)}),r.addEventListener("blur",function(t){s()}),r.addEventListener("keydown",function(t){switch(t.key){case"ArrowRight":g(a+1);break;case"ArrowLeft":g(a-1);break;case"Enter":i(a);break;case"Escape":s()}}),d},progress:function(t,e,i,s,n){var o,r,a=t.getElement(),l=void 0===n.max?a.getElementsByTagName("div")[0]&&a.getElementsByTagName("div")[0].getAttribute("max")||100:n.max,h=void 0===n.min?a.getElementsByTagName("div")[0]&&a.getElementsByTagName("div")[0].getAttribute("min")||0:n.min,c=(l-h)/100,d=t.getValue()||0,u=document.createElement("div"),p=document.createElement("div");function m(){var t=window.getComputedStyle(a,null),e=c*Math.round(p.offsetWidth/((a.clientWidth-parseInt(t.getPropertyValue("padding-left"))-parseInt(t.getPropertyValue("padding-right")))/100))+h;i(e),a.setAttribute("aria-valuenow",e),a.setAttribute("aria-label",d)}if(u.style.position="absolute",u.style.right="0",u.style.top="0",u.style.bottom="0",u.style.width="5px",u.classList.add("tabulator-progress-handle"),p.style.display="inline-block",p.style.position="relative",p.style.height="100%",p.style.backgroundColor="#488CE9",p.style.maxWidth="100%",p.style.minWidth="0%",n.elementAttributes&&"object"==typeof n.elementAttributes)for(let t in n.elementAttributes)"+"==t.charAt(0)?(t=t.slice(1),p.setAttribute(t,p.getAttribute(t)+n.elementAttributes["+"+t])):p.setAttribute(t,n.elementAttributes[t]);return a.style.padding="4px 4px",d=Math.min(parseFloat(d),l),d=Math.max(parseFloat(d),h),d=Math.round((d-h)/c),p.style.width=d+"%",a.setAttribute("aria-valuemin",h),a.setAttribute("aria-valuemax",l),p.appendChild(u),u.addEventListener("mousedown",function(t){o=t.screenX,r=p.offsetWidth}),u.addEventListener("mouseover",function(){u.style.cursor="ew-resize"}),a.addEventListener("mousemove",function(t){o&&(p.style.width=r+t.screenX-o+"px")}),a.addEventListener("mouseup",function(t){o&&(t.stopPropagation(),t.stopImmediatePropagation(),o=!1,r=!1,m())}),a.addEventListener("keydown",function(t){switch(t.key){case"ArrowRight":t.preventDefault(),p.style.width=p.clientWidth+a.clientWidth/100+"px";break;case"ArrowLeft":t.preventDefault(),p.style.width=p.clientWidth-a.clientWidth/100+"px";break;case"Tab":case"Enter":m();break;case"Escape":s()}}),a.addEventListener("blur",function(){s()}),p},tickCross:function(t,e,i,s,n){var o=t.getValue(),r=document.createElement("input"),a=n.tristate,l=void 0===n.indeterminateValue?null:n.indeterminateValue,h=!1,c=Object.keys(n).includes("trueValue"),d=Object.keys(n).includes("falseValue");if(r.setAttribute("type","checkbox"),r.style.marginTop="5px",r.style.boxSizing="border-box",n.elementAttributes&&"object"==typeof n.elementAttributes)for(let t in n.elementAttributes)"+"==t.charAt(0)?(t=t.slice(1),r.setAttribute(t,r.getAttribute(t)+n.elementAttributes["+"+t])):r.setAttribute(t,n.elementAttributes[t]);function u(t){var e=r.checked;return c&&e?e=n.trueValue:d&&!e&&(e=n.falseValue),a?t?h?l:e:r.checked&&!h?(r.checked=!1,r.indeterminate=!0,h=!0,l):(h=!1,e):e}return r.value=o,!a||void 0!==o&&o!==l&&""!==o||(h=!0,r.indeterminate=!0),"firefox"!=this.table.browser&&"safari"!=this.table.browser&&e(function(){"cell"===t.getType()&&r.focus({preventScroll:!0})}),r.checked=c?o===n.trueValue:!0===o||"true"===o||"True"===o||1===o,r.addEventListener("change",function(t){i(u())}),r.addEventListener("blur",function(t){i(u(!0))}),r.addEventListener("keydown",function(t){"Enter"==t.key&&i(u()),"Escape"==t.key&&s()}),r},adaptable:function(t,e,i,s,n){var o,r,a=t._getSelf().column;return o=n.editorLookup?n.editorLookup(t):function(t){var e=t.getValue(),i="input";switch(typeof e){case"number":i="number";break;case"boolean":i="tickCross";break;case"string":e.includes("\n")&&(i="textarea")}return i}(t),n.paramsLookup&&(r="function"==typeof n.paramsLookup?n.paramsLookup(o,t):n.paramsLookup[o]),this.table.modules.edit.lookupEditor(o,a).call(this,t,e,i,s,r||{})}};class Na extends na{static moduleName="edit";static editors=ja;constructor(t){super(t),this.currentCell=!1,this.mouseClick=!1,this.recursionBlock=!1,this.invalidEdit=!1,this.editedCells=[],this.convertEmptyValues=!1,this.editors=Na.editors,this.registerTableOption("editTriggerEvent","focus"),this.registerTableOption("editorEmptyValue"),this.registerTableOption("editorEmptyValueFunc",this.emptyValueCheck.bind(this)),this.registerColumnOption("editable"),this.registerColumnOption("editor"),this.registerColumnOption("editorParams"),this.registerColumnOption("editorEmptyValue"),this.registerColumnOption("editorEmptyValueFunc"),this.registerColumnOption("cellEditing"),this.registerColumnOption("cellEdited"),this.registerColumnOption("cellEditCancelled"),this.registerTableFunction("getEditedCells",this.getEditedCells.bind(this)),this.registerTableFunction("clearCellEdited",this.clearCellEdited.bind(this)),this.registerTableFunction("navigatePrev",this.navigatePrev.bind(this)),this.registerTableFunction("navigateNext",this.navigateNext.bind(this)),this.registerTableFunction("navigateLeft",this.navigateLeft.bind(this)),this.registerTableFunction("navigateRight",this.navigateRight.bind(this)),this.registerTableFunction("navigateUp",this.navigateUp.bind(this)),this.registerTableFunction("navigateDown",this.navigateDown.bind(this)),this.registerComponentFunction("cell","isEdited",this.cellIsEdited.bind(this)),this.registerComponentFunction("cell","clearEdited",this.clearEdited.bind(this)),this.registerComponentFunction("cell","edit",this.editCell.bind(this)),this.registerComponentFunction("cell","cancelEdit",this.cellCancelEdit.bind(this)),this.registerComponentFunction("cell","navigatePrev",this.navigatePrev.bind(this)),this.registerComponentFunction("cell","navigateNext",this.navigateNext.bind(this)),this.registerComponentFunction("cell","navigateLeft",this.navigateLeft.bind(this)),this.registerComponentFunction("cell","navigateRight",this.navigateRight.bind(this)),this.registerComponentFunction("cell","navigateUp",this.navigateUp.bind(this)),this.registerComponentFunction("cell","navigateDown",this.navigateDown.bind(this))}initialize(){this.subscribe("cell-init",this.bindEditor.bind(this)),this.subscribe("cell-delete",this.clearEdited.bind(this)),this.subscribe("cell-value-changed",this.updateCellClass.bind(this)),this.subscribe("column-layout",this.initializeColumnCheck.bind(this)),this.subscribe("column-delete",this.columnDeleteCheck.bind(this)),this.subscribe("row-deleting",this.rowDeleteCheck.bind(this)),this.subscribe("row-layout",this.rowEditableCheck.bind(this)),this.subscribe("data-refreshing",this.cancelEdit.bind(this)),this.subscribe("clipboard-paste",this.pasteBlocker.bind(this)),this.confirm("edit-nav-disabled")||(this.subscribe("keybinding-nav-prev",this.navigatePrev.bind(this,void 0)),this.subscribe("keybinding-nav-next",this.keybindingNavigateNext.bind(this)),this.subscribe("keybinding-nav-up",this.navigateUp.bind(this,void 0)),this.subscribe("keybinding-nav-down",this.navigateDown.bind(this,void 0))),this.subscribe("edit-check-editing",this.checkEditing.bind(this)),this.subscribe("edit-cancel-cell",this.cancelEditEvent.bind(this)),Object.keys(this.table.options).includes("editorEmptyValue")&&(this.convertEmptyValues=!0)}pasteBlocker(t){if(this.currentCell)return!0}keybindingNavigateNext(t){var e=this.currentCell,i=this.options("tabEndNewRow");e&&(this.navigateNext(e,t)||i&&(e.getElement().firstChild.blur(),this.invalidEdit||(i=!0===i?this.table.addRow({}):"function"==typeof i?this.table.addRow(i(e.row.getComponent())):this.table.addRow(Object.assign({},i))).then(()=>{setTimeout(()=>{e.getComponent().navigateNext()})})))}cellIsEdited(t){return!!t.modules.edit&&t.modules.edit.edited}cellCancelEdit(t){t===this.currentCell?this.table.modules.edit.cancelEdit():console.warn("Cancel Editor Error - This cell is not currently being edited ")}updateCellClass(t){this.allowEdit(t)?t.getElement().classList.add("tabulator-editable"):t.getElement().classList.remove("tabulator-editable")}clearCellEdited(t){t||(t=this.table.modules.edit.getEditedCells()),Array.isArray(t)||(t=[t]),t.forEach(t=>{this.table.modules.edit.clearEdited(t._getSelf())})}navigatePrev(t=this.currentCell,e){var i,s;if(t){if(e&&e.preventDefault(),i=this.navigateLeft())return!0;if((s=this.table.rowManager.prevDisplayRow(t.row,!0))&&(i=this.findPrevEditableCell(s,s.cells.length)))return i.getComponent().edit(),!0}return!1}navigateNext(t=this.currentCell,e){var i,s;if(t){if(e&&e.preventDefault(),i=this.navigateRight())return!0;if((s=this.table.rowManager.nextDisplayRow(t.row,!0))&&(i=this.findNextEditableCell(s,-1)))return i.getComponent().edit(),!0}return!1}navigateLeft(t=this.currentCell,e){var i,s;return!!(t&&(e&&e.preventDefault(),i=t.getIndex(),s=this.findPrevEditableCell(t.row,i)))&&(s.getComponent().edit(),!0)}navigateRight(t=this.currentCell,e){var i,s;return!!(t&&(e&&e.preventDefault(),i=t.getIndex(),s=this.findNextEditableCell(t.row,i)))&&(s.getComponent().edit(),!0)}navigateUp(t=this.currentCell,e){var i,s;return!!(t&&(e&&e.preventDefault(),i=t.getIndex(),s=this.table.rowManager.prevDisplayRow(t.row,!0)))&&(s.cells[i].getComponent().edit(),!0)}navigateDown(t=this.currentCell,e){var i,s;return!!(t&&(e&&e.preventDefault(),i=t.getIndex(),s=this.table.rowManager.nextDisplayRow(t.row,!0)))&&(s.cells[i].getComponent().edit(),!0)}findNextEditableCell(t,e){var i=!1;if(e<t.cells.length-1)for(var s=e+1;s<t.cells.length;s++){let e=t.cells[s];if(e.column.modules.edit&&ia.elVisible(e.getElement())&&this.allowEdit(e)){i=e;break}}return i}findPrevEditableCell(t,e){var i=!1;if(e>0)for(var s=e-1;s>=0;s--){let e=t.cells[s];if(e.column.modules.edit&&ia.elVisible(e.getElement())&&this.allowEdit(e)){i=e;break}}return i}initializeColumnCheck(t){void 0!==t.definition.editor&&this.initializeColumn(t)}columnDeleteCheck(t){this.currentCell&&this.currentCell.column===t&&this.cancelEdit()}rowDeleteCheck(t){this.currentCell&&this.currentCell.row===t&&this.cancelEdit()}rowEditableCheck(t){t.getCells().forEach(t=>{t.column.modules.edit&&"function"==typeof t.column.modules.edit.check&&this.updateCellClass(t)})}initializeColumn(t){var e=Object.keys(t.definition).includes("editorEmptyValue"),i={editor:!1,blocked:!1,check:t.definition.editable,params:t.definition.editorParams||{},convertEmptyValues:e,editorEmptyValue:t.definition.editorEmptyValue,editorEmptyValueFunc:t.definition.editorEmptyValueFunc};i.editor=this.lookupEditor(t.definition.editor,t),i.editor&&(t.modules.edit=i)}lookupEditor(t,e){var i;switch(typeof t){case"string":this.editors[t]?i=this.editors[t]:console.warn("Editor Error - No such editor found: ",t);break;case"function":i=t;break;case"boolean":!0===t&&("function"!=typeof e.definition.formatter?i=this.editors[e.definition.formatter]?this.editors[e.definition.formatter]:this.editors.input:console.warn("Editor Error - Cannot auto lookup editor for a custom formatter: ",e.definition.formatter))}return i}getCurrentCell(){return!!this.currentCell&&this.currentCell.getComponent()}checkEditing(){return!!this.currentCell}cancelEditEvent(){return!!this.currentCell&&(this.cancelEdit(),!0)}clearEditor(t){var e,i=this.currentCell;if(this.invalidEdit=!1,i){for(this.currentCell=!1,e=i.getElement(),this.dispatch("edit-editor-clear",i,t),e.classList.remove("tabulator-editing");e.firstChild;)e.removeChild(e.firstChild);i.row.getElement().classList.remove("tabulator-editing"),i.table.element.classList.remove("tabulator-editing")}}cancelEdit(){if(this.currentCell){var t=this.currentCell,e=this.currentCell.getComponent();this.clearEditor(!0),t.setValueActual(t.getValue()),t.cellRendered(),("textarea"==t.column.definition.editor||t.column.definition.variableHeight)&&t.row.normalizeHeight(!0),t.column.definition.cellEditCancelled&&t.column.definition.cellEditCancelled.call(this.table,e),this.dispatch("edit-cancelled",t),this.dispatchExternal("cellEditCancelled",e)}}bindEditor(t){if(t.column.modules.edit){var e=this,i=t.getElement(!0);this.updateCellClass(t),i.setAttribute("tabindex",0),i.addEventListener("mousedown",function(t){2===t.button?t.preventDefault():e.mouseClick=!0}),"dblclick"===this.options("editTriggerEvent")&&i.addEventListener("dblclick",function(s){i.classList.contains("tabulator-editing")||(i.focus({preventScroll:!0}),e.edit(t,s,!1))}),"focus"!==this.options("editTriggerEvent")&&"click"!==this.options("editTriggerEvent")||i.addEventListener("click",function(s){i.classList.contains("tabulator-editing")||(i.focus({preventScroll:!0}),e.edit(t,s,!1))}),"focus"===this.options("editTriggerEvent")&&i.addEventListener("focus",function(i){e.recursionBlock||e.edit(t,i,!1)})}}focusCellNoEvent(t,e){this.recursionBlock=!0,e&&"ie"===this.table.browser||t.getElement().focus({preventScroll:!0}),this.recursionBlock=!1}editCell(t,e){this.focusCellNoEvent(t),this.edit(t,!1,e)}focusScrollAdjust(t){if("virtual"==this.table.rowManager.getRenderMode()){var e=this.table.rowManager.element.scrollTop,i=this.table.rowManager.element.clientHeight+this.table.rowManager.element.scrollTop,s=t.row.getElement();s.offsetTop<e?this.table.rowManager.element.scrollTop-=e-s.offsetTop:s.offsetTop+s.offsetHeight>i&&(this.table.rowManager.element.scrollTop+=s.offsetTop+s.offsetHeight-i);var n=this.table.rowManager.element.scrollLeft,o=this.table.rowManager.element.clientWidth+this.table.rowManager.element.scrollLeft,r=t.getElement();this.table.modExists("frozenColumns")&&(n+=parseInt(this.table.modules.frozenColumns.leftMargin||0),o-=parseInt(this.table.modules.frozenColumns.rightMargin||0)),"virtual"===this.table.options.renderHorizontal&&(n-=parseInt(this.table.columnManager.renderer.vDomPadLeft),o-=parseInt(this.table.columnManager.renderer.vDomPadLeft)),r.offsetLeft<n?this.table.rowManager.element.scrollLeft-=n-r.offsetLeft:r.offsetLeft+r.offsetWidth>o&&(this.table.rowManager.element.scrollLeft+=r.offsetLeft+r.offsetWidth-o)}}allowEdit(t){var e=!!t.column.modules.edit;if(t.column.modules.edit)switch(typeof t.column.modules.edit.check){case"function":t.row.initialized&&(e=t.column.modules.edit.check(t.getComponent()));break;case"string":e=!!t.row.data[t.column.modules.edit.check];break;case"boolean":e=t.column.modules.edit.check}return e}edit(t,e,i){var s,n,o,r=this,a=function(){},l=t.getElement(),h=!1;if(!this.currentCell){if(t.column.modules.edit.blocked)return this.mouseClick=!1,this.blur(l),!1;if(this.allowEdit(t)||i){if(e&&e.stopPropagation(),r.cancelEdit(),r.currentCell=t,this.focusScrollAdjust(t),n=t.getComponent(),this.mouseClick&&(this.mouseClick=!1,t.column.definition.cellClick&&t.column.definition.cellClick.call(this.table,e,n)),t.column.definition.cellEditing&&t.column.definition.cellEditing.call(this.table,n),this.dispatch("cell-editing",t),this.dispatchExternal("cellEditing",n),o="function"==typeof t.column.modules.edit.params?t.column.modules.edit.params(n):t.column.modules.edit.params,s=t.column.modules.edit.editor.call(r,n,function(t){a=t},function(e){if(r.currentCell===t&&!h){var i=r.chain("edit-success",[t,e],!0,!0);return!0===i||"highlight"===r.table.options.validationMode?(h=!0,r.clearEditor(),t.modules.edit||(t.modules.edit={}),t.modules.edit.edited=!0,-1==r.editedCells.indexOf(t)&&r.editedCells.push(t),e=r.transformEmptyValues(e,t),t.setValue(e,!0),!0===i):(h=!0,r.invalidEdit=!0,r.focusCellNoEvent(t,!0),a(),setTimeout(()=>{h=!1},10),!1)}},function(){r.currentCell!==t||h||r.cancelEdit()},o),!this.currentCell||!1===s)return this.blur(l),!1;if(!(s instanceof Node))return console.warn("Edit Error - Editor should return an instance of Node, the editor returned:",s),this.blur(l),!1;for(l.classList.add("tabulator-editing"),t.row.getElement().classList.add("tabulator-editing"),t.table.element.classList.add("tabulator-editing");l.firstChild;)l.removeChild(l.firstChild);l.appendChild(s),a();for(var c=l.children,d=0;d<c.length;d++)c[d].addEventListener("click",function(t){t.stopPropagation()});return!0}return this.mouseClick=!1,this.blur(l),!1}this.invalidEdit||this.currentCell===t||this.cancelEdit()}emptyValueCheck(t){return""===t||null==t}transformEmptyValues(t,e){var i,s=e.column.modules.edit;return(s.convertEmptyValues||this.convertEmptyValues)&&(i=s.editorEmptyValueFunc||this.options("editorEmptyValueFunc"))&&i(t)&&(t=s.convertEmptyValues?s.editorEmptyValue:this.options("editorEmptyValue")),t}blur(t){this.confirm("edit-blur",[t])||t.blur()}getEditedCells(){var t=[];return this.editedCells.forEach(e=>{t.push(e.getComponent())}),t}clearEdited(t){var e;t.modules.edit&&t.modules.edit.edited&&(t.modules.edit.edited=!1,this.dispatch("edit-edited-clear",t)),(e=this.editedCells.indexOf(t))>-1&&this.editedCells.splice(e,1)}}class Aa{constructor(t,e,i,s){this.type=t,this.columns=e,this.component=i||!1,this.indent=s||0}}class za{constructor(t,e,i,s,n){this.value=t,this.component=e||!1,this.width=i,this.height=s,this.depth=n}}var Oa={},Fa={visible:function(){return this.rowManager.getVisibleRows(!1,!0)},all:function(){return this.rowManager.rows},selected:function(){return this.modules.selectRow.selectedRows},active:function(){return this.options.pagination?this.rowManager.getDisplayRows(this.rowManager.displayRows.length-2):this.rowManager.getDisplayRows()}};class Ha extends na{static moduleName="export";static columnLookups=Oa;static rowLookups=Fa;constructor(t){super(t),this.config={},this.cloneTableStyle=!0,this.colVisProp="",this.colVisPropAttach="",this.registerTableOption("htmlOutputConfig",!1),this.registerColumnOption("htmlOutput"),this.registerColumnOption("titleHtmlOutput")}initialize(){this.registerTableFunction("getHtml",this.getHtml.bind(this))}generateExportList(t,e,i,s){var n,o,r,a;return this.cloneTableStyle=e,this.config=t||{},this.colVisProp=s,this.colVisPropAttach=this.colVisProp.charAt(0).toUpperCase()+this.colVisProp.slice(1),(a=Ha.columnLookups[i])&&(r=(r=a.call(this.table)).filter(t=>this.columnVisCheck(t))),n=!1!==this.config.columnHeaders?this.headersToExportRows(this.generateColumnGroupHeaders(r)):[],r&&(r=r.map(t=>t.getComponent())),o=this.bodyToExportRows(this.rowLookup(i),r),n.concat(o)}generateTable(t,e,i,s){var n=this.generateExportList(t,e,i,s);return this.generateTableElement(n)}rowLookup(t){var e,i=[];return"function"==typeof t?t.call(this.table).forEach(t=>{(t=this.table.rowManager.findRow(t))&&i.push(t)}):(e=Ha.rowLookups[t]||Ha.rowLookups.active,i=e.call(this.table)),Object.assign([],i)}generateColumnGroupHeaders(t){var e=[];return t||(t=!1!==this.config.columnGroups?this.table.columnManager.columns:this.table.columnManager.columnsByIndex),t.forEach(t=>{var i=this.processColumnGroup(t);i&&e.push(i)}),e}processColumnGroup(t){var e=t.columns,i=0,s={title:t.definition["title"+this.colVisPropAttach]||t.definition.title,column:t,depth:1};if(e.length){if(s.subGroups=[],s.width=0,e.forEach(t=>{var e=this.processColumnGroup(t);e&&(s.width+=e.width,s.subGroups.push(e),e.depth>i&&(i=e.depth))}),s.depth+=i,!s.width)return!1}else{if(!this.columnVisCheck(t))return!1;s.width=1}return s}columnVisCheck(t){var e=t.definition[this.colVisProp];return(!1!==this.config.rowHeaders||!t.isRowHeader)&&("function"==typeof e&&(e=e.call(this.table,t.getComponent())),!1===e||!0===e?e:t.visible&&t.field)}headersToExportRows(t){var e=[],i=0,s=[];function n(t,s){var o=i-s;if(void 0===e[s]&&(e[s]=[]),t.height=t.subGroups?1:o-t.depth+1,e[s].push(t),t.height>1)for(let i=1;i<t.height;i++)void 0===e[s+i]&&(e[s+i]=[]),e[s+i].push(!1);if(t.width>1)for(let i=1;i<t.width;i++)e[s].push(!1);t.subGroups&&t.subGroups.forEach(function(t){n(t,s+1)})}return t.forEach(function(t){t.depth>i&&(i=t.depth)}),t.forEach(function(t){n(t,0)}),e.forEach(t=>{var e=[];t.forEach(t=>{if(t){let i=void 0===t.title?"":t.title;e.push(new za(i,t.column.getComponent(),t.width,t.height,t.depth))}else e.push(null)}),s.push(new Aa("header",e))}),s}bodyToExportRows(t,e=[]){var i=[];return 0===e.length&&this.table.columnManager.columnsByIndex.forEach(t=>{this.columnVisCheck(t)&&e.push(t.getComponent())}),!1!==this.config.columnCalcs&&this.table.modExists("columnCalcs")&&(this.table.modules.columnCalcs.topInitialized&&t.unshift(this.table.modules.columnCalcs.topRow),this.table.modules.columnCalcs.botInitialized&&t.push(this.table.modules.columnCalcs.botRow)),(t=t.filter(t=>{switch(t.type){case"group":return!1!==this.config.rowGroups;case"calc":return!1!==this.config.columnCalcs;case"row":return!(this.table.options.dataTree&&!1===this.config.dataTree&&t.modules.dataTree.parent)}return!0})).forEach((t,s)=>{var n=t.getData(this.colVisProp),o=[],r=0;switch(t.type){case"group":r=t.level,o.push(new za(t.key,t.getComponent(),e.length,1));break;case"calc":case"row":e.forEach(t=>{o.push(new za(t._column.getFieldValue(n),t,1,1))}),this.table.options.dataTree&&!1!==this.config.dataTree&&(r=t.modules.dataTree.index)}i.push(new Aa(t.type,o,t.getComponent(),r))}),i}generateTableElement(t){var e=document.createElement("table"),i=document.createElement("thead"),s=document.createElement("tbody"),n=this.lookupTableStyles(),o=this.table.options["rowFormatter"+this.colVisPropAttach],r={};return r.rowFormatter=null!==o?o:this.table.options.rowFormatter,this.table.options.dataTree&&!1!==this.config.dataTree&&this.table.modExists("columnCalcs")&&(r.treeElementField=this.table.modules.dataTree.elementField),r.groupHeader=this.table.options["groupHeader"+this.colVisPropAttach],r.groupHeader&&!Array.isArray(r.groupHeader)&&(r.groupHeader=[r.groupHeader]),e.classList.add("tabulator-print-table"),this.mapElementStyles(this.table.columnManager.getHeadersElement(),i,["border-top","border-left","border-right","border-bottom","background-color","color","font-weight","font-family","font-size"]),t.length>1e3&&console.warn("It may take a long time to render an HTML table with more than 1000 rows"),t.forEach((t,e)=>{let o;switch(t.type){case"header":i.appendChild(this.generateHeaderElement(t,r,n));break;case"group":s.appendChild(this.generateGroupElement(t,r,n));break;case"calc":s.appendChild(this.generateCalcElement(t,r,n));break;case"row":o=this.generateRowElement(t,r,n),this.mapElementStyles(e%2&&n.evenRow?n.evenRow:n.oddRow,o,["border-top","border-left","border-right","border-bottom","color","font-weight","font-family","font-size","background-color"]),s.appendChild(o)}}),i.innerHTML&&e.appendChild(i),e.appendChild(s),this.mapElementStyles(this.table.element,e,["border-top","border-left","border-right","border-bottom"]),e}lookupTableStyles(){var t={};return this.cloneTableStyle&&window.getComputedStyle&&(t.oddRow=this.table.element.querySelector(".tabulator-row-odd:not(.tabulator-group):not(.tabulator-calcs)"),t.evenRow=this.table.element.querySelector(".tabulator-row-even:not(.tabulator-group):not(.tabulator-calcs)"),t.calcRow=this.table.element.querySelector(".tabulator-row.tabulator-calcs"),t.firstRow=this.table.element.querySelector(".tabulator-row:not(.tabulator-group):not(.tabulator-calcs)"),t.firstGroup=this.table.element.getElementsByClassName("tabulator-group")[0],t.firstRow&&(t.styleCells=t.firstRow.getElementsByClassName("tabulator-cell"),t.styleRowHeader=t.firstRow.getElementsByClassName("tabulator-row-header")[0],t.firstCell=t.styleCells[0],t.lastCell=t.styleCells[t.styleCells.length-1])),t}generateHeaderElement(t,e,i){var s=document.createElement("tr");return t.columns.forEach(t=>{if(t){var e=document.createElement("th"),i=t.component._column.definition.cssClass?t.component._column.definition.cssClass.split(" "):[];e.colSpan=t.width,e.rowSpan=t.height,e.innerHTML=t.value,this.cloneTableStyle&&(e.style.boxSizing="border-box"),i.forEach(function(t){e.classList.add(t)}),this.mapElementStyles(t.component.getElement(),e,["text-align","border-left","border-right","background-color","color","font-weight","font-family","font-size"]),this.mapElementStyles(t.component._column.contentElement,e,["padding-top","padding-left","padding-right","padding-bottom"]),t.component._column.visible?this.mapElementStyles(t.component.getElement(),e,["width"]):t.component._column.definition.width&&(e.style.width=t.component._column.definition.width+"px"),t.component._column.parent&&t.component._column.parent.isGroup?this.mapElementStyles(t.component._column.parent.groupElement,e,["border-top"]):this.mapElementStyles(t.component.getElement(),e,["border-top"]),t.component._column.isGroup?this.mapElementStyles(t.component.getElement(),e,["border-bottom"]):this.mapElementStyles(this.table.columnManager.getElement(),e,["border-bottom"]),s.appendChild(e)}}),s}generateGroupElement(t,e,i){var s=document.createElement("tr"),n=document.createElement("td"),o=t.columns[0];return s.classList.add("tabulator-print-table-row"),e.groupHeader&&e.groupHeader[t.indent]?o.value=e.groupHeader[t.indent](o.value,t.component._group.getRowCount(),t.component._group.getData(),t.component):!1!==e.groupHeader&&(o.value=t.component._group.generator(o.value,t.component._group.getRowCount(),t.component._group.getData(),t.component)),n.colSpan=o.width,n.innerHTML=o.value,s.classList.add("tabulator-print-table-group"),s.classList.add("tabulator-group-level-"+t.indent),o.component.isVisible()&&s.classList.add("tabulator-group-visible"),this.mapElementStyles(i.firstGroup,s,["border-top","border-left","border-right","border-bottom","color","font-weight","font-family","font-size","background-color"]),this.mapElementStyles(i.firstGroup,n,["padding-top","padding-left","padding-right","padding-bottom"]),s.appendChild(n),s}generateCalcElement(t,e,i){var s=this.generateRowElement(t,e,i);return s.classList.add("tabulator-print-table-calcs"),this.mapElementStyles(i.calcRow,s,["border-top","border-left","border-right","border-bottom","color","font-weight","font-family","font-size","background-color"]),s}generateRowElement(t,e,i){var s=document.createElement("tr");return s.classList.add("tabulator-print-table-row"),t.columns.forEach((n,o)=>{if(n){var r,a,l=document.createElement("td"),h=n.component._column,c=this.table,d=c.columnManager.findColumnIndex(h),u=n.value,p={modules:{},getValue:function(){return u},getField:function(){return h.definition.field},getElement:function(){return l},getType:function(){return"cell"},getColumn:function(){return h.getComponent()},getData:function(){return t.component.getData()},getRow:function(){return t.component},getTable:function(){return c},getComponent:function(){return p},column:h};if((h.definition.cssClass?h.definition.cssClass.split(" "):[]).forEach(function(t){l.classList.add(t)}),this.table.modExists("format")&&!1!==this.config.formatCells)u=this.table.modules.format.formatExportValue(p,this.colVisProp);else switch(typeof u){case"object":u=null!==u?JSON.stringify(u):"";break;case"undefined":u=""}u instanceof Node?l.appendChild(u):l.innerHTML=u,a=["padding-top","padding-left","padding-right","padding-bottom","border-top","border-left","border-right","border-bottom","color","font-weight","font-family","font-size","text-align"],h.isRowHeader?(r=i.styleRowHeader,a.push("background-color")):r=i.styleCells&&i.styleCells[d]?i.styleCells[d]:i.firstCell,r&&(this.mapElementStyles(r,l,a),h.definition.align&&(l.style.textAlign=h.definition.align)),this.table.options.dataTree&&!1!==this.config.dataTree&&(e.treeElementField&&e.treeElementField==h.field||!e.treeElementField&&0==o)&&(t.component._row.modules.dataTree.controlEl&&l.insertBefore(t.component._row.modules.dataTree.controlEl.cloneNode(!0),l.firstChild),t.component._row.modules.dataTree.branchEl&&l.insertBefore(t.component._row.modules.dataTree.branchEl.cloneNode(!0),l.firstChild)),s.appendChild(l),p.modules.format&&p.modules.format.renderedCallback&&p.modules.format.renderedCallback()}}),e.rowFormatter&&"row"===t.type&&!1!==this.config.formatCells&&(Object.assign(t.component).getElement=function(){return s},e.rowFormatter(t.component)),s}generateHTMLTable(t){var e=document.createElement("div");return e.appendChild(this.generateTableElement(t)),e.innerHTML}getHtml(t,e,i,s){var n=this.generateExportList(i||this.table.options.htmlOutputConfig,e,t,s||"htmlOutput");return this.generateHTMLTable(n)}mapElementStyles(t,e,i){if(this.cloneTableStyle&&t&&e){var s={"background-color":"backgroundColor",color:"fontColor",width:"width","font-weight":"fontWeight","font-family":"fontFamily","font-size":"fontSize","text-align":"textAlign","border-top":"borderTop","border-left":"borderLeft","border-right":"borderRight","border-bottom":"borderBottom","padding-top":"paddingTop","padding-left":"paddingLeft","padding-right":"paddingRight","padding-bottom":"paddingBottom"};if(window.getComputedStyle){var n=window.getComputedStyle(t);i.forEach(function(t){e.style[s[t]]||(e.style[s[t]]=n.getPropertyValue(t))})}}}}var Ia={"=":function(t,e,i,s){return e==t},"<":function(t,e,i,s){return e<t},"<=":function(t,e,i,s){return e<=t},">":function(t,e,i,s){return e>t},">=":function(t,e,i,s){return e>=t},"!=":function(t,e,i,s){return e!=t},regex:function(t,e,i,s){return"string"==typeof t&&(t=new RegExp(t)),t.test(e)},like:function(t,e,i,s){return null==t?e===t:null!=e&&String(e).toLowerCase().indexOf(t.toLowerCase())>-1},keywords:function(t,e,i,s){var n=t.toLowerCase().split(void 0===s.separator?" ":s.separator),o=String(e??"").toLowerCase(),r=[];return n.forEach(t=>{o.includes(t)&&r.push(!0)}),s.matchAll?r.length===n.length:!!r.length},starts:function(t,e,i,s){return null==t?e===t:null!=e&&String(e).toLowerCase().startsWith(t.toLowerCase())},ends:function(t,e,i,s){return null==t?e===t:null!=e&&String(e).toLowerCase().endsWith(t.toLowerCase())},in:function(t,e,i,s){return Array.isArray(t)?!t.length||t.indexOf(e)>-1:(console.warn("Filter Error - filter value is not an array:",t),!1)},smart:function(t,e,i,s){const n=t.trim();if("."===n)return!(null===e||""==e);if("!"===n)return null===e||""==e;if(0===n.indexOf("<="))return this["<="](parseFloat(n.substring(2)),e,i,s);if(0===n.indexOf(">="))return this[">="](parseFloat(n.substring(2)),e,i,s);if(0===n.indexOf("<"))return this["<"](parseFloat(n.substring(1)),e,i,s);if(0===n.indexOf(">"))return this[">"](parseFloat(n.substring(1)),e,i,s);if(0===n.indexOf("="))return this["="](n.substring(1).trim(),e,i,s);if(n.includes(" ")){const t=n.split(/\s+/).filter(t=>t.length>0);if(t.length>1){const n=t.join(" AND ");return this.smarter(n,e,i,s)}}return this.like(n,e,i,s)},smarter:function(t,e,i,s){const n=t.trim();if(!n)return!0;const o=n.split(/\s+(AND|OR)\s+/i);if(1===o.length)return this.smart(n,e,i,s);let r=null,a=null;for(let t=0;t<o.length;t++){const n=o[t].trim();if("AND"===n||"OR"===n){a=n;continue}const l=this.smart(n,e,i,s);null===r?r=l:"AND"===a?r=r&&l:"OR"===a&&(r=r||l)}return null===r||r}};class Ba extends na{static moduleName="filter";static filters=Ia;constructor(t){super(t),this.filterList=[],this.headerFilters={},this.headerFilterColumns=[],this.prevHeaderFilterChangeCheck="",this.prevHeaderFilterChangeCheck="{}",this.changed=!1,this.tableInitialized=!1,this.registerTableOption("filterMode","local"),this.registerTableOption("initialFilter",!1),this.registerTableOption("initialHeaderFilter",!1),this.registerTableOption("headerFilterLiveFilterDelay",300),this.registerTableOption("placeholderHeaderFilter",!1),this.registerColumnOption("headerFilter"),this.registerColumnOption("headerFilterPlaceholder"),this.registerColumnOption("headerFilterParams"),this.registerColumnOption("headerFilterEmptyCheck"),this.registerColumnOption("headerFilterFunc"),this.registerColumnOption("headerFilterFuncParams"),this.registerColumnOption("headerFilterLiveFilter"),this.registerTableFunction("searchRows",this.searchRows.bind(this)),this.registerTableFunction("searchData",this.searchData.bind(this)),this.registerTableFunction("setFilter",this.userSetFilter.bind(this)),this.registerTableFunction("refreshFilter",this.userRefreshFilter.bind(this)),this.registerTableFunction("addFilter",this.userAddFilter.bind(this)),this.registerTableFunction("getFilters",this.getFilters.bind(this)),this.registerTableFunction("setHeaderFilterFocus",this.userSetHeaderFilterFocus.bind(this)),this.registerTableFunction("getHeaderFilterValue",this.userGetHeaderFilterValue.bind(this)),this.registerTableFunction("setHeaderFilterValue",this.userSetHeaderFilterValue.bind(this)),this.registerTableFunction("getHeaderFilters",this.getHeaderFilters.bind(this)),this.registerTableFunction("removeFilter",this.userRemoveFilter.bind(this)),this.registerTableFunction("clearFilter",this.userClearFilter.bind(this)),this.registerTableFunction("clearHeaderFilter",this.userClearHeaderFilter.bind(this)),this.registerComponentFunction("column","headerFilterFocus",this.setHeaderFilterFocus.bind(this)),this.registerComponentFunction("column","reloadHeaderFilter",this.reloadHeaderFilter.bind(this)),this.registerComponentFunction("column","getHeaderFilterValue",this.getHeaderFilterValue.bind(this)),this.registerComponentFunction("column","setHeaderFilterValue",this.setHeaderFilterValue.bind(this))}initialize(){this.subscribe("column-init",this.initializeColumnHeaderFilter.bind(this)),this.subscribe("column-width-fit-before",this.hideHeaderFilterElements.bind(this)),this.subscribe("column-width-fit-after",this.showHeaderFilterElements.bind(this)),this.subscribe("table-built",this.tableBuilt.bind(this)),this.subscribe("placeholder",this.generatePlaceholder.bind(this)),"remote"===this.table.options.filterMode&&this.subscribe("data-params",this.remoteFilterParams.bind(this)),this.registerDataHandler(this.filter.bind(this),10)}tableBuilt(){this.table.options.initialFilter&&this.setFilter(this.table.options.initialFilter),this.table.options.initialHeaderFilter&&this.table.options.initialHeaderFilter.forEach(t=>{var e=this.table.columnManager.findColumn(t.field);if(!e)return console.warn("Column Filter Error - No matching column found:",t.field),!1;this.setHeaderFilterValue(e,t.value)}),this.tableInitialized=!0}remoteFilterParams(t,e,i,s){return s.filter=this.getFilters(!0,!0),s}generatePlaceholder(t){if(this.table.options.placeholderHeaderFilter&&Object.keys(this.headerFilters).length)return this.table.options.placeholderHeaderFilter}userSetFilter(t,e,i,s){this.setFilter(t,e,i,s),this.refreshFilter()}userRefreshFilter(){this.refreshFilter()}userAddFilter(t,e,i,s){this.addFilter(t,e,i,s),this.refreshFilter()}userSetHeaderFilterFocus(t){var e=this.table.columnManager.findColumn(t);if(!e)return console.warn("Column Filter Focus Error - No matching column found:",t),!1;this.setHeaderFilterFocus(e)}userGetHeaderFilterValue(t){var e=this.table.columnManager.findColumn(t);if(e)return this.getHeaderFilterValue(e);console.warn("Column Filter Error - No matching column found:",t)}userSetHeaderFilterValue(t,e){var i=this.table.columnManager.findColumn(t);if(!i)return console.warn("Column Filter Error - No matching column found:",t),!1;this.setHeaderFilterValue(i,e)}userRemoveFilter(t,e,i){this.removeFilter(t,e,i),this.refreshFilter()}userClearFilter(t){this.clearFilter(t),this.refreshFilter()}userClearHeaderFilter(){this.clearHeaderFilter(),this.refreshFilter()}searchRows(t,e,i){return this.search("rows",t,e,i)}searchData(t,e,i){return this.search("data",t,e,i)}initializeColumnHeaderFilter(t){t.definition.headerFilter&&this.initializeColumn(t)}initializeColumn(t,e){var i=this,s=t.getField();t.modules.filter={success:function(e){var n,o="input"==t.modules.filter.tagType&&"text"==t.modules.filter.attrType||"textarea"==t.modules.filter.tagType?"partial":"match",r="",a="";if(void 0===t.modules.filter.prevSuccess||t.modules.filter.prevSuccess!==e){if(t.modules.filter.prevSuccess=e,t.modules.filter.emptyFunc(e))delete i.headerFilters[s];else{switch(t.modules.filter.value=e,typeof t.definition.headerFilterFunc){case"string":Ba.filters[t.definition.headerFilterFunc]?(r=t.definition.headerFilterFunc,n=function(i){var s=t.definition.headerFilterFuncParams||{},n=t.getFieldValue(i);return s="function"==typeof s?s(e,n,i):s,Ba.filters[t.definition.headerFilterFunc](e,n,i,s)}):console.warn("Header Filter Error - Matching filter function not found: ",t.definition.headerFilterFunc);break;case"function":r=n=function(i){var s=t.definition.headerFilterFuncParams||{},n=t.getFieldValue(i);return s="function"==typeof s?s(e,n,i):s,t.definition.headerFilterFunc(e,n,i,s)}}n||("partial"===o?(n=function(i){var s=t.getFieldValue(i);return null!=s&&String(s).toLowerCase().indexOf(String(e).toLowerCase())>-1},r="like"):(n=function(i){return t.getFieldValue(i)==e},r="=")),i.headerFilters[s]={value:e,func:n,type:r}}t.modules.filter.value=e,a=JSON.stringify(i.headerFilters),i.prevHeaderFilterChangeCheck!==a&&(i.prevHeaderFilterChangeCheck=a,i.trackChanges(),i.refreshFilter())}return!0},attrType:!1,tagType:!1,emptyFunc:!1},this.generateHeaderFilterElement(t)}generateHeaderFilterElement(t,e,i){var s,n,o,r,a,l,h,c,d=this,u=t.modules.filter.success,p=t.getField();if(t.modules.filter.value=e,t.modules.filter.headerElement&&t.modules.filter.headerElement.parentNode&&t.contentElement.removeChild(t.modules.filter.headerElement.parentNode),p){switch(t.modules.filter.emptyFunc=t.definition.headerFilterEmptyCheck||function(t){return!t&&0!==t},(s=document.createElement("div")).classList.add("tabulator-header-filter"),typeof t.definition.headerFilter){case"string":d.table.modules.edit.editors[t.definition.headerFilter]?(n=d.table.modules.edit.editors[t.definition.headerFilter],"tick"!==t.definition.headerFilter&&"tickCross"!==t.definition.headerFilter||t.definition.headerFilterEmptyCheck||(t.modules.filter.emptyFunc=function(t){return!0!==t&&!1!==t})):console.warn("Filter Error - Cannot build header filter, No such editor found: ",t.definition.editor);break;case"function":n=t.definition.headerFilter;break;case"boolean":t.modules.edit&&t.modules.edit.editor?n=t.modules.edit.editor:t.definition.formatter&&d.table.modules.edit.editors[t.definition.formatter]?(n=d.table.modules.edit.editors[t.definition.formatter],"tick"!==t.definition.formatter&&"tickCross"!==t.definition.formatter||t.definition.headerFilterEmptyCheck||(t.modules.filter.emptyFunc=function(t){return!0!==t&&!1!==t})):n=d.table.modules.edit.editors.input}if(n){if(r={getValue:function(){return void 0!==e?e:""},getField:function(){return t.definition.field},getElement:function(){return s},getColumn:function(){return t.getComponent()},getTable:()=>this.table,getType:()=>"header",getRow:function(){return{normalizeHeight:function(){}}}},h="function"==typeof(h=t.definition.headerFilterParams||{})?h.call(d.table,r):h,o=n.call(this.table.modules.edit,r,function(t){c=t},u,function(){},h),!o)return void console.warn("Filter Error - Cannot add filter to "+p+" column, editor returned a value of false");if(!(o instanceof Node))return void console.warn("Filter Error - Cannot add filter to "+p+" column, editor should return an instance of Node, the editor returned:",o);d.langBind("headerFilters|columns|"+t.definition.field,function(e){o.setAttribute("placeholder",void 0!==e&&e?e:t.definition.headerFilterPlaceholder||d.langText("headerFilters|default"))}),o.addEventListener("click",function(t){t.stopPropagation(),o.focus()}),o.addEventListener("focus",t=>{var e=this.table.columnManager.contentsElement.scrollLeft;e!==this.table.rowManager.element.scrollLeft&&(this.table.rowManager.scrollHorizontal(e),this.table.columnManager.scrollHorizontal(e))}),a=!1,l=function(t){a&&clearTimeout(a),a=setTimeout(function(){u(o.value)},d.table.options.headerFilterLiveFilterDelay)},t.modules.filter.headerElement=o,t.modules.filter.attrType=o.hasAttribute("type")?o.getAttribute("type").toLowerCase():"",t.modules.filter.tagType=o.tagName.toLowerCase(),!1!==t.definition.headerFilterLiveFilter&&("autocomplete"!==t.definition.headerFilter&&"tickCross"!==t.definition.headerFilter&&("autocomplete"!==t.definition.editor&&"tickCross"!==t.definition.editor||!0!==t.definition.headerFilter)&&(o.addEventListener("keyup",l),o.addEventListener("search",l),"number"==t.modules.filter.attrType&&o.addEventListener("change",function(t){u(o.value)}),"text"==t.modules.filter.attrType&&"ie"!==this.table.browser&&o.setAttribute("type","search")),"input"!=t.modules.filter.tagType&&"select"!=t.modules.filter.tagType&&"textarea"!=t.modules.filter.tagType||o.addEventListener("mousedown",function(t){t.stopPropagation()})),s.appendChild(o),t.contentElement.appendChild(s),i||d.headerFilterColumns.push(t),c&&c()}}else console.warn("Filter Error - Cannot add header filter, column has no field set:",t.definition.title)}hideHeaderFilterElements(){this.headerFilterColumns.forEach(function(t){t.modules.filter&&t.modules.filter.headerElement&&(t.modules.filter.headerElement.style.display="none")})}showHeaderFilterElements(){this.headerFilterColumns.forEach(function(t){t.modules.filter&&t.modules.filter.headerElement&&(t.modules.filter.headerElement.style.display="")})}setHeaderFilterFocus(t){t.modules.filter&&t.modules.filter.headerElement?t.modules.filter.headerElement.focus():console.warn("Column Filter Focus Error - No header filter set on column:",t.getField())}getHeaderFilterValue(t){if(t.modules.filter&&t.modules.filter.headerElement)return t.modules.filter.value;console.warn("Column Filter Error - No header filter set on column:",t.getField())}setHeaderFilterValue(t,e){t&&(t.modules.filter&&t.modules.filter.headerElement?(this.generateHeaderFilterElement(t,e,!0),t.modules.filter.success(e)):console.warn("Column Filter Error - No header filter set on column:",t.getField()))}reloadHeaderFilter(t){t&&(t.modules.filter&&t.modules.filter.headerElement?this.generateHeaderFilterElement(t,t.modules.filter.value,!0):console.warn("Column Filter Error - No header filter set on column:",t.getField()))}refreshFilter(){this.tableInitialized&&("remote"===this.table.options.filterMode?this.reloadData(null,!1,!1):this.refreshData(!0))}trackChanges(){this.changed=!0,this.dispatch("filter-changed")}hasChanged(){var t=this.changed;return this.changed=!1,t}setFilter(t,e,i,s){this.filterList=[],Array.isArray(t)||(t=[{field:t,type:e,value:i,params:s}]),this.addFilter(t)}addFilter(t,e,i,s){var n=!1;Array.isArray(t)||(t=[{field:t,type:e,value:i,params:s}]),t.forEach(t=>{(t=this.findFilter(t))&&(this.filterList.push(t),n=!0)}),n&&this.trackChanges()}findFilter(t){var e;if(Array.isArray(t))return this.findSubFilters(t);var i=!1;return"function"==typeof t.field?i=function(e){return t.field(e,t.type||{})}:Ba.filters[t.type]?i=(e=this.table.columnManager.getColumnByField(t.field))?function(i){return Ba.filters[t.type](t.value,e.getFieldValue(i),i,t.params||{})}:function(e){return Ba.filters[t.type](t.value,e[t.field],e,t.params||{})}:console.warn("Filter Error - No such filter type found, ignoring: ",t.type),t.func=i,!!t.func&&t}findSubFilters(t){var e=[];return t.forEach(t=>{(t=this.findFilter(t))&&e.push(t)}),!!e.length&&e}getFilters(t,e){var i=[];return t&&(i=this.getHeaderFilters()),e&&i.forEach(function(t){"function"==typeof t.type&&(t.type="function")}),i.concat(this.filtersToArray(this.filterList,e))}filtersToArray(t,e){var i=[];return t.forEach(t=>{var s;Array.isArray(t)?i.push(this.filtersToArray(t,e)):(s={field:t.field,type:t.type,value:t.value},e&&"function"==typeof s.type&&(s.type="function"),i.push(s))}),i}getHeaderFilters(){var t=[];for(var e in this.headerFilters)t.push({field:e,type:this.headerFilters[e].type,value:this.headerFilters[e].value});return t}removeFilter(t,e,i){Array.isArray(t)||(t=[{field:t,type:e,value:i}]),t.forEach(t=>{var e;(e="object"==typeof t.field?this.filterList.findIndex(e=>t===e):this.filterList.findIndex(e=>t.field===e.field&&t.type===e.type&&t.value===e.value))>-1?this.filterList.splice(e,1):console.warn("Filter Error - No matching filter type found, ignoring: ",t.type)}),this.trackChanges()}clearFilter(t){this.filterList=[],t&&this.clearHeaderFilter(),this.trackChanges()}clearHeaderFilter(){this.headerFilters={},this.prevHeaderFilterChangeCheck="{}",this.headerFilterColumns.forEach(t=>{void 0!==t.modules.filter.value&&delete t.modules.filter.value,t.modules.filter.prevSuccess=void 0,this.reloadHeaderFilter(t)}),this.trackChanges()}search(t,e,i,s){var n=[],o=[];return Array.isArray(e)||(e=[{field:e,type:i,value:s}]),e.forEach(t=>{(t=this.findFilter(t))&&o.push(t)}),this.table.rowManager.rows.forEach(e=>{var i=!0;o.forEach(t=>{this.filterRecurse(t,e.getData())||(i=!1)}),i&&n.push("data"===t?e.getData("data"):e.getComponent())}),n}filter(t,e){var i=[],s=[];return this.subscribedExternal("dataFiltering")&&this.dispatchExternal("dataFiltering",this.getFilters(!0)),"remote"!==this.table.options.filterMode&&(this.filterList.length||Object.keys(this.headerFilters).length)?t.forEach(t=>{this.filterRow(t)&&i.push(t)}):i=t.slice(0),this.subscribedExternal("dataFiltered")&&(i.forEach(t=>{s.push(t.getComponent())}),this.dispatchExternal("dataFiltered",this.getFilters(!0),s)),i}filterRow(t,e){var i=!0,s=t.getData();for(var n in this.filterList.forEach(t=>{this.filterRecurse(t,s)||(i=!1)}),this.headerFilters)this.headerFilters[n].func(s)||(i=!1);return i}filterRecurse(t,e){var i=!1;return Array.isArray(t)?t.forEach(t=>{this.filterRecurse(t,e)&&(i=!0)}):i=t.func(e),i}}var Va={plaintext:function(t,e,i){return this.emptyToSpace(this.sanitizeHTML(t.getValue()))},html:function(t,e,i){return t.getValue()},textarea:function(t,e,i){return t.getElement().style.whiteSpace="pre-wrap",this.emptyToSpace(this.sanitizeHTML(t.getValue()))},money:function(t,e,i){var s,n,o,r,a,l=parseFloat(t.getValue()),h="",c=e.decimal||".",d=e.thousand||",",u=e.negativeSign||"-",p=e.symbol||"",m=!!e.symbolAfter,g=void 0!==e.precision?e.precision:2;if(Number.isNaN(l))return this.emptyToSpace(this.sanitizeHTML(t.getValue()));if(l<0&&(l=Math.abs(l),h=u),s=!1!==g?l.toFixed(g):l,n=(s=String(s).split("."))[0],o=s.length>1?c+s[1]:"",!1!==e.thousand)for(r=/(\d+)(\d{3})/;r.test(n);)n=n.replace(r,"$1"+d+"$2");return a=n+o,!0===h?(a="("+a+")",m?a+p:p+a):m?h+a+p:h+p+a},link:function(t,e,i){var s,n=t.getValue(),o=e.urlPrefix||"",r=e.download,a=n,l=document.createElement("a");if(e.labelField&&(s=t.getData(),a=function t(e,i){var s=i[e.shift()];return e.length&&"object"==typeof s?t(e,s):s}(e.labelField.split(this.table.options.nestedFieldSeparator),s)),e.label)switch(typeof e.label){case"string":a=e.label;break;case"function":a=e.label(t)}if(a){if(e.urlField&&(s=t.getData(),n=ia.retrieveNestedData(this.table.options.nestedFieldSeparator,e.urlField,s)),e.url)switch(typeof e.url){case"string":n=e.url;break;case"function":n=e.url(t)}return l.setAttribute("href",o+n),e.target&&l.setAttribute("target",e.target),e.download&&(r="function"==typeof r?r(t):!0===r?"":r,l.setAttribute("download",r)),l.innerHTML=this.emptyToSpace(this.sanitizeHTML(a)),l}return"&nbsp;"},image:function(t,e,i){var s=document.createElement("img"),n=t.getValue();switch(e.urlPrefix&&(n=e.urlPrefix+t.getValue()),e.urlSuffix&&(n+=e.urlSuffix),s.setAttribute("src",n),typeof e.height){case"number":s.style.height=e.height+"px";break;case"string":s.style.height=e.height}switch(typeof e.width){case"number":s.style.width=e.width+"px";break;case"string":s.style.width=e.width}return s.addEventListener("load",function(){t.getRow().normalizeHeight()}),s},tickCross:function(t,e,i){var s=t.getValue(),n=t.getElement(),o=e.allowEmpty,r=e.allowTruthy,a=Object.keys(e).includes("trueValue"),l=void 0!==e.tickElement?e.tickElement:'<svg enable-background="new 0 0 24 24" height="14" width="14" viewBox="0 0 24 24" xml:space="preserve" ><path class="tabulator-tick" clip-rule="evenodd" d="M21.652,3.211c-0.293-0.295-0.77-0.295-1.061,0L9.41,14.34  c-0.293,0.297-0.771,0.297-1.062,0L3.449,9.351C3.304,9.203,3.114,9.13,2.923,9.129C2.73,9.128,2.534,9.201,2.387,9.351  l-2.165,1.946C0.078,11.445,0,11.63,0,11.823c0,0.194,0.078,0.397,0.223,0.544l4.94,5.184c0.292,0.296,0.771,0.776,1.062,1.07  l2.124,2.141c0.292,0.293,0.769,0.293,1.062,0l14.366-14.34c0.293-0.294,0.293-0.777,0-1.071L21.652,3.211z" fill-rule="evenodd"/></svg>',h=void 0!==e.crossElement?e.crossElement:'<svg enable-background="new 0 0 24 24" height="14" width="14"  viewBox="0 0 24 24" xml:space="preserve" ><path class="tabulator-cross" d="M22.245,4.015c0.313,0.313,0.313,0.826,0,1.139l-6.276,6.27c-0.313,0.312-0.313,0.826,0,1.14l6.273,6.272  c0.313,0.313,0.313,0.826,0,1.14l-2.285,2.277c-0.314,0.312-0.828,0.312-1.142,0l-6.271-6.271c-0.313-0.313-0.828-0.313-1.141,0  l-6.276,6.267c-0.313,0.313-0.828,0.313-1.141,0l-2.282-2.28c-0.313-0.313-0.313-0.826,0-1.14l6.278-6.269  c0.313-0.312,0.313-0.826,0-1.14L1.709,5.147c-0.314-0.313-0.314-0.827,0-1.14l2.284-2.278C4.308,1.417,4.821,1.417,5.135,1.73  L11.405,8c0.314,0.314,0.828,0.314,1.141,0.001l6.276-6.267c0.312-0.312,0.826-0.312,1.141,0L22.245,4.015z"/></svg>';return a&&s===e.trueValue||!a&&(r&&s||!0===s||"true"===s||"True"===s||1===s||"1"===s)?(n.setAttribute("aria-checked",!0),l||""):!o||"null"!==s&&""!==s&&null!=s?(n.setAttribute("aria-checked",!1),h||""):(n.setAttribute("aria-checked","mixed"),"")},datetime:function(t,e,i){var s,n=this.table.dependencyRegistry.lookup(["luxon","DateTime"],"DateTime"),o=e.inputFormat||"yyyy-MM-dd HH:mm:ss",r=e.outputFormat||"dd/MM/yyyy HH:mm:ss",a=void 0!==e.invalidPlaceholder?e.invalidPlaceholder:"",l=t.getValue();if(void 0!==n)return(s=n.isDateTime(l)?l:"x"===o?n.fromMillis(l):"iso"===o?n.fromISO(String(l)):n.fromFormat(String(l),o)).isValid?(e.timezone&&(s=s.setZone(e.timezone)),s.toFormat(r)):!0!==a&&l?"function"==typeof a?a(l):a:l;console.error("Format Error - 'datetime' formatter is dependant on luxon.js")},datetimediff:function(t,e,i){var s,n=this.table.dependencyRegistry.lookup(["luxon","DateTime"],"DateTime"),o=e.inputFormat||"yyyy-MM-dd HH:mm:ss",r=void 0!==e.invalidPlaceholder?e.invalidPlaceholder:"",a=void 0!==e.suffix&&e.suffix,l=void 0!==e.unit?e.unit:"days",h=void 0!==e.humanize&&e.humanize,c=void 0!==e.date?e.date:n.now(),d=t.getValue();if(void 0!==n)return(s=n.isDateTime(d)?d:"x"===o?n.fromMillis(d):"iso"===o?n.fromISO(String(d)):n.fromFormat(String(d),o)).isValid?h?s.diff(c,l).toHuman()+(a?" "+a:""):parseInt(s.diff(c,l)[l])+(a?" "+a:""):!0===r?d:"function"==typeof r?r(d):r;console.error("Format Error - 'datetimediff' formatter is dependant on luxon.js")},lookup:function(t,e,i){var s=t.getValue();return void 0===e[s]?(console.warn("Missing display value for "+s),s):e[s]},star:function(t,e,i){var s=t.getValue(),n=t.getElement(),o=e&&e.stars?e.stars:5,r=document.createElement("span"),a=document.createElementNS("http://www.w3.org/2000/svg","svg");r.style.verticalAlign="middle",a.setAttribute("width","14"),a.setAttribute("height","14"),a.setAttribute("viewBox","0 0 512 512"),a.setAttribute("xml:space","preserve"),a.style.padding="0 1px",s=s&&!Number.isNaN(s)?parseInt(s):0,s=Math.max(0,Math.min(s,o));for(var l=1;l<=o;l++){var h=a.cloneNode(!0);h.innerHTML=l<=s?'<polygon fill="#FFEA00" stroke="#C1AB60" stroke-width="37.6152" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" points="259.216,29.942 330.27,173.919 489.16,197.007 374.185,309.08 401.33,467.31 259.216,392.612 117.104,467.31 144.25,309.08 29.274,197.007 188.165,173.919 "/>':'<polygon fill="#D2D2D2" stroke="#686868" stroke-width="37.6152" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" points="259.216,29.942 330.27,173.919 489.16,197.007 374.185,309.08 401.33,467.31 259.216,392.612 117.104,467.31 144.25,309.08 29.274,197.007 188.165,173.919 "/>',r.appendChild(h)}return n.style.whiteSpace="nowrap",n.style.overflow="hidden",n.style.textOverflow="ellipsis",n.setAttribute("aria-label",s),r},traffic:function(t,e,i){var s,n,o=this.sanitizeHTML(t.getValue())||0,r=document.createElement("span"),a=e&&e.max?e.max:100,l=e&&e.min?e.min:0,h=e&&void 0!==e.color?e.color:["red","orange","green"],c="#666666";if(!Number.isNaN(o)&&void 0!==t.getValue()){switch(r.classList.add("tabulator-traffic-light"),n=parseFloat(o)<=a?parseFloat(o):a,n=parseFloat(n)>=l?parseFloat(n):l,s=(a-l)/100,n=Math.round((n-l)/s),typeof h){case"string":c=h;break;case"function":c=h(o);break;case"object":if(Array.isArray(h)){var d=100/h.length,u=Math.floor(n/d);u=Math.min(u,h.length-1),c=h[u=Math.max(u,0)];break}}return r.style.backgroundColor=c,r}},progress:function(t,e={},i){var s,n,o,r,a,l=this.sanitizeHTML(t.getValue())||0,h=t.getElement(),c=e.max?e.max:100,d=e.min?e.min:0,u=e.legendAlign?e.legendAlign:"center";switch(n=parseFloat(l)<=c?parseFloat(l):c,n=parseFloat(n)>=d?parseFloat(n):d,s=(c-d)/100,n=Math.round((n-d)/s),typeof e.color){case"string":o=e.color;break;case"function":o=e.color(l);break;case"object":if(Array.isArray(e.color)){let t=100/e.color.length,i=Math.floor(n/t);i=Math.min(i,e.color.length-1),i=Math.max(i,0),o=e.color[i];break}default:o="#2DC214"}switch(typeof e.legend){case"string":r=e.legend;break;case"function":r=e.legend(l);break;case"boolean":r=l;break;default:r=!1}switch(typeof e.legendColor){case"string":a=e.legendColor;break;case"function":a=e.legendColor(l);break;case"object":if(Array.isArray(e.legendColor)){let t=100/e.legendColor.length,i=Math.floor(n/t);i=Math.min(i,e.legendColor.length-1),i=Math.max(i,0),a=e.legendColor[i]}break;default:a="#000"}h.style.minWidth="30px",h.style.position="relative",h.setAttribute("aria-label",n);var p=document.createElement("div");p.style.display="inline-block",p.style.width=n+"%",p.style.backgroundColor=o,p.style.height="100%",p.setAttribute("data-max",c),p.setAttribute("data-min",d);var m=document.createElement("div");if(m.style.position="relative",m.style.width="100%",m.style.height="100%",r){var g=document.createElement("div");g.style.position="absolute",g.style.top=0,g.style.left=0,g.style.textAlign=u,g.style.width="100%",g.style.color=a,g.innerHTML=r}return i(function(){if(!(t instanceof ya)){var e=document.createElement("div");e.style.position="absolute",e.style.top="4px",e.style.bottom="4px",e.style.left="4px",e.style.right="4px",h.appendChild(e),h=e}h.appendChild(m),m.appendChild(p),r&&m.appendChild(g)}),""},color:function(t,e,i){return t.getElement().style.backgroundColor=this.sanitizeHTML(t.getValue()),""},buttonTick:function(t,e,i){return'<svg enable-background="new 0 0 24 24" height="14" width="14" viewBox="0 0 24 24" xml:space="preserve" ><path fill="#2DC214" clip-rule="evenodd" d="M21.652,3.211c-0.293-0.295-0.77-0.295-1.061,0L9.41,14.34  c-0.293,0.297-0.771,0.297-1.062,0L3.449,9.351C3.304,9.203,3.114,9.13,2.923,9.129C2.73,9.128,2.534,9.201,2.387,9.351  l-2.165,1.946C0.078,11.445,0,11.63,0,11.823c0,0.194,0.078,0.397,0.223,0.544l4.94,5.184c0.292,0.296,0.771,0.776,1.062,1.07  l2.124,2.141c0.292,0.293,0.769,0.293,1.062,0l14.366-14.34c0.293-0.294,0.293-0.777,0-1.071L21.652,3.211z" fill-rule="evenodd"/></svg>'},buttonCross:function(t,e,i){return'<svg enable-background="new 0 0 24 24" height="14" width="14" viewBox="0 0 24 24" xml:space="preserve" ><path fill="#CE1515" d="M22.245,4.015c0.313,0.313,0.313,0.826,0,1.139l-6.276,6.27c-0.313,0.312-0.313,0.826,0,1.14l6.273,6.272  c0.313,0.313,0.313,0.826,0,1.14l-2.285,2.277c-0.314,0.312-0.828,0.312-1.142,0l-6.271-6.271c-0.313-0.313-0.828-0.313-1.141,0  l-6.276,6.267c-0.313,0.313-0.828,0.313-1.141,0l-2.282-2.28c-0.313-0.313-0.313-0.826,0-1.14l6.278-6.269  c0.313-0.312,0.313-0.826,0-1.14L1.709,5.147c-0.314-0.313-0.314-0.827,0-1.14l2.284-2.278C4.308,1.417,4.821,1.417,5.135,1.73  L11.405,8c0.314,0.314,0.828,0.314,1.141,0.001l6.276-6.267c0.312-0.312,0.826-0.312,1.141,0L22.245,4.015z"/></svg>'},toggle:function(t,e,i){var s,n,o=t.getValue(),r=e.size||15,a=r+"px",l=!e.hasOwnProperty("onValue")||e.onValue,h=!!e.hasOwnProperty("offValue")&&e.offValue,c=e.onTruthy?o:o===l;return(s=document.createElement("div")).classList.add("tabulator-toggle"),c?(s.classList.add("tabulator-toggle-on"),s.style.flexDirection="row-reverse",e.onColor&&(s.style.background=e.onColor)):e.offColor&&(s.style.background=e.offColor),s.style.width=2.5*r+"px",s.style.borderRadius=a,e.clickable&&s.addEventListener("click",e=>{t.setValue(c?h:l)}),(n=document.createElement("div")).classList.add("tabulator-toggle-switch"),n.style.height=a,n.style.width=a,n.style.borderRadius=a,s.appendChild(n),s},rownum:function(t,e,i){var s=document.createElement("span"),n=t.getRow(),o=t.getTable();return n.watchPosition(t=>{e.relativeToPage&&(t+=o.modules.page.getPageSize()*(o.modules.page.getPage()-1)),s.innerText=t}),s},handle:function(t,e,i){return t.getElement().classList.add("tabulator-row-handle"),"<div class='tabulator-row-handle-box'><div class='tabulator-row-handle-bar'></div><div class='tabulator-row-handle-bar'></div><div class='tabulator-row-handle-bar'></div></div>"},adaptable:function(t,e,i){var s,n;return s=e.formatterLookup?e.formatterLookup(t):function(t){var e=t.getValue(),i="plaintext";switch(typeof e){case"boolean":i="tickCross";break;case"string":e.includes("\n")&&(i="textarea")}return i}(t),e.paramsLookup&&(n="function"==typeof e.paramsLookup?e.paramsLookup(s,t):e.paramsLookup[s]),this.table.modules.format.lookupFormatter(s).call(this,t,n||{},i)},array:function(t,e,i){var s,n=e.delimiter||",",o=t.getValue(),r=this.table;return e.valueMap&&(s="string"==typeof e.valueMap?function(t){return t.map(t=>ia.retrieveNestedData(r.options.nestedFieldSeparator,e.valueMap,t))}:e.valueMap),Array.isArray(o)?(s&&(o=s(o)),o.join(n)):o},json:function(t,e,i){var s=e.indent||"\t",n=void 0===e.multiline||e.multiline,o=e.replacer||null,r=t.getValue();return n&&(t.getElement().style.whiteSpace="pre-wrap"),JSON.stringify(r,o,s)}};class Wa extends na{static moduleName="format";static formatters=Va;constructor(t){super(t),this.registerColumnOption("formatter"),this.registerColumnOption("formatterParams"),this.registerColumnOption("formatterPrint"),this.registerColumnOption("formatterPrintParams"),this.registerColumnOption("formatterClipboard"),this.registerColumnOption("formatterClipboardParams"),this.registerColumnOption("formatterHtmlOutput"),this.registerColumnOption("formatterHtmlOutputParams"),this.registerColumnOption("titleFormatter"),this.registerColumnOption("titleFormatterParams")}initialize(){this.subscribe("cell-format",this.formatValue.bind(this)),this.subscribe("cell-rendered",this.cellRendered.bind(this)),this.subscribe("column-layout",this.initializeColumn.bind(this)),this.subscribe("column-format",this.formatHeader.bind(this))}initializeColumn(t){t.modules.format=this.lookupTypeFormatter(t,""),void 0!==t.definition.formatterPrint&&(t.modules.format.print=this.lookupTypeFormatter(t,"Print")),void 0!==t.definition.formatterClipboard&&(t.modules.format.clipboard=this.lookupTypeFormatter(t,"Clipboard")),void 0!==t.definition.formatterHtmlOutput&&(t.modules.format.htmlOutput=this.lookupTypeFormatter(t,"HtmlOutput"))}lookupTypeFormatter(t,e){var i={params:t.definition["formatter"+e+"Params"]||{}},s=t.definition["formatter"+e];return i.formatter=this.lookupFormatter(s),i}lookupFormatter(t){var e;switch(typeof t){case"string":Wa.formatters[t]?e=Wa.formatters[t]:(console.warn("Formatter Error - No such formatter found: ",t),e=Wa.formatters.plaintext);break;case"function":e=t;break;default:e=Wa.formatters.plaintext}return e}cellRendered(t){t.modules.format&&t.modules.format.renderedCallback&&!t.modules.format.rendered&&(t.modules.format.renderedCallback(),t.modules.format.rendered=!0)}formatHeader(t,e,i){var s,n,o,r;return t.definition.titleFormatter?(s=this.lookupFormatter(t.definition.titleFormatter),o=e=>{t.titleFormatterRendered=e},r={getValue:function(){return e},getElement:function(){return i},getType:function(){return"header"},getColumn:function(){return t.getComponent()},getTable:()=>this.table},n="function"==typeof(n=t.definition.titleFormatterParams||{})?n():n,s.call(this,r,n,o)):e}formatValue(t){var e=t.getComponent(),i="function"==typeof t.column.modules.format.params?t.column.modules.format.params(e):t.column.modules.format.params;return t.column.modules.format.formatter.call(this,e,i,function(e){t.modules.format||(t.modules.format={}),t.modules.format.renderedCallback=e,t.modules.format.rendered=!1})}formatExportValue(t,e){var i,s=t.column.modules.format[e];if(s){function n(e){t.modules.format||(t.modules.format={}),t.modules.format.renderedCallback=e,t.modules.format.rendered=!1}return i="function"==typeof s.params?s.params(t.getComponent()):s.params,s.formatter.call(this,t.getComponent(),i,n)}return this.formatValue(t)}sanitizeHTML(t){if(t){var e={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;","`":"&#x60;","=":"&#x3D;"};return String(t).replace(/[&<>"'`=/]/g,function(t){return e[t]})}return t}emptyToSpace(t){return null==t||""===t?"&nbsp;":t}}class Ga{constructor(t){return this._group=t,this.type="GroupComponent",new Proxy(this,{get:function(t,e,i){return void 0!==t[e]?t[e]:t._group.groupManager.table.componentFunctionBinder.handle("group",t._group,e)}})}getKey(){return this._group.key}getField(){return this._group.field}getElement(){return this._group.element}getRows(){return this._group.getRows(!0)}getSubGroups(){return this._group.getSubGroups(!0)}getParentGroup(){return!!this._group.parent&&this._group.parent.getComponent()}isVisible(){return this._group.visible}show(){this._group.show()}hide(){this._group.hide()}toggle(){this._group.toggleVisibility()}scrollTo(t,e){return this._group.groupManager.table.rowManager.scrollToRow(this._group,t,e)}_getSelf(){return this._group}getTable(){return this._group.groupManager.table}}class Ua{constructor(t,e,i,s,n,o,r){this.groupManager=t,this.parent=e,this.key=s,this.level=i,this.field=n,this.hasSubGroups=i<t.groupIDLookups.length-1,this.addRow=this.hasSubGroups?this._addRowToGroup:this._addRow,this.type="group",this.old=r,this.rows=[],this.groups=[],this.groupList=[],this.generator=o,this.element=!1,this.elementContents=!1,this.height=0,this.outerHeight=0,this.initialized=!1,this.calcs={},this.initialized=!1,this.modules={},this.arrowElement=!1,this.visible=r?r.visible:void 0!==t.startOpen[i]?t.startOpen[i]:t.startOpen[0],this.component=null,this.createElements(),this.addBindings(),this.createValueGroups()}wipe(t){t||(this.groupList.length?this.groupList.forEach(function(t){t.wipe()}):this.rows.forEach(t=>{t.modules&&delete t.modules.group})),this.element=!1,this.arrowElement=!1,this.elementContents=!1}createElements(){var t=document.createElement("div");t.classList.add("tabulator-arrow"),this.element=document.createElement("div"),this.element.classList.add("tabulator-row"),this.element.classList.add("tabulator-group"),this.element.classList.add("tabulator-group-level-"+this.level),this.element.setAttribute("role","rowgroup"),this.arrowElement=document.createElement("div"),this.arrowElement.classList.add("tabulator-group-toggle"),this.arrowElement.appendChild(t),!1!==this.groupManager.table.options.movableRows&&this.groupManager.table.modExists("moveRow")&&this.groupManager.table.modules.moveRow.initializeGroupHeader(this)}createValueGroups(){var t=this.level+1;this.groupManager.allowedValues&&this.groupManager.allowedValues[t]&&this.groupManager.allowedValues[t].forEach(e=>{this._createGroup(e,t)})}addBindings(){this.groupManager.table.options.groupToggleElement&&("arrow"==this.groupManager.table.options.groupToggleElement?this.arrowElement:this.element).addEventListener("click",t=>{"arrow"===this.groupManager.table.options.groupToggleElement&&(t.stopPropagation(),t.stopImmediatePropagation()),setTimeout(()=>{this.toggleVisibility()})})}_createGroup(t,e){var i=e+"_"+t,s=new Ua(this.groupManager,this,e,t,this.groupManager.groupIDLookups[e].field,this.groupManager.headerGenerator[e]||this.groupManager.headerGenerator[0],!!this.old&&this.old.groups[i]);this.groups[i]=s,this.groupList.push(s)}_addRowToGroup(t){var e=this.level+1;if(this.hasSubGroups){var i=this.groupManager.groupIDLookups[e].func(t.getData()),s=e+"_"+i;this.groupManager.allowedValues&&this.groupManager.allowedValues[e]?this.groups[s]&&this.groups[s].addRow(t):(this.groups[s]||this._createGroup(i,e),this.groups[s].addRow(t))}}_addRow(t){this.rows.push(t),t.modules.group=this}insertRow(t,e,i){var s=this.conformRowData({});t.updateData(s);var n=this.rows.indexOf(e);n>-1?i?this.rows.splice(n+1,0,t):this.rows.splice(n,0,t):i?this.rows.push(t):this.rows.unshift(t),t.modules.group=this,this.groupManager.table.modExists("columnCalcs")&&"table"!=this.groupManager.table.options.columnCalcs&&this.groupManager.table.modules.columnCalcs.recalcGroup(this),this.groupManager.updateGroupRows(!0)}scrollHeader(t){this.arrowElement&&(this.arrowElement.style.marginLeft=t,this.groupList.forEach(function(e){e.scrollHeader(t)}))}getRowIndex(t){}conformRowData(t){return this.field?t[this.field]=this.key:console.warn("Data Conforming Error - Cannot conform row data to match new group as groupBy is a function"),this.parent&&(t=this.parent.conformRowData(t)),t}removeRow(t){var e=this.rows.indexOf(t),i=t.getElement();e>-1&&this.rows.splice(e,1),this.groupManager.table.options.groupValues||this.rows.length?(i.parentNode&&i.parentNode.removeChild(i),this.groupManager.blockRedraw||(this.generateGroupHeaderContents(),this.groupManager.table.modExists("columnCalcs")&&"table"!=this.groupManager.table.options.columnCalcs&&this.groupManager.table.modules.columnCalcs.recalcGroup(this))):(this.parent?this.parent.removeGroup(this):this.groupManager.removeGroup(this),this.groupManager.updateGroupRows(!0))}removeGroup(t){var e,i=t.level+"_"+t.key;this.groups[i]&&(delete this.groups[i],(e=this.groupList.indexOf(t))>-1&&this.groupList.splice(e,1),this.groupList.length||(this.parent?this.parent.removeGroup(this):this.groupManager.removeGroup(this)))}getHeadersAndRows(){var t=[];return t.push(this),this._visSet(),this.calcs.top&&(this.calcs.top.detachElement(),this.calcs.top.deleteCells()),this.calcs.bottom&&(this.calcs.bottom.detachElement(),this.calcs.bottom.deleteCells()),this.visible?this.groupList.length?this.groupList.forEach(function(e){t=t.concat(e.getHeadersAndRows())}):("table"!=this.groupManager.table.options.columnCalcs&&this.groupManager.table.modExists("columnCalcs")&&this.groupManager.table.modules.columnCalcs.hasTopCalcs()&&(this.calcs.top=this.groupManager.table.modules.columnCalcs.generateTopRow(this.rows),t.push(this.calcs.top)),t=t.concat(this.rows),"table"!=this.groupManager.table.options.columnCalcs&&this.groupManager.table.modExists("columnCalcs")&&this.groupManager.table.modules.columnCalcs.hasBottomCalcs()&&(this.calcs.bottom=this.groupManager.table.modules.columnCalcs.generateBottomRow(this.rows),t.push(this.calcs.bottom))):this.groupList.length||"table"==this.groupManager.table.options.columnCalcs||this.groupManager.table.modExists("columnCalcs")&&(this.groupManager.table.modules.columnCalcs.hasTopCalcs()&&this.groupManager.table.options.groupClosedShowCalcs&&(this.calcs.top=this.groupManager.table.modules.columnCalcs.generateTopRow(this.rows),t.push(this.calcs.top)),this.groupManager.table.modules.columnCalcs.hasBottomCalcs()&&this.groupManager.table.options.groupClosedShowCalcs&&(this.calcs.bottom=this.groupManager.table.modules.columnCalcs.generateBottomRow(this.rows),t.push(this.calcs.bottom))),t}getData(t,e){var i=[];return this._visSet(),(!t||t&&this.visible)&&this.rows.forEach(t=>{i.push(t.getData(e||"data"))}),i}getRowCount(){var t=0;return this.groupList.length?this.groupList.forEach(e=>{t+=e.getRowCount()}):t=this.rows.length,t}toggleVisibility(){this.visible?this.hide():this.show()}hide(){this.visible=!1,"basic"!=this.groupManager.table.rowManager.getRenderMode()||this.groupManager.table.options.pagination||(this.element.classList.remove("tabulator-group-visible"),this.groupList.length?this.groupList.forEach(t=>{t.getHeadersAndRows().forEach(t=>{t.detachElement()})}):this.rows.forEach(t=>{var e=t.getElement();e.parentNode.removeChild(e)})),this.groupManager.updateGroupRows(!0),this.groupManager.table.externalEvents.dispatch("groupVisibilityChanged",this.getComponent(),!1)}show(){if(this.visible=!0,"basic"!=this.groupManager.table.rowManager.getRenderMode()||this.groupManager.table.options.pagination)this.groupManager.updateGroupRows(!0);else{this.element.classList.add("tabulator-group-visible");var t=this.generateElement();this.groupList.length?this.groupList.forEach(e=>{e.getHeadersAndRows().forEach(e=>{var i=e.getElement();t.parentNode.insertBefore(i,t.nextSibling),e.initialize(),t=i})}):this.rows.forEach(e=>{var i=e.getElement();t.parentNode.insertBefore(i,t.nextSibling),e.initialize(),t=i}),this.groupManager.updateGroupRows(!0)}this.groupManager.table.externalEvents.dispatch("groupVisibilityChanged",this.getComponent(),!0)}_visSet(){var t=[];"function"==typeof this.visible&&(this.rows.forEach(function(e){t.push(e.getData())}),this.visible=this.visible(this.key,this.getRowCount(),t,this.getComponent()))}getRowGroup(t){var e=!1;return this.groupList.length?this.groupList.forEach(function(i){var s=i.getRowGroup(t);s&&(e=s)}):this.rows.find(function(e){return e===t})&&(e=this),e}getSubGroups(t){var e=[];return this.groupList.forEach(function(i){e.push(t?i.getComponent():i)}),e}getRows(t,e){var i=[];return e&&this.groupList.length?this.groupList.forEach(s=>{i=i.concat(s.getRows(t,e))}):this.rows.forEach(function(e){i.push(t?e.getComponent():e)}),i}generateGroupHeaderContents(){var t=[];for(this.getRows(!1,!0).forEach(function(e){t.push(e.getData())}),this.elementContents=this.generator(this.key,this.getRowCount(),t,this.getComponent());this.element.firstChild;)this.element.removeChild(this.element.firstChild);"string"==typeof this.elementContents?this.element.innerHTML=this.elementContents:this.element.appendChild(this.elementContents),this.element.insertBefore(this.arrowElement,this.element.firstChild)}getPath(t=[]){return t.unshift(this.key),this.parent&&this.parent.getPath(t),t}getElement(){return this.elementContents?this.element:this.generateElement()}generateElement(){this.addBindings=!1,this._visSet(),this.visible?this.element.classList.add("tabulator-group-visible"):this.element.classList.remove("tabulator-group-visible");for(var t=0;t<this.element.childNodes.length;++t)this.element.childNodes[t].parentNode.removeChild(this.element.childNodes[t]);return this.generateGroupHeaderContents(),this.element}detachElement(){this.element&&this.element.parentNode&&this.element.parentNode.removeChild(this.element)}normalizeHeight(){this.setHeight(this.element.clientHeight)}initialize(t){this.initialized&&!t||(this.normalizeHeight(),this.initialized=!0)}reinitialize(){this.initialized=!1,this.height=0,ia.elVisible(this.element)&&this.initialize(!0)}setHeight(t){this.height!=t&&(this.height=t,this.outerHeight=this.element.offsetHeight)}getHeight(){return this.outerHeight}getGroup(){return this}reinitializeHeight(){}calcHeight(){this.outerHeight=this.element.offsetHeight}setCellHeight(){}clearCellHeight(){}deinitializeHeight(){}rendered(){}getComponent(){return this.component||(this.component=new Ga(this)),this.component}}var $a={cellEdit:function(t){t.component.setValueProcessData(t.data.oldValue),t.component.cellRendered()},rowAdd:function(t){t.component.deleteActual(),this.table.rowManager.checkPlaceholder()},rowDelete:function(t){var e=this.table.rowManager.addRowActual(t.data.data,t.data.pos,t.data.index);this.table.options.groupBy&&this.table.modExists("groupRows")&&this.table.modules.groupRows.updateGroupRows(!0),this._rebindRow(t.component,e),this.table.rowManager.checkPlaceholder()},rowMove:function(t){var e=t.data.posFrom-t.data.posTo>0;this.table.rowManager.moveRowActual(t.component,this.table.rowManager.getRowFromPosition(t.data.posFrom),e),this.table.rowManager.regenerateRowPositions(),this.table.rowManager.reRenderInPosition()}},Ya={cellEdit:function(t){t.component.setValueProcessData(t.data.newValue),t.component.cellRendered()},rowAdd:function(t){var e=this.table.rowManager.addRowActual(t.data.data,t.data.pos,t.data.index);this.table.options.groupBy&&this.table.modExists("groupRows")&&this.table.modules.groupRows.updateGroupRows(!0),this._rebindRow(t.component,e),this.table.rowManager.checkPlaceholder()},rowDelete:function(t){t.component.deleteActual(),this.table.rowManager.checkPlaceholder()},rowMove:function(t){this.table.rowManager.moveRowActual(t.component,this.table.rowManager.getRowFromPosition(t.data.posTo),t.data.after),this.table.rowManager.regenerateRowPositions(),this.table.rowManager.reRenderInPosition()}},Ka={keybindings:{bindings:{undo:["ctrl + 90","meta + 90"],redo:["ctrl + 89","meta + 89"]},actions:{undo:function(t){this.table.options.history&&this.table.modExists("history")&&this.table.modExists("edit")&&(this.table.modules.edit.currentCell||(t.preventDefault(),this.table.modules.history.undo()))},redo:function(t){this.table.options.history&&this.table.modExists("history")&&this.table.modExists("edit")&&(this.table.modules.edit.currentCell||(t.preventDefault(),this.table.modules.history.redo()))}}}};class Xa extends na{static moduleName="history";static moduleExtensions=Ka;static undoers=$a;static redoers=Ya;constructor(t){super(t),this.history=[],this.index=-1,this.registerTableOption("history",!1)}initialize(){this.table.options.history&&(this.subscribe("cell-value-updated",this.cellUpdated.bind(this)),this.subscribe("cell-delete",this.clearComponentHistory.bind(this)),this.subscribe("row-delete",this.rowDeleted.bind(this)),this.subscribe("rows-wipe",this.clear.bind(this)),this.subscribe("row-added",this.rowAdded.bind(this)),this.subscribe("row-move",this.rowMoved.bind(this))),this.registerTableFunction("undo",this.undo.bind(this)),this.registerTableFunction("redo",this.redo.bind(this)),this.registerTableFunction("getHistoryUndoSize",this.getHistoryUndoSize.bind(this)),this.registerTableFunction("getHistoryRedoSize",this.getHistoryRedoSize.bind(this)),this.registerTableFunction("clearHistory",this.clear.bind(this))}rowMoved(t,e,i){this.action("rowMove",t,{posFrom:t.getPosition(),posTo:e.getPosition(),to:e,after:i})}rowAdded(t,e,i,s){this.action("rowAdd",t,{data:e,pos:i,index:s})}rowDeleted(t){var e,i;this.table.options.groupBy?(e=(i=t.getComponent().getGroup()._getSelf().rows).indexOf(t))&&(e=i[e-1]):(e=t.table.rowManager.getRowIndex(t))&&(e=t.table.rowManager.rows[e-1]),this.action("rowDelete",t,{data:t.getData(),pos:!e,index:e})}cellUpdated(t){this.action("cellEdit",t,{oldValue:t.oldValue,newValue:t.value})}clear(){this.history=[],this.index=-1}action(t,e,i){this.history=this.history.slice(0,this.index+1),this.history.push({type:t,component:e,data:i}),this.index++}getHistoryUndoSize(){return this.index+1}getHistoryRedoSize(){return this.history.length-(this.index+1)}clearComponentHistory(t){var e=this.history.findIndex(function(e){return e.component===t});e>-1&&(this.history.splice(e,1),e<=this.index&&this.index--,this.clearComponentHistory(t))}undo(){if(this.index>-1){let t=this.history[this.index];return Xa.undoers[t.type].call(this,t),this.index--,this.dispatchExternal("historyUndo",t.type,t.component.getComponent(),t.data),!0}return console.warn(this.options("history")?"History Undo Error - No more history to undo":"History module not enabled"),!1}redo(){if(this.history.length-1>this.index){this.index++;let t=this.history[this.index];return Xa.redoers[t.type].call(this,t),this.dispatchExternal("historyRedo",t.type,t.component.getComponent(),t.data),!0}return console.warn(this.options("history")?"History Redo Error - No more history to redo":"History module not enabled"),!1}_rebindRow(t,e){this.history.forEach(function(i){if(i.component instanceof Ra)i.component===t&&(i.component=e);else if(i.component instanceof _a&&i.component.row===t){var s=i.component.column.getField();s&&(i.component=e.getCell(s))}})}}var qa={csv:function(t){var e=[],i=0,s=0,n=!1;for(let o=0;o<t.length;o++){let r=t[o],a=t[o+1];e[i]||(e[i]=[]),e[i][s]||(e[i][s]=""),'"'==r&&n&&'"'==a?(e[i][s]+=r,o++):'"'!=r?","!=r||n?"\r"!=r||"\n"!=a||n?"\r"!=r&&"\n"!=r||n?e[i][s]+=r:(s=0,i++):(s=0,i++,o++):s++:n=!n}return e},json:function(t){try{return JSON.parse(t)}catch(t){return console.warn("JSON Import Error - File contents is invalid JSON",t),Promise.reject()}},array:function(t){return t},xlsx:function(t){var e=this.dependencyRegistry.lookup("XLSX"),i=e.read(t),s=i.Sheets[i.SheetNames[0]];return e.utils.sheet_to_json(s,{header:1})}};class Ja extends na{static moduleName="import";static importers=qa;constructor(t){super(t),this.registerTableOption("importFormat"),this.registerTableOption("importReader","text"),this.registerTableOption("importHeaderTransform"),this.registerTableOption("importValueTransform"),this.registerTableOption("importDataValidator"),this.registerTableOption("importFileValidator")}initialize(){this.registerTableFunction("import",this.importFromFile.bind(this)),this.table.options.importFormat&&(this.subscribe("data-loading",this.loadDataCheck.bind(this),10),this.subscribe("data-load",this.loadData.bind(this),10))}loadDataCheck(t){return this.table.options.importFormat&&("string"==typeof t||Array.isArray(t)&&t.length&&Array.isArray(t))}loadData(t,e,i,s,n){return this.importData(this.lookupImporter(),t).then(this.structureData.bind(this)).catch(t=>(console.error("Import Error:",t||"Unable to import data"),Promise.reject(t)))}lookupImporter(t){var e;return t||(t=this.table.options.importFormat),(e="string"==typeof t?Ja.importers[t]:t)||console.error("Import Error - Importer not found:",t),e}importFromFile(t,e,i){var s=this.lookupImporter(t);if(s)return this.pickFile(e,i).then(this.importData.bind(this,s)).then(this.structureData.bind(this)).then(this.mutateData.bind(this)).then(this.validateData.bind(this)).then(this.setData.bind(this)).catch(t=>(this.dispatch("import-error",t),this.dispatchExternal("importError",t),console.error("Import Error:",t||"Unable to import file"),this.table.dataLoader.alertError(),setTimeout(()=>{this.table.dataLoader.clearAlert()},3e3),Promise.reject(t)))}pickFile(t,e){return new Promise((i,s)=>{var n=document.createElement("input");n.type="file",n.accept=t,n.addEventListener("change",t=>{var o=n.files[0],r=new FileReader,a=this.validateFile(o);if(!0===a){switch(this.dispatch("import-importing",n.files),this.dispatchExternal("importImporting",n.files),e||this.table.options.importReader){case"buffer":r.readAsArrayBuffer(o);break;case"binary":r.readAsBinaryString(o);break;case"url":r.readAsDataURL(o);break;default:r.readAsText(o)}r.onload=t=>{i(r.result)},r.onerror=t=>{console.warn("File Load Error - Unable to read file"),s(t)}}else s(a)}),this.dispatch("import-choose"),this.dispatchExternal("importChoose"),n.click()})}importData(t,e){var i;return this.table.dataLoader.alertLoader(),new Promise((s,n)=>{setTimeout(()=>{(i=t.call(this.table,e))instanceof Promise||i?s(i):n()},10)})}structureData(t){return Array.isArray(t)&&t.length&&Array.isArray(t[0])?this.table.options.autoColumns?this.structureArrayToObject(t):this.structureArrayToColumns(t):t}mutateData(t){var e=[];return Array.isArray(t)?t.forEach(t=>{e.push(this.table.modules.mutator.transformRow(t,"import"))}):e=t,e}transformHeader(t){var e=[];return this.table.options.importHeaderTransform?(t.forEach(i=>{e.push(this.table.options.importHeaderTransform.call(this.table,i,t))}),e):t}transformData(t){var e=[];return this.table.options.importValueTransform?(t.forEach(i=>{e.push(this.table.options.importValueTransform.call(this.table,i,t))}),e):t}structureArrayToObject(t){var e=this.transformHeader(t.shift());return t.map(t=>{var i={};return t=this.transformData(t),e.forEach((e,s)=>{i[e]=t[s]}),i})}structureArrayToColumns(t){var e=[],i=this.transformHeader(t[0]),s=this.table.getColumns();return s[0]&&i[0]&&s[0].getDefinition().title===i[0]&&t.shift(),t.forEach(t=>{var i={};(t=this.transformData(t)).forEach((t,e)=>{var n=s[e];n&&(i[n.getField()]=t)}),e.push(i)}),e}validateFile(t){return!this.table.options.importFileValidator||this.table.options.importFileValidator.call(this.table,t)}validateData(t){var e;return this.table.options.importDataValidator?!0===(e=this.table.options.importDataValidator.call(this.table,t))?t:Promise.reject(e):t}setData(t){return this.dispatch("import-imported",t),this.dispatchExternal("importImported",t),this.table.dataLoader.clearAlert(),this.table.setData(t)}}var Za={navPrev:"shift + 9",navNext:9,navUp:38,navDown:40,navLeft:37,navRight:39,scrollPageUp:33,scrollPageDown:34,scrollToStart:36,scrollToEnd:35},Qa={keyBlock:function(t){t.stopPropagation(),t.preventDefault()},scrollPageUp:function(t){var e=this.table.rowManager,i=e.scrollTop-e.element.clientHeight;t.preventDefault(),e.displayRowsCount&&(i>=0?e.element.scrollTop=i:e.scrollToRow(e.getDisplayRows()[0])),this.table.element.focus()},scrollPageDown:function(t){var e=this.table.rowManager,i=e.scrollTop+e.element.clientHeight,s=e.element.scrollHeight;t.preventDefault(),e.displayRowsCount&&(i<=s?e.element.scrollTop=i:e.scrollToRow(e.getDisplayRows()[e.displayRowsCount-1])),this.table.element.focus()},scrollToStart:function(t){var e=this.table.rowManager;t.preventDefault(),e.displayRowsCount&&e.scrollToRow(e.getDisplayRows()[0]),this.table.element.focus()},scrollToEnd:function(t){var e=this.table.rowManager;t.preventDefault(),e.displayRowsCount&&e.scrollToRow(e.getDisplayRows()[e.displayRowsCount-1]),this.table.element.focus()},navPrev:function(t){this.dispatch("keybinding-nav-prev",t)},navNext:function(t){this.dispatch("keybinding-nav-next",t)},navLeft:function(t){this.dispatch("keybinding-nav-left",t)},navRight:function(t){this.dispatch("keybinding-nav-right",t)},navUp:function(t){this.dispatch("keybinding-nav-up",t)},navDown:function(t){this.dispatch("keybinding-nav-down",t)}};class tl extends na{static moduleName="keybindings";static bindings=Za;static actions=Qa;constructor(t){super(t),this.watchKeys=null,this.pressedKeys=null,this.keyupBinding=!1,this.keydownBinding=!1,this.registerTableOption("keybindings",{}),this.registerTableOption("tabEndNewRow",!1)}initialize(){var t=this.table.options.keybindings,e={};this.watchKeys={},this.pressedKeys=[],!1!==t&&(Object.assign(e,tl.bindings),Object.assign(e,t),this.mapBindings(e),this.bindEvents()),this.subscribe("table-destroy",this.clearBindings.bind(this))}mapBindings(t){for(let e in t)tl.actions[e]?t[e]&&("object"!=typeof t[e]&&(t[e]=[t[e]]),t[e].forEach(t=>{(Array.isArray(t)?t:[t]).forEach(t=>{this.mapBinding(e,t)})})):console.warn("Key Binding Error - no such action:",e)}getKeyCode(t){return 1===t.key.length?t.key.toUpperCase().charCodeAt(0):{Enter:13,Escape:27,Tab:9,Backspace:8,Delete:46,ArrowUp:38,ArrowDown:40,ArrowLeft:37,ArrowRight:39,Home:36,End:35,PageUp:33,PageDown:34,Insert:45}[t.key]||t.keyCode||0}mapBinding(t,e){var i={action:tl.actions[t],keys:[],ctrl:!1,shift:!1,meta:!1};e.toString().toLowerCase().split(" ").join("").split("+").forEach(t=>{switch(t){case"ctrl":i.ctrl=!0;break;case"shift":i.shift=!0;break;case"meta":i.meta=!0;break;default:t=isNaN(t)?t.toUpperCase().charCodeAt(0):parseInt(t),i.keys.push(t),this.watchKeys[t]||(this.watchKeys[t]=[]),this.watchKeys[t].push(i)}})}bindEvents(){var t=this;this.keyupBinding=function(e){var i=t.getKeyCode(e),s=t.watchKeys[i];s&&(t.pressedKeys.push(i),s.forEach(function(i){t.checkBinding(e,i)}))},this.keydownBinding=function(e){var i=t.getKeyCode(e);if(t.watchKeys[i]){var s=t.pressedKeys.indexOf(i);s>-1&&t.pressedKeys.splice(s,1)}},this.table.element.addEventListener("keydown",this.keyupBinding),this.table.element.addEventListener("keyup",this.keydownBinding)}clearBindings(){this.keyupBinding&&this.table.element.removeEventListener("keydown",this.keyupBinding),this.keydownBinding&&this.table.element.removeEventListener("keyup",this.keydownBinding)}checkBinding(t,e){var i=!0;return t.ctrlKey==e.ctrl&&t.shiftKey==e.shift&&t.metaKey==e.meta&&(e.keys.forEach(t=>{-1==this.pressedKeys.indexOf(t)&&(i=!1)}),i&&e.action.call(this,t),!0)}}var el={delete:function(t,e,i){t.delete()}},il={insert:function(t,e,i){return this.table.addRow(t.getData(),void 0,e),!0},add:function(t,e,i){return this.table.addRow(t.getData()),!0},update:function(t,e,i){return!!e&&(e.update(t.getData()),!0)},replace:function(t,e,i){return!!e&&(this.table.addRow(t.getData(),void 0,e),e.delete(),!0)}};class sl extends na{static moduleName="moveRow";static senders=el;static receivers=il;constructor(t){super(t),this.placeholderElement=this.createPlaceholderElement(),this.hoverElement=!1,this.checkTimeout=!1,this.checkPeriod=150,this.moving=!1,this.toRow=!1,this.toRowAfter=!1,this.hasHandle=!1,this.startY=0,this.startX=0,this.moveHover=this.moveHover.bind(this),this.endMove=this.endMove.bind(this),this.tableRowDropEvent=!1,this.touchMove=!1,this.connection=!1,this.connectionSelectorsTables=!1,this.connectionSelectorsElements=!1,this.connectionElements=[],this.connections=[],this.connectedTable=!1,this.connectedRow=!1,this.registerTableOption("movableRows",!1),this.registerTableOption("movableRowsConnectedTables",!1),this.registerTableOption("movableRowsConnectedElements",!1),this.registerTableOption("movableRowsSender",!1),this.registerTableOption("movableRowsReceiver","insert"),this.registerColumnOption("rowHandle")}createPlaceholderElement(){var t=document.createElement("div");return t.classList.add("tabulator-row"),t.classList.add("tabulator-row-placeholder"),t}initialize(){this.table.options.movableRows&&(this.connectionSelectorsTables=this.table.options.movableRowsConnectedTables,this.connectionSelectorsElements=this.table.options.movableRowsConnectedElements,this.connection=this.connectionSelectorsTables||this.connectionSelectorsElements,this.subscribe("cell-init",this.initializeCell.bind(this)),this.subscribe("column-init",this.initializeColumn.bind(this)),this.subscribe("row-init",this.initializeRow.bind(this)))}initializeGroupHeader(t){var e=this,i={};i.mouseup=function(i){e.tableRowDrop(i,t)}.bind(e),i.mousemove=function(i){var s;i.pageY-ia.elOffset(t.element).top+e.table.rowManager.element.scrollTop>t.getHeight()/2?e.toRow===t&&e.toRowAfter||((s=t.getElement()).parentNode.insertBefore(e.placeholderElement,s.nextSibling),e.moveRow(t,!0)):(e.toRow!==t||e.toRowAfter)&&(s=t.getElement()).previousSibling&&(s.parentNode.insertBefore(e.placeholderElement,s),e.moveRow(t,!1))}.bind(e),t.modules.moveRow=i}initializeRow(t){var e,i=this,s={};s.mouseup=function(e){i.tableRowDrop(e,t)}.bind(i),s.mousemove=function(e){var s=t.getElement();e.pageY-ia.elOffset(s).top+i.table.rowManager.element.scrollTop>t.getHeight()/2?i.toRow===t&&i.toRowAfter||(s.parentNode.insertBefore(i.placeholderElement,s.nextSibling),i.moveRow(t,!0)):(i.toRow!==t||i.toRowAfter)&&(s.parentNode.insertBefore(i.placeholderElement,s),i.moveRow(t,!1))}.bind(i),this.hasHandle||((e=t.getElement()).addEventListener("mousedown",function(e){1===e.which&&(i.checkTimeout=setTimeout(function(){i.startMove(e,t)},i.checkPeriod))}),e.addEventListener("mouseup",function(t){1===t.which&&i.checkTimeout&&clearTimeout(i.checkTimeout)}),this.bindTouchEvents(t,t.getElement())),t.modules.moveRow=s}initializeColumn(t){t.definition.rowHandle&&!1!==this.table.options.movableRows&&(this.hasHandle=!0)}initializeCell(t){if(t.column.definition.rowHandle&&!1!==this.table.options.movableRows){var e=this,i=t.getElement(!0);i.addEventListener("mousedown",function(i){1===i.which&&(e.checkTimeout=setTimeout(function(){e.startMove(i,t.row)},e.checkPeriod))}),i.addEventListener("mouseup",function(t){1===t.which&&e.checkTimeout&&clearTimeout(e.checkTimeout)}),this.bindTouchEvents(t.row,i)}}bindTouchEvents(t,e){var i,s,n,o,r,a,l=!1;e.addEventListener("touchstart",e=>{this.checkTimeout=setTimeout(()=>{this.touchMove=!0,i=t.nextRow(),n=i?i.getHeight()/2:0,s=t.prevRow(),o=s?s.getHeight()/2:0,r=0,a=0,l=!1,this.startMove(e,t)},this.checkPeriod)},{passive:!0}),this.moving,this.toRow,this.toRowAfter,e.addEventListener("touchmove",e=>{var h,c;this.moving&&(e.preventDefault(),this.moveHover(e),l||(l=e.touches[0].pageY),(h=e.touches[0].pageY-l)>0?i&&h-r>n&&(c=i)!==t&&(l=e.touches[0].pageY,c.getElement().parentNode.insertBefore(this.placeholderElement,c.getElement().nextSibling),this.moveRow(c,!0)):s&&-h-a>o&&(c=s)!==t&&(l=e.touches[0].pageY,c.getElement().parentNode.insertBefore(this.placeholderElement,c.getElement()),this.moveRow(c,!1)),c&&(i=c.nextRow(),r=n,n=i?i.getHeight()/2:0,s=c.prevRow(),a=o,o=s?s.getHeight()/2:0))}),e.addEventListener("touchend",t=>{this.checkTimeout&&clearTimeout(this.checkTimeout),this.moving&&(this.endMove(t),this.touchMove=!1)})}_bindMouseMove(){this.table.rowManager.getDisplayRows().forEach(t=>{("row"===t.type||"group"===t.type)&&t.modules.moveRow&&t.modules.moveRow.mousemove&&t.getElement().addEventListener("mousemove",t.modules.moveRow.mousemove)})}_unbindMouseMove(){this.table.rowManager.getDisplayRows().forEach(t=>{("row"===t.type||"group"===t.type)&&t.modules.moveRow&&t.modules.moveRow.mousemove&&t.getElement().removeEventListener("mousemove",t.modules.moveRow.mousemove)})}startMove(t,e){var i=e.getElement();this.setStartPosition(t,e),this.moving=e,this.table.element.classList.add("tabulator-block-select"),this.placeholderElement.style.width=e.getWidth()+"px",this.placeholderElement.style.height=e.getHeight()+"px",this.connection?(this.table.element.classList.add("tabulator-movingrow-sending"),this.connectToTables(e)):(i.parentNode.insertBefore(this.placeholderElement,i),i.parentNode.removeChild(i)),this.hoverElement=i.cloneNode(!0),this.hoverElement.classList.add("tabulator-moving"),this.connection?(document.body.appendChild(this.hoverElement),this.hoverElement.style.left="0",this.hoverElement.style.top="0",this.hoverElement.style.width=this.table.element.clientWidth+"px",this.hoverElement.style.whiteSpace="nowrap",this.hoverElement.style.overflow="hidden",this.hoverElement.style.pointerEvents="none"):(this.table.rowManager.getTableElement().appendChild(this.hoverElement),this.hoverElement.style.left="0",this.hoverElement.style.top="0",this._bindMouseMove()),document.body.addEventListener("mousemove",this.moveHover),document.body.addEventListener("mouseup",this.endMove),this.dispatchExternal("rowMoving",e.getComponent()),this.moveHover(t)}setStartPosition(t,e){var i,s,n=this.touchMove?t.touches[0].pageX:t.pageX,o=this.touchMove?t.touches[0].pageY:t.pageY;i=e.getElement(),this.connection?(s=i.getBoundingClientRect(),this.startX=s.left-n+window.pageXOffset,this.startY=s.top-o+window.pageYOffset):this.startY=o-i.getBoundingClientRect().top}endMove(t){t&&1!==t.which&&!this.touchMove||(this._unbindMouseMove(),this.connection||(this.placeholderElement.parentNode.insertBefore(this.moving.getElement(),this.placeholderElement.nextSibling),this.placeholderElement.parentNode.removeChild(this.placeholderElement)),this.hoverElement.parentNode.removeChild(this.hoverElement),this.table.element.classList.remove("tabulator-block-select"),this.toRow?this.table.rowManager.moveRow(this.moving,this.toRow,this.toRowAfter):this.dispatchExternal("rowMoveCancelled",this.moving.getComponent()),this.moving=!1,this.toRow=!1,this.toRowAfter=!1,document.body.removeEventListener("mousemove",this.moveHover),document.body.removeEventListener("mouseup",this.endMove),this.connection&&(this.table.element.classList.remove("tabulator-movingrow-sending"),this.disconnectFromTables()))}moveRow(t,e){this.toRow=t,this.toRowAfter=e}moveHover(t){this.connection?this.moveHoverConnections.call(this,t):this.moveHoverTable.call(this,t)}moveHoverTable(t){var e=this.table.rowManager.getElement(),i=e.scrollTop,s=(this.touchMove?t.touches[0].pageY:t.pageY)-e.getBoundingClientRect().top+i;this.hoverElement.style.top=Math.min(s-this.startY,this.table.rowManager.element.scrollHeight-this.hoverElement.offsetHeight)+"px"}moveHoverConnections(t){this.hoverElement.style.left=this.startX+(this.touchMove?t.touches[0].pageX:t.pageX)+"px",this.hoverElement.style.top=this.startY+(this.touchMove?t.touches[0].pageY:t.pageY)+"px"}elementRowDrop(t,e,i){this.dispatchExternal("movableRowsElementDrop",t,e,!!i&&i.getComponent())}connectToTables(t){var e;this.connectionSelectorsTables&&(e=this.commsConnections(this.connectionSelectorsTables),this.dispatchExternal("movableRowsSendingStart",e),this.commsSend(this.connectionSelectorsTables,"moveRow","connect",{row:t})),this.connectionSelectorsElements&&(this.connectionElements=[],Array.isArray(this.connectionSelectorsElements)||(this.connectionSelectorsElements=[this.connectionSelectorsElements]),this.connectionSelectorsElements.forEach(t=>{"string"==typeof t?this.connectionElements=this.connectionElements.concat(Array.prototype.slice.call(document.querySelectorAll(t))):this.connectionElements.push(t)}),this.connectionElements.forEach(t=>{var e=e=>{this.elementRowDrop(e,t,this.moving)};t.addEventListener("mouseup",e),t.tabulatorElementDropEvent=e,t.classList.add("tabulator-movingrow-receiving")}))}disconnectFromTables(){var t;this.connectionSelectorsTables&&(t=this.commsConnections(this.connectionSelectorsTables),this.dispatchExternal("movableRowsSendingStop",t),this.commsSend(this.connectionSelectorsTables,"moveRow","disconnect")),this.connectionElements.forEach(t=>{t.classList.remove("tabulator-movingrow-receiving"),t.removeEventListener("mouseup",t.tabulatorElementDropEvent),delete t.tabulatorElementDropEvent})}connect(t,e){return this.connectedTable?(console.warn("Move Row Error - Table cannot accept connection, already connected to table:",this.connectedTable),!1):(this.connectedTable=t,this.connectedRow=e,this.table.element.classList.add("tabulator-movingrow-receiving"),this.table.rowManager.getDisplayRows().forEach(t=>{"row"===t.type&&t.modules.moveRow&&t.modules.moveRow.mouseup&&t.getElement().addEventListener("mouseup",t.modules.moveRow.mouseup)}),this.tableRowDropEvent=this.tableRowDrop.bind(this),this.table.element.addEventListener("mouseup",this.tableRowDropEvent),this.dispatchExternal("movableRowsReceivingStart",e,t),!0)}disconnect(t){t===this.connectedTable?(this.connectedTable=!1,this.connectedRow=!1,this.table.element.classList.remove("tabulator-movingrow-receiving"),this.table.rowManager.getDisplayRows().forEach(t=>{"row"===t.type&&t.modules.moveRow&&t.modules.moveRow.mouseup&&t.getElement().removeEventListener("mouseup",t.modules.moveRow.mouseup)}),this.table.element.removeEventListener("mouseup",this.tableRowDropEvent),this.dispatchExternal("movableRowsReceivingStop",t)):console.warn("Move Row Error - trying to disconnect from non connected table")}dropComplete(t,e,i){var s=!1;if(i){switch(typeof this.table.options.movableRowsSender){case"string":s=sl.senders[this.table.options.movableRowsSender];break;case"function":s=this.table.options.movableRowsSender}s?s.call(this,this.moving?this.moving.getComponent():void 0,e?e.getComponent():void 0,t):this.table.options.movableRowsSender&&console.warn("Mover Row Error - no matching sender found:",this.table.options.movableRowsSender),this.dispatchExternal("movableRowsSent",this.moving.getComponent(),e?e.getComponent():void 0,t)}else this.dispatchExternal("movableRowsSentFailed",this.moving.getComponent(),e?e.getComponent():void 0,t);this.endMove()}tableRowDrop(t,e){var i=!1,s=!1;switch(t.stopImmediatePropagation(),typeof this.table.options.movableRowsReceiver){case"string":i=sl.receivers[this.table.options.movableRowsReceiver];break;case"function":i=this.table.options.movableRowsReceiver}i?s=i.call(this,this.connectedRow.getComponent(),e?e.getComponent():void 0,this.connectedTable):console.warn("Mover Row Error - no matching receiver found:",this.table.options.movableRowsReceiver),s?this.dispatchExternal("movableRowsReceived",this.connectedRow.getComponent(),e?e.getComponent():void 0,this.connectedTable):this.dispatchExternal("movableRowsReceivedFailed",this.connectedRow.getComponent(),e?e.getComponent():void 0,this.connectedTable),this.commsSend(this.connectedTable,"moveRow","dropcomplete",{row:e,success:s})}commsReceived(t,e,i){switch(e){case"connect":return this.connect(t,i.row);case"disconnect":return this.disconnect(t);case"dropcomplete":return this.dropComplete(t,i.row,i.success)}}}var nl={};class ol extends na{static moduleName="mutator";static mutators=nl;constructor(t){super(t),this.allowedTypes=["","data","edit","clipboard","import"],this.enabled=!0,this.registerColumnOption("mutator"),this.registerColumnOption("mutatorParams"),this.registerColumnOption("mutatorData"),this.registerColumnOption("mutatorDataParams"),this.registerColumnOption("mutatorEdit"),this.registerColumnOption("mutatorEditParams"),this.registerColumnOption("mutatorClipboard"),this.registerColumnOption("mutatorClipboardParams"),this.registerColumnOption("mutatorImport"),this.registerColumnOption("mutatorImportParams"),this.registerColumnOption("mutateLink")}initialize(){this.subscribe("cell-value-changing",this.transformCell.bind(this)),this.subscribe("cell-value-changed",this.mutateLink.bind(this)),this.subscribe("column-layout",this.initializeColumn.bind(this)),this.subscribe("row-data-init-before",this.rowDataChanged.bind(this)),this.subscribe("row-data-changing",this.rowDataChanged.bind(this))}rowDataChanged(t,e,i){return this.transformRow(e,"data",i)}initializeColumn(t){var e=!1,i={};this.allowedTypes.forEach(s=>{var n,o="mutator"+(s.charAt(0).toUpperCase()+s.slice(1));t.definition[o]&&(n=this.lookupMutator(t.definition[o]))&&(e=!0,i[o]={mutator:n,params:t.definition[o+"Params"]||{}})}),e&&(t.modules.mutate=i)}lookupMutator(t){var e=!1;switch(typeof t){case"string":ol.mutators[t]?e=ol.mutators[t]:console.warn("Mutator Error - No such mutator found, ignoring: ",t);break;case"function":e=t}return e}transformRow(t,e,i){var s,n="mutator"+(e.charAt(0).toUpperCase()+e.slice(1));return this.enabled&&this.table.columnManager.traverse(o=>{var r,a,l;o.modules.mutate&&(r=o.modules.mutate[n]||o.modules.mutate.mutator||!1)&&(s=o.getFieldValue(void 0!==i?i:t),("data"==e&&!i||void 0!==s)&&(l=o.getComponent(),a="function"==typeof r.params?r.params(s,t,e,l):r.params,o.setFieldValue(t,r.mutator(s,t,e,a,l))))}),t}transformCell(t,e){if(t.column.modules.mutate){var i=t.column.modules.mutate.mutatorEdit||t.column.modules.mutate.mutator||!1,s={};if(i)return s=Object.assign(s,t.row.getData()),t.column.setFieldValue(s,e),i.mutator(e,s,"edit",i.params,t.getComponent())}return e}mutateLink(t){var e=t.column.definition.mutateLink;e&&(Array.isArray(e)||(e=[e]),e.forEach(e=>{var i=t.row.getCell(e);i&&i.setValue(i.getValue(),!0,!0)}))}enable(){this.enabled=!0}disable(){this.enabled=!1}}var rl={rows:function(t,e,i,s,n){var o=document.createElement("span"),r=document.createElement("span"),a=document.createElement("span"),l=document.createElement("span"),h=document.createElement("span"),c=document.createElement("span");return this.table.modules.localize.langBind("pagination|counter|showing",t=>{r.innerHTML=t}),this.table.modules.localize.langBind("pagination|counter|of",t=>{l.innerHTML=t}),this.table.modules.localize.langBind("pagination|counter|rows",t=>{c.innerHTML=t}),s?(a.innerHTML=" "+e+"-"+Math.min(e+t-1,s)+" ",h.innerHTML=" "+s+" ",o.appendChild(r),o.appendChild(a),o.appendChild(l),o.appendChild(h),o.appendChild(c)):(a.innerHTML=" 0 ",o.appendChild(r),o.appendChild(a),o.appendChild(c)),o},pages:function(t,e,i,s,n){var o=document.createElement("span"),r=document.createElement("span"),a=document.createElement("span"),l=document.createElement("span"),h=document.createElement("span"),c=document.createElement("span");return this.table.modules.localize.langBind("pagination|counter|showing",t=>{r.innerHTML=t}),a.innerHTML=" "+i+" ",this.table.modules.localize.langBind("pagination|counter|of",t=>{l.innerHTML=t}),h.innerHTML=" "+n+" ",this.table.modules.localize.langBind("pagination|counter|pages",t=>{c.innerHTML=t}),o.appendChild(r),o.appendChild(a),o.appendChild(l),o.appendChild(h),o.appendChild(c),o}};class al extends na{static moduleName="page";static pageCounters=rl;constructor(t){super(t),this.mode="local",this.progressiveLoad=!1,this.element=null,this.pageCounterElement=null,this.pageCounter=null,this.size=0,this.page=1,this.count=5,this.max=1,this.remoteRowCountEstimate=null,this.initialLoad=!0,this.dataChanging=!1,this.pageSizes=[],this.registerTableOption("pagination",!1),this.registerTableOption("paginationMode","local"),this.registerTableOption("paginationSize",!1),this.registerTableOption("paginationInitialPage",1),this.registerTableOption("paginationCounter",!1),this.registerTableOption("paginationCounterElement",!1),this.registerTableOption("paginationButtonCount",5),this.registerTableOption("paginationSizeSelector",!1),this.registerTableOption("paginationElement",!1),this.registerTableOption("paginationAddRow","page"),this.registerTableOption("paginationOutOfRange",!1),this.registerTableOption("progressiveLoad",!1),this.registerTableOption("progressiveLoadDelay",0),this.registerTableOption("progressiveLoadScrollMargin",0),this.registerTableFunction("setMaxPage",this.setMaxPage.bind(this)),this.registerTableFunction("setPage",this.setPage.bind(this)),this.registerTableFunction("setPageToRow",this.userSetPageToRow.bind(this)),this.registerTableFunction("setPageSize",this.userSetPageSize.bind(this)),this.registerTableFunction("getPageSize",this.getPageSize.bind(this)),this.registerTableFunction("previousPage",this.previousPage.bind(this)),this.registerTableFunction("nextPage",this.nextPage.bind(this)),this.registerTableFunction("getPage",this.getPage.bind(this)),this.registerTableFunction("getPageMax",this.getPageMax.bind(this)),this.registerComponentFunction("row","pageTo",this.setPageToRow.bind(this))}initialize(){this.table.options.pagination?(this.subscribe("row-deleted",this.rowsUpdated.bind(this)),this.subscribe("row-added",this.rowsUpdated.bind(this)),this.subscribe("data-processed",this.initialLoadComplete.bind(this)),this.subscribe("table-built",this.calculatePageSizes.bind(this)),this.subscribe("footer-redraw",this.footerRedraw.bind(this)),"page"==this.table.options.paginationAddRow&&this.subscribe("row-adding-position",this.rowAddingPosition.bind(this)),"remote"===this.table.options.paginationMode&&(this.subscribe("data-params",this.remotePageParams.bind(this)),this.subscribe("data-loaded",this._parseRemoteData.bind(this))),this.table.options.progressiveLoad&&console.error("Progressive Load Error - Pagination and progressive load cannot be used at the same time"),this.registerDisplayHandler(this.restOnRenderBefore.bind(this),40),this.registerDisplayHandler(this.getRows.bind(this),50),this.createElements(),this.initializePageCounter(),this.initializePaginator()):this.table.options.progressiveLoad&&(this.subscribe("data-params",this.remotePageParams.bind(this)),this.subscribe("data-loaded",this._parseRemoteData.bind(this)),this.subscribe("table-built",this.calculatePageSizes.bind(this)),this.subscribe("data-processed",this.initialLoadComplete.bind(this)),this.initializeProgressive(this.table.options.progressiveLoad),"scroll"===this.table.options.progressiveLoad&&this.subscribe("scroll-vertical",this.scrollVertical.bind(this)))}rowAddingPosition(t,e){var i,s=this.table.rowManager,n=s.getDisplayRows();return e?n.length?i=n[0]:s.activeRows.length&&(i=s.activeRows[s.activeRows.length-1],e=!1):n.length&&(i=n[n.length-1],e=!(n.length<this.size)),{index:i,top:e}}calculatePageSizes(){var t,e;this.table.options.paginationSize?this.size=this.table.options.paginationSize:((t=document.createElement("div")).classList.add("tabulator-row"),t.style.visibility="hidden",(e=document.createElement("div")).classList.add("tabulator-cell"),e.innerHTML="Page Row Test",t.appendChild(e),this.table.rowManager.getTableElement().appendChild(t),this.size=Math.floor(this.table.rowManager.getElement().clientHeight/t.offsetHeight),this.table.rowManager.getTableElement().removeChild(t)),this.dispatchExternal("pageSizeChanged",this.size),this.generatePageSizeSelectList()}initialLoadComplete(){this.initialLoad=!1}remotePageParams(t,e,i,s){return this.initialLoad||(this.progressiveLoad&&!i||!this.progressiveLoad&&!this.dataChanging)&&this.reset(!0),s.page=this.page,this.size&&(s.size=this.size),s}userSetPageToRow(t){return this.table.options.pagination&&(t=this.table.rowManager.findRow(t))?this.setPageToRow(t):Promise.reject()}userSetPageSize(t){return!!this.table.options.pagination&&(this.setPageSize(t),this.setPage(1))}scrollVertical(t,e){var i;e||this.table.dataLoader.loading||(i=this.table.rowManager.getElement()).scrollHeight-i.clientHeight-t<(this.table.options.progressiveLoadScrollMargin||2*i.clientHeight)&&this.nextPage().catch(()=>{})}restOnRenderBefore(t,e){return e||"local"===this.mode&&this.reset(),t}rowsUpdated(){this.refreshData(!0,"all")}createElements(){var t;this.element=document.createElement("span"),this.element.classList.add("tabulator-paginator"),this.pagesElement=document.createElement("span"),this.pagesElement.classList.add("tabulator-pages"),(t=document.createElement("button")).classList.add("tabulator-page"),t.setAttribute("type","button"),t.setAttribute("role","button"),t.setAttribute("aria-label",""),t.setAttribute("title",""),this.firstBut=t.cloneNode(!0),this.firstBut.setAttribute("data-page","first"),this.prevBut=t.cloneNode(!0),this.prevBut.setAttribute("data-page","prev"),this.nextBut=t.cloneNode(!0),this.nextBut.setAttribute("data-page","next"),this.lastBut=t.cloneNode(!0),this.lastBut.setAttribute("data-page","last"),this.table.options.paginationSizeSelector&&(this.pageSizeSelect=document.createElement("select"),this.pageSizeSelect.classList.add("tabulator-page-size"))}generatePageSizeSelectList(){var t=[];if(this.pageSizeSelect){if(Array.isArray(this.table.options.paginationSizeSelector))t=this.table.options.paginationSizeSelector,this.pageSizes=t,-1==this.pageSizes.indexOf(this.size)&&t.unshift(this.size);else if(-1==this.pageSizes.indexOf(this.size)){t=[];for(let e=1;e<5;e++)t.push(this.size*e);this.pageSizes=t}else t=this.pageSizes;for(;this.pageSizeSelect.firstChild;)this.pageSizeSelect.removeChild(this.pageSizeSelect.firstChild);t.forEach(t=>{var e=document.createElement("option");e.value=t,!0===t?this.langBind("pagination|all",function(t){e.innerHTML=t}):e.innerHTML=t,this.pageSizeSelect.appendChild(e)}),this.pageSizeSelect.value=this.size}}initializePageCounter(){var t=this.table.options.paginationCounter,e=null;t&&((e="function"==typeof t?t:al.pageCounters[t])?(this.pageCounter=e,this.pageCounterElement=document.createElement("span"),this.pageCounterElement.classList.add("tabulator-page-counter")):console.warn("Pagination Error - No such page counter found: ",t))}initializePaginator(t){var e,i;t||(this.langBind("pagination|first",t=>{this.firstBut.innerHTML=t}),this.langBind("pagination|first_title",t=>{this.firstBut.setAttribute("aria-label",t),this.firstBut.setAttribute("title",t)}),this.langBind("pagination|prev",t=>{this.prevBut.innerHTML=t}),this.langBind("pagination|prev_title",t=>{this.prevBut.setAttribute("aria-label",t),this.prevBut.setAttribute("title",t)}),this.langBind("pagination|next",t=>{this.nextBut.innerHTML=t}),this.langBind("pagination|next_title",t=>{this.nextBut.setAttribute("aria-label",t),this.nextBut.setAttribute("title",t)}),this.langBind("pagination|last",t=>{this.lastBut.innerHTML=t}),this.langBind("pagination|last_title",t=>{this.lastBut.setAttribute("aria-label",t),this.lastBut.setAttribute("title",t)}),this.firstBut.addEventListener("click",()=>{this.setPage(1)}),this.prevBut.addEventListener("click",()=>{this.previousPage()}),this.nextBut.addEventListener("click",()=>{this.nextPage()}),this.lastBut.addEventListener("click",()=>{this.setPage(this.max)}),this.table.options.paginationElement&&(this.element=this.table.options.paginationElement),this.pageSizeSelect&&(e=document.createElement("label"),this.langBind("pagination|page_size",t=>{this.pageSizeSelect.setAttribute("aria-label",t),this.pageSizeSelect.setAttribute("title",t),e.innerHTML=t}),this.element.appendChild(e),this.element.appendChild(this.pageSizeSelect),this.pageSizeSelect.addEventListener("change",t=>{this.setPageSize("true"==this.pageSizeSelect.value||this.pageSizeSelect.value),this.setPage(1)})),this.element.appendChild(this.firstBut),this.element.appendChild(this.prevBut),this.element.appendChild(this.pagesElement),this.element.appendChild(this.nextBut),this.element.appendChild(this.lastBut),this.table.options.paginationElement||(this.table.options.paginationCounter&&(this.table.options.paginationCounterElement?this.table.options.paginationCounterElement instanceof HTMLElement?this.table.options.paginationCounterElement.appendChild(this.pageCounterElement):"string"==typeof this.table.options.paginationCounterElement&&((i=document.querySelector(this.table.options.paginationCounterElement))?i.appendChild(this.pageCounterElement):console.warn("Pagination Error - Unable to find element matching paginationCounterElement selector:",this.table.options.paginationCounterElement)):this.footerAppend(this.pageCounterElement)),this.footerAppend(this.element)),this.page=this.table.options.paginationInitialPage,this.count=this.table.options.paginationButtonCount),this.mode=this.table.options.paginationMode}initializeProgressive(t){this.initializePaginator(!0),this.mode="progressive_"+t,this.progressiveLoad=!0}trackChanges(){this.dispatch("page-changed")}setMaxRows(t){this.max=t?!0===this.size?1:Math.ceil(t/this.size):1,this.page>this.max&&(this.page=this.max)}reset(t){this.initialLoad||("local"==this.mode||t)&&(this.page=1,this.trackChanges())}setMaxPage(t){t=parseInt(t),this.max=t||1,this.page>this.max&&(this.page=this.max,this.trigger())}setPage(t){switch(t){case"first":return this.setPage(1);case"prev":return this.previousPage();case"next":return this.nextPage();case"last":return this.setPage(this.max)}return(t=parseInt(t))>0&&t<=this.max||"local"!==this.mode?(this.page=t,this.trackChanges(),this.trigger()):(console.warn("Pagination Error - Requested page is out of range of 1 - "+this.max+":",t),Promise.reject())}setPageToRow(t){var e=this.displayRows(-1).indexOf(t);if(e>-1){var i=!0===this.size?1:Math.ceil((e+1)/this.size);return this.setPage(i)}return console.warn("Pagination Error - Requested row is not visible"),Promise.reject()}setPageSize(t){!0!==t&&(t=parseInt(t)),t>0&&(this.size=t,this.dispatchExternal("pageSizeChanged",t)),this.pageSizeSelect&&this.generatePageSizeSelectList(),this.trackChanges()}_setPageCounter(t,e,i){var s;if(this.pageCounter)switch("remote"===this.mode&&(e=this.size,i=(this.page-1)*this.size+1,t=this.remoteRowCountEstimate),typeof(s=this.pageCounter.call(this,e,i,this.page,t,this.max))){case"object":if(s instanceof Node){for(;this.pageCounterElement.firstChild;)this.pageCounterElement.removeChild(this.pageCounterElement.firstChild);this.pageCounterElement.appendChild(s)}else this.pageCounterElement.innerHTML="",null!=s&&console.warn("Page Counter Error - Page Counter has returned a type of object, the only valid page counter object return is an instance of Node, the page counter returned:",s);break;case"undefined":this.pageCounterElement.innerHTML="";break;default:this.pageCounterElement.innerHTML=s}}_setPageButtons(){let t=Math.floor((this.count-1)/2),e=Math.ceil((this.count-1)/2),i=this.max-this.page+t+1<this.count?this.max-this.count+1:Math.max(this.page-t,1),s=this.page<=e?Math.min(this.count,this.max):Math.min(this.page+e,this.max);for(;this.pagesElement.firstChild;)this.pagesElement.removeChild(this.pagesElement.firstChild);1==this.page?(this.firstBut.disabled=!0,this.prevBut.disabled=!0):(this.firstBut.disabled=!1,this.prevBut.disabled=!1),this.page==this.max?(this.lastBut.disabled=!0,this.nextBut.disabled=!0):(this.lastBut.disabled=!1,this.nextBut.disabled=!1);for(let t=i;t<=s;t++)t>0&&t<=this.max&&this.pagesElement.appendChild(this._generatePageButton(t));this.footerRedraw()}_generatePageButton(t){var e=document.createElement("button");return e.classList.add("tabulator-page"),t==this.page&&e.classList.add("active"),e.setAttribute("type","button"),e.setAttribute("role","button"),this.langBind("pagination|page_title",i=>{e.setAttribute("aria-label",i+" "+t),e.setAttribute("title",i+" "+t)}),e.setAttribute("data-page",t),e.textContent=t,e.addEventListener("click",e=>{this.setPage(t)}),e}previousPage(){return this.page>1?(this.page--,this.trackChanges(),this.trigger()):(console.warn("Pagination Error - Previous page would be less than page 1:",0),Promise.reject())}nextPage(){return this.page<this.max?(this.page++,this.trackChanges(),this.trigger()):(this.progressiveLoad||console.warn("Pagination Error - Next page would be greater than maximum page of "+this.max+":",this.max+1),Promise.reject())}getPage(){return this.page}getPageMax(){return this.max}getPageSize(t){return this.size}getMode(){return this.mode}getRows(t){var e,i,s,n,o=0,r=t.filter(t=>"row"===t.type);if("local"==this.mode){e=[],this.setMaxRows(t.length),!0===this.size?(i=0,s=t.length):s=(i=this.size*(this.page-1))+parseInt(this.size),this._setPageButtons();for(let r=i;r<s;r++){let i=t[r];i&&(e.push(i),"row"===i.type&&(n||(n=i),o++))}return this._setPageCounter(r.length,o,n?r.indexOf(n)+1:0),e}return this._setPageButtons(),this._setPageCounter(r.length),t.slice(0)}trigger(){var t;switch(this.mode){case"local":return t=this.table.rowManager.scrollLeft,this.refreshData(),this.table.rowManager.scrollHorizontal(t),this.dispatchExternal("pageLoaded",this.getPage()),Promise.resolve();case"remote":return this.dataChanging=!0,this.reloadData(null).finally(()=>{this.dataChanging=!1});case"progressive_load":case"progressive_scroll":return this.reloadData(null,!0);default:return console.warn("Pagination Error - no such pagination mode:",this.mode),Promise.reject()}}_parseRemoteData(t){var e,i;if(void 0===t.last_page&&console.warn("Remote Pagination Error - Server response missing '"+(this.options("dataReceiveParams").last_page||"last_page")+"' property"),t.data){if(this.max=parseInt(t.last_page)||1,this.remoteRowCountEstimate=void 0!==t.last_row?t.last_row:t.last_page*this.size-(this.page==t.last_page?this.size-t.data.length:0),this.progressiveLoad){switch(this.mode){case"progressive_load":1==this.page?this.table.rowManager.setData(t.data,!1,1==this.page):this.table.rowManager.addRows(t.data),this.page<this.max&&setTimeout(()=>{this.nextPage()},this.table.options.progressiveLoadDelay);break;case"progressive_scroll":t=1===this.page?t.data:this.table.rowManager.getData().concat(t.data),this.table.rowManager.setData(t,1!==this.page,1==this.page),e=this.table.options.progressiveLoadScrollMargin||2*this.table.rowManager.element.clientHeight,this.table.rowManager.element.scrollHeight<=this.table.rowManager.element.clientHeight+e&&this.page<this.max&&setTimeout(()=>{this.nextPage()})}return!1}if(this.page>this.max&&(console.warn("Remote Pagination Error - Server returned last page value lower than the current page"),i=this.options("paginationOutOfRange")))return this.setPage("function"==typeof i?i.call(this,this.page,this.max):i);this.dispatchExternal("pageLoaded",this.getPage())}else console.warn("Remote Pagination Error - Server response missing '"+(this.options("dataReceiveParams").data||"data")+"' property");return t.data}footerRedraw(){var t=this.table.footerManager.containerElement;Math.ceil(t.clientWidth)-t.scrollWidth<0?this.pagesElement.style.display="none":(this.pagesElement.style.display="",Math.ceil(t.clientWidth)-t.scrollWidth<0&&(this.pagesElement.style.display="none"))}}var ll={local:function(t,e){var i=localStorage.getItem(t+"-"+e);return!!i&&JSON.parse(i)},cookie:function(t,e){var i,s,n=document.cookie,o=t+"-"+e,r=n.indexOf(o+"=");return r>-1&&((i=(n=n.slice(r)).indexOf(";"))>-1&&(n=n.slice(0,i)),s=n.replace(o+"=","")),!!s&&JSON.parse(s)}},hl={local:function(t,e,i){localStorage.setItem(t+"-"+e,JSON.stringify(i))},cookie:function(t,e,i){var s=new Date;s.setDate(s.getDate()+1e4),document.cookie=t+"-"+e+"="+JSON.stringify(i)+"; expires="+s.toUTCString()}};class cl extends na{static moduleName="persistence";static moduleInitOrder=-10;static readers=ll;static writers=hl;constructor(t){super(t),this.mode="",this.id="",this.defWatcherBlock=!1,this.config={},this.readFunc=!1,this.writeFunc=!1,this.registerTableOption("persistence",!1),this.registerTableOption("persistenceID",""),this.registerTableOption("persistenceMode",!0),this.registerTableOption("persistenceReaderFunc",!1),this.registerTableOption("persistenceWriterFunc",!1)}localStorageTest(){var t="_tabulator_test";try{return window.localStorage.setItem(t,t),window.localStorage.removeItem(t),!0}catch(t){return!1}}initialize(){if(this.table.options.persistence){var t,e=this.table.options.persistenceMode,i=this.table.options.persistenceID;this.mode=!0!==e?e:this.localStorageTest()?"local":"cookie",this.table.options.persistenceReaderFunc?"function"==typeof this.table.options.persistenceReaderFunc?this.readFunc=this.table.options.persistenceReaderFunc:cl.readers[this.table.options.persistenceReaderFunc]?this.readFunc=cl.readers[this.table.options.persistenceReaderFunc]:console.warn("Persistence Read Error - invalid reader set",this.table.options.persistenceReaderFunc):cl.readers[this.mode]?this.readFunc=cl.readers[this.mode]:console.warn("Persistence Read Error - invalid reader set",this.mode),this.table.options.persistenceWriterFunc?"function"==typeof this.table.options.persistenceWriterFunc?this.writeFunc=this.table.options.persistenceWriterFunc:cl.writers[this.table.options.persistenceWriterFunc]?this.writeFunc=cl.writers[this.table.options.persistenceWriterFunc]:console.warn("Persistence Write Error - invalid reader set",this.table.options.persistenceWriterFunc):cl.writers[this.mode]?this.writeFunc=cl.writers[this.mode]:console.warn("Persistence Write Error - invalid writer set",this.mode),this.id="tabulator-"+(i||this.table.element.getAttribute("id")||""),this.config={sort:!0===this.table.options.persistence||this.table.options.persistence.sort,filter:!0===this.table.options.persistence||this.table.options.persistence.filter,headerFilter:!0===this.table.options.persistence||this.table.options.persistence.headerFilter,group:!0===this.table.options.persistence||this.table.options.persistence.group,page:!0===this.table.options.persistence||this.table.options.persistence.page,columns:!0===this.table.options.persistence?["title","width","visible"]:this.table.options.persistence.columns},this.config.page&&(t=this.retrieveData("page"))&&(void 0===t.paginationSize||!0!==this.config.page&&!this.config.page.size||(this.table.options.paginationSize=t.paginationSize),void 0===t.paginationInitialPage||!0!==this.config.page&&!this.config.page.page||(this.table.options.paginationInitialPage=t.paginationInitialPage)),this.config.group&&(t=this.retrieveData("group"))&&(void 0===t.groupBy||!0!==this.config.group&&!this.config.group.groupBy||(this.table.options.groupBy=t.groupBy),void 0===t.groupStartOpen||!0!==this.config.group&&!this.config.group.groupStartOpen||(this.table.options.groupStartOpen=t.groupStartOpen),void 0===t.groupHeader||!0!==this.config.group&&!this.config.group.groupHeader||(this.table.options.groupHeader=t.groupHeader)),this.config.columns&&(this.table.options.columns=this.load("columns",this.table.options.columns),this.subscribe("column-init",this.initializeColumn.bind(this)),this.subscribe("column-show",this.save.bind(this,"columns")),this.subscribe("column-hide",this.save.bind(this,"columns")),this.subscribe("column-moved",this.save.bind(this,"columns"))),this.subscribe("table-built",this.tableBuilt.bind(this),0),this.subscribe("table-redraw",this.tableRedraw.bind(this)),this.subscribe("filter-changed",this.eventSave.bind(this,"filter")),this.subscribe("filter-changed",this.eventSave.bind(this,"headerFilter")),this.subscribe("sort-changed",this.eventSave.bind(this,"sort")),this.subscribe("group-changed",this.eventSave.bind(this,"group")),this.subscribe("page-changed",this.eventSave.bind(this,"page")),this.subscribe("column-resized",this.eventSave.bind(this,"columns")),this.subscribe("column-width",this.eventSave.bind(this,"columns")),this.subscribe("layout-refreshed",this.eventSave.bind(this,"columns"))}this.registerTableFunction("getColumnLayout",this.getColumnLayout.bind(this)),this.registerTableFunction("setColumnLayout",this.setColumnLayout.bind(this))}eventSave(t){this.config[t]&&this.save(t)}tableBuilt(){var t,e,i;this.config.sort&&0==!(t=this.load("sort"))&&(this.table.options.initialSort=t),this.config.filter&&0==!(e=this.load("filter"))&&(this.table.options.initialFilter=e),this.config.headerFilter&&0==!(i=this.load("headerFilter"))&&(this.table.options.initialHeaderFilter=i)}tableRedraw(t){t&&this.config.columns&&this.save("columns")}getColumnLayout(){return this.parseColumns(this.table.columnManager.getColumns())}setColumnLayout(t){return this.table.columnManager.setColumns(this.mergeDefinition(this.table.options.columns,t,!0)),!0}initializeColumn(t){var e;this.config.columns&&(this.defWatcherBlock=!0,e=t.getDefinition(),(!0===this.config.columns?Object.keys(e):this.config.columns).forEach(t=>{var i=Object.getOwnPropertyDescriptor(e,t),s=e[t];i&&Object.defineProperty(e,t,{set:t=>{s=t,this.defWatcherBlock||this.save("columns"),i.set&&i.set(t)},get:()=>(i.get&&i.get(),s)})}),this.defWatcherBlock=!1)}load(t,e){var i=this.retrieveData(t);return e&&(i=i?this.mergeDefinition(e,i):e),i}retrieveData(t){return!!this.readFunc&&this.readFunc(this.id,t)}mergeDefinition(t,e,i){var s=[];return(e=e||[]).forEach((e,n)=>{var o,r=this._findColumn(t,e);r&&(i?o=Object.keys(e):!0===this.config.columns||null==this.config.columns?(o=Object.keys(r)).push("width"):o=this.config.columns,o.forEach(t=>{"columns"!==t&&void 0!==e[t]&&(r[t]=e[t])}),r.columns&&(r.columns=this.mergeDefinition(r.columns,e.columns)),s.push(r))}),t.forEach((t,i)=>{this._findColumn(e,t)||(s.length>i?s.splice(i,0,t):s.push(t))}),s}_findColumn(t,e){var i=e.columns?"group":e.field?"field":"object";return t.find(function(t){switch(i){case"group":return t.title===e.title&&t.columns.length===e.columns.length;case"field":return t.field===e.field;case"object":return t===e}})}save(t){var e={};switch(t){case"columns":e=this.parseColumns(this.table.columnManager.getColumns());break;case"filter":e=this.table.modules.filter.getFilters();break;case"headerFilter":e=this.table.modules.filter.getHeaderFilters();break;case"sort":e=this.validateSorters(this.table.modules.sort.getSort());break;case"group":e=this.getGroupConfig();break;case"page":e=this.getPageConfig()}this.writeFunc&&this.writeFunc(this.id,t,e)}validateSorters(t){return t.forEach(function(t){t.column=t.field,delete t.field}),t}getGroupConfig(){var t={};return this.config.group&&((!0===this.config.group||this.config.group.groupBy)&&(t.groupBy=this.table.options.groupBy),(!0===this.config.group||this.config.group.groupStartOpen)&&(t.groupStartOpen=this.table.options.groupStartOpen),(!0===this.config.group||this.config.group.groupHeader)&&(t.groupHeader=this.table.options.groupHeader)),t}getPageConfig(){var t={};return this.config.page&&((!0===this.config.page||this.config.page.size)&&(t.paginationSize=this.table.modules.page.getPageSize()),(!0===this.config.page||this.config.page.page)&&(t.paginationInitialPage=this.table.modules.page.getPage())),t}parseColumns(t){var e=[],i=["headerContextMenu","headerMenu","contextMenu","clickMenu"];return t.forEach(t=>{var s,n={},o=t.getDefinition();t.isGroup?(n.title=o.title,n.columns=this.parseColumns(t.getColumns())):(n.field=t.getField(),!0===this.config.columns||null==this.config.columns?((s=Object.keys(o)).push("width"),s.push("visible")):s=this.config.columns,s.forEach(e=>{switch(e){case"width":n.width=t.getWidth();break;case"visible":n.visible=t.visible;break;default:"function"!=typeof o[e]&&-1===i.indexOf(e)&&(n[e]=o[e])}})),e.push(n)}),e}}var dl={format:{formatters:{responsiveCollapse:function(t,e,i){var s=document.createElement("div"),n=t.getRow()._row.modules.responsiveLayout;function o(t){var e=n.element;n.open=t,e&&(n.open?(s.classList.add("open"),e.style.display=""):(s.classList.remove("open"),e.style.display="none"))}return s.classList.add("tabulator-responsive-collapse-toggle"),s.innerHTML='<svg class=\'tabulator-responsive-collapse-toggle-open\' viewbox="0 0 24 24">\n  <line x1="7" y1="12" x2="17" y2="12" fill="none" stroke-width="3" stroke-linecap="round" />\n  <line y1="7" x1="12" y2="17" x2="12" fill="none" stroke-width="3" stroke-linecap="round" />\n</svg>\n\n<svg class=\'tabulator-responsive-collapse-toggle-close\' viewbox="0 0 24 24">\n  <line x1="7" y1="12" x2="17" y2="12"  fill="none" stroke-width="3" stroke-linecap="round" />\n</svg>',t.getElement().classList.add("tabulator-row-handle"),s.addEventListener("click",function(e){e.stopImmediatePropagation(),o(!n.open),t.getTable().rowManager.adjustTableSize()}),o(n.open),s}}}},ul={format:{formatters:{rowSelection:function(t,e,i){var s=document.createElement("input"),n=!1;if(s.type="checkbox",s.setAttribute("aria-label","Select Row"),this.table.modExists("selectRow",!0))if(s.addEventListener("click",t=>{t.stopPropagation()}),"function"==typeof t.getRow){var o=t.getRow();o instanceof Ea?(s.addEventListener("change",t=>{"click"===this.table.options.selectableRowsRangeMode&&n?n=!1:o.toggleSelect()}),"click"===this.table.options.selectableRowsRangeMode&&s.addEventListener("click",t=>{n=!0,this.table.modules.selectRow.handleComplexRowClick(o._row,t)}),s.checked=o.isSelected&&o.isSelected(),this.table.modules.selectRow.registerRowSelectCheckbox(o,s)):s=""}else s.addEventListener("change",t=>{this.table.modules.selectRow.selectedRows.length?this.table.deselectRow():this.table.selectRow(e.rowRange)}),this.table.modules.selectRow.registerHeaderSelectCheckbox(s);return s}}}};class pl{constructor(t){return this._range=t,new Proxy(this,{get:function(t,e,i){return void 0!==t[e]?t[e]:t._range.table.componentFunctionBinder.handle("range",t._range,e)}})}getElement(){return this._range.element}getData(){return this._range.getData()}getCells(){return this._range.getCells(!0,!0)}getStructuredCells(){return this._range.getStructuredCells()}getRows(){return this._range.getRows().map(t=>t.getComponent())}getColumns(){return this._range.getColumns().map(t=>t.getComponent())}getBounds(){return this._range.getBounds()}getTopEdge(){return this._range.top}getBottomEdge(){return this._range.bottom}getLeftEdge(){return this._range.left}getRightEdge(){return this._range.right}setBounds(t,e){this._range.destroyedGuard("setBounds")&&this._range.setBounds(t?t._cell:t,e?e._cell:e)}setStartBound(t){this._range.destroyedGuard("setStartBound")&&(this._range.setEndBound(t?t._cell:t),this._range.rangeManager.layoutElement())}setEndBound(t){this._range.destroyedGuard("setEndBound")&&(this._range.setEndBound(t?t._cell:t),this._range.rangeManager.layoutElement())}clearValues(){this._range.destroyedGuard("clearValues")&&this._range.clearValues()}remove(){this._range.destroyedGuard("remove")&&this._range.destroy(!0)}}class ml extends ea{constructor(t,e,i,s){super(t),this.rangeManager=e,this.element=null,this.initialized=!1,this.initializing={start:!1,end:!1},this.destroyed=!1,this.top=0,this.bottom=0,this.left=0,this.right=0,this.table=t,this.start={row:void 0,col:void 0},this.end={row:void 0,col:void 0},this.rangeManager.rowHeader&&(this.left=1,this.right=1,this.start.col=1,this.end.col=1),this.initElement(),setTimeout(()=>{this.initBounds(i,s)})}initElement(){this.element=document.createElement("div"),this.element.classList.add("tabulator-range")}initBounds(t,e){this._updateMinMax(),t&&this.setBounds(t,e||t)}setStart(t,e){this.start.row===t&&this.start.col===e||(this.start.row=t,this.start.col=e,this.initializing.start=!0,this._updateMinMax())}setEnd(t,e){this.end.row===t&&this.end.col===e||(this.end.row=t,this.end.col=e,this.initializing.end=!0,this._updateMinMax())}setBounds(t,e,i){t&&this.setStartBound(t),this.setEndBound(e||t),this.rangeManager.layoutElement(i)}setStartBound(t){var e,i;"column"===t.type?this.rangeManager.columnSelection&&this.setStart(0,t.getPosition()-1):(e=t.row.position-1,i=t.column.getPosition()-1,t.column===this.rangeManager.rowHeader?this.setStart(e,1):this.setStart(e,i))}setEndBound(t){var e,i,s,n=this._getTableRows().length;"column"===t.type?this.rangeManager.columnSelection&&("column"===this.rangeManager.selecting?this.setEnd(n-1,t.getPosition()-1):"cell"===this.rangeManager.selecting&&this.setEnd(0,t.getPosition()-1)):(e=t.row.position-1,i=t.column.getPosition()-1,s=t.column===this.rangeManager.rowHeader,"row"===this.rangeManager.selecting?this.setEnd(e,this._getTableColumns().length-1):"row"!==this.rangeManager.selecting&&s?this.setEnd(e,0):"column"===this.rangeManager.selecting?this.setEnd(n-1,i):this.setEnd(e,i))}_updateMinMax(){this.top=Math.min(this.start.row,this.end.row),this.bottom=Math.max(this.start.row,this.end.row),this.left=Math.min(this.start.col,this.end.col),this.right=Math.max(this.start.col,this.end.col),this.initialized?this.dispatchExternal("rangeChanged",this.getComponent()):this.initializing.start&&this.initializing.end&&(this.initialized=!0,this.dispatchExternal("rangeAdded",this.getComponent()))}_getTableColumns(){return this.table.columnManager.getVisibleColumnsByIndex()}_getTableRows(){return this.table.rowManager.getDisplayRows().filter(t=>"row"===t.type)}layout(){var t,e,i,s,n,o,r,a,l,h,c=this.table.rowManager.renderer.vDomTop,d=this.table.rowManager.renderer.vDomBottom,u=this.table.columnManager.renderer.leftCol,p=this.table.columnManager.renderer.rightCol;"virtual"===this.table.options.renderHorizontal&&this.rangeManager.rowHeader&&(p+=1),null==c&&(c=0),null==d&&(d=1/0),null==u&&(u=0),null==p&&(p=1/0),this.overlaps(u,c,p,d)&&(t=Math.max(this.top,c),e=Math.min(this.bottom,d),i=Math.max(this.left,u),s=Math.min(this.right,p),n=this.rangeManager.getCell(t,i),o=this.rangeManager.getCell(e,s),r=n.getElement(),a=o.getElement(),l=n.row.getElement(),h=o.row.getElement(),this.element.classList.add("tabulator-range-active"),this.table.rtl?(this.element.style.right=l.offsetWidth-r.offsetLeft-r.offsetWidth+"px",this.element.style.width=r.offsetLeft+r.offsetWidth-a.offsetLeft+"px"):(this.element.style.left=l.offsetLeft+r.offsetLeft+"px",this.element.style.width=a.offsetLeft+a.offsetWidth-r.offsetLeft+"px"),this.element.style.top=l.offsetTop+"px",this.element.style.height=h.offsetTop+h.offsetHeight-l.offsetTop+"px")}atTopLeft(t){return t.row.position-1===this.top&&t.column.getPosition()-1===this.left}atBottomRight(t){return t.row.position-1===this.bottom&&t.column.getPosition()-1===this.right}occupies(t){return this.occupiesRow(t.row)&&this.occupiesColumn(t.column)}occupiesRow(t){return this.top<=t.position-1&&t.position-1<=this.bottom}occupiesColumn(t){return this.left<=t.getPosition()-1&&t.getPosition()-1<=this.right}overlaps(t,e,i,s){return!(this.left>i||t>this.right||this.top>s||e>this.bottom)}getData(){var t=[],e=this.getRows(),i=this.getColumns();return e.forEach(e=>{var s=e.getData(),n={};i.forEach(t=>{n[t.field]=s[t.field]}),t.push(n)}),t}getCells(t,e){var i=[],s=this.getRows(),n=this.getColumns();return t?i=s.map(t=>{var i=[];return t.getCells().forEach(t=>{n.includes(t.column)&&i.push(e?t.getComponent():t)}),i}):s.forEach(t=>{t.getCells().forEach(t=>{n.includes(t.column)&&i.push(e?t.getComponent():t)})}),i}getStructuredCells(){return this.getCells(!0,!0)}getRows(){return this._getTableRows().slice(this.top,this.bottom+1)}getColumns(){return this._getTableColumns().slice(this.left,this.right+1)}clearValues(){var t=this.getCells(),e=this.table.options.selectableRangeClearCellsValue;this.table.blockRedraw(),t.forEach(t=>{t.setValue(e)}),this.table.restoreRedraw()}getBounds(t){var e=this.getCells(!1,t),i={start:null,end:null};return e.length?(i.start=e[0],i.end=e[e.length-1]):console.warn("No bounds defined on range"),i}getComponent(){return this.component||(this.component=new pl(this)),this.component}destroy(t){this.destroyed=!0,this.element.remove(),t&&this.rangeManager.rangeRemoved(this),this.initialized&&this.dispatchExternal("rangeRemoved",this.getComponent())}destroyedGuard(t){return this.destroyed&&console.warn("You cannot call the "+t+" function on a destroyed range"),!this.destroyed}}var gl={keybindings:{bindings:{rangeJumpUp:["ctrl + 38","meta + 38"],rangeJumpDown:["ctrl + 40","meta + 40"],rangeJumpLeft:["ctrl + 37","meta + 37"],rangeJumpRight:["ctrl + 39","meta + 39"],rangeExpandUp:"shift + 38",rangeExpandDown:"shift + 40",rangeExpandLeft:"shift + 37",rangeExpandRight:"shift + 39",rangeExpandJumpUp:["ctrl + shift + 38","meta + shift + 38"],rangeExpandJumpDown:["ctrl + shift + 40","meta + shift + 40"],rangeExpandJumpLeft:["ctrl + shift + 37","meta + shift + 37"],rangeExpandJumpRight:["ctrl + shift + 39","meta + shift + 39"]},actions:{rangeJumpLeft:function(t){this.dispatch("keybinding-nav-range",t,"left",!0,!1)},rangeJumpRight:function(t){this.dispatch("keybinding-nav-range",t,"right",!0,!1)},rangeJumpUp:function(t){this.dispatch("keybinding-nav-range",t,"up",!0,!1)},rangeJumpDown:function(t){this.dispatch("keybinding-nav-range",t,"down",!0,!1)},rangeExpandLeft:function(t){this.dispatch("keybinding-nav-range",t,"left",!1,!0)},rangeExpandRight:function(t){this.dispatch("keybinding-nav-range",t,"right",!1,!0)},rangeExpandUp:function(t){this.dispatch("keybinding-nav-range",t,"up",!1,!0)},rangeExpandDown:function(t){this.dispatch("keybinding-nav-range",t,"down",!1,!0)},rangeExpandJumpLeft:function(t){this.dispatch("keybinding-nav-range",t,"left",!0,!0)},rangeExpandJumpRight:function(t){this.dispatch("keybinding-nav-range",t,"right",!0,!0)},rangeExpandJumpUp:function(t){this.dispatch("keybinding-nav-range",t,"up",!0,!0)},rangeExpandJumpDown:function(t){this.dispatch("keybinding-nav-range",t,"down",!0,!0)}}},clipboard:{pasteActions:{range:function(t){var e,i,s,n,o,r=[],a=this.table.modules.selectRange.activeRange,l=!1;return o=t.length,a&&(i=(e=a.getBounds()).start,e.start===e.end&&(l=!0),i&&(s=(r=this.table.rowManager.activeRows.slice()).indexOf(i.row),n=l?t.length:r.indexOf(e.end.row)-s+1,s>-1&&(this.table.blockRedraw(),(r=r.slice(s,s+n)).forEach((e,i)=>{e.updateData(t[i%o])}),this.table.restoreRedraw()))),r}},pasteParsers:{range:function(t){var e,i,s,n,o,r=[],a=[],l=this.table.modules.selectRange.activeRange,h=!1;return!!(l&&(i=(e=l.getBounds()).start,e.start===e.end&&(h=!0),i&&((t=t.split("\n")).forEach(function(t){r.push(t.split("\t"))}),r.length&&(o=(n=this.table.columnManager.getVisibleColumnsByIndex()).indexOf(i.column))>-1)))&&(s=h?r[0].length:n.indexOf(e.end.column)-o+1,n=n.slice(o,o+s),r.forEach(t=>{var e={},i=t.length;n.forEach(function(s,n){e[s.field]=t[n%i]}),a.push(e)}),a)}}},export:{columnLookups:{range:function(){var t=this.modules.selectRange.selectedColumns();return this.columnManager.rowHeader&&t.unshift(this.columnManager.rowHeader),t}},rowLookups:{range:function(){return this.modules.selectRange.selectedRows()}}}};function bl(t,e,i,s,n,o,r){var a=this.table.dependencyRegistry.lookup(["luxon","DateTime"],"DateTime"),l=r.format||"dd/MM/yyyy HH:mm:ss",h=r.alignEmptyValues,c=0;if(void 0!==a){if(a.isDateTime(t)||(t="iso"===l?a.fromISO(String(t)):"x"===l?a.fromMillis(t):a.fromFormat(String(t),l)),a.isDateTime(e)||(e="iso"===l?a.fromISO(String(e)):"x"===l?a.fromMillis(e):a.fromFormat(String(e),l)),t.isValid){if(e.isValid)return t-e;c=1}else c=e.isValid?-1:0;return("top"===h&&"desc"===o||"bottom"===h&&"asc"===o)&&(c*=-1),c}console.error("Sort Error - 'datetime' sorter is dependant on luxon.js")}var fl={number:function(t,e,i,s,n,o,r){var a=r.alignEmptyValues,l=r.decimalSeparator,h=r.thousandSeparator,c=0;if(t=String(t),e=String(e),h&&(t=t.split(h).join(""),e=e.split(h).join("")),l&&(t=t.split(l).join("."),e=e.split(l).join(".")),t=parseFloat(t),e=parseFloat(e),isNaN(t))c=isNaN(e)?0:-1;else{if(!isNaN(e))return t-e;c=1}return("top"===a&&"desc"===o||"bottom"===a&&"asc"===o)&&(c*=-1),c},string:function(t,e,i,s,n,o,r){var a,l=r.alignEmptyValues,h=0;if(t){if(e){switch(typeof r.locale){case"boolean":r.locale&&(a=this.langLocale());break;case"string":a=r.locale}return String(t).toLowerCase().localeCompare(String(e).toLowerCase(),a)}h=1}else h=e?-1:0;return("top"===l&&"desc"===o||"bottom"===l&&"asc"===o)&&(h*=-1),h},date:function(t,e,i,s,n,o,r){return r.format||(r.format="dd/MM/yyyy"),bl.call(this,t,e,i,s,n,o,r)},time:function(t,e,i,s,n,o,r){return r.format||(r.format="HH:mm"),bl.call(this,t,e,i,s,n,o,r)},datetime:bl,boolean:function(t,e,i,s,n,o,r){return(!0===t||"true"===t||"True"===t||1===t?1:0)-(!0===e||"true"===e||"True"===e||1===e?1:0)},array:function(t,e,i,s,n,o,r){var a,l=r.type||"length",h=r.alignEmptyValues,c=0,d=this.table;function u(t){var e;switch(a&&(t=a(t)),l){case"length":e=t.length;break;case"sum":e=t.reduce(function(t,e){return t+e});break;case"max":e=Math.max.apply(null,t);break;case"min":e=Math.min.apply(null,t);break;case"avg":e=t.reduce(function(t,e){return t+e})/t.length;break;case"string":e=t.join("")}return e}if(r.valueMap&&(a="string"==typeof r.valueMap?function(t){return t.map(t=>ia.retrieveNestedData(d.options.nestedFieldSeparator,r.valueMap,t))}:r.valueMap),Array.isArray(t)){if(Array.isArray(e))return"string"===l?String(u(t)).toLowerCase().localeCompare(String(u(e)).toLowerCase()):u(e)-u(t);c=1}else c=Array.isArray(e)?-1:0;return("top"===h&&"desc"===o||"bottom"===h&&"asc"===o)&&(c*=-1),c},exists:function(t,e,i,s,n,o,r){return(void 0===t?0:1)-(void 0===e?0:1)},alphanum:function(t,e,i,s,n,o,r){var a,l,h,c,d,u=0,p=/(\d+)|(\D+)/g,m=/\d/,g=r.alignEmptyValues,b=0;if(t||0===t){if(e||0===e){if(isFinite(t)&&isFinite(e))return t-e;if((a=String(t).toLowerCase())===(l=String(e).toLowerCase()))return 0;if(!m.test(a)||!m.test(l))return a>l?1:-1;for(a=a.match(p),l=l.match(p),d=a.length>l.length?l.length:a.length;u<d;)if((h=a[u])!==(c=l[u++]))return isFinite(h)&&isFinite(c)?("0"===h.charAt(0)&&(h="."+h),"0"===c.charAt(0)&&(c="."+c),h-c):h>c?1:-1;return a.length>l.length}b=1}else b=e||0===e?-1:0;return("top"===g&&"desc"===o||"bottom"===g&&"asc"===o)&&(b*=-1),b}};class vl extends na{static moduleName="sort";static sorters=fl;constructor(t){super(t),this.sortList=[],this.changed=!1,this.registerTableOption("sortMode","local"),this.registerTableOption("initialSort",!1),this.registerTableOption("columnHeaderSortMulti",!0),this.registerTableOption("sortOrderReverse",!1),this.registerTableOption("headerSortElement","<div class='tabulator-arrow'></div>"),this.registerTableOption("headerSortClickElement","header"),this.registerColumnOption("sorter"),this.registerColumnOption("sorterParams"),this.registerColumnOption("headerSort",!0),this.registerColumnOption("headerSortStartingDir"),this.registerColumnOption("headerSortTristate")}initialize(){this.subscribe("column-layout",this.initializeColumn.bind(this)),this.subscribe("table-built",this.tableBuilt.bind(this)),this.registerDataHandler(this.sort.bind(this),20),this.registerTableFunction("setSort",this.userSetSort.bind(this)),this.registerTableFunction("getSorters",this.getSort.bind(this)),this.registerTableFunction("clearSort",this.clearSort.bind(this)),"remote"===this.table.options.sortMode&&this.subscribe("data-params",this.remoteSortParams.bind(this))}tableBuilt(){this.table.options.initialSort&&this.setSort(this.table.options.initialSort)}remoteSortParams(t,e,i,s){var n=this.getSort();return n.forEach(t=>{delete t.column}),s.sort=n,s}userSetSort(t,e){this.setSort(t,e),this.refreshSort()}clearSort(){this.clear(),this.refreshSort()}initializeColumn(t){var e,i,s=!1;switch(typeof t.definition.sorter){case"string":vl.sorters[t.definition.sorter]?s=vl.sorters[t.definition.sorter]:console.warn("Sort Error - No such sorter found: ",t.definition.sorter);break;case"function":s=t.definition.sorter}if(t.modules.sort={sorter:s,dir:"none",params:t.definition.sorterParams||{},startingDir:t.definition.headerSortStartingDir||"asc",tristate:t.definition.headerSortTristate},!1!==t.definition.headerSort){switch((e=t.getElement()).classList.add("tabulator-sortable"),(i=document.createElement("div")).classList.add("tabulator-col-sorter"),"icon"===this.table.options.headerSortClickElement?i.classList.add("tabulator-col-sorter-element"):e.classList.add("tabulator-col-sorter-element"),this.table.options.headerSortElement){case"function":break;case"object":i.appendChild(this.table.options.headerSortElement);break;default:i.innerHTML=this.table.options.headerSortElement}t.titleHolderElement.appendChild(i),t.modules.sort.element=i,this.setColumnHeaderSortIcon(t,"none"),"icon"===this.table.options.headerSortClickElement&&i.addEventListener("mousedown",t=>{t.stopPropagation()}),("icon"===this.table.options.headerSortClickElement?i:e).addEventListener("click",e=>{var i="",s=[],n=!1;if(t.modules.sort){if(t.modules.sort.tristate)i="none"==t.modules.sort.dir?t.modules.sort.startingDir:t.modules.sort.dir==t.modules.sort.startingDir?"asc"==t.modules.sort.dir?"desc":"asc":"none";else switch(t.modules.sort.dir){case"asc":i="desc";break;case"desc":i="asc";break;default:i=t.modules.sort.startingDir}this.table.options.columnHeaderSortMulti&&(e.shiftKey||e.ctrlKey)?(n=(s=this.getSort()).findIndex(e=>e.field===t.getField()),n>-1?(s[n].dir=i,n=s.splice(n,1)[0],"none"!=i&&s.push(n)):"none"!=i&&s.push({column:t,dir:i}),this.setSort(s)):"none"==i?this.clear():this.setSort(t,i),this.refreshSort()}})}}refreshSort(){"remote"===this.table.options.sortMode?this.reloadData(null,!1,!1):this.refreshData(!0)}hasChanged(){var t=this.changed;return this.changed=!1,t}getSort(){var t=[];return this.sortList.forEach(function(e){e.column&&t.push({column:e.column.getComponent(),field:e.column.getField(),dir:e.dir})}),t}setSort(t,e){var i=this,s=[];Array.isArray(t)||(t=[{column:t,dir:e}]),t.forEach(function(t){var e;(e=i.table.columnManager.findColumn(t.column))?(t.column=e,s.push(t),i.changed=!0):console.warn("Sort Warning - Sort field does not exist and is being ignored: ",t.column)}),i.sortList=s,this.dispatch("sort-changed")}clear(){this.setSort([])}findSorter(t){var e,i=this.table.rowManager.activeRows[0],s="string";if(i&&(i=i.getData(),t.getField()))switch(typeof(e=t.getFieldValue(i))){case"undefined":s="string";break;case"boolean":s="boolean";break;default:isNaN(Number(e))||""===e?e.match(/((^[0-9]+[a-z]+)|(^[a-z]+[0-9]+))+$/i)&&(s="alphanum"):s="number"}return vl.sorters[s]}sort(t,e){var i=this,s=this.table.options.sortOrderReverse?i.sortList.slice().reverse():i.sortList,n=[],o=[];return this.subscribedExternal("dataSorting")&&this.dispatchExternal("dataSorting",i.getSort()),e||i.clearColumnHeaders(),"remote"!==this.table.options.sortMode?(s.forEach(function(t,s){var o;t.column&&((o=t.column.modules.sort)&&(o.sorter||(o.sorter=i.findSorter(t.column)),t.params="function"==typeof o.params?o.params(t.column.getComponent(),t.dir):o.params,n.push(t)),e||i.setColumnHeader(t.column,t.dir))}),n.length&&i._sortItems(t,n)):e||s.forEach(function(t,e){i.setColumnHeader(t.column,t.dir)}),this.subscribedExternal("dataSorted")&&(t.forEach(t=>{o.push(t.getComponent())}),this.dispatchExternal("dataSorted",i.getSort(),o)),t}clearColumnHeaders(){this.table.columnManager.getRealColumns().forEach(t=>{t.modules.sort&&(t.modules.sort.dir="none",t.getElement().setAttribute("aria-sort","none"),this.setColumnHeaderSortIcon(t,"none"))})}setColumnHeader(t,e){t.modules.sort.dir=e,t.getElement().setAttribute("aria-sort","asc"===e?"ascending":"descending"),this.setColumnHeaderSortIcon(t,e)}setColumnHeaderSortIcon(t,e){var i,s=t.modules.sort.element;if(t.definition.headerSort&&"function"==typeof this.table.options.headerSortElement){for(;s.firstChild;)s.removeChild(s.firstChild);"object"==typeof(i=this.table.options.headerSortElement.call(this.table,t.getComponent(),e))?s.appendChild(i):s.innerHTML=i}}_sortItems(t,e){var i=e.length-1;t.sort((t,s)=>{for(var n,o=i;o>=0;o--){let i=e[o];if(0!==(n=this._sortRow(t,s,i.column,i.dir,i.params)))break}return n})}_sortRow(t,e,i,s,n){var o,r,a="asc"==s?t:e,l="asc"==s?e:t;return t=void 0!==(t=i.getFieldValue(a.getData()))?t:"",e=void 0!==(e=i.getFieldValue(l.getData()))?e:"",o=a.getComponent(),r=l.getComponent(),i.modules.sort.sorter.call(this,t,e,o,r,i.getComponent(),s,n)}}class wl{constructor(t,e){this.columnCount=t,this.rowCount=e,this.columnString=[],this.columns=[],this.rows=[]}genColumns(t){var e=Math.max(this.columnCount,Math.max(...t.map(t=>t.length)));this.columnString=[],this.columns=[];for(let t=1;t<=e;t++)this.incrementChar(this.columnString.length-1),this.columns.push(this.columnString.join(""));return this.columns}genRows(t){var e=Math.max(this.rowCount,t.length);this.rows=[];for(let t=1;t<=e;t++)this.rows.push(t);return this.rows}incrementChar(t){let e=this.columnString[t];e?"Z"!==e?this.columnString[t]=String.fromCharCode(this.columnString[t].charCodeAt(0)+1):(this.columnString[t]="A",t?this.incrementChar(t-1):this.columnString.push("A")):this.columnString.push("A")}setRowCount(t){this.rowCount=t}setColumnCount(t){this.columnCount=t}}class yl{constructor(t){return this._sheet=t,new Proxy(this,{get:function(t,e,i){return void 0!==t[e]?t[e]:t._sheet.table.componentFunctionBinder.handle("sheet",t._sheet,e)}})}getTitle(){return this._sheet.title}getKey(){return this._sheet.key}getDefinition(){return this._sheet.getDefinition()}getData(){return this._sheet.getData()}setData(t){return this._sheet.setData(t)}clear(){return this._sheet.clear()}remove(){return this._sheet.remove()}active(){return this._sheet.active()}setTitle(t){return this._sheet.setTitle(t)}setRows(t){return this._sheet.setRows(t)}setColumns(t){return this._sheet.setColumns(t)}}class _l extends ea{constructor(t,e){super(t.table),this.spreadsheetManager=t,this.definition=e,this.title=this.definition.title||"",this.key=this.definition.key||this.definition.title,this.rowCount=this.definition.rows,this.columnCount=this.definition.columns,this.data=this.definition.data||[],this.element=null,this.isActive=!1,this.grid=new wl(this.columnCount,this.rowCount),this.defaultColumnDefinition={width:100,headerHozAlign:"center",headerSort:!1},this.columnDefinition=Object.assign(this.defaultColumnDefinition,this.options("spreadsheetColumnDefinition")),this.columnDefs=[],this.rowDefs=[],this.columnFields=[],this.columns=[],this.rows=[],this.scrollTop=null,this.scrollLeft=null,this.initialize(),this.dispatchExternal("sheetAdded",this.getComponent())}initialize(){this.initializeElement(),this.initializeColumns(),this.initializeRows()}reinitialize(){this.initializeColumns(),this.initializeRows()}initializeElement(){this.element=document.createElement("div"),this.element.classList.add("tabulator-spreadsheet-tab"),this.element.innerText=this.title,this.element.addEventListener("click",()=>{this.spreadsheetManager.loadSheet(this)})}initializeColumns(){this.grid.setColumnCount(this.columnCount),this.columnFields=this.grid.genColumns(this.data),this.columnDefs=[],this.columnFields.forEach(t=>{var e=Object.assign({},this.columnDefinition);e.field=t,e.title=t,this.columnDefs.push(e)})}initializeRows(){var t;this.grid.setRowCount(this.rowCount),t=this.grid.genRows(this.data),this.rowDefs=[],t.forEach((t,e)=>{var i={_id:t},s=this.data[e];s&&s.forEach((t,e)=>{var s=this.columnFields[e];s&&(i[s]=t)}),this.rowDefs.push(i)})}unload(){this.isActive=!1,this.scrollTop=this.table.rowManager.scrollTop,this.scrollLeft=this.table.rowManager.scrollLeft,this.data=this.getData(!0),this.element.classList.remove("tabulator-spreadsheet-tab-active")}load(){var t=!this.isActive;this.isActive=!0,this.table.blockRedraw(),this.table.setData([]),this.table.setColumns(this.columnDefs),this.table.setData(this.rowDefs),this.table.restoreRedraw(),t&&null!==this.scrollTop&&(this.table.rowManager.element.scrollLeft=this.scrollLeft,this.table.rowManager.element.scrollTop=this.scrollTop),this.element.classList.add("tabulator-spreadsheet-tab-active"),this.dispatchExternal("sheetLoaded",this.getComponent())}getComponent(){return new yl(this)}getDefinition(){return{title:this.title,key:this.key,rows:this.rowCount,columns:this.columnCount,data:this.getData()}}getData(t){var e,i,s,n=[];return this.rowDefs.forEach(t=>{var e=[];this.columnFields.forEach(i=>{e.push(t[i])}),n.push(e)}),t||this.options("spreadsheetOutputFull")||(e=n.map(t=>t.findLastIndex(t=>void 0!==t)+1),i=Math.max(...e),s=e.findLastIndex(t=>t>0)+1,n=(n=n.slice(0,s)).map(t=>t.slice(0,i))),n}setData(t){this.data=t,this.reinitialize(),this.dispatchExternal("sheetUpdated",this.getComponent()),this.isActive&&this.load()}clear(){this.setData([])}setTitle(t){this.title=t,this.element.innerText=t,this.dispatchExternal("sheetUpdated",this.getComponent())}setRows(t){this.rowCount=t,this.initializeRows(),this.dispatchExternal("sheetUpdated",this.getComponent()),this.isActive&&this.load()}setColumns(t){this.columnCount=t,this.reinitialize(),this.dispatchExternal("sheetUpdated",this.getComponent()),this.isActive&&this.load()}remove(){this.spreadsheetManager.removeSheet(this)}destroy(){this.element.parentNode&&this.element.parentNode.removeChild(this.element),this.dispatchExternal("sheetRemoved",this.getComponent())}active(){this.spreadsheetManager.loadSheet(this)}}var xl={integer:function(t,e,i){return""===e||null==e||(e=Number(e),!isNaN(e)&&isFinite(e)&&Math.floor(e)===e)},float:function(t,e,i){return""===e||null==e||(e=Number(e),!isNaN(e)&&isFinite(e)&&e%1!=0)},numeric:function(t,e,i){return""===e||null==e||!isNaN(e)},string:function(t,e,i){return""===e||null==e||isNaN(e)},alphanumeric:function(t,e,i){return""===e||null==e||new RegExp(/^[a-z0-9]+$/i).test(e)},max:function(t,e,i){return""===e||null==e||parseFloat(e)<=i},min:function(t,e,i){return""===e||null==e||parseFloat(e)>=i},starts:function(t,e,i){return""===e||null==e||String(e).toLowerCase().startsWith(String(i).toLowerCase())},ends:function(t,e,i){return""===e||null==e||String(e).toLowerCase().endsWith(String(i).toLowerCase())},minLength:function(t,e,i){return""===e||null==e||String(e).length>=i},maxLength:function(t,e,i){return""===e||null==e||String(e).length<=i},in:function(t,e,i){return""===e||null==e||("string"==typeof i&&(i=i.split("|")),i.indexOf(e)>-1)},regex:function(t,e,i){return""===e||null==e||new RegExp(i).test(e)},unique:function(t,e,i){if(""===e||null==e)return!0;var s=!0,n=t.getData(),o=t.getColumn()._getSelf();return this.table.rowManager.rows.forEach(function(t){var i=t.getData();i!==n&&e==o.getFieldValue(i)&&(s=!1)}),s},required:function(t,e,i){return""!==e&&null!=e}};class Cl extends na{static moduleName="validate";static validators=xl;constructor(t){super(t),this.invalidCells=[],this.registerTableOption("validationMode","blocking"),this.registerColumnOption("validator"),this.registerTableFunction("getInvalidCells",this.getInvalidCells.bind(this)),this.registerTableFunction("clearCellValidation",this.userClearCellValidation.bind(this)),this.registerTableFunction("validate",this.userValidate.bind(this)),this.registerComponentFunction("cell","isValid",this.cellIsValid.bind(this)),this.registerComponentFunction("cell","clearValidation",this.clearValidation.bind(this)),this.registerComponentFunction("cell","validate",this.cellValidate.bind(this)),this.registerComponentFunction("column","validate",this.columnValidate.bind(this)),this.registerComponentFunction("row","validate",this.rowValidate.bind(this))}initialize(){this.subscribe("cell-delete",this.clearValidation.bind(this)),this.subscribe("column-layout",this.initializeColumnCheck.bind(this)),this.subscribe("edit-success",this.editValidate.bind(this)),this.subscribe("edit-editor-clear",this.editorClear.bind(this)),this.subscribe("edit-edited-clear",this.editedClear.bind(this))}editValidate(t,e,i){var s="manual"===this.table.options.validationMode||this.validate(t.column.modules.validate,t,e);return!0!==s&&setTimeout(()=>{t.getElement().classList.add("tabulator-validation-fail"),this.dispatchExternal("validationFailed",t.getComponent(),e,s)}),s}editorClear(t,e){e&&t.column.modules.validate&&this.cellValidate(t),t.getElement().classList.remove("tabulator-validation-fail")}editedClear(t){t.modules.validate&&(t.modules.validate.invalid=!1)}cellIsValid(t){return t.modules.validate&&t.modules.validate.invalid||!0}cellValidate(t){return this.validate(t.column.modules.validate,t,t.getValue())}columnValidate(t){var e=[];return t.cells.forEach(t=>{!0!==this.cellValidate(t)&&e.push(t.getComponent())}),!e.length||e}rowValidate(t){var e=[];return t.cells.forEach(t=>{!0!==this.cellValidate(t)&&e.push(t.getComponent())}),!e.length||e}userClearCellValidation(t){t||(t=this.getInvalidCells()),Array.isArray(t)||(t=[t]),t.forEach(t=>{this.clearValidation(t._getSelf())})}userValidate(t){var e=[];return this.table.rowManager.rows.forEach(t=>{var i=(t=t.getComponent()).validate();!0!==i&&(e=e.concat(i))}),!e.length||e}initializeColumnCheck(t){void 0!==t.definition.validator&&this.initializeColumn(t)}initializeColumn(t){var e,i=this,s=[];t.definition.validator&&(Array.isArray(t.definition.validator)?t.definition.validator.forEach(t=>{(e=i._extractValidator(t))&&s.push(e)}):(e=this._extractValidator(t.definition.validator))&&s.push(e),t.modules.validate=!!s.length&&s)}_extractValidator(t){var e,i,s;switch(typeof t){case"string":return(s=t.indexOf(":"))>-1?(e=t.substring(0,s),i=t.substring(s+1)):e=t,this._buildValidator(e,i);case"function":return this._buildValidator(t);case"object":return this._buildValidator(t.type,t.parameters)}}_buildValidator(t,e){var i="function"==typeof t?t:Cl.validators[t];return i?{type:"function"==typeof t?"function":t,func:i,params:e}:(console.warn("Validator Setup Error - No matching validator found:",t),!1)}validate(t,e,i){var s=this,n=[],o=this.invalidCells.indexOf(e);return t&&t.forEach(t=>{t.func.call(s,e.getComponent(),i,t.params)||n.push({type:t.type,parameters:t.params})}),e.modules.validate||(e.modules.validate={}),n.length?(e.modules.validate.invalid=n,"manual"!==this.table.options.validationMode&&e.getElement().classList.add("tabulator-validation-fail"),-1==o&&this.invalidCells.push(e)):(e.modules.validate.invalid=!1,e.getElement().classList.remove("tabulator-validation-fail"),o>-1&&this.invalidCells.splice(o,1)),!n.length||n}getInvalidCells(){var t=[];return this.invalidCells.forEach(e=>{t.push(e.getComponent())}),t}clearValidation(t){var e;t.modules.validate&&t.modules.validate.invalid&&(t.getElement().classList.remove("tabulator-validation-fail"),t.modules.validate.invalid=!1,(e=this.invalidCells.indexOf(t))>-1&&this.invalidCells.splice(e,1))}}var kl=Object.freeze({__proto__:null,AccessorModule:ra,AjaxModule:ma,ClipboardModule:va,ColumnCalcsModule:Ta,DataTreeModule:class extends na{static moduleName="dataTree";constructor(t){super(t),this.indent=10,this.field="",this.collapseEl=null,this.expandEl=null,this.branchEl=null,this.elementField=!1,this.startOpen=function(){},this.registerTableOption("dataTree",!1),this.registerTableOption("dataTreeFilter",!0),this.registerTableOption("dataTreeSort",!0),this.registerTableOption("dataTreeElementColumn",!1),this.registerTableOption("dataTreeBranchElement",!0),this.registerTableOption("dataTreeChildIndent",9),this.registerTableOption("dataTreeChildField","_children"),this.registerTableOption("dataTreeCollapseElement",!1),this.registerTableOption("dataTreeExpandElement",!1),this.registerTableOption("dataTreeStartExpanded",!1),this.registerTableOption("dataTreeChildColumnCalcs",!1),this.registerTableOption("dataTreeSelectPropagate",!1),this.registerComponentFunction("row","treeCollapse",this.collapseRow.bind(this)),this.registerComponentFunction("row","treeExpand",this.expandRow.bind(this)),this.registerComponentFunction("row","treeToggle",this.toggleRow.bind(this)),this.registerComponentFunction("row","getTreeParent",this.getTreeParent.bind(this)),this.registerComponentFunction("row","getTreeChildren",this.getRowChildren.bind(this)),this.registerComponentFunction("row","addTreeChild",this.addTreeChildRow.bind(this)),this.registerComponentFunction("row","isTreeExpanded",this.isRowExpanded.bind(this))}initialize(){if(this.table.options.dataTree){var t=null,e=this.table.options;switch(this.field=e.dataTreeChildField,this.indent=e.dataTreeChildIndent,this.options("movableRows")&&console.warn("The movableRows option is not available with dataTree enabled, moving of child rows could result in unpredictable behavior"),e.dataTreeBranchElement?!0===e.dataTreeBranchElement?(this.branchEl=document.createElement("div"),this.branchEl.classList.add("tabulator-data-tree-branch")):"string"==typeof e.dataTreeBranchElement?((t=document.createElement("div")).innerHTML=e.dataTreeBranchElement,this.branchEl=t.firstChild):this.branchEl=e.dataTreeBranchElement:(this.branchEl=document.createElement("div"),this.branchEl.classList.add("tabulator-data-tree-branch-empty")),e.dataTreeCollapseElement?"string"==typeof e.dataTreeCollapseElement?((t=document.createElement("div")).innerHTML=e.dataTreeCollapseElement,this.collapseEl=t.firstChild):this.collapseEl=e.dataTreeCollapseElement:(this.collapseEl=document.createElement("div"),this.collapseEl.classList.add("tabulator-data-tree-control"),this.collapseEl.tabIndex=0,this.collapseEl.innerHTML="<div class='tabulator-data-tree-control-collapse'></div>"),e.dataTreeExpandElement?"string"==typeof e.dataTreeExpandElement?((t=document.createElement("div")).innerHTML=e.dataTreeExpandElement,this.expandEl=t.firstChild):this.expandEl=e.dataTreeExpandElement:(this.expandEl=document.createElement("div"),this.expandEl.classList.add("tabulator-data-tree-control"),this.expandEl.tabIndex=0,this.expandEl.innerHTML="<div class='tabulator-data-tree-control-expand'></div>"),typeof e.dataTreeStartExpanded){case"boolean":this.startOpen=function(t,i){return e.dataTreeStartExpanded};break;case"function":this.startOpen=e.dataTreeStartExpanded;break;default:this.startOpen=function(t,i){return e.dataTreeStartExpanded[i]}}this.subscribe("row-init",this.initializeRow.bind(this)),this.subscribe("row-layout-after",this.layoutRow.bind(this)),this.subscribe("row-deleting",this.rowDeleting.bind(this)),this.subscribe("row-deleted",this.rowDelete.bind(this),0),this.subscribe("row-data-changed",this.rowDataChanged.bind(this),10),this.subscribe("cell-value-updated",this.cellValueChanged.bind(this)),this.subscribe("edit-cancelled",this.cellValueChanged.bind(this)),this.subscribe("column-moving-rows",this.columnMoving.bind(this)),this.subscribe("table-built",this.initializeElementField.bind(this)),this.subscribe("table-redrawing",this.tableRedrawing.bind(this)),this.registerDisplayHandler(this.getRows.bind(this),30)}}tableRedrawing(t){t&&this.table.rowManager.getRows().forEach(t=>{this.reinitializeRowChildren(t)})}initializeElementField(){var t=this.table.columnManager.getFirstVisibleColumn();this.elementField=this.table.options.dataTreeElementColumn||!!t&&t.field}getRowChildren(t){return this.getTreeChildren(t,!0)}columnMoving(){var t=[];return this.table.rowManager.rows.forEach(e=>{t=t.concat(this.getTreeChildren(e,!1,!0))}),t}rowDataChanged(t,e,i){this.redrawNeeded(i)&&(this.initializeRow(t),e&&(this.layoutRow(t),this.refreshData(!0)))}cellValueChanged(t){t.column.getField()===this.elementField&&this.layoutRow(t.row)}initializeRow(t){var e=t.getData()[this.field],i=Array.isArray(e),s=i||!i&&"object"==typeof e&&null!==e;!s&&t.modules.dataTree&&t.modules.dataTree.branchEl&&t.modules.dataTree.branchEl.parentNode&&t.modules.dataTree.branchEl.parentNode.removeChild(t.modules.dataTree.branchEl),!s&&t.modules.dataTree&&t.modules.dataTree.controlEl&&t.modules.dataTree.controlEl.parentNode&&t.modules.dataTree.controlEl.parentNode.removeChild(t.modules.dataTree.controlEl),t.modules.dataTree={index:t.modules.dataTree?t.modules.dataTree.index:0,open:!!s&&(t.modules.dataTree?t.modules.dataTree.open:this.startOpen(t.getComponent(),0)),controlEl:!(!t.modules.dataTree||!s)&&t.modules.dataTree.controlEl,branchEl:!(!t.modules.dataTree||!s)&&t.modules.dataTree.branchEl,parent:!!t.modules.dataTree&&t.modules.dataTree.parent,children:s}}reinitializeRowChildren(t){this.getTreeChildren(t,!1,!0).forEach(function(t){t.reinitialize(!0)})}layoutRow(t){var e=(this.elementField?t.getCell(this.elementField):t.getCells()[0]).getElement(),i=t.modules.dataTree;i.branchEl&&(i.branchEl.parentNode&&i.branchEl.parentNode.removeChild(i.branchEl),i.branchEl=!1),i.controlEl&&(i.controlEl.parentNode&&i.controlEl.parentNode.removeChild(i.controlEl),i.controlEl=!1),this.generateControlElement(t,e),t.getElement().classList.add("tabulator-tree-level-"+i.index),i.index&&(this.branchEl?(i.branchEl=this.branchEl.cloneNode(!0),e.insertBefore(i.branchEl,e.firstChild),this.table.rtl?i.branchEl.style.marginRight=(i.branchEl.offsetWidth+i.branchEl.style.marginLeft)*(i.index-1)+i.index*this.indent+"px":i.branchEl.style.marginLeft=(i.branchEl.offsetWidth+i.branchEl.style.marginRight)*(i.index-1)+i.index*this.indent+"px"):this.table.rtl?e.style.paddingRight=parseInt(window.getComputedStyle(e,null).getPropertyValue("padding-right"))+i.index*this.indent+"px":e.style.paddingLeft=parseInt(window.getComputedStyle(e,null).getPropertyValue("padding-left"))+i.index*this.indent+"px")}generateControlElement(t,e){var i=t.modules.dataTree,s=i.controlEl;e=e||t.getCells()[0].getElement(),!1!==i.children&&(i.open?(i.controlEl=this.collapseEl.cloneNode(!0),i.controlEl.addEventListener("click",e=>{e.stopPropagation(),this.collapseRow(t)})):(i.controlEl=this.expandEl.cloneNode(!0),i.controlEl.addEventListener("click",e=>{e.stopPropagation(),this.expandRow(t)})),i.controlEl.addEventListener("mousedown",t=>{t.stopPropagation()}),s&&s.parentNode===e?s.parentNode.replaceChild(i.controlEl,s):e.insertBefore(i.controlEl,e.firstChild))}getRows(t){var e=[];return t.forEach((t,i)=>{var s;e.push(t),t instanceof Ra&&(t.create(),(s=t.modules.dataTree).index||!1===s.children||this.getChildren(t,!1,!0).forEach(t=>{t.create(),e.push(t)}))}),e}getChildren(t,e,i){var s=t.modules.dataTree,n=[],o=[];return!1!==s.children&&(s.open||e)&&(Array.isArray(s.children)||(s.children=this.generateChildren(t)),n=this.table.modExists("filter")&&this.table.options.dataTreeFilter?this.table.modules.filter.filter(s.children):s.children,this.table.modExists("sort")&&this.table.options.dataTreeSort&&this.table.modules.sort.sort(n,i),n.forEach(t=>{o.push(t),this.getChildren(t,!1,!0).forEach(t=>{o.push(t)})})),o}generateChildren(t){var e=[],i=t.getData()[this.field];return Array.isArray(i)||(i=[i]),i.forEach(i=>{var s=new Ra(i||{},this.table.rowManager);s.create(),s.modules.dataTree.index=t.modules.dataTree.index+1,s.modules.dataTree.parent=t,s.modules.dataTree.children&&(s.modules.dataTree.open=this.startOpen(s.getComponent(),s.modules.dataTree.index)),e.push(s)}),e}expandRow(t,e){var i=t.modules.dataTree;!1!==i.children&&(i.open=!0,t.reinitialize(),this.refreshData(!0),this.dispatchExternal("dataTreeRowExpanded",t.getComponent(),t.modules.dataTree.index))}collapseRow(t){var e=t.modules.dataTree;!1!==e.children&&(e.open=!1,t.reinitialize(),this.refreshData(!0),this.dispatchExternal("dataTreeRowCollapsed",t.getComponent(),t.modules.dataTree.index))}toggleRow(t){var e=t.modules.dataTree;!1!==e.children&&(e.open?this.collapseRow(t):this.expandRow(t))}isRowExpanded(t){return t.modules.dataTree.open}getTreeParent(t){return!!t.modules.dataTree.parent&&t.modules.dataTree.parent.getComponent()}getTreeParentRoot(t){return t.modules.dataTree&&t.modules.dataTree.parent?this.getTreeParentRoot(t.modules.dataTree.parent):t}getFilteredTreeChildren(t){var e=t.modules.dataTree,i=[];return e.children&&(Array.isArray(e.children)||(e.children=this.generateChildren(t)),(this.table.modExists("filter")&&this.table.options.dataTreeFilter?this.table.modules.filter.filter(e.children):e.children).forEach(t=>{t instanceof Ra&&i.push(t)})),i}rowDeleting(t){var e=t.modules.dataTree;e&&e.children&&Array.isArray(e.children)&&e.children.forEach(t=>{t instanceof Ra&&t.wipe()})}rowDelete(t){var e,i=t.modules.dataTree.parent;i&&(!1!==(e=this.findChildIndex(t,i))&&i.data[this.field].splice(e,1),i.data[this.field].length||delete i.data[this.field],this.initializeRow(i),this.layoutRow(i)),this.refreshData(!0)}addTreeChildRow(t,e,i,s){var n=!1;"string"==typeof e&&(e=JSON.parse(e)),Array.isArray(t.data[this.field])||(t.data[this.field]=[],t.modules.dataTree.open=this.startOpen(t.getComponent(),t.modules.dataTree.index)),void 0!==s&&!1!==(n=this.findChildIndex(s,t))&&t.data[this.field].splice(i?n:n+1,0,e),!1===n&&(i?t.data[this.field].unshift(e):t.data[this.field].push(e)),this.initializeRow(t),this.layoutRow(t),this.refreshData(!0)}findChildIndex(t,e){var i=!1;return"object"==typeof t?t instanceof Ra?i=t.data:t instanceof Ea?i=t._getSelf().data:"undefined"!=typeof HTMLElement&&t instanceof HTMLElement?e.modules.dataTree&&(i=e.modules.dataTree.children.find(e=>e instanceof Ra&&e.element===t))&&(i=i.data):null===t&&(i=!1):i=void 0!==t&&e.data[this.field].find(e=>e.data[this.table.options.index]==t),i&&(Array.isArray(e.data[this.field])&&(i=e.data[this.field].indexOf(i)),-1==i&&(i=!1)),i}getTreeChildren(t,e,i){var s=t.modules.dataTree,n=[];return s&&s.children&&(Array.isArray(s.children)||(s.children=this.generateChildren(t)),s.children.forEach(t=>{t instanceof Ra&&(n.push(e?t.getComponent():t),i&&this.getTreeChildren(t,e,i).forEach(t=>{n.push(t)}))})),n}getChildField(){return this.field}redrawNeeded(t){return!!this.field&&void 0!==t[this.field]||!!this.elementField&&void 0!==t[this.elementField]}},DownloadModule:Da,EditModule:Na,ExportModule:Ha,FilterModule:Ba,FormatModule:Wa,FrozenColumnsModule:class extends na{static moduleName="frozenColumns";constructor(t){super(t),this.leftColumns=[],this.rightColumns=[],this.initializationMode="left",this.active=!1,this.blocked=!0,this.registerColumnOption("frozen")}reset(){this.initializationMode="left",this.leftColumns=[],this.rightColumns=[],this.active=!1}initialize(){this.subscribe("cell-layout",this.layoutCell.bind(this)),this.subscribe("column-init",this.initializeColumn.bind(this)),this.subscribe("column-width",this.layout.bind(this)),this.subscribe("row-layout-after",this.layoutRow.bind(this)),this.subscribe("table-layout",this.layout.bind(this)),this.subscribe("columns-loading",this.reset.bind(this)),this.subscribe("column-add",this.reinitializeColumns.bind(this)),this.subscribe("column-deleted",this.reinitializeColumns.bind(this)),this.subscribe("column-hide",this.reinitializeColumns.bind(this)),this.subscribe("column-show",this.reinitializeColumns.bind(this)),this.subscribe("columns-loaded",this.reinitializeColumns.bind(this)),this.subscribe("table-redraw",this.layout.bind(this)),this.subscribe("layout-refreshing",this.blockLayout.bind(this)),this.subscribe("layout-refreshed",this.unblockLayout.bind(this)),this.subscribe("scrollbar-vertical",this.adjustForScrollbar.bind(this))}blockLayout(){this.blocked=!0}unblockLayout(){this.blocked=!1}layoutCell(t){this.layoutElement(t.element,t.column)}reinitializeColumns(){this.reset(),this.table.columnManager.columnsByIndex.forEach(t=>{this.initializeColumn(t)}),this.layout()}initializeColumn(t){var e={margin:0,edge:!1};t.isGroup||(this.frozenCheck(t)?(e.position=this.initializationMode,"left"==this.initializationMode?this.leftColumns.push(t):this.rightColumns.unshift(t),this.active=!0,t.modules.frozen=e):this.initializationMode="right")}frozenCheck(t){return t.parent.isGroup&&t.definition.frozen&&console.warn("Frozen Column Error - Parent column group must be frozen, not individual columns or sub column groups"),t.parent.isGroup?this.frozenCheck(t.parent):t.definition.frozen}layoutCalcRows(){this.table.modExists("columnCalcs")&&(this.table.modules.columnCalcs.topInitialized&&this.table.modules.columnCalcs.topRow&&this.layoutRow(this.table.modules.columnCalcs.topRow),this.table.modules.columnCalcs.botInitialized&&this.table.modules.columnCalcs.botRow&&this.layoutRow(this.table.modules.columnCalcs.botRow),this.table.modExists("groupRows")&&this.layoutGroupCalcs(this.table.modules.groupRows.getGroups()))}layoutGroupCalcs(t){t.forEach(t=>{t.calcs.top&&this.layoutRow(t.calcs.top),t.calcs.bottom&&this.layoutRow(t.calcs.bottom),t.groupList&&t.groupList.length&&this.layoutGroupCalcs(t.groupList)})}layoutColumnPosition(t){var e=[],i=0,s=0;this.leftColumns.forEach((s,n)=>{if(s.modules.frozen.marginValue=i,s.modules.frozen.margin=s.modules.frozen.marginValue+"px",s.visible&&(i+=s.getWidth()),n==this.leftColumns.length-1?s.modules.frozen.edge=!0:s.modules.frozen.edge=!1,s.parent.isGroup){var o=this.getColGroupParentElement(s);e.includes(o)||(this.layoutElement(o,s),e.push(o)),o.classList.toggle("tabulator-frozen-left",s.modules.frozen.edge&&"left"===s.modules.frozen.position),o.classList.toggle("tabulator-frozen-right",s.modules.frozen.edge&&"right"===s.modules.frozen.position)}else this.layoutElement(s.getElement(),s);t&&s.cells.forEach(t=>{this.layoutElement(t.getElement(!0),s)})}),this.rightColumns.forEach((e,i)=>{e.modules.frozen.marginValue=s,e.modules.frozen.margin=e.modules.frozen.marginValue+"px",e.visible&&(s+=e.getWidth()),i==this.rightColumns.length-1?e.modules.frozen.edge=!0:e.modules.frozen.edge=!1,e.parent.isGroup?this.layoutElement(this.getColGroupParentElement(e),e):this.layoutElement(e.getElement(),e),t&&e.cells.forEach(t=>{this.layoutElement(t.getElement(!0),e)})})}getColGroupParentElement(t){return t.parent.isGroup?this.getColGroupParentElement(t.parent):t.getElement()}layout(){this.active&&!this.blocked&&(this.layoutColumnPosition(),this.reinitializeRows(),this.layoutCalcRows())}reinitializeRows(){var t=this.table.rowManager.getVisibleRows(!0);this.table.rowManager.getRows().filter(e=>!t.includes(e)).forEach(t=>{t.deinitialize()}),t.forEach(t=>{"row"===t.type&&this.layoutRow(t)})}layoutRow(t){"fitDataFill"===this.table.options.layout&&this.rightColumns.length&&(this.table.rowManager.getTableElement().style.minWidth="calc(100% - "+this.rightMargin+")"),this.leftColumns.forEach(e=>{var i=t.getCell(e);i&&this.layoutElement(i.getElement(!0),e)}),this.rightColumns.forEach(e=>{var i=t.getCell(e);i&&this.layoutElement(i.getElement(!0),e)})}layoutElement(t,e){var i;e.modules.frozen&&t&&(t.style.position="sticky",i=this.table.rtl?"left"===e.modules.frozen.position?"right":"left":e.modules.frozen.position,t.style[i]=e.modules.frozen.margin,t.classList.add("tabulator-frozen"),t.classList.toggle("tabulator-frozen-left",e.modules.frozen.edge&&"left"===e.modules.frozen.position),t.classList.toggle("tabulator-frozen-right",e.modules.frozen.edge&&"right"===e.modules.frozen.position))}adjustForScrollbar(t){this.rightColumns.length&&(this.table.columnManager.getContentsElement().style.width="calc(100% - "+t+"px)")}getFrozenColumns(){return this.leftColumns.concat(this.rightColumns)}_calcSpace(t,e){var i=0;for(let s=0;s<e;s++)t[s].visible&&(i+=t[s].getWidth());return i}},FrozenRowsModule:class extends na{static moduleName="frozenRows";constructor(t){super(t),this.topElement=document.createElement("div"),this.rows=[],this.registerComponentFunction("row","freeze",this.freezeRow.bind(this)),this.registerComponentFunction("row","unfreeze",this.unfreezeRow.bind(this)),this.registerComponentFunction("row","isFrozen",this.isRowFrozen.bind(this)),this.registerTableOption("frozenRowsField","id"),this.registerTableOption("frozenRows",!1)}initialize(){var t=document.createDocumentFragment();this.rows=[],this.topElement.classList.add("tabulator-frozen-rows-holder"),t.appendChild(this.topElement),this.table.columnManager.getContentsElement().insertBefore(t,this.table.columnManager.headersElement.nextSibling),this.subscribe("row-deleting",this.detachRow.bind(this)),this.subscribe("rows-visible",this.visibleRows.bind(this)),this.registerDisplayHandler(this.getRows.bind(this),10),this.table.options.frozenRows&&(this.subscribe("data-processed",this.initializeRows.bind(this)),this.subscribe("row-added",this.initializeRow.bind(this)),this.subscribe("table-redrawing",this.resizeHolderWidth.bind(this)),this.subscribe("column-resized",this.resizeHolderWidth.bind(this)),this.subscribe("column-show",this.resizeHolderWidth.bind(this)),this.subscribe("column-hide",this.resizeHolderWidth.bind(this))),this.resizeHolderWidth()}resizeHolderWidth(){this.topElement.style.minWidth=this.table.columnManager.headersElement.offsetWidth+"px"}initializeRows(){this.table.rowManager.getRows().forEach(t=>{this.initializeRow(t)})}initializeRow(t){var e=this.table.options.frozenRows,i=typeof e;"number"===i?t.getPosition()&&t.getPosition()+this.rows.length<=e&&this.freezeRow(t):"function"===i?e.call(this.table,t.getComponent())&&this.freezeRow(t):Array.isArray(e)&&e.includes(t.data[this.options("frozenRowsField")])&&this.freezeRow(t)}isRowFrozen(t){return this.rows.indexOf(t)>-1}isFrozen(){return!!this.rows.length}visibleRows(t,e){return this.rows.forEach(t=>{e.push(t)}),e}getRows(t){var e=t.slice(0);return this.rows.forEach(function(t){var i=e.indexOf(t);i>-1&&e.splice(i,1)}),e}freezeRow(t){t.modules.frozen?console.warn("Freeze Error - Row is already frozen"):(t.modules.frozen=!0,this.topElement.appendChild(t.getElement()),t.initialize(),t.normalizeHeight(),this.rows.push(t),this.refreshData(!1,"display"),this.table.rowManager.adjustTableSize(),this.styleRows())}unfreezeRow(t){t.modules.frozen?(t.modules.frozen=!1,this.detachRow(t),this.table.rowManager.adjustTableSize(),this.refreshData(!1,"display"),this.rows.length&&this.styleRows()):console.warn("Freeze Error - Row is already unfrozen")}detachRow(t){var e=this.rows.indexOf(t);if(e>-1){var i=t.getElement();i.parentNode&&i.parentNode.removeChild(i),this.rows.splice(e,1)}}styleRows(t){this.rows.forEach((t,e)=>{this.table.rowManager.styleRow(t,e)})}},GroupRowsModule:class extends na{static moduleName="groupRows";constructor(t){super(t),this.groupIDLookups=!1,this.startOpen=[function(){return!1}],this.headerGenerator=[function(){return""}],this.groupList=[],this.allowedValues=!1,this.groups={},this.displayHandler=this.getRows.bind(this),this.blockRedraw=!1,this.registerTableOption("groupBy",!1),this.registerTableOption("groupStartOpen",!0),this.registerTableOption("groupValues",!1),this.registerTableOption("groupUpdateOnCellEdit",!1),this.registerTableOption("groupHeader",!1),this.registerTableOption("groupHeaderPrint",null),this.registerTableOption("groupHeaderClipboard",null),this.registerTableOption("groupHeaderHtmlOutput",null),this.registerTableOption("groupHeaderDownload",null),this.registerTableOption("groupToggleElement","arrow"),this.registerTableOption("groupClosedShowCalcs",!1),this.registerTableFunction("setGroupBy",this.setGroupBy.bind(this)),this.registerTableFunction("setGroupValues",this.setGroupValues.bind(this)),this.registerTableFunction("setGroupStartOpen",this.setGroupStartOpen.bind(this)),this.registerTableFunction("setGroupHeader",this.setGroupHeader.bind(this)),this.registerTableFunction("getGroups",this.userGetGroups.bind(this)),this.registerTableFunction("getGroupedData",this.userGetGroupedData.bind(this)),this.registerComponentFunction("row","getGroup",this.rowGetGroup.bind(this))}initialize(){this.subscribe("table-destroy",this._blockRedrawing.bind(this)),this.subscribe("rows-wipe",this._blockRedrawing.bind(this)),this.subscribe("rows-wiped",this._restore_redrawing.bind(this)),this.table.options.groupBy&&(this.table.options.groupUpdateOnCellEdit&&(this.subscribe("cell-value-updated",this.cellUpdated.bind(this)),this.subscribe("row-data-changed",this.reassignRowToGroup.bind(this),0)),this.subscribe("table-built",this.configureGroupSetup.bind(this)),this.subscribe("row-deleting",this.rowDeleting.bind(this)),this.subscribe("row-deleted",this.rowsUpdated.bind(this)),this.subscribe("scroll-horizontal",this.scrollHeaders.bind(this)),this.subscribe("rows-wipe",this.wipe.bind(this)),this.subscribe("rows-added",this.rowsUpdated.bind(this)),this.subscribe("row-moving",this.rowMoving.bind(this)),this.subscribe("row-adding-index",this.rowAddingIndex.bind(this)),this.subscribe("rows-sample",this.rowSample.bind(this)),this.subscribe("render-virtual-fill",this.virtualRenderFill.bind(this)),this.subscribe("table-layout",this.virtualRenderFill.bind(this)),this.registerDisplayHandler(this.displayHandler,20),this.initialized=!0)}_blockRedrawing(){this.blockRedraw=!0}_restore_redrawing(){this.blockRedraw=!1}configureGroupSetup(){if(this.table.options.groupBy){var t=this.table.options.groupBy,e=this.table.options.groupStartOpen,i=this.table.options.groupHeader;this.allowedValues=this.table.options.groupValues,Array.isArray(t)&&Array.isArray(i)&&t.length>i.length&&console.warn("Error creating group headers, groupHeader array is shorter than groupBy array"),this.headerGenerator=[function(){return""}],this.startOpen=[function(){return!1}],this.langBind("groups|item",(t,e)=>{this.headerGenerator[0]=(i,s,n)=>(void 0===i?"":i)+"<span>("+s+" "+(1===s?t:e.groups.items)+")</span>"}),this.groupIDLookups=[],t?this.table.modExists("columnCalcs")&&"table"!=this.table.options.columnCalcs&&"both"!=this.table.options.columnCalcs&&this.table.modules.columnCalcs.removeCalcs():this.table.modExists("columnCalcs")&&"group"!=this.table.options.columnCalcs&&this.table.columnManager.getRealColumns().forEach(t=>{t.definition.topCalc&&this.table.modules.columnCalcs.initializeTopRow(),t.definition.bottomCalc&&this.table.modules.columnCalcs.initializeBottomRow()}),Array.isArray(t)||(t=[t]),t.forEach((t,e)=>{var i,s;i="function"==typeof t?t:(s=this.table.columnManager.getColumnByField(t))?function(t){return s.getFieldValue(t)}:function(e){return e[t]},this.groupIDLookups.push({field:"function"!=typeof t&&t,func:i,values:!!this.allowedValues&&this.allowedValues[e]})}),e&&(Array.isArray(e)||(e=[e]),e.forEach(t=>{}),this.startOpen=e),i&&(this.headerGenerator=Array.isArray(i)?i:[i])}else this.groupList=[],this.groups={}}rowSample(t,e){if(this.table.options.groupBy){var i=this.getGroups(!1)[0];e.push(i.getRows(!1)[0])}return e}virtualRenderFill(){const t=this.layoutMode();"fitDataFill"!==t&&"fitDataStretch"!==t&&"fitColumns"!==t||(this.table.rowManager.tableElement.style.minWidth=this.table.columnManager.getWidth()+"px")}rowAddingIndex(t,e,i){if(this.table.options.groupBy){this.assignRowToGroup(t);var s=t.modules.group.rows;return s.length>1&&(!e||e&&-1==s.indexOf(e)?i?s[0]!==t&&(e=s[0],this.table.rowManager.moveRowInArray(t.modules.group.rows,t,e,!i)):s[s.length-1]!==t&&(e=s[s.length-1],this.table.rowManager.moveRowInArray(t.modules.group.rows,t,e,!i)):this.table.rowManager.moveRowInArray(t.modules.group.rows,t,e,!i)),e}}trackChanges(){this.dispatch("group-changed")}setGroupBy(t){this.table.options.groupBy=t,this.initialized||this.initialize(),this.configureGroupSetup(),!t&&this.table.modExists("columnCalcs")&&!0===this.table.options.columnCalcs&&this.table.modules.columnCalcs.reinitializeCalcs(),this.refreshData(),this.trackChanges()}setGroupValues(t){this.table.options.groupValues=t,this.configureGroupSetup(),this.refreshData(),this.trackChanges()}setGroupStartOpen(t){this.table.options.groupStartOpen=t,this.configureGroupSetup(),this.table.options.groupBy?(this.refreshData(),this.trackChanges()):console.warn("Grouping Update - cant refresh view, no groups have been set")}setGroupHeader(t){this.table.options.groupHeader=t,this.configureGroupSetup(),this.table.options.groupBy?(this.refreshData(),this.trackChanges()):console.warn("Grouping Update - cant refresh view, no groups have been set")}userGetGroups(t){return this.getGroups(!0)}userGetGroupedData(){return this.table.options.groupBy?this.getGroupedData():this.getData()}rowGetGroup(t){return!!t.modules.group&&t.modules.group.getComponent()}rowMoving(t,e,i){if(this.table.options.groupBy){!i&&e instanceof Ua&&(e=this.table.rowManager.prevDisplayRow(t)||e);var s=e instanceof Ua?e:e.modules.group,n=t instanceof Ua?t:t.modules.group;s===n?this.table.rowManager.moveRowInArray(s.rows,t,e,i):(n&&n.removeRow(t),s.insertRow(t,e,i))}}rowDeleting(t){this.table.options.groupBy&&t.modules.group&&t.modules.group.removeRow(t)}rowsUpdated(t){this.table.options.groupBy&&this.updateGroupRows(!0)}cellUpdated(t){this.table.options.groupBy&&this.reassignRowToGroup(t.row)}getRows(t){return this.table.options.groupBy&&this.groupIDLookups.length?(this.dispatchExternal("dataGrouping"),this.generateGroups(t),this.subscribedExternal("dataGrouped")&&this.dispatchExternal("dataGrouped",this.getGroups(!0)),this.updateGroupRows()):t.slice(0)}getGroups(t){var e=[];return this.groupList.forEach(function(i){e.push(t?i.getComponent():i)}),e}getChildGroups(t){var e=[];return t||(t=this),t.groupList.forEach(t=>{t.groupList.length?e=e.concat(this.getChildGroups(t)):e.push(t)}),e}wipe(){this.table.options.groupBy&&(this.groupList.forEach(function(t){t.wipe()}),this.groupList=[],this.groups={})}pullGroupListData(t){var e=[];return t.forEach(t=>{var i={level:0,rowCount:0,headerContent:""},s=[];t.hasSubGroups?(s=this.pullGroupListData(t.groupList),i.level=t.level,i.rowCount=s.length-t.groupList.length,i.headerContent=t.generator(t.key,i.rowCount,t.rows,t),e.push(i),e=e.concat(s)):(i.level=t.level,i.headerContent=t.generator(t.key,t.rows.length,t.rows,t),i.rowCount=t.getRows().length,e.push(i),t.getRows().forEach(t=>{e.push(t.getData("data"))}))}),e}getGroupedData(){return this.pullGroupListData(this.groupList)}getRowGroup(t){var e=!1;return this.options("dataTree")&&(t=this.table.modules.dataTree.getTreeParentRoot(t)),this.groupList.forEach(i=>{var s=i.getRowGroup(t);s&&(e=s)}),e}countGroups(){return this.groupList.length}generateGroups(t){var e=this.groups;this.groups={},this.groupList=[],this.allowedValues&&this.allowedValues[0]?(this.allowedValues[0].forEach(t=>{this.createGroup(t,0,e)}),t.forEach(t=>{this.assignRowToExistingGroup(t,e)})):t.forEach(t=>{this.assignRowToGroup(t,e)}),Object.values(e).forEach(t=>{t.wipe(!0)})}createGroup(t,e,i){var s,n=e+"_"+t;i=i||[],s=new Ua(this,!1,e,t,this.groupIDLookups[0].field,this.headerGenerator[0],i[n]),this.groups[n]=s,this.groupList.push(s)}assignRowToExistingGroup(t,e){var i="0_"+this.groupIDLookups[0].func(t.getData());this.groups[i]&&this.groups[i].addRow(t)}assignRowToGroup(t,e){var i=this.groupIDLookups[0].func(t.getData()),s=!this.groups["0_"+i];return s&&this.createGroup(i,0,e),this.groups["0_"+i].addRow(t),!s}reassignRowToGroup(t){if("row"===t.type){var e,i=t.modules.group,s=i.getPath(),n=this.getExpectedPath(t);e=s.length==n.length&&s.every((t,e)=>t===n[e]),e||(i.removeRow(t),this.assignRowToGroup(t,this.groups),this.refreshData(!0))}}getExpectedPath(t){var e=[],i=t.getData();return this.groupIDLookups.forEach(t=>{e.push(t.func(i))}),e}updateGroupRows(t){var e=[];return this.blockRedraw||(this.groupList.forEach(t=>{e=e.concat(t.getHeadersAndRows())}),t&&this.refreshData(!0)),e}scrollHeaders(t){this.table.options.groupBy&&("virtual"===this.table.options.renderHorizontal&&(t-=this.table.columnManager.renderer.vDomPadLeft),t+="px",this.groupList.forEach(e=>{e.scrollHeader(t)}))}removeGroup(t){var e,i=t.level+"_"+t.key;this.groups[i]&&(delete this.groups[i],(e=this.groupList.indexOf(t))>-1&&this.groupList.splice(e,1))}checkBasicModeGroupHeaderWidth(){var t=this.table.rowManager.tableElement,e=!0;this.table.rowManager.getDisplayRows().forEach((i,s)=>{this.table.rowManager.styleRow(i,s),t.appendChild(i.getElement()),i.initialize(!0),"group"!==i.type&&(e=!1)}),t.style.minWidth=e?this.table.columnManager.getWidth()+"px":""}},HistoryModule:Xa,HtmlTableImportModule:class extends na{static moduleName="htmlTableImport";constructor(t){super(t),this.fieldIndex=[],this.hasIndex=!1}initialize(){this.tableElementCheck()}tableElementCheck(){this.table.originalElement&&"TABLE"===this.table.originalElement.tagName&&(this.table.originalElement.childNodes.length?this.parseTable():console.warn("Unable to parse data from empty table tag, Tabulator should be initialized on a div tag unless importing data from a table element."))}parseTable(){var t=this.table.originalElement,e=this.table.options,i=t.getElementsByTagName("th"),s=t.getElementsByTagName("tbody")[0],n=[];this.hasIndex=!1,this.dispatchExternal("htmlImporting"),s=s?s.getElementsByTagName("tr"):[],this._extractOptions(t,e),i.length?this._extractHeaders(i,s):this._generateBlankHeaders(i,s);for(var o=0;o<s.length;o++){var r=s[o].getElementsByTagName("td"),a={};this.hasIndex||(a[e.index]=o);for(var l=0;l<r.length;l++){var h=r[l];void 0!==this.fieldIndex[l]&&(a[this.fieldIndex[l]]=h.innerHTML)}n.push(a)}e.data=n,this.dispatchExternal("htmlImported")}_extractOptions(t,e,i){var s=t.attributes,n=i?Object.keys(i):Object.keys(e),o={};for(var r in n.forEach(t=>{o[t.toLowerCase()]=t}),s){var a,l=s[r];l&&"object"==typeof l&&l.name&&0===l.name.indexOf("tabulator-")&&(a=l.name.replace("tabulator-",""),void 0!==o[a]&&(e[o[a]]=this._attribValue(l.value)))}}_attribValue(t){return"true"===t||"false"!==t&&t}_findCol(t){return this.table.options.columns.find(e=>e.title===t)||!1}_extractHeaders(t,e){for(var i=0;i<t.length;i++){var s,n=t[i],o=!1,r=this._findCol(n.textContent);r?o=!0:r={title:n.textContent.trim()},r.field||(r.field=n.textContent.trim().toLowerCase().replaceAll(" ","_")),(s=n.getAttribute("width"))&&!r.width&&(r.width=s),this._extractOptions(n,r,this.table.columnManager.optionsList.registeredDefaults),this.fieldIndex[i]=r.field,r.field==this.table.options.index&&(this.hasIndex=!0),o||this.table.options.columns.push(r)}}_generateBlankHeaders(t,e){for(var i=0;i<t.length;i++){var s=t[i],n={title:"",field:"col"+i};this.fieldIndex[i]=n.field;var o=s.getAttribute("width");o&&(n.width=o),this.table.options.columns.push(n)}}},ImportModule:Ja,InteractionModule:class extends na{static moduleName="interaction";constructor(t){super(t),this.eventMap={rowClick:"row-click",rowDblClick:"row-dblclick",rowContext:"row-contextmenu",rowMouseEnter:"row-mouseenter",rowMouseLeave:"row-mouseleave",rowMouseOver:"row-mouseover",rowMouseOut:"row-mouseout",rowMouseMove:"row-mousemove",rowMouseDown:"row-mousedown",rowMouseUp:"row-mouseup",rowTap:"row",rowDblTap:"row",rowTapHold:"row",cellClick:"cell-click",cellDblClick:"cell-dblclick",cellContext:"cell-contextmenu",cellMouseEnter:"cell-mouseenter",cellMouseLeave:"cell-mouseleave",cellMouseOver:"cell-mouseover",cellMouseOut:"cell-mouseout",cellMouseMove:"cell-mousemove",cellMouseDown:"cell-mousedown",cellMouseUp:"cell-mouseup",cellTap:"cell",cellDblTap:"cell",cellTapHold:"cell",headerClick:"column-click",headerDblClick:"column-dblclick",headerContext:"column-contextmenu",headerMouseEnter:"column-mouseenter",headerMouseLeave:"column-mouseleave",headerMouseOver:"column-mouseover",headerMouseOut:"column-mouseout",headerMouseMove:"column-mousemove",headerMouseDown:"column-mousedown",headerMouseUp:"column-mouseup",headerTap:"column",headerDblTap:"column",headerTapHold:"column",groupClick:"group-click",groupDblClick:"group-dblclick",groupContext:"group-contextmenu",groupMouseEnter:"group-mouseenter",groupMouseLeave:"group-mouseleave",groupMouseOver:"group-mouseover",groupMouseOut:"group-mouseout",groupMouseMove:"group-mousemove",groupMouseDown:"group-mousedown",groupMouseUp:"group-mouseup",groupTap:"group",groupDblTap:"group",groupTapHold:"group"},this.subscribers={},this.touchSubscribers={},this.columnSubscribers={},this.touchWatchers={row:{tap:null,tapDbl:null,tapHold:null},cell:{tap:null,tapDbl:null,tapHold:null},column:{tap:null,tapDbl:null,tapHold:null},group:{tap:null,tapDbl:null,tapHold:null}},this.registerColumnOption("headerClick"),this.registerColumnOption("headerDblClick"),this.registerColumnOption("headerContext"),this.registerColumnOption("headerMouseEnter"),this.registerColumnOption("headerMouseLeave"),this.registerColumnOption("headerMouseOver"),this.registerColumnOption("headerMouseOut"),this.registerColumnOption("headerMouseMove"),this.registerColumnOption("headerMouseDown"),this.registerColumnOption("headerMouseUp"),this.registerColumnOption("headerTap"),this.registerColumnOption("headerDblTap"),this.registerColumnOption("headerTapHold"),this.registerColumnOption("cellClick"),this.registerColumnOption("cellDblClick"),this.registerColumnOption("cellContext"),this.registerColumnOption("cellMouseEnter"),this.registerColumnOption("cellMouseLeave"),this.registerColumnOption("cellMouseOver"),this.registerColumnOption("cellMouseOut"),this.registerColumnOption("cellMouseMove"),this.registerColumnOption("cellMouseDown"),this.registerColumnOption("cellMouseUp"),this.registerColumnOption("cellTap"),this.registerColumnOption("cellDblTap"),this.registerColumnOption("cellTapHold")}initialize(){this.initializeExternalEvents(),this.subscribe("column-init",this.initializeColumn.bind(this)),this.subscribe("cell-dblclick",this.cellContentsSelectionFixer.bind(this)),this.subscribe("scroll-horizontal",this.clearTouchWatchers.bind(this)),this.subscribe("scroll-vertical",this.clearTouchWatchers.bind(this))}clearTouchWatchers(){Object.values(this.touchWatchers).forEach(t=>{clearTimeout(t.tapDbl),clearTimeout(t.tapHold);for(let e in t)t[e]=null})}cellContentsSelectionFixer(t,e){var i;if(!this.table.modExists("edit")||this.table.modules.edit.currentCell!==e){t.preventDefault();try{document.selection?((i=document.body.createTextRange()).moveToElementText(e.getElement()),i.select()):window.getSelection&&((i=document.createRange()).selectNode(e.getElement()),window.getSelection().removeAllRanges(),window.getSelection().addRange(i))}catch(t){}}}initializeExternalEvents(){for(let t in this.eventMap)this.subscriptionChangeExternal(t,this.subscriptionChanged.bind(this,t))}subscriptionChanged(t,e){e?this.subscribers[t]||(this.eventMap[t].includes("-")?(this.subscribers[t]=this.handle.bind(this,t),this.subscribe(this.eventMap[t],this.subscribers[t])):this.subscribeTouchEvents(t)):this.eventMap[t].includes("-")?!this.subscribers[t]||this.columnSubscribers[t]||this.subscribedExternal(t)||(this.unsubscribe(this.eventMap[t],this.subscribers[t]),delete this.subscribers[t]):this.unsubscribeTouchEvents(t)}subscribeTouchEvents(t){var e=this.eventMap[t];this.touchSubscribers[e+"-touchstart"]||(this.touchSubscribers[e+"-touchstart"]=this.handleTouch.bind(this,e,"start"),this.touchSubscribers[e+"-touchend"]=this.handleTouch.bind(this,e,"end"),this.subscribe(e+"-touchstart",this.touchSubscribers[e+"-touchstart"]),this.subscribe(e+"-touchend",this.touchSubscribers[e+"-touchend"])),this.subscribers[t]=!0}unsubscribeTouchEvents(t){var e=!0,i=this.eventMap[t];if(this.subscribers[t]&&!this.subscribedExternal(t)){delete this.subscribers[t];for(let t in this.eventMap)this.eventMap[t]===i&&this.subscribers[t]&&(e=!1);e&&(this.unsubscribe(i+"-touchstart",this.touchSubscribers[i+"-touchstart"]),this.unsubscribe(i+"-touchend",this.touchSubscribers[i+"-touchend"]),delete this.touchSubscribers[i+"-touchstart"],delete this.touchSubscribers[i+"-touchend"])}}initializeColumn(t){var e=t.definition;for(let i in this.eventMap)e[i]&&(this.subscriptionChanged(i,!0),this.columnSubscribers[i]||(this.columnSubscribers[i]=[]),this.columnSubscribers[i].push(t))}handle(t,e,i){this.dispatchEvent(t,e,i)}handleTouch(t,e,i,s){var n=this.touchWatchers[t];switch("column"===t&&(t="header"),e){case"start":n.tap=!0,clearTimeout(n.tapHold),n.tapHold=setTimeout(()=>{clearTimeout(n.tapHold),n.tapHold=null,n.tap=null,clearTimeout(n.tapDbl),n.tapDbl=null,this.dispatchEvent(t+"TapHold",i,s)},1e3);break;case"end":n.tap&&(n.tap=null,this.dispatchEvent(t+"Tap",i,s)),n.tapDbl?(clearTimeout(n.tapDbl),n.tapDbl=null,this.dispatchEvent(t+"DblTap",i,s)):n.tapDbl=setTimeout(()=>{clearTimeout(n.tapDbl),n.tapDbl=null},300),clearTimeout(n.tapHold),n.tapHold=null}}dispatchEvent(t,e,i){var s,n=i.getComponent();this.columnSubscribers[t]&&(i instanceof _a?s=i.column.definition[t]:i instanceof ka&&(s=i.definition[t]),s&&s(e,n)),this.dispatchExternal(t,e,n)}},KeybindingsModule:tl,MenuModule:class extends na{static moduleName="menu";constructor(t){super(t),this.menuContainer=null,this.nestedMenuBlock=!1,this.currentComponent=null,this.rootPopup=null,this.columnSubscribers={},this.registerTableOption("rowContextMenu",!1),this.registerTableOption("rowClickMenu",!1),this.registerTableOption("rowDblClickMenu",!1),this.registerTableOption("groupContextMenu",!1),this.registerTableOption("groupClickMenu",!1),this.registerTableOption("groupDblClickMenu",!1),this.registerColumnOption("headerContextMenu"),this.registerColumnOption("headerClickMenu"),this.registerColumnOption("headerDblClickMenu"),this.registerColumnOption("headerMenu"),this.registerColumnOption("headerMenuIcon"),this.registerColumnOption("contextMenu"),this.registerColumnOption("clickMenu"),this.registerColumnOption("dblClickMenu")}initialize(){this.deprecatedOptionsCheck(),this.initializeRowWatchers(),this.initializeGroupWatchers(),this.subscribe("column-init",this.initializeColumn.bind(this))}deprecatedOptionsCheck(){}initializeRowWatchers(){this.table.options.rowContextMenu&&(this.subscribe("row-contextmenu",this.loadMenuEvent.bind(this,this.table.options.rowContextMenu)),this.table.on("rowTapHold",this.loadMenuEvent.bind(this,this.table.options.rowContextMenu))),this.table.options.rowClickMenu&&this.subscribe("row-click",this.loadMenuEvent.bind(this,this.table.options.rowClickMenu)),this.table.options.rowDblClickMenu&&this.subscribe("row-dblclick",this.loadMenuEvent.bind(this,this.table.options.rowDblClickMenu))}initializeGroupWatchers(){this.table.options.groupContextMenu&&(this.subscribe("group-contextmenu",this.loadMenuEvent.bind(this,this.table.options.groupContextMenu)),this.table.on("groupTapHold",this.loadMenuEvent.bind(this,this.table.options.groupContextMenu))),this.table.options.groupClickMenu&&this.subscribe("group-click",this.loadMenuEvent.bind(this,this.table.options.groupClickMenu)),this.table.options.groupDblClickMenu&&this.subscribe("group-dblclick",this.loadMenuEvent.bind(this,this.table.options.groupDblClickMenu))}initializeColumn(t){var e=t.definition;e.headerContextMenu&&!this.columnSubscribers.headerContextMenu&&(this.columnSubscribers.headerContextMenu=this.loadMenuTableColumnEvent.bind(this,"headerContextMenu"),this.subscribe("column-contextmenu",this.columnSubscribers.headerContextMenu),this.table.on("headerTapHold",this.loadMenuTableColumnEvent.bind(this,"headerContextMenu"))),e.headerClickMenu&&!this.columnSubscribers.headerClickMenu&&(this.columnSubscribers.headerClickMenu=this.loadMenuTableColumnEvent.bind(this,"headerClickMenu"),this.subscribe("column-click",this.columnSubscribers.headerClickMenu)),e.headerDblClickMenu&&!this.columnSubscribers.headerDblClickMenu&&(this.columnSubscribers.headerDblClickMenu=this.loadMenuTableColumnEvent.bind(this,"headerDblClickMenu"),this.subscribe("column-dblclick",this.columnSubscribers.headerDblClickMenu)),e.headerMenu&&this.initializeColumnHeaderMenu(t),e.contextMenu&&!this.columnSubscribers.contextMenu&&(this.columnSubscribers.contextMenu=this.loadMenuTableCellEvent.bind(this,"contextMenu"),this.subscribe("cell-contextmenu",this.columnSubscribers.contextMenu),this.table.on("cellTapHold",this.loadMenuTableCellEvent.bind(this,"contextMenu"))),e.clickMenu&&!this.columnSubscribers.clickMenu&&(this.columnSubscribers.clickMenu=this.loadMenuTableCellEvent.bind(this,"clickMenu"),this.subscribe("cell-click",this.columnSubscribers.clickMenu)),e.dblClickMenu&&!this.columnSubscribers.dblClickMenu&&(this.columnSubscribers.dblClickMenu=this.loadMenuTableCellEvent.bind(this,"dblClickMenu"),this.subscribe("cell-dblclick",this.columnSubscribers.dblClickMenu))}initializeColumnHeaderMenu(t){var e,i=t.definition.headerMenuIcon;(e=document.createElement("span")).classList.add("tabulator-header-popup-button"),i?("function"==typeof i&&(i=i(t.getComponent())),i instanceof HTMLElement?e.appendChild(i):e.innerHTML=i):e.innerHTML="&vellip;",e.addEventListener("click",e=>{e.stopPropagation(),e.preventDefault(),this.loadMenuEvent(t.definition.headerMenu,e,t)}),t.titleElement.insertBefore(e,t.titleElement.firstChild)}loadMenuTableCellEvent(t,e,i){i._cell&&(i=i._cell),i.column.definition[t]&&this.loadMenuEvent(i.column.definition[t],e,i)}loadMenuTableColumnEvent(t,e,i){i._column&&(i=i._column),i.definition[t]&&this.loadMenuEvent(i.definition[t],e,i)}loadMenuEvent(t,e,i){i._group?i=i._group:i._row&&(i=i._row),t="function"==typeof t?t.call(this.table,e,i.getComponent()):t,this.loadMenu(e,i,t)}loadMenu(t,e,i,s,n){var o,r=!(t instanceof MouseEvent),a=document.createElement("div");if(a.classList.add("tabulator-menu"),r||t.preventDefault(),i&&i.length){if(s)o=n.child(a);else{if(this.nestedMenuBlock){if(this.rootPopup)return}else this.nestedMenuBlock=setTimeout(()=>{this.nestedMenuBlock=!1},100);this.rootPopup&&this.rootPopup.hide(),this.rootPopup=o=this.popup(a)}i.forEach(t=>{var i=document.createElement("div"),s=t.label,n=t.disabled;t.separator?i.classList.add("tabulator-menu-separator"):(i.classList.add("tabulator-menu-item"),"function"==typeof s&&(s=s.call(this.table,e.getComponent())),s instanceof Node?i.appendChild(s):i.innerHTML=s,"function"==typeof n&&(n=n.call(this.table,e.getComponent())),n?(i.classList.add("tabulator-menu-item-disabled"),i.addEventListener("click",t=>{t.stopPropagation()})):t.menu&&t.menu.length?i.addEventListener("click",s=>{s.stopPropagation(),this.loadMenu(s,e,t.menu,i,o)}):t.action&&i.addEventListener("click",i=>{t.action(i,e.getComponent())}),t.menu&&t.menu.length&&i.classList.add("tabulator-menu-item-submenu")),a.appendChild(i)}),a.addEventListener("click",t=>{this.rootPopup&&this.rootPopup.hide()}),o.show(s||t),o===this.rootPopup&&(this.rootPopup.hideOnBlur(()=>{this.rootPopup=null,this.currentComponent&&(this.dispatch("menu-closed",i,o),this.dispatchExternal("menuClosed",this.currentComponent.getComponent()),this.currentComponent=null)}),this.currentComponent=e,this.dispatch("menu-opened",i,o),this.dispatchExternal("menuOpened",e.getComponent()))}}},MoveColumnsModule:class extends na{static moduleName="moveColumn";constructor(t){super(t),this.placeholderElement=this.createPlaceholderElement(),this.hoverElement=!1,this.checkTimeout=!1,this.checkPeriod=250,this.moving=!1,this.toCol=!1,this.toColAfter=!1,this.startX=0,this.autoScrollMargin=40,this.autoScrollStep=5,this.autoScrollTimeout=!1,this.touchMove=!1,this.moveHover=this.moveHover.bind(this),this.endMove=this.endMove.bind(this),this.registerTableOption("movableColumns",!1)}createPlaceholderElement(){var t=document.createElement("div");return t.classList.add("tabulator-col"),t.classList.add("tabulator-col-placeholder"),t}initialize(){this.table.options.movableColumns&&(this.subscribe("column-init",this.initializeColumn.bind(this)),this.subscribe("alert-show",this.abortMove.bind(this)))}abortMove(){clearTimeout(this.checkTimeout)}initializeColumn(t){var e,i=this,s={};t.modules.frozen||t.isGroup||t.isRowHeader||(e=t.getElement(),s.mousemove=function(s){t.parent===i.moving.parent&&((i.touchMove?s.touches[0].pageX:s.pageX)-ia.elOffset(e).left+i.table.columnManager.contentsElement.scrollLeft>t.getWidth()/2?i.toCol===t&&i.toColAfter||(e.parentNode.insertBefore(i.placeholderElement,e.nextSibling),i.moveColumn(t,!0)):(i.toCol!==t||i.toColAfter)&&(e.parentNode.insertBefore(i.placeholderElement,e),i.moveColumn(t,!1)))}.bind(i),e.addEventListener("mousedown",function(e){i.touchMove=!1,1===e.which&&(i.checkTimeout=setTimeout(function(){i.startMove(e,t)},i.checkPeriod))}),e.addEventListener("mouseup",function(t){1===t.which&&i.checkTimeout&&clearTimeout(i.checkTimeout)}),i.bindTouchEvents(t)),t.modules.moveColumn=s}bindTouchEvents(t){var e,i,s,n,o,r,a=t.getElement(),l=!1;a.addEventListener("touchstart",a=>{this.checkTimeout=setTimeout(()=>{this.touchMove=!0,e=t.nextColumn(),s=e?e.getWidth()/2:0,i=t.prevColumn(),n=i?i.getWidth()/2:0,o=0,r=0,l=!1,this.startMove(a,t)},this.checkPeriod)},{passive:!0}),a.addEventListener("touchmove",a=>{var h,c;this.moving&&(this.moveHover(a),l||(l=a.touches[0].pageX),(h=a.touches[0].pageX-l)>0?e&&h-o>s&&(c=e)!==t&&(l=a.touches[0].pageX,c.getElement().parentNode.insertBefore(this.placeholderElement,c.getElement().nextSibling),this.moveColumn(c,!0)):i&&-h-r>n&&(c=i)!==t&&(l=a.touches[0].pageX,c.getElement().parentNode.insertBefore(this.placeholderElement,c.getElement()),this.moveColumn(c,!1)),c&&(e=c.nextColumn(),o=s,s=e?e.getWidth()/2:0,i=c.prevColumn(),r=n,n=i?i.getWidth()/2:0))},{passive:!0}),a.addEventListener("touchend",t=>{this.checkTimeout&&clearTimeout(this.checkTimeout),this.moving&&this.endMove(t)})}startMove(t,e){var i=e.getElement(),s=this.table.columnManager.getContentsElement(),n=this.table.columnManager.getHeadersElement();this.table.modules.selectRange&&this.table.modules.selectRange.columnSelection&&this.table.modules.selectRange.mousedown&&"column"===this.table.modules.selectRange.selecting||(this.moving=e,this.startX=(this.touchMove?t.touches[0].pageX:t.pageX)-ia.elOffset(i).left,this.table.element.classList.add("tabulator-block-select"),this.placeholderElement.style.width=e.getWidth()+"px",this.placeholderElement.style.height=e.getHeight()+"px",i.parentNode.insertBefore(this.placeholderElement,i),i.parentNode.removeChild(i),this.hoverElement=i.cloneNode(!0),this.hoverElement.classList.add("tabulator-moving"),s.appendChild(this.hoverElement),this.hoverElement.style.left="0",this.hoverElement.style.bottom=s.clientHeight-n.offsetHeight+"px",this.touchMove||(this._bindMouseMove(),document.body.addEventListener("mousemove",this.moveHover),document.body.addEventListener("mouseup",this.endMove)),this.moveHover(t),this.dispatch("column-moving",t,this.moving))}_bindMouseMove(){this.table.columnManager.columnsByIndex.forEach(function(t){t.modules.moveColumn.mousemove&&t.getElement().addEventListener("mousemove",t.modules.moveColumn.mousemove)})}_unbindMouseMove(){this.table.columnManager.columnsByIndex.forEach(function(t){t.modules.moveColumn.mousemove&&t.getElement().removeEventListener("mousemove",t.modules.moveColumn.mousemove)})}moveColumn(t,e){var i=this.moving.getCells();this.toCol=t,this.toColAfter=e,e?t.getCells().forEach(function(t,e){var s=t.getElement(!0);s.parentNode&&i[e]&&s.parentNode.insertBefore(i[e].getElement(),s.nextSibling)}):t.getCells().forEach(function(t,e){var s=t.getElement(!0);s.parentNode&&i[e]&&s.parentNode.insertBefore(i[e].getElement(),s)})}endMove(t){(1===t.which||this.touchMove)&&(this._unbindMouseMove(),this.placeholderElement.parentNode.insertBefore(this.moving.getElement(),this.placeholderElement.nextSibling),this.placeholderElement.parentNode.removeChild(this.placeholderElement),this.hoverElement.parentNode.removeChild(this.hoverElement),this.table.element.classList.remove("tabulator-block-select"),this.toCol&&this.table.columnManager.moveColumnActual(this.moving,this.toCol,this.toColAfter),this.moving=!1,this.toCol=!1,this.toColAfter=!1,this.touchMove||(document.body.removeEventListener("mousemove",this.moveHover),document.body.removeEventListener("mouseup",this.endMove)))}moveHover(t){var e,i=this.table.columnManager.getContentsElement(),s=i.scrollLeft,n=(this.touchMove?t.touches[0].pageX:t.pageX)-ia.elOffset(i).left+s;this.hoverElement.style.left=n-this.startX+"px",n-s<this.autoScrollMargin&&(this.autoScrollTimeout||(this.autoScrollTimeout=setTimeout(()=>{e=Math.max(0,s-5),this.table.rowManager.getElement().scrollLeft=e,this.autoScrollTimeout=!1},1))),s+i.clientWidth-n<this.autoScrollMargin&&(this.autoScrollTimeout||(this.autoScrollTimeout=setTimeout(()=>{e=Math.min(i.clientWidth,s+5),this.table.rowManager.getElement().scrollLeft=e,this.autoScrollTimeout=!1},1)))}},MoveRowsModule:sl,MutatorModule:ol,PageModule:al,PersistenceModule:cl,PopupModule:class extends na{static moduleName="popup";constructor(t){super(t),this.columnSubscribers={},this.registerTableOption("rowContextPopup",!1),this.registerTableOption("rowClickPopup",!1),this.registerTableOption("rowDblClickPopup",!1),this.registerTableOption("groupContextPopup",!1),this.registerTableOption("groupClickPopup",!1),this.registerTableOption("groupDblClickPopup",!1),this.registerColumnOption("headerContextPopup"),this.registerColumnOption("headerClickPopup"),this.registerColumnOption("headerDblClickPopup"),this.registerColumnOption("headerPopup"),this.registerColumnOption("headerPopupIcon"),this.registerColumnOption("contextPopup"),this.registerColumnOption("clickPopup"),this.registerColumnOption("dblClickPopup"),this.registerComponentFunction("cell","popup",this._componentPopupCall.bind(this)),this.registerComponentFunction("column","popup",this._componentPopupCall.bind(this)),this.registerComponentFunction("row","popup",this._componentPopupCall.bind(this)),this.registerComponentFunction("group","popup",this._componentPopupCall.bind(this))}initialize(){this.initializeRowWatchers(),this.initializeGroupWatchers(),this.subscribe("column-init",this.initializeColumn.bind(this))}_componentPopupCall(t,e,i){this.loadPopupEvent(e,null,t,i)}initializeRowWatchers(){this.table.options.rowContextPopup&&(this.subscribe("row-contextmenu",this.loadPopupEvent.bind(this,this.table.options.rowContextPopup)),this.table.on("rowTapHold",this.loadPopupEvent.bind(this,this.table.options.rowContextPopup))),this.table.options.rowClickPopup&&this.subscribe("row-click",this.loadPopupEvent.bind(this,this.table.options.rowClickPopup)),this.table.options.rowDblClickPopup&&this.subscribe("row-dblclick",this.loadPopupEvent.bind(this,this.table.options.rowDblClickPopup))}initializeGroupWatchers(){this.table.options.groupContextPopup&&(this.subscribe("group-contextmenu",this.loadPopupEvent.bind(this,this.table.options.groupContextPopup)),this.table.on("groupTapHold",this.loadPopupEvent.bind(this,this.table.options.groupContextPopup))),this.table.options.groupClickPopup&&this.subscribe("group-click",this.loadPopupEvent.bind(this,this.table.options.groupClickPopup)),this.table.options.groupDblClickPopup&&this.subscribe("group-dblclick",this.loadPopupEvent.bind(this,this.table.options.groupDblClickPopup))}initializeColumn(t){var e=t.definition;e.headerContextPopup&&!this.columnSubscribers.headerContextPopup&&(this.columnSubscribers.headerContextPopup=this.loadPopupTableColumnEvent.bind(this,"headerContextPopup"),this.subscribe("column-contextmenu",this.columnSubscribers.headerContextPopup),this.table.on("headerTapHold",this.loadPopupTableColumnEvent.bind(this,"headerContextPopup"))),e.headerClickPopup&&!this.columnSubscribers.headerClickPopup&&(this.columnSubscribers.headerClickPopup=this.loadPopupTableColumnEvent.bind(this,"headerClickPopup"),this.subscribe("column-click",this.columnSubscribers.headerClickPopup)),e.headerDblClickPopup&&!this.columnSubscribers.headerDblClickPopup&&(this.columnSubscribers.headerDblClickPopup=this.loadPopupTableColumnEvent.bind(this,"headerDblClickPopup"),this.subscribe("column-dblclick",this.columnSubscribers.headerDblClickPopup)),e.headerPopup&&this.initializeColumnHeaderPopup(t),e.contextPopup&&!this.columnSubscribers.contextPopup&&(this.columnSubscribers.contextPopup=this.loadPopupTableCellEvent.bind(this,"contextPopup"),this.subscribe("cell-contextmenu",this.columnSubscribers.contextPopup),this.table.on("cellTapHold",this.loadPopupTableCellEvent.bind(this,"contextPopup"))),e.clickPopup&&!this.columnSubscribers.clickPopup&&(this.columnSubscribers.clickPopup=this.loadPopupTableCellEvent.bind(this,"clickPopup"),this.subscribe("cell-click",this.columnSubscribers.clickPopup)),e.dblClickPopup&&!this.columnSubscribers.dblClickPopup&&(this.columnSubscribers.dblClickPopup=this.loadPopupTableCellEvent.bind(this,"dblClickPopup"),this.subscribe("cell-click",this.columnSubscribers.dblClickPopup))}initializeColumnHeaderPopup(t){var e,i=t.definition.headerPopupIcon;(e=document.createElement("span")).classList.add("tabulator-header-popup-button"),i?("function"==typeof i&&(i=i(t.getComponent())),i instanceof HTMLElement?e.appendChild(i):e.innerHTML=i):e.innerHTML="&vellip;",e.addEventListener("click",e=>{e.stopPropagation(),e.preventDefault(),this.loadPopupEvent(t.definition.headerPopup,e,t)}),t.titleElement.insertBefore(e,t.titleElement.firstChild)}loadPopupTableCellEvent(t,e,i){i._cell&&(i=i._cell),i.column.definition[t]&&this.loadPopupEvent(i.column.definition[t],e,i)}loadPopupTableColumnEvent(t,e,i){i._column&&(i=i._column),i.definition[t]&&this.loadPopupEvent(i.definition[t],e,i)}loadPopupEvent(t,e,i,s){var n;i._group?i=i._group:i._row&&(i=i._row),t="function"==typeof t?t.call(this.table,e,i.getComponent(),function(t){n=t}):t,this.loadPopup(e,i,t,n,s)}loadPopup(t,e,i,s,n){var o,r,a=!(t instanceof MouseEvent);i instanceof HTMLElement?o=i:(o=document.createElement("div")).innerHTML=i,o.classList.add("tabulator-popup"),o.addEventListener("click",t=>{t.stopPropagation()}),a||t.preventDefault(),r=this.popup(o),"function"==typeof s&&r.renderCallback(s),t?r.show(t):r.show(e.getElement(),n||"center"),r.hideOnBlur(()=>{this.dispatchExternal("popupClosed",e.getComponent())}),this.dispatchExternal("popupOpened",e.getComponent())}},PrintModule:class extends na{static moduleName="print";constructor(t){super(t),this.element=!1,this.manualBlock=!1,this.beforeprintEventHandler=null,this.afterprintEventHandler=null,this.registerTableOption("printAsHtml",!1),this.registerTableOption("printFormatter",!1),this.registerTableOption("printHeader",!1),this.registerTableOption("printFooter",!1),this.registerTableOption("printStyled",!0),this.registerTableOption("printRowRange","visible"),this.registerTableOption("printConfig",{}),this.registerColumnOption("print"),this.registerColumnOption("titlePrint")}initialize(){this.table.options.printAsHtml&&(this.beforeprintEventHandler=this.replaceTable.bind(this),this.afterprintEventHandler=this.cleanup.bind(this),window.addEventListener("beforeprint",this.beforeprintEventHandler),window.addEventListener("afterprint",this.afterprintEventHandler),this.subscribe("table-destroy",this.destroy.bind(this))),this.registerTableFunction("print",this.printFullscreen.bind(this))}destroy(){this.table.options.printAsHtml&&(window.removeEventListener("beforeprint",this.beforeprintEventHandler),window.removeEventListener("afterprint",this.afterprintEventHandler))}replaceTable(){this.manualBlock||(this.element=document.createElement("div"),this.element.classList.add("tabulator-print-table"),this.element.appendChild(this.table.modules.export.generateTable(this.table.options.printConfig,this.table.options.printStyled,this.table.options.printRowRange,"print")),this.table.element.style.display="none",this.table.element.parentNode.insertBefore(this.element,this.table.element))}cleanup(){document.body.classList.remove("tabulator-print-fullscreen-hide"),this.element&&this.element.parentNode&&(this.element.parentNode.removeChild(this.element),this.table.element.style.display="")}printFullscreen(t,e,i){var s,n,o=window.scrollX,r=window.scrollY,a=document.createElement("div"),l=document.createElement("div"),h=this.table.modules.export.generateTable(void 0!==i?i:this.table.options.printConfig,void 0!==e?e:this.table.options.printStyled,t||this.table.options.printRowRange,"print");this.manualBlock=!0,this.element=document.createElement("div"),this.element.classList.add("tabulator-print-fullscreen"),this.table.options.printHeader&&(a.classList.add("tabulator-print-header"),"string"==typeof(s="function"==typeof this.table.options.printHeader?this.table.options.printHeader.call(this.table):this.table.options.printHeader)?a.innerHTML=s:a.appendChild(s),this.element.appendChild(a)),this.element.appendChild(h),this.table.options.printFooter&&(l.classList.add("tabulator-print-footer"),"string"==typeof(n="function"==typeof this.table.options.printFooter?this.table.options.printFooter.call(this.table):this.table.options.printFooter)?l.innerHTML=n:l.appendChild(n),this.element.appendChild(l)),document.body.classList.add("tabulator-print-fullscreen-hide"),document.body.appendChild(this.element),this.table.options.printFormatter&&this.table.options.printFormatter(this.element,h),window.print(),this.cleanup(),window.scrollTo(o,r),this.manualBlock=!1}},ReactiveDataModule:class extends na{static moduleName="reactiveData";constructor(t){super(t),this.data=!1,this.blocked=!1,this.origFuncs={},this.currentVersion=0,this.registerTableOption("reactiveData",!1)}initialize(){this.table.options.reactiveData&&(this.subscribe("cell-value-save-before",this.block.bind(this,"cellsave")),this.subscribe("cell-value-save-after",this.unblock.bind(this,"cellsave")),this.subscribe("row-data-save-before",this.block.bind(this,"rowsave")),this.subscribe("row-data-save-after",this.unblock.bind(this,"rowsave")),this.subscribe("row-data-init-after",this.watchRow.bind(this)),this.subscribe("data-processing",this.watchData.bind(this)),this.subscribe("table-destroy",this.unwatchData.bind(this)))}watchData(t){var e,i=this;this.currentVersion++,e=this.currentVersion,this.unwatchData(),this.data=t,this.origFuncs.push=t.push,Object.defineProperty(this.data,"push",{enumerable:!1,configurable:!0,value:function(){var s,n=Array.from(arguments);return i.blocked||e!==i.currentVersion||(i.block("data-push"),n.forEach(t=>{i.table.rowManager.addRowActual(t,!1)}),s=Array.prototype.push.apply(t,arguments),i.unblock("data-push")),s}}),this.origFuncs.unshift=t.unshift,Object.defineProperty(this.data,"unshift",{enumerable:!1,configurable:!0,value:function(){var s,n=Array.from(arguments);return i.blocked||e!==i.currentVersion||(i.block("data-unshift"),n.forEach(t=>{i.table.rowManager.addRowActual(t,!0)}),s=Array.prototype.unshift.apply(t,arguments),i.unblock("data-unshift")),s}}),this.origFuncs.shift=t.shift,Object.defineProperty(this.data,"shift",{enumerable:!1,configurable:!0,value:function(){var s,n;return i.blocked||e!==i.currentVersion||(i.block("data-shift"),i.data.length&&(s=i.table.rowManager.getRowFromDataObject(i.data[0]))&&s.deleteActual(),n=Array.prototype.shift.call(t),i.unblock("data-shift")),n}}),this.origFuncs.pop=t.pop,Object.defineProperty(this.data,"pop",{enumerable:!1,configurable:!0,value:function(){var s,n;return i.blocked||e!==i.currentVersion||(i.block("data-pop"),i.data.length&&(s=i.table.rowManager.getRowFromDataObject(i.data[i.data.length-1]))&&s.deleteActual(),n=Array.prototype.pop.call(t),i.unblock("data-pop")),n}}),this.origFuncs.splice=t.splice,Object.defineProperty(this.data,"splice",{enumerable:!1,configurable:!0,value:function(){var s,n,o=Array.from(arguments),r=o[0]<0?t.length+o[0]:o[0],a=o[1],l=!!o[2]&&o.slice(2);if(!i.blocked&&e===i.currentVersion){if(i.block("data-splice"),l&&((s=!!t[r]&&i.table.rowManager.getRowFromDataObject(t[r]))?l.forEach(t=>{i.table.rowManager.addRowActual(t,!0,s,!0)}):(l=l.slice().reverse()).forEach(t=>{i.table.rowManager.addRowActual(t,!0,!1,!0)})),0!==a){var h=t.slice(r,void 0===o[1]?o[1]:r+a);h.forEach((t,e)=>{var s=i.table.rowManager.getRowFromDataObject(t);s&&s.deleteActual(e!==h.length-1)})}(l||0!==a)&&i.table.rowManager.reRenderInPosition(),n=Array.prototype.splice.apply(t,arguments),i.unblock("data-splice")}return n}})}unwatchData(){if(!1!==this.data)for(var t in this.origFuncs)Object.defineProperty(this.data,t,{enumerable:!0,configurable:!0,writable:!0,value:this.origFuncs[t]})}watchRow(t){var e=t.getData();for(var i in e)this.watchKey(t,e,i);this.table.options.dataTree&&this.watchTreeChildren(t)}watchTreeChildren(t){var e=this,i=t.getData()[this.table.options.dataTreeChildField];i&&(Object.defineProperty(i,"push",{enumerable:!1,configurable:!0,value:function(){var s;return e.blocked||(e.block("tree-push"),s=Array.prototype.push.apply(i,arguments),e.rebuildTree(t),e.unblock("tree-push")),s}}),Object.defineProperty(i,"unshift",{enumerable:!1,configurable:!0,value:function(){var s;return e.blocked||(e.block("tree-unshift"),s=Array.prototype.unshift.apply(i,arguments),e.rebuildTree(t),e.unblock("tree-unshift")),s}}),Object.defineProperty(i,"shift",{enumerable:!1,configurable:!0,value:function(){var s;return e.blocked||(e.block("tree-shift"),s=Array.prototype.shift.call(i),e.rebuildTree(t),e.unblock("tree-shift")),s}}),Object.defineProperty(i,"pop",{enumerable:!1,configurable:!0,value:function(){var s;return e.blocked||(e.block("tree-pop"),s=Array.prototype.pop.call(i),e.rebuildTree(t),e.unblock("tree-pop")),s}}),Object.defineProperty(i,"splice",{enumerable:!1,configurable:!0,value:function(){var s;return e.blocked||(e.block("tree-splice"),s=Array.prototype.splice.apply(i,arguments),e.rebuildTree(t),e.unblock("tree-splice")),s}}))}rebuildTree(t){this.table.modules.dataTree.initializeRow(t),this.table.modules.dataTree.layoutRow(t),this.table.rowManager.refreshActiveData("tree",!1,!0)}watchKey(t,e,i){var s=this,n=Object.getOwnPropertyDescriptor(e,i),o=e[i],r=this.currentVersion;Object.defineProperty(e,i,{set:e=>{if(o=e,!s.blocked&&r===s.currentVersion){s.block("key");var a={};a[i]=e,t.updateData(a),s.unblock("key")}n.set&&n.set(e)},get:()=>(n.get&&n.get(),o)})}unwatchRow(t){var e=t.getData();for(var i in e)Object.defineProperty(e,i,{value:e[i]})}block(t){this.blocked||(this.blocked=t)}unblock(t){this.blocked===t&&(this.blocked=!1)}},ResizeColumnsModule:class extends na{static moduleName="resizeColumns";constructor(t){super(t),this.startColumn=!1,this.startX=!1,this.startWidth=!1,this.latestX=!1,this.handle=null,this.initialNextColumn=null,this.nextColumn=null,this.initialized=!1,this.registerColumnOption("resizable",!0),this.registerTableOption("resizableColumnFit",!1),this.registerTableOption("resizableColumnGuide",!1)}initialize(){this.subscribe("column-rendered",this.layoutColumnHeader.bind(this))}initializeEventWatchers(){this.initialized||(this.subscribe("cell-rendered",this.layoutCellHandles.bind(this)),this.subscribe("cell-delete",this.deInitializeComponent.bind(this)),this.subscribe("cell-height",this.resizeHandle.bind(this)),this.subscribe("column-moved",this.columnLayoutUpdated.bind(this)),this.subscribe("column-hide",this.deInitializeColumn.bind(this)),this.subscribe("column-show",this.columnLayoutUpdated.bind(this)),this.subscribe("column-width",this.columnWidthUpdated.bind(this)),this.subscribe("column-delete",this.deInitializeComponent.bind(this)),this.subscribe("column-height",this.resizeHandle.bind(this)),this.initialized=!0)}layoutCellHandles(t){"row"===t.row.type&&(this.deInitializeComponent(t),this.initializeColumn("cell",t,t.column,t.element))}layoutColumnHeader(t){t.definition.resizable&&(this.initializeEventWatchers(),this.deInitializeComponent(t),this.initializeColumn("header",t,t,t.element))}columnLayoutUpdated(t){var e=t.prevColumn();this.reinitializeColumn(t),e&&this.reinitializeColumn(e)}columnWidthUpdated(t){t.modules.frozen&&(this.table.modules.frozenColumns.leftColumns.includes(t)?this.table.modules.frozenColumns.leftColumns.forEach(t=>{this.reinitializeColumn(t)}):this.table.modules.frozenColumns.rightColumns.includes(t)&&this.table.modules.frozenColumns.rightColumns.forEach(t=>{this.reinitializeColumn(t)}))}frozenColumnOffset(t){var e=!1;return t.modules.frozen&&(e=t.modules.frozen.marginValue,"left"===t.modules.frozen.position?e+=t.getWidth()-3:e&&(e-=3)),!1!==e&&e+"px"}reinitializeColumn(t){var e=this.frozenColumnOffset(t);t.cells.forEach(i=>{i.modules.resize&&i.modules.resize.handleEl&&(e&&(i.modules.resize.handleEl.style[t.modules.frozen.position]=e,i.modules.resize.handleEl.style["z-index"]=11),i.element.after(i.modules.resize.handleEl))}),t.modules.resize&&t.modules.resize.handleEl&&(e&&(t.modules.resize.handleEl.style[t.modules.frozen.position]=e),t.element.after(t.modules.resize.handleEl))}initializeColumn(t,e,i,s){var n=this,o=i.definition.resizable,r={},a=i.getLastColumn();if("header"===t&&(r={variableHeight:"textarea"==i.definition.formatter||i.definition.variableHeight}),(!0===o||o==t)&&this._checkResizability(a)){var l=document.createElement("span");l.className="tabulator-col-resize-handle",l.addEventListener("click",function(t){t.stopPropagation()});var h=function(t){n.startColumn=i,n.initialNextColumn=n.nextColumn=a.nextColumn(),n._mouseDown(t,a,l)};l.addEventListener("mousedown",h),l.addEventListener("touchstart",h,{passive:!0}),l.addEventListener("dblclick",t=>{var e=a.getWidth();t.stopPropagation(),a.reinitializeWidth(!0),e!==a.getWidth()&&(n.dispatch("column-resized",a),n.dispatchExternal("columnResized",a.getComponent()))}),i.modules.frozen&&(l.style.position="sticky",l.style[i.modules.frozen.position]=this.frozenColumnOffset(i)),r.handleEl=l,s.parentNode&&i.visible&&s.after(l)}e.modules.resize=r}deInitializeColumn(t){this.deInitializeComponent(t),t.cells.forEach(t=>{this.deInitializeComponent(t)})}deInitializeComponent(t){var e;t.modules.resize&&(e=t.modules.resize.handleEl)&&e.parentElement&&e.parentElement.removeChild(e)}resizeHandle(t,e){t.modules.resize&&t.modules.resize.handleEl&&(t.modules.resize.handleEl.style.height=e)}getResizingClientX(t){if(void 0!==t.clientX)return t.clientX;const e=this.table.options.resizableColumnGuide?t.changedTouches?.[0]:t.touches?.[0];return e?.clientX}resize(t,e){var i=this.getResizingClientX(t);if("number"==typeof i&&isFinite(i)){var s,n,o=i-this.startX,r=i-this.latestX;if(this.latestX=i,this.table.rtl&&(o=-o,r=-r),s=e.width==e.minWidth||e.width==e.maxWidth,e.setWidth(this.startWidth+o),n=e.width==e.minWidth||e.width==e.maxWidth,r<0&&(this.nextColumn=this.initialNextColumn),this.table.options.resizableColumnFit&&this.nextColumn&&(!s||!n)){let t=this.nextColumn.getWidth();r>0&&t<=this.nextColumn.minWidth&&(this.nextColumn=this.nextColumn.nextColumn()),this.nextColumn&&this.nextColumn.setWidth(this.nextColumn.getWidth()-r)}this.table.columnManager.rerenderColumns(!0),!this.table.browserSlow&&e.modules.resize&&e.modules.resize.variableHeight&&e.checkCellHeights()}else console.warn("ResizeColumns: could not resolve pointer X from event",t)}calcGuidePosition(t,e,i){var s=void 0===t.clientX?t.touches[0].clientX:t.clientX,n=i.getBoundingClientRect().x-this.table.element.getBoundingClientRect().x,o=this.table.element.getBoundingClientRect().x,r=e.element.getBoundingClientRect().left-o,a=s-this.startX,l=Math.max(n+a,r+e.minWidth);return e.maxWidth&&(l=Math.min(l,r+e.maxWidth)),l}_checkResizability(t){return t.definition.resizable}_mouseDown(t,e,i){var s,n=this;function o(t){n.table.options.resizableColumnGuide?s.style.left=n.calcGuidePosition(t,e,i)+"px":n.resize(t,e)}function r(t){n.table.options.resizableColumnGuide&&(n.resize(t,e),s.remove()),n.startColumn.modules.edit&&(n.startColumn.modules.edit.blocked=!1),n.table.browserSlow&&e.modules.resize&&e.modules.resize.variableHeight&&e.checkCellHeights(),document.body.removeEventListener("mouseup",r),document.body.removeEventListener("mousemove",o),i.removeEventListener("touchmove",o),i.removeEventListener("touchend",r),n.table.element.classList.remove("tabulator-block-select"),n.startWidth!==e.getWidth()&&(n.table.columnManager.verticalAlignHeaders(),n.dispatch("column-resized",e),n.dispatchExternal("columnResized",e.getComponent()))}this.dispatchExternal("columnResizing",e.getComponent()),n.table.options.resizableColumnGuide&&((s=document.createElement("span")).classList.add("tabulator-col-resize-guide"),n.table.element.appendChild(s),setTimeout(()=>{s.style.left=n.calcGuidePosition(t,e,i)+"px"})),n.table.element.classList.add("tabulator-block-select"),t.stopPropagation(),n.startColumn.modules.edit&&(n.startColumn.modules.edit.blocked=!0),n.startX=void 0===t.clientX?t.touches[0].clientX:t.clientX,n.latestX=n.startX,n.startWidth=e.getWidth(),document.body.addEventListener("mousemove",o),document.body.addEventListener("mouseup",r),i.addEventListener("touchmove",o,{passive:!0}),i.addEventListener("touchend",r)}},ResizeRowsModule:class extends na{static moduleName="resizeRows";constructor(t){super(t),this.startColumn=!1,this.startY=!1,this.startHeight=!1,this.handle=null,this.prevHandle=null,this.registerTableOption("resizableRows",!1),this.registerTableOption("resizableRowGuide",!1)}initialize(){this.table.options.resizableRows&&this.subscribe("row-layout-after",this.initializeRow.bind(this))}initializeRow(t){var e=this,i=t.getElement(),s=document.createElement("div");s.className="tabulator-row-resize-handle";var n=document.createElement("div");n.className="tabulator-row-resize-handle prev",s.addEventListener("click",function(t){t.stopPropagation()});var o=function(i){e.startRow=t,e._mouseDown(i,t,s)};s.addEventListener("mousedown",o),s.addEventListener("touchstart",o,{passive:!0}),n.addEventListener("click",function(t){t.stopPropagation()});var r=function(i){var s=e.table.rowManager.prevDisplayRow(t);s&&(e.startRow=s,e._mouseDown(i,s,n))};n.addEventListener("mousedown",r),n.addEventListener("touchstart",r,{passive:!0}),i.appendChild(s),i.appendChild(n)}resize(t,e){e.setHeight(this.startHeight+((void 0===t.screenY?t.touches[0].screenY:t.screenY)-this.startY))}calcGuidePosition(t,e,i){var s=void 0===t.screenY?t.touches[0].screenY:t.screenY,n=i.getBoundingClientRect().y-this.table.element.getBoundingClientRect().y,o=this.table.element.getBoundingClientRect().y,r=e.element.getBoundingClientRect().top-o,a=s-this.startY;return Math.max(n+a,r)}_mouseDown(t,e,i){var s,n=this;function o(t){n.table.options.resizableRowGuide?s.style.top=n.calcGuidePosition(t,e,i)+"px":n.resize(t,e)}function r(t){n.table.options.resizableRowGuide&&(n.resize(t,e),s.remove()),document.body.removeEventListener("mouseup",o),document.body.removeEventListener("mousemove",o),i.removeEventListener("touchmove",o),i.removeEventListener("touchend",r),n.table.element.classList.remove("tabulator-block-select"),n.dispatchExternal("rowResized",e.getComponent())}n.dispatchExternal("rowResizing",e.getComponent()),n.table.options.resizableRowGuide&&((s=document.createElement("span")).classList.add("tabulator-row-resize-guide"),n.table.element.appendChild(s),setTimeout(()=>{s.style.top=n.calcGuidePosition(t,e,i)+"px"})),n.table.element.classList.add("tabulator-block-select"),t.stopPropagation(),n.startY=void 0===t.screenY?t.touches[0].screenY:t.screenY,n.startHeight=e.getHeight(),document.body.addEventListener("mousemove",o),document.body.addEventListener("mouseup",r),i.addEventListener("touchmove",o,{passive:!0}),i.addEventListener("touchend",r)}},ResizeTableModule:class extends na{static moduleName="resizeTable";constructor(t){super(t),this.binding=!1,this.visibilityObserver=!1,this.resizeObserver=!1,this.containerObserver=!1,this.tableHeight=0,this.tableWidth=0,this.containerHeight=0,this.containerWidth=0,this.autoResize=!1,this.visible=!1,this.initialized=!1,this.initialRedraw=!1,this.registerTableOption("autoResize",!0)}initialize(){if(this.table.options.autoResize){var t,e=this.table;this.tableHeight=e.element.clientHeight,this.tableWidth=e.element.clientWidth,e.element.parentNode&&(this.containerHeight=e.element.parentNode.clientHeight,this.containerWidth=e.element.parentNode.clientWidth),"undefined"!=typeof IntersectionObserver&&"undefined"!=typeof ResizeObserver&&"virtual"===e.rowManager.getRenderMode()?(this.initializeVisibilityObserver(),this.autoResize=!0,this.resizeObserver=new ResizeObserver(t=>{if(!e.browserMobile||e.browserMobile&&(!e.modules.edit||e.modules.edit&&!e.modules.edit.currentCell)){var i=Math.floor(t[0].contentRect.height),s=Math.floor(t[0].contentRect.width);this.tableHeight==i&&this.tableWidth==s||(this.tableHeight=i,this.tableWidth=s,e.element.parentNode&&(this.containerHeight=e.element.parentNode.clientHeight,this.containerWidth=e.element.parentNode.clientWidth),this.redrawTable())}}),this.resizeObserver.observe(e.element),t=window.getComputedStyle(e.element),this.table.element.parentNode&&!this.table.rowManager.fixedHeight&&(t.getPropertyValue("max-height")||t.getPropertyValue("min-height"))&&(this.containerObserver=new ResizeObserver(t=>{if(!e.browserMobile||e.browserMobile&&(!e.modules.edit||e.modules.edit&&!e.modules.edit.currentCell)){var i=Math.floor(t[0].contentRect.height),s=Math.floor(t[0].contentRect.width);this.containerHeight==i&&this.containerWidth==s||(this.containerHeight=i,this.containerWidth=s,this.tableHeight=e.element.clientHeight,this.tableWidth=e.element.clientWidth),this.redrawTable()}}),this.containerObserver.observe(this.table.element.parentNode)),this.subscribe("table-resize",this.tableResized.bind(this))):(this.binding=function(){(!e.browserMobile||e.browserMobile&&(!e.modules.edit||e.modules.edit&&!e.modules.edit.currentCell))&&(e.columnManager.rerenderColumns(!0),e.redraw())},window.addEventListener("resize",this.binding)),this.subscribe("table-destroy",this.clearBindings.bind(this))}}initializeVisibilityObserver(){this.visibilityObserver=new IntersectionObserver(t=>{this.visible=t[t.length-1].isIntersecting,this.initialized?this.visible&&(this.redrawTable(this.initialRedraw),this.initialRedraw=!1):(this.initialized=!0,this.initialRedraw=!this.visible)}),this.visibilityObserver.observe(this.table.element)}redrawTable(t){this.initialized&&this.visible&&(this.table.columnManager.rerenderColumns(!0),this.table.redraw(t))}tableResized(){this.table.rowManager.redraw()}clearBindings(){this.binding&&window.removeEventListener("resize",this.binding),this.resizeObserver&&this.resizeObserver.unobserve(this.table.element),this.visibilityObserver&&this.visibilityObserver.unobserve(this.table.element),this.containerObserver&&this.containerObserver.unobserve(this.table.element.parentNode)}},ResponsiveLayoutModule:class extends na{static moduleName="responsiveLayout";static moduleExtensions=dl;constructor(t){super(t),this.columns=[],this.hiddenColumns=[],this.mode="",this.index=0,this.collapseFormatter=[],this.collapseStartOpen=!0,this.collapseHandleColumn=!1,this.registerTableOption("responsiveLayout",!1),this.registerTableOption("responsiveLayoutCollapseStartOpen",!0),this.registerTableOption("responsiveLayoutCollapseUseFormatters",!0),this.registerTableOption("responsiveLayoutCollapseFormatter",!1),this.registerColumnOption("responsive")}initialize(){this.table.options.responsiveLayout&&(this.subscribe("column-layout",this.initializeColumn.bind(this)),this.subscribe("column-show",this.updateColumnVisibility.bind(this)),this.subscribe("column-hide",this.updateColumnVisibility.bind(this)),this.subscribe("columns-loaded",this.initializeResponsivity.bind(this)),this.subscribe("column-moved",this.initializeResponsivity.bind(this)),this.subscribe("column-add",this.initializeResponsivity.bind(this)),this.subscribe("column-delete",this.initializeResponsivity.bind(this)),this.subscribe("table-redrawing",this.tableRedraw.bind(this)),"collapse"===this.table.options.responsiveLayout&&(this.subscribe("row-data-changed",this.generateCollapsedRowContent.bind(this)),this.subscribe("row-init",this.initializeRow.bind(this)),this.subscribe("row-layout",this.layoutRow.bind(this))))}tableRedraw(t){-1===["fitColumns","fitDataStretch"].indexOf(this.layoutMode())&&(t||this.update())}initializeResponsivity(){var t=[];this.mode=this.table.options.responsiveLayout,this.collapseFormatter=this.table.options.responsiveLayoutCollapseFormatter||this.formatCollapsedData,this.collapseStartOpen=this.table.options.responsiveLayoutCollapseStartOpen,this.hiddenColumns=[],this.collapseFormatter&&(this.collapseFormatter=this.collapseFormatter.bind(this.table)),this.table.columnManager.columnsByIndex.forEach((e,i)=>{e.modules.responsive&&e.modules.responsive.order&&e.modules.responsive.visible&&(e.modules.responsive.index=i,t.push(e),e.visible||"collapse"!==this.mode||this.hiddenColumns.push(e))}),t=(t=t.reverse()).sort((t,e)=>e.modules.responsive.order-t.modules.responsive.order||e.modules.responsive.index-t.modules.responsive.index),this.columns=t,"collapse"===this.mode&&this.generateCollapsedContent();for(let t of this.table.columnManager.columnsByIndex)if("responsiveCollapse"==t.definition.formatter){this.collapseHandleColumn=t;break}this.collapseHandleColumn&&(this.hiddenColumns.length?this.collapseHandleColumn.show():this.collapseHandleColumn.hide())}initializeColumn(t){var e=t.getDefinition();t.modules.responsive={order:void 0===e.responsive?1:e.responsive,visible:!1!==e.visible}}initializeRow(t){var e;"calc"!==t.type&&((e=document.createElement("div")).classList.add("tabulator-responsive-collapse"),t.modules.responsiveLayout={element:e,open:this.collapseStartOpen},this.collapseStartOpen||(e.style.display="none"))}layoutRow(t){var e=t.getElement();t.modules.responsiveLayout&&(e.appendChild(t.modules.responsiveLayout.element),this.generateCollapsedRowContent(t))}updateColumnVisibility(t,e){!e&&t.modules.responsive&&(t.modules.responsive.visible=t.visible,this.initializeResponsivity())}hideColumn(t){var e=this.hiddenColumns.length;t.hide(!1,!0),"collapse"===this.mode&&(this.hiddenColumns.unshift(t),this.generateCollapsedContent(),this.collapseHandleColumn&&!e&&this.collapseHandleColumn.show())}showColumn(t){var e;t.show(!1,!0),t.setWidth(t.getWidth()),"collapse"===this.mode&&((e=this.hiddenColumns.indexOf(t))>-1&&this.hiddenColumns.splice(e,1),this.generateCollapsedContent(),this.collapseHandleColumn&&!this.hiddenColumns.length&&this.collapseHandleColumn.hide())}update(){for(var t=!0;t;){let e="fitColumns"==this.table.modules.layout.getMode()?this.table.columnManager.getFlexBaseWidth():this.table.columnManager.getWidth(),i=(this.table.options.headerVisible?this.table.columnManager.element.clientWidth:this.table.element.clientWidth)-e;if(i<0){let e=this.columns[this.index];e?(this.hideColumn(e),this.index++):t=!1}else{let e=this.columns[this.index-1];e&&i>0&&i>=e.getWidth()?(this.showColumn(e),this.index--):t=!1}this.table.rowManager.activeRowsCount||this.table.rowManager.renderEmptyScroll()}}generateCollapsedContent(){this.table.rowManager.getDisplayRows().forEach(t=>{this.generateCollapsedRowContent(t)})}generateCollapsedRowContent(t){var e,i;if(t.modules.responsiveLayout){for(e=t.modules.responsiveLayout.element;e.firstChild;)e.removeChild(e.firstChild);(i=this.collapseFormatter(this.generateCollapsedRowData(t)))&&e.appendChild(i),t.calcHeight(!0)}}generateCollapsedRowData(t){var e,i=t.getData(),s=[];return this.hiddenColumns.forEach(n=>{var o=n.getFieldValue(i);if(n.definition.title&&n.field)if(n.modules.format&&this.table.options.responsiveLayoutCollapseUseFormatters){function r(t){t()}e={value:!1,data:{},getValue:function(){return o},getData:function(){return i},getType:function(){return"cell"},getElement:function(){return document.createElement("div")},getRow:function(){return t.getComponent()},getColumn:function(){return n.getComponent()},getTable:()=>this.table},s.push({field:n.field,title:n.definition.title,value:n.modules.format.formatter.call(this.table.modules.format,e,n.modules.format.params,r)})}else s.push({field:n.field,title:n.definition.title,value:o})}),s}formatCollapsedData(t){var e=document.createElement("table");return t.forEach(t=>{var i,s=document.createElement("tr"),n=document.createElement("td"),o=document.createElement("td"),r=document.createElement("strong");n.appendChild(r),this.modules.localize.bind("columns|"+t.field,function(e){r.innerHTML=e||t.title}),t.value instanceof Node?((i=document.createElement("div")).appendChild(t.value),o.appendChild(i)):o.innerHTML=t.value,s.appendChild(n),s.appendChild(o),e.appendChild(s)}),Object.keys(t).length?e:""}},SelectRangeModule:class extends na{static moduleName="selectRange";static moduleInitOrder=1;static moduleExtensions=gl;constructor(t){super(t),this.selecting="cell",this.mousedown=!1,this.ranges=[],this.overlay=null,this.rowHeader=null,this.layoutChangeTimeout=null,this.columnSelection=!1,this.rowSelection=!1,this.maxRanges=0,this.activeRange=!1,this.blockKeydown=!1,this.keyDownEvent=this._handleKeyDown.bind(this),this.mouseUpEvent=this._handleMouseUp.bind(this),this.registerTableOption("selectableRange",!1),this.registerTableOption("selectableRangeColumns",!1),this.registerTableOption("selectableRangeRows",!1),this.registerTableOption("selectableRangeClearCells",!1),this.registerTableOption("selectableRangeClearCellsValue",void 0),this.registerTableOption("selectableRangeAutoFocus",!0),this.registerTableOption("selectableRangeInitializeDefault",!0),this.registerTableOption("selectableRangeBlurEditOnNavigate",void 0),this.registerTableFunction("getRangesData",this.getRangesData.bind(this)),this.registerTableFunction("getRanges",this.getRanges.bind(this)),this.registerTableFunction("addRange",this.addRangeFromComponent.bind(this)),this.registerComponentFunction("cell","getRanges",this.cellGetRanges.bind(this)),this.registerComponentFunction("row","getRanges",this.rowGetRanges.bind(this)),this.registerComponentFunction("column","getRanges",this.colGetRanges.bind(this))}initialize(){this.options("selectableRange")&&(this.options("selectableRows")?console.warn("SelectRange functionality cannot be used in conjunction with row selection"):(this.maxRanges=this.options("selectableRange"),this.initializeTable(),this.initializeWatchers()),this.options("columns").findIndex(t=>t.frozen)>0&&console.warn("Having frozen column in arbitrary position with selectRange option may result in unpredictable behavior."),this.options("columns").filter(t=>t.frozen)>1&&console.warn("Having multiple frozen columns with selectRange option may result in unpredictable behavior.")),this.subscribe("edit-nav-disabled",()=>!0)}initializeTable(){this.overlay=document.createElement("div"),this.overlay.classList.add("tabulator-range-overlay"),this.rangeContainer=document.createElement("div"),this.rangeContainer.classList.add("tabulator-range-container"),this.activeRangeCellElement=document.createElement("div"),this.activeRangeCellElement.classList.add("tabulator-range-cell-active"),this.overlay.appendChild(this.rangeContainer),this.overlay.appendChild(this.activeRangeCellElement),this.table.rowManager.element.addEventListener("keydown",this.keyDownEvent),this.setDefaultRange(),this.table.rowManager.element.appendChild(this.overlay),this.table.columnManager.element.setAttribute("tabindex",0),this.table.element.classList.add("tabulator-ranges")}initializeWatchers(){this.columnSelection=this.options("selectableRangeColumns"),this.rowSelection=this.options("selectableRangeRows"),this.subscribe("column-init",this.initializeColumn.bind(this)),this.subscribe("column-mousedown",this.handleColumnMouseDown.bind(this)),this.subscribe("column-mousemove",this.handleColumnMouseMove.bind(this)),this.subscribe("column-resized",this.handleColumnResized.bind(this)),this.subscribe("column-moving",this.handleColumnMoving.bind(this)),this.subscribe("column-moved",this.handleColumnMoved.bind(this)),this.subscribe("column-width",this.layoutChange.bind(this)),this.subscribe("column-height",this.layoutChange.bind(this)),this.subscribe("column-resized",this.layoutChange.bind(this)),this.subscribe("columns-loaded",this.updateHeaderColumn.bind(this)),this.subscribe("cell-height",this.layoutChange.bind(this)),this.subscribe("cell-rendered",this.renderCell.bind(this)),this.subscribe("cell-mousedown",this.handleCellMouseDown.bind(this)),this.subscribe("cell-mousemove",this.handleCellMouseMove.bind(this)),this.subscribe("cell-click",this.handleCellClick.bind(this)),this.subscribe("cell-editing",this.handleEditingCell.bind(this)),this.subscribe("page-changed",this.redraw.bind(this)),this.subscribe("scroll-vertical",this.layoutChange.bind(this)),this.subscribe("scroll-horizontal",this.layoutChange.bind(this)),this.subscribe("data-destroy",this.tableDestroyed.bind(this)),this.subscribe("data-processed",this.setDefaultRange.bind(this)),this.subscribe("table-layout",this.layoutElement.bind(this)),this.subscribe("table-redraw",this.redraw.bind(this)),this.subscribe("table-destroy",this.tableDestroyed.bind(this)),this.subscribe("edit-editor-clear",this.finishEditingCell.bind(this)),this.subscribe("edit-blur",this.restoreFocus.bind(this)),this.subscribe("keybinding-nav-prev",this.keyNavigate.bind(this,"prev")),this.subscribe("keybinding-nav-next",this.keyNavigate.bind(this,"next")),this.subscribe("keybinding-nav-left",this.keyNavigate.bind(this,"left")),this.subscribe("keybinding-nav-right",this.keyNavigate.bind(this,"right")),this.subscribe("keybinding-nav-up",this.keyNavigate.bind(this,"up")),this.subscribe("keybinding-nav-down",this.keyNavigate.bind(this,"down")),this.subscribe("keybinding-nav-range",this.keyNavigateRange.bind(this))}initializeColumn(t){this.columnSelection&&t.definition.headerSort&&"icon"!==this.options("headerSortClickElement")&&console.warn("Using column headerSort with selectableRangeColumns option may result in unpredictable behavior. Consider using headerSortClickElement: 'icon'.")}updateHeaderColumn(){var t;this.rowSelection&&(this.rowHeader=this.table.columnManager.getVisibleColumnsByIndex()[0],this.rowHeader&&(this.rowHeader.definition.cssClass=this.rowHeader.definition.cssClass+" tabulator-range-row-header",this.rowHeader.definition.headerSort&&console.warn("Using column headerSort with selectableRangeRows option may result in unpredictable behavior"),this.rowHeader.definition.editor&&console.warn("Using column editor with selectableRangeRows option may result in unpredictable behavior"))),this.table.modules.frozenColumns&&this.table.modules.frozenColumns.active&&((t=this.table.modules.frozenColumns.getFrozenColumns()).length>1||1===t.length&&t[0]!==this.rowHeader)&&console.warn("Using frozen columns that are not the range header in combination with the selectRange option may result in unpredictable behavior")}getRanges(){return this.ranges.map(t=>t.getComponent())}getRangesData(){return this.ranges.map(t=>t.getData())}addRangeFromComponent(t,e){return t=t?t._cell:null,e=e?e._cell:null,this.addRange(t,e)}cellGetRanges(t){return(t.column===this.rowHeader?this.ranges.filter(e=>e.occupiesRow(t.row)):this.ranges.filter(e=>e.occupies(t))).map(t=>t.getComponent())}rowGetRanges(t){return this.ranges.filter(e=>e.occupiesRow(t)).map(t=>t.getComponent())}colGetRanges(t){return this.ranges.filter(e=>e.occupiesColumn(t)).map(t=>t.getComponent())}_handleMouseUp(t){this.mousedown=!1,document.removeEventListener("mouseup",this.mouseUpEvent)}_handleKeyDown(t){if(!this.blockKeydown&&(!this.table.modules.edit||this.table.modules.edit&&!this.table.modules.edit.currentCell)){if("Enter"===t.key){if(this.table.modules.edit&&this.table.modules.edit.currentCell)return;var e=this.getActiveCell();if(e)return;this.table.modules.edit.editCell(e),t.preventDefault()}"Backspace"!==t.key&&"Delete"!==t.key||!this.options("selectableRangeClearCells")||this.activeRange&&this.activeRange.clearValues()}}initializeFocus(t){var e;this.restoreFocus();try{document.selection?((e=document.body.createTextRange()).moveToElementText(t.getElement()),e.select()):window.getSelection&&((e=document.createRange()).selectNode(t.getElement()),window.getSelection().removeAllRanges(),window.getSelection().addRange(e))}catch(t){}}restoreFocus(t){return this.table.rowManager.element.focus(),!0}handleColumnResized(t){"column"!==this.selecting&&"all"!==this.selecting||this.ranges.some(e=>e.occupiesColumn(t))&&this.ranges.forEach(e=>{e.getColumns(!0).forEach(e=>{e!==t&&e.setWidth(t.width)})})}handleColumnMoving(t,e){this.resetRanges().setBounds(e),this.overlay.style.visibility="hidden"}handleColumnMoved(t,e,i){this.activeRange.setBounds(t),this.layoutElement()}handleColumnMouseDown(t,e){(2!==t.button||"column"!==this.selecting&&"all"!==this.selecting||!this.activeRange.occupiesColumn(e))&&(this.table.options.movableColumns&&"column"===this.selecting&&this.activeRange.occupiesColumn(e)||(this.mousedown=!0,document.addEventListener("mouseup",this.mouseUpEvent),this.newSelection(t,e)))}handleColumnMouseMove(t,e){e!==this.rowHeader&&this.mousedown&&"all"!==this.selecting&&this.activeRange.setBounds(!1,e,!0)}renderCell(t){var e=t.getElement(),i=this.ranges.findIndex(e=>e.occupies(t));e.classList.toggle("tabulator-range-selected",-1!==i),e.classList.toggle("tabulator-range-only-cell-selected",1===this.ranges.length&&this.ranges[0].atTopLeft(t)&&this.ranges[0].atBottomRight(t)),e.dataset.range=i}handleCellMouseDown(t,e){2===t.button&&(this.activeRange.occupies(e)||("row"===this.selecting||"all"===this.selecting)&&this.activeRange.occupiesRow(e.row))||(this.mousedown=!0,document.addEventListener("mouseup",this.mouseUpEvent),this.newSelection(t,e))}handleCellMouseMove(t,e){this.mousedown&&"all"!==this.selecting&&this.activeRange.setBounds(!1,e,!0)}handleCellClick(t,e){this.initializeFocus(e)}handleEditingCell(t){this.activeRange&&this.activeRange.setBounds(t)}finishEditingCell(){this.blockKeydown=!0,this.table.rowManager.element.focus(),setTimeout(()=>{this.blockKeydown=!1},10)}keyNavigate(t,e){if(this.options("selectableRangeBlurEditOnNavigate")&&this.chain("edit-check-editing")){if("next"!==t&&"prev"!==t)return!1;this.dispatch("edit-cancel-cell")}"prev"===t?t="left":"next"===t&&(t="right"),this.navigate(!1,!1,t)&&e.preventDefault()}keyNavigateRange(t,e,i,s){this.navigate(i,s,e)&&t.preventDefault()}navigate(t,e,i){var s,n,o,r,a,l,h,c,d,u,p;if(this.table.modules.edit&&this.table.modules.edit.currentCell)return!1;if(this.ranges.length>1&&(this.ranges=this.ranges.filter(t=>t===this.activeRange?(t.setEnd(t.start.row,t.start.col),!0):(t.destroy(),!1))),o={top:(s=this.activeRange).top,bottom:s.bottom,left:s.left,right:s.right},r=(n=e?s.end:s.start).row,a=n.col,t)switch(i){case"left":a=this.findJumpCellLeft(s.start.row,n.col);break;case"right":a=this.findJumpCellRight(s.start.row,n.col);break;case"up":r=this.findJumpCellUp(n.row,s.start.col);break;case"down":r=this.findJumpCellDown(n.row,s.start.col)}else{if(e&&("row"===this.selecting&&("left"===i||"right"===i)||"column"===this.selecting&&("up"===i||"down"===i)))return;switch(i){case"left":a=Math.max(a-1,0);break;case"right":a=Math.min(a+1,this.getTableColumns().length-1);break;case"up":r=Math.max(r-1,0);break;case"down":r=Math.min(r+1,this.getTableRows().length-1)}}return this.rowHeader&&0===a&&(a=1),e||s.setStart(r,a),s.setEnd(r,a),e||(this.selecting="cell"),(o.top!==s.top||o.bottom!==s.bottom||o.left!==s.left||o.right!==s.right)&&(l=this.getRowByRangePos(s.end.row),h=this.getColumnByRangePos(s.end.col),c=l.getElement().getBoundingClientRect(),u=h.getElement().getBoundingClientRect(),d=this.table.rowManager.getElement().getBoundingClientRect(),p=this.table.columnManager.getElement().getBoundingClientRect(),c.top>=d.top&&c.bottom<=d.bottom||(l.getElement().parentNode&&h.getElement().parentNode?this.autoScroll(s,l.getElement(),h.getElement()):l.getComponent().scrollTo(void 0,!1)),u.left>=p.left+this.getRowHeaderWidth()&&u.right<=p.right||(l.getElement().parentNode&&h.getElement().parentNode?this.autoScroll(s,l.getElement(),h.getElement()):h.getComponent().scrollTo(void 0,!1)),this.layoutElement()),!0}rangeRemoved(t){this.ranges=this.ranges.filter(e=>e!==t),this.activeRange===t&&(this.ranges.length?this.activeRange=this.ranges[this.ranges.length-1]:this.addRange()),this.layoutElement(!0)}findJumpRow(t,e,i,s,n){return i&&(e=e.reverse()),this.findJumpItem(s,n,e,function(e){return e.getData()[t.getField()]})}findJumpCol(t,e,i,s,n){return i&&(e=e.reverse()),this.findJumpItem(s,n,e,function(e){return t.getData()[e.getField()]})}findJumpItem(t,e,i,s){var n;for(let o of i){let i=s(o);if(t){if(n=o,i)break}else if(e){if(n=o,i)break}else{if(!i)break;n=o}}return n}findJumpCellLeft(t,e){var i=this.getRowByRangePos(t),s=this.getTableColumns(),n=this.isEmpty(i.getData()[s[e].getField()]),o=!!s[e-1]&&this.isEmpty(i.getData()[s[e-1].getField()]),r=this.rowHeader?s.slice(1,e):s.slice(0,e),a=this.findJumpCol(i,r,!0,n,o);return a?a.getPosition()-1:e}findJumpCellRight(t,e){var i=this.getRowByRangePos(t),s=this.getTableColumns(),n=this.isEmpty(i.getData()[s[e].getField()]),o=!!s[e+1]&&this.isEmpty(i.getData()[s[e+1].getField()]),r=this.findJumpCol(i,s.slice(e+1,s.length),!1,n,o);return r?r.getPosition()-1:e}findJumpCellUp(t,e){var i=this.getColumnByRangePos(e),s=this.getTableRows(),n=this.isEmpty(s[t].getData()[i.getField()]),o=!!s[t-1]&&this.isEmpty(s[t-1].getData()[i.getField()]),r=this.findJumpRow(i,s.slice(0,t),!0,n,o);return r?r.position-1:t}findJumpCellDown(t,e){var i=this.getColumnByRangePos(e),s=this.getTableRows(),n=this.isEmpty(s[t].getData()[i.getField()]),o=!!s[t+1]&&this.isEmpty(s[t+1].getData()[i.getField()]),r=this.findJumpRow(i,s.slice(t+1,s.length),!1,n,o);return r?r.position-1:t}newSelection(t,e){var i;if("column"===e.type){if(!this.columnSelection)return;if(e===this.rowHeader){i=this.resetRanges(),this.selecting="all";var s,n=this.getCell(-1,-1);return s=this.rowHeader?this.getCell(0,1):this.getCell(0,0),void i.setBounds(s,n)}this.selecting="column"}else e.column===this.rowHeader?this.selecting="row":this.selecting="cell";t.shiftKey?this.activeRange.setBounds(!1,e,!0):t.ctrlKey?this.addRange().setBounds(e,void 0,!0):this.resetRanges().setBounds(e,void 0,!0)}autoScroll(t,e,i){var s,n,o,r=this.table.rowManager.element;void 0===e&&(e=this.getRowByRangePos(t.end.row).getElement()),void 0===i&&(i=this.getColumnByRangePos(t.end.col).getElement()),s={left:i.offsetLeft,right:i.offsetLeft+i.offsetWidth,top:e.offsetTop,bottom:e.offsetTop+e.offsetHeight},o=(n={left:r.scrollLeft+this.getRowHeaderWidth(),right:Math.ceil(r.scrollLeft+r.clientWidth),top:r.scrollTop,bottom:r.scrollTop+r.offsetHeight-this.table.rowManager.scrollbarWidth}).top<s.top&&s.top<n.bottom&&n.top<s.bottom&&s.bottom<n.bottom,n.left<s.left&&s.left<n.right&&n.left<s.right&&s.right<n.right||(s.left<n.left?r.scrollLeft=s.left-this.getRowHeaderWidth():s.right>n.right&&(r.scrollLeft=Math.min(s.right-r.clientWidth,s.left-this.getRowHeaderWidth()))),o||(s.top<n.top?r.scrollTop=s.top:s.bottom>n.bottom&&(r.scrollTop=s.bottom-r.clientHeight))}layoutChange(){this.overlay.style.visibility="hidden",clearTimeout(this.layoutChangeTimeout),this.layoutChangeTimeout=setTimeout(this.layoutRanges.bind(this),200)}redraw(t){t&&(this.selecting="cell",this.setDefaultRange(),this.layoutElement())}layoutElement(t){(t?this.table.rowManager.getVisibleRows(!0):this.table.rowManager.getRows()).forEach(t=>{"row"===t.type&&(this.layoutRow(t),t.cells.forEach(t=>this.renderCell(t)))}),this.getTableColumns().forEach(t=>{this.layoutColumn(t)}),this.layoutRanges()}layoutRow(t){var e=t.getElement(),i=!1,s=this.ranges.some(e=>e.occupiesRow(t));"row"===this.selecting?i=s:"all"===this.selecting&&(i=!0),e.classList.toggle("tabulator-range-selected",i),e.classList.toggle("tabulator-range-highlight",s)}layoutColumn(t){var e=t.getElement(),i=!1,s=this.ranges.some(e=>e.occupiesColumn(t));"column"===this.selecting?i=s:"all"===this.selecting&&(i=!0),e.classList.toggle("tabulator-range-selected",i),e.classList.toggle("tabulator-range-highlight",s)}layoutRanges(){var t,e,i;this.table.initialized&&(t=this.getActiveCell())&&(e=t.getElement(),i=t.row.getElement(),this.table.rtl?this.activeRangeCellElement.style.right=i.offsetWidth-e.offsetLeft-e.offsetWidth+"px":this.activeRangeCellElement.style.left=i.offsetLeft+e.offsetLeft+"px",this.activeRangeCellElement.style.top=i.offsetTop+"px",this.activeRangeCellElement.style.width=e.offsetWidth+"px",this.activeRangeCellElement.style.height=i.offsetHeight+"px",this.ranges.forEach(t=>t.layout()),this.overlay.style.visibility="visible")}getCell(t,e){var i;return e<0&&(e=this.getTableColumns().length+e)<0?null:(t<0&&(t=this.getTableRows().length+t),(i=this.table.rowManager.getRowFromPosition(t+1))?i.getCells(!1,!0).filter(t=>t.column.visible)[e]:null)}getActiveCell(){if(this.activeRange)return this.getCell(this.activeRange.start.row,this.activeRange.start.col)}getRowByRangePos(t){return this.getTableRows()[t]}getColumnByRangePos(t){return this.getTableColumns()[t]}getTableRows(){return this.table.rowManager.getDisplayRows().filter(t=>"row"===t.type)}getTableColumns(){return this.table.columnManager.getVisibleColumnsByIndex()}addRange(t,e){var i;return!0!==this.maxRanges&&this.ranges.length>=this.maxRanges&&this.ranges.shift().destroy(),i=new ml(this.table,this,t,e),this.activeRange=i,this.ranges.push(i),this.rangeContainer.appendChild(i.element),i}createDefaultRange(){var t,e,i;return t=this.addRange(),this.table.rowManager.activeRows.length&&(i=this.table.rowManager.activeRows[0].cells.filter(t=>t.column.visible),(e=i[this.rowHeader?1:0])&&(t.setBounds(e),this.options("selectableRangeAutoFocus")&&this.initializeFocus(e))),t}clearRanges(){this.ranges.forEach(t=>t.destroy()),this.ranges=[]}setDefaultRange(){this.clearRanges(),this.options("selectableRangeInitializeDefault")&&this.createDefaultRange()}resetRanges(){return this.clearRanges(),this.createDefaultRange()}tableDestroyed(){document.removeEventListener("mouseup",this.mouseUpEvent),this.table.rowManager.element.removeEventListener("keydown",this.keyDownEvent)}selectedRows(t){return t?this.activeRange.getRows().map(t=>t.getComponent()):this.activeRange.getRows()}selectedColumns(t){return t?this.activeRange.getColumns().map(t=>t.getComponent()):this.activeRange.getColumns()}getRowHeaderWidth(){return this.rowHeader?this.rowHeader.getElement().offsetWidth:0}isEmpty(t){return null==t||""===t}},SelectRowModule:class extends na{static moduleName="selectRow";static moduleExtensions=ul;constructor(t){super(t),this.selecting=!1,this.lastClickedRow=!1,this.selectPrev=[],this.selectedRows=[],this.headerCheckboxElement=null,this.registerTableOption("selectableRows","highlight"),this.registerTableOption("selectableRowsRangeMode","drag"),this.registerTableOption("selectableRowsRollingSelection",!0),this.registerTableOption("selectableRowsPersistence",!0),this.registerTableOption("selectableRowsCheck",function(t,e){return!0}),this.registerTableFunction("selectRow",this.selectRows.bind(this)),this.registerTableFunction("deselectRow",this.deselectRows.bind(this)),this.registerTableFunction("toggleSelectRow",this.toggleRow.bind(this)),this.registerTableFunction("getSelectedRows",this.getSelectedRows.bind(this)),this.registerTableFunction("getSelectedData",this.getSelectedData.bind(this)),this.registerComponentFunction("row","select",this.selectRows.bind(this)),this.registerComponentFunction("row","deselect",this.deselectRows.bind(this)),this.registerComponentFunction("row","toggleSelect",this.toggleRow.bind(this)),this.registerComponentFunction("row","isSelected",this.isRowSelected.bind(this))}initialize(){this.deprecatedOptionsCheck(),"highlight"===this.table.options.selectableRows&&this.table.options.selectableRange&&(this.table.options.selectableRows=!1),!1!==this.table.options.selectableRows&&(this.subscribe("row-init",this.initializeRow.bind(this)),this.subscribe("row-deleting",this.rowDeleted.bind(this)),this.subscribe("rows-wipe",this.clearSelectionData.bind(this)),this.subscribe("rows-retrieve",this.rowRetrieve.bind(this)),this.table.options.selectableRows&&!this.table.options.selectableRowsPersistence&&this.subscribe("data-refreshing",this.deselectRows.bind(this)))}deprecatedOptionsCheck(){}rowRetrieve(t,e){return"selected"===t?this.selectedRows:e}rowDeleted(t){this._deselectRow(t,!0)}clearSelectionData(t){var e=this.selectedRows.length;this.selecting=!1,this.lastClickedRow=!1,this.selectPrev=[],this.selectedRows=[],e&&!0!==t&&this._rowSelectionChanged()}initializeRow(t){var e=this,i=e.checkRowSelectability(t),s=t.getElement(),n=function(){setTimeout(function(){e.selecting=!1},50),document.body.removeEventListener("mouseup",n)};t.modules.select={selected:!1},s.classList.toggle("tabulator-selectable",i),s.classList.toggle("tabulator-unselectable",!i),e.checkRowSelectability(t)&&e.table.options.selectableRows&&"highlight"!=e.table.options.selectableRows&&("click"===e.table.options.selectableRowsRangeMode?s.addEventListener("click",this.handleComplexRowClick.bind(this,t)):(s.addEventListener("click",function(i){e.table.modExists("edit")&&e.table.modules.edit.getCurrentCell()||e.table._clearSelection(),e.selecting||e.toggleRow(t)}),s.addEventListener("mousedown",function(i){if(i.shiftKey)return e.table._clearSelection(),e.selecting=!0,e.selectPrev=[],document.body.addEventListener("mouseup",n),document.body.addEventListener("keyup",n),e.toggleRow(t),!1}),s.addEventListener("mouseenter",function(i){e.selecting&&(e.table._clearSelection(),e.toggleRow(t),e.selectPrev[1]==t&&e.toggleRow(e.selectPrev[0]))}),s.addEventListener("mouseout",function(i){e.selecting&&(e.table._clearSelection(),e.selectPrev.unshift(t))})))}handleComplexRowClick(t,e){if(e.shiftKey){this.table._clearSelection(),this.lastClickedRow=this.lastClickedRow||t;var i=this.table.rowManager.getDisplayRowIndex(this.lastClickedRow),s=this.table.rowManager.getDisplayRowIndex(t),n=i<=s?i:s,o=i>=s?i:s,r=this.table.rowManager.getDisplayRows().slice(0).splice(n,o-n+1);e.ctrlKey||e.metaKey?(r.forEach(e=>{e!==this.lastClickedRow&&(!0===this.table.options.selectableRows||this.isRowSelected(t)||this.selectedRows.length<this.table.options.selectableRows)&&this.toggleRow(e)}),this.lastClickedRow=t):(this.deselectRows(void 0,!0),!0!==this.table.options.selectableRows&&r.length>this.table.options.selectableRows&&(r=r.slice(0,this.table.options.selectableRows)),this.selectRows(r)),this.table._clearSelection()}else e.ctrlKey||e.metaKey?(this.toggleRow(t),this.lastClickedRow=t):(this.deselectRows(void 0,!0),1===this.selectedRows.length&&this.isRowSelected(t)||this.selectRows(t),this.lastClickedRow=t)}checkRowSelectability(t){return!(!t||"row"!==t.type)&&this.table.options.selectableRowsCheck.call(this.table,t.getComponent())}toggleRow(t){this.checkRowSelectability(t)&&(t.modules.select&&t.modules.select.selected?this._deselectRow(t):this._selectRow(t))}selectRows(t){var e,i,s=[];switch(typeof t){case"undefined":e=this.table.rowManager.rows;break;case"number":e=this.table.rowManager.findRow(t);break;case"string":(e=this.table.rowManager.findRow(t))||(e=this.table.rowManager.getRows(t));break;default:e=t}Array.isArray(e)?e.length&&(e.forEach(t=>{(i=this._selectRow(t,!0,!0))&&s.push(i)}),this._rowSelectionChanged(!1,s)):e&&this._selectRow(e,!1,!0)}_selectRow(t,e,i){if(!isNaN(this.table.options.selectableRows)&&!0!==this.table.options.selectableRows&&!i&&this.selectedRows.length>=this.table.options.selectableRows){if(!this.table.options.selectableRowsRollingSelection)return!1;this._deselectRow(this.selectedRows[0])}var s=this.table.rowManager.findRow(t);if(s){if(-1==this.selectedRows.indexOf(s))return s.getElement().classList.add("tabulator-selected"),s.modules.select||(s.modules.select={}),s.modules.select.selected=!0,s.modules.select.checkboxEl&&(s.modules.select.checkboxEl.checked=!0),this.selectedRows.push(s),this.table.options.dataTreeSelectPropagate&&this.childRowSelection(s,!0),this.dispatchExternal("rowSelected",s.getComponent()),this._rowSelectionChanged(e,s),s}else e||console.warn("Selection Error - No such row found, ignoring selection:"+t)}isRowSelected(t){return-1!==this.selectedRows.indexOf(t)}deselectRows(t,e){var i,s,n=[];switch(typeof t){case"undefined":i=Object.assign([],this.selectedRows);break;case"number":i=this.table.rowManager.findRow(t);break;case"string":(i=this.table.rowManager.findRow(t))||(i=this.table.rowManager.getRows(t));break;default:i=t}Array.isArray(i)?i.length&&(i.forEach(t=>{(s=this._deselectRow(t,!0,!0))&&n.push(s)}),this._rowSelectionChanged(e,[],n)):i&&this._deselectRow(i,e,!0)}_deselectRow(t,e){var i,s,n=this,o=n.table.rowManager.findRow(t);if(o){if((i=n.selectedRows.findIndex(function(t){return t==o}))>-1)return(s=o.getElement())&&s.classList.remove("tabulator-selected"),o.modules.select||(o.modules.select={}),o.modules.select.selected=!1,o.modules.select.checkboxEl&&(o.modules.select.checkboxEl.checked=!1),n.selectedRows.splice(i,1),this.table.options.dataTreeSelectPropagate&&this.childRowSelection(o,!1),this.dispatchExternal("rowDeselected",o.getComponent()),n._rowSelectionChanged(e,void 0,o),o}else e||console.warn("Deselection Error - No such row found, ignoring selection:"+t)}getSelectedData(){var t=[];return this.selectedRows.forEach(function(e){t.push(e.getData())}),t}getSelectedRows(){var t=[];return this.selectedRows.forEach(function(e){t.push(e.getComponent())}),t}_rowSelectionChanged(t,e=[],i=[]){this.headerCheckboxElement&&(0===this.selectedRows.length?(this.headerCheckboxElement.checked=!1,this.headerCheckboxElement.indeterminate=!1):this.table.rowManager.rows.length===this.selectedRows.length?(this.headerCheckboxElement.checked=!0,this.headerCheckboxElement.indeterminate=!1):(this.headerCheckboxElement.indeterminate=!0,this.headerCheckboxElement.checked=!1)),t||(Array.isArray(e)||(e=[e]),e=e.map(t=>t.getComponent()),Array.isArray(i)||(i=[i]),i=i.map(t=>t.getComponent()),this.dispatchExternal("rowSelectionChanged",this.getSelectedData(),this.getSelectedRows(),e,i))}registerRowSelectCheckbox(t,e){t._row.modules.select||(t._row.modules.select={}),t._row.modules.select.checkboxEl=e}registerHeaderSelectCheckbox(t){this.headerCheckboxElement=t}childRowSelection(t,e){var i=this.table.modules.dataTree.getChildren(t,!0,!0);if(e)for(let t of i)this._selectRow(t,!0);else for(let t of i)this._deselectRow(t,!0)}},SortModule:vl,SpreadsheetModule:class extends na{static moduleName="spreadsheet";constructor(t){super(t),this.sheets=[],this.element=null,this.registerTableOption("spreadsheet",!1),this.registerTableOption("spreadsheetRows",50),this.registerTableOption("spreadsheetColumns",50),this.registerTableOption("spreadsheetColumnDefinition",{}),this.registerTableOption("spreadsheetOutputFull",!1),this.registerTableOption("spreadsheetData",!1),this.registerTableOption("spreadsheetSheets",!1),this.registerTableOption("spreadsheetSheetTabs",!1),this.registerTableOption("spreadsheetSheetTabsElement",!1),this.registerTableFunction("setSheets",this.setSheets.bind(this)),this.registerTableFunction("addSheet",this.addSheet.bind(this)),this.registerTableFunction("getSheets",this.getSheets.bind(this)),this.registerTableFunction("getSheetDefinitions",this.getSheetDefinitions.bind(this)),this.registerTableFunction("setSheetData",this.setSheetData.bind(this)),this.registerTableFunction("getSheet",this.getSheet.bind(this)),this.registerTableFunction("getSheetData",this.getSheetData.bind(this)),this.registerTableFunction("clearSheet",this.clearSheet.bind(this)),this.registerTableFunction("removeSheet",this.removeSheetFunc.bind(this)),this.registerTableFunction("activeSheet",this.activeSheetFunc.bind(this))}initialize(){this.options("spreadsheet")&&(this.subscribe("table-initialized",this.tableInitialized.bind(this)),this.subscribe("data-loaded",this.loadRemoteData.bind(this)),this.table.options.index="_id",this.options("spreadsheetData")&&this.options("spreadsheetSheets")&&(console.warn("You cannot use spreadsheetData and spreadsheetSheets at the same time, ignoring spreadsheetData"),this.table.options.spreadsheetData=!1),this.compatibilityCheck(),this.options("spreadsheetSheetTabs")&&this.initializeTabset())}compatibilityCheck(){this.options("data")&&console.warn("Do not use the data option when working with spreadsheets, use either spreadsheetData or spreadsheetSheets to pass data into the table"),this.options("pagination")&&console.warn("The spreadsheet module is not compatible with the pagination module"),this.options("groupBy")&&console.warn("The spreadsheet module is not compatible with the row grouping module"),this.options("responsiveCollapse")&&console.warn("The spreadsheet module is not compatible with the responsive collapse module")}initializeTabset(){this.element=document.createElement("div"),this.element.classList.add("tabulator-spreadsheet-tabs");var t=this.options("spreadsheetSheetTabsElement");!t||t instanceof HTMLElement||(t=document.querySelector(t))||console.warn("Unable to find element matching spreadsheetSheetTabsElement selector:",this.options("spreadsheetSheetTabsElement")),t?t.appendChild(this.element):this.footerAppend(this.element)}tableInitialized(){this.sheets.length?this.loadSheet(this.sheets[0]):this.options("spreadsheetSheets")?this.loadSheets(this.options("spreadsheetSheets")):this.options("spreadsheetData")&&this.loadData(this.options("spreadsheetData"))}loadRemoteData(t,e,i){return console.log("data",t,e,i),Array.isArray(t)?(this.table.dataLoader.clearAlert(),this.dispatchExternal("dataLoaded",t),!t.length||Array.isArray(t[0])?this.loadData(t):this.loadSheets(t)):console.error("Spreadsheet Loading Error - Unable to process remote data due to invalid data type \nExpecting: array \nReceived: ",typeof t,"\nData:     ",t),!1}loadData(t){var e={data:t};this.loadSheet(this.newSheet(e))}destroySheets(){this.sheets.forEach(t=>{t.destroy()}),this.sheets=[],this.activeSheet=null}loadSheets(t){Array.isArray(t)||(t=[]),this.destroySheets(),t.forEach(t=>{this.newSheet(t)}),this.loadSheet(this.sheets[0])}loadSheet(t){this.activeSheet!==t&&(this.activeSheet&&this.activeSheet.unload(),this.activeSheet=t,t.load())}newSheet(t={}){var e;return t.rows||(t.rows=this.options("spreadsheetRows")),t.columns||(t.columns=this.options("spreadsheetColumns")),e=new _l(this,t),this.sheets.push(e),this.element&&this.element.appendChild(e.element),e}removeSheet(t){var e,i=this.sheets.indexOf(t);this.sheets.length>1?i>-1&&(this.sheets.splice(i,1),t.destroy(),this.activeSheet===t&&((e=this.sheets[i-1]||this.sheets[0])?this.loadSheet(e):this.activeSheet=null)):console.warn("Unable to remove sheet, at least one sheet must be active")}lookupSheet(t){return t?t instanceof _l?t:t instanceof yl?t._sheet:this.sheets.find(e=>e.key===t)||!1:this.activeSheet}setSheets(t){return this.loadSheets(t),this.getSheets()}addSheet(t){return this.newSheet(t).getComponent()}getSheetDefinitions(){return this.sheets.map(t=>t.getDefinition())}getSheets(){return this.sheets.map(t=>t.getComponent())}getSheet(t){var e=this.lookupSheet(t);return!!e&&e.getComponent()}setSheetData(t,e){t&&!e&&(e=t,t=!1);var i=this.lookupSheet(t);return!!i&&i.setData(e)}getSheetData(t){var e=this.lookupSheet(t);return!!e&&e.getData()}clearSheet(t){var e=this.lookupSheet(t);return!!e&&e.clear()}removeSheetFunc(t){var e=this.lookupSheet(t);e&&this.removeSheet(e)}activeSheetFunc(t){var e=this.lookupSheet(t);return!!e&&this.loadSheet(e)}},TooltipModule:class extends na{static moduleName="tooltip";constructor(t){super(t),this.tooltipSubscriber=null,this.headerSubscriber=null,this.timeout=null,this.popupInstance=null,this.registerTableOption("tooltipDelay",300),this.registerColumnOption("tooltip"),this.registerColumnOption("headerTooltip")}initialize(){this.deprecatedOptionsCheck(),this.subscribe("column-init",this.initializeColumn.bind(this))}deprecatedOptionsCheck(){}initializeColumn(t){t.definition.headerTooltip&&!this.headerSubscriber&&(this.headerSubscriber=!0,this.subscribe("column-mousemove",this.mousemoveCheck.bind(this,"headerTooltip")),this.subscribe("column-mouseout",this.mouseoutCheck.bind(this,"headerTooltip"))),t.definition.tooltip&&!this.tooltipSubscriber&&(this.tooltipSubscriber=!0,this.subscribe("cell-mousemove",this.mousemoveCheck.bind(this,"tooltip")),this.subscribe("cell-mouseout",this.mouseoutCheck.bind(this,"tooltip")))}mousemoveCheck(t,e,i){var s="tooltip"===t?i.column.definition.tooltip:i.definition.headerTooltip;s&&(this.clearPopup(),this.timeout=setTimeout(this.loadTooltip.bind(this,e,i,s),this.table.options.tooltipDelay))}mouseoutCheck(t,e,i){this.popupInstance||this.clearPopup()}clearPopup(t,e,i){clearTimeout(this.timeout),this.timeout=null,this.popupInstance&&this.popupInstance.hide()}loadTooltip(t,e,i){var s,n,o;"function"==typeof i&&(i=i(t,e.getComponent(),function(t){n=t})),i instanceof HTMLElement?s=i:(s=document.createElement("div"),!0===i&&(e instanceof _a?i=e.value:e.definition.field?this.langBind("columns|"+e.definition.field,t=>{s.innerHTML=i=t||e.definition.title}):i=e.definition.title),s.innerHTML=i),(i||0===i||!1===i)&&(s.classList.add("tabulator-tooltip"),s.addEventListener("mousemove",t=>t.preventDefault()),this.popupInstance=this.popup(s),"function"==typeof n&&this.popupInstance.renderCallback(n),o=this.popupInstance.containerEventCoords(t),this.popupInstance.show(o.x+15,o.y+15).hideOnBlur(()=>{this.dispatchExternal("TooltipClosed",e.getComponent()),this.popupInstance=null}),this.dispatchExternal("TooltipOpened",e.getComponent()))}},ValidateModule:Cl}),El={debugEventsExternal:!1,debugEventsInternal:!1,debugInvalidOptions:!0,debugInvalidComponentFuncs:!0,debugInitialization:!0,debugDeprecation:!0,height:!1,minHeight:!1,maxHeight:!1,columnHeaderVertAlign:"top",popupContainer:!1,columns:[],columnDefaults:{},rowHeader:!1,data:!1,autoColumns:!1,autoColumnsDefinitions:!1,nestedFieldSeparator:".",footerElement:!1,index:"id",textDirection:"auto",addRowPos:"bottom",headerVisible:!0,renderVertical:"virtual",renderHorizontal:"basic",renderVerticalBuffer:0,scrollToRowPosition:"top",scrollToRowIfVisible:!0,scrollToColumnPosition:"left",scrollToColumnIfVisible:!0,rowFormatter:!1,rowFormatterPrint:null,rowFormatterClipboard:null,rowFormatterHtmlOutput:null,rowHeight:null,placeholder:!1,dataLoader:!0,dataLoaderLoading:!1,dataLoaderError:!1,dataLoaderErrorTimeout:3e3,dataSendParams:{},dataReceiveParams:{},dependencies:{}};class Rl{constructor(t,e,i={}){this.table=t,this.msgType=e,this.registeredDefaults=Object.assign({},i)}register(t,e){this.registeredDefaults[t]=e}generate(t,e={}){var i=Object.assign({},this.registeredDefaults),s=this.table.options.debugInvalidOptions||!0===e.debugInvalidOptions;Object.assign(i,t);for(let t in e)i.hasOwnProperty(t)||(s&&console.warn("Invalid "+this.msgType+" option:",t),i[t]=e.key);for(let t in i)t in e?i[t]=e[t]:Array.isArray(i[t])?i[t]=Object.assign([],i[t]):"object"==typeof i[t]&&null!==i[t]?i[t]=Object.assign({},i[t]):void 0===i[t]&&delete i[t];return i}}class Ml extends ea{constructor(t){super(t),this.elementVertical=t.rowManager.element,this.elementHorizontal=t.columnManager.element,this.tableElement=t.rowManager.tableElement,this.verticalFillMode="fit"}initialize(){}clearRows(){}clearColumns(){}reinitializeColumnWidths(t){}renderRows(){}renderColumns(){}rerenderRows(t){t&&t()}rerenderColumns(t,e){}renderRowCells(t){}rerenderRowCells(t,e){}scrollColumns(t,e){}scrollRows(t,e){}resize(){}scrollToRow(t){}scrollToRowNearestTop(t){}visibleRows(t){return[]}rows(){return this.table.rowManager.getDisplayRows()}styleRow(t,e){var i=t.getElement();e%2?(i.classList.add("tabulator-row-even"),i.classList.remove("tabulator-row-odd")):(i.classList.add("tabulator-row-odd"),i.classList.remove("tabulator-row-even"))}clear(){this.clearRows(),this.clearColumns()}render(){this.renderRows(),this.renderColumns()}rerender(t){this.rerenderRows(),this.rerenderColumns()}scrollToRowPosition(t,e,i){var s=this.rows().indexOf(t),n=t.getElement(),o=0;return new Promise((r,a)=>{if(s>-1){if(void 0===i&&(i=this.table.options.scrollToRowIfVisible),!i&&ia.elVisible(n)&&(o=ia.elOffset(n).top-ia.elOffset(this.elementVertical).top)>0&&o<this.elementVertical.clientHeight-n.offsetHeight)return r(),!1;switch(void 0===e&&(e=this.table.options.scrollToRowPosition),"nearest"===e&&(e=this.scrollToRowNearestTop(t)?"top":"bottom"),this.scrollToRow(t),e){case"middle":case"center":this.elementVertical.scrollHeight-this.elementVertical.scrollTop==this.elementVertical.clientHeight?this.elementVertical.scrollTop=this.elementVertical.scrollTop+(n.offsetTop-this.elementVertical.scrollTop)-(this.elementVertical.scrollHeight-n.offsetTop)/2:this.elementVertical.scrollTop=this.elementVertical.scrollTop-this.elementVertical.clientHeight/2;break;case"bottom":this.elementVertical.scrollHeight-this.elementVertical.scrollTop==this.elementVertical.clientHeight?this.elementVertical.scrollTop=this.elementVertical.scrollTop-(this.elementVertical.scrollHeight-n.offsetTop)+n.offsetHeight:this.elementVertical.scrollTop=this.elementVertical.scrollTop-this.elementVertical.clientHeight+n.offsetHeight;break;case"top":this.elementVertical.scrollTop=n.offsetTop}r()}else console.warn("Scroll Error - Row not visible"),a("Scroll Error - Row not visible")})}}class Tl extends Ml{constructor(t){super(t)}renderRowCells(t,e){const i=document.createDocumentFragment();t.cells.forEach(t=>{i.appendChild(t.getElement())}),t.element.appendChild(i),e||t.cells.forEach(t=>{t.cellRendered()})}reinitializeColumnWidths(t){t.forEach(function(t){t.reinitializeWidth()})}}class Sl extends Ml{constructor(t){super(t),this.leftCol=0,this.rightCol=0,this.scrollLeft=0,this.vDomScrollPosLeft=0,this.vDomScrollPosRight=0,this.vDomPadLeft=0,this.vDomPadRight=0,this.fitDataColAvg=0,this.windowBuffer=200,this.visibleRows=null,this.initialized=!1,this.isFitData=!1,this.columns=[]}initialize(){this.compatibilityCheck(),this.layoutCheck(),this.vertScrollListen()}compatibilityCheck(){"fitDataTable"==this.options("layout")&&console.warn("Horizontal Virtual DOM is not compatible with fitDataTable layout mode"),this.options("responsiveLayout")&&console.warn("Horizontal Virtual DOM is not compatible with responsive columns"),this.options("rtl")&&console.warn("Horizontal Virtual DOM is not currently compatible with RTL text direction")}layoutCheck(){this.isFitData=this.options("layout").startsWith("fitData")}vertScrollListen(){this.subscribe("scroll-vertical",this.clearVisRowCache.bind(this)),this.subscribe("data-refreshed",this.clearVisRowCache.bind(this))}clearVisRowCache(){this.visibleRows=null}renderColumns(t,e){this.dataChange()}scrollColumns(t,e){this.scrollLeft!=t&&(this.scrollLeft=t,this.scroll(t-(this.vDomScrollPosLeft+this.windowBuffer)))}calcWindowBuffer(){var t=this.elementVertical.clientWidth;this.table.columnManager.columnsByIndex.forEach(e=>{if(e.visible){var i=e.getWidth();i>t&&(t=i)}}),this.windowBuffer=2*t}rerenderColumns(t,e){var i={cols:this.columns,leftCol:this.leftCol,rightCol:this.rightCol},s=0;t&&!this.initialized||(this.clear(),this.calcWindowBuffer(),this.scrollLeft=this.elementVertical.scrollLeft,this.vDomScrollPosLeft=this.scrollLeft-this.windowBuffer,this.vDomScrollPosRight=this.scrollLeft+this.elementVertical.clientWidth+this.windowBuffer,this.table.columnManager.columnsByIndex.forEach(t=>{var e,i={};t.visible&&(t.modules.frozen||(e=t.getWidth(),i.leftPos=s,i.rightPos=s+e,i.width=e,this.isFitData&&(i.fitDataCheck=!t.modules.vdomHoz||t.modules.vdomHoz.fitDataCheck),s+e>this.vDomScrollPosLeft&&s<this.vDomScrollPosRight?(-1==this.leftCol&&(this.leftCol=this.columns.length,this.vDomPadLeft=s),this.rightCol=this.columns.length):-1!==this.leftCol&&(this.vDomPadRight+=e),this.columns.push(t),t.modules.vdomHoz=i,s+=e))}),this.tableElement.style.paddingLeft=this.vDomPadLeft+"px",this.tableElement.style.paddingRight=this.vDomPadRight+"px",this.initialized=!0,e||t&&!this.reinitChanged(i)||this.reinitializeRows(),this.elementVertical.scrollLeft=this.scrollLeft)}renderRowCells(t){if(this.initialized)this.initializeRow(t);else{const e=document.createDocumentFragment();t.cells.forEach(t=>{e.appendChild(t.getElement())}),t.element.appendChild(e),t.cells.forEach(t=>{t.cellRendered()})}}rerenderRowCells(t,e){this.reinitializeRow(t,e)}reinitializeColumnWidths(t){for(let t=this.leftCol;t<=this.rightCol;t++){let e=this.columns[t];e&&e.reinitializeWidth()}}deinitialize(){this.initialized=!1}clear(){this.columns=[],this.leftCol=-1,this.rightCol=0,this.vDomScrollPosLeft=0,this.vDomScrollPosRight=0,this.vDomPadLeft=0,this.vDomPadRight=0}dataChange(){var t,e,i=!1;if(this.isFitData){if(this.table.columnManager.columnsByIndex.forEach(t=>{!t.definition.width&&t.visible&&(i=!0)}),i&&this.table.rowManager.getDisplayRows().length&&(this.vDomScrollPosRight=this.scrollLeft+this.elementVertical.clientWidth+this.windowBuffer,t=this.chain("rows-sample",[1],[],()=>this.table.rowManager.getDisplayRows())[0])){e=t.getElement(),t.generateCells(),this.tableElement.appendChild(e);for(let i=0;i<t.cells.length;i++){let s=t.cells[i];e.appendChild(s.getElement()),s.column.reinitializeWidth()}e.parentNode.removeChild(e),this.rerenderColumns(!1,!0)}}else"fitColumns"===this.options("layout")&&(this.layoutRefresh(),this.rerenderColumns(!1,!0))}reinitChanged(t){var e=!0;return t.cols.length!==this.columns.length||t.leftCol!==this.leftCol||t.rightCol!==this.rightCol||(t.cols.forEach((t,i)=>{t!==this.columns[i]&&(e=!1)}),!e)}reinitializeRows(){var t=this.getVisibleRows(),e=this.table.rowManager.getRows().filter(e=>!t.includes(e));t.forEach(t=>{this.reinitializeRow(t,!0)}),e.forEach(t=>{t.deinitialize()})}getVisibleRows(){return this.visibleRows||(this.visibleRows=this.table.rowManager.getVisibleRows()),this.visibleRows}scroll(t){this.vDomScrollPosLeft+=t,this.vDomScrollPosRight+=t,Math.abs(t)>this.windowBuffer/2?this.rerenderColumns():t>0?(this.addColRight(),this.removeColLeft()):(this.addColLeft(),this.removeColRight())}colPositionAdjust(t,e,i){for(let s=t;s<e;s++){let t=this.columns[s];t.modules.vdomHoz.leftPos+=i,t.modules.vdomHoz.rightPos+=i}}addColRight(){for(var t=!1,e=!0;e;){let i=this.columns[this.rightCol+1];i&&i.modules.vdomHoz.leftPos<=this.vDomScrollPosRight?(t=!0,this.getVisibleRows().forEach(t=>{if("group"!==t.type){var e=t.getCell(i);t.getElement().insertBefore(e.getElement(),t.getCell(this.columns[this.rightCol]).getElement().nextSibling),e.cellRendered()}}),this.fitDataColActualWidthCheck(i),this.rightCol++,this.getVisibleRows().forEach(t=>{"group"!==t.type&&(t.modules.vdomHoz.rightCol=this.rightCol)}),this.rightCol>=this.columns.length-1?this.vDomPadRight=0:this.vDomPadRight-=i.getWidth()):e=!1}t&&(this.tableElement.style.paddingRight=this.vDomPadRight+"px")}addColLeft(){for(var t=!1,e=!0;e;){let i=this.columns[this.leftCol-1];if(i)if(i.modules.vdomHoz.rightPos>=this.vDomScrollPosLeft){t=!0,this.getVisibleRows().forEach(t=>{if("group"!==t.type){var e=t.getCell(i);t.getElement().insertBefore(e.getElement(),t.getCell(this.columns[this.leftCol]).getElement()),e.cellRendered()}}),this.leftCol--,this.getVisibleRows().forEach(t=>{"group"!==t.type&&(t.modules.vdomHoz.leftCol=this.leftCol)}),this.leftCol<=0?this.vDomPadLeft=0:this.vDomPadLeft-=i.getWidth();let e=this.fitDataColActualWidthCheck(i);e&&(this.scrollLeft=this.elementVertical.scrollLeft=this.elementVertical.scrollLeft+e,this.vDomPadRight-=e)}else e=!1;else e=!1}t&&(this.tableElement.style.paddingLeft=this.vDomPadLeft+"px")}removeColRight(){for(var t=!1,e=!0;e;){let i=this.columns[this.rightCol];i&&i.modules.vdomHoz.leftPos>this.vDomScrollPosRight?(t=!0,this.getVisibleRows().forEach(t=>{if("group"!==t.type){var e=t.getCell(i);try{t.getElement().removeChild(e.getElement())}catch(t){console.warn("Could not removeColRight",t.message)}}}),this.vDomPadRight+=i.getWidth(),this.rightCol--,this.getVisibleRows().forEach(t=>{"group"!==t.type&&(t.modules.vdomHoz.rightCol=this.rightCol)})):e=!1}t&&(this.tableElement.style.paddingRight=this.vDomPadRight+"px")}removeColLeft(){for(var t=!1,e=!0;e;){let i=this.columns[this.leftCol];i&&i.modules.vdomHoz.rightPos<this.vDomScrollPosLeft?(t=!0,this.getVisibleRows().forEach(t=>{if("group"!==t.type){var e=t.getCell(i);try{t.getElement().removeChild(e.getElement())}catch(t){console.warn("Could not removeColLeft",t.message)}}}),this.vDomPadLeft+=i.getWidth(),this.leftCol++,this.getVisibleRows().forEach(t=>{"group"!==t.type&&(t.modules.vdomHoz.leftCol=this.leftCol)})):e=!1}t&&(this.tableElement.style.paddingLeft=this.vDomPadLeft+"px")}fitDataColActualWidthCheck(t){var e,i;return t.modules.vdomHoz.fitDataCheck&&(t.reinitializeWidth(),(i=(e=t.getWidth())-t.modules.vdomHoz.width)&&(t.modules.vdomHoz.rightPos+=i,t.modules.vdomHoz.width=e,this.colPositionAdjust(this.columns.indexOf(t)+1,this.columns.length,i)),t.modules.vdomHoz.fitDataCheck=!1),i}initializeRow(t){if("group"!==t.type){t.modules.vdomHoz={leftCol:this.leftCol,rightCol:this.rightCol},this.table.modules.frozenColumns&&this.table.modules.frozenColumns.leftColumns.forEach(e=>{this.appendCell(t,e)});for(let e=this.leftCol;e<=this.rightCol;e++)this.appendCell(t,this.columns[e]);this.table.modules.frozenColumns&&this.table.modules.frozenColumns.rightColumns.forEach(e=>{this.appendCell(t,e)})}}appendCell(t,e){if(e&&e.visible){let i=t.getCell(e);t.getElement().appendChild(i.getElement()),i.cellRendered()}}reinitializeRow(t,e){if("group"!==t.type&&(e||!t.modules.vdomHoz||t.modules.vdomHoz.leftCol!==this.leftCol||t.modules.vdomHoz.rightCol!==this.rightCol)){for(var i=t.getElement();i.firstChild;)i.removeChild(i.firstChild);this.initializeRow(t)}}}class Dl extends ea{constructor(t){super(t),this.blockHozScrollEvent=!1,this.headersElement=null,this.contentsElement=null,this.rowHeader=null,this.element=null,this.columns=[],this.columnsByIndex=[],this.columnsByField={},this.scrollLeft=0,this.optionsList=new Rl(this.table,"column definition",Ca),this.redrawBlock=!1,this.redrawBlockUpdate=null,this.renderer=null}initialize(){this.initializeRenderer(),this.headersElement=this.createHeadersElement(),this.contentsElement=this.createHeaderContentsElement(),this.element=this.createHeaderElement(),this.contentsElement.insertBefore(this.headersElement,this.contentsElement.firstChild),this.element.insertBefore(this.contentsElement,this.element.firstChild),this.initializeScrollWheelWatcher(),this.subscribe("scroll-horizontal",this.scrollHorizontal.bind(this)),this.subscribe("scrollbar-vertical",this.padVerticalScrollbar.bind(this))}padVerticalScrollbar(t){this.table.rtl?this.headersElement.style.marginLeft=t+"px":this.headersElement.style.marginRight=t+"px"}initializeRenderer(){var t,e={virtual:Sl,basic:Tl};(t="string"==typeof this.table.options.renderHorizontal?e[this.table.options.renderHorizontal]:this.table.options.renderHorizontal)?(this.renderer=new t(this.table,this.element,this.tableElement),this.renderer.initialize()):console.error("Unable to find matching renderer:",this.table.options.renderHorizontal)}createHeadersElement(){var t=document.createElement("div");return t.classList.add("tabulator-headers"),t.setAttribute("role","row"),t}createHeaderContentsElement(){var t=document.createElement("div");return t.classList.add("tabulator-header-contents"),t}createHeaderElement(){var t=document.createElement("div");return t.classList.add("tabulator-header"),t.setAttribute("role","rowgroup"),this.table.options.headerVisible||t.classList.add("tabulator-header-hidden"),t}getElement(){return this.element}getContentsElement(){return this.contentsElement}getHeadersElement(){return this.headersElement}scrollHorizontal(t){this.contentsElement.scrollLeft=t,this.scrollLeft=t,this.renderer.scrollColumns(t)}initializeScrollWheelWatcher(){this.contentsElement.addEventListener("wheel",t=>{var e;t.deltaX&&(e=this.contentsElement.scrollLeft+t.deltaX,this.table.rowManager.scrollHorizontal(e),this.table.columnManager.scrollHorizontal(e))})}generateColumnsFromRowData(t){var e=[],i={},s="full"===this.table.options.autoColumns?t:[t[0]],n=this.table.options.autoColumnsDefinitions;if(t&&t.length){if(s.forEach(t=>{Object.keys(t).forEach((s,n)=>{let o,r=t[s];i[s]?!0!==i[s]&&void 0!==r&&(i[s].sorter=this.calculateSorterFromValue(r),i[s]=!0):(o={field:s,title:s,sorter:this.calculateSorterFromValue(r)},e.splice(n,0,o),i[s]=void 0!==r||o)})}),n)switch(typeof n){case"function":this.table.options.columns=n.call(this.table,e);break;case"object":Array.isArray(n)?e.forEach(t=>{var e=n.find(e=>e.field===t.field);e&&Object.assign(t,e)}):e.forEach(t=>{n[t.field]&&Object.assign(t,n[t.field])}),this.table.options.columns=e}else this.table.options.columns=e;this.setColumns(this.table.options.columns)}}calculateSorterFromValue(t){var e;switch(typeof t){case"undefined":e="string";break;case"boolean":e="boolean";break;case"number":e="number";break;case"object":e=Array.isArray(t)?"array":"string";break;default:e=isNaN(Number(t))||""===t?t.match(/((^[0-9]+[a-z]+)|(^[a-z]+[0-9]+))+$/i)?"alphanum":"string":"number"}return e}setColumns(t,e){for(;this.headersElement.firstChild;)this.headersElement.removeChild(this.headersElement.firstChild);this.columns=[],this.columnsByIndex=[],this.columnsByField={},this.dispatch("columns-loading"),this.dispatchExternal("columnsLoading"),this.table.options.rowHeader&&(this.rowHeader=new ka(!0===this.table.options.rowHeader?{}:this.table.options.rowHeader,this,!0),this.columns.push(this.rowHeader),this.headersElement.appendChild(this.rowHeader.getElement()),this.rowHeader.columnRendered()),t.forEach((t,e)=>{this._addColumn(t)}),this._reIndexColumns(),this.dispatch("columns-loaded"),this.subscribedExternal("columnsLoaded")&&this.dispatchExternal("columnsLoaded",this.getComponents()),this.rerenderColumns(!1,!0),this.redraw(!0)}_addColumn(t,e,i){var s=new ka(t,this),n=s.getElement(),o=i?this.findColumnIndex(i):i;if(!e||!this.rowHeader||i&&i!==this.rowHeader||(e=!1,i=this.rowHeader,o=0),i&&o>-1){var r=i.getTopColumn(),a=this.columns.indexOf(r),l=r.getElement();e?(this.columns.splice(a,0,s),l.parentNode.insertBefore(n,l)):(this.columns.splice(a+1,0,s),l.parentNode.insertBefore(n,l.nextSibling))}else e?(this.columns.unshift(s),this.headersElement.insertBefore(s.getElement(),this.headersElement.firstChild)):(this.columns.push(s),this.headersElement.appendChild(s.getElement()));return s.columnRendered(),s}registerColumnField(t){t.definition.field&&(this.columnsByField[t.definition.field]=t)}registerColumnPosition(t){this.columnsByIndex.push(t)}_reIndexColumns(){this.columnsByIndex=[],this.columns.forEach(function(t){t.reRegisterPosition()})}verticalAlignHeaders(){var t=0;this.redrawBlock||(this.headersElement.style.height="",this.columns.forEach(t=>{t.clearVerticalAlign()}),this.columns.forEach(e=>{var i=e.getHeight();i>t&&(t=i)}),this.headersElement.style.height=t+"px",this.columns.forEach(e=>{e.verticalAlign(this.table.options.columnHeaderVertAlign,t)}),this.table.rowManager.adjustTableSize())}findColumn(t){var e;return"object"!=typeof t?this.columnsByField[t]||!1:t instanceof ka?t:t instanceof xa?t._getSelf()||!1:"undefined"!=typeof HTMLElement&&t instanceof HTMLElement&&(e=[],this.columns.forEach(t=>{e.push(t),e=e.concat(t.getColumns(!0))}),e.find(e=>e.element===t)||!1)}getColumnByField(t){return this.columnsByField[t]}getColumnsByFieldRoot(t){var e=[];return Object.keys(this.columnsByField).forEach(i=>{(this.table.options.nestedFieldSeparator?i.split(this.table.options.nestedFieldSeparator)[0]:i)===t&&e.push(this.columnsByField[i])}),e}getColumnByIndex(t){return this.columnsByIndex[t]}getFirstVisibleColumn(){var t=this.columnsByIndex.findIndex(t=>t.visible);return t>-1&&this.columnsByIndex[t]}getVisibleColumnsByIndex(){return this.columnsByIndex.filter(t=>t.visible)}getColumns(){return this.columns}findColumnIndex(t){return this.columnsByIndex.findIndex(e=>t===e)}getRealColumns(){return this.columnsByIndex}traverse(t){this.columnsByIndex.forEach((e,i)=>{t(e,i)})}getDefinitions(t){var e=[];return this.columnsByIndex.forEach(i=>{(!t||t&&i.visible)&&e.push(i.getDefinition())}),e}getDefinitionTree(){var t=[];return this.columns.forEach(e=>{t.push(e.getDefinition(!0))}),t}getComponents(t){var e=[];return(t?this.columns:this.columnsByIndex).forEach(t=>{e.push(t.getComponent())}),e}getWidth(){var t=0;return this.columnsByIndex.forEach(e=>{e.visible&&(t+=e.getWidth())}),t}moveColumn(t,e,i){e.element.parentNode.insertBefore(t.element,e.element),i&&e.element.parentNode.insertBefore(e.element,t.element),this.moveColumnActual(t,e,i),this.verticalAlignHeaders(),this.table.rowManager.reinitialize()}moveColumnActual(t,e,i){t.parent.isGroup?this._moveColumnInArray(t.parent.columns,t,e,i):this._moveColumnInArray(this.columns,t,e,i),this._moveColumnInArray(this.columnsByIndex,t,e,i,!0),this.rerenderColumns(!0),this.dispatch("column-moved",t,e,i),this.subscribedExternal("columnMoved")&&this.dispatchExternal("columnMoved",t.getComponent(),this.table.columnManager.getComponents())}_moveColumnInArray(t,e,i,s,n){var o,r=t.indexOf(e);r>-1&&(t.splice(r,1),(o=t.indexOf(i))>-1?s&&(o+=1):o=r,t.splice(o,0,e),n&&(this.chain("column-moving-rows",[e,i,s],null,[])||[]).concat(this.table.rowManager.rows).forEach(function(t){if(t.cells.length){var e=t.cells.splice(r,1)[0];t.cells.splice(o,0,e)}}))}scrollToColumn(t,e,i){var s=0,n=t.getLeftOffset(),o=0,r=t.getElement();return new Promise((a,l)=>{if(void 0===e&&(e=this.table.options.scrollToColumnPosition),void 0===i&&(i=this.table.options.scrollToColumnIfVisible),t.visible){switch(e){case"middle":case"center":o=-this.element.clientWidth/2;break;case"right":o=r.clientWidth-this.headersElement.clientWidth}if(!i&&n>0&&n+r.offsetWidth<this.element.clientWidth)return!1;s=n+o,s=Math.max(Math.min(s,this.table.rowManager.element.scrollWidth-this.table.rowManager.element.clientWidth),0),this.table.rowManager.scrollHorizontal(s),this.scrollHorizontal(s),a()}else console.warn("Scroll Error - Column not visible"),l("Scroll Error - Column not visible")})}generateCells(t){var e=[];return this.columnsByIndex.forEach(i=>{e.push(i.generateCell(t))}),e}getFlexBaseWidth(){var t=this.table.element.clientWidth,e=0;return this.table.rowManager.element.scrollHeight>this.table.rowManager.element.clientHeight&&(t-=this.table.rowManager.element.offsetWidth-this.table.rowManager.element.clientWidth),this.columnsByIndex.forEach(function(i){var s,n,o;i.visible&&(s=i.definition.width||0,n=parseInt(i.minWidth),o="string"==typeof s?s.indexOf("%")>-1?t/100*parseInt(s):parseInt(s):s,e+=o>n?o:n)}),e}addColumn(t,e,i){return new Promise((s,n)=>{var o=this._addColumn(t,e,i);this._reIndexColumns(),this.dispatch("column-add",t,e,i),"fitColumns"!=this.layoutMode()&&o.reinitializeWidth(),this.redraw(!0),this.table.rowManager.reinitialize(),this.rerenderColumns(),s(o)})}deregisterColumn(t){var e,i=t.getField();i&&delete this.columnsByField[i],(e=this.columnsByIndex.indexOf(t))>-1&&this.columnsByIndex.splice(e,1),(e=this.columns.indexOf(t))>-1&&this.columns.splice(e,1),this.verticalAlignHeaders(),this.redraw()}rerenderColumns(t,e){this.redrawBlock?(!1===t||!0===t&&null===this.redrawBlockUpdate)&&(this.redrawBlockUpdate=t):this.renderer.rerenderColumns(t,e)}blockRedraw(){this.redrawBlock=!0,this.redrawBlockUpdate=null}restoreRedraw(){this.redrawBlock=!1,this.verticalAlignHeaders(),this.renderer.rerenderColumns(this.redrawBlockUpdate)}redraw(t){ia.elVisible(this.element)&&this.verticalAlignHeaders(),t&&(this.table.rowManager.resetScroll(),this.table.rowManager.reinitialize()),this.confirm("table-redrawing",t)||this.layoutRefresh(t),this.dispatch("table-redraw",t),this.table.footerManager.redraw()}}class Ll extends Ml{constructor(t){super(t),this.verticalFillMode="fill",this.scrollTop=0,this.scrollLeft=0,this.scrollTop=0,this.scrollLeft=0}clearRows(){for(var t=this.tableElement;t.firstChild;)t.removeChild(t.firstChild);t.scrollTop=0,t.scrollLeft=0,t.style.minWidth="",t.style.minHeight="",t.style.display="",t.style.visibility=""}renderRows(){var t=this.tableElement,e=!0,i=document.createDocumentFragment(),s=this.rows();s.forEach((t,s)=>{this.styleRow(t,s),t.initialize(!1,!0),"group"!==t.type&&(e=!1),i.appendChild(t.getElement())}),t.appendChild(i),s.forEach(t=>{t.rendered(),t.heightInitialized||t.calcHeight(!0)}),s.forEach(t=>{t.heightInitialized||t.setCellHeight()}),t.style.minWidth=e?this.table.columnManager.getWidth()+"px":""}rerenderRows(t){this.clearRows(),t&&t(),this.renderRows(),this.rows().length||this.table.rowManager.tableEmpty()}scrollToRowNearestTop(t){var e=ia.elOffset(t.getElement()).top;return!(Math.abs(this.elementVertical.scrollTop-e)>Math.abs(this.elementVertical.scrollTop+this.elementVertical.clientHeight-e))}scrollToRow(t){var e=t.getElement();this.elementVertical.scrollTop=ia.elOffset(e).top-ia.elOffset(this.elementVertical).top+this.elementVertical.scrollTop}visibleRows(t){return this.rows()}}class Pl extends Ml{constructor(t){super(t),this.verticalFillMode="fill",this.scrollTop=0,this.scrollLeft=0,this.vDomRowHeight=20,this.vDomTop=0,this.vDomBottom=0,this.vDomScrollPosTop=0,this.vDomScrollPosBottom=0,this.vDomTopPad=0,this.vDomBottomPad=0,this.vDomMaxRenderChain=90,this.vDomWindowBuffer=0,this.vDomWindowMinTotalRows=20,this.vDomWindowMinMarginRows=5,this.vDomTopNewRows=[],this.vDomBottomNewRows=[]}clearRows(){for(var t=this.tableElement;t.firstChild;)t.removeChild(t.firstChild);t.style.paddingTop="",t.style.paddingBottom="",t.style.minHeight="",t.style.display="",t.style.visibility="",this.elementVertical.scrollTop=0,this.elementVertical.scrollLeft=0,this.scrollTop=0,this.scrollLeft=0,this.vDomTop=0,this.vDomBottom=0,this.vDomTopPad=0,this.vDomBottomPad=0,this.vDomScrollPosTop=0,this.vDomScrollPosBottom=0}renderRows(){this._virtualRenderFill()}rerenderRows(t){for(var e=this.elementVertical.scrollTop,i=!1,s=!1,n=this.table.rowManager.scrollLeft,o=this.rows(),r=this.vDomTop;r<=this.vDomBottom;r++)if(o[r]){var a=e-o[r].getElement().offsetTop;if(!(!1===s||Math.abs(a)<s))break;s=a,i=r}o.forEach(t=>{t.deinitializeHeight()}),t&&t(),this.rows().length?this._virtualRenderFill(!1===i?this.rows.length-1:i,!0,s||0):(this.clear(),this.table.rowManager.tableEmpty()),this.scrollColumns(n)}scrollColumns(t){this.table.rowManager.scrollHorizontal(t)}scrollRows(t,e){var i=t-this.vDomScrollPosTop,s=t-this.vDomScrollPosBottom,n=2*this.vDomWindowBuffer,o=this.rows();if(this.scrollTop=t,-i>n||s>n){var r=this.table.rowManager.scrollLeft;this._virtualRenderFill(Math.floor(this.elementVertical.scrollTop/this.elementVertical.scrollHeight*o.length)),this.scrollColumns(r)}else e?(i<0&&this._addTopRow(o,-i),s<0&&(this.vDomScrollHeight-this.scrollTop>this.vDomWindowBuffer?this._removeBottomRow(o,-s):this.vDomScrollPosBottom=this.scrollTop)):(s>=0&&this._addBottomRow(o,s),i>=0&&(this.scrollTop>this.vDomWindowBuffer?this._removeTopRow(o,i):this.vDomScrollPosTop=this.scrollTop))}resize(){this.vDomWindowBuffer=this.table.options.renderVerticalBuffer||this.elementVertical.clientHeight}scrollToRowNearestTop(t){var e=this.rows().indexOf(t);return!(Math.abs(this.vDomTop-e)>Math.abs(this.vDomBottom-e))}scrollToRow(t){var e=this.rows().indexOf(t);e>-1&&this._virtualRenderFill(e,!0)}visibleRows(t){var e=this.elementVertical.scrollTop,i=this.elementVertical.clientHeight+e,s=!1,n=0,o=0,r=this.rows();if(t)n=this.vDomTop,o=this.vDomBottom;else for(var a=this.vDomTop;a<=this.vDomBottom;a++)if(r[a])if(s){if(!(i-r[a].getElement().offsetTop>=0))break;o=a}else if(e-r[a].getElement().offsetTop>=0)n=a;else{if(s=!0,!(i-r[a].getElement().offsetTop>=0))break;o=a}return r.slice(n,o+1)}_virtualRenderFill(t,e,i){var s,n,o=this.tableElement,r=this.elementVertical,a=0,l=0,h=0,c=0,d=0,u=0,p=this.rows(),m=p.length,g=0,b=[],f=0,v=0,w=this.table.rowManager.fixedHeight,y=this.elementVertical.clientHeight,_=this.table.options.rowHeight,x=!0;if(i=i||0,t=t||0){for(;o.firstChild;)o.removeChild(o.firstChild);(c=(m-t+1)*this.vDomRowHeight)<y&&(t-=Math.ceil((y-c)/this.vDomRowHeight))<0&&(t=0),t-=a=Math.min(Math.max(Math.floor(this.vDomWindowBuffer/this.vDomRowHeight),this.vDomWindowMinMarginRows),t)}else this.clear();if(m&&ia.elVisible(this.elementVertical)){for(this.vDomTop=t,this.vDomBottom=t-1,w||this.table.options.maxHeight?(_&&(v=y/_+this.vDomWindowBuffer/_),v=Math.max(this.vDomWindowMinTotalRows,Math.ceil(v))):v=m;(v==m||l<=y+this.vDomWindowBuffer||f<this.vDomWindowMinTotalRows)&&this.vDomBottom<m-1;){for(b=[],n=document.createDocumentFragment(),u=0;u<v&&this.vDomBottom<m-1;)s=p[g=this.vDomBottom+1],this.styleRow(s,g),s.initialize(!1,!0),s.heightInitialized||this.table.options.rowHeight||s.clearCellHeight(),n.appendChild(s.getElement()),b.push(s),this.vDomBottom++,u++;if(!b.length)break;o.appendChild(n),b.forEach(t=>{t.rendered()});const t=[];b.forEach(e=>{e.heightInitialized&&e.getHeight()||(e.calcHeight(!0),t.push(e))}),t.forEach(t=>{t.setCellHeight()}),b.forEach(t=>{h=t.getHeight()||this.vDomRowHeight,f<a?d+=h:l+=h,h>this.vDomWindowBuffer&&(this.vDomWindowBuffer=2*h),f++}),x=this.table.rowManager.adjustTableSize(),y=this.elementVertical.clientHeight,x&&(w||this.table.options.maxHeight)&&(_=l/f,v=Math.max(this.vDomWindowMinTotalRows,Math.ceil(y/_+this.vDomWindowBuffer/_)))}t?(this.vDomTopPad=e?this.vDomRowHeight*this.vDomTop+i:this.scrollTop-d,this.vDomBottomPad=this.vDomBottom==m-1?0:Math.max(this.vDomScrollHeight-this.vDomTopPad-l-d,0)):(this.vDomTopPad=0,this.vDomRowHeight=Math.floor((l+d)/f),this.vDomBottomPad=this.vDomRowHeight*(m-this.vDomBottom-1),this.vDomScrollHeight=d+l+this.vDomBottomPad-y),o.style.paddingTop=this.vDomTopPad+"px",o.style.paddingBottom=this.vDomBottomPad+"px",e&&(this.scrollTop=this.vDomTopPad+d+i-(this.elementVertical.scrollWidth>this.elementVertical.clientWidth?this.elementVertical.offsetHeight-y:0)),this.scrollTop=Math.min(this.scrollTop,this.elementVertical.scrollHeight-y),this.elementVertical.scrollWidth>this.elementVertical.clientWidth&&e&&(this.scrollTop+=this.elementVertical.offsetHeight-y),this.vDomScrollPosTop=this.scrollTop,this.vDomScrollPosBottom=this.scrollTop,r.scrollTop=this.scrollTop,this.dispatch("render-virtual-fill")}}_addTopRow(t,e){for(var i=this.tableElement,s=[],n=0,o=this.vDomTop-1,r=0,a=!0;a;)if(this.vDomTop){let l,h,c=t[o];c&&r<this.vDomMaxRenderChain?(l=c.getHeight()||this.vDomRowHeight,h=c.initialized,e>=l?(this.styleRow(c,o),i.insertBefore(c.getElement(),i.firstChild),c.initialized&&c.heightInitialized||s.push(c),c.initialize(),h||(l=c.getElement().offsetHeight,l>this.vDomWindowBuffer&&(this.vDomWindowBuffer=2*l)),e-=l,n+=l,this.vDomTop--,o--,r++):a=!1):a=!1}else a=!1;for(let t of s)t.clearCellHeight();this._quickNormalizeRowHeight(s),n&&(this.vDomTopPad-=n,this.vDomTopPad<0&&(this.vDomTopPad=o*this.vDomRowHeight),o<1&&(this.vDomTopPad=0),i.style.paddingTop=this.vDomTopPad+"px",this.vDomScrollPosTop-=n)}_removeTopRow(t,e){for(var i=[],s=0,n=0,o=!0;o;){let r,a=t[this.vDomTop];a&&n<this.vDomMaxRenderChain?(r=a.getHeight()||this.vDomRowHeight,e>=r?(this.vDomTop++,e-=r,s+=r,i.push(a),n++):o=!1):o=!1}for(let t of i){let e=t.getElement();e.parentNode&&e.parentNode.removeChild(e)}s&&(this.vDomTopPad+=s,this.tableElement.style.paddingTop=this.vDomTopPad+"px",this.vDomScrollPosTop+=this.vDomTop?s:s+this.vDomWindowBuffer)}_addBottomRow(t,e){for(var i=this.tableElement,s=[],n=0,o=this.vDomBottom+1,r=0,a=!0;a;){let l,h,c=t[o];c&&r<this.vDomMaxRenderChain?(l=c.getHeight()||this.vDomRowHeight,h=c.initialized,e>=l?(this.styleRow(c,o),i.appendChild(c.getElement()),c.initialized&&c.heightInitialized||s.push(c),c.initialize(),h||(l=c.getElement().offsetHeight,l>this.vDomWindowBuffer&&(this.vDomWindowBuffer=2*l)),e-=l,n+=l,this.vDomBottom++,o++,r++):a=!1):a=!1}for(let t of s)t.clearCellHeight();this._quickNormalizeRowHeight(s),n&&(this.vDomBottomPad-=n,(this.vDomBottomPad<0||o==t.length-1)&&(this.vDomBottomPad=0),i.style.paddingBottom=this.vDomBottomPad+"px",this.vDomScrollPosBottom+=n)}_removeBottomRow(t,e){for(var i=[],s=0,n=0,o=!0;o;){let r,a=t[this.vDomBottom];a&&n<this.vDomMaxRenderChain?(r=a.getHeight()||this.vDomRowHeight,e>=r?(this.vDomBottom--,e-=r,s+=r,i.push(a),n++):o=!1):o=!1}for(let t of i){let e=t.getElement();e.parentNode&&e.parentNode.removeChild(e)}s&&(this.vDomBottomPad+=s,this.vDomBottomPad<0&&(this.vDomBottomPad=0),this.tableElement.style.paddingBottom=this.vDomBottomPad+"px",this.vDomScrollPosBottom-=s)}_quickNormalizeRowHeight(t){for(let e of t)e.calcHeight();for(let e of t)e.setCellHeight()}}class jl extends ea{constructor(t){super(t),this.element=this.createHolderElement(),this.tableElement=this.createTableElement(),this.heightFixer=this.createTableElement(),this.placeholder=null,this.placeholderContents=null,this.firstRender=!1,this.renderMode="virtual",this.fixedHeight=!1,this.rows=[],this.activeRowsPipeline=[],this.activeRows=[],this.activeRowsCount=0,this.displayRows=[],this.displayRowsCount=0,this.scrollTop=0,this.scrollLeft=0,this.redrawBlock=!1,this.redrawBlockRestoreConfig=!1,this.redrawBlockRenderInPosition=!1,this.dataPipeline=[],this.displayPipeline=[],this.scrollbarWidth=0,this.renderer=null}createHolderElement(){var t=document.createElement("div");return t.classList.add("tabulator-tableholder"),t.setAttribute("tabindex",0),t}createTableElement(){var t=document.createElement("div");return t.classList.add("tabulator-table"),t.setAttribute("role","rowgroup"),t.setAttribute("id","tabulator-table-body"),t}initializePlaceholder(){var t=this.table.options.placeholder;if("function"==typeof t&&(t=t.call(this.table)),t=this.chain("placeholder",[t],t,t)||t){let e=document.createElement("div");if(e.classList.add("tabulator-placeholder"),"string"==typeof t){let i=document.createElement("div");i.classList.add("tabulator-placeholder-contents"),i.innerHTML=t,e.appendChild(i),this.placeholderContents=i}else"undefined"!=typeof HTMLElement&&t instanceof HTMLElement?(e.appendChild(t),this.placeholderContents=t):(console.warn("Invalid placeholder provided, must be string or HTML Element",t),this.el=null);this.placeholder=e}}getElement(){return this.element}getTableElement(){return this.tableElement}initialize(){this.initializePlaceholder(),this.initializeRenderer(),this.element.appendChild(this.tableElement),this.firstRender=!0,this.element.addEventListener("scroll",()=>{var t=this.element.scrollLeft,e=this.scrollLeft>t,i=this.element.scrollTop,s=this.scrollTop>i;this.scrollLeft!=t&&(this.scrollLeft=t,this.dispatch("scroll-horizontal",t,e),this.dispatchExternal("scrollHorizontal",t,e),this._positionPlaceholder()),this.scrollTop!=i&&(this.scrollTop=i,this.renderer.scrollRows(i,s),this.dispatch("scroll-vertical",i,s),this.dispatchExternal("scrollVertical",i,s))})}findRow(t){return"object"!=typeof t?void 0!==t&&(this.rows.find(e=>e.data[this.table.options.index]==t)||!1):t instanceof Ra?t:t instanceof Ea?t._getSelf()||!1:"undefined"!=typeof HTMLElement&&t instanceof HTMLElement&&this.rows.find(e=>e.getElement()===t)||!1}getRowFromDataObject(t){return this.rows.find(e=>e.data===t)||!1}getRowFromPosition(t){return this.getDisplayRows().find(e=>"row"===e.type&&e.getPosition()===t&&e.isDisplayed())}scrollToRow(t,e,i){return this.renderer.scrollToRowPosition(t,e,i)}setData(t,e,i){return new Promise((s,n)=>{e&&this.getDisplayRows().length?this.table.options.pagination?this._setDataActual(t,!0):this.reRenderInPosition(()=>{this._setDataActual(t)}):(this.table.options.autoColumns&&i&&this.table.initialized&&this.table.columnManager.generateColumnsFromRowData(t),this.resetScroll(),this._setDataActual(t)),s()})}_setDataActual(t,e){this.dispatchExternal("dataProcessing",t),this._wipeElements(),Array.isArray(t)?(this.dispatch("data-processing",t),t.forEach((t,e)=>{if(t&&"object"==typeof t){var i=new Ra(t,this);this.rows.push(i)}else console.warn("Data Loading Warning - Invalid row data detected and ignored, expecting object but received:",t)}),this.refreshActiveData(!1,!1,e),this.dispatch("data-processed",t),this.dispatchExternal("dataProcessed",t)):console.error("Data Loading Error - Unable to process data due to invalid data type \nExpecting: array \nReceived: ",typeof t,"\nData:     ",t)}_wipeElements(){this.dispatch("rows-wipe"),this.destroy(),this.adjustTableSize(),this.dispatch("rows-wiped")}destroy(){this.rows.forEach(t=>{t.wipe()}),this.rows=[],this.activeRows=[],this.activeRowsPipeline=[],this.activeRowsCount=0,this.displayRows=[],this.displayRowsCount=0}deleteRow(t,e){var i=this.rows.indexOf(t),s=this.activeRows.indexOf(t);s>-1&&this.activeRows.splice(s,1),i>-1&&this.rows.splice(i,1),this.setActiveRows(this.activeRows),this.displayRowIterator(e=>{var i=e.indexOf(t);i>-1&&e.splice(i,1)}),e||this.reRenderInPosition(),this.regenerateRowPositions(),this.dispatchExternal("rowDeleted",t.getComponent()),this.displayRowsCount||this.tableEmpty(),this.subscribedExternal("dataChanged")&&this.dispatchExternal("dataChanged",this.getData())}addRow(t,e,i,s){return this.addRowActual(t,e,i,s)}addRows(t,e,i,s){var n=[];return new Promise((o,r)=>{e=this.findAddRowPos(e),Array.isArray(t)||(t=[t]),(void 0===i&&e||void 0!==i&&!e)&&t.reverse(),t.forEach((t,s)=>{var o=this.addRow(t,e,i,!0);n.push(o),this.dispatch("row-added",o,t,e,i)}),this.refreshActiveData(!!s&&"displayPipeline",!1,!0),this.regenerateRowPositions(),this.displayRowsCount&&this._clearPlaceholder(),o(n)})}findAddRowPos(t){return void 0===t&&(t=this.table.options.addRowPos),"pos"===t&&(t=!0),"bottom"===t&&(t=!1),t}addRowActual(t,e,i,s){var n,o,r=t instanceof Ra?t:new Ra(t||{},this),a=this.findAddRowPos(e),l=-1;return i||(o=this.chain("row-adding-position",[r,a],null,{index:i,top:a}),i=o.index,a=o.top),void 0!==i&&(i=this.findRow(i)),(i=this.chain("row-adding-index",[r,i,a],null,i))&&(l=this.rows.indexOf(i)),i&&l>-1?(n=this.activeRows.indexOf(i),this.displayRowIterator(function(t){var e=t.indexOf(i);e>-1&&t.splice(a?e:e+1,0,r)}),n>-1&&this.activeRows.splice(a?n:n+1,0,r),this.rows.splice(a?l:l+1,0,r)):a?(this.displayRowIterator(function(t){t.unshift(r)}),this.activeRows.unshift(r),this.rows.unshift(r)):(this.displayRowIterator(function(t){t.push(r)}),this.activeRows.push(r),this.rows.push(r)),this.setActiveRows(this.activeRows),this.dispatchExternal("rowAdded",r.getComponent()),this.subscribedExternal("dataChanged")&&this.dispatchExternal("dataChanged",this.table.rowManager.getData()),s||this.reRenderInPosition(),r}moveRow(t,e,i){this.dispatch("row-move",t,e,i),this.moveRowActual(t,e,i),this.regenerateRowPositions(),this.dispatch("row-moved",t,e,i),this.dispatchExternal("rowMoved",t.getComponent())}moveRowActual(t,e,i){this.moveRowInArray(this.rows,t,e,i),this.moveRowInArray(this.activeRows,t,e,i),this.displayRowIterator(s=>{this.moveRowInArray(s,t,e,i)}),this.dispatch("row-moving",t,e,i)}moveRowInArray(t,e,i,s){var n,o,r;if(e!==i&&((n=t.indexOf(e))>-1&&(t.splice(n,1),(o=t.indexOf(i))>-1?s?t.splice(o+1,0,e):t.splice(o,0,e):t.splice(n,0,e)),t===this.getDisplayRows())){r=o>n?o:n+1;for(let e=n<o?n:o;e<=r;e++)t[e]&&this.styleRow(t[e],e)}}clearData(){this.setData([])}getRowIndex(t){return this.findRowIndex(t,this.rows)}getDisplayRowIndex(t){var e=this.getDisplayRows().indexOf(t);return e>-1&&e}nextDisplayRow(t,e){var i=this.getDisplayRowIndex(t),s=!1;return!1!==i&&i<this.displayRowsCount-1&&(s=this.getDisplayRows()[i+1]),!s||s instanceof Ra&&"row"==s.type?s:this.nextDisplayRow(s,e)}prevDisplayRow(t,e){var i=this.getDisplayRowIndex(t),s=!1;return i&&(s=this.getDisplayRows()[i-1]),!e||!s||s instanceof Ra&&"row"==s.type?s:this.prevDisplayRow(s,e)}findRowIndex(t,e){var i;return!!((t=this.findRow(t))&&(i=e.indexOf(t))>-1)&&i}getData(t,e){var i=[];return this.getRows(t).forEach(function(t){"row"==t.type&&i.push(t.getData(e||"data"))}),i}getComponents(t){var e=[];return this.getRows(t).forEach(function(t){e.push(t.getComponent())}),e}getDataCount(t){return this.getRows(t).length}scrollHorizontal(t){this.scrollLeft=t,this.element.scrollLeft=t,this.dispatch("scroll-horizontal",t)}registerDataPipelineHandler(t,e){void 0!==e?(this.dataPipeline.push({handler:t,priority:e}),this.dataPipeline.sort((t,e)=>t.priority-e.priority)):console.error("Data pipeline handlers must have a priority in order to be registered")}registerDisplayPipelineHandler(t,e){void 0!==e?(this.displayPipeline.push({handler:t,priority:e}),this.displayPipeline.sort((t,e)=>t.priority-e.priority)):console.error("Display pipeline handlers must have a priority in order to be registered")}refreshActiveData(t,e,i){var s=this.table,n="",o=0,r=["all","dataPipeline","display","displayPipeline","end"];if(!this.table.destroyed){if("function"==typeof t)if((o=this.dataPipeline.findIndex(e=>e.handler===t))>-1)n="dataPipeline",e&&(o==this.dataPipeline.length-1?n="display":o++);else{if(!((o=this.displayPipeline.findIndex(e=>e.handler===t))>-1))return void console.error("Unable to refresh data, invalid handler provided",t);n="displayPipeline",e&&(o==this.displayPipeline.length-1?n="end":o++)}else n=t||"all",o=0;if(this.redrawBlock)return void((!this.redrawBlockRestoreConfig||this.redrawBlockRestoreConfig&&(this.redrawBlockRestoreConfig.stage===n&&o<this.redrawBlockRestoreConfig.index||r.indexOf(n)<r.indexOf(this.redrawBlockRestoreConfig.stage)))&&(this.redrawBlockRestoreConfig={handler:t,skipStage:e,renderInPosition:i,stage:n,index:o}));ia.elVisible(this.element)?i?this.reRenderInPosition(this.refreshPipelines.bind(this,t,n,o,i)):(this.refreshPipelines(t,n,o,i),t||this.table.columnManager.renderer.renderColumns(),this.renderTable(),s.options.layoutColumnsOnNewData&&this.table.columnManager.redraw(!0)):this.refreshPipelines(t,n,o,i),this.dispatch("data-refreshed")}}refreshPipelines(t,e,i,s){switch(this.dispatch("data-refreshing"),t&&this.activeRowsPipeline[0]||(this.activeRowsPipeline[0]=this.rows.slice(0)),e){case"all":case"dataPipeline":for(let t=i;t<this.dataPipeline.length;t++){let e=this.dataPipeline[t].handler(this.activeRowsPipeline[t].slice(0));this.activeRowsPipeline[t+1]=e||this.activeRowsPipeline[t].slice(0)}this.setActiveRows(this.activeRowsPipeline[this.dataPipeline.length]);case"display":i=0,this.resetDisplayRows();case"displayPipeline":for(let t=i;t<this.displayPipeline.length;t++){let e=this.displayPipeline[t].handler((t?this.getDisplayRows(t-1):this.activeRows).slice(0),s);this.setDisplayRows(e||this.getDisplayRows(t-1).slice(0),t)}case"end":this.regenerateRowPositions()}this.getDisplayRows().length&&this._clearPlaceholder()}regenerateRowPositions(){var t=this.getDisplayRows(),e=1;t.forEach(t=>{"row"===t.type&&(t.setPosition(e),e++)})}setActiveRows(t){this.activeRows=this.activeRows=Object.assign([],t),this.activeRowsCount=this.activeRows.length}resetDisplayRows(){this.displayRows=[],this.displayRows.push(this.activeRows.slice(0)),this.displayRowsCount=this.displayRows[0].length}setDisplayRows(t,e){this.displayRows[e]=t,e==this.displayRows.length-1&&(this.displayRowsCount=this.displayRows[this.displayRows.length-1].length)}getDisplayRows(t){return void 0===t?this.displayRows.length?this.displayRows[this.displayRows.length-1]:[]:this.displayRows[t]||[]}getVisibleRows(t,e){var i=Object.assign([],this.renderer.visibleRows(!e));return t&&(i=this.chain("rows-visible",[e],i,i)),i}displayRowIterator(t){this.activeRowsPipeline.forEach(t),this.displayRows.forEach(t),this.displayRowsCount=this.displayRows[this.displayRows.length-1].length}getRows(t){var e=[];switch(t){case"active":e=this.activeRows;break;case"display":e=this.table.rowManager.getDisplayRows();break;case"visible":e=this.getVisibleRows(!1,!0);break;default:e=this.chain("rows-retrieve",t,null,this.rows)||this.rows}return e}reRenderInPosition(t){this.redrawBlock?t?t():this.redrawBlockRenderInPosition=!0:(this.dispatchExternal("renderStarted"),this.renderer.rerenderRows(t),this.fixedHeight||this.adjustTableSize(),this.scrollBarCheck(),this.dispatchExternal("renderComplete"))}scrollBarCheck(){var t=0;this.element.scrollHeight>this.element.clientHeight&&(t=this.element.offsetWidth-this.element.clientWidth),t!==this.scrollbarWidth&&(this.scrollbarWidth=t,this.dispatch("scrollbar-vertical",t))}initializeRenderer(){var t,e={virtual:Pl,basic:Ll};(t="string"==typeof this.table.options.renderVertical?e[this.table.options.renderVertical]:this.table.options.renderVertical)?(this.renderMode=this.table.options.renderVertical,this.renderer=new t(this.table,this.element,this.tableElement),this.renderer.initialize(),!this.table.element.clientHeight&&!this.table.options.height||this.table.options.minHeight&&this.table.options.maxHeight?this.fixedHeight=!1:this.fixedHeight=!0):console.error("Unable to find matching renderer:",this.table.options.renderVertical)}getRenderMode(){return this.renderMode}renderTable(){this.dispatchExternal("renderStarted"),this.element.scrollTop=0,this._clearTable(),this.displayRowsCount?(this.renderer.renderRows(),this.firstRender&&(this.firstRender=!1,this.fixedHeight||this.adjustTableSize(),this.layoutRefresh(!0))):this.renderEmptyScroll(),this.fixedHeight||this.adjustTableSize(),this.dispatch("table-layout"),this.displayRowsCount||this._showPlaceholder(),this.scrollBarCheck(),this.dispatchExternal("renderComplete")}renderEmptyScroll(){this.placeholder?this.tableElement.style.display="none":this.tableElement.style.minWidth=this.table.columnManager.getWidth()+"px"}_clearTable(){this._clearPlaceholder(),this.scrollTop=0,this.scrollLeft=0,this.renderer.clearRows()}tableEmpty(){this.renderEmptyScroll(),this._showPlaceholder()}checkPlaceholder(){this.displayRowsCount?this._clearPlaceholder():this.tableEmpty()}_showPlaceholder(){this.placeholder&&(this.placeholder&&this.placeholder.parentNode&&this.placeholder.parentNode.removeChild(this.placeholder),this.initializePlaceholder(),this.placeholder.setAttribute("tabulator-render-mode",this.renderMode),this.getElement().appendChild(this.placeholder),this._positionPlaceholder(),this.adjustTableSize())}_clearPlaceholder(){this.placeholder&&this.placeholder.parentNode&&this.placeholder.parentNode.removeChild(this.placeholder),this.tableElement.style.minWidth="",this.tableElement.style.display=""}_positionPlaceholder(){this.placeholder&&this.placeholder.parentNode&&(this.placeholder.style.width=this.table.columnManager.getWidth()+"px",this.placeholderContents.style.width=this.table.rowManager.element.clientWidth+"px",this.placeholderContents.style.marginLeft=this.scrollLeft+"px")}styleRow(t,e){var i=t.getElement();e%2?(i.classList.add("tabulator-row-even"),i.classList.remove("tabulator-row-odd")):(i.classList.add("tabulator-row-odd"),i.classList.remove("tabulator-row-even"))}normalizeHeight(t){this.activeRows.forEach(function(e){e.normalizeHeight(t)})}adjustTableSize(){let t,e=this.element.clientHeight,i=!1;if("fill"===this.renderer.verticalFillMode){let s=Math.floor(this.table.columnManager.getElement().getBoundingClientRect().height+(this.table.footerManager&&this.table.footerManager.active&&!this.table.footerManager.external?this.table.footerManager.getElement().getBoundingClientRect().height:0));if(this.fixedHeight){t=isNaN(this.table.options.minHeight)?this.table.options.minHeight:this.table.options.minHeight+"px";const e="calc(100% - "+s+"px)";this.element.style.minHeight=t||"calc(100% - "+s+"px)",this.element.style.height=e,this.element.style.maxHeight=e}else this.element.style.height="",this.element.style.height=this.table.element.clientHeight-s+"px",this.element.scrollTop=this.scrollTop;this.renderer.resize(),this.fixedHeight||e==this.element.clientHeight||(i=!0,this.redrawing||(this.redrawing=!0,this.subscribed("table-resize")?this.dispatch("table-resize"):this.redraw(),this.redrawing=!1)),this.scrollBarCheck()}return this._positionPlaceholder(),i}reinitialize(){this.rows.forEach(function(t){t.reinitialize(!0)})}blockRedraw(){this.redrawBlock=!0,this.redrawBlockRestoreConfig=!1}restoreRedraw(){this.redrawBlock=!1,this.redrawBlockRestoreConfig?(this.refreshActiveData(this.redrawBlockRestoreConfig.handler,this.redrawBlockRestoreConfig.skipStage,this.redrawBlockRestoreConfig.renderInPosition),this.redrawBlockRestoreConfig=!1):this.redrawBlockRenderInPosition&&this.reRenderInPosition(),this.redrawBlockRenderInPosition=!1}redraw(t){this.adjustTableSize(),this.table.tableWidth=this.table.element.clientWidth,t?this.renderTable():(this.reRenderInPosition(),this.scrollHorizontal(this.scrollLeft))}resetScroll(){if(this.element.scrollLeft=0,this.element.scrollTop=0,"ie"===this.table.browser){var t=document.createEvent("Event");t.initEvent("scroll",!1,!0),this.element.dispatchEvent(t)}else this.element.dispatchEvent(new Event("scroll"))}}class Nl extends ea{constructor(t){super(t),this.active=!1,this.element=this.createElement(),this.containerElement=this.createContainerElement(),this.external=!1}initialize(){this.initializeElement()}createElement(){var t=document.createElement("div");return t.classList.add("tabulator-footer"),t}createContainerElement(){var t=document.createElement("div");return t.classList.add("tabulator-footer-contents"),this.element.appendChild(t),t}initializeElement(){this.table.options.footerElement&&("string"==typeof this.table.options.footerElement?"<"===this.table.options.footerElement[0]?this.containerElement.innerHTML=this.table.options.footerElement:(this.external=!0,this.containerElement=document.querySelector(this.table.options.footerElement)):this.element=this.table.options.footerElement)}getElement(){return this.element}append(t){this.activate(),this.containerElement.appendChild(t),this.table.rowManager.adjustTableSize()}prepend(t){this.activate(),this.element.insertBefore(t,this.element.firstChild),this.table.rowManager.adjustTableSize()}remove(t){t.parentNode.removeChild(t),this.deactivate()}deactivate(t){this.element.firstChild&&!t||(this.external||this.element.parentNode.removeChild(this.element),this.active=!1)}activate(){this.active||(this.active=!0,this.external||(this.table.element.appendChild(this.getElement()),this.table.element.style.display=""))}redraw(){this.dispatch("footer-redraw")}}class Al extends ea{constructor(t){super(t),this.el=null,this.abortClasses=["tabulator-headers","tabulator-table"],this.previousTargets={},this.listeners=["click","dblclick","contextmenu","mouseenter","mouseleave","mouseover","mouseout","mousemove","mouseup","mousedown","touchstart","touchend"],this.componentMap={"tabulator-cell":"cell","tabulator-row":"row","tabulator-group":"group","tabulator-col":"column"},this.pseudoTrackers={row:{subscriber:null,target:null},cell:{subscriber:null,target:null},group:{subscriber:null,target:null},column:{subscriber:null,target:null}},this.pseudoTracking=!1}initialize(){this.el=this.table.element,this.buildListenerMap(),this.bindSubscriptionWatchers()}buildListenerMap(){var t={};this.listeners.forEach(e=>{t[e]={handler:null,components:[]}}),this.listeners=t}bindPseudoEvents(){Object.keys(this.pseudoTrackers).forEach(t=>{this.pseudoTrackers[t].subscriber=this.pseudoMouseEnter.bind(this,t),this.subscribe(t+"-mouseover",this.pseudoTrackers[t].subscriber)}),this.pseudoTracking=!0}pseudoMouseEnter(t,e,i){this.pseudoTrackers[t].target!==i&&(this.pseudoTrackers[t].target&&this.dispatch(t+"-mouseleave",e,this.pseudoTrackers[t].target),this.pseudoMouseLeave(t,e),this.pseudoTrackers[t].target=i,this.dispatch(t+"-mouseenter",e,i))}pseudoMouseLeave(t,e){var i=Object.keys(this.pseudoTrackers),s={row:["cell"],cell:["row"]};(i=i.filter(e=>{var i=s[t];return e!==t&&(!i||i&&!i.includes(e))})).forEach(t=>{var i=this.pseudoTrackers[t].target;this.pseudoTrackers[t].target&&(this.dispatch(t+"-mouseleave",e,i),this.pseudoTrackers[t].target=null)})}bindSubscriptionWatchers(){var t=Object.keys(this.listeners),e=Object.values(this.componentMap);for(let i of e)for(let e of t){let t=i+"-"+e;this.subscriptionChange(t,this.subscriptionChanged.bind(this,i,e))}this.subscribe("table-destroy",this.clearWatchers.bind(this))}subscriptionChanged(t,e,i){var s=this.listeners[e].components,n=s.indexOf(t),o=!1;i?-1===n&&(s.push(t),o=!0):this.subscribed(t+"-"+e)||n>-1&&(s.splice(n,1),o=!0),"mouseenter"!==e&&"mouseleave"!==e||this.pseudoTracking||this.bindPseudoEvents(),o&&this.updateEventListeners()}updateEventListeners(){for(let t in this.listeners){let e=this.listeners[t];e.components.length?e.handler||(e.handler=this.track.bind(this,t),this.el.addEventListener(t,e.handler)):e.handler&&(this.el.removeEventListener(t,e.handler),e.handler=null)}}track(t,e){var i=e.composedPath&&e.composedPath()||e.path,s=this.findTargets(i);s=this.bindComponents(t,s),this.triggerEvents(t,e,s),!this.pseudoTracking||"mouseover"!=t&&"mouseleave"!=t||Object.keys(s).length||this.pseudoMouseLeave("none",e)}findTargets(t){var e={};let i=Object.keys(this.componentMap);for(let s of t){let t=s.classList?[...s.classList]:[];if(t.filter(t=>this.abortClasses.includes(t)).length)break;let n=t.filter(t=>i.includes(t));for(let t of n)e[this.componentMap[t]]||(e[this.componentMap[t]]=s)}return e.group&&e.group===e.row&&delete e.row,e}bindComponents(t,e){var i=Object.keys(e).reverse(),s=this.listeners[t],n={},o={},r={};for(let t of i){let i,o=e[t],a=this.previousTargets[t];if(a&&a.target===o)i=a.component;else switch(t){case"row":case"group":(s.components.includes("row")||s.components.includes("cell")||s.components.includes("group"))&&(i=this.table.rowManager.getVisibleRows(!0).find(t=>t.getElement()===o),e.row&&e.row.parentNode&&e.row.parentNode.closest(".tabulator-row")&&(e[t]=!1));break;case"column":s.components.includes("column")&&(i=this.table.columnManager.findColumn(o));break;case"cell":s.components.includes("cell")&&(n.row instanceof Ra?i=n.row.findCell(o):e.row&&console.warn("Event Target Lookup Error - The row this cell is attached to cannot be found, has the table been reinitialized without being destroyed first?"))}i&&(n[t]=i,r[t]={target:o,component:i})}return this.previousTargets=r,Object.keys(e).forEach(t=>{let e=n[t];o[t]=e}),o}triggerEvents(t,e,i){var s=this.listeners[t];for(let n in i)i[n]&&s.components.includes(n)&&this.dispatch(n+"-"+t,e,i[n])}clearWatchers(){for(let t in this.listeners){let e=this.listeners[t];e.handler&&(this.el.removeEventListener(t,e.handler),e.handler=null)}}}class zl{constructor(t){this.table=t,this.bindings={}}bind(t,e,i){this.bindings[t]||(this.bindings[t]={}),this.bindings[t][e]?console.warn("Unable to bind component handler, a matching function name is already bound",t,e,i):this.bindings[t][e]=i}handle(t,e,i){if(this.bindings[t]&&this.bindings[t][i]&&"function"==typeof this.bindings[t][i].bind)return this.bindings[t][i].bind(null,e);"then"===i||"string"!=typeof i||i.startsWith("_")||this.table.options.debugInvalidComponentFuncs&&console.error("The "+t+" component does not have a "+i+" function, have you checked that you have the correct Tabulator module installed?")}}class Ol extends ea{constructor(t){super(t),this.requestOrder=0,this.loading=!1}initialize(){}load(t,e,i,s,n,o){var r=++this.requestOrder;return this.table.destroyed?Promise.resolve():(this.dispatchExternal("dataLoading",t),!t||0!=t.indexOf("{")&&0!=t.indexOf("[")||(t=JSON.parse(t)),this.confirm("data-loading",[t,e,i,n])?(this.loading=!0,n||this.alertLoader(),e=this.chain("data-params",[t,i,n],e||{},e||{}),e=this.mapParams(e,this.table.options.dataSendParams),this.chain("data-load",[t,e,i,n],!1,Promise.resolve([])).then(t=>{if(this.table.destroyed)console.warn("Data Load Response Blocked - Table has been destroyed");else{Array.isArray(t)||"object"!=typeof t||(t=this.mapParams(t,this.objectInvert(this.table.options.dataReceiveParams)));var e=this.chain("data-loaded",[t],null,t);r==this.requestOrder?(this.clearAlert(),!1!==e&&(this.dispatchExternal("dataLoaded",e),this.table.rowManager.setData(e,s,void 0===o?!s:o))):console.warn("Data Load Response Blocked - An active data load request was blocked by an attempt to change table data while the request was being made")}}).catch(t=>{console.error("Data Load Error: ",t),this.dispatchExternal("dataLoadError",t),n||this.alertError(),setTimeout(()=>{this.clearAlert()},this.table.options.dataLoaderErrorTimeout)}).finally(()=>{this.loading=!1})):(this.dispatchExternal("dataLoaded",t),t||(t=[]),this.table.rowManager.setData(t,s,void 0===o?!s:o),Promise.resolve()))}mapParams(t,e){var i={};for(let s in t)i[e.hasOwnProperty(s)?e[s]:s]=t[s];return i}objectInvert(t){var e={};for(let i in t)e[t[i]]=i;return e}blockActiveLoad(){this.requestOrder++}alertLoader(){("function"==typeof this.table.options.dataLoader?this.table.options.dataLoader():this.table.options.dataLoader)&&this.table.alertManager.alert(this.table.options.dataLoaderLoading||this.langText("data|loading"))}alertError(){this.table.alertManager.alert(this.table.options.dataLoaderError||this.langText("data|error"),"error")}clearAlert(){this.table.alertManager.clear()}}class Fl{constructor(t,e,i){this.table=t,this.events={},this.optionsList=e||{},this.subscriptionNotifiers={},this.dispatch=i?this._debugDispatch.bind(this):this._dispatch.bind(this),this.debug=i}subscriptionChange(t,e){this.subscriptionNotifiers[t]||(this.subscriptionNotifiers[t]=[]),this.subscriptionNotifiers[t].push(e),this.subscribed(t)&&this._notifySubscriptionChange(t,!0)}subscribe(t,e){this.events[t]||(this.events[t]=[]),this.events[t].push(e),this._notifySubscriptionChange(t,!0)}unsubscribe(t,e){var i;if(this.events[t]){if(e){if(!((i=this.events[t].findIndex(t=>t===e))>-1))return void console.warn("Cannot remove event, no matching event found:",t,e);this.events[t].splice(i,1)}else delete this.events[t];this._notifySubscriptionChange(t,!1)}else console.warn("Cannot remove event, no events set on:",t)}subscribed(t){return this.events[t]&&this.events[t].length}_notifySubscriptionChange(t,e){var i=this.subscriptionNotifiers[t];i&&i.forEach(t=>{t(e)})}_dispatch(){var t,e=Array.from(arguments),i=e.shift();return this.events[i]&&this.events[i].forEach((i,s)=>{let n=i.apply(this.table,e);s||(t=n)}),t}_debugDispatch(){var t=Array.from(arguments),e=t[0];return t[0]="ExternalEvent:"+t[0],(!0===this.debug||this.debug.includes(e))&&console.log(...t),this._dispatch(...arguments)}}class Hl{constructor(t){this.events={},this.subscriptionNotifiers={},this.dispatch=t?this._debugDispatch.bind(this):this._dispatch.bind(this),this.chain=t?this._debugChain.bind(this):this._chain.bind(this),this.confirm=t?this._debugConfirm.bind(this):this._confirm.bind(this),this.debug=t}subscriptionChange(t,e){this.subscriptionNotifiers[t]||(this.subscriptionNotifiers[t]=[]),this.subscriptionNotifiers[t].push(e),this.subscribed(t)&&this._notifySubscriptionChange(t,!0)}subscribe(t,e,i=1e4){this.events[t]||(this.events[t]=[]),this.events[t].push({callback:e,priority:i}),this.events[t].sort((t,e)=>t.priority-e.priority),this._notifySubscriptionChange(t,!0)}unsubscribe(t,e){var i;if(this.events[t]){if(e){if(!((i=this.events[t].findIndex(t=>t.callback===e))>-1))return void console.warn("Cannot remove event, no matching event found:",t,e);this.events[t].splice(i,1)}this._notifySubscriptionChange(t,!1)}else console.warn("Cannot remove event, no events set on:",t)}subscribed(t){return this.events[t]&&this.events[t].length}_chain(t,e,i,s){var n=i;return Array.isArray(e)||(e=[e]),this.subscribed(t)?(this.events[t].forEach((t,i)=>{n=t.callback.apply(this,e.concat([n]))}),n):"function"==typeof s?s():s}_confirm(t,e){var i=!1;return Array.isArray(e)||(e=[e]),this.subscribed(t)&&this.events[t].forEach((t,s)=>{t.callback.apply(this,e)&&(i=!0)}),i}_notifySubscriptionChange(t,e){var i=this.subscriptionNotifiers[t];i&&i.forEach(t=>{t(e)})}_dispatch(){var t=Array.from(arguments),e=t.shift();this.events[e]&&this.events[e].forEach(e=>{e.callback.apply(this,t)})}_debugDispatch(){var t=Array.from(arguments),e=t[0];return t[0]="InternalEvent:"+e,(!0===this.debug||this.debug.includes(e))&&console.log(...t),this._dispatch(...arguments)}_debugChain(){var t=Array.from(arguments),e=t[0];return t[0]="InternalEvent:"+e,(!0===this.debug||this.debug.includes(e))&&console.log(...t),this._chain(...arguments)}_debugConfirm(){var t=Array.from(arguments),e=t[0];return t[0]="InternalEvent:"+e,(!0===this.debug||this.debug.includes(e))&&console.log(...t),this._confirm(...arguments)}}class Il extends ea{constructor(t){super(t)}_warnUser(){this.options("debugDeprecation")&&console.warn(...arguments)}check(t,e,i){var s="";return void 0===this.options(t)||(s="Deprecated Setup Option - Use of the %c"+t+"%c option is now deprecated",e?(s=s+", Please use the %c"+e+"%c option instead",this._warnUser(s,"font-weight: bold;","font-weight: normal;","font-weight: bold;","font-weight: normal;"),i&&(this.table.options[e]=this.table.options[t])):this._warnUser(s,"font-weight: bold;","font-weight: normal;"),!1)}checkMsg(t,e){return void 0===this.options(t)||(this._warnUser("%cDeprecated Setup Option - Use of the %c"+t+" %c option is now deprecated, "+e,"font-weight: normal;","font-weight: bold;","font-weight: normal;"),!1)}msg(t){this._warnUser(t)}}class Bl extends ea{constructor(t){super(t),this.deps={},this.props={}}initialize(){this.deps=Object.assign({},this.options("dependencies"))}lookup(t,e,i){if(!Array.isArray(t))return e?this.lookupProp(t,e,i):this.lookupKey(t,i);for(const i of t){var s=this.lookup(i,e,!0);if(s)break}if(s)return s;this.error(t)}lookupProp(t,e,i){var s;return this.props[t]&&this.props[t][e]?this.props[t][e]:(s=this.lookupKey(t,i))?(this.props[t]||(this.props[t]={}),this.props[t][e]=s[e]||s,this.props[t][e]):void 0}lookupKey(t,e){var i;return this.deps[t]?i=this.deps[t]:window[t]?(this.deps[t]=window[t],i=this.deps[t]):e||this.error(t),i}error(t){console.error("Unable to find dependency",t,"Please check documentation and ensure you have imported the required library into your project")}}function Vl(t,e){t.forEach(function(t){t.reinitializeWidth()}),this.table.options.responsiveLayout&&this.table.modExists("responsiveLayout",!0)&&this.table.modules.responsiveLayout.update()}var Wl={fitData:function(t,e){e&&this.table.columnManager.renderer.reinitializeColumnWidths(t),this.table.options.responsiveLayout&&this.table.modExists("responsiveLayout",!0)&&this.table.modules.responsiveLayout.update()},fitDataFill:Vl,fitDataTable:Vl,fitDataStretch:function(t,e){var i=0,s=this.table.rowManager.element.clientWidth,n=0,o=!1;t.forEach((t,e)=>{t.widthFixed||t.reinitializeWidth(),(this.table.options.responsiveLayout?t.modules.responsive.visible:t.visible)&&(o=t),t.visible&&(i+=t.getWidth())}),o?(n=s-i+o.getWidth(),this.table.options.responsiveLayout&&this.table.modExists("responsiveLayout",!0)&&(o.setWidth(0),this.table.modules.responsiveLayout.update()),n>0?o.setWidth(n):o.reinitializeWidth()):this.table.options.responsiveLayout&&this.table.modExists("responsiveLayout",!0)&&this.table.modules.responsiveLayout.update()},fitColumns:function(t,e){var i,s,n=this.table.rowManager.element.getBoundingClientRect().width,o=0,r=0,a=0,l=[],h=[],c=0,d=0;function u(t){return"string"==typeof t?t.indexOf("%")>-1?n/100*parseInt(t):parseInt(t):t}function p(t,e,i,s){var n=[],o=0,r=0,l=0,h=a,c=0,d=0,m=[];function g(t){return i*(t.column.definition.widthGrow||1)}function b(t){return u(t.width)-i*(t.column.definition.widthShrink||0)}return t.forEach(function(t,o){var r=s?b(t):g(t);t.column.minWidth>=r?n.push(t):t.column.maxWidth&&t.column.maxWidth<r?(t.width=t.column.maxWidth,e-=t.column.maxWidth,(h-=s?t.column.definition.widthShrink||1:t.column.definition.widthGrow||1)&&(i=Math.floor(e/h))):(m.push(t),d+=s?t.column.definition.widthShrink||1:t.column.definition.widthGrow||1)}),n.length?(n.forEach(function(t){o+=s?t.width-t.column.minWidth:t.column.minWidth,t.width=t.column.minWidth}),r=e-o,l=d?Math.floor(r/d):r,c=p(m,r,l,s)):(c=d?e-Math.floor(e/d)*d:e,m.forEach(function(t){t.width=s?b(t):g(t)})),c}this.table.options.responsiveLayout&&this.table.modExists("responsiveLayout",!0)&&this.table.modules.responsiveLayout.update(),this.table.rowManager.element.scrollHeight>this.table.rowManager.element.clientHeight&&(n-=this.table.rowManager.element.offsetWidth-this.table.rowManager.element.clientWidth),t.forEach(function(t){var e,i,s;t.visible&&(e=t.definition.width,i=parseInt(t.minWidth),e?(s=u(e),o+=s>i?s:i,t.definition.widthShrink&&(h.push({column:t,width:s>i?s:i}),c+=t.definition.widthShrink)):(l.push({column:t,width:0}),a+=t.definition.widthGrow||1))}),r=n-o,i=Math.floor(r/a),d=p(l,r,i,!1),l.length&&d>0&&(l[l.length-1].width+=d),l.forEach(function(t){r-=t.width}),(s=Math.abs(d)+r)>0&&c&&(d=p(h,s,Math.floor(s/c),!0)),d&&h.length&&(h[h.length-1].width-=d),l.forEach(function(t){t.column.setWidth(t.width)}),h.forEach(function(t){t.column.setWidth(t.width)})}};class Gl extends na{static moduleName="layout";static modes=Wl;constructor(t){super(t,"layout"),this.mode=null,this.registerTableOption("layout","fitData"),this.registerTableOption("layoutColumnsOnNewData",!1),this.registerColumnOption("widthGrow"),this.registerColumnOption("widthShrink")}initialize(){var t=this.table.options.layout;Gl.modes[t]?this.mode=t:(console.warn("Layout Error - invalid mode set, defaulting to 'fitData' : "+t),this.mode="fitData"),this.table.element.setAttribute("tabulator-layout",this.mode),this.subscribe("column-init",this.initializeColumn.bind(this))}initializeColumn(t){t.definition.widthGrow&&(t.definition.widthGrow=Number(t.definition.widthGrow)),t.definition.widthShrink&&(t.definition.widthShrink=Number(t.definition.widthShrink))}getMode(){return this.mode}layout(t){var e=this.table.columnManager.columnsByIndex.find(t=>t.definition.variableHeight||"textarea"===t.definition.formatter);this.dispatch("layout-refreshing"),Gl.modes[this.mode].call(this,this.table.columnManager.columnsByIndex,t),e&&this.table.rowManager.normalizeHeight(!0),this.dispatch("layout-refreshed")}}var Ul={default:{groups:{item:"item",items:"items"},columns:{},data:{loading:"Loading",error:"Error"},pagination:{page_size:"Page Size",page_title:"Show Page",first:"First",first_title:"First Page",last:"Last",last_title:"Last Page",prev:"Prev",prev_title:"Prev Page",next:"Next",next_title:"Next Page",all:"All",counter:{showing:"Showing",of:"of",rows:"rows",pages:"pages"}},headerFilters:{default:"filter column...",columns:{}}}};class $l extends na{static moduleName="localize";static langs=Ul;constructor(t){super(t),this.locale="default",this.lang=!1,this.bindings={},this.langList={},this.registerTableOption("locale",!1),this.registerTableOption("langs",{})}initialize(){this.langList=ia.deepClone($l.langs),!1!==this.table.options.columnDefaults.headerFilterPlaceholder&&this.setHeaderFilterPlaceholder(this.table.options.columnDefaults.headerFilterPlaceholder);for(let t in this.table.options.langs)this.installLang(t,this.table.options.langs[t]);this.setLocale(this.table.options.locale),this.registerTableFunction("setLocale",this.setLocale.bind(this)),this.registerTableFunction("getLocale",this.getLocale.bind(this)),this.registerTableFunction("getLang",this.getLang.bind(this))}setHeaderFilterPlaceholder(t){this.langList.default.headerFilters.default=t}installLang(t,e){this.langList[t]?this._setLangProp(this.langList[t],e):this.langList[t]=e}_setLangProp(t,e){for(let i in e)t[i]&&"object"==typeof t[i]?this._setLangProp(t[i],e[i]):t[i]=e[i]}setLocale(t){if(!0===(t=t||"default")&&navigator.language&&(t=navigator.language.toLowerCase()),t&&!this.langList[t]){let e=t.split("-")[0];this.langList[e]?(console.warn("Localization Error - Exact matching locale not found, using closest match: ",t,e),t=e):(console.warn("Localization Error - Matching locale not found, using default: ",t),t="default")}this.locale=t,this.lang=ia.deepClone(this.langList.default||{}),"default"!=t&&function t(e,i){for(var s in e)"object"==typeof e[s]?(i[s]||(i[s]={}),t(e[s],i[s])):i[s]=e[s]}(this.langList[t],this.lang),this.dispatchExternal("localized",this.locale,this.lang),this._executeBindings()}getLocale(t){return this.locale}getLang(t){return t?this.langList[t]:this.lang}getText(t,e){var i=(e?t+"|"+e:t).split("|");return this._getLangElement(i,this.locale)||""}_getLangElement(t,e){var i=this.lang;return t.forEach(function(t){var e;i&&(e=i[t],i=void 0!==e&&e)}),i}bind(t,e){this.bindings[t]||(this.bindings[t]=[]),this.bindings[t].push(e),e(this.getText(t),this.lang)}_executeBindings(){for(let t in this.bindings)this.bindings[t].forEach(e=>{e(this.getText(t),this.lang)})}}var Yl=Object.freeze({__proto__:null,CommsModule:class extends na{static moduleName="comms";constructor(t){super(t)}initialize(){this.registerTableFunction("tableComms",this.receive.bind(this))}getConnections(t){var e=[];return this.table.constructor.registry.lookupTable(t).forEach(t=>{this.table!==t&&e.push(t)}),e}send(t,e,i,s){var n=this.getConnections(t);n.forEach(t=>{t.tableComms(this.table.element,e,i,s)}),!n.length&&t&&console.warn("Table Connection Error - No tables matching selector found",t)}receive(t,e,i,s){if(this.table.modExists(e))return this.table.modules[e].commsReceived(t,i,s);console.warn("Inter-table Comms Error - no such module:",e)}},LayoutModule:Gl,LocalizeModule:$l});class Kl{static registry={tables:[],register(t){Kl.registry.tables.push(t)},deregister(t){var e=Kl.registry.tables.indexOf(t);e>-1&&Kl.registry.tables.splice(e,1)},lookupTable(t,e){var i,s,n=[];if("string"==typeof t){if((i=document.querySelectorAll(t)).length)for(var o=0;o<i.length;o++)(s=Kl.registry.matchElement(i[o]))&&n.push(s)}else"undefined"!=typeof HTMLElement&&t instanceof HTMLElement||t instanceof Kl?(s=Kl.registry.matchElement(t))&&n.push(s):Array.isArray(t)?t.forEach(function(t){n=n.concat(Kl.registry.lookupTable(t))}):e||console.warn("Table Connection Error - Invalid Selector",t);return n},matchElement:t=>Kl.registry.tables.find(function(e){return t instanceof Kl?e===t:e.element===t})};static findTable(t){var e=Kl.registry.lookupTable(t,!0);return!(Array.isArray(e)&&!e.length)&&e}}class Xl extends Kl{static moduleBindings={};static moduleExtensions={};static modulesRegistered=!1;static defaultModules=!1;constructor(){super()}static initializeModuleBinder(t){Xl.modulesRegistered||(Xl.modulesRegistered=!0,Xl._registerModules(Yl,!0),t&&Xl._registerModules(t))}static _extendModule(t,e,i){if(Xl.moduleBindings[t]){var s=Xl.moduleBindings[t][e];if(s)if("object"==typeof i)for(let t in i)s[t]=i[t];else console.warn("Module Error - Invalid value type, it must be an object");else console.warn("Module Error - property does not exist:",e)}else console.warn("Module Error - module does not exist:",t)}static _registerModules(t,e){var i=Object.values(t);e&&i.forEach(t=>{t.prototype.moduleCore=!0}),Xl._registerModule(i)}static _registerModule(t){Array.isArray(t)||(t=[t]),t.forEach(t=>{Xl._registerModuleBinding(t),Xl._registerModuleExtensions(t)})}static _registerModuleBinding(t){t.moduleName?Xl.moduleBindings[t.moduleName]=t:console.error("Unable to bind module, no moduleName defined",t.moduleName)}static _registerModuleExtensions(t){var e=t.moduleExtensions;if(t.moduleExtensions)for(let t in e){let i=e[t];if(Xl.moduleBindings[t])for(let e in i)Xl._extendModule(t,e,i[e]);else{Xl.moduleExtensions[t]||(Xl.moduleExtensions[t]={});for(let e in i)Xl.moduleExtensions[t][e]||(Xl.moduleExtensions[t][e]={}),Object.assign(Xl.moduleExtensions[t][e],i[e])}}Xl._extendModuleFromQueue(t)}static _extendModuleFromQueue(t){var e=Xl.moduleExtensions[t.moduleName];if(e)for(let i in e)Xl._extendModule(t.moduleName,i,e[i])}_bindModules(){var t=[],e=[],i=[];for(var s in this.modules={},Xl.moduleBindings){let n=Xl.moduleBindings[s],o=new n(this);this.modules[s]=o,n.prototype.moduleCore?this.modulesCore.push(o):n.moduleInitOrder?n.moduleInitOrder<0?t.push(o):e.push(o):i.push(o)}t.sort((t,e)=>t.moduleInitOrder>e.moduleInitOrder?1:-1),e.sort((t,e)=>t.moduleInitOrder>e.moduleInitOrder?1:-1),this.modulesRegular=t.concat(i.concat(e))}}class ql extends ea{constructor(t){super(t),this.element=this._createAlertElement(),this.msgElement=this._createMsgElement(),this.type=null,this.element.appendChild(this.msgElement)}_createAlertElement(){var t=document.createElement("div");return t.classList.add("tabulator-alert"),t}_createMsgElement(){var t=document.createElement("div");return t.classList.add("tabulator-alert-msg"),t.setAttribute("role","alert"),t}_typeClass(){return"tabulator-alert-state-"+this.type}alert(t,e="msg"){if(t){for(this.clear(),this.dispatch("alert-show",e),this.type=e;this.msgElement.firstChild;)this.msgElement.removeChild(this.msgElement.firstChild);this.msgElement.classList.add(this._typeClass()),"function"==typeof t&&(t=t()),t instanceof HTMLElement?this.msgElement.appendChild(t):this.msgElement.innerHTML=t,this.table.element.appendChild(this.element)}}clear(){this.dispatch("alert-hide",this.type),this.element.parentNode&&this.element.parentNode.removeChild(this.element),this.msgElement.classList.remove(this._typeClass())}}class Jl extends Xl{static defaultOptions=El;static extendModule(){Jl.initializeModuleBinder(),Jl._extendModule(...arguments)}static registerModule(){Jl.initializeModuleBinder(),Jl._registerModule(...arguments)}constructor(t,e,i){super(),Jl.initializeModuleBinder(i),this.options={},this.columnManager=null,this.rowManager=null,this.footerManager=null,this.alertManager=null,this.vdomHoz=null,this.externalEvents=null,this.eventBus=null,this.interactionMonitor=!1,this.browser="",this.browserSlow=!1,this.browserMobile=!1,this.rtl=!1,this.originalElement=null,this.componentFunctionBinder=new zl(this),this.dataLoader=!1,this.modules={},this.modulesCore=[],this.modulesRegular=[],this.deprecationAdvisor=new Il(this),this.optionsList=new Rl(this,"table constructor"),this.dependencyRegistry=new Bl(this),this.initialized=!1,this.destroyed=!1,this.initializeElement(t)&&(this.initializeCoreSystems(e),setTimeout(()=>{this._create()})),this.constructor.registry.register(this)}initializeElement(t){return"undefined"!=typeof HTMLElement&&t instanceof HTMLElement?(this.element=t,!0):"string"==typeof t?(this.element=document.querySelector(t),!!this.element||(console.error("Tabulator Creation Error - no element found matching selector: ",t),!1)):(console.error("Tabulator Creation Error - Invalid element provided:",t),!1)}initializeCoreSystems(t){this.columnManager=new Dl(this),this.rowManager=new jl(this),this.footerManager=new Nl(this),this.dataLoader=new Ol(this),this.alertManager=new ql(this),this._bindModules(),this.options=this.optionsList.generate(Jl.defaultOptions,t),this._clearObjectPointers(),this._mapDeprecatedFunctionality(),this.externalEvents=new Fl(this,this.options,this.options.debugEventsExternal),this.eventBus=new Hl(this.options.debugEventsInternal),this.interactionMonitor=new Al(this),this.dataLoader.initialize(),this.footerManager.initialize(),this.dependencyRegistry.initialize()}_mapDeprecatedFunctionality(){}_clearSelection(){this.element.classList.add("tabulator-block-select"),window.getSelection?window.getSelection().empty?window.getSelection().empty():window.getSelection().removeAllRanges&&window.getSelection().removeAllRanges():document.selection&&document.selection.empty(),this.element.classList.remove("tabulator-block-select")}_create(){this.externalEvents.dispatch("tableBuilding"),this.eventBus.dispatch("table-building"),this._rtlCheck(),this._buildElement(),this._initializeTable(),this.initialized=!0,this._loadInitialData().finally(()=>{this.eventBus.dispatch("table-initialized"),this.externalEvents.dispatch("tableBuilt")})}_rtlCheck(){var t=window.getComputedStyle(this.element);switch(this.options.textDirection){case"auto":if("rtl"!==t.direction)break;case"rtl":this.element.classList.add("tabulator-rtl"),this.rtl=!0;break;case"ltr":this.element.classList.add("tabulator-ltr");default:this.rtl=!1}}_clearObjectPointers(){this.options.columns=this.options.columns.slice(0),Array.isArray(this.options.data)&&!this.options.reactiveData&&(this.options.data=this.options.data.slice(0))}_buildElement(){var t,e=this.element,i=this.options;if("TABLE"===e.tagName){this.originalElement=this.element,t=document.createElement("div");var s=e.attributes;for(var n in s)"object"==typeof s[n]&&t.setAttribute(s[n].name,s[n].value);e.parentNode.replaceChild(t,e),this.element=e=t}for(e.classList.add("tabulator"),e.setAttribute("role","grid"),e.setAttribute("aria-owns","tabulator-table-body");e.firstChild;)e.removeChild(e.firstChild);i.height&&(i.height=isNaN(i.height)?i.height:i.height+"px",e.style.height=i.height),!1!==i.minHeight&&(i.minHeight=isNaN(i.minHeight)?i.minHeight:i.minHeight+"px",e.style.minHeight=i.minHeight),!1!==i.maxHeight&&(i.maxHeight=isNaN(i.maxHeight)?i.maxHeight:i.maxHeight+"px",e.style.maxHeight=i.maxHeight)}_initializeTable(){var t=this.element,e=this.options;this.interactionMonitor.initialize(),this.columnManager.initialize(),this.rowManager.initialize(),this._detectBrowser(),this.modulesCore.forEach(t=>{t.initialize()}),t.appendChild(this.columnManager.getElement()),t.appendChild(this.rowManager.getElement()),e.footerElement&&this.footerManager.activate(),e.autoColumns&&e.data&&this.columnManager.generateColumnsFromRowData(this.options.data),this.modulesRegular.forEach(t=>{t.initialize()}),this.columnManager.setColumns(e.columns),this.eventBus.dispatch("table-built")}_loadInitialData(){return this.dataLoader.load(this.options.data).finally(()=>{this.columnManager.verticalAlignHeaders()})}destroy(){var t=this.element;for(this.destroyed=!0,this.constructor.registry.deregister(this),this.eventBus.dispatch("table-destroy"),this.rowManager.destroy();t.firstChild;)t.removeChild(t.firstChild);t.classList.remove("tabulator"),t.removeAttribute("tabulator-layout"),this.externalEvents.dispatch("tableDestroyed")}_detectBrowser(){var t=navigator.userAgent||navigator.vendor||window.opera;t.indexOf("Trident")>-1?(this.browser="ie",this.browserSlow=!0):t.indexOf("Edge")>-1?(this.browser="edge",this.browserSlow=!0):t.indexOf("Firefox")>-1?(this.browser="firefox",this.browserSlow=!1):t.indexOf("Mac OS")>-1?(this.browser="safari",this.browserSlow=!1):(this.browser="other",this.browserSlow=!1),this.browserMobile=/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(t)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw-(n|u)|c55\/|capi|ccwa|cdm-|cell|chtm|cldc|cmd-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc-s|devi|dica|dmob|do(c|p)o|ds(12|-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(-|_)|g1 u|g560|gene|gf-5|g-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd-(m|p|t)|hei-|hi(pt|ta)|hp( i|ip)|hs-c|ht(c(-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i-(20|go|ma)|i230|iac( |-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|-[a-w])|libw|lynx|m1-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|-([1-8]|c))|phil|pire|pl(ay|uc)|pn-2|po(ck|rt|se)|prox|psio|pt-g|qa-a|qc(07|12|21|32|60|-[2-7]|i-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h-|oo|p-)|sdk\/|se(c(-|0|1)|47|mc|nd|ri)|sgh-|shar|sie(-|m)|sk-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h-|v-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl-|tdg-|tel(i|m)|tim-|t-mo|to(pl|sh)|ts(70|m-|m3|m5)|tx-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas-|your|zeto|zte-/i.test(t.slice(0,4))}initGuard(t,e){var i,s;return this.options.debugInitialization&&!this.initialized&&(t||(t=" "==(s="Error"==(i=(new Error).stack.split("\n"))[0]?i[2]:i[1])[0]?s.trim().split(" ")[1].split(".")[1]:s.trim().split("@")[0]),console.warn("Table Not Initialized - Calling the "+t+" function before the table is initialized may result in inconsistent behavior, Please wait for the `tableBuilt` event before calling this function."+(e?" "+e:""))),this.initialized}blockRedraw(){this.initGuard(),this.eventBus.dispatch("redraw-blocking"),this.rowManager.blockRedraw(),this.columnManager.blockRedraw(),this.eventBus.dispatch("redraw-blocked")}restoreRedraw(){this.initGuard(),this.eventBus.dispatch("redraw-restoring"),this.rowManager.restoreRedraw(),this.columnManager.restoreRedraw(),this.eventBus.dispatch("redraw-restored")}setData(t,e,i){return this.initGuard(!1,"To set initial data please use the 'data' property in the table constructor."),this.dataLoader.load(t,e,i,!1)}clearData(){this.initGuard(),this.dataLoader.blockActiveLoad(),this.rowManager.clearData()}getData(t){return this.rowManager.getData(t)}getDataCount(t){return this.rowManager.getDataCount(t)}replaceData(t,e,i){return this.initGuard(),this.dataLoader.load(t,e,i,!0,!0)}updateData(t){var e=0;return this.initGuard(),new Promise((i,s)=>{this.dataLoader.blockActiveLoad(),"string"==typeof t&&(t=JSON.parse(t)),t&&t.length>0?t.forEach(t=>{var n=this.rowManager.findRow(t[this.options.index]);n?(e++,n.updateData(t).then(()=>{--e||i()}).catch(e=>{s("Update Error - Unable to update row",t,e)})):s("Update Error - Unable to find row",t)}):(console.warn("Update Error - No data provided"),s("Update Error - No data provided"))})}addData(t,e,i){return this.initGuard(),new Promise((s,n)=>{this.dataLoader.blockActiveLoad(),"string"==typeof t&&(t=JSON.parse(t)),t?this.rowManager.addRows(t,e,i).then(t=>{var e=[];t.forEach(function(t){e.push(t.getComponent())}),s(e)}):(console.warn("Update Error - No data provided"),n("Update Error - No data provided"))})}updateOrAddData(t){var e=[],i=0;return this.initGuard(),new Promise((s,n)=>{this.dataLoader.blockActiveLoad(),"string"==typeof t&&(t=JSON.parse(t)),t&&t.length>0?t.forEach(t=>{var n=this.rowManager.findRow(t[this.options.index]);i++,n?n.updateData(t).then(()=>{i--,e.push(n.getComponent()),i||s(e)}):this.rowManager.addRows(t).then(t=>{i--,e.push(t[0].getComponent()),i||s(e)})}):(console.warn("Update Error - No data provided"),n("Update Error - No data provided"))})}getRow(t){var e=this.rowManager.findRow(t);return e?e.getComponent():(console.warn("Find Error - No matching row found:",t),!1)}getRowFromPosition(t){var e=this.rowManager.getRowFromPosition(t);return e?e.getComponent():(console.warn("Find Error - No matching row found:",t),!1)}deleteRow(t){var e=[];this.initGuard(),Array.isArray(t)||(t=[t]);for(let i of t){let t=this.rowManager.findRow(i,!0);if(!t)return console.error("Delete Error - No matching row found:",i),Promise.reject("Delete Error - No matching row found");e.push(t)}return e.sort((t,e)=>this.rowManager.rows.indexOf(t)>this.rowManager.rows.indexOf(e)?1:-1),e.forEach(t=>{t.delete()}),this.rowManager.reRenderInPosition(),Promise.resolve()}addRow(t,e,i){return this.initGuard(),"string"==typeof t&&(t=JSON.parse(t)),this.rowManager.addRows(t,e,i,!0).then(t=>t[0].getComponent())}updateOrAddRow(t,e){var i=this.rowManager.findRow(t);return this.initGuard(),"string"==typeof e&&(e=JSON.parse(e)),i?i.updateData(e).then(()=>i.getComponent()):this.rowManager.addRows(e).then(t=>t[0].getComponent())}updateRow(t,e){var i=this.rowManager.findRow(t);return this.initGuard(),"string"==typeof e&&(e=JSON.parse(e)),i?i.updateData(e).then(()=>Promise.resolve(i.getComponent())):(console.warn("Update Error - No matching row found:",t),Promise.reject("Update Error - No matching row found"))}scrollToRow(t,e,i){var s=this.rowManager.findRow(t);return s?this.rowManager.scrollToRow(s,e,i):(console.warn("Scroll Error - No matching row found:",t),Promise.reject("Scroll Error - No matching row found"))}moveRow(t,e,i){var s=this.rowManager.findRow(t);this.initGuard(),s?s.moveToRow(e,i):console.warn("Move Error - No matching row found:",t)}getRows(t){return this.rowManager.getComponents(t)}getRowPosition(t){var e=this.rowManager.findRow(t);return e?e.getPosition():(console.warn("Position Error - No matching row found:",t),!1)}setColumns(t){this.initGuard(!1,"To set initial columns please use the 'columns' property in the table constructor"),this.columnManager.setColumns(t)}getColumns(t){return this.columnManager.getComponents(t)}getColumn(t){var e=this.columnManager.findColumn(t);return e?e.getComponent():(console.warn("Find Error - No matching column found:",t),!1)}getColumnDefinitions(){return this.columnManager.getDefinitionTree()}showColumn(t){var e=this.columnManager.findColumn(t);if(this.initGuard(),!e)return console.warn("Column Show Error - No matching column found:",t),!1;e.show()}hideColumn(t){var e=this.columnManager.findColumn(t);if(this.initGuard(),!e)return console.warn("Column Hide Error - No matching column found:",t),!1;e.hide()}toggleColumn(t){var e=this.columnManager.findColumn(t);if(this.initGuard(),!e)return console.warn("Column Visibility Toggle Error - No matching column found:",t),!1;e.visible?e.hide():e.show()}addColumn(t,e,i){var s=this.columnManager.findColumn(i);return this.initGuard(),this.columnManager.addColumn(t,e,s).then(t=>t.getComponent())}deleteColumn(t){var e=this.columnManager.findColumn(t);return this.initGuard(),e?e.delete():(console.warn("Column Delete Error - No matching column found:",t),Promise.reject())}updateColumnDefinition(t,e){var i=this.columnManager.findColumn(t);return this.initGuard(),i?i.updateDefinition(e):(console.warn("Column Update Error - No matching column found:",t),Promise.reject())}moveColumn(t,e,i){var s=this.columnManager.findColumn(t),n=this.columnManager.findColumn(e);this.initGuard(),s?n?this.columnManager.moveColumn(s,n,i):console.warn("Move Error - No matching column found:",n):console.warn("Move Error - No matching column found:",t)}scrollToColumn(t,e,i){return new Promise((s,n)=>{var o=this.columnManager.findColumn(t);return o?this.columnManager.scrollToColumn(o,e,i):(console.warn("Scroll Error - No matching column found:",t),Promise.reject("Scroll Error - No matching column found"))})}redraw(t){this.initGuard(),this.columnManager.redraw(t),this.rowManager.redraw(t)}setHeight(t){this.options.height=isNaN(t)?t:t+"px",this.element.style.height=this.options.height,this.rowManager.initializeRenderer(),this.rowManager.redraw(!0)}setMaxHeight(t){this.options.maxHeight=isNaN(t)?t:t+"px",this.element.style.maxHeight=this.options.maxHeight,this.rowManager.initializeRenderer(),this.rowManager.redraw(!0)}setMinHeight(t){this.options.minHeight=isNaN(t)?t:t+"px",this.element.style.minHeight=this.options.minHeight,this.rowManager.initializeRenderer(),this.rowManager.redraw(!0)}on(t,e){this.externalEvents.subscribe(t,e)}off(t,e){this.externalEvents.unsubscribe(t,e)}dispatchEvent(){Array.from(arguments).shift(),this.externalEvents.dispatch(...arguments)}alert(t,e){this.initGuard(),this.alertManager.alert(t,e)}clearAlert(){this.initGuard(),this.alertManager.clear()}modExists(t,e){return!!this.modules[t]||(e&&console.error("Tabulator Module Not Installed: "+t),!1)}module(t){var e=this.modules[t];return e||console.error("Tabulator module not installed: "+t),e}}class Zl extends Jl{static extendModule(){Jl.initializeModuleBinder(kl),Jl._extendModule(...arguments)}static registerModule(){Jl.initializeModuleBinder(kl),Jl._registerModule(...arguments)}constructor(t,e,i){super(t,e,kl)}}let Ql={};function th(t){Ql=t&&"object"==typeof t?t:{}}function eh(){return Ql}function ih(t){return String(t??"").replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}function sh(t){const e=t.getRow()?.getData();return e?.data&&"object"==typeof e.data?e.data:{}}function nh(t,e="",i=""){const s=i?` title="${ih(i)}"`:"";return`<span class="dashicons dashicons-${ih(t)} ${e}"${s} aria-hidden="true"></span>`}function oh(){return!1!==eh().plan_allows_metrics}function rh(t){const e=t?.cannibalization;return!0===e||1===e||"1"===e}function ah(t){if(!t?.positions||"object"!=typeof t.positions)return null;const e=Object.keys(t.positions);return e.length?(e.sort(),t.positions[e[e.length-1]]):null}function lh(t){const e=ah(t);if(e&&parseInt(e.depth,10)>0)return 10*parseInt(e.depth,10);if(e&&e.few)return 10;const i=parseInt(t?.depth,10);if(!Number.isNaN(i)&&i>0)return 10*i;const s=eh().available_depths?.[0],n=parseInt(s,10);return!Number.isNaN(n)&&n>0?10*n:100}function hh(){return nh("lock","slr-rt-cell-icon",(0,a.__)("Buy plan","seo-local-rank"))}function ch(t){return nh("clock","slr-rt-cell-icon slr-rt-cell-icon--muted",t)}function dh(t,e){if(null==t||""===t)return'<span class="slr-rt-change slr-rt-change--empty">—</span>';const i=parseInt(t,10);if(Number.isNaN(i))return'<span class="slr-rt-change slr-rt-change--empty">—</span>';if(0===i)return'<span class="slr-rt-change slr-rt-change--zero">•</span>';const s=i>0;return`<span class="slr-rt-change ${e?s?"slr-rt-change--up-text":"slr-rt-change--down-text":s?"slr-rt-change--up":"slr-rt-change--down"}">${s?"▲":"▼"} ${Math.abs(i)}</span>`}function uh(t){return function(e){const i=sh(e)[t];return null==i?`<span>${ih((0,a.__)("Pending","seo-local-rank"))}</span>`:parseInt(i,10)>0?ih(i):(0,a.__)("101+","seo-local-rank")}}function ph(t){return function(e){return`<span class="slr-rt-dates">${dh(sh(e)[t],!0)}</span>`}}function mh(t,e,i,s){return function(n){const o=sh(n);if(!Boolean(eh().gsc_has_consent))return"<span>—</span>";if(null===o.gsc_impressions||void 0===o.gsc_impressions)return ch((0,a.__)("Waiting for GSC data","seo-local-rank"));if((o.gsc_impressions||0)<=0)return"gsc_impressions"===t||"gsc_clicks"===t?"0":"—";let r=o[e];return null==r&&(r=o[t.replace("gsc_","")]||0),s?`${Uo(100*r,1)} %`:Uo(r,i||0)}}const gh={keyword(t){const e=sh(t);let i=`<span class="slr-rt-keyword"><span class="slr-rt-keyword__text">${ih(e.keyword)}</span>`,s="";return e.url&&(s=String(e.url).replace(/\?.+$/,"")),e.target_url&&e.target_url===s&&!e.paused_at?i+=rh(e)?nh("warning","slr-rt-keyword__icon slr-rt-keyword__icon--target",(0,a.__)("Ranking target URL and cannibalization","seo-local-rank")):nh("yes","slr-rt-keyword__icon slr-rt-keyword__icon--target",(0,a.__)("Ranking target URL","seo-local-rank")):(e.target_url&&e.target_url!==s&&s&&!e.paused_at||rh(e)&&!e.paused_at)&&(i+=nh("warning","slr-rt-keyword__icon",(0,a.__)("Possible cannibalization","seo-local-rank"))),i+="</span>",i},location(t){const e=sh(t),i=Fr(e.region_code),s=i?`<span class="slr-rt-flag" aria-hidden="true">${i}</span>`:"";return`<span class="slr-rt-location" title="${ih(e.google_search_location||e.province)}">${s}${ih(e.province)}</span>`},screen_type(t){const e=sh(t),i=1===parseInt(e.screen_type,10);return nh(i?"desktop":"smartphone",i?"slr-rt-device slr-rt-device--desktop":"slr-rt-device slr-rt-device--mobile",i?(0,a.__)("Desktop","seo-local-rank"):(0,a.__)("Mobile","seo-local-rank"))},depth(t){if(!eh().active_keywords_depth)return"";const e=sh(t);return`<span class="slr-rt-depth">${ih(void 0!==e.depth&&null!==e.depth?e.depth:"1")}</span>`},position(t){const e=sh(t);let i='<span class="slr-rt-rank">';if(e.paused_at)return i+=nh("controls-pause","slr-rt-cell-icon slr-rt-cell-icon--danger",(0,a.__)("Keyword paused","seo-local-rank")),i+="</span>",i;if(void 0!==e.rank&&null!==e.rank){const t=parseInt(e.rank,10),s=lh(e);if(t>0&&t<=s){if(i+=`<span>${ih(e.rank)}</span>`,e.positions){const s=Object.keys(e.positions);s.length>0&&!e.not_sync&&1===t?i+=`<span class="slr-rt-rank__crown" title="${ih((0,a.__)("You are top 1","seo-local-rank"))}">👑</span>`:s.length>6&&!e.not_sync&&t===parseInt(e.best_rank_ever,10)&&(i+=`<span class="slr-rt-rank__medal" title="${ih((0,a.__)("Best rank ever","seo-local-rank"))}">🏅</span>`);const n=ah(e);s.length>2&&!e.not_sync&&n&&0===parseInt(n.rank,10)&&(i+=`<span class="slr-rt-rank__new" title="${ih((0,a.__)("New keyword ranking","seo-local-rank"))}">${ih((0,a.__)("NEW","seo-local-rank"))}</span>`)}}else{const t=ah(e);!t||!t.few||t.depth>0?i+=ih(function(t){const e=ah(t);return e&&parseInt(e.depth,10)>0?(0,a.sprintf)(/* translators: %s: ranking position threshold */ /* translators: %s: ranking position threshold */
    11 (0,a.__)("%s+","seo-local-rank"),10*parseInt(e.depth,10)):e&&e.few?null:(0,a.sprintf)(/* translators: %s: ranking position threshold */ /* translators: %s: ranking position threshold */
    12 (0,a.__)("%s+","seo-local-rank"),lh(t))}(e)||`${s}+`):i+=`${ih((0,a.__)("11+","seo-local-rank"))} ${nh("warning","slr-rt-cell-icon slr-rt-cell-icon--warn",(0,a.__)("Few results in search","seo-local-rank"))}`}}else i+=ih((0,a.__)("Pending","seo-local-rank"));return e.not_sync&&(i+=nh("update","slr-rt-cell-icon slr-rt-cell-icon--danger",(0,a.__)("Waiting to update","seo-local-rank"))),i+="</span>",i},change:t=>dh(sh(t).rank_change,!1),date1_change:ph("date1_change"),date7_change:ph("date7_change"),date30_change:ph("date30_change"),date90_change:ph("date90_change"),dates_changes(t){const e=sh(t);return`<span class="slr-rt-dates slr-rt-dates--stack">${[1,7,30].map(t=>dh(e[`date${t}_change`],!0)).join("")}</span>`},last_change(t){const e=sh(t),i=e.last_change_display||e.last_change;return i?ih(i):""},best_rank_ever:uh("best_rank_ever"),best_rank:uh("best_rank"),worst_rank:uh("worst_rank"),rank_avg(t){const e=sh(t);return void 0===e.rank_avg||null===e.rank_avg?ih((0,a.__)("Pending","seo-local-rank")):Uo(e.rank_avg,1)},first_rank(t){const e=sh(t);if(void 0===e.first_rank||null===e.first_rank)return ih((0,a.__)("Pending","seo-local-rank"));let i=parseInt(e.first_rank,10)>0?ih(e.first_rank):ih((0,a.__)("101+","seo-local-rank")),s=parseInt(e.rank,10);(Number.isNaN(s)||0===s)&&(s=101);let n=parseInt(e.first_rank,10);0===n&&(n=101);const o=n-s;return 0!==o&&(i+=` ${dh(o,!0)}`),i},volume(t){const e=sh(t);return oh()?null===e.volume||""===e.volume?ch((0,a.__)("Waiting for volume","seo-local-rank")):Uo(e.volume):hh()},cpc(t){const e=sh(t);return oh()?null===e.cpc||""===e.cpc?ch((0,a.__)("Waiting for CPC","seo-local-rank")):function(t,e){const i=Uo(t,2),s={usd:"$",eur:"€",gbp:"£"},n=String(e||"usd").toLowerCase();return s[n]?`${i} ${s[n]}`:`${i} ${n.toUpperCase()}`}(e.cpc,eh().currency):hh()},competition(t){const e=sh(t);return oh()?null===e.volume||""===e.volume?ch((0,a.__)("Waiting for competition","seo-local-rank")):`${Uo(100*(e.ads_competition||0),0)} %`:hh()},ve(t){const e=sh(t);return oh()?null===e.volume||""===e.volume?ch((0,a.__)("Waiting for volume","seo-local-rank")):Uo(void 0!==e.estimated_visits?e.estimated_visits:0):hh()},gsc_impressions:mh("gsc_impressions","gsc_impressions_display",0,!1),gsc_clicks:mh("gsc_clicks","gsc_clicks_display",0,!1),gsc_position:mh("gsc_position","gsc_position_display",1,!1),gsc_ctr:mh("gsc_ctr","gsc_ctr_display",1,!0),local_pack(t){const e=sh(t);if(1!==parseInt(e.maps_local_snp,10)||e.paused_at)return"";const i=e.serp_url?ih(e.serp_url):"",s=void 0!==e.local_position?`<span class="slr-rt-local-pos">${ih(e.local_position)}</span>`:"";return`<span class="slr-rt-local">${i?`<a class="slr-rt-local-link" href="${i}" target="_blank" rel="noopener noreferrer" title="${ih((0,a.__)("Local Map","seo-local-rank"))}">${nh("location-alt")}</a>`:nh("location-alt")}${s}${!1===eh().last_data?nh("warning","slr-rt-cell-icon slr-rt-cell-icon--warn",(0,a.__)("Last crawl data","seo-local-rank")):""}</span>`},snippets(t){const e=sh(t).snippets_in_serp;let i='<span class="slr-rt-snippets">';if(e&&"object"==typeof e){const t={people_also_ask:{icon:"editor-help",label:(0,a.__)("People Also Ask","seo-local-rank")},videos:{icon:"video-alt3",label:(0,a.__)("Videos","seo-local-rank")},images:{icon:"format-image",label:(0,a.__)("Images","seo-local-rank")},local_pack:{icon:"location",label:(0,a.__)("Local Pack","seo-local-rank")},knowledge_panel:{icon:"info",label:(0,a.__)("Knowledge Panel","seo-local-rank")},placed_sites:{icon:"admin-site",label:(0,a.__)("Placed Sites","seo-local-rank")},discussions:{icon:"format-chat",label:(0,a.__)("Forums & Discussions","seo-local-rank")},product_grid:{icon:"cart",label:(0,a.__)("Product Grid","seo-local-rank")}};Object.keys(t).forEach(s=>{if(!Object.prototype.hasOwnProperty.call(e,s))return;const n=e[s];if(function(t){return!1===t||null===t||""===t||0===t||"0"===t||Array.isArray(t)&&0===t.length}(n))return;const o=t[s];if(function(t){return!0===t||1===t||"1"===t}(n))return void(i+=nh(o.icon,"slr-rt-snippet slr-rt-snippet--muted",(0,a.__)("Snippet exists but does not appear","seo-local-rank")));const r=function(t){return t&&"object"==typeof t?t.domain||t.position||t.brand_word?[t]:Array.isArray(t)?t.filter(t=>t&&"object"==typeof t):Object.keys(t).map(e=>t[e]).filter(t=>t&&"object"==typeof t):[]}(n);if(r.length){const t=function(t,e,i){const s=String(e||"").trim().toLowerCase(),n=String(i||"").trim().toLowerCase();return t.some(t=>!(!s||!t.domain||String(t.domain).trim().toLowerCase()!==s)||Boolean(n&&t.brand_word&&String(t.brand_word).trim().toLowerCase()===n))}(r,eh().domain_name,eh().brand_word),e=t?"slr-rt-snippet slr-rt-snippet--user":"slr-rt-snippet slr-rt-snippet--competitor",s=t?(0,a.__)("Your site appears in this snippet","seo-local-rank"):(0,a.__)("A competitor appears in this snippet","seo-local-rank");i+=nh(o.icon,e,s)}})}return!1===eh().last_data&&(i+=nh("warning","slr-rt-cell-icon slr-rt-cell-icon--warn",(0,a.__)("Last crawl data","seo-local-rank"))),i+="</span>",i},url(t){const e=sh(t);if(!e.url)return"";let i=e.url,s=String(e.url).trim();try{const t=new URL(s,"https://example.com");t.pathname&&(i=decodeURIComponent(t.pathname))}catch(t){i=s}return`<span class="slr-rt-url"><a href="${ih(s)}" target="_blank" rel="noopener noreferrer" title="${ih(e.url)}">${ih(i)}</a></span>`},tags(t){const e=sh(t).tags||[];return e.length?`<span class="slr-rt-tags">${e.map(t=>`<span class="slr-rt-tag" style="background-color:${t.color?ih(t.color):"#efefef"}">${ih(t.description||t.tag_description||"")}</span>`).join("")}</span>`:""},date(t){const e=sh(t);if(!e.last_search_display&&!e.last_search)return ih((0,a.__)("Pending","seo-local-rank"));const i=parseInt(e.hours_ago,10);return!Number.isNaN(i)&&i<24?ih(function(t){return 0===t?(0,a.__)("Now","seo-local-rank"):(0,a.sprintf)(/* translators: %d: number of hours */ /* translators: %d: number of hours */
    13 (0,a._n)("%d hour ago","%d hours ago",t,"seo-local-rank"),t)}(i)):ih(e.last_search_display||e.last_search)},created(t){const e=sh(t);return e.created_at?ih(e.created_at):""},ai_overview(t){const e=sh(t);if(!e.ai||!e.ai.snp)return"";const i=Array.isArray(e.ai.links)?e.ai.links:[],s=Array.isArray(e.ai.bw)?e.ai.bw:[],n=[];i.length&&n.push((0,a.sprintf)(/* translators: %s: comma-separated URLs */ /* translators: %s: comma-separated URLs */
    14 (0,a.__)("Project links: %s","seo-local-rank"),i.map(t=>t&&"object"==typeof t?t.url:t).join(", "))),s.length&&n.push((0,a.sprintf)(/* translators: %s: comma-separated brand words */ /* translators: %s: comma-separated brand words */
    15 (0,a.__)("Brand words: %s","seo-local-rank"),s.join(", "))),i.length||s.length||n.push((0,a.__)("Project does not appear","seo-local-rank"));let o=`<span class="slr-rt-aio" title="${ih(n.join(" · "))}">`;return o+=`<span class="slr-rt-aio__presence">${nh("yes-alt")} ${ih((0,a.__)("AI Overview","seo-local-rank"))}</span>`,i.length&&(o+=`<span class="slr-rt-aio__links">${nh("admin-links")} ${i.length}</span>`),s.length&&(o+=`<span class="slr-rt-aio__brand">${ih((0,a.__)("Brand","seo-local-rank"))}</span>`),o+="</span>",o}};function bh(t){if(null==t||""===t)return 0;let e=String(t).trim();if(!e)return 0;/^\d{4}-\d{2}-\d{2} /.test(e)&&(e=e.replace(" ","T"));const i=Date.parse(e);return Number.isNaN(i)?0:i}function fh(t){if(null==t||""===t)return null;const e=parseInt(t,10);return Number.isNaN(e)?null:e}function vh(t,e,i){const s=parseInt(t,10);return Number.isNaN(s)||s<=0?(n=function(t,e){const i=function(t){if(!t?.positions||"object"!=typeof t.positions)return null;const e=Object.keys(t.positions);return e.length?(e.sort(),t.positions[e[e.length-1]]):null}(t);if(i&&parseInt(i.depth,10)>0)return parseInt(i.depth,10);const s=parseInt(t?.depth,10);if(!Number.isNaN(s)&&s>0)return s;const n=e?.available_depths;if(Array.isArray(n)&&n.length){const t=parseInt(n[0],10);if(!Number.isNaN(t)&&t>0)return t}return 10}(e,i),10*Math.max(1,n)+1):s;var n}function wh(t,e,i){return null==t||""===t?null:vh(t,e,i)}function yh(t){const e=t?.data&&"object"==typeof t.data&&!Array.isArray(t.data)?t.data:t;return!e||"object"!=typeof e||void 0!==e.pending&&null!==e.pending&&""!==e.pending&&0!==parseInt(e.pending,10)}function _h(t){return function(e,i,s,n){const o=s?.getData?s.getData()[t]:e,r=n?.getData?n.getData()[t]:i;return("number"!=typeof o||Number.isNaN(o)?0:o)-("number"!=typeof r||Number.isNaN(r)?0:r)}}function xh(t){return function(e,i,s,n){const o=s?.getData?s.getData()[t]:e,r=n?.getData?n.getData()[t]:i,a=null==o?"":String(o),l=null==r?"":String(r);return a.localeCompare(l,void 0,{sensitivity:"base"})}}function Ch(t,e){const i=(s=t.field,gh[s]||null);var s;i&&(t.formatter=i),"keyword"!==t.field?(void 0===t.widthGrow&&(t.widthGrow=0),void 0===t.width&&(t.width=90),void 0===t.minWidth&&(t.minWidth=t.width)):void 0===t.minWidth&&(t.minWidth=300);const n=t.cssClass&&String(t.cssClass).includes("text-center");return void 0===t.hozAlign&&(t.hozAlign=n?"center":"left"),void 0===t.headerHozAlign&&(t.headerHozAlign=n?"center":"left"),t.visible=function(t,e){return!e.includes(t)}(t.field,e),t.headerSort=!1!==t.headerSort,t.resizable=!1!==t.resizable,t.headerTooltip=!1,t}function kh(t,e){const i=Array.isArray(t)?t:[],s=Boolean(e?.active_keywords_depth),n=[];return n.push(Ch({field:"keyword",title:(0,a.__)("Keyword","seo-local-rank"),minWidth:300,widthGrow:6,cssClass:"slr-rt-col--keyword",sorter:xh("_sort_keyword")},i)),n.push(Ch({field:"location",title:(0,a.__)("Location","seo-local-rank"),width:120,minWidth:100,cssClass:"text-left",sorter:xh("_sort_location")},i)),n.push(Ch({field:"screen_type",title:(0,a.__)("Device","seo-local-rank"),width:70,cssClass:"text-center",headerSort:!1},i)),s&&n.push(Ch({field:"depth",title:(0,a.__)("Depth","seo-local-rank"),width:110,cssClass:"text-center",sorter:_h("_sort_depth")},i)),n.push(Ch({field:"position",title:(0,a.__)("Position","seo-local-rank"),width:100,cssClass:"text-center",sorter:_h("_sort_position")},i)),n.push(Ch({field:"change",title:(0,a.__)("Change","seo-local-rank"),width:90,cssClass:"text-center",sorter:_h("_sort_change")},i)),n.push(Ch({field:"ai_overview",title:(0,a.__)("AI Overview","seo-local-rank"),width:140,cssClass:"text-center",headerSort:!1},i)),n.push(Ch({field:"date1_change",title:(0,a.__)("Last interval change","seo-local-rank"),width:150,cssClass:"text-center",sorter:_h("_sort_date1_change")},i)),n.push(Ch({field:"dates_changes",title:(0,a.__)("1/7/30","seo-local-rank"),width:90,cssClass:"text-center",headerSort:!1},i)),n.push(Ch({field:"date7_change",title:(0,a.__)("7 days","seo-local-rank"),width:130,cssClass:"text-center",sorter:_h("_sort_date7_change")},i)),n.push(Ch({field:"date30_change",title:(0,a.__)("30 days","seo-local-rank"),width:140,cssClass:"text-center",sorter:_h("_sort_date30_change")},i)),n.push(Ch({field:"date90_change",title:(0,a.__)("90 days","seo-local-rank"),width:140,cssClass:"text-center",sorter:_h("_sort_date90_change")},i)),n.push(Ch({field:"last_change",title:(0,a.__)("Last change","seo-local-rank"),width:130,cssClass:"text-center",sorter:_h("_sort_last_change")},i)),n.push(Ch({field:"best_rank_ever",title:(0,a.__)("Best ever","seo-local-rank"),width:145,cssClass:"text-center",sorter:_h("_sort_best_rank_ever")},i)),n.push(Ch({field:"rank_avg",title:(0,a.__)("Avg position","seo-local-rank"),width:130,cssClass:"text-center",sorter:_h("_sort_rank_avg")},i)),n.push(Ch({field:"best_rank",title:(0,a.__)("Best","seo-local-rank"),width:80,cssClass:"text-center",sorter:_h("_sort_best_rank")},i)),n.push(Ch({field:"worst_rank",title:(0,a.__)("Worst","seo-local-rank"),width:80,cssClass:"text-center",sorter:_h("_sort_worst_rank")},i)),n.push(Ch({field:"first_rank",title:(0,a.__)("Starting","seo-local-rank"),width:90,cssClass:"text-center",sorter:_h("_sort_first_rank")},i)),n.push(Ch({field:"volume",title:(0,a.__)("Volume","seo-local-rank"),width:95,cssClass:"text-center",sorter:_h("_sort_volume")},i)),n.push(Ch({field:"cpc",title:(0,a.__)("CPC","seo-local-rank"),width:75,cssClass:"text-center",sorter:_h("_sort_cpc")},i)),n.push(Ch({field:"competition",title:(0,a.__)("Competition","seo-local-rank"),width:115,cssClass:"text-center",sorter:_h("_sort_competition")},i)),n.push(Ch({field:"ve",title:(0,a.__)("Traffic","seo-local-rank"),width:90,cssClass:"text-center",sorter:_h("_sort_ve")},i)),n.push(Ch({field:"gsc_impressions",title:(0,a.__)("Impressions","seo-local-rank"),width:115,cssClass:"text-center",sorter:_h("_sort_gsc_impressions")},i)),n.push(Ch({field:"gsc_clicks",title:(0,a.__)("Clicks","seo-local-rank"),width:80,cssClass:"text-center",sorter:_h("_sort_gsc_clicks")},i)),n.push(Ch({field:"gsc_position",title:(0,a.__)("GSC Position","seo-local-rank"),width:165,cssClass:"text-center",sorter:_h("_sort_gsc_position")},i)),n.push(Ch({field:"gsc_ctr",title:(0,a.__)("CTR","seo-local-rank"),width:70,cssClass:"text-center",sorter:_h("_sort_gsc_ctr")},i)),n.push(Ch({field:"local_pack",title:(0,a.__)("Local Pack","seo-local-rank"),width:110,cssClass:"text-center",sorter:_h("_sort_local_pack")},i)),n.push(Ch({field:"snippets",title:(0,a.__)("Snippets","seo-local-rank"),width:100,cssClass:"text-center",headerSort:!1},i)),n.push(Ch({field:"url",title:(0,a.__)("URL","seo-local-rank"),width:180,minWidth:120,cssClass:"text-left",sorter:xh("_sort_url")},i)),n.push(Ch({field:"tags",title:(0,a.__)("Tags","seo-local-rank"),width:140,minWidth:100,cssClass:"text-left",sorter:xh("_sort_tags")},i)),n.push(Ch({field:"date",title:(0,a.__)("Updated at","seo-local-rank"),width:115,cssClass:"text-center",sorter:_h("_sort_updated")},i)),n.push(Ch({field:"created",title:(0,a.__)("Created at","seo-local-rank"),width:95,cssClass:"text-center",sorter:_h("_sort_created")},i)),n}function Eh(t,e){if(!t)return;const i=String(e||"").trim().toLowerCase();try{i?t.setFilter(t=>String(t._search_blob||"").includes(i)):t.clearFilter(!0)}catch(t){}}function Rh(t,e,i,s){if(!t)return;const n=(0,a.__)("Loading…","seo-local-rank"),o=(0,a.__)("Add keywords to see rank data.","seo-local-rank");th(e?.tableContext||{}),t.options.placeholder=i?n:o;const r=i?[]:function(t,e={}){return Array.isArray(t)?t.map(t=>function(t,e={}){const i=function(t){return t&&"object"==typeof t?t.data&&"object"==typeof t.data&&!Array.isArray(t.data)?t.data:t:null}(t);if(!i)return null;const s={data:i,DT_RowId:null!=t?.DT_RowId?t.DT_RowId:i.id};s._sort_position=function(t){if(!t?.paused_at&&(null==t?.rank||""===t?.rank))return-2;if(t?.paused_at)return-1;let e=parseInt(t.rank,10);return(Number.isNaN(e)||0===e)&&(e=101),e}(i),s._sort_change=parseInt(i.rank_change,10),Number.isNaN(s._sort_change)&&(s._sort_change=0),s._sort_volume=parseInt(i.volume,10)||0,null!==i.cpc&&void 0!==i.cpc&&""!==i.cpc?(s._sort_cpc=parseFloat(String(i.cpc).replace(",",".")),Number.isNaN(s._sort_cpc)&&(s._sort_cpc=null)):s._sort_cpc=null,null!==i.ads_competition&&void 0!==i.ads_competition&&""!==i.ads_competition?(s._sort_competition=Math.round(100*parseFloat(i.ads_competition)),Number.isNaN(s._sort_competition)&&(s._sort_competition=null)):s._sort_competition=null;const n=void 0!==i.estimated_visits&&null!==i.estimated_visits?i.estimated_visits:i.traffic;if(s._sort_ve=parseInt(n,10)||0,s._sort_first_rank=wh(i.first_rank,i,e),s._sort_rank_avg=null!==i.rank_avg&&void 0!==i.rank_avg&&""!==i.rank_avg?parseFloat(i.rank_avg):null,null!==s._sort_rank_avg&&Number.isNaN(s._sort_rank_avg)&&(s._sort_rank_avg=null),s._sort_best_rank=wh(i.best_rank,i,e),s._sort_worst_rank=wh(i.worst_rank,i,e),s._sort_best_rank_ever=wh(i.best_rank_ever,i,e),s._sort_date1_change=fh(i.date1_change),s._sort_date7_change=fh(i.date7_change),s._sort_date30_change=fh(i.date30_change),s._sort_date90_change=fh(i.date90_change),s._sort_last_change=bh(i.full_last_change||i.last_change),s._sort_keyword=i.keyword?String(i.keyword).toLowerCase():"",s._sort_location=i.province?String(i.province).toLowerCase():"",s._sort_depth=parseInt(i.depth,10),Number.isNaN(s._sort_depth)&&(s._sort_depth=1),1!==parseInt(i.maps_local_snp,10)||i.paused_at)s._sort_local_pack=999;else{const t=parseInt(i.local_position,10);s._sort_local_pack=Number.isNaN(t)?8:t}var o;s._sort_url=function(t){if(!t)return"";try{const e=new URL(t,"https://example.com");if(e.pathname)return decodeURIComponent(e.pathname)}catch(e){return String(t)}return String(t)}(i.url).toLowerCase(),s._sort_tags=(o=i.tags,Array.isArray(o)&&o.length?o.map(t=>String(t?.description||t?.tag_description||"")).filter(Boolean).join(" "):"").toLowerCase(),s._sort_updated=bh(i.updated_at),s._sort_created=bh(i.created_at),s._sort_gsc_impressions=parseInt(i.gsc_impressions,10)||0,s._sort_gsc_clicks=parseInt(i.gsc_clicks,10)||0,s._sort_gsc_position=parseFloat(i.gsc_position),Number.isNaN(s._sort_gsc_position)&&(s._sort_gsc_position=0),s._sort_gsc_impressions>0&&s._sort_gsc_clicks>=0?s._sort_gsc_ctr=s._sort_gsc_clicks/s._sort_gsc_impressions*100:null!==i.gsc_ctr&&void 0!==i.gsc_ctr&&""!==i.gsc_ctr?(s._sort_gsc_ctr=parseFloat(i.gsc_ctr),Number.isNaN(s._sort_gsc_ctr)&&(s._sort_gsc_ctr=0)):s._sort_gsc_ctr=0;const r=function(t){return Array.isArray(t?.tags)&&t.tags.length?t.tags.map(t=>String(t?.description||t?.tag_description||"")).filter(Boolean).sort():[]}(i);return s._search_blob=[i.keyword,i.province,i.url,r.join(" ")].join(" ").toLowerCase(),s._rt_row_key=String(null!=s.DT_RowId?s.DT_RowId:i.id),s}(t,e)).filter(Boolean):[]}(e?.keywords||[],e?.tableContext||{});Promise.resolve(t.replaceData(r)).then(()=>Eh(t,s)).catch(()=>{})}function Mh(t){return!(!t||"function"!=typeof t.closest)&&Boolean(t.closest("a, button, select, input, textarea, .slr-rt-tags"))}function Th(t,e){const i=t.getElement(),s=t.getData(),n=yh(s);i.classList.toggle("slr-rt-row--clickable",!n),i.classList.toggle("slr-rt-row--active",String(s._rt_row_key)===String(e||""))}function Sh({dataset:t,loading:i,selectedRowKey:s,onKeywordSelect:n,tableApiRef:o}){const r=(0,e.useRef)(null),h=(0,e.useRef)(null),c=(0,e.useRef)(null),d=(0,e.useRef)(!1),u=(0,e.useRef)(0),p=(0,e.useRef)(t),m=(0,e.useRef)(i),g=(0,e.useRef)(""),b=(0,e.useRef)(s),f=(0,e.useRef)(n),[v,w]=(0,e.useState)("");p.current=t,m.current=i,g.current=v,b.current=s,f.current=n;const y=t?.hiddenColumns,_=t?.tableContext||null,x=(0,e.useMemo)(()=>JSON.stringify({hidden:Array.isArray(y)?y:[],depth:Boolean(_?.active_keywords_depth)}),[y,_?.active_keywords_depth]);return(0,e.useEffect)(()=>{if(!h.current)return;th(_||{}),d.current=!1;const t=new Zl(h.current,{layout:"fitColumns",autoResize:!1,movableColumns:!1,reactiveData:!1,index:"_rt_row_key",rowHeight:55,height:"420px",renderVertical:"virtual",columnHeaderVertAlign:"middle",headerSort:!0,data:[],columns:kh(y,_),pagination:!0,paginationSize:100,paginationSizeSelector:[50,100,500,1e3,2e3],paginationCounter:(t,e,i,s)=>s?`${e}–${Math.min(e+t-1,s)} / ${s}`:"0",initialSort:[{column:"position",dir:"asc"}],placeholder:(0,a.__)("Loading…","seo-local-rank"),locale:!0,langs:{default:{pagination:{first:(0,a.__)("First","seo-local-rank"),first_title:(0,a.__)("First","seo-local-rank"),last:(0,a.__)("Last","seo-local-rank"),last_title:(0,a.__)("Last","seo-local-rank"),prev:(0,a.__)("Prev","seo-local-rank"),prev_title:(0,a.__)("Prev","seo-local-rank"),next:(0,a.__)("Next","seo-local-rank"),next_title:(0,a.__)("Next","seo-local-rank"),page_size:(0,a.__)("Show","seo-local-rank"),counter:{showing:"",of:"/",rows:"",pages:""}}}},columnDefaults:{headerTooltip:!1,tooltip:!1,vertAlign:"middle",resizable:!0},rowFormatter(t){Th(t,b.current)}});c.current=t;const e=()=>{d.current=!0,Rh(t,p.current,m.current,g.current)},i=(t,e)=>{const i=function(t,e){if(e&&Mh(e.target))return!1;if(!t||"function"!=typeof t.getData)return!1;const i=t.getData();return!yh(i)&&i}(e&&"function"==typeof e.getRow?e.getRow():e,t);if(!i)return;const s=Date.now();s-u.current<250||(u.current=s,f.current?.(i))},s=t=>{if(!c.current||Mh(t.target))return;const e=t.target?.closest?.(".tabulator-row");if(e)try{i(t,c.current.getRow(e))}catch(t){}},n=r.current;return t.on("tableBuilt",e),t.on("rowClick",i),n?.addEventListener("click",s),o&&(o.current={getActiveRows(){if(!c.current||!d.current)return[];try{return c.current.getRows("active").map(t=>t.getData())}catch(t){return[]}}}),()=>{d.current=!1,t.off("tableBuilt",e),t.off("rowClick",i),n?.removeEventListener("click",s),t.destroy(),c.current=null,o&&(o.current=null)}},[x,o]),(0,e.useEffect)(()=>{d.current&&Rh(c.current,t,i,g.current)},[t,i,x]),(0,e.useEffect)(()=>{d.current&&function(t,e){if(t)try{t.getRows().forEach(t=>Th(t,e))}catch(t){}}(c.current,s)},[s]),(0,e.useEffect)(()=>{const t=window.setTimeout(()=>{Eh(c.current,v)},180);return()=>{window.clearTimeout(t)}},[v]),(0,l.jsxs)("div",{className:"slr-panel slr-rt-table-panel",children:[(0,l.jsxs)("div",{className:"slr-rt-table-toolbar",children:[(0,l.jsx)("div",{className:"slr-rt-table-toolbar__left"}),(0,l.jsx)("input",{type:"search",className:"slr-rt-table-toolbar__search",placeholder:(0,a.__)("Search keyword, URL, location…","seo-local-rank"),autoComplete:"off",value:v,onChange:t=>w(t.target.value)})]}),(0,l.jsx)("div",{className:"slr-rt-table",ref:r,children:(0,l.jsx)("div",{ref:h})})]})}function Dh(){return(0,l.jsxs)("div",{className:"slr-rank-tracker slr-rank-tracker--loading","aria-busy":"true","aria-label":(0,a.__)("Loading rank tracker","seo-local-rank"),children:[(0,l.jsxs)("div",{className:"slr-toolbar slr-toolbar--skeleton",children:[(0,l.jsx)("div",{className:"slr-skeleton slr-skeleton--selector"}),(0,l.jsx)("div",{className:"slr-skeleton slr-skeleton--upgrade"})]}),(0,l.jsxs)("div",{className:"slr-rank-tracker__body",children:[(0,l.jsx)("div",{className:"slr-panel slr-rt-filters slr-dash-panel--skeleton",children:(0,l.jsx)("div",{className:"slr-rt-filters__row",children:(0,l.jsx)("div",{className:"slr-skeleton slr-skeleton--daterange"})})}),(0,l.jsxs)("div",{className:"slr-rt-summary",children:[(0,l.jsxs)("div",{className:"slr-panel slr-rt-summary__card slr-rt-summary__avg slr-dash-panel--skeleton",children:[(0,l.jsx)("div",{className:"slr-skeleton slr-skeleton--line slr-skeleton--sm"}),(0,l.jsx)("div",{className:"slr-skeleton slr-skeleton--line slr-skeleton--lg"}),(0,l.jsx)("div",{className:"slr-skeleton slr-skeleton--chart slr-skeleton--chart-sm"})]}),(0,l.jsxs)("div",{className:"slr-panel slr-rt-summary__card slr-rt-summary__distribution slr-dash-panel--skeleton",children:[(0,l.jsx)("div",{className:"slr-skeleton slr-skeleton--line slr-skeleton--sm"}),(0,l.jsxs)("div",{className:"slr-rt-summary__distribution-body",children:[(0,l.jsx)("div",{className:"slr-skeleton slr-skeleton--donut"}),(0,l.jsx)("div",{className:"slr-rt-summary__rows",children:[1,2,3,4].map(t=>(0,l.jsx)("div",{className:"slr-skeleton slr-skeleton--line slr-skeleton--md"},t))})]})]}),(0,l.jsxs)("div",{className:"slr-panel slr-rt-summary__card slr-rt-summary__aio slr-dash-panel--skeleton",children:[(0,l.jsx)("div",{className:"slr-skeleton slr-skeleton--line slr-skeleton--sm"}),(0,l.jsx)("div",{className:"slr-skeleton slr-skeleton--line slr-skeleton--lg"}),(0,l.jsx)("div",{className:"slr-skeleton slr-skeleton--bar"}),(0,l.jsx)("div",{className:"slr-skeleton slr-skeleton--line slr-skeleton--sm"}),(0,l.jsx)("div",{className:"slr-skeleton slr-skeleton--line slr-skeleton--sm"})]})]}),(0,l.jsx)("div",{className:"slr-skeleton slr-skeleton--button"}),(0,l.jsxs)("div",{className:"slr-panel slr-rt-table-panel slr-dash-panel--skeleton",children:[(0,l.jsxs)("div",{className:"slr-rt-table-toolbar",children:[(0,l.jsx)("div",{className:"slr-skeleton slr-skeleton--search"}),(0,l.jsx)("div",{className:"slr-skeleton slr-skeleton--select"})]}),(0,l.jsx)("div",{className:"slr-skeleton slr-skeleton--chart"})]})]})]})}const Lh=["top_3","top_10","top_20","top_101"];function Ph(t){return 10*Math.max(1,t)}function jh(t,e){const i=Ph(Math.max(1,parseInt(e,10)||10)),s=parseInt(t,10);return Number.isNaN(s)?"top_101":s>=1&&s<=3?"top_3":s>=4&&s<=10?"top_10":s>=11&&s<=i?"top_20":"top_101"}function Nh(t){if("number"==typeof t)return{rank:t>0?t:101,depth:10};if(!t||"object"!=typeof t)return{rank:101,depth:10};const e=t.depth??10,i=Number(t.rank);return i>0?{rank:i,depth:e}:{rank:10*e+1,depth:e}}function Ah(t,e){if(e?.new_project_with_gsc_data){const t=wr(String(e?.max_date?.date||"").slice(0,10));if(t)return t}return wr(t)}function zh(t,e,i){let s=xr(t,1);if(!e||"object"!=typeof e)return s;for(;s<=i&&!e[yr(s)];)s=xr(s,1);return s}function Oh(t,e,i,s){const n=e?.[s];if(!n||!t[s])return;const{rank:o,depth:r}=Nh(n),a=e?.[i];if(a){const e=Nh(a);return void Lh.forEach(i=>{const n=jh(o,r)===i,a=jh(e.rank,e.depth)===i;n&&!a&&(t[s][i].new+=1),a&&!n&&(t[s][i].lost+=1)})}const l=jh(o,r);t[s][l].new+=1}function Fh(t,e,i){return t<e||t===e&&i>=95}function Hh(t,e,i,s,n){const o=wr(e),r=wr(i),a=[],l=[];if(!o||!r)return{labels:a,values:l};for(let e=o;e<=r;e=xr(e,1)){const o=yr(e);Fh(o,i,s)&&t[o]&&(a.push(o),l.push(n(t[o])))}return{labels:a,values:l}}function Ih(t){return Number.isNaN(t)?0:Math.abs(Math.round(10*(t+Number.EPSILON))/10)}function Bh(t,e){const i=Array.isArray(t?.keywords)?t.keywords:[];if(0===i.length)return{empty:!0};const s=function(t,e={}){const i={},s=Array.isArray(t?.keywords)?t.keywords:[],n=e.createdYmd||"",o=Boolean(e.newProjectWithGsc),r=Ah(t?.start,{new_project_with_gsc_data:o,max_date:{date:n}}),a=Ah(t?.startGrouped||t?.start,{new_project_with_gsc_data:o,max_date:{date:n}}),l=wr(t?.end);return s.forEach(t=>{const e=function(t){return t?.data&&"object"==typeof t.data?t.data:t}(t),s=e?.positions;if(!s||"object"!=typeof s)return;if(Object.keys(s).forEach(t=>{if(!wr(t))return;const e=s[t],r=function(t,e){return t[e]||(t[e]={sum_rank:0,total_keywords:0,avg:0,top_3:{num_keywords:0,new:0,lost:0},top_10:{num_keywords:0,new:0,lost:0},top_20:{num_keywords:0,new:0,lost:0},top_101:{num_keywords:0,new:0,lost:0},aio_num_keywords:0,aio_mentions:0,aio_citations:0}),t[e]}(i,t);if("number"==typeof e||e&&"object"==typeof e&&void 0!==e.rank){const{rank:i,depth:s}=Nh(e);r.sum_rank+=i,r.total_keywords+=1,(!o||n&&t>=n)&&(r[jh(i,s)].num_keywords+=1)}const a=e&&"object"==typeof e?e.ai:null;a&&!0===a.snp&&(r.aio_num_keywords+=1,Array.isArray(a.bw)&&a.bw.length>0&&(r.aio_mentions+=a.bw.length),Array.isArray(a.links)&&a.links.length>0&&(r.aio_citations+=a.links.length))}),!r||!l||!a)return;const h=yr(a);let c=xr(r,1),d=r;for(;c<=l;){const t=yr(d),e=yr(c);s[t]&&s[e]&&Oh(i,s,h,e),d=c,c=zh(c,s,l)}}),Object.keys(i).forEach(t=>{const e=i[t];e.avg=e.total_keywords>0?Math.round(10*(e.sum_rank/e.total_keywords+Number.EPSILON))/10:0}),i}(t,{newProjectWithGsc:Boolean(e?.new_project_with_gsc_data),createdYmd:yr(wr(String(e?.max_date?.date||"").slice(0,10)))});if(0===Object.keys(s).length)return{empty:!0};const n=function(t,e,i){const s=Ah(e?.start,i),n=wr(e?.end);if(!s||!n)return null;let o=function(t,e,i){let s=e;for(;s<=i;){if(t[yr(s)])return s;s=xr(s,1)}return null}(t,s,n);if(!o)return null;let r=n;const a=Number(e?.updatedPercent)||0,l=Math.max(1,Number(e?.groupDataInterval)||1);return a<95&&yr(r)===yr(n)&&r>o&&(r=xr(r,-l)),r=function(t,e,i){let s=e;for(;s>=i;){if(t[yr(s)])return s;s=xr(s,-1)}return null}(t,r,o)||o,{startYmd:yr(o),endYmd:yr(r),pickerEndYmd:yr(n),updatedPercent:a}}(s,t,e);if(!n||!s[n.startYmd]||!s[n.endYmd])return{empty:!0};const o=s[n.startYmd],r=s[n.endYmd],l=function(t){const e=t?.tableContext||{},i=Number(e.pd_depth_for_distribution);if(i>0)return i;const s=Number(e.pd_depth_at_end);return s>0?s:1}(t),h=function(t){const e=Ph(Math.max(1,Number(t)||1)),i=[{key:"top_3",label:(0,a.__)("TOP 1-3","seo-local-rank"),color:"#EDC92F"},{key:"top_10",label:(0,a.__)("TOP 4-10","seo-local-rank"),color:"#69B5EB"}];return e>10&&i.push({key:"top_20",label:(0,a.sprintf)(/* translators: %s: ranking position threshold */ /* translators: %s: ranking position threshold */
    16 (0,a.__)("TOP 11-%s","seo-local-rank"),e),color:"#3A8AD5"}),i.push({key:"top_101",label:(0,a.sprintf)(/* translators: %s: ranking position threshold */ /* translators: %s: ranking position threshold */
    17 (0,a.__)("TOP %s+","seo-local-rank"),e),color:"#CCCCCC"}),i}(l),c=Hh(s,n.startYmd,n.pickerEndYmd,n.updatedPercent,t=>t.avg),d=c.values.filter(t=>"number"==typeof t);let u=d.length?Math.min(...d):1,p=d.length?Math.max(...d):10;const m=l,g=Math.min(5,m);if(p-u<g){const t=g-(p-u);p+=t/2,u-=t/2}const b=(r.avg||0)-(o.avg||0),f=i.length,v=(r.aio_num_keywords||0)-(o.aio_num_keywords||0),w=(r.aio_mentions||0)-(o.aio_mentions||0),y=(r.aio_citations||0)-(o.aio_citations||0);return{empty:!1,avg:{value:r.avg,change:Ih(b),improved:b<0,labels:c.labels,values:c.values,min:u,max:p},distribution:{buckets:h.map(t=>{const e=r[t.key]||{num_keywords:0,new:0,lost:0},i=Hh(s,n.startYmd,n.pickerEndYmd,n.updatedPercent,e=>e[t.key]?.num_keywords||0);return{key:t.key,label:t.label,color:t.color,total:e.num_keywords,newCount:e.new,lostCount:e.lost,percent:f>0?100*e.num_keywords/f:0,sparkLabels:i.labels,sparkValues:i.values}}),totalKeywords:f},aio:{value:r.aio_num_keywords||0,change:Ih(v),improved:v>0,total:f,percent:f>0?(r.aio_num_keywords||0)/f*100:0,mentions:r.aio_mentions||0,mentionsChange:Ih(w),mentionsImproved:w>0,citations:r.aio_citations||0,citationsChange:Ih(y),citationsImproved:y>0}}}function Vh({count:t,total:e,change:i,improved:s,template:n}){return(0,l.jsxs)("div",{className:"slr-rt-aio-stat",children:[(0,l.jsx)("span",{children:(0,a.sprintf)(n,Uo(t),Uo(e))}),(0,l.jsx)(qo,{value:i,positive:s,variant:"solid"})]})}function Wh({aio:t}){return(0,l.jsxs)("div",{className:"slr-panel slr-rt-summary__card slr-rt-summary__aio",children:[(0,l.jsx)("h3",{className:"slr-rt-summary__title",children:(0,a.__)("AI Overview Presence","seo-local-rank")}),(0,l.jsxs)("div",{className:"slr-rt-summary__value-row",children:[(0,l.jsx)("span",{className:"slr-rt-summary__value",children:Uo(t.value)}),(0,l.jsx)(qo,{value:t.change,positive:t.improved,variant:"solid"})]}),(0,l.jsx)("p",{className:"slr-rt-aio-meta",children:(0,a.sprintf)(/* translators: 1: number of keywords with AI Overview, 2: total keywords */ /* translators: 1: number of keywords with AI Overview, 2: total keywords */
    18 (0,a.__)("%1$s of %2$s keywords","seo-local-rank"),Uo(t.value),Uo(t.total))}),(0,l.jsx)("div",{className:"slr-rt-aio-progress",role:"presentation",children:(0,l.jsx)("div",{className:"slr-rt-aio-progress__bar",style:{width:`${Math.min(100,Math.max(0,t.percent))}%`}})}),(0,l.jsx)(Vh,{count:t.mentions,total:t.total,template:/* translators: 1: mention count, 2: total keywords */ /* translators: 1: mention count, 2: total keywords */
    19 (0,a.__)("%1$s mentions of %2$s keywords","seo-local-rank"),change:t.mentionsChange,improved:t.mentionsImproved}),(0,l.jsx)(Vh,{count:t.citations,total:t.total,template:/* translators: 1: citation count, 2: total keywords */ /* translators: 1: citation count, 2: total keywords */
    20 (0,a.__)("%1$s citations of %2$s keywords","seo-local-rank"),change:t.citationsChange,improved:t.citationsImproved})]})}function Gh({avg:t}){const e={labels:t.labels,datasets:[{data:t.values,borderColor:"#EF7A35",backgroundColor:"transparent",spanGaps:!0}]};return(0,l.jsxs)("div",{className:"slr-panel slr-rt-summary__card slr-rt-summary__avg",children:[(0,l.jsx)("h3",{className:"slr-rt-summary__title",children:(0,a.__)("AVG position","seo-local-rank")}),(0,l.jsxs)("div",{className:"slr-rt-summary__value-row",children:[(0,l.jsx)("span",{className:"slr-rt-summary__value",children:Uo(t.value,1)}),(0,l.jsx)(qo,{value:t.change,positive:t.improved,variant:"solid"})]}),(0,l.jsx)("div",{className:"slr-rt-avg-chart",children:(0,l.jsx)(Ao,{data:e,options:(i=t.min,s=t.max,{responsive:!0,maintainAspectRatio:!1,animation:!1,plugins:{legend:{display:!1},tooltip:{callbacks:{title:t=>t[0]?Yo(t[0].label):""}}},elements:{point:{radius:0,hoverRadius:4},line:{tension:.3,borderWidth:2}},scales:{x:{display:!1},y:{display:!1,reverse:!0,min:i,max:s}}})})})]});var i,s}const Uh={responsive:!0,maintainAspectRatio:!1,animation:!1,plugins:{legend:{display:!1},tooltip:{callbacks:{title:t=>t[0]?Yo(t[0].label):""}}},elements:{point:{radius:0,hoverRadius:3},line:{tension:.3,borderWidth:1.5}},scales:{x:{display:!1},y:{display:!1}}},$h={responsive:!0,maintainAspectRatio:!1,animation:!1,cutout:"50%",plugins:{legend:{display:!1},tooltip:{callbacks:{label:t=>`${t.label}: ${Number(t.parsed).toFixed(1)}%`}}}};function Yh({labels:t,values:e,color:i}){return(0,l.jsx)("div",{className:"slr-rt-spark",children:(0,l.jsx)(Ao,{data:{labels:t,datasets:[{data:e,borderColor:i,backgroundColor:"transparent",spanGaps:!0}]},options:Uh})})}function Kh({bucket:t}){return(0,l.jsxs)("div",{className:"slr-rt-dist-row",children:[(0,l.jsxs)("span",{className:"slr-rt-dist-row__label",children:[(0,l.jsx)("span",{className:"slr-rt-dist-row__dot",style:{background:t.color},"aria-hidden":"true"}),t.label]}),(0,l.jsx)("span",{className:"slr-rt-dist-row__num",children:Uo(t.total)}),(0,l.jsx)("span",{className:"slr-rt-dist-row__new",children:t.newCount>0?Uo(t.newCount):""}),(0,l.jsx)("span",{className:"slr-rt-dist-row__lost",children:t.lostCount>0?Uo(t.lostCount):""}),(0,l.jsx)(Yh,{labels:t.sparkLabels,values:t.sparkValues,color:t.color})]})}function Xh({distribution:t}){const e={labels:t.buckets.map(t=>t.label),datasets:[{data:t.buckets.map(t=>t.percent),backgroundColor:t.buckets.map(t=>t.color),borderWidth:0}]};return(0,l.jsxs)("div",{className:"slr-panel slr-rt-summary__card slr-rt-summary__distribution",children:[(0,l.jsx)("h3",{className:"slr-rt-summary__title",children:(0,a.__)("Keywords distribution","seo-local-rank")}),(0,l.jsxs)("div",{className:"slr-rt-summary__distribution-body",children:[(0,l.jsx)("div",{className:"slr-rt-donut",children:(0,l.jsx)(Oo,{data:e,options:$h})}),(0,l.jsxs)("div",{className:"slr-rt-dist-table",children:[(0,l.jsxs)("div",{className:"slr-rt-dist-row slr-rt-dist-row--head",children:[(0,l.jsx)("span",{}),(0,l.jsx)("span",{children:(0,a.__)("Total","seo-local-rank")}),(0,l.jsx)("span",{children:(0,a.__)("New","seo-local-rank")}),(0,l.jsx)("span",{children:(0,a.__)("Lost","seo-local-rank")}),(0,l.jsx)("span",{})]}),t.buckets.map(t=>(0,l.jsx)(Kh,{bucket:t},t.key))]})]})]})}function qh({label:t,color:e}){return(0,l.jsxs)("div",{className:"slr-rt-dist-row",children:[(0,l.jsxs)("span",{className:"slr-rt-dist-row__label",children:[(0,l.jsx)("span",{className:"slr-rt-dist-row__dot",style:{background:e},"aria-hidden":"true"}),t]}),(0,l.jsx)("span",{className:"slr-skeleton slr-skeleton--line slr-skeleton--cell"}),(0,l.jsx)("span",{className:"slr-skeleton slr-skeleton--line slr-skeleton--cell"}),(0,l.jsx)("span",{className:"slr-skeleton slr-skeleton--line slr-skeleton--cell"}),(0,l.jsx)("span",{className:"slr-skeleton slr-skeleton--spark"})]})}function Jh(){return(0,l.jsxs)("div",{className:"slr-rt-summary","aria-busy":"true",children:[(0,l.jsxs)("div",{className:"slr-panel slr-rt-summary__card slr-rt-summary__avg",children:[(0,l.jsx)("h3",{className:"slr-rt-summary__title",children:(0,a.__)("AVG position","seo-local-rank")}),(0,l.jsx)("div",{className:"slr-skeleton slr-skeleton--line slr-skeleton--lg"}),(0,l.jsx)("div",{className:"slr-skeleton slr-skeleton--chart slr-skeleton--chart-sm"})]}),(0,l.jsxs)("div",{className:"slr-panel slr-rt-summary__card slr-rt-summary__distribution",children:[(0,l.jsx)("h3",{className:"slr-rt-summary__title",children:(0,a.__)("Keywords distribution","seo-local-rank")}),(0,l.jsxs)("div",{className:"slr-rt-summary__distribution-body",children:[(0,l.jsx)("div",{className:"slr-skeleton slr-skeleton--donut"}),(0,l.jsxs)("div",{className:"slr-rt-dist-table",children:[(0,l.jsxs)("div",{className:"slr-rt-dist-row slr-rt-dist-row--head",children:[(0,l.jsx)("span",{}),(0,l.jsx)("span",{children:(0,a.__)("Total","seo-local-rank")}),(0,l.jsx)("span",{children:(0,a.__)("New","seo-local-rank")}),(0,l.jsx)("span",{children:(0,a.__)("Lost","seo-local-rank")}),(0,l.jsx)("span",{})]}),(0,l.jsx)(qh,{label:(0,a.__)("TOP 1-3","seo-local-rank"),color:"#EDC92F"}),(0,l.jsx)(qh,{label:(0,a.__)("TOP 4-10","seo-local-rank"),color:"#69B5EB"}),(0,l.jsx)(qh,{label:(0,a.__)("TOP 11-20","seo-local-rank"),color:"#3A8AD5"}),(0,l.jsx)(qh,{label:(0,a.__)("TOP 20+","seo-local-rank"),color:"#C5C9CE"})]})]})]}),(0,l.jsxs)("div",{className:"slr-panel slr-rt-summary__card slr-rt-summary__aio",children:[(0,l.jsx)("h3",{className:"slr-rt-summary__title",children:(0,a.__)("AI Overview Presence","seo-local-rank")}),(0,l.jsx)("div",{className:"slr-skeleton slr-skeleton--line slr-skeleton--lg"}),(0,l.jsx)("div",{className:"slr-skeleton slr-skeleton--line slr-skeleton--md"}),(0,l.jsx)("div",{className:"slr-skeleton slr-skeleton--bar"}),(0,l.jsx)("div",{className:"slr-skeleton slr-skeleton--line slr-skeleton--sm"}),(0,l.jsx)("div",{className:"slr-skeleton slr-skeleton--line slr-skeleton--sm"})]})]})}function Zh(){const t=(0,a.__)("Add keywords to see rank data.","seo-local-rank");return(0,l.jsxs)("div",{className:"slr-rt-summary",children:[(0,l.jsxs)("div",{className:"slr-panel slr-rt-summary__card slr-rt-summary__avg",children:[(0,l.jsx)("h3",{className:"slr-rt-summary__title",children:(0,a.__)("AVG position","seo-local-rank")}),(0,l.jsx)("p",{className:"slr-rt-summary__empty",children:t})]}),(0,l.jsxs)("div",{className:"slr-panel slr-rt-summary__card slr-rt-summary__distribution",children:[(0,l.jsx)("h3",{className:"slr-rt-summary__title",children:(0,a.__)("Keywords distribution","seo-local-rank")}),(0,l.jsx)("p",{className:"slr-rt-summary__empty",children:t})]}),(0,l.jsxs)("div",{className:"slr-panel slr-rt-summary__card slr-rt-summary__aio",children:[(0,l.jsx)("h3",{className:"slr-rt-summary__title",children:(0,a.__)("AI Overview Presence","seo-local-rank")}),(0,l.jsx)("p",{className:"slr-rt-summary__empty",children:t})]})]})}function Qh({dataset:t,bootstrap:i,loading:s,error:n}){const o=(0,e.useMemo)(()=>t?Bh(t,i):null,[t,i]);return s||!t&&!n?(0,l.jsx)(Jh,{}):t&&o&&!o.empty?(0,l.jsxs)("div",{className:"slr-rt-summary",children:[(0,l.jsx)(Gh,{avg:o.avg}),(0,l.jsx)(Xh,{distribution:o.distribution}),(0,l.jsx)(Wh,{aio:o.aio})]}):(0,l.jsx)(Zh,{})}function tc(t){const e=t&&"object"==typeof t?t:{},i=Array.isArray(e.data)?e.data:[],s=e.notes&&"object"==typeof e.notes?e.notes:{},n=Number(e.keywords_without_end_data)||0,o=Number(e.keywords_paused)||0,r=Math.max(0,i.length-o),a=Math.max(0,r-n);return{keywords:i,keywordsWithoutEndData:n,keywordsPaused:o,updatedCount:a,updatedPercent:r>0?100*a/r:0,notes:{project:Array.isArray(s.project)?s.project:[],system:Array.isArray(s.system)?s.system:[]},hiddenColumns:e.hidden_columns??null,tableContext:e.rt_table_context&&"object"==typeof e.rt_table_context?e.rt_table_context:null,groupDataInterval:Number(e.group_data_interval)||0,start:e.start||"",end:e.end||"",startGrouped:e.start_grouped||"",gscAdvancedFirstDay:e.gsc_advanced_data_first_day??null,gscAdvancedLastDay:e.gsc_advanced_data_last_day??null,competitors:Array.isArray(e.competitors)?e.competitors:[]}}function ec({domainsPayload:t,selectedProject:i,onProjectChange:r}){const h=t?.domains||[],c=t?.domain||"",d=i?.project_domain_id||i?.id||0,[u,p]=(0,e.useState)(null),[m,g]=(0,e.useState)(!1),[b,f]=(0,e.useState)(""),[v,w]=(0,e.useState)(null),[y,_]=(0,e.useState)(null),[x,C]=(0,e.useState)(!0),[k,E]=(0,e.useState)(""),[R,M]=(0,e.useState)(null),[T,S]=(0,e.useState)(!1),D=(0,e.useRef)(null),L=u?function(t){const e=t?.default_period||{},i=t?.max_date||{},s=Number(i.days||0),n=wr(String(i.date||"").slice(0,10)),o=_r(),r=n||xr(o,-Math.max(s,0)),a=o,l="string"==typeof e.range?e.range:"";let h=wr(e.start),c=wr(e.end);if(!h||!c)switch(l){case"1 day":h=xr(o,-1),c=o;break;case"7 days":h=xr(o,-6),c=o;break;case"1 month":h=Cr(o,-1),c=o;break;case"2 months":h=Cr(o,-2),c=o;break;case"3 months":h=Cr(o,-3),c=o;break;default:h=s>29?Cr(o,-1):xr(o,-Math.max(s,0)),c=o}return h=Er(h||r,r,a),c=Er(c||o,r,a),h>c&&(h=c),{start:h,end:c,minDate:r,maxDate:a,projectDays:s}}(u):null,P=v?.start||L?.start||null,j=v?.end||L?.end||null,N=yr(P),A=yr(j),z=L?.minDate||null,O=L?.maxDate||null,F=L?.projectDays||0,H=Number(u?.num_keywords??i?.num_keywords),I=y?y.keywords.length:Number.isFinite(H)?H:null,B=y?{paused:y.keywordsPaused,withoutEndData:y.keywordsWithoutEndData,percent:y.updatedPercent}:null,V=Number(u?.selected_domain?.project_domain_id||u?.domain?.project_domain_id||0),W=(!V||V===Number(d))&&function(t){if(!t||"object"!=typeof t)return!1;const e=Number(t.num_keywords);return Number.isFinite(e)&&e<=0}(u),G=(0,e.useCallback)(async()=>{if(!d)return p(null),_(null),void E("");g(!0),f(""),_(null),E("");try{const t=await s()({path:o(`/domains/ranktracker?project_domain_id=${d}`)});w(null),p(t?.data||null)}catch(t){p(null),w(null),_(null),f(t?.message||(0,a.__)("Could not load the rank tracker. Try again later.","seo-local-rank"))}finally{g(!1)}},[d]);(0,e.useEffect)(()=>{G()},[G]),(0,e.useEffect)(()=>{S(!1)},[d]),(0,e.useEffect)(()=>{!m&&u&&W&&S(!0)},[m,u,W]),(0,e.useEffect)(()=>{if(!d||!N||!A||m)return void(d&&!m||(_(null),C(!1)));if(W)return E(""),_(tc({data:[]})),void C(!1);let t=!1;const e="undefined"!=typeof AbortController?new AbortController:null;return(async()=>{C(!0),E(""),_(null);try{const i=await s()({path:o(`/domains/ranktracker/data?project_domain_id=${d}&start=${encodeURIComponent(N)}&end=${encodeURIComponent(A)}`),signal:e?.signal});if(t)return;_(tc(i))}catch(e){if(t||"AbortError"===e?.name)return;_(null),E(e?.message||(0,a.__)("Could not load keyword data. Try again later.","seo-local-rank"))}finally{t||C(!1)}})(),()=>{t=!0,e?.abort()}},[d,N,A,m,W]),(0,e.useEffect)(()=>{M(null)},[d,N,A]);const U=(0,e.useCallback)(t=>{yh(t)||M(t)},[]),$=(0,e.useCallback)(t=>{const e=(D.current?.getActiveRows()||[]).filter(t=>!yh(t));if(!e.length)return;const i=R?._rt_row_key,s=e.findIndex(t=>String(t._rt_row_key)===String(i)),n=s<0?0:(s+t+e.length)%e.length;M(e[n])},[R]);return i?m&&!u?(0,l.jsx)(Dh,{}):(0,l.jsxs)("div",{className:"slr-rank-tracker","data-rt-ready":y?"true":"false","aria-busy":x||void 0,children:[(0,l.jsx)(ur,{selectedProject:i,domains:h,siteDomain:c,onProjectChange:r,keywordCount:I,keywordSync:B}),(0,l.jsxs)("div",{className:"slr-rank-tracker__body",children:[b&&(0,l.jsx)(n.Notice,{status:"error",isDismissible:!1,children:b}),k&&(0,l.jsx)(n.Notice,{status:"error",isDismissible:!1,children:k}),u&&P&&j&&z&&O&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(Nr,{bootstrap:u,start:P,end:j,minDate:z,maxDate:O,projectDays:F,onRangeChange:(t,e)=>{w({start:t,end:e})}}),(0,l.jsx)(Qh,{dataset:y,bootstrap:u,loading:x,error:k}),(0,l.jsx)("div",{className:"slr-rt-actions",children:(0,l.jsx)(n.Button,{variant:"primary",className:"slr-rt-add-keywords",icon:"plus-alt2",onClick:()=>S(!0),children:(0,a.__)("Add keywords","seo-local-rank")})}),(0,l.jsx)(Sh,{dataset:y,loading:x,selectedRowKey:R?._rt_row_key,onKeywordSelect:U,tableApiRef:D})]})]}),T?(0,l.jsx)(Vr,{bootstrap:u,projectDomainId:d,onClose:()=>S(!1),onAdded:()=>{S(!1),G()}}):null,R?(0,l.jsx)(ta,{row:R,projectDomainId:d,domainId:Number(u?.domain?.domain_id||i?.domain_id||0),projectName:u?.domain?.name||i?.name||"",start:N,end:A,onClose:()=>M(null),onPrev:()=>$(-1),onNext:()=>$(1)}):null]}):(0,l.jsx)("div",{className:"slr-panel slr-empty-state",children:(0,l.jsx)("p",{children:(0,a.__)("No project selected.","seo-local-rank")})})}function ic({settings:t,domainsPayload:i,selectedProject:r,onDisconnect:h,onProjectChange:c}){const[d,u]=(0,e.useState)(!1),[p,m]=(0,e.useState)(!1),[g,b]=(0,e.useState)(null),[f,v]=(0,e.useState)(""),w=i?.domains||[],y=w.length>1,_=i?.domain||t?.site_url||"";(0,e.useEffect)(()=>{const e=i?.project_domain_id||t?.project_domain_id||0;v(e>0?String(e):"")},[i?.project_domain_id,t?.project_domain_id]);const x=w.map(t=>{const e=t.project_domain_id||t.id;return{label:t.project_name?`${t.project_name} (${t.name_displayed||t.name})`:t.name_displayed||t.name||`#${e}`,value:String(e)}}),C=t?.user?.email,k=t?.plugin_version||window.slrAdmin?.version,E=r?`${r.project_name||""} (${r.name_displayed||r.name||_})`.trim():"—";return(0,l.jsxs)(l.Fragment,{children:[g&&(0,l.jsx)(n.Notice,{status:g.status,isDismissible:!0,onRemove:()=>b(null),children:g.message}),(0,l.jsxs)("div",{className:"slr-panel",children:[(0,l.jsx)("h2",{className:"slr-panel__title",children:(0,a.__)("Connection","seo-local-rank")}),(0,l.jsx)("p",{children:(0,l.jsx)("span",{className:"slr-status--connected",children:(0,a.__)("Logged in","seo-local-rank")})}),C&&(0,l.jsx)("p",{children:(0,a.sprintf)(/* translators: %s: account email */ /* translators: %s: account email */
    21 (0,a.__)("Account: %s","seo-local-rank"),C)}),(0,l.jsx)("div",{className:"slr-settings__actions",children:(0,l.jsx)(n.Button,{variant:"secondary",onClick:async()=>{u(!0),b(null);try{const t=await s()({path:o("/connection/disconnect"),method:"POST"});b({status:"success",message:t.message||(0,a.__)("Session closed.","seo-local-rank")}),h()}catch(t){b({status:"error",message:t?.message||(0,a.__)("Could not log out.","seo-local-rank")})}finally{u(!1)}},isBusy:d,disabled:d,children:(0,a.__)("Log out","seo-local-rank")})})]}),(0,l.jsxs)("div",{className:"slr-panel",children:[(0,l.jsx)("h2",{className:"slr-panel__title",children:(0,a.__)("Project","seo-local-rank")}),0===w.length?(0,l.jsx)("p",{children:(0,e.createInterpolateElement)((0,a.sprintf)(/* translators: %s: site domain */ /* translators: %s: site domain */
    22 (0,a.__)("There are no projects for <strong>%s</strong>.","seo-local-rank"),_),{strong:(0,l.jsx)("strong",{})})}):y?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)("p",{className:"slr-onboarding__help",children:(0,a.__)("The selected project is used on every plugin screen.","seo-local-rank")}),(0,l.jsx)(n.SelectControl,{label:(0,a.__)("Active project","seo-local-rank"),value:f,options:x,onChange:v}),(0,l.jsx)("div",{className:"slr-settings__actions",children:(0,l.jsx)(n.Button,{variant:"primary",onClick:async()=>{const t=parseInt(f,10);if(t){m(!0),b(null);try{await s()({path:o(`/domains/${t}/select`),method:"POST"}),b({status:"success",message:(0,a.__)("Project updated.","seo-local-rank")}),c()}catch(t){b({status:"error",message:t?.message||(0,a.__)("Could not change the project.","seo-local-rank")})}finally{m(!1)}}},isBusy:p,disabled:p||!f,children:(0,a.__)("Save project","seo-local-rank")})})]}):(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)("p",{className:"slr-onboarding__help",children:(0,a.__)("Active project","seo-local-rank")}),(0,l.jsx)("p",{children:E})]})]}),(0,l.jsxs)("div",{className:"slr-panel",children:[(0,l.jsx)("h2",{className:"slr-panel__title",children:(0,a.__)("About","seo-local-rank")}),(0,l.jsx)("p",{children:(0,a.sprintf)(/* translators: %s: plugin version */ /* translators: %s: plugin version */
    23 (0,a.__)("Plugin version: %s","seo-local-rank"),k)})]})]})}function sc({page:t}){const i="seolocalrank-settings"===t,r="seolocalrank-rank-tracker"===t,[a,c]=(0,e.useState)(!0),[d,p]=(0,e.useState)(null),[m,g]=(0,e.useState)(null),[b,f]=(0,e.useState)(!1),v=(0,e.useCallback)(async()=>{c(!0);try{const t=await s()({path:o("/settings")});p(t)}catch{p({connected:!1}),g(null)}finally{c(!1)}},[]),w=(0,e.useCallback)(async()=>{f(!0);try{const t=await s()({path:o("/domains")});g(t)}catch{g({ok:!1,domains:[],project_domain_id:0,needs_selection:!1})}finally{f(!1)}},[]);if((0,e.useEffect)(()=>{v()},[v]),(0,e.useEffect)(()=>{d?.connected?w():g(null)},[d?.connected,w]),a||d?.connected&&b&&!m)return(0,l.jsx)("div",{className:"slr-app slr-app--loading",children:(0,l.jsx)(n.Spinner,{})});if(!d?.connected)return(0,l.jsx)("div",{className:"slr-app",children:(0,l.jsx)(vr,{settings:d,onConnected:v})});if(m?.needs_selection&&m?.domains?.length>1)return(0,l.jsx)("div",{className:"slr-app",children:(0,l.jsx)(h,{domains:m.domains,onSelected:w})});if(!i&&0===(m?.domains||[]).length)return(0,l.jsx)("div",{className:"slr-app",children:(0,l.jsx)(u,{settings:d,domainsPayload:m,onCreated:w})});const y=(_=m?.domains||[],(x=m?.project_domain_id||d?.project_domain_id||0)&&Array.isArray(_)&&_.find(t=>(t.project_domain_id||t.id)===x)||null);var _,x;return(0,l.jsx)("div",{className:"slr-app",children:i?(0,l.jsx)(ic,{settings:d,domainsPayload:m,selectedProject:y,onDisconnect:v,onProjectChange:w}):r?(0,l.jsx)(ec,{domainsPayload:m,selectedProject:y,onProjectChange:w}):(0,l.jsx)(mr,{domainsPayload:m,selectedProject:y,onProjectChange:w})})}const nc=document.getElementById("slr-admin-root");if(nc){const t=(0,l.jsx)(e.StrictMode,{children:(0,l.jsx)(sc,{page:nc.dataset.page||"seolocalrank"})});e.createRoot?(0,e.createRoot)(nc).render(t):(0,e.render)(t,nc)}})();
     1(()=>{"use strict";const e={n:t=>{const i=t&&t.__esModule?()=>t.default:()=>t;return e.d(i,{a:i}),i},d:(t,i)=>{if(Array.isArray(i))for(var s=0;s<i.length;){var n=i[s++],o=i[s++];e.o(t,n)?0===o&&s++:0===o?Object.defineProperty(t,n,{enumerable:!0,value:i[s++]}):Object.defineProperty(t,n,{enumerable:!0,get:o})}else for(var n in i)e.o(i,n)&&!e.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:i[n]})},o:(e,t)=>Object.hasOwn(e,t)},t=window.wp.element,i=window.wp.apiFetch;var s=e.n(i);const n=window.wp.components,o=e=>`/seo-local-rank/v1${e.startsWith("/")?e:`/${e}`}`;function a(e){if(!e||"string"!=typeof e)return"";const t=e.trim();return t?/^https?:\/\//i.test(t)?t:t.startsWith("//")?`https:${t}`:`${(window.slrAdmin?.appOrigin||"https://app.trueranker.com").replace(/\/$/,"")}${t.startsWith("/")?t:`/${t}`}`:""}const r=window.wp.i18n,l=window.ReactJSXRuntime;function h({domains:e,onSelected:i}){const a=e.length>0?String(c(e[0])):"",[h,d]=(0,t.useState)(a),[u,p]=(0,t.useState)(!1),[m,g]=(0,t.useState)(null),b=e.map(e=>{const t=c(e),i=e.project_name||e.name||`#${t}`,s=e.name_displayed||e.name||"",n=Number(e.num_keywords),o=Number.isFinite(n)?n:0;return{label:(0,r.sprintf)(/* translators: 1: project name, 2: hostname, 3: keyword count */ /* translators: 1: project name, 2: hostname, 3: keyword count */
     2(0,r._n)("%1$s (%2$s) — %3$d keyword","%1$s (%2$s) — %3$d keywords",o,"seo-local-rank"),i,s,o),value:String(t)}});return(0,l.jsxs)(n.Modal,{title:(0,r.__)("Choose a project","seo-local-rank"),onRequestClose:()=>{},shouldCloseOnClickOutside:!1,shouldCloseOnEsc:!1,className:"slr-project-modal",children:[(0,l.jsx)("p",{className:"slr-project-modal__lead",children:(0,r.__)("There are several projects for this domain. Choose which one to use in WordPress.","seo-local-rank")}),(0,l.jsx)("p",{className:"slr-project-modal__hint",children:(0,r.__)("You can change it at any time from Settings.","seo-local-rank")}),(0,l.jsx)(n.RadioControl,{selected:h,options:b,onChange:d}),m&&(0,l.jsx)("p",{className:"slr-project-modal__error",children:m}),(0,l.jsx)("div",{className:"slr-project-modal__actions",children:(0,l.jsx)(n.Button,{variant:"primary",onClick:async()=>{const e=parseInt(h,10);if(e){p(!0),g(null);try{await s()({path:o(`/domains/${e}/select`),method:"POST"}),i()}catch(e){g(e?.message||(0,r.__)("Could not save the selection.","seo-local-rank"))}finally{p(!1)}}},isBusy:u,disabled:u||!h,children:(0,r.__)("Use this project","seo-local-rank")})})]})}function c(e){return e.project_domain_id||e.id||0}const d="top20 every day";function u({settings:e,domainsPayload:i,onCreated:a}){const[h,c]=(0,t.useState)("string"==typeof e?.site_name?e.site_name:""),[u,p]=(0,t.useState)(""),[m,g]=(0,t.useState)(d),[b,f]=(0,t.useState)([]),[v,w]=(0,t.useState)(!0),[_,y]=(0,t.useState)(!1),[x,C]=(0,t.useState)(null),k=function(e,t){if("string"==typeof t?.domain&&t.domain)return t.domain;const i="string"==typeof e?.site_url?e.site_url:"";try{return new URL(i).hostname||i}catch{return i}}(e,i),E=[{value:d,label:(0,r.__)("TOP 20 every day","seo-local-rank"),description:(0,r.__)("We will monitor the TOP 20 of your keywords in Google every day.","seo-local-rank")},{value:"top50 every 3 days",label:(0,r.__)("TOP 50 every 3 days","seo-local-rank"),description:(0,r.__)("We will monitor the TOP 50 of your keywords in Google every 3 days.","seo-local-rank")},{value:"top100 every 7 days",label:(0,r.__)("TOP 100 every 7 days","seo-local-rank"),description:(0,r.__)("We will monitor the TOP 100 of your keywords in Google every 7 days.","seo-local-rank")}];(0,t.useEffect)(()=>{let e=!1;return(async()=>{w(!0);try{const t=await s()({path:o("/domains/countries")}),i=Array.isArray(t?.data)?t.data:[];e||f(i)}catch(t){e||(f([]),C({status:"error",message:t?.message||(0,r.__)("Could not load countries.","seo-local-rank")}))}finally{e||w(!1)}})(),()=>{e=!0}},[]);const R=[{label:(0,r.__)("Choose a country","seo-local-rank"),value:""},...b.map(e=>({label:e.name||`#${e.id}`,value:String(e.id)}))];return(0,l.jsx)("div",{className:"slr-onboarding slr-create-project",children:(0,l.jsxs)("div",{className:"slr-panel slr-onboarding__panel",children:[x&&(0,l.jsx)(n.Notice,{status:x.status,isDismissible:!0,onRemove:()=>C(null),children:x.message}),(0,l.jsx)("h2",{className:"slr-create-project__title",children:(0,r.__)("Create your project","seo-local-rank")}),(0,l.jsx)("p",{className:"slr-create-project__lead",children:(0,r.__)("There is no TrueRanker project for this site. Fill in the brand, country and tracking frequency to get started.","seo-local-rank")}),v?(0,l.jsx)("div",{className:"slr-onboarding__loader",children:(0,l.jsx)(n.Spinner,{})}):(0,l.jsxs)("div",{className:"slr-create-project__fields",children:[(0,l.jsx)(n.TextControl,{className:"slr-create-project__domain",label:(0,r.__)("Domain","seo-local-rank"),help:(0,r.__)("Taken from this WordPress site and cannot be changed.","seo-local-rank"),value:k,onChange:()=>{},disabled:!0,readOnly:!0,__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0}),(0,l.jsx)(n.TextControl,{label:(0,r.__)("Brand","seo-local-rank"),help:(0,r.__)("Enter your brand to monitor its appearances in AI-generated answers.","seo-local-rank"),value:h,onChange:c,disabled:_,__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0}),(0,l.jsx)(n.SelectControl,{label:(0,r.__)("Country","seo-local-rank"),help:(0,r.__)("Choose the country where you want to measure visibility. Later, for each keyword, you can pick any location (even in another country).","seo-local-rank"),value:u,options:R,onChange:p,disabled:_,__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0}),(0,l.jsxs)("fieldset",{className:"slr-create-project__tracking",disabled:_,children:[(0,l.jsx)("legend",{className:"slr-create-project__label",children:(0,r.__)("Tracking","seo-local-rank")}),(0,l.jsx)("p",{className:"slr-create-project__hint",children:(0,r.__)("Choose the tracking options you want to apply to your project.","seo-local-rank")}),(0,l.jsx)("div",{className:"slr-tracking-options",role:"radiogroup","aria-label":(0,r.__)("Tracking options","seo-local-rank"),children:E.map(e=>{const t=m===e.value;return(0,l.jsxs)("button",{type:"button",role:"radio","aria-checked":t,className:t?"slr-tracking-option is-selected":"slr-tracking-option",disabled:_,onClick:()=>g(e.value),children:[(0,l.jsxs)("span",{className:"slr-tracking-option__text",children:[(0,l.jsx)("span",{className:"slr-tracking-option__title",children:e.label}),(0,l.jsx)("span",{className:"slr-tracking-option__desc",children:e.description})]}),(0,l.jsx)("span",{className:"slr-tracking-option__check","aria-hidden":"true"})]},e.value)})})]}),(0,l.jsx)("div",{className:"slr-onboarding__actions slr-create-project__actions",children:(0,l.jsx)(n.Button,{variant:"primary",onClick:async()=>{if(h.trim())if(u){y(!0),C(null);try{await s()({path:o("/domains/create"),method:"POST",data:{brand_name:h.trim(),country_id:parseInt(u,10),tracking_options:m}}),a()}catch(e){C({status:"error",message:e?.message||(0,r.__)("Could not create the project.","seo-local-rank")})}finally{y(!1)}}else C({status:"error",message:(0,r.__)("Choose a country.","seo-local-rank")});else C({status:"error",message:(0,r.__)("Enter the brand name.","seo-local-rank")})},isBusy:_,disabled:_||0===b.length,children:(0,r.__)("Create project","seo-local-rank")})})]})]})})}const p=window.React;function m(e){return e+.5|0}const g=(e,t,i)=>Math.max(Math.min(e,i),t);function b(e){return g(m(2.55*e),0,255)}function f(e){return g(m(255*e),0,255)}function v(e){return g(m(e/2.55)/100,0,1)}function w(e){return g(m(100*e),0,100)}const _={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,A:10,B:11,C:12,D:13,E:14,F:15,a:10,b:11,c:12,d:13,e:14,f:15},y=[..."0123456789ABCDEF"],x=e=>y[15&e],C=e=>y[(240&e)>>4]+y[15&e],k=e=>(240&e)>>4==(15&e);const E=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function R(e,t,i){const s=t*Math.min(i,1-i),n=(t,n=(t+e/30)%12)=>i-s*Math.max(Math.min(n-3,9-n,1),-1);return[n(0),n(8),n(4)]}function M(e,t,i){const s=(s,n=(s+e/60)%6)=>i-i*t*Math.max(Math.min(n,4-n,1),0);return[s(5),s(3),s(1)]}function T(e,t,i){const s=R(e,1,.5);let n;for(t+i>1&&(n=1/(t+i),t*=n,i*=n),n=0;n<3;n++)s[n]*=1-t-i,s[n]+=t;return s}function S(e){const t=e.r/255,i=e.g/255,s=e.b/255,n=Math.max(t,i,s),o=Math.min(t,i,s),a=(n+o)/2;let r,l,h;return n!==o&&(h=n-o,l=a>.5?h/(2-n-o):h/(n+o),r=function(e,t,i,s,n){return e===n?(t-i)/s+(t<i?6:0):t===n?(i-e)/s+2:(e-t)/s+4}(t,i,s,h,n),r=60*r+.5),[0|r,l||0,a]}function D(e,t,i,s){return(Array.isArray(t)?e(t[0],t[1],t[2]):e(t,i,s)).map(f)}function j(e,t,i){return D(R,e,t,i)}function N(e){return(e%360+360)%360}const L={x:"dark",Z:"light",Y:"re",X:"blu",W:"gr",V:"medium",U:"slate",A:"ee",T:"ol",S:"or",B:"ra",C:"lateg",D:"ights",R:"in",Q:"turquois",E:"hi",P:"ro",O:"al",N:"le",M:"de",L:"yello",F:"en",K:"ch",G:"arks",H:"ea",I:"ightg",J:"wh"},P={OiceXe:"f0f8ff",antiquewEte:"faebd7",aqua:"ffff",aquamarRe:"7fffd4",azuY:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"0",blanKedOmond:"ffebcd",Xe:"ff",XeviTet:"8a2be2",bPwn:"a52a2a",burlywood:"deb887",caMtXe:"5f9ea0",KartYuse:"7fff00",KocTate:"d2691e",cSO:"ff7f50",cSnflowerXe:"6495ed",cSnsilk:"fff8dc",crimson:"dc143c",cyan:"ffff",xXe:"8b",xcyan:"8b8b",xgTMnPd:"b8860b",xWay:"a9a9a9",xgYF:"6400",xgYy:"a9a9a9",xkhaki:"bdb76b",xmagFta:"8b008b",xTivegYF:"556b2f",xSange:"ff8c00",xScEd:"9932cc",xYd:"8b0000",xsOmon:"e9967a",xsHgYF:"8fbc8f",xUXe:"483d8b",xUWay:"2f4f4f",xUgYy:"2f4f4f",xQe:"ced1",xviTet:"9400d3",dAppRk:"ff1493",dApskyXe:"bfff",dimWay:"696969",dimgYy:"696969",dodgerXe:"1e90ff",fiYbrick:"b22222",flSOwEte:"fffaf0",foYstWAn:"228b22",fuKsia:"ff00ff",gaRsbSo:"dcdcdc",ghostwEte:"f8f8ff",gTd:"ffd700",gTMnPd:"daa520",Way:"808080",gYF:"8000",gYFLw:"adff2f",gYy:"808080",honeyMw:"f0fff0",hotpRk:"ff69b4",RdianYd:"cd5c5c",Rdigo:"4b0082",ivSy:"fffff0",khaki:"f0e68c",lavFMr:"e6e6fa",lavFMrXsh:"fff0f5",lawngYF:"7cfc00",NmoncEffon:"fffacd",ZXe:"add8e6",ZcSO:"f08080",Zcyan:"e0ffff",ZgTMnPdLw:"fafad2",ZWay:"d3d3d3",ZgYF:"90ee90",ZgYy:"d3d3d3",ZpRk:"ffb6c1",ZsOmon:"ffa07a",ZsHgYF:"20b2aa",ZskyXe:"87cefa",ZUWay:"778899",ZUgYy:"778899",ZstAlXe:"b0c4de",ZLw:"ffffe0",lime:"ff00",limegYF:"32cd32",lRF:"faf0e6",magFta:"ff00ff",maPon:"800000",VaquamarRe:"66cdaa",VXe:"cd",VScEd:"ba55d3",VpurpN:"9370db",VsHgYF:"3cb371",VUXe:"7b68ee",VsprRggYF:"fa9a",VQe:"48d1cc",VviTetYd:"c71585",midnightXe:"191970",mRtcYam:"f5fffa",mistyPse:"ffe4e1",moccasR:"ffe4b5",navajowEte:"ffdead",navy:"80",Tdlace:"fdf5e6",Tive:"808000",TivedBb:"6b8e23",Sange:"ffa500",SangeYd:"ff4500",ScEd:"da70d6",pOegTMnPd:"eee8aa",pOegYF:"98fb98",pOeQe:"afeeee",pOeviTetYd:"db7093",papayawEp:"ffefd5",pHKpuff:"ffdab9",peru:"cd853f",pRk:"ffc0cb",plum:"dda0dd",powMrXe:"b0e0e6",purpN:"800080",YbeccapurpN:"663399",Yd:"ff0000",Psybrown:"bc8f8f",PyOXe:"4169e1",saddNbPwn:"8b4513",sOmon:"fa8072",sandybPwn:"f4a460",sHgYF:"2e8b57",sHshell:"fff5ee",siFna:"a0522d",silver:"c0c0c0",skyXe:"87ceeb",UXe:"6a5acd",UWay:"708090",UgYy:"708090",snow:"fffafa",sprRggYF:"ff7f",stAlXe:"4682b4",tan:"d2b48c",teO:"8080",tEstN:"d8bfd8",tomato:"ff6347",Qe:"40e0d0",viTet:"ee82ee",JHt:"f5deb3",wEte:"ffffff",wEtesmoke:"f5f5f5",Lw:"ffff00",LwgYF:"9acd32"};let A;const z=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/,F=e=>e<=.0031308?12.92*e:1.055*Math.pow(e,1/2.4)-.055,O=e=>e<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4);function H(e,t,i){if(e){let s=S(e);s[t]=Math.max(0,Math.min(s[t]+s[t]*i,0===t?360:1)),s=j(s),e.r=s[0],e.g=s[1],e.b=s[2]}}function I(e,t){return e?Object.assign(t||{},e):e}function B(e){var t={r:0,g:0,b:0,a:255};return Array.isArray(e)?e.length>=3&&(t={r:e[0],g:e[1],b:e[2],a:255},e.length>3&&(t.a=f(e[3]))):(t=I(e,{r:0,g:0,b:0,a:1})).a=f(t.a),t}function V(e){return"r"===e.charAt(0)?function(e){const t=z.exec(e);let i,s,n,o=255;if(t){if(t[7]!==i){const e=+t[7];o=t[8]?b(e):g(255*e,0,255)}return i=+t[1],s=+t[3],n=+t[5],i=255&(t[2]?b(i):g(i,0,255)),s=255&(t[4]?b(s):g(s,0,255)),n=255&(t[6]?b(n):g(n,0,255)),{r:i,g:s,b:n,a:o}}}(e):function(e){const t=E.exec(e);let i,s=255;if(!t)return;t[5]!==i&&(s=t[6]?b(+t[5]):f(+t[5]));const n=N(+t[2]),o=+t[3]/100,a=+t[4]/100;return i="hwb"===t[1]?function(e,t,i){return D(T,e,t,i)}(n,o,a):"hsv"===t[1]?function(e,t,i){return D(M,e,t,i)}(n,o,a):j(n,o,a),{r:i[0],g:i[1],b:i[2],a:s}}(e)}class W{constructor(e){if(e instanceof W)return e;const t=typeof e;let i;var s,n,o;"object"===t?i=B(e):"string"===t&&(o=(s=e).length,"#"===s[0]&&(4===o||5===o?n={r:255&17*_[s[1]],g:255&17*_[s[2]],b:255&17*_[s[3]],a:5===o?17*_[s[4]]:255}:7!==o&&9!==o||(n={r:_[s[1]]<<4|_[s[2]],g:_[s[3]]<<4|_[s[4]],b:_[s[5]]<<4|_[s[6]],a:9===o?_[s[7]]<<4|_[s[8]]:255})),i=n||function(e){A||(A=function(){const e={},t=Object.keys(P),i=Object.keys(L);let s,n,o,a,r;for(s=0;s<t.length;s++){for(a=r=t[s],n=0;n<i.length;n++)o=i[n],r=r.replace(o,L[o]);o=parseInt(P[a],16),e[r]=[o>>16&255,o>>8&255,255&o]}return e}(),A.transparent=[0,0,0,0]);const t=A[e.toLowerCase()];return t&&{r:t[0],g:t[1],b:t[2],a:4===t.length?t[3]:255}}(e)||V(e)),this._rgb=i,this._valid=!!i}get valid(){return this._valid}get rgb(){var e=I(this._rgb);return e&&(e.a=v(e.a)),e}set rgb(e){this._rgb=B(e)}rgbString(){return this._valid?(e=this._rgb)&&(e.a<255?`rgba(${e.r}, ${e.g}, ${e.b}, ${v(e.a)})`:`rgb(${e.r}, ${e.g}, ${e.b})`):void 0;var e}hexString(){return this._valid?(e=this._rgb,t=(e=>k(e.r)&&k(e.g)&&k(e.b)&&k(e.a))(e)?x:C,e?"#"+t(e.r)+t(e.g)+t(e.b)+((e,t)=>e<255?t(e):"")(e.a,t):void 0):void 0;var e,t}hslString(){return this._valid?function(e){if(!e)return;const t=S(e),i=t[0],s=w(t[1]),n=w(t[2]);return e.a<255?`hsla(${i}, ${s}%, ${n}%, ${v(e.a)})`:`hsl(${i}, ${s}%, ${n}%)`}(this._rgb):void 0}mix(e,t){if(e){const i=this.rgb,s=e.rgb;let n;const o=t===n?.5:t,a=2*o-1,r=i.a-s.a,l=((a*r===-1?a:(a+r)/(1+a*r))+1)/2;n=1-l,i.r=255&l*i.r+n*s.r+.5,i.g=255&l*i.g+n*s.g+.5,i.b=255&l*i.b+n*s.b+.5,i.a=o*i.a+(1-o)*s.a,this.rgb=i}return this}interpolate(e,t){return e&&(this._rgb=function(e,t,i){const s=O(v(e.r)),n=O(v(e.g)),o=O(v(e.b));return{r:f(F(s+i*(O(v(t.r))-s))),g:f(F(n+i*(O(v(t.g))-n))),b:f(F(o+i*(O(v(t.b))-o))),a:e.a+i*(t.a-e.a)}}(this._rgb,e._rgb,t)),this}clone(){return new W(this.rgb)}alpha(e){return this._rgb.a=f(e),this}clearer(e){return this._rgb.a*=1-e,this}greyscale(){const e=this._rgb,t=m(.3*e.r+.59*e.g+.11*e.b);return e.r=e.g=e.b=t,this}opaquer(e){return this._rgb.a*=1+e,this}negate(){const e=this._rgb;return e.r=255-e.r,e.g=255-e.g,e.b=255-e.b,this}lighten(e){return H(this._rgb,2,e),this}darken(e){return H(this._rgb,2,-e),this}saturate(e){return H(this._rgb,1,e),this}desaturate(e){return H(this._rgb,1,-e),this}rotate(e){return function(e,t){var i=S(e);i[0]=N(i[0]+t),i=j(i),e.r=i[0],e.g=i[1],e.b=i[2]}(this._rgb,e),this}}function G(){}const U=(()=>{let e=0;return()=>e++})();function $(e){return null==e}function Y(e){if(Array.isArray&&Array.isArray(e))return!0;const t=Object.prototype.toString.call(e);return"[object"===t.slice(0,7)&&"Array]"===t.slice(-6)}function K(e){return null!==e&&"[object Object]"===Object.prototype.toString.call(e)}function X(e){return("number"==typeof e||e instanceof Number)&&isFinite(+e)}function q(e,t){return X(e)?e:t}function J(e,t){return void 0===e?t:e}const Z=(e,t)=>"string"==typeof e&&e.endsWith("%")?parseFloat(e)/100*t:+e;function Q(e,t,i){if(e&&"function"==typeof e.call)return e.apply(i,t)}function ee(e,t,i,s){let n,o,a;if(Y(e))if(o=e.length,s)for(n=o-1;n>=0;n--)t.call(i,e[n],n);else for(n=0;n<o;n++)t.call(i,e[n],n);else if(K(e))for(a=Object.keys(e),o=a.length,n=0;n<o;n++)t.call(i,e[a[n]],a[n])}function te(e,t){let i,s,n,o;if(!e||!t||e.length!==t.length)return!1;for(i=0,s=e.length;i<s;++i)if(n=e[i],o=t[i],n.datasetIndex!==o.datasetIndex||n.index!==o.index)return!1;return!0}function ie(e){if(Y(e))return e.map(ie);if(K(e)){const t=Object.create(null),i=Object.keys(e),s=i.length;let n=0;for(;n<s;++n)t[i[n]]=ie(e[i[n]]);return t}return e}function se(e){return-1===["__proto__","prototype","constructor"].indexOf(e)}function ne(e,t,i,s){if(!se(e))return;const n=t[e],o=i[e];K(n)&&K(o)?oe(n,o,s):t[e]=ie(o)}function oe(e,t,i){const s=Y(t)?t:[t],n=s.length;if(!K(e))return e;const o=(i=i||{}).merger||ne;let a;for(let t=0;t<n;++t){if(a=s[t],!K(a))continue;const n=Object.keys(a);for(let t=0,s=n.length;t<s;++t)o(n[t],e,a,i)}return e}function ae(e,t){return oe(e,t,{merger:re})}function re(e,t,i){if(!se(e))return;const s=t[e],n=i[e];K(s)&&K(n)?ae(s,n):Object.prototype.hasOwnProperty.call(t,e)||(t[e]=ie(n))}const le={"":e=>e,x:e=>e.x,y:e=>e.y};function he(e,t){const i=le[t]||(le[t]=function(e){const t=function(e){const t=e.split("."),i=[];let s="";for(const e of t)s+=e,s.endsWith("\\")?s=s.slice(0,-1)+".":(i.push(s),s="");return i}(e);return e=>{for(const i of t){if(""===i)break;e=e&&e[i]}return e}}(t));return i(e)}function ce(e){return e.charAt(0).toUpperCase()+e.slice(1)}const de=e=>void 0!==e,ue=e=>"function"==typeof e,pe=(e,t)=>{if(e.size!==t.size)return!1;for(const i of e)if(!t.has(i))return!1;return!0},me=Math.PI,ge=2*me,be=ge+me,fe=Number.POSITIVE_INFINITY,ve=me/180,we=me/2,_e=me/4,ye=2*me/3,xe=Math.log10,Ce=Math.sign;function ke(e,t,i){return Math.abs(e-t)<i}function Ee(e){const t=Math.round(e);e=ke(e,t,e/1e3)?t:e;const i=Math.pow(10,Math.floor(xe(e))),s=e/i;return(s<=1?1:s<=2?2:s<=5?5:10)*i}function Re(e){return!function(e){return"symbol"==typeof e||"object"==typeof e&&null!==e&&!(Symbol.toPrimitive in e||"toString"in e||"valueOf"in e)}(e)&&!isNaN(parseFloat(e))&&isFinite(e)}function Me(e){return e*(me/180)}function Te(e){if(!X(e))return;let t=1,i=0;for(;Math.round(e*t)/t!==e;)t*=10,i++;return i}function Se(e,t){const i=t.x-e.x,s=t.y-e.y,n=Math.sqrt(i*i+s*s);let o=Math.atan2(s,i);return o<-.5*me&&(o+=ge),{angle:o,distance:n}}function De(e,t){return Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))}function je(e,t){return(e-t+be)%ge-me}function Ne(e){return(e%ge+ge)%ge}function Le(e,t,i,s){const n=Ne(e),o=Ne(t),a=Ne(i),r=Ne(o-n),l=Ne(a-n),h=Ne(n-o),c=Ne(n-a);return n===o||n===a||s&&o===a||r>l&&h<c}function Pe(e,t,i){return Math.max(t,Math.min(i,e))}function Ae(e,t,i,s=1e-6){return e>=Math.min(t,i)-s&&e<=Math.max(t,i)+s}function ze(e,t,i){i=i||(i=>e[i]<t);let s,n=e.length-1,o=0;for(;n-o>1;)s=o+n>>1,i(s)?o=s:n=s;return{lo:o,hi:n}}const Fe=(e,t,i,s)=>ze(e,i,s?s=>{const n=e[s][t];return n<i||n===i&&e[s+1][t]===i}:s=>e[s][t]<i),Oe=(e,t,i)=>ze(e,i,s=>e[s][t]>=i),He=["push","pop","shift","splice","unshift"];function Ie(e,t){const i=e._chartjs;if(!i)return;const s=i.listeners,n=s.indexOf(t);-1!==n&&s.splice(n,1),s.length>0||(He.forEach(t=>{delete e[t]}),delete e._chartjs)}const Be="undefined"==typeof window?function(e){return e()}:window.requestAnimationFrame;function Ve(e,t){let i=[],s=!1;return function(...n){i=n,s||(s=!0,Be.call(window,()=>{s=!1,e.apply(t,i)}))}}const We=e=>"start"===e?"left":"end"===e?"right":"center",Ge=(e,t,i)=>"start"===e?t:"end"===e?i:(t+i)/2,Ue=e=>0===e||1===e,$e=(e,t,i)=>-Math.pow(2,10*(e-=1))*Math.sin((e-t)*ge/i),Ye=(e,t,i)=>Math.pow(2,-10*e)*Math.sin((e-t)*ge/i)+1,Ke={linear:e=>e,easeInQuad:e=>e*e,easeOutQuad:e=>-e*(e-2),easeInOutQuad:e=>(e/=.5)<1?.5*e*e:-.5*(--e*(e-2)-1),easeInCubic:e=>e*e*e,easeOutCubic:e=>(e-=1)*e*e+1,easeInOutCubic:e=>(e/=.5)<1?.5*e*e*e:.5*((e-=2)*e*e+2),easeInQuart:e=>e*e*e*e,easeOutQuart:e=>-((e-=1)*e*e*e-1),easeInOutQuart:e=>(e/=.5)<1?.5*e*e*e*e:-.5*((e-=2)*e*e*e-2),easeInQuint:e=>e*e*e*e*e,easeOutQuint:e=>(e-=1)*e*e*e*e+1,easeInOutQuint:e=>(e/=.5)<1?.5*e*e*e*e*e:.5*((e-=2)*e*e*e*e+2),easeInSine:e=>1-Math.cos(e*we),easeOutSine:e=>Math.sin(e*we),easeInOutSine:e=>-.5*(Math.cos(me*e)-1),easeInExpo:e=>0===e?0:Math.pow(2,10*(e-1)),easeOutExpo:e=>1===e?1:1-Math.pow(2,-10*e),easeInOutExpo:e=>Ue(e)?e:e<.5?.5*Math.pow(2,10*(2*e-1)):.5*(2-Math.pow(2,-10*(2*e-1))),easeInCirc:e=>e>=1?e:-(Math.sqrt(1-e*e)-1),easeOutCirc:e=>Math.sqrt(1-(e-=1)*e),easeInOutCirc:e=>(e/=.5)<1?-.5*(Math.sqrt(1-e*e)-1):.5*(Math.sqrt(1-(e-=2)*e)+1),easeInElastic:e=>Ue(e)?e:$e(e,.075,.3),easeOutElastic:e=>Ue(e)?e:Ye(e,.075,.3),easeInOutElastic(e){const t=.1125;return Ue(e)?e:e<.5?.5*$e(2*e,t,.45):.5+.5*Ye(2*e-1,t,.45)},easeInBack(e){const t=1.70158;return e*e*((t+1)*e-t)},easeOutBack(e){const t=1.70158;return(e-=1)*e*((t+1)*e+t)+1},easeInOutBack(e){let t=1.70158;return(e/=.5)<1?e*e*((1+(t*=1.525))*e-t)*.5:.5*((e-=2)*e*((1+(t*=1.525))*e+t)+2)},easeInBounce:e=>1-Ke.easeOutBounce(1-e),easeOutBounce(e){const t=7.5625,i=2.75;return e<1/i?t*e*e:e<2/i?t*(e-=1.5/i)*e+.75:e<2.5/i?t*(e-=2.25/i)*e+.9375:t*(e-=2.625/i)*e+.984375},easeInOutBounce:e=>e<.5?.5*Ke.easeInBounce(2*e):.5*Ke.easeOutBounce(2*e-1)+.5};function Xe(e){if(e&&"object"==typeof e){const t=e.toString();return"[object CanvasPattern]"===t||"[object CanvasGradient]"===t}return!1}function qe(e){return Xe(e)?e:new W(e)}function Je(e){return Xe(e)?e:new W(e).saturate(.5).darken(.1).hexString()}const Ze=["x","y","borderWidth","radius","tension"],Qe=["color","borderColor","backgroundColor"],et=new Map;function tt(e,t,i){return function(e,t){t=t||{};const i=e+JSON.stringify(t);let s=et.get(i);return s||(s=new Intl.NumberFormat(e,t),et.set(i,s)),s}(t,i).format(e)}const it={values:e=>Y(e)?e:""+e,numeric(e,t,i){if(0===e)return"0";const s=this.chart.options.locale;let n,o=e;if(i.length>1){const t=Math.max(Math.abs(i[0].value),Math.abs(i[i.length-1].value));(t<1e-4||t>1e15)&&(n="scientific"),o=function(e,t){let i=t.length>3?t[2].value-t[1].value:t[1].value-t[0].value;return Math.abs(i)>=1&&e!==Math.floor(e)&&(i=e-Math.floor(e)),i}(e,i)}const a=xe(Math.abs(o)),r=isNaN(a)?1:Math.max(Math.min(-1*Math.floor(a),20),0),l={notation:n,minimumFractionDigits:r,maximumFractionDigits:r};return Object.assign(l,this.options.ticks.format),tt(e,s,l)},logarithmic(e,t,i){if(0===e)return"0";const s=i[t].significand||e/Math.pow(10,Math.floor(xe(e)));return[1,2,3,5,10,15].includes(s)||t>.8*i.length?it.numeric.call(this,e,t,i):""}};var st={formatters:it};const nt=Object.create(null),ot=Object.create(null);function at(e,t){if(!t)return e;const i=t.split(".");for(let t=0,s=i.length;t<s;++t){const s=i[t];e=e[s]||(e[s]=Object.create(null))}return e}function rt(e,t,i){return"string"==typeof t?oe(at(e,t),i):oe(at(e,""),t)}class lt{constructor(e,t){this.animation=void 0,this.backgroundColor="rgba(0,0,0,0.1)",this.borderColor="rgba(0,0,0,0.1)",this.color="#666",this.datasets={},this.devicePixelRatio=e=>e.chart.platform.getDevicePixelRatio(),this.elements={},this.events=["mousemove","mouseout","click","touchstart","touchmove"],this.font={family:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",size:12,style:"normal",lineHeight:1.2,weight:null},this.hover={},this.hoverBackgroundColor=(e,t)=>Je(t.backgroundColor),this.hoverBorderColor=(e,t)=>Je(t.borderColor),this.hoverColor=(e,t)=>Je(t.color),this.indexAxis="x",this.interaction={mode:"nearest",intersect:!0,includeInvisible:!1},this.maintainAspectRatio=!0,this.onHover=null,this.onClick=null,this.parsing=!0,this.plugins={},this.responsive=!0,this.scale=void 0,this.scales={},this.showLine=!0,this.drawActiveElementsOnTop=!0,this.describe(e),this.apply(t)}set(e,t){return rt(this,e,t)}get(e){return at(this,e)}describe(e,t){return rt(ot,e,t)}override(e,t){return rt(nt,e,t)}route(e,t,i,s){const n=at(this,e),o=at(this,i),a="_"+t;Object.defineProperties(n,{[a]:{value:n[t],writable:!0},[t]:{enumerable:!0,get(){const e=this[a],t=o[s];return K(e)?Object.assign({},t,e):J(e,t)},set(e){this[a]=e}}})}apply(e){e.forEach(e=>e(this))}}var ht=new lt({_scriptable:e=>!e.startsWith("on"),_indexable:e=>"events"!==e,hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[function(e){e.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0}),e.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:e=>"onProgress"!==e&&"onComplete"!==e&&"fn"!==e}),e.set("animations",{colors:{type:"color",properties:Qe},numbers:{type:"number",properties:Ze}}),e.describe("animations",{_fallback:"animation"}),e.set("transitions",{active:{animation:{duration:400}},resize:{animation:{duration:0}},show:{animations:{colors:{from:"transparent"},visible:{type:"boolean",duration:0}}},hide:{animations:{colors:{to:"transparent"},visible:{type:"boolean",easing:"linear",fn:e=>0|e}}}})},function(e){e.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})},function(e){e.set("scale",{display:!0,offset:!1,reverse:!1,beginAtZero:!1,bounds:"ticks",clip:!0,grace:0,grid:{display:!0,lineWidth:1,drawOnChartArea:!0,drawTicks:!0,tickLength:8,tickWidth:(e,t)=>t.lineWidth,tickColor:(e,t)=>t.color,offset:!1},border:{display:!0,dash:[],dashOffset:0,width:1},title:{display:!1,text:"",padding:{top:4,bottom:4}},ticks:{minRotation:0,maxRotation:50,mirror:!1,textStrokeWidth:0,textStrokeColor:"",padding:3,display:!0,autoSkip:!0,autoSkipPadding:3,labelOffset:0,callback:st.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),e.route("scale.ticks","color","","color"),e.route("scale.grid","color","","borderColor"),e.route("scale.border","color","","borderColor"),e.route("scale.title","color","","color"),e.describe("scale",{_fallback:!1,_scriptable:e=>!e.startsWith("before")&&!e.startsWith("after")&&"callback"!==e&&"parser"!==e,_indexable:e=>"borderDash"!==e&&"tickBorderDash"!==e&&"dash"!==e}),e.describe("scales",{_fallback:"scale"}),e.describe("scale.ticks",{_scriptable:e=>"backdropPadding"!==e&&"callback"!==e,_indexable:e=>"backdropPadding"!==e})}]);function ct(e,t,i,s,n){let o=t[n];return o||(o=t[n]=e.measureText(n).width,i.push(n)),o>s&&(s=o),s}function dt(e,t,i){const s=e.currentDevicePixelRatio,n=0!==i?Math.max(i/2,.5):0;return Math.round((t-n)*s)/s+n}function ut(e,t){(t||e)&&((t=t||e.getContext("2d")).save(),t.resetTransform(),t.clearRect(0,0,e.width,e.height),t.restore())}function pt(e,t,i,s){mt(e,t,i,s,null)}function mt(e,t,i,s,n){let o,a,r,l,h,c,d,u;const p=t.pointStyle,m=t.rotation,g=t.radius;let b=(m||0)*ve;if(p&&"object"==typeof p&&(o=p.toString(),"[object HTMLImageElement]"===o||"[object HTMLCanvasElement]"===o))return e.save(),e.translate(i,s),e.rotate(b),e.drawImage(p,-p.width/2,-p.height/2,p.width,p.height),void e.restore();if(!(isNaN(g)||g<=0)){switch(e.beginPath(),p){default:n?e.ellipse(i,s,n/2,g,0,0,ge):e.arc(i,s,g,0,ge),e.closePath();break;case"triangle":c=n?n/2:g,e.moveTo(i+Math.sin(b)*c,s-Math.cos(b)*g),b+=ye,e.lineTo(i+Math.sin(b)*c,s-Math.cos(b)*g),b+=ye,e.lineTo(i+Math.sin(b)*c,s-Math.cos(b)*g),e.closePath();break;case"rectRounded":h=.516*g,l=g-h,a=Math.cos(b+_e)*l,d=Math.cos(b+_e)*(n?n/2-h:l),r=Math.sin(b+_e)*l,u=Math.sin(b+_e)*(n?n/2-h:l),e.arc(i-d,s-r,h,b-me,b-we),e.arc(i+u,s-a,h,b-we,b),e.arc(i+d,s+r,h,b,b+we),e.arc(i-u,s+a,h,b+we,b+me),e.closePath();break;case"rect":if(!m){l=Math.SQRT1_2*g,c=n?n/2:l,e.rect(i-c,s-l,2*c,2*l);break}b+=_e;case"rectRot":d=Math.cos(b)*(n?n/2:g),a=Math.cos(b)*g,r=Math.sin(b)*g,u=Math.sin(b)*(n?n/2:g),e.moveTo(i-d,s-r),e.lineTo(i+u,s-a),e.lineTo(i+d,s+r),e.lineTo(i-u,s+a),e.closePath();break;case"crossRot":b+=_e;case"cross":d=Math.cos(b)*(n?n/2:g),a=Math.cos(b)*g,r=Math.sin(b)*g,u=Math.sin(b)*(n?n/2:g),e.moveTo(i-d,s-r),e.lineTo(i+d,s+r),e.moveTo(i+u,s-a),e.lineTo(i-u,s+a);break;case"star":d=Math.cos(b)*(n?n/2:g),a=Math.cos(b)*g,r=Math.sin(b)*g,u=Math.sin(b)*(n?n/2:g),e.moveTo(i-d,s-r),e.lineTo(i+d,s+r),e.moveTo(i+u,s-a),e.lineTo(i-u,s+a),b+=_e,d=Math.cos(b)*(n?n/2:g),a=Math.cos(b)*g,r=Math.sin(b)*g,u=Math.sin(b)*(n?n/2:g),e.moveTo(i-d,s-r),e.lineTo(i+d,s+r),e.moveTo(i+u,s-a),e.lineTo(i-u,s+a);break;case"line":a=n?n/2:Math.cos(b)*g,r=Math.sin(b)*g,e.moveTo(i-a,s-r),e.lineTo(i+a,s+r);break;case"dash":e.moveTo(i,s),e.lineTo(i+Math.cos(b)*(n?n/2:g),s+Math.sin(b)*g);break;case!1:e.closePath()}e.fill(),t.borderWidth>0&&e.stroke()}}function gt(e,t,i){return i=i||.5,!t||e&&e.x>t.left-i&&e.x<t.right+i&&e.y>t.top-i&&e.y<t.bottom+i}function bt(e,t){e.save(),e.beginPath(),e.rect(t.left,t.top,t.right-t.left,t.bottom-t.top),e.clip()}function ft(e){e.restore()}function vt(e,t,i,s,n){if(!t)return e.lineTo(i.x,i.y);if("middle"===n){const s=(t.x+i.x)/2;e.lineTo(s,t.y),e.lineTo(s,i.y)}else"after"===n!=!!s?e.lineTo(t.x,i.y):e.lineTo(i.x,t.y);e.lineTo(i.x,i.y)}function wt(e,t,i,s){if(!t)return e.lineTo(i.x,i.y);e.bezierCurveTo(s?t.cp1x:t.cp2x,s?t.cp1y:t.cp2y,s?i.cp2x:i.cp1x,s?i.cp2y:i.cp1y,i.x,i.y)}function _t(e,t,i,s,n){if(n.strikethrough||n.underline){const o=e.measureText(s),a=t-o.actualBoundingBoxLeft,r=t+o.actualBoundingBoxRight,l=i-o.actualBoundingBoxAscent,h=i+o.actualBoundingBoxDescent,c=n.strikethrough?(l+h)/2:h;e.strokeStyle=e.fillStyle,e.beginPath(),e.lineWidth=n.decorationWidth||2,e.moveTo(a,c),e.lineTo(r,c),e.stroke()}}function yt(e,t){const i=e.fillStyle;e.fillStyle=t.color,e.fillRect(t.left,t.top,t.width,t.height),e.fillStyle=i}function xt(e,t,i,s,n,o={}){const a=Y(t)?t:[t],r=o.strokeWidth>0&&""!==o.strokeColor;let l,h;for(e.save(),e.font=n.string,function(e,t){t.translation&&e.translate(t.translation[0],t.translation[1]),$(t.rotation)||e.rotate(t.rotation),t.color&&(e.fillStyle=t.color),t.textAlign&&(e.textAlign=t.textAlign),t.textBaseline&&(e.textBaseline=t.textBaseline)}(e,o),l=0;l<a.length;++l)h=a[l],o.backdrop&&yt(e,o.backdrop),r&&(o.strokeColor&&(e.strokeStyle=o.strokeColor),$(o.strokeWidth)||(e.lineWidth=o.strokeWidth),e.strokeText(h,i,s,o.maxWidth)),e.fillText(h,i,s,o.maxWidth),_t(e,i,s,h,o),s+=Number(n.lineHeight);e.restore()}function Ct(e,t){const{x:i,y:s,w:n,h:o,radius:a}=t;e.arc(i+a.topLeft,s+a.topLeft,a.topLeft,1.5*me,me,!0),e.lineTo(i,s+o-a.bottomLeft),e.arc(i+a.bottomLeft,s+o-a.bottomLeft,a.bottomLeft,me,we,!0),e.lineTo(i+n-a.bottomRight,s+o),e.arc(i+n-a.bottomRight,s+o-a.bottomRight,a.bottomRight,we,0,!0),e.lineTo(i+n,s+a.topRight),e.arc(i+n-a.topRight,s+a.topRight,a.topRight,0,-we,!0),e.lineTo(i+a.topLeft,s)}const kt=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,Et=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;function Rt(e,t){const i=(""+e).match(kt);if(!i||"normal"===i[1])return 1.2*t;switch(e=+i[2],i[3]){case"px":return e;case"%":e/=100}return t*e}const Mt=e=>+e||0;function Tt(e,t){const i={},s=K(t),n=s?Object.keys(t):t,o=K(e)?s?i=>J(e[i],e[t[i]]):t=>e[t]:()=>e;for(const e of n)i[e]=Mt(o(e));return i}function St(e){return Tt(e,{top:"y",right:"x",bottom:"y",left:"x"})}function Dt(e){return Tt(e,["topLeft","topRight","bottomLeft","bottomRight"])}function jt(e){const t=St(e);return t.width=t.left+t.right,t.height=t.top+t.bottom,t}function Nt(e,t){e=e||{},t=t||ht.font;let i=J(e.size,t.size);"string"==typeof i&&(i=parseInt(i,10));let s=J(e.style,t.style);s&&!(""+s).match(Et)&&(console.warn('Invalid font style specified: "'+s+'"'),s=void 0);const n={family:J(e.family,t.family),lineHeight:Rt(J(e.lineHeight,t.lineHeight),i),size:i,style:s,weight:J(e.weight,t.weight),string:""};return n.string=function(e){return!e||$(e.size)||$(e.family)?null:(e.style?e.style+" ":"")+(e.weight?e.weight+" ":"")+e.size+"px "+e.family}(n),n}function Lt(e,t,i,s){let n,o,a,r=!0;for(n=0,o=e.length;n<o;++n)if(a=e[n],void 0!==a&&(void 0!==t&&"function"==typeof a&&(a=a(t),r=!1),void 0!==i&&Y(a)&&(a=a[i%a.length],r=!1),void 0!==a))return s&&!r&&(s.cacheable=!1),a}function Pt(e,t){return Object.assign(Object.create(e),t)}function At(e,t=[""],i,s,n=()=>e[0]){const o=i||e;void 0===s&&(s=$t("_fallback",e));const a={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:e,_rootScopes:o,_fallback:s,_getTarget:n,override:i=>At([i,...e],t,o,s)};return new Proxy(a,{deleteProperty:(t,i)=>(delete t[i],delete t._keys,delete e[0][i],!0),get:(i,s)=>It(i,s,()=>function(e,t,i,s){let n;for(const o of t)if(n=$t(Ot(o,e),i),void 0!==n)return Ht(e,n)?Gt(i,s,e,n):n}(s,t,e,i)),getOwnPropertyDescriptor:(e,t)=>Reflect.getOwnPropertyDescriptor(e._scopes[0],t),getPrototypeOf:()=>Reflect.getPrototypeOf(e[0]),has:(e,t)=>Yt(e).includes(t),ownKeys:e=>Yt(e),set(e,t,i){const s=e._storage||(e._storage=n());return e[t]=s[t]=i,delete e._keys,!0}})}function zt(e,t,i,s){const n={_cacheable:!1,_proxy:e,_context:t,_subProxy:i,_stack:new Set,_descriptors:Ft(e,s),setContext:t=>zt(e,t,i,s),override:n=>zt(e.override(n),t,i,s)};return new Proxy(n,{deleteProperty:(t,i)=>(delete t[i],delete e[i],!0),get:(e,t,i)=>It(e,t,()=>function(e,t,i){const{_proxy:s,_context:n,_subProxy:o,_descriptors:a}=e;let r=s[t];return ue(r)&&a.isScriptable(t)&&(r=function(e,t,i,s){const{_proxy:n,_context:o,_subProxy:a,_stack:r}=i;if(r.has(e))throw new Error("Recursion detected: "+Array.from(r).join("->")+"->"+e);r.add(e);let l=t(o,a||s);return r.delete(e),Ht(e,l)&&(l=Gt(n._scopes,n,e,l)),l}(t,r,e,i)),Y(r)&&r.length&&(r=function(e,t,i,s){const{_proxy:n,_context:o,_subProxy:a,_descriptors:r}=i;if(void 0!==o.index&&s(e))return t[o.index%t.length];if(K(t[0])){const i=t,s=n._scopes.filter(e=>e!==i);t=[];for(const l of i){const i=Gt(s,n,e,l);t.push(zt(i,o,a&&a[e],r))}}return t}(t,r,e,a.isIndexable)),Ht(t,r)&&(r=zt(r,n,o&&o[t],a)),r}(e,t,i)),getOwnPropertyDescriptor:(t,i)=>t._descriptors.allKeys?Reflect.has(e,i)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(e,i),getPrototypeOf:()=>Reflect.getPrototypeOf(e),has:(t,i)=>Reflect.has(e,i),ownKeys:()=>Reflect.ownKeys(e),set:(t,i,s)=>(e[i]=s,delete t[i],!0)})}function Ft(e,t={scriptable:!0,indexable:!0}){const{_scriptable:i=t.scriptable,_indexable:s=t.indexable,_allKeys:n=t.allKeys}=e;return{allKeys:n,scriptable:i,indexable:s,isScriptable:ue(i)?i:()=>i,isIndexable:ue(s)?s:()=>s}}const Ot=(e,t)=>e?e+ce(t):t,Ht=(e,t)=>K(t)&&"adapters"!==e&&(null===Object.getPrototypeOf(t)||t.constructor===Object);function It(e,t,i){if(Object.prototype.hasOwnProperty.call(e,t)||"constructor"===t)return e[t];const s=i();return e[t]=s,s}function Bt(e,t,i){return ue(e)?e(t,i):e}const Vt=(e,t)=>!0===e?t:"string"==typeof e?he(t,e):void 0;function Wt(e,t,i,s,n){for(const o of t){const t=Vt(i,o);if(t){e.add(t);const o=Bt(t._fallback,i,n);if(void 0!==o&&o!==i&&o!==s)return o}else if(!1===t&&void 0!==s&&i!==s)return null}return!1}function Gt(e,t,i,s){const n=t._rootScopes,o=Bt(t._fallback,i,s),a=[...e,...n],r=new Set;r.add(s);let l=Ut(r,a,i,o||i,s);return null!==l&&(void 0===o||o===i||(l=Ut(r,a,o,l,s),null!==l))&&At(Array.from(r),[""],n,o,()=>function(e,t,i){const s=e._getTarget();t in s||(s[t]={});const n=s[t];return Y(n)&&K(i)?i:n||{}}(t,i,s))}function Ut(e,t,i,s,n){for(;i;)i=Wt(e,t,i,s,n);return i}function $t(e,t){for(const i of t){if(!i)continue;const t=i[e];if(void 0!==t)return t}}function Yt(e){let t=e._keys;return t||(t=e._keys=function(e){const t=new Set;for(const i of e)for(const e of Object.keys(i).filter(e=>!e.startsWith("_")))t.add(e);return Array.from(t)}(e._scopes)),t}const Kt=Number.EPSILON||1e-14,Xt=(e,t)=>t<e.length&&!e[t].skip&&e[t],qt=e=>"x"===e?"y":"x";function Jt(e,t,i,s){const n=e.skip?t:e,o=t,a=i.skip?t:i,r=De(o,n),l=De(a,o);let h=r/(r+l),c=l/(r+l);h=isNaN(h)?0:h,c=isNaN(c)?0:c;const d=s*h,u=s*c;return{previous:{x:o.x-d*(a.x-n.x),y:o.y-d*(a.y-n.y)},next:{x:o.x+u*(a.x-n.x),y:o.y+u*(a.y-n.y)}}}function Zt(e,t,i){return Math.max(Math.min(e,i),t)}function Qt(e,t,i,s,n){let o,a,r,l;if(t.spanGaps&&(e=e.filter(e=>!e.skip)),"monotone"===t.cubicInterpolationMode)!function(e,t="x"){const i=qt(t),s=e.length,n=Array(s).fill(0),o=Array(s);let a,r,l,h=Xt(e,0);for(a=0;a<s;++a)if(r=l,l=h,h=Xt(e,a+1),l){if(h){const e=h[t]-l[t];n[a]=0!==e?(h[i]-l[i])/e:0}o[a]=r?h?Ce(n[a-1])!==Ce(n[a])?0:(n[a-1]+n[a])/2:n[a-1]:n[a]}!function(e,t,i){const s=e.length;let n,o,a,r,l,h=Xt(e,0);for(let c=0;c<s-1;++c)l=h,h=Xt(e,c+1),l&&h&&(ke(t[c],0,Kt)?i[c]=i[c+1]=0:(n=i[c]/t[c],o=i[c+1]/t[c],r=Math.pow(n,2)+Math.pow(o,2),r<=9||(a=3/Math.sqrt(r),i[c]=n*a*t[c],i[c+1]=o*a*t[c])))}(e,n,o),function(e,t,i="x"){const s=qt(i),n=e.length;let o,a,r,l=Xt(e,0);for(let h=0;h<n;++h){if(a=r,r=l,l=Xt(e,h+1),!r)continue;const n=r[i],c=r[s];a&&(o=(n-a[i])/3,r[`cp1${i}`]=n-o,r[`cp1${s}`]=c-o*t[h]),l&&(o=(l[i]-n)/3,r[`cp2${i}`]=n+o,r[`cp2${s}`]=c+o*t[h])}}(e,o,t)}(e,n);else{let i=s?e[e.length-1]:e[0];for(o=0,a=e.length;o<a;++o)r=e[o],l=Jt(i,r,e[Math.min(o+1,a-(s?0:1))%a],t.tension),r.cp1x=l.previous.x,r.cp1y=l.previous.y,r.cp2x=l.next.x,r.cp2y=l.next.y,i=r}t.capBezierPoints&&function(e,t){let i,s,n,o,a,r=gt(e[0],t);for(i=0,s=e.length;i<s;++i)a=o,o=r,r=i<s-1&&gt(e[i+1],t),o&&(n=e[i],a&&(n.cp1x=Zt(n.cp1x,t.left,t.right),n.cp1y=Zt(n.cp1y,t.top,t.bottom)),r&&(n.cp2x=Zt(n.cp2x,t.left,t.right),n.cp2y=Zt(n.cp2y,t.top,t.bottom)))}(e,i)}function ei(){return"undefined"!=typeof window&&"undefined"!=typeof document}function ti(e){let t=e.parentNode;return t&&"[object ShadowRoot]"===t.toString()&&(t=t.host),t}function ii(e,t,i){let s;return"string"==typeof e?(s=parseInt(e,10),-1!==e.indexOf("%")&&(s=s/100*t.parentNode[i])):s=e,s}const si=e=>e.ownerDocument.defaultView.getComputedStyle(e,null),ni=["top","right","bottom","left"];function oi(e,t,i){const s={};i=i?"-"+i:"";for(let n=0;n<4;n++){const o=ni[n];s[o]=parseFloat(e[t+"-"+o+i])||0}return s.width=s.left+s.right,s.height=s.top+s.bottom,s}function ai(e,t){if("native"in e)return e;const{canvas:i,currentDevicePixelRatio:s}=t,n=si(i),o="border-box"===n.boxSizing,a=oi(n,"padding"),r=oi(n,"border","width"),{x:l,y:h,box:c}=function(e,t){const i=e.touches,s=i&&i.length?i[0]:e,{offsetX:n,offsetY:o}=s;let a,r,l=!1;if(((e,t,i)=>(e>0||t>0)&&(!i||!i.shadowRoot))(n,o,e.target))a=n,r=o;else{const e=t.getBoundingClientRect();a=s.clientX-e.left,r=s.clientY-e.top,l=!0}return{x:a,y:r,box:l}}(e,i),d=a.left+(c&&r.left),u=a.top+(c&&r.top);let{width:p,height:m}=t;return o&&(p-=a.width+r.width,m-=a.height+r.height),{x:Math.round((l-d)/p*i.width/s),y:Math.round((h-u)/m*i.height/s)}}const ri=e=>Math.round(10*e)/10;function li(e,t,i){const s=t||1,n=ri(e.height*s),o=ri(e.width*s);e.height=ri(e.height),e.width=ri(e.width);const a=e.canvas;return a.style&&(i||!a.style.height&&!a.style.width)&&(a.style.height=`${e.height}px`,a.style.width=`${e.width}px`),(e.currentDevicePixelRatio!==s||a.height!==n||a.width!==o)&&(e.currentDevicePixelRatio=s,a.height=n,a.width=o,e.ctx.setTransform(s,0,0,s,0,0),!0)}const hi=function(){let e=!1;try{const t={get passive(){return e=!0,!1}};ei()&&(window.addEventListener("test",null,t),window.removeEventListener("test",null,t))}catch(e){}return e}();function ci(e,t){const i=function(e,t){return si(e).getPropertyValue(t)}(e,t),s=i&&i.match(/^(\d+)(\.\d+)?px$/);return s?+s[1]:void 0}function di(e,t,i,s){return{x:e.x+i*(t.x-e.x),y:e.y+i*(t.y-e.y)}}function ui(e,t,i,s){return{x:e.x+i*(t.x-e.x),y:"middle"===s?i<.5?e.y:t.y:"after"===s?i<1?e.y:t.y:i>0?t.y:e.y}}function pi(e,t,i,s){const n={x:e.cp2x,y:e.cp2y},o={x:t.cp1x,y:t.cp1y},a=di(e,n,i),r=di(n,o,i),l=di(o,t,i),h=di(a,r,i),c=di(r,l,i);return di(h,c,i)}function mi(e,t,i){return e?function(e,t){return{x:i=>e+e+t-i,setWidth(e){t=e},textAlign:e=>"center"===e?e:"right"===e?"left":"right",xPlus:(e,t)=>e-t,leftForLtr:(e,t)=>e-t}}(t,i):{x:e=>e,setWidth(e){},textAlign:e=>e,xPlus:(e,t)=>e+t,leftForLtr:(e,t)=>e}}function gi(e,t){let i,s;"ltr"!==t&&"rtl"!==t||(i=e.canvas.style,s=[i.getPropertyValue("direction"),i.getPropertyPriority("direction")],i.setProperty("direction",t,"important"),e.prevTextDirection=s)}function bi(e,t){void 0!==t&&(delete e.prevTextDirection,e.canvas.style.setProperty("direction",t[0],t[1]))}function fi(e){return"angle"===e?{between:Le,compare:je,normalize:Ne}:{between:Ae,compare:(e,t)=>e-t,normalize:e=>e}}function vi({start:e,end:t,count:i,loop:s,style:n}){return{start:e%i,end:t%i,loop:s&&(t-e+1)%i==0,style:n}}function wi(e,t,i){if(!i)return[e];const{property:s,start:n,end:o}=i,a=t.length,{compare:r,between:l,normalize:h}=fi(s),{start:c,end:d,loop:u,style:p}=function(e,t,i){const{property:s,start:n,end:o}=i,{between:a,normalize:r}=fi(s),l=t.length;let h,c,{start:d,end:u,loop:p}=e;if(p){for(d+=l,u+=l,h=0,c=l;h<c&&a(r(t[d%l][s]),n,o);++h)d--,u--;d%=l,u%=l}return u<d&&(u+=l),{start:d,end:u,loop:p,style:e.style}}(e,t,i),m=[];let g,b,f,v=!1,w=null;const _=()=>v||l(n,f,g)&&0!==r(n,f),y=()=>!v||0===r(o,g)||l(o,f,g);for(let e=c,i=c;e<=d;++e)b=t[e%a],b.skip||(g=h(b[s]),g!==f&&(v=l(g,n,o),null===w&&_()&&(w=0===r(g,n)?e:i),null!==w&&y()&&(m.push(vi({start:w,end:e,loop:u,count:a,style:p})),w=null),i=e,f=g));return null!==w&&m.push(vi({start:w,end:d,loop:u,count:a,style:p})),m}function _i(e,t){const i=[],s=e.segments;for(let n=0;n<s.length;n++){const o=wi(s[n],e.points,t);o.length&&i.push(...o)}return i}function yi(e){return{backgroundColor:e.backgroundColor,borderCapStyle:e.borderCapStyle,borderDash:e.borderDash,borderDashOffset:e.borderDashOffset,borderJoinStyle:e.borderJoinStyle,borderWidth:e.borderWidth,borderColor:e.borderColor}}function xi(e,t){if(!t)return!1;const i=[],s=function(e,t){return Xe(t)?(i.includes(t)||i.push(t),i.indexOf(t)):t};return JSON.stringify(e,s)!==JSON.stringify(t,s)}function Ci(e,t,i){return e.options.clip?e[i]:t[i]}function ki(e,t){const i=t._clip;if(i.disabled)return!1;const s=function(e,t){const{xScale:i,yScale:s}=e;return i&&s?{left:Ci(i,t,"left"),right:Ci(i,t,"right"),top:Ci(s,t,"top"),bottom:Ci(s,t,"bottom")}:t}(t,e.chartArea);return{left:!1===i.left?0:s.left-(!0===i.left?0:i.left),right:!1===i.right?e.width:s.right+(!0===i.right?0:i.right),top:!1===i.top?0:s.top-(!0===i.top?0:i.top),bottom:!1===i.bottom?e.height:s.bottom+(!0===i.bottom?0:i.bottom)}}class Ei{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(e,t,i,s){const n=t.listeners[s],o=t.duration;n.forEach(s=>s({chart:e,initial:t.initial,numSteps:o,currentStep:Math.min(i-t.start,o)}))}_refresh(){this._request||(this._running=!0,this._request=Be.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(e=Date.now()){let t=0;this._charts.forEach((i,s)=>{if(!i.running||!i.items.length)return;const n=i.items;let o,a=n.length-1,r=!1;for(;a>=0;--a)o=n[a],o._active?(o._total>i.duration&&(i.duration=o._total),o.tick(e),r=!0):(n[a]=n[n.length-1],n.pop());r&&(s.draw(),this._notify(s,i,e,"progress")),n.length||(i.running=!1,this._notify(s,i,e,"complete"),i.initial=!1),t+=n.length}),this._lastDate=e,0===t&&(this._running=!1)}_getAnims(e){const t=this._charts;let i=t.get(e);return i||(i={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},t.set(e,i)),i}listen(e,t,i){this._getAnims(e).listeners[t].push(i)}add(e,t){t&&t.length&&this._getAnims(e).items.push(...t)}has(e){return this._getAnims(e).items.length>0}start(e){const t=this._charts.get(e);t&&(t.running=!0,t.start=Date.now(),t.duration=t.items.reduce((e,t)=>Math.max(e,t._duration),0),this._refresh())}running(e){if(!this._running)return!1;const t=this._charts.get(e);return!!(t&&t.running&&t.items.length)}stop(e){const t=this._charts.get(e);if(!t||!t.items.length)return;const i=t.items;let s=i.length-1;for(;s>=0;--s)i[s].cancel();t.items=[],this._notify(e,t,Date.now(),"complete")}remove(e){return this._charts.delete(e)}}var Ri=new Ei;const Mi="transparent",Ti={boolean:(e,t,i)=>i>.5?t:e,color(e,t,i){const s=qe(e||Mi),n=s.valid&&qe(t||Mi);return n&&n.valid?n.mix(s,i).hexString():t},number:(e,t,i)=>e+(t-e)*i};class Si{constructor(e,t,i,s){const n=t[i];s=Lt([e.to,s,n,e.from]);const o=Lt([e.from,n,s]);this._active=!0,this._fn=e.fn||Ti[e.type||typeof o],this._easing=Ke[e.easing]||Ke.linear,this._start=Math.floor(Date.now()+(e.delay||0)),this._duration=this._total=Math.floor(e.duration),this._loop=!!e.loop,this._target=t,this._prop=i,this._from=o,this._to=s,this._promises=void 0}active(){return this._active}update(e,t,i){if(this._active){this._notify(!1);const s=this._target[this._prop],n=i-this._start,o=this._duration-n;this._start=i,this._duration=Math.floor(Math.max(o,e.duration)),this._total+=n,this._loop=!!e.loop,this._to=Lt([e.to,t,s,e.from]),this._from=Lt([e.from,s,t])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(e){const t=e-this._start,i=this._duration,s=this._prop,n=this._from,o=this._loop,a=this._to;let r;if(this._active=n!==a&&(o||t<i),!this._active)return this._target[s]=a,void this._notify(!0);t<0?this._target[s]=n:(r=t/i%2,r=o&&r>1?2-r:r,r=this._easing(Math.min(1,Math.max(0,r))),this._target[s]=this._fn(n,a,r))}wait(){const e=this._promises||(this._promises=[]);return new Promise((t,i)=>{e.push({res:t,rej:i})})}_notify(e){const t=e?"res":"rej",i=this._promises||[];for(let e=0;e<i.length;e++)i[e][t]()}}class Di{constructor(e,t){this._chart=e,this._properties=new Map,this.configure(t)}configure(e){if(!K(e))return;const t=Object.keys(ht.animation),i=this._properties;Object.getOwnPropertyNames(e).forEach(s=>{const n=e[s];if(!K(n))return;const o={};for(const e of t)o[e]=n[e];(Y(n.properties)&&n.properties||[s]).forEach(e=>{e!==s&&i.has(e)||i.set(e,o)})})}_animateOptions(e,t){const i=t.options,s=function(e,t){if(!t)return;let i=e.options;if(i)return i.$shared&&(e.options=i=Object.assign({},i,{$shared:!1,$animations:{}})),i;e.options=t}(e,i);if(!s)return[];const n=this._createAnimations(s,i);return i.$shared&&function(e,t){const i=[],s=Object.keys(t);for(let t=0;t<s.length;t++){const n=e[s[t]];n&&n.active()&&i.push(n.wait())}return Promise.all(i)}(e.options.$animations,i).then(()=>{e.options=i},()=>{}),n}_createAnimations(e,t){const i=this._properties,s=[],n=e.$animations||(e.$animations={}),o=Object.keys(t),a=Date.now();let r;for(r=o.length-1;r>=0;--r){const l=o[r];if("$"===l.charAt(0))continue;if("options"===l){s.push(...this._animateOptions(e,t));continue}const h=t[l];let c=n[l];const d=i.get(l);if(c){if(d&&c.active()){c.update(d,h,a);continue}c.cancel()}d&&d.duration?(n[l]=c=new Si(d,e,l,h),s.push(c)):e[l]=h}return s}update(e,t){if(0===this._properties.size)return void Object.assign(e,t);const i=this._createAnimations(e,t);return i.length?(Ri.add(this._chart,i),!0):void 0}}function ji(e,t){const i=e&&e.options||{},s=i.reverse,n=void 0===i.min?t:0,o=void 0===i.max?t:0;return{start:s?o:n,end:s?n:o}}function Ni(e,t){const i=[],s=e._getSortedDatasetMetas(t);let n,o;for(n=0,o=s.length;n<o;++n)i.push(s[n].index);return i}function Li(e,t,i,s={}){const n=e.keys,o="single"===s.mode;let a,r,l,h;if(null===t)return;let c=!1;for(a=0,r=n.length;a<r;++a){if(l=+n[a],l===i){if(c=!0,s.all)continue;break}h=e.values[l],X(h)&&(o||0===t||Ce(t)===Ce(h))&&(t+=h)}return c||s.all?t:0}function Pi(e,t){const i=e&&e.options.stacked;return i||void 0===i&&void 0!==t.stack}function Ai(e,t,i){const s=e[t]||(e[t]={});return s[i]||(s[i]={})}function zi(e,t,i,s){for(const n of t.getMatchingVisibleMetas(s).reverse()){const t=e[n.index];if(i&&t>0||!i&&t<0)return n.index}return null}function Fi(e,t){const{chart:i,_cachedMeta:s}=e,n=i._stacks||(i._stacks={}),{iScale:o,vScale:a,index:r}=s,l=o.axis,h=a.axis,c=function(e,t,i){return`${e.id}.${t.id}.${i.stack||i.type}`}(o,a,s),d=t.length;let u;for(let e=0;e<d;++e){const i=t[e],{[l]:o,[h]:d}=i;u=(i._stacks||(i._stacks={}))[h]=Ai(n,c,o),u[r]=d,u._top=zi(u,a,!0,s.type),u._bottom=zi(u,a,!1,s.type),(u._visualValues||(u._visualValues={}))[r]=d}}function Oi(e,t){const i=e.scales;return Object.keys(i).filter(e=>i[e].axis===t).shift()}function Hi(e,t){const i=e.controller.index,s=e.vScale&&e.vScale.axis;if(s){t=t||e._parsed;for(const e of t){const t=e._stacks;if(!t||void 0===t[s]||void 0===t[s][i])return;delete t[s][i],void 0!==t[s]._visualValues&&void 0!==t[s]._visualValues[i]&&delete t[s]._visualValues[i]}}}const Ii=e=>"reset"===e||"none"===e,Bi=(e,t)=>t?e:Object.assign({},e);class Vi{static defaults={};static datasetElementType=null;static dataElementType=null;constructor(e,t){this.chart=e,this._ctx=e.ctx,this.index=t,this._cachedDataOpts={},this._cachedMeta=this.getMeta(),this._type=this._cachedMeta.type,this.options=void 0,this._parsing=!1,this._data=void 0,this._objectData=void 0,this._sharedOptions=void 0,this._drawStart=void 0,this._drawCount=void 0,this.enableOptionSharing=!1,this.supportsDecimation=!1,this.$context=void 0,this._syncList=[],this.datasetElementType=new.target.datasetElementType,this.dataElementType=new.target.dataElementType,this.initialize()}initialize(){const e=this._cachedMeta;this.configure(),this.linkScales(),e._stacked=Pi(e.vScale,e),this.addElements(),this.options.fill&&!this.chart.isPluginEnabled("filler")&&console.warn("Tried to use the 'fill' option without the 'Filler' plugin enabled. Please import and register the 'Filler' plugin and make sure it is not disabled in the options")}updateIndex(e){this.index!==e&&Hi(this._cachedMeta),this.index=e}linkScales(){const e=this.chart,t=this._cachedMeta,i=this.getDataset(),s=(e,t,i,s)=>"x"===e?t:"r"===e?s:i,n=t.xAxisID=J(i.xAxisID,Oi(e,"x")),o=t.yAxisID=J(i.yAxisID,Oi(e,"y")),a=t.rAxisID=J(i.rAxisID,Oi(e,"r")),r=t.indexAxis,l=t.iAxisID=s(r,n,o,a),h=t.vAxisID=s(r,o,n,a);t.xScale=this.getScaleForId(n),t.yScale=this.getScaleForId(o),t.rScale=this.getScaleForId(a),t.iScale=this.getScaleForId(l),t.vScale=this.getScaleForId(h)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(e){return this.chart.scales[e]}_getOtherScale(e){const t=this._cachedMeta;return e===t.iScale?t.vScale:t.iScale}reset(){this._update("reset")}_destroy(){const e=this._cachedMeta;this._data&&Ie(this._data,this),e._stacked&&Hi(e)}_dataCheck(){const e=this.getDataset(),t=e.data||(e.data=[]),i=this._data;if(K(t)){const e=this._cachedMeta;this._data=function(e,t){const{iScale:i,vScale:s}=t,n="x"===i.axis?"x":"y",o="x"===s.axis?"x":"y",a=Object.keys(e),r=new Array(a.length);let l,h,c;for(l=0,h=a.length;l<h;++l)c=a[l],r[l]={[n]:c,[o]:e[c]};return r}(t,e)}else if(i!==t){if(i){Ie(i,this);const e=this._cachedMeta;Hi(e),e._parsed=[]}t&&Object.isExtensible(t)&&(n=this,(s=t)._chartjs?s._chartjs.listeners.push(n):(Object.defineProperty(s,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[n]}}),He.forEach(e=>{const t="_onData"+ce(e),i=s[e];Object.defineProperty(s,e,{configurable:!0,enumerable:!1,value(...e){const n=i.apply(this,e);return s._chartjs.listeners.forEach(i=>{"function"==typeof i[t]&&i[t](...e)}),n}})}))),this._syncList=[],this._data=t}var s,n}addElements(){const e=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(e.dataset=new this.datasetElementType)}buildOrUpdateElements(e){const t=this._cachedMeta,i=this.getDataset();let s=!1;this._dataCheck();const n=t._stacked;t._stacked=Pi(t.vScale,t),t.stack!==i.stack&&(s=!0,Hi(t),t.stack=i.stack),this._resyncElements(e),(s||n!==t._stacked)&&(Fi(this,t._parsed),t._stacked=Pi(t.vScale,t))}configure(){const e=this.chart.config,t=e.datasetScopeKeys(this._type),i=e.getOptionScopes(this.getDataset(),t,!0);this.options=e.createResolver(i,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(e,t){const{_cachedMeta:i,_data:s}=this,{iScale:n,_stacked:o}=i,a=n.axis;let r,l,h,c=0===e&&t===s.length||i._sorted,d=e>0&&i._parsed[e-1];if(!1===this._parsing)i._parsed=s,i._sorted=!0,h=s;else{h=Y(s[e])?this.parseArrayData(i,s,e,t):K(s[e])?this.parseObjectData(i,s,e,t):this.parsePrimitiveData(i,s,e,t);const n=()=>null===l[a]||d&&l[a]<d[a];for(r=0;r<t;++r)i._parsed[r+e]=l=h[r],c&&(n()&&(c=!1),d=l);i._sorted=c}o&&Fi(this,h)}parsePrimitiveData(e,t,i,s){const{iScale:n,vScale:o}=e,a=n.axis,r=o.axis,l=n.getLabels(),h=n===o,c=new Array(s);let d,u,p;for(d=0,u=s;d<u;++d)p=d+i,c[d]={[a]:h||n.parse(l[p],p),[r]:o.parse(t[p],p)};return c}parseArrayData(e,t,i,s){const{xScale:n,yScale:o}=e,a=new Array(s);let r,l,h,c;for(r=0,l=s;r<l;++r)h=r+i,c=t[h],a[r]={x:n.parse(c[0],h),y:o.parse(c[1],h)};return a}parseObjectData(e,t,i,s){const{xScale:n,yScale:o}=e,{xAxisKey:a="x",yAxisKey:r="y"}=this._parsing,l=new Array(s);let h,c,d,u;for(h=0,c=s;h<c;++h)d=h+i,u=t[d],l[h]={x:n.parse(he(u,a),d),y:o.parse(he(u,r),d)};return l}getParsed(e){return this._cachedMeta._parsed[e]}getDataElement(e){return this._cachedMeta.data[e]}applyStack(e,t,i){const s=this.chart,n=this._cachedMeta,o=t[e.axis];return Li({keys:Ni(s,!0),values:t._stacks[e.axis]._visualValues},o,n.index,{mode:i})}updateRangeFromParsed(e,t,i,s){const n=i[t.axis];let o=null===n?NaN:n;const a=s&&i._stacks[t.axis];s&&a&&(s.values=a,o=Li(s,n,this._cachedMeta.index)),e.min=Math.min(e.min,o),e.max=Math.max(e.max,o)}getMinMax(e,t){const i=this._cachedMeta,s=i._parsed,n=i._sorted&&e===i.iScale,o=s.length,a=this._getOtherScale(e),r=((e,t,i)=>e&&!t.hidden&&t._stacked&&{keys:Ni(i,!0),values:null})(t,i,this.chart),l={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:h,max:c}=function(e){const{min:t,max:i,minDefined:s,maxDefined:n}=e.getUserBounds();return{min:s?t:Number.NEGATIVE_INFINITY,max:n?i:Number.POSITIVE_INFINITY}}(a);let d,u;function p(){u=s[d];const t=u[a.axis];return!X(u[e.axis])||h>t||c<t}for(d=0;d<o&&(p()||(this.updateRangeFromParsed(l,e,u,r),!n));++d);if(n)for(d=o-1;d>=0;--d)if(!p()){this.updateRangeFromParsed(l,e,u,r);break}return l}getAllParsedValues(e){const t=this._cachedMeta._parsed,i=[];let s,n,o;for(s=0,n=t.length;s<n;++s)o=t[s][e.axis],X(o)&&i.push(o);return i}getMaxOverflow(){return!1}getLabelAndValue(e){const t=this._cachedMeta,i=t.iScale,s=t.vScale,n=this.getParsed(e);return{label:i?""+i.getLabelForValue(n[i.axis]):"",value:s?""+s.getLabelForValue(n[s.axis]):""}}_update(e){const t=this._cachedMeta;this.update(e||"default"),t._clip=function(e){let t,i,s,n;return K(e)?(t=e.top,i=e.right,s=e.bottom,n=e.left):t=i=s=n=e,{top:t,right:i,bottom:s,left:n,disabled:!1===e}}(J(this.options.clip,function(e,t,i){if(!1===i)return!1;const s=ji(e,i),n=ji(t,i);return{top:n.end,right:s.end,bottom:n.start,left:s.start}}(t.xScale,t.yScale,this.getMaxOverflow())))}update(e){}draw(){const e=this._ctx,t=this.chart,i=this._cachedMeta,s=i.data||[],n=t.chartArea,o=[],a=this._drawStart||0,r=this._drawCount||s.length-a,l=this.options.drawActiveElementsOnTop;let h;for(i.dataset&&i.dataset.draw(e,n,a,r),h=a;h<a+r;++h){const t=s[h];t.hidden||(t.active&&l?o.push(t):t.draw(e,n))}for(h=0;h<o.length;++h)o[h].draw(e,n)}getStyle(e,t){const i=t?"active":"default";return void 0===e&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(i):this.resolveDataElementOptions(e||0,i)}getContext(e,t,i){const s=this.getDataset();let n;if(e>=0&&e<this._cachedMeta.data.length){const t=this._cachedMeta.data[e];n=t.$context||(t.$context=function(e,t,i){return Pt(e,{active:!1,dataIndex:t,parsed:void 0,raw:void 0,element:i,index:t,mode:"default",type:"data"})}(this.getContext(),e,t)),n.parsed=this.getParsed(e),n.raw=s.data[e],n.index=n.dataIndex=e}else n=this.$context||(this.$context=function(e,t){return Pt(e,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:"default",type:"dataset"})}(this.chart.getContext(),this.index)),n.dataset=s,n.index=n.datasetIndex=this.index;return n.active=!!t,n.mode=i,n}resolveDatasetElementOptions(e){return this._resolveElementOptions(this.datasetElementType.id,e)}resolveDataElementOptions(e,t){return this._resolveElementOptions(this.dataElementType.id,t,e)}_resolveElementOptions(e,t="default",i){const s="active"===t,n=this._cachedDataOpts,o=e+"-"+t,a=n[o],r=this.enableOptionSharing&&de(i);if(a)return Bi(a,r);const l=this.chart.config,h=l.datasetElementScopeKeys(this._type,e),c=s?[`${e}Hover`,"hover",e,""]:[e,""],d=l.getOptionScopes(this.getDataset(),h),u=Object.keys(ht.elements[e]),p=l.resolveNamedOptions(d,u,()=>this.getContext(i,s,t),c);return p.$shared&&(p.$shared=r,n[o]=Object.freeze(Bi(p,r))),p}_resolveAnimations(e,t,i){const s=this.chart,n=this._cachedDataOpts,o=`animation-${t}`,a=n[o];if(a)return a;let r;if(!1!==s.options.animation){const s=this.chart.config,n=s.datasetAnimationScopeKeys(this._type,t),o=s.getOptionScopes(this.getDataset(),n);r=s.createResolver(o,this.getContext(e,i,t))}const l=new Di(s,r&&r.animations);return r&&r._cacheable&&(n[o]=Object.freeze(l)),l}getSharedOptions(e){if(e.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},e))}includeOptions(e,t){return!t||Ii(e)||this.chart._animationsDisabled}_getSharedOptions(e,t){const i=this.resolveDataElementOptions(e,t),s=this._sharedOptions,n=this.getSharedOptions(i),o=this.includeOptions(t,n)||n!==s;return this.updateSharedOptions(n,t,i),{sharedOptions:n,includeOptions:o}}updateElement(e,t,i,s){Ii(s)?Object.assign(e,i):this._resolveAnimations(t,s).update(e,i)}updateSharedOptions(e,t,i){e&&!Ii(t)&&this._resolveAnimations(void 0,t).update(e,i)}_setStyle(e,t,i,s){e.active=s;const n=this.getStyle(t,s);this._resolveAnimations(t,i,s).update(e,{options:!s&&this.getSharedOptions(n)||n})}removeHoverStyle(e,t,i){this._setStyle(e,i,"active",!1)}setHoverStyle(e,t,i){this._setStyle(e,i,"active",!0)}_removeDatasetHoverStyle(){const e=this._cachedMeta.dataset;e&&this._setStyle(e,void 0,"active",!1)}_setDatasetHoverStyle(){const e=this._cachedMeta.dataset;e&&this._setStyle(e,void 0,"active",!0)}_resyncElements(e){const t=this._data,i=this._cachedMeta.data;for(const[e,t,i]of this._syncList)this[e](t,i);this._syncList=[];const s=i.length,n=t.length,o=Math.min(n,s);o&&this.parse(0,o),n>s?this._insertElements(s,n-s,e):n<s&&this._removeElements(n,s-n)}_insertElements(e,t,i=!0){const s=this._cachedMeta,n=s.data,o=e+t;let a;const r=e=>{for(e.length+=t,a=e.length-1;a>=o;a--)e[a]=e[a-t]};for(r(n),a=e;a<o;++a)n[a]=new this.dataElementType;this._parsing&&r(s._parsed),this.parse(e,t),i&&this.updateElements(n,e,t,"reset")}updateElements(e,t,i,s){}_removeElements(e,t){const i=this._cachedMeta;if(this._parsing){const s=i._parsed.splice(e,t);i._stacked&&Hi(i,s)}i.data.splice(e,t)}_sync(e){if(this._parsing)this._syncList.push(e);else{const[t,i,s]=e;this[t](i,s)}this.chart._dataChanges.push([this.index,...e])}_onDataPush(){const e=arguments.length;this._sync(["_insertElements",this.getDataset().data.length-e,e])}_onDataPop(){this._sync(["_removeElements",this._cachedMeta.data.length-1,1])}_onDataShift(){this._sync(["_removeElements",0,1])}_onDataSplice(e,t){t&&this._sync(["_removeElements",e,t]);const i=arguments.length-2;i&&this._sync(["_insertElements",e,i])}_onDataUnshift(){this._sync(["_insertElements",0,arguments.length])}}function Wi(e){const t=e.iScale,i=function(e,t){if(!e._cache.$bar){const i=e.getMatchingVisibleMetas(t);let s=[];for(let t=0,n=i.length;t<n;t++)s=s.concat(i[t].controller.getAllParsedValues(e));e._cache.$bar=function(e){const t=new Set(e);return t.size===e.length?e:Array.from(t)}(s.sort((e,t)=>e-t))}return e._cache.$bar}(t,e.type);let s,n,o,a,r=t._length;const l=()=>{32767!==o&&-32768!==o&&(de(a)&&(r=Math.min(r,Math.abs(o-a)||r)),a=o)};for(s=0,n=i.length;s<n;++s)o=t.getPixelForValue(i[s]),l();for(a=void 0,s=0,n=t.ticks.length;s<n;++s)o=t.getPixelForTick(s),l();return r}function Gi(e,t,i,s){return Y(e)?function(e,t,i,s){const n=i.parse(e[0],s),o=i.parse(e[1],s),a=Math.min(n,o),r=Math.max(n,o);let l=a,h=r;Math.abs(a)>Math.abs(r)&&(l=r,h=a),t[i.axis]=h,t._custom={barStart:l,barEnd:h,start:n,end:o,min:a,max:r}}(e,t,i,s):t[i.axis]=i.parse(e,s),t}function Ui(e,t,i,s){const n=e.iScale,o=e.vScale,a=n.getLabels(),r=n===o,l=[];let h,c,d,u;for(h=i,c=i+s;h<c;++h)u=t[h],d={},d[n.axis]=r||n.parse(a[h],h),l.push(Gi(u,d,o,h));return l}function $i(e){return e&&void 0!==e.barStart&&void 0!==e.barEnd}function Yi(e,t,i,s){let n=t.borderSkipped;const o={};if(!n)return void(e.borderSkipped=o);if(!0===n)return void(e.borderSkipped={top:!0,right:!0,bottom:!0,left:!0});const{start:a,end:r,reverse:l,top:h,bottom:c}=function(e){let t,i,s,n,o;return e.horizontal?(t=e.base>e.x,i="left",s="right"):(t=e.base<e.y,i="bottom",s="top"),t?(n="end",o="start"):(n="start",o="end"),{start:i,end:s,reverse:t,top:n,bottom:o}}(e);"middle"===n&&i&&(e.enableBorderRadius=!0,(i._top||0)===s?n=h:(i._bottom||0)===s?n=c:(o[Ki(c,a,r,l)]=!0,n=h)),o[Ki(n,a,r,l)]=!0,e.borderSkipped=o}function Ki(e,t,i,s){var n,o,a;return s?(a=i,e=Xi(e=(n=e)===(o=t)?a:n===a?o:n,i,t)):e=Xi(e,t,i),e}function Xi(e,t,i){return"start"===e?t:"end"===e?i:e}function qi(e,{inflateAmount:t},i){e.inflateAmount="auto"===t?1===i?.33:0:t}class Ji extends Vi{static id="bar";static defaults={datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}};static overrides={scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}};parsePrimitiveData(e,t,i,s){return Ui(e,t,i,s)}parseArrayData(e,t,i,s){return Ui(e,t,i,s)}parseObjectData(e,t,i,s){const{iScale:n,vScale:o}=e,{xAxisKey:a="x",yAxisKey:r="y"}=this._parsing,l="x"===n.axis?a:r,h="x"===o.axis?a:r,c=[];let d,u,p,m;for(d=i,u=i+s;d<u;++d)m=t[d],p={},p[n.axis]=n.parse(he(m,l),d),c.push(Gi(he(m,h),p,o,d));return c}updateRangeFromParsed(e,t,i,s){super.updateRangeFromParsed(e,t,i,s);const n=i._custom;n&&t===this._cachedMeta.vScale&&(e.min=Math.min(e.min,n.min),e.max=Math.max(e.max,n.max))}getMaxOverflow(){return 0}getLabelAndValue(e){const t=this._cachedMeta,{iScale:i,vScale:s}=t,n=this.getParsed(e),o=n._custom,a=$i(o)?"["+o.start+", "+o.end+"]":""+s.getLabelForValue(n[s.axis]);return{label:""+i.getLabelForValue(n[i.axis]),value:a}}initialize(){this.enableOptionSharing=!0,super.initialize(),this._cachedMeta.stack=this.getDataset().stack}update(e){const t=this._cachedMeta;this.updateElements(t.data,0,t.data.length,e)}updateElements(e,t,i,s){const n="reset"===s,{index:o,_cachedMeta:{vScale:a}}=this,r=a.getBasePixel(),l=a.isHorizontal(),h=this._getRuler(),{sharedOptions:c,includeOptions:d}=this._getSharedOptions(t,s);for(let u=t;u<t+i;u++){const t=this.getParsed(u),i=n||$(t[a.axis])?{base:r,head:r}:this._calculateBarValuePixels(u),p=this._calculateBarIndexPixels(u,h),m=(t._stacks||{})[a.axis],g={horizontal:l,base:i.base,enableBorderRadius:!m||$i(t._custom)||o===m._top||o===m._bottom,x:l?i.head:p.center,y:l?p.center:i.head,height:l?p.size:Math.abs(i.size),width:l?Math.abs(i.size):p.size};d&&(g.options=c||this.resolveDataElementOptions(u,e[u].active?"active":s));const b=g.options||e[u].options;Yi(g,b,m,o),qi(g,b,h.ratio),this.updateElement(e[u],u,g,s)}}_getStacks(e,t){const{iScale:i}=this._cachedMeta,s=i.getMatchingVisibleMetas(this._type).filter(e=>e.controller.options.grouped),n=i.options.stacked,o=[],a=this._cachedMeta.controller.getParsed(t),r=a&&a[i.axis],l=e=>{const t=e._parsed.find(e=>e[i.axis]===r),s=t&&t[e.vScale.axis];if($(s)||isNaN(s))return!0};for(const i of s)if((void 0===t||!l(i))&&((!1===n||-1===o.indexOf(i.stack)||void 0===n&&void 0===i.stack)&&o.push(i.stack),i.index===e))break;return o.length||o.push(void 0),o}_getStackCount(e){return this._getStacks(void 0,e).length}_getAxisCount(){return this._getAxis().length}getFirstScaleIdForIndexAxis(){const e=this.chart.scales,t=this.chart.options.indexAxis;return Object.keys(e).filter(i=>e[i].axis===t).shift()}_getAxis(){const e={},t=this.getFirstScaleIdForIndexAxis();for(const i of this.chart.data.datasets)e[J("x"===this.chart.options.indexAxis?i.xAxisID:i.yAxisID,t)]=!0;return Object.keys(e)}_getStackIndex(e,t,i){const s=this._getStacks(e,i),n=void 0!==t?s.indexOf(t):-1;return-1===n?s.length-1:n}_getRuler(){const e=this.options,t=this._cachedMeta,i=t.iScale,s=[];let n,o;for(n=0,o=t.data.length;n<o;++n)s.push(i.getPixelForValue(this.getParsed(n)[i.axis],n));const a=e.barThickness;return{min:a||Wi(t),pixels:s,start:i._startPixel,end:i._endPixel,stackCount:this._getStackCount(),scale:i,grouped:e.grouped,ratio:a?1:e.categoryPercentage*e.barPercentage}}_calculateBarValuePixels(e){const{_cachedMeta:{vScale:t,_stacked:i,index:s},options:{base:n,minBarLength:o}}=this,a=n||0,r=this.getParsed(e),l=r._custom,h=$i(l);let c,d,u=r[t.axis],p=0,m=i?this.applyStack(t,r,i):u;m!==u&&(p=m-u,m=u),h&&(u=l.barStart,m=l.barEnd-l.barStart,0!==u&&Ce(u)!==Ce(l.barEnd)&&(p=0),p+=u);const g=$(n)||h?p:n;let b=t.getPixelForValue(g);if(c=this.chart.getDataVisibility(e)?t.getPixelForValue(p+m):b,d=c-b,Math.abs(d)<o){d=function(e,t,i){return 0!==e?Ce(e):(t.isHorizontal()?1:-1)*(t.min>=i?1:-1)}(d,t,a)*o,u===a&&(b-=d/2);const e=t.getPixelForDecimal(0),n=t.getPixelForDecimal(1),l=Math.min(e,n),p=Math.max(e,n);b=Math.max(Math.min(b,p),l),c=b+d,i&&!h&&(r._stacks[t.axis]._visualValues[s]=t.getValueForPixel(c)-t.getValueForPixel(b))}if(b===t.getPixelForValue(a)){const e=Ce(d)*t.getLineWidthForValue(a)/2;b+=e,d-=e}return{size:d,base:b,head:c,center:c+d/2}}_calculateBarIndexPixels(e,t){const i=t.scale,s=this.options,n=s.skipNull,o=J(s.maxBarThickness,1/0);let a,r;const l=this._getAxisCount();if(t.grouped){const i=n?this._getStackCount(e):t.stackCount,h="flex"===s.barThickness?function(e,t,i,s){const n=t.pixels,o=n[e];let a=e>0?n[e-1]:null,r=e<n.length-1?n[e+1]:null;const l=i.categoryPercentage;null===a&&(a=o-(null===r?t.end-t.start:r-o)),null===r&&(r=o+o-a);const h=o-(o-Math.min(a,r))/2*l;return{chunk:Math.abs(r-a)/2*l/s,ratio:i.barPercentage,start:h}}(e,t,s,i*l):function(e,t,i,s){const n=i.barThickness;let o,a;return $(n)?(o=t.min*i.categoryPercentage,a=i.barPercentage):(o=n*s,a=1),{chunk:o/s,ratio:a,start:t.pixels[e]-o/2}}(e,t,s,i*l),c="x"===this.chart.options.indexAxis?this.getDataset().xAxisID:this.getDataset().yAxisID,d=this._getAxis().indexOf(J(c,this.getFirstScaleIdForIndexAxis())),u=this._getStackIndex(this.index,this._cachedMeta.stack,n?e:void 0)+d;a=h.start+h.chunk*u+h.chunk/2,r=Math.min(o,h.chunk*h.ratio)}else a=i.getPixelForValue(this.getParsed(e)[i.axis],e),r=Math.min(o,t.min*t.ratio);return{base:a-r/2,head:a+r/2,center:a,size:r}}draw(){const e=this._cachedMeta,t=e.vScale,i=e.data,s=i.length;let n=0;for(;n<s;++n)null===this.getParsed(n)[t.axis]||i[n].hidden||i[n].draw(this._ctx)}}class Zi extends Vi{static id="doughnut";static defaults={datasetElementType:!1,dataElementType:"arc",animation:{animateRotate:!0,animateScale:!1},animations:{numbers:{type:"number",properties:["circumference","endAngle","innerRadius","outerRadius","startAngle","x","y","offset","borderWidth","spacing"]}},cutout:"50%",rotation:0,circumference:360,radius:"100%",spacing:0,indexAxis:"r"};static descriptors={_scriptable:e=>"spacing"!==e,_indexable:e=>"spacing"!==e&&!e.startsWith("borderDash")&&!e.startsWith("hoverBorderDash")};static overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(e){const t=e.data,{labels:{pointStyle:i,textAlign:s,color:n,useBorderRadius:o,borderRadius:a}}=e.legend.options;return t.labels.length&&t.datasets.length?t.labels.map((t,r)=>{const l=e.getDatasetMeta(0).controller.getStyle(r);return{text:t,fillStyle:l.backgroundColor,fontColor:n,hidden:!e.getDataVisibility(r),lineDash:l.borderDash,lineDashOffset:l.borderDashOffset,lineJoin:l.borderJoinStyle,lineWidth:l.borderWidth,strokeStyle:l.borderColor,textAlign:s,pointStyle:i,borderRadius:o&&(a||l.borderRadius),index:r}}):[]}},onClick(e,t,i){i.chart.toggleDataVisibility(t.index),i.chart.update()}}}};constructor(e,t){super(e,t),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(e,t){const i=this.getDataset().data,s=this._cachedMeta;if(!1===this._parsing)s._parsed=i;else{let n,o,a=e=>+i[e];if(K(i[e])){const{key:e="value"}=this._parsing;a=t=>+he(i[t],e)}for(n=e,o=e+t;n<o;++n)s._parsed[n]=a(n)}}_getRotation(){return Me(this.options.rotation-90)}_getCircumference(){return Me(this.options.circumference)}_getRotationExtents(){let e=ge,t=-ge;for(let i=0;i<this.chart.data.datasets.length;++i)if(this.chart.isDatasetVisible(i)&&this.chart.getDatasetMeta(i).type===this._type){const s=this.chart.getDatasetMeta(i).controller,n=s._getRotation(),o=s._getCircumference();e=Math.min(e,n),t=Math.max(t,n+o)}return{rotation:e,circumference:t-e}}update(e){const t=this.chart,{chartArea:i}=t,s=this._cachedMeta,n=s.data,o=this.getMaxBorderWidth()+this.getMaxOffset(n)+this.options.spacing,a=Math.max((Math.min(i.width,i.height)-o)/2,0),r=Math.min((h=a,"string"==typeof(l=this.options.cutout)&&l.endsWith("%")?parseFloat(l)/100:+l/h),1);var l,h;const c=this._getRingWeight(this.index),{circumference:d,rotation:u}=this._getRotationExtents(),{ratioX:p,ratioY:m,offsetX:g,offsetY:b}=function(e,t,i){let s=1,n=1,o=0,a=0;if(t<ge){const r=e,l=r+t,h=Math.cos(r),c=Math.sin(r),d=Math.cos(l),u=Math.sin(l),p=(e,t,s)=>Le(e,r,l,!0)?1:Math.max(t,t*i,s,s*i),m=(e,t,s)=>Le(e,r,l,!0)?-1:Math.min(t,t*i,s,s*i),g=p(0,h,d),b=p(we,c,u),f=m(me,h,d),v=m(me+we,c,u);s=(g-f)/2,n=(b-v)/2,o=-(g+f)/2,a=-(b+v)/2}return{ratioX:s,ratioY:n,offsetX:o,offsetY:a}}(u,d,r),f=(i.width-o)/p,v=(i.height-o)/m,w=Math.max(Math.min(f,v)/2,0),_=Z(this.options.radius,w),y=(_-Math.max(_*r,0))/this._getVisibleDatasetWeightTotal();this.offsetX=g*_,this.offsetY=b*_,s.total=this.calculateTotal(),this.outerRadius=_-y*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-y*c,0),this.updateElements(n,0,n.length,e)}_circumference(e,t){const i=this.options,s=this._cachedMeta,n=this._getCircumference();return t&&i.animation.animateRotate||!this.chart.getDataVisibility(e)||null===s._parsed[e]||s.data[e].hidden?0:this.calculateCircumference(s._parsed[e]*n/ge)}updateElements(e,t,i,s){const n="reset"===s,o=this.chart,a=o.chartArea,r=o.options.animation,l=(a.left+a.right)/2,h=(a.top+a.bottom)/2,c=n&&r.animateScale,d=c?0:this.innerRadius,u=c?0:this.outerRadius,{sharedOptions:p,includeOptions:m}=this._getSharedOptions(t,s);let g,b=this._getRotation();for(g=0;g<t;++g)b+=this._circumference(g,n);for(g=t;g<t+i;++g){const t=this._circumference(g,n),i=e[g],o={x:l+this.offsetX,y:h+this.offsetY,startAngle:b,endAngle:b+t,circumference:t,outerRadius:u,innerRadius:d};m&&(o.options=p||this.resolveDataElementOptions(g,i.active?"active":s)),b+=t,this.updateElement(i,g,o,s)}}calculateTotal(){const e=this._cachedMeta,t=e.data;let i,s=0;for(i=0;i<t.length;i++){const n=e._parsed[i];null===n||isNaN(n)||!this.chart.getDataVisibility(i)||t[i].hidden||(s+=Math.abs(n))}return s}calculateCircumference(e){const t=this._cachedMeta.total;return t>0&&!isNaN(e)?ge*(Math.abs(e)/t):0}getLabelAndValue(e){const t=this._cachedMeta,i=this.chart,s=i.data.labels||[],n=tt(t._parsed[e],i.options.locale);return{label:s[e]||"",value:n}}getMaxBorderWidth(e){let t=0;const i=this.chart;let s,n,o,a,r;if(!e)for(s=0,n=i.data.datasets.length;s<n;++s)if(i.isDatasetVisible(s)){o=i.getDatasetMeta(s),e=o.data,a=o.controller;break}if(!e)return 0;for(s=0,n=e.length;s<n;++s)r=a.resolveDataElementOptions(s),"inner"!==r.borderAlign&&(t=Math.max(t,r.borderWidth||0,r.hoverBorderWidth||0));return t}getMaxOffset(e){let t=0;for(let i=0,s=e.length;i<s;++i){const e=this.resolveDataElementOptions(i);t=Math.max(t,e.offset||0,e.hoverOffset||0)}return t}_getRingWeightOffset(e){let t=0;for(let i=0;i<e;++i)this.chart.isDatasetVisible(i)&&(t+=this._getRingWeight(i));return t}_getRingWeight(e){return Math.max(J(this.chart.data.datasets[e].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}}class Qi extends Vi{static id="line";static defaults={datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1};static overrides={scales:{_index_:{type:"category"},_value_:{type:"linear"}}};initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(e){const t=this._cachedMeta,{dataset:i,data:s=[],_dataset:n}=t,o=this.chart._animationsDisabled;let{start:a,count:r}=function(e,t,i){const s=t.length;let n=0,o=s;if(e._sorted){const{iScale:a,vScale:r,_parsed:l}=e,h=e.dataset&&e.dataset.options?e.dataset.options.spanGaps:null,c=a.axis,{min:d,max:u,minDefined:p,maxDefined:m}=a.getUserBounds();if(p){if(n=Math.min(Fe(l,c,d).lo,i?s:Fe(t,c,a.getPixelForValue(d)).lo),h){const e=l.slice(0,n+1).reverse().findIndex(e=>!$(e[r.axis]));n-=Math.max(0,e)}n=Pe(n,0,s-1)}if(m){let e=Math.max(Fe(l,a.axis,u,!0).hi+1,i?0:Fe(t,c,a.getPixelForValue(u),!0).hi+1);if(h){const t=l.slice(e-1).findIndex(e=>!$(e[r.axis]));e+=Math.max(0,t)}o=Pe(e,n,s)-n}else o=s-n}return{start:n,count:o}}(t,s,o);this._drawStart=a,this._drawCount=r,function(e){const{xScale:t,yScale:i,_scaleRanges:s}=e,n={xmin:t.min,xmax:t.max,ymin:i.min,ymax:i.max};if(!s)return e._scaleRanges=n,!0;const o=s.xmin!==t.min||s.xmax!==t.max||s.ymin!==i.min||s.ymax!==i.max;return Object.assign(s,n),o}(t)&&(a=0,r=s.length),i._chart=this.chart,i._datasetIndex=this.index,i._decimated=!!n._decimated,i.points=s;const l=this.resolveDatasetElementOptions(e);this.options.showLine||(l.borderWidth=0),l.segment=this.options.segment,this.updateElement(i,void 0,{animated:!o,options:l},e),this.updateElements(s,a,r,e)}updateElements(e,t,i,s){const n="reset"===s,{iScale:o,vScale:a,_stacked:r,_dataset:l}=this._cachedMeta,{sharedOptions:h,includeOptions:c}=this._getSharedOptions(t,s),d=o.axis,u=a.axis,{spanGaps:p,segment:m}=this.options,g=Re(p)?p:Number.POSITIVE_INFINITY,b=this.chart._animationsDisabled||n||"none"===s,f=t+i,v=e.length;let w=t>0&&this.getParsed(t-1);for(let i=0;i<v;++i){const p=e[i],v=b?p:{};if(i<t||i>=f){v.skip=!0;continue}const _=this.getParsed(i),y=$(_[u]),x=v[d]=o.getPixelForValue(_[d],i),C=v[u]=n||y?a.getBasePixel():a.getPixelForValue(r?this.applyStack(a,_,r):_[u],i);v.skip=isNaN(x)||isNaN(C)||y,v.stop=i>0&&Math.abs(_[d]-w[d])>g,m&&(v.parsed=_,v.raw=l.data[i]),c&&(v.options=h||this.resolveDataElementOptions(i,p.active?"active":s)),b||this.updateElement(p,i,v,s),w=_}}getMaxOverflow(){const e=this._cachedMeta,t=e.dataset,i=t.options&&t.options.borderWidth||0,s=e.data||[];if(!s.length)return i;const n=s[0].size(this.resolveDataElementOptions(0)),o=s[s.length-1].size(this.resolveDataElementOptions(s.length-1));return Math.max(i,n,o)/2}draw(){const e=this._cachedMeta;e.dataset.updateControlPoints(this.chart.chartArea,e.iScale.axis),super.draw()}}function es(e,t,i,s){const{controller:n,data:o,_sorted:a}=e,r=n._cachedMeta.iScale,l=e.dataset&&e.dataset.options?e.dataset.options.spanGaps:null;if(r&&t===r.axis&&"r"!==t&&a&&o.length){const a=r._reversePixels?Oe:Fe;if(!s){const s=a(o,t,i);if(l){const{vScale:t}=n._cachedMeta,{_parsed:i}=e,o=i.slice(0,s.lo+1).reverse().findIndex(e=>!$(e[t.axis]));s.lo-=Math.max(0,o);const a=i.slice(s.hi).findIndex(e=>!$(e[t.axis]));s.hi+=Math.max(0,a)}return s}if(n._sharedOptions){const e=o[0],s="function"==typeof e.getRange&&e.getRange(t);if(s){const e=a(o,t,i-s),n=a(o,t,i+s);return{lo:e.lo,hi:n.hi}}}}return{lo:0,hi:o.length-1}}function ts(e,t,i,s,n){const o=e.getSortedVisibleDatasetMetas(),a=i[t];for(let e=0,i=o.length;e<i;++e){const{index:i,data:r}=o[e],{lo:l,hi:h}=es(o[e],t,a,n);for(let e=l;e<=h;++e){const t=r[e];t.skip||s(t,i,e)}}}function is(e,t,i,s,n){const o=[];return n||e.isPointInArea(t)?(ts(e,i,t,function(i,a,r){(n||gt(i,e.chartArea,0))&&i.inRange(t.x,t.y,s)&&o.push({element:i,datasetIndex:a,index:r})},!0),o):o}function ss(e,t,i,s,n,o){return o||e.isPointInArea(t)?"r"!==i||s?function(e,t,i,s,n,o){let a=[];const r=function(e){const t=-1!==e.indexOf("x"),i=-1!==e.indexOf("y");return function(e,s){const n=t?Math.abs(e.x-s.x):0,o=i?Math.abs(e.y-s.y):0;return Math.sqrt(Math.pow(n,2)+Math.pow(o,2))}}(i);let l=Number.POSITIVE_INFINITY;return ts(e,i,t,function(i,h,c){const d=i.inRange(t.x,t.y,n);if(s&&!d)return;const u=i.getCenterPoint(n);if(!o&&!e.isPointInArea(u)&&!d)return;const p=r(t,u);p<l?(a=[{element:i,datasetIndex:h,index:c}],l=p):p===l&&a.push({element:i,datasetIndex:h,index:c})}),a}(e,t,i,s,n,o):function(e,t,i,s){let n=[];return ts(e,i,t,function(e,i,o){const{startAngle:a,endAngle:r}=e.getProps(["startAngle","endAngle"],s),{angle:l}=Se(e,{x:t.x,y:t.y});Le(l,a,r)&&n.push({element:e,datasetIndex:i,index:o})}),n}(e,t,i,n):[]}function ns(e,t,i,s,n){const o=[],a="x"===i?"inXRange":"inYRange";let r=!1;return ts(e,i,t,(e,s,l)=>{e[a]&&e[a](t[i],n)&&(o.push({element:e,datasetIndex:s,index:l}),r=r||e.inRange(t.x,t.y,n))}),s&&!r?[]:o}var os={evaluateInteractionItems:ts,modes:{index(e,t,i,s){const n=ai(t,e),o=i.axis||"x",a=i.includeInvisible||!1,r=i.intersect?is(e,n,o,s,a):ss(e,n,o,!1,s,a),l=[];return r.length?(e.getSortedVisibleDatasetMetas().forEach(e=>{const t=r[0].index,i=e.data[t];i&&!i.skip&&l.push({element:i,datasetIndex:e.index,index:t})}),l):[]},dataset(e,t,i,s){const n=ai(t,e),o=i.axis||"xy",a=i.includeInvisible||!1;let r=i.intersect?is(e,n,o,s,a):ss(e,n,o,!1,s,a);if(r.length>0){const t=r[0].datasetIndex,i=e.getDatasetMeta(t).data;r=[];for(let e=0;e<i.length;++e)r.push({element:i[e],datasetIndex:t,index:e})}return r},point:(e,t,i,s)=>is(e,ai(t,e),i.axis||"xy",s,i.includeInvisible||!1),nearest(e,t,i,s){const n=ai(t,e),o=i.axis||"xy",a=i.includeInvisible||!1;return ss(e,n,o,i.intersect,s,a)},x:(e,t,i,s)=>ns(e,ai(t,e),"x",i.intersect,s),y:(e,t,i,s)=>ns(e,ai(t,e),"y",i.intersect,s)}};const as=["left","top","right","bottom"];function rs(e,t){return e.filter(e=>e.pos===t)}function ls(e,t){return e.filter(e=>-1===as.indexOf(e.pos)&&e.box.axis===t)}function hs(e,t){return e.sort((e,i)=>{const s=t?i:e,n=t?e:i;return s.weight===n.weight?s.index-n.index:s.weight-n.weight})}function cs(e,t,i,s){return Math.max(e[i],t[i])+Math.max(e[s],t[s])}function ds(e,t){e.top=Math.max(e.top,t.top),e.left=Math.max(e.left,t.left),e.bottom=Math.max(e.bottom,t.bottom),e.right=Math.max(e.right,t.right)}function us(e,t,i,s){const{pos:n,box:o}=i,a=e.maxPadding;if(!K(n)){i.size&&(e[n]-=i.size);const t=s[i.stack]||{size:0,count:1};t.size=Math.max(t.size,i.horizontal?o.height:o.width),i.size=t.size/t.count,e[n]+=i.size}o.getPadding&&ds(a,o.getPadding());const r=Math.max(0,t.outerWidth-cs(a,e,"left","right")),l=Math.max(0,t.outerHeight-cs(a,e,"top","bottom")),h=r!==e.w,c=l!==e.h;return e.w=r,e.h=l,i.horizontal?{same:h,other:c}:{same:c,other:h}}function ps(e,t){const i=t.maxPadding;return function(e){const s={left:0,top:0,right:0,bottom:0};return e.forEach(e=>{s[e]=Math.max(t[e],i[e])}),s}(e?["left","right"]:["top","bottom"])}function ms(e,t,i,s){const n=[];let o,a,r,l,h,c;for(o=0,a=e.length,h=0;o<a;++o){r=e[o],l=r.box,l.update(r.width||t.w,r.height||t.h,ps(r.horizontal,t));const{same:a,other:d}=us(t,i,r,s);h|=a&&n.length,c=c||d,l.fullSize||n.push(r)}return h&&ms(n,t,i,s)||c}function gs(e,t,i,s,n){e.top=i,e.left=t,e.right=t+s,e.bottom=i+n,e.width=s,e.height=n}function bs(e,t,i,s){const n=i.padding;let{x:o,y:a}=t;for(const r of e){const e=r.box,l=s[r.stack]||{count:1,placed:0,weight:1},h=r.stackWeight/l.weight||1;if(r.horizontal){const s=t.w*h,o=l.size||e.height;de(l.start)&&(a=l.start),e.fullSize?gs(e,n.left,a,i.outerWidth-n.right-n.left,o):gs(e,t.left+l.placed,a,s,o),l.start=a,l.placed+=s,a=e.bottom}else{const s=t.h*h,a=l.size||e.width;de(l.start)&&(o=l.start),e.fullSize?gs(e,o,n.top,a,i.outerHeight-n.bottom-n.top):gs(e,o,t.top+l.placed,a,s),l.start=o,l.placed+=s,o=e.right}}t.x=o,t.y=a}var fs={addBox(e,t){e.boxes||(e.boxes=[]),t.fullSize=t.fullSize||!1,t.position=t.position||"top",t.weight=t.weight||0,t._layers=t._layers||function(){return[{z:0,draw(e){t.draw(e)}}]},e.boxes.push(t)},removeBox(e,t){const i=e.boxes?e.boxes.indexOf(t):-1;-1!==i&&e.boxes.splice(i,1)},configure(e,t,i){t.fullSize=i.fullSize,t.position=i.position,t.weight=i.weight},update(e,t,i,s){if(!e)return;const n=jt(e.options.layout.padding),o=Math.max(t-n.width,0),a=Math.max(i-n.height,0),r=function(e){const t=function(e){const t=[];let i,s,n,o,a,r;for(i=0,s=(e||[]).length;i<s;++i)n=e[i],({position:o,options:{stack:a,stackWeight:r=1}}=n),t.push({index:i,box:n,pos:o,horizontal:n.isHorizontal(),weight:n.weight,stack:a&&o+a,stackWeight:r});return t}(e),i=hs(t.filter(e=>e.box.fullSize),!0),s=hs(rs(t,"left"),!0),n=hs(rs(t,"right")),o=hs(rs(t,"top"),!0),a=hs(rs(t,"bottom")),r=ls(t,"x"),l=ls(t,"y");return{fullSize:i,leftAndTop:s.concat(o),rightAndBottom:n.concat(l).concat(a).concat(r),chartArea:rs(t,"chartArea"),vertical:s.concat(n).concat(l),horizontal:o.concat(a).concat(r)}}(e.boxes),l=r.vertical,h=r.horizontal;ee(e.boxes,e=>{"function"==typeof e.beforeLayout&&e.beforeLayout()});const c=l.reduce((e,t)=>t.box.options&&!1===t.box.options.display?e:e+1,0)||1,d=Object.freeze({outerWidth:t,outerHeight:i,padding:n,availableWidth:o,availableHeight:a,vBoxMaxWidth:o/2/c,hBoxMaxHeight:a/2}),u=Object.assign({},n);ds(u,jt(s));const p=Object.assign({maxPadding:u,w:o,h:a,x:n.left,y:n.top},n),m=function(e,t){const i=function(e){const t={};for(const i of e){const{stack:e,pos:s,stackWeight:n}=i;if(!e||!as.includes(s))continue;const o=t[e]||(t[e]={count:0,placed:0,weight:0,size:0});o.count++,o.weight+=n}return t}(e),{vBoxMaxWidth:s,hBoxMaxHeight:n}=t;let o,a,r;for(o=0,a=e.length;o<a;++o){r=e[o];const{fullSize:a}=r.box,l=i[r.stack],h=l&&r.stackWeight/l.weight;r.horizontal?(r.width=h?h*s:a&&t.availableWidth,r.height=n):(r.width=s,r.height=h?h*n:a&&t.availableHeight)}return i}(l.concat(h),d);ms(r.fullSize,p,d,m),ms(l,p,d,m),ms(h,p,d,m)&&ms(l,p,d,m),function(e){const t=e.maxPadding;function i(i){const s=Math.max(t[i]-e[i],0);return e[i]+=s,s}e.y+=i("top"),e.x+=i("left"),i("right"),i("bottom")}(p),bs(r.leftAndTop,p,d,m),p.x+=p.w,p.y+=p.h,bs(r.rightAndBottom,p,d,m),e.chartArea={left:p.left,top:p.top,right:p.left+p.w,bottom:p.top+p.h,height:p.h,width:p.w},ee(r.chartArea,t=>{const i=t.box;Object.assign(i,e.chartArea),i.update(p.w,p.h,{left:0,top:0,right:0,bottom:0})})}};class vs{acquireContext(e,t){}releaseContext(e){return!1}addEventListener(e,t,i){}removeEventListener(e,t,i){}getDevicePixelRatio(){return 1}getMaximumSize(e,t,i,s){return t=Math.max(0,t||e.width),i=i||e.height,{width:t,height:Math.max(0,s?Math.floor(t/s):i)}}isAttached(e){return!0}updateConfig(e){}}class ws extends vs{acquireContext(e){return e&&e.getContext&&e.getContext("2d")||null}updateConfig(e){e.options.animation=!1}}const _s="$chartjs",ys={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},xs=e=>null===e||""===e,Cs=!!hi&&{passive:!0};function ks(e,t,i){e&&e.canvas&&e.canvas.removeEventListener(t,i,Cs)}function Es(e,t){for(const i of e)if(i===t||i.contains(t))return!0}function Rs(e,t,i){const s=e.canvas,n=new MutationObserver(e=>{let t=!1;for(const i of e)t=t||Es(i.addedNodes,s),t=t&&!Es(i.removedNodes,s);t&&i()});return n.observe(document,{childList:!0,subtree:!0}),n}function Ms(e,t,i){const s=e.canvas,n=new MutationObserver(e=>{let t=!1;for(const i of e)t=t||Es(i.removedNodes,s),t=t&&!Es(i.addedNodes,s);t&&i()});return n.observe(document,{childList:!0,subtree:!0}),n}const Ts=new Map;let Ss=0;function Ds(){const e=window.devicePixelRatio;e!==Ss&&(Ss=e,Ts.forEach((t,i)=>{i.currentDevicePixelRatio!==e&&t()}))}function js(e,t,i){const s=e.canvas,n=s&&ti(s);if(!n)return;const o=Ve((e,t)=>{const s=n.clientWidth;i(e,t),s<n.clientWidth&&i()},window),a=new ResizeObserver(e=>{const t=e[0],i=t.contentRect.width,s=t.contentRect.height;0===i&&0===s||o(i,s)});return a.observe(n),function(e,t){Ts.size||window.addEventListener("resize",Ds),Ts.set(e,t)}(e,o),a}function Ns(e,t,i){i&&i.disconnect(),"resize"===t&&function(e){Ts.delete(e),Ts.size||window.removeEventListener("resize",Ds)}(e)}function Ls(e,t,i){const s=e.canvas,n=Ve(t=>{null!==e.ctx&&i(function(e,t){const i=ys[e.type]||e.type,{x:s,y:n}=ai(e,t);return{type:i,chart:t,native:e,x:void 0!==s?s:null,y:void 0!==n?n:null}}(t,e))},e);return function(e,t,i){e&&e.addEventListener(t,i,Cs)}(s,t,n),n}class Ps extends vs{acquireContext(e,t){const i=e&&e.getContext&&e.getContext("2d");return i&&i.canvas===e?(function(e,t){const i=e.style,s=e.getAttribute("height"),n=e.getAttribute("width");if(e[_s]={initial:{height:s,width:n,style:{display:i.display,height:i.height,width:i.width}}},i.display=i.display||"block",i.boxSizing=i.boxSizing||"border-box",xs(n)){const t=ci(e,"width");void 0!==t&&(e.width=t)}if(xs(s))if(""===e.style.height)e.height=e.width/(t||2);else{const t=ci(e,"height");void 0!==t&&(e.height=t)}}(e,t),i):null}releaseContext(e){const t=e.canvas;if(!t[_s])return!1;const i=t[_s].initial;["height","width"].forEach(e=>{const s=i[e];$(s)?t.removeAttribute(e):t.setAttribute(e,s)});const s=i.style||{};return Object.keys(s).forEach(e=>{t.style[e]=s[e]}),t.width=t.width,delete t[_s],!0}addEventListener(e,t,i){this.removeEventListener(e,t);const s=e.$proxies||(e.$proxies={}),n={attach:Rs,detach:Ms,resize:js}[t]||Ls;s[t]=n(e,t,i)}removeEventListener(e,t){const i=e.$proxies||(e.$proxies={}),s=i[t];s&&(({attach:Ns,detach:Ns,resize:Ns}[t]||ks)(e,t,s),i[t]=void 0)}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(e,t,i,s){return function(e,t,i,s){const n=si(e),o=oi(n,"margin"),a=ii(n.maxWidth,e,"clientWidth")||fe,r=ii(n.maxHeight,e,"clientHeight")||fe,l=function(e,t,i){let s,n;if(void 0===t||void 0===i){const o=e&&ti(e);if(o){const e=o.getBoundingClientRect(),a=si(o),r=oi(a,"border","width"),l=oi(a,"padding");t=e.width-l.width-r.width,i=e.height-l.height-r.height,s=ii(a.maxWidth,o,"clientWidth"),n=ii(a.maxHeight,o,"clientHeight")}else t=e.clientWidth,i=e.clientHeight}return{width:t,height:i,maxWidth:s||fe,maxHeight:n||fe}}(e,t,i);let{width:h,height:c}=l;if("content-box"===n.boxSizing){const e=oi(n,"border","width"),t=oi(n,"padding");h-=t.width+e.width,c-=t.height+e.height}return h=Math.max(0,h-o.width),c=Math.max(0,s?h/s:c-o.height),h=ri(Math.min(h,a,l.maxWidth)),c=ri(Math.min(c,r,l.maxHeight)),h&&!c&&(c=ri(h/2)),(void 0!==t||void 0!==i)&&s&&l.height&&c>l.height&&(c=l.height,h=ri(Math.floor(c*s))),{width:h,height:c}}(e,t,i,s)}isAttached(e){const t=e&&ti(e);return!(!t||!t.isConnected)}}class As{static defaults={};static defaultRoutes=void 0;x;y;active=!1;options;$animations;tooltipPosition(e){const{x:t,y:i}=this.getProps(["x","y"],e);return{x:t,y:i}}hasValue(){return Re(this.x)&&Re(this.y)}getProps(e,t){const i=this.$animations;if(!t||!i)return this;const s={};return e.forEach(e=>{s[e]=i[e]&&i[e].active()?i[e]._to:this[e]}),s}}function zs(e,t,i,s,n){const o=J(s,0),a=Math.min(J(n,e.length),e.length);let r,l,h,c=0;for(i=Math.ceil(i),n&&(r=n-s,i=r/Math.floor(r/i)),h=o;h<0;)c++,h=Math.round(o+c*i);for(l=Math.max(o,0);l<a;l++)l===h&&(t.push(e[l]),c++,h=Math.round(o+c*i))}const Fs=(e,t,i)=>"top"===t||"left"===t?e[t]+i:e[t]-i,Os=(e,t)=>Math.min(t||e,e);function Hs(e,t){const i=[],s=e.length/t,n=e.length;let o=0;for(;o<n;o+=s)i.push(e[Math.floor(o)]);return i}function Is(e,t,i){const s=e.ticks.length,n=Math.min(t,s-1),o=e._startPixel,a=e._endPixel,r=1e-6;let l,h=e.getPixelForTick(n);if(!(i&&(l=1===s?Math.max(h-o,a-h):0===t?(e.getPixelForTick(1)-h)/2:(h-e.getPixelForTick(n-1))/2,h+=n<t?l:-l,h<o-r||h>a+r)))return h}function Bs(e){return e.drawTicks?e.tickLength:0}function Vs(e,t){if(!e.display)return 0;const i=Nt(e.font,t),s=jt(e.padding);return(Y(e.text)?e.text.length:1)*i.lineHeight+s.height}function Ws(e,t,i){let s=We(e);return(i&&"right"!==t||!i&&"right"===t)&&(s=(e=>"left"===e?"right":"right"===e?"left":e)(s)),s}class Gs extends As{constructor(e){super(),this.id=e.id,this.type=e.type,this.options=void 0,this.ctx=e.ctx,this.chart=e.chart,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this._margins={left:0,right:0,top:0,bottom:0},this.maxWidth=void 0,this.maxHeight=void 0,this.paddingTop=void 0,this.paddingBottom=void 0,this.paddingLeft=void 0,this.paddingRight=void 0,this.axis=void 0,this.labelRotation=void 0,this.min=void 0,this.max=void 0,this._range=void 0,this.ticks=[],this._gridLineItems=null,this._labelItems=null,this._labelSizes=null,this._length=0,this._maxLength=0,this._longestTextCache={},this._startPixel=void 0,this._endPixel=void 0,this._reversePixels=!1,this._userMax=void 0,this._userMin=void 0,this._suggestedMax=void 0,this._suggestedMin=void 0,this._ticksLength=0,this._borderValue=0,this._cache={},this._dataLimitsCached=!1,this.$context=void 0}init(e){this.options=e.setContext(this.getContext()),this.axis=e.axis,this._userMin=this.parse(e.min),this._userMax=this.parse(e.max),this._suggestedMin=this.parse(e.suggestedMin),this._suggestedMax=this.parse(e.suggestedMax)}parse(e,t){return e}getUserBounds(){let{_userMin:e,_userMax:t,_suggestedMin:i,_suggestedMax:s}=this;return e=q(e,Number.POSITIVE_INFINITY),t=q(t,Number.NEGATIVE_INFINITY),i=q(i,Number.POSITIVE_INFINITY),s=q(s,Number.NEGATIVE_INFINITY),{min:q(e,i),max:q(t,s),minDefined:X(e),maxDefined:X(t)}}getMinMax(e){let t,{min:i,max:s,minDefined:n,maxDefined:o}=this.getUserBounds();if(n&&o)return{min:i,max:s};const a=this.getMatchingVisibleMetas();for(let r=0,l=a.length;r<l;++r)t=a[r].controller.getMinMax(this,e),n||(i=Math.min(i,t.min)),o||(s=Math.max(s,t.max));return i=o&&i>s?s:i,s=n&&i>s?i:s,{min:q(i,q(s,i)),max:q(s,q(i,s))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){const e=this.chart.data;return this.options.labels||(this.isHorizontal()?e.xLabels:e.yLabels)||e.labels||[]}getLabelItems(e=this.chart.chartArea){return this._labelItems||(this._labelItems=this._computeLabelItems(e))}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){Q(this.options.beforeUpdate,[this])}update(e,t,i){const{beginAtZero:s,grace:n,ticks:o}=this.options,a=o.sampleSize;this.beforeUpdate(),this.maxWidth=e,this.maxHeight=t,this._margins=i=Object.assign({left:0,right:0,top:0,bottom:0},i),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+i.left+i.right:this.height+i.top+i.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=function(e,t,i){const{min:s,max:n}=e,o=Z(t,(n-s)/2),a=(e,t)=>i&&0===e?0:e+t;return{min:a(s,-Math.abs(o)),max:a(n,o)}}(this,n,s),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const r=a<this.ticks.length;this._convertTicksToLabels(r?Hs(this.ticks,a):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),o.display&&(o.autoSkip||"auto"===o.source)&&(this.ticks=function(e,t){const i=e.options.ticks,s=function(e){const t=e.options.offset,i=e._tickSize(),s=e._length/i+(t?0:1),n=e._maxLength/i;return Math.floor(Math.min(s,n))}(e),n=Math.min(i.maxTicksLimit||s,s),o=i.major.enabled?function(e){const t=[];let i,s;for(i=0,s=e.length;i<s;i++)e[i].major&&t.push(i);return t}(t):[],a=o.length,r=o[0],l=o[a-1],h=[];if(a>n)return function(e,t,i,s){let n,o=0,a=i[0];for(s=Math.ceil(s),n=0;n<e.length;n++)n===a&&(t.push(e[n]),o++,a=i[o*s])}(t,h,o,a/n),h;const c=function(e,t,i){const s=function(e){const t=e.length;let i,s;if(t<2)return!1;for(s=e[0],i=1;i<t;++i)if(e[i]-e[i-1]!==s)return!1;return s}(e),n=t.length/i;if(!s)return Math.max(n,1);const o=function(e){const t=[],i=Math.sqrt(e);let s;for(s=1;s<i;s++)e%s===0&&(t.push(s),t.push(e/s));return i===(0|i)&&t.push(i),t.sort((e,t)=>e-t).pop(),t}(s);for(let e=0,t=o.length-1;e<t;e++){const t=o[e];if(t>n)return t}return Math.max(n,1)}(o,t,n);if(a>0){let e,i;const s=a>1?Math.round((l-r)/(a-1)):null;for(zs(t,h,c,$(s)?0:r-s,r),e=0,i=a-1;e<i;e++)zs(t,h,c,o[e],o[e+1]);return zs(t,h,c,l,$(s)?t.length:l+s),h}return zs(t,h,c),h}(this,this.ticks),this._labelSizes=null,this.afterAutoSkip()),r&&this._convertTicksToLabels(this.ticks),this.beforeFit(),this.fit(),this.afterFit(),this.afterUpdate()}configure(){let e,t,i=this.options.reverse;this.isHorizontal()?(e=this.left,t=this.right):(e=this.top,t=this.bottom,i=!i),this._startPixel=e,this._endPixel=t,this._reversePixels=i,this._length=t-e,this._alignToPixels=this.options.alignToPixels}afterUpdate(){Q(this.options.afterUpdate,[this])}beforeSetDimensions(){Q(this.options.beforeSetDimensions,[this])}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=0,this.right=this.width):(this.height=this.maxHeight,this.top=0,this.bottom=this.height),this.paddingLeft=0,this.paddingTop=0,this.paddingRight=0,this.paddingBottom=0}afterSetDimensions(){Q(this.options.afterSetDimensions,[this])}_callHooks(e){this.chart.notifyPlugins(e,this.getContext()),Q(this.options[e],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){Q(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(e){const t=this.options.ticks;let i,s,n;for(i=0,s=e.length;i<s;i++)n=e[i],n.label=Q(t.callback,[n.value,i,e],this)}afterTickToLabelConversion(){Q(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){Q(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){const e=this.options,t=e.ticks,i=Os(this.ticks.length,e.ticks.maxTicksLimit),s=t.minRotation||0,n=t.maxRotation;let o,a,r,l=s;if(!this._isVisible()||!t.display||s>=n||i<=1||!this.isHorizontal())return void(this.labelRotation=s);const h=this._getLabelSizes(),c=h.widest.width,d=h.highest.height,u=Pe(this.chart.width-c,0,this.maxWidth);o=e.offset?this.maxWidth/i:u/(i-1),c+6>o&&(o=u/(i-(e.offset?.5:1)),a=this.maxHeight-Bs(e.grid)-t.padding-Vs(e.title,this.chart.options.font),r=Math.sqrt(c*c+d*d),l=Math.min(Math.asin(Pe((h.highest.height+6)/o,-1,1)),Math.asin(Pe(a/r,-1,1))-Math.asin(Pe(d/r,-1,1)))*(180/me),l=Math.max(s,Math.min(n,l))),this.labelRotation=l}afterCalculateLabelRotation(){Q(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){Q(this.options.beforeFit,[this])}fit(){const e={width:0,height:0},{chart:t,options:{ticks:i,title:s,grid:n}}=this,o=this._isVisible(),a=this.isHorizontal();if(o){const o=Vs(s,t.options.font);if(a?(e.width=this.maxWidth,e.height=Bs(n)+o):(e.height=this.maxHeight,e.width=Bs(n)+o),i.display&&this.ticks.length){const{first:t,last:s,widest:n,highest:o}=this._getLabelSizes(),r=2*i.padding,l=Me(this.labelRotation),h=Math.cos(l),c=Math.sin(l);if(a){const t=i.mirror?0:c*n.width+h*o.height;e.height=Math.min(this.maxHeight,e.height+t+r)}else{const t=i.mirror?0:h*n.width+c*o.height;e.width=Math.min(this.maxWidth,e.width+t+r)}this._calculatePadding(t,s,c,h)}}this._handleMargins(),a?(this.width=this._length=t.width-this._margins.left-this._margins.right,this.height=e.height):(this.width=e.width,this.height=this._length=t.height-this._margins.top-this._margins.bottom)}_calculatePadding(e,t,i,s){const{ticks:{align:n,padding:o},position:a}=this.options,r=0!==this.labelRotation,l="top"!==a&&"x"===this.axis;if(this.isHorizontal()){const a=this.getPixelForTick(0)-this.left,h=this.right-this.getPixelForTick(this.ticks.length-1);let c=0,d=0;r?l?(c=s*e.width,d=i*t.height):(c=i*e.height,d=s*t.width):"start"===n?d=t.width:"end"===n?c=e.width:"inner"!==n&&(c=e.width/2,d=t.width/2),this.paddingLeft=Math.max((c-a+o)*this.width/(this.width-a),0),this.paddingRight=Math.max((d-h+o)*this.width/(this.width-h),0)}else{let i=t.height/2,s=e.height/2;"start"===n?(i=0,s=e.height):"end"===n&&(i=t.height,s=0),this.paddingTop=i+o,this.paddingBottom=s+o}}_handleMargins(){this._margins&&(this._margins.left=Math.max(this.paddingLeft,this._margins.left),this._margins.top=Math.max(this.paddingTop,this._margins.top),this._margins.right=Math.max(this.paddingRight,this._margins.right),this._margins.bottom=Math.max(this.paddingBottom,this._margins.bottom))}afterFit(){Q(this.options.afterFit,[this])}isHorizontal(){const{axis:e,position:t}=this.options;return"top"===t||"bottom"===t||"x"===e}isFullSize(){return this.options.fullSize}_convertTicksToLabels(e){let t,i;for(this.beforeTickToLabelConversion(),this.generateTickLabels(e),t=0,i=e.length;t<i;t++)$(e[t].label)&&(e.splice(t,1),i--,t--);this.afterTickToLabelConversion()}_getLabelSizes(){let e=this._labelSizes;if(!e){const t=this.options.ticks.sampleSize;let i=this.ticks;t<i.length&&(i=Hs(i,t)),this._labelSizes=e=this._computeLabelSizes(i,i.length,this.options.ticks.maxTicksLimit)}return e}_computeLabelSizes(e,t,i){const{ctx:s,_longestTextCache:n}=this,o=[],a=[],r=Math.floor(t/Os(t,i));let l,h,c,d,u,p,m,g,b,f,v,w=0,_=0;for(l=0;l<t;l+=r){if(d=e[l].label,u=this._resolveTickFontOptions(l),s.font=p=u.string,m=n[p]=n[p]||{data:{},gc:[]},g=u.lineHeight,b=f=0,$(d)||Y(d)){if(Y(d))for(h=0,c=d.length;h<c;++h)v=d[h],$(v)||Y(v)||(b=ct(s,m.data,m.gc,b,v),f+=g)}else b=ct(s,m.data,m.gc,b,d),f=g;o.push(b),a.push(f),w=Math.max(b,w),_=Math.max(f,_)}!function(e,t){ee(e,e=>{const i=e.gc,s=i.length/2;let n;if(s>t){for(n=0;n<s;++n)delete e.data[i[n]];i.splice(0,s)}})}(n,t);const y=o.indexOf(w),x=a.indexOf(_),C=e=>({width:o[e]||0,height:a[e]||0});return{first:C(0),last:C(t-1),widest:C(y),highest:C(x),widths:o,heights:a}}getLabelForValue(e){return e}getPixelForValue(e,t){return NaN}getValueForPixel(e){}getPixelForTick(e){const t=this.ticks;return e<0||e>t.length-1?null:this.getPixelForValue(t[e].value)}getPixelForDecimal(e){this._reversePixels&&(e=1-e);const t=this._startPixel+e*this._length;return Pe(this._alignToPixels?dt(this.chart,t,0):t,-32768,32767)}getDecimalForPixel(e){const t=(e-this._startPixel)/this._length;return this._reversePixels?1-t:t}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:e,max:t}=this;return e<0&&t<0?t:e>0&&t>0?e:0}getContext(e){const t=this.ticks||[];if(e>=0&&e<t.length){const i=t[e];return i.$context||(i.$context=function(e,t,i){return Pt(e,{tick:i,index:t,type:"tick"})}(this.getContext(),e,i))}return this.$context||(this.$context=Pt(this.chart.getContext(),{scale:this,type:"scale"}))}_tickSize(){const e=this.options.ticks,t=Me(this.labelRotation),i=Math.abs(Math.cos(t)),s=Math.abs(Math.sin(t)),n=this._getLabelSizes(),o=e.autoSkipPadding||0,a=n?n.widest.width+o:0,r=n?n.highest.height+o:0;return this.isHorizontal()?r*i>a*s?a/i:r/s:r*s<a*i?r/i:a/s}_isVisible(){const e=this.options.display;return"auto"!==e?!!e:this.getMatchingVisibleMetas().length>0}_computeGridLineItems(e){const t=this.axis,i=this.chart,s=this.options,{grid:n,position:o,border:a}=s,r=n.offset,l=this.isHorizontal(),h=this.ticks.length+(r?1:0),c=Bs(n),d=[],u=a.setContext(this.getContext()),p=u.display?u.width:0,m=p/2,g=function(e){return dt(i,e,p)};let b,f,v,w,_,y,x,C,k,E,R,M;if("top"===o)b=g(this.bottom),y=this.bottom-c,C=b-m,E=g(e.top)+m,M=e.bottom;else if("bottom"===o)b=g(this.top),E=e.top,M=g(e.bottom)-m,y=b+m,C=this.top+c;else if("left"===o)b=g(this.right),_=this.right-c,x=b-m,k=g(e.left)+m,R=e.right;else if("right"===o)b=g(this.left),k=e.left,R=g(e.right)-m,_=b+m,x=this.left+c;else if("x"===t){if("center"===o)b=g((e.top+e.bottom)/2+.5);else if(K(o)){const e=Object.keys(o)[0],t=o[e];b=g(this.chart.scales[e].getPixelForValue(t))}E=e.top,M=e.bottom,y=b+m,C=y+c}else if("y"===t){if("center"===o)b=g((e.left+e.right)/2);else if(K(o)){const e=Object.keys(o)[0],t=o[e];b=g(this.chart.scales[e].getPixelForValue(t))}_=b-m,x=_-c,k=e.left,R=e.right}const T=J(s.ticks.maxTicksLimit,h),S=Math.max(1,Math.ceil(h/T));for(f=0;f<h;f+=S){const e=this.getContext(f),t=n.setContext(e),s=a.setContext(e),o=t.lineWidth,h=t.color,c=s.dash||[],u=s.dashOffset,p=t.tickWidth,m=t.tickColor,g=t.tickBorderDash||[],b=t.tickBorderDashOffset;v=Is(this,f,r),void 0!==v&&(w=dt(i,v,o),l?_=x=k=R=w:y=C=E=M=w,d.push({tx1:_,ty1:y,tx2:x,ty2:C,x1:k,y1:E,x2:R,y2:M,width:o,color:h,borderDash:c,borderDashOffset:u,tickWidth:p,tickColor:m,tickBorderDash:g,tickBorderDashOffset:b}))}return this._ticksLength=h,this._borderValue=b,d}_computeLabelItems(e){const t=this.axis,i=this.options,{position:s,ticks:n}=i,o=this.isHorizontal(),a=this.ticks,{align:r,crossAlign:l,padding:h,mirror:c}=n,d=Bs(i.grid),u=d+h,p=c?-h:u,m=-Me(this.labelRotation),g=[];let b,f,v,w,_,y,x,C,k,E,R,M,T="middle";if("top"===s)y=this.bottom-p,x=this._getXAxisLabelAlignment();else if("bottom"===s)y=this.top+p,x=this._getXAxisLabelAlignment();else if("left"===s){const e=this._getYAxisLabelAlignment(d);x=e.textAlign,_=e.x}else if("right"===s){const e=this._getYAxisLabelAlignment(d);x=e.textAlign,_=e.x}else if("x"===t){if("center"===s)y=(e.top+e.bottom)/2+u;else if(K(s)){const e=Object.keys(s)[0],t=s[e];y=this.chart.scales[e].getPixelForValue(t)+u}x=this._getXAxisLabelAlignment()}else if("y"===t){if("center"===s)_=(e.left+e.right)/2-u;else if(K(s)){const e=Object.keys(s)[0],t=s[e];_=this.chart.scales[e].getPixelForValue(t)}x=this._getYAxisLabelAlignment(d).textAlign}"y"===t&&("start"===r?T="top":"end"===r&&(T="bottom"));const S=this._getLabelSizes();for(b=0,f=a.length;b<f;++b){v=a[b],w=v.label;const e=n.setContext(this.getContext(b));C=this.getPixelForTick(b)+n.labelOffset,k=this._resolveTickFontOptions(b),E=k.lineHeight,R=Y(w)?w.length:1;const t=R/2,i=e.color,r=e.textStrokeColor,h=e.textStrokeWidth;let d,u=x;if(o?(_=C,"inner"===x&&(u=b===f-1?this.options.reverse?"left":"right":0===b?this.options.reverse?"right":"left":"center"),M="top"===s?"near"===l||0!==m?-R*E+E/2:"center"===l?-S.highest.height/2-t*E+E:-S.highest.height+E/2:"near"===l||0!==m?E/2:"center"===l?S.highest.height/2-t*E:S.highest.height-R*E,c&&(M*=-1),0===m||e.showLabelBackdrop||(_+=E/2*Math.sin(m))):(y=C,M=(1-R)*E/2),e.showLabelBackdrop){const t=jt(e.backdropPadding),i=S.heights[b],s=S.widths[b];let n=M-t.top,o=0-t.left;switch(T){case"middle":n-=i/2;break;case"bottom":n-=i}switch(x){case"center":o-=s/2;break;case"right":o-=s;break;case"inner":b===f-1?o-=s:b>0&&(o-=s/2)}d={left:o,top:n,width:s+t.width,height:i+t.height,color:e.backdropColor}}g.push({label:w,font:k,textOffset:M,options:{rotation:m,color:i,strokeColor:r,strokeWidth:h,textAlign:u,textBaseline:T,translation:[_,y],backdrop:d}})}return g}_getXAxisLabelAlignment(){const{position:e,ticks:t}=this.options;if(-Me(this.labelRotation))return"top"===e?"left":"right";let i="center";return"start"===t.align?i="left":"end"===t.align?i="right":"inner"===t.align&&(i="inner"),i}_getYAxisLabelAlignment(e){const{position:t,ticks:{crossAlign:i,mirror:s,padding:n}}=this.options,o=e+n,a=this._getLabelSizes().widest.width;let r,l;return"left"===t?s?(l=this.right+n,"near"===i?r="left":"center"===i?(r="center",l+=a/2):(r="right",l+=a)):(l=this.right-o,"near"===i?r="right":"center"===i?(r="center",l-=a/2):(r="left",l=this.left)):"right"===t?s?(l=this.left+n,"near"===i?r="right":"center"===i?(r="center",l-=a/2):(r="left",l-=a)):(l=this.left+o,"near"===i?r="left":"center"===i?(r="center",l+=a/2):(r="right",l=this.right)):r="right",{textAlign:r,x:l}}_computeLabelArea(){if(this.options.ticks.mirror)return;const e=this.chart,t=this.options.position;return"left"===t||"right"===t?{top:0,left:this.left,bottom:e.height,right:this.right}:"top"===t||"bottom"===t?{top:this.top,left:0,bottom:this.bottom,right:e.width}:void 0}drawBackground(){const{ctx:e,options:{backgroundColor:t},left:i,top:s,width:n,height:o}=this;t&&(e.save(),e.fillStyle=t,e.fillRect(i,s,n,o),e.restore())}getLineWidthForValue(e){const t=this.options.grid;if(!this._isVisible()||!t.display)return 0;const i=this.ticks.findIndex(t=>t.value===e);return i>=0?t.setContext(this.getContext(i)).lineWidth:0}drawGrid(e){const t=this.options.grid,i=this.ctx,s=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(e));let n,o;const a=(e,t,s)=>{s.width&&s.color&&(i.save(),i.lineWidth=s.width,i.strokeStyle=s.color,i.setLineDash(s.borderDash||[]),i.lineDashOffset=s.borderDashOffset,i.beginPath(),i.moveTo(e.x,e.y),i.lineTo(t.x,t.y),i.stroke(),i.restore())};if(t.display)for(n=0,o=s.length;n<o;++n){const e=s[n];t.drawOnChartArea&&a({x:e.x1,y:e.y1},{x:e.x2,y:e.y2},e),t.drawTicks&&a({x:e.tx1,y:e.ty1},{x:e.tx2,y:e.ty2},{color:e.tickColor,width:e.tickWidth,borderDash:e.tickBorderDash,borderDashOffset:e.tickBorderDashOffset})}}drawBorder(){const{chart:e,ctx:t,options:{border:i,grid:s}}=this,n=i.setContext(this.getContext()),o=i.display?n.width:0;if(!o)return;const a=s.setContext(this.getContext(0)).lineWidth,r=this._borderValue;let l,h,c,d;this.isHorizontal()?(l=dt(e,this.left,o)-o/2,h=dt(e,this.right,a)+a/2,c=d=r):(c=dt(e,this.top,o)-o/2,d=dt(e,this.bottom,a)+a/2,l=h=r),t.save(),t.lineWidth=n.width,t.strokeStyle=n.color,t.beginPath(),t.moveTo(l,c),t.lineTo(h,d),t.stroke(),t.restore()}drawLabels(e){if(!this.options.ticks.display)return;const t=this.ctx,i=this._computeLabelArea();i&&bt(t,i);const s=this.getLabelItems(e);for(const e of s){const i=e.options,s=e.font;xt(t,e.label,0,e.textOffset,s,i)}i&&ft(t)}drawTitle(){const{ctx:e,options:{position:t,title:i,reverse:s}}=this;if(!i.display)return;const n=Nt(i.font),o=jt(i.padding),a=i.align;let r=n.lineHeight/2;"bottom"===t||"center"===t||K(t)?(r+=o.bottom,Y(i.text)&&(r+=n.lineHeight*(i.text.length-1))):r+=o.top;const{titleX:l,titleY:h,maxWidth:c,rotation:d}=function(e,t,i,s){const{top:n,left:o,bottom:a,right:r,chart:l}=e,{chartArea:h,scales:c}=l;let d,u,p,m=0;const g=a-n,b=r-o;if(e.isHorizontal()){if(u=Ge(s,o,r),K(i)){const e=Object.keys(i)[0],s=i[e];p=c[e].getPixelForValue(s)+g-t}else p="center"===i?(h.bottom+h.top)/2+g-t:Fs(e,i,t);d=r-o}else{if(K(i)){const e=Object.keys(i)[0],s=i[e];u=c[e].getPixelForValue(s)-b+t}else u="center"===i?(h.left+h.right)/2-b+t:Fs(e,i,t);p=Ge(s,a,n),m="left"===i?-we:we}return{titleX:u,titleY:p,maxWidth:d,rotation:m}}(this,r,t,a);xt(e,i.text,0,0,n,{color:i.color,maxWidth:c,rotation:d,textAlign:Ws(a,t,s),textBaseline:"middle",translation:[l,h]})}draw(e){this._isVisible()&&(this.drawBackground(),this.drawGrid(e),this.drawBorder(),this.drawTitle(),this.drawLabels(e))}_layers(){const e=this.options,t=e.ticks&&e.ticks.z||0,i=J(e.grid&&e.grid.z,-1),s=J(e.border&&e.border.z,0);return this._isVisible()&&this.draw===Gs.prototype.draw?[{z:i,draw:e=>{this.drawBackground(),this.drawGrid(e),this.drawTitle()}},{z:s,draw:()=>{this.drawBorder()}},{z:t,draw:e=>{this.drawLabels(e)}}]:[{z:t,draw:e=>{this.draw(e)}}]}getMatchingVisibleMetas(e){const t=this.chart.getSortedVisibleDatasetMetas(),i=this.axis+"AxisID",s=[];let n,o;for(n=0,o=t.length;n<o;++n){const o=t[n];o[i]!==this.id||e&&o.type!==e||s.push(o)}return s}_resolveTickFontOptions(e){return Nt(this.options.ticks.setContext(this.getContext(e)).font)}_maxDigits(){const e=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/e}}class Us{constructor(e,t,i){this.type=e,this.scope=t,this.override=i,this.items=Object.create(null)}isForType(e){return Object.prototype.isPrototypeOf.call(this.type.prototype,e.prototype)}register(e){const t=Object.getPrototypeOf(e);let i;(function(e){return"id"in e&&"defaults"in e})(t)&&(i=this.register(t));const s=this.items,n=e.id,o=this.scope+"."+n;if(!n)throw new Error("class does not have id: "+e);return n in s||(s[n]=e,function(e,t,i){const s=oe(Object.create(null),[i?ht.get(i):{},ht.get(t),e.defaults]);ht.set(t,s),e.defaultRoutes&&function(e,t){Object.keys(t).forEach(i=>{const s=i.split("."),n=s.pop(),o=[e].concat(s).join("."),a=t[i].split("."),r=a.pop(),l=a.join(".");ht.route(o,n,l,r)})}(t,e.defaultRoutes),e.descriptors&&ht.describe(t,e.descriptors)}(e,o,i),this.override&&ht.override(e.id,e.overrides)),o}get(e){return this.items[e]}unregister(e){const t=this.items,i=e.id,s=this.scope;i in t&&delete t[i],s&&i in ht[s]&&(delete ht[s][i],this.override&&delete nt[i])}}class $s{constructor(){this.controllers=new Us(Vi,"datasets",!0),this.elements=new Us(As,"elements"),this.plugins=new Us(Object,"plugins"),this.scales=new Us(Gs,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...e){this._each("register",e)}remove(...e){this._each("unregister",e)}addControllers(...e){this._each("register",e,this.controllers)}addElements(...e){this._each("register",e,this.elements)}addPlugins(...e){this._each("register",e,this.plugins)}addScales(...e){this._each("register",e,this.scales)}getController(e){return this._get(e,this.controllers,"controller")}getElement(e){return this._get(e,this.elements,"element")}getPlugin(e){return this._get(e,this.plugins,"plugin")}getScale(e){return this._get(e,this.scales,"scale")}removeControllers(...e){this._each("unregister",e,this.controllers)}removeElements(...e){this._each("unregister",e,this.elements)}removePlugins(...e){this._each("unregister",e,this.plugins)}removeScales(...e){this._each("unregister",e,this.scales)}_each(e,t,i){[...t].forEach(t=>{const s=i||this._getRegistryForType(t);i||s.isForType(t)||s===this.plugins&&t.id?this._exec(e,s,t):ee(t,t=>{const s=i||this._getRegistryForType(t);this._exec(e,s,t)})})}_exec(e,t,i){const s=ce(e);Q(i["before"+s],[],i),t[e](i),Q(i["after"+s],[],i)}_getRegistryForType(e){for(let t=0;t<this._typedRegistries.length;t++){const i=this._typedRegistries[t];if(i.isForType(e))return i}return this.plugins}_get(e,t,i){const s=t.get(e);if(void 0===s)throw new Error('"'+e+'" is not a registered '+i+".");return s}}var Ys=new $s;class Ks{constructor(){this._init=void 0}notify(e,t,i,s){if("beforeInit"===t&&(this._init=this._createDescriptors(e,!0),this._notify(this._init,e,"install")),void 0===this._init)return;const n=s?this._descriptors(e).filter(s):this._descriptors(e),o=this._notify(n,e,t,i);return"afterDestroy"===t&&(this._notify(n,e,"stop"),this._notify(this._init,e,"uninstall"),this._init=void 0),o}_notify(e,t,i,s){s=s||{};for(const n of e){const e=n.plugin;if(!1===Q(e[i],[t,s,n.options],e)&&s.cancelable)return!1}return!0}invalidate(){$(this._cache)||(this._oldCache=this._cache,this._cache=void 0)}_descriptors(e){if(this._cache)return this._cache;const t=this._cache=this._createDescriptors(e);return this._notifyStateChanges(e),t}_createDescriptors(e,t){const i=e&&e.config,s=J(i.options&&i.options.plugins,{}),n=function(e){const t={},i=[],s=Object.keys(Ys.plugins.items);for(let e=0;e<s.length;e++)i.push(Ys.getPlugin(s[e]));const n=e.plugins||[];for(let e=0;e<n.length;e++){const s=n[e];-1===i.indexOf(s)&&(i.push(s),t[s.id]=!0)}return{plugins:i,localIds:t}}(i);return!1!==s||t?function(e,{plugins:t,localIds:i},s,n){const o=[],a=e.getContext();for(const r of t){const t=r.id,l=Xs(s[t],n);null!==l&&o.push({plugin:r,options:qs(e.config,{plugin:r,local:i[t]},l,a)})}return o}(e,n,s,t):[]}_notifyStateChanges(e){const t=this._oldCache||[],i=this._cache,s=(e,t)=>e.filter(e=>!t.some(t=>e.plugin.id===t.plugin.id));this._notify(s(t,i),e,"stop"),this._notify(s(i,t),e,"start")}}function Xs(e,t){return t||!1!==e?!0===e?{}:e:null}function qs(e,{plugin:t,local:i},s,n){const o=e.pluginScopeKeys(t),a=e.getOptionScopes(s,o);return i&&t.defaults&&a.push(t.defaults),e.createResolver(a,n,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function Js(e,t){const i=ht.datasets[e]||{};return((t.datasets||{})[e]||{}).indexAxis||t.indexAxis||i.indexAxis||"x"}function Zs(e){if("x"===e||"y"===e||"r"===e)return e}function Qs(e){return"top"===e||"bottom"===e?"x":"left"===e||"right"===e?"y":void 0}function en(e,...t){if(Zs(e))return e;for(const i of t){const t=i.axis||Qs(i.position)||e.length>1&&Zs(e[0].toLowerCase());if(t)return t}throw new Error(`Cannot determine type of '${e}' axis. Please provide 'axis' or 'position' option.`)}function tn(e,t,i){if(i[t+"AxisID"]===e)return{axis:t}}function sn(e){const t=e.options||(e.options={});t.plugins=J(t.plugins,{}),t.scales=function(e,t){const i=nt[e.type]||{scales:{}},s=t.scales||{},n=Js(e.type,t),o=Object.create(null);return Object.keys(s).forEach(t=>{const a=s[t];if(!K(a))return console.error(`Invalid scale configuration for scale: ${t}`);if(a._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${t}`);const r=en(t,a,function(e,t){if(t.data&&t.data.datasets){const i=t.data.datasets.filter(t=>t.xAxisID===e||t.yAxisID===e);if(i.length)return tn(e,"x",i[0])||tn(e,"y",i[0])}return{}}(t,e),ht.scales[a.type]),l=function(e,t){return e===t?"_index_":"_value_"}(r,n),h=i.scales||{};o[t]=ae(Object.create(null),[{axis:r},a,h[r],h[l]])}),e.data.datasets.forEach(i=>{const n=i.type||e.type,a=i.indexAxis||Js(n,t),r=(nt[n]||{}).scales||{};Object.keys(r).forEach(e=>{const t=function(e,t){let i=e;return"_index_"===e?i=t:"_value_"===e&&(i="x"===t?"y":"x"),i}(e,a),n=i[t+"AxisID"]||t;o[n]=o[n]||Object.create(null),ae(o[n],[{axis:t},s[n],r[e]])})}),Object.keys(o).forEach(e=>{const t=o[e];ae(t,[ht.scales[t.type],ht.scale])}),o}(e,t)}function nn(e){return(e=e||{}).datasets=e.datasets||[],e.labels=e.labels||[],e}const on=new Map,an=new Set;function rn(e,t){let i=on.get(e);return i||(i=t(),on.set(e,i),an.add(i)),i}const ln=(e,t,i)=>{const s=he(t,i);void 0!==s&&e.add(s)};class hn{constructor(e){this._config=function(e){return(e=e||{}).data=nn(e.data),sn(e),e}(e),this._scopeCache=new Map,this._resolverCache=new Map}get platform(){return this._config.platform}get type(){return this._config.type}set type(e){this._config.type=e}get data(){return this._config.data}set data(e){this._config.data=nn(e)}get options(){return this._config.options}set options(e){this._config.options=e}get plugins(){return this._config.plugins}update(){const e=this._config;this.clearCache(),sn(e)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(e){return rn(e,()=>[[`datasets.${e}`,""]])}datasetAnimationScopeKeys(e,t){return rn(`${e}.transition.${t}`,()=>[[`datasets.${e}.transitions.${t}`,`transitions.${t}`],[`datasets.${e}`,""]])}datasetElementScopeKeys(e,t){return rn(`${e}-${t}`,()=>[[`datasets.${e}.elements.${t}`,`datasets.${e}`,`elements.${t}`,""]])}pluginScopeKeys(e){const t=e.id;return rn(`${this.type}-plugin-${t}`,()=>[[`plugins.${t}`,...e.additionalOptionScopes||[]]])}_cachedScopes(e,t){const i=this._scopeCache;let s=i.get(e);return s&&!t||(s=new Map,i.set(e,s)),s}getOptionScopes(e,t,i){const{options:s,type:n}=this,o=this._cachedScopes(e,i),a=o.get(t);if(a)return a;const r=new Set;t.forEach(t=>{e&&(r.add(e),t.forEach(t=>ln(r,e,t))),t.forEach(e=>ln(r,s,e)),t.forEach(e=>ln(r,nt[n]||{},e)),t.forEach(e=>ln(r,ht,e)),t.forEach(e=>ln(r,ot,e))});const l=Array.from(r);return 0===l.length&&l.push(Object.create(null)),an.has(t)&&o.set(t,l),l}chartOptionScopes(){const{options:e,type:t}=this;return[e,nt[t]||{},ht.datasets[t]||{},{type:t},ht,ot]}resolveNamedOptions(e,t,i,s=[""]){const n={$shared:!0},{resolver:o,subPrefixes:a}=cn(this._resolverCache,e,s);let r=o;(function(e,t){const{isScriptable:i,isIndexable:s}=Ft(e);for(const n of t){const t=i(n),o=s(n),a=(o||t)&&e[n];if(t&&(ue(a)||dn(a))||o&&Y(a))return!0}return!1})(o,t)&&(n.$shared=!1,r=zt(o,i=ue(i)?i():i,this.createResolver(e,i,a)));for(const e of t)n[e]=r[e];return n}createResolver(e,t,i=[""],s){const{resolver:n}=cn(this._resolverCache,e,i);return K(t)?zt(n,t,void 0,s):n}}function cn(e,t,i){let s=e.get(t);s||(s=new Map,e.set(t,s));const n=i.join();let o=s.get(n);return o||(o={resolver:At(t,i),subPrefixes:i.filter(e=>!e.toLowerCase().includes("hover"))},s.set(n,o)),o}const dn=e=>K(e)&&Object.getOwnPropertyNames(e).some(t=>ue(e[t])),un=["top","bottom","left","right","chartArea"];function pn(e,t){return"top"===e||"bottom"===e||-1===un.indexOf(e)&&"x"===t}function mn(e,t){return function(i,s){return i[e]===s[e]?i[t]-s[t]:i[e]-s[e]}}function gn(e){const t=e.chart,i=t.options.animation;t.notifyPlugins("afterRender"),Q(i&&i.onComplete,[e],t)}function bn(e){const t=e.chart,i=t.options.animation;Q(i&&i.onProgress,[e],t)}function fn(e){return ei()&&"string"==typeof e?e=document.getElementById(e):e&&e.length&&(e=e[0]),e&&e.canvas&&(e=e.canvas),e}const vn={},wn=e=>{const t=fn(e);return Object.values(vn).filter(e=>e.canvas===t).pop()};function yn(e,t,i){const s=Object.keys(e);for(const n of s){const s=+n;if(s>=t){const o=e[n];delete e[n],(i>0||s>t)&&(e[s+i]=o)}}}class xn{static defaults=ht;static instances=vn;static overrides=nt;static registry=Ys;static version="4.5.1";static getChart=wn;static register(...e){Ys.add(...e),Cn()}static unregister(...e){Ys.remove(...e),Cn()}constructor(e,t){const i=this.config=new hn(t),s=fn(e),n=wn(s);if(n)throw new Error("Canvas is already in use. Chart with ID '"+n.id+"' must be destroyed before the canvas with ID '"+n.canvas.id+"' can be reused.");const o=i.createResolver(i.chartOptionScopes(),this.getContext());this.platform=new(i.platform||function(e){return!ei()||"undefined"!=typeof OffscreenCanvas&&e instanceof OffscreenCanvas?ws:Ps}(s)),this.platform.updateConfig(i);const a=this.platform.acquireContext(s,o.aspectRatio),r=a&&a.canvas,l=r&&r.height,h=r&&r.width;this.id=U(),this.ctx=a,this.canvas=r,this.width=h,this.height=l,this._options=o,this._aspectRatio=this.aspectRatio,this._layers=[],this._metasets=[],this._stacks=void 0,this.boxes=[],this.currentDevicePixelRatio=void 0,this.chartArea=void 0,this._active=[],this._lastEvent=void 0,this._listeners={},this._responsiveListeners=void 0,this._sortedMetasets=[],this.scales={},this._plugins=new Ks,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=function(e,t){let i;return function(...s){return t?(clearTimeout(i),i=setTimeout(e,t,s)):e.apply(this,s),t}}(e=>this.update(e),o.resizeDelay||0),this._dataChanges=[],vn[this.id]=this,a&&r?(Ri.listen(this,"complete",gn),Ri.listen(this,"progress",bn),this._initialize(),this.attached&&this.update()):console.error("Failed to create chart: can't acquire context from the given item")}get aspectRatio(){const{options:{aspectRatio:e,maintainAspectRatio:t},width:i,height:s,_aspectRatio:n}=this;return $(e)?t&&n?n:s?i/s:null:e}get data(){return this.config.data}set data(e){this.config.data=e}get options(){return this._options}set options(e){this.config.options=e}get registry(){return Ys}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():li(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return ut(this.canvas,this.ctx),this}stop(){return Ri.stop(this),this}resize(e,t){Ri.running(this)?this._resizeBeforeDraw={width:e,height:t}:this._resize(e,t)}_resize(e,t){const i=this.options,s=this.canvas,n=i.maintainAspectRatio&&this.aspectRatio,o=this.platform.getMaximumSize(s,e,t,n),a=i.devicePixelRatio||this.platform.getDevicePixelRatio(),r=this.width?"resize":"attach";this.width=o.width,this.height=o.height,this._aspectRatio=this.aspectRatio,li(this,a,!0)&&(this.notifyPlugins("resize",{size:o}),Q(i.onResize,[this,o],this),this.attached&&this._doResize(r)&&this.render())}ensureScalesHaveIDs(){ee(this.options.scales||{},(e,t)=>{e.id=t})}buildOrUpdateScales(){const e=this.options,t=e.scales,i=this.scales,s=Object.keys(i).reduce((e,t)=>(e[t]=!1,e),{});let n=[];t&&(n=n.concat(Object.keys(t).map(e=>{const i=t[e],s=en(e,i),n="r"===s,o="x"===s;return{options:i,dposition:n?"chartArea":o?"bottom":"left",dtype:n?"radialLinear":o?"category":"linear"}}))),ee(n,t=>{const n=t.options,o=n.id,a=en(o,n),r=J(n.type,t.dtype);void 0!==n.position&&pn(n.position,a)===pn(t.dposition)||(n.position=t.dposition),s[o]=!0;let l=null;o in i&&i[o].type===r?l=i[o]:(l=new(Ys.getScale(r))({id:o,type:r,ctx:this.ctx,chart:this}),i[l.id]=l),l.init(n,e)}),ee(s,(e,t)=>{e||delete i[t]}),ee(i,e=>{fs.configure(this,e,e.options),fs.addBox(this,e)})}_updateMetasets(){const e=this._metasets,t=this.data.datasets.length,i=e.length;if(e.sort((e,t)=>e.index-t.index),i>t){for(let e=t;e<i;++e)this._destroyDatasetMeta(e);e.splice(t,i-t)}this._sortedMetasets=e.slice(0).sort(mn("order","index"))}_removeUnreferencedMetasets(){const{_metasets:e,data:{datasets:t}}=this;e.length>t.length&&delete this._stacks,e.forEach((e,i)=>{0===t.filter(t=>t===e._dataset).length&&this._destroyDatasetMeta(i)})}buildOrUpdateControllers(){const e=[],t=this.data.datasets;let i,s;for(this._removeUnreferencedMetasets(),i=0,s=t.length;i<s;i++){const s=t[i];let n=this.getDatasetMeta(i);const o=s.type||this.config.type;if(n.type&&n.type!==o&&(this._destroyDatasetMeta(i),n=this.getDatasetMeta(i)),n.type=o,n.indexAxis=s.indexAxis||Js(o,this.options),n.order=s.order||0,n.index=i,n.label=""+s.label,n.visible=this.isDatasetVisible(i),n.controller)n.controller.updateIndex(i),n.controller.linkScales();else{const t=Ys.getController(o),{datasetElementType:s,dataElementType:a}=ht.datasets[o];Object.assign(t,{dataElementType:Ys.getElement(a),datasetElementType:s&&Ys.getElement(s)}),n.controller=new t(this,i),e.push(n.controller)}}return this._updateMetasets(),e}_resetElements(){ee(this.data.datasets,(e,t)=>{this.getDatasetMeta(t).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(e){const t=this.config;t.update();const i=this._options=t.createResolver(t.chartOptionScopes(),this.getContext()),s=this._animationsDisabled=!i.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),!1===this.notifyPlugins("beforeUpdate",{mode:e,cancelable:!0}))return;const n=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let o=0;for(let e=0,t=this.data.datasets.length;e<t;e++){const{controller:t}=this.getDatasetMeta(e),i=!s&&-1===n.indexOf(t);t.buildOrUpdateElements(i),o=Math.max(+t.getMaxOverflow(),o)}o=this._minPadding=i.layout.autoPadding?o:0,this._updateLayout(o),s||ee(n,e=>{e.reset()}),this._updateDatasets(e),this.notifyPlugins("afterUpdate",{mode:e}),this._layers.sort(mn("z","_idx"));const{_active:a,_lastEvent:r}=this;r?this._eventHandler(r,!0):a.length&&this._updateHoverStyles(a,a,!0),this.render()}_updateScales(){ee(this.scales,e=>{fs.removeBox(this,e)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const e=this.options,t=new Set(Object.keys(this._listeners)),i=new Set(e.events);pe(t,i)&&!!this._responsiveListeners===e.responsive||(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:e}=this,t=this._getUniformDataChanges()||[];for(const{method:i,start:s,count:n}of t)yn(e,s,"_removeElements"===i?-n:n)}_getUniformDataChanges(){const e=this._dataChanges;if(!e||!e.length)return;this._dataChanges=[];const t=this.data.datasets.length,i=t=>new Set(e.filter(e=>e[0]===t).map((e,t)=>t+","+e.splice(1).join(","))),s=i(0);for(let e=1;e<t;e++)if(!pe(s,i(e)))return;return Array.from(s).map(e=>e.split(",")).map(e=>({method:e[1],start:+e[2],count:+e[3]}))}_updateLayout(e){if(!1===this.notifyPlugins("beforeLayout",{cancelable:!0}))return;fs.update(this,this.width,this.height,e);const t=this.chartArea,i=t.width<=0||t.height<=0;this._layers=[],ee(this.boxes,e=>{i&&"chartArea"===e.position||(e.configure&&e.configure(),this._layers.push(...e._layers()))},this),this._layers.forEach((e,t)=>{e._idx=t}),this.notifyPlugins("afterLayout")}_updateDatasets(e){if(!1!==this.notifyPlugins("beforeDatasetsUpdate",{mode:e,cancelable:!0})){for(let e=0,t=this.data.datasets.length;e<t;++e)this.getDatasetMeta(e).controller.configure();for(let t=0,i=this.data.datasets.length;t<i;++t)this._updateDataset(t,ue(e)?e({datasetIndex:t}):e);this.notifyPlugins("afterDatasetsUpdate",{mode:e})}}_updateDataset(e,t){const i=this.getDatasetMeta(e),s={meta:i,index:e,mode:t,cancelable:!0};!1!==this.notifyPlugins("beforeDatasetUpdate",s)&&(i.controller._update(t),s.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",s))}render(){!1!==this.notifyPlugins("beforeRender",{cancelable:!0})&&(Ri.has(this)?this.attached&&!Ri.running(this)&&Ri.start(this):(this.draw(),gn({chart:this})))}draw(){let e;if(this._resizeBeforeDraw){const{width:e,height:t}=this._resizeBeforeDraw;this._resizeBeforeDraw=null,this._resize(e,t)}if(this.clear(),this.width<=0||this.height<=0)return;if(!1===this.notifyPlugins("beforeDraw",{cancelable:!0}))return;const t=this._layers;for(e=0;e<t.length&&t[e].z<=0;++e)t[e].draw(this.chartArea);for(this._drawDatasets();e<t.length;++e)t[e].draw(this.chartArea);this.notifyPlugins("afterDraw")}_getSortedDatasetMetas(e){const t=this._sortedMetasets,i=[];let s,n;for(s=0,n=t.length;s<n;++s){const n=t[s];e&&!n.visible||i.push(n)}return i}getSortedVisibleDatasetMetas(){return this._getSortedDatasetMetas(!0)}_drawDatasets(){if(!1===this.notifyPlugins("beforeDatasetsDraw",{cancelable:!0}))return;const e=this.getSortedVisibleDatasetMetas();for(let t=e.length-1;t>=0;--t)this._drawDataset(e[t]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(e){const t=this.ctx,i={meta:e,index:e.index,cancelable:!0},s=ki(this,e);!1!==this.notifyPlugins("beforeDatasetDraw",i)&&(s&&bt(t,s),e.controller.draw(),s&&ft(t),i.cancelable=!1,this.notifyPlugins("afterDatasetDraw",i))}isPointInArea(e){return gt(e,this.chartArea,this._minPadding)}getElementsAtEventForMode(e,t,i,s){const n=os.modes[t];return"function"==typeof n?n(this,e,i,s):[]}getDatasetMeta(e){const t=this.data.datasets[e],i=this._metasets;let s=i.filter(e=>e&&e._dataset===t).pop();return s||(s={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:t&&t.order||0,index:e,_dataset:t,_parsed:[],_sorted:!1},i.push(s)),s}getContext(){return this.$context||(this.$context=Pt(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(e){const t=this.data.datasets[e];if(!t)return!1;const i=this.getDatasetMeta(e);return"boolean"==typeof i.hidden?!i.hidden:!t.hidden}setDatasetVisibility(e,t){this.getDatasetMeta(e).hidden=!t}toggleDataVisibility(e){this._hiddenIndices[e]=!this._hiddenIndices[e]}getDataVisibility(e){return!this._hiddenIndices[e]}_updateVisibility(e,t,i){const s=i?"show":"hide",n=this.getDatasetMeta(e),o=n.controller._resolveAnimations(void 0,s);de(t)?(n.data[t].hidden=!i,this.update()):(this.setDatasetVisibility(e,i),o.update(n,{visible:i}),this.update(t=>t.datasetIndex===e?s:void 0))}hide(e,t){this._updateVisibility(e,t,!1)}show(e,t){this._updateVisibility(e,t,!0)}_destroyDatasetMeta(e){const t=this._metasets[e];t&&t.controller&&t.controller._destroy(),delete this._metasets[e]}_stop(){let e,t;for(this.stop(),Ri.remove(this),e=0,t=this.data.datasets.length;e<t;++e)this._destroyDatasetMeta(e)}destroy(){this.notifyPlugins("beforeDestroy");const{canvas:e,ctx:t}=this;this._stop(),this.config.clearCache(),e&&(this.unbindEvents(),ut(e,t),this.platform.releaseContext(t),this.canvas=null,this.ctx=null),delete vn[this.id],this.notifyPlugins("afterDestroy")}toBase64Image(...e){return this.canvas.toDataURL(...e)}bindEvents(){this.bindUserEvents(),this.options.responsive?this.bindResponsiveEvents():this.attached=!0}bindUserEvents(){const e=this._listeners,t=this.platform,i=(i,s)=>{t.addEventListener(this,i,s),e[i]=s},s=(e,t,i)=>{e.offsetX=t,e.offsetY=i,this._eventHandler(e)};ee(this.options.events,e=>i(e,s))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const e=this._responsiveListeners,t=this.platform,i=(i,s)=>{t.addEventListener(this,i,s),e[i]=s},s=(i,s)=>{e[i]&&(t.removeEventListener(this,i,s),delete e[i])},n=(e,t)=>{this.canvas&&this.resize(e,t)};let o;const a=()=>{s("attach",a),this.attached=!0,this.resize(),i("resize",n),i("detach",o)};o=()=>{this.attached=!1,s("resize",n),this._stop(),this._resize(0,0),i("attach",a)},t.isAttached(this.canvas)?a():o()}unbindEvents(){ee(this._listeners,(e,t)=>{this.platform.removeEventListener(this,t,e)}),this._listeners={},ee(this._responsiveListeners,(e,t)=>{this.platform.removeEventListener(this,t,e)}),this._responsiveListeners=void 0}updateHoverStyle(e,t,i){const s=i?"set":"remove";let n,o,a,r;for("dataset"===t&&(n=this.getDatasetMeta(e[0].datasetIndex),n.controller["_"+s+"DatasetHoverStyle"]()),a=0,r=e.length;a<r;++a){o=e[a];const t=o&&this.getDatasetMeta(o.datasetIndex).controller;t&&t[s+"HoverStyle"](o.element,o.datasetIndex,o.index)}}getActiveElements(){return this._active||[]}setActiveElements(e){const t=this._active||[],i=e.map(({datasetIndex:e,index:t})=>{const i=this.getDatasetMeta(e);if(!i)throw new Error("No dataset found at index "+e);return{datasetIndex:e,element:i.data[t],index:t}});!te(i,t)&&(this._active=i,this._lastEvent=null,this._updateHoverStyles(i,t))}notifyPlugins(e,t,i){return this._plugins.notify(this,e,t,i)}isPluginEnabled(e){return 1===this._plugins._cache.filter(t=>t.plugin.id===e).length}_updateHoverStyles(e,t,i){const s=this.options.hover,n=(e,t)=>e.filter(e=>!t.some(t=>e.datasetIndex===t.datasetIndex&&e.index===t.index)),o=n(t,e),a=i?e:n(e,t);o.length&&this.updateHoverStyle(o,s.mode,!1),a.length&&s.mode&&this.updateHoverStyle(a,s.mode,!0)}_eventHandler(e,t){const i={event:e,replay:t,cancelable:!0,inChartArea:this.isPointInArea(e)},s=t=>(t.options.events||this.options.events).includes(e.native.type);if(!1===this.notifyPlugins("beforeEvent",i,s))return;const n=this._handleEvent(e,t,i.inChartArea);return i.cancelable=!1,this.notifyPlugins("afterEvent",i,s),(n||i.changed)&&this.render(),this}_handleEvent(e,t,i){const{_active:s=[],options:n}=this,o=t,a=this._getActiveElements(e,s,i,o),r=function(e){return"mouseup"===e.type||"click"===e.type||"contextmenu"===e.type}(e),l=function(e,t,i,s){return i&&"mouseout"!==e.type?s?t:e:null}(e,this._lastEvent,i,r);i&&(this._lastEvent=null,Q(n.onHover,[e,a,this],this),r&&Q(n.onClick,[e,a,this],this));const h=!te(a,s);return(h||t)&&(this._active=a,this._updateHoverStyles(a,s,t)),this._lastEvent=l,h}_getActiveElements(e,t,i,s){if("mouseout"===e.type)return[];if(!i)return t;const n=this.options.hover;return this.getElementsAtEventForMode(e,n.mode,n,s)}}function Cn(){return ee(xn.instances,e=>e._plugins.invalidate())}function kn(e,t,i,s){return{x:i+e*Math.cos(t),y:s+e*Math.sin(t)}}function En(e,t,i,s,n,o){const{x:a,y:r,startAngle:l,pixelMargin:h,innerRadius:c}=t,d=Math.max(t.outerRadius+s+i-h,0),u=c>0?c+s+i+h:0;let p=0;const m=n-l;if(s){const e=((c>0?c-s:0)+(d>0?d-s:0))/2;p=(m-(0!==e?m*e/(e+s):m))/2}const g=(m-Math.max(.001,m*d-i/me)/d)/2,b=l+g+p,f=n-g-p,{outerStart:v,outerEnd:w,innerStart:_,innerEnd:y}=function(e,t,i,s){const n=Tt(e.options.borderRadius,["outerStart","outerEnd","innerStart","innerEnd"]),o=(i-t)/2,a=Math.min(o,s*t/2),r=e=>{const t=(i-Math.min(o,e))*s/2;return Pe(e,0,Math.min(o,t))};return{outerStart:r(n.outerStart),outerEnd:r(n.outerEnd),innerStart:Pe(n.innerStart,0,a),innerEnd:Pe(n.innerEnd,0,a)}}(t,u,d,f-b),x=d-v,C=d-w,k=b+v/x,E=f-w/C,R=u+_,M=u+y,T=b+_/R,S=f-y/M;if(e.beginPath(),o){const t=(k+E)/2;if(e.arc(a,r,d,k,t),e.arc(a,r,d,t,E),w>0){const t=kn(C,E,a,r);e.arc(t.x,t.y,w,E,f+we)}const i=kn(M,f,a,r);if(e.lineTo(i.x,i.y),y>0){const t=kn(M,S,a,r);e.arc(t.x,t.y,y,f+we,S+Math.PI)}const s=(f-y/u+(b+_/u))/2;if(e.arc(a,r,u,f-y/u,s,!0),e.arc(a,r,u,s,b+_/u,!0),_>0){const t=kn(R,T,a,r);e.arc(t.x,t.y,_,T+Math.PI,b-we)}const n=kn(x,b,a,r);if(e.lineTo(n.x,n.y),v>0){const t=kn(x,k,a,r);e.arc(t.x,t.y,v,b-we,k)}}else{e.moveTo(a,r);const t=Math.cos(k)*d+a,i=Math.sin(k)*d+r;e.lineTo(t,i);const s=Math.cos(E)*d+a,n=Math.sin(E)*d+r;e.lineTo(s,n)}e.closePath()}function Rn(e,t,i=t){e.lineCap=J(i.borderCapStyle,t.borderCapStyle),e.setLineDash(J(i.borderDash,t.borderDash)),e.lineDashOffset=J(i.borderDashOffset,t.borderDashOffset),e.lineJoin=J(i.borderJoinStyle,t.borderJoinStyle),e.lineWidth=J(i.borderWidth,t.borderWidth),e.strokeStyle=J(i.borderColor,t.borderColor)}function Mn(e,t,i){e.lineTo(i.x,i.y)}function Tn(e,t,i={}){const s=e.length,{start:n=0,end:o=s-1}=i,{start:a,end:r}=t,l=Math.max(n,a),h=Math.min(o,r),c=n<a&&o<a||n>r&&o>r;return{count:s,start:l,loop:t.loop,ilen:h<l&&!c?s+h-l:h-l}}function Sn(e,t,i,s){const{points:n,options:o}=t,{count:a,start:r,loop:l,ilen:h}=Tn(n,i,s),c=function(e){return e.stepped?vt:e.tension||"monotone"===e.cubicInterpolationMode?wt:Mn}(o);let d,u,p,{move:m=!0,reverse:g}=s||{};for(d=0;d<=h;++d)u=n[(r+(g?h-d:d))%a],u.skip||(m?(e.moveTo(u.x,u.y),m=!1):c(e,p,u,g,o.stepped),p=u);return l&&(u=n[(r+(g?h:0))%a],c(e,p,u,g,o.stepped)),!!l}function Dn(e,t,i,s){const n=t.points,{count:o,start:a,ilen:r}=Tn(n,i,s),{move:l=!0,reverse:h}=s||{};let c,d,u,p,m,g,b=0,f=0;const v=e=>(a+(h?r-e:e))%o,w=()=>{p!==m&&(e.lineTo(b,m),e.lineTo(b,p),e.lineTo(b,g))};for(l&&(d=n[v(0)],e.moveTo(d.x,d.y)),c=0;c<=r;++c){if(d=n[v(c)],d.skip)continue;const t=d.x,i=d.y,s=0|t;s===u?(i<p?p=i:i>m&&(m=i),b=(f*b+t)/++f):(w(),e.lineTo(t,i),u=s,f=0,p=m=i),g=i}w()}function jn(e){const t=e.options,i=t.borderDash&&t.borderDash.length;return e._decimated||e._loop||t.tension||"monotone"===t.cubicInterpolationMode||t.stepped||i?Sn:Dn}const Nn="function"==typeof Path2D;class Ln extends As{static id="line";static defaults={borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0};static defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};static descriptors={_scriptable:!0,_indexable:e=>"borderDash"!==e&&"fill"!==e};constructor(e){super(),this.animated=!0,this.options=void 0,this._chart=void 0,this._loop=void 0,this._fullLoop=void 0,this._path=void 0,this._points=void 0,this._segments=void 0,this._decimated=!1,this._pointsUpdated=!1,this._datasetIndex=void 0,e&&Object.assign(this,e)}updateControlPoints(e,t){const i=this.options;if((i.tension||"monotone"===i.cubicInterpolationMode)&&!i.stepped&&!this._pointsUpdated){const s=i.spanGaps?this._loop:this._fullLoop;Qt(this._points,i,e,s,t),this._pointsUpdated=!0}}set points(e){this._points=e,delete this._segments,delete this._path,this._pointsUpdated=!1}get points(){return this._points}get segments(){return this._segments||(this._segments=function(e,t){const i=e.points,s=e.options.spanGaps,n=i.length;if(!n)return[];const o=!!e._loop,{start:a,end:r}=function(e,t,i,s){let n=0,o=t-1;if(i&&!s)for(;n<t&&!e[n].skip;)n++;for(;n<t&&e[n].skip;)n++;for(n%=t,i&&(o+=n);o>n&&e[o%t].skip;)o--;return o%=t,{start:n,end:o}}(i,n,o,s);return function(e,t,i,s){return s&&s.setContext&&i?function(e,t,i,s){const n=e._chart.getContext(),o=yi(e.options),{_datasetIndex:a,options:{spanGaps:r}}=e,l=i.length,h=[];let c=o,d=t[0].start,u=d;function p(e,t,s,n){const o=r?-1:1;if(e!==t){for(e+=l;i[e%l].skip;)e-=o;for(;i[t%l].skip;)t+=o;e%l!==t%l&&(h.push({start:e%l,end:t%l,loop:s,style:n}),c=n,d=t%l)}}for(const e of t){d=r?d:e.start;let t,o=i[d%l];for(u=d+1;u<=e.end;u++){const r=i[u%l];t=yi(s.setContext(Pt(n,{type:"segment",p0:o,p1:r,p0DataIndex:(u-1)%l,p1DataIndex:u%l,datasetIndex:a}))),xi(t,c)&&p(d,u-1,e.loop,c),o=r,c=t}d<u-1&&p(d,u-1,e.loop,c)}return h}(e,t,i,s):t}(e,!0===s?[{start:a,end:r,loop:o}]:function(e,t,i,s){const n=e.length,o=[];let a,r=t,l=e[t];for(a=t+1;a<=i;++a){const i=e[a%n];i.skip||i.stop?l.skip||(s=!1,o.push({start:t%n,end:(a-1)%n,loop:s}),t=r=i.stop?a:null):(r=a,l.skip&&(t=a)),l=i}return null!==r&&o.push({start:t%n,end:r%n,loop:s}),o}(i,a,r<a?r+n:r,!!e._fullLoop&&0===a&&r===n-1),i,t)}(this,this.options.segment))}first(){const e=this.segments,t=this.points;return e.length&&t[e[0].start]}last(){const e=this.segments,t=this.points,i=e.length;return i&&t[e[i-1].end]}interpolate(e,t){const i=this.options,s=e[t],n=this.points,o=_i(this,{property:t,start:s,end:s});if(!o.length)return;const a=[],r=function(e){return e.stepped?ui:e.tension||"monotone"===e.cubicInterpolationMode?pi:di}(i);let l,h;for(l=0,h=o.length;l<h;++l){const{start:h,end:c}=o[l],d=n[h],u=n[c];if(d===u){a.push(d);continue}const p=r(d,u,Math.abs((s-d[t])/(u[t]-d[t])),i.stepped);p[t]=e[t],a.push(p)}return 1===a.length?a[0]:a}pathSegment(e,t,i){return jn(this)(e,this,t,i)}path(e,t,i){const s=this.segments,n=jn(this);let o=this._loop;t=t||0,i=i||this.points.length-t;for(const a of s)o&=n(e,this,a,{start:t,end:t+i-1});return!!o}draw(e,t,i,s){const n=this.options||{};(this.points||[]).length&&n.borderWidth&&(e.save(),function(e,t,i,s){Nn&&!t.options.segment?function(e,t,i,s){let n=t._path;n||(n=t._path=new Path2D,t.path(n,i,s)&&n.closePath()),Rn(e,t.options),e.stroke(n)}(e,t,i,s):function(e,t,i,s){const{segments:n,options:o}=t,a=jn(t);for(const r of n)Rn(e,o,r.style),e.beginPath(),a(e,t,r,{start:i,end:i+s-1})&&e.closePath(),e.stroke()}(e,t,i,s)}(e,this,i,s),e.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}function Pn(e,t,i,s){const n=e.options,{[i]:o}=e.getProps([i],s);return Math.abs(t-o)<n.radius+n.hitRadius}function An(e,t){const{x:i,y:s,base:n,width:o,height:a}=e.getProps(["x","y","base","width","height"],t);let r,l,h,c,d;return e.horizontal?(d=a/2,r=Math.min(i,n),l=Math.max(i,n),h=s-d,c=s+d):(d=o/2,r=i-d,l=i+d,h=Math.min(s,n),c=Math.max(s,n)),{left:r,top:h,right:l,bottom:c}}function zn(e,t,i,s){return e?0:Pe(t,i,s)}function Fn(e,t,i,s){const n=null===t,o=null===i,a=e&&!(n&&o)&&An(e,s);return a&&(n||Ae(t,a.left,a.right))&&(o||Ae(i,a.top,a.bottom))}function On(e,t){e.rect(t.x,t.y,t.w,t.h)}function Hn(e,t,i={}){const s=e.x!==i.x?-t:0,n=e.y!==i.y?-t:0,o=(e.x+e.w!==i.x+i.w?t:0)-s,a=(e.y+e.h!==i.y+i.h?t:0)-n;return{x:e.x+s,y:e.y+n,w:e.w+o,h:e.h+a,radius:e.radius}}function In(e,t,i,s){if(s)return;let n=t[e],o=i[e];return"angle"===e&&(n=Ne(n),o=Ne(o)),{property:e,start:n,end:o}}function Bn(e,t,i){for(;t>e;t--){const e=i[t];if(!isNaN(e.x)&&!isNaN(e.y))break}return t}function Vn(e,t,i,s){return e&&t?s(e[i],t[i]):e?e[i]:t?t[i]:0}function Wn(e,t){let i=[],s=!1;return Y(e)?(s=!0,i=e):i=function(e,t){const{x:i=null,y:s=null}=e||{},n=t.points,o=[];return t.segments.forEach(({start:e,end:t})=>{t=Bn(e,t,n);const a=n[e],r=n[t];null!==s?(o.push({x:a.x,y:s}),o.push({x:r.x,y:s})):null!==i&&(o.push({x:i,y:a.y}),o.push({x:i,y:r.y}))}),o}(e,t),i.length?new Ln({points:i,options:{tension:0},_loop:s,_fullLoop:s}):null}function Gn(e){return e&&!1!==e.fill}function Un(e,t,i){let s=e[t].fill;const n=[t];let o;if(!i)return s;for(;!1!==s&&-1===n.indexOf(s);){if(!X(s))return s;if(o=e[s],!o)return!1;if(o.visible)return s;n.push(s),s=o.fill}return!1}function $n(e,t,i){const s=function(e){const t=e.options,i=t.fill;let s=J(i&&i.target,i);return void 0===s&&(s=!!t.backgroundColor),!1!==s&&null!==s&&(!0===s?"origin":s)}(e);if(K(s))return!isNaN(s.value)&&s;let n=parseFloat(s);return X(n)&&Math.floor(n)===n?function(e,t,i,s){return"-"!==e&&"+"!==e||(i=t+i),!(i===t||i<0||i>=s)&&i}(s[0],t,n,i):["origin","start","end","stack","shape"].indexOf(s)>=0&&s}function Yn(e,t,i){const s=[];for(let n=0;n<i.length;n++){const o=i[n],{first:a,last:r,point:l}=Kn(o,t,"x");if(!(!l||a&&r))if(a)s.unshift(l);else if(e.push(l),!r)break}e.push(...s)}function Kn(e,t,i){const s=e.interpolate(t,i);if(!s)return{};const n=s[i],o=e.segments,a=e.points;let r=!1,l=!1;for(let e=0;e<o.length;e++){const t=o[e],s=a[t.start][i],h=a[t.end][i];if(Ae(n,s,h)){r=n===s,l=n===h;break}}return{first:r,last:l,point:s}}class Xn{constructor(e){this.x=e.x,this.y=e.y,this.radius=e.radius}pathSegment(e,t,i){const{x:s,y:n,radius:o}=this;return t=t||{start:0,end:ge},e.arc(s,n,o,t.end,t.start,!0),!i.bounds}interpolate(e){const{x:t,y:i,radius:s}=this,n=e.angle;return{x:t+Math.cos(n)*s,y:i+Math.sin(n)*s,angle:n}}}function qn(e,t,i){const s=function(e){const{chart:t,fill:i,line:s}=e;if(X(i))return function(e,t){const i=e.getDatasetMeta(t);return i&&e.isDatasetVisible(t)?i.dataset:null}(t,i);if("stack"===i)return function(e){const{scale:t,index:i,line:s}=e,n=[],o=s.segments,a=s.points,r=function(e,t){const i=[],s=e.getMatchingVisibleMetas("line");for(let e=0;e<s.length;e++){const n=s[e];if(n.index===t)break;n.hidden||i.unshift(n.dataset)}return i}(t,i);r.push(Wn({x:null,y:t.bottom},s));for(let e=0;e<o.length;e++){const t=o[e];for(let e=t.start;e<=t.end;e++)Yn(n,a[e],r)}return new Ln({points:n,options:{}})}(e);if("shape"===i)return!0;const n=function(e){return(e.scale||{}).getPointPositionForValue?function(e){const{scale:t,fill:i}=e,s=t.options,n=t.getLabels().length,o=s.reverse?t.max:t.min,a=function(e,t,i){let s;return s="start"===e?i:"end"===e?t.options.reverse?t.min:t.max:K(e)?e.value:t.getBaseValue(),s}(i,t,o),r=[];if(s.grid.circular){const e=t.getPointPositionForValue(0,o);return new Xn({x:e.x,y:e.y,radius:t.getDistanceFromCenterForValue(a)})}for(let e=0;e<n;++e)r.push(t.getPointPositionForValue(e,a));return r}(e):function(e){const{scale:t={},fill:i}=e,s=function(e,t){let i=null;return"start"===e?i=t.bottom:"end"===e?i=t.top:K(e)?i=t.getPixelForValue(e.value):t.getBasePixel&&(i=t.getBasePixel()),i}(i,t);if(X(s)){const e=t.isHorizontal();return{x:e?s:null,y:e?null:s}}return null}(e)}(e);return n instanceof Xn?n:Wn(n,s)}(t),{chart:n,index:o,line:a,scale:r,axis:l}=t,h=a.options,c=h.fill,d=h.backgroundColor,{above:u=d,below:p=d}=c||{},m=n.getDatasetMeta(o),g=ki(n,m);s&&a.points.length&&(bt(e,i),function(e,t){const{line:i,target:s,above:n,below:o,area:a,scale:r,clip:l}=t,h=i._loop?"angle":t.axis;e.save();let c=o;o!==n&&("x"===h?(Jn(e,s,a.top),Qn(e,{line:i,target:s,color:n,scale:r,property:h,clip:l}),e.restore(),e.save(),Jn(e,s,a.bottom)):"y"===h&&(Zn(e,s,a.left),Qn(e,{line:i,target:s,color:o,scale:r,property:h,clip:l}),e.restore(),e.save(),Zn(e,s,a.right),c=n)),Qn(e,{line:i,target:s,color:c,scale:r,property:h,clip:l}),e.restore()}(e,{line:a,target:s,above:u,below:p,area:i,scale:r,axis:l,clip:g}),ft(e))}function Jn(e,t,i){const{segments:s,points:n}=t;let o=!0,a=!1;e.beginPath();for(const r of s){const{start:s,end:l}=r,h=n[s],c=n[Bn(s,l,n)];o?(e.moveTo(h.x,h.y),o=!1):(e.lineTo(h.x,i),e.lineTo(h.x,h.y)),a=!!t.pathSegment(e,r,{move:a}),a?e.closePath():e.lineTo(c.x,i)}e.lineTo(t.first().x,i),e.closePath(),e.clip()}function Zn(e,t,i){const{segments:s,points:n}=t;let o=!0,a=!1;e.beginPath();for(const r of s){const{start:s,end:l}=r,h=n[s],c=n[Bn(s,l,n)];o?(e.moveTo(h.x,h.y),o=!1):(e.lineTo(i,h.y),e.lineTo(h.x,h.y)),a=!!t.pathSegment(e,r,{move:a}),a?e.closePath():e.lineTo(i,c.y)}e.lineTo(i,t.first().y),e.closePath(),e.clip()}function Qn(e,t){const{line:i,target:s,property:n,color:o,scale:a,clip:r}=t,l=function(e,t,i){const s=e.segments,n=e.points,o=t.points,a=[];for(const e of s){let{start:s,end:r}=e;r=Bn(s,r,n);const l=In(i,n[s],n[r],e.loop);if(!t.segments){a.push({source:e,target:l,start:n[s],end:n[r]});continue}const h=_i(t,l);for(const t of h){const s=In(i,o[t.start],o[t.end],t.loop),r=wi(e,n,s);for(const e of r)a.push({source:e,target:t,start:{[i]:Vn(l,s,"start",Math.max)},end:{[i]:Vn(l,s,"end",Math.min)}})}}return a}(i,s,n);for(const{source:t,target:h,start:c,end:d}of l){const{style:{backgroundColor:l=o}={}}=t,u=!0!==s;e.save(),e.fillStyle=l,eo(e,a,r,u&&In(n,c,d)),e.beginPath();const p=!!i.pathSegment(e,t);let m;if(u){p?e.closePath():to(e,s,d,n);const t=!!s.pathSegment(e,h,{move:p,reverse:!0});m=p&&t,m||to(e,s,c,n)}e.closePath(),e.fill(m?"evenodd":"nonzero"),e.restore()}}function eo(e,t,i,s){const n=t.chart.chartArea,{property:o,start:a,end:r}=s||{};if("x"===o||"y"===o){let t,s,l,h;"x"===o?(t=a,s=n.top,l=r,h=n.bottom):(t=n.left,s=a,l=n.right,h=r),e.beginPath(),i&&(t=Math.max(t,i.left),l=Math.min(l,i.right),s=Math.max(s,i.top),h=Math.min(h,i.bottom)),e.rect(t,s,l-t,h-s),e.clip()}}function to(e,t,i,s){const n=t.interpolate(i,s);n&&e.lineTo(n.x,n.y)}var io={id:"filler",afterDatasetsUpdate(e,t,i){const s=(e.data.datasets||[]).length,n=[];let o,a,r,l;for(a=0;a<s;++a)o=e.getDatasetMeta(a),r=o.dataset,l=null,r&&r.options&&r instanceof Ln&&(l={visible:e.isDatasetVisible(a),index:a,fill:$n(r,a,s),chart:e,axis:o.controller.options.indexAxis,scale:o.vScale,line:r}),o.$filler=l,n.push(l);for(a=0;a<s;++a)l=n[a],l&&!1!==l.fill&&(l.fill=Un(n,a,i.propagate))},beforeDraw(e,t,i){const s="beforeDraw"===i.drawTime,n=e.getSortedVisibleDatasetMetas(),o=e.chartArea;for(let t=n.length-1;t>=0;--t){const i=n[t].$filler;i&&(i.line.updateControlPoints(o,i.axis),s&&i.fill&&qn(e.ctx,i,o))}},beforeDatasetsDraw(e,t,i){if("beforeDatasetsDraw"!==i.drawTime)return;const s=e.getSortedVisibleDatasetMetas();for(let t=s.length-1;t>=0;--t){const i=s[t].$filler;Gn(i)&&qn(e.ctx,i,e.chartArea)}},beforeDatasetDraw(e,t,i){const s=t.meta.$filler;Gn(s)&&"beforeDatasetDraw"===i.drawTime&&qn(e.ctx,s,e.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const so=(e,t)=>{let{boxHeight:i=t,boxWidth:s=t}=e;return e.usePointStyle&&(i=Math.min(i,t),s=e.pointStyleWidth||Math.min(s,t)),{boxWidth:s,boxHeight:i,itemHeight:Math.max(t,i)}};class no extends As{constructor(e){super(),this._added=!1,this.legendHitBoxes=[],this._hoveredItem=null,this.doughnutMode=!1,this.chart=e.chart,this.options=e.options,this.ctx=e.ctx,this.legendItems=void 0,this.columnSizes=void 0,this.lineWidths=void 0,this.maxHeight=void 0,this.maxWidth=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.height=void 0,this.width=void 0,this._margins=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(e,t,i){this.maxWidth=e,this.maxHeight=t,this._margins=i,this.setDimensions(),this.buildLabels(),this.fit()}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=this._margins.left,this.right=this.width):(this.height=this.maxHeight,this.top=this._margins.top,this.bottom=this.height)}buildLabels(){const e=this.options.labels||{};let t=Q(e.generateLabels,[this.chart],this)||[];e.filter&&(t=t.filter(t=>e.filter(t,this.chart.data))),e.sort&&(t=t.sort((t,i)=>e.sort(t,i,this.chart.data))),this.options.reverse&&t.reverse(),this.legendItems=t}fit(){const{options:e,ctx:t}=this;if(!e.display)return void(this.width=this.height=0);const i=e.labels,s=Nt(i.font),n=s.size,o=this._computeTitleHeight(),{boxWidth:a,itemHeight:r}=so(i,n);let l,h;t.font=s.string,this.isHorizontal()?(l=this.maxWidth,h=this._fitRows(o,n,a,r)+10):(h=this.maxHeight,l=this._fitCols(o,s,a,r)+10),this.width=Math.min(l,e.maxWidth||this.maxWidth),this.height=Math.min(h,e.maxHeight||this.maxHeight)}_fitRows(e,t,i,s){const{ctx:n,maxWidth:o,options:{labels:{padding:a}}}=this,r=this.legendHitBoxes=[],l=this.lineWidths=[0],h=s+a;let c=e;n.textAlign="left",n.textBaseline="middle";let d=-1,u=-h;return this.legendItems.forEach((e,p)=>{const m=i+t/2+n.measureText(e.text).width;(0===p||l[l.length-1]+m+2*a>o)&&(c+=h,l[l.length-(p>0?0:1)]=0,u+=h,d++),r[p]={left:0,top:u,row:d,width:m,height:s},l[l.length-1]+=m+a}),c}_fitCols(e,t,i,s){const{ctx:n,maxHeight:o,options:{labels:{padding:a}}}=this,r=this.legendHitBoxes=[],l=this.columnSizes=[],h=o-e;let c=a,d=0,u=0,p=0,m=0;return this.legendItems.forEach((e,o)=>{const{itemWidth:g,itemHeight:b}=function(e,t,i,s,n){const o=function(e,t,i,s){let n=e.text;return n&&"string"!=typeof n&&(n=n.reduce((e,t)=>e.length>t.length?e:t)),t+i.size/2+s.measureText(n).width}(s,e,t,i),a=function(e,t,i){let s=e;return"string"!=typeof t.text&&(s=oo(t,i)),s}(n,s,t.lineHeight);return{itemWidth:o,itemHeight:a}}(i,t,n,e,s);o>0&&u+b+2*a>h&&(c+=d+a,l.push({width:d,height:u}),p+=d+a,m++,d=u=0),r[o]={left:p,top:u,col:m,width:g,height:b},d=Math.max(d,g),u+=b+a}),c+=d,l.push({width:d,height:u}),c}adjustHitBoxes(){if(!this.options.display)return;const e=this._computeTitleHeight(),{legendHitBoxes:t,options:{align:i,labels:{padding:s},rtl:n}}=this,o=mi(n,this.left,this.width);if(this.isHorizontal()){let n=0,a=Ge(i,this.left+s,this.right-this.lineWidths[n]);for(const r of t)n!==r.row&&(n=r.row,a=Ge(i,this.left+s,this.right-this.lineWidths[n])),r.top+=this.top+e+s,r.left=o.leftForLtr(o.x(a),r.width),a+=r.width+s}else{let n=0,a=Ge(i,this.top+e+s,this.bottom-this.columnSizes[n].height);for(const r of t)r.col!==n&&(n=r.col,a=Ge(i,this.top+e+s,this.bottom-this.columnSizes[n].height)),r.top=a,r.left+=this.left+s,r.left=o.leftForLtr(o.x(r.left),r.width),a+=r.height+s}}isHorizontal(){return"top"===this.options.position||"bottom"===this.options.position}draw(){if(this.options.display){const e=this.ctx;bt(e,this),this._draw(),ft(e)}}_draw(){const{options:e,columnSizes:t,lineWidths:i,ctx:s}=this,{align:n,labels:o}=e,a=ht.color,r=mi(e.rtl,this.left,this.width),l=Nt(o.font),{padding:h}=o,c=l.size,d=c/2;let u;this.drawTitle(),s.textAlign=r.textAlign("left"),s.textBaseline="middle",s.lineWidth=.5,s.font=l.string;const{boxWidth:p,boxHeight:m,itemHeight:g}=so(o,c),b=this.isHorizontal(),f=this._computeTitleHeight();u=b?{x:Ge(n,this.left+h,this.right-i[0]),y:this.top+h+f,line:0}:{x:this.left+h,y:Ge(n,this.top+f+h,this.bottom-t[0].height),line:0},gi(this.ctx,e.textDirection);const v=g+h;this.legendItems.forEach((w,_)=>{s.strokeStyle=w.fontColor,s.fillStyle=w.fontColor;const y=s.measureText(w.text).width,x=r.textAlign(w.textAlign||(w.textAlign=o.textAlign)),C=p+d+y;let k=u.x,E=u.y;if(r.setWidth(this.width),b?_>0&&k+C+h>this.right&&(E=u.y+=v,u.line++,k=u.x=Ge(n,this.left+h,this.right-i[u.line])):_>0&&E+v>this.bottom&&(k=u.x=k+t[u.line].width+h,u.line++,E=u.y=Ge(n,this.top+f+h,this.bottom-t[u.line].height)),function(e,t,i){if(isNaN(p)||p<=0||isNaN(m)||m<0)return;s.save();const n=J(i.lineWidth,1);if(s.fillStyle=J(i.fillStyle,a),s.lineCap=J(i.lineCap,"butt"),s.lineDashOffset=J(i.lineDashOffset,0),s.lineJoin=J(i.lineJoin,"miter"),s.lineWidth=n,s.strokeStyle=J(i.strokeStyle,a),s.setLineDash(J(i.lineDash,[])),o.usePointStyle){const a={radius:m*Math.SQRT2/2,pointStyle:i.pointStyle,rotation:i.rotation,borderWidth:n},l=r.xPlus(e,p/2);mt(s,a,l,t+d,o.pointStyleWidth&&p)}else{const o=t+Math.max((c-m)/2,0),a=r.leftForLtr(e,p),l=Dt(i.borderRadius);s.beginPath(),Object.values(l).some(e=>0!==e)?Ct(s,{x:a,y:o,w:p,h:m,radius:l}):s.rect(a,o,p,m),s.fill(),0!==n&&s.stroke()}s.restore()}(r.x(k),E,w),k=((e,t,i,s)=>e===(s?"left":"right")?i:"center"===e?(t+i)/2:t)(x,k+p+d,b?k+C:this.right,e.rtl),function(e,t,i){xt(s,i.text,e,t+g/2,l,{strikethrough:i.hidden,textAlign:r.textAlign(i.textAlign)})}(r.x(k),E,w),b)u.x+=C+h;else if("string"!=typeof w.text){const e=l.lineHeight;u.y+=oo(w,e)+h}else u.y+=v}),bi(this.ctx,e.textDirection)}drawTitle(){const e=this.options,t=e.title,i=Nt(t.font),s=jt(t.padding);if(!t.display)return;const n=mi(e.rtl,this.left,this.width),o=this.ctx,a=t.position,r=i.size/2,l=s.top+r;let h,c=this.left,d=this.width;if(this.isHorizontal())d=Math.max(...this.lineWidths),h=this.top+l,c=Ge(e.align,c,this.right-d);else{const t=this.columnSizes.reduce((e,t)=>Math.max(e,t.height),0);h=l+Ge(e.align,this.top,this.bottom-t-e.labels.padding-this._computeTitleHeight())}const u=Ge(a,c,c+d);o.textAlign=n.textAlign(We(a)),o.textBaseline="middle",o.strokeStyle=t.color,o.fillStyle=t.color,o.font=i.string,xt(o,t.text,u,h,i)}_computeTitleHeight(){const e=this.options.title,t=Nt(e.font),i=jt(e.padding);return e.display?t.lineHeight+i.height:0}_getLegendItemAt(e,t){let i,s,n;if(Ae(e,this.left,this.right)&&Ae(t,this.top,this.bottom))for(n=this.legendHitBoxes,i=0;i<n.length;++i)if(s=n[i],Ae(e,s.left,s.left+s.width)&&Ae(t,s.top,s.top+s.height))return this.legendItems[i];return null}handleEvent(e){const t=this.options;if(!function(e,t){return!("mousemove"!==e&&"mouseout"!==e||!t.onHover&&!t.onLeave)||!(!t.onClick||"click"!==e&&"mouseup"!==e)}(e.type,t))return;const i=this._getLegendItemAt(e.x,e.y);if("mousemove"===e.type||"mouseout"===e.type){const o=this._hoveredItem,a=(n=i,null!==(s=o)&&null!==n&&s.datasetIndex===n.datasetIndex&&s.index===n.index);o&&!a&&Q(t.onLeave,[e,o,this],this),this._hoveredItem=i,i&&!a&&Q(t.onHover,[e,i,this],this)}else i&&Q(t.onClick,[e,i,this],this);var s,n}}function oo(e,t){return t*(e.text?e.text.length:0)}var ao={id:"legend",_element:no,start(e,t,i){const s=e.legend=new no({ctx:e.ctx,options:i,chart:e});fs.configure(e,s,i),fs.addBox(e,s)},stop(e){fs.removeBox(e,e.legend),delete e.legend},beforeUpdate(e,t,i){const s=e.legend;fs.configure(e,s,i),s.options=i},afterUpdate(e){const t=e.legend;t.buildLabels(),t.adjustHitBoxes()},afterEvent(e,t){t.replay||e.legend.handleEvent(t.event)},defaults:{display:!0,position:"top",align:"center",fullSize:!0,reverse:!1,weight:1e3,onClick(e,t,i){const s=t.datasetIndex,n=i.chart;n.isDatasetVisible(s)?(n.hide(s),t.hidden=!0):(n.show(s),t.hidden=!1)},onHover:null,onLeave:null,labels:{color:e=>e.chart.options.color,boxWidth:40,padding:10,generateLabels(e){const t=e.data.datasets,{labels:{usePointStyle:i,pointStyle:s,textAlign:n,color:o,useBorderRadius:a,borderRadius:r}}=e.legend.options;return e._getSortedDatasetMetas().map(e=>{const l=e.controller.getStyle(i?0:void 0),h=jt(l.borderWidth);return{text:t[e.index].label,fillStyle:l.backgroundColor,fontColor:o,hidden:!e.visible,lineCap:l.borderCapStyle,lineDash:l.borderDash,lineDashOffset:l.borderDashOffset,lineJoin:l.borderJoinStyle,lineWidth:(h.width+h.height)/4,strokeStyle:l.borderColor,pointStyle:s||l.pointStyle,rotation:l.rotation,textAlign:n||l.textAlign,borderRadius:a&&(r||l.borderRadius),datasetIndex:e.index}},this)}},title:{color:e=>e.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:e=>!e.startsWith("on"),labels:{_scriptable:e=>!["generateLabels","filter","sort"].includes(e)}}};new WeakMap;const ro={average(e){if(!e.length)return!1;let t,i,s=new Set,n=0,o=0;for(t=0,i=e.length;t<i;++t){const i=e[t].element;if(i&&i.hasValue()){const e=i.tooltipPosition();s.add(e.x),n+=e.y,++o}}return 0!==o&&0!==s.size&&{x:[...s].reduce((e,t)=>e+t)/s.size,y:n/o}},nearest(e,t){if(!e.length)return!1;let i,s,n,o=t.x,a=t.y,r=Number.POSITIVE_INFINITY;for(i=0,s=e.length;i<s;++i){const s=e[i].element;if(s&&s.hasValue()){const e=De(t,s.getCenterPoint());e<r&&(r=e,n=s)}}if(n){const e=n.tooltipPosition();o=e.x,a=e.y}return{x:o,y:a}}};function lo(e,t){return t&&(Y(t)?Array.prototype.push.apply(e,t):e.push(t)),e}function ho(e){return("string"==typeof e||e instanceof String)&&e.indexOf("\n")>-1?e.split("\n"):e}function co(e,t){const{element:i,datasetIndex:s,index:n}=t,o=e.getDatasetMeta(s).controller,{label:a,value:r}=o.getLabelAndValue(n);return{chart:e,label:a,parsed:o.getParsed(n),raw:e.data.datasets[s].data[n],formattedValue:r,dataset:o.getDataset(),dataIndex:n,datasetIndex:s,element:i}}function uo(e,t){const i=e.chart.ctx,{body:s,footer:n,title:o}=e,{boxWidth:a,boxHeight:r}=t,l=Nt(t.bodyFont),h=Nt(t.titleFont),c=Nt(t.footerFont),d=o.length,u=n.length,p=s.length,m=jt(t.padding);let g=m.height,b=0,f=s.reduce((e,t)=>e+t.before.length+t.lines.length+t.after.length,0);f+=e.beforeBody.length+e.afterBody.length,d&&(g+=d*h.lineHeight+(d-1)*t.titleSpacing+t.titleMarginBottom),f&&(g+=p*(t.displayColors?Math.max(r,l.lineHeight):l.lineHeight)+(f-p)*l.lineHeight+(f-1)*t.bodySpacing),u&&(g+=t.footerMarginTop+u*c.lineHeight+(u-1)*t.footerSpacing);let v=0;const w=function(e){b=Math.max(b,i.measureText(e).width+v)};return i.save(),i.font=h.string,ee(e.title,w),i.font=l.string,ee(e.beforeBody.concat(e.afterBody),w),v=t.displayColors?a+2+t.boxPadding:0,ee(s,e=>{ee(e.before,w),ee(e.lines,w),ee(e.after,w)}),v=0,i.font=c.string,ee(e.footer,w),i.restore(),b+=m.width,{width:b,height:g}}function po(e,t,i,s){const{x:n,width:o}=i,{width:a,chartArea:{left:r,right:l}}=e;let h="center";return"center"===s?h=n<=(r+l)/2?"left":"right":n<=o/2?h="left":n>=a-o/2&&(h="right"),function(e,t,i,s){const{x:n,width:o}=s,a=i.caretSize+i.caretPadding;return"left"===e&&n+o+a>t.width||"right"===e&&n-o-a<0||void 0}(h,e,t,i)&&(h="center"),h}function mo(e,t,i){const s=i.yAlign||t.yAlign||function(e,t){const{y:i,height:s}=t;return i<s/2?"top":i>e.height-s/2?"bottom":"center"}(e,i);return{xAlign:i.xAlign||t.xAlign||po(e,t,i,s),yAlign:s}}function go(e,t,i,s){const{caretSize:n,caretPadding:o,cornerRadius:a}=e,{xAlign:r,yAlign:l}=i,h=n+o,{topLeft:c,topRight:d,bottomLeft:u,bottomRight:p}=Dt(a);let m=function(e,t){let{x:i,width:s}=e;return"right"===t?i-=s:"center"===t&&(i-=s/2),i}(t,r);const g=function(e,t,i){let{y:s,height:n}=e;return"top"===t?s+=i:s-="bottom"===t?n+i:n/2,s}(t,l,h);return"center"===l?"left"===r?m+=h:"right"===r&&(m-=h):"left"===r?m-=Math.max(c,u)+n:"right"===r&&(m+=Math.max(d,p)+n),{x:Pe(m,0,s.width-t.width),y:Pe(g,0,s.height-t.height)}}function bo(e,t,i){const s=jt(i.padding);return"center"===t?e.x+e.width/2:"right"===t?e.x+e.width-s.right:e.x+s.left}function fo(e){return lo([],ho(e))}function vo(e,t){const i=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return i?e.override(i):e}const wo={beforeTitle:G,title(e){if(e.length>0){const t=e[0],i=t.chart.data.labels,s=i?i.length:0;if(this&&this.options&&"dataset"===this.options.mode)return t.dataset.label||"";if(t.label)return t.label;if(s>0&&t.dataIndex<s)return i[t.dataIndex]}return""},afterTitle:G,beforeBody:G,beforeLabel:G,label(e){if(this&&this.options&&"dataset"===this.options.mode)return e.label+": "+e.formattedValue||e.formattedValue;let t=e.dataset.label||"";t&&(t+=": ");const i=e.formattedValue;return $(i)||(t+=i),t},labelColor(e){const t=e.chart.getDatasetMeta(e.datasetIndex).controller.getStyle(e.dataIndex);return{borderColor:t.borderColor,backgroundColor:t.backgroundColor,borderWidth:t.borderWidth,borderDash:t.borderDash,borderDashOffset:t.borderDashOffset,borderRadius:0}},labelTextColor(){return this.options.bodyColor},labelPointStyle(e){const t=e.chart.getDatasetMeta(e.datasetIndex).controller.getStyle(e.dataIndex);return{pointStyle:t.pointStyle,rotation:t.rotation}},afterLabel:G,afterBody:G,beforeFooter:G,footer:G,afterFooter:G};function _o(e,t,i,s){const n=e[t].call(i,s);return void 0===n?wo[t].call(i,s):n}class yo extends As{static positioners=ro;constructor(e){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=e.chart,this.options=e.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(e){this.options=e,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const e=this._cachedAnimations;if(e)return e;const t=this.chart,i=this.options.setContext(this.getContext()),s=i.enabled&&t.options.animation&&i.animations,n=new Di(this.chart,s);return s._cacheable&&(this._cachedAnimations=Object.freeze(n)),n}getContext(){return this.$context||(this.$context=Pt(this.chart.getContext(),{tooltip:this,tooltipItems:this._tooltipItems,type:"tooltip"}))}getTitle(e,t){const{callbacks:i}=t,s=_o(i,"beforeTitle",this,e),n=_o(i,"title",this,e),o=_o(i,"afterTitle",this,e);let a=[];return a=lo(a,ho(s)),a=lo(a,ho(n)),a=lo(a,ho(o)),a}getBeforeBody(e,t){return fo(_o(t.callbacks,"beforeBody",this,e))}getBody(e,t){const{callbacks:i}=t,s=[];return ee(e,e=>{const t={before:[],lines:[],after:[]},n=vo(i,e);lo(t.before,ho(_o(n,"beforeLabel",this,e))),lo(t.lines,_o(n,"label",this,e)),lo(t.after,ho(_o(n,"afterLabel",this,e))),s.push(t)}),s}getAfterBody(e,t){return fo(_o(t.callbacks,"afterBody",this,e))}getFooter(e,t){const{callbacks:i}=t,s=_o(i,"beforeFooter",this,e),n=_o(i,"footer",this,e),o=_o(i,"afterFooter",this,e);let a=[];return a=lo(a,ho(s)),a=lo(a,ho(n)),a=lo(a,ho(o)),a}_createItems(e){const t=this._active,i=this.chart.data,s=[],n=[],o=[];let a,r,l=[];for(a=0,r=t.length;a<r;++a)l.push(co(this.chart,t[a]));return e.filter&&(l=l.filter((t,s,n)=>e.filter(t,s,n,i))),e.itemSort&&(l=l.sort((t,s)=>e.itemSort(t,s,i))),ee(l,t=>{const i=vo(e.callbacks,t);s.push(_o(i,"labelColor",this,t)),n.push(_o(i,"labelPointStyle",this,t)),o.push(_o(i,"labelTextColor",this,t))}),this.labelColors=s,this.labelPointStyles=n,this.labelTextColors=o,this.dataPoints=l,l}update(e,t){const i=this.options.setContext(this.getContext()),s=this._active;let n,o=[];if(s.length){const e=ro[i.position].call(this,s,this._eventPosition);o=this._createItems(i),this.title=this.getTitle(o,i),this.beforeBody=this.getBeforeBody(o,i),this.body=this.getBody(o,i),this.afterBody=this.getAfterBody(o,i),this.footer=this.getFooter(o,i);const t=this._size=uo(this,i),a=Object.assign({},e,t),r=mo(this.chart,i,a),l=go(i,a,r,this.chart);this.xAlign=r.xAlign,this.yAlign=r.yAlign,n={opacity:1,x:l.x,y:l.y,width:t.width,height:t.height,caretX:e.x,caretY:e.y}}else 0!==this.opacity&&(n={opacity:0});this._tooltipItems=o,this.$context=void 0,n&&this._resolveAnimations().update(this,n),e&&i.external&&i.external.call(this,{chart:this.chart,tooltip:this,replay:t})}drawCaret(e,t,i,s){const n=this.getCaretPosition(e,i,s);t.lineTo(n.x1,n.y1),t.lineTo(n.x2,n.y2),t.lineTo(n.x3,n.y3)}getCaretPosition(e,t,i){const{xAlign:s,yAlign:n}=this,{caretSize:o,cornerRadius:a}=i,{topLeft:r,topRight:l,bottomLeft:h,bottomRight:c}=Dt(a),{x:d,y:u}=e,{width:p,height:m}=t;let g,b,f,v,w,_;return"center"===n?(w=u+m/2,"left"===s?(g=d,b=g-o,v=w+o,_=w-o):(g=d+p,b=g+o,v=w-o,_=w+o),f=g):(b="left"===s?d+Math.max(r,h)+o:"right"===s?d+p-Math.max(l,c)-o:this.caretX,"top"===n?(v=u,w=v-o,g=b-o,f=b+o):(v=u+m,w=v+o,g=b+o,f=b-o),_=v),{x1:g,x2:b,x3:f,y1:v,y2:w,y3:_}}drawTitle(e,t,i){const s=this.title,n=s.length;let o,a,r;if(n){const l=mi(i.rtl,this.x,this.width);for(e.x=bo(this,i.titleAlign,i),t.textAlign=l.textAlign(i.titleAlign),t.textBaseline="middle",o=Nt(i.titleFont),a=i.titleSpacing,t.fillStyle=i.titleColor,t.font=o.string,r=0;r<n;++r)t.fillText(s[r],l.x(e.x),e.y+o.lineHeight/2),e.y+=o.lineHeight+a,r+1===n&&(e.y+=i.titleMarginBottom-a)}}_drawColorBox(e,t,i,s,n){const o=this.labelColors[i],a=this.labelPointStyles[i],{boxHeight:r,boxWidth:l}=n,h=Nt(n.bodyFont),c=bo(this,"left",n),d=s.x(c),u=r<h.lineHeight?(h.lineHeight-r)/2:0,p=t.y+u;if(n.usePointStyle){const t={radius:Math.min(l,r)/2,pointStyle:a.pointStyle,rotation:a.rotation,borderWidth:1},i=s.leftForLtr(d,l)+l/2,h=p+r/2;e.strokeStyle=n.multiKeyBackground,e.fillStyle=n.multiKeyBackground,pt(e,t,i,h),e.strokeStyle=o.borderColor,e.fillStyle=o.backgroundColor,pt(e,t,i,h)}else{e.lineWidth=K(o.borderWidth)?Math.max(...Object.values(o.borderWidth)):o.borderWidth||1,e.strokeStyle=o.borderColor,e.setLineDash(o.borderDash||[]),e.lineDashOffset=o.borderDashOffset||0;const t=s.leftForLtr(d,l),i=s.leftForLtr(s.xPlus(d,1),l-2),a=Dt(o.borderRadius);Object.values(a).some(e=>0!==e)?(e.beginPath(),e.fillStyle=n.multiKeyBackground,Ct(e,{x:t,y:p,w:l,h:r,radius:a}),e.fill(),e.stroke(),e.fillStyle=o.backgroundColor,e.beginPath(),Ct(e,{x:i,y:p+1,w:l-2,h:r-2,radius:a}),e.fill()):(e.fillStyle=n.multiKeyBackground,e.fillRect(t,p,l,r),e.strokeRect(t,p,l,r),e.fillStyle=o.backgroundColor,e.fillRect(i,p+1,l-2,r-2))}e.fillStyle=this.labelTextColors[i]}drawBody(e,t,i){const{body:s}=this,{bodySpacing:n,bodyAlign:o,displayColors:a,boxHeight:r,boxWidth:l,boxPadding:h}=i,c=Nt(i.bodyFont);let d=c.lineHeight,u=0;const p=mi(i.rtl,this.x,this.width),m=function(i){t.fillText(i,p.x(e.x+u),e.y+d/2),e.y+=d+n},g=p.textAlign(o);let b,f,v,w,_,y,x;for(t.textAlign=o,t.textBaseline="middle",t.font=c.string,e.x=bo(this,g,i),t.fillStyle=i.bodyColor,ee(this.beforeBody,m),u=a&&"right"!==g?"center"===o?l/2+h:l+2+h:0,w=0,y=s.length;w<y;++w){for(b=s[w],f=this.labelTextColors[w],t.fillStyle=f,ee(b.before,m),v=b.lines,a&&v.length&&(this._drawColorBox(t,e,w,p,i),d=Math.max(c.lineHeight,r)),_=0,x=v.length;_<x;++_)m(v[_]),d=c.lineHeight;ee(b.after,m)}u=0,d=c.lineHeight,ee(this.afterBody,m),e.y-=n}drawFooter(e,t,i){const s=this.footer,n=s.length;let o,a;if(n){const r=mi(i.rtl,this.x,this.width);for(e.x=bo(this,i.footerAlign,i),e.y+=i.footerMarginTop,t.textAlign=r.textAlign(i.footerAlign),t.textBaseline="middle",o=Nt(i.footerFont),t.fillStyle=i.footerColor,t.font=o.string,a=0;a<n;++a)t.fillText(s[a],r.x(e.x),e.y+o.lineHeight/2),e.y+=o.lineHeight+i.footerSpacing}}drawBackground(e,t,i,s){const{xAlign:n,yAlign:o}=this,{x:a,y:r}=e,{width:l,height:h}=i,{topLeft:c,topRight:d,bottomLeft:u,bottomRight:p}=Dt(s.cornerRadius);t.fillStyle=s.backgroundColor,t.strokeStyle=s.borderColor,t.lineWidth=s.borderWidth,t.beginPath(),t.moveTo(a+c,r),"top"===o&&this.drawCaret(e,t,i,s),t.lineTo(a+l-d,r),t.quadraticCurveTo(a+l,r,a+l,r+d),"center"===o&&"right"===n&&this.drawCaret(e,t,i,s),t.lineTo(a+l,r+h-p),t.quadraticCurveTo(a+l,r+h,a+l-p,r+h),"bottom"===o&&this.drawCaret(e,t,i,s),t.lineTo(a+u,r+h),t.quadraticCurveTo(a,r+h,a,r+h-u),"center"===o&&"left"===n&&this.drawCaret(e,t,i,s),t.lineTo(a,r+c),t.quadraticCurveTo(a,r,a+c,r),t.closePath(),t.fill(),s.borderWidth>0&&t.stroke()}_updateAnimationTarget(e){const t=this.chart,i=this.$animations,s=i&&i.x,n=i&&i.y;if(s||n){const i=ro[e.position].call(this,this._active,this._eventPosition);if(!i)return;const o=this._size=uo(this,e),a=Object.assign({},i,this._size),r=mo(t,e,a),l=go(e,a,r,t);s._to===l.x&&n._to===l.y||(this.xAlign=r.xAlign,this.yAlign=r.yAlign,this.width=o.width,this.height=o.height,this.caretX=i.x,this.caretY=i.y,this._resolveAnimations().update(this,l))}}_willRender(){return!!this.opacity}draw(e){const t=this.options.setContext(this.getContext());let i=this.opacity;if(!i)return;this._updateAnimationTarget(t);const s={width:this.width,height:this.height},n={x:this.x,y:this.y};i=Math.abs(i)<.001?0:i;const o=jt(t.padding),a=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;t.enabled&&a&&(e.save(),e.globalAlpha=i,this.drawBackground(n,e,s,t),gi(e,t.textDirection),n.y+=o.top,this.drawTitle(n,e,t),this.drawBody(n,e,t),this.drawFooter(n,e,t),bi(e,t.textDirection),e.restore())}getActiveElements(){return this._active||[]}setActiveElements(e,t){const i=this._active,s=e.map(({datasetIndex:e,index:t})=>{const i=this.chart.getDatasetMeta(e);if(!i)throw new Error("Cannot find a dataset at index "+e);return{datasetIndex:e,element:i.data[t],index:t}}),n=!te(i,s),o=this._positionChanged(s,t);(n||o)&&(this._active=s,this._eventPosition=t,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(e,t,i=!0){if(t&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const s=this.options,n=this._active||[],o=this._getActiveElements(e,n,t,i),a=this._positionChanged(o,e),r=t||!te(o,n)||a;return r&&(this._active=o,(s.enabled||s.external)&&(this._eventPosition={x:e.x,y:e.y},this.update(!0,t))),r}_getActiveElements(e,t,i,s){const n=this.options;if("mouseout"===e.type)return[];if(!s)return t.filter(e=>this.chart.data.datasets[e.datasetIndex]&&void 0!==this.chart.getDatasetMeta(e.datasetIndex).controller.getParsed(e.index));const o=this.chart.getElementsAtEventForMode(e,n.mode,n,i);return n.reverse&&o.reverse(),o}_positionChanged(e,t){const{caretX:i,caretY:s,options:n}=this,o=ro[n.position].call(this,e,t);return!1!==o&&(i!==o.x||s!==o.y)}}var xo={id:"tooltip",_element:yo,positioners:ro,afterInit(e,t,i){i&&(e.tooltip=new yo({chart:e,options:i}))},beforeUpdate(e,t,i){e.tooltip&&e.tooltip.initialize(i)},reset(e,t,i){e.tooltip&&e.tooltip.initialize(i)},afterDraw(e){const t=e.tooltip;if(t&&t._willRender()){const i={tooltip:t};if(!1===e.notifyPlugins("beforeTooltipDraw",{...i,cancelable:!0}))return;t.draw(e.ctx),e.notifyPlugins("afterTooltipDraw",i)}},afterEvent(e,t){if(e.tooltip){const i=t.replay;e.tooltip.handleEvent(t.event,i,t.inChartArea)&&(t.changed=!0)}},defaults:{enabled:!0,external:null,position:"average",backgroundColor:"rgba(0,0,0,0.8)",titleColor:"#fff",titleFont:{weight:"bold"},titleSpacing:2,titleMarginBottom:6,titleAlign:"left",bodyColor:"#fff",bodySpacing:2,bodyFont:{},bodyAlign:"left",footerColor:"#fff",footerSpacing:2,footerMarginTop:6,footerFont:{weight:"bold"},footerAlign:"left",padding:6,caretPadding:2,caretSize:5,cornerRadius:6,boxHeight:(e,t)=>t.bodyFont.size,boxWidth:(e,t)=>t.bodyFont.size,multiKeyBackground:"#fff",displayColors:!0,boxPadding:0,borderColor:"rgba(0,0,0,0)",borderWidth:0,animation:{duration:400,easing:"easeOutQuart"},animations:{numbers:{type:"number",properties:["x","y","width","height","caretX","caretY"]},opacity:{easing:"linear",duration:200}},callbacks:wo},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:e=>"filter"!==e&&"itemSort"!==e&&"external"!==e,_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]};function Co(e){const t=this.getLabels();return e>=0&&e<t.length?t[e]:e}function ko(e,t,{horizontal:i,minRotation:s}){const n=Me(s),o=(i?Math.sin(n):Math.cos(n))||.001,a=.75*t*(""+e).length;return Math.min(t/o,a)}class Eo extends Gs{constructor(e){super(e),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}parse(e,t){return $(e)||("number"==typeof e||e instanceof Number)&&!isFinite(+e)?null:+e}handleTickRangeOptions(){const{beginAtZero:e}=this.options,{minDefined:t,maxDefined:i}=this.getUserBounds();let{min:s,max:n}=this;const o=e=>s=t?s:e,a=e=>n=i?n:e;if(e){const e=Ce(s),t=Ce(n);e<0&&t<0?a(0):e>0&&t>0&&o(0)}if(s===n){let t=0===n?1:Math.abs(.05*n);a(n+t),e||o(s-t)}this.min=s,this.max=n}getTickLimit(){const e=this.options.ticks;let t,{maxTicksLimit:i,stepSize:s}=e;return s?(t=Math.ceil(this.max/s)-Math.floor(this.min/s)+1,t>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${s} would result generating up to ${t} ticks. Limiting to 1000.`),t=1e3)):(t=this.computeTickLimit(),i=i||11),i&&(t=Math.min(i,t)),t}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const e=this.options,t=e.ticks;let i=this.getTickLimit();i=Math.max(2,i);const s=function(e,t){const i=[],{bounds:s,step:n,min:o,max:a,precision:r,count:l,maxTicks:h,maxDigits:c,includeBounds:d}=e,u=n||1,p=h-1,{min:m,max:g}=t,b=!$(o),f=!$(a),v=!$(l),w=(g-m)/(c+1);let _,y,x,C,k=Ee((g-m)/p/u)*u;if(k<1e-14&&!b&&!f)return[{value:m},{value:g}];C=Math.ceil(g/k)-Math.floor(m/k),C>p&&(k=Ee(C*k/p/u)*u),$(r)||(_=Math.pow(10,r),k=Math.ceil(k*_)/_),"ticks"===s?(y=Math.floor(m/k)*k,x=Math.ceil(g/k)*k):(y=m,x=g),b&&f&&n&&function(e,t){const i=Math.round(e);return i-t<=e&&i+t>=e}((a-o)/n,k/1e3)?(C=Math.round(Math.min((a-o)/k,h)),k=(a-o)/C,y=o,x=a):v?(y=b?o:y,x=f?a:x,C=l-1,k=(x-y)/C):(C=(x-y)/k,C=ke(C,Math.round(C),k/1e3)?Math.round(C):Math.ceil(C));const E=Math.max(Te(k),Te(y));_=Math.pow(10,$(r)?E:r),y=Math.round(y*_)/_,x=Math.round(x*_)/_;let R=0;for(b&&(d&&y!==o?(i.push({value:o}),y<o&&R++,ke(Math.round((y+R*k)*_)/_,o,ko(o,w,e))&&R++):y<o&&R++);R<C;++R){const e=Math.round((y+R*k)*_)/_;if(f&&e>a)break;i.push({value:e})}return f&&d&&x!==a?i.length&&ke(i[i.length-1].value,a,ko(a,w,e))?i[i.length-1].value=a:i.push({value:a}):f&&x!==a||i.push({value:x}),i}({maxTicks:i,bounds:e.bounds,min:e.min,max:e.max,precision:t.precision,step:t.stepSize,count:t.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:t.minRotation||0,includeBounds:!1!==t.includeBounds},this._range||this);return"ticks"===e.bounds&&function(e,t,i){let s,n,o;for(s=0,n=e.length;s<n;s++)o=e[s][i],isNaN(o)||(t.min=Math.min(t.min,o),t.max=Math.max(t.max,o))}(s,this,"value"),e.reverse?(s.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),s}configure(){const e=this.ticks;let t=this.min,i=this.max;if(super.configure(),this.options.offset&&e.length){const s=(i-t)/Math.max(e.length-1,1)/2;t-=s,i+=s}this._startValue=t,this._endValue=i,this._valueRange=i-t}getLabelForValue(e){return tt(e,this.chart.options.locale,this.options.ticks.format)}}class Ro extends Eo{static id="linear";static defaults={ticks:{callback:st.formatters.numeric}};determineDataLimits(){const{min:e,max:t}=this.getMinMax(!0);this.min=X(e)?e:0,this.max=X(t)?t:1,this.handleTickRangeOptions()}computeTickLimit(){const e=this.isHorizontal(),t=e?this.width:this.height,i=Me(this.options.ticks.minRotation),s=(e?Math.sin(i):Math.cos(i))||.001,n=this._resolveTickFontOptions(0);return Math.ceil(t/Math.min(40,n.lineHeight/s))}getPixelForValue(e){return null===e?NaN:this.getPixelForDecimal((e-this._startValue)/this._valueRange)}getValueForPixel(e){return this._startValue+this.getDecimalForPixel(e)*this._valueRange}}st.formatters.logarithmic,st.formatters.numeric;const Mo="label";function To(e,t){"function"==typeof e?e(t):e&&(e.current=t)}function So(e,t){e.labels=t}function Do(e,t,i=Mo){const s=[];e.datasets=t.map(t=>{const n=e.datasets.find(e=>e[i]===t[i]);return n&&t.data&&!s.includes(n)?(s.push(n),Object.assign(n,t),n):{...t}})}function jo(e,t=Mo){const i={labels:[],datasets:[]};return So(i,e.labels),Do(i,e.datasets,t),i}function No(e,t){const{height:i=150,width:s=300,redraw:n=!1,datasetIdKey:o,type:a,data:r,options:h,plugins:c=[],fallbackContent:d,updateMode:u,...m}=e,g=(0,p.useRef)(null),b=(0,p.useRef)(null),f=()=>{g.current&&(b.current=new xn(g.current,{type:a,data:jo(r,o),options:h&&{...h},plugins:c}),To(t,b.current))},v=()=>{To(t,null),b.current&&(b.current.destroy(),b.current=null)};return(0,p.useEffect)(()=>{!n&&b.current&&h&&function(e,t){const i=e.options;i&&t&&Object.assign(i,t)}(b.current,h)},[n,h]),(0,p.useEffect)(()=>{!n&&b.current&&So(b.current.config.data,r.labels)},[n,r.labels]),(0,p.useEffect)(()=>{!n&&b.current&&r.datasets&&Do(b.current.config.data,r.datasets,o)},[n,r.datasets]),(0,p.useEffect)(()=>{b.current&&(n?(v(),setTimeout(f)):b.current.update(u))},[n,h,r.labels,r.datasets,u]),(0,p.useEffect)(()=>{b.current&&(v(),setTimeout(f))},[a]),(0,p.useEffect)(()=>(f(),()=>v()),[]),(0,l.jsx)("canvas",{ref:g,role:"img",height:i,width:s,...m,children:d})}const Lo=(0,p.forwardRef)(No);function Po(e,t){return xn.register(t),(0,p.forwardRef)((t,i)=>(0,l.jsx)(Lo,{...t,ref:i,type:e}))}const Ao=Po("line",Qi),zo=Po("bar",Ji),Fo=Po("doughnut",Zi);function Oo({waiting:e,title:t,message:i}){return(0,l.jsxs)("div",{className:"slr-chart-empty"+(e?" slr-chart-empty--waiting":""),children:[(0,l.jsx)("div",{className:"slr-chart-empty__grid","aria-hidden":"true"}),(0,l.jsxs)("div",{className:"slr-chart-empty__content",children:[e?(0,l.jsx)("span",{className:"slr-chart-empty__icon dashicons dashicons-update slr-pulse","aria-hidden":"true"}):(0,l.jsx)("span",{className:"slr-chart-empty__icon dashicons dashicons-chart-area","aria-hidden":"true"}),e&&t&&(0,l.jsx)("p",{className:"slr-chart-empty__title",children:t}),i&&(0,l.jsx)("p",{className:"slr-chart-empty__desc",children:i})]})]})}function Ho({title:e,subtitle:t,state:i="content",emptyMessage:s,waitingMessage:n,children:o}){return(0,l.jsxs)("div",{className:"slr-panel slr-dash-panel",children:[e&&(0,l.jsx)("h3",{className:"slr-dash-panel__title",children:e}),t&&(0,l.jsx)("p",{className:"slr-dash-panel__subtitle",children:t}),"waiting"===i&&(0,l.jsx)(Oo,{waiting:!0,title:(0,r.__)("Collecting data","seo-local-rank"),message:n}),"empty"===i&&(0,l.jsx)(Oo,{message:s}),"content"===i&&(0,l.jsx)("div",{className:"slr-dash-panel__content",children:o})]})}function Io({icon:e,title:t}){return(0,l.jsxs)("div",{className:"slr-dash-section__header",children:[(0,l.jsx)("span",{className:`slr-dash-section__icon dashicons ${e}`,"aria-hidden":"true"}),(0,l.jsx)("h2",{className:"slr-dash-section__title",children:t}),(0,l.jsx)("span",{className:"slr-dash-section__line","aria-hidden":"true"})]})}let Bo=!1;const Vo={x:{grid:{display:!1},border:{display:!1},ticks:{color:"#666",font:{size:11}}},y:{grid:{color:"#f5f5f5",drawTicks:!1},border:{display:!1},ticks:{color:"#aaa",font:{size:11}}}},Wo={position:"top",align:"end"};let Go=!1;function Uo(e,t=0){return null==e||Number.isNaN(Number(e))?"—":Number(e).toLocaleString(void 0,{minimumFractionDigits:t,maximumFractionDigits:t})}function $o(e,t=0){if(null==e||Number.isNaN(Number(e)))return"—";const i=Number(e),s=Math.abs(i);return s>=1e6?`${(i/1e6).toFixed(t)}M`:s>=1e3?`${(i/1e3).toFixed(t)}K`:Uo(i,t)}function Yo(e){if(!e)return"";const t=String(e).substring(0,10),i=t.split("-");return 3!==i.length?t:new Date(Date.UTC(Number(i[0]),Number(i[1])-1,Number(i[2]))).toLocaleDateString(void 0,{month:"short",day:"numeric"})}function Ko(e){const t=Math.max(0,Math.min(100,Math.round(e)));return t>=80?"good":t>=60?"ok":t>=40?"warn":"bad"}function Xo({data:e}){const t=e?.kpi_data||{},i=Array.isArray(e?.score_trend)?e.score_trend:[],s=e?.visibility_score||{};let n="content";0===Number(t.num_tracking_prompts||0)?n="empty":0===i.length&&(n="waiting");const o={labels:i.map(e=>Yo(e.date)),datasets:[{label:(0,r.__)("Score","seo-local-rank"),data:i.map(e=>e.score),borderColor:"#4E78F4",backgroundColor:"rgba(78, 120, 244, 0.12)",fill:!0,yAxisID:"yScore",tension:.3,pointRadius:2},{label:(0,r.__)("Mentions","seo-local-rank"),data:i.map(e=>e.mentions),borderColor:"#50B142",backgroundColor:"transparent",yAxisID:"yCount",tension:.3,pointRadius:2},{label:(0,r.__)("Citations","seo-local-rank"),data:i.map(e=>e.citations),borderColor:"#ED922F",backgroundColor:"transparent",yAxisID:"yCount",tension:.3,pointRadius:2}]},a={responsive:!0,maintainAspectRatio:!1,interaction:{mode:"index",intersect:!1},plugins:{legend:Wo},scales:{x:Vo.x,yScore:{...Vo.y,min:0,max:100,position:"left"},yCount:{...Vo.y,position:"right",grid:{drawOnChartArea:!1}}}},h=Array.isArray(s.breakdown)?s.breakdown:[],c="up"===s.trend?(0,r.sprintf)(/* translators: %d: visibility score points gained */ /* translators: %d: visibility score points gained */
     3(0,r.__)("+%d pts","seo-local-rank"),s.delta||0):"down"===s.trend?(0,r.sprintf)(/* translators: %d: visibility score points lost */ /* translators: %d: visibility score points lost */
     4(0,r.__)("-%d pts","seo-local-rank"),s.delta||0):null;return(0,l.jsxs)("section",{className:"slr-dash-section",children:[(0,l.jsx)(Io,{icon:"dashicons-star-filled",title:(0,r.__)("AI Visibility","seo-local-rank")}),(0,l.jsxs)("div",{className:"slr-dash-grid",children:[(0,l.jsx)(Ho,{title:(0,r.__)("Score trend","seo-local-rank"),state:n,emptyMessage:(0,r.__)("Add prompts to see AI visibility trends.","seo-local-rank"),waitingMessage:(0,r.__)("AI visibility data will appear after the first scan.","seo-local-rank"),children:(0,l.jsx)("div",{className:"slr-chart slr-chart--line",children:(0,l.jsx)(Ao,{data:o,options:a})})}),(0,l.jsx)(Ho,{title:(0,r.__)("AI visibility score","seo-local-rank"),state:n,emptyMessage:(0,r.__)("Add prompts to see the visibility score.","seo-local-rank"),waitingMessage:(0,r.__)("Score breakdown will appear after the first scan.","seo-local-rank"),children:(0,l.jsxs)("div",{className:"slr-ai-score",children:[(0,l.jsxs)("div",{className:"slr-ai-score__header",children:[(0,l.jsx)("span",{className:"slr-ai-score__value",children:s.score??"—"}),c&&(0,l.jsx)("span",{className:`slr-ai-score__delta slr-ai-score__delta--${s.trend||"flat"}`,children:c})]}),(0,l.jsx)("ul",{className:"slr-ai-score__breakdown",children:h.map(e=>{return(0,l.jsxs)("li",{className:"slr-ai-score__row",children:[(0,l.jsxs)("div",{className:"slr-ai-score__row-main",children:[(0,l.jsxs)("div",{className:"slr-ai-score__row-head",children:[(0,l.jsx)("span",{children:(t=e.key,{mention_rate:(0,r.__)("Mention rate","seo-local-rank"),citation_rate:(0,r.__)("Citation rate","seo-local-rank"),sentiment_score:(0,r.__)("Sentiment score","seo-local-rank"),share_of_voice:(0,r.__)("Share of voice","seo-local-rank"),llm_coverage:(0,r.__)("LLM coverage","seo-local-rank")}[t]||t)}),(0,l.jsxs)("span",{className:"slr-ai-score__row-weight",children:[e.weight,"%"]})]}),(0,l.jsx)("div",{className:"slr-ai-score__bar",children:(0,l.jsx)("div",{className:"slr-ai-score__bar-fill",style:{width:`${Math.min(100,Number(e.value))}%`}})})]}),(0,l.jsx)("span",{className:"slr-ai-score__row-value",children:e.value})]},e.key);var t})})]})})]})]})}function qo({value:e,positive:t,compact:i=!1,suffix:s="",variant:n="text"}){const o=Number(e);if(!o)return null;const a=t?"up":"down",r=i?$o(Math.abs(o),1):Uo(Math.abs(o),1),h="solid"===n?" slr-trend--solid":"";return(0,l.jsxs)("span",{className:`slr-trend slr-trend--${a}${h}`,"aria-hidden":"true",children:[(0,l.jsx)("span",{className:"slr-trend__arrow",children:t?"▲":"▼"}),r,s]})}function Jo({data:e}){if(3===Number(e?.project_domain?.type_id??0))return null;const t=e?.kpi_data||{},i=e?.current_bl_summary||{},s=e?.prev_bl_summary||{},n=e?.days_since_last_update;let o="content";null===n&&(o="waiting");const a=Number(i.rank||0),h=null!=s?.rank?Number(i.rank)-Number(s.rank):0,c=[{label:(0,r.__)("Backlinks","seo-local-rank"),value:$o(i.backlinks,1),change:null!=s?.backlinks?Number(i.backlinks)-Number(s.backlinks):0,positive:Number(i.backlinks)-Number(s?.backlinks||0)>0},{label:(0,r.__)("Pages","seo-local-rank"),value:$o(i.pages,1),change:null!=s?.pages?Number(i.pages)-Number(s.pages):0,positive:Number(i.pages)-Number(s?.pages||0)>0},{label:(0,r.__)("Referring domains","seo-local-rank"),value:$o(i.main_domains,1),change:Number(t.bl_change_main_domains||0),positive:Number(t.bl_change_main_domains)>0},{label:(0,r.__)("Unique IPs","seo-local-rank"),value:$o(i.ips,1),change:null!=s?.ips?Number(i.ips)-Number(s.ips):0,positive:Number(i.ips)-Number(s?.ips||0)>0}],d={labels:[(0,r.__)("Domain rank","seo-local-rank"),(0,r.__)("Remaining","seo-local-rank")],datasets:[{data:[a,Math.max(0,100-a)],backgroundColor:["#50B142","#EFEFEF"],borderWidth:0}]},u=[Number(i.backlinks||0),Number(i.pages||0),Number(i.main_domains||0),Number(i.ips||0)],p={labels:c.map(e=>e.label),datasets:[{label:(0,r.__)("Backlink metrics","seo-local-rank"),data:u,borderColor:"#4E78F4",backgroundColor:"rgba(78, 120, 244, 0.15)",fill:!0,tension:.4,pointRadius:0}]},m={responsive:!0,maintainAspectRatio:!1,plugins:{legend:{display:!1}},scales:{x:{...Vo.x,ticks:{...Vo.x.ticks,maxRotation:0}},y:{display:!1,min:0}}};return(0,l.jsxs)("section",{className:"slr-dash-section",children:[(0,l.jsx)(Io,{icon:"dashicons-admin-links",title:(0,r.__)("Backlinks","seo-local-rank")}),(0,l.jsxs)("div",{className:"slr-dash-grid slr-dash-grid--backlinks",children:[(0,l.jsx)(Ho,{title:(0,r.__)("Domain rank (DR)","seo-local-rank"),state:o,waitingMessage:(0,r.__)("Backlink summary is being prepared.","seo-local-rank"),children:(0,l.jsxs)("div",{className:"slr-bl-dr",children:[(0,l.jsxs)("div",{className:"slr-bl-dr__score",children:[(0,l.jsx)("span",{className:"slr-bl-dr__value",children:Uo(a)}),(0,l.jsx)(qo,{value:h,positive:h>0,variant:"solid"})]}),(0,l.jsx)("div",{className:"slr-chart slr-chart--donut slr-chart--donut-sm",children:(0,l.jsx)(Fo,{data:d,options:{responsive:!0,maintainAspectRatio:!1,cutout:"55%",plugins:{legend:{display:!1},tooltip:{enabled:!1}}}})})]})}),(0,l.jsxs)(Ho,{title:(0,r.__)("Backlink trends","seo-local-rank"),state:o,waitingMessage:(0,r.__)("Backlink summary is being prepared.","seo-local-rank"),children:[(0,l.jsx)("ul",{className:"slr-bl-metrics",children:c.map(e=>(0,l.jsxs)("li",{className:"slr-bl-metrics__item",children:[(0,l.jsx)("span",{className:"slr-bl-metrics__label",children:e.label}),(0,l.jsxs)("span",{className:"slr-bl-metrics__value",children:[e.value,(0,l.jsx)(qo,{value:e.change,positive:e.positive,compact:!0})]})]},e.label))}),(0,l.jsx)("div",{className:"slr-chart slr-chart--area",children:(0,l.jsx)(Ao,{data:p,options:m})})]})]})]})}function Zo(){return(0,l.jsxs)("div",{className:"slr-dashboard slr-dashboard--loading","aria-busy":"true","aria-label":(0,r.__)("Loading dashboard","seo-local-rank"),children:[(0,l.jsxs)("div",{className:"slr-toolbar slr-toolbar--skeleton",children:[(0,l.jsx)("div",{className:"slr-skeleton slr-skeleton--selector"}),(0,l.jsx)("div",{className:"slr-skeleton slr-skeleton--upgrade"})]}),(0,l.jsxs)("div",{className:"slr-dashboard__body",children:[(0,l.jsx)("div",{className:"slr-kpi-grid slr-kpi-grid--dashboard",children:[1,2,3,4].map(e=>(0,l.jsxs)("div",{className:"slr-kpi-card slr-kpi-card--rich slr-kpi-card--skeleton",children:[(0,l.jsx)("div",{className:"slr-skeleton slr-skeleton--line slr-skeleton--sm"}),(0,l.jsx)("div",{className:"slr-skeleton slr-skeleton--line slr-skeleton--lg"}),(0,l.jsx)("div",{className:"slr-skeleton slr-skeleton--line slr-skeleton--md"})]},e))}),(0,l.jsxs)("div",{className:"slr-dash-grid",children:[(0,l.jsxs)("div",{className:"slr-panel slr-dash-panel slr-dash-panel--skeleton",children:[(0,l.jsx)("div",{className:"slr-skeleton slr-skeleton--line slr-skeleton--sm"}),(0,l.jsx)("div",{className:"slr-skeleton slr-skeleton--chart"})]}),(0,l.jsxs)("div",{className:"slr-panel slr-dash-panel slr-dash-panel--skeleton",children:[(0,l.jsx)("div",{className:"slr-skeleton slr-skeleton--line slr-skeleton--sm"}),(0,l.jsx)("div",{className:"slr-skeleton slr-skeleton--chart slr-skeleton--chart-sm"})]})]})]})]})}Go||(xn.register(class extends Gs{static id="category";static defaults={ticks:{callback:Co}};constructor(e){super(e),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(e){const t=this._addedLabels;if(t.length){const e=this.getLabels();for(const{index:i,label:s}of t)e[i]===s&&e.splice(i,1);this._addedLabels=[]}super.init(e)}parse(e,t){if($(e))return null;const i=this.getLabels();return((e,t)=>null===e?null:Pe(Math.round(e),0,t))(t=isFinite(t)&&i[t]===e?t:function(e,t,i,s){const n=e.indexOf(t);return-1===n?((e,t,i,s)=>("string"==typeof t?(i=e.push(t)-1,s.unshift({index:i,label:t})):isNaN(t)&&(i=null),i))(e,t,i,s):n!==e.lastIndexOf(t)?i:n}(i,e,J(t,e),this._addedLabels),i.length-1)}determineDataLimits(){const{minDefined:e,maxDefined:t}=this.getUserBounds();let{min:i,max:s}=this.getMinMax(!0);"ticks"===this.options.bounds&&(e||(i=0),t||(s=this.getLabels().length-1)),this.min=i,this.max=s}buildTicks(){const e=this.min,t=this.max,i=this.options.offset,s=[];let n=this.getLabels();n=0===e&&t===n.length-1?n:n.slice(e,t+1),this._valueRange=Math.max(n.length-(i?0:1),1),this._startValue=this.min-(i?.5:0);for(let i=e;i<=t;i++)s.push({value:i});return s}getLabelForValue(e){return Co.call(this,e)}configure(){super.configure(),this.isHorizontal()||(this._reversePixels=!this._reversePixels)}getPixelForValue(e){return"number"!=typeof e&&(e=this.parse(e)),null===e?NaN:this.getPixelForDecimal((e-this._startValue)/this._valueRange)}getPixelForTick(e){const t=this.ticks;return e<0||e>t.length-1?null:this.getPixelForValue(t[e].value)}getValueForPixel(e){return Math.round(this._startValue+this.getDecimalForPixel(e)*this._valueRange)}getBasePixel(){return this.bottom}},Ro,class extends As{static id="point";parsed;skip;stop;static defaults={borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0};static defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};constructor(e){super(),this.options=void 0,this.parsed=void 0,this.skip=void 0,this.stop=void 0,e&&Object.assign(this,e)}inRange(e,t,i){const s=this.options,{x:n,y:o}=this.getProps(["x","y"],i);return Math.pow(e-n,2)+Math.pow(t-o,2)<Math.pow(s.hitRadius+s.radius,2)}inXRange(e,t){return Pn(this,e,"x",t)}inYRange(e,t){return Pn(this,e,"y",t)}getCenterPoint(e){const{x:t,y:i}=this.getProps(["x","y"],e);return{x:t,y:i}}size(e){let t=(e=e||this.options||{}).radius||0;return t=Math.max(t,t&&e.hoverRadius||0),2*(t+(t&&e.borderWidth||0))}draw(e,t){const i=this.options;this.skip||i.radius<.1||!gt(this,t,this.size(i)/2)||(e.strokeStyle=i.borderColor,e.lineWidth=i.borderWidth,e.fillStyle=i.backgroundColor,pt(e,i,this.x,this.y))}getRange(){const e=this.options||{};return e.radius+e.hitRadius}},Ln,class extends As{static id="bar";static defaults={borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0};static defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};constructor(e){super(),this.options=void 0,this.horizontal=void 0,this.base=void 0,this.width=void 0,this.height=void 0,this.inflateAmount=void 0,e&&Object.assign(this,e)}draw(e){const{inflateAmount:t,options:{borderColor:i,backgroundColor:s}}=this,{inner:n,outer:o}=function(e){const t=An(e),i=t.right-t.left,s=t.bottom-t.top,n=function(e,t,i){const s=e.options.borderWidth,n=e.borderSkipped,o=St(s);return{t:zn(n.top,o.top,0,i),r:zn(n.right,o.right,0,t),b:zn(n.bottom,o.bottom,0,i),l:zn(n.left,o.left,0,t)}}(e,i/2,s/2),o=function(e,t,i){const{enableBorderRadius:s}=e.getProps(["enableBorderRadius"]),n=e.options.borderRadius,o=Dt(n),a=Math.min(t,i),r=e.borderSkipped,l=s||K(n);return{topLeft:zn(!l||r.top||r.left,o.topLeft,0,a),topRight:zn(!l||r.top||r.right,o.topRight,0,a),bottomLeft:zn(!l||r.bottom||r.left,o.bottomLeft,0,a),bottomRight:zn(!l||r.bottom||r.right,o.bottomRight,0,a)}}(e,i/2,s/2);return{outer:{x:t.left,y:t.top,w:i,h:s,radius:o},inner:{x:t.left+n.l,y:t.top+n.t,w:i-n.l-n.r,h:s-n.t-n.b,radius:{topLeft:Math.max(0,o.topLeft-Math.max(n.t,n.l)),topRight:Math.max(0,o.topRight-Math.max(n.t,n.r)),bottomLeft:Math.max(0,o.bottomLeft-Math.max(n.b,n.l)),bottomRight:Math.max(0,o.bottomRight-Math.max(n.b,n.r))}}}}(this),a=(r=o.radius).topLeft||r.topRight||r.bottomLeft||r.bottomRight?Ct:On;var r;e.save(),o.w===n.w&&o.h===n.h||(e.beginPath(),a(e,Hn(o,t,n)),e.clip(),a(e,Hn(n,-t,o)),e.fillStyle=i,e.fill("evenodd")),e.beginPath(),a(e,Hn(n,t)),e.fillStyle=s,e.fill(),e.restore()}inRange(e,t,i){return Fn(this,e,t,i)}inXRange(e,t){return Fn(this,e,null,t)}inYRange(e,t){return Fn(this,null,e,t)}getCenterPoint(e){const{x:t,y:i,base:s,horizontal:n}=this.getProps(["x","y","base","horizontal"],e);return{x:n?(t+s)/2:t,y:n?i:(i+s)/2}}getRange(e){return"x"===e?this.width/2:this.height/2}},class extends As{static id="arc";static defaults={borderAlign:"center",borderColor:"#fff",borderDash:[],borderDashOffset:0,borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:!0,selfJoin:!1};static defaultRoutes={backgroundColor:"backgroundColor"};static descriptors={_scriptable:!0,_indexable:e=>"borderDash"!==e};circumference;endAngle;fullCircles;innerRadius;outerRadius;pixelMargin;startAngle;constructor(e){super(),this.options=void 0,this.circumference=void 0,this.startAngle=void 0,this.endAngle=void 0,this.innerRadius=void 0,this.outerRadius=void 0,this.pixelMargin=0,this.fullCircles=0,e&&Object.assign(this,e)}inRange(e,t,i){const s=this.getProps(["x","y"],i),{angle:n,distance:o}=Se(s,{x:e,y:t}),{startAngle:a,endAngle:r,innerRadius:l,outerRadius:h,circumference:c}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],i),d=(this.options.spacing+this.options.borderWidth)/2,u=J(c,r-a),p=Le(n,a,r)&&a!==r,m=u>=ge||p,g=Ae(o,l+d,h+d);return m&&g}getCenterPoint(e){const{x:t,y:i,startAngle:s,endAngle:n,innerRadius:o,outerRadius:a}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius"],e),{offset:r,spacing:l}=this.options,h=(s+n)/2,c=(o+a+l+r)/2;return{x:t+Math.cos(h)*c,y:i+Math.sin(h)*c}}tooltipPosition(e){return this.getCenterPoint(e)}draw(e){const{options:t,circumference:i}=this,s=(t.offset||0)/4,n=(t.spacing||0)/2,o=t.circular;if(this.pixelMargin="inner"===t.borderAlign?.33:0,this.fullCircles=i>ge?Math.floor(i/ge):0,0===i||this.innerRadius<0||this.outerRadius<0)return;e.save();const a=(this.startAngle+this.endAngle)/2;e.translate(Math.cos(a)*s,Math.sin(a)*s);const r=s*(1-Math.sin(Math.min(me,i||0)));e.fillStyle=t.backgroundColor,e.strokeStyle=t.borderColor,function(e,t,i,s,n){const{fullCircles:o,startAngle:a,circumference:r}=t;let l=t.endAngle;if(o){En(e,t,i,s,l,n);for(let t=0;t<o;++t)e.fill();isNaN(r)||(l=a+(r%ge||ge))}En(e,t,i,s,l,n),e.fill()}(e,this,r,n,o),function(e,t,i,s,n){const{fullCircles:o,startAngle:a,circumference:r,options:l}=t,{borderWidth:h,borderJoinStyle:c,borderDash:d,borderDashOffset:u,borderRadius:p}=l,m="inner"===l.borderAlign;if(!h)return;e.setLineDash(d||[]),e.lineDashOffset=u,m?(e.lineWidth=2*h,e.lineJoin=c||"round"):(e.lineWidth=h,e.lineJoin=c||"bevel");let g=t.endAngle;if(o){En(e,t,i,s,g,n);for(let t=0;t<o;++t)e.stroke();isNaN(r)||(g=a+(r%ge||ge))}m&&function(e,t,i){const{startAngle:s,pixelMargin:n,x:o,y:a,outerRadius:r,innerRadius:l}=t;let h=n/r;e.beginPath(),e.arc(o,a,r,s-h,i+h),l>n?(h=n/l,e.arc(o,a,l,i+h,s-h,!0)):e.arc(o,a,n,i+we,s-we),e.closePath(),e.clip()}(e,t,g),l.selfJoin&&g-a>=me&&0===p&&"miter"!==c&&function(e,t,i){const{startAngle:s,x:n,y:o,outerRadius:a,innerRadius:r,options:l}=t,{borderWidth:h,borderJoinStyle:c}=l,d=Math.min(h/a,Ne(s-i));if(e.beginPath(),e.arc(n,o,a-h/2,s+d/2,i-d/2),r>0){const t=Math.min(h/r,Ne(s-i));e.arc(n,o,r+h/2,i-t/2,s+t/2,!0)}else{const t=Math.min(h/2,a*Ne(s-i));if("round"===c)e.arc(n,o,t,i-me/2,s+me/2,!0);else if("bevel"===c){const a=2*t*t,r=-a*Math.cos(i+me/2)+n,l=-a*Math.sin(i+me/2)+o,h=a*Math.cos(s+me/2)+n,c=a*Math.sin(s+me/2)+o;e.lineTo(r,l),e.lineTo(h,c)}}e.closePath(),e.moveTo(0,0),e.rect(0,0,e.canvas.width,e.canvas.height),e.clip("evenodd")}(e,t,g),o||(En(e,t,i,s,g,n),e.stroke())}(e,this,r,n,o),e.restore()}},io,xo,ao),Bo||(xn.defaults.font.family="Poppins, sans-serif",xn.defaults.font.size=11,xn.defaults.color="#767676",xn.defaults.plugins.legend.labels.boxWidth=8,xn.defaults.plugins.legend.labels.usePointStyle=!0,xn.defaults.plugins.legend.labels.padding=12,xn.defaults.plugins.tooltip.backgroundColor="#fff",xn.defaults.plugins.tooltip.titleColor="#0b172b",xn.defaults.plugins.tooltip.bodyColor="#0b172b",xn.defaults.plugins.tooltip.borderColor="#efefef",xn.defaults.plugins.tooltip.borderWidth=1,xn.defaults.plugins.tooltip.padding=10,xn.defaults.plugins.tooltip.displayColors=!0,xn.defaults.plugins.tooltip.cornerRadius=6,xn.defaults.plugins.tooltip.boxPadding=4,Bo=!0),Go=!0);const Qo={upgrade:{es:"/admin/precios",en:"/en/admin/pricing"},ai_visibility:{es:"/admin/dominio/visibilidad-ia/%d",en:"/en/admin/domain/ai-visibility/%d",de:"/de/admin/domain/ki-sichtbarkeit/%d",fr:"/fr/admin/domain/visibilite-ia/%d",pt:"/pt/admin/domain/visibilidade-ia/%d",it:"/it/admin/domain/visibilita-ia/%d",nl:"/nl/admin/domain/ai-zichtbaarheid/%d"},backlinks:{es:"/admin/dominio/enlaces/%d",en:"/en/admin/domain/backlinks/%d"},seo_audits:{es:"/admin/dominio/auditorias-seo/%d",en:"/en/admin/domain/seo-audits/%d"}};function ea(){return(window.slrAdmin?.appOrigin||"https://app.trueranker.com").replace(/\/$/,"")}function ta(e,t){const i=Qo[e];if(!i)return"";const s=i[function(){const e=String(window.slrAdmin?.pageLang||window.slrAdmin?.lang||"en").toLowerCase();return["es","en","de","fr","pt","it","nl"].includes(e)?e:"en"}()]||i.en||i.es||"";if(!s)return"";if(s.includes("%d")){const e=parseInt(t,10);return e?s.replace("%d",String(e)):""}return s}function ia(e,t){if(e&&!e.closed)return e.opener=null,void(e.location.href=t);window.open(t,"_blank")}function sa(e){const t=new URL(window.location.href);return t.searchParams.set("page",e),t.href}async function na(e="upgrade",t=0){const i=window.open("about:blank","_blank"),n={page:e};t&&(n.project_domain_id=t);try{const e=await s()({path:o("/connection/plugin-login-url"),method:"POST",data:n});if(e?.url&&"string"==typeof e.url)return void ia(i,e.url)}catch(e){}const a=function(e,t){if("upgrade"===e)return window.slrAdmin?.upgradeUrl||`${ea()}${ta("upgrade",0)}`;const i=ta(e,t);return i?`${ea()}${i}`:""}(e,t);a?ia(i,a):function(e){e&&!e.closed&&e.close()}(i)}function oa({icon:e,title:t,state:i,emptyMessage:s,waitingMessage:n,main:o,footer:a,href:h,onActivate:c,disabled:d}){const u=["slr-kpi-card","slr-kpi-card--rich",Boolean(h||c)?"slr-kpi-card--clickable":""].filter(Boolean).join(" ");return(0,l.jsxs)("div",{className:u,children:[h?(0,l.jsx)("a",{className:"slr-kpi-card__hit",href:h,children:(0,l.jsx)("span",{className:"screen-reader-text",children:t})}):null,c?(0,l.jsx)("button",{type:"button",className:"slr-kpi-card__hit",onClick:c,disabled:d,"aria-label":t}):null,(0,l.jsxs)("div",{className:"slr-kpi-card__header",children:[(0,l.jsx)("span",{className:`slr-kpi-card__icon dashicons ${e}`,"aria-hidden":"true"}),(0,l.jsx)("span",{className:"slr-kpi-card__title",children:t})]}),"waiting"===i&&(0,l.jsxs)("div",{className:"slr-kpi-card__state slr-kpi-card__state--waiting",children:[(0,l.jsx)("span",{className:"slr-kpi-card__pulse dashicons dashicons-update slr-pulse","aria-hidden":"true"}),(0,l.jsx)("p",{className:"slr-kpi-card__state-title",children:(0,r.__)("Collecting data","seo-local-rank")}),n&&(0,l.jsx)("p",{className:"slr-kpi-card__state-desc",children:n})]}),"empty"===i&&(0,l.jsxs)("div",{className:"slr-kpi-card__state slr-kpi-card__state--empty",children:[(0,l.jsx)("span",{className:"slr-kpi-card__empty-icon dashicons dashicons-chart-area","aria-hidden":"true"}),(0,l.jsx)("p",{className:"slr-kpi-card__state-desc",children:s})]}),"content"===i&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)("div",{className:"slr-kpi-card__main",children:o}),a&&(0,l.jsx)("div",{className:"slr-kpi-card__footer",children:a})]})]})}function aa({label:e,value:t,trend:i}){return(0,l.jsxs)("div",{className:"slr-kpi-card__row",children:[(0,l.jsx)("span",{className:"slr-kpi-card__row-label",children:e}),(0,l.jsxs)("span",{className:"slr-kpi-card__row-value",children:[t,i]})]})}function ra({data:e,projectDomainId:i}){const[s,n]=(0,t.useState)(""),o=e?.kpi_data||{},a=e?.visibility_score||{},h=e?.mentions_summary||{},c=e?.project_seo_audit_data||{},d=Boolean(e?.seo_audit_enabled),u=Number(e?.project_domain?.type_id??0),p=e?.keywords_data?Object.keys(e.keywords_data).length:0,m=Array.isArray(e?.score_trend)?e.score_trend:[],g=Number(h.mentions_total||0)-Number(h.mentions_previous||0),b=Number(h.citations_total||0)-Number(h.citations_previous||0);let f="content";0===Number(o.num_tracking_keywords)?f="empty":0===p&&(f="waiting");let v="content";0===Number(o.num_tracking_prompts)?v="empty":0===m.length&&(v="waiting");let w="content";3===u?w="hidden":null===e?.days_since_last_update&&(w="waiting");const _=Number(c.audits_count||0),y=o.vi_current,x=sa("seolocalrank-rank-tracker"),C=sa("seolocalrank-ai-visibility"),k=async e=>{if(!s&&i){n(e);try{await na(e,i)}finally{n("")}}};return(0,l.jsxs)("div",{className:"slr-kpi-grid slr-kpi-grid--dashboard",children:[(0,l.jsx)(oa,{icon:"dashicons-chart-line",title:(0,r.__)("Rank Tracker","seo-local-rank"),state:f,emptyMessage:(0,r.__)("Add keywords to start tracking rankings.","seo-local-rank"),waitingMessage:(0,r.__)("Rank data will appear after the first update.","seo-local-rank"),href:x,main:(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)("div",{className:"slr-kpi-card__value-row",children:[(0,l.jsx)("span",{className:"slr-kpi-card__value",children:Uo(o.tk_avg_rank,1)}),(0,l.jsx)(qo,{value:o.tk_change_avg_rank,positive:Number(o.tk_change_avg_rank)<0,variant:"solid"})]}),(0,l.jsx)("p",{className:"slr-kpi-card__metric-label",children:(0,r.__)("Average position","seo-local-rank")})]}),footer:(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(aa,{label:(0,r.__)("Organic visibility","seo-local-rank"),value:`${Uo(o.tk_avg_ov,2)}%`,trend:(0,l.jsx)(qo,{value:o.tk_change_avg_ov,positive:Number(o.tk_change_avg_ov)>0,suffix:"%"})}),(0,l.jsx)(aa,{label:(0,r.__)("Keywords","seo-local-rank"),value:Uo(o.num_tracking_keywords)})]})}),(0,l.jsx)(oa,{icon:"dashicons-star-filled",title:(0,r.__)("AI Visibility","seo-local-rank"),state:v,emptyMessage:(0,r.__)("Add prompts to measure AI visibility.","seo-local-rank"),waitingMessage:(0,r.__)("AI visibility data will appear after the first scan.","seo-local-rank"),href:C,main:(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)("div",{className:"slr-kpi-card__value-row",children:[(0,l.jsx)("span",{className:"slr-kpi-card__value",children:Uo(a.score)}),(0,l.jsx)(qo,{value:a.delta,positive:"up"===a.trend,variant:"solid"})]}),(0,l.jsx)("p",{className:"slr-kpi-card__metric-label",children:(0,r.__)("AI visibility score","seo-local-rank")})]}),footer:(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(aa,{label:(0,r.__)("Mentions","seo-local-rank"),value:Uo(h.mentions_total),trend:(0,l.jsx)(qo,{value:g,positive:g>0})}),(0,l.jsx)(aa,{label:(0,r.__)("Citations","seo-local-rank"),value:Uo(h.citations_total),trend:(0,l.jsx)(qo,{value:b,positive:b>0})}),(0,l.jsx)(aa,{label:(0,r.__)("Prompts","seo-local-rank"),value:Uo(o.num_tracking_prompts)})]})}),"hidden"!==w&&(0,l.jsx)(oa,{icon:"dashicons-admin-links",title:(0,r.__)("Backlinks","seo-local-rank"),state:w,waitingMessage:(0,r.__)("Backlink summary is being prepared.","seo-local-rank"),onActivate:()=>k("backlinks"),disabled:Boolean(s)||!i,main:(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)("div",{className:"slr-kpi-card__value-row",children:[(0,l.jsx)("span",{className:"slr-kpi-card__value",children:$o(o.bl_main_domains,1)}),(0,l.jsx)(qo,{value:o.bl_change_main_domains,positive:Number(o.bl_change_main_domains)>0,compact:!0,variant:"solid"})]}),(0,l.jsx)("p",{className:"slr-kpi-card__metric-label",children:(0,r.__)("Referring domains","seo-local-rank")})]}),footer:(0,l.jsx)(aa,{label:(0,r.__)("Tracked backlinks","seo-local-rank"),value:Uo(o.num_tracked_backlinks),trend:Number(o.num_tracked_backlinks_with_issues)>0?(0,l.jsxs)("span",{className:"slr-trend slr-trend--down slr-trend--issues",children:[Uo(o.num_tracked_backlinks_with_issues)," ",(0,r.__)("with issues","seo-local-rank")]}):null})}),d?(0,l.jsx)(oa,{icon:"dashicons-search",title:(0,r.__)("SEO Audits","seo-local-rank"),state:_>0?"content":"empty",emptyMessage:(0,r.__)("No audits yet for this project.","seo-local-rank"),onActivate:()=>k("seo_audits"),disabled:Boolean(s)||!i,main:(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)("div",{className:"slr-kpi-card__value-row",children:[(0,l.jsx)("span",{className:`slr-kpi-card__value slr-kpi-card__value--${Ko(c.avg_score)}`,children:Uo(c.avg_score,1)}),(0,l.jsx)("span",{className:"slr-kpi-card__value-suffix",children:"/100"})]}),(0,l.jsx)("p",{className:"slr-kpi-card__metric-label",children:(0,r.__)("Average score","seo-local-rank")})]}),footer:(0,l.jsx)(aa,{label:(0,r.__)("URLs audited","seo-local-rank"),value:Uo(_)})}):(0,l.jsx)(oa,{icon:"dashicons-heart",title:(0,r.__)("Visibility index","seo-local-rank"),state:null!=y?"content":"empty",emptyMessage:(0,r.__)("Visibility index data is not available yet.","seo-local-rank"),main:(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)("div",{className:"slr-kpi-card__value-row",children:[(0,l.jsx)("span",{className:"slr-kpi-card__value",children:Uo(y,4)}),(0,l.jsx)(qo,{value:o.vi_change_one_month,positive:Number(o.vi_change_one_month)>0,suffix:"%",variant:"solid"})]}),(0,l.jsx)("p",{className:"slr-kpi-card__metric-label",children:(0,r.__)("Mobile visibility","seo-local-rank")})]})})]})}function la(e){return e?.project_domain_id||e?.id||0}function ha(e,t=""){return e?.project_name||e?.name_displayed||e?.name||t}function ca({domain:e,size:t=24}){const i=a(e?.favicon||""),s=ha(e);return i?(0,l.jsx)("img",{className:"slr-project-selector__favicon",src:i,alt:"",width:t,height:t}):(0,l.jsx)("span",{className:"slr-project-selector__favicon slr-project-selector__favicon--fallback","aria-hidden":"true",children:(n=s,n&&"string"==typeof n?n.charAt(0).toUpperCase():"?")});var n}function da(){return(0,l.jsx)("span",{className:"slr-upgrade-button__icon","aria-hidden":"true"})}function ua({count:e,sync:t}){if(null==e)return null;let i="",s="",n="";return t&&(t.paused>0?(i="warn",s="dashicons-controls-pause",n=(0,r.sprintf)(/* translators: %d: number of paused keywords */ /* translators: %d: number of paused keywords */
     5(0,r._n)("%d paused","%d paused",t.paused,"seo-local-rank"),t.paused)):e>0&&(n=(0,r.sprintf)(/* translators: %d: percent of keywords updated */ /* translators: %d: percent of keywords updated */
     6(0,r.__)("%d%% updated","seo-local-rank"),Math.round(Number(t.percent)||0)),t.withoutEndData>0?(i="warn",s="dashicons-update"):i="ok")),(0,l.jsxs)("div",{className:"slr-toolbar__keywords",children:[(0,l.jsx)("span",{children:(0,r.sprintf)(/* translators: %d: number of keywords */ /* translators: %d: number of keywords */
     7(0,r._n)("%d Keyword","%d Keywords",e,"seo-local-rank"),e)}),n&&(0,l.jsxs)("span",{className:`slr-toolbar__sync slr-toolbar__sync--${i}`,children:["(",n,s&&(0,l.jsx)("span",{className:`dashicons ${s}`,"aria-hidden":"true"}),")"]})]})}function pa({selectedProject:e,domains:i,siteDomain:n,onProjectChange:a,keywordCount:h=null,keywordSync:c=null,promptCount:d=null}){const[u,p]=(0,t.useState)(!1),[m,g]=(0,t.useState)(!1),[b,f]=(0,t.useState)(""),[v,w]=(0,t.useState)(!1),_=(0,t.useRef)(null),y=la(e),x=ha(e,n),C=i.length>1,k=i.length>0,E=(0,t.useMemo)(()=>{const e=b.trim().toLowerCase();return e?i.filter(t=>[t.project_name,t.name_displayed,t.name].filter(Boolean).join(" ").toLowerCase().includes(e)):i},[i,b]);return(0,t.useEffect)(()=>{if(!m)return;const e=e=>{_.current&&!_.current.contains(e.target)&&(g(!1),f(""))};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[m]),(0,l.jsxs)("div",{className:"slr-toolbar",children:[(0,l.jsxs)("div",{className:"slr-toolbar__left",children:[(0,l.jsxs)("div",{className:"slr-project-selector",ref:_,children:[(0,l.jsxs)("button",{type:"button",className:"slr-project-selector__toggle","aria-expanded":m,"aria-haspopup":"listbox",disabled:u||0===i.length,onClick:()=>k&&g(e=>!e),children:[(0,l.jsx)(ca,{domain:e}),(0,l.jsx)("span",{className:"slr-project-selector__name",children:x}),(0,l.jsx)("span",{className:"dashicons dashicons-arrow-down-alt2 slr-project-selector__chevron","aria-hidden":"true"})]}),m&&k&&(0,l.jsxs)("div",{className:"slr-project-selector__menu",role:"listbox",children:[C&&(0,l.jsxs)("div",{className:"slr-project-selector__search",children:[(0,l.jsx)("span",{className:"dashicons dashicons-search","aria-hidden":"true"}),(0,l.jsx)("input",{type:"search",value:b,onChange:e=>f(e.target.value),placeholder:(0,r.__)("Search project…","seo-local-rank"),autoComplete:"off"})]}),(0,l.jsxs)("ul",{className:"slr-project-selector__list",children:[E.map(e=>{const t=la(e),i=t===y;return(0,l.jsx)("li",{children:(0,l.jsxs)("button",{type:"button",role:"option","aria-selected":i,className:"slr-project-selector__item"+(i?" is-selected":""),onClick:()=>(async e=>{if(!u&&e&&e!==y){p(!0),g(!1),f("");try{await s()({path:o(`/domains/${e}/select`),method:"POST"}),a()}finally{p(!1)}}else g(!1)})(t),children:[(0,l.jsx)(ca,{domain:e,size:20}),(0,l.jsx)("span",{className:"slr-project-selector__item-name",children:ha(e)}),i&&(0,l.jsx)("span",{className:"dashicons dashicons-yes slr-project-selector__check","aria-hidden":"true"})]})},t)}),0===E.length&&(0,l.jsx)("li",{className:"slr-project-selector__empty",children:(0,r.__)("No projects found.","seo-local-rank")})]})]})]}),(0,l.jsx)(ua,{count:h,sync:c}),null!=d&&(0,l.jsx)("div",{className:"slr-toolbar__keywords",children:(0,l.jsx)("span",{children:(0,r.sprintf)(/* translators: %d: number of prompts */ /* translators: %d: number of prompts */
     8(0,r._n)("%d Prompt","%d Prompts",d,"seo-local-rank"),d)})})]}),(0,l.jsxs)("button",{type:"button",className:"slr-upgrade-button",disabled:v,onClick:async()=>{if(!v){w(!0);try{await na()}finally{w(!1)}}},children:[(0,l.jsx)(da,{}),(0,l.jsx)("span",{children:(0,r.__)("Upgrade","seo-local-rank")})]})]})}function ma({data:e}){const t=e?.kpi_data||{},i=(s=e?.keywords_data,s?(Array.isArray(s)?s:Object.values(s)).filter(e=>e&&"object"==typeof e).sort((e,t)=>String(t.date).localeCompare(String(e.date))):[]);var s;let n="content";0===Number(t.num_tracking_keywords||0)?n="empty":0===i.length&&(n="waiting");const o=[...i].reverse().filter(e=>Number(e.count)>0),a=function(e){if(!e||!e.count)return[];const t=Number(e.count),i=e=>Math.round(100*Number(e)/t*10)/10,s=["#EDC92F","#69B5EB","#3A8AD5","#1F78B4","#CCCCCC"],n=[{label:(0,r.__)("Top 1–3","seo-local-rank"),value:i(e.top_1_3)},{label:(0,r.__)("Top 4–10","seo-local-rank"),value:i(e.top_4_10)}];return 1===Number(e.max_depth)?n.push({label:(0,r.__)("Top 11+","seo-local-rank"),value:i((e.top_11_20||0)+(e.top_21_50||0)+(e.top_51_100||0)+(e.top_101||0))}):(n.push({label:(0,r.__)("Top 11–20","seo-local-rank"),value:i(e.top_11_20)}),Number(e.max_depth)>5?(n.push({label:(0,r.__)("Top 21–100","seo-local-rank"),value:i((e.top_21_50||0)+(e.top_51_100||0))}),n.push({label:(0,r.__)("Top 101+","seo-local-rank"),value:i(e.top_101)})):Number(e.max_depth)>2?(n.push({label:(0,r.__)("Top 21–50","seo-local-rank"),value:i(e.top_21_50)}),n.push({label:(0,r.__)("Top 51+","seo-local-rank"),value:i((e.top_51_100||0)+(e.top_101||0))})):n.push({label:(0,r.__)("Top 21+","seo-local-rank"),value:i((e.top_21_50||0)+(e.top_51_100||0)+(e.top_101||0))})),n.filter(e=>e.value>0).map((e,t)=>({...e,color:s[t]||s[s.length-1]}))}(i[0]||null),h={labels:o.map(e=>Yo(e.date)),datasets:[{label:(0,r.__)("Average position","seo-local-rank"),data:o.map(e=>Math.round(e.sum_rank/e.count*10)/10),borderColor:"#EF7A35",backgroundColor:"transparent",yAxisID:"yRank",tension:.3,pointRadius:3},{label:(0,r.__)("Organic visibility","seo-local-rank"),data:o.map(e=>Math.round(e.sum_ov/e.count*10)/10),borderColor:"#4E78F4",backgroundColor:"transparent",yAxisID:"yOv",tension:.3,pointRadius:3}]},c=h.datasets[0].data,d=h.datasets[1].data,u={responsive:!0,maintainAspectRatio:!1,interaction:{mode:"index",intersect:!1},plugins:{legend:Wo},scales:{x:Vo.x,yRank:{...Vo.y,position:"left",reverse:!0,min:c.length?Math.max(1,Math.min(...c)-2):1,max:c.length?Math.max(...c)+2:100},yOv:{...Vo.y,position:"right",min:d.length?Math.max(0,Math.min(...d)-1):0,max:d.length?Math.max(...d)+1:100,grid:{drawOnChartArea:!1}}}},p={labels:a.map(e=>e.label),datasets:[{data:a.map(e=>e.value),backgroundColor:a.map(e=>e.color),borderWidth:0}]};return(0,l.jsxs)("section",{className:"slr-dash-section",children:[(0,l.jsx)(Io,{icon:"dashicons-chart-line",title:(0,r.__)("Rank Tracker","seo-local-rank")}),(0,l.jsxs)("div",{className:"slr-dash-grid",children:[(0,l.jsx)(Ho,{title:(0,r.__)("Evolution","seo-local-rank"),subtitle:(0,r.__)("Positioning and organic visibility over the last 30 days.","seo-local-rank"),state:n,emptyMessage:(0,r.__)("Add keywords to see rank evolution.","seo-local-rank"),waitingMessage:(0,r.__)("Rank data will appear after the first update.","seo-local-rank"),children:(0,l.jsx)("div",{className:"slr-chart slr-chart--line",children:(0,l.jsx)(Ao,{data:h,options:u})})}),(0,l.jsx)(Ho,{title:(0,r.__)("Keywords distribution","seo-local-rank"),state:"content"===n&&0===a.length?"empty":n,emptyMessage:(0,r.__)("No distribution data yet.","seo-local-rank"),waitingMessage:(0,r.__)("Distribution will appear after the first update.","seo-local-rank"),children:(0,l.jsx)("div",{className:"slr-chart slr-chart--donut",children:(0,l.jsx)(Fo,{data:p,options:{responsive:!0,maintainAspectRatio:!1,cutout:"55%",plugins:{legend:{position:"bottom",labels:{boxWidth:10,padding:12}},tooltip:{callbacks:{label:e=>`${e.label}: ${e.parsed}%`}}}}})})})]})]})}function ga({domainsPayload:e,selectedProject:i,onProjectChange:a}){const h=e?.domains||[],c=e?.domain||"",d=i?.project_domain_id||i?.id||0,[u,p]=(0,t.useState)(null),[m,g]=(0,t.useState)(!1),[b,f]=(0,t.useState)(""),v=(0,t.useCallback)(async()=>{if(d){g(!0),f("");try{const e=await s()({path:o(`/domains/dashboard?project_domain_id=${d}`)});p(e?.data||null)}catch(e){p(null),f(e?.message||(0,r.__)("Could not load the dashboard. Try again later.","seo-local-rank"))}finally{g(!1)}}else p(null)},[d]);return(0,t.useEffect)(()=>{v()},[v]),0===h.length?(0,l.jsxs)("div",{className:"slr-panel slr-empty-state",children:[(0,l.jsx)("h2",{className:"slr-panel__title",children:(0,r.__)("No project for this domain","seo-local-rank")}),(0,l.jsx)("p",{children:(0,t.createInterpolateElement)((0,r.sprintf)(/* translators: %s: site domain */ /* translators: %s: site domain */
     9(0,r.__)("There is no TrueRanker project for <strong>%s</strong>.","seo-local-rank"),c),{strong:(0,l.jsx)("strong",{})})}),(0,l.jsx)(n.Notice,{status:"info",isDismissible:!1,children:(0,r.__)("Creating a project from scratch will be available soon.","seo-local-rank")})]}):i?m&&!u?(0,l.jsx)(Zo,{}):(0,l.jsxs)("div",{className:"slr-dashboard",children:[(0,l.jsx)(pa,{selectedProject:i,domains:h,siteDomain:c,onProjectChange:a}),(0,l.jsxs)("div",{className:"slr-dashboard__body",children:[b&&(0,l.jsx)(n.Notice,{status:"error",isDismissible:!1,children:b}),u&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(ra,{data:u,projectDomainId:d}),(0,l.jsx)(ma,{data:u}),(0,l.jsx)(Xo,{data:u}),(0,l.jsx)(Jo,{data:u})]})]})]}):(0,l.jsx)("div",{className:"slr-panel slr-empty-state",children:(0,l.jsx)("p",{children:(0,r.__)("No project selected.","seo-local-rank")})})}const ba="welcome",fa="api-key",va="start-fresh";function wa({settings:e,onConnected:i}){const a="string"==typeof e?.wp_user_email?e.wp_user_email:"",[h,c]=(0,t.useState)(ba),[d,u]=(0,t.useState)(""),[p,m]=(0,t.useState)(a),[g,b]=(0,t.useState)(!1),[f,v]=(0,t.useState)(!1),[w,_]=(0,t.useState)(!1),[y,x]=(0,t.useState)(null),C=e?.api_key_url||"https://app.trueranker.com/es/admin/api-key",k=f||w,E=()=>{c(ba),x(null),u(""),m(a),b(!1)},R=async()=>{if(d.trim()){v(!0),x(null);try{await s()({path:o("/settings"),method:"POST",data:{api_key:d.trim()}}),u(""),i()}catch(e){x({status:"error",message:e?.message||(0,r.__)("Could not connect with this API key.","seo-local-rank")})}finally{v(!1)}}else x({status:"error",message:(0,r.__)("Enter your API key.","seo-local-rank")})};return(0,l.jsx)("div",{className:"slr-onboarding",children:(0,l.jsxs)("div",{className:"slr-panel slr-onboarding__panel",children:[y&&(0,l.jsx)(n.Notice,{status:y.status,isDismissible:!0,onRemove:()=>x(null),children:y.message}),h===ba&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)("p",{className:"slr-onboarding__lead",children:(0,r.__)("TrueRanker helps you track keyword rankings, monitor backlinks and measure your AI visibility — all from WordPress.","seo-local-rank")}),(0,l.jsx)("p",{className:"slr-onboarding__question",children:(0,r.__)("How do you want to get started?","seo-local-rank")}),(0,l.jsxs)("div",{className:"slr-onboarding__actions",children:[(0,l.jsx)(n.Button,{variant:"primary",onClick:()=>{x(null),c(fa)},children:(0,r.__)("Connect existing account","seo-local-rank")}),(0,l.jsx)(n.Button,{variant:"secondary",onClick:()=>{x(null),c(va)},children:(0,r.__)("Start from scratch","seo-local-rank")})]})]}),h===fa&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)("h2",{className:"slr-panel__title",children:(0,r.__)("Connect your account","seo-local-rank")}),(0,l.jsx)("p",{className:"slr-onboarding__help",children:(0,r.__)("Paste your TrueRanker API key to link this WordPress site with your account.","seo-local-rank")}),(0,l.jsx)("p",{className:"slr-onboarding__help",children:(0,l.jsx)("a",{href:C,target:"_blank",rel:"noopener noreferrer",children:(0,r.__)("Get API key in TrueRanker","seo-local-rank")})}),(0,l.jsx)(n.TextControl,{label:(0,r.__)("API Key","seo-local-rank"),value:d,onChange:u,type:"password",disabled:k}),(0,l.jsxs)("div",{className:"slr-onboarding__actions",children:[(0,l.jsx)(n.Button,{variant:"primary",onClick:R,isBusy:f,disabled:k,children:(0,r.__)("Connect","seo-local-rank")}),(0,l.jsx)(n.Button,{variant:"secondary",onClick:E,disabled:k,children:(0,r.__)("Back","seo-local-rank")})]})]}),h===va&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)("h2",{className:"slr-panel__title",children:(0,r.__)("Start from scratch","seo-local-rank")}),(0,l.jsx)("p",{className:"slr-onboarding__help",children:g?(0,r.__)("We have sent the API key to this email. The field can no longer be changed.","seo-local-rank"):(0,r.__)("Enter your email. TrueRanker will send you an API key to connect this site. The key is not shown here: it arrives by email only.","seo-local-rank")}),(0,l.jsx)(n.TextControl,{label:(0,r.__)("Email","seo-local-rank"),value:p,onChange:m,type:"email",disabled:k||g,readOnly:g}),!g&&(0,l.jsxs)("div",{className:"slr-onboarding__actions",children:[(0,l.jsx)(n.Button,{variant:"primary",onClick:async()=>{if(p.trim()){_(!0),x(null);try{const e=await s()({path:o("/connection/send-api-key"),method:"POST",data:{email:p.trim()}});x({status:"success",message:e?.message||(0,r.__)("Check your inbox: we have sent you the API key. Paste it below to connect.","seo-local-rank")}),b(!0)}catch(e){x({status:"error",message:e?.message||(0,r.__)("Could not send the API key. Please try again.","seo-local-rank")})}finally{_(!1)}}else x({status:"error",message:(0,r.__)("Enter a valid email.","seo-local-rank")})},isBusy:w,disabled:k,children:(0,r.__)("Send API key","seo-local-rank")}),(0,l.jsx)(n.Button,{variant:"secondary",onClick:E,disabled:k,children:(0,r.__)("Back","seo-local-rank")})]}),g&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)("hr",{className:"slr-onboarding__divider"}),(0,l.jsx)("p",{className:"slr-onboarding__help",children:(0,r.__)("When you receive the email, paste the API key here to connect.","seo-local-rank")}),(0,l.jsx)(n.TextControl,{label:(0,r.__)("API Key","seo-local-rank"),value:d,onChange:u,type:"password",disabled:k}),(0,l.jsxs)("div",{className:"slr-onboarding__actions",children:[(0,l.jsx)(n.Button,{variant:"primary",onClick:R,isBusy:f,disabled:k,children:(0,r.__)("Connect","seo-local-rank")}),(0,l.jsx)(n.Button,{variant:"secondary",onClick:E,disabled:k,children:(0,r.__)("Back","seo-local-rank")})]})]})]})]})})}function _a(){return(0,l.jsxs)("div",{className:"slr-ai-visibility slr-ai-visibility--loading","aria-busy":"true","aria-label":(0,r.__)("Loading AI Visibility","seo-local-rank"),children:[(0,l.jsxs)("div",{className:"slr-toolbar slr-toolbar--skeleton",children:[(0,l.jsx)("div",{className:"slr-skeleton slr-skeleton--selector"}),(0,l.jsx)("div",{className:"slr-skeleton slr-skeleton--upgrade"})]}),(0,l.jsxs)("div",{className:"slr-ai-visibility__body",children:[(0,l.jsxs)("div",{className:"slr-aiv-top",children:[(0,l.jsxs)("div",{className:"slr-panel slr-aiv-card slr-dash-panel--skeleton",children:[(0,l.jsx)("div",{className:"slr-skeleton slr-skeleton--line slr-skeleton--sm"}),(0,l.jsx)("div",{className:"slr-skeleton slr-skeleton--line slr-skeleton--lg"}),(0,l.jsx)("div",{className:"slr-skeleton slr-skeleton--bar"})]}),(0,l.jsxs)("div",{className:"slr-aiv-middle",children:[(0,l.jsx)("div",{className:"slr-panel slr-aiv-card slr-dash-panel--skeleton",children:(0,l.jsx)("div",{className:"slr-skeleton slr-skeleton--line slr-skeleton--lg"})}),(0,l.jsx)("div",{className:"slr-panel slr-aiv-card slr-dash-panel--skeleton",children:(0,l.jsx)("div",{className:"slr-skeleton slr-skeleton--line slr-skeleton--lg"})})]}),(0,l.jsxs)("div",{className:"slr-panel slr-aiv-card slr-dash-panel--skeleton",children:[(0,l.jsx)("div",{className:"slr-skeleton slr-skeleton--line slr-skeleton--sm"}),(0,l.jsx)("div",{className:"slr-skeleton slr-skeleton--chart slr-skeleton--chart-sm"})]})]}),(0,l.jsx)("div",{className:"slr-panel slr-aiv-card slr-dash-panel--skeleton",children:(0,l.jsx)("div",{className:"slr-skeleton slr-skeleton--chart"})})]})]})}function ya(e){return e?.data?.dashboard&&"object"==typeof e.data.dashboard?e.data.dashboard:{}}function xa(e){return Number(e?.data?.num_prompts??0)}function Ca(e){const t=e?.data?.llms;return Array.isArray(t)?t:[]}function ka(e){const t=ya(e).prompts;return Array.isArray(t)?t:[]}function Ea(e){const t=ya(e).competitors;return Array.isArray(t)?t:[]}function Ra(e){return ya(e).brand_sov||null}function Ma(e){const t=String(e||""),i=t.match(/^rgba\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*[\d.]+\s*\)$/i);return i?`rgb(${i[1]}, ${i[2]}, ${i[3]})`:t||"#007BFF"}function Ta(e){const t=String(e||"").toLowerCase().replace(/[\s_-]+/g,"");return"googleai"===t||t.includes("googleai")?"google":t.includes("chatgpt")||t.includes("openai")?"chatgpt":t.includes("claude")?"claude":t.includes("gemini")?"gemini":t.includes("perplexity")?"perplexity":t.includes("grok")?"grok":t.includes("deepseek")?"deepseek":t.includes("google")?"google":t||"unknown"}const Sa={chatgpt:"#10a37f",claude:"#d97757",gemini:"#4285f4",perplexity:"#20b2aa",grok:"#1a8cd8",deepseek:"#4d6bfe",google:"#ea4335"};function Da(e){return String(e??"").replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")}function ja({visible:e,compact:t=!1}){return e?(0,l.jsxs)("div",{className:"slr-aiv-collecting"+(t?" slr-aiv-collecting--compact":""),"aria-live":"polite",children:[(0,l.jsx)("span",{className:"slr-aiv-collecting__spinner","aria-hidden":"true"}),!t&&(0,l.jsx)("p",{className:"slr-aiv-collecting__text",children:(0,r.__)("Collecting data","seo-local-rank")})]}):null}function Na(e){if(!e)return"—";const t=String(e).substring(0,10),i=t.split("-");return 3!==i.length?t:new Date(Date.UTC(Number(i[0]),Number(i[1])-1,Number(i[2]))).toLocaleDateString(void 0,{month:"long",day:"numeric",year:"numeric",timeZone:"UTC"})}function La(e){switch(String(e||"").toLowerCase()){case"traction":return(0,r.__)("Traction","seo-local-rank");case"alert":return(0,r.__)("Alert","seo-local-rank");case"competition":return(0,r.__)("Competition","seo-local-rank");case"milestone":return(0,r.__)("Milestone","seo-local-rank");default:return e||""}}function Pa({changes:e,collecting:t}){const i=function(e){const t={};return(Array.isArray(e)?e:[]).forEach(e=>{const i=e?.periodDate||"";t[i]||(t[i]=[]),t[i].push(e)}),t}(Array.isArray(e)?e:[]),s=Object.keys(i).sort((e,t)=>t.localeCompare(e));return(0,l.jsxs)("div",{className:"slr-panel slr-aiv-card slr-aiv-changes"+(t?" is-collecting":""),children:[0===s.length?(0,l.jsx)("p",{className:"slr-aiv-changes__empty",children:(0,r.__)("No significant milestones detected in this period.","seo-local-rank")}):(0,l.jsx)("div",{className:"slr-aiv-changes__list",children:s.map((e,t)=>(0,l.jsxs)("div",{className:"slr-aiv-changes__group",children:[(0,l.jsx)("div",{className:"slr-aiv-changes__date",children:Na(e)}),(0,l.jsx)("div",{className:"slr-aiv-changes__rows",children:i[e].map((t,i)=>{const s=t?.metricValues?.previousValue,n=t?.metricValues?.currentValue,o=void 0!==s&&void 0!==n;return(0,l.jsxs)("div",{className:"slr-aiv-changes__row",children:[(0,l.jsx)("span",{className:`slr-aiv-changes__badge slr-aiv-changes__badge--${String(t.severity||"").toLowerCase()}`,children:La(t.severity)}),(0,l.jsx)("span",{className:"slr-aiv-changes__message",children:t.UIMessage||""}),(0,l.jsx)("span",{className:"slr-aiv-changes__delta",children:o?`${s} → ${n}`:"—"})]},`${e}-${t.eventType||i}`)})})]},e||t))}),(0,l.jsx)(ja,{visible:t})]})}function Aa({entity:e,max:t,isBrand:i}){const s=t>0?Math.round(Number(e.sov||0)/t*100):0,n=a(e.icon||"");return(0,l.jsxs)("tr",{className:i?"is-brand":"",children:[(0,l.jsx)("td",{children:(0,l.jsxs)("span",{className:"slr-aiv-comp__name",children:[!i&&(0,l.jsx)("span",{className:"slr-aiv-comp__dot",style:{background:e.color||"#aaa"},"aria-hidden":"true"}),n?(0,l.jsx)("img",{src:n,alt:"",width:"16",height:"16"}):null,(0,l.jsx)("span",{children:e.name})]})}),(0,l.jsx)("td",{children:(0,l.jsxs)("div",{className:"slr-aiv-comp__sov",children:[(0,l.jsx)("div",{className:"slr-aiv-comp__sov-track",children:(0,l.jsx)("div",{className:"slr-aiv-comp__sov-fill",style:{width:`${s}%`,background:e.solid_color||e.color||"#007BFF"}})}),(0,l.jsxs)("span",{children:[e.sov??0,"%"]})]})})]})}function za({brandSov:e,competitors:i,limit:s,collecting:o,projectDomainId:a}){const[h,c]=(0,t.useState)(!1),d=Array.isArray(i)?i:[],u=[e,...d].filter(Boolean).reduce((e,t)=>Math.max(e,Number(t.sov||0)),0),p=Number(a)>0,m=async()=>{if(!h&&p){c(!0);try{await na("ai_visibility",a)}finally{c(!1)}}};return(0,l.jsxs)("div",{className:"slr-panel slr-aiv-card slr-aiv-comp"+(o?" is-collecting":""),children:[(0,l.jsxs)("div",{className:"slr-aiv-comp__head",children:[(0,l.jsx)("span",{children:(0,r.__)("Competitors","seo-local-rank")}),d.length>0&&(0,l.jsxs)("div",{className:"slr-aiv-comp__head-actions",children:[(0,l.jsx)("span",{className:"slr-aiv-comp__count",children:(0,r.sprintf)(/* translators: 1: current competitors, 2: plan limit */ /* translators: 1: current competitors, 2: plan limit */
     10(0,r.__)("%1$d of %2$d","seo-local-rank"),d.length,Number(s||0))}),(0,l.jsx)(n.Button,{variant:"secondary",className:"slr-aiv-comp__add",disabled:!p||h,isBusy:h,onClick:m,children:(0,r.__)("Add competitor","seo-local-rank")})]})]}),0===d.length?(0,l.jsx)("div",{className:"slr-aiv-comp__empty",children:(0,l.jsx)(n.Button,{variant:"primary",disabled:!p||h,isBusy:h,onClick:m,children:(0,r.__)("Add first competitor","seo-local-rank")})}):(0,l.jsx)("div",{className:"slr-aiv-comp__table-wrap",children:(0,l.jsxs)("table",{className:"slr-aiv-comp__table",children:[(0,l.jsx)("thead",{children:(0,l.jsxs)("tr",{children:[(0,l.jsx)("th",{children:(0,r.__)("Website","seo-local-rank")}),(0,l.jsx)("th",{children:(0,r.__)("Share of voice","seo-local-rank")})]})}),(0,l.jsxs)("tbody",{children:[e?(0,l.jsx)(Aa,{entity:e,max:u,isBrand:!0}):null,d.map(e=>(0,l.jsx)(Aa,{entity:e,max:u},e.id||e.name))]})]})}),(0,l.jsx)(ja,{visible:o&&d.length>0})]})}function Fa({projectDomainId:e}){const[i,s]=(0,t.useState)(!1),o=Number(e)>0;return(0,l.jsxs)("section",{className:"slr-panel slr-aiv-empty",children:[(0,l.jsx)("span",{className:"slr-aiv-empty__badge","aria-hidden":"true",children:(0,l.jsx)("span",{className:"dashicons dashicons-star-filled"})}),(0,l.jsxs)("div",{className:"slr-aiv-empty__head",children:[(0,l.jsx)("h2",{children:(0,r.__)("No prompts in this project","seo-local-rank")}),(0,l.jsx)("p",{children:(0,r.__)("Add prompts to start measuring how AI models mention and cite your brand.","seo-local-rank")})]}),(0,l.jsxs)("div",{className:"slr-aiv-empty__features",children:[(0,l.jsxs)("div",{className:"slr-aiv-empty__feature",children:[(0,l.jsx)("span",{className:"slr-aiv-empty__feature-icon slr-aiv-empty__feature-icon--blue","aria-hidden":"true",children:(0,l.jsx)("span",{className:"dashicons dashicons-edit"})}),(0,l.jsxs)("div",{children:[(0,l.jsx)("strong",{children:(0,r.__)("Track AI mentions","seo-local-rank")}),(0,l.jsx)("span",{children:(0,r.__)("See when ChatGPT, Claude, Gemini and others mention your brand.","seo-local-rank")})]})]}),(0,l.jsxs)("div",{className:"slr-aiv-empty__feature",children:[(0,l.jsx)("span",{className:"slr-aiv-empty__feature-icon slr-aiv-empty__feature-icon--cyan","aria-hidden":"true",children:(0,l.jsx)("span",{className:"dashicons dashicons-format-chat"})}),(0,l.jsxs)("div",{children:[(0,l.jsx)("strong",{children:(0,r.__)("Compare models","seo-local-rank")}),(0,l.jsx)("span",{children:(0,r.__)("Check mention and citation status for each LLM.","seo-local-rank")})]})]}),(0,l.jsxs)("div",{className:"slr-aiv-empty__feature",children:[(0,l.jsx)("span",{className:"slr-aiv-empty__feature-icon slr-aiv-empty__feature-icon--violet","aria-hidden":"true",children:(0,l.jsx)("span",{className:"dashicons dashicons-awards"})}),(0,l.jsxs)("div",{children:[(0,l.jsx)("strong",{children:(0,r.__)("Beat competitors","seo-local-rank")}),(0,l.jsx)("span",{children:(0,r.__)("Measure share of voice against the sites AI recommends.","seo-local-rank")})]})]})]}),(0,l.jsx)(n.Button,{variant:"primary",className:"slr-aiv-empty__cta",icon:"plus-alt2",disabled:!o||i,isBusy:i,onClick:async()=>{if(!i&&o){s(!0);try{await na("ai_visibility",e)}finally{s(!1)}}},children:(0,r.__)("Add prompts","seo-local-rank")}),(0,l.jsxs)("p",{className:"slr-aiv-empty__hint",children:[(0,l.jsx)("span",{className:"dashicons dashicons-lightbulb","aria-hidden":"true"}),(0,r.__)("First results usually appear after the next scan.","seo-local-rank")]})]})}function Oa({coverage:e,brandName:t,collecting:i}){const s=Array.isArray(e)?e:[],n=s.filter(e=>e.mentioned).length;return(0,l.jsxs)("div",{className:"slr-panel slr-aiv-card slr-aiv-coverage"+(i?" is-collecting":""),children:[(0,l.jsx)("div",{className:"slr-aiv-coverage__kicker",children:(0,r.__)("LLM coverage","seo-local-rank")}),(0,l.jsxs)("div",{className:"slr-aiv-coverage__count",children:[(0,l.jsx)("span",{className:"slr-aiv-coverage__num",children:s.length?n:"—"}),(0,l.jsxs)("span",{className:"slr-aiv-coverage__den",children:["/ ",s.length||"—"]}),(0,l.jsxs)("span",{className:"slr-aiv-coverage__sub",children:[(0,r.__)("models mention","seo-local-rank"),t?(0,l.jsxs)("strong",{children:[" ",t]}):null]})]}),(0,l.jsx)("div",{className:"slr-aiv-coverage__bar",children:s.map(e=>{return(0,l.jsx)("div",{className:"slr-aiv-coverage__seg",style:{background:e.mentioned?(t=e.icon||e.label,Sa[Ta(t)]||"#aaa"):"#e5e7eb"},title:e.label},e.llm_id||e.label);var t})}),(0,l.jsx)("div",{className:"slr-aiv-coverage__list",children:s.map(e=>{const t=Ta(e.icon||e.label),i=!e.mentioned;return(0,l.jsxs)("div",{className:"slr-aiv-coverage__item"+(i?" is-muted":""),children:[(0,l.jsx)("span",{className:`slr-aiv-llm-icon slr-aiv-llm-icon--${t}`,"aria-hidden":"true"}),(0,l.jsx)("span",{className:"slr-aiv-coverage__name",children:e.label}),(0,l.jsx)("span",{className:"slr-aiv-coverage__rate",children:null===e.mention_rate||void 0===e.mention_rate?"—":`${e.mention_rate}%`})]},e.llm_id||e.label)})}),(0,l.jsx)(ja,{visible:i,compact:!0})]})}function Ha({label:e,value:t,total:i,previous:s}){const{diff:n,trend:o}=function(e,t){const i=Number(e||0)-Number(t||0);return i>0?{diff:i,trend:"up"}:i<0?{diff:i,trend:"down"}:{diff:0,trend:"flat"}}(t,s),a="up"===o?"↑":"down"===o?"↓":"→",h=n>0?"+":"";return(0,l.jsxs)("div",{className:"slr-aiv-metric",children:[(0,l.jsx)("div",{className:"slr-aiv-metric__label",children:e}),(0,l.jsxs)("div",{className:"slr-aiv-metric__value",children:[(0,l.jsx)("span",{className:"slr-aiv-metric__num",children:t??0}),(0,l.jsxs)("span",{className:"slr-aiv-metric__den",children:[" / ",i??0]})]}),(0,l.jsx)("div",{className:`slr-aiv-score__delta slr-aiv-score__delta--${o}`,children:(0,r.sprintf)(/* translators: 1: arrow 2: signed change */ /* translators: 1: arrow 2: signed change */
     11(0,r.__)("%1$s %2$s vs prev","seo-local-rank"),a,`${h}${n}`)})]})}function Ia({summary:e,collecting:t}){const i=Number(e?.mentions_total||0),s=Number(e?.citations_total||0),n=Number(e?.prompts_total||0);return(0,l.jsxs)("div",{className:"slr-panel slr-aiv-card slr-aiv-mentions"+(t?" is-collecting":""),children:[(0,l.jsxs)("div",{className:"slr-aiv-mentions__row",children:[(0,l.jsx)(Ha,{label:(0,r.__)("Mentions","seo-local-rank"),value:i,total:n,previous:e?.mentions_previous}),(0,l.jsx)("div",{className:"slr-aiv-mentions__divider"}),(0,l.jsx)(Ha,{label:(0,r.__)("Citations","seo-local-rank"),value:s,total:n,previous:e?.citations_previous})]}),(0,l.jsx)(ja,{visible:t,compact:!0})]})}class Ba{constructor(e){this.table=e}reloadData(e,t,i){return this.table.dataLoader.load(e,void 0,void 0,void 0,t,i)}langText(){return this.table.modules.localize.getText(...arguments)}langBind(){return this.table.modules.localize.bind(...arguments)}langLocale(){return this.table.modules.localize.getLocale(...arguments)}commsConnections(){return this.table.modules.comms.getConnections(...arguments)}commsSend(){return this.table.modules.comms.send(...arguments)}layoutMode(){return this.table.modules.layout.getMode()}layoutRefresh(e){return this.table.modules.layout.layout(e)}subscribe(){return this.table.eventBus.subscribe(...arguments)}unsubscribe(){return this.table.eventBus.unsubscribe(...arguments)}subscribed(e){return this.table.eventBus.subscribed(e)}subscriptionChange(){return this.table.eventBus.subscriptionChange(...arguments)}dispatch(){return this.table.eventBus.dispatch(...arguments)}chain(){return this.table.eventBus.chain(...arguments)}confirm(){return this.table.eventBus.confirm(...arguments)}dispatchExternal(){return this.table.externalEvents.dispatch(...arguments)}subscribedExternal(e){return this.table.externalEvents.subscribed(e)}subscriptionChangeExternal(){return this.table.externalEvents.subscriptionChange(...arguments)}options(e){return this.table.options[e]}setOption(e,t){return void 0!==t&&(this.table.options[e]=t),this.table.options[e]}deprecationCheck(e,t,i){return this.table.deprecationAdvisor.check(e,t,i)}deprecationCheckMsg(e,t){return this.table.deprecationAdvisor.checkMsg(e,t)}deprecationMsg(e){return this.table.deprecationAdvisor.msg(e)}module(e){return this.table.module(e)}}class Va{static elVisible(e){return!(e.offsetWidth<=0&&e.offsetHeight<=0)}static elOffset(e){var t=e.getBoundingClientRect();return{top:t.top+window.pageYOffset-document.documentElement.clientTop,left:t.left+window.pageXOffset-document.documentElement.clientLeft}}static retrieveNestedData(e,t,i){var s,n=e?t.split(e):[t],o=n.length;for(let e=0;e<o&&(s=i=i[n[e]],i);e++);return s}static deepClone(e,t,i=[]){var s={}.__proto__,n=[].__proto__;for(var o in t||(t=Object.assign(Array.isArray(e)?[]:{},e)),e){let a,r,l=e[o];null==l||"object"!=typeof l||l.__proto__!==s&&l.__proto__!==n||(a=i.findIndex(e=>e.subject===l),a>-1?t[o]=i[a].copy:(r=Object.assign(Array.isArray(l)?[]:{},l),i.unshift({subject:l,copy:r}),t[o]=this.deepClone(l,r,i)))}return t}}let Wa=class e extends Ba{constructor(e,t,i){super(e),this.element=t,this.container=this._lookupContainer(),this.parent=i,this.reversedX=!1,this.childPopup=null,this.blurable=!1,this.blurCallback=null,this.blurEventsBound=!1,this.renderedCallback=null,this.visible=!1,this.hideable=!0,this.element.classList.add("tabulator-popup-container"),this.blurEvent=this.hide.bind(this,!1),this.escEvent=this._escapeCheck.bind(this),this.destroyBinding=this.tableDestroyed.bind(this),this.destroyed=!1}tableDestroyed(){this.destroyed=!0,this.hide(!0)}_lookupContainer(){var e=this.table.options.popupContainer;return"string"==typeof e?(e=document.querySelector(e))||console.warn("Menu Error - no container element found matching selector:",this.table.options.popupContainer,"(defaulting to document body)"):!0===e&&(e=this.table.element),e&&!this._checkContainerIsParent(e)&&(e=!1,console.warn("Menu Error - container element does not contain this table:",this.table.options.popupContainer,"(defaulting to document body)")),e||(e=document.body),e}_checkContainerIsParent(e,t=this.table.element){return e===t||!!t.parentNode&&this._checkContainerIsParent(e,t.parentNode)}renderCallback(e){this.renderedCallback=e}containerEventCoords(e){var t=!(e instanceof MouseEvent),i=t?e.touches[0].pageX:e.pageX,s=t?e.touches[0].pageY:e.pageY;if(this.container!==document.body){let e=Va.elOffset(this.container);i-=e.left,s-=e.top}return{x:i,y:s}}elementPositionCoords(e,t="right"){var i,s,n,o=Va.elOffset(e);switch(this.container!==document.body&&(i=Va.elOffset(this.container),o.left-=i.left,o.top-=i.top),t){case"right":s=o.left+e.offsetWidth,n=o.top-1;break;case"bottom":s=o.left,n=o.top+e.offsetHeight;break;case"left":s=o.left,n=o.top-1;break;case"top":s=o.left,n=o.top;break;case"center":s=o.left+e.offsetWidth/2,n=o.top+e.offsetHeight/2}return{x:s,y:n,offset:o}}show(e,t){var i,s,n,o,a;return this.destroyed||this.table.destroyed||(e instanceof HTMLElement?(n=e,o=(a=this.elementPositionCoords(e,t)).offset,i=a.x,s=a.y):"number"==typeof e?(o={top:0,left:0},i=e,s=t):(i=(a=this.containerEventCoords(e)).x,s=a.y,this.reversedX=!1),this.element.style.top=s+"px",this.element.style.left=i+"px",this.container.appendChild(this.element),"function"==typeof this.renderedCallback&&this.renderedCallback(),this._fitToScreen(i,s,n,o,t),this.visible=!0,this.subscribe("table-destroy",this.destroyBinding),this.element.addEventListener("mousedown",e=>{e.stopPropagation()})),this}_fitToScreen(e,t,i,s,n){var o=this.container===document.body?document.documentElement.scrollTop:this.container.scrollTop;(e+this.element.offsetWidth>=this.container.offsetWidth||this.reversedX)&&(this.element.style.left="",this.element.style.right=i?this.container.offsetWidth-s.left+"px":this.container.offsetWidth-e+"px",this.reversedX=!0);let a=Math.max(this.container.offsetHeight,o?this.container.scrollHeight:0);if(t+this.element.offsetHeight>a)if(i)this.element.style.top="bottom"===n?parseInt(this.element.style.top)-this.element.offsetHeight-i.offsetHeight-1+"px":parseInt(this.element.style.top)-this.element.offsetHeight+i.offsetHeight+1+"px";else{let e=this.element.offsetHeight;if(e>a)this.element.style.top="0px",this.element.style.height=a+"px";else{let i=t-e;i<0&&(i=a-e),this.element.style.top=i+"px"}}}isVisible(){return this.visible}hideOnBlur(e){return this.blurable=!0,this.visible&&(setTimeout(()=>{this.visible&&(this.table.rowManager.element.addEventListener("scroll",this.blurEvent),this.subscribe("cell-editing",this.blurEvent),document.body.addEventListener("click",this.blurEvent),document.body.addEventListener("contextmenu",this.blurEvent),document.body.addEventListener("mousedown",this.blurEvent),window.addEventListener("resize",this.blurEvent),document.body.addEventListener("keydown",this.escEvent),this.blurEventsBound=!0)},100),this.blurCallback=e),this}_escapeCheck(e){27==e.key&&this.hide()}blockHide(){this.hideable=!1}restoreHide(){this.hideable=!0}hide(e=!1){return this.visible&&this.hideable&&(this.blurable&&this.blurEventsBound&&(document.body.removeEventListener("keydown",this.escEvent),document.body.removeEventListener("click",this.blurEvent),document.body.removeEventListener("contextmenu",this.blurEvent),document.body.removeEventListener("mousedown",this.blurEvent),window.removeEventListener("resize",this.blurEvent),this.table.rowManager.element.removeEventListener("scroll",this.blurEvent),this.unsubscribe("cell-editing",this.blurEvent),this.blurEventsBound=!1),this.childPopup&&this.childPopup.hide(),this.parent&&(this.parent.childPopup=null),this.element.parentNode&&this.element.parentNode.removeChild(this.element),this.visible=!1,this.blurCallback&&!e&&this.blurCallback(),this.unsubscribe("table-destroy",this.destroyBinding)),this}child(t){return this.childPopup&&this.childPopup.hide(),this.childPopup=new e(this.table,t,this),this.childPopup}};class Ga extends Ba{constructor(e,t){super(e),this._handler=null}initialize(){}registerTableOption(e,t){this.table.optionsList.register(e,t)}registerColumnOption(e,t){this.table.columnManager.optionsList.register(e,t)}registerTableFunction(e,t){void 0===this.table[e]?this.table[e]=(...i)=>(this.table.initGuard(e),t(...i)):console.warn("Unable to bind table function, name already in use",e)}registerComponentFunction(e,t,i){return this.table.componentFunctionBinder.bind(e,t,i)}registerDataHandler(e,t){this.table.rowManager.registerDataPipelineHandler(e,t),this._handler=e}registerDisplayHandler(e,t){this.table.rowManager.registerDisplayPipelineHandler(e,t),this._handler=e}displayRows(e){var t,i=this.table.rowManager.displayRows.length-1;if(this._handler&&(t=this.table.rowManager.displayPipeline.findIndex(e=>e.handler===this._handler))>-1&&(i=t),e&&(i+=e),this._handler)return i>-1?this.table.rowManager.getDisplayRows(i):this.activeRows()}activeRows(){return this.table.rowManager.activeRows}refreshData(e,t){t||(t=this._handler),t&&this.table.rowManager.refreshActiveData(t,!1,e)}footerAppend(e){return this.table.footerManager.append(e)}footerPrepend(e){return this.table.footerManager.prepend(e)}footerRemove(e){return this.table.footerManager.remove(e)}popup(e,t){return new Wa(this.table,e,t)}alert(e,t){return this.table.alertManager.alert(e,t)}clearAlert(){return this.table.alertManager.clear()}}var Ua={rownum:function(e,t,i,s,n,o){return o.getPosition()}};class $a extends Ga{static moduleName="accessor";static accessors=Ua;constructor(e){super(e),this.allowedTypes=["","data","download","clipboard","print","htmlOutput"],this.registerColumnOption("accessor"),this.registerColumnOption("accessorParams"),this.registerColumnOption("accessorData"),this.registerColumnOption("accessorDataParams"),this.registerColumnOption("accessorDownload"),this.registerColumnOption("accessorDownloadParams"),this.registerColumnOption("accessorClipboard"),this.registerColumnOption("accessorClipboardParams"),this.registerColumnOption("accessorPrint"),this.registerColumnOption("accessorPrintParams"),this.registerColumnOption("accessorHtmlOutput"),this.registerColumnOption("accessorHtmlOutputParams")}initialize(){this.subscribe("column-layout",this.initializeColumn.bind(this)),this.subscribe("row-data-retrieve",this.transformRow.bind(this))}initializeColumn(e){var t=!1,i={};this.allowedTypes.forEach(s=>{var n,o="accessor"+(s.charAt(0).toUpperCase()+s.slice(1));e.definition[o]&&(n=this.lookupAccessor(e.definition[o]))&&(t=!0,i[o]={accessor:n,params:e.definition[o+"Params"]||{}})}),t&&(e.modules.accessor=i)}lookupAccessor(e){var t=!1;switch(typeof e){case"string":$a.accessors[e]?t=$a.accessors[e]:console.warn("Accessor Error - No such accessor found, ignoring: ",e);break;case"function":t=e}return t}transformRow(e,t){var i="accessor"+(t.charAt(0).toUpperCase()+t.slice(1)),s=e.getComponent(),n=Va.deepClone(e.data||{});return this.table.columnManager.traverse(function(e){var o,a,r,l;e.modules.accessor&&(a=e.modules.accessor[i]||e.modules.accessor.accessor||!1)&&"undefined"!=(o=e.getFieldValue(n))&&(l=e.getComponent(),r="function"==typeof a.params?a.params(o,n,t,l,s):a.params,e.setFieldValue(n,a.accessor(o,n,t,r,l,s)))}),n}}var Ya={method:"GET"};function Ka(e,t){var i=[];if(t=t||"",Array.isArray(e))e.forEach((e,s)=>{i=i.concat(Ka(e,t?t+"["+s+"]":s))});else if("object"==typeof e)for(var s in e)i=i.concat(Ka(e[s],t?t+"["+s+"]":s));else i.push({key:t,value:e});return i}function Xa(e){var t=Ka(e),i=[];return t.forEach(function(e){i.push(encodeURIComponent(e.key)+"="+encodeURIComponent(e.value))}),i.join("&")}function qa(e,t,i){return e&&i&&Object.keys(i).length&&(t.method&&"get"!=t.method.toLowerCase()||(t.method="get",e+=(e.includes("?")?"&":"?")+Xa(i))),e}function Ja(e,t,i){var s;return new Promise((n,o)=>{if(e=this.urlGenerator.call(this.table,e,t,i),"GET"!=t.method.toUpperCase())if(s="object"==typeof this.table.options.ajaxContentType?this.table.options.ajaxContentType:this.contentTypeFormatters[this.table.options.ajaxContentType]){for(var a in s.headers)t.headers||(t.headers={}),void 0===t.headers[a]&&(t.headers[a]=s.headers[a]);t.body=s.body.call(this,e,t,i)}else console.warn("Ajax Error - Invalid ajaxContentType value:",this.table.options.ajaxContentType);e?(void 0===t.headers&&(t.headers={}),void 0===t.headers.Accept&&(t.headers.Accept="application/json"),void 0===t.headers["X-Requested-With"]&&(t.headers["X-Requested-With"]="XMLHttpRequest"),void 0===t.mode&&(t.mode="cors"),"cors"==t.mode?(void 0===t.headers.Origin&&(t.headers.Origin=window.location.origin),void 0===t.credentials&&(t.credentials="same-origin")):void 0===t.credentials&&(t.credentials="include"),fetch(e,t).then(e=>{e.ok?e.json().then(e=>{n(e)}).catch(e=>{o(e),console.warn("Ajax Load Error - Invalid JSON returned",e)}):(console.error("Ajax Load Error - Connection Error: "+e.status,e.statusText),o(e))}).catch(e=>{console.error("Ajax Load Error - Connection Error: ",e),o(e)})):(console.warn("Ajax Load Error - No URL Set"),n([]))})}function Za(e,t){var i=[];if(t=t||"",Array.isArray(e))e.forEach((e,s)=>{i=i.concat(Za(e,t?t+"["+s+"]":s))});else if("object"==typeof e)for(var s in e)i=i.concat(Za(e[s],t?t+"["+s+"]":s));else i.push({key:t,value:e});return i}var Qa={json:{headers:{"Content-Type":"application/json"},body:function(e,t,i){return JSON.stringify(i)}},form:{headers:{},body:function(e,t,i){var s=Za(i),n=new FormData;return s.forEach(function(e){n.append(e.key,e.value)}),n}}};class er extends Ga{static moduleName="ajax";static defaultConfig=Ya;static defaultURLGenerator=qa;static defaultLoaderPromise=Ja;static contentTypeFormatters=Qa;constructor(e){super(e),this.config={},this.url="",this.urlGenerator=!1,this.params=!1,this.loaderPromise=!1,this.registerTableOption("ajaxURL",!1),this.registerTableOption("ajaxURLGenerator",!1),this.registerTableOption("ajaxParams",{}),this.registerTableOption("ajaxConfig","get"),this.registerTableOption("ajaxContentType","form"),this.registerTableOption("ajaxRequestFunc",!1),this.registerTableOption("ajaxRequesting",function(){}),this.registerTableOption("ajaxResponse",!1),this.contentTypeFormatters=er.contentTypeFormatters}initialize(){this.loaderPromise=this.table.options.ajaxRequestFunc||er.defaultLoaderPromise,this.urlGenerator=this.table.options.ajaxURLGenerator||er.defaultURLGenerator,this.table.options.ajaxURL&&this.setUrl(this.table.options.ajaxURL),this.setDefaultConfig(this.table.options.ajaxConfig),this.registerTableFunction("getAjaxUrl",this.getUrl.bind(this)),this.subscribe("data-loading",this.requestDataCheck.bind(this)),this.subscribe("data-params",this.requestParams.bind(this)),this.subscribe("data-load",this.requestData.bind(this))}requestParams(e,t,i,s){var n=this.table.options.ajaxParams;return n&&("function"==typeof n&&(n=n.call(this.table)),s=Object.assign(Object.assign({},n),s)),s}requestDataCheck(e,t,i,s){return!((e||!this.url)&&"string"!=typeof e)}requestData(e,t,i,s,n){var o;return!n&&this.requestDataCheck(e)?(e&&this.setUrl(e),o=this.generateConfig(i),this.sendRequest(this.url,t,o)):n}setDefaultConfig(e={}){this.config=Object.assign({},er.defaultConfig),"string"==typeof e?this.config.method=e:Object.assign(this.config,e)}generateConfig(e={}){var t=Object.assign({},this.config);return"string"==typeof e?t.method=e:Object.assign(t,e),t}setUrl(e){this.url=e}getUrl(){return this.url}sendRequest(e,t,i){return!1!==this.table.options.ajaxRequesting.call(this.table,e,t)?this.loaderPromise(e,i,t).then(i=>(this.table.options.ajaxResponse&&(i=this.table.options.ajaxResponse.call(this.table,e,t,i)),i)):Promise.reject()}}var tr={replace:function(e){return this.table.setData(e)},update:function(e){return this.table.updateOrAddData(e)},insert:function(e){return this.table.addData(e)}},ir={table:function(e){var t=[],i=!0,s=this.table.columnManager.columns,n=[],o=[];return(e=e.split("\n")).forEach(function(e){t.push(e.split("\t"))}),!(!t.length||1===t.length&&t[0].length<2)&&(t[0].forEach(function(e){var t=s.find(function(t){return e&&t.definition.title&&e.trim()&&t.definition.title.trim()===e.trim()});t?n.push(t):i=!1}),i||(i=!0,n=[],t[0].forEach(function(e){var t=s.find(function(t){return e&&t.field&&e.trim()&&t.field.trim()===e.trim()});t?n.push(t):i=!1}),i||(n=this.table.columnManager.columnsByIndex)),i&&t.shift(),t.forEach(function(e){var t={};e.forEach(function(e,i){n[i]&&(t[n[i].field]=e)}),o.push(t)}),o)}},sr={keybindings:{bindings:{copyToClipboard:["ctrl + 67","meta + 67"]},actions:{copyToClipboard:function(e){this.table.modules.edit.currentCell||this.table.modExists("clipboard",!0)&&this.table.modules.clipboard.copy(!1,!0)}}}};class nr extends Ga{static moduleName="clipboard";static moduleExtensions=sr;static pasteActions=tr;static pasteParsers=ir;constructor(e){super(e),this.mode=!0,this.pasteParser=function(){},this.pasteAction=function(){},this.customSelection=!1,this.rowRange=!1,this.blocked=!0,this.registerTableOption("clipboard",!1),this.registerTableOption("clipboardCopyStyled",!0),this.registerTableOption("clipboardCopyConfig",!1),this.registerTableOption("clipboardCopyFormatter",!1),this.registerTableOption("clipboardCopyRowRange","active"),this.registerTableOption("clipboardPasteParser","table"),this.registerTableOption("clipboardPasteAction","insert"),this.registerColumnOption("clipboard"),this.registerColumnOption("titleClipboard")}initialize(){this.mode=this.table.options.clipboard,this.rowRange=this.table.options.clipboardCopyRowRange,!0!==this.mode&&"copy"!==this.mode||this.table.element.addEventListener("copy",e=>{var t,i,s;this.blocked||(e.preventDefault(),this.customSelection?(t=this.customSelection,this.table.options.clipboardCopyFormatter&&(t=this.table.options.clipboardCopyFormatter("plain",t))):(s=this.table.modules.export.generateExportList(this.table.options.clipboardCopyConfig,this.table.options.clipboardCopyStyled,this.rowRange,"clipboard"),t=(i=this.table.modules.export.generateHTMLTable(s))?this.generatePlainContent(s):"",this.table.options.clipboardCopyFormatter&&(t=this.table.options.clipboardCopyFormatter("plain",t),i=this.table.options.clipboardCopyFormatter("html",i))),window.clipboardData&&window.clipboardData.setData?window.clipboardData.setData("Text",t):e.clipboardData&&e.clipboardData.setData?(e.clipboardData.setData("text/plain",t),i&&e.clipboardData.setData("text/html",i)):e.originalEvent&&e.originalEvent.clipboardData.setData&&(e.originalEvent.clipboardData.setData("text/plain",t),i&&e.originalEvent.clipboardData.setData("text/html",i)),this.dispatchExternal("clipboardCopied",t,i),this.reset())}),!0!==this.mode&&"paste"!==this.mode||this.table.element.addEventListener("paste",e=>{this.paste(e)}),this.setPasteParser(this.table.options.clipboardPasteParser),this.setPasteAction(this.table.options.clipboardPasteAction),this.registerTableFunction("copyToClipboard",this.copy.bind(this))}reset(){this.blocked=!0,this.customSelection=!1}generatePlainContent(e){var t=[];return e.forEach(e=>{var i=[];e.columns.forEach(t=>{var s="";if(t)if("group"===e.type&&(t.value=t.component.getKey()),null===t.value)s="";else switch(typeof t.value){case"object":s=JSON.stringify(t.value);break;case"undefined":s="";break;default:s=t.value}i.push(s)}),t.push(i.join("\t"))}),t.join("\n")}copy(e,t){var i,s;this.blocked=!1,this.customSelection=!1,!0!==this.mode&&"copy"!==this.mode||(this.rowRange=e||this.table.options.clipboardCopyRowRange,void 0!==window.getSelection&&void 0!==document.createRange?((e=document.createRange()).selectNodeContents(this.table.element),(i=window.getSelection()).toString()&&t&&(this.customSelection=i.toString()),i.removeAllRanges(),i.addRange(e)):void 0!==document.selection&&void 0!==document.body.createTextRange&&((s=document.body.createTextRange()).moveToElementText(this.table.element),s.select()),document.execCommand("copy"),i&&i.removeAllRanges())}setPasteAction(e){switch(typeof e){case"string":this.pasteAction=nr.pasteActions[e],this.pasteAction||console.warn("Clipboard Error - No such paste action found:",e);break;case"function":this.pasteAction=e}}setPasteParser(e){switch(typeof e){case"string":this.pasteParser=nr.pasteParsers[e],this.pasteParser||console.warn("Clipboard Error - No such paste parser found:",e);break;case"function":this.pasteParser=e}}paste(e){var t,i,s;this.checkPasteOrigin(e)&&(t=this.getPasteData(e),(i=this.pasteParser.call(this,t))?(e.preventDefault(),this.table.modExists("mutator")&&(i=this.mutateData(i)),s=this.pasteAction.call(this,i),this.dispatchExternal("clipboardPasted",t,i,s)):this.dispatchExternal("clipboardPasteError",t))}mutateData(e){var t=[];return Array.isArray(e)?e.forEach(e=>{t.push(this.table.modules.mutator.transformRow(e,"clipboard"))}):t=e,t}checkPasteOrigin(e){var t=!0;return!this.confirm("clipboard-paste",[e])&&["DIV","SPAN"].includes(e.target.tagName)||(t=!1),t}getPasteData(e){var t;return window.clipboardData&&window.clipboardData.getData?t=window.clipboardData.getData("Text"):e.clipboardData&&e.clipboardData.getData?t=e.clipboardData.getData("text/plain"):e.originalEvent&&e.originalEvent.clipboardData.getData&&(t=e.originalEvent.clipboardData.getData("text/plain")),t}}class or{constructor(e){return this._row=e,new Proxy(this,{get:function(e,t,i){return void 0!==e[t]?e[t]:e._row.table.componentFunctionBinder.handle("row",e._row,t)}})}getData(e){return this._row.getData(e)}getElement(){return this._row.getElement()}getTable(){return this._row.table}getCells(){var e=[];return this._row.getCells().forEach(function(t){e.push(t.getComponent())}),e}getCell(e){var t=this._row.getCell(e);return!!t&&t.getComponent()}_getSelf(){return this._row}}class ar{constructor(e){return this._cell=e,new Proxy(this,{get:function(e,t,i){return void 0!==e[t]?e[t]:e._cell.table.componentFunctionBinder.handle("cell",e._cell,t)}})}getValue(){return this._cell.getValue()}getOldValue(){return this._cell.getOldValue()}getInitialValue(){return this._cell.initialValue}getElement(){return this._cell.getElement()}getRow(){return this._cell.row.getComponent()}getData(e){return this._cell.row.getData(e)}getType(){return"cell"}getField(){return this._cell.column.getField()}getColumn(){return this._cell.column.getComponent()}setValue(e,t){void 0===t&&(t=!0),this._cell.setValue(e,t)}restoreOldValue(){this._cell.setValueActual(this._cell.getOldValue())}restoreInitialValue(){this._cell.setValueActual(this._cell.initialValue)}checkHeight(){this._cell.checkHeight()}getTable(){return this._cell.table}_getSelf(){return this._cell}}class rr extends Ba{constructor(e,t){super(e.table),this.table=e.table,this.column=e,this.row=t,this.element=null,this.value=null,this.initialValue,this.oldValue=null,this.modules={},this.height=null,this.width=null,this.minWidth=null,this.component=null,this.loaded=!1,this.build()}build(){this.generateElement(),this.setWidth(),this._configureCell(),this.setValueActual(this.column.getFieldValue(this.row.data)),this.initialValue=this.value}generateElement(){this.element=document.createElement("div"),this.element.className="tabulator-cell",this.element.setAttribute("role","gridcell"),this.column.isRowHeader&&this.element.classList.add("tabulator-row-header")}_configureCell(){var e=this.element,t=this.column.getField();e.style.textAlign=this.column.hozAlign,this.column.vertAlign&&(e.style.display="inline-flex",e.style.alignItems={top:"flex-start",bottom:"flex-end",middle:"center"}[this.column.vertAlign]||"",this.column.hozAlign&&(e.style.justifyContent={left:"flex-start",right:"flex-end",center:"center"}[this.column.hozAlign]||"")),t&&e.setAttribute("tabulator-field",t),this.column.definition.cssClass&&this.column.definition.cssClass.split(" ").forEach(t=>{e.classList.add(t)}),this.dispatch("cell-init",this),this.column.visible||this.hide()}_generateContents(){var e;switch(typeof(e=this.chain("cell-format",this,null,()=>this.element.innerHTML=this.value))){case"object":if(e instanceof Node){for(;this.element.firstChild;)this.element.removeChild(this.element.firstChild);this.element.appendChild(e)}else this.element.innerHTML="",null!=e&&console.warn("Format Error - Formatter has returned a type of object, the only valid formatter object return is an instance of Node, the formatter returned:",e);break;case"undefined":this.element.innerHTML="";break;default:this.element.innerHTML=e}}cellRendered(){this.dispatch("cell-rendered",this)}getElement(e){return this.loaded||(this.loaded=!0,e||this.layoutElement()),this.element}getValue(){return this.value}getOldValue(){return this.oldValue}setValue(e,t,i){this.setValueProcessData(e,t,i)&&(this.dispatch("cell-value-updated",this),this.cellRendered(),this.column.definition.cellEdited&&this.column.definition.cellEdited.call(this.table,this.getComponent()),this.dispatchExternal("cellEdited",this.getComponent()),this.subscribedExternal("dataChanged")&&this.dispatchExternal("dataChanged",this.table.rowManager.getData()))}setValueProcessData(e,t,i){var s=!1;return(this.value!==e||i)&&(s=!0,t&&(e=this.chain("cell-value-changing",[this,e],null,e))),this.setValueActual(e),s&&this.dispatch("cell-value-changed",this),s}setValueActual(e){this.oldValue=this.value,this.value=e,this.dispatch("cell-value-save-before",this),this.column.setFieldValue(this.row.data,e),this.dispatch("cell-value-save-after",this),this.loaded&&this.layoutElement()}layoutElement(){this._generateContents(),this.dispatch("cell-layout",this)}setWidth(){this.width=this.column.width,this.element.style.width=this.column.widthStyled}clearWidth(){this.width="",this.element.style.width=""}getWidth(){return this.width||this.element.offsetWidth}setMinWidth(){this.minWidth=this.column.minWidth,this.element.style.minWidth=this.column.minWidthStyled}setMaxWidth(){this.maxWidth=this.column.maxWidth,this.element.style.maxWidth=this.column.maxWidthStyled}checkHeight(){this.row.reinitializeHeight()}clearHeight(){this.element.style.height="",this.height=null,this.dispatch("cell-height",this,"")}setHeight(){this.height=this.row.height,this.element.style.height=this.row.heightStyled,this.dispatch("cell-height",this,this.row.heightStyled)}getHeight(){return this.height||this.element.offsetHeight}show(){this.element.style.display=this.column.vertAlign?"inline-flex":""}hide(){this.element.style.display="none"}delete(){this.dispatch("cell-delete",this),!this.table.rowManager.redrawBlock&&this.element.parentNode&&this.element.parentNode.removeChild(this.element),this.element=!1,this.column.deleteCell(this),this.row.deleteCell(this),this.calcs={}}getIndex(){return this.row.getCellIndex(this)}getComponent(){return this.component||(this.component=new ar(this)),this.component}}class lr{constructor(e){return this._column=e,this.type="ColumnComponent",new Proxy(this,{get:function(e,t,i){return void 0!==e[t]?e[t]:e._column.table.componentFunctionBinder.handle("column",e._column,t)}})}getElement(){return this._column.getElement()}getDefinition(){return this._column.getDefinition()}getField(){return this._column.getField()}getTitleDownload(){return this._column.getTitleDownload()}getCells(){var e=[];return this._column.cells.forEach(function(t){e.push(t.getComponent())}),e}isVisible(){return this._column.visible}show(){this._column.isGroup?this._column.columns.forEach(function(e){e.show()}):this._column.show()}hide(){this._column.isGroup?this._column.columns.forEach(function(e){e.hide()}):this._column.hide()}toggle(){this._column.visible?this.hide():this.show()}delete(){return this._column.delete()}getSubColumns(){var e=[];return this._column.columns.length&&this._column.columns.forEach(function(t){e.push(t.getComponent())}),e}getParentColumn(){return this._column.getParentComponent()}_getSelf(){return this._column}scrollTo(e,t){return this._column.table.columnManager.scrollToColumn(this._column,e,t)}getTable(){return this._column.table}move(e,t){var i=this._column.table.columnManager.findColumn(e);i?this._column.table.columnManager.moveColumn(this._column,i,t):console.warn("Move Error - No matching column found:",i)}getNextColumn(){var e=this._column.nextColumn();return!!e&&e.getComponent()}getPrevColumn(){var e=this._column.prevColumn();return!!e&&e.getComponent()}updateDefinition(e){return this._column.updateDefinition(e)}getWidth(){return this._column.getWidth()}setWidth(e){var t;return t=!0===e?this._column.reinitializeWidth(!0):this._column.setWidth(e),this._column.table.columnManager.rerenderColumns(!0),t}}var hr={title:void 0,field:void 0,columns:void 0,visible:void 0,hozAlign:void 0,vertAlign:void 0,width:void 0,minWidth:40,maxWidth:void 0,maxInitialWidth:void 0,cssClass:void 0,variableHeight:void 0,headerVertical:void 0,headerHozAlign:void 0,headerWordWrap:!1,editableTitle:void 0};class cr extends Ba{static defaultOptionList=hr;constructor(e,t,i){super(t.table),this.definition=e,this.parent=t,this.type="column",this.columns=[],this.cells=[],this.isGroup=!1,this.isRowHeader=i,this.element=this.createElement(),this.contentElement=!1,this.titleHolderElement=!1,this.titleElement=!1,this.groupElement=this.createGroupElement(),this.hozAlign="",this.vertAlign="",this.field="",this.fieldStructure="",this.getFieldValue="",this.setFieldValue="",this.titleDownload=null,this.titleFormatterRendered=!1,this.mapDefinitions(),this.setField(this.definition.field),this.modules={},this.width=null,this.widthStyled="",this.maxWidth=null,this.maxWidthStyled="",this.maxInitialWidth=null,this.minWidth=null,this.minWidthStyled="",this.widthFixed=!1,this.visible=!0,this.component=null,this.definition.columns?(this.isGroup=!0,this.definition.columns.forEach((e,t)=>{var i=new cr(e,this);this.attachColumn(i)}),this.checkColumnVisibility()):t.registerColumnField(this),this._initialize()}createElement(){var e=document.createElement("div");switch(e.classList.add("tabulator-col"),e.setAttribute("role","columnheader"),e.setAttribute("aria-sort","none"),this.isRowHeader&&e.classList.add("tabulator-row-header"),this.table.options.columnHeaderVertAlign){case"middle":e.style.justifyContent="center";break;case"bottom":e.style.justifyContent="flex-end"}return e}createGroupElement(){var e=document.createElement("div");return e.classList.add("tabulator-col-group-cols"),e}mapDefinitions(){var e=this.table.options.columnDefaults;if(e)for(let t in e)void 0===this.definition[t]&&(this.definition[t]=e[t]);this.definition=this.table.columnManager.optionsList.generate(cr.defaultOptionList,this.definition)}checkDefinition(){Object.keys(this.definition).forEach(e=>{-1===cr.defaultOptionList.indexOf(e)&&console.warn("Invalid column definition option in '"+(this.field||this.definition.title)+"' column:",e)})}setField(e){this.field=e,this.fieldStructure=e?this.table.options.nestedFieldSeparator?e.split(this.table.options.nestedFieldSeparator):[e]:[],this.getFieldValue=this.fieldStructure.length>1?this._getNestedData:this._getFlatData,this.setFieldValue=this.fieldStructure.length>1?this._setNestedData:this._setFlatData}registerColumnPosition(e){this.parent.registerColumnPosition(e)}registerColumnField(e){this.parent.registerColumnField(e)}reRegisterPosition(){this.isGroup?this.columns.forEach(function(e){e.reRegisterPosition()}):this.registerColumnPosition(this)}_initialize(){for(var e=this.definition;this.element.firstChild;)this.element.removeChild(this.element.firstChild);e.headerVertical&&(this.element.classList.add("tabulator-col-vertical"),"flip"===e.headerVertical&&this.element.classList.add("tabulator-col-vertical-flip")),this.contentElement=this._buildColumnHeaderContent(),this.element.appendChild(this.contentElement),this.isGroup?this._buildGroupHeader():this._buildColumnHeader(),this.dispatch("column-init",this)}_buildColumnHeader(){var e=this.definition;this.dispatch("column-layout",this),void 0!==e.visible&&(e.visible?this.show(!0):this.hide(!0)),e.cssClass&&e.cssClass.split(" ").forEach(e=>{this.element.classList.add(e)}),e.field&&this.element.setAttribute("tabulator-field",e.field),this.setMinWidth(parseInt(e.minWidth)),e.maxInitialWidth&&(this.maxInitialWidth=parseInt(e.maxInitialWidth)),e.maxWidth&&this.setMaxWidth(parseInt(e.maxWidth)),this.reinitializeWidth(),this.hozAlign=this.definition.hozAlign,this.vertAlign=this.definition.vertAlign,this.titleElement.style.textAlign=this.definition.headerHozAlign}_buildColumnHeaderContent(){var e=document.createElement("div");return e.classList.add("tabulator-col-content"),this.titleHolderElement=document.createElement("div"),this.titleHolderElement.classList.add("tabulator-col-title-holder"),e.appendChild(this.titleHolderElement),this.titleElement=this._buildColumnHeaderTitle(),this.titleHolderElement.appendChild(this.titleElement),e}_buildColumnHeaderTitle(){var e=this.definition,t=document.createElement("div");if(t.classList.add("tabulator-col-title"),e.headerWordWrap&&t.classList.add("tabulator-col-title-wrap"),e.editableTitle){var i=document.createElement("input");i.classList.add("tabulator-title-editor"),i.addEventListener("click",e=>{e.stopPropagation(),i.focus()}),i.addEventListener("mousedown",e=>{e.stopPropagation()}),i.addEventListener("change",()=>{e.title=i.value,this.dispatchExternal("columnTitleChanged",this.getComponent())}),t.appendChild(i),e.field?this.langBind("columns|"+e.field,t=>{i.value=t||e.title||"&nbsp;"}):i.value=e.title||"&nbsp;"}else e.field?this.langBind("columns|"+e.field,i=>{this._formatColumnHeaderTitle(t,i||e.title||"&nbsp;")}):this._formatColumnHeaderTitle(t,e.title||"&nbsp;");return t}_formatColumnHeaderTitle(e,t){var i=this.chain("column-format",[this,t,e],null,()=>t);switch(typeof i){case"object":i instanceof Node?e.appendChild(i):(e.innerHTML="",console.warn("Format Error - Title formatter has returned a type of object, the only valid formatter object return is an instance of Node, the formatter returned:",i));break;case"undefined":e.innerHTML="";break;default:e.innerHTML=i}}_buildGroupHeader(){this.element.classList.add("tabulator-col-group"),this.element.setAttribute("role","columngroup"),this.element.setAttribute("aria-title",this.definition.title),this.definition.cssClass&&this.definition.cssClass.split(" ").forEach(e=>{this.element.classList.add(e)}),this.titleElement.style.textAlign=this.definition.headerHozAlign,this.element.appendChild(this.groupElement)}_getFlatData(e){return e[this.field]}_getNestedData(e){var t,i=e,s=this.fieldStructure,n=s.length;for(let e=0;e<n&&(t=i=i[s[e]],i);e++);return t}_setFlatData(e,t){this.field&&(e[this.field]=t)}_setNestedData(e,t){var i=e,s=this.fieldStructure,n=s.length;for(let e=0;e<n;e++)if(e==n-1)i[s[e]]=t;else{if(!i[s[e]]){if(void 0===t)break;i[s[e]]={}}i=i[s[e]]}}attachColumn(e){this.groupElement?(this.columns.push(e),this.groupElement.appendChild(e.getElement()),e.columnRendered()):console.warn("Column Warning - Column being attached to another column instead of column group")}verticalAlign(e,t){var i=this.parent.isGroup?this.parent.getGroupElement().clientHeight:t||this.parent.getHeadersElement().clientHeight;this.element.style.height=i+"px",this.dispatch("column-height",this,this.element.style.height),this.isGroup&&(this.groupElement.style.minHeight=i-this.contentElement.offsetHeight+"px"),this.columns.forEach(function(t){t.verticalAlign(e)})}clearVerticalAlign(){this.element.style.paddingTop="",this.element.style.height="",this.element.style.minHeight="",this.groupElement.style.minHeight="",this.columns.forEach(function(e){e.clearVerticalAlign()}),this.dispatch("column-height",this,"")}getElement(){return this.element}getGroupElement(){return this.groupElement}getField(){return this.field}getTitleDownload(){return this.titleDownload}getFirstColumn(){return this.isGroup?!!this.columns.length&&this.columns[0].getFirstColumn():this}getLastColumn(){return this.isGroup?!!this.columns.length&&this.columns[this.columns.length-1].getLastColumn():this}getColumns(e){var t=[];return e?this.columns.forEach(e=>{t.push(e),t=t.concat(e.getColumns(!0))}):t=this.columns,t}getCells(){return this.cells}getTopColumn(){return this.parent.isGroup?this.parent.getTopColumn():this}getDefinition(e){var t=[];return this.isGroup&&e&&(this.columns.forEach(function(e){t.push(e.getDefinition(!0))}),this.definition.columns=t),this.definition}checkColumnVisibility(){var e=!1;this.columns.forEach(function(t){t.visible&&(e=!0)}),e?(this.show(),this.dispatchExternal("columnVisibilityChanged",this.getComponent(),!1)):this.hide()}show(e,t){this.visible||(this.visible=!0,this.element.style.display="",this.parent.isGroup&&this.parent.checkColumnVisibility(),this.cells.forEach(function(e){e.show()}),this.isGroup||null!==this.width||this.reinitializeWidth(),this.table.columnManager.verticalAlignHeaders(),this.dispatch("column-show",this,t),e||this.dispatchExternal("columnVisibilityChanged",this.getComponent(),!0),this.parent.isGroup&&this.parent.matchChildWidths(),this.silent||this.table.columnManager.rerenderColumns())}hide(e,t){this.visible&&(this.visible=!1,this.element.style.display="none",this.table.columnManager.verticalAlignHeaders(),this.parent.isGroup&&this.parent.checkColumnVisibility(),this.cells.forEach(function(e){e.hide()}),this.dispatch("column-hide",this,t),e||this.dispatchExternal("columnVisibilityChanged",this.getComponent(),!1),this.parent.isGroup&&this.parent.matchChildWidths(),this.silent||this.table.columnManager.rerenderColumns())}matchChildWidths(){var e=0;this.contentElement&&this.columns.length&&(this.columns.forEach(function(t){t.visible&&(e+=t.getWidth())}),this.contentElement.style.maxWidth=e-1+"px",this.table.initialized&&(this.element.style.width=e+"px"),this.parent.isGroup&&this.parent.matchChildWidths())}removeChild(e){var t=this.columns.indexOf(e);t>-1&&this.columns.splice(t,1),this.columns.length||this.delete()}setWidth(e){this.widthFixed=!0,this.setWidthActual(e)}setWidthActual(e){isNaN(e)&&(e=Math.floor(this.table.element.clientWidth/100*parseInt(e))),e=Math.max(this.minWidth,e),this.maxWidth&&(e=Math.min(this.maxWidth,e)),this.width=e,this.widthStyled=e?e+"px":"",this.element.style.width=this.widthStyled,this.isGroup||this.cells.forEach(function(e){e.setWidth()}),this.parent.isGroup&&this.parent.matchChildWidths(),this.dispatch("column-width",this),this.subscribedExternal("columnWidth")&&this.dispatchExternal("columnWidth",this.getComponent())}checkCellHeights(){var e=[];this.cells.forEach(function(t){t.row.heightInitialized&&(null!==t.row.getElement().offsetParent?(e.push(t.row),t.row.clearCellHeight()):t.row.heightInitialized=!1)}),e.forEach(function(e){e.calcHeight()}),e.forEach(function(e){e.setCellHeight()})}getWidth(){var e=0;return this.isGroup?this.columns.forEach(function(t){t.visible&&(e+=t.getWidth())}):e=this.width,e}getLeftOffset(){var e=this.element.offsetLeft;return this.parent.isGroup&&(e+=this.parent.getLeftOffset()),e}getHeight(){return Math.ceil(this.element.getBoundingClientRect().height)}setMinWidth(e){this.maxWidth&&e>this.maxWidth&&(e=this.maxWidth,console.warn("the minWidth ("+e+"px) for column '"+this.field+"' cannot be bigger that its maxWidth ("+this.maxWidthStyled+")")),this.minWidth=e,this.minWidthStyled=e?e+"px":"",this.element.style.minWidth=this.minWidthStyled,this.cells.forEach(function(e){e.setMinWidth()})}setMaxWidth(e){this.minWidth&&e<this.minWidth&&(e=this.minWidth,console.warn("the maxWidth ("+e+"px) for column '"+this.field+"' cannot be smaller that its minWidth ("+this.minWidthStyled+")")),this.maxWidth=e,this.maxWidthStyled=e?e+"px":"",this.element.style.maxWidth=this.maxWidthStyled,this.cells.forEach(function(e){e.setMaxWidth()})}delete(){return new Promise((e,t)=>{this.isGroup&&this.columns.forEach(function(e){e.delete()}),this.dispatch("column-delete",this);var i=this.cells.length;for(let e=0;e<i;e++)this.cells[0].delete();this.element.parentNode&&this.element.parentNode.removeChild(this.element),this.element=!1,this.contentElement=!1,this.titleElement=!1,this.groupElement=!1,this.parent.isGroup&&this.parent.removeChild(this),this.table.columnManager.deregisterColumn(this),this.table.columnManager.rerenderColumns(!0),this.dispatch("column-deleted",this),e()})}columnRendered(){this.titleFormatterRendered&&this.titleFormatterRendered(),this.dispatch("column-rendered",this)}generateCell(e){var t=new rr(this,e);return this.cells.push(t),t}nextColumn(){var e=this.table.columnManager.findColumnIndex(this);return e>-1&&this._nextVisibleColumn(e+1)}_nextVisibleColumn(e){var t=this.table.columnManager.getColumnByIndex(e);return!t||t.visible?t:this._nextVisibleColumn(e+1)}prevColumn(){var e=this.table.columnManager.findColumnIndex(this);return e>-1&&this._prevVisibleColumn(e-1)}_prevVisibleColumn(e){var t=this.table.columnManager.getColumnByIndex(e);return!t||t.visible?t:this._prevVisibleColumn(e-1)}reinitializeWidth(e){this.widthFixed=!1,void 0===this.definition.width||e||this.setWidth(this.definition.width),this.dispatch("column-width-fit-before",this),this.fitToData(e),this.dispatch("column-width-fit-after",this)}fitToData(e){if(!this.isGroup){this.widthFixed||(this.element.style.width="",this.cells.forEach(e=>{e.clearWidth()}));var t=this.element.offsetWidth;if((!this.width||!this.widthFixed)&&(this.cells.forEach(e=>{var i=e.getWidth();i>t&&(t=i)}),t)){var i=t+1;e?this.setWidth(i):(this.maxInitialWidth&&!e&&(i=Math.min(i,this.maxInitialWidth)),this.setWidthActual(i))}}}updateDefinition(e){var t;return this.isGroup||this.parent.isGroup?(console.error("Column Update Error - The updateDefinition function is only available on ungrouped columns"),Promise.reject("Column Update Error - The updateDefinition function is only available on columns, not column groups")):(t=Object.assign({},this.getDefinition()),t=Object.assign(t,e),this.table.columnManager.addColumn(t,!1,this).then(e=>(t.field==this.field&&(this.field=!1),this.delete().then(()=>e.getComponent()))))}deleteCell(e){var t=this.cells.indexOf(e);t>-1&&this.cells.splice(t,1)}getComponent(){return this.component||(this.component=new lr(this)),this.component}getPosition(){return this.table.columnManager.getVisibleColumnsByIndex().indexOf(this)+1}getParentComponent(){return this.parent instanceof cr&&this.parent.getComponent()}}class dr{constructor(e){return this._row=e,new Proxy(this,{get:function(e,t,i){return void 0!==e[t]?e[t]:e._row.table.componentFunctionBinder.handle("row",e._row,t)}})}getData(e){return this._row.getData(e)}getElement(){return this._row.getElement()}getCells(){var e=[];return this._row.getCells().forEach(function(t){e.push(t.getComponent())}),e}getCell(e){var t=this._row.getCell(e);return!!t&&t.getComponent()}getIndex(){return this._row.getData("data")[this._row.table.options.index]}getPosition(){return this._row.getPosition()}watchPosition(e){return this._row.watchPosition(e)}delete(){return this._row.delete()}scrollTo(e,t){return this._row.table.rowManager.scrollToRow(this._row,e,t)}move(e,t){this._row.moveToRow(e,t)}update(e){return this._row.updateData(e)}normalizeHeight(){this._row.normalizeHeight(!0)}_getSelf(){return this._row}reformat(){return this._row.reinitialize()}getTable(){return this._row.table}getNextRow(){var e=this._row.nextRow();return e?e.getComponent():e}getPrevRow(){var e=this._row.prevRow();return e?e.getComponent():e}}class ur extends Ba{constructor(e,t,i="row"){super(t.table),this.parent=t,this.data={},this.type=i,this.element=!1,this.modules={},this.cells=[],this.height=0,this.heightStyled="",this.manualHeight=!1,this.outerHeight=0,this.initialized=!1,this.heightInitialized=!1,this.position=0,this.positionWatchers=[],this.component=null,this.created=!1,this.setData(e)}create(){this.created||(this.created=!0,this.generateElement())}createElement(){var e=document.createElement("div");e.classList.add("tabulator-row"),e.setAttribute("role","row"),this.element=e}getElement(){return this.create(),this.element}detachElement(){this.element&&this.element.parentNode&&this.element.parentNode.removeChild(this.element)}generateElement(){this.createElement(),this.dispatch("row-init",this)}generateCells(){this.cells=this.table.columnManager.generateCells(this)}initialize(e,t){if(this.create(),!this.initialized||e){for(this.deleteCells();this.element.firstChild;)this.element.removeChild(this.element.firstChild);this.dispatch("row-layout-before",this),this.generateCells(),this.initialized=!0,this.table.columnManager.renderer.renderRowCells(this,t),e&&this.normalizeHeight(),this.dispatch("row-layout",this),this.table.options.rowFormatter&&this.table.options.rowFormatter(this.getComponent()),this.dispatch("row-layout-after",this)}else this.table.columnManager.renderer.rerenderRowCells(this,t)}rendered(){this.cells.forEach(e=>{e.cellRendered()})}reinitializeHeight(){this.heightInitialized=!1,this.element&&null!==this.element.offsetParent&&this.normalizeHeight(!0)}deinitialize(){this.initialized=!1}deinitializeHeight(){this.heightInitialized=!1}reinitialize(e){this.initialized=!1,this.heightInitialized=!1,this.manualHeight||(this.height=0,this.heightStyled=""),this.element&&null!==this.element.offsetParent&&this.initialize(!0),this.dispatch("row-relayout",this)}calcHeight(e){var t=0,i=0;this.table.options.rowHeight?this.height=this.table.options.rowHeight:(i=this.calcMinHeight(),t=this.calcMaxHeight(),this.height=e?Math.max(t,i):this.manualHeight?this.height:Math.max(t,i)),this.heightStyled=this.height?this.height+"px":"",this.outerHeight=this.element.offsetHeight}calcMinHeight(){return this.table.options.resizableRows?this.element.clientHeight:0}calcMaxHeight(){var e=0;return this.cells.forEach(function(t){var i=t.getHeight();i>e&&(e=i)}),e}setCellHeight(){this.cells.forEach(function(e){e.setHeight()}),this.heightInitialized=!0}clearCellHeight(){this.cells.forEach(function(e){e.clearHeight()})}normalizeHeight(e){e&&!this.table.options.rowHeight&&this.clearCellHeight(),this.calcHeight(e),this.setCellHeight()}setHeight(e,t){(this.height!=e||t)&&(this.manualHeight=!0,this.height=e,this.heightStyled=e?e+"px":"",this.setCellHeight(),this.outerHeight=this.element.offsetHeight,this.subscribedExternal("rowHeight")&&this.dispatchExternal("rowHeight",this.getComponent()))}getHeight(){return this.outerHeight}getWidth(){return this.element.offsetWidth}deleteCell(e){var t=this.cells.indexOf(e);t>-1&&this.cells.splice(t,1)}setData(e){this.data=this.chain("row-data-init-before",[this,e],void 0,e),this.dispatch("row-data-init-after",this)}updateData(e){var t,i=this.element&&Va.elVisible(this.element),s={};return new Promise((n,o)=>{"string"==typeof e&&(e=JSON.parse(e)),this.dispatch("row-data-save-before",this),this.subscribed("row-data-changing")&&(s=Object.assign(s,this.data),s=Object.assign(s,e)),t=this.chain("row-data-changing",[this,s,e],null,e);const a=[];for(let i in e)this.table.columnManager.getColumnsByFieldRoot(i).forEach(e=>{let i=this.getCell(e.getField());if(i){let s=e.getFieldValue(t);i.getValue()!==s&&a.push([i,s])}});for(let e in t)this.data[e]=t[e];this.dispatch("row-data-save-after",this),a.forEach(([e,t])=>{e.setValueProcessData(t),i&&e.cellRendered()}),i?(this.normalizeHeight(!0),this.table.options.rowFormatter&&this.table.options.rowFormatter(this.getComponent())):(this.initialized=!1,this.height=0,this.heightStyled=""),this.dispatch("row-data-changed",this,i,e),this.dispatchExternal("rowUpdated",this.getComponent()),this.subscribedExternal("dataChanged")&&this.dispatchExternal("dataChanged",this.table.rowManager.getData()),n()})}getData(e){return e?this.chain("row-data-retrieve",[this,e],null,this.data):this.data}getCell(e){return e=this.table.columnManager.findColumn(e),this.initialized||0!==this.cells.length||this.generateCells(),this.cells.find(function(t){return t.column===e})}getCellIndex(e){return this.cells.findIndex(function(t){return t===e})}findCell(e){return this.cells.find(t=>t.element===e)}getCells(){return this.initialized||0!==this.cells.length||this.generateCells(),this.cells}nextRow(){return this.table.rowManager.nextDisplayRow(this,!0)||!1}prevRow(){return this.table.rowManager.prevDisplayRow(this,!0)||!1}moveToRow(e,t){var i=this.table.rowManager.findRow(e);i?(this.table.rowManager.moveRowActual(this,i,!t),this.table.rowManager.refreshActiveData("display",!1,!0)):console.warn("Move Error - No matching row found:",e)}delete(){return this.dispatch("row-delete",this),this.deleteActual(),Promise.resolve()}deleteActual(e){this.detachModules(),this.table.rowManager.deleteRow(this,e),this.deleteCells(),this.initialized=!1,this.heightInitialized=!1,this.element=!1,this.dispatch("row-deleted",this)}detachModules(){this.dispatch("row-deleting",this)}deleteCells(){var e=this.cells.length;for(let t=0;t<e;t++)this.cells[0].delete()}wipe(){if(this.detachModules(),this.deleteCells(),this.element){for(;this.element.firstChild;)this.element.removeChild(this.element.firstChild);this.element.parentNode&&this.element.parentNode.removeChild(this.element)}this.element=!1,this.modules={}}isDisplayed(){return this.table.rowManager.getDisplayRows().includes(this)}getPosition(){return!!this.isDisplayed()&&this.position}setPosition(e){e!=this.position&&(this.position=e,this.positionWatchers.forEach(e=>{e(this.position)}))}watchPosition(e){this.positionWatchers.push(e),e(this.position)}getGroup(){return this.modules.group||!1}getComponent(){return this.component||(this.component=new dr(this)),this.component}}var pr={avg:function(e,t,i){var s=0,n=void 0!==i.precision?i.precision:2;return e.length&&(s=e.reduce(function(e,t){return Number(e)+Number(t)}),s/=e.length,s=!1!==n?s.toFixed(n):s),parseFloat(s).toString()},max:function(e,t,i){var s=null,n=void 0!==i.precision&&i.precision;return e.forEach(function(e){((e=Number(e))>s||null===s)&&(s=e)}),null!==s?!1!==n?s.toFixed(n):s:""},min:function(e,t,i){var s=null,n=void 0!==i.precision&&i.precision;return e.forEach(function(e){((e=Number(e))<s||null===s)&&(s=e)}),null!==s?!1!==n?s.toFixed(n):s:""},sum:function(e,t,i){var s=0,n=void 0!==i.precision&&i.precision;return e.length&&e.forEach(function(e){e=Number(e),s+=isNaN(e)?0:Number(e)}),!1!==n?s.toFixed(n):s},concat:function(e,t,i){var s=0;return e.length&&(s=e.reduce(function(e,t){return String(e)+String(t)})),s},count:function(e,t,i){var s=0;return e.length&&e.forEach(function(e){e&&s++}),s},unique:function(e,t,i){var s=e.filter((t,i)=>(e||0===t)&&e.indexOf(t)===i);return s.length}};class mr extends Ga{static moduleName="columnCalcs";static calculations=pr;constructor(e){super(e),this.topCalcs=[],this.botCalcs=[],this.genColumn=!1,this.topElement=this.createElement(),this.botElement=this.createElement(),this.topRow=!1,this.botRow=!1,this.topInitialized=!1,this.botInitialized=!1,this.blocked=!1,this.recalcAfterBlock=!1,this.registerTableOption("columnCalcs",!0),this.registerColumnOption("topCalc"),this.registerColumnOption("topCalcParams"),this.registerColumnOption("topCalcFormatter"),this.registerColumnOption("topCalcFormatterParams"),this.registerColumnOption("bottomCalc"),this.registerColumnOption("bottomCalcParams"),this.registerColumnOption("bottomCalcFormatter"),this.registerColumnOption("bottomCalcFormatterParams")}createElement(){var e=document.createElement("div");return e.classList.add("tabulator-calcs-holder"),e}initialize(){this.genColumn=new cr({field:"value"},this),this.subscribe("cell-value-changed",this.cellValueChanged.bind(this)),this.subscribe("column-init",this.initializeColumnCheck.bind(this)),this.subscribe("row-deleted",this.rowsUpdated.bind(this)),this.subscribe("scroll-horizontal",this.scrollHorizontal.bind(this)),this.subscribe("row-added",this.rowsUpdated.bind(this)),this.subscribe("column-moved",this.recalcActiveRows.bind(this)),this.subscribe("column-add",this.recalcActiveRows.bind(this)),this.subscribe("data-refreshed",this.recalcActiveRowsRefresh.bind(this)),this.subscribe("table-redraw",this.tableRedraw.bind(this)),this.subscribe("rows-visible",this.visibleRows.bind(this)),this.subscribe("scrollbar-vertical",this.adjustForScrollbar.bind(this)),this.subscribe("redraw-blocked",this.blockRedraw.bind(this)),this.subscribe("redraw-restored",this.restoreRedraw.bind(this)),this.subscribe("table-redrawing",this.resizeHolderWidth.bind(this)),this.subscribe("column-resized",this.resizeHolderWidth.bind(this)),this.subscribe("column-show",this.resizeHolderWidth.bind(this)),this.subscribe("column-hide",this.resizeHolderWidth.bind(this)),this.registerTableFunction("getCalcResults",this.getResults.bind(this)),this.registerTableFunction("recalc",this.userRecalc.bind(this)),this.resizeHolderWidth()}resizeHolderWidth(){this.topElement.style.minWidth=this.table.columnManager.headersElement.offsetWidth+"px"}tableRedraw(e){this.recalc(this.table.rowManager.activeRows),e&&this.redraw()}blockRedraw(){this.blocked=!0,this.recalcAfterBlock=!1}restoreRedraw(){this.blocked=!1,this.recalcAfterBlock&&(this.recalcAfterBlock=!1,this.recalcActiveRowsRefresh())}userRecalc(){this.recalc(this.table.rowManager.activeRows)}blockCheck(){return this.blocked&&(this.recalcAfterBlock=!0),this.blocked}visibleRows(e,t){return this.topRow&&t.unshift(this.topRow),this.botRow&&t.push(this.botRow),t}rowsUpdated(e){this.table.options.groupBy?this.recalcRowGroup(e):this.recalcActiveRows()}recalcActiveRowsRefresh(){this.table.options.groupBy&&this.table.options.dataTreeStartExpanded&&this.table.options.dataTree?this.recalcAll():this.recalcActiveRows()}recalcActiveRows(){this.recalc(this.table.rowManager.activeRows)}cellValueChanged(e){(e.column.definition.topCalc||e.column.definition.bottomCalc)&&(this.table.options.groupBy?("table"!=this.table.options.columnCalcs&&"both"!=this.table.options.columnCalcs||this.recalcActiveRows(),"table"!=this.table.options.columnCalcs&&this.recalcRowGroup(e.row)):this.recalcActiveRows())}initializeColumnCheck(e){(e.definition.topCalc||e.definition.bottomCalc)&&this.initializeColumn(e)}initializeColumn(e){var t=e.definition,i={topCalcParams:t.topCalcParams||{},botCalcParams:t.bottomCalcParams||{}};if(t.topCalc){switch(typeof t.topCalc){case"string":mr.calculations[t.topCalc]?i.topCalc=mr.calculations[t.topCalc]:console.warn("Column Calc Error - No such calculation found, ignoring: ",t.topCalc);break;case"function":i.topCalc=t.topCalc}i.topCalc&&(e.modules.columnCalcs=i,this.topCalcs.push(e),"group"!=this.table.options.columnCalcs&&this.initializeTopRow())}if(t.bottomCalc){switch(typeof t.bottomCalc){case"string":mr.calculations[t.bottomCalc]?i.botCalc=mr.calculations[t.bottomCalc]:console.warn("Column Calc Error - No such calculation found, ignoring: ",t.bottomCalc);break;case"function":i.botCalc=t.bottomCalc}i.botCalc&&(e.modules.columnCalcs=i,this.botCalcs.push(e),"group"!=this.table.options.columnCalcs&&this.initializeBottomRow())}}registerColumnField(){}removeCalcs(){var e=!1;this.topInitialized&&(this.topInitialized=!1,this.topElement.parentNode.removeChild(this.topElement),e=!0),this.botInitialized&&(this.botInitialized=!1,this.footerRemove(this.botElement),e=!0),e&&this.table.rowManager.adjustTableSize()}reinitializeCalcs(){this.topCalcs.length&&this.initializeTopRow(),this.botCalcs.length&&this.initializeBottomRow()}initializeTopRow(){var e=document.createDocumentFragment();this.topInitialized||(e.appendChild(document.createElement("br")),e.appendChild(this.topElement),this.table.columnManager.getContentsElement().insertBefore(e,this.table.columnManager.headersElement.nextSibling),this.topInitialized=!0)}initializeBottomRow(){this.botInitialized||(this.footerPrepend(this.botElement),this.botInitialized=!0)}scrollHorizontal(e){this.botInitialized&&this.botRow&&(this.botElement.scrollLeft=e)}recalc(e){var t,i;if(!this.blockCheck()&&(this.topInitialized||this.botInitialized)){if(t=this.rowsToData(e),this.topInitialized){for(this.topRow&&this.topRow.deleteCells(),i=this.generateRow("top",t),this.topRow=i;this.topElement.firstChild;)this.topElement.removeChild(this.topElement.firstChild);this.topElement.appendChild(i.getElement()),i.initialize(!0)}if(this.botInitialized){for(this.botRow&&this.botRow.deleteCells(),i=this.generateRow("bottom",t),this.botRow=i;this.botElement.firstChild;)this.botElement.removeChild(this.botElement.firstChild);this.botElement.appendChild(i.getElement()),i.initialize(!0)}this.table.rowManager.adjustTableSize(),this.table.modExists("frozenColumns")&&this.table.modules.frozenColumns.layout()}}recalcRowGroup(e){this.recalcGroup(this.table.modules.groupRows.getRowGroup(e))}recalcAll(){(this.topCalcs.length||this.botCalcs.length)&&("group"!==this.table.options.columnCalcs&&this.recalcActiveRows(),this.table.options.groupBy&&"table"!==this.table.options.columnCalcs&&this.table.modules.groupRows.getChildGroups().forEach(e=>{this.recalcGroup(e)}))}recalcGroup(e){var t,i;this.blockCheck()||e&&e.calcs&&(e.calcs.bottom&&(t=this.rowsToData(e.rows),i=this.generateRowData("bottom",t),e.calcs.bottom.updateData(i),e.calcs.bottom.reinitialize()),e.calcs.top&&(t=this.rowsToData(e.rows),i=this.generateRowData("top",t),e.calcs.top.updateData(i),e.calcs.top.reinitialize()))}generateTopRow(e){return this.generateRow("top",this.rowsToData(e))}generateBottomRow(e){return this.generateRow("bottom",this.rowsToData(e))}rowsToData(e){var t=[],i=this.table.options.dataTree&&this.table.options.dataTreeChildColumnCalcs,s=this.table.modules.dataTree;return e.forEach(e=>{t.push(e.getData()),i&&e.modules.dataTree?.open&&this.rowsToData(s.getFilteredTreeChildren(e)).forEach(e=>{t.push(e)})}),t}generateRow(e,t){var i,s=this.generateRowData(e,t);return this.table.modExists("mutator")&&this.table.modules.mutator.disable(),i=new ur(s,this,"calc"),this.table.modExists("mutator")&&this.table.modules.mutator.enable(),i.getElement().classList.add("tabulator-calcs","tabulator-calcs-"+e),i.component=!1,i.getComponent=()=>(i.component||(i.component=new or(i)),i.component),i.generateCells=()=>{var t=[];this.table.columnManager.columnsByIndex.forEach(s=>{this.genColumn.setField(s.getField()),this.genColumn.hozAlign=s.hozAlign,s.definition[e+"CalcFormatter"]&&this.table.modExists("format")?this.genColumn.modules.format={formatter:this.table.modules.format.lookupFormatter(s.definition[e+"CalcFormatter"]),params:s.definition[e+"CalcFormatterParams"]||{}}:this.genColumn.modules.format={formatter:this.table.modules.format.lookupFormatter("plaintext"),params:{}},this.genColumn.definition.cssClass=s.definition.cssClass;var n=new rr(this.genColumn,i);n.getElement(),n.column=s,n.setWidth(),s.cells.push(n),t.push(n),s.visible||n.hide()}),i.cells=t},i}generateRowData(e,t){var i,s,n={},o="top"==e?this.topCalcs:this.botCalcs,a="top"==e?"topCalc":"botCalc";return o.forEach(function(e){var o=[];e.modules.columnCalcs&&e.modules.columnCalcs[a]&&(t.forEach(function(t){o.push(e.getFieldValue(t))}),s=a+"Params",i="function"==typeof e.modules.columnCalcs[s]?e.modules.columnCalcs[s](o,t):e.modules.columnCalcs[s],e.setFieldValue(n,e.modules.columnCalcs[a](o,t,i)))}),n}hasTopCalcs(){return!!this.topCalcs.length}hasBottomCalcs(){return!!this.botCalcs.length}redraw(){this.topRow&&this.topRow.normalizeHeight(!0),this.botRow&&this.botRow.normalizeHeight(!0)}getResults(){var e={};return this.table.options.groupBy&&this.table.modExists("groupRows")?this.table.modules.groupRows.getGroups(!0).forEach(t=>{e[t.getKey()]=this.getGroupResults(t)}):e={top:this.topRow?this.topRow.getData():{},bottom:this.botRow?this.botRow.getData():{}},e}getGroupResults(e){var t=e._getSelf(),i=e.getSubGroups(),s={};return i.forEach(e=>{s[e.getKey()]=this.getGroupResults(e)}),{top:t.calcs.top?t.calcs.top.getData():{},bottom:t.calcs.bottom?t.calcs.bottom.getData():{},groups:s}}adjustForScrollbar(e){this.botRow&&(this.table.rtl?this.botElement.style.paddingLeft=e+"px":this.botElement.style.paddingRight=e+"px")}}var gr={csv:function(e,t={},i){var s=t.delimiter?t.delimiter:",",n=[],o=[];e.forEach(e=>{var t=[];switch(e.type){case"group":console.warn("Download Warning - CSV downloader cannot process row groups");break;case"calc":console.warn("Download Warning - CSV downloader cannot process column calculations");break;case"header":e.columns.forEach((e,t)=>{e&&1===e.depth&&(o[t]=void 0===e.value||null===e.value?"":'"'+String(e.value).split('"').join('""')+'"')});break;case"row":e.columns.forEach(e=>{if(e){switch(typeof e.value){case"object":e.value=null!==e.value?JSON.stringify(e.value):"";break;case"undefined":e.value=""}t.push('"'+String(e.value).split('"').join('""')+'"')}}),n.push(t.join(s))}}),o.length&&n.unshift(o.join(s)),n=n.join("\n"),t.bom&&(n="\ufeff"+n),i(n,"text/csv")},json:function(e,t,i){var s=[];e.forEach(e=>{var t={};switch(e.type){case"header":break;case"group":console.warn("Download Warning - JSON downloader cannot process row groups");break;case"calc":console.warn("Download Warning - JSON downloader cannot process column calculations");break;case"row":e.columns.forEach(e=>{e&&(t[e.component.getTitleDownload()||e.component.getField()]=e.value)}),s.push(t)}}),i(s=JSON.stringify(s,null,"\t"),"application/json")},jsonLines:function(e,t,i){const s=[];e.forEach(e=>{const t={};switch(e.type){case"header":break;case"group":console.warn("Download Warning - JSON downloader cannot process row groups");break;case"calc":console.warn("Download Warning - JSON downloader cannot process column calculations");break;case"row":e.columns.forEach(e=>{e&&(t[e.component.getTitleDownload()||e.component.getField()]=e.value)}),s.push(JSON.stringify(t))}}),i(s.join("\n"),"application/x-ndjson")},pdf:function(e,t={},i){var s,n,o=[],a=[],r={},l=t.rowGroupStyles||{fontStyle:"bold",fontSize:12,cellPadding:6,fillColor:220},h=t.rowCalcStyles||{fontStyle:"bold",fontSize:10,cellPadding:4,fillColor:232},c=t.jsPDF||{},d=t.title?t.title:"";function u(e,t){var i=[];return e.columns.forEach(e=>{var s;if(e){switch(typeof e.value){case"object":e.value=null!==e.value?JSON.stringify(e.value):"";break;case"undefined":e.value=""}s={content:e.value,colSpan:e.width,rowSpan:e.height},t&&(s.styles=t),i.push(s)}}),i}c.orientation||(c.orientation=t.orientation||"landscape"),c.unit||(c.unit="pt"),e.forEach(e=>{switch(e.type){case"header":o.push(u(e));break;case"group":a.push(u(e,l));break;case"calc":a.push(u(e,h));break;case"row":a.push(u(e))}}),s=this.dependencyRegistry.lookup("jspdf","jsPDF"),n=new s(c),t.autoTable&&(r="function"==typeof t.autoTable?t.autoTable(n)||{}:t.autoTable),d&&(r.didDrawPage=function(e){n.text(d,40,30)}),r.head=o,r.body=a,n.autoTable(r),t.documentProcessing&&t.documentProcessing(n),i(n.output("arraybuffer"),"application/pdf")},xlsx:function(e,t,i){var s=t.sheetName||"Sheet1",n=this.dependencyRegistry.lookup("XLSX"),o=n.utils.book_new(),a=new Ba(this),r=!("compress"in t)||t.compress,l=t.writeOptions||{bookType:"xlsx",bookSST:!0,compression:r};function h(){var t=[],i=[],s={},o={s:{c:0,r:0},e:{c:e[0]?e[0].columns.reduce((e,t)=>e+(t&&t.width?t.width:1),0):0,r:e.length}};return e.forEach((e,s)=>{var n=[];e.columns.forEach(function(e,t){e?(n.push(e.value instanceof Date||"object"!=typeof e.value?e.value:JSON.stringify(e.value)),(e.width>1||e.height>-1)&&(e.height>1||e.width>1)&&i.push({s:{r:s,c:t},e:{r:s+e.height-1,c:t+e.width-1}})):n.push("")}),t.push(n)}),n.utils.sheet_add_aoa(s,t),s["!ref"]=n.utils.encode_range(o),i.length&&(s["!merges"]=i),s}if(l.type="binary",o.SheetNames=[],o.Sheets={},t.sheetOnly)i(h());else{if(t.sheets)for(var c in t.sheets)!0===t.sheets[c]?(o.SheetNames.push(c),o.Sheets[c]=h()):(o.SheetNames.push(c),a.commsSend(t.sheets[c],"download","intercept",{type:"xlsx",options:{sheetOnly:!0},active:this.active,intercept:function(e){o.Sheets[c]=e}}));else o.SheetNames.push(s),o.Sheets[s]=h();t.documentProcessing&&(o=t.documentProcessing(o)),i(function(e){for(var t=new ArrayBuffer(e.length),i=new Uint8Array(t),s=0;s!=e.length;++s)i[s]=255&e.charCodeAt(s);return t}(n.write(o,l)),"application/octet-stream")}},html:function(e,t,i){this.modExists("export",!0)&&i(this.modules.export.generateHTMLTable(e),"text/html")}};class br extends Ga{static moduleName="download";static downloaders=gr;constructor(e){super(e),this.registerTableOption("downloadEncoder",function(e,t){return new Blob([e],{type:t})}),this.registerTableOption("downloadConfig",{}),this.registerTableOption("downloadRowRange","active"),this.registerColumnOption("download"),this.registerColumnOption("titleDownload")}initialize(){this.deprecatedOptionsCheck(),this.registerTableFunction("download",this.download.bind(this)),this.registerTableFunction("downloadToTab",this.downloadToTab.bind(this))}deprecatedOptionsCheck(){}downloadToTab(e,t,i,s){this.download(e,t,i,s,!0)}download(e,t,i,s,n){var o=!1;if("function"==typeof e?o=e:br.downloaders[e]?o=br.downloaders[e]:console.warn("Download Error - No such download type found: ",e),o){var a=this.generateExportList(s);o.call(this.table,a,i||{},function(i,s){n?!0===n?this.triggerDownload(i,s,e,t,!0):n(i):this.triggerDownload(i,s,e,t)}.bind(this))}}generateExportList(e){var t=this.table.modules.export.generateExportList(this.table.options.downloadConfig,!1,e||this.table.options.downloadRowRange,"download"),i=this.table.options.groupHeaderDownload;return i&&!Array.isArray(i)&&(i=[i]),t.forEach(e=>{var t;"group"===e.type&&(t=e.columns[0],i&&i[e.indent]&&(t.value=i[e.indent](t.value,e.component._group.getRowCount(),e.component._group.getData(),e.component)))}),t}triggerDownload(e,t,i,s,n){var o=document.createElement("a"),a=this.table.options.downloadEncoder(e,t);a&&(n?window.open(window.URL.createObjectURL(a)):(s=s||"Tabulator."+("function"==typeof i?"txt":i),navigator.msSaveOrOpenBlob?navigator.msSaveOrOpenBlob(a,s):(o.setAttribute("href",window.URL.createObjectURL(a)),o.setAttribute("download",s),o.style.display="none",document.body.appendChild(o),o.click(),document.body.removeChild(o))),this.dispatchExternal("downloadComplete"))}commsReceived(e,t,i){"intercept"===t&&this.download(i.type,"",i.options,i.active,i.intercept)}}function fr(e,t){var i=t.mask,s=void 0!==t.maskLetterChar?t.maskLetterChar:"A",n=void 0!==t.maskNumberChar?t.maskNumberChar:"9",o=void 0!==t.maskWildcardChar?t.maskWildcardChar:"*";function a(t){var r=i[t];void 0!==r&&r!==o&&r!==s&&r!==n&&(e.value=e.value+""+r,a(t+1))}e.addEventListener("keydown",t=>{var a=e.value.length,r=t.key;if(1===t.key.length&&!t.ctrlKey&&!t.metaKey){if(a>=i.length)return t.preventDefault(),t.stopPropagation(),!1;switch(i[a]){case s:if(r.toUpperCase()==r.toLowerCase())return t.preventDefault(),t.stopPropagation(),!1;break;case n:if(isNaN(r))return t.preventDefault(),t.stopPropagation(),!1;break;case o:break;default:if(r!==i[a])return t.preventDefault(),t.stopPropagation(),!1}}}),e.addEventListener("keyup",i=>{1===i.key.length&&t.maskAutoFill&&a(e.value.length)}),e.placeholder||(e.placeholder=i),t.maskAutoFill&&a(e.value.length)}let vr=class{constructor(e,t,i,s,n,o){this.edit=e,this.table=e.table,this.cell=t,this.params=this._initializeParams(o),this.data=[],this.displayItems=[],this.currentItems=[],this.focusedItem=null,this.input=this._createInputElement(),this.listEl=this._createListElement(),this.initialValues=null,this.isFilter="header"===t.getType(),this.filterTimeout=null,this.filtered=!1,this.typing=!1,this.values=[],this.popup=null,this.listIteration=0,this.lastAction="",this.filterTerm="",this.blurable=!0,this.actions={success:s,cancel:n},this._deprecatedOptionsCheck(),this._initializeValue(),i(this._onRendered.bind(this))}_deprecatedOptionsCheck(){}_initializeValue(){var e=this.cell.getValue();void 0===e&&void 0!==this.params.defaultValue&&(e=this.params.defaultValue),this.initialValues=this.params.multiselect?e:[e],this.isFilter&&(this.input.value=this.initialValues?this.initialValues.join(","):"",this.headerFilterInitialListGen())}_onRendered(){var e=this.cell.getElement();function t(e){e.stopPropagation()}this.isFilter||(this.input.style.height="100%",this.input.focus({preventScroll:!0})),e.addEventListener("click",t),setTimeout(()=>{e.removeEventListener("click",t)},1e3),this.input.addEventListener("mousedown",this._preventPopupBlur.bind(this))}_createListElement(){var e=document.createElement("div");return e.classList.add("tabulator-edit-list"),e.addEventListener("mousedown",this._preventBlur.bind(this)),e.addEventListener("keydown",this._inputKeyDown.bind(this)),e}_setListWidth(){var e=this.isFilter?this.input:this.cell.getElement();this.listEl.style.minWidth=e.offsetWidth+"px",this.params.maxWidth&&(!0===this.params.maxWidth?this.listEl.style.maxWidth=e.offsetWidth+"px":"number"==typeof this.params.maxWidth?this.listEl.style.maxWidth=this.params.maxWidth+"px":this.listEl.style.maxWidth=this.params.maxWidth)}_createInputElement(){var e=this.params.elementAttributes,t=document.createElement("input");if(t.setAttribute("type",this.params.clearable?"search":"text"),t.style.padding="4px",t.style.width="100%",t.style.boxSizing="border-box",this.params.autocomplete||(t.style.cursor="default",t.style.caretColor="transparent"),e&&"object"==typeof e)for(let i in e)"+"==i.charAt(0)?(i=i.slice(1),t.setAttribute(i,t.getAttribute(i)+e["+"+i])):t.setAttribute(i,e[i]);return this.params.mask&&fr(t,this.params),this._bindInputEvents(t),t}_initializeParams(e){var t,i=["values","valuesURL","valuesLookup"];return(e=Object.assign({},e)).verticalNavigation=e.verticalNavigation||"editor",e.placeholderLoading=void 0===e.placeholderLoading?"Searching ...":e.placeholderLoading,e.placeholderEmpty=void 0===e.placeholderEmpty?"No Results Found":e.placeholderEmpty,e.filterDelay=void 0===e.filterDelay?300:e.filterDelay,e.emptyValue=Object.keys(e).includes("emptyValue")?e.emptyValue:"",(t=Object.keys(e).filter(e=>i.includes(e)).length)?t>1&&console.warn("list editor config error - only one of the values, valuesURL, or valuesLookup options can be set on the same editor"):console.warn("list editor config error - either the values, valuesURL, or valuesLookup option must be set"),e.autocomplete?e.multiselect&&(e.multiselect=!1,console.warn("list editor config error - multiselect option is not available when autocomplete is enabled")):(e.freetext&&(e.freetext=!1,console.warn("list editor config error - freetext option is only available when autocomplete is enabled")),e.filterFunc&&(e.filterFunc=!1,console.warn("list editor config error - filterFunc option is only available when autocomplete is enabled")),e.filterRemote&&(e.filterRemote=!1,console.warn("list editor config error - filterRemote option is only available when autocomplete is enabled")),e.mask&&(e.mask=!1,console.warn("list editor config error - mask option is only available when autocomplete is enabled")),e.allowEmpty&&(e.allowEmpty=!1,console.warn("list editor config error - allowEmpty option is only available when autocomplete is enabled")),e.listOnEmpty&&(e.listOnEmpty=!1,console.warn("list editor config error - listOnEmpty option is only available when autocomplete is enabled"))),e.filterRemote&&"function"!=typeof e.valuesLookup&&!e.valuesURL&&(e.filterRemote=!1,console.warn("list editor config error - filterRemote option should only be used when values list is populated from a remote source")),e}_bindInputEvents(e){e.addEventListener("focus",this._inputFocus.bind(this)),e.addEventListener("click",this._inputClick.bind(this)),e.addEventListener("blur",this._inputBlur.bind(this)),e.addEventListener("keydown",this._inputKeyDown.bind(this)),e.addEventListener("search",this._inputSearch.bind(this)),this.params.autocomplete&&e.addEventListener("keyup",this._inputKeyUp.bind(this))}_inputFocus(e){this.rebuildOptionsList()}_filter(){this.params.filterRemote?(clearTimeout(this.filterTimeout),this.filterTimeout=setTimeout(()=>{this.rebuildOptionsList()},this.params.filterDelay)):this._filterList()}_inputClick(e){e.stopPropagation()}_inputBlur(e){this.blurable&&(this.popup?this.popup.hide():this._resolveValue(!0))}_inputSearch(){this._clearChoices()}_inputKeyDown(e){switch(e.key){case"ArrowUp":this._keyUp(e);break;case"ArrowDown":this._keyDown(e);break;case"ArrowLeft":case"ArrowRight":this._keySide(e);break;case"Enter":this._keyEnter();break;case"Escape":this._keyEsc();break;case"Home":case"End":this._keyHomeEnd(e);break;case"Tab":this._keyTab(e);break;default:this._keySelectLetter(e)}}_inputKeyUp(e){switch(e.key){case"ArrowUp":case"ArrowLeft":case"ArrowRight":case"ArrowDown":case"Enter":case"Escape":break;default:this._keyAutoCompLetter(e)}}_preventPopupBlur(){this.popup&&this.popup.blockHide(),setTimeout(()=>{this.popup&&this.popup.restoreHide()},10)}_preventBlur(){this.blurable=!1,setTimeout(()=>{this.blurable=!0},10)}_keyTab(e){this.params.autocomplete&&"typing"===this.lastAction?this._resolveValue(!0):this.focusedItem&&this._chooseItem(this.focusedItem,!0)}_keyUp(e){var t=this.displayItems.indexOf(this.focusedItem);("editor"==this.params.verticalNavigation||"hybrid"==this.params.verticalNavigation&&t)&&(e.stopImmediatePropagation(),e.stopPropagation(),e.preventDefault(),t>0&&this._focusItem(this.displayItems[t-1]))}_keyDown(e){var t=this.displayItems.indexOf(this.focusedItem);("editor"==this.params.verticalNavigation||"hybrid"==this.params.verticalNavigation&&t<this.displayItems.length-1)&&(e.stopImmediatePropagation(),e.stopPropagation(),e.preventDefault(),t<this.displayItems.length-1&&(-1==t?this._focusItem(this.displayItems[0]):this._focusItem(this.displayItems[t+1])))}_keySide(e){this.params.autocomplete||(e.stopImmediatePropagation(),e.stopPropagation(),e.preventDefault())}_keyEnter(e){this.params.autocomplete&&"typing"===this.lastAction?this._resolveValue(!0):this.focusedItem&&this._chooseItem(this.focusedItem)}_keyEsc(e){this._cancel()}_keyHomeEnd(e){this.params.autocomplete&&e.stopImmediatePropagation()}_keySelectLetter(e){this.params.autocomplete||(e.preventDefault(),1===e.key.length&&this._scrollToValue(e.key.toUpperCase().charCodeAt(0)))}_keyAutoCompLetter(e){this._filter(),this.lastAction="typing",this.typing=!0}_scrollToValue(e){clearTimeout(this.filterTimeout);var t=String.fromCharCode(e).toLowerCase();this.filterTerm+=t.toLowerCase();var i=this.displayItems.find(e=>void 0!==e.label&&e.label.toLowerCase().startsWith(this.filterTerm));i&&this._focusItem(i),this.filterTimeout=setTimeout(()=>{this.filterTerm=""},800)}_focusItem(e){this.lastAction="focus",this.focusedItem&&this.focusedItem.element&&this.focusedItem.element.classList.remove("focused"),this.focusedItem=e,e&&e.element&&(e.element.classList.add("focused"),e.element.scrollIntoView({behavior:"smooth",block:"nearest",inline:"start"}))}headerFilterInitialListGen(){this._generateOptions(!0)}rebuildOptionsList(){this._generateOptions().then(this._sortOptions.bind(this)).then(this._buildList.bind(this)).then(this._showList.bind(this)).catch(e=>{Number.isInteger(e)||console.error("List generation error",e)})}_filterList(){this._buildList(this._filterOptions()),this._showList()}_generateOptions(e){var t=[],i=++this.listIteration;return this.filtered=!1,this.params.values?t=this.params.values:this.params.valuesURL?t=this._ajaxRequest(this.params.valuesURL,this.input.value):"function"==typeof this.params.valuesLookup?t=this.params.valuesLookup(this.cell,this.input.value):this.params.valuesLookup&&(t=this._uniqueColumnValues(this.params.valuesLookupField)),t instanceof Promise?(e||this._addPlaceholder(this.params.placeholderLoading),t.then().then(e=>this.listIteration===i?this._parseList(e):Promise.reject(i))):Promise.resolve(this._parseList(t))}_addPlaceholder(e){var t=document.createElement("div");"function"==typeof e&&(e=e(this.cell.getComponent(),this.listEl)),e&&(this._clearList(),e instanceof HTMLElement?t=e:(t.classList.add("tabulator-edit-list-placeholder"),t.innerHTML=e),this.listEl.appendChild(t),this._showList())}_ajaxRequest(e,t){return e=qa(e,{},this.params.filterRemote?{term:t}:{}),fetch(e).then(e=>e.ok?e.json().catch(e=>(console.warn("List Ajax Load Error - Invalid JSON returned",e),Promise.reject(e))):(console.error("List Ajax Load Error - Connection Error: "+e.status,e.statusText),Promise.reject(e))).catch(e=>(console.error("List Ajax Load Error - Connection Error: ",e),Promise.reject(e)))}_uniqueColumnValues(e){var t,i={},s=this.table.getData(this.params.valuesLookup);return(t=e?this.table.columnManager.getColumnByField(e):this.cell.getColumn()._getSelf())?s.forEach(e=>{var s=t.getFieldValue(e);this._emptyValueCheck(s)||(this.params.multiselect&&Array.isArray(s)?s.forEach(e=>{this._emptyValueCheck(e)||(i[e]=!0)}):i[s]=!0)}):(console.warn("unable to find matching column to create select lookup list:",e),i=[]),Object.keys(i)}_emptyValueCheck(e){return null==e||""===e}_parseList(e){var t=[];return Array.isArray(e)||(e=Object.entries(e).map(([e,t])=>({label:t,value:e}))),e.forEach(e=>{"object"!=typeof e&&(e={label:e,value:e}),this._parseListItem(e,t,0)}),!this.currentItems.length&&this.params.freetext&&(this.input.value=this.initialValues,this.typing=!0,this.lastAction="typing"),this.data=t,t}_parseListItem(e,t,i){var s={};e.options?s=this._parseListGroup(e,i+1):(s={label:e.label,value:e.value,itemParams:e.itemParams,elementAttributes:e.elementAttributes,element:!1,selected:!1,visible:!0,level:i,original:e},this.initialValues&&this.initialValues.indexOf(e.value)>-1&&this._chooseItem(s,!0)),t.push(s)}_parseListGroup(e,t){var i={label:e.label,group:!0,itemParams:e.itemParams,elementAttributes:e.elementAttributes,element:!1,visible:!0,level:t,options:[],original:e};return e.options.forEach(e=>{this._parseListItem(e,i.options,t)}),i}_sortOptions(e){var t;return this.params.sort&&(t="function"==typeof this.params.sort?this.params.sort:this._defaultSortFunction.bind(this),this._sortGroup(t,e)),e}_sortGroup(e,t){t.sort((t,i)=>e(t.label,i.label,t.value,i.value,t.original,i.original)),t.forEach(t=>{t.group&&this._sortGroup(e,t.options)})}_defaultSortFunction(e,t){var i,s,n,o,a,r=0,l=/(\d+)|(\D+)/g,h=/\d/,c=0;if("desc"===this.params.sort&&([e,t]=[t,e]),e||0===e){if(t||0===t){if(isFinite(e)&&isFinite(t))return e-t;if((i=String(e).toLowerCase())===(s=String(t).toLowerCase()))return 0;if(!h.test(i)||!h.test(s))return i>s?1:-1;for(i=i.match(l),s=s.match(l),a=i.length>s.length?s.length:i.length;r<a;)if((n=i[r])!==(o=s[r++]))return isFinite(n)&&isFinite(o)?("0"===n.charAt(0)&&(n="."+n),"0"===o.charAt(0)&&(o="."+o),n-o):n>o?1:-1;return i.length>s.length}c=1}else c=t||0===t?-1:0;return c}_filterOptions(){var e=this.params.filterFunc||this._defaultFilterFunc,t=this.input.value;return t?(this.filtered=!0,this.data.forEach(i=>{this._filterItem(e,t,i)})):this.filtered=!1,this.data}_filterItem(e,t,i){var s=!1;return i.group?(i.options.forEach(i=>{this._filterItem(e,t,i)&&(s=!0)}),i.visible=s):i.visible=e(t,i.label,i.value,i.original),i.visible}_defaultFilterFunc(e,t,i,s){return e=String(e).toLowerCase(),null!=t&&(String(t).toLowerCase().indexOf(e)>-1||String(i).toLowerCase().indexOf(e)>-1)}_clearList(){for(;this.listEl.firstChild;)this.listEl.removeChild(this.listEl.firstChild);this.displayItems=[]}_buildList(e){this._clearList(),e.forEach(e=>{this._buildItem(e)}),this.displayItems.length||this._addPlaceholder(this.params.placeholderEmpty)}_buildItem(e){var t,i=e.element;if(!this.filtered||e.visible){if(!i){if((i=document.createElement("div")).tabIndex=0,(t=this.params.itemFormatter?this.params.itemFormatter(e.label,e.value,e.original,i):e.label)instanceof HTMLElement?i.appendChild(t):i.innerHTML=t,e.group?i.classList.add("tabulator-edit-list-group"):i.classList.add("tabulator-edit-list-item"),i.classList.add("tabulator-edit-list-group-level-"+e.level),e.elementAttributes&&"object"==typeof e.elementAttributes)for(let t in e.elementAttributes)"+"==t.charAt(0)?(t=t.slice(1),i.setAttribute(t,this.input.getAttribute(t)+e.elementAttributes["+"+t])):i.setAttribute(t,e.elementAttributes[t]);e.group?i.addEventListener("click",this._groupClick.bind(this,e)):i.addEventListener("click",this._itemClick.bind(this,e)),i.addEventListener("mousedown",this._preventBlur.bind(this)),e.element=i}this._styleItem(e),this.listEl.appendChild(i),e.group?e.options.forEach(e=>{this._buildItem(e)}):this.displayItems.push(e)}}_showList(){var e=this.popup&&this.popup.isVisible();if(this.input.parentNode){if(this.params.autocomplete&&""===this.input.value&&!this.params.listOnEmpty)return void(this.popup&&this.popup.hide(!0));this._setListWidth(),this.popup||(this.popup=this.edit.popup(this.listEl)),this.popup.show(this.cell.getElement(),"bottom"),e||setTimeout(()=>{this.popup.hideOnBlur(this._resolveValue.bind(this,!0))},10)}}_styleItem(e){e&&e.element&&(e.selected?e.element.classList.add("active"):e.element.classList.remove("active"))}_itemClick(e,t){t.stopPropagation(),this._chooseItem(e)}_groupClick(e,t){t.stopPropagation()}_cancel(){this.popup.hide(!0),this.actions.cancel()}_clearChoices(){this.typing=!0,this.currentItems.forEach(e=>{e.selected=!1,this._styleItem(e)}),this.currentItems=[],this.focusedItem=null}_chooseItem(e,t){var i;this.typing=!1,this.params.multiselect?((i=this.currentItems.indexOf(e))>-1?(this.currentItems.splice(i,1),e.selected=!1):(this.currentItems.push(e),e.selected=!0),this.input.value=this.currentItems.map(e=>e.label).join(","),this._styleItem(e)):(this.currentItems=[e],e.selected=!0,this.input.value=e.label,this._styleItem(e),t||this._resolveValue()),this._focusItem(e)}_resolveValue(e){var t,i;if(this.popup&&this.popup.hide(!0),this.params.multiselect)t=this.currentItems.map(e=>e.value);else if(e&&this.params.autocomplete&&this.typing){if(!(this.params.freetext||this.params.allowEmpty&&""===this.input.value))return void this.actions.cancel();t=this.input.value}else t=this.currentItems[0]?this.currentItems[0].value:null==(i=Array.isArray(this.initialValues)?this.initialValues[0]:this.initialValues)||""===i?i:this.params.emptyValue;""===t&&(t=this.params.emptyValue),this.actions.success(t),this.isFilter&&(this.initialValues=t&&!Array.isArray(t)?[t]:t,this.currentItems=[])}};var wr={input:function(e,t,i,s,n){var o=e.getValue(),a=document.createElement("input");if(a.setAttribute("type",n.search?"search":"text"),a.style.padding="4px",a.style.width="100%",a.style.boxSizing="border-box",n.elementAttributes&&"object"==typeof n.elementAttributes)for(let e in n.elementAttributes)"+"==e.charAt(0)?(e=e.slice(1),a.setAttribute(e,a.getAttribute(e)+n.elementAttributes["+"+e])):a.setAttribute(e,n.elementAttributes[e]);function r(e){null==o&&""!==a.value||a.value!==o?i(a.value)&&(o=a.value):s()}return a.value=void 0!==o?o:"",t(function(){"cell"===e.getType()&&(a.focus({preventScroll:!0}),a.style.height="100%",n.selectContents&&a.select())}),a.addEventListener("change",r),a.addEventListener("blur",r),a.addEventListener("keydown",function(e){switch(e.key){case"Enter":r();break;case"Escape":s();break;case"End":case"Home":e.stopPropagation()}}),n.mask&&fr(a,n),a},textarea:function(e,t,i,s,n){var o=e.getValue(),a=n.verticalNavigation||"hybrid",r=String(null!=o?o:""),l=document.createElement("textarea"),h=0;if(l.style.display="block",l.style.padding="2px",l.style.height="100%",l.style.width="100%",l.style.boxSizing="border-box",l.style.whiteSpace="pre-wrap",l.style.resize="none",n.elementAttributes&&"object"==typeof n.elementAttributes)for(let e in n.elementAttributes)"+"==e.charAt(0)?(e=e.slice(1),l.setAttribute(e,l.getAttribute(e)+n.elementAttributes["+"+e])):l.setAttribute(e,n.elementAttributes[e]);function c(t){null==o&&""!==l.value||l.value!==o?(i(l.value)&&(o=l.value),setTimeout(function(){e.getRow().normalizeHeight()},300)):s()}return l.value=r,t(function(){"cell"===e.getType()&&(l.focus({preventScroll:!0}),l.style.height="100%",l.scrollHeight,l.style.height=l.scrollHeight+"px",e.getRow().normalizeHeight(),n.selectContents&&l.select())}),l.addEventListener("change",c),l.addEventListener("blur",c),l.addEventListener("keyup",function(){l.style.height="";var t=l.scrollHeight;l.style.height=t+"px",t!=h&&(h=t,e.getRow().normalizeHeight())}),l.addEventListener("keydown",function(e){switch(e.key){case"Enter":e.shiftKey&&n.shiftEnterSubmit&&c();break;case"Escape":s();break;case"ArrowUp":("editor"==a||"hybrid"==a&&l.selectionStart)&&(e.stopImmediatePropagation(),e.stopPropagation());break;case"ArrowDown":("editor"==a||"hybrid"==a&&l.selectionStart!==l.value.length)&&(e.stopImmediatePropagation(),e.stopPropagation());break;case"End":case"Home":e.stopPropagation()}}),n.mask&&fr(l,n),l},number:function(e,t,i,s,n){var o=e.getValue(),a=n.verticalNavigation||"editor",r=document.createElement("input");if(r.setAttribute("type","number"),void 0!==n.max&&r.setAttribute("max",n.max),void 0!==n.min&&r.setAttribute("min",n.min),void 0!==n.step&&r.setAttribute("step",n.step),r.style.padding="4px",r.style.width="100%",r.style.boxSizing="border-box",n.elementAttributes&&"object"==typeof n.elementAttributes)for(let e in n.elementAttributes)"+"==e.charAt(0)?(e=e.slice(1),r.setAttribute(e,r.getAttribute(e)+n.elementAttributes["+"+e])):r.setAttribute(e,n.elementAttributes[e]);r.value=o;var l=function(e){h()};function h(){var e=r.value;isNaN(e)||""===e||(e=Number(e)),e!==o?i(e)&&(o=e):s()}return t(function(){"cell"===e.getType()&&(r.removeEventListener("blur",l),r.focus({preventScroll:!0}),r.style.height="100%",r.addEventListener("blur",l),n.selectContents&&r.select())}),r.addEventListener("keydown",function(e){switch(e.key){case"Enter":h();break;case"Escape":s();break;case"ArrowUp":case"ArrowDown":"editor"==a&&(e.stopImmediatePropagation(),e.stopPropagation());break;case"End":case"Home":e.stopPropagation()}}),n.mask&&fr(r,n),r},range:function(e,t,i,s,n){var o=e.getValue(),a=document.createElement("input");if(a.setAttribute("type","range"),void 0!==n.max&&a.setAttribute("max",n.max),void 0!==n.min&&a.setAttribute("min",n.min),void 0!==n.step&&a.setAttribute("step",n.step),a.style.padding="4px",a.style.width="100%",a.style.boxSizing="border-box",n.elementAttributes&&"object"==typeof n.elementAttributes)for(let e in n.elementAttributes)"+"==e.charAt(0)?(e=e.slice(1),a.setAttribute(e,a.getAttribute(e)+n.elementAttributes["+"+e])):a.setAttribute(e,n.elementAttributes[e]);function r(){var e=a.value;isNaN(e)||""===e||(e=Number(e)),e!=o?i(e)&&(o=e):s()}return a.value=o,t(function(){"cell"===e.getType()&&(a.focus({preventScroll:!0}),a.style.height="100%")}),a.addEventListener("blur",function(e){r()}),a.addEventListener("keydown",function(e){switch(e.key){case"Enter":r();break;case"Escape":s()}}),a},date:function(e,t,i,s,n){var o=n.format,a=n.verticalNavigation||"editor",r=o?window.DateTime||luxon.DateTime:null,l=e.getValue(),h=document.createElement("input");function c(e){return(r.isDateTime(e)?e:"x"===o?r.fromMillis(e):"iso"===o?r.fromISO(String(e)):r.fromFormat(String(e),o)).toFormat("yyyy-MM-dd")}if(h.type="date",h.style.padding="4px",h.style.width="100%",h.style.boxSizing="border-box",n.max&&h.setAttribute("max",o?c(n.max):n.max),n.min&&h.setAttribute("min",o?c(n.min):n.min),n.elementAttributes&&"object"==typeof n.elementAttributes)for(let e in n.elementAttributes)"+"==e.charAt(0)?(e=e.slice(1),h.setAttribute(e,h.getAttribute(e)+n.elementAttributes["+"+e])):h.setAttribute(e,n.elementAttributes[e]);function d(){var e,t=h.value;if(null==l&&""!==t||t!==l){if(t&&o)switch(e=r.fromFormat(String(t),"yyyy-MM-dd"),o){case!0:t=e;break;case"x":t=e.toMillis();break;case"iso":t=e.toISO();break;default:t=e.toFormat(o)}i(t)&&(l=h.value)}else s()}return l=void 0!==l?l:"",o&&(r?l=c(l):console.error("Editor Error - 'date' editor 'format' param is dependant on luxon.js")),h.value=l,t(function(){"cell"===e.getType()&&(h.focus({preventScroll:!0}),h.style.height="100%",n.selectContents&&h.select())}),h.addEventListener("blur",function(e){(e.relatedTarget||e.rangeParent||e.explicitOriginalTarget!==h)&&d()}),h.addEventListener("keydown",function(e){switch(e.key){case"Enter":d();break;case"Escape":s();break;case"End":case"Home":e.stopPropagation();break;case"ArrowUp":case"ArrowDown":"editor"==a&&(e.stopImmediatePropagation(),e.stopPropagation())}}),h},time:function(e,t,i,s,n){var o,a=n.format,r=n.verticalNavigation||"editor",l=a?window.DateTime||luxon.DateTime:null,h=e.getValue(),c=document.createElement("input");if(c.type="time",c.style.padding="4px",c.style.width="100%",c.style.boxSizing="border-box",n.elementAttributes&&"object"==typeof n.elementAttributes)for(let e in n.elementAttributes)"+"==e.charAt(0)?(e=e.slice(1),c.setAttribute(e,c.getAttribute(e)+n.elementAttributes["+"+e])):c.setAttribute(e,n.elementAttributes[e]);function d(){var e,t=c.value;if(null==h&&""!==t||t!==h){if(t&&a)switch(e=l.fromFormat(String(t),"hh:mm"),a){case!0:t=e;break;case"x":t=e.toMillis();break;case"iso":t=e.toISO();break;default:t=e.toFormat(a)}i(t)&&(h=c.value)}else s()}return h=void 0!==h?h:"",a&&(l?(o=l.isDateTime(h)?h:"x"===a?l.fromMillis(h):"iso"===a?l.fromISO(String(h)):l.fromFormat(String(h),a),h=o.toFormat("HH:mm")):console.error("Editor Error - 'date' editor 'format' param is dependant on luxon.js")),c.value=h,t(function(){"cell"==e.getType()&&(c.focus({preventScroll:!0}),c.style.height="100%",n.selectContents&&c.select())}),c.addEventListener("blur",function(e){(e.relatedTarget||e.rangeParent||e.explicitOriginalTarget!==c)&&d()}),c.addEventListener("keydown",function(e){switch(e.key){case"Enter":d();break;case"Escape":s();break;case"End":case"Home":e.stopPropagation();break;case"ArrowUp":case"ArrowDown":"editor"==r&&(e.stopImmediatePropagation(),e.stopPropagation())}}),c},datetime:function(e,t,i,s,n){var o,a=n.format,r=n.verticalNavigation||"editor",l=a?this.table.dependencyRegistry.lookup(["luxon","DateTime"],"DateTime"):null,h=e.getValue(),c=document.createElement("input");if(c.type="datetime-local",c.style.padding="4px",c.style.width="100%",c.style.boxSizing="border-box",n.elementAttributes&&"object"==typeof n.elementAttributes)for(let e in n.elementAttributes)"+"==e.charAt(0)?(e=e.slice(1),c.setAttribute(e,c.getAttribute(e)+n.elementAttributes["+"+e])):c.setAttribute(e,n.elementAttributes[e]);function d(){var e,t=c.value;if(null==h&&""!==t||t!==h){if(t&&a)switch(e=l.fromISO(String(t)),a){case!0:t=e;break;case"x":t=e.toMillis();break;case"iso":t=e.toISO();break;default:t=e.toFormat(a)}i(t)&&(h=c.value)}else s()}return h=void 0!==h?h:"",a&&(l?(o=l.isDateTime(h)?h:"x"===a?l.fromMillis(h):"iso"===a?l.fromISO(String(h)):l.fromFormat(String(h),a),h=o.toFormat("yyyy-MM-dd")+"T"+o.toFormat("HH:mm")):console.error("Editor Error - 'date' editor 'format' param is dependant on luxon.js")),c.value=h,t(function(){"cell"===e.getType()&&(c.focus({preventScroll:!0}),c.style.height="100%",n.selectContents&&c.select())}),c.addEventListener("blur",function(e){(e.relatedTarget||e.rangeParent||e.explicitOriginalTarget!==c)&&d()}),c.addEventListener("keydown",function(e){switch(e.key){case"Enter":d();break;case"Escape":s();break;case"End":case"Home":e.stopPropagation();break;case"ArrowUp":case"ArrowDown":"editor"==r&&(e.stopImmediatePropagation(),e.stopPropagation())}}),c},list:function(e,t,i,s,n){return new vr(this,e,t,i,s,n).input},star:function(e,t,i,s,n){var o=this,a=e.getElement(),r=e.getValue(),l=a.getElementsByTagName("svg").length||5,h=a.getElementsByTagName("svg")[0]?a.getElementsByTagName("svg")[0].getAttribute("width"):14,c=[],d=document.createElement("div"),u=document.createElementNS("http://www.w3.org/2000/svg","svg");function p(e){c.forEach(function(t,i){i<e?("ie"==o.table.browser?t.setAttribute("class","tabulator-star-active"):t.classList.replace("tabulator-star-inactive","tabulator-star-active"),t.innerHTML='<polygon fill="#488CE9" stroke="#014AAE" stroke-width="37.6152" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" points="259.216,29.942 330.27,173.919 489.16,197.007 374.185,309.08 401.33,467.31 259.216,392.612 117.104,467.31 144.25,309.08 29.274,197.007 188.165,173.919 "/>'):("ie"==o.table.browser?t.setAttribute("class","tabulator-star-inactive"):t.classList.replace("tabulator-star-active","tabulator-star-inactive"),t.innerHTML='<polygon fill="#010155" stroke="#686868" stroke-width="37.6152" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" points="259.216,29.942 330.27,173.919 489.16,197.007 374.185,309.08 401.33,467.31 259.216,392.612 117.104,467.31 144.25,309.08 29.274,197.007 188.165,173.919 "/>')})}function m(e){var t=document.createElement("span"),s=u.cloneNode(!0);c.push(s),t.addEventListener("mouseenter",function(t){t.stopPropagation(),t.stopImmediatePropagation(),p(e)}),t.addEventListener("mousemove",function(e){e.stopPropagation(),e.stopImmediatePropagation()}),t.addEventListener("click",function(t){t.stopPropagation(),t.stopImmediatePropagation(),i(e),a.blur()}),t.appendChild(s),d.appendChild(t)}function g(e){r=e,p(e)}if(a.style.whiteSpace="nowrap",a.style.overflow="hidden",a.style.textOverflow="ellipsis",d.style.verticalAlign="middle",d.style.display="inline-block",d.style.padding="4px",u.setAttribute("width",h),u.setAttribute("height",h),u.setAttribute("viewBox","0 0 512 512"),u.setAttribute("xml:space","preserve"),u.style.padding="0 1px",n.elementAttributes&&"object"==typeof n.elementAttributes)for(let e in n.elementAttributes)"+"==e.charAt(0)?(e=e.slice(1),d.setAttribute(e,d.getAttribute(e)+n.elementAttributes["+"+e])):d.setAttribute(e,n.elementAttributes[e]);for(var b=1;b<=l;b++)m(b);return p(r=Math.min(parseInt(r),l)),d.addEventListener("mousemove",function(e){p(0)}),d.addEventListener("click",function(e){i(0)}),a.addEventListener("blur",function(e){s()}),a.addEventListener("keydown",function(e){switch(e.key){case"ArrowRight":g(r+1);break;case"ArrowLeft":g(r-1);break;case"Enter":i(r);break;case"Escape":s()}}),d},progress:function(e,t,i,s,n){var o,a,r=e.getElement(),l=void 0===n.max?r.getElementsByTagName("div")[0]&&r.getElementsByTagName("div")[0].getAttribute("max")||100:n.max,h=void 0===n.min?r.getElementsByTagName("div")[0]&&r.getElementsByTagName("div")[0].getAttribute("min")||0:n.min,c=(l-h)/100,d=e.getValue()||0,u=document.createElement("div"),p=document.createElement("div");function m(){var e=window.getComputedStyle(r,null),t=c*Math.round(p.offsetWidth/((r.clientWidth-parseInt(e.getPropertyValue("padding-left"))-parseInt(e.getPropertyValue("padding-right")))/100))+h;i(t),r.setAttribute("aria-valuenow",t),r.setAttribute("aria-label",d)}if(u.style.position="absolute",u.style.right="0",u.style.top="0",u.style.bottom="0",u.style.width="5px",u.classList.add("tabulator-progress-handle"),p.style.display="inline-block",p.style.position="relative",p.style.height="100%",p.style.backgroundColor="#488CE9",p.style.maxWidth="100%",p.style.minWidth="0%",n.elementAttributes&&"object"==typeof n.elementAttributes)for(let e in n.elementAttributes)"+"==e.charAt(0)?(e=e.slice(1),p.setAttribute(e,p.getAttribute(e)+n.elementAttributes["+"+e])):p.setAttribute(e,n.elementAttributes[e]);return r.style.padding="4px 4px",d=Math.min(parseFloat(d),l),d=Math.max(parseFloat(d),h),d=Math.round((d-h)/c),p.style.width=d+"%",r.setAttribute("aria-valuemin",h),r.setAttribute("aria-valuemax",l),p.appendChild(u),u.addEventListener("mousedown",function(e){o=e.screenX,a=p.offsetWidth}),u.addEventListener("mouseover",function(){u.style.cursor="ew-resize"}),r.addEventListener("mousemove",function(e){o&&(p.style.width=a+e.screenX-o+"px")}),r.addEventListener("mouseup",function(e){o&&(e.stopPropagation(),e.stopImmediatePropagation(),o=!1,a=!1,m())}),r.addEventListener("keydown",function(e){switch(e.key){case"ArrowRight":e.preventDefault(),p.style.width=p.clientWidth+r.clientWidth/100+"px";break;case"ArrowLeft":e.preventDefault(),p.style.width=p.clientWidth-r.clientWidth/100+"px";break;case"Tab":case"Enter":m();break;case"Escape":s()}}),r.addEventListener("blur",function(){s()}),p},tickCross:function(e,t,i,s,n){var o=e.getValue(),a=document.createElement("input"),r=n.tristate,l=void 0===n.indeterminateValue?null:n.indeterminateValue,h=!1,c=Object.keys(n).includes("trueValue"),d=Object.keys(n).includes("falseValue");if(a.setAttribute("type","checkbox"),a.style.marginTop="5px",a.style.boxSizing="border-box",n.elementAttributes&&"object"==typeof n.elementAttributes)for(let e in n.elementAttributes)"+"==e.charAt(0)?(e=e.slice(1),a.setAttribute(e,a.getAttribute(e)+n.elementAttributes["+"+e])):a.setAttribute(e,n.elementAttributes[e]);function u(e){var t=a.checked;return c&&t?t=n.trueValue:d&&!t&&(t=n.falseValue),r?e?h?l:t:a.checked&&!h?(a.checked=!1,a.indeterminate=!0,h=!0,l):(h=!1,t):t}return a.value=o,!r||void 0!==o&&o!==l&&""!==o||(h=!0,a.indeterminate=!0),"firefox"!=this.table.browser&&"safari"!=this.table.browser&&t(function(){"cell"===e.getType()&&a.focus({preventScroll:!0})}),a.checked=c?o===n.trueValue:!0===o||"true"===o||"True"===o||1===o,a.addEventListener("change",function(e){i(u())}),a.addEventListener("blur",function(e){i(u(!0))}),a.addEventListener("keydown",function(e){"Enter"==e.key&&i(u()),"Escape"==e.key&&s()}),a},adaptable:function(e,t,i,s,n){var o,a,r=e._getSelf().column;return o=n.editorLookup?n.editorLookup(e):function(e){var t=e.getValue(),i="input";switch(typeof t){case"number":i="number";break;case"boolean":i="tickCross";break;case"string":t.includes("\n")&&(i="textarea")}return i}(e),n.paramsLookup&&(a="function"==typeof n.paramsLookup?n.paramsLookup(o,e):n.paramsLookup[o]),this.table.modules.edit.lookupEditor(o,r).call(this,e,t,i,s,a||{})}};class _r extends Ga{static moduleName="edit";static editors=wr;constructor(e){super(e),this.currentCell=!1,this.mouseClick=!1,this.recursionBlock=!1,this.invalidEdit=!1,this.editedCells=[],this.convertEmptyValues=!1,this.editors=_r.editors,this.registerTableOption("editTriggerEvent","focus"),this.registerTableOption("editorEmptyValue"),this.registerTableOption("editorEmptyValueFunc",this.emptyValueCheck.bind(this)),this.registerColumnOption("editable"),this.registerColumnOption("editor"),this.registerColumnOption("editorParams"),this.registerColumnOption("editorEmptyValue"),this.registerColumnOption("editorEmptyValueFunc"),this.registerColumnOption("cellEditing"),this.registerColumnOption("cellEdited"),this.registerColumnOption("cellEditCancelled"),this.registerTableFunction("getEditedCells",this.getEditedCells.bind(this)),this.registerTableFunction("clearCellEdited",this.clearCellEdited.bind(this)),this.registerTableFunction("navigatePrev",this.navigatePrev.bind(this)),this.registerTableFunction("navigateNext",this.navigateNext.bind(this)),this.registerTableFunction("navigateLeft",this.navigateLeft.bind(this)),this.registerTableFunction("navigateRight",this.navigateRight.bind(this)),this.registerTableFunction("navigateUp",this.navigateUp.bind(this)),this.registerTableFunction("navigateDown",this.navigateDown.bind(this)),this.registerComponentFunction("cell","isEdited",this.cellIsEdited.bind(this)),this.registerComponentFunction("cell","clearEdited",this.clearEdited.bind(this)),this.registerComponentFunction("cell","edit",this.editCell.bind(this)),this.registerComponentFunction("cell","cancelEdit",this.cellCancelEdit.bind(this)),this.registerComponentFunction("cell","navigatePrev",this.navigatePrev.bind(this)),this.registerComponentFunction("cell","navigateNext",this.navigateNext.bind(this)),this.registerComponentFunction("cell","navigateLeft",this.navigateLeft.bind(this)),this.registerComponentFunction("cell","navigateRight",this.navigateRight.bind(this)),this.registerComponentFunction("cell","navigateUp",this.navigateUp.bind(this)),this.registerComponentFunction("cell","navigateDown",this.navigateDown.bind(this))}initialize(){this.subscribe("cell-init",this.bindEditor.bind(this)),this.subscribe("cell-delete",this.clearEdited.bind(this)),this.subscribe("cell-value-changed",this.updateCellClass.bind(this)),this.subscribe("column-layout",this.initializeColumnCheck.bind(this)),this.subscribe("column-delete",this.columnDeleteCheck.bind(this)),this.subscribe("row-deleting",this.rowDeleteCheck.bind(this)),this.subscribe("row-layout",this.rowEditableCheck.bind(this)),this.subscribe("data-refreshing",this.cancelEdit.bind(this)),this.subscribe("clipboard-paste",this.pasteBlocker.bind(this)),this.confirm("edit-nav-disabled")||(this.subscribe("keybinding-nav-prev",this.navigatePrev.bind(this,void 0)),this.subscribe("keybinding-nav-next",this.keybindingNavigateNext.bind(this)),this.subscribe("keybinding-nav-up",this.navigateUp.bind(this,void 0)),this.subscribe("keybinding-nav-down",this.navigateDown.bind(this,void 0))),this.subscribe("edit-check-editing",this.checkEditing.bind(this)),this.subscribe("edit-cancel-cell",this.cancelEditEvent.bind(this)),Object.keys(this.table.options).includes("editorEmptyValue")&&(this.convertEmptyValues=!0)}pasteBlocker(e){if(this.currentCell)return!0}keybindingNavigateNext(e){var t=this.currentCell,i=this.options("tabEndNewRow");t&&(this.navigateNext(t,e)||i&&(t.getElement().firstChild.blur(),this.invalidEdit||(i=!0===i?this.table.addRow({}):"function"==typeof i?this.table.addRow(i(t.row.getComponent())):this.table.addRow(Object.assign({},i))).then(()=>{setTimeout(()=>{t.getComponent().navigateNext()})})))}cellIsEdited(e){return!!e.modules.edit&&e.modules.edit.edited}cellCancelEdit(e){e===this.currentCell?this.table.modules.edit.cancelEdit():console.warn("Cancel Editor Error - This cell is not currently being edited ")}updateCellClass(e){this.allowEdit(e)?e.getElement().classList.add("tabulator-editable"):e.getElement().classList.remove("tabulator-editable")}clearCellEdited(e){e||(e=this.table.modules.edit.getEditedCells()),Array.isArray(e)||(e=[e]),e.forEach(e=>{this.table.modules.edit.clearEdited(e._getSelf())})}navigatePrev(e=this.currentCell,t){var i,s;if(e){if(t&&t.preventDefault(),i=this.navigateLeft())return!0;if((s=this.table.rowManager.prevDisplayRow(e.row,!0))&&(i=this.findPrevEditableCell(s,s.cells.length)))return i.getComponent().edit(),!0}return!1}navigateNext(e=this.currentCell,t){var i,s;if(e){if(t&&t.preventDefault(),i=this.navigateRight())return!0;if((s=this.table.rowManager.nextDisplayRow(e.row,!0))&&(i=this.findNextEditableCell(s,-1)))return i.getComponent().edit(),!0}return!1}navigateLeft(e=this.currentCell,t){var i,s;return!!(e&&(t&&t.preventDefault(),i=e.getIndex(),s=this.findPrevEditableCell(e.row,i)))&&(s.getComponent().edit(),!0)}navigateRight(e=this.currentCell,t){var i,s;return!!(e&&(t&&t.preventDefault(),i=e.getIndex(),s=this.findNextEditableCell(e.row,i)))&&(s.getComponent().edit(),!0)}navigateUp(e=this.currentCell,t){var i,s;return!!(e&&(t&&t.preventDefault(),i=e.getIndex(),s=this.table.rowManager.prevDisplayRow(e.row,!0)))&&(s.cells[i].getComponent().edit(),!0)}navigateDown(e=this.currentCell,t){var i,s;return!!(e&&(t&&t.preventDefault(),i=e.getIndex(),s=this.table.rowManager.nextDisplayRow(e.row,!0)))&&(s.cells[i].getComponent().edit(),!0)}findNextEditableCell(e,t){var i=!1;if(t<e.cells.length-1)for(var s=t+1;s<e.cells.length;s++){let t=e.cells[s];if(t.column.modules.edit&&Va.elVisible(t.getElement())&&this.allowEdit(t)){i=t;break}}return i}findPrevEditableCell(e,t){var i=!1;if(t>0)for(var s=t-1;s>=0;s--){let t=e.cells[s];if(t.column.modules.edit&&Va.elVisible(t.getElement())&&this.allowEdit(t)){i=t;break}}return i}initializeColumnCheck(e){void 0!==e.definition.editor&&this.initializeColumn(e)}columnDeleteCheck(e){this.currentCell&&this.currentCell.column===e&&this.cancelEdit()}rowDeleteCheck(e){this.currentCell&&this.currentCell.row===e&&this.cancelEdit()}rowEditableCheck(e){e.getCells().forEach(e=>{e.column.modules.edit&&"function"==typeof e.column.modules.edit.check&&this.updateCellClass(e)})}initializeColumn(e){var t=Object.keys(e.definition).includes("editorEmptyValue"),i={editor:!1,blocked:!1,check:e.definition.editable,params:e.definition.editorParams||{},convertEmptyValues:t,editorEmptyValue:e.definition.editorEmptyValue,editorEmptyValueFunc:e.definition.editorEmptyValueFunc};i.editor=this.lookupEditor(e.definition.editor,e),i.editor&&(e.modules.edit=i)}lookupEditor(e,t){var i;switch(typeof e){case"string":this.editors[e]?i=this.editors[e]:console.warn("Editor Error - No such editor found: ",e);break;case"function":i=e;break;case"boolean":!0===e&&("function"!=typeof t.definition.formatter?i=this.editors[t.definition.formatter]?this.editors[t.definition.formatter]:this.editors.input:console.warn("Editor Error - Cannot auto lookup editor for a custom formatter: ",t.definition.formatter))}return i}getCurrentCell(){return!!this.currentCell&&this.currentCell.getComponent()}checkEditing(){return!!this.currentCell}cancelEditEvent(){return!!this.currentCell&&(this.cancelEdit(),!0)}clearEditor(e){var t,i=this.currentCell;if(this.invalidEdit=!1,i){for(this.currentCell=!1,t=i.getElement(),this.dispatch("edit-editor-clear",i,e),t.classList.remove("tabulator-editing");t.firstChild;)t.removeChild(t.firstChild);i.row.getElement().classList.remove("tabulator-editing"),i.table.element.classList.remove("tabulator-editing")}}cancelEdit(){if(this.currentCell){var e=this.currentCell,t=this.currentCell.getComponent();this.clearEditor(!0),e.setValueActual(e.getValue()),e.cellRendered(),("textarea"==e.column.definition.editor||e.column.definition.variableHeight)&&e.row.normalizeHeight(!0),e.column.definition.cellEditCancelled&&e.column.definition.cellEditCancelled.call(this.table,t),this.dispatch("edit-cancelled",e),this.dispatchExternal("cellEditCancelled",t)}}bindEditor(e){if(e.column.modules.edit){var t=this,i=e.getElement(!0);this.updateCellClass(e),i.setAttribute("tabindex",0),i.addEventListener("mousedown",function(e){2===e.button?e.preventDefault():t.mouseClick=!0}),"dblclick"===this.options("editTriggerEvent")&&i.addEventListener("dblclick",function(s){i.classList.contains("tabulator-editing")||(i.focus({preventScroll:!0}),t.edit(e,s,!1))}),"focus"!==this.options("editTriggerEvent")&&"click"!==this.options("editTriggerEvent")||i.addEventListener("click",function(s){i.classList.contains("tabulator-editing")||(i.focus({preventScroll:!0}),t.edit(e,s,!1))}),"focus"===this.options("editTriggerEvent")&&i.addEventListener("focus",function(i){t.recursionBlock||t.edit(e,i,!1)})}}focusCellNoEvent(e,t){this.recursionBlock=!0,t&&"ie"===this.table.browser||e.getElement().focus({preventScroll:!0}),this.recursionBlock=!1}editCell(e,t){this.focusCellNoEvent(e),this.edit(e,!1,t)}focusScrollAdjust(e){if("virtual"==this.table.rowManager.getRenderMode()){var t=this.table.rowManager.element.scrollTop,i=this.table.rowManager.element.clientHeight+this.table.rowManager.element.scrollTop,s=e.row.getElement();s.offsetTop<t?this.table.rowManager.element.scrollTop-=t-s.offsetTop:s.offsetTop+s.offsetHeight>i&&(this.table.rowManager.element.scrollTop+=s.offsetTop+s.offsetHeight-i);var n=this.table.rowManager.element.scrollLeft,o=this.table.rowManager.element.clientWidth+this.table.rowManager.element.scrollLeft,a=e.getElement();this.table.modExists("frozenColumns")&&(n+=parseInt(this.table.modules.frozenColumns.leftMargin||0),o-=parseInt(this.table.modules.frozenColumns.rightMargin||0)),"virtual"===this.table.options.renderHorizontal&&(n-=parseInt(this.table.columnManager.renderer.vDomPadLeft),o-=parseInt(this.table.columnManager.renderer.vDomPadLeft)),a.offsetLeft<n?this.table.rowManager.element.scrollLeft-=n-a.offsetLeft:a.offsetLeft+a.offsetWidth>o&&(this.table.rowManager.element.scrollLeft+=a.offsetLeft+a.offsetWidth-o)}}allowEdit(e){var t=!!e.column.modules.edit;if(e.column.modules.edit)switch(typeof e.column.modules.edit.check){case"function":e.row.initialized&&(t=e.column.modules.edit.check(e.getComponent()));break;case"string":t=!!e.row.data[e.column.modules.edit.check];break;case"boolean":t=e.column.modules.edit.check}return t}edit(e,t,i){var s,n,o,a=this,r=function(){},l=e.getElement(),h=!1;if(!this.currentCell){if(e.column.modules.edit.blocked)return this.mouseClick=!1,this.blur(l),!1;if(this.allowEdit(e)||i){if(t&&t.stopPropagation(),a.cancelEdit(),a.currentCell=e,this.focusScrollAdjust(e),n=e.getComponent(),this.mouseClick&&(this.mouseClick=!1,e.column.definition.cellClick&&e.column.definition.cellClick.call(this.table,t,n)),e.column.definition.cellEditing&&e.column.definition.cellEditing.call(this.table,n),this.dispatch("cell-editing",e),this.dispatchExternal("cellEditing",n),o="function"==typeof e.column.modules.edit.params?e.column.modules.edit.params(n):e.column.modules.edit.params,s=e.column.modules.edit.editor.call(a,n,function(e){r=e},function(t){if(a.currentCell===e&&!h){var i=a.chain("edit-success",[e,t],!0,!0);return!0===i||"highlight"===a.table.options.validationMode?(h=!0,a.clearEditor(),e.modules.edit||(e.modules.edit={}),e.modules.edit.edited=!0,-1==a.editedCells.indexOf(e)&&a.editedCells.push(e),t=a.transformEmptyValues(t,e),e.setValue(t,!0),!0===i):(h=!0,a.invalidEdit=!0,a.focusCellNoEvent(e,!0),r(),setTimeout(()=>{h=!1},10),!1)}},function(){a.currentCell!==e||h||a.cancelEdit()},o),!this.currentCell||!1===s)return this.blur(l),!1;if(!(s instanceof Node))return console.warn("Edit Error - Editor should return an instance of Node, the editor returned:",s),this.blur(l),!1;for(l.classList.add("tabulator-editing"),e.row.getElement().classList.add("tabulator-editing"),e.table.element.classList.add("tabulator-editing");l.firstChild;)l.removeChild(l.firstChild);l.appendChild(s),r();for(var c=l.children,d=0;d<c.length;d++)c[d].addEventListener("click",function(e){e.stopPropagation()});return!0}return this.mouseClick=!1,this.blur(l),!1}this.invalidEdit||this.currentCell===e||this.cancelEdit()}emptyValueCheck(e){return""===e||null==e}transformEmptyValues(e,t){var i,s=t.column.modules.edit;return(s.convertEmptyValues||this.convertEmptyValues)&&(i=s.editorEmptyValueFunc||this.options("editorEmptyValueFunc"))&&i(e)&&(e=s.convertEmptyValues?s.editorEmptyValue:this.options("editorEmptyValue")),e}blur(e){this.confirm("edit-blur",[e])||e.blur()}getEditedCells(){var e=[];return this.editedCells.forEach(t=>{e.push(t.getComponent())}),e}clearEdited(e){var t;e.modules.edit&&e.modules.edit.edited&&(e.modules.edit.edited=!1,this.dispatch("edit-edited-clear",e)),(t=this.editedCells.indexOf(e))>-1&&this.editedCells.splice(t,1)}}class yr{constructor(e,t,i,s){this.type=e,this.columns=t,this.component=i||!1,this.indent=s||0}}class xr{constructor(e,t,i,s,n){this.value=e,this.component=t||!1,this.width=i,this.height=s,this.depth=n}}var Cr={},kr={visible:function(){return this.rowManager.getVisibleRows(!1,!0)},all:function(){return this.rowManager.rows},selected:function(){return this.modules.selectRow.selectedRows},active:function(){return this.options.pagination?this.rowManager.getDisplayRows(this.rowManager.displayRows.length-2):this.rowManager.getDisplayRows()}};class Er extends Ga{static moduleName="export";static columnLookups=Cr;static rowLookups=kr;constructor(e){super(e),this.config={},this.cloneTableStyle=!0,this.colVisProp="",this.colVisPropAttach="",this.registerTableOption("htmlOutputConfig",!1),this.registerColumnOption("htmlOutput"),this.registerColumnOption("titleHtmlOutput")}initialize(){this.registerTableFunction("getHtml",this.getHtml.bind(this))}generateExportList(e,t,i,s){var n,o,a,r;return this.cloneTableStyle=t,this.config=e||{},this.colVisProp=s,this.colVisPropAttach=this.colVisProp.charAt(0).toUpperCase()+this.colVisProp.slice(1),(r=Er.columnLookups[i])&&(a=(a=r.call(this.table)).filter(e=>this.columnVisCheck(e))),n=!1!==this.config.columnHeaders?this.headersToExportRows(this.generateColumnGroupHeaders(a)):[],a&&(a=a.map(e=>e.getComponent())),o=this.bodyToExportRows(this.rowLookup(i),a),n.concat(o)}generateTable(e,t,i,s){var n=this.generateExportList(e,t,i,s);return this.generateTableElement(n)}rowLookup(e){var t,i=[];return"function"==typeof e?e.call(this.table).forEach(e=>{(e=this.table.rowManager.findRow(e))&&i.push(e)}):(t=Er.rowLookups[e]||Er.rowLookups.active,i=t.call(this.table)),Object.assign([],i)}generateColumnGroupHeaders(e){var t=[];return e||(e=!1!==this.config.columnGroups?this.table.columnManager.columns:this.table.columnManager.columnsByIndex),e.forEach(e=>{var i=this.processColumnGroup(e);i&&t.push(i)}),t}processColumnGroup(e){var t=e.columns,i=0,s={title:e.definition["title"+this.colVisPropAttach]||e.definition.title,column:e,depth:1};if(t.length){if(s.subGroups=[],s.width=0,t.forEach(e=>{var t=this.processColumnGroup(e);t&&(s.width+=t.width,s.subGroups.push(t),t.depth>i&&(i=t.depth))}),s.depth+=i,!s.width)return!1}else{if(!this.columnVisCheck(e))return!1;s.width=1}return s}columnVisCheck(e){var t=e.definition[this.colVisProp];return(!1!==this.config.rowHeaders||!e.isRowHeader)&&("function"==typeof t&&(t=t.call(this.table,e.getComponent())),!1===t||!0===t?t:e.visible&&e.field)}headersToExportRows(e){var t=[],i=0,s=[];function n(e,s){var o=i-s;if(void 0===t[s]&&(t[s]=[]),e.height=e.subGroups?1:o-e.depth+1,t[s].push(e),e.height>1)for(let i=1;i<e.height;i++)void 0===t[s+i]&&(t[s+i]=[]),t[s+i].push(!1);if(e.width>1)for(let i=1;i<e.width;i++)t[s].push(!1);e.subGroups&&e.subGroups.forEach(function(e){n(e,s+1)})}return e.forEach(function(e){e.depth>i&&(i=e.depth)}),e.forEach(function(e){n(e,0)}),t.forEach(e=>{var t=[];e.forEach(e=>{if(e){let i=void 0===e.title?"":e.title;t.push(new xr(i,e.column.getComponent(),e.width,e.height,e.depth))}else t.push(null)}),s.push(new yr("header",t))}),s}bodyToExportRows(e,t=[]){var i=[];return 0===t.length&&this.table.columnManager.columnsByIndex.forEach(e=>{this.columnVisCheck(e)&&t.push(e.getComponent())}),!1!==this.config.columnCalcs&&this.table.modExists("columnCalcs")&&(this.table.modules.columnCalcs.topInitialized&&e.unshift(this.table.modules.columnCalcs.topRow),this.table.modules.columnCalcs.botInitialized&&e.push(this.table.modules.columnCalcs.botRow)),(e=e.filter(e=>{switch(e.type){case"group":return!1!==this.config.rowGroups;case"calc":return!1!==this.config.columnCalcs;case"row":return!(this.table.options.dataTree&&!1===this.config.dataTree&&e.modules.dataTree.parent)}return!0})).forEach((e,s)=>{var n=e.getData(this.colVisProp),o=[],a=0;switch(e.type){case"group":a=e.level,o.push(new xr(e.key,e.getComponent(),t.length,1));break;case"calc":case"row":t.forEach(e=>{o.push(new xr(e._column.getFieldValue(n),e,1,1))}),this.table.options.dataTree&&!1!==this.config.dataTree&&(a=e.modules.dataTree.index)}i.push(new yr(e.type,o,e.getComponent(),a))}),i}generateTableElement(e){var t=document.createElement("table"),i=document.createElement("thead"),s=document.createElement("tbody"),n=this.lookupTableStyles(),o=this.table.options["rowFormatter"+this.colVisPropAttach],a={};return a.rowFormatter=null!==o?o:this.table.options.rowFormatter,this.table.options.dataTree&&!1!==this.config.dataTree&&this.table.modExists("columnCalcs")&&(a.treeElementField=this.table.modules.dataTree.elementField),a.groupHeader=this.table.options["groupHeader"+this.colVisPropAttach],a.groupHeader&&!Array.isArray(a.groupHeader)&&(a.groupHeader=[a.groupHeader]),t.classList.add("tabulator-print-table"),this.mapElementStyles(this.table.columnManager.getHeadersElement(),i,["border-top","border-left","border-right","border-bottom","background-color","color","font-weight","font-family","font-size"]),e.length>1e3&&console.warn("It may take a long time to render an HTML table with more than 1000 rows"),e.forEach((e,t)=>{let o;switch(e.type){case"header":i.appendChild(this.generateHeaderElement(e,a,n));break;case"group":s.appendChild(this.generateGroupElement(e,a,n));break;case"calc":s.appendChild(this.generateCalcElement(e,a,n));break;case"row":o=this.generateRowElement(e,a,n),this.mapElementStyles(t%2&&n.evenRow?n.evenRow:n.oddRow,o,["border-top","border-left","border-right","border-bottom","color","font-weight","font-family","font-size","background-color"]),s.appendChild(o)}}),i.innerHTML&&t.appendChild(i),t.appendChild(s),this.mapElementStyles(this.table.element,t,["border-top","border-left","border-right","border-bottom"]),t}lookupTableStyles(){var e={};return this.cloneTableStyle&&window.getComputedStyle&&(e.oddRow=this.table.element.querySelector(".tabulator-row-odd:not(.tabulator-group):not(.tabulator-calcs)"),e.evenRow=this.table.element.querySelector(".tabulator-row-even:not(.tabulator-group):not(.tabulator-calcs)"),e.calcRow=this.table.element.querySelector(".tabulator-row.tabulator-calcs"),e.firstRow=this.table.element.querySelector(".tabulator-row:not(.tabulator-group):not(.tabulator-calcs)"),e.firstGroup=this.table.element.getElementsByClassName("tabulator-group")[0],e.firstRow&&(e.styleCells=e.firstRow.getElementsByClassName("tabulator-cell"),e.styleRowHeader=e.firstRow.getElementsByClassName("tabulator-row-header")[0],e.firstCell=e.styleCells[0],e.lastCell=e.styleCells[e.styleCells.length-1])),e}generateHeaderElement(e,t,i){var s=document.createElement("tr");return e.columns.forEach(e=>{if(e){var t=document.createElement("th"),i=e.component._column.definition.cssClass?e.component._column.definition.cssClass.split(" "):[];t.colSpan=e.width,t.rowSpan=e.height,t.innerHTML=e.value,this.cloneTableStyle&&(t.style.boxSizing="border-box"),i.forEach(function(e){t.classList.add(e)}),this.mapElementStyles(e.component.getElement(),t,["text-align","border-left","border-right","background-color","color","font-weight","font-family","font-size"]),this.mapElementStyles(e.component._column.contentElement,t,["padding-top","padding-left","padding-right","padding-bottom"]),e.component._column.visible?this.mapElementStyles(e.component.getElement(),t,["width"]):e.component._column.definition.width&&(t.style.width=e.component._column.definition.width+"px"),e.component._column.parent&&e.component._column.parent.isGroup?this.mapElementStyles(e.component._column.parent.groupElement,t,["border-top"]):this.mapElementStyles(e.component.getElement(),t,["border-top"]),e.component._column.isGroup?this.mapElementStyles(e.component.getElement(),t,["border-bottom"]):this.mapElementStyles(this.table.columnManager.getElement(),t,["border-bottom"]),s.appendChild(t)}}),s}generateGroupElement(e,t,i){var s=document.createElement("tr"),n=document.createElement("td"),o=e.columns[0];return s.classList.add("tabulator-print-table-row"),t.groupHeader&&t.groupHeader[e.indent]?o.value=t.groupHeader[e.indent](o.value,e.component._group.getRowCount(),e.component._group.getData(),e.component):!1!==t.groupHeader&&(o.value=e.component._group.generator(o.value,e.component._group.getRowCount(),e.component._group.getData(),e.component)),n.colSpan=o.width,n.innerHTML=o.value,s.classList.add("tabulator-print-table-group"),s.classList.add("tabulator-group-level-"+e.indent),o.component.isVisible()&&s.classList.add("tabulator-group-visible"),this.mapElementStyles(i.firstGroup,s,["border-top","border-left","border-right","border-bottom","color","font-weight","font-family","font-size","background-color"]),this.mapElementStyles(i.firstGroup,n,["padding-top","padding-left","padding-right","padding-bottom"]),s.appendChild(n),s}generateCalcElement(e,t,i){var s=this.generateRowElement(e,t,i);return s.classList.add("tabulator-print-table-calcs"),this.mapElementStyles(i.calcRow,s,["border-top","border-left","border-right","border-bottom","color","font-weight","font-family","font-size","background-color"]),s}generateRowElement(e,t,i){var s=document.createElement("tr");return s.classList.add("tabulator-print-table-row"),e.columns.forEach((n,o)=>{if(n){var a,r,l=document.createElement("td"),h=n.component._column,c=this.table,d=c.columnManager.findColumnIndex(h),u=n.value,p={modules:{},getValue:function(){return u},getField:function(){return h.definition.field},getElement:function(){return l},getType:function(){return"cell"},getColumn:function(){return h.getComponent()},getData:function(){return e.component.getData()},getRow:function(){return e.component},getTable:function(){return c},getComponent:function(){return p},column:h};if((h.definition.cssClass?h.definition.cssClass.split(" "):[]).forEach(function(e){l.classList.add(e)}),this.table.modExists("format")&&!1!==this.config.formatCells)u=this.table.modules.format.formatExportValue(p,this.colVisProp);else switch(typeof u){case"object":u=null!==u?JSON.stringify(u):"";break;case"undefined":u=""}u instanceof Node?l.appendChild(u):l.innerHTML=u,r=["padding-top","padding-left","padding-right","padding-bottom","border-top","border-left","border-right","border-bottom","color","font-weight","font-family","font-size","text-align"],h.isRowHeader?(a=i.styleRowHeader,r.push("background-color")):a=i.styleCells&&i.styleCells[d]?i.styleCells[d]:i.firstCell,a&&(this.mapElementStyles(a,l,r),h.definition.align&&(l.style.textAlign=h.definition.align)),this.table.options.dataTree&&!1!==this.config.dataTree&&(t.treeElementField&&t.treeElementField==h.field||!t.treeElementField&&0==o)&&(e.component._row.modules.dataTree.controlEl&&l.insertBefore(e.component._row.modules.dataTree.controlEl.cloneNode(!0),l.firstChild),e.component._row.modules.dataTree.branchEl&&l.insertBefore(e.component._row.modules.dataTree.branchEl.cloneNode(!0),l.firstChild)),s.appendChild(l),p.modules.format&&p.modules.format.renderedCallback&&p.modules.format.renderedCallback()}}),t.rowFormatter&&"row"===e.type&&!1!==this.config.formatCells&&(Object.assign(e.component).getElement=function(){return s},t.rowFormatter(e.component)),s}generateHTMLTable(e){var t=document.createElement("div");return t.appendChild(this.generateTableElement(e)),t.innerHTML}getHtml(e,t,i,s){var n=this.generateExportList(i||this.table.options.htmlOutputConfig,t,e,s||"htmlOutput");return this.generateHTMLTable(n)}mapElementStyles(e,t,i){if(this.cloneTableStyle&&e&&t){var s={"background-color":"backgroundColor",color:"fontColor",width:"width","font-weight":"fontWeight","font-family":"fontFamily","font-size":"fontSize","text-align":"textAlign","border-top":"borderTop","border-left":"borderLeft","border-right":"borderRight","border-bottom":"borderBottom","padding-top":"paddingTop","padding-left":"paddingLeft","padding-right":"paddingRight","padding-bottom":"paddingBottom"};if(window.getComputedStyle){var n=window.getComputedStyle(e);i.forEach(function(e){t.style[s[e]]||(t.style[s[e]]=n.getPropertyValue(e))})}}}}var Rr={"=":function(e,t,i,s){return t==e},"<":function(e,t,i,s){return t<e},"<=":function(e,t,i,s){return t<=e},">":function(e,t,i,s){return t>e},">=":function(e,t,i,s){return t>=e},"!=":function(e,t,i,s){return t!=e},regex:function(e,t,i,s){return"string"==typeof e&&(e=new RegExp(e)),e.test(t)},like:function(e,t,i,s){return null==e?t===e:null!=t&&String(t).toLowerCase().indexOf(e.toLowerCase())>-1},keywords:function(e,t,i,s){var n=e.toLowerCase().split(void 0===s.separator?" ":s.separator),o=String(t??"").toLowerCase(),a=[];return n.forEach(e=>{o.includes(e)&&a.push(!0)}),s.matchAll?a.length===n.length:!!a.length},starts:function(e,t,i,s){return null==e?t===e:null!=t&&String(t).toLowerCase().startsWith(e.toLowerCase())},ends:function(e,t,i,s){return null==e?t===e:null!=t&&String(t).toLowerCase().endsWith(e.toLowerCase())},in:function(e,t,i,s){return Array.isArray(e)?!e.length||e.indexOf(t)>-1:(console.warn("Filter Error - filter value is not an array:",e),!1)},smart:function(e,t,i,s){const n=e.trim();if("."===n)return!(null===t||""==t);if("!"===n)return null===t||""==t;if(0===n.indexOf("<="))return this["<="](parseFloat(n.substring(2)),t,i,s);if(0===n.indexOf(">="))return this[">="](parseFloat(n.substring(2)),t,i,s);if(0===n.indexOf("<"))return this["<"](parseFloat(n.substring(1)),t,i,s);if(0===n.indexOf(">"))return this[">"](parseFloat(n.substring(1)),t,i,s);if(0===n.indexOf("="))return this["="](n.substring(1).trim(),t,i,s);if(n.includes(" ")){const e=n.split(/\s+/).filter(e=>e.length>0);if(e.length>1){const n=e.join(" AND ");return this.smarter(n,t,i,s)}}return this.like(n,t,i,s)},smarter:function(e,t,i,s){const n=e.trim();if(!n)return!0;const o=n.split(/\s+(AND|OR)\s+/i);if(1===o.length)return this.smart(n,t,i,s);let a=null,r=null;for(let e=0;e<o.length;e++){const n=o[e].trim();if("AND"===n||"OR"===n){r=n;continue}const l=this.smart(n,t,i,s);null===a?a=l:"AND"===r?a=a&&l:"OR"===r&&(a=a||l)}return null===a||a}};class Mr extends Ga{static moduleName="filter";static filters=Rr;constructor(e){super(e),this.filterList=[],this.headerFilters={},this.headerFilterColumns=[],this.prevHeaderFilterChangeCheck="",this.prevHeaderFilterChangeCheck="{}",this.changed=!1,this.tableInitialized=!1,this.registerTableOption("filterMode","local"),this.registerTableOption("initialFilter",!1),this.registerTableOption("initialHeaderFilter",!1),this.registerTableOption("headerFilterLiveFilterDelay",300),this.registerTableOption("placeholderHeaderFilter",!1),this.registerColumnOption("headerFilter"),this.registerColumnOption("headerFilterPlaceholder"),this.registerColumnOption("headerFilterParams"),this.registerColumnOption("headerFilterEmptyCheck"),this.registerColumnOption("headerFilterFunc"),this.registerColumnOption("headerFilterFuncParams"),this.registerColumnOption("headerFilterLiveFilter"),this.registerTableFunction("searchRows",this.searchRows.bind(this)),this.registerTableFunction("searchData",this.searchData.bind(this)),this.registerTableFunction("setFilter",this.userSetFilter.bind(this)),this.registerTableFunction("refreshFilter",this.userRefreshFilter.bind(this)),this.registerTableFunction("addFilter",this.userAddFilter.bind(this)),this.registerTableFunction("getFilters",this.getFilters.bind(this)),this.registerTableFunction("setHeaderFilterFocus",this.userSetHeaderFilterFocus.bind(this)),this.registerTableFunction("getHeaderFilterValue",this.userGetHeaderFilterValue.bind(this)),this.registerTableFunction("setHeaderFilterValue",this.userSetHeaderFilterValue.bind(this)),this.registerTableFunction("getHeaderFilters",this.getHeaderFilters.bind(this)),this.registerTableFunction("removeFilter",this.userRemoveFilter.bind(this)),this.registerTableFunction("clearFilter",this.userClearFilter.bind(this)),this.registerTableFunction("clearHeaderFilter",this.userClearHeaderFilter.bind(this)),this.registerComponentFunction("column","headerFilterFocus",this.setHeaderFilterFocus.bind(this)),this.registerComponentFunction("column","reloadHeaderFilter",this.reloadHeaderFilter.bind(this)),this.registerComponentFunction("column","getHeaderFilterValue",this.getHeaderFilterValue.bind(this)),this.registerComponentFunction("column","setHeaderFilterValue",this.setHeaderFilterValue.bind(this))}initialize(){this.subscribe("column-init",this.initializeColumnHeaderFilter.bind(this)),this.subscribe("column-width-fit-before",this.hideHeaderFilterElements.bind(this)),this.subscribe("column-width-fit-after",this.showHeaderFilterElements.bind(this)),this.subscribe("table-built",this.tableBuilt.bind(this)),this.subscribe("placeholder",this.generatePlaceholder.bind(this)),"remote"===this.table.options.filterMode&&this.subscribe("data-params",this.remoteFilterParams.bind(this)),this.registerDataHandler(this.filter.bind(this),10)}tableBuilt(){this.table.options.initialFilter&&this.setFilter(this.table.options.initialFilter),this.table.options.initialHeaderFilter&&this.table.options.initialHeaderFilter.forEach(e=>{var t=this.table.columnManager.findColumn(e.field);if(!t)return console.warn("Column Filter Error - No matching column found:",e.field),!1;this.setHeaderFilterValue(t,e.value)}),this.tableInitialized=!0}remoteFilterParams(e,t,i,s){return s.filter=this.getFilters(!0,!0),s}generatePlaceholder(e){if(this.table.options.placeholderHeaderFilter&&Object.keys(this.headerFilters).length)return this.table.options.placeholderHeaderFilter}userSetFilter(e,t,i,s){this.setFilter(e,t,i,s),this.refreshFilter()}userRefreshFilter(){this.refreshFilter()}userAddFilter(e,t,i,s){this.addFilter(e,t,i,s),this.refreshFilter()}userSetHeaderFilterFocus(e){var t=this.table.columnManager.findColumn(e);if(!t)return console.warn("Column Filter Focus Error - No matching column found:",e),!1;this.setHeaderFilterFocus(t)}userGetHeaderFilterValue(e){var t=this.table.columnManager.findColumn(e);if(t)return this.getHeaderFilterValue(t);console.warn("Column Filter Error - No matching column found:",e)}userSetHeaderFilterValue(e,t){var i=this.table.columnManager.findColumn(e);if(!i)return console.warn("Column Filter Error - No matching column found:",e),!1;this.setHeaderFilterValue(i,t)}userRemoveFilter(e,t,i){this.removeFilter(e,t,i),this.refreshFilter()}userClearFilter(e){this.clearFilter(e),this.refreshFilter()}userClearHeaderFilter(){this.clearHeaderFilter(),this.refreshFilter()}searchRows(e,t,i){return this.search("rows",e,t,i)}searchData(e,t,i){return this.search("data",e,t,i)}initializeColumnHeaderFilter(e){e.definition.headerFilter&&this.initializeColumn(e)}initializeColumn(e,t){var i=this,s=e.getField();e.modules.filter={success:function(t){var n,o="input"==e.modules.filter.tagType&&"text"==e.modules.filter.attrType||"textarea"==e.modules.filter.tagType?"partial":"match",a="",r="";if(void 0===e.modules.filter.prevSuccess||e.modules.filter.prevSuccess!==t){if(e.modules.filter.prevSuccess=t,e.modules.filter.emptyFunc(t))delete i.headerFilters[s];else{switch(e.modules.filter.value=t,typeof e.definition.headerFilterFunc){case"string":Mr.filters[e.definition.headerFilterFunc]?(a=e.definition.headerFilterFunc,n=function(i){var s=e.definition.headerFilterFuncParams||{},n=e.getFieldValue(i);return s="function"==typeof s?s(t,n,i):s,Mr.filters[e.definition.headerFilterFunc](t,n,i,s)}):console.warn("Header Filter Error - Matching filter function not found: ",e.definition.headerFilterFunc);break;case"function":a=n=function(i){var s=e.definition.headerFilterFuncParams||{},n=e.getFieldValue(i);return s="function"==typeof s?s(t,n,i):s,e.definition.headerFilterFunc(t,n,i,s)}}n||("partial"===o?(n=function(i){var s=e.getFieldValue(i);return null!=s&&String(s).toLowerCase().indexOf(String(t).toLowerCase())>-1},a="like"):(n=function(i){return e.getFieldValue(i)==t},a="=")),i.headerFilters[s]={value:t,func:n,type:a}}e.modules.filter.value=t,r=JSON.stringify(i.headerFilters),i.prevHeaderFilterChangeCheck!==r&&(i.prevHeaderFilterChangeCheck=r,i.trackChanges(),i.refreshFilter())}return!0},attrType:!1,tagType:!1,emptyFunc:!1},this.generateHeaderFilterElement(e)}generateHeaderFilterElement(e,t,i){var s,n,o,a,r,l,h,c,d=this,u=e.modules.filter.success,p=e.getField();if(e.modules.filter.value=t,e.modules.filter.headerElement&&e.modules.filter.headerElement.parentNode&&e.contentElement.removeChild(e.modules.filter.headerElement.parentNode),p){switch(e.modules.filter.emptyFunc=e.definition.headerFilterEmptyCheck||function(e){return!e&&0!==e},(s=document.createElement("div")).classList.add("tabulator-header-filter"),typeof e.definition.headerFilter){case"string":d.table.modules.edit.editors[e.definition.headerFilter]?(n=d.table.modules.edit.editors[e.definition.headerFilter],"tick"!==e.definition.headerFilter&&"tickCross"!==e.definition.headerFilter||e.definition.headerFilterEmptyCheck||(e.modules.filter.emptyFunc=function(e){return!0!==e&&!1!==e})):console.warn("Filter Error - Cannot build header filter, No such editor found: ",e.definition.editor);break;case"function":n=e.definition.headerFilter;break;case"boolean":e.modules.edit&&e.modules.edit.editor?n=e.modules.edit.editor:e.definition.formatter&&d.table.modules.edit.editors[e.definition.formatter]?(n=d.table.modules.edit.editors[e.definition.formatter],"tick"!==e.definition.formatter&&"tickCross"!==e.definition.formatter||e.definition.headerFilterEmptyCheck||(e.modules.filter.emptyFunc=function(e){return!0!==e&&!1!==e})):n=d.table.modules.edit.editors.input}if(n){if(a={getValue:function(){return void 0!==t?t:""},getField:function(){return e.definition.field},getElement:function(){return s},getColumn:function(){return e.getComponent()},getTable:()=>this.table,getType:()=>"header",getRow:function(){return{normalizeHeight:function(){}}}},h="function"==typeof(h=e.definition.headerFilterParams||{})?h.call(d.table,a):h,o=n.call(this.table.modules.edit,a,function(e){c=e},u,function(){},h),!o)return void console.warn("Filter Error - Cannot add filter to "+p+" column, editor returned a value of false");if(!(o instanceof Node))return void console.warn("Filter Error - Cannot add filter to "+p+" column, editor should return an instance of Node, the editor returned:",o);d.langBind("headerFilters|columns|"+e.definition.field,function(t){o.setAttribute("placeholder",void 0!==t&&t?t:e.definition.headerFilterPlaceholder||d.langText("headerFilters|default"))}),o.addEventListener("click",function(e){e.stopPropagation(),o.focus()}),o.addEventListener("focus",e=>{var t=this.table.columnManager.contentsElement.scrollLeft;t!==this.table.rowManager.element.scrollLeft&&(this.table.rowManager.scrollHorizontal(t),this.table.columnManager.scrollHorizontal(t))}),r=!1,l=function(e){r&&clearTimeout(r),r=setTimeout(function(){u(o.value)},d.table.options.headerFilterLiveFilterDelay)},e.modules.filter.headerElement=o,e.modules.filter.attrType=o.hasAttribute("type")?o.getAttribute("type").toLowerCase():"",e.modules.filter.tagType=o.tagName.toLowerCase(),!1!==e.definition.headerFilterLiveFilter&&("autocomplete"!==e.definition.headerFilter&&"tickCross"!==e.definition.headerFilter&&("autocomplete"!==e.definition.editor&&"tickCross"!==e.definition.editor||!0!==e.definition.headerFilter)&&(o.addEventListener("keyup",l),o.addEventListener("search",l),"number"==e.modules.filter.attrType&&o.addEventListener("change",function(e){u(o.value)}),"text"==e.modules.filter.attrType&&"ie"!==this.table.browser&&o.setAttribute("type","search")),"input"!=e.modules.filter.tagType&&"select"!=e.modules.filter.tagType&&"textarea"!=e.modules.filter.tagType||o.addEventListener("mousedown",function(e){e.stopPropagation()})),s.appendChild(o),e.contentElement.appendChild(s),i||d.headerFilterColumns.push(e),c&&c()}}else console.warn("Filter Error - Cannot add header filter, column has no field set:",e.definition.title)}hideHeaderFilterElements(){this.headerFilterColumns.forEach(function(e){e.modules.filter&&e.modules.filter.headerElement&&(e.modules.filter.headerElement.style.display="none")})}showHeaderFilterElements(){this.headerFilterColumns.forEach(function(e){e.modules.filter&&e.modules.filter.headerElement&&(e.modules.filter.headerElement.style.display="")})}setHeaderFilterFocus(e){e.modules.filter&&e.modules.filter.headerElement?e.modules.filter.headerElement.focus():console.warn("Column Filter Focus Error - No header filter set on column:",e.getField())}getHeaderFilterValue(e){if(e.modules.filter&&e.modules.filter.headerElement)return e.modules.filter.value;console.warn("Column Filter Error - No header filter set on column:",e.getField())}setHeaderFilterValue(e,t){e&&(e.modules.filter&&e.modules.filter.headerElement?(this.generateHeaderFilterElement(e,t,!0),e.modules.filter.success(t)):console.warn("Column Filter Error - No header filter set on column:",e.getField()))}reloadHeaderFilter(e){e&&(e.modules.filter&&e.modules.filter.headerElement?this.generateHeaderFilterElement(e,e.modules.filter.value,!0):console.warn("Column Filter Error - No header filter set on column:",e.getField()))}refreshFilter(){this.tableInitialized&&("remote"===this.table.options.filterMode?this.reloadData(null,!1,!1):this.refreshData(!0))}trackChanges(){this.changed=!0,this.dispatch("filter-changed")}hasChanged(){var e=this.changed;return this.changed=!1,e}setFilter(e,t,i,s){this.filterList=[],Array.isArray(e)||(e=[{field:e,type:t,value:i,params:s}]),this.addFilter(e)}addFilter(e,t,i,s){var n=!1;Array.isArray(e)||(e=[{field:e,type:t,value:i,params:s}]),e.forEach(e=>{(e=this.findFilter(e))&&(this.filterList.push(e),n=!0)}),n&&this.trackChanges()}findFilter(e){var t;if(Array.isArray(e))return this.findSubFilters(e);var i=!1;return"function"==typeof e.field?i=function(t){return e.field(t,e.type||{})}:Mr.filters[e.type]?i=(t=this.table.columnManager.getColumnByField(e.field))?function(i){return Mr.filters[e.type](e.value,t.getFieldValue(i),i,e.params||{})}:function(t){return Mr.filters[e.type](e.value,t[e.field],t,e.params||{})}:console.warn("Filter Error - No such filter type found, ignoring: ",e.type),e.func=i,!!e.func&&e}findSubFilters(e){var t=[];return e.forEach(e=>{(e=this.findFilter(e))&&t.push(e)}),!!t.length&&t}getFilters(e,t){var i=[];return e&&(i=this.getHeaderFilters()),t&&i.forEach(function(e){"function"==typeof e.type&&(e.type="function")}),i.concat(this.filtersToArray(this.filterList,t))}filtersToArray(e,t){var i=[];return e.forEach(e=>{var s;Array.isArray(e)?i.push(this.filtersToArray(e,t)):(s={field:e.field,type:e.type,value:e.value},t&&"function"==typeof s.type&&(s.type="function"),i.push(s))}),i}getHeaderFilters(){var e=[];for(var t in this.headerFilters)e.push({field:t,type:this.headerFilters[t].type,value:this.headerFilters[t].value});return e}removeFilter(e,t,i){Array.isArray(e)||(e=[{field:e,type:t,value:i}]),e.forEach(e=>{var t;(t="object"==typeof e.field?this.filterList.findIndex(t=>e===t):this.filterList.findIndex(t=>e.field===t.field&&e.type===t.type&&e.value===t.value))>-1?this.filterList.splice(t,1):console.warn("Filter Error - No matching filter type found, ignoring: ",e.type)}),this.trackChanges()}clearFilter(e){this.filterList=[],e&&this.clearHeaderFilter(),this.trackChanges()}clearHeaderFilter(){this.headerFilters={},this.prevHeaderFilterChangeCheck="{}",this.headerFilterColumns.forEach(e=>{void 0!==e.modules.filter.value&&delete e.modules.filter.value,e.modules.filter.prevSuccess=void 0,this.reloadHeaderFilter(e)}),this.trackChanges()}search(e,t,i,s){var n=[],o=[];return Array.isArray(t)||(t=[{field:t,type:i,value:s}]),t.forEach(e=>{(e=this.findFilter(e))&&o.push(e)}),this.table.rowManager.rows.forEach(t=>{var i=!0;o.forEach(e=>{this.filterRecurse(e,t.getData())||(i=!1)}),i&&n.push("data"===e?t.getData("data"):t.getComponent())}),n}filter(e,t){var i=[],s=[];return this.subscribedExternal("dataFiltering")&&this.dispatchExternal("dataFiltering",this.getFilters(!0)),"remote"!==this.table.options.filterMode&&(this.filterList.length||Object.keys(this.headerFilters).length)?e.forEach(e=>{this.filterRow(e)&&i.push(e)}):i=e.slice(0),this.subscribedExternal("dataFiltered")&&(i.forEach(e=>{s.push(e.getComponent())}),this.dispatchExternal("dataFiltered",this.getFilters(!0),s)),i}filterRow(e,t){var i=!0,s=e.getData();for(var n in this.filterList.forEach(e=>{this.filterRecurse(e,s)||(i=!1)}),this.headerFilters)this.headerFilters[n].func(s)||(i=!1);return i}filterRecurse(e,t){var i=!1;return Array.isArray(e)?e.forEach(e=>{this.filterRecurse(e,t)&&(i=!0)}):i=e.func(t),i}}var Tr={plaintext:function(e,t,i){return this.emptyToSpace(this.sanitizeHTML(e.getValue()))},html:function(e,t,i){return e.getValue()},textarea:function(e,t,i){return e.getElement().style.whiteSpace="pre-wrap",this.emptyToSpace(this.sanitizeHTML(e.getValue()))},money:function(e,t,i){var s,n,o,a,r,l=parseFloat(e.getValue()),h="",c=t.decimal||".",d=t.thousand||",",u=t.negativeSign||"-",p=t.symbol||"",m=!!t.symbolAfter,g=void 0!==t.precision?t.precision:2;if(Number.isNaN(l))return this.emptyToSpace(this.sanitizeHTML(e.getValue()));if(l<0&&(l=Math.abs(l),h=u),s=!1!==g?l.toFixed(g):l,n=(s=String(s).split("."))[0],o=s.length>1?c+s[1]:"",!1!==t.thousand)for(a=/(\d+)(\d{3})/;a.test(n);)n=n.replace(a,"$1"+d+"$2");return r=n+o,!0===h?(r="("+r+")",m?r+p:p+r):m?h+r+p:h+p+r},link:function(e,t,i){var s,n=e.getValue(),o=t.urlPrefix||"",a=t.download,r=n,l=document.createElement("a");if(t.labelField&&(s=e.getData(),r=function e(t,i){var s=i[t.shift()];return t.length&&"object"==typeof s?e(t,s):s}(t.labelField.split(this.table.options.nestedFieldSeparator),s)),t.label)switch(typeof t.label){case"string":r=t.label;break;case"function":r=t.label(e)}if(r){if(t.urlField&&(s=e.getData(),n=Va.retrieveNestedData(this.table.options.nestedFieldSeparator,t.urlField,s)),t.url)switch(typeof t.url){case"string":n=t.url;break;case"function":n=t.url(e)}return l.setAttribute("href",o+n),t.target&&l.setAttribute("target",t.target),t.download&&(a="function"==typeof a?a(e):!0===a?"":a,l.setAttribute("download",a)),l.innerHTML=this.emptyToSpace(this.sanitizeHTML(r)),l}return"&nbsp;"},image:function(e,t,i){var s=document.createElement("img"),n=e.getValue();switch(t.urlPrefix&&(n=t.urlPrefix+e.getValue()),t.urlSuffix&&(n+=t.urlSuffix),s.setAttribute("src",n),typeof t.height){case"number":s.style.height=t.height+"px";break;case"string":s.style.height=t.height}switch(typeof t.width){case"number":s.style.width=t.width+"px";break;case"string":s.style.width=t.width}return s.addEventListener("load",function(){e.getRow().normalizeHeight()}),s},tickCross:function(e,t,i){var s=e.getValue(),n=e.getElement(),o=t.allowEmpty,a=t.allowTruthy,r=Object.keys(t).includes("trueValue"),l=void 0!==t.tickElement?t.tickElement:'<svg enable-background="new 0 0 24 24" height="14" width="14" viewBox="0 0 24 24" xml:space="preserve" ><path class="tabulator-tick" clip-rule="evenodd" d="M21.652,3.211c-0.293-0.295-0.77-0.295-1.061,0L9.41,14.34  c-0.293,0.297-0.771,0.297-1.062,0L3.449,9.351C3.304,9.203,3.114,9.13,2.923,9.129C2.73,9.128,2.534,9.201,2.387,9.351  l-2.165,1.946C0.078,11.445,0,11.63,0,11.823c0,0.194,0.078,0.397,0.223,0.544l4.94,5.184c0.292,0.296,0.771,0.776,1.062,1.07  l2.124,2.141c0.292,0.293,0.769,0.293,1.062,0l14.366-14.34c0.293-0.294,0.293-0.777,0-1.071L21.652,3.211z" fill-rule="evenodd"/></svg>',h=void 0!==t.crossElement?t.crossElement:'<svg enable-background="new 0 0 24 24" height="14" width="14"  viewBox="0 0 24 24" xml:space="preserve" ><path class="tabulator-cross" d="M22.245,4.015c0.313,0.313,0.313,0.826,0,1.139l-6.276,6.27c-0.313,0.312-0.313,0.826,0,1.14l6.273,6.272  c0.313,0.313,0.313,0.826,0,1.14l-2.285,2.277c-0.314,0.312-0.828,0.312-1.142,0l-6.271-6.271c-0.313-0.313-0.828-0.313-1.141,0  l-6.276,6.267c-0.313,0.313-0.828,0.313-1.141,0l-2.282-2.28c-0.313-0.313-0.313-0.826,0-1.14l6.278-6.269  c0.313-0.312,0.313-0.826,0-1.14L1.709,5.147c-0.314-0.313-0.314-0.827,0-1.14l2.284-2.278C4.308,1.417,4.821,1.417,5.135,1.73  L11.405,8c0.314,0.314,0.828,0.314,1.141,0.001l6.276-6.267c0.312-0.312,0.826-0.312,1.141,0L22.245,4.015z"/></svg>';return r&&s===t.trueValue||!r&&(a&&s||!0===s||"true"===s||"True"===s||1===s||"1"===s)?(n.setAttribute("aria-checked",!0),l||""):!o||"null"!==s&&""!==s&&null!=s?(n.setAttribute("aria-checked",!1),h||""):(n.setAttribute("aria-checked","mixed"),"")},datetime:function(e,t,i){var s,n=this.table.dependencyRegistry.lookup(["luxon","DateTime"],"DateTime"),o=t.inputFormat||"yyyy-MM-dd HH:mm:ss",a=t.outputFormat||"dd/MM/yyyy HH:mm:ss",r=void 0!==t.invalidPlaceholder?t.invalidPlaceholder:"",l=e.getValue();if(void 0!==n)return(s=n.isDateTime(l)?l:"x"===o?n.fromMillis(l):"iso"===o?n.fromISO(String(l)):n.fromFormat(String(l),o)).isValid?(t.timezone&&(s=s.setZone(t.timezone)),s.toFormat(a)):!0!==r&&l?"function"==typeof r?r(l):r:l;console.error("Format Error - 'datetime' formatter is dependant on luxon.js")},datetimediff:function(e,t,i){var s,n=this.table.dependencyRegistry.lookup(["luxon","DateTime"],"DateTime"),o=t.inputFormat||"yyyy-MM-dd HH:mm:ss",a=void 0!==t.invalidPlaceholder?t.invalidPlaceholder:"",r=void 0!==t.suffix&&t.suffix,l=void 0!==t.unit?t.unit:"days",h=void 0!==t.humanize&&t.humanize,c=void 0!==t.date?t.date:n.now(),d=e.getValue();if(void 0!==n)return(s=n.isDateTime(d)?d:"x"===o?n.fromMillis(d):"iso"===o?n.fromISO(String(d)):n.fromFormat(String(d),o)).isValid?h?s.diff(c,l).toHuman()+(r?" "+r:""):parseInt(s.diff(c,l)[l])+(r?" "+r:""):!0===a?d:"function"==typeof a?a(d):a;console.error("Format Error - 'datetimediff' formatter is dependant on luxon.js")},lookup:function(e,t,i){var s=e.getValue();return void 0===t[s]?(console.warn("Missing display value for "+s),s):t[s]},star:function(e,t,i){var s=e.getValue(),n=e.getElement(),o=t&&t.stars?t.stars:5,a=document.createElement("span"),r=document.createElementNS("http://www.w3.org/2000/svg","svg");a.style.verticalAlign="middle",r.setAttribute("width","14"),r.setAttribute("height","14"),r.setAttribute("viewBox","0 0 512 512"),r.setAttribute("xml:space","preserve"),r.style.padding="0 1px",s=s&&!Number.isNaN(s)?parseInt(s):0,s=Math.max(0,Math.min(s,o));for(var l=1;l<=o;l++){var h=r.cloneNode(!0);h.innerHTML=l<=s?'<polygon fill="#FFEA00" stroke="#C1AB60" stroke-width="37.6152" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" points="259.216,29.942 330.27,173.919 489.16,197.007 374.185,309.08 401.33,467.31 259.216,392.612 117.104,467.31 144.25,309.08 29.274,197.007 188.165,173.919 "/>':'<polygon fill="#D2D2D2" stroke="#686868" stroke-width="37.6152" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" points="259.216,29.942 330.27,173.919 489.16,197.007 374.185,309.08 401.33,467.31 259.216,392.612 117.104,467.31 144.25,309.08 29.274,197.007 188.165,173.919 "/>',a.appendChild(h)}return n.style.whiteSpace="nowrap",n.style.overflow="hidden",n.style.textOverflow="ellipsis",n.setAttribute("aria-label",s),a},traffic:function(e,t,i){var s,n,o=this.sanitizeHTML(e.getValue())||0,a=document.createElement("span"),r=t&&t.max?t.max:100,l=t&&t.min?t.min:0,h=t&&void 0!==t.color?t.color:["red","orange","green"],c="#666666";if(!Number.isNaN(o)&&void 0!==e.getValue()){switch(a.classList.add("tabulator-traffic-light"),n=parseFloat(o)<=r?parseFloat(o):r,n=parseFloat(n)>=l?parseFloat(n):l,s=(r-l)/100,n=Math.round((n-l)/s),typeof h){case"string":c=h;break;case"function":c=h(o);break;case"object":if(Array.isArray(h)){var d=100/h.length,u=Math.floor(n/d);u=Math.min(u,h.length-1),c=h[u=Math.max(u,0)];break}}return a.style.backgroundColor=c,a}},progress:function(e,t={},i){var s,n,o,a,r,l=this.sanitizeHTML(e.getValue())||0,h=e.getElement(),c=t.max?t.max:100,d=t.min?t.min:0,u=t.legendAlign?t.legendAlign:"center";switch(n=parseFloat(l)<=c?parseFloat(l):c,n=parseFloat(n)>=d?parseFloat(n):d,s=(c-d)/100,n=Math.round((n-d)/s),typeof t.color){case"string":o=t.color;break;case"function":o=t.color(l);break;case"object":if(Array.isArray(t.color)){let e=100/t.color.length,i=Math.floor(n/e);i=Math.min(i,t.color.length-1),i=Math.max(i,0),o=t.color[i];break}default:o="#2DC214"}switch(typeof t.legend){case"string":a=t.legend;break;case"function":a=t.legend(l);break;case"boolean":a=l;break;default:a=!1}switch(typeof t.legendColor){case"string":r=t.legendColor;break;case"function":r=t.legendColor(l);break;case"object":if(Array.isArray(t.legendColor)){let e=100/t.legendColor.length,i=Math.floor(n/e);i=Math.min(i,t.legendColor.length-1),i=Math.max(i,0),r=t.legendColor[i]}break;default:r="#000"}h.style.minWidth="30px",h.style.position="relative",h.setAttribute("aria-label",n);var p=document.createElement("div");p.style.display="inline-block",p.style.width=n+"%",p.style.backgroundColor=o,p.style.height="100%",p.setAttribute("data-max",c),p.setAttribute("data-min",d);var m=document.createElement("div");if(m.style.position="relative",m.style.width="100%",m.style.height="100%",a){var g=document.createElement("div");g.style.position="absolute",g.style.top=0,g.style.left=0,g.style.textAlign=u,g.style.width="100%",g.style.color=r,g.innerHTML=a}return i(function(){if(!(e instanceof ar)){var t=document.createElement("div");t.style.position="absolute",t.style.top="4px",t.style.bottom="4px",t.style.left="4px",t.style.right="4px",h.appendChild(t),h=t}h.appendChild(m),m.appendChild(p),a&&m.appendChild(g)}),""},color:function(e,t,i){return e.getElement().style.backgroundColor=this.sanitizeHTML(e.getValue()),""},buttonTick:function(e,t,i){return'<svg enable-background="new 0 0 24 24" height="14" width="14" viewBox="0 0 24 24" xml:space="preserve" ><path fill="#2DC214" clip-rule="evenodd" d="M21.652,3.211c-0.293-0.295-0.77-0.295-1.061,0L9.41,14.34  c-0.293,0.297-0.771,0.297-1.062,0L3.449,9.351C3.304,9.203,3.114,9.13,2.923,9.129C2.73,9.128,2.534,9.201,2.387,9.351  l-2.165,1.946C0.078,11.445,0,11.63,0,11.823c0,0.194,0.078,0.397,0.223,0.544l4.94,5.184c0.292,0.296,0.771,0.776,1.062,1.07  l2.124,2.141c0.292,0.293,0.769,0.293,1.062,0l14.366-14.34c0.293-0.294,0.293-0.777,0-1.071L21.652,3.211z" fill-rule="evenodd"/></svg>'},buttonCross:function(e,t,i){return'<svg enable-background="new 0 0 24 24" height="14" width="14" viewBox="0 0 24 24" xml:space="preserve" ><path fill="#CE1515" d="M22.245,4.015c0.313,0.313,0.313,0.826,0,1.139l-6.276,6.27c-0.313,0.312-0.313,0.826,0,1.14l6.273,6.272  c0.313,0.313,0.313,0.826,0,1.14l-2.285,2.277c-0.314,0.312-0.828,0.312-1.142,0l-6.271-6.271c-0.313-0.313-0.828-0.313-1.141,0  l-6.276,6.267c-0.313,0.313-0.828,0.313-1.141,0l-2.282-2.28c-0.313-0.313-0.313-0.826,0-1.14l6.278-6.269  c0.313-0.312,0.313-0.826,0-1.14L1.709,5.147c-0.314-0.313-0.314-0.827,0-1.14l2.284-2.278C4.308,1.417,4.821,1.417,5.135,1.73  L11.405,8c0.314,0.314,0.828,0.314,1.141,0.001l6.276-6.267c0.312-0.312,0.826-0.312,1.141,0L22.245,4.015z"/></svg>'},toggle:function(e,t,i){var s,n,o=e.getValue(),a=t.size||15,r=a+"px",l=!t.hasOwnProperty("onValue")||t.onValue,h=!!t.hasOwnProperty("offValue")&&t.offValue,c=t.onTruthy?o:o===l;return(s=document.createElement("div")).classList.add("tabulator-toggle"),c?(s.classList.add("tabulator-toggle-on"),s.style.flexDirection="row-reverse",t.onColor&&(s.style.background=t.onColor)):t.offColor&&(s.style.background=t.offColor),s.style.width=2.5*a+"px",s.style.borderRadius=r,t.clickable&&s.addEventListener("click",t=>{e.setValue(c?h:l)}),(n=document.createElement("div")).classList.add("tabulator-toggle-switch"),n.style.height=r,n.style.width=r,n.style.borderRadius=r,s.appendChild(n),s},rownum:function(e,t,i){var s=document.createElement("span"),n=e.getRow(),o=e.getTable();return n.watchPosition(e=>{t.relativeToPage&&(e+=o.modules.page.getPageSize()*(o.modules.page.getPage()-1)),s.innerText=e}),s},handle:function(e,t,i){return e.getElement().classList.add("tabulator-row-handle"),"<div class='tabulator-row-handle-box'><div class='tabulator-row-handle-bar'></div><div class='tabulator-row-handle-bar'></div><div class='tabulator-row-handle-bar'></div></div>"},adaptable:function(e,t,i){var s,n;return s=t.formatterLookup?t.formatterLookup(e):function(e){var t=e.getValue(),i="plaintext";switch(typeof t){case"boolean":i="tickCross";break;case"string":t.includes("\n")&&(i="textarea")}return i}(e),t.paramsLookup&&(n="function"==typeof t.paramsLookup?t.paramsLookup(s,e):t.paramsLookup[s]),this.table.modules.format.lookupFormatter(s).call(this,e,n||{},i)},array:function(e,t,i){var s,n=t.delimiter||",",o=e.getValue(),a=this.table;return t.valueMap&&(s="string"==typeof t.valueMap?function(e){return e.map(e=>Va.retrieveNestedData(a.options.nestedFieldSeparator,t.valueMap,e))}:t.valueMap),Array.isArray(o)?(s&&(o=s(o)),o.join(n)):o},json:function(e,t,i){var s=t.indent||"\t",n=void 0===t.multiline||t.multiline,o=t.replacer||null,a=e.getValue();return n&&(e.getElement().style.whiteSpace="pre-wrap"),JSON.stringify(a,o,s)}};class Sr extends Ga{static moduleName="format";static formatters=Tr;constructor(e){super(e),this.registerColumnOption("formatter"),this.registerColumnOption("formatterParams"),this.registerColumnOption("formatterPrint"),this.registerColumnOption("formatterPrintParams"),this.registerColumnOption("formatterClipboard"),this.registerColumnOption("formatterClipboardParams"),this.registerColumnOption("formatterHtmlOutput"),this.registerColumnOption("formatterHtmlOutputParams"),this.registerColumnOption("titleFormatter"),this.registerColumnOption("titleFormatterParams")}initialize(){this.subscribe("cell-format",this.formatValue.bind(this)),this.subscribe("cell-rendered",this.cellRendered.bind(this)),this.subscribe("column-layout",this.initializeColumn.bind(this)),this.subscribe("column-format",this.formatHeader.bind(this))}initializeColumn(e){e.modules.format=this.lookupTypeFormatter(e,""),void 0!==e.definition.formatterPrint&&(e.modules.format.print=this.lookupTypeFormatter(e,"Print")),void 0!==e.definition.formatterClipboard&&(e.modules.format.clipboard=this.lookupTypeFormatter(e,"Clipboard")),void 0!==e.definition.formatterHtmlOutput&&(e.modules.format.htmlOutput=this.lookupTypeFormatter(e,"HtmlOutput"))}lookupTypeFormatter(e,t){var i={params:e.definition["formatter"+t+"Params"]||{}},s=e.definition["formatter"+t];return i.formatter=this.lookupFormatter(s),i}lookupFormatter(e){var t;switch(typeof e){case"string":Sr.formatters[e]?t=Sr.formatters[e]:(console.warn("Formatter Error - No such formatter found: ",e),t=Sr.formatters.plaintext);break;case"function":t=e;break;default:t=Sr.formatters.plaintext}return t}cellRendered(e){e.modules.format&&e.modules.format.renderedCallback&&!e.modules.format.rendered&&(e.modules.format.renderedCallback(),e.modules.format.rendered=!0)}formatHeader(e,t,i){var s,n,o,a;return e.definition.titleFormatter?(s=this.lookupFormatter(e.definition.titleFormatter),o=t=>{e.titleFormatterRendered=t},a={getValue:function(){return t},getElement:function(){return i},getType:function(){return"header"},getColumn:function(){return e.getComponent()},getTable:()=>this.table},n="function"==typeof(n=e.definition.titleFormatterParams||{})?n():n,s.call(this,a,n,o)):t}formatValue(e){var t=e.getComponent(),i="function"==typeof e.column.modules.format.params?e.column.modules.format.params(t):e.column.modules.format.params;return e.column.modules.format.formatter.call(this,t,i,function(t){e.modules.format||(e.modules.format={}),e.modules.format.renderedCallback=t,e.modules.format.rendered=!1})}formatExportValue(e,t){var i,s=e.column.modules.format[t];if(s){function n(t){e.modules.format||(e.modules.format={}),e.modules.format.renderedCallback=t,e.modules.format.rendered=!1}return i="function"==typeof s.params?s.params(e.getComponent()):s.params,s.formatter.call(this,e.getComponent(),i,n)}return this.formatValue(e)}sanitizeHTML(e){if(e){var t={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;","`":"&#x60;","=":"&#x3D;"};return String(e).replace(/[&<>"'`=/]/g,function(e){return t[e]})}return e}emptyToSpace(e){return null==e||""===e?"&nbsp;":e}}class Dr{constructor(e){return this._group=e,this.type="GroupComponent",new Proxy(this,{get:function(e,t,i){return void 0!==e[t]?e[t]:e._group.groupManager.table.componentFunctionBinder.handle("group",e._group,t)}})}getKey(){return this._group.key}getField(){return this._group.field}getElement(){return this._group.element}getRows(){return this._group.getRows(!0)}getSubGroups(){return this._group.getSubGroups(!0)}getParentGroup(){return!!this._group.parent&&this._group.parent.getComponent()}isVisible(){return this._group.visible}show(){this._group.show()}hide(){this._group.hide()}toggle(){this._group.toggleVisibility()}scrollTo(e,t){return this._group.groupManager.table.rowManager.scrollToRow(this._group,e,t)}_getSelf(){return this._group}getTable(){return this._group.groupManager.table}}class jr{constructor(e,t,i,s,n,o,a){this.groupManager=e,this.parent=t,this.key=s,this.level=i,this.field=n,this.hasSubGroups=i<e.groupIDLookups.length-1,this.addRow=this.hasSubGroups?this._addRowToGroup:this._addRow,this.type="group",this.old=a,this.rows=[],this.groups=[],this.groupList=[],this.generator=o,this.element=!1,this.elementContents=!1,this.height=0,this.outerHeight=0,this.initialized=!1,this.calcs={},this.initialized=!1,this.modules={},this.arrowElement=!1,this.visible=a?a.visible:void 0!==e.startOpen[i]?e.startOpen[i]:e.startOpen[0],this.component=null,this.createElements(),this.addBindings(),this.createValueGroups()}wipe(e){e||(this.groupList.length?this.groupList.forEach(function(e){e.wipe()}):this.rows.forEach(e=>{e.modules&&delete e.modules.group})),this.element=!1,this.arrowElement=!1,this.elementContents=!1}createElements(){var e=document.createElement("div");e.classList.add("tabulator-arrow"),this.element=document.createElement("div"),this.element.classList.add("tabulator-row"),this.element.classList.add("tabulator-group"),this.element.classList.add("tabulator-group-level-"+this.level),this.element.setAttribute("role","rowgroup"),this.arrowElement=document.createElement("div"),this.arrowElement.classList.add("tabulator-group-toggle"),this.arrowElement.appendChild(e),!1!==this.groupManager.table.options.movableRows&&this.groupManager.table.modExists("moveRow")&&this.groupManager.table.modules.moveRow.initializeGroupHeader(this)}createValueGroups(){var e=this.level+1;this.groupManager.allowedValues&&this.groupManager.allowedValues[e]&&this.groupManager.allowedValues[e].forEach(t=>{this._createGroup(t,e)})}addBindings(){this.groupManager.table.options.groupToggleElement&&("arrow"==this.groupManager.table.options.groupToggleElement?this.arrowElement:this.element).addEventListener("click",e=>{"arrow"===this.groupManager.table.options.groupToggleElement&&(e.stopPropagation(),e.stopImmediatePropagation()),setTimeout(()=>{this.toggleVisibility()})})}_createGroup(e,t){var i=t+"_"+e,s=new jr(this.groupManager,this,t,e,this.groupManager.groupIDLookups[t].field,this.groupManager.headerGenerator[t]||this.groupManager.headerGenerator[0],!!this.old&&this.old.groups[i]);this.groups[i]=s,this.groupList.push(s)}_addRowToGroup(e){var t=this.level+1;if(this.hasSubGroups){var i=this.groupManager.groupIDLookups[t].func(e.getData()),s=t+"_"+i;this.groupManager.allowedValues&&this.groupManager.allowedValues[t]?this.groups[s]&&this.groups[s].addRow(e):(this.groups[s]||this._createGroup(i,t),this.groups[s].addRow(e))}}_addRow(e){this.rows.push(e),e.modules.group=this}insertRow(e,t,i){var s=this.conformRowData({});e.updateData(s);var n=this.rows.indexOf(t);n>-1?i?this.rows.splice(n+1,0,e):this.rows.splice(n,0,e):i?this.rows.push(e):this.rows.unshift(e),e.modules.group=this,this.groupManager.table.modExists("columnCalcs")&&"table"!=this.groupManager.table.options.columnCalcs&&this.groupManager.table.modules.columnCalcs.recalcGroup(this),this.groupManager.updateGroupRows(!0)}scrollHeader(e){this.arrowElement&&(this.arrowElement.style.marginLeft=e,this.groupList.forEach(function(t){t.scrollHeader(e)}))}getRowIndex(e){}conformRowData(e){return this.field?e[this.field]=this.key:console.warn("Data Conforming Error - Cannot conform row data to match new group as groupBy is a function"),this.parent&&(e=this.parent.conformRowData(e)),e}removeRow(e){var t=this.rows.indexOf(e),i=e.getElement();t>-1&&this.rows.splice(t,1),this.groupManager.table.options.groupValues||this.rows.length?(i.parentNode&&i.parentNode.removeChild(i),this.groupManager.blockRedraw||(this.generateGroupHeaderContents(),this.groupManager.table.modExists("columnCalcs")&&"table"!=this.groupManager.table.options.columnCalcs&&this.groupManager.table.modules.columnCalcs.recalcGroup(this))):(this.parent?this.parent.removeGroup(this):this.groupManager.removeGroup(this),this.groupManager.updateGroupRows(!0))}removeGroup(e){var t,i=e.level+"_"+e.key;this.groups[i]&&(delete this.groups[i],(t=this.groupList.indexOf(e))>-1&&this.groupList.splice(t,1),this.groupList.length||(this.parent?this.parent.removeGroup(this):this.groupManager.removeGroup(this)))}getHeadersAndRows(){var e=[];return e.push(this),this._visSet(),this.calcs.top&&(this.calcs.top.detachElement(),this.calcs.top.deleteCells()),this.calcs.bottom&&(this.calcs.bottom.detachElement(),this.calcs.bottom.deleteCells()),this.visible?this.groupList.length?this.groupList.forEach(function(t){e=e.concat(t.getHeadersAndRows())}):("table"!=this.groupManager.table.options.columnCalcs&&this.groupManager.table.modExists("columnCalcs")&&this.groupManager.table.modules.columnCalcs.hasTopCalcs()&&(this.calcs.top=this.groupManager.table.modules.columnCalcs.generateTopRow(this.rows),e.push(this.calcs.top)),e=e.concat(this.rows),"table"!=this.groupManager.table.options.columnCalcs&&this.groupManager.table.modExists("columnCalcs")&&this.groupManager.table.modules.columnCalcs.hasBottomCalcs()&&(this.calcs.bottom=this.groupManager.table.modules.columnCalcs.generateBottomRow(this.rows),e.push(this.calcs.bottom))):this.groupList.length||"table"==this.groupManager.table.options.columnCalcs||this.groupManager.table.modExists("columnCalcs")&&(this.groupManager.table.modules.columnCalcs.hasTopCalcs()&&this.groupManager.table.options.groupClosedShowCalcs&&(this.calcs.top=this.groupManager.table.modules.columnCalcs.generateTopRow(this.rows),e.push(this.calcs.top)),this.groupManager.table.modules.columnCalcs.hasBottomCalcs()&&this.groupManager.table.options.groupClosedShowCalcs&&(this.calcs.bottom=this.groupManager.table.modules.columnCalcs.generateBottomRow(this.rows),e.push(this.calcs.bottom))),e}getData(e,t){var i=[];return this._visSet(),(!e||e&&this.visible)&&this.rows.forEach(e=>{i.push(e.getData(t||"data"))}),i}getRowCount(){var e=0;return this.groupList.length?this.groupList.forEach(t=>{e+=t.getRowCount()}):e=this.rows.length,e}toggleVisibility(){this.visible?this.hide():this.show()}hide(){this.visible=!1,"basic"!=this.groupManager.table.rowManager.getRenderMode()||this.groupManager.table.options.pagination||(this.element.classList.remove("tabulator-group-visible"),this.groupList.length?this.groupList.forEach(e=>{e.getHeadersAndRows().forEach(e=>{e.detachElement()})}):this.rows.forEach(e=>{var t=e.getElement();t.parentNode.removeChild(t)})),this.groupManager.updateGroupRows(!0),this.groupManager.table.externalEvents.dispatch("groupVisibilityChanged",this.getComponent(),!1)}show(){if(this.visible=!0,"basic"!=this.groupManager.table.rowManager.getRenderMode()||this.groupManager.table.options.pagination)this.groupManager.updateGroupRows(!0);else{this.element.classList.add("tabulator-group-visible");var e=this.generateElement();this.groupList.length?this.groupList.forEach(t=>{t.getHeadersAndRows().forEach(t=>{var i=t.getElement();e.parentNode.insertBefore(i,e.nextSibling),t.initialize(),e=i})}):this.rows.forEach(t=>{var i=t.getElement();e.parentNode.insertBefore(i,e.nextSibling),t.initialize(),e=i}),this.groupManager.updateGroupRows(!0)}this.groupManager.table.externalEvents.dispatch("groupVisibilityChanged",this.getComponent(),!0)}_visSet(){var e=[];"function"==typeof this.visible&&(this.rows.forEach(function(t){e.push(t.getData())}),this.visible=this.visible(this.key,this.getRowCount(),e,this.getComponent()))}getRowGroup(e){var t=!1;return this.groupList.length?this.groupList.forEach(function(i){var s=i.getRowGroup(e);s&&(t=s)}):this.rows.find(function(t){return t===e})&&(t=this),t}getSubGroups(e){var t=[];return this.groupList.forEach(function(i){t.push(e?i.getComponent():i)}),t}getRows(e,t){var i=[];return t&&this.groupList.length?this.groupList.forEach(s=>{i=i.concat(s.getRows(e,t))}):this.rows.forEach(function(t){i.push(e?t.getComponent():t)}),i}generateGroupHeaderContents(){var e=[];for(this.getRows(!1,!0).forEach(function(t){e.push(t.getData())}),this.elementContents=this.generator(this.key,this.getRowCount(),e,this.getComponent());this.element.firstChild;)this.element.removeChild(this.element.firstChild);"string"==typeof this.elementContents?this.element.innerHTML=this.elementContents:this.element.appendChild(this.elementContents),this.element.insertBefore(this.arrowElement,this.element.firstChild)}getPath(e=[]){return e.unshift(this.key),this.parent&&this.parent.getPath(e),e}getElement(){return this.elementContents?this.element:this.generateElement()}generateElement(){this.addBindings=!1,this._visSet(),this.visible?this.element.classList.add("tabulator-group-visible"):this.element.classList.remove("tabulator-group-visible");for(var e=0;e<this.element.childNodes.length;++e)this.element.childNodes[e].parentNode.removeChild(this.element.childNodes[e]);return this.generateGroupHeaderContents(),this.element}detachElement(){this.element&&this.element.parentNode&&this.element.parentNode.removeChild(this.element)}normalizeHeight(){this.setHeight(this.element.clientHeight)}initialize(e){this.initialized&&!e||(this.normalizeHeight(),this.initialized=!0)}reinitialize(){this.initialized=!1,this.height=0,Va.elVisible(this.element)&&this.initialize(!0)}setHeight(e){this.height!=e&&(this.height=e,this.outerHeight=this.element.offsetHeight)}getHeight(){return this.outerHeight}getGroup(){return this}reinitializeHeight(){}calcHeight(){this.outerHeight=this.element.offsetHeight}setCellHeight(){}clearCellHeight(){}deinitializeHeight(){}rendered(){}getComponent(){return this.component||(this.component=new Dr(this)),this.component}}var Nr={cellEdit:function(e){e.component.setValueProcessData(e.data.oldValue),e.component.cellRendered()},rowAdd:function(e){e.component.deleteActual(),this.table.rowManager.checkPlaceholder()},rowDelete:function(e){var t=this.table.rowManager.addRowActual(e.data.data,e.data.pos,e.data.index);this.table.options.groupBy&&this.table.modExists("groupRows")&&this.table.modules.groupRows.updateGroupRows(!0),this._rebindRow(e.component,t),this.table.rowManager.checkPlaceholder()},rowMove:function(e){var t=e.data.posFrom-e.data.posTo>0;this.table.rowManager.moveRowActual(e.component,this.table.rowManager.getRowFromPosition(e.data.posFrom),t),this.table.rowManager.regenerateRowPositions(),this.table.rowManager.reRenderInPosition()}},Lr={cellEdit:function(e){e.component.setValueProcessData(e.data.newValue),e.component.cellRendered()},rowAdd:function(e){var t=this.table.rowManager.addRowActual(e.data.data,e.data.pos,e.data.index);this.table.options.groupBy&&this.table.modExists("groupRows")&&this.table.modules.groupRows.updateGroupRows(!0),this._rebindRow(e.component,t),this.table.rowManager.checkPlaceholder()},rowDelete:function(e){e.component.deleteActual(),this.table.rowManager.checkPlaceholder()},rowMove:function(e){this.table.rowManager.moveRowActual(e.component,this.table.rowManager.getRowFromPosition(e.data.posTo),e.data.after),this.table.rowManager.regenerateRowPositions(),this.table.rowManager.reRenderInPosition()}},Pr={keybindings:{bindings:{undo:["ctrl + 90","meta + 90"],redo:["ctrl + 89","meta + 89"]},actions:{undo:function(e){this.table.options.history&&this.table.modExists("history")&&this.table.modExists("edit")&&(this.table.modules.edit.currentCell||(e.preventDefault(),this.table.modules.history.undo()))},redo:function(e){this.table.options.history&&this.table.modExists("history")&&this.table.modExists("edit")&&(this.table.modules.edit.currentCell||(e.preventDefault(),this.table.modules.history.redo()))}}}};class Ar extends Ga{static moduleName="history";static moduleExtensions=Pr;static undoers=Nr;static redoers=Lr;constructor(e){super(e),this.history=[],this.index=-1,this.registerTableOption("history",!1)}initialize(){this.table.options.history&&(this.subscribe("cell-value-updated",this.cellUpdated.bind(this)),this.subscribe("cell-delete",this.clearComponentHistory.bind(this)),this.subscribe("row-delete",this.rowDeleted.bind(this)),this.subscribe("rows-wipe",this.clear.bind(this)),this.subscribe("row-added",this.rowAdded.bind(this)),this.subscribe("row-move",this.rowMoved.bind(this))),this.registerTableFunction("undo",this.undo.bind(this)),this.registerTableFunction("redo",this.redo.bind(this)),this.registerTableFunction("getHistoryUndoSize",this.getHistoryUndoSize.bind(this)),this.registerTableFunction("getHistoryRedoSize",this.getHistoryRedoSize.bind(this)),this.registerTableFunction("clearHistory",this.clear.bind(this))}rowMoved(e,t,i){this.action("rowMove",e,{posFrom:e.getPosition(),posTo:t.getPosition(),to:t,after:i})}rowAdded(e,t,i,s){this.action("rowAdd",e,{data:t,pos:i,index:s})}rowDeleted(e){var t,i;this.table.options.groupBy?(t=(i=e.getComponent().getGroup()._getSelf().rows).indexOf(e))&&(t=i[t-1]):(t=e.table.rowManager.getRowIndex(e))&&(t=e.table.rowManager.rows[t-1]),this.action("rowDelete",e,{data:e.getData(),pos:!t,index:t})}cellUpdated(e){this.action("cellEdit",e,{oldValue:e.oldValue,newValue:e.value})}clear(){this.history=[],this.index=-1}action(e,t,i){this.history=this.history.slice(0,this.index+1),this.history.push({type:e,component:t,data:i}),this.index++}getHistoryUndoSize(){return this.index+1}getHistoryRedoSize(){return this.history.length-(this.index+1)}clearComponentHistory(e){var t=this.history.findIndex(function(t){return t.component===e});t>-1&&(this.history.splice(t,1),t<=this.index&&this.index--,this.clearComponentHistory(e))}undo(){if(this.index>-1){let e=this.history[this.index];return Ar.undoers[e.type].call(this,e),this.index--,this.dispatchExternal("historyUndo",e.type,e.component.getComponent(),e.data),!0}return console.warn(this.options("history")?"History Undo Error - No more history to undo":"History module not enabled"),!1}redo(){if(this.history.length-1>this.index){this.index++;let e=this.history[this.index];return Ar.redoers[e.type].call(this,e),this.dispatchExternal("historyRedo",e.type,e.component.getComponent(),e.data),!0}return console.warn(this.options("history")?"History Redo Error - No more history to redo":"History module not enabled"),!1}_rebindRow(e,t){this.history.forEach(function(i){if(i.component instanceof ur)i.component===e&&(i.component=t);else if(i.component instanceof rr&&i.component.row===e){var s=i.component.column.getField();s&&(i.component=t.getCell(s))}})}}var zr={csv:function(e){var t=[],i=0,s=0,n=!1;for(let o=0;o<e.length;o++){let a=e[o],r=e[o+1];t[i]||(t[i]=[]),t[i][s]||(t[i][s]=""),'"'==a&&n&&'"'==r?(t[i][s]+=a,o++):'"'!=a?","!=a||n?"\r"!=a||"\n"!=r||n?"\r"!=a&&"\n"!=a||n?t[i][s]+=a:(s=0,i++):(s=0,i++,o++):s++:n=!n}return t},json:function(e){try{return JSON.parse(e)}catch(e){return console.warn("JSON Import Error - File contents is invalid JSON",e),Promise.reject()}},array:function(e){return e},xlsx:function(e){var t=this.dependencyRegistry.lookup("XLSX"),i=t.read(e),s=i.Sheets[i.SheetNames[0]];return t.utils.sheet_to_json(s,{header:1})}};class Fr extends Ga{static moduleName="import";static importers=zr;constructor(e){super(e),this.registerTableOption("importFormat"),this.registerTableOption("importReader","text"),this.registerTableOption("importHeaderTransform"),this.registerTableOption("importValueTransform"),this.registerTableOption("importDataValidator"),this.registerTableOption("importFileValidator")}initialize(){this.registerTableFunction("import",this.importFromFile.bind(this)),this.table.options.importFormat&&(this.subscribe("data-loading",this.loadDataCheck.bind(this),10),this.subscribe("data-load",this.loadData.bind(this),10))}loadDataCheck(e){return this.table.options.importFormat&&("string"==typeof e||Array.isArray(e)&&e.length&&Array.isArray(e))}loadData(e,t,i,s,n){return this.importData(this.lookupImporter(),e).then(this.structureData.bind(this)).catch(e=>(console.error("Import Error:",e||"Unable to import data"),Promise.reject(e)))}lookupImporter(e){var t;return e||(e=this.table.options.importFormat),(t="string"==typeof e?Fr.importers[e]:e)||console.error("Import Error - Importer not found:",e),t}importFromFile(e,t,i){var s=this.lookupImporter(e);if(s)return this.pickFile(t,i).then(this.importData.bind(this,s)).then(this.structureData.bind(this)).then(this.mutateData.bind(this)).then(this.validateData.bind(this)).then(this.setData.bind(this)).catch(e=>(this.dispatch("import-error",e),this.dispatchExternal("importError",e),console.error("Import Error:",e||"Unable to import file"),this.table.dataLoader.alertError(),setTimeout(()=>{this.table.dataLoader.clearAlert()},3e3),Promise.reject(e)))}pickFile(e,t){return new Promise((i,s)=>{var n=document.createElement("input");n.type="file",n.accept=e,n.addEventListener("change",e=>{var o=n.files[0],a=new FileReader,r=this.validateFile(o);if(!0===r){switch(this.dispatch("import-importing",n.files),this.dispatchExternal("importImporting",n.files),t||this.table.options.importReader){case"buffer":a.readAsArrayBuffer(o);break;case"binary":a.readAsBinaryString(o);break;case"url":a.readAsDataURL(o);break;default:a.readAsText(o)}a.onload=e=>{i(a.result)},a.onerror=e=>{console.warn("File Load Error - Unable to read file"),s(e)}}else s(r)}),this.dispatch("import-choose"),this.dispatchExternal("importChoose"),n.click()})}importData(e,t){var i;return this.table.dataLoader.alertLoader(),new Promise((s,n)=>{setTimeout(()=>{(i=e.call(this.table,t))instanceof Promise||i?s(i):n()},10)})}structureData(e){return Array.isArray(e)&&e.length&&Array.isArray(e[0])?this.table.options.autoColumns?this.structureArrayToObject(e):this.structureArrayToColumns(e):e}mutateData(e){var t=[];return Array.isArray(e)?e.forEach(e=>{t.push(this.table.modules.mutator.transformRow(e,"import"))}):t=e,t}transformHeader(e){var t=[];return this.table.options.importHeaderTransform?(e.forEach(i=>{t.push(this.table.options.importHeaderTransform.call(this.table,i,e))}),t):e}transformData(e){var t=[];return this.table.options.importValueTransform?(e.forEach(i=>{t.push(this.table.options.importValueTransform.call(this.table,i,e))}),t):e}structureArrayToObject(e){var t=this.transformHeader(e.shift());return e.map(e=>{var i={};return e=this.transformData(e),t.forEach((t,s)=>{i[t]=e[s]}),i})}structureArrayToColumns(e){var t=[],i=this.transformHeader(e[0]),s=this.table.getColumns();return s[0]&&i[0]&&s[0].getDefinition().title===i[0]&&e.shift(),e.forEach(e=>{var i={};(e=this.transformData(e)).forEach((e,t)=>{var n=s[t];n&&(i[n.getField()]=e)}),t.push(i)}),t}validateFile(e){return!this.table.options.importFileValidator||this.table.options.importFileValidator.call(this.table,e)}validateData(e){var t;return this.table.options.importDataValidator?!0===(t=this.table.options.importDataValidator.call(this.table,e))?e:Promise.reject(t):e}setData(e){return this.dispatch("import-imported",e),this.dispatchExternal("importImported",e),this.table.dataLoader.clearAlert(),this.table.setData(e)}}var Or={navPrev:"shift + 9",navNext:9,navUp:38,navDown:40,navLeft:37,navRight:39,scrollPageUp:33,scrollPageDown:34,scrollToStart:36,scrollToEnd:35},Hr={keyBlock:function(e){e.stopPropagation(),e.preventDefault()},scrollPageUp:function(e){var t=this.table.rowManager,i=t.scrollTop-t.element.clientHeight;e.preventDefault(),t.displayRowsCount&&(i>=0?t.element.scrollTop=i:t.scrollToRow(t.getDisplayRows()[0])),this.table.element.focus()},scrollPageDown:function(e){var t=this.table.rowManager,i=t.scrollTop+t.element.clientHeight,s=t.element.scrollHeight;e.preventDefault(),t.displayRowsCount&&(i<=s?t.element.scrollTop=i:t.scrollToRow(t.getDisplayRows()[t.displayRowsCount-1])),this.table.element.focus()},scrollToStart:function(e){var t=this.table.rowManager;e.preventDefault(),t.displayRowsCount&&t.scrollToRow(t.getDisplayRows()[0]),this.table.element.focus()},scrollToEnd:function(e){var t=this.table.rowManager;e.preventDefault(),t.displayRowsCount&&t.scrollToRow(t.getDisplayRows()[t.displayRowsCount-1]),this.table.element.focus()},navPrev:function(e){this.dispatch("keybinding-nav-prev",e)},navNext:function(e){this.dispatch("keybinding-nav-next",e)},navLeft:function(e){this.dispatch("keybinding-nav-left",e)},navRight:function(e){this.dispatch("keybinding-nav-right",e)},navUp:function(e){this.dispatch("keybinding-nav-up",e)},navDown:function(e){this.dispatch("keybinding-nav-down",e)}};class Ir extends Ga{static moduleName="keybindings";static bindings=Or;static actions=Hr;constructor(e){super(e),this.watchKeys=null,this.pressedKeys=null,this.keyupBinding=!1,this.keydownBinding=!1,this.registerTableOption("keybindings",{}),this.registerTableOption("tabEndNewRow",!1)}initialize(){var e=this.table.options.keybindings,t={};this.watchKeys={},this.pressedKeys=[],!1!==e&&(Object.assign(t,Ir.bindings),Object.assign(t,e),this.mapBindings(t),this.bindEvents()),this.subscribe("table-destroy",this.clearBindings.bind(this))}mapBindings(e){for(let t in e)Ir.actions[t]?e[t]&&("object"!=typeof e[t]&&(e[t]=[e[t]]),e[t].forEach(e=>{(Array.isArray(e)?e:[e]).forEach(e=>{this.mapBinding(t,e)})})):console.warn("Key Binding Error - no such action:",t)}getKeyCode(e){return 1===e.key.length?e.key.toUpperCase().charCodeAt(0):{Enter:13,Escape:27,Tab:9,Backspace:8,Delete:46,ArrowUp:38,ArrowDown:40,ArrowLeft:37,ArrowRight:39,Home:36,End:35,PageUp:33,PageDown:34,Insert:45}[e.key]||e.keyCode||0}mapBinding(e,t){var i={action:Ir.actions[e],keys:[],ctrl:!1,shift:!1,meta:!1};t.toString().toLowerCase().split(" ").join("").split("+").forEach(e=>{switch(e){case"ctrl":i.ctrl=!0;break;case"shift":i.shift=!0;break;case"meta":i.meta=!0;break;default:e=isNaN(e)?e.toUpperCase().charCodeAt(0):parseInt(e),i.keys.push(e),this.watchKeys[e]||(this.watchKeys[e]=[]),this.watchKeys[e].push(i)}})}bindEvents(){var e=this;this.keyupBinding=function(t){var i=e.getKeyCode(t),s=e.watchKeys[i];s&&(e.pressedKeys.push(i),s.forEach(function(i){e.checkBinding(t,i)}))},this.keydownBinding=function(t){var i=e.getKeyCode(t);if(e.watchKeys[i]){var s=e.pressedKeys.indexOf(i);s>-1&&e.pressedKeys.splice(s,1)}},this.table.element.addEventListener("keydown",this.keyupBinding),this.table.element.addEventListener("keyup",this.keydownBinding)}clearBindings(){this.keyupBinding&&this.table.element.removeEventListener("keydown",this.keyupBinding),this.keydownBinding&&this.table.element.removeEventListener("keyup",this.keydownBinding)}checkBinding(e,t){var i=!0;return e.ctrlKey==t.ctrl&&e.shiftKey==t.shift&&e.metaKey==t.meta&&(t.keys.forEach(e=>{-1==this.pressedKeys.indexOf(e)&&(i=!1)}),i&&t.action.call(this,e),!0)}}var Br={delete:function(e,t,i){e.delete()}},Vr={insert:function(e,t,i){return this.table.addRow(e.getData(),void 0,t),!0},add:function(e,t,i){return this.table.addRow(e.getData()),!0},update:function(e,t,i){return!!t&&(t.update(e.getData()),!0)},replace:function(e,t,i){return!!t&&(this.table.addRow(e.getData(),void 0,t),t.delete(),!0)}};class Wr extends Ga{static moduleName="moveRow";static senders=Br;static receivers=Vr;constructor(e){super(e),this.placeholderElement=this.createPlaceholderElement(),this.hoverElement=!1,this.checkTimeout=!1,this.checkPeriod=150,this.moving=!1,this.toRow=!1,this.toRowAfter=!1,this.hasHandle=!1,this.startY=0,this.startX=0,this.moveHover=this.moveHover.bind(this),this.endMove=this.endMove.bind(this),this.tableRowDropEvent=!1,this.touchMove=!1,this.connection=!1,this.connectionSelectorsTables=!1,this.connectionSelectorsElements=!1,this.connectionElements=[],this.connections=[],this.connectedTable=!1,this.connectedRow=!1,this.registerTableOption("movableRows",!1),this.registerTableOption("movableRowsConnectedTables",!1),this.registerTableOption("movableRowsConnectedElements",!1),this.registerTableOption("movableRowsSender",!1),this.registerTableOption("movableRowsReceiver","insert"),this.registerColumnOption("rowHandle")}createPlaceholderElement(){var e=document.createElement("div");return e.classList.add("tabulator-row"),e.classList.add("tabulator-row-placeholder"),e}initialize(){this.table.options.movableRows&&(this.connectionSelectorsTables=this.table.options.movableRowsConnectedTables,this.connectionSelectorsElements=this.table.options.movableRowsConnectedElements,this.connection=this.connectionSelectorsTables||this.connectionSelectorsElements,this.subscribe("cell-init",this.initializeCell.bind(this)),this.subscribe("column-init",this.initializeColumn.bind(this)),this.subscribe("row-init",this.initializeRow.bind(this)))}initializeGroupHeader(e){var t=this,i={};i.mouseup=function(i){t.tableRowDrop(i,e)}.bind(t),i.mousemove=function(i){var s;i.pageY-Va.elOffset(e.element).top+t.table.rowManager.element.scrollTop>e.getHeight()/2?t.toRow===e&&t.toRowAfter||((s=e.getElement()).parentNode.insertBefore(t.placeholderElement,s.nextSibling),t.moveRow(e,!0)):(t.toRow!==e||t.toRowAfter)&&(s=e.getElement()).previousSibling&&(s.parentNode.insertBefore(t.placeholderElement,s),t.moveRow(e,!1))}.bind(t),e.modules.moveRow=i}initializeRow(e){var t,i=this,s={};s.mouseup=function(t){i.tableRowDrop(t,e)}.bind(i),s.mousemove=function(t){var s=e.getElement();t.pageY-Va.elOffset(s).top+i.table.rowManager.element.scrollTop>e.getHeight()/2?i.toRow===e&&i.toRowAfter||(s.parentNode.insertBefore(i.placeholderElement,s.nextSibling),i.moveRow(e,!0)):(i.toRow!==e||i.toRowAfter)&&(s.parentNode.insertBefore(i.placeholderElement,s),i.moveRow(e,!1))}.bind(i),this.hasHandle||((t=e.getElement()).addEventListener("mousedown",function(t){1===t.which&&(i.checkTimeout=setTimeout(function(){i.startMove(t,e)},i.checkPeriod))}),t.addEventListener("mouseup",function(e){1===e.which&&i.checkTimeout&&clearTimeout(i.checkTimeout)}),this.bindTouchEvents(e,e.getElement())),e.modules.moveRow=s}initializeColumn(e){e.definition.rowHandle&&!1!==this.table.options.movableRows&&(this.hasHandle=!0)}initializeCell(e){if(e.column.definition.rowHandle&&!1!==this.table.options.movableRows){var t=this,i=e.getElement(!0);i.addEventListener("mousedown",function(i){1===i.which&&(t.checkTimeout=setTimeout(function(){t.startMove(i,e.row)},t.checkPeriod))}),i.addEventListener("mouseup",function(e){1===e.which&&t.checkTimeout&&clearTimeout(t.checkTimeout)}),this.bindTouchEvents(e.row,i)}}bindTouchEvents(e,t){var i,s,n,o,a,r,l=!1;t.addEventListener("touchstart",t=>{this.checkTimeout=setTimeout(()=>{this.touchMove=!0,i=e.nextRow(),n=i?i.getHeight()/2:0,s=e.prevRow(),o=s?s.getHeight()/2:0,a=0,r=0,l=!1,this.startMove(t,e)},this.checkPeriod)},{passive:!0}),this.moving,this.toRow,this.toRowAfter,t.addEventListener("touchmove",t=>{var h,c;this.moving&&(t.preventDefault(),this.moveHover(t),l||(l=t.touches[0].pageY),(h=t.touches[0].pageY-l)>0?i&&h-a>n&&(c=i)!==e&&(l=t.touches[0].pageY,c.getElement().parentNode.insertBefore(this.placeholderElement,c.getElement().nextSibling),this.moveRow(c,!0)):s&&-h-r>o&&(c=s)!==e&&(l=t.touches[0].pageY,c.getElement().parentNode.insertBefore(this.placeholderElement,c.getElement()),this.moveRow(c,!1)),c&&(i=c.nextRow(),a=n,n=i?i.getHeight()/2:0,s=c.prevRow(),r=o,o=s?s.getHeight()/2:0))}),t.addEventListener("touchend",e=>{this.checkTimeout&&clearTimeout(this.checkTimeout),this.moving&&(this.endMove(e),this.touchMove=!1)})}_bindMouseMove(){this.table.rowManager.getDisplayRows().forEach(e=>{("row"===e.type||"group"===e.type)&&e.modules.moveRow&&e.modules.moveRow.mousemove&&e.getElement().addEventListener("mousemove",e.modules.moveRow.mousemove)})}_unbindMouseMove(){this.table.rowManager.getDisplayRows().forEach(e=>{("row"===e.type||"group"===e.type)&&e.modules.moveRow&&e.modules.moveRow.mousemove&&e.getElement().removeEventListener("mousemove",e.modules.moveRow.mousemove)})}startMove(e,t){var i=t.getElement();this.setStartPosition(e,t),this.moving=t,this.table.element.classList.add("tabulator-block-select"),this.placeholderElement.style.width=t.getWidth()+"px",this.placeholderElement.style.height=t.getHeight()+"px",this.connection?(this.table.element.classList.add("tabulator-movingrow-sending"),this.connectToTables(t)):(i.parentNode.insertBefore(this.placeholderElement,i),i.parentNode.removeChild(i)),this.hoverElement=i.cloneNode(!0),this.hoverElement.classList.add("tabulator-moving"),this.connection?(document.body.appendChild(this.hoverElement),this.hoverElement.style.left="0",this.hoverElement.style.top="0",this.hoverElement.style.width=this.table.element.clientWidth+"px",this.hoverElement.style.whiteSpace="nowrap",this.hoverElement.style.overflow="hidden",this.hoverElement.style.pointerEvents="none"):(this.table.rowManager.getTableElement().appendChild(this.hoverElement),this.hoverElement.style.left="0",this.hoverElement.style.top="0",this._bindMouseMove()),document.body.addEventListener("mousemove",this.moveHover),document.body.addEventListener("mouseup",this.endMove),this.dispatchExternal("rowMoving",t.getComponent()),this.moveHover(e)}setStartPosition(e,t){var i,s,n=this.touchMove?e.touches[0].pageX:e.pageX,o=this.touchMove?e.touches[0].pageY:e.pageY;i=t.getElement(),this.connection?(s=i.getBoundingClientRect(),this.startX=s.left-n+window.pageXOffset,this.startY=s.top-o+window.pageYOffset):this.startY=o-i.getBoundingClientRect().top}endMove(e){e&&1!==e.which&&!this.touchMove||(this._unbindMouseMove(),this.connection||(this.placeholderElement.parentNode.insertBefore(this.moving.getElement(),this.placeholderElement.nextSibling),this.placeholderElement.parentNode.removeChild(this.placeholderElement)),this.hoverElement.parentNode.removeChild(this.hoverElement),this.table.element.classList.remove("tabulator-block-select"),this.toRow?this.table.rowManager.moveRow(this.moving,this.toRow,this.toRowAfter):this.dispatchExternal("rowMoveCancelled",this.moving.getComponent()),this.moving=!1,this.toRow=!1,this.toRowAfter=!1,document.body.removeEventListener("mousemove",this.moveHover),document.body.removeEventListener("mouseup",this.endMove),this.connection&&(this.table.element.classList.remove("tabulator-movingrow-sending"),this.disconnectFromTables()))}moveRow(e,t){this.toRow=e,this.toRowAfter=t}moveHover(e){this.connection?this.moveHoverConnections.call(this,e):this.moveHoverTable.call(this,e)}moveHoverTable(e){var t=this.table.rowManager.getElement(),i=t.scrollTop,s=(this.touchMove?e.touches[0].pageY:e.pageY)-t.getBoundingClientRect().top+i;this.hoverElement.style.top=Math.min(s-this.startY,this.table.rowManager.element.scrollHeight-this.hoverElement.offsetHeight)+"px"}moveHoverConnections(e){this.hoverElement.style.left=this.startX+(this.touchMove?e.touches[0].pageX:e.pageX)+"px",this.hoverElement.style.top=this.startY+(this.touchMove?e.touches[0].pageY:e.pageY)+"px"}elementRowDrop(e,t,i){this.dispatchExternal("movableRowsElementDrop",e,t,!!i&&i.getComponent())}connectToTables(e){var t;this.connectionSelectorsTables&&(t=this.commsConnections(this.connectionSelectorsTables),this.dispatchExternal("movableRowsSendingStart",t),this.commsSend(this.connectionSelectorsTables,"moveRow","connect",{row:e})),this.connectionSelectorsElements&&(this.connectionElements=[],Array.isArray(this.connectionSelectorsElements)||(this.connectionSelectorsElements=[this.connectionSelectorsElements]),this.connectionSelectorsElements.forEach(e=>{"string"==typeof e?this.connectionElements=this.connectionElements.concat(Array.prototype.slice.call(document.querySelectorAll(e))):this.connectionElements.push(e)}),this.connectionElements.forEach(e=>{var t=t=>{this.elementRowDrop(t,e,this.moving)};e.addEventListener("mouseup",t),e.tabulatorElementDropEvent=t,e.classList.add("tabulator-movingrow-receiving")}))}disconnectFromTables(){var e;this.connectionSelectorsTables&&(e=this.commsConnections(this.connectionSelectorsTables),this.dispatchExternal("movableRowsSendingStop",e),this.commsSend(this.connectionSelectorsTables,"moveRow","disconnect")),this.connectionElements.forEach(e=>{e.classList.remove("tabulator-movingrow-receiving"),e.removeEventListener("mouseup",e.tabulatorElementDropEvent),delete e.tabulatorElementDropEvent})}connect(e,t){return this.connectedTable?(console.warn("Move Row Error - Table cannot accept connection, already connected to table:",this.connectedTable),!1):(this.connectedTable=e,this.connectedRow=t,this.table.element.classList.add("tabulator-movingrow-receiving"),this.table.rowManager.getDisplayRows().forEach(e=>{"row"===e.type&&e.modules.moveRow&&e.modules.moveRow.mouseup&&e.getElement().addEventListener("mouseup",e.modules.moveRow.mouseup)}),this.tableRowDropEvent=this.tableRowDrop.bind(this),this.table.element.addEventListener("mouseup",this.tableRowDropEvent),this.dispatchExternal("movableRowsReceivingStart",t,e),!0)}disconnect(e){e===this.connectedTable?(this.connectedTable=!1,this.connectedRow=!1,this.table.element.classList.remove("tabulator-movingrow-receiving"),this.table.rowManager.getDisplayRows().forEach(e=>{"row"===e.type&&e.modules.moveRow&&e.modules.moveRow.mouseup&&e.getElement().removeEventListener("mouseup",e.modules.moveRow.mouseup)}),this.table.element.removeEventListener("mouseup",this.tableRowDropEvent),this.dispatchExternal("movableRowsReceivingStop",e)):console.warn("Move Row Error - trying to disconnect from non connected table")}dropComplete(e,t,i){var s=!1;if(i){switch(typeof this.table.options.movableRowsSender){case"string":s=Wr.senders[this.table.options.movableRowsSender];break;case"function":s=this.table.options.movableRowsSender}s?s.call(this,this.moving?this.moving.getComponent():void 0,t?t.getComponent():void 0,e):this.table.options.movableRowsSender&&console.warn("Mover Row Error - no matching sender found:",this.table.options.movableRowsSender),this.dispatchExternal("movableRowsSent",this.moving.getComponent(),t?t.getComponent():void 0,e)}else this.dispatchExternal("movableRowsSentFailed",this.moving.getComponent(),t?t.getComponent():void 0,e);this.endMove()}tableRowDrop(e,t){var i=!1,s=!1;switch(e.stopImmediatePropagation(),typeof this.table.options.movableRowsReceiver){case"string":i=Wr.receivers[this.table.options.movableRowsReceiver];break;case"function":i=this.table.options.movableRowsReceiver}i?s=i.call(this,this.connectedRow.getComponent(),t?t.getComponent():void 0,this.connectedTable):console.warn("Mover Row Error - no matching receiver found:",this.table.options.movableRowsReceiver),s?this.dispatchExternal("movableRowsReceived",this.connectedRow.getComponent(),t?t.getComponent():void 0,this.connectedTable):this.dispatchExternal("movableRowsReceivedFailed",this.connectedRow.getComponent(),t?t.getComponent():void 0,this.connectedTable),this.commsSend(this.connectedTable,"moveRow","dropcomplete",{row:t,success:s})}commsReceived(e,t,i){switch(t){case"connect":return this.connect(e,i.row);case"disconnect":return this.disconnect(e);case"dropcomplete":return this.dropComplete(e,i.row,i.success)}}}var Gr={};class Ur extends Ga{static moduleName="mutator";static mutators=Gr;constructor(e){super(e),this.allowedTypes=["","data","edit","clipboard","import"],this.enabled=!0,this.registerColumnOption("mutator"),this.registerColumnOption("mutatorParams"),this.registerColumnOption("mutatorData"),this.registerColumnOption("mutatorDataParams"),this.registerColumnOption("mutatorEdit"),this.registerColumnOption("mutatorEditParams"),this.registerColumnOption("mutatorClipboard"),this.registerColumnOption("mutatorClipboardParams"),this.registerColumnOption("mutatorImport"),this.registerColumnOption("mutatorImportParams"),this.registerColumnOption("mutateLink")}initialize(){this.subscribe("cell-value-changing",this.transformCell.bind(this)),this.subscribe("cell-value-changed",this.mutateLink.bind(this)),this.subscribe("column-layout",this.initializeColumn.bind(this)),this.subscribe("row-data-init-before",this.rowDataChanged.bind(this)),this.subscribe("row-data-changing",this.rowDataChanged.bind(this))}rowDataChanged(e,t,i){return this.transformRow(t,"data",i)}initializeColumn(e){var t=!1,i={};this.allowedTypes.forEach(s=>{var n,o="mutator"+(s.charAt(0).toUpperCase()+s.slice(1));e.definition[o]&&(n=this.lookupMutator(e.definition[o]))&&(t=!0,i[o]={mutator:n,params:e.definition[o+"Params"]||{}})}),t&&(e.modules.mutate=i)}lookupMutator(e){var t=!1;switch(typeof e){case"string":Ur.mutators[e]?t=Ur.mutators[e]:console.warn("Mutator Error - No such mutator found, ignoring: ",e);break;case"function":t=e}return t}transformRow(e,t,i){var s,n="mutator"+(t.charAt(0).toUpperCase()+t.slice(1));return this.enabled&&this.table.columnManager.traverse(o=>{var a,r,l;o.modules.mutate&&(a=o.modules.mutate[n]||o.modules.mutate.mutator||!1)&&(s=o.getFieldValue(void 0!==i?i:e),("data"==t&&!i||void 0!==s)&&(l=o.getComponent(),r="function"==typeof a.params?a.params(s,e,t,l):a.params,o.setFieldValue(e,a.mutator(s,e,t,r,l))))}),e}transformCell(e,t){if(e.column.modules.mutate){var i=e.column.modules.mutate.mutatorEdit||e.column.modules.mutate.mutator||!1,s={};if(i)return s=Object.assign(s,e.row.getData()),e.column.setFieldValue(s,t),i.mutator(t,s,"edit",i.params,e.getComponent())}return t}mutateLink(e){var t=e.column.definition.mutateLink;t&&(Array.isArray(t)||(t=[t]),t.forEach(t=>{var i=e.row.getCell(t);i&&i.setValue(i.getValue(),!0,!0)}))}enable(){this.enabled=!0}disable(){this.enabled=!1}}var $r={rows:function(e,t,i,s,n){var o=document.createElement("span"),a=document.createElement("span"),r=document.createElement("span"),l=document.createElement("span"),h=document.createElement("span"),c=document.createElement("span");return this.table.modules.localize.langBind("pagination|counter|showing",e=>{a.innerHTML=e}),this.table.modules.localize.langBind("pagination|counter|of",e=>{l.innerHTML=e}),this.table.modules.localize.langBind("pagination|counter|rows",e=>{c.innerHTML=e}),s?(r.innerHTML=" "+t+"-"+Math.min(t+e-1,s)+" ",h.innerHTML=" "+s+" ",o.appendChild(a),o.appendChild(r),o.appendChild(l),o.appendChild(h),o.appendChild(c)):(r.innerHTML=" 0 ",o.appendChild(a),o.appendChild(r),o.appendChild(c)),o},pages:function(e,t,i,s,n){var o=document.createElement("span"),a=document.createElement("span"),r=document.createElement("span"),l=document.createElement("span"),h=document.createElement("span"),c=document.createElement("span");return this.table.modules.localize.langBind("pagination|counter|showing",e=>{a.innerHTML=e}),r.innerHTML=" "+i+" ",this.table.modules.localize.langBind("pagination|counter|of",e=>{l.innerHTML=e}),h.innerHTML=" "+n+" ",this.table.modules.localize.langBind("pagination|counter|pages",e=>{c.innerHTML=e}),o.appendChild(a),o.appendChild(r),o.appendChild(l),o.appendChild(h),o.appendChild(c),o}};class Yr extends Ga{static moduleName="page";static pageCounters=$r;constructor(e){super(e),this.mode="local",this.progressiveLoad=!1,this.element=null,this.pageCounterElement=null,this.pageCounter=null,this.size=0,this.page=1,this.count=5,this.max=1,this.remoteRowCountEstimate=null,this.initialLoad=!0,this.dataChanging=!1,this.pageSizes=[],this.registerTableOption("pagination",!1),this.registerTableOption("paginationMode","local"),this.registerTableOption("paginationSize",!1),this.registerTableOption("paginationInitialPage",1),this.registerTableOption("paginationCounter",!1),this.registerTableOption("paginationCounterElement",!1),this.registerTableOption("paginationButtonCount",5),this.registerTableOption("paginationSizeSelector",!1),this.registerTableOption("paginationElement",!1),this.registerTableOption("paginationAddRow","page"),this.registerTableOption("paginationOutOfRange",!1),this.registerTableOption("progressiveLoad",!1),this.registerTableOption("progressiveLoadDelay",0),this.registerTableOption("progressiveLoadScrollMargin",0),this.registerTableFunction("setMaxPage",this.setMaxPage.bind(this)),this.registerTableFunction("setPage",this.setPage.bind(this)),this.registerTableFunction("setPageToRow",this.userSetPageToRow.bind(this)),this.registerTableFunction("setPageSize",this.userSetPageSize.bind(this)),this.registerTableFunction("getPageSize",this.getPageSize.bind(this)),this.registerTableFunction("previousPage",this.previousPage.bind(this)),this.registerTableFunction("nextPage",this.nextPage.bind(this)),this.registerTableFunction("getPage",this.getPage.bind(this)),this.registerTableFunction("getPageMax",this.getPageMax.bind(this)),this.registerComponentFunction("row","pageTo",this.setPageToRow.bind(this))}initialize(){this.table.options.pagination?(this.subscribe("row-deleted",this.rowsUpdated.bind(this)),this.subscribe("row-added",this.rowsUpdated.bind(this)),this.subscribe("data-processed",this.initialLoadComplete.bind(this)),this.subscribe("table-built",this.calculatePageSizes.bind(this)),this.subscribe("footer-redraw",this.footerRedraw.bind(this)),"page"==this.table.options.paginationAddRow&&this.subscribe("row-adding-position",this.rowAddingPosition.bind(this)),"remote"===this.table.options.paginationMode&&(this.subscribe("data-params",this.remotePageParams.bind(this)),this.subscribe("data-loaded",this._parseRemoteData.bind(this))),this.table.options.progressiveLoad&&console.error("Progressive Load Error - Pagination and progressive load cannot be used at the same time"),this.registerDisplayHandler(this.restOnRenderBefore.bind(this),40),this.registerDisplayHandler(this.getRows.bind(this),50),this.createElements(),this.initializePageCounter(),this.initializePaginator()):this.table.options.progressiveLoad&&(this.subscribe("data-params",this.remotePageParams.bind(this)),this.subscribe("data-loaded",this._parseRemoteData.bind(this)),this.subscribe("table-built",this.calculatePageSizes.bind(this)),this.subscribe("data-processed",this.initialLoadComplete.bind(this)),this.initializeProgressive(this.table.options.progressiveLoad),"scroll"===this.table.options.progressiveLoad&&this.subscribe("scroll-vertical",this.scrollVertical.bind(this)))}rowAddingPosition(e,t){var i,s=this.table.rowManager,n=s.getDisplayRows();return t?n.length?i=n[0]:s.activeRows.length&&(i=s.activeRows[s.activeRows.length-1],t=!1):n.length&&(i=n[n.length-1],t=!(n.length<this.size)),{index:i,top:t}}calculatePageSizes(){var e,t;this.table.options.paginationSize?this.size=this.table.options.paginationSize:((e=document.createElement("div")).classList.add("tabulator-row"),e.style.visibility="hidden",(t=document.createElement("div")).classList.add("tabulator-cell"),t.innerHTML="Page Row Test",e.appendChild(t),this.table.rowManager.getTableElement().appendChild(e),this.size=Math.floor(this.table.rowManager.getElement().clientHeight/e.offsetHeight),this.table.rowManager.getTableElement().removeChild(e)),this.dispatchExternal("pageSizeChanged",this.size),this.generatePageSizeSelectList()}initialLoadComplete(){this.initialLoad=!1}remotePageParams(e,t,i,s){return this.initialLoad||(this.progressiveLoad&&!i||!this.progressiveLoad&&!this.dataChanging)&&this.reset(!0),s.page=this.page,this.size&&(s.size=this.size),s}userSetPageToRow(e){return this.table.options.pagination&&(e=this.table.rowManager.findRow(e))?this.setPageToRow(e):Promise.reject()}userSetPageSize(e){return!!this.table.options.pagination&&(this.setPageSize(e),this.setPage(1))}scrollVertical(e,t){var i;t||this.table.dataLoader.loading||(i=this.table.rowManager.getElement()).scrollHeight-i.clientHeight-e<(this.table.options.progressiveLoadScrollMargin||2*i.clientHeight)&&this.nextPage().catch(()=>{})}restOnRenderBefore(e,t){return t||"local"===this.mode&&this.reset(),e}rowsUpdated(){this.refreshData(!0,"all")}createElements(){var e;this.element=document.createElement("span"),this.element.classList.add("tabulator-paginator"),this.pagesElement=document.createElement("span"),this.pagesElement.classList.add("tabulator-pages"),(e=document.createElement("button")).classList.add("tabulator-page"),e.setAttribute("type","button"),e.setAttribute("role","button"),e.setAttribute("aria-label",""),e.setAttribute("title",""),this.firstBut=e.cloneNode(!0),this.firstBut.setAttribute("data-page","first"),this.prevBut=e.cloneNode(!0),this.prevBut.setAttribute("data-page","prev"),this.nextBut=e.cloneNode(!0),this.nextBut.setAttribute("data-page","next"),this.lastBut=e.cloneNode(!0),this.lastBut.setAttribute("data-page","last"),this.table.options.paginationSizeSelector&&(this.pageSizeSelect=document.createElement("select"),this.pageSizeSelect.classList.add("tabulator-page-size"))}generatePageSizeSelectList(){var e=[];if(this.pageSizeSelect){if(Array.isArray(this.table.options.paginationSizeSelector))e=this.table.options.paginationSizeSelector,this.pageSizes=e,-1==this.pageSizes.indexOf(this.size)&&e.unshift(this.size);else if(-1==this.pageSizes.indexOf(this.size)){e=[];for(let t=1;t<5;t++)e.push(this.size*t);this.pageSizes=e}else e=this.pageSizes;for(;this.pageSizeSelect.firstChild;)this.pageSizeSelect.removeChild(this.pageSizeSelect.firstChild);e.forEach(e=>{var t=document.createElement("option");t.value=e,!0===e?this.langBind("pagination|all",function(e){t.innerHTML=e}):t.innerHTML=e,this.pageSizeSelect.appendChild(t)}),this.pageSizeSelect.value=this.size}}initializePageCounter(){var e=this.table.options.paginationCounter,t=null;e&&((t="function"==typeof e?e:Yr.pageCounters[e])?(this.pageCounter=t,this.pageCounterElement=document.createElement("span"),this.pageCounterElement.classList.add("tabulator-page-counter")):console.warn("Pagination Error - No such page counter found: ",e))}initializePaginator(e){var t,i;e||(this.langBind("pagination|first",e=>{this.firstBut.innerHTML=e}),this.langBind("pagination|first_title",e=>{this.firstBut.setAttribute("aria-label",e),this.firstBut.setAttribute("title",e)}),this.langBind("pagination|prev",e=>{this.prevBut.innerHTML=e}),this.langBind("pagination|prev_title",e=>{this.prevBut.setAttribute("aria-label",e),this.prevBut.setAttribute("title",e)}),this.langBind("pagination|next",e=>{this.nextBut.innerHTML=e}),this.langBind("pagination|next_title",e=>{this.nextBut.setAttribute("aria-label",e),this.nextBut.setAttribute("title",e)}),this.langBind("pagination|last",e=>{this.lastBut.innerHTML=e}),this.langBind("pagination|last_title",e=>{this.lastBut.setAttribute("aria-label",e),this.lastBut.setAttribute("title",e)}),this.firstBut.addEventListener("click",()=>{this.setPage(1)}),this.prevBut.addEventListener("click",()=>{this.previousPage()}),this.nextBut.addEventListener("click",()=>{this.nextPage()}),this.lastBut.addEventListener("click",()=>{this.setPage(this.max)}),this.table.options.paginationElement&&(this.element=this.table.options.paginationElement),this.pageSizeSelect&&(t=document.createElement("label"),this.langBind("pagination|page_size",e=>{this.pageSizeSelect.setAttribute("aria-label",e),this.pageSizeSelect.setAttribute("title",e),t.innerHTML=e}),this.element.appendChild(t),this.element.appendChild(this.pageSizeSelect),this.pageSizeSelect.addEventListener("change",e=>{this.setPageSize("true"==this.pageSizeSelect.value||this.pageSizeSelect.value),this.setPage(1)})),this.element.appendChild(this.firstBut),this.element.appendChild(this.prevBut),this.element.appendChild(this.pagesElement),this.element.appendChild(this.nextBut),this.element.appendChild(this.lastBut),this.table.options.paginationElement||(this.table.options.paginationCounter&&(this.table.options.paginationCounterElement?this.table.options.paginationCounterElement instanceof HTMLElement?this.table.options.paginationCounterElement.appendChild(this.pageCounterElement):"string"==typeof this.table.options.paginationCounterElement&&((i=document.querySelector(this.table.options.paginationCounterElement))?i.appendChild(this.pageCounterElement):console.warn("Pagination Error - Unable to find element matching paginationCounterElement selector:",this.table.options.paginationCounterElement)):this.footerAppend(this.pageCounterElement)),this.footerAppend(this.element)),this.page=this.table.options.paginationInitialPage,this.count=this.table.options.paginationButtonCount),this.mode=this.table.options.paginationMode}initializeProgressive(e){this.initializePaginator(!0),this.mode="progressive_"+e,this.progressiveLoad=!0}trackChanges(){this.dispatch("page-changed")}setMaxRows(e){this.max=e?!0===this.size?1:Math.ceil(e/this.size):1,this.page>this.max&&(this.page=this.max)}reset(e){this.initialLoad||("local"==this.mode||e)&&(this.page=1,this.trackChanges())}setMaxPage(e){e=parseInt(e),this.max=e||1,this.page>this.max&&(this.page=this.max,this.trigger())}setPage(e){switch(e){case"first":return this.setPage(1);case"prev":return this.previousPage();case"next":return this.nextPage();case"last":return this.setPage(this.max)}return(e=parseInt(e))>0&&e<=this.max||"local"!==this.mode?(this.page=e,this.trackChanges(),this.trigger()):(console.warn("Pagination Error - Requested page is out of range of 1 - "+this.max+":",e),Promise.reject())}setPageToRow(e){var t=this.displayRows(-1).indexOf(e);if(t>-1){var i=!0===this.size?1:Math.ceil((t+1)/this.size);return this.setPage(i)}return console.warn("Pagination Error - Requested row is not visible"),Promise.reject()}setPageSize(e){!0!==e&&(e=parseInt(e)),e>0&&(this.size=e,this.dispatchExternal("pageSizeChanged",e)),this.pageSizeSelect&&this.generatePageSizeSelectList(),this.trackChanges()}_setPageCounter(e,t,i){var s;if(this.pageCounter)switch("remote"===this.mode&&(t=this.size,i=(this.page-1)*this.size+1,e=this.remoteRowCountEstimate),typeof(s=this.pageCounter.call(this,t,i,this.page,e,this.max))){case"object":if(s instanceof Node){for(;this.pageCounterElement.firstChild;)this.pageCounterElement.removeChild(this.pageCounterElement.firstChild);this.pageCounterElement.appendChild(s)}else this.pageCounterElement.innerHTML="",null!=s&&console.warn("Page Counter Error - Page Counter has returned a type of object, the only valid page counter object return is an instance of Node, the page counter returned:",s);break;case"undefined":this.pageCounterElement.innerHTML="";break;default:this.pageCounterElement.innerHTML=s}}_setPageButtons(){let e=Math.floor((this.count-1)/2),t=Math.ceil((this.count-1)/2),i=this.max-this.page+e+1<this.count?this.max-this.count+1:Math.max(this.page-e,1),s=this.page<=t?Math.min(this.count,this.max):Math.min(this.page+t,this.max);for(;this.pagesElement.firstChild;)this.pagesElement.removeChild(this.pagesElement.firstChild);1==this.page?(this.firstBut.disabled=!0,this.prevBut.disabled=!0):(this.firstBut.disabled=!1,this.prevBut.disabled=!1),this.page==this.max?(this.lastBut.disabled=!0,this.nextBut.disabled=!0):(this.lastBut.disabled=!1,this.nextBut.disabled=!1);for(let e=i;e<=s;e++)e>0&&e<=this.max&&this.pagesElement.appendChild(this._generatePageButton(e));this.footerRedraw()}_generatePageButton(e){var t=document.createElement("button");return t.classList.add("tabulator-page"),e==this.page&&t.classList.add("active"),t.setAttribute("type","button"),t.setAttribute("role","button"),this.langBind("pagination|page_title",i=>{t.setAttribute("aria-label",i+" "+e),t.setAttribute("title",i+" "+e)}),t.setAttribute("data-page",e),t.textContent=e,t.addEventListener("click",t=>{this.setPage(e)}),t}previousPage(){return this.page>1?(this.page--,this.trackChanges(),this.trigger()):(console.warn("Pagination Error - Previous page would be less than page 1:",0),Promise.reject())}nextPage(){return this.page<this.max?(this.page++,this.trackChanges(),this.trigger()):(this.progressiveLoad||console.warn("Pagination Error - Next page would be greater than maximum page of "+this.max+":",this.max+1),Promise.reject())}getPage(){return this.page}getPageMax(){return this.max}getPageSize(e){return this.size}getMode(){return this.mode}getRows(e){var t,i,s,n,o=0,a=e.filter(e=>"row"===e.type);if("local"==this.mode){t=[],this.setMaxRows(e.length),!0===this.size?(i=0,s=e.length):s=(i=this.size*(this.page-1))+parseInt(this.size),this._setPageButtons();for(let a=i;a<s;a++){let i=e[a];i&&(t.push(i),"row"===i.type&&(n||(n=i),o++))}return this._setPageCounter(a.length,o,n?a.indexOf(n)+1:0),t}return this._setPageButtons(),this._setPageCounter(a.length),e.slice(0)}trigger(){var e;switch(this.mode){case"local":return e=this.table.rowManager.scrollLeft,this.refreshData(),this.table.rowManager.scrollHorizontal(e),this.dispatchExternal("pageLoaded",this.getPage()),Promise.resolve();case"remote":return this.dataChanging=!0,this.reloadData(null).finally(()=>{this.dataChanging=!1});case"progressive_load":case"progressive_scroll":return this.reloadData(null,!0);default:return console.warn("Pagination Error - no such pagination mode:",this.mode),Promise.reject()}}_parseRemoteData(e){var t,i;if(void 0===e.last_page&&console.warn("Remote Pagination Error - Server response missing '"+(this.options("dataReceiveParams").last_page||"last_page")+"' property"),e.data){if(this.max=parseInt(e.last_page)||1,this.remoteRowCountEstimate=void 0!==e.last_row?e.last_row:e.last_page*this.size-(this.page==e.last_page?this.size-e.data.length:0),this.progressiveLoad){switch(this.mode){case"progressive_load":1==this.page?this.table.rowManager.setData(e.data,!1,1==this.page):this.table.rowManager.addRows(e.data),this.page<this.max&&setTimeout(()=>{this.nextPage()},this.table.options.progressiveLoadDelay);break;case"progressive_scroll":e=1===this.page?e.data:this.table.rowManager.getData().concat(e.data),this.table.rowManager.setData(e,1!==this.page,1==this.page),t=this.table.options.progressiveLoadScrollMargin||2*this.table.rowManager.element.clientHeight,this.table.rowManager.element.scrollHeight<=this.table.rowManager.element.clientHeight+t&&this.page<this.max&&setTimeout(()=>{this.nextPage()})}return!1}if(this.page>this.max&&(console.warn("Remote Pagination Error - Server returned last page value lower than the current page"),i=this.options("paginationOutOfRange")))return this.setPage("function"==typeof i?i.call(this,this.page,this.max):i);this.dispatchExternal("pageLoaded",this.getPage())}else console.warn("Remote Pagination Error - Server response missing '"+(this.options("dataReceiveParams").data||"data")+"' property");return e.data}footerRedraw(){var e=this.table.footerManager.containerElement;Math.ceil(e.clientWidth)-e.scrollWidth<0?this.pagesElement.style.display="none":(this.pagesElement.style.display="",Math.ceil(e.clientWidth)-e.scrollWidth<0&&(this.pagesElement.style.display="none"))}}var Kr={local:function(e,t){var i=localStorage.getItem(e+"-"+t);return!!i&&JSON.parse(i)},cookie:function(e,t){var i,s,n=document.cookie,o=e+"-"+t,a=n.indexOf(o+"=");return a>-1&&((i=(n=n.slice(a)).indexOf(";"))>-1&&(n=n.slice(0,i)),s=n.replace(o+"=","")),!!s&&JSON.parse(s)}},Xr={local:function(e,t,i){localStorage.setItem(e+"-"+t,JSON.stringify(i))},cookie:function(e,t,i){var s=new Date;s.setDate(s.getDate()+1e4),document.cookie=e+"-"+t+"="+JSON.stringify(i)+"; expires="+s.toUTCString()}};class qr extends Ga{static moduleName="persistence";static moduleInitOrder=-10;static readers=Kr;static writers=Xr;constructor(e){super(e),this.mode="",this.id="",this.defWatcherBlock=!1,this.config={},this.readFunc=!1,this.writeFunc=!1,this.registerTableOption("persistence",!1),this.registerTableOption("persistenceID",""),this.registerTableOption("persistenceMode",!0),this.registerTableOption("persistenceReaderFunc",!1),this.registerTableOption("persistenceWriterFunc",!1)}localStorageTest(){var e="_tabulator_test";try{return window.localStorage.setItem(e,e),window.localStorage.removeItem(e),!0}catch(e){return!1}}initialize(){if(this.table.options.persistence){var e,t=this.table.options.persistenceMode,i=this.table.options.persistenceID;this.mode=!0!==t?t:this.localStorageTest()?"local":"cookie",this.table.options.persistenceReaderFunc?"function"==typeof this.table.options.persistenceReaderFunc?this.readFunc=this.table.options.persistenceReaderFunc:qr.readers[this.table.options.persistenceReaderFunc]?this.readFunc=qr.readers[this.table.options.persistenceReaderFunc]:console.warn("Persistence Read Error - invalid reader set",this.table.options.persistenceReaderFunc):qr.readers[this.mode]?this.readFunc=qr.readers[this.mode]:console.warn("Persistence Read Error - invalid reader set",this.mode),this.table.options.persistenceWriterFunc?"function"==typeof this.table.options.persistenceWriterFunc?this.writeFunc=this.table.options.persistenceWriterFunc:qr.writers[this.table.options.persistenceWriterFunc]?this.writeFunc=qr.writers[this.table.options.persistenceWriterFunc]:console.warn("Persistence Write Error - invalid reader set",this.table.options.persistenceWriterFunc):qr.writers[this.mode]?this.writeFunc=qr.writers[this.mode]:console.warn("Persistence Write Error - invalid writer set",this.mode),this.id="tabulator-"+(i||this.table.element.getAttribute("id")||""),this.config={sort:!0===this.table.options.persistence||this.table.options.persistence.sort,filter:!0===this.table.options.persistence||this.table.options.persistence.filter,headerFilter:!0===this.table.options.persistence||this.table.options.persistence.headerFilter,group:!0===this.table.options.persistence||this.table.options.persistence.group,page:!0===this.table.options.persistence||this.table.options.persistence.page,columns:!0===this.table.options.persistence?["title","width","visible"]:this.table.options.persistence.columns},this.config.page&&(e=this.retrieveData("page"))&&(void 0===e.paginationSize||!0!==this.config.page&&!this.config.page.size||(this.table.options.paginationSize=e.paginationSize),void 0===e.paginationInitialPage||!0!==this.config.page&&!this.config.page.page||(this.table.options.paginationInitialPage=e.paginationInitialPage)),this.config.group&&(e=this.retrieveData("group"))&&(void 0===e.groupBy||!0!==this.config.group&&!this.config.group.groupBy||(this.table.options.groupBy=e.groupBy),void 0===e.groupStartOpen||!0!==this.config.group&&!this.config.group.groupStartOpen||(this.table.options.groupStartOpen=e.groupStartOpen),void 0===e.groupHeader||!0!==this.config.group&&!this.config.group.groupHeader||(this.table.options.groupHeader=e.groupHeader)),this.config.columns&&(this.table.options.columns=this.load("columns",this.table.options.columns),this.subscribe("column-init",this.initializeColumn.bind(this)),this.subscribe("column-show",this.save.bind(this,"columns")),this.subscribe("column-hide",this.save.bind(this,"columns")),this.subscribe("column-moved",this.save.bind(this,"columns"))),this.subscribe("table-built",this.tableBuilt.bind(this),0),this.subscribe("table-redraw",this.tableRedraw.bind(this)),this.subscribe("filter-changed",this.eventSave.bind(this,"filter")),this.subscribe("filter-changed",this.eventSave.bind(this,"headerFilter")),this.subscribe("sort-changed",this.eventSave.bind(this,"sort")),this.subscribe("group-changed",this.eventSave.bind(this,"group")),this.subscribe("page-changed",this.eventSave.bind(this,"page")),this.subscribe("column-resized",this.eventSave.bind(this,"columns")),this.subscribe("column-width",this.eventSave.bind(this,"columns")),this.subscribe("layout-refreshed",this.eventSave.bind(this,"columns"))}this.registerTableFunction("getColumnLayout",this.getColumnLayout.bind(this)),this.registerTableFunction("setColumnLayout",this.setColumnLayout.bind(this))}eventSave(e){this.config[e]&&this.save(e)}tableBuilt(){var e,t,i;this.config.sort&&0==!(e=this.load("sort"))&&(this.table.options.initialSort=e),this.config.filter&&0==!(t=this.load("filter"))&&(this.table.options.initialFilter=t),this.config.headerFilter&&0==!(i=this.load("headerFilter"))&&(this.table.options.initialHeaderFilter=i)}tableRedraw(e){e&&this.config.columns&&this.save("columns")}getColumnLayout(){return this.parseColumns(this.table.columnManager.getColumns())}setColumnLayout(e){return this.table.columnManager.setColumns(this.mergeDefinition(this.table.options.columns,e,!0)),!0}initializeColumn(e){var t;this.config.columns&&(this.defWatcherBlock=!0,t=e.getDefinition(),(!0===this.config.columns?Object.keys(t):this.config.columns).forEach(e=>{var i=Object.getOwnPropertyDescriptor(t,e),s=t[e];i&&Object.defineProperty(t,e,{set:e=>{s=e,this.defWatcherBlock||this.save("columns"),i.set&&i.set(e)},get:()=>(i.get&&i.get(),s)})}),this.defWatcherBlock=!1)}load(e,t){var i=this.retrieveData(e);return t&&(i=i?this.mergeDefinition(t,i):t),i}retrieveData(e){return!!this.readFunc&&this.readFunc(this.id,e)}mergeDefinition(e,t,i){var s=[];return(t=t||[]).forEach((t,n)=>{var o,a=this._findColumn(e,t);a&&(i?o=Object.keys(t):!0===this.config.columns||null==this.config.columns?(o=Object.keys(a)).push("width"):o=this.config.columns,o.forEach(e=>{"columns"!==e&&void 0!==t[e]&&(a[e]=t[e])}),a.columns&&(a.columns=this.mergeDefinition(a.columns,t.columns)),s.push(a))}),e.forEach((e,i)=>{this._findColumn(t,e)||(s.length>i?s.splice(i,0,e):s.push(e))}),s}_findColumn(e,t){var i=t.columns?"group":t.field?"field":"object";return e.find(function(e){switch(i){case"group":return e.title===t.title&&e.columns.length===t.columns.length;case"field":return e.field===t.field;case"object":return e===t}})}save(e){var t={};switch(e){case"columns":t=this.parseColumns(this.table.columnManager.getColumns());break;case"filter":t=this.table.modules.filter.getFilters();break;case"headerFilter":t=this.table.modules.filter.getHeaderFilters();break;case"sort":t=this.validateSorters(this.table.modules.sort.getSort());break;case"group":t=this.getGroupConfig();break;case"page":t=this.getPageConfig()}this.writeFunc&&this.writeFunc(this.id,e,t)}validateSorters(e){return e.forEach(function(e){e.column=e.field,delete e.field}),e}getGroupConfig(){var e={};return this.config.group&&((!0===this.config.group||this.config.group.groupBy)&&(e.groupBy=this.table.options.groupBy),(!0===this.config.group||this.config.group.groupStartOpen)&&(e.groupStartOpen=this.table.options.groupStartOpen),(!0===this.config.group||this.config.group.groupHeader)&&(e.groupHeader=this.table.options.groupHeader)),e}getPageConfig(){var e={};return this.config.page&&((!0===this.config.page||this.config.page.size)&&(e.paginationSize=this.table.modules.page.getPageSize()),(!0===this.config.page||this.config.page.page)&&(e.paginationInitialPage=this.table.modules.page.getPage())),e}parseColumns(e){var t=[],i=["headerContextMenu","headerMenu","contextMenu","clickMenu"];return e.forEach(e=>{var s,n={},o=e.getDefinition();e.isGroup?(n.title=o.title,n.columns=this.parseColumns(e.getColumns())):(n.field=e.getField(),!0===this.config.columns||null==this.config.columns?((s=Object.keys(o)).push("width"),s.push("visible")):s=this.config.columns,s.forEach(t=>{switch(t){case"width":n.width=e.getWidth();break;case"visible":n.visible=e.visible;break;default:"function"!=typeof o[t]&&-1===i.indexOf(t)&&(n[t]=o[t])}})),t.push(n)}),t}}var Jr={format:{formatters:{responsiveCollapse:function(e,t,i){var s=document.createElement("div"),n=e.getRow()._row.modules.responsiveLayout;function o(e){var t=n.element;n.open=e,t&&(n.open?(s.classList.add("open"),t.style.display=""):(s.classList.remove("open"),t.style.display="none"))}return s.classList.add("tabulator-responsive-collapse-toggle"),s.innerHTML='<svg class=\'tabulator-responsive-collapse-toggle-open\' viewbox="0 0 24 24">\n  <line x1="7" y1="12" x2="17" y2="12" fill="none" stroke-width="3" stroke-linecap="round" />\n  <line y1="7" x1="12" y2="17" x2="12" fill="none" stroke-width="3" stroke-linecap="round" />\n</svg>\n\n<svg class=\'tabulator-responsive-collapse-toggle-close\' viewbox="0 0 24 24">\n  <line x1="7" y1="12" x2="17" y2="12"  fill="none" stroke-width="3" stroke-linecap="round" />\n</svg>',e.getElement().classList.add("tabulator-row-handle"),s.addEventListener("click",function(t){t.stopImmediatePropagation(),o(!n.open),e.getTable().rowManager.adjustTableSize()}),o(n.open),s}}}},Zr={format:{formatters:{rowSelection:function(e,t,i){var s=document.createElement("input"),n=!1;if(s.type="checkbox",s.setAttribute("aria-label","Select Row"),this.table.modExists("selectRow",!0))if(s.addEventListener("click",e=>{e.stopPropagation()}),"function"==typeof e.getRow){var o=e.getRow();o instanceof dr?(s.addEventListener("change",e=>{"click"===this.table.options.selectableRowsRangeMode&&n?n=!1:o.toggleSelect()}),"click"===this.table.options.selectableRowsRangeMode&&s.addEventListener("click",e=>{n=!0,this.table.modules.selectRow.handleComplexRowClick(o._row,e)}),s.checked=o.isSelected&&o.isSelected(),this.table.modules.selectRow.registerRowSelectCheckbox(o,s)):s=""}else s.addEventListener("change",e=>{this.table.modules.selectRow.selectedRows.length?this.table.deselectRow():this.table.selectRow(t.rowRange)}),this.table.modules.selectRow.registerHeaderSelectCheckbox(s);return s}}}};class Qr{constructor(e){return this._range=e,new Proxy(this,{get:function(e,t,i){return void 0!==e[t]?e[t]:e._range.table.componentFunctionBinder.handle("range",e._range,t)}})}getElement(){return this._range.element}getData(){return this._range.getData()}getCells(){return this._range.getCells(!0,!0)}getStructuredCells(){return this._range.getStructuredCells()}getRows(){return this._range.getRows().map(e=>e.getComponent())}getColumns(){return this._range.getColumns().map(e=>e.getComponent())}getBounds(){return this._range.getBounds()}getTopEdge(){return this._range.top}getBottomEdge(){return this._range.bottom}getLeftEdge(){return this._range.left}getRightEdge(){return this._range.right}setBounds(e,t){this._range.destroyedGuard("setBounds")&&this._range.setBounds(e?e._cell:e,t?t._cell:t)}setStartBound(e){this._range.destroyedGuard("setStartBound")&&(this._range.setEndBound(e?e._cell:e),this._range.rangeManager.layoutElement())}setEndBound(e){this._range.destroyedGuard("setEndBound")&&(this._range.setEndBound(e?e._cell:e),this._range.rangeManager.layoutElement())}clearValues(){this._range.destroyedGuard("clearValues")&&this._range.clearValues()}remove(){this._range.destroyedGuard("remove")&&this._range.destroy(!0)}}class el extends Ba{constructor(e,t,i,s){super(e),this.rangeManager=t,this.element=null,this.initialized=!1,this.initializing={start:!1,end:!1},this.destroyed=!1,this.top=0,this.bottom=0,this.left=0,this.right=0,this.table=e,this.start={row:void 0,col:void 0},this.end={row:void 0,col:void 0},this.rangeManager.rowHeader&&(this.left=1,this.right=1,this.start.col=1,this.end.col=1),this.initElement(),setTimeout(()=>{this.initBounds(i,s)})}initElement(){this.element=document.createElement("div"),this.element.classList.add("tabulator-range")}initBounds(e,t){this._updateMinMax(),e&&this.setBounds(e,t||e)}setStart(e,t){this.start.row===e&&this.start.col===t||(this.start.row=e,this.start.col=t,this.initializing.start=!0,this._updateMinMax())}setEnd(e,t){this.end.row===e&&this.end.col===t||(this.end.row=e,this.end.col=t,this.initializing.end=!0,this._updateMinMax())}setBounds(e,t,i){e&&this.setStartBound(e),this.setEndBound(t||e),this.rangeManager.layoutElement(i)}setStartBound(e){var t,i;"column"===e.type?this.rangeManager.columnSelection&&this.setStart(0,e.getPosition()-1):(t=e.row.position-1,i=e.column.getPosition()-1,e.column===this.rangeManager.rowHeader?this.setStart(t,1):this.setStart(t,i))}setEndBound(e){var t,i,s,n=this._getTableRows().length;"column"===e.type?this.rangeManager.columnSelection&&("column"===this.rangeManager.selecting?this.setEnd(n-1,e.getPosition()-1):"cell"===this.rangeManager.selecting&&this.setEnd(0,e.getPosition()-1)):(t=e.row.position-1,i=e.column.getPosition()-1,s=e.column===this.rangeManager.rowHeader,"row"===this.rangeManager.selecting?this.setEnd(t,this._getTableColumns().length-1):"row"!==this.rangeManager.selecting&&s?this.setEnd(t,0):"column"===this.rangeManager.selecting?this.setEnd(n-1,i):this.setEnd(t,i))}_updateMinMax(){this.top=Math.min(this.start.row,this.end.row),this.bottom=Math.max(this.start.row,this.end.row),this.left=Math.min(this.start.col,this.end.col),this.right=Math.max(this.start.col,this.end.col),this.initialized?this.dispatchExternal("rangeChanged",this.getComponent()):this.initializing.start&&this.initializing.end&&(this.initialized=!0,this.dispatchExternal("rangeAdded",this.getComponent()))}_getTableColumns(){return this.table.columnManager.getVisibleColumnsByIndex()}_getTableRows(){return this.table.rowManager.getDisplayRows().filter(e=>"row"===e.type)}layout(){var e,t,i,s,n,o,a,r,l,h,c=this.table.rowManager.renderer.vDomTop,d=this.table.rowManager.renderer.vDomBottom,u=this.table.columnManager.renderer.leftCol,p=this.table.columnManager.renderer.rightCol;"virtual"===this.table.options.renderHorizontal&&this.rangeManager.rowHeader&&(p+=1),null==c&&(c=0),null==d&&(d=1/0),null==u&&(u=0),null==p&&(p=1/0),this.overlaps(u,c,p,d)&&(e=Math.max(this.top,c),t=Math.min(this.bottom,d),i=Math.max(this.left,u),s=Math.min(this.right,p),n=this.rangeManager.getCell(e,i),o=this.rangeManager.getCell(t,s),a=n.getElement(),r=o.getElement(),l=n.row.getElement(),h=o.row.getElement(),this.element.classList.add("tabulator-range-active"),this.table.rtl?(this.element.style.right=l.offsetWidth-a.offsetLeft-a.offsetWidth+"px",this.element.style.width=a.offsetLeft+a.offsetWidth-r.offsetLeft+"px"):(this.element.style.left=l.offsetLeft+a.offsetLeft+"px",this.element.style.width=r.offsetLeft+r.offsetWidth-a.offsetLeft+"px"),this.element.style.top=l.offsetTop+"px",this.element.style.height=h.offsetTop+h.offsetHeight-l.offsetTop+"px")}atTopLeft(e){return e.row.position-1===this.top&&e.column.getPosition()-1===this.left}atBottomRight(e){return e.row.position-1===this.bottom&&e.column.getPosition()-1===this.right}occupies(e){return this.occupiesRow(e.row)&&this.occupiesColumn(e.column)}occupiesRow(e){return this.top<=e.position-1&&e.position-1<=this.bottom}occupiesColumn(e){return this.left<=e.getPosition()-1&&e.getPosition()-1<=this.right}overlaps(e,t,i,s){return!(this.left>i||e>this.right||this.top>s||t>this.bottom)}getData(){var e=[],t=this.getRows(),i=this.getColumns();return t.forEach(t=>{var s=t.getData(),n={};i.forEach(e=>{n[e.field]=s[e.field]}),e.push(n)}),e}getCells(e,t){var i=[],s=this.getRows(),n=this.getColumns();return e?i=s.map(e=>{var i=[];return e.getCells().forEach(e=>{n.includes(e.column)&&i.push(t?e.getComponent():e)}),i}):s.forEach(e=>{e.getCells().forEach(e=>{n.includes(e.column)&&i.push(t?e.getComponent():e)})}),i}getStructuredCells(){return this.getCells(!0,!0)}getRows(){return this._getTableRows().slice(this.top,this.bottom+1)}getColumns(){return this._getTableColumns().slice(this.left,this.right+1)}clearValues(){var e=this.getCells(),t=this.table.options.selectableRangeClearCellsValue;this.table.blockRedraw(),e.forEach(e=>{e.setValue(t)}),this.table.restoreRedraw()}getBounds(e){var t=this.getCells(!1,e),i={start:null,end:null};return t.length?(i.start=t[0],i.end=t[t.length-1]):console.warn("No bounds defined on range"),i}getComponent(){return this.component||(this.component=new Qr(this)),this.component}destroy(e){this.destroyed=!0,this.element.remove(),e&&this.rangeManager.rangeRemoved(this),this.initialized&&this.dispatchExternal("rangeRemoved",this.getComponent())}destroyedGuard(e){return this.destroyed&&console.warn("You cannot call the "+e+" function on a destroyed range"),!this.destroyed}}var tl={keybindings:{bindings:{rangeJumpUp:["ctrl + 38","meta + 38"],rangeJumpDown:["ctrl + 40","meta + 40"],rangeJumpLeft:["ctrl + 37","meta + 37"],rangeJumpRight:["ctrl + 39","meta + 39"],rangeExpandUp:"shift + 38",rangeExpandDown:"shift + 40",rangeExpandLeft:"shift + 37",rangeExpandRight:"shift + 39",rangeExpandJumpUp:["ctrl + shift + 38","meta + shift + 38"],rangeExpandJumpDown:["ctrl + shift + 40","meta + shift + 40"],rangeExpandJumpLeft:["ctrl + shift + 37","meta + shift + 37"],rangeExpandJumpRight:["ctrl + shift + 39","meta + shift + 39"]},actions:{rangeJumpLeft:function(e){this.dispatch("keybinding-nav-range",e,"left",!0,!1)},rangeJumpRight:function(e){this.dispatch("keybinding-nav-range",e,"right",!0,!1)},rangeJumpUp:function(e){this.dispatch("keybinding-nav-range",e,"up",!0,!1)},rangeJumpDown:function(e){this.dispatch("keybinding-nav-range",e,"down",!0,!1)},rangeExpandLeft:function(e){this.dispatch("keybinding-nav-range",e,"left",!1,!0)},rangeExpandRight:function(e){this.dispatch("keybinding-nav-range",e,"right",!1,!0)},rangeExpandUp:function(e){this.dispatch("keybinding-nav-range",e,"up",!1,!0)},rangeExpandDown:function(e){this.dispatch("keybinding-nav-range",e,"down",!1,!0)},rangeExpandJumpLeft:function(e){this.dispatch("keybinding-nav-range",e,"left",!0,!0)},rangeExpandJumpRight:function(e){this.dispatch("keybinding-nav-range",e,"right",!0,!0)},rangeExpandJumpUp:function(e){this.dispatch("keybinding-nav-range",e,"up",!0,!0)},rangeExpandJumpDown:function(e){this.dispatch("keybinding-nav-range",e,"down",!0,!0)}}},clipboard:{pasteActions:{range:function(e){var t,i,s,n,o,a=[],r=this.table.modules.selectRange.activeRange,l=!1;return o=e.length,r&&(i=(t=r.getBounds()).start,t.start===t.end&&(l=!0),i&&(s=(a=this.table.rowManager.activeRows.slice()).indexOf(i.row),n=l?e.length:a.indexOf(t.end.row)-s+1,s>-1&&(this.table.blockRedraw(),(a=a.slice(s,s+n)).forEach((t,i)=>{t.updateData(e[i%o])}),this.table.restoreRedraw()))),a}},pasteParsers:{range:function(e){var t,i,s,n,o,a=[],r=[],l=this.table.modules.selectRange.activeRange,h=!1;return!!(l&&(i=(t=l.getBounds()).start,t.start===t.end&&(h=!0),i&&((e=e.split("\n")).forEach(function(e){a.push(e.split("\t"))}),a.length&&(o=(n=this.table.columnManager.getVisibleColumnsByIndex()).indexOf(i.column))>-1)))&&(s=h?a[0].length:n.indexOf(t.end.column)-o+1,n=n.slice(o,o+s),a.forEach(e=>{var t={},i=e.length;n.forEach(function(s,n){t[s.field]=e[n%i]}),r.push(t)}),r)}}},export:{columnLookups:{range:function(){var e=this.modules.selectRange.selectedColumns();return this.columnManager.rowHeader&&e.unshift(this.columnManager.rowHeader),e}},rowLookups:{range:function(){return this.modules.selectRange.selectedRows()}}}};function il(e,t,i,s,n,o,a){var r=this.table.dependencyRegistry.lookup(["luxon","DateTime"],"DateTime"),l=a.format||"dd/MM/yyyy HH:mm:ss",h=a.alignEmptyValues,c=0;if(void 0!==r){if(r.isDateTime(e)||(e="iso"===l?r.fromISO(String(e)):"x"===l?r.fromMillis(e):r.fromFormat(String(e),l)),r.isDateTime(t)||(t="iso"===l?r.fromISO(String(t)):"x"===l?r.fromMillis(t):r.fromFormat(String(t),l)),e.isValid){if(t.isValid)return e-t;c=1}else c=t.isValid?-1:0;return("top"===h&&"desc"===o||"bottom"===h&&"asc"===o)&&(c*=-1),c}console.error("Sort Error - 'datetime' sorter is dependant on luxon.js")}var sl={number:function(e,t,i,s,n,o,a){var r=a.alignEmptyValues,l=a.decimalSeparator,h=a.thousandSeparator,c=0;if(e=String(e),t=String(t),h&&(e=e.split(h).join(""),t=t.split(h).join("")),l&&(e=e.split(l).join("."),t=t.split(l).join(".")),e=parseFloat(e),t=parseFloat(t),isNaN(e))c=isNaN(t)?0:-1;else{if(!isNaN(t))return e-t;c=1}return("top"===r&&"desc"===o||"bottom"===r&&"asc"===o)&&(c*=-1),c},string:function(e,t,i,s,n,o,a){var r,l=a.alignEmptyValues,h=0;if(e){if(t){switch(typeof a.locale){case"boolean":a.locale&&(r=this.langLocale());break;case"string":r=a.locale}return String(e).toLowerCase().localeCompare(String(t).toLowerCase(),r)}h=1}else h=t?-1:0;return("top"===l&&"desc"===o||"bottom"===l&&"asc"===o)&&(h*=-1),h},date:function(e,t,i,s,n,o,a){return a.format||(a.format="dd/MM/yyyy"),il.call(this,e,t,i,s,n,o,a)},time:function(e,t,i,s,n,o,a){return a.format||(a.format="HH:mm"),il.call(this,e,t,i,s,n,o,a)},datetime:il,boolean:function(e,t,i,s,n,o,a){return(!0===e||"true"===e||"True"===e||1===e?1:0)-(!0===t||"true"===t||"True"===t||1===t?1:0)},array:function(e,t,i,s,n,o,a){var r,l=a.type||"length",h=a.alignEmptyValues,c=0,d=this.table;function u(e){var t;switch(r&&(e=r(e)),l){case"length":t=e.length;break;case"sum":t=e.reduce(function(e,t){return e+t});break;case"max":t=Math.max.apply(null,e);break;case"min":t=Math.min.apply(null,e);break;case"avg":t=e.reduce(function(e,t){return e+t})/e.length;break;case"string":t=e.join("")}return t}if(a.valueMap&&(r="string"==typeof a.valueMap?function(e){return e.map(e=>Va.retrieveNestedData(d.options.nestedFieldSeparator,a.valueMap,e))}:a.valueMap),Array.isArray(e)){if(Array.isArray(t))return"string"===l?String(u(e)).toLowerCase().localeCompare(String(u(t)).toLowerCase()):u(t)-u(e);c=1}else c=Array.isArray(t)?-1:0;return("top"===h&&"desc"===o||"bottom"===h&&"asc"===o)&&(c*=-1),c},exists:function(e,t,i,s,n,o,a){return(void 0===e?0:1)-(void 0===t?0:1)},alphanum:function(e,t,i,s,n,o,a){var r,l,h,c,d,u=0,p=/(\d+)|(\D+)/g,m=/\d/,g=a.alignEmptyValues,b=0;if(e||0===e){if(t||0===t){if(isFinite(e)&&isFinite(t))return e-t;if((r=String(e).toLowerCase())===(l=String(t).toLowerCase()))return 0;if(!m.test(r)||!m.test(l))return r>l?1:-1;for(r=r.match(p),l=l.match(p),d=r.length>l.length?l.length:r.length;u<d;)if((h=r[u])!==(c=l[u++]))return isFinite(h)&&isFinite(c)?("0"===h.charAt(0)&&(h="."+h),"0"===c.charAt(0)&&(c="."+c),h-c):h>c?1:-1;return r.length>l.length}b=1}else b=t||0===t?-1:0;return("top"===g&&"desc"===o||"bottom"===g&&"asc"===o)&&(b*=-1),b}};class nl extends Ga{static moduleName="sort";static sorters=sl;constructor(e){super(e),this.sortList=[],this.changed=!1,this.registerTableOption("sortMode","local"),this.registerTableOption("initialSort",!1),this.registerTableOption("columnHeaderSortMulti",!0),this.registerTableOption("sortOrderReverse",!1),this.registerTableOption("headerSortElement","<div class='tabulator-arrow'></div>"),this.registerTableOption("headerSortClickElement","header"),this.registerColumnOption("sorter"),this.registerColumnOption("sorterParams"),this.registerColumnOption("headerSort",!0),this.registerColumnOption("headerSortStartingDir"),this.registerColumnOption("headerSortTristate")}initialize(){this.subscribe("column-layout",this.initializeColumn.bind(this)),this.subscribe("table-built",this.tableBuilt.bind(this)),this.registerDataHandler(this.sort.bind(this),20),this.registerTableFunction("setSort",this.userSetSort.bind(this)),this.registerTableFunction("getSorters",this.getSort.bind(this)),this.registerTableFunction("clearSort",this.clearSort.bind(this)),"remote"===this.table.options.sortMode&&this.subscribe("data-params",this.remoteSortParams.bind(this))}tableBuilt(){this.table.options.initialSort&&this.setSort(this.table.options.initialSort)}remoteSortParams(e,t,i,s){var n=this.getSort();return n.forEach(e=>{delete e.column}),s.sort=n,s}userSetSort(e,t){this.setSort(e,t),this.refreshSort()}clearSort(){this.clear(),this.refreshSort()}initializeColumn(e){var t,i,s=!1;switch(typeof e.definition.sorter){case"string":nl.sorters[e.definition.sorter]?s=nl.sorters[e.definition.sorter]:console.warn("Sort Error - No such sorter found: ",e.definition.sorter);break;case"function":s=e.definition.sorter}if(e.modules.sort={sorter:s,dir:"none",params:e.definition.sorterParams||{},startingDir:e.definition.headerSortStartingDir||"asc",tristate:e.definition.headerSortTristate},!1!==e.definition.headerSort){switch((t=e.getElement()).classList.add("tabulator-sortable"),(i=document.createElement("div")).classList.add("tabulator-col-sorter"),"icon"===this.table.options.headerSortClickElement?i.classList.add("tabulator-col-sorter-element"):t.classList.add("tabulator-col-sorter-element"),this.table.options.headerSortElement){case"function":break;case"object":i.appendChild(this.table.options.headerSortElement);break;default:i.innerHTML=this.table.options.headerSortElement}e.titleHolderElement.appendChild(i),e.modules.sort.element=i,this.setColumnHeaderSortIcon(e,"none"),"icon"===this.table.options.headerSortClickElement&&i.addEventListener("mousedown",e=>{e.stopPropagation()}),("icon"===this.table.options.headerSortClickElement?i:t).addEventListener("click",t=>{var i="",s=[],n=!1;if(e.modules.sort){if(e.modules.sort.tristate)i="none"==e.modules.sort.dir?e.modules.sort.startingDir:e.modules.sort.dir==e.modules.sort.startingDir?"asc"==e.modules.sort.dir?"desc":"asc":"none";else switch(e.modules.sort.dir){case"asc":i="desc";break;case"desc":i="asc";break;default:i=e.modules.sort.startingDir}this.table.options.columnHeaderSortMulti&&(t.shiftKey||t.ctrlKey)?(n=(s=this.getSort()).findIndex(t=>t.field===e.getField()),n>-1?(s[n].dir=i,n=s.splice(n,1)[0],"none"!=i&&s.push(n)):"none"!=i&&s.push({column:e,dir:i}),this.setSort(s)):"none"==i?this.clear():this.setSort(e,i),this.refreshSort()}})}}refreshSort(){"remote"===this.table.options.sortMode?this.reloadData(null,!1,!1):this.refreshData(!0)}hasChanged(){var e=this.changed;return this.changed=!1,e}getSort(){var e=[];return this.sortList.forEach(function(t){t.column&&e.push({column:t.column.getComponent(),field:t.column.getField(),dir:t.dir})}),e}setSort(e,t){var i=this,s=[];Array.isArray(e)||(e=[{column:e,dir:t}]),e.forEach(function(e){var t;(t=i.table.columnManager.findColumn(e.column))?(e.column=t,s.push(e),i.changed=!0):console.warn("Sort Warning - Sort field does not exist and is being ignored: ",e.column)}),i.sortList=s,this.dispatch("sort-changed")}clear(){this.setSort([])}findSorter(e){var t,i=this.table.rowManager.activeRows[0],s="string";if(i&&(i=i.getData(),e.getField()))switch(typeof(t=e.getFieldValue(i))){case"undefined":s="string";break;case"boolean":s="boolean";break;default:isNaN(Number(t))||""===t?t.match(/((^[0-9]+[a-z]+)|(^[a-z]+[0-9]+))+$/i)&&(s="alphanum"):s="number"}return nl.sorters[s]}sort(e,t){var i=this,s=this.table.options.sortOrderReverse?i.sortList.slice().reverse():i.sortList,n=[],o=[];return this.subscribedExternal("dataSorting")&&this.dispatchExternal("dataSorting",i.getSort()),t||i.clearColumnHeaders(),"remote"!==this.table.options.sortMode?(s.forEach(function(e,s){var o;e.column&&((o=e.column.modules.sort)&&(o.sorter||(o.sorter=i.findSorter(e.column)),e.params="function"==typeof o.params?o.params(e.column.getComponent(),e.dir):o.params,n.push(e)),t||i.setColumnHeader(e.column,e.dir))}),n.length&&i._sortItems(e,n)):t||s.forEach(function(e,t){i.setColumnHeader(e.column,e.dir)}),this.subscribedExternal("dataSorted")&&(e.forEach(e=>{o.push(e.getComponent())}),this.dispatchExternal("dataSorted",i.getSort(),o)),e}clearColumnHeaders(){this.table.columnManager.getRealColumns().forEach(e=>{e.modules.sort&&(e.modules.sort.dir="none",e.getElement().setAttribute("aria-sort","none"),this.setColumnHeaderSortIcon(e,"none"))})}setColumnHeader(e,t){e.modules.sort.dir=t,e.getElement().setAttribute("aria-sort","asc"===t?"ascending":"descending"),this.setColumnHeaderSortIcon(e,t)}setColumnHeaderSortIcon(e,t){var i,s=e.modules.sort.element;if(e.definition.headerSort&&"function"==typeof this.table.options.headerSortElement){for(;s.firstChild;)s.removeChild(s.firstChild);"object"==typeof(i=this.table.options.headerSortElement.call(this.table,e.getComponent(),t))?s.appendChild(i):s.innerHTML=i}}_sortItems(e,t){var i=t.length-1;e.sort((e,s)=>{for(var n,o=i;o>=0;o--){let i=t[o];if(0!==(n=this._sortRow(e,s,i.column,i.dir,i.params)))break}return n})}_sortRow(e,t,i,s,n){var o,a,r="asc"==s?e:t,l="asc"==s?t:e;return e=void 0!==(e=i.getFieldValue(r.getData()))?e:"",t=void 0!==(t=i.getFieldValue(l.getData()))?t:"",o=r.getComponent(),a=l.getComponent(),i.modules.sort.sorter.call(this,e,t,o,a,i.getComponent(),s,n)}}class ol{constructor(e,t){this.columnCount=e,this.rowCount=t,this.columnString=[],this.columns=[],this.rows=[]}genColumns(e){var t=Math.max(this.columnCount,Math.max(...e.map(e=>e.length)));this.columnString=[],this.columns=[];for(let e=1;e<=t;e++)this.incrementChar(this.columnString.length-1),this.columns.push(this.columnString.join(""));return this.columns}genRows(e){var t=Math.max(this.rowCount,e.length);this.rows=[];for(let e=1;e<=t;e++)this.rows.push(e);return this.rows}incrementChar(e){let t=this.columnString[e];t?"Z"!==t?this.columnString[e]=String.fromCharCode(this.columnString[e].charCodeAt(0)+1):(this.columnString[e]="A",e?this.incrementChar(e-1):this.columnString.push("A")):this.columnString.push("A")}setRowCount(e){this.rowCount=e}setColumnCount(e){this.columnCount=e}}class al{constructor(e){return this._sheet=e,new Proxy(this,{get:function(e,t,i){return void 0!==e[t]?e[t]:e._sheet.table.componentFunctionBinder.handle("sheet",e._sheet,t)}})}getTitle(){return this._sheet.title}getKey(){return this._sheet.key}getDefinition(){return this._sheet.getDefinition()}getData(){return this._sheet.getData()}setData(e){return this._sheet.setData(e)}clear(){return this._sheet.clear()}remove(){return this._sheet.remove()}active(){return this._sheet.active()}setTitle(e){return this._sheet.setTitle(e)}setRows(e){return this._sheet.setRows(e)}setColumns(e){return this._sheet.setColumns(e)}}class rl extends Ba{constructor(e,t){super(e.table),this.spreadsheetManager=e,this.definition=t,this.title=this.definition.title||"",this.key=this.definition.key||this.definition.title,this.rowCount=this.definition.rows,this.columnCount=this.definition.columns,this.data=this.definition.data||[],this.element=null,this.isActive=!1,this.grid=new ol(this.columnCount,this.rowCount),this.defaultColumnDefinition={width:100,headerHozAlign:"center",headerSort:!1},this.columnDefinition=Object.assign(this.defaultColumnDefinition,this.options("spreadsheetColumnDefinition")),this.columnDefs=[],this.rowDefs=[],this.columnFields=[],this.columns=[],this.rows=[],this.scrollTop=null,this.scrollLeft=null,this.initialize(),this.dispatchExternal("sheetAdded",this.getComponent())}initialize(){this.initializeElement(),this.initializeColumns(),this.initializeRows()}reinitialize(){this.initializeColumns(),this.initializeRows()}initializeElement(){this.element=document.createElement("div"),this.element.classList.add("tabulator-spreadsheet-tab"),this.element.innerText=this.title,this.element.addEventListener("click",()=>{this.spreadsheetManager.loadSheet(this)})}initializeColumns(){this.grid.setColumnCount(this.columnCount),this.columnFields=this.grid.genColumns(this.data),this.columnDefs=[],this.columnFields.forEach(e=>{var t=Object.assign({},this.columnDefinition);t.field=e,t.title=e,this.columnDefs.push(t)})}initializeRows(){var e;this.grid.setRowCount(this.rowCount),e=this.grid.genRows(this.data),this.rowDefs=[],e.forEach((e,t)=>{var i={_id:e},s=this.data[t];s&&s.forEach((e,t)=>{var s=this.columnFields[t];s&&(i[s]=e)}),this.rowDefs.push(i)})}unload(){this.isActive=!1,this.scrollTop=this.table.rowManager.scrollTop,this.scrollLeft=this.table.rowManager.scrollLeft,this.data=this.getData(!0),this.element.classList.remove("tabulator-spreadsheet-tab-active")}load(){var e=!this.isActive;this.isActive=!0,this.table.blockRedraw(),this.table.setData([]),this.table.setColumns(this.columnDefs),this.table.setData(this.rowDefs),this.table.restoreRedraw(),e&&null!==this.scrollTop&&(this.table.rowManager.element.scrollLeft=this.scrollLeft,this.table.rowManager.element.scrollTop=this.scrollTop),this.element.classList.add("tabulator-spreadsheet-tab-active"),this.dispatchExternal("sheetLoaded",this.getComponent())}getComponent(){return new al(this)}getDefinition(){return{title:this.title,key:this.key,rows:this.rowCount,columns:this.columnCount,data:this.getData()}}getData(e){var t,i,s,n=[];return this.rowDefs.forEach(e=>{var t=[];this.columnFields.forEach(i=>{t.push(e[i])}),n.push(t)}),e||this.options("spreadsheetOutputFull")||(t=n.map(e=>e.findLastIndex(e=>void 0!==e)+1),i=Math.max(...t),s=t.findLastIndex(e=>e>0)+1,n=(n=n.slice(0,s)).map(e=>e.slice(0,i))),n}setData(e){this.data=e,this.reinitialize(),this.dispatchExternal("sheetUpdated",this.getComponent()),this.isActive&&this.load()}clear(){this.setData([])}setTitle(e){this.title=e,this.element.innerText=e,this.dispatchExternal("sheetUpdated",this.getComponent())}setRows(e){this.rowCount=e,this.initializeRows(),this.dispatchExternal("sheetUpdated",this.getComponent()),this.isActive&&this.load()}setColumns(e){this.columnCount=e,this.reinitialize(),this.dispatchExternal("sheetUpdated",this.getComponent()),this.isActive&&this.load()}remove(){this.spreadsheetManager.removeSheet(this)}destroy(){this.element.parentNode&&this.element.parentNode.removeChild(this.element),this.dispatchExternal("sheetRemoved",this.getComponent())}active(){this.spreadsheetManager.loadSheet(this)}}var ll={integer:function(e,t,i){return""===t||null==t||(t=Number(t),!isNaN(t)&&isFinite(t)&&Math.floor(t)===t)},float:function(e,t,i){return""===t||null==t||(t=Number(t),!isNaN(t)&&isFinite(t)&&t%1!=0)},numeric:function(e,t,i){return""===t||null==t||!isNaN(t)},string:function(e,t,i){return""===t||null==t||isNaN(t)},alphanumeric:function(e,t,i){return""===t||null==t||new RegExp(/^[a-z0-9]+$/i).test(t)},max:function(e,t,i){return""===t||null==t||parseFloat(t)<=i},min:function(e,t,i){return""===t||null==t||parseFloat(t)>=i},starts:function(e,t,i){return""===t||null==t||String(t).toLowerCase().startsWith(String(i).toLowerCase())},ends:function(e,t,i){return""===t||null==t||String(t).toLowerCase().endsWith(String(i).toLowerCase())},minLength:function(e,t,i){return""===t||null==t||String(t).length>=i},maxLength:function(e,t,i){return""===t||null==t||String(t).length<=i},in:function(e,t,i){return""===t||null==t||("string"==typeof i&&(i=i.split("|")),i.indexOf(t)>-1)},regex:function(e,t,i){return""===t||null==t||new RegExp(i).test(t)},unique:function(e,t,i){if(""===t||null==t)return!0;var s=!0,n=e.getData(),o=e.getColumn()._getSelf();return this.table.rowManager.rows.forEach(function(e){var i=e.getData();i!==n&&t==o.getFieldValue(i)&&(s=!1)}),s},required:function(e,t,i){return""!==t&&null!=t}};class hl extends Ga{static moduleName="validate";static validators=ll;constructor(e){super(e),this.invalidCells=[],this.registerTableOption("validationMode","blocking"),this.registerColumnOption("validator"),this.registerTableFunction("getInvalidCells",this.getInvalidCells.bind(this)),this.registerTableFunction("clearCellValidation",this.userClearCellValidation.bind(this)),this.registerTableFunction("validate",this.userValidate.bind(this)),this.registerComponentFunction("cell","isValid",this.cellIsValid.bind(this)),this.registerComponentFunction("cell","clearValidation",this.clearValidation.bind(this)),this.registerComponentFunction("cell","validate",this.cellValidate.bind(this)),this.registerComponentFunction("column","validate",this.columnValidate.bind(this)),this.registerComponentFunction("row","validate",this.rowValidate.bind(this))}initialize(){this.subscribe("cell-delete",this.clearValidation.bind(this)),this.subscribe("column-layout",this.initializeColumnCheck.bind(this)),this.subscribe("edit-success",this.editValidate.bind(this)),this.subscribe("edit-editor-clear",this.editorClear.bind(this)),this.subscribe("edit-edited-clear",this.editedClear.bind(this))}editValidate(e,t,i){var s="manual"===this.table.options.validationMode||this.validate(e.column.modules.validate,e,t);return!0!==s&&setTimeout(()=>{e.getElement().classList.add("tabulator-validation-fail"),this.dispatchExternal("validationFailed",e.getComponent(),t,s)}),s}editorClear(e,t){t&&e.column.modules.validate&&this.cellValidate(e),e.getElement().classList.remove("tabulator-validation-fail")}editedClear(e){e.modules.validate&&(e.modules.validate.invalid=!1)}cellIsValid(e){return e.modules.validate&&e.modules.validate.invalid||!0}cellValidate(e){return this.validate(e.column.modules.validate,e,e.getValue())}columnValidate(e){var t=[];return e.cells.forEach(e=>{!0!==this.cellValidate(e)&&t.push(e.getComponent())}),!t.length||t}rowValidate(e){var t=[];return e.cells.forEach(e=>{!0!==this.cellValidate(e)&&t.push(e.getComponent())}),!t.length||t}userClearCellValidation(e){e||(e=this.getInvalidCells()),Array.isArray(e)||(e=[e]),e.forEach(e=>{this.clearValidation(e._getSelf())})}userValidate(e){var t=[];return this.table.rowManager.rows.forEach(e=>{var i=(e=e.getComponent()).validate();!0!==i&&(t=t.concat(i))}),!t.length||t}initializeColumnCheck(e){void 0!==e.definition.validator&&this.initializeColumn(e)}initializeColumn(e){var t,i=this,s=[];e.definition.validator&&(Array.isArray(e.definition.validator)?e.definition.validator.forEach(e=>{(t=i._extractValidator(e))&&s.push(t)}):(t=this._extractValidator(e.definition.validator))&&s.push(t),e.modules.validate=!!s.length&&s)}_extractValidator(e){var t,i,s;switch(typeof e){case"string":return(s=e.indexOf(":"))>-1?(t=e.substring(0,s),i=e.substring(s+1)):t=e,this._buildValidator(t,i);case"function":return this._buildValidator(e);case"object":return this._buildValidator(e.type,e.parameters)}}_buildValidator(e,t){var i="function"==typeof e?e:hl.validators[e];return i?{type:"function"==typeof e?"function":e,func:i,params:t}:(console.warn("Validator Setup Error - No matching validator found:",e),!1)}validate(e,t,i){var s=this,n=[],o=this.invalidCells.indexOf(t);return e&&e.forEach(e=>{e.func.call(s,t.getComponent(),i,e.params)||n.push({type:e.type,parameters:e.params})}),t.modules.validate||(t.modules.validate={}),n.length?(t.modules.validate.invalid=n,"manual"!==this.table.options.validationMode&&t.getElement().classList.add("tabulator-validation-fail"),-1==o&&this.invalidCells.push(t)):(t.modules.validate.invalid=!1,t.getElement().classList.remove("tabulator-validation-fail"),o>-1&&this.invalidCells.splice(o,1)),!n.length||n}getInvalidCells(){var e=[];return this.invalidCells.forEach(t=>{e.push(t.getComponent())}),e}clearValidation(e){var t;e.modules.validate&&e.modules.validate.invalid&&(e.getElement().classList.remove("tabulator-validation-fail"),e.modules.validate.invalid=!1,(t=this.invalidCells.indexOf(e))>-1&&this.invalidCells.splice(t,1))}}var cl=Object.freeze({__proto__:null,AccessorModule:$a,AjaxModule:er,ClipboardModule:nr,ColumnCalcsModule:mr,DataTreeModule:class extends Ga{static moduleName="dataTree";constructor(e){super(e),this.indent=10,this.field="",this.collapseEl=null,this.expandEl=null,this.branchEl=null,this.elementField=!1,this.startOpen=function(){},this.registerTableOption("dataTree",!1),this.registerTableOption("dataTreeFilter",!0),this.registerTableOption("dataTreeSort",!0),this.registerTableOption("dataTreeElementColumn",!1),this.registerTableOption("dataTreeBranchElement",!0),this.registerTableOption("dataTreeChildIndent",9),this.registerTableOption("dataTreeChildField","_children"),this.registerTableOption("dataTreeCollapseElement",!1),this.registerTableOption("dataTreeExpandElement",!1),this.registerTableOption("dataTreeStartExpanded",!1),this.registerTableOption("dataTreeChildColumnCalcs",!1),this.registerTableOption("dataTreeSelectPropagate",!1),this.registerComponentFunction("row","treeCollapse",this.collapseRow.bind(this)),this.registerComponentFunction("row","treeExpand",this.expandRow.bind(this)),this.registerComponentFunction("row","treeToggle",this.toggleRow.bind(this)),this.registerComponentFunction("row","getTreeParent",this.getTreeParent.bind(this)),this.registerComponentFunction("row","getTreeChildren",this.getRowChildren.bind(this)),this.registerComponentFunction("row","addTreeChild",this.addTreeChildRow.bind(this)),this.registerComponentFunction("row","isTreeExpanded",this.isRowExpanded.bind(this))}initialize(){if(this.table.options.dataTree){var e=null,t=this.table.options;switch(this.field=t.dataTreeChildField,this.indent=t.dataTreeChildIndent,this.options("movableRows")&&console.warn("The movableRows option is not available with dataTree enabled, moving of child rows could result in unpredictable behavior"),t.dataTreeBranchElement?!0===t.dataTreeBranchElement?(this.branchEl=document.createElement("div"),this.branchEl.classList.add("tabulator-data-tree-branch")):"string"==typeof t.dataTreeBranchElement?((e=document.createElement("div")).innerHTML=t.dataTreeBranchElement,this.branchEl=e.firstChild):this.branchEl=t.dataTreeBranchElement:(this.branchEl=document.createElement("div"),this.branchEl.classList.add("tabulator-data-tree-branch-empty")),t.dataTreeCollapseElement?"string"==typeof t.dataTreeCollapseElement?((e=document.createElement("div")).innerHTML=t.dataTreeCollapseElement,this.collapseEl=e.firstChild):this.collapseEl=t.dataTreeCollapseElement:(this.collapseEl=document.createElement("div"),this.collapseEl.classList.add("tabulator-data-tree-control"),this.collapseEl.tabIndex=0,this.collapseEl.innerHTML="<div class='tabulator-data-tree-control-collapse'></div>"),t.dataTreeExpandElement?"string"==typeof t.dataTreeExpandElement?((e=document.createElement("div")).innerHTML=t.dataTreeExpandElement,this.expandEl=e.firstChild):this.expandEl=t.dataTreeExpandElement:(this.expandEl=document.createElement("div"),this.expandEl.classList.add("tabulator-data-tree-control"),this.expandEl.tabIndex=0,this.expandEl.innerHTML="<div class='tabulator-data-tree-control-expand'></div>"),typeof t.dataTreeStartExpanded){case"boolean":this.startOpen=function(e,i){return t.dataTreeStartExpanded};break;case"function":this.startOpen=t.dataTreeStartExpanded;break;default:this.startOpen=function(e,i){return t.dataTreeStartExpanded[i]}}this.subscribe("row-init",this.initializeRow.bind(this)),this.subscribe("row-layout-after",this.layoutRow.bind(this)),this.subscribe("row-deleting",this.rowDeleting.bind(this)),this.subscribe("row-deleted",this.rowDelete.bind(this),0),this.subscribe("row-data-changed",this.rowDataChanged.bind(this),10),this.subscribe("cell-value-updated",this.cellValueChanged.bind(this)),this.subscribe("edit-cancelled",this.cellValueChanged.bind(this)),this.subscribe("column-moving-rows",this.columnMoving.bind(this)),this.subscribe("table-built",this.initializeElementField.bind(this)),this.subscribe("table-redrawing",this.tableRedrawing.bind(this)),this.registerDisplayHandler(this.getRows.bind(this),30)}}tableRedrawing(e){e&&this.table.rowManager.getRows().forEach(e=>{this.reinitializeRowChildren(e)})}initializeElementField(){var e=this.table.columnManager.getFirstVisibleColumn();this.elementField=this.table.options.dataTreeElementColumn||!!e&&e.field}getRowChildren(e){return this.getTreeChildren(e,!0)}columnMoving(){var e=[];return this.table.rowManager.rows.forEach(t=>{e=e.concat(this.getTreeChildren(t,!1,!0))}),e}rowDataChanged(e,t,i){this.redrawNeeded(i)&&(this.initializeRow(e),t&&(this.layoutRow(e),this.refreshData(!0)))}cellValueChanged(e){e.column.getField()===this.elementField&&this.layoutRow(e.row)}initializeRow(e){var t=e.getData()[this.field],i=Array.isArray(t),s=i||!i&&"object"==typeof t&&null!==t;!s&&e.modules.dataTree&&e.modules.dataTree.branchEl&&e.modules.dataTree.branchEl.parentNode&&e.modules.dataTree.branchEl.parentNode.removeChild(e.modules.dataTree.branchEl),!s&&e.modules.dataTree&&e.modules.dataTree.controlEl&&e.modules.dataTree.controlEl.parentNode&&e.modules.dataTree.controlEl.parentNode.removeChild(e.modules.dataTree.controlEl),e.modules.dataTree={index:e.modules.dataTree?e.modules.dataTree.index:0,open:!!s&&(e.modules.dataTree?e.modules.dataTree.open:this.startOpen(e.getComponent(),0)),controlEl:!(!e.modules.dataTree||!s)&&e.modules.dataTree.controlEl,branchEl:!(!e.modules.dataTree||!s)&&e.modules.dataTree.branchEl,parent:!!e.modules.dataTree&&e.modules.dataTree.parent,children:s}}reinitializeRowChildren(e){this.getTreeChildren(e,!1,!0).forEach(function(e){e.reinitialize(!0)})}layoutRow(e){var t=(this.elementField?e.getCell(this.elementField):e.getCells()[0]).getElement(),i=e.modules.dataTree;i.branchEl&&(i.branchEl.parentNode&&i.branchEl.parentNode.removeChild(i.branchEl),i.branchEl=!1),i.controlEl&&(i.controlEl.parentNode&&i.controlEl.parentNode.removeChild(i.controlEl),i.controlEl=!1),this.generateControlElement(e,t),e.getElement().classList.add("tabulator-tree-level-"+i.index),i.index&&(this.branchEl?(i.branchEl=this.branchEl.cloneNode(!0),t.insertBefore(i.branchEl,t.firstChild),this.table.rtl?i.branchEl.style.marginRight=(i.branchEl.offsetWidth+i.branchEl.style.marginLeft)*(i.index-1)+i.index*this.indent+"px":i.branchEl.style.marginLeft=(i.branchEl.offsetWidth+i.branchEl.style.marginRight)*(i.index-1)+i.index*this.indent+"px"):this.table.rtl?t.style.paddingRight=parseInt(window.getComputedStyle(t,null).getPropertyValue("padding-right"))+i.index*this.indent+"px":t.style.paddingLeft=parseInt(window.getComputedStyle(t,null).getPropertyValue("padding-left"))+i.index*this.indent+"px")}generateControlElement(e,t){var i=e.modules.dataTree,s=i.controlEl;t=t||e.getCells()[0].getElement(),!1!==i.children&&(i.open?(i.controlEl=this.collapseEl.cloneNode(!0),i.controlEl.addEventListener("click",t=>{t.stopPropagation(),this.collapseRow(e)})):(i.controlEl=this.expandEl.cloneNode(!0),i.controlEl.addEventListener("click",t=>{t.stopPropagation(),this.expandRow(e)})),i.controlEl.addEventListener("mousedown",e=>{e.stopPropagation()}),s&&s.parentNode===t?s.parentNode.replaceChild(i.controlEl,s):t.insertBefore(i.controlEl,t.firstChild))}getRows(e){var t=[];return e.forEach((e,i)=>{var s;t.push(e),e instanceof ur&&(e.create(),(s=e.modules.dataTree).index||!1===s.children||this.getChildren(e,!1,!0).forEach(e=>{e.create(),t.push(e)}))}),t}getChildren(e,t,i){var s=e.modules.dataTree,n=[],o=[];return!1!==s.children&&(s.open||t)&&(Array.isArray(s.children)||(s.children=this.generateChildren(e)),n=this.table.modExists("filter")&&this.table.options.dataTreeFilter?this.table.modules.filter.filter(s.children):s.children,this.table.modExists("sort")&&this.table.options.dataTreeSort&&this.table.modules.sort.sort(n,i),n.forEach(e=>{o.push(e),this.getChildren(e,!1,!0).forEach(e=>{o.push(e)})})),o}generateChildren(e){var t=[],i=e.getData()[this.field];return Array.isArray(i)||(i=[i]),i.forEach(i=>{var s=new ur(i||{},this.table.rowManager);s.create(),s.modules.dataTree.index=e.modules.dataTree.index+1,s.modules.dataTree.parent=e,s.modules.dataTree.children&&(s.modules.dataTree.open=this.startOpen(s.getComponent(),s.modules.dataTree.index)),t.push(s)}),t}expandRow(e,t){var i=e.modules.dataTree;!1!==i.children&&(i.open=!0,e.reinitialize(),this.refreshData(!0),this.dispatchExternal("dataTreeRowExpanded",e.getComponent(),e.modules.dataTree.index))}collapseRow(e){var t=e.modules.dataTree;!1!==t.children&&(t.open=!1,e.reinitialize(),this.refreshData(!0),this.dispatchExternal("dataTreeRowCollapsed",e.getComponent(),e.modules.dataTree.index))}toggleRow(e){var t=e.modules.dataTree;!1!==t.children&&(t.open?this.collapseRow(e):this.expandRow(e))}isRowExpanded(e){return e.modules.dataTree.open}getTreeParent(e){return!!e.modules.dataTree.parent&&e.modules.dataTree.parent.getComponent()}getTreeParentRoot(e){return e.modules.dataTree&&e.modules.dataTree.parent?this.getTreeParentRoot(e.modules.dataTree.parent):e}getFilteredTreeChildren(e){var t=e.modules.dataTree,i=[];return t.children&&(Array.isArray(t.children)||(t.children=this.generateChildren(e)),(this.table.modExists("filter")&&this.table.options.dataTreeFilter?this.table.modules.filter.filter(t.children):t.children).forEach(e=>{e instanceof ur&&i.push(e)})),i}rowDeleting(e){var t=e.modules.dataTree;t&&t.children&&Array.isArray(t.children)&&t.children.forEach(e=>{e instanceof ur&&e.wipe()})}rowDelete(e){var t,i=e.modules.dataTree.parent;i&&(!1!==(t=this.findChildIndex(e,i))&&i.data[this.field].splice(t,1),i.data[this.field].length||delete i.data[this.field],this.initializeRow(i),this.layoutRow(i)),this.refreshData(!0)}addTreeChildRow(e,t,i,s){var n=!1;"string"==typeof t&&(t=JSON.parse(t)),Array.isArray(e.data[this.field])||(e.data[this.field]=[],e.modules.dataTree.open=this.startOpen(e.getComponent(),e.modules.dataTree.index)),void 0!==s&&!1!==(n=this.findChildIndex(s,e))&&e.data[this.field].splice(i?n:n+1,0,t),!1===n&&(i?e.data[this.field].unshift(t):e.data[this.field].push(t)),this.initializeRow(e),this.layoutRow(e),this.refreshData(!0)}findChildIndex(e,t){var i=!1;return"object"==typeof e?e instanceof ur?i=e.data:e instanceof dr?i=e._getSelf().data:"undefined"!=typeof HTMLElement&&e instanceof HTMLElement?t.modules.dataTree&&(i=t.modules.dataTree.children.find(t=>t instanceof ur&&t.element===e))&&(i=i.data):null===e&&(i=!1):i=void 0!==e&&t.data[this.field].find(t=>t.data[this.table.options.index]==e),i&&(Array.isArray(t.data[this.field])&&(i=t.data[this.field].indexOf(i)),-1==i&&(i=!1)),i}getTreeChildren(e,t,i){var s=e.modules.dataTree,n=[];return s&&s.children&&(Array.isArray(s.children)||(s.children=this.generateChildren(e)),s.children.forEach(e=>{e instanceof ur&&(n.push(t?e.getComponent():e),i&&this.getTreeChildren(e,t,i).forEach(e=>{n.push(e)}))})),n}getChildField(){return this.field}redrawNeeded(e){return!!this.field&&void 0!==e[this.field]||!!this.elementField&&void 0!==e[this.elementField]}},DownloadModule:br,EditModule:_r,ExportModule:Er,FilterModule:Mr,FormatModule:Sr,FrozenColumnsModule:class extends Ga{static moduleName="frozenColumns";constructor(e){super(e),this.leftColumns=[],this.rightColumns=[],this.initializationMode="left",this.active=!1,this.blocked=!0,this.registerColumnOption("frozen")}reset(){this.initializationMode="left",this.leftColumns=[],this.rightColumns=[],this.active=!1}initialize(){this.subscribe("cell-layout",this.layoutCell.bind(this)),this.subscribe("column-init",this.initializeColumn.bind(this)),this.subscribe("column-width",this.layout.bind(this)),this.subscribe("row-layout-after",this.layoutRow.bind(this)),this.subscribe("table-layout",this.layout.bind(this)),this.subscribe("columns-loading",this.reset.bind(this)),this.subscribe("column-add",this.reinitializeColumns.bind(this)),this.subscribe("column-deleted",this.reinitializeColumns.bind(this)),this.subscribe("column-hide",this.reinitializeColumns.bind(this)),this.subscribe("column-show",this.reinitializeColumns.bind(this)),this.subscribe("columns-loaded",this.reinitializeColumns.bind(this)),this.subscribe("table-redraw",this.layout.bind(this)),this.subscribe("layout-refreshing",this.blockLayout.bind(this)),this.subscribe("layout-refreshed",this.unblockLayout.bind(this)),this.subscribe("scrollbar-vertical",this.adjustForScrollbar.bind(this))}blockLayout(){this.blocked=!0}unblockLayout(){this.blocked=!1}layoutCell(e){this.layoutElement(e.element,e.column)}reinitializeColumns(){this.reset(),this.table.columnManager.columnsByIndex.forEach(e=>{this.initializeColumn(e)}),this.layout()}initializeColumn(e){var t={margin:0,edge:!1};e.isGroup||(this.frozenCheck(e)?(t.position=this.initializationMode,"left"==this.initializationMode?this.leftColumns.push(e):this.rightColumns.unshift(e),this.active=!0,e.modules.frozen=t):this.initializationMode="right")}frozenCheck(e){return e.parent.isGroup&&e.definition.frozen&&console.warn("Frozen Column Error - Parent column group must be frozen, not individual columns or sub column groups"),e.parent.isGroup?this.frozenCheck(e.parent):e.definition.frozen}layoutCalcRows(){this.table.modExists("columnCalcs")&&(this.table.modules.columnCalcs.topInitialized&&this.table.modules.columnCalcs.topRow&&this.layoutRow(this.table.modules.columnCalcs.topRow),this.table.modules.columnCalcs.botInitialized&&this.table.modules.columnCalcs.botRow&&this.layoutRow(this.table.modules.columnCalcs.botRow),this.table.modExists("groupRows")&&this.layoutGroupCalcs(this.table.modules.groupRows.getGroups()))}layoutGroupCalcs(e){e.forEach(e=>{e.calcs.top&&this.layoutRow(e.calcs.top),e.calcs.bottom&&this.layoutRow(e.calcs.bottom),e.groupList&&e.groupList.length&&this.layoutGroupCalcs(e.groupList)})}layoutColumnPosition(e){var t=[],i=0,s=0;this.leftColumns.forEach((s,n)=>{if(s.modules.frozen.marginValue=i,s.modules.frozen.margin=s.modules.frozen.marginValue+"px",s.visible&&(i+=s.getWidth()),n==this.leftColumns.length-1?s.modules.frozen.edge=!0:s.modules.frozen.edge=!1,s.parent.isGroup){var o=this.getColGroupParentElement(s);t.includes(o)||(this.layoutElement(o,s),t.push(o)),o.classList.toggle("tabulator-frozen-left",s.modules.frozen.edge&&"left"===s.modules.frozen.position),o.classList.toggle("tabulator-frozen-right",s.modules.frozen.edge&&"right"===s.modules.frozen.position)}else this.layoutElement(s.getElement(),s);e&&s.cells.forEach(e=>{this.layoutElement(e.getElement(!0),s)})}),this.rightColumns.forEach((t,i)=>{t.modules.frozen.marginValue=s,t.modules.frozen.margin=t.modules.frozen.marginValue+"px",t.visible&&(s+=t.getWidth()),i==this.rightColumns.length-1?t.modules.frozen.edge=!0:t.modules.frozen.edge=!1,t.parent.isGroup?this.layoutElement(this.getColGroupParentElement(t),t):this.layoutElement(t.getElement(),t),e&&t.cells.forEach(e=>{this.layoutElement(e.getElement(!0),t)})})}getColGroupParentElement(e){return e.parent.isGroup?this.getColGroupParentElement(e.parent):e.getElement()}layout(){this.active&&!this.blocked&&(this.layoutColumnPosition(),this.reinitializeRows(),this.layoutCalcRows())}reinitializeRows(){var e=this.table.rowManager.getVisibleRows(!0);this.table.rowManager.getRows().filter(t=>!e.includes(t)).forEach(e=>{e.deinitialize()}),e.forEach(e=>{"row"===e.type&&this.layoutRow(e)})}layoutRow(e){"fitDataFill"===this.table.options.layout&&this.rightColumns.length&&(this.table.rowManager.getTableElement().style.minWidth="calc(100% - "+this.rightMargin+")"),this.leftColumns.forEach(t=>{var i=e.getCell(t);i&&this.layoutElement(i.getElement(!0),t)}),this.rightColumns.forEach(t=>{var i=e.getCell(t);i&&this.layoutElement(i.getElement(!0),t)})}layoutElement(e,t){var i;t.modules.frozen&&e&&(e.style.position="sticky",i=this.table.rtl?"left"===t.modules.frozen.position?"right":"left":t.modules.frozen.position,e.style[i]=t.modules.frozen.margin,e.classList.add("tabulator-frozen"),e.classList.toggle("tabulator-frozen-left",t.modules.frozen.edge&&"left"===t.modules.frozen.position),e.classList.toggle("tabulator-frozen-right",t.modules.frozen.edge&&"right"===t.modules.frozen.position))}adjustForScrollbar(e){this.rightColumns.length&&(this.table.columnManager.getContentsElement().style.width="calc(100% - "+e+"px)")}getFrozenColumns(){return this.leftColumns.concat(this.rightColumns)}_calcSpace(e,t){var i=0;for(let s=0;s<t;s++)e[s].visible&&(i+=e[s].getWidth());return i}},FrozenRowsModule:class extends Ga{static moduleName="frozenRows";constructor(e){super(e),this.topElement=document.createElement("div"),this.rows=[],this.registerComponentFunction("row","freeze",this.freezeRow.bind(this)),this.registerComponentFunction("row","unfreeze",this.unfreezeRow.bind(this)),this.registerComponentFunction("row","isFrozen",this.isRowFrozen.bind(this)),this.registerTableOption("frozenRowsField","id"),this.registerTableOption("frozenRows",!1)}initialize(){var e=document.createDocumentFragment();this.rows=[],this.topElement.classList.add("tabulator-frozen-rows-holder"),e.appendChild(this.topElement),this.table.columnManager.getContentsElement().insertBefore(e,this.table.columnManager.headersElement.nextSibling),this.subscribe("row-deleting",this.detachRow.bind(this)),this.subscribe("rows-visible",this.visibleRows.bind(this)),this.registerDisplayHandler(this.getRows.bind(this),10),this.table.options.frozenRows&&(this.subscribe("data-processed",this.initializeRows.bind(this)),this.subscribe("row-added",this.initializeRow.bind(this)),this.subscribe("table-redrawing",this.resizeHolderWidth.bind(this)),this.subscribe("column-resized",this.resizeHolderWidth.bind(this)),this.subscribe("column-show",this.resizeHolderWidth.bind(this)),this.subscribe("column-hide",this.resizeHolderWidth.bind(this))),this.resizeHolderWidth()}resizeHolderWidth(){this.topElement.style.minWidth=this.table.columnManager.headersElement.offsetWidth+"px"}initializeRows(){this.table.rowManager.getRows().forEach(e=>{this.initializeRow(e)})}initializeRow(e){var t=this.table.options.frozenRows,i=typeof t;"number"===i?e.getPosition()&&e.getPosition()+this.rows.length<=t&&this.freezeRow(e):"function"===i?t.call(this.table,e.getComponent())&&this.freezeRow(e):Array.isArray(t)&&t.includes(e.data[this.options("frozenRowsField")])&&this.freezeRow(e)}isRowFrozen(e){return this.rows.indexOf(e)>-1}isFrozen(){return!!this.rows.length}visibleRows(e,t){return this.rows.forEach(e=>{t.push(e)}),t}getRows(e){var t=e.slice(0);return this.rows.forEach(function(e){var i=t.indexOf(e);i>-1&&t.splice(i,1)}),t}freezeRow(e){e.modules.frozen?console.warn("Freeze Error - Row is already frozen"):(e.modules.frozen=!0,this.topElement.appendChild(e.getElement()),e.initialize(),e.normalizeHeight(),this.rows.push(e),this.refreshData(!1,"display"),this.table.rowManager.adjustTableSize(),this.styleRows())}unfreezeRow(e){e.modules.frozen?(e.modules.frozen=!1,this.detachRow(e),this.table.rowManager.adjustTableSize(),this.refreshData(!1,"display"),this.rows.length&&this.styleRows()):console.warn("Freeze Error - Row is already unfrozen")}detachRow(e){var t=this.rows.indexOf(e);if(t>-1){var i=e.getElement();i.parentNode&&i.parentNode.removeChild(i),this.rows.splice(t,1)}}styleRows(e){this.rows.forEach((e,t)=>{this.table.rowManager.styleRow(e,t)})}},GroupRowsModule:class extends Ga{static moduleName="groupRows";constructor(e){super(e),this.groupIDLookups=!1,this.startOpen=[function(){return!1}],this.headerGenerator=[function(){return""}],this.groupList=[],this.allowedValues=!1,this.groups={},this.displayHandler=this.getRows.bind(this),this.blockRedraw=!1,this.registerTableOption("groupBy",!1),this.registerTableOption("groupStartOpen",!0),this.registerTableOption("groupValues",!1),this.registerTableOption("groupUpdateOnCellEdit",!1),this.registerTableOption("groupHeader",!1),this.registerTableOption("groupHeaderPrint",null),this.registerTableOption("groupHeaderClipboard",null),this.registerTableOption("groupHeaderHtmlOutput",null),this.registerTableOption("groupHeaderDownload",null),this.registerTableOption("groupToggleElement","arrow"),this.registerTableOption("groupClosedShowCalcs",!1),this.registerTableFunction("setGroupBy",this.setGroupBy.bind(this)),this.registerTableFunction("setGroupValues",this.setGroupValues.bind(this)),this.registerTableFunction("setGroupStartOpen",this.setGroupStartOpen.bind(this)),this.registerTableFunction("setGroupHeader",this.setGroupHeader.bind(this)),this.registerTableFunction("getGroups",this.userGetGroups.bind(this)),this.registerTableFunction("getGroupedData",this.userGetGroupedData.bind(this)),this.registerComponentFunction("row","getGroup",this.rowGetGroup.bind(this))}initialize(){this.subscribe("table-destroy",this._blockRedrawing.bind(this)),this.subscribe("rows-wipe",this._blockRedrawing.bind(this)),this.subscribe("rows-wiped",this._restore_redrawing.bind(this)),this.table.options.groupBy&&(this.table.options.groupUpdateOnCellEdit&&(this.subscribe("cell-value-updated",this.cellUpdated.bind(this)),this.subscribe("row-data-changed",this.reassignRowToGroup.bind(this),0)),this.subscribe("table-built",this.configureGroupSetup.bind(this)),this.subscribe("row-deleting",this.rowDeleting.bind(this)),this.subscribe("row-deleted",this.rowsUpdated.bind(this)),this.subscribe("scroll-horizontal",this.scrollHeaders.bind(this)),this.subscribe("rows-wipe",this.wipe.bind(this)),this.subscribe("rows-added",this.rowsUpdated.bind(this)),this.subscribe("row-moving",this.rowMoving.bind(this)),this.subscribe("row-adding-index",this.rowAddingIndex.bind(this)),this.subscribe("rows-sample",this.rowSample.bind(this)),this.subscribe("render-virtual-fill",this.virtualRenderFill.bind(this)),this.subscribe("table-layout",this.virtualRenderFill.bind(this)),this.registerDisplayHandler(this.displayHandler,20),this.initialized=!0)}_blockRedrawing(){this.blockRedraw=!0}_restore_redrawing(){this.blockRedraw=!1}configureGroupSetup(){if(this.table.options.groupBy){var e=this.table.options.groupBy,t=this.table.options.groupStartOpen,i=this.table.options.groupHeader;this.allowedValues=this.table.options.groupValues,Array.isArray(e)&&Array.isArray(i)&&e.length>i.length&&console.warn("Error creating group headers, groupHeader array is shorter than groupBy array"),this.headerGenerator=[function(){return""}],this.startOpen=[function(){return!1}],this.langBind("groups|item",(e,t)=>{this.headerGenerator[0]=(i,s,n)=>(void 0===i?"":i)+"<span>("+s+" "+(1===s?e:t.groups.items)+")</span>"}),this.groupIDLookups=[],e?this.table.modExists("columnCalcs")&&"table"!=this.table.options.columnCalcs&&"both"!=this.table.options.columnCalcs&&this.table.modules.columnCalcs.removeCalcs():this.table.modExists("columnCalcs")&&"group"!=this.table.options.columnCalcs&&this.table.columnManager.getRealColumns().forEach(e=>{e.definition.topCalc&&this.table.modules.columnCalcs.initializeTopRow(),e.definition.bottomCalc&&this.table.modules.columnCalcs.initializeBottomRow()}),Array.isArray(e)||(e=[e]),e.forEach((e,t)=>{var i,s;i="function"==typeof e?e:(s=this.table.columnManager.getColumnByField(e))?function(e){return s.getFieldValue(e)}:function(t){return t[e]},this.groupIDLookups.push({field:"function"!=typeof e&&e,func:i,values:!!this.allowedValues&&this.allowedValues[t]})}),t&&(Array.isArray(t)||(t=[t]),t.forEach(e=>{}),this.startOpen=t),i&&(this.headerGenerator=Array.isArray(i)?i:[i])}else this.groupList=[],this.groups={}}rowSample(e,t){if(this.table.options.groupBy){var i=this.getGroups(!1)[0];t.push(i.getRows(!1)[0])}return t}virtualRenderFill(){const e=this.layoutMode();"fitDataFill"!==e&&"fitDataStretch"!==e&&"fitColumns"!==e||(this.table.rowManager.tableElement.style.minWidth=this.table.columnManager.getWidth()+"px")}rowAddingIndex(e,t,i){if(this.table.options.groupBy){this.assignRowToGroup(e);var s=e.modules.group.rows;return s.length>1&&(!t||t&&-1==s.indexOf(t)?i?s[0]!==e&&(t=s[0],this.table.rowManager.moveRowInArray(e.modules.group.rows,e,t,!i)):s[s.length-1]!==e&&(t=s[s.length-1],this.table.rowManager.moveRowInArray(e.modules.group.rows,e,t,!i)):this.table.rowManager.moveRowInArray(e.modules.group.rows,e,t,!i)),t}}trackChanges(){this.dispatch("group-changed")}setGroupBy(e){this.table.options.groupBy=e,this.initialized||this.initialize(),this.configureGroupSetup(),!e&&this.table.modExists("columnCalcs")&&!0===this.table.options.columnCalcs&&this.table.modules.columnCalcs.reinitializeCalcs(),this.refreshData(),this.trackChanges()}setGroupValues(e){this.table.options.groupValues=e,this.configureGroupSetup(),this.refreshData(),this.trackChanges()}setGroupStartOpen(e){this.table.options.groupStartOpen=e,this.configureGroupSetup(),this.table.options.groupBy?(this.refreshData(),this.trackChanges()):console.warn("Grouping Update - cant refresh view, no groups have been set")}setGroupHeader(e){this.table.options.groupHeader=e,this.configureGroupSetup(),this.table.options.groupBy?(this.refreshData(),this.trackChanges()):console.warn("Grouping Update - cant refresh view, no groups have been set")}userGetGroups(e){return this.getGroups(!0)}userGetGroupedData(){return this.table.options.groupBy?this.getGroupedData():this.getData()}rowGetGroup(e){return!!e.modules.group&&e.modules.group.getComponent()}rowMoving(e,t,i){if(this.table.options.groupBy){!i&&t instanceof jr&&(t=this.table.rowManager.prevDisplayRow(e)||t);var s=t instanceof jr?t:t.modules.group,n=e instanceof jr?e:e.modules.group;s===n?this.table.rowManager.moveRowInArray(s.rows,e,t,i):(n&&n.removeRow(e),s.insertRow(e,t,i))}}rowDeleting(e){this.table.options.groupBy&&e.modules.group&&e.modules.group.removeRow(e)}rowsUpdated(e){this.table.options.groupBy&&this.updateGroupRows(!0)}cellUpdated(e){this.table.options.groupBy&&this.reassignRowToGroup(e.row)}getRows(e){return this.table.options.groupBy&&this.groupIDLookups.length?(this.dispatchExternal("dataGrouping"),this.generateGroups(e),this.subscribedExternal("dataGrouped")&&this.dispatchExternal("dataGrouped",this.getGroups(!0)),this.updateGroupRows()):e.slice(0)}getGroups(e){var t=[];return this.groupList.forEach(function(i){t.push(e?i.getComponent():i)}),t}getChildGroups(e){var t=[];return e||(e=this),e.groupList.forEach(e=>{e.groupList.length?t=t.concat(this.getChildGroups(e)):t.push(e)}),t}wipe(){this.table.options.groupBy&&(this.groupList.forEach(function(e){e.wipe()}),this.groupList=[],this.groups={})}pullGroupListData(e){var t=[];return e.forEach(e=>{var i={level:0,rowCount:0,headerContent:""},s=[];e.hasSubGroups?(s=this.pullGroupListData(e.groupList),i.level=e.level,i.rowCount=s.length-e.groupList.length,i.headerContent=e.generator(e.key,i.rowCount,e.rows,e),t.push(i),t=t.concat(s)):(i.level=e.level,i.headerContent=e.generator(e.key,e.rows.length,e.rows,e),i.rowCount=e.getRows().length,t.push(i),e.getRows().forEach(e=>{t.push(e.getData("data"))}))}),t}getGroupedData(){return this.pullGroupListData(this.groupList)}getRowGroup(e){var t=!1;return this.options("dataTree")&&(e=this.table.modules.dataTree.getTreeParentRoot(e)),this.groupList.forEach(i=>{var s=i.getRowGroup(e);s&&(t=s)}),t}countGroups(){return this.groupList.length}generateGroups(e){var t=this.groups;this.groups={},this.groupList=[],this.allowedValues&&this.allowedValues[0]?(this.allowedValues[0].forEach(e=>{this.createGroup(e,0,t)}),e.forEach(e=>{this.assignRowToExistingGroup(e,t)})):e.forEach(e=>{this.assignRowToGroup(e,t)}),Object.values(t).forEach(e=>{e.wipe(!0)})}createGroup(e,t,i){var s,n=t+"_"+e;i=i||[],s=new jr(this,!1,t,e,this.groupIDLookups[0].field,this.headerGenerator[0],i[n]),this.groups[n]=s,this.groupList.push(s)}assignRowToExistingGroup(e,t){var i="0_"+this.groupIDLookups[0].func(e.getData());this.groups[i]&&this.groups[i].addRow(e)}assignRowToGroup(e,t){var i=this.groupIDLookups[0].func(e.getData()),s=!this.groups["0_"+i];return s&&this.createGroup(i,0,t),this.groups["0_"+i].addRow(e),!s}reassignRowToGroup(e){if("row"===e.type){var t,i=e.modules.group,s=i.getPath(),n=this.getExpectedPath(e);t=s.length==n.length&&s.every((e,t)=>e===n[t]),t||(i.removeRow(e),this.assignRowToGroup(e,this.groups),this.refreshData(!0))}}getExpectedPath(e){var t=[],i=e.getData();return this.groupIDLookups.forEach(e=>{t.push(e.func(i))}),t}updateGroupRows(e){var t=[];return this.blockRedraw||(this.groupList.forEach(e=>{t=t.concat(e.getHeadersAndRows())}),e&&this.refreshData(!0)),t}scrollHeaders(e){this.table.options.groupBy&&("virtual"===this.table.options.renderHorizontal&&(e-=this.table.columnManager.renderer.vDomPadLeft),e+="px",this.groupList.forEach(t=>{t.scrollHeader(e)}))}removeGroup(e){var t,i=e.level+"_"+e.key;this.groups[i]&&(delete this.groups[i],(t=this.groupList.indexOf(e))>-1&&this.groupList.splice(t,1))}checkBasicModeGroupHeaderWidth(){var e=this.table.rowManager.tableElement,t=!0;this.table.rowManager.getDisplayRows().forEach((i,s)=>{this.table.rowManager.styleRow(i,s),e.appendChild(i.getElement()),i.initialize(!0),"group"!==i.type&&(t=!1)}),e.style.minWidth=t?this.table.columnManager.getWidth()+"px":""}},HistoryModule:Ar,HtmlTableImportModule:class extends Ga{static moduleName="htmlTableImport";constructor(e){super(e),this.fieldIndex=[],this.hasIndex=!1}initialize(){this.tableElementCheck()}tableElementCheck(){this.table.originalElement&&"TABLE"===this.table.originalElement.tagName&&(this.table.originalElement.childNodes.length?this.parseTable():console.warn("Unable to parse data from empty table tag, Tabulator should be initialized on a div tag unless importing data from a table element."))}parseTable(){var e=this.table.originalElement,t=this.table.options,i=e.getElementsByTagName("th"),s=e.getElementsByTagName("tbody")[0],n=[];this.hasIndex=!1,this.dispatchExternal("htmlImporting"),s=s?s.getElementsByTagName("tr"):[],this._extractOptions(e,t),i.length?this._extractHeaders(i,s):this._generateBlankHeaders(i,s);for(var o=0;o<s.length;o++){var a=s[o].getElementsByTagName("td"),r={};this.hasIndex||(r[t.index]=o);for(var l=0;l<a.length;l++){var h=a[l];void 0!==this.fieldIndex[l]&&(r[this.fieldIndex[l]]=h.innerHTML)}n.push(r)}t.data=n,this.dispatchExternal("htmlImported")}_extractOptions(e,t,i){var s=e.attributes,n=i?Object.keys(i):Object.keys(t),o={};for(var a in n.forEach(e=>{o[e.toLowerCase()]=e}),s){var r,l=s[a];l&&"object"==typeof l&&l.name&&0===l.name.indexOf("tabulator-")&&(r=l.name.replace("tabulator-",""),void 0!==o[r]&&(t[o[r]]=this._attribValue(l.value)))}}_attribValue(e){return"true"===e||"false"!==e&&e}_findCol(e){return this.table.options.columns.find(t=>t.title===e)||!1}_extractHeaders(e,t){for(var i=0;i<e.length;i++){var s,n=e[i],o=!1,a=this._findCol(n.textContent);a?o=!0:a={title:n.textContent.trim()},a.field||(a.field=n.textContent.trim().toLowerCase().replaceAll(" ","_")),(s=n.getAttribute("width"))&&!a.width&&(a.width=s),this._extractOptions(n,a,this.table.columnManager.optionsList.registeredDefaults),this.fieldIndex[i]=a.field,a.field==this.table.options.index&&(this.hasIndex=!0),o||this.table.options.columns.push(a)}}_generateBlankHeaders(e,t){for(var i=0;i<e.length;i++){var s=e[i],n={title:"",field:"col"+i};this.fieldIndex[i]=n.field;var o=s.getAttribute("width");o&&(n.width=o),this.table.options.columns.push(n)}}},ImportModule:Fr,InteractionModule:class extends Ga{static moduleName="interaction";constructor(e){super(e),this.eventMap={rowClick:"row-click",rowDblClick:"row-dblclick",rowContext:"row-contextmenu",rowMouseEnter:"row-mouseenter",rowMouseLeave:"row-mouseleave",rowMouseOver:"row-mouseover",rowMouseOut:"row-mouseout",rowMouseMove:"row-mousemove",rowMouseDown:"row-mousedown",rowMouseUp:"row-mouseup",rowTap:"row",rowDblTap:"row",rowTapHold:"row",cellClick:"cell-click",cellDblClick:"cell-dblclick",cellContext:"cell-contextmenu",cellMouseEnter:"cell-mouseenter",cellMouseLeave:"cell-mouseleave",cellMouseOver:"cell-mouseover",cellMouseOut:"cell-mouseout",cellMouseMove:"cell-mousemove",cellMouseDown:"cell-mousedown",cellMouseUp:"cell-mouseup",cellTap:"cell",cellDblTap:"cell",cellTapHold:"cell",headerClick:"column-click",headerDblClick:"column-dblclick",headerContext:"column-contextmenu",headerMouseEnter:"column-mouseenter",headerMouseLeave:"column-mouseleave",headerMouseOver:"column-mouseover",headerMouseOut:"column-mouseout",headerMouseMove:"column-mousemove",headerMouseDown:"column-mousedown",headerMouseUp:"column-mouseup",headerTap:"column",headerDblTap:"column",headerTapHold:"column",groupClick:"group-click",groupDblClick:"group-dblclick",groupContext:"group-contextmenu",groupMouseEnter:"group-mouseenter",groupMouseLeave:"group-mouseleave",groupMouseOver:"group-mouseover",groupMouseOut:"group-mouseout",groupMouseMove:"group-mousemove",groupMouseDown:"group-mousedown",groupMouseUp:"group-mouseup",groupTap:"group",groupDblTap:"group",groupTapHold:"group"},this.subscribers={},this.touchSubscribers={},this.columnSubscribers={},this.touchWatchers={row:{tap:null,tapDbl:null,tapHold:null},cell:{tap:null,tapDbl:null,tapHold:null},column:{tap:null,tapDbl:null,tapHold:null},group:{tap:null,tapDbl:null,tapHold:null}},this.registerColumnOption("headerClick"),this.registerColumnOption("headerDblClick"),this.registerColumnOption("headerContext"),this.registerColumnOption("headerMouseEnter"),this.registerColumnOption("headerMouseLeave"),this.registerColumnOption("headerMouseOver"),this.registerColumnOption("headerMouseOut"),this.registerColumnOption("headerMouseMove"),this.registerColumnOption("headerMouseDown"),this.registerColumnOption("headerMouseUp"),this.registerColumnOption("headerTap"),this.registerColumnOption("headerDblTap"),this.registerColumnOption("headerTapHold"),this.registerColumnOption("cellClick"),this.registerColumnOption("cellDblClick"),this.registerColumnOption("cellContext"),this.registerColumnOption("cellMouseEnter"),this.registerColumnOption("cellMouseLeave"),this.registerColumnOption("cellMouseOver"),this.registerColumnOption("cellMouseOut"),this.registerColumnOption("cellMouseMove"),this.registerColumnOption("cellMouseDown"),this.registerColumnOption("cellMouseUp"),this.registerColumnOption("cellTap"),this.registerColumnOption("cellDblTap"),this.registerColumnOption("cellTapHold")}initialize(){this.initializeExternalEvents(),this.subscribe("column-init",this.initializeColumn.bind(this)),this.subscribe("cell-dblclick",this.cellContentsSelectionFixer.bind(this)),this.subscribe("scroll-horizontal",this.clearTouchWatchers.bind(this)),this.subscribe("scroll-vertical",this.clearTouchWatchers.bind(this))}clearTouchWatchers(){Object.values(this.touchWatchers).forEach(e=>{clearTimeout(e.tapDbl),clearTimeout(e.tapHold);for(let t in e)e[t]=null})}cellContentsSelectionFixer(e,t){var i;if(!this.table.modExists("edit")||this.table.modules.edit.currentCell!==t){e.preventDefault();try{document.selection?((i=document.body.createTextRange()).moveToElementText(t.getElement()),i.select()):window.getSelection&&((i=document.createRange()).selectNode(t.getElement()),window.getSelection().removeAllRanges(),window.getSelection().addRange(i))}catch(e){}}}initializeExternalEvents(){for(let e in this.eventMap)this.subscriptionChangeExternal(e,this.subscriptionChanged.bind(this,e))}subscriptionChanged(e,t){t?this.subscribers[e]||(this.eventMap[e].includes("-")?(this.subscribers[e]=this.handle.bind(this,e),this.subscribe(this.eventMap[e],this.subscribers[e])):this.subscribeTouchEvents(e)):this.eventMap[e].includes("-")?!this.subscribers[e]||this.columnSubscribers[e]||this.subscribedExternal(e)||(this.unsubscribe(this.eventMap[e],this.subscribers[e]),delete this.subscribers[e]):this.unsubscribeTouchEvents(e)}subscribeTouchEvents(e){var t=this.eventMap[e];this.touchSubscribers[t+"-touchstart"]||(this.touchSubscribers[t+"-touchstart"]=this.handleTouch.bind(this,t,"start"),this.touchSubscribers[t+"-touchend"]=this.handleTouch.bind(this,t,"end"),this.subscribe(t+"-touchstart",this.touchSubscribers[t+"-touchstart"]),this.subscribe(t+"-touchend",this.touchSubscribers[t+"-touchend"])),this.subscribers[e]=!0}unsubscribeTouchEvents(e){var t=!0,i=this.eventMap[e];if(this.subscribers[e]&&!this.subscribedExternal(e)){delete this.subscribers[e];for(let e in this.eventMap)this.eventMap[e]===i&&this.subscribers[e]&&(t=!1);t&&(this.unsubscribe(i+"-touchstart",this.touchSubscribers[i+"-touchstart"]),this.unsubscribe(i+"-touchend",this.touchSubscribers[i+"-touchend"]),delete this.touchSubscribers[i+"-touchstart"],delete this.touchSubscribers[i+"-touchend"])}}initializeColumn(e){var t=e.definition;for(let i in this.eventMap)t[i]&&(this.subscriptionChanged(i,!0),this.columnSubscribers[i]||(this.columnSubscribers[i]=[]),this.columnSubscribers[i].push(e))}handle(e,t,i){this.dispatchEvent(e,t,i)}handleTouch(e,t,i,s){var n=this.touchWatchers[e];switch("column"===e&&(e="header"),t){case"start":n.tap=!0,clearTimeout(n.tapHold),n.tapHold=setTimeout(()=>{clearTimeout(n.tapHold),n.tapHold=null,n.tap=null,clearTimeout(n.tapDbl),n.tapDbl=null,this.dispatchEvent(e+"TapHold",i,s)},1e3);break;case"end":n.tap&&(n.tap=null,this.dispatchEvent(e+"Tap",i,s)),n.tapDbl?(clearTimeout(n.tapDbl),n.tapDbl=null,this.dispatchEvent(e+"DblTap",i,s)):n.tapDbl=setTimeout(()=>{clearTimeout(n.tapDbl),n.tapDbl=null},300),clearTimeout(n.tapHold),n.tapHold=null}}dispatchEvent(e,t,i){var s,n=i.getComponent();this.columnSubscribers[e]&&(i instanceof rr?s=i.column.definition[e]:i instanceof cr&&(s=i.definition[e]),s&&s(t,n)),this.dispatchExternal(e,t,n)}},KeybindingsModule:Ir,MenuModule:class extends Ga{static moduleName="menu";constructor(e){super(e),this.menuContainer=null,this.nestedMenuBlock=!1,this.currentComponent=null,this.rootPopup=null,this.columnSubscribers={},this.registerTableOption("rowContextMenu",!1),this.registerTableOption("rowClickMenu",!1),this.registerTableOption("rowDblClickMenu",!1),this.registerTableOption("groupContextMenu",!1),this.registerTableOption("groupClickMenu",!1),this.registerTableOption("groupDblClickMenu",!1),this.registerColumnOption("headerContextMenu"),this.registerColumnOption("headerClickMenu"),this.registerColumnOption("headerDblClickMenu"),this.registerColumnOption("headerMenu"),this.registerColumnOption("headerMenuIcon"),this.registerColumnOption("contextMenu"),this.registerColumnOption("clickMenu"),this.registerColumnOption("dblClickMenu")}initialize(){this.deprecatedOptionsCheck(),this.initializeRowWatchers(),this.initializeGroupWatchers(),this.subscribe("column-init",this.initializeColumn.bind(this))}deprecatedOptionsCheck(){}initializeRowWatchers(){this.table.options.rowContextMenu&&(this.subscribe("row-contextmenu",this.loadMenuEvent.bind(this,this.table.options.rowContextMenu)),this.table.on("rowTapHold",this.loadMenuEvent.bind(this,this.table.options.rowContextMenu))),this.table.options.rowClickMenu&&this.subscribe("row-click",this.loadMenuEvent.bind(this,this.table.options.rowClickMenu)),this.table.options.rowDblClickMenu&&this.subscribe("row-dblclick",this.loadMenuEvent.bind(this,this.table.options.rowDblClickMenu))}initializeGroupWatchers(){this.table.options.groupContextMenu&&(this.subscribe("group-contextmenu",this.loadMenuEvent.bind(this,this.table.options.groupContextMenu)),this.table.on("groupTapHold",this.loadMenuEvent.bind(this,this.table.options.groupContextMenu))),this.table.options.groupClickMenu&&this.subscribe("group-click",this.loadMenuEvent.bind(this,this.table.options.groupClickMenu)),this.table.options.groupDblClickMenu&&this.subscribe("group-dblclick",this.loadMenuEvent.bind(this,this.table.options.groupDblClickMenu))}initializeColumn(e){var t=e.definition;t.headerContextMenu&&!this.columnSubscribers.headerContextMenu&&(this.columnSubscribers.headerContextMenu=this.loadMenuTableColumnEvent.bind(this,"headerContextMenu"),this.subscribe("column-contextmenu",this.columnSubscribers.headerContextMenu),this.table.on("headerTapHold",this.loadMenuTableColumnEvent.bind(this,"headerContextMenu"))),t.headerClickMenu&&!this.columnSubscribers.headerClickMenu&&(this.columnSubscribers.headerClickMenu=this.loadMenuTableColumnEvent.bind(this,"headerClickMenu"),this.subscribe("column-click",this.columnSubscribers.headerClickMenu)),t.headerDblClickMenu&&!this.columnSubscribers.headerDblClickMenu&&(this.columnSubscribers.headerDblClickMenu=this.loadMenuTableColumnEvent.bind(this,"headerDblClickMenu"),this.subscribe("column-dblclick",this.columnSubscribers.headerDblClickMenu)),t.headerMenu&&this.initializeColumnHeaderMenu(e),t.contextMenu&&!this.columnSubscribers.contextMenu&&(this.columnSubscribers.contextMenu=this.loadMenuTableCellEvent.bind(this,"contextMenu"),this.subscribe("cell-contextmenu",this.columnSubscribers.contextMenu),this.table.on("cellTapHold",this.loadMenuTableCellEvent.bind(this,"contextMenu"))),t.clickMenu&&!this.columnSubscribers.clickMenu&&(this.columnSubscribers.clickMenu=this.loadMenuTableCellEvent.bind(this,"clickMenu"),this.subscribe("cell-click",this.columnSubscribers.clickMenu)),t.dblClickMenu&&!this.columnSubscribers.dblClickMenu&&(this.columnSubscribers.dblClickMenu=this.loadMenuTableCellEvent.bind(this,"dblClickMenu"),this.subscribe("cell-dblclick",this.columnSubscribers.dblClickMenu))}initializeColumnHeaderMenu(e){var t,i=e.definition.headerMenuIcon;(t=document.createElement("span")).classList.add("tabulator-header-popup-button"),i?("function"==typeof i&&(i=i(e.getComponent())),i instanceof HTMLElement?t.appendChild(i):t.innerHTML=i):t.innerHTML="&vellip;",t.addEventListener("click",t=>{t.stopPropagation(),t.preventDefault(),this.loadMenuEvent(e.definition.headerMenu,t,e)}),e.titleElement.insertBefore(t,e.titleElement.firstChild)}loadMenuTableCellEvent(e,t,i){i._cell&&(i=i._cell),i.column.definition[e]&&this.loadMenuEvent(i.column.definition[e],t,i)}loadMenuTableColumnEvent(e,t,i){i._column&&(i=i._column),i.definition[e]&&this.loadMenuEvent(i.definition[e],t,i)}loadMenuEvent(e,t,i){i._group?i=i._group:i._row&&(i=i._row),e="function"==typeof e?e.call(this.table,t,i.getComponent()):e,this.loadMenu(t,i,e)}loadMenu(e,t,i,s,n){var o,a=!(e instanceof MouseEvent),r=document.createElement("div");if(r.classList.add("tabulator-menu"),a||e.preventDefault(),i&&i.length){if(s)o=n.child(r);else{if(this.nestedMenuBlock){if(this.rootPopup)return}else this.nestedMenuBlock=setTimeout(()=>{this.nestedMenuBlock=!1},100);this.rootPopup&&this.rootPopup.hide(),this.rootPopup=o=this.popup(r)}i.forEach(e=>{var i=document.createElement("div"),s=e.label,n=e.disabled;e.separator?i.classList.add("tabulator-menu-separator"):(i.classList.add("tabulator-menu-item"),"function"==typeof s&&(s=s.call(this.table,t.getComponent())),s instanceof Node?i.appendChild(s):i.innerHTML=s,"function"==typeof n&&(n=n.call(this.table,t.getComponent())),n?(i.classList.add("tabulator-menu-item-disabled"),i.addEventListener("click",e=>{e.stopPropagation()})):e.menu&&e.menu.length?i.addEventListener("click",s=>{s.stopPropagation(),this.loadMenu(s,t,e.menu,i,o)}):e.action&&i.addEventListener("click",i=>{e.action(i,t.getComponent())}),e.menu&&e.menu.length&&i.classList.add("tabulator-menu-item-submenu")),r.appendChild(i)}),r.addEventListener("click",e=>{this.rootPopup&&this.rootPopup.hide()}),o.show(s||e),o===this.rootPopup&&(this.rootPopup.hideOnBlur(()=>{this.rootPopup=null,this.currentComponent&&(this.dispatch("menu-closed",i,o),this.dispatchExternal("menuClosed",this.currentComponent.getComponent()),this.currentComponent=null)}),this.currentComponent=t,this.dispatch("menu-opened",i,o),this.dispatchExternal("menuOpened",t.getComponent()))}}},MoveColumnsModule:class extends Ga{static moduleName="moveColumn";constructor(e){super(e),this.placeholderElement=this.createPlaceholderElement(),this.hoverElement=!1,this.checkTimeout=!1,this.checkPeriod=250,this.moving=!1,this.toCol=!1,this.toColAfter=!1,this.startX=0,this.autoScrollMargin=40,this.autoScrollStep=5,this.autoScrollTimeout=!1,this.touchMove=!1,this.moveHover=this.moveHover.bind(this),this.endMove=this.endMove.bind(this),this.registerTableOption("movableColumns",!1)}createPlaceholderElement(){var e=document.createElement("div");return e.classList.add("tabulator-col"),e.classList.add("tabulator-col-placeholder"),e}initialize(){this.table.options.movableColumns&&(this.subscribe("column-init",this.initializeColumn.bind(this)),this.subscribe("alert-show",this.abortMove.bind(this)))}abortMove(){clearTimeout(this.checkTimeout)}initializeColumn(e){var t,i=this,s={};e.modules.frozen||e.isGroup||e.isRowHeader||(t=e.getElement(),s.mousemove=function(s){e.parent===i.moving.parent&&((i.touchMove?s.touches[0].pageX:s.pageX)-Va.elOffset(t).left+i.table.columnManager.contentsElement.scrollLeft>e.getWidth()/2?i.toCol===e&&i.toColAfter||(t.parentNode.insertBefore(i.placeholderElement,t.nextSibling),i.moveColumn(e,!0)):(i.toCol!==e||i.toColAfter)&&(t.parentNode.insertBefore(i.placeholderElement,t),i.moveColumn(e,!1)))}.bind(i),t.addEventListener("mousedown",function(t){i.touchMove=!1,1===t.which&&(i.checkTimeout=setTimeout(function(){i.startMove(t,e)},i.checkPeriod))}),t.addEventListener("mouseup",function(e){1===e.which&&i.checkTimeout&&clearTimeout(i.checkTimeout)}),i.bindTouchEvents(e)),e.modules.moveColumn=s}bindTouchEvents(e){var t,i,s,n,o,a,r=e.getElement(),l=!1;r.addEventListener("touchstart",r=>{this.checkTimeout=setTimeout(()=>{this.touchMove=!0,t=e.nextColumn(),s=t?t.getWidth()/2:0,i=e.prevColumn(),n=i?i.getWidth()/2:0,o=0,a=0,l=!1,this.startMove(r,e)},this.checkPeriod)},{passive:!0}),r.addEventListener("touchmove",r=>{var h,c;this.moving&&(this.moveHover(r),l||(l=r.touches[0].pageX),(h=r.touches[0].pageX-l)>0?t&&h-o>s&&(c=t)!==e&&(l=r.touches[0].pageX,c.getElement().parentNode.insertBefore(this.placeholderElement,c.getElement().nextSibling),this.moveColumn(c,!0)):i&&-h-a>n&&(c=i)!==e&&(l=r.touches[0].pageX,c.getElement().parentNode.insertBefore(this.placeholderElement,c.getElement()),this.moveColumn(c,!1)),c&&(t=c.nextColumn(),o=s,s=t?t.getWidth()/2:0,i=c.prevColumn(),a=n,n=i?i.getWidth()/2:0))},{passive:!0}),r.addEventListener("touchend",e=>{this.checkTimeout&&clearTimeout(this.checkTimeout),this.moving&&this.endMove(e)})}startMove(e,t){var i=t.getElement(),s=this.table.columnManager.getContentsElement(),n=this.table.columnManager.getHeadersElement();this.table.modules.selectRange&&this.table.modules.selectRange.columnSelection&&this.table.modules.selectRange.mousedown&&"column"===this.table.modules.selectRange.selecting||(this.moving=t,this.startX=(this.touchMove?e.touches[0].pageX:e.pageX)-Va.elOffset(i).left,this.table.element.classList.add("tabulator-block-select"),this.placeholderElement.style.width=t.getWidth()+"px",this.placeholderElement.style.height=t.getHeight()+"px",i.parentNode.insertBefore(this.placeholderElement,i),i.parentNode.removeChild(i),this.hoverElement=i.cloneNode(!0),this.hoverElement.classList.add("tabulator-moving"),s.appendChild(this.hoverElement),this.hoverElement.style.left="0",this.hoverElement.style.bottom=s.clientHeight-n.offsetHeight+"px",this.touchMove||(this._bindMouseMove(),document.body.addEventListener("mousemove",this.moveHover),document.body.addEventListener("mouseup",this.endMove)),this.moveHover(e),this.dispatch("column-moving",e,this.moving))}_bindMouseMove(){this.table.columnManager.columnsByIndex.forEach(function(e){e.modules.moveColumn.mousemove&&e.getElement().addEventListener("mousemove",e.modules.moveColumn.mousemove)})}_unbindMouseMove(){this.table.columnManager.columnsByIndex.forEach(function(e){e.modules.moveColumn.mousemove&&e.getElement().removeEventListener("mousemove",e.modules.moveColumn.mousemove)})}moveColumn(e,t){var i=this.moving.getCells();this.toCol=e,this.toColAfter=t,t?e.getCells().forEach(function(e,t){var s=e.getElement(!0);s.parentNode&&i[t]&&s.parentNode.insertBefore(i[t].getElement(),s.nextSibling)}):e.getCells().forEach(function(e,t){var s=e.getElement(!0);s.parentNode&&i[t]&&s.parentNode.insertBefore(i[t].getElement(),s)})}endMove(e){(1===e.which||this.touchMove)&&(this._unbindMouseMove(),this.placeholderElement.parentNode.insertBefore(this.moving.getElement(),this.placeholderElement.nextSibling),this.placeholderElement.parentNode.removeChild(this.placeholderElement),this.hoverElement.parentNode.removeChild(this.hoverElement),this.table.element.classList.remove("tabulator-block-select"),this.toCol&&this.table.columnManager.moveColumnActual(this.moving,this.toCol,this.toColAfter),this.moving=!1,this.toCol=!1,this.toColAfter=!1,this.touchMove||(document.body.removeEventListener("mousemove",this.moveHover),document.body.removeEventListener("mouseup",this.endMove)))}moveHover(e){var t,i=this.table.columnManager.getContentsElement(),s=i.scrollLeft,n=(this.touchMove?e.touches[0].pageX:e.pageX)-Va.elOffset(i).left+s;this.hoverElement.style.left=n-this.startX+"px",n-s<this.autoScrollMargin&&(this.autoScrollTimeout||(this.autoScrollTimeout=setTimeout(()=>{t=Math.max(0,s-5),this.table.rowManager.getElement().scrollLeft=t,this.autoScrollTimeout=!1},1))),s+i.clientWidth-n<this.autoScrollMargin&&(this.autoScrollTimeout||(this.autoScrollTimeout=setTimeout(()=>{t=Math.min(i.clientWidth,s+5),this.table.rowManager.getElement().scrollLeft=t,this.autoScrollTimeout=!1},1)))}},MoveRowsModule:Wr,MutatorModule:Ur,PageModule:Yr,PersistenceModule:qr,PopupModule:class extends Ga{static moduleName="popup";constructor(e){super(e),this.columnSubscribers={},this.registerTableOption("rowContextPopup",!1),this.registerTableOption("rowClickPopup",!1),this.registerTableOption("rowDblClickPopup",!1),this.registerTableOption("groupContextPopup",!1),this.registerTableOption("groupClickPopup",!1),this.registerTableOption("groupDblClickPopup",!1),this.registerColumnOption("headerContextPopup"),this.registerColumnOption("headerClickPopup"),this.registerColumnOption("headerDblClickPopup"),this.registerColumnOption("headerPopup"),this.registerColumnOption("headerPopupIcon"),this.registerColumnOption("contextPopup"),this.registerColumnOption("clickPopup"),this.registerColumnOption("dblClickPopup"),this.registerComponentFunction("cell","popup",this._componentPopupCall.bind(this)),this.registerComponentFunction("column","popup",this._componentPopupCall.bind(this)),this.registerComponentFunction("row","popup",this._componentPopupCall.bind(this)),this.registerComponentFunction("group","popup",this._componentPopupCall.bind(this))}initialize(){this.initializeRowWatchers(),this.initializeGroupWatchers(),this.subscribe("column-init",this.initializeColumn.bind(this))}_componentPopupCall(e,t,i){this.loadPopupEvent(t,null,e,i)}initializeRowWatchers(){this.table.options.rowContextPopup&&(this.subscribe("row-contextmenu",this.loadPopupEvent.bind(this,this.table.options.rowContextPopup)),this.table.on("rowTapHold",this.loadPopupEvent.bind(this,this.table.options.rowContextPopup))),this.table.options.rowClickPopup&&this.subscribe("row-click",this.loadPopupEvent.bind(this,this.table.options.rowClickPopup)),this.table.options.rowDblClickPopup&&this.subscribe("row-dblclick",this.loadPopupEvent.bind(this,this.table.options.rowDblClickPopup))}initializeGroupWatchers(){this.table.options.groupContextPopup&&(this.subscribe("group-contextmenu",this.loadPopupEvent.bind(this,this.table.options.groupContextPopup)),this.table.on("groupTapHold",this.loadPopupEvent.bind(this,this.table.options.groupContextPopup))),this.table.options.groupClickPopup&&this.subscribe("group-click",this.loadPopupEvent.bind(this,this.table.options.groupClickPopup)),this.table.options.groupDblClickPopup&&this.subscribe("group-dblclick",this.loadPopupEvent.bind(this,this.table.options.groupDblClickPopup))}initializeColumn(e){var t=e.definition;t.headerContextPopup&&!this.columnSubscribers.headerContextPopup&&(this.columnSubscribers.headerContextPopup=this.loadPopupTableColumnEvent.bind(this,"headerContextPopup"),this.subscribe("column-contextmenu",this.columnSubscribers.headerContextPopup),this.table.on("headerTapHold",this.loadPopupTableColumnEvent.bind(this,"headerContextPopup"))),t.headerClickPopup&&!this.columnSubscribers.headerClickPopup&&(this.columnSubscribers.headerClickPopup=this.loadPopupTableColumnEvent.bind(this,"headerClickPopup"),this.subscribe("column-click",this.columnSubscribers.headerClickPopup)),t.headerDblClickPopup&&!this.columnSubscribers.headerDblClickPopup&&(this.columnSubscribers.headerDblClickPopup=this.loadPopupTableColumnEvent.bind(this,"headerDblClickPopup"),this.subscribe("column-dblclick",this.columnSubscribers.headerDblClickPopup)),t.headerPopup&&this.initializeColumnHeaderPopup(e),t.contextPopup&&!this.columnSubscribers.contextPopup&&(this.columnSubscribers.contextPopup=this.loadPopupTableCellEvent.bind(this,"contextPopup"),this.subscribe("cell-contextmenu",this.columnSubscribers.contextPopup),this.table.on("cellTapHold",this.loadPopupTableCellEvent.bind(this,"contextPopup"))),t.clickPopup&&!this.columnSubscribers.clickPopup&&(this.columnSubscribers.clickPopup=this.loadPopupTableCellEvent.bind(this,"clickPopup"),this.subscribe("cell-click",this.columnSubscribers.clickPopup)),t.dblClickPopup&&!this.columnSubscribers.dblClickPopup&&(this.columnSubscribers.dblClickPopup=this.loadPopupTableCellEvent.bind(this,"dblClickPopup"),this.subscribe("cell-click",this.columnSubscribers.dblClickPopup))}initializeColumnHeaderPopup(e){var t,i=e.definition.headerPopupIcon;(t=document.createElement("span")).classList.add("tabulator-header-popup-button"),i?("function"==typeof i&&(i=i(e.getComponent())),i instanceof HTMLElement?t.appendChild(i):t.innerHTML=i):t.innerHTML="&vellip;",t.addEventListener("click",t=>{t.stopPropagation(),t.preventDefault(),this.loadPopupEvent(e.definition.headerPopup,t,e)}),e.titleElement.insertBefore(t,e.titleElement.firstChild)}loadPopupTableCellEvent(e,t,i){i._cell&&(i=i._cell),i.column.definition[e]&&this.loadPopupEvent(i.column.definition[e],t,i)}loadPopupTableColumnEvent(e,t,i){i._column&&(i=i._column),i.definition[e]&&this.loadPopupEvent(i.definition[e],t,i)}loadPopupEvent(e,t,i,s){var n;i._group?i=i._group:i._row&&(i=i._row),e="function"==typeof e?e.call(this.table,t,i.getComponent(),function(e){n=e}):e,this.loadPopup(t,i,e,n,s)}loadPopup(e,t,i,s,n){var o,a,r=!(e instanceof MouseEvent);i instanceof HTMLElement?o=i:(o=document.createElement("div")).innerHTML=i,o.classList.add("tabulator-popup"),o.addEventListener("click",e=>{e.stopPropagation()}),r||e.preventDefault(),a=this.popup(o),"function"==typeof s&&a.renderCallback(s),e?a.show(e):a.show(t.getElement(),n||"center"),a.hideOnBlur(()=>{this.dispatchExternal("popupClosed",t.getComponent())}),this.dispatchExternal("popupOpened",t.getComponent())}},PrintModule:class extends Ga{static moduleName="print";constructor(e){super(e),this.element=!1,this.manualBlock=!1,this.beforeprintEventHandler=null,this.afterprintEventHandler=null,this.registerTableOption("printAsHtml",!1),this.registerTableOption("printFormatter",!1),this.registerTableOption("printHeader",!1),this.registerTableOption("printFooter",!1),this.registerTableOption("printStyled",!0),this.registerTableOption("printRowRange","visible"),this.registerTableOption("printConfig",{}),this.registerColumnOption("print"),this.registerColumnOption("titlePrint")}initialize(){this.table.options.printAsHtml&&(this.beforeprintEventHandler=this.replaceTable.bind(this),this.afterprintEventHandler=this.cleanup.bind(this),window.addEventListener("beforeprint",this.beforeprintEventHandler),window.addEventListener("afterprint",this.afterprintEventHandler),this.subscribe("table-destroy",this.destroy.bind(this))),this.registerTableFunction("print",this.printFullscreen.bind(this))}destroy(){this.table.options.printAsHtml&&(window.removeEventListener("beforeprint",this.beforeprintEventHandler),window.removeEventListener("afterprint",this.afterprintEventHandler))}replaceTable(){this.manualBlock||(this.element=document.createElement("div"),this.element.classList.add("tabulator-print-table"),this.element.appendChild(this.table.modules.export.generateTable(this.table.options.printConfig,this.table.options.printStyled,this.table.options.printRowRange,"print")),this.table.element.style.display="none",this.table.element.parentNode.insertBefore(this.element,this.table.element))}cleanup(){document.body.classList.remove("tabulator-print-fullscreen-hide"),this.element&&this.element.parentNode&&(this.element.parentNode.removeChild(this.element),this.table.element.style.display="")}printFullscreen(e,t,i){var s,n,o=window.scrollX,a=window.scrollY,r=document.createElement("div"),l=document.createElement("div"),h=this.table.modules.export.generateTable(void 0!==i?i:this.table.options.printConfig,void 0!==t?t:this.table.options.printStyled,e||this.table.options.printRowRange,"print");this.manualBlock=!0,this.element=document.createElement("div"),this.element.classList.add("tabulator-print-fullscreen"),this.table.options.printHeader&&(r.classList.add("tabulator-print-header"),"string"==typeof(s="function"==typeof this.table.options.printHeader?this.table.options.printHeader.call(this.table):this.table.options.printHeader)?r.innerHTML=s:r.appendChild(s),this.element.appendChild(r)),this.element.appendChild(h),this.table.options.printFooter&&(l.classList.add("tabulator-print-footer"),"string"==typeof(n="function"==typeof this.table.options.printFooter?this.table.options.printFooter.call(this.table):this.table.options.printFooter)?l.innerHTML=n:l.appendChild(n),this.element.appendChild(l)),document.body.classList.add("tabulator-print-fullscreen-hide"),document.body.appendChild(this.element),this.table.options.printFormatter&&this.table.options.printFormatter(this.element,h),window.print(),this.cleanup(),window.scrollTo(o,a),this.manualBlock=!1}},ReactiveDataModule:class extends Ga{static moduleName="reactiveData";constructor(e){super(e),this.data=!1,this.blocked=!1,this.origFuncs={},this.currentVersion=0,this.registerTableOption("reactiveData",!1)}initialize(){this.table.options.reactiveData&&(this.subscribe("cell-value-save-before",this.block.bind(this,"cellsave")),this.subscribe("cell-value-save-after",this.unblock.bind(this,"cellsave")),this.subscribe("row-data-save-before",this.block.bind(this,"rowsave")),this.subscribe("row-data-save-after",this.unblock.bind(this,"rowsave")),this.subscribe("row-data-init-after",this.watchRow.bind(this)),this.subscribe("data-processing",this.watchData.bind(this)),this.subscribe("table-destroy",this.unwatchData.bind(this)))}watchData(e){var t,i=this;this.currentVersion++,t=this.currentVersion,this.unwatchData(),this.data=e,this.origFuncs.push=e.push,Object.defineProperty(this.data,"push",{enumerable:!1,configurable:!0,value:function(){var s,n=Array.from(arguments);return i.blocked||t!==i.currentVersion||(i.block("data-push"),n.forEach(e=>{i.table.rowManager.addRowActual(e,!1)}),s=Array.prototype.push.apply(e,arguments),i.unblock("data-push")),s}}),this.origFuncs.unshift=e.unshift,Object.defineProperty(this.data,"unshift",{enumerable:!1,configurable:!0,value:function(){var s,n=Array.from(arguments);return i.blocked||t!==i.currentVersion||(i.block("data-unshift"),n.forEach(e=>{i.table.rowManager.addRowActual(e,!0)}),s=Array.prototype.unshift.apply(e,arguments),i.unblock("data-unshift")),s}}),this.origFuncs.shift=e.shift,Object.defineProperty(this.data,"shift",{enumerable:!1,configurable:!0,value:function(){var s,n;return i.blocked||t!==i.currentVersion||(i.block("data-shift"),i.data.length&&(s=i.table.rowManager.getRowFromDataObject(i.data[0]))&&s.deleteActual(),n=Array.prototype.shift.call(e),i.unblock("data-shift")),n}}),this.origFuncs.pop=e.pop,Object.defineProperty(this.data,"pop",{enumerable:!1,configurable:!0,value:function(){var s,n;return i.blocked||t!==i.currentVersion||(i.block("data-pop"),i.data.length&&(s=i.table.rowManager.getRowFromDataObject(i.data[i.data.length-1]))&&s.deleteActual(),n=Array.prototype.pop.call(e),i.unblock("data-pop")),n}}),this.origFuncs.splice=e.splice,Object.defineProperty(this.data,"splice",{enumerable:!1,configurable:!0,value:function(){var s,n,o=Array.from(arguments),a=o[0]<0?e.length+o[0]:o[0],r=o[1],l=!!o[2]&&o.slice(2);if(!i.blocked&&t===i.currentVersion){if(i.block("data-splice"),l&&((s=!!e[a]&&i.table.rowManager.getRowFromDataObject(e[a]))?l.forEach(e=>{i.table.rowManager.addRowActual(e,!0,s,!0)}):(l=l.slice().reverse()).forEach(e=>{i.table.rowManager.addRowActual(e,!0,!1,!0)})),0!==r){var h=e.slice(a,void 0===o[1]?o[1]:a+r);h.forEach((e,t)=>{var s=i.table.rowManager.getRowFromDataObject(e);s&&s.deleteActual(t!==h.length-1)})}(l||0!==r)&&i.table.rowManager.reRenderInPosition(),n=Array.prototype.splice.apply(e,arguments),i.unblock("data-splice")}return n}})}unwatchData(){if(!1!==this.data)for(var e in this.origFuncs)Object.defineProperty(this.data,e,{enumerable:!0,configurable:!0,writable:!0,value:this.origFuncs[e]})}watchRow(e){var t=e.getData();for(var i in t)this.watchKey(e,t,i);this.table.options.dataTree&&this.watchTreeChildren(e)}watchTreeChildren(e){var t=this,i=e.getData()[this.table.options.dataTreeChildField];i&&(Object.defineProperty(i,"push",{enumerable:!1,configurable:!0,value:function(){var s;return t.blocked||(t.block("tree-push"),s=Array.prototype.push.apply(i,arguments),t.rebuildTree(e),t.unblock("tree-push")),s}}),Object.defineProperty(i,"unshift",{enumerable:!1,configurable:!0,value:function(){var s;return t.blocked||(t.block("tree-unshift"),s=Array.prototype.unshift.apply(i,arguments),t.rebuildTree(e),t.unblock("tree-unshift")),s}}),Object.defineProperty(i,"shift",{enumerable:!1,configurable:!0,value:function(){var s;return t.blocked||(t.block("tree-shift"),s=Array.prototype.shift.call(i),t.rebuildTree(e),t.unblock("tree-shift")),s}}),Object.defineProperty(i,"pop",{enumerable:!1,configurable:!0,value:function(){var s;return t.blocked||(t.block("tree-pop"),s=Array.prototype.pop.call(i),t.rebuildTree(e),t.unblock("tree-pop")),s}}),Object.defineProperty(i,"splice",{enumerable:!1,configurable:!0,value:function(){var s;return t.blocked||(t.block("tree-splice"),s=Array.prototype.splice.apply(i,arguments),t.rebuildTree(e),t.unblock("tree-splice")),s}}))}rebuildTree(e){this.table.modules.dataTree.initializeRow(e),this.table.modules.dataTree.layoutRow(e),this.table.rowManager.refreshActiveData("tree",!1,!0)}watchKey(e,t,i){var s=this,n=Object.getOwnPropertyDescriptor(t,i),o=t[i],a=this.currentVersion;Object.defineProperty(t,i,{set:t=>{if(o=t,!s.blocked&&a===s.currentVersion){s.block("key");var r={};r[i]=t,e.updateData(r),s.unblock("key")}n.set&&n.set(t)},get:()=>(n.get&&n.get(),o)})}unwatchRow(e){var t=e.getData();for(var i in t)Object.defineProperty(t,i,{value:t[i]})}block(e){this.blocked||(this.blocked=e)}unblock(e){this.blocked===e&&(this.blocked=!1)}},ResizeColumnsModule:class extends Ga{static moduleName="resizeColumns";constructor(e){super(e),this.startColumn=!1,this.startX=!1,this.startWidth=!1,this.latestX=!1,this.handle=null,this.initialNextColumn=null,this.nextColumn=null,this.initialized=!1,this.registerColumnOption("resizable",!0),this.registerTableOption("resizableColumnFit",!1),this.registerTableOption("resizableColumnGuide",!1)}initialize(){this.subscribe("column-rendered",this.layoutColumnHeader.bind(this))}initializeEventWatchers(){this.initialized||(this.subscribe("cell-rendered",this.layoutCellHandles.bind(this)),this.subscribe("cell-delete",this.deInitializeComponent.bind(this)),this.subscribe("cell-height",this.resizeHandle.bind(this)),this.subscribe("column-moved",this.columnLayoutUpdated.bind(this)),this.subscribe("column-hide",this.deInitializeColumn.bind(this)),this.subscribe("column-show",this.columnLayoutUpdated.bind(this)),this.subscribe("column-width",this.columnWidthUpdated.bind(this)),this.subscribe("column-delete",this.deInitializeComponent.bind(this)),this.subscribe("column-height",this.resizeHandle.bind(this)),this.initialized=!0)}layoutCellHandles(e){"row"===e.row.type&&(this.deInitializeComponent(e),this.initializeColumn("cell",e,e.column,e.element))}layoutColumnHeader(e){e.definition.resizable&&(this.initializeEventWatchers(),this.deInitializeComponent(e),this.initializeColumn("header",e,e,e.element))}columnLayoutUpdated(e){var t=e.prevColumn();this.reinitializeColumn(e),t&&this.reinitializeColumn(t)}columnWidthUpdated(e){e.modules.frozen&&(this.table.modules.frozenColumns.leftColumns.includes(e)?this.table.modules.frozenColumns.leftColumns.forEach(e=>{this.reinitializeColumn(e)}):this.table.modules.frozenColumns.rightColumns.includes(e)&&this.table.modules.frozenColumns.rightColumns.forEach(e=>{this.reinitializeColumn(e)}))}frozenColumnOffset(e){var t=!1;return e.modules.frozen&&(t=e.modules.frozen.marginValue,"left"===e.modules.frozen.position?t+=e.getWidth()-3:t&&(t-=3)),!1!==t&&t+"px"}reinitializeColumn(e){var t=this.frozenColumnOffset(e);e.cells.forEach(i=>{i.modules.resize&&i.modules.resize.handleEl&&(t&&(i.modules.resize.handleEl.style[e.modules.frozen.position]=t,i.modules.resize.handleEl.style["z-index"]=11),i.element.after(i.modules.resize.handleEl))}),e.modules.resize&&e.modules.resize.handleEl&&(t&&(e.modules.resize.handleEl.style[e.modules.frozen.position]=t),e.element.after(e.modules.resize.handleEl))}initializeColumn(e,t,i,s){var n=this,o=i.definition.resizable,a={},r=i.getLastColumn();if("header"===e&&(a={variableHeight:"textarea"==i.definition.formatter||i.definition.variableHeight}),(!0===o||o==e)&&this._checkResizability(r)){var l=document.createElement("span");l.className="tabulator-col-resize-handle",l.addEventListener("click",function(e){e.stopPropagation()});var h=function(e){n.startColumn=i,n.initialNextColumn=n.nextColumn=r.nextColumn(),n._mouseDown(e,r,l)};l.addEventListener("mousedown",h),l.addEventListener("touchstart",h,{passive:!0}),l.addEventListener("dblclick",e=>{var t=r.getWidth();e.stopPropagation(),r.reinitializeWidth(!0),t!==r.getWidth()&&(n.dispatch("column-resized",r),n.dispatchExternal("columnResized",r.getComponent()))}),i.modules.frozen&&(l.style.position="sticky",l.style[i.modules.frozen.position]=this.frozenColumnOffset(i)),a.handleEl=l,s.parentNode&&i.visible&&s.after(l)}t.modules.resize=a}deInitializeColumn(e){this.deInitializeComponent(e),e.cells.forEach(e=>{this.deInitializeComponent(e)})}deInitializeComponent(e){var t;e.modules.resize&&(t=e.modules.resize.handleEl)&&t.parentElement&&t.parentElement.removeChild(t)}resizeHandle(e,t){e.modules.resize&&e.modules.resize.handleEl&&(e.modules.resize.handleEl.style.height=t)}getResizingClientX(e){if(void 0!==e.clientX)return e.clientX;const t=this.table.options.resizableColumnGuide?e.changedTouches?.[0]:e.touches?.[0];return t?.clientX}resize(e,t){var i=this.getResizingClientX(e);if("number"==typeof i&&isFinite(i)){var s,n,o=i-this.startX,a=i-this.latestX;if(this.latestX=i,this.table.rtl&&(o=-o,a=-a),s=t.width==t.minWidth||t.width==t.maxWidth,t.setWidth(this.startWidth+o),n=t.width==t.minWidth||t.width==t.maxWidth,a<0&&(this.nextColumn=this.initialNextColumn),this.table.options.resizableColumnFit&&this.nextColumn&&(!s||!n)){let e=this.nextColumn.getWidth();a>0&&e<=this.nextColumn.minWidth&&(this.nextColumn=this.nextColumn.nextColumn()),this.nextColumn&&this.nextColumn.setWidth(this.nextColumn.getWidth()-a)}this.table.columnManager.rerenderColumns(!0),!this.table.browserSlow&&t.modules.resize&&t.modules.resize.variableHeight&&t.checkCellHeights()}else console.warn("ResizeColumns: could not resolve pointer X from event",e)}calcGuidePosition(e,t,i){var s=void 0===e.clientX?e.touches[0].clientX:e.clientX,n=i.getBoundingClientRect().x-this.table.element.getBoundingClientRect().x,o=this.table.element.getBoundingClientRect().x,a=t.element.getBoundingClientRect().left-o,r=s-this.startX,l=Math.max(n+r,a+t.minWidth);return t.maxWidth&&(l=Math.min(l,a+t.maxWidth)),l}_checkResizability(e){return e.definition.resizable}_mouseDown(e,t,i){var s,n=this;function o(e){n.table.options.resizableColumnGuide?s.style.left=n.calcGuidePosition(e,t,i)+"px":n.resize(e,t)}function a(e){n.table.options.resizableColumnGuide&&(n.resize(e,t),s.remove()),n.startColumn.modules.edit&&(n.startColumn.modules.edit.blocked=!1),n.table.browserSlow&&t.modules.resize&&t.modules.resize.variableHeight&&t.checkCellHeights(),document.body.removeEventListener("mouseup",a),document.body.removeEventListener("mousemove",o),i.removeEventListener("touchmove",o),i.removeEventListener("touchend",a),n.table.element.classList.remove("tabulator-block-select"),n.startWidth!==t.getWidth()&&(n.table.columnManager.verticalAlignHeaders(),n.dispatch("column-resized",t),n.dispatchExternal("columnResized",t.getComponent()))}this.dispatchExternal("columnResizing",t.getComponent()),n.table.options.resizableColumnGuide&&((s=document.createElement("span")).classList.add("tabulator-col-resize-guide"),n.table.element.appendChild(s),setTimeout(()=>{s.style.left=n.calcGuidePosition(e,t,i)+"px"})),n.table.element.classList.add("tabulator-block-select"),e.stopPropagation(),n.startColumn.modules.edit&&(n.startColumn.modules.edit.blocked=!0),n.startX=void 0===e.clientX?e.touches[0].clientX:e.clientX,n.latestX=n.startX,n.startWidth=t.getWidth(),document.body.addEventListener("mousemove",o),document.body.addEventListener("mouseup",a),i.addEventListener("touchmove",o,{passive:!0}),i.addEventListener("touchend",a)}},ResizeRowsModule:class extends Ga{static moduleName="resizeRows";constructor(e){super(e),this.startColumn=!1,this.startY=!1,this.startHeight=!1,this.handle=null,this.prevHandle=null,this.registerTableOption("resizableRows",!1),this.registerTableOption("resizableRowGuide",!1)}initialize(){this.table.options.resizableRows&&this.subscribe("row-layout-after",this.initializeRow.bind(this))}initializeRow(e){var t=this,i=e.getElement(),s=document.createElement("div");s.className="tabulator-row-resize-handle";var n=document.createElement("div");n.className="tabulator-row-resize-handle prev",s.addEventListener("click",function(e){e.stopPropagation()});var o=function(i){t.startRow=e,t._mouseDown(i,e,s)};s.addEventListener("mousedown",o),s.addEventListener("touchstart",o,{passive:!0}),n.addEventListener("click",function(e){e.stopPropagation()});var a=function(i){var s=t.table.rowManager.prevDisplayRow(e);s&&(t.startRow=s,t._mouseDown(i,s,n))};n.addEventListener("mousedown",a),n.addEventListener("touchstart",a,{passive:!0}),i.appendChild(s),i.appendChild(n)}resize(e,t){t.setHeight(this.startHeight+((void 0===e.screenY?e.touches[0].screenY:e.screenY)-this.startY))}calcGuidePosition(e,t,i){var s=void 0===e.screenY?e.touches[0].screenY:e.screenY,n=i.getBoundingClientRect().y-this.table.element.getBoundingClientRect().y,o=this.table.element.getBoundingClientRect().y,a=t.element.getBoundingClientRect().top-o,r=s-this.startY;return Math.max(n+r,a)}_mouseDown(e,t,i){var s,n=this;function o(e){n.table.options.resizableRowGuide?s.style.top=n.calcGuidePosition(e,t,i)+"px":n.resize(e,t)}function a(e){n.table.options.resizableRowGuide&&(n.resize(e,t),s.remove()),document.body.removeEventListener("mouseup",o),document.body.removeEventListener("mousemove",o),i.removeEventListener("touchmove",o),i.removeEventListener("touchend",a),n.table.element.classList.remove("tabulator-block-select"),n.dispatchExternal("rowResized",t.getComponent())}n.dispatchExternal("rowResizing",t.getComponent()),n.table.options.resizableRowGuide&&((s=document.createElement("span")).classList.add("tabulator-row-resize-guide"),n.table.element.appendChild(s),setTimeout(()=>{s.style.top=n.calcGuidePosition(e,t,i)+"px"})),n.table.element.classList.add("tabulator-block-select"),e.stopPropagation(),n.startY=void 0===e.screenY?e.touches[0].screenY:e.screenY,n.startHeight=t.getHeight(),document.body.addEventListener("mousemove",o),document.body.addEventListener("mouseup",a),i.addEventListener("touchmove",o,{passive:!0}),i.addEventListener("touchend",a)}},ResizeTableModule:class extends Ga{static moduleName="resizeTable";constructor(e){super(e),this.binding=!1,this.visibilityObserver=!1,this.resizeObserver=!1,this.containerObserver=!1,this.tableHeight=0,this.tableWidth=0,this.containerHeight=0,this.containerWidth=0,this.autoResize=!1,this.visible=!1,this.initialized=!1,this.initialRedraw=!1,this.registerTableOption("autoResize",!0)}initialize(){if(this.table.options.autoResize){var e,t=this.table;this.tableHeight=t.element.clientHeight,this.tableWidth=t.element.clientWidth,t.element.parentNode&&(this.containerHeight=t.element.parentNode.clientHeight,this.containerWidth=t.element.parentNode.clientWidth),"undefined"!=typeof IntersectionObserver&&"undefined"!=typeof ResizeObserver&&"virtual"===t.rowManager.getRenderMode()?(this.initializeVisibilityObserver(),this.autoResize=!0,this.resizeObserver=new ResizeObserver(e=>{if(!t.browserMobile||t.browserMobile&&(!t.modules.edit||t.modules.edit&&!t.modules.edit.currentCell)){var i=Math.floor(e[0].contentRect.height),s=Math.floor(e[0].contentRect.width);this.tableHeight==i&&this.tableWidth==s||(this.tableHeight=i,this.tableWidth=s,t.element.parentNode&&(this.containerHeight=t.element.parentNode.clientHeight,this.containerWidth=t.element.parentNode.clientWidth),this.redrawTable())}}),this.resizeObserver.observe(t.element),e=window.getComputedStyle(t.element),this.table.element.parentNode&&!this.table.rowManager.fixedHeight&&(e.getPropertyValue("max-height")||e.getPropertyValue("min-height"))&&(this.containerObserver=new ResizeObserver(e=>{if(!t.browserMobile||t.browserMobile&&(!t.modules.edit||t.modules.edit&&!t.modules.edit.currentCell)){var i=Math.floor(e[0].contentRect.height),s=Math.floor(e[0].contentRect.width);this.containerHeight==i&&this.containerWidth==s||(this.containerHeight=i,this.containerWidth=s,this.tableHeight=t.element.clientHeight,this.tableWidth=t.element.clientWidth),this.redrawTable()}}),this.containerObserver.observe(this.table.element.parentNode)),this.subscribe("table-resize",this.tableResized.bind(this))):(this.binding=function(){(!t.browserMobile||t.browserMobile&&(!t.modules.edit||t.modules.edit&&!t.modules.edit.currentCell))&&(t.columnManager.rerenderColumns(!0),t.redraw())},window.addEventListener("resize",this.binding)),this.subscribe("table-destroy",this.clearBindings.bind(this))}}initializeVisibilityObserver(){this.visibilityObserver=new IntersectionObserver(e=>{this.visible=e[e.length-1].isIntersecting,this.initialized?this.visible&&(this.redrawTable(this.initialRedraw),this.initialRedraw=!1):(this.initialized=!0,this.initialRedraw=!this.visible)}),this.visibilityObserver.observe(this.table.element)}redrawTable(e){this.initialized&&this.visible&&(this.table.columnManager.rerenderColumns(!0),this.table.redraw(e))}tableResized(){this.table.rowManager.redraw()}clearBindings(){this.binding&&window.removeEventListener("resize",this.binding),this.resizeObserver&&this.resizeObserver.unobserve(this.table.element),this.visibilityObserver&&this.visibilityObserver.unobserve(this.table.element),this.containerObserver&&this.containerObserver.unobserve(this.table.element.parentNode)}},ResponsiveLayoutModule:class extends Ga{static moduleName="responsiveLayout";static moduleExtensions=Jr;constructor(e){super(e),this.columns=[],this.hiddenColumns=[],this.mode="",this.index=0,this.collapseFormatter=[],this.collapseStartOpen=!0,this.collapseHandleColumn=!1,this.registerTableOption("responsiveLayout",!1),this.registerTableOption("responsiveLayoutCollapseStartOpen",!0),this.registerTableOption("responsiveLayoutCollapseUseFormatters",!0),this.registerTableOption("responsiveLayoutCollapseFormatter",!1),this.registerColumnOption("responsive")}initialize(){this.table.options.responsiveLayout&&(this.subscribe("column-layout",this.initializeColumn.bind(this)),this.subscribe("column-show",this.updateColumnVisibility.bind(this)),this.subscribe("column-hide",this.updateColumnVisibility.bind(this)),this.subscribe("columns-loaded",this.initializeResponsivity.bind(this)),this.subscribe("column-moved",this.initializeResponsivity.bind(this)),this.subscribe("column-add",this.initializeResponsivity.bind(this)),this.subscribe("column-delete",this.initializeResponsivity.bind(this)),this.subscribe("table-redrawing",this.tableRedraw.bind(this)),"collapse"===this.table.options.responsiveLayout&&(this.subscribe("row-data-changed",this.generateCollapsedRowContent.bind(this)),this.subscribe("row-init",this.initializeRow.bind(this)),this.subscribe("row-layout",this.layoutRow.bind(this))))}tableRedraw(e){-1===["fitColumns","fitDataStretch"].indexOf(this.layoutMode())&&(e||this.update())}initializeResponsivity(){var e=[];this.mode=this.table.options.responsiveLayout,this.collapseFormatter=this.table.options.responsiveLayoutCollapseFormatter||this.formatCollapsedData,this.collapseStartOpen=this.table.options.responsiveLayoutCollapseStartOpen,this.hiddenColumns=[],this.collapseFormatter&&(this.collapseFormatter=this.collapseFormatter.bind(this.table)),this.table.columnManager.columnsByIndex.forEach((t,i)=>{t.modules.responsive&&t.modules.responsive.order&&t.modules.responsive.visible&&(t.modules.responsive.index=i,e.push(t),t.visible||"collapse"!==this.mode||this.hiddenColumns.push(t))}),e=(e=e.reverse()).sort((e,t)=>t.modules.responsive.order-e.modules.responsive.order||t.modules.responsive.index-e.modules.responsive.index),this.columns=e,"collapse"===this.mode&&this.generateCollapsedContent();for(let e of this.table.columnManager.columnsByIndex)if("responsiveCollapse"==e.definition.formatter){this.collapseHandleColumn=e;break}this.collapseHandleColumn&&(this.hiddenColumns.length?this.collapseHandleColumn.show():this.collapseHandleColumn.hide())}initializeColumn(e){var t=e.getDefinition();e.modules.responsive={order:void 0===t.responsive?1:t.responsive,visible:!1!==t.visible}}initializeRow(e){var t;"calc"!==e.type&&((t=document.createElement("div")).classList.add("tabulator-responsive-collapse"),e.modules.responsiveLayout={element:t,open:this.collapseStartOpen},this.collapseStartOpen||(t.style.display="none"))}layoutRow(e){var t=e.getElement();e.modules.responsiveLayout&&(t.appendChild(e.modules.responsiveLayout.element),this.generateCollapsedRowContent(e))}updateColumnVisibility(e,t){!t&&e.modules.responsive&&(e.modules.responsive.visible=e.visible,this.initializeResponsivity())}hideColumn(e){var t=this.hiddenColumns.length;e.hide(!1,!0),"collapse"===this.mode&&(this.hiddenColumns.unshift(e),this.generateCollapsedContent(),this.collapseHandleColumn&&!t&&this.collapseHandleColumn.show())}showColumn(e){var t;e.show(!1,!0),e.setWidth(e.getWidth()),"collapse"===this.mode&&((t=this.hiddenColumns.indexOf(e))>-1&&this.hiddenColumns.splice(t,1),this.generateCollapsedContent(),this.collapseHandleColumn&&!this.hiddenColumns.length&&this.collapseHandleColumn.hide())}update(){for(var e=!0;e;){let t="fitColumns"==this.table.modules.layout.getMode()?this.table.columnManager.getFlexBaseWidth():this.table.columnManager.getWidth(),i=(this.table.options.headerVisible?this.table.columnManager.element.clientWidth:this.table.element.clientWidth)-t;if(i<0){let t=this.columns[this.index];t?(this.hideColumn(t),this.index++):e=!1}else{let t=this.columns[this.index-1];t&&i>0&&i>=t.getWidth()?(this.showColumn(t),this.index--):e=!1}this.table.rowManager.activeRowsCount||this.table.rowManager.renderEmptyScroll()}}generateCollapsedContent(){this.table.rowManager.getDisplayRows().forEach(e=>{this.generateCollapsedRowContent(e)})}generateCollapsedRowContent(e){var t,i;if(e.modules.responsiveLayout){for(t=e.modules.responsiveLayout.element;t.firstChild;)t.removeChild(t.firstChild);(i=this.collapseFormatter(this.generateCollapsedRowData(e)))&&t.appendChild(i),e.calcHeight(!0)}}generateCollapsedRowData(e){var t,i=e.getData(),s=[];return this.hiddenColumns.forEach(n=>{var o=n.getFieldValue(i);if(n.definition.title&&n.field)if(n.modules.format&&this.table.options.responsiveLayoutCollapseUseFormatters){function a(e){e()}t={value:!1,data:{},getValue:function(){return o},getData:function(){return i},getType:function(){return"cell"},getElement:function(){return document.createElement("div")},getRow:function(){return e.getComponent()},getColumn:function(){return n.getComponent()},getTable:()=>this.table},s.push({field:n.field,title:n.definition.title,value:n.modules.format.formatter.call(this.table.modules.format,t,n.modules.format.params,a)})}else s.push({field:n.field,title:n.definition.title,value:o})}),s}formatCollapsedData(e){var t=document.createElement("table");return e.forEach(e=>{var i,s=document.createElement("tr"),n=document.createElement("td"),o=document.createElement("td"),a=document.createElement("strong");n.appendChild(a),this.modules.localize.bind("columns|"+e.field,function(t){a.innerHTML=t||e.title}),e.value instanceof Node?((i=document.createElement("div")).appendChild(e.value),o.appendChild(i)):o.innerHTML=e.value,s.appendChild(n),s.appendChild(o),t.appendChild(s)}),Object.keys(e).length?t:""}},SelectRangeModule:class extends Ga{static moduleName="selectRange";static moduleInitOrder=1;static moduleExtensions=tl;constructor(e){super(e),this.selecting="cell",this.mousedown=!1,this.ranges=[],this.overlay=null,this.rowHeader=null,this.layoutChangeTimeout=null,this.columnSelection=!1,this.rowSelection=!1,this.maxRanges=0,this.activeRange=!1,this.blockKeydown=!1,this.keyDownEvent=this._handleKeyDown.bind(this),this.mouseUpEvent=this._handleMouseUp.bind(this),this.registerTableOption("selectableRange",!1),this.registerTableOption("selectableRangeColumns",!1),this.registerTableOption("selectableRangeRows",!1),this.registerTableOption("selectableRangeClearCells",!1),this.registerTableOption("selectableRangeClearCellsValue",void 0),this.registerTableOption("selectableRangeAutoFocus",!0),this.registerTableOption("selectableRangeInitializeDefault",!0),this.registerTableOption("selectableRangeBlurEditOnNavigate",void 0),this.registerTableFunction("getRangesData",this.getRangesData.bind(this)),this.registerTableFunction("getRanges",this.getRanges.bind(this)),this.registerTableFunction("addRange",this.addRangeFromComponent.bind(this)),this.registerComponentFunction("cell","getRanges",this.cellGetRanges.bind(this)),this.registerComponentFunction("row","getRanges",this.rowGetRanges.bind(this)),this.registerComponentFunction("column","getRanges",this.colGetRanges.bind(this))}initialize(){this.options("selectableRange")&&(this.options("selectableRows")?console.warn("SelectRange functionality cannot be used in conjunction with row selection"):(this.maxRanges=this.options("selectableRange"),this.initializeTable(),this.initializeWatchers()),this.options("columns").findIndex(e=>e.frozen)>0&&console.warn("Having frozen column in arbitrary position with selectRange option may result in unpredictable behavior."),this.options("columns").filter(e=>e.frozen)>1&&console.warn("Having multiple frozen columns with selectRange option may result in unpredictable behavior.")),this.subscribe("edit-nav-disabled",()=>!0)}initializeTable(){this.overlay=document.createElement("div"),this.overlay.classList.add("tabulator-range-overlay"),this.rangeContainer=document.createElement("div"),this.rangeContainer.classList.add("tabulator-range-container"),this.activeRangeCellElement=document.createElement("div"),this.activeRangeCellElement.classList.add("tabulator-range-cell-active"),this.overlay.appendChild(this.rangeContainer),this.overlay.appendChild(this.activeRangeCellElement),this.table.rowManager.element.addEventListener("keydown",this.keyDownEvent),this.setDefaultRange(),this.table.rowManager.element.appendChild(this.overlay),this.table.columnManager.element.setAttribute("tabindex",0),this.table.element.classList.add("tabulator-ranges")}initializeWatchers(){this.columnSelection=this.options("selectableRangeColumns"),this.rowSelection=this.options("selectableRangeRows"),this.subscribe("column-init",this.initializeColumn.bind(this)),this.subscribe("column-mousedown",this.handleColumnMouseDown.bind(this)),this.subscribe("column-mousemove",this.handleColumnMouseMove.bind(this)),this.subscribe("column-resized",this.handleColumnResized.bind(this)),this.subscribe("column-moving",this.handleColumnMoving.bind(this)),this.subscribe("column-moved",this.handleColumnMoved.bind(this)),this.subscribe("column-width",this.layoutChange.bind(this)),this.subscribe("column-height",this.layoutChange.bind(this)),this.subscribe("column-resized",this.layoutChange.bind(this)),this.subscribe("columns-loaded",this.updateHeaderColumn.bind(this)),this.subscribe("cell-height",this.layoutChange.bind(this)),this.subscribe("cell-rendered",this.renderCell.bind(this)),this.subscribe("cell-mousedown",this.handleCellMouseDown.bind(this)),this.subscribe("cell-mousemove",this.handleCellMouseMove.bind(this)),this.subscribe("cell-click",this.handleCellClick.bind(this)),this.subscribe("cell-editing",this.handleEditingCell.bind(this)),this.subscribe("page-changed",this.redraw.bind(this)),this.subscribe("scroll-vertical",this.layoutChange.bind(this)),this.subscribe("scroll-horizontal",this.layoutChange.bind(this)),this.subscribe("data-destroy",this.tableDestroyed.bind(this)),this.subscribe("data-processed",this.setDefaultRange.bind(this)),this.subscribe("table-layout",this.layoutElement.bind(this)),this.subscribe("table-redraw",this.redraw.bind(this)),this.subscribe("table-destroy",this.tableDestroyed.bind(this)),this.subscribe("edit-editor-clear",this.finishEditingCell.bind(this)),this.subscribe("edit-blur",this.restoreFocus.bind(this)),this.subscribe("keybinding-nav-prev",this.keyNavigate.bind(this,"prev")),this.subscribe("keybinding-nav-next",this.keyNavigate.bind(this,"next")),this.subscribe("keybinding-nav-left",this.keyNavigate.bind(this,"left")),this.subscribe("keybinding-nav-right",this.keyNavigate.bind(this,"right")),this.subscribe("keybinding-nav-up",this.keyNavigate.bind(this,"up")),this.subscribe("keybinding-nav-down",this.keyNavigate.bind(this,"down")),this.subscribe("keybinding-nav-range",this.keyNavigateRange.bind(this))}initializeColumn(e){this.columnSelection&&e.definition.headerSort&&"icon"!==this.options("headerSortClickElement")&&console.warn("Using column headerSort with selectableRangeColumns option may result in unpredictable behavior. Consider using headerSortClickElement: 'icon'.")}updateHeaderColumn(){var e;this.rowSelection&&(this.rowHeader=this.table.columnManager.getVisibleColumnsByIndex()[0],this.rowHeader&&(this.rowHeader.definition.cssClass=this.rowHeader.definition.cssClass+" tabulator-range-row-header",this.rowHeader.definition.headerSort&&console.warn("Using column headerSort with selectableRangeRows option may result in unpredictable behavior"),this.rowHeader.definition.editor&&console.warn("Using column editor with selectableRangeRows option may result in unpredictable behavior"))),this.table.modules.frozenColumns&&this.table.modules.frozenColumns.active&&((e=this.table.modules.frozenColumns.getFrozenColumns()).length>1||1===e.length&&e[0]!==this.rowHeader)&&console.warn("Using frozen columns that are not the range header in combination with the selectRange option may result in unpredictable behavior")}getRanges(){return this.ranges.map(e=>e.getComponent())}getRangesData(){return this.ranges.map(e=>e.getData())}addRangeFromComponent(e,t){return e=e?e._cell:null,t=t?t._cell:null,this.addRange(e,t)}cellGetRanges(e){return(e.column===this.rowHeader?this.ranges.filter(t=>t.occupiesRow(e.row)):this.ranges.filter(t=>t.occupies(e))).map(e=>e.getComponent())}rowGetRanges(e){return this.ranges.filter(t=>t.occupiesRow(e)).map(e=>e.getComponent())}colGetRanges(e){return this.ranges.filter(t=>t.occupiesColumn(e)).map(e=>e.getComponent())}_handleMouseUp(e){this.mousedown=!1,document.removeEventListener("mouseup",this.mouseUpEvent)}_handleKeyDown(e){if(!this.blockKeydown&&(!this.table.modules.edit||this.table.modules.edit&&!this.table.modules.edit.currentCell)){if("Enter"===e.key){if(this.table.modules.edit&&this.table.modules.edit.currentCell)return;var t=this.getActiveCell();if(t)return;this.table.modules.edit.editCell(t),e.preventDefault()}"Backspace"!==e.key&&"Delete"!==e.key||!this.options("selectableRangeClearCells")||this.activeRange&&this.activeRange.clearValues()}}initializeFocus(e){var t;this.restoreFocus();try{document.selection?((t=document.body.createTextRange()).moveToElementText(e.getElement()),t.select()):window.getSelection&&((t=document.createRange()).selectNode(e.getElement()),window.getSelection().removeAllRanges(),window.getSelection().addRange(t))}catch(e){}}restoreFocus(e){return this.table.rowManager.element.focus(),!0}handleColumnResized(e){"column"!==this.selecting&&"all"!==this.selecting||this.ranges.some(t=>t.occupiesColumn(e))&&this.ranges.forEach(t=>{t.getColumns(!0).forEach(t=>{t!==e&&t.setWidth(e.width)})})}handleColumnMoving(e,t){this.resetRanges().setBounds(t),this.overlay.style.visibility="hidden"}handleColumnMoved(e,t,i){this.activeRange.setBounds(e),this.layoutElement()}handleColumnMouseDown(e,t){(2!==e.button||"column"!==this.selecting&&"all"!==this.selecting||!this.activeRange.occupiesColumn(t))&&(this.table.options.movableColumns&&"column"===this.selecting&&this.activeRange.occupiesColumn(t)||(this.mousedown=!0,document.addEventListener("mouseup",this.mouseUpEvent),this.newSelection(e,t)))}handleColumnMouseMove(e,t){t!==this.rowHeader&&this.mousedown&&"all"!==this.selecting&&this.activeRange.setBounds(!1,t,!0)}renderCell(e){var t=e.getElement(),i=this.ranges.findIndex(t=>t.occupies(e));t.classList.toggle("tabulator-range-selected",-1!==i),t.classList.toggle("tabulator-range-only-cell-selected",1===this.ranges.length&&this.ranges[0].atTopLeft(e)&&this.ranges[0].atBottomRight(e)),t.dataset.range=i}handleCellMouseDown(e,t){2===e.button&&(this.activeRange.occupies(t)||("row"===this.selecting||"all"===this.selecting)&&this.activeRange.occupiesRow(t.row))||(this.mousedown=!0,document.addEventListener("mouseup",this.mouseUpEvent),this.newSelection(e,t))}handleCellMouseMove(e,t){this.mousedown&&"all"!==this.selecting&&this.activeRange.setBounds(!1,t,!0)}handleCellClick(e,t){this.initializeFocus(t)}handleEditingCell(e){this.activeRange&&this.activeRange.setBounds(e)}finishEditingCell(){this.blockKeydown=!0,this.table.rowManager.element.focus(),setTimeout(()=>{this.blockKeydown=!1},10)}keyNavigate(e,t){if(this.options("selectableRangeBlurEditOnNavigate")&&this.chain("edit-check-editing")){if("next"!==e&&"prev"!==e)return!1;this.dispatch("edit-cancel-cell")}"prev"===e?e="left":"next"===e&&(e="right"),this.navigate(!1,!1,e)&&t.preventDefault()}keyNavigateRange(e,t,i,s){this.navigate(i,s,t)&&e.preventDefault()}navigate(e,t,i){var s,n,o,a,r,l,h,c,d,u,p;if(this.table.modules.edit&&this.table.modules.edit.currentCell)return!1;if(this.ranges.length>1&&(this.ranges=this.ranges.filter(e=>e===this.activeRange?(e.setEnd(e.start.row,e.start.col),!0):(e.destroy(),!1))),o={top:(s=this.activeRange).top,bottom:s.bottom,left:s.left,right:s.right},a=(n=t?s.end:s.start).row,r=n.col,e)switch(i){case"left":r=this.findJumpCellLeft(s.start.row,n.col);break;case"right":r=this.findJumpCellRight(s.start.row,n.col);break;case"up":a=this.findJumpCellUp(n.row,s.start.col);break;case"down":a=this.findJumpCellDown(n.row,s.start.col)}else{if(t&&("row"===this.selecting&&("left"===i||"right"===i)||"column"===this.selecting&&("up"===i||"down"===i)))return;switch(i){case"left":r=Math.max(r-1,0);break;case"right":r=Math.min(r+1,this.getTableColumns().length-1);break;case"up":a=Math.max(a-1,0);break;case"down":a=Math.min(a+1,this.getTableRows().length-1)}}return this.rowHeader&&0===r&&(r=1),t||s.setStart(a,r),s.setEnd(a,r),t||(this.selecting="cell"),(o.top!==s.top||o.bottom!==s.bottom||o.left!==s.left||o.right!==s.right)&&(l=this.getRowByRangePos(s.end.row),h=this.getColumnByRangePos(s.end.col),c=l.getElement().getBoundingClientRect(),u=h.getElement().getBoundingClientRect(),d=this.table.rowManager.getElement().getBoundingClientRect(),p=this.table.columnManager.getElement().getBoundingClientRect(),c.top>=d.top&&c.bottom<=d.bottom||(l.getElement().parentNode&&h.getElement().parentNode?this.autoScroll(s,l.getElement(),h.getElement()):l.getComponent().scrollTo(void 0,!1)),u.left>=p.left+this.getRowHeaderWidth()&&u.right<=p.right||(l.getElement().parentNode&&h.getElement().parentNode?this.autoScroll(s,l.getElement(),h.getElement()):h.getComponent().scrollTo(void 0,!1)),this.layoutElement()),!0}rangeRemoved(e){this.ranges=this.ranges.filter(t=>t!==e),this.activeRange===e&&(this.ranges.length?this.activeRange=this.ranges[this.ranges.length-1]:this.addRange()),this.layoutElement(!0)}findJumpRow(e,t,i,s,n){return i&&(t=t.reverse()),this.findJumpItem(s,n,t,function(t){return t.getData()[e.getField()]})}findJumpCol(e,t,i,s,n){return i&&(t=t.reverse()),this.findJumpItem(s,n,t,function(t){return e.getData()[t.getField()]})}findJumpItem(e,t,i,s){var n;for(let o of i){let i=s(o);if(e){if(n=o,i)break}else if(t){if(n=o,i)break}else{if(!i)break;n=o}}return n}findJumpCellLeft(e,t){var i=this.getRowByRangePos(e),s=this.getTableColumns(),n=this.isEmpty(i.getData()[s[t].getField()]),o=!!s[t-1]&&this.isEmpty(i.getData()[s[t-1].getField()]),a=this.rowHeader?s.slice(1,t):s.slice(0,t),r=this.findJumpCol(i,a,!0,n,o);return r?r.getPosition()-1:t}findJumpCellRight(e,t){var i=this.getRowByRangePos(e),s=this.getTableColumns(),n=this.isEmpty(i.getData()[s[t].getField()]),o=!!s[t+1]&&this.isEmpty(i.getData()[s[t+1].getField()]),a=this.findJumpCol(i,s.slice(t+1,s.length),!1,n,o);return a?a.getPosition()-1:t}findJumpCellUp(e,t){var i=this.getColumnByRangePos(t),s=this.getTableRows(),n=this.isEmpty(s[e].getData()[i.getField()]),o=!!s[e-1]&&this.isEmpty(s[e-1].getData()[i.getField()]),a=this.findJumpRow(i,s.slice(0,e),!0,n,o);return a?a.position-1:e}findJumpCellDown(e,t){var i=this.getColumnByRangePos(t),s=this.getTableRows(),n=this.isEmpty(s[e].getData()[i.getField()]),o=!!s[e+1]&&this.isEmpty(s[e+1].getData()[i.getField()]),a=this.findJumpRow(i,s.slice(e+1,s.length),!1,n,o);return a?a.position-1:e}newSelection(e,t){var i;if("column"===t.type){if(!this.columnSelection)return;if(t===this.rowHeader){i=this.resetRanges(),this.selecting="all";var s,n=this.getCell(-1,-1);return s=this.rowHeader?this.getCell(0,1):this.getCell(0,0),void i.setBounds(s,n)}this.selecting="column"}else t.column===this.rowHeader?this.selecting="row":this.selecting="cell";e.shiftKey?this.activeRange.setBounds(!1,t,!0):e.ctrlKey?this.addRange().setBounds(t,void 0,!0):this.resetRanges().setBounds(t,void 0,!0)}autoScroll(e,t,i){var s,n,o,a=this.table.rowManager.element;void 0===t&&(t=this.getRowByRangePos(e.end.row).getElement()),void 0===i&&(i=this.getColumnByRangePos(e.end.col).getElement()),s={left:i.offsetLeft,right:i.offsetLeft+i.offsetWidth,top:t.offsetTop,bottom:t.offsetTop+t.offsetHeight},o=(n={left:a.scrollLeft+this.getRowHeaderWidth(),right:Math.ceil(a.scrollLeft+a.clientWidth),top:a.scrollTop,bottom:a.scrollTop+a.offsetHeight-this.table.rowManager.scrollbarWidth}).top<s.top&&s.top<n.bottom&&n.top<s.bottom&&s.bottom<n.bottom,n.left<s.left&&s.left<n.right&&n.left<s.right&&s.right<n.right||(s.left<n.left?a.scrollLeft=s.left-this.getRowHeaderWidth():s.right>n.right&&(a.scrollLeft=Math.min(s.right-a.clientWidth,s.left-this.getRowHeaderWidth()))),o||(s.top<n.top?a.scrollTop=s.top:s.bottom>n.bottom&&(a.scrollTop=s.bottom-a.clientHeight))}layoutChange(){this.overlay.style.visibility="hidden",clearTimeout(this.layoutChangeTimeout),this.layoutChangeTimeout=setTimeout(this.layoutRanges.bind(this),200)}redraw(e){e&&(this.selecting="cell",this.setDefaultRange(),this.layoutElement())}layoutElement(e){(e?this.table.rowManager.getVisibleRows(!0):this.table.rowManager.getRows()).forEach(e=>{"row"===e.type&&(this.layoutRow(e),e.cells.forEach(e=>this.renderCell(e)))}),this.getTableColumns().forEach(e=>{this.layoutColumn(e)}),this.layoutRanges()}layoutRow(e){var t=e.getElement(),i=!1,s=this.ranges.some(t=>t.occupiesRow(e));"row"===this.selecting?i=s:"all"===this.selecting&&(i=!0),t.classList.toggle("tabulator-range-selected",i),t.classList.toggle("tabulator-range-highlight",s)}layoutColumn(e){var t=e.getElement(),i=!1,s=this.ranges.some(t=>t.occupiesColumn(e));"column"===this.selecting?i=s:"all"===this.selecting&&(i=!0),t.classList.toggle("tabulator-range-selected",i),t.classList.toggle("tabulator-range-highlight",s)}layoutRanges(){var e,t,i;this.table.initialized&&(e=this.getActiveCell())&&(t=e.getElement(),i=e.row.getElement(),this.table.rtl?this.activeRangeCellElement.style.right=i.offsetWidth-t.offsetLeft-t.offsetWidth+"px":this.activeRangeCellElement.style.left=i.offsetLeft+t.offsetLeft+"px",this.activeRangeCellElement.style.top=i.offsetTop+"px",this.activeRangeCellElement.style.width=t.offsetWidth+"px",this.activeRangeCellElement.style.height=i.offsetHeight+"px",this.ranges.forEach(e=>e.layout()),this.overlay.style.visibility="visible")}getCell(e,t){var i;return t<0&&(t=this.getTableColumns().length+t)<0?null:(e<0&&(e=this.getTableRows().length+e),(i=this.table.rowManager.getRowFromPosition(e+1))?i.getCells(!1,!0).filter(e=>e.column.visible)[t]:null)}getActiveCell(){if(this.activeRange)return this.getCell(this.activeRange.start.row,this.activeRange.start.col)}getRowByRangePos(e){return this.getTableRows()[e]}getColumnByRangePos(e){return this.getTableColumns()[e]}getTableRows(){return this.table.rowManager.getDisplayRows().filter(e=>"row"===e.type)}getTableColumns(){return this.table.columnManager.getVisibleColumnsByIndex()}addRange(e,t){var i;return!0!==this.maxRanges&&this.ranges.length>=this.maxRanges&&this.ranges.shift().destroy(),i=new el(this.table,this,e,t),this.activeRange=i,this.ranges.push(i),this.rangeContainer.appendChild(i.element),i}createDefaultRange(){var e,t,i;return e=this.addRange(),this.table.rowManager.activeRows.length&&(i=this.table.rowManager.activeRows[0].cells.filter(e=>e.column.visible),(t=i[this.rowHeader?1:0])&&(e.setBounds(t),this.options("selectableRangeAutoFocus")&&this.initializeFocus(t))),e}clearRanges(){this.ranges.forEach(e=>e.destroy()),this.ranges=[]}setDefaultRange(){this.clearRanges(),this.options("selectableRangeInitializeDefault")&&this.createDefaultRange()}resetRanges(){return this.clearRanges(),this.createDefaultRange()}tableDestroyed(){document.removeEventListener("mouseup",this.mouseUpEvent),this.table.rowManager.element.removeEventListener("keydown",this.keyDownEvent)}selectedRows(e){return e?this.activeRange.getRows().map(e=>e.getComponent()):this.activeRange.getRows()}selectedColumns(e){return e?this.activeRange.getColumns().map(e=>e.getComponent()):this.activeRange.getColumns()}getRowHeaderWidth(){return this.rowHeader?this.rowHeader.getElement().offsetWidth:0}isEmpty(e){return null==e||""===e}},SelectRowModule:class extends Ga{static moduleName="selectRow";static moduleExtensions=Zr;constructor(e){super(e),this.selecting=!1,this.lastClickedRow=!1,this.selectPrev=[],this.selectedRows=[],this.headerCheckboxElement=null,this.registerTableOption("selectableRows","highlight"),this.registerTableOption("selectableRowsRangeMode","drag"),this.registerTableOption("selectableRowsRollingSelection",!0),this.registerTableOption("selectableRowsPersistence",!0),this.registerTableOption("selectableRowsCheck",function(e,t){return!0}),this.registerTableFunction("selectRow",this.selectRows.bind(this)),this.registerTableFunction("deselectRow",this.deselectRows.bind(this)),this.registerTableFunction("toggleSelectRow",this.toggleRow.bind(this)),this.registerTableFunction("getSelectedRows",this.getSelectedRows.bind(this)),this.registerTableFunction("getSelectedData",this.getSelectedData.bind(this)),this.registerComponentFunction("row","select",this.selectRows.bind(this)),this.registerComponentFunction("row","deselect",this.deselectRows.bind(this)),this.registerComponentFunction("row","toggleSelect",this.toggleRow.bind(this)),this.registerComponentFunction("row","isSelected",this.isRowSelected.bind(this))}initialize(){this.deprecatedOptionsCheck(),"highlight"===this.table.options.selectableRows&&this.table.options.selectableRange&&(this.table.options.selectableRows=!1),!1!==this.table.options.selectableRows&&(this.subscribe("row-init",this.initializeRow.bind(this)),this.subscribe("row-deleting",this.rowDeleted.bind(this)),this.subscribe("rows-wipe",this.clearSelectionData.bind(this)),this.subscribe("rows-retrieve",this.rowRetrieve.bind(this)),this.table.options.selectableRows&&!this.table.options.selectableRowsPersistence&&this.subscribe("data-refreshing",this.deselectRows.bind(this)))}deprecatedOptionsCheck(){}rowRetrieve(e,t){return"selected"===e?this.selectedRows:t}rowDeleted(e){this._deselectRow(e,!0)}clearSelectionData(e){var t=this.selectedRows.length;this.selecting=!1,this.lastClickedRow=!1,this.selectPrev=[],this.selectedRows=[],t&&!0!==e&&this._rowSelectionChanged()}initializeRow(e){var t=this,i=t.checkRowSelectability(e),s=e.getElement(),n=function(){setTimeout(function(){t.selecting=!1},50),document.body.removeEventListener("mouseup",n)};e.modules.select={selected:!1},s.classList.toggle("tabulator-selectable",i),s.classList.toggle("tabulator-unselectable",!i),t.checkRowSelectability(e)&&t.table.options.selectableRows&&"highlight"!=t.table.options.selectableRows&&("click"===t.table.options.selectableRowsRangeMode?s.addEventListener("click",this.handleComplexRowClick.bind(this,e)):(s.addEventListener("click",function(i){t.table.modExists("edit")&&t.table.modules.edit.getCurrentCell()||t.table._clearSelection(),t.selecting||t.toggleRow(e)}),s.addEventListener("mousedown",function(i){if(i.shiftKey)return t.table._clearSelection(),t.selecting=!0,t.selectPrev=[],document.body.addEventListener("mouseup",n),document.body.addEventListener("keyup",n),t.toggleRow(e),!1}),s.addEventListener("mouseenter",function(i){t.selecting&&(t.table._clearSelection(),t.toggleRow(e),t.selectPrev[1]==e&&t.toggleRow(t.selectPrev[0]))}),s.addEventListener("mouseout",function(i){t.selecting&&(t.table._clearSelection(),t.selectPrev.unshift(e))})))}handleComplexRowClick(e,t){if(t.shiftKey){this.table._clearSelection(),this.lastClickedRow=this.lastClickedRow||e;var i=this.table.rowManager.getDisplayRowIndex(this.lastClickedRow),s=this.table.rowManager.getDisplayRowIndex(e),n=i<=s?i:s,o=i>=s?i:s,a=this.table.rowManager.getDisplayRows().slice(0).splice(n,o-n+1);t.ctrlKey||t.metaKey?(a.forEach(t=>{t!==this.lastClickedRow&&(!0===this.table.options.selectableRows||this.isRowSelected(e)||this.selectedRows.length<this.table.options.selectableRows)&&this.toggleRow(t)}),this.lastClickedRow=e):(this.deselectRows(void 0,!0),!0!==this.table.options.selectableRows&&a.length>this.table.options.selectableRows&&(a=a.slice(0,this.table.options.selectableRows)),this.selectRows(a)),this.table._clearSelection()}else t.ctrlKey||t.metaKey?(this.toggleRow(e),this.lastClickedRow=e):(this.deselectRows(void 0,!0),1===this.selectedRows.length&&this.isRowSelected(e)||this.selectRows(e),this.lastClickedRow=e)}checkRowSelectability(e){return!(!e||"row"!==e.type)&&this.table.options.selectableRowsCheck.call(this.table,e.getComponent())}toggleRow(e){this.checkRowSelectability(e)&&(e.modules.select&&e.modules.select.selected?this._deselectRow(e):this._selectRow(e))}selectRows(e){var t,i,s=[];switch(typeof e){case"undefined":t=this.table.rowManager.rows;break;case"number":t=this.table.rowManager.findRow(e);break;case"string":(t=this.table.rowManager.findRow(e))||(t=this.table.rowManager.getRows(e));break;default:t=e}Array.isArray(t)?t.length&&(t.forEach(e=>{(i=this._selectRow(e,!0,!0))&&s.push(i)}),this._rowSelectionChanged(!1,s)):t&&this._selectRow(t,!1,!0)}_selectRow(e,t,i){if(!isNaN(this.table.options.selectableRows)&&!0!==this.table.options.selectableRows&&!i&&this.selectedRows.length>=this.table.options.selectableRows){if(!this.table.options.selectableRowsRollingSelection)return!1;this._deselectRow(this.selectedRows[0])}var s=this.table.rowManager.findRow(e);if(s){if(-1==this.selectedRows.indexOf(s))return s.getElement().classList.add("tabulator-selected"),s.modules.select||(s.modules.select={}),s.modules.select.selected=!0,s.modules.select.checkboxEl&&(s.modules.select.checkboxEl.checked=!0),this.selectedRows.push(s),this.table.options.dataTreeSelectPropagate&&this.childRowSelection(s,!0),this.dispatchExternal("rowSelected",s.getComponent()),this._rowSelectionChanged(t,s),s}else t||console.warn("Selection Error - No such row found, ignoring selection:"+e)}isRowSelected(e){return-1!==this.selectedRows.indexOf(e)}deselectRows(e,t){var i,s,n=[];switch(typeof e){case"undefined":i=Object.assign([],this.selectedRows);break;case"number":i=this.table.rowManager.findRow(e);break;case"string":(i=this.table.rowManager.findRow(e))||(i=this.table.rowManager.getRows(e));break;default:i=e}Array.isArray(i)?i.length&&(i.forEach(e=>{(s=this._deselectRow(e,!0,!0))&&n.push(s)}),this._rowSelectionChanged(t,[],n)):i&&this._deselectRow(i,t,!0)}_deselectRow(e,t){var i,s,n=this,o=n.table.rowManager.findRow(e);if(o){if((i=n.selectedRows.findIndex(function(e){return e==o}))>-1)return(s=o.getElement())&&s.classList.remove("tabulator-selected"),o.modules.select||(o.modules.select={}),o.modules.select.selected=!1,o.modules.select.checkboxEl&&(o.modules.select.checkboxEl.checked=!1),n.selectedRows.splice(i,1),this.table.options.dataTreeSelectPropagate&&this.childRowSelection(o,!1),this.dispatchExternal("rowDeselected",o.getComponent()),n._rowSelectionChanged(t,void 0,o),o}else t||console.warn("Deselection Error - No such row found, ignoring selection:"+e)}getSelectedData(){var e=[];return this.selectedRows.forEach(function(t){e.push(t.getData())}),e}getSelectedRows(){var e=[];return this.selectedRows.forEach(function(t){e.push(t.getComponent())}),e}_rowSelectionChanged(e,t=[],i=[]){this.headerCheckboxElement&&(0===this.selectedRows.length?(this.headerCheckboxElement.checked=!1,this.headerCheckboxElement.indeterminate=!1):this.table.rowManager.rows.length===this.selectedRows.length?(this.headerCheckboxElement.checked=!0,this.headerCheckboxElement.indeterminate=!1):(this.headerCheckboxElement.indeterminate=!0,this.headerCheckboxElement.checked=!1)),e||(Array.isArray(t)||(t=[t]),t=t.map(e=>e.getComponent()),Array.isArray(i)||(i=[i]),i=i.map(e=>e.getComponent()),this.dispatchExternal("rowSelectionChanged",this.getSelectedData(),this.getSelectedRows(),t,i))}registerRowSelectCheckbox(e,t){e._row.modules.select||(e._row.modules.select={}),e._row.modules.select.checkboxEl=t}registerHeaderSelectCheckbox(e){this.headerCheckboxElement=e}childRowSelection(e,t){var i=this.table.modules.dataTree.getChildren(e,!0,!0);if(t)for(let e of i)this._selectRow(e,!0);else for(let e of i)this._deselectRow(e,!0)}},SortModule:nl,SpreadsheetModule:class extends Ga{static moduleName="spreadsheet";constructor(e){super(e),this.sheets=[],this.element=null,this.registerTableOption("spreadsheet",!1),this.registerTableOption("spreadsheetRows",50),this.registerTableOption("spreadsheetColumns",50),this.registerTableOption("spreadsheetColumnDefinition",{}),this.registerTableOption("spreadsheetOutputFull",!1),this.registerTableOption("spreadsheetData",!1),this.registerTableOption("spreadsheetSheets",!1),this.registerTableOption("spreadsheetSheetTabs",!1),this.registerTableOption("spreadsheetSheetTabsElement",!1),this.registerTableFunction("setSheets",this.setSheets.bind(this)),this.registerTableFunction("addSheet",this.addSheet.bind(this)),this.registerTableFunction("getSheets",this.getSheets.bind(this)),this.registerTableFunction("getSheetDefinitions",this.getSheetDefinitions.bind(this)),this.registerTableFunction("setSheetData",this.setSheetData.bind(this)),this.registerTableFunction("getSheet",this.getSheet.bind(this)),this.registerTableFunction("getSheetData",this.getSheetData.bind(this)),this.registerTableFunction("clearSheet",this.clearSheet.bind(this)),this.registerTableFunction("removeSheet",this.removeSheetFunc.bind(this)),this.registerTableFunction("activeSheet",this.activeSheetFunc.bind(this))}initialize(){this.options("spreadsheet")&&(this.subscribe("table-initialized",this.tableInitialized.bind(this)),this.subscribe("data-loaded",this.loadRemoteData.bind(this)),this.table.options.index="_id",this.options("spreadsheetData")&&this.options("spreadsheetSheets")&&(console.warn("You cannot use spreadsheetData and spreadsheetSheets at the same time, ignoring spreadsheetData"),this.table.options.spreadsheetData=!1),this.compatibilityCheck(),this.options("spreadsheetSheetTabs")&&this.initializeTabset())}compatibilityCheck(){this.options("data")&&console.warn("Do not use the data option when working with spreadsheets, use either spreadsheetData or spreadsheetSheets to pass data into the table"),this.options("pagination")&&console.warn("The spreadsheet module is not compatible with the pagination module"),this.options("groupBy")&&console.warn("The spreadsheet module is not compatible with the row grouping module"),this.options("responsiveCollapse")&&console.warn("The spreadsheet module is not compatible with the responsive collapse module")}initializeTabset(){this.element=document.createElement("div"),this.element.classList.add("tabulator-spreadsheet-tabs");var e=this.options("spreadsheetSheetTabsElement");!e||e instanceof HTMLElement||(e=document.querySelector(e))||console.warn("Unable to find element matching spreadsheetSheetTabsElement selector:",this.options("spreadsheetSheetTabsElement")),e?e.appendChild(this.element):this.footerAppend(this.element)}tableInitialized(){this.sheets.length?this.loadSheet(this.sheets[0]):this.options("spreadsheetSheets")?this.loadSheets(this.options("spreadsheetSheets")):this.options("spreadsheetData")&&this.loadData(this.options("spreadsheetData"))}loadRemoteData(e,t,i){return console.log("data",e,t,i),Array.isArray(e)?(this.table.dataLoader.clearAlert(),this.dispatchExternal("dataLoaded",e),!e.length||Array.isArray(e[0])?this.loadData(e):this.loadSheets(e)):console.error("Spreadsheet Loading Error - Unable to process remote data due to invalid data type \nExpecting: array \nReceived: ",typeof e,"\nData:     ",e),!1}loadData(e){var t={data:e};this.loadSheet(this.newSheet(t))}destroySheets(){this.sheets.forEach(e=>{e.destroy()}),this.sheets=[],this.activeSheet=null}loadSheets(e){Array.isArray(e)||(e=[]),this.destroySheets(),e.forEach(e=>{this.newSheet(e)}),this.loadSheet(this.sheets[0])}loadSheet(e){this.activeSheet!==e&&(this.activeSheet&&this.activeSheet.unload(),this.activeSheet=e,e.load())}newSheet(e={}){var t;return e.rows||(e.rows=this.options("spreadsheetRows")),e.columns||(e.columns=this.options("spreadsheetColumns")),t=new rl(this,e),this.sheets.push(t),this.element&&this.element.appendChild(t.element),t}removeSheet(e){var t,i=this.sheets.indexOf(e);this.sheets.length>1?i>-1&&(this.sheets.splice(i,1),e.destroy(),this.activeSheet===e&&((t=this.sheets[i-1]||this.sheets[0])?this.loadSheet(t):this.activeSheet=null)):console.warn("Unable to remove sheet, at least one sheet must be active")}lookupSheet(e){return e?e instanceof rl?e:e instanceof al?e._sheet:this.sheets.find(t=>t.key===e)||!1:this.activeSheet}setSheets(e){return this.loadSheets(e),this.getSheets()}addSheet(e){return this.newSheet(e).getComponent()}getSheetDefinitions(){return this.sheets.map(e=>e.getDefinition())}getSheets(){return this.sheets.map(e=>e.getComponent())}getSheet(e){var t=this.lookupSheet(e);return!!t&&t.getComponent()}setSheetData(e,t){e&&!t&&(t=e,e=!1);var i=this.lookupSheet(e);return!!i&&i.setData(t)}getSheetData(e){var t=this.lookupSheet(e);return!!t&&t.getData()}clearSheet(e){var t=this.lookupSheet(e);return!!t&&t.clear()}removeSheetFunc(e){var t=this.lookupSheet(e);t&&this.removeSheet(t)}activeSheetFunc(e){var t=this.lookupSheet(e);return!!t&&this.loadSheet(t)}},TooltipModule:class extends Ga{static moduleName="tooltip";constructor(e){super(e),this.tooltipSubscriber=null,this.headerSubscriber=null,this.timeout=null,this.popupInstance=null,this.registerTableOption("tooltipDelay",300),this.registerColumnOption("tooltip"),this.registerColumnOption("headerTooltip")}initialize(){this.deprecatedOptionsCheck(),this.subscribe("column-init",this.initializeColumn.bind(this))}deprecatedOptionsCheck(){}initializeColumn(e){e.definition.headerTooltip&&!this.headerSubscriber&&(this.headerSubscriber=!0,this.subscribe("column-mousemove",this.mousemoveCheck.bind(this,"headerTooltip")),this.subscribe("column-mouseout",this.mouseoutCheck.bind(this,"headerTooltip"))),e.definition.tooltip&&!this.tooltipSubscriber&&(this.tooltipSubscriber=!0,this.subscribe("cell-mousemove",this.mousemoveCheck.bind(this,"tooltip")),this.subscribe("cell-mouseout",this.mouseoutCheck.bind(this,"tooltip")))}mousemoveCheck(e,t,i){var s="tooltip"===e?i.column.definition.tooltip:i.definition.headerTooltip;s&&(this.clearPopup(),this.timeout=setTimeout(this.loadTooltip.bind(this,t,i,s),this.table.options.tooltipDelay))}mouseoutCheck(e,t,i){this.popupInstance||this.clearPopup()}clearPopup(e,t,i){clearTimeout(this.timeout),this.timeout=null,this.popupInstance&&this.popupInstance.hide()}loadTooltip(e,t,i){var s,n,o;"function"==typeof i&&(i=i(e,t.getComponent(),function(e){n=e})),i instanceof HTMLElement?s=i:(s=document.createElement("div"),!0===i&&(t instanceof rr?i=t.value:t.definition.field?this.langBind("columns|"+t.definition.field,e=>{s.innerHTML=i=e||t.definition.title}):i=t.definition.title),s.innerHTML=i),(i||0===i||!1===i)&&(s.classList.add("tabulator-tooltip"),s.addEventListener("mousemove",e=>e.preventDefault()),this.popupInstance=this.popup(s),"function"==typeof n&&this.popupInstance.renderCallback(n),o=this.popupInstance.containerEventCoords(e),this.popupInstance.show(o.x+15,o.y+15).hideOnBlur(()=>{this.dispatchExternal("TooltipClosed",t.getComponent()),this.popupInstance=null}),this.dispatchExternal("TooltipOpened",t.getComponent()))}},ValidateModule:hl}),dl={debugEventsExternal:!1,debugEventsInternal:!1,debugInvalidOptions:!0,debugInvalidComponentFuncs:!0,debugInitialization:!0,debugDeprecation:!0,height:!1,minHeight:!1,maxHeight:!1,columnHeaderVertAlign:"top",popupContainer:!1,columns:[],columnDefaults:{},rowHeader:!1,data:!1,autoColumns:!1,autoColumnsDefinitions:!1,nestedFieldSeparator:".",footerElement:!1,index:"id",textDirection:"auto",addRowPos:"bottom",headerVisible:!0,renderVertical:"virtual",renderHorizontal:"basic",renderVerticalBuffer:0,scrollToRowPosition:"top",scrollToRowIfVisible:!0,scrollToColumnPosition:"left",scrollToColumnIfVisible:!0,rowFormatter:!1,rowFormatterPrint:null,rowFormatterClipboard:null,rowFormatterHtmlOutput:null,rowHeight:null,placeholder:!1,dataLoader:!0,dataLoaderLoading:!1,dataLoaderError:!1,dataLoaderErrorTimeout:3e3,dataSendParams:{},dataReceiveParams:{},dependencies:{}};class ul{constructor(e,t,i={}){this.table=e,this.msgType=t,this.registeredDefaults=Object.assign({},i)}register(e,t){this.registeredDefaults[e]=t}generate(e,t={}){var i=Object.assign({},this.registeredDefaults),s=this.table.options.debugInvalidOptions||!0===t.debugInvalidOptions;Object.assign(i,e);for(let e in t)i.hasOwnProperty(e)||(s&&console.warn("Invalid "+this.msgType+" option:",e),i[e]=t.key);for(let e in i)e in t?i[e]=t[e]:Array.isArray(i[e])?i[e]=Object.assign([],i[e]):"object"==typeof i[e]&&null!==i[e]?i[e]=Object.assign({},i[e]):void 0===i[e]&&delete i[e];return i}}class pl extends Ba{constructor(e){super(e),this.elementVertical=e.rowManager.element,this.elementHorizontal=e.columnManager.element,this.tableElement=e.rowManager.tableElement,this.verticalFillMode="fit"}initialize(){}clearRows(){}clearColumns(){}reinitializeColumnWidths(e){}renderRows(){}renderColumns(){}rerenderRows(e){e&&e()}rerenderColumns(e,t){}renderRowCells(e){}rerenderRowCells(e,t){}scrollColumns(e,t){}scrollRows(e,t){}resize(){}scrollToRow(e){}scrollToRowNearestTop(e){}visibleRows(e){return[]}rows(){return this.table.rowManager.getDisplayRows()}styleRow(e,t){var i=e.getElement();t%2?(i.classList.add("tabulator-row-even"),i.classList.remove("tabulator-row-odd")):(i.classList.add("tabulator-row-odd"),i.classList.remove("tabulator-row-even"))}clear(){this.clearRows(),this.clearColumns()}render(){this.renderRows(),this.renderColumns()}rerender(e){this.rerenderRows(),this.rerenderColumns()}scrollToRowPosition(e,t,i){var s=this.rows().indexOf(e),n=e.getElement(),o=0;return new Promise((a,r)=>{if(s>-1){if(void 0===i&&(i=this.table.options.scrollToRowIfVisible),!i&&Va.elVisible(n)&&(o=Va.elOffset(n).top-Va.elOffset(this.elementVertical).top)>0&&o<this.elementVertical.clientHeight-n.offsetHeight)return a(),!1;switch(void 0===t&&(t=this.table.options.scrollToRowPosition),"nearest"===t&&(t=this.scrollToRowNearestTop(e)?"top":"bottom"),this.scrollToRow(e),t){case"middle":case"center":this.elementVertical.scrollHeight-this.elementVertical.scrollTop==this.elementVertical.clientHeight?this.elementVertical.scrollTop=this.elementVertical.scrollTop+(n.offsetTop-this.elementVertical.scrollTop)-(this.elementVertical.scrollHeight-n.offsetTop)/2:this.elementVertical.scrollTop=this.elementVertical.scrollTop-this.elementVertical.clientHeight/2;break;case"bottom":this.elementVertical.scrollHeight-this.elementVertical.scrollTop==this.elementVertical.clientHeight?this.elementVertical.scrollTop=this.elementVertical.scrollTop-(this.elementVertical.scrollHeight-n.offsetTop)+n.offsetHeight:this.elementVertical.scrollTop=this.elementVertical.scrollTop-this.elementVertical.clientHeight+n.offsetHeight;break;case"top":this.elementVertical.scrollTop=n.offsetTop}a()}else console.warn("Scroll Error - Row not visible"),r("Scroll Error - Row not visible")})}}class ml extends pl{constructor(e){super(e)}renderRowCells(e,t){const i=document.createDocumentFragment();e.cells.forEach(e=>{i.appendChild(e.getElement())}),e.element.appendChild(i),t||e.cells.forEach(e=>{e.cellRendered()})}reinitializeColumnWidths(e){e.forEach(function(e){e.reinitializeWidth()})}}class gl extends pl{constructor(e){super(e),this.leftCol=0,this.rightCol=0,this.scrollLeft=0,this.vDomScrollPosLeft=0,this.vDomScrollPosRight=0,this.vDomPadLeft=0,this.vDomPadRight=0,this.fitDataColAvg=0,this.windowBuffer=200,this.visibleRows=null,this.initialized=!1,this.isFitData=!1,this.columns=[]}initialize(){this.compatibilityCheck(),this.layoutCheck(),this.vertScrollListen()}compatibilityCheck(){"fitDataTable"==this.options("layout")&&console.warn("Horizontal Virtual DOM is not compatible with fitDataTable layout mode"),this.options("responsiveLayout")&&console.warn("Horizontal Virtual DOM is not compatible with responsive columns"),this.options("rtl")&&console.warn("Horizontal Virtual DOM is not currently compatible with RTL text direction")}layoutCheck(){this.isFitData=this.options("layout").startsWith("fitData")}vertScrollListen(){this.subscribe("scroll-vertical",this.clearVisRowCache.bind(this)),this.subscribe("data-refreshed",this.clearVisRowCache.bind(this))}clearVisRowCache(){this.visibleRows=null}renderColumns(e,t){this.dataChange()}scrollColumns(e,t){this.scrollLeft!=e&&(this.scrollLeft=e,this.scroll(e-(this.vDomScrollPosLeft+this.windowBuffer)))}calcWindowBuffer(){var e=this.elementVertical.clientWidth;this.table.columnManager.columnsByIndex.forEach(t=>{if(t.visible){var i=t.getWidth();i>e&&(e=i)}}),this.windowBuffer=2*e}rerenderColumns(e,t){var i={cols:this.columns,leftCol:this.leftCol,rightCol:this.rightCol},s=0;e&&!this.initialized||(this.clear(),this.calcWindowBuffer(),this.scrollLeft=this.elementVertical.scrollLeft,this.vDomScrollPosLeft=this.scrollLeft-this.windowBuffer,this.vDomScrollPosRight=this.scrollLeft+this.elementVertical.clientWidth+this.windowBuffer,this.table.columnManager.columnsByIndex.forEach(e=>{var t,i={};e.visible&&(e.modules.frozen||(t=e.getWidth(),i.leftPos=s,i.rightPos=s+t,i.width=t,this.isFitData&&(i.fitDataCheck=!e.modules.vdomHoz||e.modules.vdomHoz.fitDataCheck),s+t>this.vDomScrollPosLeft&&s<this.vDomScrollPosRight?(-1==this.leftCol&&(this.leftCol=this.columns.length,this.vDomPadLeft=s),this.rightCol=this.columns.length):-1!==this.leftCol&&(this.vDomPadRight+=t),this.columns.push(e),e.modules.vdomHoz=i,s+=t))}),this.tableElement.style.paddingLeft=this.vDomPadLeft+"px",this.tableElement.style.paddingRight=this.vDomPadRight+"px",this.initialized=!0,t||e&&!this.reinitChanged(i)||this.reinitializeRows(),this.elementVertical.scrollLeft=this.scrollLeft)}renderRowCells(e){if(this.initialized)this.initializeRow(e);else{const t=document.createDocumentFragment();e.cells.forEach(e=>{t.appendChild(e.getElement())}),e.element.appendChild(t),e.cells.forEach(e=>{e.cellRendered()})}}rerenderRowCells(e,t){this.reinitializeRow(e,t)}reinitializeColumnWidths(e){for(let e=this.leftCol;e<=this.rightCol;e++){let t=this.columns[e];t&&t.reinitializeWidth()}}deinitialize(){this.initialized=!1}clear(){this.columns=[],this.leftCol=-1,this.rightCol=0,this.vDomScrollPosLeft=0,this.vDomScrollPosRight=0,this.vDomPadLeft=0,this.vDomPadRight=0}dataChange(){var e,t,i=!1;if(this.isFitData){if(this.table.columnManager.columnsByIndex.forEach(e=>{!e.definition.width&&e.visible&&(i=!0)}),i&&this.table.rowManager.getDisplayRows().length&&(this.vDomScrollPosRight=this.scrollLeft+this.elementVertical.clientWidth+this.windowBuffer,e=this.chain("rows-sample",[1],[],()=>this.table.rowManager.getDisplayRows())[0])){t=e.getElement(),e.generateCells(),this.tableElement.appendChild(t);for(let i=0;i<e.cells.length;i++){let s=e.cells[i];t.appendChild(s.getElement()),s.column.reinitializeWidth()}t.parentNode.removeChild(t),this.rerenderColumns(!1,!0)}}else"fitColumns"===this.options("layout")&&(this.layoutRefresh(),this.rerenderColumns(!1,!0))}reinitChanged(e){var t=!0;return e.cols.length!==this.columns.length||e.leftCol!==this.leftCol||e.rightCol!==this.rightCol||(e.cols.forEach((e,i)=>{e!==this.columns[i]&&(t=!1)}),!t)}reinitializeRows(){var e=this.getVisibleRows(),t=this.table.rowManager.getRows().filter(t=>!e.includes(t));e.forEach(e=>{this.reinitializeRow(e,!0)}),t.forEach(e=>{e.deinitialize()})}getVisibleRows(){return this.visibleRows||(this.visibleRows=this.table.rowManager.getVisibleRows()),this.visibleRows}scroll(e){this.vDomScrollPosLeft+=e,this.vDomScrollPosRight+=e,Math.abs(e)>this.windowBuffer/2?this.rerenderColumns():e>0?(this.addColRight(),this.removeColLeft()):(this.addColLeft(),this.removeColRight())}colPositionAdjust(e,t,i){for(let s=e;s<t;s++){let e=this.columns[s];e.modules.vdomHoz.leftPos+=i,e.modules.vdomHoz.rightPos+=i}}addColRight(){for(var e=!1,t=!0;t;){let i=this.columns[this.rightCol+1];i&&i.modules.vdomHoz.leftPos<=this.vDomScrollPosRight?(e=!0,this.getVisibleRows().forEach(e=>{if("group"!==e.type){var t=e.getCell(i);e.getElement().insertBefore(t.getElement(),e.getCell(this.columns[this.rightCol]).getElement().nextSibling),t.cellRendered()}}),this.fitDataColActualWidthCheck(i),this.rightCol++,this.getVisibleRows().forEach(e=>{"group"!==e.type&&(e.modules.vdomHoz.rightCol=this.rightCol)}),this.rightCol>=this.columns.length-1?this.vDomPadRight=0:this.vDomPadRight-=i.getWidth()):t=!1}e&&(this.tableElement.style.paddingRight=this.vDomPadRight+"px")}addColLeft(){for(var e=!1,t=!0;t;){let i=this.columns[this.leftCol-1];if(i)if(i.modules.vdomHoz.rightPos>=this.vDomScrollPosLeft){e=!0,this.getVisibleRows().forEach(e=>{if("group"!==e.type){var t=e.getCell(i);e.getElement().insertBefore(t.getElement(),e.getCell(this.columns[this.leftCol]).getElement()),t.cellRendered()}}),this.leftCol--,this.getVisibleRows().forEach(e=>{"group"!==e.type&&(e.modules.vdomHoz.leftCol=this.leftCol)}),this.leftCol<=0?this.vDomPadLeft=0:this.vDomPadLeft-=i.getWidth();let t=this.fitDataColActualWidthCheck(i);t&&(this.scrollLeft=this.elementVertical.scrollLeft=this.elementVertical.scrollLeft+t,this.vDomPadRight-=t)}else t=!1;else t=!1}e&&(this.tableElement.style.paddingLeft=this.vDomPadLeft+"px")}removeColRight(){for(var e=!1,t=!0;t;){let i=this.columns[this.rightCol];i&&i.modules.vdomHoz.leftPos>this.vDomScrollPosRight?(e=!0,this.getVisibleRows().forEach(e=>{if("group"!==e.type){var t=e.getCell(i);try{e.getElement().removeChild(t.getElement())}catch(e){console.warn("Could not removeColRight",e.message)}}}),this.vDomPadRight+=i.getWidth(),this.rightCol--,this.getVisibleRows().forEach(e=>{"group"!==e.type&&(e.modules.vdomHoz.rightCol=this.rightCol)})):t=!1}e&&(this.tableElement.style.paddingRight=this.vDomPadRight+"px")}removeColLeft(){for(var e=!1,t=!0;t;){let i=this.columns[this.leftCol];i&&i.modules.vdomHoz.rightPos<this.vDomScrollPosLeft?(e=!0,this.getVisibleRows().forEach(e=>{if("group"!==e.type){var t=e.getCell(i);try{e.getElement().removeChild(t.getElement())}catch(e){console.warn("Could not removeColLeft",e.message)}}}),this.vDomPadLeft+=i.getWidth(),this.leftCol++,this.getVisibleRows().forEach(e=>{"group"!==e.type&&(e.modules.vdomHoz.leftCol=this.leftCol)})):t=!1}e&&(this.tableElement.style.paddingLeft=this.vDomPadLeft+"px")}fitDataColActualWidthCheck(e){var t,i;return e.modules.vdomHoz.fitDataCheck&&(e.reinitializeWidth(),(i=(t=e.getWidth())-e.modules.vdomHoz.width)&&(e.modules.vdomHoz.rightPos+=i,e.modules.vdomHoz.width=t,this.colPositionAdjust(this.columns.indexOf(e)+1,this.columns.length,i)),e.modules.vdomHoz.fitDataCheck=!1),i}initializeRow(e){if("group"!==e.type){e.modules.vdomHoz={leftCol:this.leftCol,rightCol:this.rightCol},this.table.modules.frozenColumns&&this.table.modules.frozenColumns.leftColumns.forEach(t=>{this.appendCell(e,t)});for(let t=this.leftCol;t<=this.rightCol;t++)this.appendCell(e,this.columns[t]);this.table.modules.frozenColumns&&this.table.modules.frozenColumns.rightColumns.forEach(t=>{this.appendCell(e,t)})}}appendCell(e,t){if(t&&t.visible){let i=e.getCell(t);e.getElement().appendChild(i.getElement()),i.cellRendered()}}reinitializeRow(e,t){if("group"!==e.type&&(t||!e.modules.vdomHoz||e.modules.vdomHoz.leftCol!==this.leftCol||e.modules.vdomHoz.rightCol!==this.rightCol)){for(var i=e.getElement();i.firstChild;)i.removeChild(i.firstChild);this.initializeRow(e)}}}class bl extends Ba{constructor(e){super(e),this.blockHozScrollEvent=!1,this.headersElement=null,this.contentsElement=null,this.rowHeader=null,this.element=null,this.columns=[],this.columnsByIndex=[],this.columnsByField={},this.scrollLeft=0,this.optionsList=new ul(this.table,"column definition",hr),this.redrawBlock=!1,this.redrawBlockUpdate=null,this.renderer=null}initialize(){this.initializeRenderer(),this.headersElement=this.createHeadersElement(),this.contentsElement=this.createHeaderContentsElement(),this.element=this.createHeaderElement(),this.contentsElement.insertBefore(this.headersElement,this.contentsElement.firstChild),this.element.insertBefore(this.contentsElement,this.element.firstChild),this.initializeScrollWheelWatcher(),this.subscribe("scroll-horizontal",this.scrollHorizontal.bind(this)),this.subscribe("scrollbar-vertical",this.padVerticalScrollbar.bind(this))}padVerticalScrollbar(e){this.table.rtl?this.headersElement.style.marginLeft=e+"px":this.headersElement.style.marginRight=e+"px"}initializeRenderer(){var e,t={virtual:gl,basic:ml};(e="string"==typeof this.table.options.renderHorizontal?t[this.table.options.renderHorizontal]:this.table.options.renderHorizontal)?(this.renderer=new e(this.table,this.element,this.tableElement),this.renderer.initialize()):console.error("Unable to find matching renderer:",this.table.options.renderHorizontal)}createHeadersElement(){var e=document.createElement("div");return e.classList.add("tabulator-headers"),e.setAttribute("role","row"),e}createHeaderContentsElement(){var e=document.createElement("div");return e.classList.add("tabulator-header-contents"),e}createHeaderElement(){var e=document.createElement("div");return e.classList.add("tabulator-header"),e.setAttribute("role","rowgroup"),this.table.options.headerVisible||e.classList.add("tabulator-header-hidden"),e}getElement(){return this.element}getContentsElement(){return this.contentsElement}getHeadersElement(){return this.headersElement}scrollHorizontal(e){this.contentsElement.scrollLeft=e,this.scrollLeft=e,this.renderer.scrollColumns(e)}initializeScrollWheelWatcher(){this.contentsElement.addEventListener("wheel",e=>{var t;e.deltaX&&(t=this.contentsElement.scrollLeft+e.deltaX,this.table.rowManager.scrollHorizontal(t),this.table.columnManager.scrollHorizontal(t))})}generateColumnsFromRowData(e){var t=[],i={},s="full"===this.table.options.autoColumns?e:[e[0]],n=this.table.options.autoColumnsDefinitions;if(e&&e.length){if(s.forEach(e=>{Object.keys(e).forEach((s,n)=>{let o,a=e[s];i[s]?!0!==i[s]&&void 0!==a&&(i[s].sorter=this.calculateSorterFromValue(a),i[s]=!0):(o={field:s,title:s,sorter:this.calculateSorterFromValue(a)},t.splice(n,0,o),i[s]=void 0!==a||o)})}),n)switch(typeof n){case"function":this.table.options.columns=n.call(this.table,t);break;case"object":Array.isArray(n)?t.forEach(e=>{var t=n.find(t=>t.field===e.field);t&&Object.assign(e,t)}):t.forEach(e=>{n[e.field]&&Object.assign(e,n[e.field])}),this.table.options.columns=t}else this.table.options.columns=t;this.setColumns(this.table.options.columns)}}calculateSorterFromValue(e){var t;switch(typeof e){case"undefined":t="string";break;case"boolean":t="boolean";break;case"number":t="number";break;case"object":t=Array.isArray(e)?"array":"string";break;default:t=isNaN(Number(e))||""===e?e.match(/((^[0-9]+[a-z]+)|(^[a-z]+[0-9]+))+$/i)?"alphanum":"string":"number"}return t}setColumns(e,t){for(;this.headersElement.firstChild;)this.headersElement.removeChild(this.headersElement.firstChild);this.columns=[],this.columnsByIndex=[],this.columnsByField={},this.dispatch("columns-loading"),this.dispatchExternal("columnsLoading"),this.table.options.rowHeader&&(this.rowHeader=new cr(!0===this.table.options.rowHeader?{}:this.table.options.rowHeader,this,!0),this.columns.push(this.rowHeader),this.headersElement.appendChild(this.rowHeader.getElement()),this.rowHeader.columnRendered()),e.forEach((e,t)=>{this._addColumn(e)}),this._reIndexColumns(),this.dispatch("columns-loaded"),this.subscribedExternal("columnsLoaded")&&this.dispatchExternal("columnsLoaded",this.getComponents()),this.rerenderColumns(!1,!0),this.redraw(!0)}_addColumn(e,t,i){var s=new cr(e,this),n=s.getElement(),o=i?this.findColumnIndex(i):i;if(!t||!this.rowHeader||i&&i!==this.rowHeader||(t=!1,i=this.rowHeader,o=0),i&&o>-1){var a=i.getTopColumn(),r=this.columns.indexOf(a),l=a.getElement();t?(this.columns.splice(r,0,s),l.parentNode.insertBefore(n,l)):(this.columns.splice(r+1,0,s),l.parentNode.insertBefore(n,l.nextSibling))}else t?(this.columns.unshift(s),this.headersElement.insertBefore(s.getElement(),this.headersElement.firstChild)):(this.columns.push(s),this.headersElement.appendChild(s.getElement()));return s.columnRendered(),s}registerColumnField(e){e.definition.field&&(this.columnsByField[e.definition.field]=e)}registerColumnPosition(e){this.columnsByIndex.push(e)}_reIndexColumns(){this.columnsByIndex=[],this.columns.forEach(function(e){e.reRegisterPosition()})}verticalAlignHeaders(){var e=0;this.redrawBlock||(this.headersElement.style.height="",this.columns.forEach(e=>{e.clearVerticalAlign()}),this.columns.forEach(t=>{var i=t.getHeight();i>e&&(e=i)}),this.headersElement.style.height=e+"px",this.columns.forEach(t=>{t.verticalAlign(this.table.options.columnHeaderVertAlign,e)}),this.table.rowManager.adjustTableSize())}findColumn(e){var t;return"object"!=typeof e?this.columnsByField[e]||!1:e instanceof cr?e:e instanceof lr?e._getSelf()||!1:"undefined"!=typeof HTMLElement&&e instanceof HTMLElement&&(t=[],this.columns.forEach(e=>{t.push(e),t=t.concat(e.getColumns(!0))}),t.find(t=>t.element===e)||!1)}getColumnByField(e){return this.columnsByField[e]}getColumnsByFieldRoot(e){var t=[];return Object.keys(this.columnsByField).forEach(i=>{(this.table.options.nestedFieldSeparator?i.split(this.table.options.nestedFieldSeparator)[0]:i)===e&&t.push(this.columnsByField[i])}),t}getColumnByIndex(e){return this.columnsByIndex[e]}getFirstVisibleColumn(){var e=this.columnsByIndex.findIndex(e=>e.visible);return e>-1&&this.columnsByIndex[e]}getVisibleColumnsByIndex(){return this.columnsByIndex.filter(e=>e.visible)}getColumns(){return this.columns}findColumnIndex(e){return this.columnsByIndex.findIndex(t=>e===t)}getRealColumns(){return this.columnsByIndex}traverse(e){this.columnsByIndex.forEach((t,i)=>{e(t,i)})}getDefinitions(e){var t=[];return this.columnsByIndex.forEach(i=>{(!e||e&&i.visible)&&t.push(i.getDefinition())}),t}getDefinitionTree(){var e=[];return this.columns.forEach(t=>{e.push(t.getDefinition(!0))}),e}getComponents(e){var t=[];return(e?this.columns:this.columnsByIndex).forEach(e=>{t.push(e.getComponent())}),t}getWidth(){var e=0;return this.columnsByIndex.forEach(t=>{t.visible&&(e+=t.getWidth())}),e}moveColumn(e,t,i){t.element.parentNode.insertBefore(e.element,t.element),i&&t.element.parentNode.insertBefore(t.element,e.element),this.moveColumnActual(e,t,i),this.verticalAlignHeaders(),this.table.rowManager.reinitialize()}moveColumnActual(e,t,i){e.parent.isGroup?this._moveColumnInArray(e.parent.columns,e,t,i):this._moveColumnInArray(this.columns,e,t,i),this._moveColumnInArray(this.columnsByIndex,e,t,i,!0),this.rerenderColumns(!0),this.dispatch("column-moved",e,t,i),this.subscribedExternal("columnMoved")&&this.dispatchExternal("columnMoved",e.getComponent(),this.table.columnManager.getComponents())}_moveColumnInArray(e,t,i,s,n){var o,a=e.indexOf(t);a>-1&&(e.splice(a,1),(o=e.indexOf(i))>-1?s&&(o+=1):o=a,e.splice(o,0,t),n&&(this.chain("column-moving-rows",[t,i,s],null,[])||[]).concat(this.table.rowManager.rows).forEach(function(e){if(e.cells.length){var t=e.cells.splice(a,1)[0];e.cells.splice(o,0,t)}}))}scrollToColumn(e,t,i){var s=0,n=e.getLeftOffset(),o=0,a=e.getElement();return new Promise((r,l)=>{if(void 0===t&&(t=this.table.options.scrollToColumnPosition),void 0===i&&(i=this.table.options.scrollToColumnIfVisible),e.visible){switch(t){case"middle":case"center":o=-this.element.clientWidth/2;break;case"right":o=a.clientWidth-this.headersElement.clientWidth}if(!i&&n>0&&n+a.offsetWidth<this.element.clientWidth)return!1;s=n+o,s=Math.max(Math.min(s,this.table.rowManager.element.scrollWidth-this.table.rowManager.element.clientWidth),0),this.table.rowManager.scrollHorizontal(s),this.scrollHorizontal(s),r()}else console.warn("Scroll Error - Column not visible"),l("Scroll Error - Column not visible")})}generateCells(e){var t=[];return this.columnsByIndex.forEach(i=>{t.push(i.generateCell(e))}),t}getFlexBaseWidth(){var e=this.table.element.clientWidth,t=0;return this.table.rowManager.element.scrollHeight>this.table.rowManager.element.clientHeight&&(e-=this.table.rowManager.element.offsetWidth-this.table.rowManager.element.clientWidth),this.columnsByIndex.forEach(function(i){var s,n,o;i.visible&&(s=i.definition.width||0,n=parseInt(i.minWidth),o="string"==typeof s?s.indexOf("%")>-1?e/100*parseInt(s):parseInt(s):s,t+=o>n?o:n)}),t}addColumn(e,t,i){return new Promise((s,n)=>{var o=this._addColumn(e,t,i);this._reIndexColumns(),this.dispatch("column-add",e,t,i),"fitColumns"!=this.layoutMode()&&o.reinitializeWidth(),this.redraw(!0),this.table.rowManager.reinitialize(),this.rerenderColumns(),s(o)})}deregisterColumn(e){var t,i=e.getField();i&&delete this.columnsByField[i],(t=this.columnsByIndex.indexOf(e))>-1&&this.columnsByIndex.splice(t,1),(t=this.columns.indexOf(e))>-1&&this.columns.splice(t,1),this.verticalAlignHeaders(),this.redraw()}rerenderColumns(e,t){this.redrawBlock?(!1===e||!0===e&&null===this.redrawBlockUpdate)&&(this.redrawBlockUpdate=e):this.renderer.rerenderColumns(e,t)}blockRedraw(){this.redrawBlock=!0,this.redrawBlockUpdate=null}restoreRedraw(){this.redrawBlock=!1,this.verticalAlignHeaders(),this.renderer.rerenderColumns(this.redrawBlockUpdate)}redraw(e){Va.elVisible(this.element)&&this.verticalAlignHeaders(),e&&(this.table.rowManager.resetScroll(),this.table.rowManager.reinitialize()),this.confirm("table-redrawing",e)||this.layoutRefresh(e),this.dispatch("table-redraw",e),this.table.footerManager.redraw()}}class fl extends pl{constructor(e){super(e),this.verticalFillMode="fill",this.scrollTop=0,this.scrollLeft=0,this.scrollTop=0,this.scrollLeft=0}clearRows(){for(var e=this.tableElement;e.firstChild;)e.removeChild(e.firstChild);e.scrollTop=0,e.scrollLeft=0,e.style.minWidth="",e.style.minHeight="",e.style.display="",e.style.visibility=""}renderRows(){var e=this.tableElement,t=!0,i=document.createDocumentFragment(),s=this.rows();s.forEach((e,s)=>{this.styleRow(e,s),e.initialize(!1,!0),"group"!==e.type&&(t=!1),i.appendChild(e.getElement())}),e.appendChild(i),s.forEach(e=>{e.rendered(),e.heightInitialized||e.calcHeight(!0)}),s.forEach(e=>{e.heightInitialized||e.setCellHeight()}),e.style.minWidth=t?this.table.columnManager.getWidth()+"px":""}rerenderRows(e){this.clearRows(),e&&e(),this.renderRows(),this.rows().length||this.table.rowManager.tableEmpty()}scrollToRowNearestTop(e){var t=Va.elOffset(e.getElement()).top;return!(Math.abs(this.elementVertical.scrollTop-t)>Math.abs(this.elementVertical.scrollTop+this.elementVertical.clientHeight-t))}scrollToRow(e){var t=e.getElement();this.elementVertical.scrollTop=Va.elOffset(t).top-Va.elOffset(this.elementVertical).top+this.elementVertical.scrollTop}visibleRows(e){return this.rows()}}class vl extends pl{constructor(e){super(e),this.verticalFillMode="fill",this.scrollTop=0,this.scrollLeft=0,this.vDomRowHeight=20,this.vDomTop=0,this.vDomBottom=0,this.vDomScrollPosTop=0,this.vDomScrollPosBottom=0,this.vDomTopPad=0,this.vDomBottomPad=0,this.vDomMaxRenderChain=90,this.vDomWindowBuffer=0,this.vDomWindowMinTotalRows=20,this.vDomWindowMinMarginRows=5,this.vDomTopNewRows=[],this.vDomBottomNewRows=[]}clearRows(){for(var e=this.tableElement;e.firstChild;)e.removeChild(e.firstChild);e.style.paddingTop="",e.style.paddingBottom="",e.style.minHeight="",e.style.display="",e.style.visibility="",this.elementVertical.scrollTop=0,this.elementVertical.scrollLeft=0,this.scrollTop=0,this.scrollLeft=0,this.vDomTop=0,this.vDomBottom=0,this.vDomTopPad=0,this.vDomBottomPad=0,this.vDomScrollPosTop=0,this.vDomScrollPosBottom=0}renderRows(){this._virtualRenderFill()}rerenderRows(e){for(var t=this.elementVertical.scrollTop,i=!1,s=!1,n=this.table.rowManager.scrollLeft,o=this.rows(),a=this.vDomTop;a<=this.vDomBottom;a++)if(o[a]){var r=t-o[a].getElement().offsetTop;if(!(!1===s||Math.abs(r)<s))break;s=r,i=a}o.forEach(e=>{e.deinitializeHeight()}),e&&e(),this.rows().length?this._virtualRenderFill(!1===i?this.rows.length-1:i,!0,s||0):(this.clear(),this.table.rowManager.tableEmpty()),this.scrollColumns(n)}scrollColumns(e){this.table.rowManager.scrollHorizontal(e)}scrollRows(e,t){var i=e-this.vDomScrollPosTop,s=e-this.vDomScrollPosBottom,n=2*this.vDomWindowBuffer,o=this.rows();if(this.scrollTop=e,-i>n||s>n){var a=this.table.rowManager.scrollLeft;this._virtualRenderFill(Math.floor(this.elementVertical.scrollTop/this.elementVertical.scrollHeight*o.length)),this.scrollColumns(a)}else t?(i<0&&this._addTopRow(o,-i),s<0&&(this.vDomScrollHeight-this.scrollTop>this.vDomWindowBuffer?this._removeBottomRow(o,-s):this.vDomScrollPosBottom=this.scrollTop)):(s>=0&&this._addBottomRow(o,s),i>=0&&(this.scrollTop>this.vDomWindowBuffer?this._removeTopRow(o,i):this.vDomScrollPosTop=this.scrollTop))}resize(){this.vDomWindowBuffer=this.table.options.renderVerticalBuffer||this.elementVertical.clientHeight}scrollToRowNearestTop(e){var t=this.rows().indexOf(e);return!(Math.abs(this.vDomTop-t)>Math.abs(this.vDomBottom-t))}scrollToRow(e){var t=this.rows().indexOf(e);t>-1&&this._virtualRenderFill(t,!0)}visibleRows(e){var t=this.elementVertical.scrollTop,i=this.elementVertical.clientHeight+t,s=!1,n=0,o=0,a=this.rows();if(e)n=this.vDomTop,o=this.vDomBottom;else for(var r=this.vDomTop;r<=this.vDomBottom;r++)if(a[r])if(s){if(!(i-a[r].getElement().offsetTop>=0))break;o=r}else if(t-a[r].getElement().offsetTop>=0)n=r;else{if(s=!0,!(i-a[r].getElement().offsetTop>=0))break;o=r}return a.slice(n,o+1)}_virtualRenderFill(e,t,i){var s,n,o=this.tableElement,a=this.elementVertical,r=0,l=0,h=0,c=0,d=0,u=0,p=this.rows(),m=p.length,g=0,b=[],f=0,v=0,w=this.table.rowManager.fixedHeight,_=this.elementVertical.clientHeight,y=this.table.options.rowHeight,x=!0;if(i=i||0,e=e||0){for(;o.firstChild;)o.removeChild(o.firstChild);(c=(m-e+1)*this.vDomRowHeight)<_&&(e-=Math.ceil((_-c)/this.vDomRowHeight))<0&&(e=0),e-=r=Math.min(Math.max(Math.floor(this.vDomWindowBuffer/this.vDomRowHeight),this.vDomWindowMinMarginRows),e)}else this.clear();if(m&&Va.elVisible(this.elementVertical)){for(this.vDomTop=e,this.vDomBottom=e-1,w||this.table.options.maxHeight?(y&&(v=_/y+this.vDomWindowBuffer/y),v=Math.max(this.vDomWindowMinTotalRows,Math.ceil(v))):v=m;(v==m||l<=_+this.vDomWindowBuffer||f<this.vDomWindowMinTotalRows)&&this.vDomBottom<m-1;){for(b=[],n=document.createDocumentFragment(),u=0;u<v&&this.vDomBottom<m-1;)s=p[g=this.vDomBottom+1],this.styleRow(s,g),s.initialize(!1,!0),s.heightInitialized||this.table.options.rowHeight||s.clearCellHeight(),n.appendChild(s.getElement()),b.push(s),this.vDomBottom++,u++;if(!b.length)break;o.appendChild(n),b.forEach(e=>{e.rendered()});const e=[];b.forEach(t=>{t.heightInitialized&&t.getHeight()||(t.calcHeight(!0),e.push(t))}),e.forEach(e=>{e.setCellHeight()}),b.forEach(e=>{h=e.getHeight()||this.vDomRowHeight,f<r?d+=h:l+=h,h>this.vDomWindowBuffer&&(this.vDomWindowBuffer=2*h),f++}),x=this.table.rowManager.adjustTableSize(),_=this.elementVertical.clientHeight,x&&(w||this.table.options.maxHeight)&&(y=l/f,v=Math.max(this.vDomWindowMinTotalRows,Math.ceil(_/y+this.vDomWindowBuffer/y)))}e?(this.vDomTopPad=t?this.vDomRowHeight*this.vDomTop+i:this.scrollTop-d,this.vDomBottomPad=this.vDomBottom==m-1?0:Math.max(this.vDomScrollHeight-this.vDomTopPad-l-d,0)):(this.vDomTopPad=0,this.vDomRowHeight=Math.floor((l+d)/f),this.vDomBottomPad=this.vDomRowHeight*(m-this.vDomBottom-1),this.vDomScrollHeight=d+l+this.vDomBottomPad-_),o.style.paddingTop=this.vDomTopPad+"px",o.style.paddingBottom=this.vDomBottomPad+"px",t&&(this.scrollTop=this.vDomTopPad+d+i-(this.elementVertical.scrollWidth>this.elementVertical.clientWidth?this.elementVertical.offsetHeight-_:0)),this.scrollTop=Math.min(this.scrollTop,this.elementVertical.scrollHeight-_),this.elementVertical.scrollWidth>this.elementVertical.clientWidth&&t&&(this.scrollTop+=this.elementVertical.offsetHeight-_),this.vDomScrollPosTop=this.scrollTop,this.vDomScrollPosBottom=this.scrollTop,a.scrollTop=this.scrollTop,this.dispatch("render-virtual-fill")}}_addTopRow(e,t){for(var i=this.tableElement,s=[],n=0,o=this.vDomTop-1,a=0,r=!0;r;)if(this.vDomTop){let l,h,c=e[o];c&&a<this.vDomMaxRenderChain?(l=c.getHeight()||this.vDomRowHeight,h=c.initialized,t>=l?(this.styleRow(c,o),i.insertBefore(c.getElement(),i.firstChild),c.initialized&&c.heightInitialized||s.push(c),c.initialize(),h||(l=c.getElement().offsetHeight,l>this.vDomWindowBuffer&&(this.vDomWindowBuffer=2*l)),t-=l,n+=l,this.vDomTop--,o--,a++):r=!1):r=!1}else r=!1;for(let e of s)e.clearCellHeight();this._quickNormalizeRowHeight(s),n&&(this.vDomTopPad-=n,this.vDomTopPad<0&&(this.vDomTopPad=o*this.vDomRowHeight),o<1&&(this.vDomTopPad=0),i.style.paddingTop=this.vDomTopPad+"px",this.vDomScrollPosTop-=n)}_removeTopRow(e,t){for(var i=[],s=0,n=0,o=!0;o;){let a,r=e[this.vDomTop];r&&n<this.vDomMaxRenderChain?(a=r.getHeight()||this.vDomRowHeight,t>=a?(this.vDomTop++,t-=a,s+=a,i.push(r),n++):o=!1):o=!1}for(let e of i){let t=e.getElement();t.parentNode&&t.parentNode.removeChild(t)}s&&(this.vDomTopPad+=s,this.tableElement.style.paddingTop=this.vDomTopPad+"px",this.vDomScrollPosTop+=this.vDomTop?s:s+this.vDomWindowBuffer)}_addBottomRow(e,t){for(var i=this.tableElement,s=[],n=0,o=this.vDomBottom+1,a=0,r=!0;r;){let l,h,c=e[o];c&&a<this.vDomMaxRenderChain?(l=c.getHeight()||this.vDomRowHeight,h=c.initialized,t>=l?(this.styleRow(c,o),i.appendChild(c.getElement()),c.initialized&&c.heightInitialized||s.push(c),c.initialize(),h||(l=c.getElement().offsetHeight,l>this.vDomWindowBuffer&&(this.vDomWindowBuffer=2*l)),t-=l,n+=l,this.vDomBottom++,o++,a++):r=!1):r=!1}for(let e of s)e.clearCellHeight();this._quickNormalizeRowHeight(s),n&&(this.vDomBottomPad-=n,(this.vDomBottomPad<0||o==e.length-1)&&(this.vDomBottomPad=0),i.style.paddingBottom=this.vDomBottomPad+"px",this.vDomScrollPosBottom+=n)}_removeBottomRow(e,t){for(var i=[],s=0,n=0,o=!0;o;){let a,r=e[this.vDomBottom];r&&n<this.vDomMaxRenderChain?(a=r.getHeight()||this.vDomRowHeight,t>=a?(this.vDomBottom--,t-=a,s+=a,i.push(r),n++):o=!1):o=!1}for(let e of i){let t=e.getElement();t.parentNode&&t.parentNode.removeChild(t)}s&&(this.vDomBottomPad+=s,this.vDomBottomPad<0&&(this.vDomBottomPad=0),this.tableElement.style.paddingBottom=this.vDomBottomPad+"px",this.vDomScrollPosBottom-=s)}_quickNormalizeRowHeight(e){for(let t of e)t.calcHeight();for(let t of e)t.setCellHeight()}}class wl extends Ba{constructor(e){super(e),this.element=this.createHolderElement(),this.tableElement=this.createTableElement(),this.heightFixer=this.createTableElement(),this.placeholder=null,this.placeholderContents=null,this.firstRender=!1,this.renderMode="virtual",this.fixedHeight=!1,this.rows=[],this.activeRowsPipeline=[],this.activeRows=[],this.activeRowsCount=0,this.displayRows=[],this.displayRowsCount=0,this.scrollTop=0,this.scrollLeft=0,this.redrawBlock=!1,this.redrawBlockRestoreConfig=!1,this.redrawBlockRenderInPosition=!1,this.dataPipeline=[],this.displayPipeline=[],this.scrollbarWidth=0,this.renderer=null}createHolderElement(){var e=document.createElement("div");return e.classList.add("tabulator-tableholder"),e.setAttribute("tabindex",0),e}createTableElement(){var e=document.createElement("div");return e.classList.add("tabulator-table"),e.setAttribute("role","rowgroup"),e.setAttribute("id","tabulator-table-body"),e}initializePlaceholder(){var e=this.table.options.placeholder;if("function"==typeof e&&(e=e.call(this.table)),e=this.chain("placeholder",[e],e,e)||e){let t=document.createElement("div");if(t.classList.add("tabulator-placeholder"),"string"==typeof e){let i=document.createElement("div");i.classList.add("tabulator-placeholder-contents"),i.innerHTML=e,t.appendChild(i),this.placeholderContents=i}else"undefined"!=typeof HTMLElement&&e instanceof HTMLElement?(t.appendChild(e),this.placeholderContents=e):(console.warn("Invalid placeholder provided, must be string or HTML Element",e),this.el=null);this.placeholder=t}}getElement(){return this.element}getTableElement(){return this.tableElement}initialize(){this.initializePlaceholder(),this.initializeRenderer(),this.element.appendChild(this.tableElement),this.firstRender=!0,this.element.addEventListener("scroll",()=>{var e=this.element.scrollLeft,t=this.scrollLeft>e,i=this.element.scrollTop,s=this.scrollTop>i;this.scrollLeft!=e&&(this.scrollLeft=e,this.dispatch("scroll-horizontal",e,t),this.dispatchExternal("scrollHorizontal",e,t),this._positionPlaceholder()),this.scrollTop!=i&&(this.scrollTop=i,this.renderer.scrollRows(i,s),this.dispatch("scroll-vertical",i,s),this.dispatchExternal("scrollVertical",i,s))})}findRow(e){return"object"!=typeof e?void 0!==e&&(this.rows.find(t=>t.data[this.table.options.index]==e)||!1):e instanceof ur?e:e instanceof dr?e._getSelf()||!1:"undefined"!=typeof HTMLElement&&e instanceof HTMLElement&&this.rows.find(t=>t.getElement()===e)||!1}getRowFromDataObject(e){return this.rows.find(t=>t.data===e)||!1}getRowFromPosition(e){return this.getDisplayRows().find(t=>"row"===t.type&&t.getPosition()===e&&t.isDisplayed())}scrollToRow(e,t,i){return this.renderer.scrollToRowPosition(e,t,i)}setData(e,t,i){return new Promise((s,n)=>{t&&this.getDisplayRows().length?this.table.options.pagination?this._setDataActual(e,!0):this.reRenderInPosition(()=>{this._setDataActual(e)}):(this.table.options.autoColumns&&i&&this.table.initialized&&this.table.columnManager.generateColumnsFromRowData(e),this.resetScroll(),this._setDataActual(e)),s()})}_setDataActual(e,t){this.dispatchExternal("dataProcessing",e),this._wipeElements(),Array.isArray(e)?(this.dispatch("data-processing",e),e.forEach((e,t)=>{if(e&&"object"==typeof e){var i=new ur(e,this);this.rows.push(i)}else console.warn("Data Loading Warning - Invalid row data detected and ignored, expecting object but received:",e)}),this.refreshActiveData(!1,!1,t),this.dispatch("data-processed",e),this.dispatchExternal("dataProcessed",e)):console.error("Data Loading Error - Unable to process data due to invalid data type \nExpecting: array \nReceived: ",typeof e,"\nData:     ",e)}_wipeElements(){this.dispatch("rows-wipe"),this.destroy(),this.adjustTableSize(),this.dispatch("rows-wiped")}destroy(){this.rows.forEach(e=>{e.wipe()}),this.rows=[],this.activeRows=[],this.activeRowsPipeline=[],this.activeRowsCount=0,this.displayRows=[],this.displayRowsCount=0}deleteRow(e,t){var i=this.rows.indexOf(e),s=this.activeRows.indexOf(e);s>-1&&this.activeRows.splice(s,1),i>-1&&this.rows.splice(i,1),this.setActiveRows(this.activeRows),this.displayRowIterator(t=>{var i=t.indexOf(e);i>-1&&t.splice(i,1)}),t||this.reRenderInPosition(),this.regenerateRowPositions(),this.dispatchExternal("rowDeleted",e.getComponent()),this.displayRowsCount||this.tableEmpty(),this.subscribedExternal("dataChanged")&&this.dispatchExternal("dataChanged",this.getData())}addRow(e,t,i,s){return this.addRowActual(e,t,i,s)}addRows(e,t,i,s){var n=[];return new Promise((o,a)=>{t=this.findAddRowPos(t),Array.isArray(e)||(e=[e]),(void 0===i&&t||void 0!==i&&!t)&&e.reverse(),e.forEach((e,s)=>{var o=this.addRow(e,t,i,!0);n.push(o),this.dispatch("row-added",o,e,t,i)}),this.refreshActiveData(!!s&&"displayPipeline",!1,!0),this.regenerateRowPositions(),this.displayRowsCount&&this._clearPlaceholder(),o(n)})}findAddRowPos(e){return void 0===e&&(e=this.table.options.addRowPos),"pos"===e&&(e=!0),"bottom"===e&&(e=!1),e}addRowActual(e,t,i,s){var n,o,a=e instanceof ur?e:new ur(e||{},this),r=this.findAddRowPos(t),l=-1;return i||(o=this.chain("row-adding-position",[a,r],null,{index:i,top:r}),i=o.index,r=o.top),void 0!==i&&(i=this.findRow(i)),(i=this.chain("row-adding-index",[a,i,r],null,i))&&(l=this.rows.indexOf(i)),i&&l>-1?(n=this.activeRows.indexOf(i),this.displayRowIterator(function(e){var t=e.indexOf(i);t>-1&&e.splice(r?t:t+1,0,a)}),n>-1&&this.activeRows.splice(r?n:n+1,0,a),this.rows.splice(r?l:l+1,0,a)):r?(this.displayRowIterator(function(e){e.unshift(a)}),this.activeRows.unshift(a),this.rows.unshift(a)):(this.displayRowIterator(function(e){e.push(a)}),this.activeRows.push(a),this.rows.push(a)),this.setActiveRows(this.activeRows),this.dispatchExternal("rowAdded",a.getComponent()),this.subscribedExternal("dataChanged")&&this.dispatchExternal("dataChanged",this.table.rowManager.getData()),s||this.reRenderInPosition(),a}moveRow(e,t,i){this.dispatch("row-move",e,t,i),this.moveRowActual(e,t,i),this.regenerateRowPositions(),this.dispatch("row-moved",e,t,i),this.dispatchExternal("rowMoved",e.getComponent())}moveRowActual(e,t,i){this.moveRowInArray(this.rows,e,t,i),this.moveRowInArray(this.activeRows,e,t,i),this.displayRowIterator(s=>{this.moveRowInArray(s,e,t,i)}),this.dispatch("row-moving",e,t,i)}moveRowInArray(e,t,i,s){var n,o,a;if(t!==i&&((n=e.indexOf(t))>-1&&(e.splice(n,1),(o=e.indexOf(i))>-1?s?e.splice(o+1,0,t):e.splice(o,0,t):e.splice(n,0,t)),e===this.getDisplayRows())){a=o>n?o:n+1;for(let t=n<o?n:o;t<=a;t++)e[t]&&this.styleRow(e[t],t)}}clearData(){this.setData([])}getRowIndex(e){return this.findRowIndex(e,this.rows)}getDisplayRowIndex(e){var t=this.getDisplayRows().indexOf(e);return t>-1&&t}nextDisplayRow(e,t){var i=this.getDisplayRowIndex(e),s=!1;return!1!==i&&i<this.displayRowsCount-1&&(s=this.getDisplayRows()[i+1]),!s||s instanceof ur&&"row"==s.type?s:this.nextDisplayRow(s,t)}prevDisplayRow(e,t){var i=this.getDisplayRowIndex(e),s=!1;return i&&(s=this.getDisplayRows()[i-1]),!t||!s||s instanceof ur&&"row"==s.type?s:this.prevDisplayRow(s,t)}findRowIndex(e,t){var i;return!!((e=this.findRow(e))&&(i=t.indexOf(e))>-1)&&i}getData(e,t){var i=[];return this.getRows(e).forEach(function(e){"row"==e.type&&i.push(e.getData(t||"data"))}),i}getComponents(e){var t=[];return this.getRows(e).forEach(function(e){t.push(e.getComponent())}),t}getDataCount(e){return this.getRows(e).length}scrollHorizontal(e){this.scrollLeft=e,this.element.scrollLeft=e,this.dispatch("scroll-horizontal",e)}registerDataPipelineHandler(e,t){void 0!==t?(this.dataPipeline.push({handler:e,priority:t}),this.dataPipeline.sort((e,t)=>e.priority-t.priority)):console.error("Data pipeline handlers must have a priority in order to be registered")}registerDisplayPipelineHandler(e,t){void 0!==t?(this.displayPipeline.push({handler:e,priority:t}),this.displayPipeline.sort((e,t)=>e.priority-t.priority)):console.error("Display pipeline handlers must have a priority in order to be registered")}refreshActiveData(e,t,i){var s=this.table,n="",o=0,a=["all","dataPipeline","display","displayPipeline","end"];if(!this.table.destroyed){if("function"==typeof e)if((o=this.dataPipeline.findIndex(t=>t.handler===e))>-1)n="dataPipeline",t&&(o==this.dataPipeline.length-1?n="display":o++);else{if(!((o=this.displayPipeline.findIndex(t=>t.handler===e))>-1))return void console.error("Unable to refresh data, invalid handler provided",e);n="displayPipeline",t&&(o==this.displayPipeline.length-1?n="end":o++)}else n=e||"all",o=0;if(this.redrawBlock)return void((!this.redrawBlockRestoreConfig||this.redrawBlockRestoreConfig&&(this.redrawBlockRestoreConfig.stage===n&&o<this.redrawBlockRestoreConfig.index||a.indexOf(n)<a.indexOf(this.redrawBlockRestoreConfig.stage)))&&(this.redrawBlockRestoreConfig={handler:e,skipStage:t,renderInPosition:i,stage:n,index:o}));Va.elVisible(this.element)?i?this.reRenderInPosition(this.refreshPipelines.bind(this,e,n,o,i)):(this.refreshPipelines(e,n,o,i),e||this.table.columnManager.renderer.renderColumns(),this.renderTable(),s.options.layoutColumnsOnNewData&&this.table.columnManager.redraw(!0)):this.refreshPipelines(e,n,o,i),this.dispatch("data-refreshed")}}refreshPipelines(e,t,i,s){switch(this.dispatch("data-refreshing"),e&&this.activeRowsPipeline[0]||(this.activeRowsPipeline[0]=this.rows.slice(0)),t){case"all":case"dataPipeline":for(let e=i;e<this.dataPipeline.length;e++){let t=this.dataPipeline[e].handler(this.activeRowsPipeline[e].slice(0));this.activeRowsPipeline[e+1]=t||this.activeRowsPipeline[e].slice(0)}this.setActiveRows(this.activeRowsPipeline[this.dataPipeline.length]);case"display":i=0,this.resetDisplayRows();case"displayPipeline":for(let e=i;e<this.displayPipeline.length;e++){let t=this.displayPipeline[e].handler((e?this.getDisplayRows(e-1):this.activeRows).slice(0),s);this.setDisplayRows(t||this.getDisplayRows(e-1).slice(0),e)}case"end":this.regenerateRowPositions()}this.getDisplayRows().length&&this._clearPlaceholder()}regenerateRowPositions(){var e=this.getDisplayRows(),t=1;e.forEach(e=>{"row"===e.type&&(e.setPosition(t),t++)})}setActiveRows(e){this.activeRows=this.activeRows=Object.assign([],e),this.activeRowsCount=this.activeRows.length}resetDisplayRows(){this.displayRows=[],this.displayRows.push(this.activeRows.slice(0)),this.displayRowsCount=this.displayRows[0].length}setDisplayRows(e,t){this.displayRows[t]=e,t==this.displayRows.length-1&&(this.displayRowsCount=this.displayRows[this.displayRows.length-1].length)}getDisplayRows(e){return void 0===e?this.displayRows.length?this.displayRows[this.displayRows.length-1]:[]:this.displayRows[e]||[]}getVisibleRows(e,t){var i=Object.assign([],this.renderer.visibleRows(!t));return e&&(i=this.chain("rows-visible",[t],i,i)),i}displayRowIterator(e){this.activeRowsPipeline.forEach(e),this.displayRows.forEach(e),this.displayRowsCount=this.displayRows[this.displayRows.length-1].length}getRows(e){var t=[];switch(e){case"active":t=this.activeRows;break;case"display":t=this.table.rowManager.getDisplayRows();break;case"visible":t=this.getVisibleRows(!1,!0);break;default:t=this.chain("rows-retrieve",e,null,this.rows)||this.rows}return t}reRenderInPosition(e){this.redrawBlock?e?e():this.redrawBlockRenderInPosition=!0:(this.dispatchExternal("renderStarted"),this.renderer.rerenderRows(e),this.fixedHeight||this.adjustTableSize(),this.scrollBarCheck(),this.dispatchExternal("renderComplete"))}scrollBarCheck(){var e=0;this.element.scrollHeight>this.element.clientHeight&&(e=this.element.offsetWidth-this.element.clientWidth),e!==this.scrollbarWidth&&(this.scrollbarWidth=e,this.dispatch("scrollbar-vertical",e))}initializeRenderer(){var e,t={virtual:vl,basic:fl};(e="string"==typeof this.table.options.renderVertical?t[this.table.options.renderVertical]:this.table.options.renderVertical)?(this.renderMode=this.table.options.renderVertical,this.renderer=new e(this.table,this.element,this.tableElement),this.renderer.initialize(),!this.table.element.clientHeight&&!this.table.options.height||this.table.options.minHeight&&this.table.options.maxHeight?this.fixedHeight=!1:this.fixedHeight=!0):console.error("Unable to find matching renderer:",this.table.options.renderVertical)}getRenderMode(){return this.renderMode}renderTable(){this.dispatchExternal("renderStarted"),this.element.scrollTop=0,this._clearTable(),this.displayRowsCount?(this.renderer.renderRows(),this.firstRender&&(this.firstRender=!1,this.fixedHeight||this.adjustTableSize(),this.layoutRefresh(!0))):this.renderEmptyScroll(),this.fixedHeight||this.adjustTableSize(),this.dispatch("table-layout"),this.displayRowsCount||this._showPlaceholder(),this.scrollBarCheck(),this.dispatchExternal("renderComplete")}renderEmptyScroll(){this.placeholder?this.tableElement.style.display="none":this.tableElement.style.minWidth=this.table.columnManager.getWidth()+"px"}_clearTable(){this._clearPlaceholder(),this.scrollTop=0,this.scrollLeft=0,this.renderer.clearRows()}tableEmpty(){this.renderEmptyScroll(),this._showPlaceholder()}checkPlaceholder(){this.displayRowsCount?this._clearPlaceholder():this.tableEmpty()}_showPlaceholder(){this.placeholder&&(this.placeholder&&this.placeholder.parentNode&&this.placeholder.parentNode.removeChild(this.placeholder),this.initializePlaceholder(),this.placeholder.setAttribute("tabulator-render-mode",this.renderMode),this.getElement().appendChild(this.placeholder),this._positionPlaceholder(),this.adjustTableSize())}_clearPlaceholder(){this.placeholder&&this.placeholder.parentNode&&this.placeholder.parentNode.removeChild(this.placeholder),this.tableElement.style.minWidth="",this.tableElement.style.display=""}_positionPlaceholder(){this.placeholder&&this.placeholder.parentNode&&(this.placeholder.style.width=this.table.columnManager.getWidth()+"px",this.placeholderContents.style.width=this.table.rowManager.element.clientWidth+"px",this.placeholderContents.style.marginLeft=this.scrollLeft+"px")}styleRow(e,t){var i=e.getElement();t%2?(i.classList.add("tabulator-row-even"),i.classList.remove("tabulator-row-odd")):(i.classList.add("tabulator-row-odd"),i.classList.remove("tabulator-row-even"))}normalizeHeight(e){this.activeRows.forEach(function(t){t.normalizeHeight(e)})}adjustTableSize(){let e,t=this.element.clientHeight,i=!1;if("fill"===this.renderer.verticalFillMode){let s=Math.floor(this.table.columnManager.getElement().getBoundingClientRect().height+(this.table.footerManager&&this.table.footerManager.active&&!this.table.footerManager.external?this.table.footerManager.getElement().getBoundingClientRect().height:0));if(this.fixedHeight){e=isNaN(this.table.options.minHeight)?this.table.options.minHeight:this.table.options.minHeight+"px";const t="calc(100% - "+s+"px)";this.element.style.minHeight=e||"calc(100% - "+s+"px)",this.element.style.height=t,this.element.style.maxHeight=t}else this.element.style.height="",this.element.style.height=this.table.element.clientHeight-s+"px",this.element.scrollTop=this.scrollTop;this.renderer.resize(),this.fixedHeight||t==this.element.clientHeight||(i=!0,this.redrawing||(this.redrawing=!0,this.subscribed("table-resize")?this.dispatch("table-resize"):this.redraw(),this.redrawing=!1)),this.scrollBarCheck()}return this._positionPlaceholder(),i}reinitialize(){this.rows.forEach(function(e){e.reinitialize(!0)})}blockRedraw(){this.redrawBlock=!0,this.redrawBlockRestoreConfig=!1}restoreRedraw(){this.redrawBlock=!1,this.redrawBlockRestoreConfig?(this.refreshActiveData(this.redrawBlockRestoreConfig.handler,this.redrawBlockRestoreConfig.skipStage,this.redrawBlockRestoreConfig.renderInPosition),this.redrawBlockRestoreConfig=!1):this.redrawBlockRenderInPosition&&this.reRenderInPosition(),this.redrawBlockRenderInPosition=!1}redraw(e){this.adjustTableSize(),this.table.tableWidth=this.table.element.clientWidth,e?this.renderTable():(this.reRenderInPosition(),this.scrollHorizontal(this.scrollLeft))}resetScroll(){if(this.element.scrollLeft=0,this.element.scrollTop=0,"ie"===this.table.browser){var e=document.createEvent("Event");e.initEvent("scroll",!1,!0),this.element.dispatchEvent(e)}else this.element.dispatchEvent(new Event("scroll"))}}class _l extends Ba{constructor(e){super(e),this.active=!1,this.element=this.createElement(),this.containerElement=this.createContainerElement(),this.external=!1}initialize(){this.initializeElement()}createElement(){var e=document.createElement("div");return e.classList.add("tabulator-footer"),e}createContainerElement(){var e=document.createElement("div");return e.classList.add("tabulator-footer-contents"),this.element.appendChild(e),e}initializeElement(){this.table.options.footerElement&&("string"==typeof this.table.options.footerElement?"<"===this.table.options.footerElement[0]?this.containerElement.innerHTML=this.table.options.footerElement:(this.external=!0,this.containerElement=document.querySelector(this.table.options.footerElement)):this.element=this.table.options.footerElement)}getElement(){return this.element}append(e){this.activate(),this.containerElement.appendChild(e),this.table.rowManager.adjustTableSize()}prepend(e){this.activate(),this.element.insertBefore(e,this.element.firstChild),this.table.rowManager.adjustTableSize()}remove(e){e.parentNode.removeChild(e),this.deactivate()}deactivate(e){this.element.firstChild&&!e||(this.external||this.element.parentNode.removeChild(this.element),this.active=!1)}activate(){this.active||(this.active=!0,this.external||(this.table.element.appendChild(this.getElement()),this.table.element.style.display=""))}redraw(){this.dispatch("footer-redraw")}}class yl extends Ba{constructor(e){super(e),this.el=null,this.abortClasses=["tabulator-headers","tabulator-table"],this.previousTargets={},this.listeners=["click","dblclick","contextmenu","mouseenter","mouseleave","mouseover","mouseout","mousemove","mouseup","mousedown","touchstart","touchend"],this.componentMap={"tabulator-cell":"cell","tabulator-row":"row","tabulator-group":"group","tabulator-col":"column"},this.pseudoTrackers={row:{subscriber:null,target:null},cell:{subscriber:null,target:null},group:{subscriber:null,target:null},column:{subscriber:null,target:null}},this.pseudoTracking=!1}initialize(){this.el=this.table.element,this.buildListenerMap(),this.bindSubscriptionWatchers()}buildListenerMap(){var e={};this.listeners.forEach(t=>{e[t]={handler:null,components:[]}}),this.listeners=e}bindPseudoEvents(){Object.keys(this.pseudoTrackers).forEach(e=>{this.pseudoTrackers[e].subscriber=this.pseudoMouseEnter.bind(this,e),this.subscribe(e+"-mouseover",this.pseudoTrackers[e].subscriber)}),this.pseudoTracking=!0}pseudoMouseEnter(e,t,i){this.pseudoTrackers[e].target!==i&&(this.pseudoTrackers[e].target&&this.dispatch(e+"-mouseleave",t,this.pseudoTrackers[e].target),this.pseudoMouseLeave(e,t),this.pseudoTrackers[e].target=i,this.dispatch(e+"-mouseenter",t,i))}pseudoMouseLeave(e,t){var i=Object.keys(this.pseudoTrackers),s={row:["cell"],cell:["row"]};(i=i.filter(t=>{var i=s[e];return t!==e&&(!i||i&&!i.includes(t))})).forEach(e=>{var i=this.pseudoTrackers[e].target;this.pseudoTrackers[e].target&&(this.dispatch(e+"-mouseleave",t,i),this.pseudoTrackers[e].target=null)})}bindSubscriptionWatchers(){var e=Object.keys(this.listeners),t=Object.values(this.componentMap);for(let i of t)for(let t of e){let e=i+"-"+t;this.subscriptionChange(e,this.subscriptionChanged.bind(this,i,t))}this.subscribe("table-destroy",this.clearWatchers.bind(this))}subscriptionChanged(e,t,i){var s=this.listeners[t].components,n=s.indexOf(e),o=!1;i?-1===n&&(s.push(e),o=!0):this.subscribed(e+"-"+t)||n>-1&&(s.splice(n,1),o=!0),"mouseenter"!==t&&"mouseleave"!==t||this.pseudoTracking||this.bindPseudoEvents(),o&&this.updateEventListeners()}updateEventListeners(){for(let e in this.listeners){let t=this.listeners[e];t.components.length?t.handler||(t.handler=this.track.bind(this,e),this.el.addEventListener(e,t.handler)):t.handler&&(this.el.removeEventListener(e,t.handler),t.handler=null)}}track(e,t){var i=t.composedPath&&t.composedPath()||t.path,s=this.findTargets(i);s=this.bindComponents(e,s),this.triggerEvents(e,t,s),!this.pseudoTracking||"mouseover"!=e&&"mouseleave"!=e||Object.keys(s).length||this.pseudoMouseLeave("none",t)}findTargets(e){var t={};let i=Object.keys(this.componentMap);for(let s of e){let e=s.classList?[...s.classList]:[];if(e.filter(e=>this.abortClasses.includes(e)).length)break;let n=e.filter(e=>i.includes(e));for(let e of n)t[this.componentMap[e]]||(t[this.componentMap[e]]=s)}return t.group&&t.group===t.row&&delete t.row,t}bindComponents(e,t){var i=Object.keys(t).reverse(),s=this.listeners[e],n={},o={},a={};for(let e of i){let i,o=t[e],r=this.previousTargets[e];if(r&&r.target===o)i=r.component;else switch(e){case"row":case"group":(s.components.includes("row")||s.components.includes("cell")||s.components.includes("group"))&&(i=this.table.rowManager.getVisibleRows(!0).find(e=>e.getElement()===o),t.row&&t.row.parentNode&&t.row.parentNode.closest(".tabulator-row")&&(t[e]=!1));break;case"column":s.components.includes("column")&&(i=this.table.columnManager.findColumn(o));break;case"cell":s.components.includes("cell")&&(n.row instanceof ur?i=n.row.findCell(o):t.row&&console.warn("Event Target Lookup Error - The row this cell is attached to cannot be found, has the table been reinitialized without being destroyed first?"))}i&&(n[e]=i,a[e]={target:o,component:i})}return this.previousTargets=a,Object.keys(t).forEach(e=>{let t=n[e];o[e]=t}),o}triggerEvents(e,t,i){var s=this.listeners[e];for(let n in i)i[n]&&s.components.includes(n)&&this.dispatch(n+"-"+e,t,i[n])}clearWatchers(){for(let e in this.listeners){let t=this.listeners[e];t.handler&&(this.el.removeEventListener(e,t.handler),t.handler=null)}}}class xl{constructor(e){this.table=e,this.bindings={}}bind(e,t,i){this.bindings[e]||(this.bindings[e]={}),this.bindings[e][t]?console.warn("Unable to bind component handler, a matching function name is already bound",e,t,i):this.bindings[e][t]=i}handle(e,t,i){if(this.bindings[e]&&this.bindings[e][i]&&"function"==typeof this.bindings[e][i].bind)return this.bindings[e][i].bind(null,t);"then"===i||"string"!=typeof i||i.startsWith("_")||this.table.options.debugInvalidComponentFuncs&&console.error("The "+e+" component does not have a "+i+" function, have you checked that you have the correct Tabulator module installed?")}}class Cl extends Ba{constructor(e){super(e),this.requestOrder=0,this.loading=!1}initialize(){}load(e,t,i,s,n,o){var a=++this.requestOrder;return this.table.destroyed?Promise.resolve():(this.dispatchExternal("dataLoading",e),!e||0!=e.indexOf("{")&&0!=e.indexOf("[")||(e=JSON.parse(e)),this.confirm("data-loading",[e,t,i,n])?(this.loading=!0,n||this.alertLoader(),t=this.chain("data-params",[e,i,n],t||{},t||{}),t=this.mapParams(t,this.table.options.dataSendParams),this.chain("data-load",[e,t,i,n],!1,Promise.resolve([])).then(e=>{if(this.table.destroyed)console.warn("Data Load Response Blocked - Table has been destroyed");else{Array.isArray(e)||"object"!=typeof e||(e=this.mapParams(e,this.objectInvert(this.table.options.dataReceiveParams)));var t=this.chain("data-loaded",[e],null,e);a==this.requestOrder?(this.clearAlert(),!1!==t&&(this.dispatchExternal("dataLoaded",t),this.table.rowManager.setData(t,s,void 0===o?!s:o))):console.warn("Data Load Response Blocked - An active data load request was blocked by an attempt to change table data while the request was being made")}}).catch(e=>{console.error("Data Load Error: ",e),this.dispatchExternal("dataLoadError",e),n||this.alertError(),setTimeout(()=>{this.clearAlert()},this.table.options.dataLoaderErrorTimeout)}).finally(()=>{this.loading=!1})):(this.dispatchExternal("dataLoaded",e),e||(e=[]),this.table.rowManager.setData(e,s,void 0===o?!s:o),Promise.resolve()))}mapParams(e,t){var i={};for(let s in e)i[t.hasOwnProperty(s)?t[s]:s]=e[s];return i}objectInvert(e){var t={};for(let i in e)t[e[i]]=i;return t}blockActiveLoad(){this.requestOrder++}alertLoader(){("function"==typeof this.table.options.dataLoader?this.table.options.dataLoader():this.table.options.dataLoader)&&this.table.alertManager.alert(this.table.options.dataLoaderLoading||this.langText("data|loading"))}alertError(){this.table.alertManager.alert(this.table.options.dataLoaderError||this.langText("data|error"),"error")}clearAlert(){this.table.alertManager.clear()}}class kl{constructor(e,t,i){this.table=e,this.events={},this.optionsList=t||{},this.subscriptionNotifiers={},this.dispatch=i?this._debugDispatch.bind(this):this._dispatch.bind(this),this.debug=i}subscriptionChange(e,t){this.subscriptionNotifiers[e]||(this.subscriptionNotifiers[e]=[]),this.subscriptionNotifiers[e].push(t),this.subscribed(e)&&this._notifySubscriptionChange(e,!0)}subscribe(e,t){this.events[e]||(this.events[e]=[]),this.events[e].push(t),this._notifySubscriptionChange(e,!0)}unsubscribe(e,t){var i;if(this.events[e]){if(t){if(!((i=this.events[e].findIndex(e=>e===t))>-1))return void console.warn("Cannot remove event, no matching event found:",e,t);this.events[e].splice(i,1)}else delete this.events[e];this._notifySubscriptionChange(e,!1)}else console.warn("Cannot remove event, no events set on:",e)}subscribed(e){return this.events[e]&&this.events[e].length}_notifySubscriptionChange(e,t){var i=this.subscriptionNotifiers[e];i&&i.forEach(e=>{e(t)})}_dispatch(){var e,t=Array.from(arguments),i=t.shift();return this.events[i]&&this.events[i].forEach((i,s)=>{let n=i.apply(this.table,t);s||(e=n)}),e}_debugDispatch(){var e=Array.from(arguments),t=e[0];return e[0]="ExternalEvent:"+e[0],(!0===this.debug||this.debug.includes(t))&&console.log(...e),this._dispatch(...arguments)}}class El{constructor(e){this.events={},this.subscriptionNotifiers={},this.dispatch=e?this._debugDispatch.bind(this):this._dispatch.bind(this),this.chain=e?this._debugChain.bind(this):this._chain.bind(this),this.confirm=e?this._debugConfirm.bind(this):this._confirm.bind(this),this.debug=e}subscriptionChange(e,t){this.subscriptionNotifiers[e]||(this.subscriptionNotifiers[e]=[]),this.subscriptionNotifiers[e].push(t),this.subscribed(e)&&this._notifySubscriptionChange(e,!0)}subscribe(e,t,i=1e4){this.events[e]||(this.events[e]=[]),this.events[e].push({callback:t,priority:i}),this.events[e].sort((e,t)=>e.priority-t.priority),this._notifySubscriptionChange(e,!0)}unsubscribe(e,t){var i;if(this.events[e]){if(t){if(!((i=this.events[e].findIndex(e=>e.callback===t))>-1))return void console.warn("Cannot remove event, no matching event found:",e,t);this.events[e].splice(i,1)}this._notifySubscriptionChange(e,!1)}else console.warn("Cannot remove event, no events set on:",e)}subscribed(e){return this.events[e]&&this.events[e].length}_chain(e,t,i,s){var n=i;return Array.isArray(t)||(t=[t]),this.subscribed(e)?(this.events[e].forEach((e,i)=>{n=e.callback.apply(this,t.concat([n]))}),n):"function"==typeof s?s():s}_confirm(e,t){var i=!1;return Array.isArray(t)||(t=[t]),this.subscribed(e)&&this.events[e].forEach((e,s)=>{e.callback.apply(this,t)&&(i=!0)}),i}_notifySubscriptionChange(e,t){var i=this.subscriptionNotifiers[e];i&&i.forEach(e=>{e(t)})}_dispatch(){var e=Array.from(arguments),t=e.shift();this.events[t]&&this.events[t].forEach(t=>{t.callback.apply(this,e)})}_debugDispatch(){var e=Array.from(arguments),t=e[0];return e[0]="InternalEvent:"+t,(!0===this.debug||this.debug.includes(t))&&console.log(...e),this._dispatch(...arguments)}_debugChain(){var e=Array.from(arguments),t=e[0];return e[0]="InternalEvent:"+t,(!0===this.debug||this.debug.includes(t))&&console.log(...e),this._chain(...arguments)}_debugConfirm(){var e=Array.from(arguments),t=e[0];return e[0]="InternalEvent:"+t,(!0===this.debug||this.debug.includes(t))&&console.log(...e),this._confirm(...arguments)}}class Rl extends Ba{constructor(e){super(e)}_warnUser(){this.options("debugDeprecation")&&console.warn(...arguments)}check(e,t,i){var s="";return void 0===this.options(e)||(s="Deprecated Setup Option - Use of the %c"+e+"%c option is now deprecated",t?(s=s+", Please use the %c"+t+"%c option instead",this._warnUser(s,"font-weight: bold;","font-weight: normal;","font-weight: bold;","font-weight: normal;"),i&&(this.table.options[t]=this.table.options[e])):this._warnUser(s,"font-weight: bold;","font-weight: normal;"),!1)}checkMsg(e,t){return void 0===this.options(e)||(this._warnUser("%cDeprecated Setup Option - Use of the %c"+e+" %c option is now deprecated, "+t,"font-weight: normal;","font-weight: bold;","font-weight: normal;"),!1)}msg(e){this._warnUser(e)}}class Ml extends Ba{constructor(e){super(e),this.deps={},this.props={}}initialize(){this.deps=Object.assign({},this.options("dependencies"))}lookup(e,t,i){if(!Array.isArray(e))return t?this.lookupProp(e,t,i):this.lookupKey(e,i);for(const i of e){var s=this.lookup(i,t,!0);if(s)break}if(s)return s;this.error(e)}lookupProp(e,t,i){var s;return this.props[e]&&this.props[e][t]?this.props[e][t]:(s=this.lookupKey(e,i))?(this.props[e]||(this.props[e]={}),this.props[e][t]=s[t]||s,this.props[e][t]):void 0}lookupKey(e,t){var i;return this.deps[e]?i=this.deps[e]:window[e]?(this.deps[e]=window[e],i=this.deps[e]):t||this.error(e),i}error(e){console.error("Unable to find dependency",e,"Please check documentation and ensure you have imported the required library into your project")}}function Tl(e,t){e.forEach(function(e){e.reinitializeWidth()}),this.table.options.responsiveLayout&&this.table.modExists("responsiveLayout",!0)&&this.table.modules.responsiveLayout.update()}var Sl={fitData:function(e,t){t&&this.table.columnManager.renderer.reinitializeColumnWidths(e),this.table.options.responsiveLayout&&this.table.modExists("responsiveLayout",!0)&&this.table.modules.responsiveLayout.update()},fitDataFill:Tl,fitDataTable:Tl,fitDataStretch:function(e,t){var i=0,s=this.table.rowManager.element.clientWidth,n=0,o=!1;e.forEach((e,t)=>{e.widthFixed||e.reinitializeWidth(),(this.table.options.responsiveLayout?e.modules.responsive.visible:e.visible)&&(o=e),e.visible&&(i+=e.getWidth())}),o?(n=s-i+o.getWidth(),this.table.options.responsiveLayout&&this.table.modExists("responsiveLayout",!0)&&(o.setWidth(0),this.table.modules.responsiveLayout.update()),n>0?o.setWidth(n):o.reinitializeWidth()):this.table.options.responsiveLayout&&this.table.modExists("responsiveLayout",!0)&&this.table.modules.responsiveLayout.update()},fitColumns:function(e,t){var i,s,n=this.table.rowManager.element.getBoundingClientRect().width,o=0,a=0,r=0,l=[],h=[],c=0,d=0;function u(e){return"string"==typeof e?e.indexOf("%")>-1?n/100*parseInt(e):parseInt(e):e}function p(e,t,i,s){var n=[],o=0,a=0,l=0,h=r,c=0,d=0,m=[];function g(e){return i*(e.column.definition.widthGrow||1)}function b(e){return u(e.width)-i*(e.column.definition.widthShrink||0)}return e.forEach(function(e,o){var a=s?b(e):g(e);e.column.minWidth>=a?n.push(e):e.column.maxWidth&&e.column.maxWidth<a?(e.width=e.column.maxWidth,t-=e.column.maxWidth,(h-=s?e.column.definition.widthShrink||1:e.column.definition.widthGrow||1)&&(i=Math.floor(t/h))):(m.push(e),d+=s?e.column.definition.widthShrink||1:e.column.definition.widthGrow||1)}),n.length?(n.forEach(function(e){o+=s?e.width-e.column.minWidth:e.column.minWidth,e.width=e.column.minWidth}),a=t-o,l=d?Math.floor(a/d):a,c=p(m,a,l,s)):(c=d?t-Math.floor(t/d)*d:t,m.forEach(function(e){e.width=s?b(e):g(e)})),c}this.table.options.responsiveLayout&&this.table.modExists("responsiveLayout",!0)&&this.table.modules.responsiveLayout.update(),this.table.rowManager.element.scrollHeight>this.table.rowManager.element.clientHeight&&(n-=this.table.rowManager.element.offsetWidth-this.table.rowManager.element.clientWidth),e.forEach(function(e){var t,i,s;e.visible&&(t=e.definition.width,i=parseInt(e.minWidth),t?(s=u(t),o+=s>i?s:i,e.definition.widthShrink&&(h.push({column:e,width:s>i?s:i}),c+=e.definition.widthShrink)):(l.push({column:e,width:0}),r+=e.definition.widthGrow||1))}),a=n-o,i=Math.floor(a/r),d=p(l,a,i,!1),l.length&&d>0&&(l[l.length-1].width+=d),l.forEach(function(e){a-=e.width}),(s=Math.abs(d)+a)>0&&c&&(d=p(h,s,Math.floor(s/c),!0)),d&&h.length&&(h[h.length-1].width-=d),l.forEach(function(e){e.column.setWidth(e.width)}),h.forEach(function(e){e.column.setWidth(e.width)})}};class Dl extends Ga{static moduleName="layout";static modes=Sl;constructor(e){super(e,"layout"),this.mode=null,this.registerTableOption("layout","fitData"),this.registerTableOption("layoutColumnsOnNewData",!1),this.registerColumnOption("widthGrow"),this.registerColumnOption("widthShrink")}initialize(){var e=this.table.options.layout;Dl.modes[e]?this.mode=e:(console.warn("Layout Error - invalid mode set, defaulting to 'fitData' : "+e),this.mode="fitData"),this.table.element.setAttribute("tabulator-layout",this.mode),this.subscribe("column-init",this.initializeColumn.bind(this))}initializeColumn(e){e.definition.widthGrow&&(e.definition.widthGrow=Number(e.definition.widthGrow)),e.definition.widthShrink&&(e.definition.widthShrink=Number(e.definition.widthShrink))}getMode(){return this.mode}layout(e){var t=this.table.columnManager.columnsByIndex.find(e=>e.definition.variableHeight||"textarea"===e.definition.formatter);this.dispatch("layout-refreshing"),Dl.modes[this.mode].call(this,this.table.columnManager.columnsByIndex,e),t&&this.table.rowManager.normalizeHeight(!0),this.dispatch("layout-refreshed")}}var jl={default:{groups:{item:"item",items:"items"},columns:{},data:{loading:"Loading",error:"Error"},pagination:{page_size:"Page Size",page_title:"Show Page",first:"First",first_title:"First Page",last:"Last",last_title:"Last Page",prev:"Prev",prev_title:"Prev Page",next:"Next",next_title:"Next Page",all:"All",counter:{showing:"Showing",of:"of",rows:"rows",pages:"pages"}},headerFilters:{default:"filter column...",columns:{}}}};class Nl extends Ga{static moduleName="localize";static langs=jl;constructor(e){super(e),this.locale="default",this.lang=!1,this.bindings={},this.langList={},this.registerTableOption("locale",!1),this.registerTableOption("langs",{})}initialize(){this.langList=Va.deepClone(Nl.langs),!1!==this.table.options.columnDefaults.headerFilterPlaceholder&&this.setHeaderFilterPlaceholder(this.table.options.columnDefaults.headerFilterPlaceholder);for(let e in this.table.options.langs)this.installLang(e,this.table.options.langs[e]);this.setLocale(this.table.options.locale),this.registerTableFunction("setLocale",this.setLocale.bind(this)),this.registerTableFunction("getLocale",this.getLocale.bind(this)),this.registerTableFunction("getLang",this.getLang.bind(this))}setHeaderFilterPlaceholder(e){this.langList.default.headerFilters.default=e}installLang(e,t){this.langList[e]?this._setLangProp(this.langList[e],t):this.langList[e]=t}_setLangProp(e,t){for(let i in t)e[i]&&"object"==typeof e[i]?this._setLangProp(e[i],t[i]):e[i]=t[i]}setLocale(e){if(!0===(e=e||"default")&&navigator.language&&(e=navigator.language.toLowerCase()),e&&!this.langList[e]){let t=e.split("-")[0];this.langList[t]?(console.warn("Localization Error - Exact matching locale not found, using closest match: ",e,t),e=t):(console.warn("Localization Error - Matching locale not found, using default: ",e),e="default")}this.locale=e,this.lang=Va.deepClone(this.langList.default||{}),"default"!=e&&function e(t,i){for(var s in t)"object"==typeof t[s]?(i[s]||(i[s]={}),e(t[s],i[s])):i[s]=t[s]}(this.langList[e],this.lang),this.dispatchExternal("localized",this.locale,this.lang),this._executeBindings()}getLocale(e){return this.locale}getLang(e){return e?this.langList[e]:this.lang}getText(e,t){var i=(t?e+"|"+t:e).split("|");return this._getLangElement(i,this.locale)||""}_getLangElement(e,t){var i=this.lang;return e.forEach(function(e){var t;i&&(t=i[e],i=void 0!==t&&t)}),i}bind(e,t){this.bindings[e]||(this.bindings[e]=[]),this.bindings[e].push(t),t(this.getText(e),this.lang)}_executeBindings(){for(let e in this.bindings)this.bindings[e].forEach(t=>{t(this.getText(e),this.lang)})}}var Ll=Object.freeze({__proto__:null,CommsModule:class extends Ga{static moduleName="comms";constructor(e){super(e)}initialize(){this.registerTableFunction("tableComms",this.receive.bind(this))}getConnections(e){var t=[];return this.table.constructor.registry.lookupTable(e).forEach(e=>{this.table!==e&&t.push(e)}),t}send(e,t,i,s){var n=this.getConnections(e);n.forEach(e=>{e.tableComms(this.table.element,t,i,s)}),!n.length&&e&&console.warn("Table Connection Error - No tables matching selector found",e)}receive(e,t,i,s){if(this.table.modExists(t))return this.table.modules[t].commsReceived(e,i,s);console.warn("Inter-table Comms Error - no such module:",t)}},LayoutModule:Dl,LocalizeModule:Nl});class Pl{static registry={tables:[],register(e){Pl.registry.tables.push(e)},deregister(e){var t=Pl.registry.tables.indexOf(e);t>-1&&Pl.registry.tables.splice(t,1)},lookupTable(e,t){var i,s,n=[];if("string"==typeof e){if((i=document.querySelectorAll(e)).length)for(var o=0;o<i.length;o++)(s=Pl.registry.matchElement(i[o]))&&n.push(s)}else"undefined"!=typeof HTMLElement&&e instanceof HTMLElement||e instanceof Pl?(s=Pl.registry.matchElement(e))&&n.push(s):Array.isArray(e)?e.forEach(function(e){n=n.concat(Pl.registry.lookupTable(e))}):t||console.warn("Table Connection Error - Invalid Selector",e);return n},matchElement:e=>Pl.registry.tables.find(function(t){return e instanceof Pl?t===e:t.element===e})};static findTable(e){var t=Pl.registry.lookupTable(e,!0);return!(Array.isArray(t)&&!t.length)&&t}}class Al extends Pl{static moduleBindings={};static moduleExtensions={};static modulesRegistered=!1;static defaultModules=!1;constructor(){super()}static initializeModuleBinder(e){Al.modulesRegistered||(Al.modulesRegistered=!0,Al._registerModules(Ll,!0),e&&Al._registerModules(e))}static _extendModule(e,t,i){if(Al.moduleBindings[e]){var s=Al.moduleBindings[e][t];if(s)if("object"==typeof i)for(let e in i)s[e]=i[e];else console.warn("Module Error - Invalid value type, it must be an object");else console.warn("Module Error - property does not exist:",t)}else console.warn("Module Error - module does not exist:",e)}static _registerModules(e,t){var i=Object.values(e);t&&i.forEach(e=>{e.prototype.moduleCore=!0}),Al._registerModule(i)}static _registerModule(e){Array.isArray(e)||(e=[e]),e.forEach(e=>{Al._registerModuleBinding(e),Al._registerModuleExtensions(e)})}static _registerModuleBinding(e){e.moduleName?Al.moduleBindings[e.moduleName]=e:console.error("Unable to bind module, no moduleName defined",e.moduleName)}static _registerModuleExtensions(e){var t=e.moduleExtensions;if(e.moduleExtensions)for(let e in t){let i=t[e];if(Al.moduleBindings[e])for(let t in i)Al._extendModule(e,t,i[t]);else{Al.moduleExtensions[e]||(Al.moduleExtensions[e]={});for(let t in i)Al.moduleExtensions[e][t]||(Al.moduleExtensions[e][t]={}),Object.assign(Al.moduleExtensions[e][t],i[t])}}Al._extendModuleFromQueue(e)}static _extendModuleFromQueue(e){var t=Al.moduleExtensions[e.moduleName];if(t)for(let i in t)Al._extendModule(e.moduleName,i,t[i])}_bindModules(){var e=[],t=[],i=[];for(var s in this.modules={},Al.moduleBindings){let n=Al.moduleBindings[s],o=new n(this);this.modules[s]=o,n.prototype.moduleCore?this.modulesCore.push(o):n.moduleInitOrder?n.moduleInitOrder<0?e.push(o):t.push(o):i.push(o)}e.sort((e,t)=>e.moduleInitOrder>t.moduleInitOrder?1:-1),t.sort((e,t)=>e.moduleInitOrder>t.moduleInitOrder?1:-1),this.modulesRegular=e.concat(i.concat(t))}}class zl extends Ba{constructor(e){super(e),this.element=this._createAlertElement(),this.msgElement=this._createMsgElement(),this.type=null,this.element.appendChild(this.msgElement)}_createAlertElement(){var e=document.createElement("div");return e.classList.add("tabulator-alert"),e}_createMsgElement(){var e=document.createElement("div");return e.classList.add("tabulator-alert-msg"),e.setAttribute("role","alert"),e}_typeClass(){return"tabulator-alert-state-"+this.type}alert(e,t="msg"){if(e){for(this.clear(),this.dispatch("alert-show",t),this.type=t;this.msgElement.firstChild;)this.msgElement.removeChild(this.msgElement.firstChild);this.msgElement.classList.add(this._typeClass()),"function"==typeof e&&(e=e()),e instanceof HTMLElement?this.msgElement.appendChild(e):this.msgElement.innerHTML=e,this.table.element.appendChild(this.element)}}clear(){this.dispatch("alert-hide",this.type),this.element.parentNode&&this.element.parentNode.removeChild(this.element),this.msgElement.classList.remove(this._typeClass())}}class Fl extends Al{static defaultOptions=dl;static extendModule(){Fl.initializeModuleBinder(),Fl._extendModule(...arguments)}static registerModule(){Fl.initializeModuleBinder(),Fl._registerModule(...arguments)}constructor(e,t,i){super(),Fl.initializeModuleBinder(i),this.options={},this.columnManager=null,this.rowManager=null,this.footerManager=null,this.alertManager=null,this.vdomHoz=null,this.externalEvents=null,this.eventBus=null,this.interactionMonitor=!1,this.browser="",this.browserSlow=!1,this.browserMobile=!1,this.rtl=!1,this.originalElement=null,this.componentFunctionBinder=new xl(this),this.dataLoader=!1,this.modules={},this.modulesCore=[],this.modulesRegular=[],this.deprecationAdvisor=new Rl(this),this.optionsList=new ul(this,"table constructor"),this.dependencyRegistry=new Ml(this),this.initialized=!1,this.destroyed=!1,this.initializeElement(e)&&(this.initializeCoreSystems(t),setTimeout(()=>{this._create()})),this.constructor.registry.register(this)}initializeElement(e){return"undefined"!=typeof HTMLElement&&e instanceof HTMLElement?(this.element=e,!0):"string"==typeof e?(this.element=document.querySelector(e),!!this.element||(console.error("Tabulator Creation Error - no element found matching selector: ",e),!1)):(console.error("Tabulator Creation Error - Invalid element provided:",e),!1)}initializeCoreSystems(e){this.columnManager=new bl(this),this.rowManager=new wl(this),this.footerManager=new _l(this),this.dataLoader=new Cl(this),this.alertManager=new zl(this),this._bindModules(),this.options=this.optionsList.generate(Fl.defaultOptions,e),this._clearObjectPointers(),this._mapDeprecatedFunctionality(),this.externalEvents=new kl(this,this.options,this.options.debugEventsExternal),this.eventBus=new El(this.options.debugEventsInternal),this.interactionMonitor=new yl(this),this.dataLoader.initialize(),this.footerManager.initialize(),this.dependencyRegistry.initialize()}_mapDeprecatedFunctionality(){}_clearSelection(){this.element.classList.add("tabulator-block-select"),window.getSelection?window.getSelection().empty?window.getSelection().empty():window.getSelection().removeAllRanges&&window.getSelection().removeAllRanges():document.selection&&document.selection.empty(),this.element.classList.remove("tabulator-block-select")}_create(){this.externalEvents.dispatch("tableBuilding"),this.eventBus.dispatch("table-building"),this._rtlCheck(),this._buildElement(),this._initializeTable(),this.initialized=!0,this._loadInitialData().finally(()=>{this.eventBus.dispatch("table-initialized"),this.externalEvents.dispatch("tableBuilt")})}_rtlCheck(){var e=window.getComputedStyle(this.element);switch(this.options.textDirection){case"auto":if("rtl"!==e.direction)break;case"rtl":this.element.classList.add("tabulator-rtl"),this.rtl=!0;break;case"ltr":this.element.classList.add("tabulator-ltr");default:this.rtl=!1}}_clearObjectPointers(){this.options.columns=this.options.columns.slice(0),Array.isArray(this.options.data)&&!this.options.reactiveData&&(this.options.data=this.options.data.slice(0))}_buildElement(){var e,t=this.element,i=this.options;if("TABLE"===t.tagName){this.originalElement=this.element,e=document.createElement("div");var s=t.attributes;for(var n in s)"object"==typeof s[n]&&e.setAttribute(s[n].name,s[n].value);t.parentNode.replaceChild(e,t),this.element=t=e}for(t.classList.add("tabulator"),t.setAttribute("role","grid"),t.setAttribute("aria-owns","tabulator-table-body");t.firstChild;)t.removeChild(t.firstChild);i.height&&(i.height=isNaN(i.height)?i.height:i.height+"px",t.style.height=i.height),!1!==i.minHeight&&(i.minHeight=isNaN(i.minHeight)?i.minHeight:i.minHeight+"px",t.style.minHeight=i.minHeight),!1!==i.maxHeight&&(i.maxHeight=isNaN(i.maxHeight)?i.maxHeight:i.maxHeight+"px",t.style.maxHeight=i.maxHeight)}_initializeTable(){var e=this.element,t=this.options;this.interactionMonitor.initialize(),this.columnManager.initialize(),this.rowManager.initialize(),this._detectBrowser(),this.modulesCore.forEach(e=>{e.initialize()}),e.appendChild(this.columnManager.getElement()),e.appendChild(this.rowManager.getElement()),t.footerElement&&this.footerManager.activate(),t.autoColumns&&t.data&&this.columnManager.generateColumnsFromRowData(this.options.data),this.modulesRegular.forEach(e=>{e.initialize()}),this.columnManager.setColumns(t.columns),this.eventBus.dispatch("table-built")}_loadInitialData(){return this.dataLoader.load(this.options.data).finally(()=>{this.columnManager.verticalAlignHeaders()})}destroy(){var e=this.element;for(this.destroyed=!0,this.constructor.registry.deregister(this),this.eventBus.dispatch("table-destroy"),this.rowManager.destroy();e.firstChild;)e.removeChild(e.firstChild);e.classList.remove("tabulator"),e.removeAttribute("tabulator-layout"),this.externalEvents.dispatch("tableDestroyed")}_detectBrowser(){var e=navigator.userAgent||navigator.vendor||window.opera;e.indexOf("Trident")>-1?(this.browser="ie",this.browserSlow=!0):e.indexOf("Edge")>-1?(this.browser="edge",this.browserSlow=!0):e.indexOf("Firefox")>-1?(this.browser="firefox",this.browserSlow=!1):e.indexOf("Mac OS")>-1?(this.browser="safari",this.browserSlow=!1):(this.browser="other",this.browserSlow=!1),this.browserMobile=/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(e)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw-(n|u)|c55\/|capi|ccwa|cdm-|cell|chtm|cldc|cmd-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc-s|devi|dica|dmob|do(c|p)o|ds(12|-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(-|_)|g1 u|g560|gene|gf-5|g-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd-(m|p|t)|hei-|hi(pt|ta)|hp( i|ip)|hs-c|ht(c(-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i-(20|go|ma)|i230|iac( |-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|-[a-w])|libw|lynx|m1-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|-([1-8]|c))|phil|pire|pl(ay|uc)|pn-2|po(ck|rt|se)|prox|psio|pt-g|qa-a|qc(07|12|21|32|60|-[2-7]|i-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h-|oo|p-)|sdk\/|se(c(-|0|1)|47|mc|nd|ri)|sgh-|shar|sie(-|m)|sk-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h-|v-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl-|tdg-|tel(i|m)|tim-|t-mo|to(pl|sh)|ts(70|m-|m3|m5)|tx-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas-|your|zeto|zte-/i.test(e.slice(0,4))}initGuard(e,t){var i,s;return this.options.debugInitialization&&!this.initialized&&(e||(e=" "==(s="Error"==(i=(new Error).stack.split("\n"))[0]?i[2]:i[1])[0]?s.trim().split(" ")[1].split(".")[1]:s.trim().split("@")[0]),console.warn("Table Not Initialized - Calling the "+e+" function before the table is initialized may result in inconsistent behavior, Please wait for the `tableBuilt` event before calling this function."+(t?" "+t:""))),this.initialized}blockRedraw(){this.initGuard(),this.eventBus.dispatch("redraw-blocking"),this.rowManager.blockRedraw(),this.columnManager.blockRedraw(),this.eventBus.dispatch("redraw-blocked")}restoreRedraw(){this.initGuard(),this.eventBus.dispatch("redraw-restoring"),this.rowManager.restoreRedraw(),this.columnManager.restoreRedraw(),this.eventBus.dispatch("redraw-restored")}setData(e,t,i){return this.initGuard(!1,"To set initial data please use the 'data' property in the table constructor."),this.dataLoader.load(e,t,i,!1)}clearData(){this.initGuard(),this.dataLoader.blockActiveLoad(),this.rowManager.clearData()}getData(e){return this.rowManager.getData(e)}getDataCount(e){return this.rowManager.getDataCount(e)}replaceData(e,t,i){return this.initGuard(),this.dataLoader.load(e,t,i,!0,!0)}updateData(e){var t=0;return this.initGuard(),new Promise((i,s)=>{this.dataLoader.blockActiveLoad(),"string"==typeof e&&(e=JSON.parse(e)),e&&e.length>0?e.forEach(e=>{var n=this.rowManager.findRow(e[this.options.index]);n?(t++,n.updateData(e).then(()=>{--t||i()}).catch(t=>{s("Update Error - Unable to update row",e,t)})):s("Update Error - Unable to find row",e)}):(console.warn("Update Error - No data provided"),s("Update Error - No data provided"))})}addData(e,t,i){return this.initGuard(),new Promise((s,n)=>{this.dataLoader.blockActiveLoad(),"string"==typeof e&&(e=JSON.parse(e)),e?this.rowManager.addRows(e,t,i).then(e=>{var t=[];e.forEach(function(e){t.push(e.getComponent())}),s(t)}):(console.warn("Update Error - No data provided"),n("Update Error - No data provided"))})}updateOrAddData(e){var t=[],i=0;return this.initGuard(),new Promise((s,n)=>{this.dataLoader.blockActiveLoad(),"string"==typeof e&&(e=JSON.parse(e)),e&&e.length>0?e.forEach(e=>{var n=this.rowManager.findRow(e[this.options.index]);i++,n?n.updateData(e).then(()=>{i--,t.push(n.getComponent()),i||s(t)}):this.rowManager.addRows(e).then(e=>{i--,t.push(e[0].getComponent()),i||s(t)})}):(console.warn("Update Error - No data provided"),n("Update Error - No data provided"))})}getRow(e){var t=this.rowManager.findRow(e);return t?t.getComponent():(console.warn("Find Error - No matching row found:",e),!1)}getRowFromPosition(e){var t=this.rowManager.getRowFromPosition(e);return t?t.getComponent():(console.warn("Find Error - No matching row found:",e),!1)}deleteRow(e){var t=[];this.initGuard(),Array.isArray(e)||(e=[e]);for(let i of e){let e=this.rowManager.findRow(i,!0);if(!e)return console.error("Delete Error - No matching row found:",i),Promise.reject("Delete Error - No matching row found");t.push(e)}return t.sort((e,t)=>this.rowManager.rows.indexOf(e)>this.rowManager.rows.indexOf(t)?1:-1),t.forEach(e=>{e.delete()}),this.rowManager.reRenderInPosition(),Promise.resolve()}addRow(e,t,i){return this.initGuard(),"string"==typeof e&&(e=JSON.parse(e)),this.rowManager.addRows(e,t,i,!0).then(e=>e[0].getComponent())}updateOrAddRow(e,t){var i=this.rowManager.findRow(e);return this.initGuard(),"string"==typeof t&&(t=JSON.parse(t)),i?i.updateData(t).then(()=>i.getComponent()):this.rowManager.addRows(t).then(e=>e[0].getComponent())}updateRow(e,t){var i=this.rowManager.findRow(e);return this.initGuard(),"string"==typeof t&&(t=JSON.parse(t)),i?i.updateData(t).then(()=>Promise.resolve(i.getComponent())):(console.warn("Update Error - No matching row found:",e),Promise.reject("Update Error - No matching row found"))}scrollToRow(e,t,i){var s=this.rowManager.findRow(e);return s?this.rowManager.scrollToRow(s,t,i):(console.warn("Scroll Error - No matching row found:",e),Promise.reject("Scroll Error - No matching row found"))}moveRow(e,t,i){var s=this.rowManager.findRow(e);this.initGuard(),s?s.moveToRow(t,i):console.warn("Move Error - No matching row found:",e)}getRows(e){return this.rowManager.getComponents(e)}getRowPosition(e){var t=this.rowManager.findRow(e);return t?t.getPosition():(console.warn("Position Error - No matching row found:",e),!1)}setColumns(e){this.initGuard(!1,"To set initial columns please use the 'columns' property in the table constructor"),this.columnManager.setColumns(e)}getColumns(e){return this.columnManager.getComponents(e)}getColumn(e){var t=this.columnManager.findColumn(e);return t?t.getComponent():(console.warn("Find Error - No matching column found:",e),!1)}getColumnDefinitions(){return this.columnManager.getDefinitionTree()}showColumn(e){var t=this.columnManager.findColumn(e);if(this.initGuard(),!t)return console.warn("Column Show Error - No matching column found:",e),!1;t.show()}hideColumn(e){var t=this.columnManager.findColumn(e);if(this.initGuard(),!t)return console.warn("Column Hide Error - No matching column found:",e),!1;t.hide()}toggleColumn(e){var t=this.columnManager.findColumn(e);if(this.initGuard(),!t)return console.warn("Column Visibility Toggle Error - No matching column found:",e),!1;t.visible?t.hide():t.show()}addColumn(e,t,i){var s=this.columnManager.findColumn(i);return this.initGuard(),this.columnManager.addColumn(e,t,s).then(e=>e.getComponent())}deleteColumn(e){var t=this.columnManager.findColumn(e);return this.initGuard(),t?t.delete():(console.warn("Column Delete Error - No matching column found:",e),Promise.reject())}updateColumnDefinition(e,t){var i=this.columnManager.findColumn(e);return this.initGuard(),i?i.updateDefinition(t):(console.warn("Column Update Error - No matching column found:",e),Promise.reject())}moveColumn(e,t,i){var s=this.columnManager.findColumn(e),n=this.columnManager.findColumn(t);this.initGuard(),s?n?this.columnManager.moveColumn(s,n,i):console.warn("Move Error - No matching column found:",n):console.warn("Move Error - No matching column found:",e)}scrollToColumn(e,t,i){return new Promise((s,n)=>{var o=this.columnManager.findColumn(e);return o?this.columnManager.scrollToColumn(o,t,i):(console.warn("Scroll Error - No matching column found:",e),Promise.reject("Scroll Error - No matching column found"))})}redraw(e){this.initGuard(),this.columnManager.redraw(e),this.rowManager.redraw(e)}setHeight(e){this.options.height=isNaN(e)?e:e+"px",this.element.style.height=this.options.height,this.rowManager.initializeRenderer(),this.rowManager.redraw(!0)}setMaxHeight(e){this.options.maxHeight=isNaN(e)?e:e+"px",this.element.style.maxHeight=this.options.maxHeight,this.rowManager.initializeRenderer(),this.rowManager.redraw(!0)}setMinHeight(e){this.options.minHeight=isNaN(e)?e:e+"px",this.element.style.minHeight=this.options.minHeight,this.rowManager.initializeRenderer(),this.rowManager.redraw(!0)}on(e,t){this.externalEvents.subscribe(e,t)}off(e,t){this.externalEvents.unsubscribe(e,t)}dispatchEvent(){Array.from(arguments).shift(),this.externalEvents.dispatch(...arguments)}alert(e,t){this.initGuard(),this.alertManager.alert(e,t)}clearAlert(){this.initGuard(),this.alertManager.clear()}modExists(e,t){return!!this.modules[e]||(t&&console.error("Tabulator Module Not Installed: "+e),!1)}module(e){var t=this.modules[e];return t||console.error("Tabulator module not installed: "+e),t}}class Ol extends Fl{static extendModule(){Fl.initializeModuleBinder(cl),Fl._extendModule(...arguments)}static registerModule(){Fl.initializeModuleBinder(cl),Fl._registerModule(...arguments)}constructor(e,t,i){super(e,t,cl)}}function Hl(e){const t=String(e||"").toUpperCase();return/^[A-Z]{2}$/.test(t)?String.fromCodePoint(...[...t].map(e=>127397+e.charCodeAt(0))):""}function Il(e,t){if(!e)return;const i=String(t||"").trim().toLowerCase();try{i?e.setFilter(e=>String(e._search_blob||"").includes(i)):e.clearFilter(!0)}catch(e){}}function Bl(e){const t=(Array.isArray(e)?e:[]).map(e=>{const t=Ta(e.name),i=Number(e.llm_type_id||e.id);return{title:`<span class="slr-aiv-llm-icon slr-aiv-llm-icon--${t}" title="${Da(e.name)}"></span>`,field:`llm_${i}`,hozAlign:"center",headerHozAlign:"center",width:96,minWidth:96,cssClass:"slr-aiv-llm-col",headerSort:!1,formatter:t=>function(e,t){const i=Number(t.llm_type_id||t.id),s=e?.llms?.[i]||e?.llms?.[String(i)];if(!s)return'<span class="slr-aiv-llm-cell slr-aiv-llm-cell--empty">—</span>';if(s.pending)return`<span class="slr-aiv-llm-cell slr-aiv-llm-cell--pending" title="${Da((0,r.__)("Pending","seo-local-rank"))}"><span class="dashicons dashicons-clock"></span></span>`;const n=s.mentioned?"is-active":"is-inactive",o=s.cited?"is-active":"is-inactive";return`<span class="slr-aiv-llm-cell slr-aiv-llm-cell--statuses"><span class="slr-aiv-status ${n}" title="${Da((0,r.__)("Mentions","seo-local-rank"))}"><span class="dashicons dashicons-format-chat"></span></span><span class="slr-aiv-status ${o}" title="${Da((0,r.__)("Citations","seo-local-rank"))}"><span class="dashicons dashicons-admin-links"></span></span></span>`}(t.getRow().getData(),e)}});return[{title:(0,r.__)("Prompt","seo-local-rank"),field:"prompt",minWidth:220,formatter:e=>`<span class="slr-aiv-prompt-text">${Da(e.getValue()||"")}</span>`},{title:(0,r.__)("Location","seo-local-rank"),field:"location",width:180,formatter(e){const t=e.getRow().getData(),i=t.location||t.country||"—",s=Hl(t.country),n=s?`<span class="slr-rt-flag" aria-hidden="true">${s}</span>`:"";return`<span class="slr-rt-location" title="${Da(t.google_search_location||i)}">${n}${Da(i)}</span>`}},...t,{title:(0,r.__)("Sentiment","seo-local-rank"),field:"sentiment",hozAlign:"center",width:120,headerSort:!1,formatter:e=>function(e){const t=Object.values(e?.llms||{}).map(e=>e?.sentiment).filter(Boolean)[0]||"";if(!t)return"—";const i={positive:(0,r.__)("Positive","seo-local-rank"),neutral:(0,r.__)("Neutral","seo-local-rank"),negative:(0,r.__)("Negative","seo-local-rank")};return`<span class="slr-aiv-sentiment slr-aiv-sentiment--${Da(t)}"><span class="slr-aiv-sentiment__dot"></span>${Da(i[t]||t)}</span>`}(e.getRow().getData())},{title:(0,r.__)("Trend","seo-local-rank"),field:"trend",hozAlign:"center",width:96,headerSort:!1,formatter:e=>function(e){const t=Array.isArray(e)?e.map(e=>Number(e)||0):[];if(!t.length)return'<span class="slr-aiv-spark slr-aiv-spark--empty">—</span>';const i=Math.max(...t,1),s=t.length>1?72/(t.length-1):0,n=t.map((e,t)=>{const n=24-e/i*22-1;return`${0===t?"M":"L"}${(t*s).toFixed(1)},${n.toFixed(1)}`}).join(" ");return`<svg class="slr-aiv-spark" width="72" height="24" viewBox="0 0 72 24" aria-hidden="true"><path d="${n}" fill="none" stroke="#007BFF" stroke-width="1.5"/></svg>`}(e.getValue())}]}function Vl({prompts:e,llms:i,loading:s,projectDomainId:n}){const o=(0,t.useRef)(null),a=(0,t.useRef)(null),h=(0,t.useRef)(!1),c=(0,t.useRef)(""),d=(0,t.useRef)(Number(n)||0),u=(0,t.useRef)(!1),[p,m]=(0,t.useState)(""),g=(0,t.useMemo)(()=>function(e){return(Array.isArray(e)?e:[]).map((e,t)=>({...e,_row_key:e.id||`${e.prompt_id||"p"}-${t}`,_search_blob:[e.prompt,e.location,e.country,e.category].filter(Boolean).join(" ").toLowerCase()}))}(e),[e]),b=(0,t.useMemo)(()=>(Array.isArray(i)?i:[]).map(e=>`${e.llm_type_id||e.id}`).join(","),[i]);return(0,t.useEffect)(()=>{d.current=Number(n)||0},[n]),(0,t.useEffect)(()=>{if(!o.current)return;h.current=!1;const e=new Ol(o.current,{layout:"fitColumns",autoResize:!1,movableColumns:!1,reactiveData:!1,index:"_row_key",rowHeight:52,height:"480px",renderVertical:"virtual",headerSort:!0,data:[],columns:Bl(i),pagination:!0,paginationSize:100,paginationSizeSelector:[25,50,100],paginationCounter:(e,t,i,s)=>s?`${t}–${Math.min(t+e-1,s)} / ${s}`:"0",placeholder:s?(0,r.__)("Loading…","seo-local-rank"):(0,r.__)("No prompts in this range.","seo-local-rank"),locale:!0,langs:{default:{pagination:{first:(0,r.__)("First","seo-local-rank"),first_title:(0,r.__)("First","seo-local-rank"),last:(0,r.__)("Last","seo-local-rank"),last_title:(0,r.__)("Last","seo-local-rank"),prev:(0,r.__)("Prev","seo-local-rank"),prev_title:(0,r.__)("Prev","seo-local-rank"),next:(0,r.__)("Next","seo-local-rank"),next_title:(0,r.__)("Next","seo-local-rank"),page_size:(0,r.__)("Show","seo-local-rank"),counter:{showing:"",of:"/",rows:"",pages:""}}}},columnDefaults:{headerTooltip:!1,tooltip:!1,vertAlign:"middle",resizable:!0}});a.current=e;const t=()=>{h.current=!0,Promise.resolve(e.replaceData(s?[]:g)).then(()=>Il(e,c.current)).catch(()=>{})},n=()=>{const e=d.current;e&&!u.current&&(u.current=!0,na("ai_visibility",e).finally(()=>{u.current=!1}))};return e.on("tableBuilt",t),e.on("rowClick",n),()=>{h.current=!1,e.off("tableBuilt",t),e.off("rowClick",n),e.destroy(),a.current=null}},[b]),(0,t.useEffect)(()=>{h.current&&a.current&&(a.current.options.placeholder=s?(0,r.__)("Loading…","seo-local-rank"):(0,r.__)("No prompts in this range.","seo-local-rank"),Promise.resolve(a.current.replaceData(s?[]:g)).then(()=>Il(a.current,c.current)).catch(()=>{}))},[g,s]),(0,t.useEffect)(()=>{c.current=p;const e=window.setTimeout(()=>{Il(a.current,p)},180);return()=>window.clearTimeout(e)},[p]),(0,l.jsxs)("div",{className:"slr-panel slr-aiv-table-panel",children:[(0,l.jsxs)("div",{className:"slr-rt-table-toolbar",children:[(0,l.jsx)("div",{className:"slr-rt-table-toolbar__left"}),(0,l.jsx)("input",{type:"search",className:"slr-rt-table-toolbar__search",placeholder:(0,r.__)("Search prompt…","seo-local-rank"),autoComplete:"off",value:p,onChange:e=>m(e.target.value)})]}),(0,l.jsx)("div",{className:"slr-rt-table slr-aiv-table"+(n?" slr-aiv-table--clickable":""),children:(0,l.jsx)("div",{ref:o})})]})}function Wl({score:e,collecting:t}){const i=e?.score??"—",s=e?.trend||"flat",n=Number(e?.delta||0),o=Array.isArray(e?.breakdown)?e.breakdown:[],a="up"===s?"↑":"down"===s?"↓":"→",h="up"===s?"+":"down"===s?"-":"";return(0,l.jsxs)("div",{className:"slr-panel slr-aiv-card slr-aiv-score"+(t?" is-collecting":""),children:[(0,l.jsx)("div",{className:"slr-aiv-score__label",children:(0,r.__)("AI Visibility Score","seo-local-rank")}),(0,l.jsxs)("div",{className:"slr-aiv-score__main",children:[(0,l.jsx)("span",{className:"slr-aiv-score__value",children:i}),(0,l.jsx)("span",{className:`slr-aiv-score__delta slr-aiv-score__delta--${s}`,children:(0,r.sprintf)(/* translators: 1: arrow, 2: signed delta, 3: unit */ /* translators: 1: arrow, 2: signed delta, 3: unit */
     12(0,r.__)("%1$s %2$s pts","seo-local-rank"),a,`${h}${n}`)})]}),(0,l.jsx)("div",{className:"slr-aiv-score__breakdown",children:o.map(e=>(0,l.jsxs)("div",{className:"slr-aiv-breakdown",children:[(0,l.jsxs)("div",{className:"slr-aiv-breakdown__main",children:[(0,l.jsxs)("div",{className:"slr-aiv-breakdown__label",children:[(0,l.jsx)("span",{children:e.label}),(0,l.jsxs)("span",{className:"slr-aiv-breakdown__weight",children:["· ",e.weight,"%"]})]}),(0,l.jsx)("div",{className:"slr-aiv-breakdown__bar",children:(0,l.jsx)("div",{style:{width:`${Math.min(100,Number(e.value)||0)}%`}})})]}),(0,l.jsx)("span",{className:"slr-aiv-breakdown__value",children:e.value})]},e.key||e.label))}),(0,l.jsx)(ja,{visible:t})]})}function Gl({trend:e,collecting:t}){const i=Array.isArray(e)?e:[],s={labels:i.map(e=>Yo(e.date)),datasets:[{label:(0,r.__)("Score","seo-local-rank"),data:i.map(e=>e.score),borderColor:"#007BFF",backgroundColor:"rgba(0, 123, 255, 0.12)",fill:!0,yAxisID:"yScore",tension:.3,pointRadius:0,pointHoverRadius:3},{label:(0,r.__)("Mentions","seo-local-rank"),data:i.map(e=>e.mentions),borderColor:"#FF9500",backgroundColor:"transparent",yAxisID:"yCount",tension:.3,pointRadius:0,pointHoverRadius:3},{label:(0,r.__)("Citations","seo-local-rank"),data:i.map(e=>e.citations),borderColor:"#A259FF",backgroundColor:"transparent",yAxisID:"yCount",tension:.3,pointRadius:0,pointHoverRadius:3}]},n={responsive:!0,maintainAspectRatio:!1,interaction:{mode:"index",intersect:!1},plugins:{legend:Wo},scales:{x:Vo.x,yScore:{...Vo.y,min:0,max:100,position:"left"},yCount:{...Vo.y,position:"right",grid:{drawOnChartArea:!1}}}};return(0,l.jsxs)("div",{className:"slr-panel slr-aiv-card slr-aiv-trend"+(t?" is-collecting":""),children:[(0,l.jsx)("div",{className:"slr-aiv-trend__label",children:(0,r.__)("Score trend","seo-local-rank")}),(0,l.jsx)("div",{className:"slr-aiv-trend__chart",children:i.length>0&&!t?(0,l.jsx)(Ao,{data:s,options:n}):null}),(0,l.jsx)(ja,{visible:t})]})}const Ul=e=>`${e}%`;function $l({shareOfVoice:e,perLlm:i,loadingPerLlm:s,perLlmError:o,hasCompetitors:a,collecting:h,projectDomainId:c}){const[d,u]=(0,t.useState)(!1),p=Number(c)>0;if(!a)return(0,l.jsx)("div",{className:"slr-panel slr-aiv-sov-empty",children:(0,l.jsx)(n.Button,{variant:"primary",disabled:!p||d,isBusy:d,onClick:async()=>{if(!d&&p){u(!0);try{await na("ai_visibility",c)}finally{u(!1)}}},children:(0,r.__)("Add first competitor","seo-local-rank")})});const m=Array.isArray(e?.pie)?e.pie:[],g=Array.isArray(e?.trend)?e.trend:[],b=g[0]?.dates||[],f=function(e){const t=Array.isArray(e)?e:[],i=Array.isArray(t[0]?.entities)?t[0].entities:[];return{labels:t.map(e=>e.label||e.name||""),datasets:i.map((e,i)=>{const s=e.name||"";return{label:s,data:t.map(e=>{const t=(Array.isArray(e.entities)?e.entities:[]).find(e=>e.name===s);return Number(t?.rate??0)}),backgroundColor:Ma(e.solid_color||e.color),borderWidth:0,borderRadius:2,minBarLength:3,categoryPercentage:.75,barPercentage:.9,order:i}})}}(i),v={labels:m.map(e=>e.name),datasets:[{data:m.map(e=>e.y),backgroundColor:m.map(e=>e.color||"#007BFF"),borderWidth:0}]},w={responsive:!0,maintainAspectRatio:!1,interaction:{mode:"index",intersect:!1},plugins:{legend:Wo,tooltip:{callbacks:{label(e){const t=e.parsed?.y??0;return`${e.dataset.label}: ${t}%`}}}},scales:{x:{...Vo.x,ticks:{...Vo.x.ticks,maxRotation:0,autoSkip:!1}},y:{...Vo.y,min:0,max:100,ticks:{...Vo.y.ticks,callback:Ul}}}},_={labels:b.map(e=>Yo(e)),datasets:g.map(e=>({label:e.name,data:e.points,borderColor:e.color||"#007BFF",backgroundColor:"transparent",borderWidth:e.is_brand?3:2,tension:.3,pointRadius:e.is_brand?2:0,pointHoverRadius:3}))},y={responsive:!0,maintainAspectRatio:!1,interaction:{mode:"index",intersect:!1},plugins:{legend:Wo},scales:{x:Vo.x,y:{...Vo.y,min:0,max:100}}};let x=null;return s&&!f.labels.length?x=(0,l.jsx)("div",{className:"slr-aiv-sov__loading",children:(0,r.__)("Loading…","seo-local-rank")}):o?x=(0,l.jsx)("div",{className:"slr-aiv-sov__loading",children:o}):f.labels.length&&f.datasets.length&&(x=(0,l.jsx)(zo,{data:f,options:w})),(0,l.jsxs)("div",{className:"slr-aiv-sov"+(h?" is-collecting":""),children:[(0,l.jsxs)("div",{className:"slr-aiv-sov__top",children:[(0,l.jsxs)("div",{className:"slr-panel slr-aiv-card",children:[(0,l.jsx)("div",{className:"slr-aiv-trend__label",children:(0,r.__)("Current share of voice","seo-local-rank")}),(0,l.jsx)("div",{className:"slr-aiv-sov__chart",children:m.length>0?(0,l.jsx)(Fo,{data:v,options:{responsive:!0,maintainAspectRatio:!1,plugins:{legend:{position:"bottom"}}}}):null})]}),(0,l.jsxs)("div",{className:"slr-panel slr-aiv-card",children:[(0,l.jsx)("div",{className:"slr-aiv-trend__label",children:(0,r.__)("Share of voice per LLM","seo-local-rank")}),(0,l.jsx)("div",{className:"slr-aiv-sov__chart",children:x})]})]}),(0,l.jsxs)("div",{className:"slr-panel slr-aiv-card",children:[(0,l.jsx)("div",{className:"slr-aiv-trend__label",children:(0,r.__)("Share of voice over time","seo-local-rank")}),(0,l.jsx)("div",{className:"slr-aiv-sov__chart slr-aiv-sov__chart--wide",children:g.length>0?(0,l.jsx)(Ao,{data:_,options:y}):null})]}),(0,l.jsx)(ja,{visible:h})]})}function Yl({domainsPayload:e,selectedProject:i,onProjectChange:a}){const h=e?.domains||[],c=e?.domain||"",d=i?.project_domain_id||i?.id||0,[u,p]=(0,t.useState)(null),[m,g]=(0,t.useState)(!0),[b,f]=(0,t.useState)(""),[v,w]=(0,t.useState)("overview"),[_,y]=(0,t.useState)(null),[x,C]=(0,t.useState)(!1),[k,E]=(0,t.useState)(""),[R,M]=(0,t.useState)(!1),T=u?.data||null,S=ya(u),D=xa(u),j=function(e){return xa(e)>0&&!function(e){return Boolean(ya(e).has_visibility_scores)}(e)}(u),N=j&&Ea(u).length>0,L=T?.brand_words?.[0]?.brand_word||S.brand||"",P=(0,t.useCallback)(async()=>{if(!d)return p(null),f(""),void g(!1);g(!0),p(null),f(""),y(null),E("");try{const e=await s()({path:o(`/domains/ai-visibility?project_domain_id=${d}`)});p(e||null)}catch(e){p(null),f(e?.message||(0,r.__)("Could not load AI Visibility. Try again later.","seo-local-rank"))}finally{g(!1)}},[d]),A=(0,t.useCallback)(async()=>{if(!R&&d){M(!0);try{await na("ai_visibility",d)}finally{M(!1)}}},[R,d]);return(0,t.useEffect)(()=>{w("overview"),P()},[P]),(0,t.useEffect)(()=>{if("share-of-voice"!==v||!d)return;if(0===Ea(u).length||null!==_)return;let e=!1;const t=u?.date_range?.start_date||"",i=u?.date_range?.end_date||"",n=t&&i?`&start=${t}&end=${i}`:"";return(async()=>{C(!0),E("");try{const t=await s()({path:o(`/domains/ai-visibility/share-of-voice?project_domain_id=${d}${n}`)});e||y(function(e){const t=e?.data?.per_llm??e?.per_llm??[];return Array.isArray(t)?t:t&&"object"==typeof t?Object.values(t):[]}(t))}catch(t){e||(y([]),E(t?.message||(0,r.__)("Could not load share of voice per LLM.","seo-local-rank")))}finally{e||C(!1)}})(),()=>{e=!0}},[v,d,u,_]),i?m&&!u?(0,l.jsx)(_a,{}):(0,l.jsxs)("div",{className:"slr-ai-visibility","data-aiv-ready":u?"true":"false",children:[(0,l.jsx)(pa,{selectedProject:i,domains:h,siteDomain:c,onProjectChange:a,promptCount:u?D:null}),(0,l.jsxs)("div",{className:"slr-ai-visibility__body",children:[b&&(0,l.jsx)(n.Notice,{status:"error",isDismissible:!1,children:b}),u&&(0,l.jsx)(l.Fragment,{children:0===D?(0,l.jsx)(Fa,{projectDomainId:d}):(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)("div",{className:"slr-aiv-top",children:[(0,l.jsx)(Wl,{score:S.score,collecting:j}),(0,l.jsxs)("div",{className:"slr-aiv-middle",children:[(0,l.jsx)(Ia,{summary:S.mentions_summary,collecting:j}),(0,l.jsx)(Oa,{coverage:S.llm_coverage,brandName:L,collecting:j})]}),(0,l.jsx)(za,{brandSov:Ra(u),competitors:Ea(u),limit:T?.num_competitors_user,collecting:N,projectDomainId:d})]}),(0,l.jsx)(Gl,{trend:S.score_trend,collecting:j}),(0,l.jsx)("div",{className:"slr-aiv-actions",children:(0,l.jsx)(n.Button,{variant:"primary",className:"slr-rt-add-keywords",icon:"plus-alt2",disabled:!d||R,isBusy:R,onClick:A,children:(0,r.__)("Add prompts","seo-local-rank")})}),(0,l.jsxs)("ul",{className:"slr-aiv-tabs",role:"tablist",children:[(0,l.jsx)("li",{children:(0,l.jsx)("button",{type:"button",role:"tab","aria-selected":"overview"===v,className:"overview"===v?"is-active":"",onClick:()=>w("overview"),children:(0,r.__)("Prompt results","seo-local-rank")})}),(0,l.jsx)("li",{children:(0,l.jsx)("button",{type:"button",role:"tab","aria-selected":"share-of-voice"===v,className:"share-of-voice"===v?"is-active":"",onClick:()=>w("share-of-voice"),children:(0,r.__)("Share of voice","seo-local-rank")})}),(0,l.jsx)("li",{children:(0,l.jsx)("button",{type:"button",role:"tab","aria-selected":"changes"===v,className:"changes"===v?"is-active":"",onClick:()=>w("changes"),children:(0,r.__)("AI Visibility Changes","seo-local-rank")})})]}),"overview"===v&&(0,l.jsx)(Vl,{prompts:ka(u),llms:Ca(u),projectDomainId:d}),"share-of-voice"===v&&(0,l.jsx)($l,{shareOfVoice:S.share_of_voice,perLlm:_,loadingPerLlm:x,perLlmError:k,hasCompetitors:Ea(u).length>0,collecting:N,projectDomainId:d}),"changes"===v&&(0,l.jsx)(Pa,{changes:S.changes,collecting:j})]})})]})]}):(0,l.jsx)("div",{className:"slr-panel slr-empty-state",children:(0,l.jsx)("p",{children:(0,r.__)("No project selected.","seo-local-rank")})})}function Kl(e){if(!e||"string"!=typeof e)return null;const t=e.trim().match(/^(\d{4})-(\d{2})-(\d{2})/);if(!t)return null;const i=new Date(Date.UTC(Number(t[1]),Number(t[2])-1,Number(t[3])));return Number.isNaN(i.getTime())?null:i}function Xl(e){if(!e)return"";if("string"==typeof e){const t=Kl(e);return t?Xl(t):""}return e instanceof Date&&!Number.isNaN(e.getTime())?`${e.getUTCFullYear()}-${String(e.getUTCMonth()+1).padStart(2,"0")}-${String(e.getUTCDate()).padStart(2,"0")}`:""}function ql(){const e=new Date;return new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate()))}function Jl(e,t){const i=new Date(e.getTime());return i.setUTCDate(i.getUTCDate()+t),i}function Zl(e,t){const i=new Date(e.getTime());return i.setUTCMonth(i.getUTCMonth()+t),i}function Ql(e){return new Date(Date.UTC(e.getUTCFullYear(),e.getUTCMonth(),1))}function eh(e,t,i){return e<t?t:e>i?i:e}function th(e,t){return Boolean(e&&t&&Xl(e)===Xl(t))}function ih(e){const t=[];return e>=2&&t.push("1day"),e>=7&&t.push("7days"),e>=31&&t.push("1month"),e>=61&&t.push("2months"),e>=92&&t.push("3months"),t}function sh(e,t){switch(e){case"1day":return{start:Jl(t,-1),end:t};case"7days":return{start:Jl(t,-6),end:t};case"1month":default:return{start:Zl(t,-1),end:t};case"2months":return{start:Zl(t,-2),end:t};case"3months":return{start:Zl(t,-3),end:t};case"6months":return{start:Zl(t,-6),end:t};case"1year":return{start:Zl(t,-12),end:t}}}function nh(){return document.documentElement.lang||void 0}const oh={"1day":(0,r.__)("1 day","seo-local-rank"),"7days":(0,r.__)("7 days","seo-local-rank"),"1month":(0,r.__)("1 month","seo-local-rank"),"2months":(0,r.__)("2 months","seo-local-rank"),"3months":(0,r.__)("3 months","seo-local-rank"),"6months":(0,r.__)("6 months","seo-local-rank"),"1year":(0,r.__)("1 year","seo-local-rank")};function ah({year:e,month:t,start:i,end:s,minDate:n,maxDate:o,firstDay:a,weekdayLabels:h,onSelect:c,onMonthChange:d}){const u=nh(),p=new Intl.DateTimeFormat(u,{month:"short",year:"numeric",timeZone:"UTC"}).format(new Date(Date.UTC(e,t,1))),m=function(e,t,i){const s=(new Date(Date.UTC(e,t,1)).getUTCDay()-i+7)%7,n=new Date(Date.UTC(e,t+1,0)).getUTCDate(),o=[];for(let e=0;e<s;e++)o.push(null);for(let i=1;i<=n;i++)o.push(new Date(Date.UTC(e,t,i)));return o}(e,t,a),g=[],b=n.getUTCFullYear(),f=o.getUTCFullYear();for(let e=b;e<=f;e++)g.push(e);return(0,l.jsxs)("div",{className:"slr-rt-cal",children:[(0,l.jsxs)("div",{className:"slr-rt-cal__nav",children:[(0,l.jsx)("button",{type:"button",className:"slr-rt-cal__nav-btn","aria-label":(0,r.__)("Previous month","seo-local-rank"),onClick:()=>d(Zl(new Date(Date.UTC(e,t,1)),-1)),children:(0,l.jsx)("span",{className:"dashicons dashicons-arrow-left-alt2","aria-hidden":"true"})}),(0,l.jsxs)("div",{className:"slr-rt-cal__caption",children:[(0,l.jsx)("select",{value:t,"aria-label":(0,r.__)("Month","seo-local-rank"),onChange:t=>d(new Date(Date.UTC(e,Number(t.target.value),1))),children:Array.from({length:12},(e,t)=>(0,l.jsx)("option",{value:t,children:new Intl.DateTimeFormat(u,{month:"short",timeZone:"UTC"}).format(new Date(Date.UTC(2021,t,1)))},t))}),(0,l.jsx)("select",{value:e,"aria-label":(0,r.__)("Year","seo-local-rank"),onChange:e=>d(new Date(Date.UTC(Number(e.target.value),t,1))),children:g.map(e=>(0,l.jsx)("option",{value:e,children:e},e))}),(0,l.jsx)("span",{className:"screen-reader-text",children:p})]}),(0,l.jsx)("button",{type:"button",className:"slr-rt-cal__nav-btn","aria-label":(0,r.__)("Next month","seo-local-rank"),onClick:()=>d(Zl(new Date(Date.UTC(e,t,1)),1)),children:(0,l.jsx)("span",{className:"dashicons dashicons-arrow-right-alt2","aria-hidden":"true"})})]}),(0,l.jsxs)("div",{className:"slr-rt-cal__grid",children:[h.map((e,t)=>(0,l.jsx)("span",{className:"slr-rt-cal__weekday",children:e},t)),m.map((e,t)=>{if(!e)return(0,l.jsx)("span",{className:"slr-rt-cal__day is-empty"},`empty-${t}`);const a=(e=>e<n||e>o)(e),r=th(e,i),h=th(e,s),d=function(e,t,i){if(!e||!t||!i)return!1;const s=e.getTime();return s>=t.getTime()&&s<=i.getTime()}(e,i,s),u=["slr-rt-cal__day",a?"is-disabled":"",r||h?"is-edge":"",d?"is-in-range":""].filter(Boolean).join(" ");return(0,l.jsx)("button",{type:"button",className:u,disabled:a,onClick:()=>c(e),children:e.getUTCDate()},e.toISOString())})]})]})}function rh({start:e,end:i,minDate:s,maxDate:n,projectDays:o,onChange:a,presetKeys:h}){const c=nh(),d=function(e){return String(e||"").toLowerCase().startsWith("en")?0:1}(c),u=(0,t.useRef)(null),[p,m]=(0,t.useState)(!1),[g,b]=(0,t.useState)(e),[f,v]=(0,t.useState)(i),[w,_]=(0,t.useState)(!1),[y,x]=(0,t.useState)(Ql(e||ql())),[C,k]=(0,t.useState)(Zl(Ql(e||ql()),1)),E=(0,t.useMemo)(()=>Array.isArray(h)&&h.length?h:ih(o),[h,o]),R=(0,t.useMemo)(()=>function(e,t){const i=new Intl.DateTimeFormat(e||void 0,{weekday:"short",timeZone:"UTC"}),s=[];for(let e=0;e<7;e++){const n=(t+e)%7,o=new Date(Date.UTC(2021,7,1+n));s.push(i.format(o))}return s}(c,d),[c,d]),M=ql(),T=function(e,t,i,s,n){const o=Array.isArray(n)&&n.length?n:ih(s);for(const s of o){const n=sh(s,i);if(th(n.start,e)&&th(n.end,t))return s}return"custom"}(e,i,M,o,E),S=function(e,t,i){if(!e||!t)return"";const s=new Intl.DateTimeFormat(i||void 0,{day:"numeric",month:"short",year:"numeric",timeZone:"UTC"});return`${s.format(e)} – ${s.format(t)}`}(e,i,c);(0,t.useEffect)(()=>{if(!p)return;const e=e=>{u.current&&!u.current.contains(e.target)&&m(!1)};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[p]);const D=(e,t)=>{const i=eh(e,s,n),o=eh(t,s,n);a(i,o),m(!1)},j=e=>{if(!w||!g)return b(e),v(null),void _(!0);e<g?D(e,g):D(g,e)};return(0,l.jsxs)("div",{className:"slr-rt-daterange",ref:u,children:[(0,l.jsxs)("button",{type:"button",className:"slr-rt-daterange__trigger","aria-expanded":p,"aria-haspopup":"dialog",onClick:()=>{b(e),v(i),_(!1),x(Ql(e||M)),k(Zl(Ql(e||M),1)),m(e=>!e)},children:[(0,l.jsx)("span",{className:"dashicons dashicons-calendar-alt","aria-hidden":"true"}),(0,l.jsx)("span",{children:S})]}),p&&(0,l.jsxs)("div",{className:"slr-rt-daterange__popover",role:"dialog","aria-label":(0,r.__)("Date range","seo-local-rank"),children:[(0,l.jsx)("button",{type:"button",className:"slr-rt-daterange__close",onClick:()=>m(!1),children:(0,r.__)("Close","seo-local-rank")}),(0,l.jsxs)("div",{className:"slr-rt-daterange__body",children:[(0,l.jsx)("ul",{className:"slr-rt-daterange__presets",children:E.map(e=>(0,l.jsx)("li",{children:(0,l.jsx)("button",{type:"button",className:T===e?"slr-rt-daterange__preset is-active":"slr-rt-daterange__preset",onClick:()=>(e=>{const t=sh(e,M);D(t.start,t.end)})(e),children:oh[e]})},e))}),(0,l.jsxs)("div",{className:"slr-rt-daterange__calendars",children:[(0,l.jsx)(ah,{year:y.getUTCFullYear(),month:y.getUTCMonth(),start:g,end:f,minDate:s,maxDate:n,firstDay:d,weekdayLabels:R,onSelect:j,onMonthChange:x}),(0,l.jsx)(ah,{year:C.getUTCFullYear(),month:C.getUTCMonth(),start:g,end:f,minDate:s,maxDate:n,firstDay:d,weekdayLabels:R,onSelect:j,onMonthChange:k})]})]})]})]})}function lh(e){return e.is_country?e.name:e.google_search_location?`${e.name} (${e.google_search_location})`:e.name}function hh({bootstrap:e,start:t,end:i,minDate:s,maxDate:n,projectDays:o,onRangeChange:a}){const h=Array.isArray(e?.tags_list)?e.tags_list:[],c=Array.isArray(e?.locations)?e.locations:[];return(0,l.jsxs)("div",{className:"slr-panel slr-rt-filters",children:[(0,l.jsxs)("div",{className:"slr-rt-filters__row",children:[(0,l.jsxs)("div",{className:"slr-rt-filters__left slr-rt-filters__hidden",children:[(0,l.jsxs)("div",{className:"slr-rt-device",role:"group","aria-label":(0,r.__)("Device","seo-local-rank"),children:[(0,l.jsx)("button",{type:"button",className:"slr-rt-device__btn is-selected","data-value":"0",children:(0,r.__)("All","seo-local-rank")}),(0,l.jsx)("button",{type:"button",className:"slr-rt-device__btn","data-value":"1","aria-label":(0,r.__)("Desktop","seo-local-rank"),children:(0,l.jsx)("span",{className:"dashicons dashicons-desktop","aria-hidden":"true"})}),(0,l.jsx)("button",{type:"button",className:"slr-rt-device__btn","data-value":"2","aria-label":(0,r.__)("Mobile","seo-local-rank"),children:(0,l.jsx)("span",{className:"dashicons dashicons-smartphone","aria-hidden":"true"})})]}),(0,l.jsx)("button",{type:"button",className:"slr-rt-icon-btn","aria-label":(0,r.__)("Favorites","seo-local-rank"),children:(0,l.jsx)("span",{className:"dashicons dashicons-heart","aria-hidden":"true"})}),(0,l.jsxs)("div",{className:"slr-rt-combo",children:[(0,l.jsxs)("select",{className:"slr-rt-filter-select slr-rt-combo__mode","aria-label":(0,r.__)("Tag match","seo-local-rank"),defaultValue:"1",children:[(0,l.jsx)("option",{value:"1",children:(0,r.__)("Include all tags","seo-local-rank")}),(0,l.jsx)("option",{value:"0",children:(0,r.__)("Include one tag","seo-local-rank")}),(0,l.jsx)("option",{value:"2",children:(0,r.__)("Does not have this tag","seo-local-rank")}),(0,l.jsx)("option",{value:"3",children:(0,r.__)("Does not have one of those tags","seo-local-rank")})]}),(0,l.jsx)("select",{className:"slr-rt-filter-select slr-rt-combo__value","aria-label":(0,r.__)("Tags","seo-local-rank"),multiple:!0,children:h.filter(e=>Number(e.num_keywords)>0).map(e=>(0,l.jsx)("option",{value:e.id,"data-color":e.color,children:e.description},e.id))})]}),(0,l.jsxs)("select",{className:"slr-rt-filter-select slr-rt-filter-select--location","aria-label":(0,r.__)("Location","seo-local-rank"),defaultValue:"0",children:[(0,l.jsx)("option",{value:"0",children:(0,r.__)("All locations","seo-local-rank")}),c.map(e=>(0,l.jsx)("option",{value:e.id,"data-region":e.region_code,children:lh(e)},e.id))]}),(0,l.jsxs)("button",{type:"button",className:"slr-rt-more-filters",children:[(0,l.jsx)("span",{className:"dashicons dashicons-admin-generic","aria-hidden":"true"}),(0,l.jsx)("span",{children:(0,r.__)("More filters","seo-local-rank")}),(0,l.jsx)("span",{className:"dashicons dashicons-arrow-down-alt2","aria-hidden":"true"})]})]}),(0,l.jsx)("div",{className:"slr-rt-filters__right",children:(0,l.jsx)(rh,{start:t,end:i,minDate:s,maxDate:n,projectDays:o,onChange:a})})]}),(0,l.jsxs)("div",{className:"slr-rt-filters__row slr-rt-filters__hidden",children:[(0,l.jsxs)("div",{className:"slr-rt-combo",children:[(0,l.jsxs)("select",{className:"slr-rt-filter-select slr-rt-combo__mode","aria-label":(0,r.__)("URL match","seo-local-rank"),defaultValue:"0",children:[(0,l.jsx)("option",{value:"0",children:(0,r.__)("URL contains","seo-local-rank")}),(0,l.jsx)("option",{value:"2",children:(0,r.__)("URL not contains","seo-local-rank")}),(0,l.jsx)("option",{value:"1",children:(0,r.__)("Exact URL","seo-local-rank")}),(0,l.jsx)("option",{value:"3",children:(0,r.__)("Exact URL different","seo-local-rank")})]}),(0,l.jsx)("input",{type:"text",className:"slr-rt-filter-input slr-rt-combo__value",placeholder:(0,r.__)("Word","seo-local-rank")})]}),(0,l.jsx)("input",{type:"text",className:"slr-rt-filter-input",placeholder:(0,r.__)("Volume","seo-local-rank")}),(0,l.jsx)("input",{type:"text",className:"slr-rt-filter-input",placeholder:(0,r.__)("Position","seo-local-rank")}),(0,l.jsxs)("select",{className:"slr-rt-filter-select","aria-label":(0,r.__)("Rank change","seo-local-rank"),defaultValue:"",children:[(0,l.jsx)("option",{value:"",children:(0,r.__)("All","seo-local-rank")}),(0,l.jsx)("option",{value:"1",children:(0,r.__)("Keywords up","seo-local-rank")}),(0,l.jsx)("option",{value:"-1",children:(0,r.__)("Keywords down","seo-local-rank")}),(0,l.jsx)("option",{value:"0",children:(0,r.__)("No changes","seo-local-rank")})]}),(0,l.jsx)("input",{type:"text",className:"slr-rt-filter-input",placeholder:(0,r.__)("No. of words","seo-local-rank")}),(0,l.jsxs)("select",{className:"slr-rt-filter-select","aria-label":(0,r.__)("Cannibalizations","seo-local-rank"),defaultValue:"0",children:[(0,l.jsx)("option",{value:"0",children:(0,r.__)("Cannibalizations","seo-local-rank")}),(0,l.jsx)("option",{value:"1",children:(0,r.__)("All cannibalizations","seo-local-rank")}),(0,l.jsx)("option",{value:"-1",children:(0,r.__)("No cannibalizations","seo-local-rank")}),(0,l.jsx)("option",{value:"2",children:(0,r.__)("Target URL is not ranking higher","seo-local-rank")}),(0,l.jsx)("option",{value:"3",children:(0,r.__)("Target URL is ranking higher","seo-local-rank")}),(0,l.jsx)("option",{value:"4",children:(0,r.__)("Target URL is set","seo-local-rank")}),(0,l.jsx)("option",{value:"5",children:(0,r.__)("Target URL is not set","seo-local-rank")})]}),(0,l.jsxs)("select",{className:"slr-rt-filter-select","aria-label":(0,r.__)("AI Overview","seo-local-rank"),defaultValue:"",children:[(0,l.jsx)("option",{value:"",children:(0,r.__)("All keywords","seo-local-rank")}),(0,l.jsx)("option",{value:"0",children:(0,r.__)("No AI Overview keywords","seo-local-rank")}),(0,l.jsx)("option",{value:"1",children:(0,r.__)("AI Overview keywords","seo-local-rank")}),(0,l.jsx)("option",{value:"2",children:(0,r.__)("Mentions keywords","seo-local-rank")}),(0,l.jsx)("option",{value:"3",children:(0,r.__)("Citations keywords","seo-local-rank")})]})]}),(0,l.jsxs)("div",{className:"slr-rt-filters__row slr-rt-filters__row--center slr-rt-filters__hidden",children:[(0,l.jsx)("div",{className:"slr-rt-filtered-count"}),(0,l.jsxs)("button",{type:"button",className:"slr-rt-clear-filters",children:[(0,l.jsx)("span",{className:"dashicons dashicons-dismiss","aria-hidden":"true"}),(0,r.__)("Clear filters","seo-local-rank")]}),(0,l.jsxs)("button",{type:"button",className:"slr-rt-save-view",children:[(0,l.jsx)("span",{className:"dashicons dashicons-category","aria-hidden":"true"}),(0,r.__)("Save as view","seo-local-rank")]}),(0,l.jsxs)("button",{type:"button",className:"slr-rt-delete-view",children:[(0,l.jsx)("span",{className:"dashicons dashicons-trash","aria-hidden":"true"}),(0,r.__)("Delete view","seo-local-rank")]})]})]})}function ch(e){const t=new Set,i=[];return String(e||"").split("\n").forEach(e=>{let s=e.trim();if(s.endsWith(".")&&(s=s.slice(0,-1).trim()),!s)return;const n=s.toLowerCase();t.has(n)||(t.add(n),i.push(s))}),i}function dh(e,t,i){const s=Number(e)||0,n=Number(t)||0,o=0===i?2:1;return s<=0?0:n>0?s*n*o:s*o}function uh(e,t=!1){return e&&"object"==typeof e?t&&1===Number(e.is_country)&&e.english_name?String(e.english_name):String(e.name||e.description||e.english_name||""):""}function ph(){return String(document.documentElement.lang||"").toLowerCase().startsWith("en")}function mh(e){return Number(e?.id||e?.province_id||0)}function gh({number:e,children:t}){return(0,l.jsxs)("div",{className:"slr-addkw-section__title",children:[(0,l.jsx)("span",{className:"slr-addkw-section__number",children:e}),(0,l.jsx)("span",{className:"slr-addkw-section__heading",children:t})]})}function bh({bootstrap:e,projectDomainId:i,onClose:a,onAdded:h}){const c=function(e){const t=Number(e?.available_keywords);if(Number.isFinite(t)&&t>=0)return t;const i=Number(e?.max_tracking_keywords),s=Number(e?.num_tracking_keywords??e?.num_keywords);return Number.isFinite(i)&&Number.isFinite(s)?Math.max(0,i-s):null}(e),d=function(e){return e?.domain?.name||e?.selected_domain?.name||""}(e),[u,p]=(0,t.useState)(""),[m,g]=(0,t.useState)(1),[b,f]=(0,t.useState)(()=>function(e){const t=e?.main_country;if(!t||"object"!=typeof t)return[];const i=Number(t.province_id);return!Number.isFinite(i)||i<=0?[]:[{id:i,name:(ph()?t.english_name||t.name:t.name||t.english_name)||"",region_code:t.region_code||"",google_search_location:t.google_search_location||""}]}(e)),[v,w]=(0,t.useState)(""),[_,y]=(0,t.useState)([]),[x,C]=(0,t.useState)(!1),[k,E]=(0,t.useState)(!1),[R,M]=(0,t.useState)(!1),[T,S]=(0,t.useState)(!1),[D,j]=(0,t.useState)(""),[N,L]=(0,t.useState)(!1),P=(0,t.useRef)(0),A=(0,t.useRef)(null),z=(0,t.useRef)(!0),F=(0,t.useMemo)(()=>ch(u),[u]),O=dh(F.length,b.length,m),H=null===c?null:c-O,I=null!==c&&O>c,B=I||R,V=F.length>0&&b.length>0&&!I&&!T&&Number(i)>0,W=Array.from({length:Math.max(9,u.split("\n").length)},(e,t)=>t+1),G=(0,t.useMemo)(()=>new Set(b.map(e=>mh(e))),[b]),U=(0,t.useMemo)(()=>_.filter(e=>{const t=mh(e);return t>0&&!G.has(t)}),[_,G]);(0,t.useEffect)(()=>{const e=v.trim();if(e.length<3)return P.current+=1,y([]),void C(!1);C(!0);const t=++P.current,i=setTimeout(async()=>{try{const i=new URLSearchParams({description:e}),n=await s()({path:o(`/locations/search?${i.toString()}`)});if(t!==P.current)return;y(Array.isArray(n?.data)?n.data:[])}catch(e){if(t!==P.current)return;y([])}finally{t===P.current&&C(!1)}},250);return()=>{clearTimeout(i)}},[v]),(0,t.useEffect)(()=>{const e=e=>{A.current&&!A.current.contains(e.target)&&E(!1)};return document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)}},[]),(0,t.useEffect)(()=>{B&&z.current&&(z.current=!1,L(!0)),B||(z.current=!0)},[B]);const $=()=>{p(e=>ch(e).join("\n"))};return(0,l.jsxs)(n.Modal,{title:(0,r.__)("Add keywords","seo-local-rank"),onRequestClose:T?()=>{}:a,className:"slr-addkw-modal",children:[N?(0,l.jsxs)(n.__experimentalConfirmDialog,{isOpen:!0,onConfirm:()=>{na(),L(!1)},onCancel:()=>L(!1),confirmButtonText:(0,r.__)("Go to plans","seo-local-rank"),cancelButtonText:(0,r.__)("Cancel","seo-local-rank"),children:[(0,l.jsx)("h2",{className:"slr-addkw-upgrade__title",children:(0,r.__)("Keyword limit reached","seo-local-rank")}),(0,l.jsx)("p",{children:(0,r.__)("You should consider upgrade your plan to add more keywords.","seo-local-rank")})]}):null,(0,l.jsxs)("div",{className:"slr-addkw"+(T?" is-busy":""),children:[T?(0,l.jsx)("div",{className:"slr-addkw__busy","aria-live":"polite",children:(0,l.jsx)(n.Spinner,{})}):null,(0,l.jsxs)("div",{className:"slr-addkw__header",children:[(0,l.jsx)("h2",{className:"slr-addkw__title",children:(0,r.__)("Add keywords","seo-local-rank")}),null!==H?(0,l.jsxs)("div",{className:"slr-addkw__remaining"+(B?" is-danger":""),children:[(0,l.jsx)("span",{className:"slr-addkw__remaining-count",children:Uo(H)})," ",(0,r.__)("keywords left","seo-local-rank")]}):null]}),(0,l.jsxs)("div",{className:"slr-addkw__body",children:[(0,l.jsx)("div",{className:"slr-addkw__col slr-addkw__col--left",children:(0,l.jsxs)("section",{className:"slr-addkw-section",children:[(0,l.jsx)(gh,{number:"1",children:d?(0,r.sprintf)(/* translators: %s: project hostname */ /* translators: %s: project hostname */
     13(0,r.__)("Add keywords to %s","seo-local-rank"),d):(0,r.__)("Add keywords","seo-local-rank")}),(0,l.jsx)("p",{className:"slr-addkw-section__desc",children:(0,r.__)("One keyword per line","seo-local-rank")}),B?(0,l.jsx)("p",{className:"slr-addkw-error",role:"alert",children:(0,r.__)("Number of keywords is above the available keywords.","seo-local-rank")}):null,D&&!B?(0,l.jsx)("p",{className:"slr-addkw-error",role:"alert",children:D}):null,(0,l.jsxs)("div",{className:"slr-addkw-lined",children:[(0,l.jsx)("div",{className:"slr-addkw-lined__nums","aria-hidden":"true",children:W.map(e=>(0,l.jsx)("span",{children:e},e))}),(0,l.jsx)("textarea",{className:"slr-addkw-lined__input",rows:9,value:u,onChange:e=>{M(!1),p(e.target.value)},onBlur:$,onPaste:()=>{window.setTimeout($,200)}})]})]})}),(0,l.jsxs)("div",{className:"slr-addkw__col slr-addkw__col--right",children:[(0,l.jsxs)("section",{className:"slr-addkw-section",children:[(0,l.jsx)(gh,{number:"2",children:(0,r.__)("Where do you want to track your keywords?","seo-local-rank")}),(0,l.jsx)("p",{className:"slr-addkw-section__desc",children:(0,r.__)("Countries, provinces, cities…","seo-local-rank")}),(0,l.jsxs)("div",{className:"slr-addkw-suggest",ref:A,children:[(0,l.jsx)("input",{type:"text",className:"slr-addkw-input",value:v,placeholder:(0,r.__)("Write a country, province or city","seo-local-rank"),onChange:e=>{w(e.target.value),E(!0)},onFocus:()=>E(!0),autoComplete:"off"}),k&&v.trim().length>=3?(0,l.jsx)("div",{className:"slr-addkw-suggest__list",role:"listbox",children:x?(0,l.jsx)("div",{className:"slr-addkw-suggest__status",children:(0,l.jsx)(n.Spinner,{})}):0===U.length?(0,l.jsx)("div",{className:"slr-addkw-suggest__status",children:(0,r.__)("No locations found.","seo-local-rank")}):U.map(e=>{const t=mh(e),i=uh(e,ph()),s=Hl(e.region_code);return(0,l.jsxs)("button",{type:"button",className:"slr-addkw-suggest__item",onClick:()=>(e=>{const t=mh(e);if(t<=0||G.has(t))return;const i=dh(F.length,b.length+1,m);null!==c&&i>c?M(!0):(M(!1),f(i=>[...i,{id:t,name:uh(e,ph()),region_code:e.region_code||"",google_search_location:e.google_search_location||""}]),w(""),y([]),E(!1),$())})(e),children:[(0,l.jsxs)("span",{className:"slr-addkw-suggest__item-main",children:[s?(0,l.jsx)("span",{className:"slr-rt-flag","aria-hidden":"true",children:s}):null,i]}),e.google_search_location?(0,l.jsx)("span",{className:"slr-addkw-suggest__item-meta",children:e.google_search_location}):null]},t)})}):null]}),b.length>0?(0,l.jsx)("div",{className:"slr-addkw-chips",children:b.map(e=>{const t=Hl(e.region_code);return(0,l.jsxs)("span",{className:"slr-addkw-chip",children:[t?(0,l.jsx)("span",{className:"slr-rt-flag","aria-hidden":"true",children:t}):null,e.name,(0,l.jsx)("button",{type:"button",className:"slr-addkw-chip__remove","aria-label":(0,r.__)("Remove location","seo-local-rank"),onClick:()=>{return t=e.id,M(!1),f(e=>e.filter(e=>mh(e)!==t)),void $();var t},children:"×"})]},e.id)})}):null]}),(0,l.jsxs)("section",{className:"slr-addkw-section slr-addkw-section--spaced",children:[(0,l.jsx)(gh,{number:"3",children:(0,r.__)("On what type of device do you want to track the results?","seo-local-rank")}),(0,l.jsx)("p",{className:"slr-addkw-section__desc",children:(0,r.__)("When selecting two devices, the number of used keywords doubles","seo-local-rank")}),(0,l.jsxs)("div",{className:"slr-addkw-device",role:"group","aria-label":(0,r.__)("Device","seo-local-rank"),children:[(0,l.jsxs)("button",{type:"button",className:"slr-addkw-device__btn"+(1===m?" is-selected":""),onClick:()=>g(1),children:[(0,l.jsx)("span",{className:"dashicons dashicons-desktop","aria-hidden":"true"}),(0,r.__)("Desktop","seo-local-rank")]}),(0,l.jsxs)("button",{type:"button",className:"slr-addkw-device__btn"+(2===m?" is-selected":""),onClick:()=>g(2),children:[(0,l.jsx)("span",{className:"dashicons dashicons-smartphone","aria-hidden":"true"}),(0,r.__)("Mobile","seo-local-rank")]}),(0,l.jsx)("button",{type:"button",className:"slr-addkw-device__btn"+(0===m?" is-selected":""),onClick:()=>g(0),children:(0,r.__)("Both","seo-local-rank")})]})]})]})]}),(0,l.jsxs)("div",{className:"slr-addkw__footer",children:[(0,l.jsx)(n.Button,{variant:"primary",className:"slr-addkw__submit",disabled:!V,onClick:async()=>{if(!V)return;const e=ch(u),t=b.map(e=>mh(e)).filter(e=>e>0);if(0!==e.length&&0!==t.length){S(!0),j("");try{await s()({path:o("/keywords/add-multi"),method:"POST",data:{project_domain_id:Number(i),keywords:e,cities:t,screen_type:m}}),"function"==typeof h?h():a()}catch(e){!function(e){const t=e?.data&&"object"==typeof e.data?e.data:e||{},i=t.data&&"object"==typeof t.data?t.data:{},s=i.error_code??t.error_code??e?.code,n=String(i.error||t.error||t.message||e?.message||"");return 1===Number(s)||"ER_MAX_TRACKING_KEYWORDS"===s||n.includes("ER_MAX_TRACKING_KEYWORDS")}(e)?j(e?.message||(0,r.__)("Could not add keywords. Try again later.","seo-local-rank")):L(!0)}finally{S(!1)}}},children:(0,r.__)("Add keywords to your project","seo-local-rank")}),(0,l.jsxs)("div",{className:"slr-addkw__note",children:[(0,l.jsx)("span",{className:"dashicons dashicons-info-outline","aria-hidden":"true"}),(0,l.jsx)("span",{children:(0,r.__)("You can add multiple words and multiple locations, creating combinations between all of them.","seo-local-rank")})]})]})]})]})}const fh="#EF7A35";function vh(e){const t=parseInt(e?.depth,10),i=10*(Number.isFinite(t)&&t>0?t:10)+1,s=parseInt(e?.rank,10),n=Number.isFinite(s)&&s>0;return{y:n?s:i,label:n?String(s):`+${i}`,url:e?.url?String(e.url):"",date:String(e?.formatted_date2||e?.formatted_date||"")}}function wh(e){const t=e.length>7?Math.round(e.length/7):1;return{responsive:!0,maintainAspectRatio:!1,animation:!1,interaction:{mode:"nearest",intersect:!1},layout:{padding:{top:4,right:8,bottom:0,left:0}},plugins:{legend:{display:!1},tooltip:{callbacks:{title:e=>e[0]?.label||"",label(e){const t=e.dataset.meta?.[e.dataIndex],i=t?.label||e.formattedValue,s=[`${e.dataset.label}: ${i}`];return t?.url&&s.push(t.url),s}}}},elements:{line:{tension:0}},scales:{x:{grid:{display:!1},border:{display:!1},ticks:{color:"#666",font:{size:11},maxRotation:0,callback:(i,s)=>0===s||s===e.length-1||e.length<=7||s%t===0?e[s]:""}},y:{reverse:!0,min:1,grace:0,ticks:{stepSize:2,color:"#aaa",font:{size:11}},grid:{display:!1},border:{display:!1}}}}}function _h(e,t){const i=e?.data&&"object"==typeof e.data?e.data:{};return new URLSearchParams({keyword_province_id:String(i.keyword_province_id||0),domain_id:String(i.domain_id||t.domainId||0),tracking_keyword_id:String(i.id||0),project_domain_id:String(t.projectDomainId||0),screen_type:String(2===parseInt(i.screen_type,10)?2:1),start:t.start||"",end:t.end||"",competitors:"false"}).toString()}function yh(e){if(!e)return"";try{const t=new URL(e),i=t.pathname.replace(/\/+$/,"")||"/";return`${t.protocol}//${t.hostname}${i}`}catch(t){return String(e).replace(/\/+$/,"")}}function xh(e){return String(e?.name||e?.competitor_domain||e?.domain||"").toLowerCase()}function Ch({history:e,projectName:i}){const s=(0,t.useMemo)(()=>function(e,t){const i=function(e){return(t=e,Array.isArray(t)?t:[]).slice().reverse();var t}(e).map(vh),s=i.map(e=>e.date),n=[];return function(e){return e.some(e=>e.y<101)}(i)&&n.push({label:t||"",data:i.map(e=>e.y),meta:i,borderColor:fh,backgroundColor:fh,borderWidth:3,tension:0,pointRadius:3,pointHoverRadius:5,spanGaps:!0}),{labels:s,datasets:n}}(e?.data,i),[e,i]);return s.datasets.length?(0,l.jsx)(Ao,{data:{labels:s.labels,datasets:s.datasets},options:wh(s.labels)}):(0,l.jsx)("p",{className:"slr-kw-stats__empty",children:(0,r.__)("No ranking history for this range.","seo-local-rank")})}function kh({trend:e}){const i=(0,t.useMemo)(()=>function(e){if(!e||"object"!=typeof e)return{labels:[],values:[]};const t=Object.entries(e).reverse();return{labels:t.map(([e])=>e),values:t.map(([,e])=>{const t=parseInt(e,10);return Number.isFinite(t)&&t>0?t:0})}}(e),[e]);return i.labels.length?(0,l.jsx)(zo,{data:{labels:i.labels,datasets:[{data:i.values,backgroundColor:"#4a89dc",borderWidth:0,barPercentage:.9,categoryPercentage:1}]},options:{responsive:!0,maintainAspectRatio:!1,animation:!1,plugins:{legend:{display:!1},tooltip:{callbacks:{title:e=>e[0]?.label||"",label:e=>String(e.parsed.y??"")}}},layout:{padding:0},scales:{x:{grid:{display:!1},border:{display:!1},ticks:{color:"#666",font:{size:10},maxRotation:0,autoSkip:!0,maxTicksLimit:6}},y:{display:!1,min:0}}}}):null}function Eh({rows:e,targetUrl:t,competitors:i,serpUrl:s}){const n=Array.isArray(e)?e:[],o=yh(t),h=(Array.isArray(i)?i:[]).map(xh).filter(Boolean);return(0,l.jsxs)("section",{className:"slr-kw-stats-top10",children:[(0,l.jsxs)("h3",{className:"slr-kw-stats-top10__title",children:[(0,l.jsx)("span",{children:(0,r.__)("Google's top 10 for your keyword indexed URL","seo-local-rank")}),s?(0,l.jsxs)("a",{className:"slr-kw-stats-top10__serp",href:a(s),target:"_blank",rel:"noopener noreferrer",children:[(0,r.__)("(Show SERP)","seo-local-rank"),(0,l.jsx)("span",{className:"dashicons dashicons-external","aria-hidden":"true"})]}):null]}),(0,l.jsx)("div",{className:"slr-kw-stats-top10__panel",children:(0,l.jsxs)("table",{className:"slr-kw-stats-top10__table",children:[(0,l.jsx)("thead",{children:(0,l.jsxs)("tr",{children:[(0,l.jsx)("th",{className:"slr-kw-stats-top10__pos",children:(0,r.__)("Position","seo-local-rank")}),(0,l.jsx)("th",{children:(0,r.__)("URL","seo-local-rank")})]})}),(0,l.jsx)("tbody",{children:0===n.length?(0,l.jsx)("tr",{children:(0,l.jsx)("td",{colSpan:2,children:(0,r.__)("No SERP data.","seo-local-rank")})}):n.map((e,t)=>{const i=e.url||"",s=e.url_encoded||i,n=Boolean(e.my_domain),a=function(e){try{return new URL(e).hostname.toLowerCase()}catch(e){return""}}(i),c=!n&&h.some(e=>a.includes(e)),d=yh(i),u=Boolean(o)&&d===o,p=n&&(!0===e.cannibalization||Array.isArray(e.cannibalization)&&e.cannibalization.length>0||Boolean(o)&&!u);return(0,l.jsxs)("tr",{className:n||c?"slr-kw-stats-top10__row slr-kw-stats-top10__row--strong":"slr-kw-stats-top10__row",children:[(0,l.jsx)("td",{className:"slr-kw-stats-top10__pos",children:e.position}),(0,l.jsxs)("td",{children:[i?(0,l.jsx)("a",{href:i,target:"_blank",rel:"noopener noreferrer",className:n?"slr-kw-stats-top10__link slr-kw-stats-top10__link--mine":"slr-kw-stats-top10__link",children:s}):"—",u?(0,l.jsx)("span",{className:"dashicons dashicons-flag slr-kw-stats-top10__icon slr-kw-stats-top10__icon--target",title:(0,r.__)("Target URL","seo-local-rank")}):null,p&&!u?(0,l.jsx)("span",{className:"dashicons dashicons-warning slr-kw-stats-top10__icon slr-kw-stats-top10__icon--cann",title:(0,r.__)("Cannibalization","seo-local-rank")}):null]})]},`${e.position||t}-${i}`)})})]})})]})}function Rh({stats:e}){if(!1===e)return null;if(!e||"object"!=typeof e)return null;const t=function(e){if(null==e?.competition||""===e?.competition)return null;const t=Number(e.competition);if(Number.isNaN(t))return null;const i=t<=1?100*t:t;return`${Math.round(i)} %`}(e);return(0,l.jsxs)("div",{className:"slr-panel slr-kw-stats-stats",children:[(0,l.jsxs)("div",{className:"slr-kw-stats-stats__metrics",children:[(0,l.jsxs)("div",{className:"slr-kw-stats-stats__metric",children:[(0,l.jsx)("span",{className:"slr-kw-stats-stats__label",children:(0,r.__)("Volume:","seo-local-rank")}),(0,l.jsx)("span",{className:"slr-kw-stats-stats__value",children:Uo(e.volume)})]}),(0,l.jsxs)("div",{className:"slr-kw-stats-stats__metric",children:[(0,l.jsx)("span",{className:"slr-kw-stats-stats__label",children:(0,r.__)("CPC:","seo-local-rank")}),(0,l.jsx)("span",{className:"slr-kw-stats-stats__value",children:e.cpc_formatted||Uo(e.cpc,2)})]}),null!==t?(0,l.jsxs)("div",{className:"slr-kw-stats-stats__metric",children:[(0,l.jsx)("span",{className:"slr-kw-stats-stats__label",children:(0,r.__)("Competition:","seo-local-rank")}),(0,l.jsx)("span",{className:"slr-kw-stats-stats__value",children:t})]}):null]}),(0,l.jsx)("div",{className:"slr-kw-stats-stats__trend-title",children:(0,r.__)("Search trend","seo-local-rank")}),(0,l.jsx)("div",{className:"slr-kw-stats-stats__trend",children:(0,l.jsx)(kh,{trend:e.trend})})]})}function Mh({tags:e}){const t=Array.isArray(e)?e:[];return(0,l.jsxs)("div",{className:"slr-panel slr-kw-stats-tags",children:[(0,l.jsx)("div",{className:"slr-kw-stats-tags__title",children:(0,r.__)("Keyword tags","seo-local-rank")}),0===t.length?(0,l.jsx)("p",{className:"slr-kw-stats__empty",children:(0,r.__)("No tags.","seo-local-rank")}):(0,l.jsx)("div",{className:"slr-rt-tags",children:t.map((e,t)=>(0,l.jsx)("span",{className:"slr-rt-tag",style:{backgroundColor:e.color||"#efefef"},children:e.description||e.tag_description||""},`${e.id||e.description||t}`))})]})}function Th({row:e,projectDomainId:i,domainId:a,projectName:h,start:c,end:d,onClose:u,onPrev:p,onNext:m}){const g=function(e){return e?.data&&"object"==typeof e.data?e.data:{}}(e),b=g.keyword||"",[f,v]=(0,t.useState)(null),[w,_]=(0,t.useState)(!0),[y,x]=(0,t.useState)("");(0,t.useEffect)(()=>{if(!e)return;const t="undefined"!=typeof AbortController?new AbortController:null;let n=!1;return(async()=>{_(!0),x(""),v(null);try{const r=await s()({path:o(`/keywords/history?${_h(e,{projectDomainId:i,domainId:a,start:c,end:d})}`),signal:t?.signal});if(n)return;v(r)}catch(e){if(n||"AbortError"===e?.name)return;v(null),x(e?.message||(0,r.__)("Could not load keyword history. Try again later.","seo-local-rank"))}finally{n||_(!1)}})(),()=>{n=!0,t?.abort()}},[e,i,a,c,d]);const C=Hl(g.region_code),k=g.province||g.google_search_location||g.region_code||"",E=2===parseInt(g.screen_type,10),R=function(e){if(null==e?.rank||""===e?.rank)return(0,r.__)("Pending","seo-local-rank");const t=parseInt(e.rank,10);if(t>0)return String(t);const i=parseInt(e.depth,10);return 10*(Number.isFinite(i)&&i>0?i:10)+"+"}(g),M=parseInt(g.rank,10),T=g.target_url||"";return(0,l.jsx)(n.Modal,{title:(0,r.sprintf)(/* translators: %s: keyword */ /* translators: %s: keyword */
     14(0,r.__)("Keyword: %s","seo-local-rank"),b),onRequestClose:u,className:"slr-kw-stats-modal",children:(0,l.jsxs)("div",{className:"slr-kw-stats",children:[(0,l.jsxs)("h2",{className:"slr-kw-stats__heading",children:[(0,l.jsx)("span",{className:"slr-kw-stats__heading-label",children:(0,r.__)("Keyword:","seo-local-rank")}),(0,l.jsx)("span",{className:"slr-kw-stats__heading-value",children:b})]}),(0,l.jsxs)("div",{className:"slr-kw-stats__top",children:[(0,l.jsxs)("div",{className:"slr-kw-stats__attrs",children:[C||k?(0,l.jsxs)("span",{className:"slr-kw-stats__attr",children:[C?(0,l.jsx)("span",{className:"slr-rt-flag","aria-hidden":"true",children:C}):null,k]}):null,(0,l.jsxs)("span",{className:"slr-kw-stats__attr",children:[(0,l.jsx)("span",{className:"dashicons "+(E?"dashicons-smartphone slr-rt-device--mobile":"dashicons-desktop slr-rt-device--desktop"),"aria-hidden":"true"}),E?(0,r.__)("Mobile","seo-local-rank"):(0,r.__)("Desktop","seo-local-rank")]}),(0,l.jsxs)("span",{className:"slr-kw-stats__attr slr-kw-stats__attr--rank",children:[(0,r.__)("Position","seo-local-rank"),(0,l.jsx)("strong",{children:R}),1===M?(0,l.jsx)("span",{"aria-hidden":"true",children:"👑"}):null]})]}),T?(0,l.jsxs)("div",{className:"slr-kw-stats__target",children:[(0,l.jsx)("span",{className:"dashicons dashicons-flag","aria-hidden":"true"}),(0,l.jsx)("span",{className:"slr-kw-stats__target-label",children:(0,r.__)("Target URL","seo-local-rank")}),(0,l.jsx)("span",{className:"slr-kw-stats__target-url",children:T})]}):null]}),y?(0,l.jsx)(n.Notice,{status:"error",isDismissible:!1,children:y}):null,(0,l.jsxs)("div",{className:"slr-kw-stats__body"+(w?" is-loading":""),children:[(0,l.jsxs)("div",{className:"slr-kw-stats__left",children:[(0,l.jsx)("div",{className:"slr-panel slr-kw-stats-chart",children:(0,l.jsx)("div",{className:"slr-kw-stats-chart__canvas",children:!w&&f?(0,l.jsx)(Ch,{history:f,projectName:h}):null})}),!w&&f?(0,l.jsx)(Eh,{rows:f.top_10,targetUrl:T,competitors:f.competitors,serpUrl:f.serp_url}):null]}),(0,l.jsx)("div",{className:"slr-kw-stats__right",children:!w&&f?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(Rh,{stats:f.search_stats}),(0,l.jsx)(Mh,{tags:f.keyword_tags})]}):null})]}),w?(0,l.jsxs)("div",{className:"slr-kw-stats__loader",children:[(0,l.jsx)(n.Spinner,{}),(0,l.jsx)("p",{children:(0,r.__)("Loading keyword stats…","seo-local-rank")})]}):null,(0,l.jsxs)("div",{className:"slr-kw-stats__footer",children:[(0,l.jsx)(n.Button,{variant:"link",className:"slr-kw-stats__nav",icon:"arrow-left-alt2",onClick:p,children:(0,r.__)("Previous keyword","seo-local-rank")}),(0,l.jsx)(n.Button,{variant:"link",className:"slr-kw-stats__nav",icon:"arrow-right-alt2",iconPosition:"right",onClick:m,children:(0,r.__)("Next keyword","seo-local-rank")})]})]})})}let Sh={};function Dh(e){Sh=e&&"object"==typeof e?e:{}}function jh(){return Sh}function Nh(e){return String(e??"").replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}function Lh(e){const t=e.getRow()?.getData();return t?.data&&"object"==typeof t.data?t.data:{}}function Ph(e,t="",i=""){const s=i?` title="${Nh(i)}"`:"";return`<span class="dashicons dashicons-${Nh(e)} ${t}"${s} aria-hidden="true"></span>`}function Ah(){return!1!==jh().plan_allows_metrics}function zh(e){const t=e?.cannibalization;return!0===t||1===t||"1"===t}function Fh(e){if(!e?.positions||"object"!=typeof e.positions)return null;const t=Object.keys(e.positions);return t.length?(t.sort(),e.positions[t[t.length-1]]):null}function Oh(e){const t=Fh(e);if(t&&parseInt(t.depth,10)>0)return 10*parseInt(t.depth,10);if(t&&t.few)return 10;const i=parseInt(e?.depth,10);if(!Number.isNaN(i)&&i>0)return 10*i;const s=jh().available_depths?.[0],n=parseInt(s,10);return!Number.isNaN(n)&&n>0?10*n:100}function Hh(){return Ph("lock","slr-rt-cell-icon",(0,r.__)("Buy plan","seo-local-rank"))}function Ih(e){return Ph("clock","slr-rt-cell-icon slr-rt-cell-icon--muted",e)}function Bh(e,t){if(null==e||""===e)return'<span class="slr-rt-change slr-rt-change--empty">—</span>';const i=parseInt(e,10);if(Number.isNaN(i))return'<span class="slr-rt-change slr-rt-change--empty">—</span>';if(0===i)return'<span class="slr-rt-change slr-rt-change--zero">•</span>';const s=i>0;return`<span class="slr-rt-change ${t?s?"slr-rt-change--up-text":"slr-rt-change--down-text":s?"slr-rt-change--up":"slr-rt-change--down"}">${s?"▲":"▼"} ${Math.abs(i)}</span>`}function Vh(e){return function(t){const i=Lh(t)[e];return null==i?`<span>${Nh((0,r.__)("Pending","seo-local-rank"))}</span>`:parseInt(i,10)>0?Nh(i):(0,r.__)("101+","seo-local-rank")}}function Wh(e){return function(t){return`<span class="slr-rt-dates">${Bh(Lh(t)[e],!0)}</span>`}}function Gh(e,t,i,s){return function(n){const o=Lh(n);if(!Boolean(jh().gsc_has_consent))return"<span>—</span>";if(null===o.gsc_impressions||void 0===o.gsc_impressions)return Ih((0,r.__)("Waiting for GSC data","seo-local-rank"));if((o.gsc_impressions||0)<=0)return"gsc_impressions"===e||"gsc_clicks"===e?"0":"—";let a=o[t];return null==a&&(a=o[e.replace("gsc_","")]||0),s?`${Uo(100*a,1)} %`:Uo(a,i||0)}}const Uh={keyword(e){const t=Lh(e);let i=`<span class="slr-rt-keyword"><span class="slr-rt-keyword__text">${Nh(t.keyword)}</span>`,s="";return t.url&&(s=String(t.url).replace(/\?.+$/,"")),t.target_url&&t.target_url===s&&!t.paused_at?i+=zh(t)?Ph("warning","slr-rt-keyword__icon slr-rt-keyword__icon--target",(0,r.__)("Ranking target URL and cannibalization","seo-local-rank")):Ph("yes","slr-rt-keyword__icon slr-rt-keyword__icon--target",(0,r.__)("Ranking target URL","seo-local-rank")):(t.target_url&&t.target_url!==s&&s&&!t.paused_at||zh(t)&&!t.paused_at)&&(i+=Ph("warning","slr-rt-keyword__icon",(0,r.__)("Possible cannibalization","seo-local-rank"))),i+="</span>",i},location(e){const t=Lh(e),i=Hl(t.region_code),s=i?`<span class="slr-rt-flag" aria-hidden="true">${i}</span>`:"";return`<span class="slr-rt-location" title="${Nh(t.google_search_location||t.province)}">${s}${Nh(t.province)}</span>`},screen_type(e){const t=Lh(e),i=1===parseInt(t.screen_type,10);return Ph(i?"desktop":"smartphone",i?"slr-rt-device slr-rt-device--desktop":"slr-rt-device slr-rt-device--mobile",i?(0,r.__)("Desktop","seo-local-rank"):(0,r.__)("Mobile","seo-local-rank"))},depth(e){if(!jh().active_keywords_depth)return"";const t=Lh(e);return`<span class="slr-rt-depth">${Nh(void 0!==t.depth&&null!==t.depth?t.depth:"1")}</span>`},position(e){const t=Lh(e);let i='<span class="slr-rt-rank">';if(t.paused_at)return i+=Ph("controls-pause","slr-rt-cell-icon slr-rt-cell-icon--danger",(0,r.__)("Keyword paused","seo-local-rank")),i+="</span>",i;if(void 0!==t.rank&&null!==t.rank){const e=parseInt(t.rank,10),s=Oh(t);if(e>0&&e<=s){if(i+=`<span>${Nh(t.rank)}</span>`,t.positions){const s=Object.keys(t.positions);s.length>0&&!t.not_sync&&1===e?i+=`<span class="slr-rt-rank__crown" title="${Nh((0,r.__)("You are top 1","seo-local-rank"))}">👑</span>`:s.length>6&&!t.not_sync&&e===parseInt(t.best_rank_ever,10)&&(i+=`<span class="slr-rt-rank__medal" title="${Nh((0,r.__)("Best rank ever","seo-local-rank"))}">🏅</span>`);const n=Fh(t);s.length>2&&!t.not_sync&&n&&0===parseInt(n.rank,10)&&(i+=`<span class="slr-rt-rank__new" title="${Nh((0,r.__)("New keyword ranking","seo-local-rank"))}">${Nh((0,r.__)("NEW","seo-local-rank"))}</span>`)}}else{const e=Fh(t);!e||!e.few||e.depth>0?i+=Nh(function(e){const t=Fh(e);return t&&parseInt(t.depth,10)>0?(0,r.sprintf)(/* translators: %s: ranking position threshold */ /* translators: %s: ranking position threshold */
     15(0,r.__)("%s+","seo-local-rank"),10*parseInt(t.depth,10)):t&&t.few?null:(0,r.sprintf)(/* translators: %s: ranking position threshold */ /* translators: %s: ranking position threshold */
     16(0,r.__)("%s+","seo-local-rank"),Oh(e))}(t)||`${s}+`):i+=`${Nh((0,r.__)("11+","seo-local-rank"))} ${Ph("warning","slr-rt-cell-icon slr-rt-cell-icon--warn",(0,r.__)("Few results in search","seo-local-rank"))}`}}else i+=Nh((0,r.__)("Pending","seo-local-rank"));return t.not_sync&&(i+=Ph("update","slr-rt-cell-icon slr-rt-cell-icon--danger",(0,r.__)("Waiting to update","seo-local-rank"))),i+="</span>",i},change:e=>Bh(Lh(e).rank_change,!1),date1_change:Wh("date1_change"),date7_change:Wh("date7_change"),date30_change:Wh("date30_change"),date90_change:Wh("date90_change"),dates_changes(e){const t=Lh(e);return`<span class="slr-rt-dates slr-rt-dates--stack">${[1,7,30].map(e=>Bh(t[`date${e}_change`],!0)).join("")}</span>`},last_change(e){const t=Lh(e),i=t.last_change_display||t.last_change;return i?Nh(i):""},best_rank_ever:Vh("best_rank_ever"),best_rank:Vh("best_rank"),worst_rank:Vh("worst_rank"),rank_avg(e){const t=Lh(e);return void 0===t.rank_avg||null===t.rank_avg?Nh((0,r.__)("Pending","seo-local-rank")):Uo(t.rank_avg,1)},first_rank(e){const t=Lh(e);if(void 0===t.first_rank||null===t.first_rank)return Nh((0,r.__)("Pending","seo-local-rank"));let i=parseInt(t.first_rank,10)>0?Nh(t.first_rank):Nh((0,r.__)("101+","seo-local-rank")),s=parseInt(t.rank,10);(Number.isNaN(s)||0===s)&&(s=101);let n=parseInt(t.first_rank,10);0===n&&(n=101);const o=n-s;return 0!==o&&(i+=` ${Bh(o,!0)}`),i},volume(e){const t=Lh(e);return Ah()?null===t.volume||""===t.volume?Ih((0,r.__)("Waiting for volume","seo-local-rank")):Uo(t.volume):Hh()},cpc(e){const t=Lh(e);return Ah()?null===t.cpc||""===t.cpc?Ih((0,r.__)("Waiting for CPC","seo-local-rank")):function(e,t){const i=Uo(e,2),s={usd:"$",eur:"€",gbp:"£"},n=String(t||"usd").toLowerCase();return s[n]?`${i} ${s[n]}`:`${i} ${n.toUpperCase()}`}(t.cpc,jh().currency):Hh()},competition(e){const t=Lh(e);return Ah()?null===t.volume||""===t.volume?Ih((0,r.__)("Waiting for competition","seo-local-rank")):`${Uo(100*(t.ads_competition||0),0)} %`:Hh()},ve(e){const t=Lh(e);return Ah()?null===t.volume||""===t.volume?Ih((0,r.__)("Waiting for volume","seo-local-rank")):Uo(void 0!==t.estimated_visits?t.estimated_visits:0):Hh()},gsc_impressions:Gh("gsc_impressions","gsc_impressions_display",0,!1),gsc_clicks:Gh("gsc_clicks","gsc_clicks_display",0,!1),gsc_position:Gh("gsc_position","gsc_position_display",1,!1),gsc_ctr:Gh("gsc_ctr","gsc_ctr_display",1,!0),local_pack(e){const t=Lh(e);if(1!==parseInt(t.maps_local_snp,10)||t.paused_at)return"";const i=t.serp_url?Nh(t.serp_url):"",s=void 0!==t.local_position?`<span class="slr-rt-local-pos">${Nh(t.local_position)}</span>`:"";return`<span class="slr-rt-local">${i?`<a class="slr-rt-local-link" href="${i}" target="_blank" rel="noopener noreferrer" title="${Nh((0,r.__)("Local Map","seo-local-rank"))}">${Ph("location-alt")}</a>`:Ph("location-alt")}${s}${!1===jh().last_data?Ph("warning","slr-rt-cell-icon slr-rt-cell-icon--warn",(0,r.__)("Last crawl data","seo-local-rank")):""}</span>`},snippets(e){const t=Lh(e).snippets_in_serp;let i='<span class="slr-rt-snippets">';if(t&&"object"==typeof t){const e={people_also_ask:{icon:"editor-help",label:(0,r.__)("People Also Ask","seo-local-rank")},videos:{icon:"video-alt3",label:(0,r.__)("Videos","seo-local-rank")},images:{icon:"format-image",label:(0,r.__)("Images","seo-local-rank")},local_pack:{icon:"location",label:(0,r.__)("Local Pack","seo-local-rank")},knowledge_panel:{icon:"info",label:(0,r.__)("Knowledge Panel","seo-local-rank")},placed_sites:{icon:"admin-site",label:(0,r.__)("Placed Sites","seo-local-rank")},discussions:{icon:"format-chat",label:(0,r.__)("Forums & Discussions","seo-local-rank")},product_grid:{icon:"cart",label:(0,r.__)("Product Grid","seo-local-rank")}};Object.keys(e).forEach(s=>{if(!Object.prototype.hasOwnProperty.call(t,s))return;const n=t[s];if(function(e){return!1===e||null===e||""===e||0===e||"0"===e||Array.isArray(e)&&0===e.length}(n))return;const o=e[s];if(function(e){return!0===e||1===e||"1"===e}(n))return void(i+=Ph(o.icon,"slr-rt-snippet slr-rt-snippet--muted",(0,r.__)("Snippet exists but does not appear","seo-local-rank")));const a=function(e){return e&&"object"==typeof e?e.domain||e.position||e.brand_word?[e]:Array.isArray(e)?e.filter(e=>e&&"object"==typeof e):Object.keys(e).map(t=>e[t]).filter(e=>e&&"object"==typeof e):[]}(n);if(a.length){const e=function(e,t,i){const s=String(t||"").trim().toLowerCase(),n=String(i||"").trim().toLowerCase();return e.some(e=>!(!s||!e.domain||String(e.domain).trim().toLowerCase()!==s)||Boolean(n&&e.brand_word&&String(e.brand_word).trim().toLowerCase()===n))}(a,jh().domain_name,jh().brand_word),t=e?"slr-rt-snippet slr-rt-snippet--user":"slr-rt-snippet slr-rt-snippet--competitor",s=e?(0,r.__)("Your site appears in this snippet","seo-local-rank"):(0,r.__)("A competitor appears in this snippet","seo-local-rank");i+=Ph(o.icon,t,s)}})}return!1===jh().last_data&&(i+=Ph("warning","slr-rt-cell-icon slr-rt-cell-icon--warn",(0,r.__)("Last crawl data","seo-local-rank"))),i+="</span>",i},url(e){const t=Lh(e);if(!t.url)return"";let i=t.url,s=String(t.url).trim();try{const e=new URL(s,"https://example.com");e.pathname&&(i=decodeURIComponent(e.pathname))}catch(e){i=s}return`<span class="slr-rt-url"><a href="${Nh(s)}" target="_blank" rel="noopener noreferrer" title="${Nh(t.url)}">${Nh(i)}</a></span>`},tags(e){const t=Lh(e).tags||[];return t.length?`<span class="slr-rt-tags">${t.map(e=>`<span class="slr-rt-tag" style="background-color:${e.color?Nh(e.color):"#efefef"}">${Nh(e.description||e.tag_description||"")}</span>`).join("")}</span>`:""},date(e){const t=Lh(e);if(!t.last_search_display&&!t.last_search)return Nh((0,r.__)("Pending","seo-local-rank"));const i=parseInt(t.hours_ago,10);return!Number.isNaN(i)&&i<24?Nh(function(e){return 0===e?(0,r.__)("Now","seo-local-rank"):(0,r.sprintf)(/* translators: %d: number of hours */ /* translators: %d: number of hours */
     17(0,r._n)("%d hour ago","%d hours ago",e,"seo-local-rank"),e)}(i)):Nh(t.last_search_display||t.last_search)},created(e){const t=Lh(e);return t.created_at?Nh(t.created_at):""},ai_overview(e){const t=Lh(e);if(!t.ai||!t.ai.snp)return"";const i=Array.isArray(t.ai.links)?t.ai.links:[],s=Array.isArray(t.ai.bw)?t.ai.bw:[],n=[];i.length&&n.push((0,r.sprintf)(/* translators: %s: comma-separated URLs */ /* translators: %s: comma-separated URLs */
     18(0,r.__)("Project links: %s","seo-local-rank"),i.map(e=>e&&"object"==typeof e?e.url:e).join(", "))),s.length&&n.push((0,r.sprintf)(/* translators: %s: comma-separated brand words */ /* translators: %s: comma-separated brand words */
     19(0,r.__)("Brand words: %s","seo-local-rank"),s.join(", "))),i.length||s.length||n.push((0,r.__)("Project does not appear","seo-local-rank"));let o=`<span class="slr-rt-aio" title="${Nh(n.join(" · "))}">`;return o+=`<span class="slr-rt-aio__presence">${Ph("yes-alt")} ${Nh((0,r.__)("AI Overview","seo-local-rank"))}</span>`,i.length&&(o+=`<span class="slr-rt-aio__links">${Ph("admin-links")} ${i.length}</span>`),s.length&&(o+=`<span class="slr-rt-aio__brand">${Nh((0,r.__)("Brand","seo-local-rank"))}</span>`),o+="</span>",o}};function $h(e){if(null==e||""===e)return 0;let t=String(e).trim();if(!t)return 0;/^\d{4}-\d{2}-\d{2} /.test(t)&&(t=t.replace(" ","T"));const i=Date.parse(t);return Number.isNaN(i)?0:i}function Yh(e){if(null==e||""===e)return null;const t=parseInt(e,10);return Number.isNaN(t)?null:t}function Kh(e,t,i){const s=parseInt(e,10);return Number.isNaN(s)||s<=0?(n=function(e,t){const i=function(e){if(!e?.positions||"object"!=typeof e.positions)return null;const t=Object.keys(e.positions);return t.length?(t.sort(),e.positions[t[t.length-1]]):null}(e);if(i&&parseInt(i.depth,10)>0)return parseInt(i.depth,10);const s=parseInt(e?.depth,10);if(!Number.isNaN(s)&&s>0)return s;const n=t?.available_depths;if(Array.isArray(n)&&n.length){const e=parseInt(n[0],10);if(!Number.isNaN(e)&&e>0)return e}return 10}(t,i),10*Math.max(1,n)+1):s;var n}function Xh(e,t,i){return null==e||""===e?null:Kh(e,t,i)}function qh(e){const t=e?.data&&"object"==typeof e.data&&!Array.isArray(e.data)?e.data:e;return!t||"object"!=typeof t||void 0!==t.pending&&null!==t.pending&&""!==t.pending&&0!==parseInt(t.pending,10)}function Jh(e){return function(t,i,s,n){const o=s?.getData?s.getData()[e]:t,a=n?.getData?n.getData()[e]:i;return("number"!=typeof o||Number.isNaN(o)?0:o)-("number"!=typeof a||Number.isNaN(a)?0:a)}}function Zh(e){return function(t,i,s,n){const o=s?.getData?s.getData()[e]:t,a=n?.getData?n.getData()[e]:i,r=null==o?"":String(o),l=null==a?"":String(a);return r.localeCompare(l,void 0,{sensitivity:"base"})}}function Qh(e,t){const i=(s=e.field,Uh[s]||null);var s;i&&(e.formatter=i),"keyword"!==e.field?(void 0===e.widthGrow&&(e.widthGrow=0),void 0===e.width&&(e.width=90),void 0===e.minWidth&&(e.minWidth=e.width)):void 0===e.minWidth&&(e.minWidth=300);const n=e.cssClass&&String(e.cssClass).includes("text-center");return void 0===e.hozAlign&&(e.hozAlign=n?"center":"left"),void 0===e.headerHozAlign&&(e.headerHozAlign=n?"center":"left"),e.visible=function(e,t){return!t.includes(e)}(e.field,t),e.headerSort=!1!==e.headerSort,e.resizable=!1!==e.resizable,e.headerTooltip=!1,e}function ec(e,t){const i=Array.isArray(e)?e:[],s=Boolean(t?.active_keywords_depth),n=[];return n.push(Qh({field:"keyword",title:(0,r.__)("Keyword","seo-local-rank"),minWidth:300,widthGrow:6,cssClass:"slr-rt-col--keyword",sorter:Zh("_sort_keyword")},i)),n.push(Qh({field:"location",title:(0,r.__)("Location","seo-local-rank"),width:120,minWidth:100,cssClass:"text-left",sorter:Zh("_sort_location")},i)),n.push(Qh({field:"screen_type",title:(0,r.__)("Device","seo-local-rank"),width:70,cssClass:"text-center",headerSort:!1},i)),s&&n.push(Qh({field:"depth",title:(0,r.__)("Depth","seo-local-rank"),width:110,cssClass:"text-center",sorter:Jh("_sort_depth")},i)),n.push(Qh({field:"position",title:(0,r.__)("Position","seo-local-rank"),width:100,cssClass:"text-center",sorter:Jh("_sort_position")},i)),n.push(Qh({field:"change",title:(0,r.__)("Change","seo-local-rank"),width:90,cssClass:"text-center",sorter:Jh("_sort_change")},i)),n.push(Qh({field:"ai_overview",title:(0,r.__)("AI Overview","seo-local-rank"),width:140,cssClass:"text-center",headerSort:!1},i)),n.push(Qh({field:"date1_change",title:(0,r.__)("Last interval change","seo-local-rank"),width:150,cssClass:"text-center",sorter:Jh("_sort_date1_change")},i)),n.push(Qh({field:"dates_changes",title:(0,r.__)("1/7/30","seo-local-rank"),width:90,cssClass:"text-center",headerSort:!1},i)),n.push(Qh({field:"date7_change",title:(0,r.__)("7 days","seo-local-rank"),width:130,cssClass:"text-center",sorter:Jh("_sort_date7_change")},i)),n.push(Qh({field:"date30_change",title:(0,r.__)("30 days","seo-local-rank"),width:140,cssClass:"text-center",sorter:Jh("_sort_date30_change")},i)),n.push(Qh({field:"date90_change",title:(0,r.__)("90 days","seo-local-rank"),width:140,cssClass:"text-center",sorter:Jh("_sort_date90_change")},i)),n.push(Qh({field:"last_change",title:(0,r.__)("Last change","seo-local-rank"),width:130,cssClass:"text-center",sorter:Jh("_sort_last_change")},i)),n.push(Qh({field:"best_rank_ever",title:(0,r.__)("Best ever","seo-local-rank"),width:145,cssClass:"text-center",sorter:Jh("_sort_best_rank_ever")},i)),n.push(Qh({field:"rank_avg",title:(0,r.__)("Avg position","seo-local-rank"),width:130,cssClass:"text-center",sorter:Jh("_sort_rank_avg")},i)),n.push(Qh({field:"best_rank",title:(0,r.__)("Best","seo-local-rank"),width:80,cssClass:"text-center",sorter:Jh("_sort_best_rank")},i)),n.push(Qh({field:"worst_rank",title:(0,r.__)("Worst","seo-local-rank"),width:80,cssClass:"text-center",sorter:Jh("_sort_worst_rank")},i)),n.push(Qh({field:"first_rank",title:(0,r.__)("Starting","seo-local-rank"),width:90,cssClass:"text-center",sorter:Jh("_sort_first_rank")},i)),n.push(Qh({field:"volume",title:(0,r.__)("Volume","seo-local-rank"),width:95,cssClass:"text-center",sorter:Jh("_sort_volume")},i)),n.push(Qh({field:"cpc",title:(0,r.__)("CPC","seo-local-rank"),width:75,cssClass:"text-center",sorter:Jh("_sort_cpc")},i)),n.push(Qh({field:"competition",title:(0,r.__)("Competition","seo-local-rank"),width:115,cssClass:"text-center",sorter:Jh("_sort_competition")},i)),n.push(Qh({field:"ve",title:(0,r.__)("Traffic","seo-local-rank"),width:90,cssClass:"text-center",sorter:Jh("_sort_ve")},i)),n.push(Qh({field:"gsc_impressions",title:(0,r.__)("Impressions","seo-local-rank"),width:115,cssClass:"text-center",sorter:Jh("_sort_gsc_impressions")},i)),n.push(Qh({field:"gsc_clicks",title:(0,r.__)("Clicks","seo-local-rank"),width:80,cssClass:"text-center",sorter:Jh("_sort_gsc_clicks")},i)),n.push(Qh({field:"gsc_position",title:(0,r.__)("GSC Position","seo-local-rank"),width:165,cssClass:"text-center",sorter:Jh("_sort_gsc_position")},i)),n.push(Qh({field:"gsc_ctr",title:(0,r.__)("CTR","seo-local-rank"),width:70,cssClass:"text-center",sorter:Jh("_sort_gsc_ctr")},i)),n.push(Qh({field:"local_pack",title:(0,r.__)("Local Pack","seo-local-rank"),width:110,cssClass:"text-center",sorter:Jh("_sort_local_pack")},i)),n.push(Qh({field:"snippets",title:(0,r.__)("Snippets","seo-local-rank"),width:100,cssClass:"text-center",headerSort:!1},i)),n.push(Qh({field:"url",title:(0,r.__)("URL","seo-local-rank"),width:180,minWidth:120,cssClass:"text-left",sorter:Zh("_sort_url")},i)),n.push(Qh({field:"tags",title:(0,r.__)("Tags","seo-local-rank"),width:140,minWidth:100,cssClass:"text-left",sorter:Zh("_sort_tags")},i)),n.push(Qh({field:"date",title:(0,r.__)("Updated at","seo-local-rank"),width:115,cssClass:"text-center",sorter:Jh("_sort_updated")},i)),n.push(Qh({field:"created",title:(0,r.__)("Created at","seo-local-rank"),width:95,cssClass:"text-center",sorter:Jh("_sort_created")},i)),n}function tc(e,t){if(!e)return;const i=String(t||"").trim().toLowerCase();try{i?e.setFilter(e=>String(e._search_blob||"").includes(i)):e.clearFilter(!0)}catch(e){}}function ic(e,t,i,s){if(!e)return;const n=(0,r.__)("Loading…","seo-local-rank"),o=(0,r.__)("Add keywords to see rank data.","seo-local-rank");Dh(t?.tableContext||{}),e.options.placeholder=i?n:o;const a=i?[]:function(e,t={}){return Array.isArray(e)?e.map(e=>function(e,t={}){const i=function(e){return e&&"object"==typeof e?e.data&&"object"==typeof e.data&&!Array.isArray(e.data)?e.data:e:null}(e);if(!i)return null;const s={data:i,DT_RowId:null!=e?.DT_RowId?e.DT_RowId:i.id};s._sort_position=function(e){if(!e?.paused_at&&(null==e?.rank||""===e?.rank))return-2;if(e?.paused_at)return-1;let t=parseInt(e.rank,10);return(Number.isNaN(t)||0===t)&&(t=101),t}(i),s._sort_change=parseInt(i.rank_change,10),Number.isNaN(s._sort_change)&&(s._sort_change=0),s._sort_volume=parseInt(i.volume,10)||0,null!==i.cpc&&void 0!==i.cpc&&""!==i.cpc?(s._sort_cpc=parseFloat(String(i.cpc).replace(",",".")),Number.isNaN(s._sort_cpc)&&(s._sort_cpc=null)):s._sort_cpc=null,null!==i.ads_competition&&void 0!==i.ads_competition&&""!==i.ads_competition?(s._sort_competition=Math.round(100*parseFloat(i.ads_competition)),Number.isNaN(s._sort_competition)&&(s._sort_competition=null)):s._sort_competition=null;const n=void 0!==i.estimated_visits&&null!==i.estimated_visits?i.estimated_visits:i.traffic;if(s._sort_ve=parseInt(n,10)||0,s._sort_first_rank=Xh(i.first_rank,i,t),s._sort_rank_avg=null!==i.rank_avg&&void 0!==i.rank_avg&&""!==i.rank_avg?parseFloat(i.rank_avg):null,null!==s._sort_rank_avg&&Number.isNaN(s._sort_rank_avg)&&(s._sort_rank_avg=null),s._sort_best_rank=Xh(i.best_rank,i,t),s._sort_worst_rank=Xh(i.worst_rank,i,t),s._sort_best_rank_ever=Xh(i.best_rank_ever,i,t),s._sort_date1_change=Yh(i.date1_change),s._sort_date7_change=Yh(i.date7_change),s._sort_date30_change=Yh(i.date30_change),s._sort_date90_change=Yh(i.date90_change),s._sort_last_change=$h(i.full_last_change||i.last_change),s._sort_keyword=i.keyword?String(i.keyword).toLowerCase():"",s._sort_location=i.province?String(i.province).toLowerCase():"",s._sort_depth=parseInt(i.depth,10),Number.isNaN(s._sort_depth)&&(s._sort_depth=1),1!==parseInt(i.maps_local_snp,10)||i.paused_at)s._sort_local_pack=999;else{const e=parseInt(i.local_position,10);s._sort_local_pack=Number.isNaN(e)?8:e}var o;s._sort_url=function(e){if(!e)return"";try{const t=new URL(e,"https://example.com");if(t.pathname)return decodeURIComponent(t.pathname)}catch(t){return String(e)}return String(e)}(i.url).toLowerCase(),s._sort_tags=(o=i.tags,Array.isArray(o)&&o.length?o.map(e=>String(e?.description||e?.tag_description||"")).filter(Boolean).join(" "):"").toLowerCase(),s._sort_updated=$h(i.updated_at),s._sort_created=$h(i.created_at),s._sort_gsc_impressions=parseInt(i.gsc_impressions,10)||0,s._sort_gsc_clicks=parseInt(i.gsc_clicks,10)||0,s._sort_gsc_position=parseFloat(i.gsc_position),Number.isNaN(s._sort_gsc_position)&&(s._sort_gsc_position=0),s._sort_gsc_impressions>0&&s._sort_gsc_clicks>=0?s._sort_gsc_ctr=s._sort_gsc_clicks/s._sort_gsc_impressions*100:null!==i.gsc_ctr&&void 0!==i.gsc_ctr&&""!==i.gsc_ctr?(s._sort_gsc_ctr=parseFloat(i.gsc_ctr),Number.isNaN(s._sort_gsc_ctr)&&(s._sort_gsc_ctr=0)):s._sort_gsc_ctr=0;const a=function(e){return Array.isArray(e?.tags)&&e.tags.length?e.tags.map(e=>String(e?.description||e?.tag_description||"")).filter(Boolean).sort():[]}(i);return s._search_blob=[i.keyword,i.province,i.url,a.join(" ")].join(" ").toLowerCase(),s._rt_row_key=String(null!=s.DT_RowId?s.DT_RowId:i.id),s}(e,t)).filter(Boolean):[]}(t?.keywords||[],t?.tableContext||{});Promise.resolve(e.replaceData(a)).then(()=>tc(e,s)).catch(()=>{})}function sc(e){return!(!e||"function"!=typeof e.closest)&&Boolean(e.closest("a, button, select, input, textarea, .slr-rt-tags"))}function nc(e,t){const i=e.getElement(),s=e.getData(),n=qh(s);i.classList.toggle("slr-rt-row--clickable",!n),i.classList.toggle("slr-rt-row--active",String(s._rt_row_key)===String(t||""))}function oc({dataset:e,loading:i,selectedRowKey:s,onKeywordSelect:n,tableApiRef:o}){const a=(0,t.useRef)(null),h=(0,t.useRef)(null),c=(0,t.useRef)(null),d=(0,t.useRef)(!1),u=(0,t.useRef)(0),p=(0,t.useRef)(e),m=(0,t.useRef)(i),g=(0,t.useRef)(""),b=(0,t.useRef)(s),f=(0,t.useRef)(n),[v,w]=(0,t.useState)("");p.current=e,m.current=i,g.current=v,b.current=s,f.current=n;const _=e?.hiddenColumns,y=e?.tableContext||null,x=(0,t.useMemo)(()=>JSON.stringify({hidden:Array.isArray(_)?_:[],depth:Boolean(y?.active_keywords_depth)}),[_,y?.active_keywords_depth]);return(0,t.useEffect)(()=>{if(!h.current)return;Dh(y||{}),d.current=!1;const e=new Ol(h.current,{layout:"fitColumns",autoResize:!1,movableColumns:!1,reactiveData:!1,index:"_rt_row_key",rowHeight:55,height:"420px",renderVertical:"virtual",columnHeaderVertAlign:"middle",headerSort:!0,data:[],columns:ec(_,y),pagination:!0,paginationSize:100,paginationSizeSelector:[50,100,500,1e3,2e3],paginationCounter:(e,t,i,s)=>s?`${t}–${Math.min(t+e-1,s)} / ${s}`:"0",initialSort:[{column:"position",dir:"asc"}],placeholder:(0,r.__)("Loading…","seo-local-rank"),locale:!0,langs:{default:{pagination:{first:(0,r.__)("First","seo-local-rank"),first_title:(0,r.__)("First","seo-local-rank"),last:(0,r.__)("Last","seo-local-rank"),last_title:(0,r.__)("Last","seo-local-rank"),prev:(0,r.__)("Prev","seo-local-rank"),prev_title:(0,r.__)("Prev","seo-local-rank"),next:(0,r.__)("Next","seo-local-rank"),next_title:(0,r.__)("Next","seo-local-rank"),page_size:(0,r.__)("Show","seo-local-rank"),counter:{showing:"",of:"/",rows:"",pages:""}}}},columnDefaults:{headerTooltip:!1,tooltip:!1,vertAlign:"middle",resizable:!0},rowFormatter(e){nc(e,b.current)}});c.current=e;const t=()=>{d.current=!0,ic(e,p.current,m.current,g.current)},i=(e,t)=>{const i=function(e,t){if(t&&sc(t.target))return!1;if(!e||"function"!=typeof e.getData)return!1;const i=e.getData();return!qh(i)&&i}(t&&"function"==typeof t.getRow?t.getRow():t,e);if(!i)return;const s=Date.now();s-u.current<250||(u.current=s,f.current?.(i))},s=e=>{if(!c.current||sc(e.target))return;const t=e.target?.closest?.(".tabulator-row");if(t)try{i(e,c.current.getRow(t))}catch(e){}},n=a.current;return e.on("tableBuilt",t),e.on("rowClick",i),n?.addEventListener("click",s),o&&(o.current={getActiveRows(){if(!c.current||!d.current)return[];try{return c.current.getRows("active").map(e=>e.getData())}catch(e){return[]}}}),()=>{d.current=!1,e.off("tableBuilt",t),e.off("rowClick",i),n?.removeEventListener("click",s),e.destroy(),c.current=null,o&&(o.current=null)}},[x,o]),(0,t.useEffect)(()=>{d.current&&ic(c.current,e,i,g.current)},[e,i,x]),(0,t.useEffect)(()=>{d.current&&function(e,t){if(e)try{e.getRows().forEach(e=>nc(e,t))}catch(e){}}(c.current,s)},[s]),(0,t.useEffect)(()=>{const e=window.setTimeout(()=>{tc(c.current,v)},180);return()=>{window.clearTimeout(e)}},[v]),(0,l.jsxs)("div",{className:"slr-panel slr-rt-table-panel",children:[(0,l.jsxs)("div",{className:"slr-rt-table-toolbar",children:[(0,l.jsx)("div",{className:"slr-rt-table-toolbar__left"}),(0,l.jsx)("input",{type:"search",className:"slr-rt-table-toolbar__search",placeholder:(0,r.__)("Search keyword, URL, location…","seo-local-rank"),autoComplete:"off",value:v,onChange:e=>w(e.target.value)})]}),(0,l.jsx)("div",{className:"slr-rt-table",ref:a,children:(0,l.jsx)("div",{ref:h})})]})}function ac(){return(0,l.jsxs)("div",{className:"slr-rank-tracker slr-rank-tracker--loading","aria-busy":"true","aria-label":(0,r.__)("Loading rank tracker","seo-local-rank"),children:[(0,l.jsxs)("div",{className:"slr-toolbar slr-toolbar--skeleton",children:[(0,l.jsx)("div",{className:"slr-skeleton slr-skeleton--selector"}),(0,l.jsx)("div",{className:"slr-skeleton slr-skeleton--upgrade"})]}),(0,l.jsxs)("div",{className:"slr-rank-tracker__body",children:[(0,l.jsx)("div",{className:"slr-panel slr-rt-filters slr-dash-panel--skeleton",children:(0,l.jsx)("div",{className:"slr-rt-filters__row",children:(0,l.jsx)("div",{className:"slr-skeleton slr-skeleton--daterange"})})}),(0,l.jsxs)("div",{className:"slr-rt-summary",children:[(0,l.jsxs)("div",{className:"slr-panel slr-rt-summary__card slr-rt-summary__avg slr-dash-panel--skeleton",children:[(0,l.jsx)("div",{className:"slr-skeleton slr-skeleton--line slr-skeleton--sm"}),(0,l.jsx)("div",{className:"slr-skeleton slr-skeleton--line slr-skeleton--lg"}),(0,l.jsx)("div",{className:"slr-skeleton slr-skeleton--chart slr-skeleton--chart-sm"})]}),(0,l.jsxs)("div",{className:"slr-panel slr-rt-summary__card slr-rt-summary__distribution slr-dash-panel--skeleton",children:[(0,l.jsx)("div",{className:"slr-skeleton slr-skeleton--line slr-skeleton--sm"}),(0,l.jsxs)("div",{className:"slr-rt-summary__distribution-body",children:[(0,l.jsx)("div",{className:"slr-skeleton slr-skeleton--donut"}),(0,l.jsx)("div",{className:"slr-rt-summary__rows",children:[1,2,3,4].map(e=>(0,l.jsx)("div",{className:"slr-skeleton slr-skeleton--line slr-skeleton--md"},e))})]})]}),(0,l.jsxs)("div",{className:"slr-panel slr-rt-summary__card slr-rt-summary__aio slr-dash-panel--skeleton",children:[(0,l.jsx)("div",{className:"slr-skeleton slr-skeleton--line slr-skeleton--sm"}),(0,l.jsx)("div",{className:"slr-skeleton slr-skeleton--line slr-skeleton--lg"}),(0,l.jsx)("div",{className:"slr-skeleton slr-skeleton--bar"}),(0,l.jsx)("div",{className:"slr-skeleton slr-skeleton--line slr-skeleton--sm"}),(0,l.jsx)("div",{className:"slr-skeleton slr-skeleton--line slr-skeleton--sm"})]})]}),(0,l.jsx)("div",{className:"slr-skeleton slr-skeleton--button"}),(0,l.jsxs)("div",{className:"slr-panel slr-rt-table-panel slr-dash-panel--skeleton",children:[(0,l.jsxs)("div",{className:"slr-rt-table-toolbar",children:[(0,l.jsx)("div",{className:"slr-skeleton slr-skeleton--search"}),(0,l.jsx)("div",{className:"slr-skeleton slr-skeleton--select"})]}),(0,l.jsx)("div",{className:"slr-skeleton slr-skeleton--chart"})]})]})]})}const rc=["top_3","top_10","top_20","top_101"];function lc(e){return 10*Math.max(1,e)}function hc(e,t){const i=lc(Math.max(1,parseInt(t,10)||10)),s=parseInt(e,10);return Number.isNaN(s)?"top_101":s>=1&&s<=3?"top_3":s>=4&&s<=10?"top_10":s>=11&&s<=i?"top_20":"top_101"}function cc(e){if("number"==typeof e)return{rank:e>0?e:101,depth:10};if(!e||"object"!=typeof e)return{rank:101,depth:10};const t=e.depth??10,i=Number(e.rank);return i>0?{rank:i,depth:t}:{rank:10*t+1,depth:t}}function dc(e,t){if(t?.new_project_with_gsc_data){const e=Kl(String(t?.max_date?.date||"").slice(0,10));if(e)return e}return Kl(e)}function uc(e,t,i){let s=Jl(e,1);if(!t||"object"!=typeof t)return s;for(;s<=i&&!t[Xl(s)];)s=Jl(s,1);return s}function pc(e,t,i,s){const n=t?.[s];if(!n||!e[s])return;const{rank:o,depth:a}=cc(n),r=t?.[i];if(r){const t=cc(r);return void rc.forEach(i=>{const n=hc(o,a)===i,r=hc(t.rank,t.depth)===i;n&&!r&&(e[s][i].new+=1),r&&!n&&(e[s][i].lost+=1)})}const l=hc(o,a);e[s][l].new+=1}function mc(e,t,i){return e<t||e===t&&i>=95}function gc(e,t,i,s,n){const o=Kl(t),a=Kl(i),r=[],l=[];if(!o||!a)return{labels:r,values:l};for(let t=o;t<=a;t=Jl(t,1)){const o=Xl(t);mc(o,i,s)&&e[o]&&(r.push(o),l.push(n(e[o])))}return{labels:r,values:l}}function bc(e){return Number.isNaN(e)?0:Math.abs(Math.round(10*(e+Number.EPSILON))/10)}function fc(e,t){const i=Array.isArray(e?.keywords)?e.keywords:[];if(0===i.length)return{empty:!0};const s=function(e,t={}){const i={},s=Array.isArray(e?.keywords)?e.keywords:[],n=t.createdYmd||"",o=Boolean(t.newProjectWithGsc),a=dc(e?.start,{new_project_with_gsc_data:o,max_date:{date:n}}),r=dc(e?.startGrouped||e?.start,{new_project_with_gsc_data:o,max_date:{date:n}}),l=Kl(e?.end);return s.forEach(e=>{const t=function(e){return e?.data&&"object"==typeof e.data?e.data:e}(e),s=t?.positions;if(!s||"object"!=typeof s)return;if(Object.keys(s).forEach(e=>{if(!Kl(e))return;const t=s[e],a=function(e,t){return e[t]||(e[t]={sum_rank:0,total_keywords:0,avg:0,top_3:{num_keywords:0,new:0,lost:0},top_10:{num_keywords:0,new:0,lost:0},top_20:{num_keywords:0,new:0,lost:0},top_101:{num_keywords:0,new:0,lost:0},aio_num_keywords:0,aio_mentions:0,aio_citations:0}),e[t]}(i,e);if("number"==typeof t||t&&"object"==typeof t&&void 0!==t.rank){const{rank:i,depth:s}=cc(t);a.sum_rank+=i,a.total_keywords+=1,(!o||n&&e>=n)&&(a[hc(i,s)].num_keywords+=1)}const r=t&&"object"==typeof t?t.ai:null;r&&!0===r.snp&&(a.aio_num_keywords+=1,Array.isArray(r.bw)&&r.bw.length>0&&(a.aio_mentions+=r.bw.length),Array.isArray(r.links)&&r.links.length>0&&(a.aio_citations+=r.links.length))}),!a||!l||!r)return;const h=Xl(r);let c=Jl(a,1),d=a;for(;c<=l;){const e=Xl(d),t=Xl(c);s[e]&&s[t]&&pc(i,s,h,t),d=c,c=uc(c,s,l)}}),Object.keys(i).forEach(e=>{const t=i[e];t.avg=t.total_keywords>0?Math.round(10*(t.sum_rank/t.total_keywords+Number.EPSILON))/10:0}),i}(e,{newProjectWithGsc:Boolean(t?.new_project_with_gsc_data),createdYmd:Xl(Kl(String(t?.max_date?.date||"").slice(0,10)))});if(0===Object.keys(s).length)return{empty:!0};const n=function(e,t,i){const s=dc(t?.start,i),n=Kl(t?.end);if(!s||!n)return null;let o=function(e,t,i){let s=t;for(;s<=i;){if(e[Xl(s)])return s;s=Jl(s,1)}return null}(e,s,n);if(!o)return null;let a=n;const r=Number(t?.updatedPercent)||0,l=Math.max(1,Number(t?.groupDataInterval)||1);return r<95&&Xl(a)===Xl(n)&&a>o&&(a=Jl(a,-l)),a=function(e,t,i){let s=t;for(;s>=i;){if(e[Xl(s)])return s;s=Jl(s,-1)}return null}(e,a,o)||o,{startYmd:Xl(o),endYmd:Xl(a),pickerEndYmd:Xl(n),updatedPercent:r}}(s,e,t);if(!n||!s[n.startYmd]||!s[n.endYmd])return{empty:!0};const o=s[n.startYmd],a=s[n.endYmd],l=function(e){const t=e?.tableContext||{},i=Number(t.pd_depth_for_distribution);if(i>0)return i;const s=Number(t.pd_depth_at_end);return s>0?s:1}(e),h=function(e){const t=lc(Math.max(1,Number(e)||1)),i=[{key:"top_3",label:(0,r.__)("TOP 1-3","seo-local-rank"),color:"#EDC92F"},{key:"top_10",label:(0,r.__)("TOP 4-10","seo-local-rank"),color:"#69B5EB"}];return t>10&&i.push({key:"top_20",label:(0,r.sprintf)(/* translators: %s: ranking position threshold */ /* translators: %s: ranking position threshold */
     20(0,r.__)("TOP 11-%s","seo-local-rank"),t),color:"#3A8AD5"}),i.push({key:"top_101",label:(0,r.sprintf)(/* translators: %s: ranking position threshold */ /* translators: %s: ranking position threshold */
     21(0,r.__)("TOP %s+","seo-local-rank"),t),color:"#CCCCCC"}),i}(l),c=gc(s,n.startYmd,n.pickerEndYmd,n.updatedPercent,e=>e.avg),d=c.values.filter(e=>"number"==typeof e);let u=d.length?Math.min(...d):1,p=d.length?Math.max(...d):10;const m=l,g=Math.min(5,m);if(p-u<g){const e=g-(p-u);p+=e/2,u-=e/2}const b=(a.avg||0)-(o.avg||0),f=i.length,v=(a.aio_num_keywords||0)-(o.aio_num_keywords||0),w=(a.aio_mentions||0)-(o.aio_mentions||0),_=(a.aio_citations||0)-(o.aio_citations||0);return{empty:!1,avg:{value:a.avg,change:bc(b),improved:b<0,labels:c.labels,values:c.values,min:u,max:p},distribution:{buckets:h.map(e=>{const t=a[e.key]||{num_keywords:0,new:0,lost:0},i=gc(s,n.startYmd,n.pickerEndYmd,n.updatedPercent,t=>t[e.key]?.num_keywords||0);return{key:e.key,label:e.label,color:e.color,total:t.num_keywords,newCount:t.new,lostCount:t.lost,percent:f>0?100*t.num_keywords/f:0,sparkLabels:i.labels,sparkValues:i.values}}),totalKeywords:f},aio:{value:a.aio_num_keywords||0,change:bc(v),improved:v>0,total:f,percent:f>0?(a.aio_num_keywords||0)/f*100:0,mentions:a.aio_mentions||0,mentionsChange:bc(w),mentionsImproved:w>0,citations:a.aio_citations||0,citationsChange:bc(_),citationsImproved:_>0}}}function vc({count:e,total:t,change:i,improved:s,template:n}){return(0,l.jsxs)("div",{className:"slr-rt-aio-stat",children:[(0,l.jsx)("span",{children:(0,r.sprintf)(n,Uo(e),Uo(t))}),(0,l.jsx)(qo,{value:i,positive:s,variant:"solid"})]})}function wc({aio:e}){return(0,l.jsxs)("div",{className:"slr-panel slr-rt-summary__card slr-rt-summary__aio",children:[(0,l.jsx)("h3",{className:"slr-rt-summary__title",children:(0,r.__)("AI Overview Presence","seo-local-rank")}),(0,l.jsxs)("div",{className:"slr-rt-summary__value-row",children:[(0,l.jsx)("span",{className:"slr-rt-summary__value",children:Uo(e.value)}),(0,l.jsx)(qo,{value:e.change,positive:e.improved,variant:"solid"})]}),(0,l.jsx)("p",{className:"slr-rt-aio-meta",children:(0,r.sprintf)(/* translators: 1: number of keywords with AI Overview, 2: total keywords */ /* translators: 1: number of keywords with AI Overview, 2: total keywords */
     22(0,r.__)("%1$s of %2$s keywords","seo-local-rank"),Uo(e.value),Uo(e.total))}),(0,l.jsx)("div",{className:"slr-rt-aio-progress",role:"presentation",children:(0,l.jsx)("div",{className:"slr-rt-aio-progress__bar",style:{width:`${Math.min(100,Math.max(0,e.percent))}%`}})}),(0,l.jsx)(vc,{count:e.mentions,total:e.total,template:/* translators: 1: mention count, 2: total keywords */ /* translators: 1: mention count, 2: total keywords */
     23(0,r.__)("%1$s mentions of %2$s keywords","seo-local-rank"),change:e.mentionsChange,improved:e.mentionsImproved}),(0,l.jsx)(vc,{count:e.citations,total:e.total,template:/* translators: 1: citation count, 2: total keywords */ /* translators: 1: citation count, 2: total keywords */
     24(0,r.__)("%1$s citations of %2$s keywords","seo-local-rank"),change:e.citationsChange,improved:e.citationsImproved})]})}function _c({avg:e}){const t={labels:e.labels,datasets:[{data:e.values,borderColor:"#EF7A35",backgroundColor:"transparent",spanGaps:!0}]};return(0,l.jsxs)("div",{className:"slr-panel slr-rt-summary__card slr-rt-summary__avg",children:[(0,l.jsx)("h3",{className:"slr-rt-summary__title",children:(0,r.__)("AVG position","seo-local-rank")}),(0,l.jsxs)("div",{className:"slr-rt-summary__value-row",children:[(0,l.jsx)("span",{className:"slr-rt-summary__value",children:Uo(e.value,1)}),(0,l.jsx)(qo,{value:e.change,positive:e.improved,variant:"solid"})]}),(0,l.jsx)("div",{className:"slr-rt-avg-chart",children:(0,l.jsx)(Ao,{data:t,options:(i=e.min,s=e.max,{responsive:!0,maintainAspectRatio:!1,animation:!1,plugins:{legend:{display:!1},tooltip:{callbacks:{title:e=>e[0]?Yo(e[0].label):""}}},elements:{point:{radius:0,hoverRadius:4},line:{tension:.3,borderWidth:2}},scales:{x:{display:!1},y:{display:!1,reverse:!0,min:i,max:s}}})})})]});var i,s}const yc={responsive:!0,maintainAspectRatio:!1,animation:!1,plugins:{legend:{display:!1},tooltip:{callbacks:{title:e=>e[0]?Yo(e[0].label):""}}},elements:{point:{radius:0,hoverRadius:3},line:{tension:.3,borderWidth:1.5}},scales:{x:{display:!1},y:{display:!1}}},xc={responsive:!0,maintainAspectRatio:!1,animation:!1,cutout:"50%",plugins:{legend:{display:!1},tooltip:{callbacks:{label:e=>`${e.label}: ${Number(e.parsed).toFixed(1)}%`}}}};function Cc({labels:e,values:t,color:i}){return(0,l.jsx)("div",{className:"slr-rt-spark",children:(0,l.jsx)(Ao,{data:{labels:e,datasets:[{data:t,borderColor:i,backgroundColor:"transparent",spanGaps:!0}]},options:yc})})}function kc({bucket:e}){return(0,l.jsxs)("div",{className:"slr-rt-dist-row",children:[(0,l.jsxs)("span",{className:"slr-rt-dist-row__label",children:[(0,l.jsx)("span",{className:"slr-rt-dist-row__dot",style:{background:e.color},"aria-hidden":"true"}),e.label]}),(0,l.jsx)("span",{className:"slr-rt-dist-row__num",children:Uo(e.total)}),(0,l.jsx)("span",{className:"slr-rt-dist-row__new",children:e.newCount>0?Uo(e.newCount):""}),(0,l.jsx)("span",{className:"slr-rt-dist-row__lost",children:e.lostCount>0?Uo(e.lostCount):""}),(0,l.jsx)(Cc,{labels:e.sparkLabels,values:e.sparkValues,color:e.color})]})}function Ec({distribution:e}){const t={labels:e.buckets.map(e=>e.label),datasets:[{data:e.buckets.map(e=>e.percent),backgroundColor:e.buckets.map(e=>e.color),borderWidth:0}]};return(0,l.jsxs)("div",{className:"slr-panel slr-rt-summary__card slr-rt-summary__distribution",children:[(0,l.jsx)("h3",{className:"slr-rt-summary__title",children:(0,r.__)("Keywords distribution","seo-local-rank")}),(0,l.jsxs)("div",{className:"slr-rt-summary__distribution-body",children:[(0,l.jsx)("div",{className:"slr-rt-donut",children:(0,l.jsx)(Fo,{data:t,options:xc})}),(0,l.jsxs)("div",{className:"slr-rt-dist-table",children:[(0,l.jsxs)("div",{className:"slr-rt-dist-row slr-rt-dist-row--head",children:[(0,l.jsx)("span",{}),(0,l.jsx)("span",{children:(0,r.__)("Total","seo-local-rank")}),(0,l.jsx)("span",{children:(0,r.__)("New","seo-local-rank")}),(0,l.jsx)("span",{children:(0,r.__)("Lost","seo-local-rank")}),(0,l.jsx)("span",{})]}),e.buckets.map(e=>(0,l.jsx)(kc,{bucket:e},e.key))]})]})]})}function Rc({label:e,color:t}){return(0,l.jsxs)("div",{className:"slr-rt-dist-row",children:[(0,l.jsxs)("span",{className:"slr-rt-dist-row__label",children:[(0,l.jsx)("span",{className:"slr-rt-dist-row__dot",style:{background:t},"aria-hidden":"true"}),e]}),(0,l.jsx)("span",{className:"slr-skeleton slr-skeleton--line slr-skeleton--cell"}),(0,l.jsx)("span",{className:"slr-skeleton slr-skeleton--line slr-skeleton--cell"}),(0,l.jsx)("span",{className:"slr-skeleton slr-skeleton--line slr-skeleton--cell"}),(0,l.jsx)("span",{className:"slr-skeleton slr-skeleton--spark"})]})}function Mc(){return(0,l.jsxs)("div",{className:"slr-rt-summary","aria-busy":"true",children:[(0,l.jsxs)("div",{className:"slr-panel slr-rt-summary__card slr-rt-summary__avg",children:[(0,l.jsx)("h3",{className:"slr-rt-summary__title",children:(0,r.__)("AVG position","seo-local-rank")}),(0,l.jsx)("div",{className:"slr-skeleton slr-skeleton--line slr-skeleton--lg"}),(0,l.jsx)("div",{className:"slr-skeleton slr-skeleton--chart slr-skeleton--chart-sm"})]}),(0,l.jsxs)("div",{className:"slr-panel slr-rt-summary__card slr-rt-summary__distribution",children:[(0,l.jsx)("h3",{className:"slr-rt-summary__title",children:(0,r.__)("Keywords distribution","seo-local-rank")}),(0,l.jsxs)("div",{className:"slr-rt-summary__distribution-body",children:[(0,l.jsx)("div",{className:"slr-skeleton slr-skeleton--donut"}),(0,l.jsxs)("div",{className:"slr-rt-dist-table",children:[(0,l.jsxs)("div",{className:"slr-rt-dist-row slr-rt-dist-row--head",children:[(0,l.jsx)("span",{}),(0,l.jsx)("span",{children:(0,r.__)("Total","seo-local-rank")}),(0,l.jsx)("span",{children:(0,r.__)("New","seo-local-rank")}),(0,l.jsx)("span",{children:(0,r.__)("Lost","seo-local-rank")}),(0,l.jsx)("span",{})]}),(0,l.jsx)(Rc,{label:(0,r.__)("TOP 1-3","seo-local-rank"),color:"#EDC92F"}),(0,l.jsx)(Rc,{label:(0,r.__)("TOP 4-10","seo-local-rank"),color:"#69B5EB"}),(0,l.jsx)(Rc,{label:(0,r.__)("TOP 11-20","seo-local-rank"),color:"#3A8AD5"}),(0,l.jsx)(Rc,{label:(0,r.__)("TOP 20+","seo-local-rank"),color:"#C5C9CE"})]})]})]}),(0,l.jsxs)("div",{className:"slr-panel slr-rt-summary__card slr-rt-summary__aio",children:[(0,l.jsx)("h3",{className:"slr-rt-summary__title",children:(0,r.__)("AI Overview Presence","seo-local-rank")}),(0,l.jsx)("div",{className:"slr-skeleton slr-skeleton--line slr-skeleton--lg"}),(0,l.jsx)("div",{className:"slr-skeleton slr-skeleton--line slr-skeleton--md"}),(0,l.jsx)("div",{className:"slr-skeleton slr-skeleton--bar"}),(0,l.jsx)("div",{className:"slr-skeleton slr-skeleton--line slr-skeleton--sm"}),(0,l.jsx)("div",{className:"slr-skeleton slr-skeleton--line slr-skeleton--sm"})]})]})}function Tc(){const e=(0,r.__)("Add keywords to see rank data.","seo-local-rank");return(0,l.jsxs)("div",{className:"slr-rt-summary",children:[(0,l.jsxs)("div",{className:"slr-panel slr-rt-summary__card slr-rt-summary__avg",children:[(0,l.jsx)("h3",{className:"slr-rt-summary__title",children:(0,r.__)("AVG position","seo-local-rank")}),(0,l.jsx)("p",{className:"slr-rt-summary__empty",children:e})]}),(0,l.jsxs)("div",{className:"slr-panel slr-rt-summary__card slr-rt-summary__distribution",children:[(0,l.jsx)("h3",{className:"slr-rt-summary__title",children:(0,r.__)("Keywords distribution","seo-local-rank")}),(0,l.jsx)("p",{className:"slr-rt-summary__empty",children:e})]}),(0,l.jsxs)("div",{className:"slr-panel slr-rt-summary__card slr-rt-summary__aio",children:[(0,l.jsx)("h3",{className:"slr-rt-summary__title",children:(0,r.__)("AI Overview Presence","seo-local-rank")}),(0,l.jsx)("p",{className:"slr-rt-summary__empty",children:e})]})]})}function Sc({dataset:e,bootstrap:i,loading:s,error:n}){const o=(0,t.useMemo)(()=>e?fc(e,i):null,[e,i]);return s||!e&&!n?(0,l.jsx)(Mc,{}):e&&o&&!o.empty?(0,l.jsxs)("div",{className:"slr-rt-summary",children:[(0,l.jsx)(_c,{avg:o.avg}),(0,l.jsx)(Ec,{distribution:o.distribution}),(0,l.jsx)(wc,{aio:o.aio})]}):(0,l.jsx)(Tc,{})}function Dc(e){const t=e&&"object"==typeof e?e:{},i=Array.isArray(t.data)?t.data:[],s=t.notes&&"object"==typeof t.notes?t.notes:{},n=Number(t.keywords_without_end_data)||0,o=Number(t.keywords_paused)||0,a=Math.max(0,i.length-o),r=Math.max(0,a-n);return{keywords:i,keywordsWithoutEndData:n,keywordsPaused:o,updatedCount:r,updatedPercent:a>0?100*r/a:0,notes:{project:Array.isArray(s.project)?s.project:[],system:Array.isArray(s.system)?s.system:[]},hiddenColumns:t.hidden_columns??null,tableContext:t.rt_table_context&&"object"==typeof t.rt_table_context?t.rt_table_context:null,groupDataInterval:Number(t.group_data_interval)||0,start:t.start||"",end:t.end||"",startGrouped:t.start_grouped||"",gscAdvancedFirstDay:t.gsc_advanced_data_first_day??null,gscAdvancedLastDay:t.gsc_advanced_data_last_day??null,competitors:Array.isArray(t.competitors)?t.competitors:[]}}function jc({domainsPayload:e,selectedProject:i,onProjectChange:a}){const h=e?.domains||[],c=e?.domain||"",d=i?.project_domain_id||i?.id||0,[u,p]=(0,t.useState)(null),[m,g]=(0,t.useState)(!1),[b,f]=(0,t.useState)(""),[v,w]=(0,t.useState)(null),[_,y]=(0,t.useState)(null),[x,C]=(0,t.useState)(!0),[k,E]=(0,t.useState)(""),[R,M]=(0,t.useState)(null),[T,S]=(0,t.useState)(!1),D=(0,t.useRef)(null),j=u?function(e){const t=e?.default_period||{},i=e?.max_date||{},s=Number(i.days||0),n=Kl(String(i.date||"").slice(0,10)),o=ql(),a=n||Jl(o,-Math.max(s,0)),r=o,l="string"==typeof t.range?t.range:"";let h=Kl(t.start),c=Kl(t.end);if(!h||!c)switch(l){case"1 day":h=Jl(o,-1),c=o;break;case"7 days":h=Jl(o,-6),c=o;break;case"1 month":h=Zl(o,-1),c=o;break;case"2 months":h=Zl(o,-2),c=o;break;case"3 months":h=Zl(o,-3),c=o;break;default:h=s>29?Zl(o,-1):Jl(o,-Math.max(s,0)),c=o}return h=eh(h||a,a,r),c=eh(c||o,a,r),h>c&&(h=c),{start:h,end:c,minDate:a,maxDate:r,projectDays:s}}(u):null,N=v?.start||j?.start||null,L=v?.end||j?.end||null,P=Xl(N),A=Xl(L),z=j?.minDate||null,F=j?.maxDate||null,O=j?.projectDays||0,H=Number(u?.num_keywords??i?.num_keywords),I=_?_.keywords.length:Number.isFinite(H)?H:null,B=_?{paused:_.keywordsPaused,withoutEndData:_.keywordsWithoutEndData,percent:_.updatedPercent}:null,V=Number(u?.selected_domain?.project_domain_id||u?.domain?.project_domain_id||0),W=(!V||V===Number(d))&&function(e){if(!e||"object"!=typeof e)return!1;const t=Number(e.num_keywords);return Number.isFinite(t)&&t<=0}(u),G=(0,t.useCallback)(async()=>{if(!d)return p(null),y(null),void E("");g(!0),f(""),y(null),E("");try{const e=await s()({path:o(`/domains/ranktracker?project_domain_id=${d}`)});w(null),p(e?.data||null)}catch(e){p(null),w(null),y(null),f(e?.message||(0,r.__)("Could not load the rank tracker. Try again later.","seo-local-rank"))}finally{g(!1)}},[d]);(0,t.useEffect)(()=>{G()},[G]),(0,t.useEffect)(()=>{S(!1)},[d]),(0,t.useEffect)(()=>{!m&&u&&W&&S(!0)},[m,u,W]),(0,t.useEffect)(()=>{if(!d||!P||!A||m)return void(d&&!m||(y(null),C(!1)));if(W)return E(""),y(Dc({data:[]})),void C(!1);let e=!1;const t="undefined"!=typeof AbortController?new AbortController:null;return(async()=>{C(!0),E(""),y(null);try{const i=await s()({path:o(`/domains/ranktracker/data?project_domain_id=${d}&start=${encodeURIComponent(P)}&end=${encodeURIComponent(A)}`),signal:t?.signal});if(e)return;y(Dc(i))}catch(t){if(e||"AbortError"===t?.name)return;y(null),E(t?.message||(0,r.__)("Could not load keyword data. Try again later.","seo-local-rank"))}finally{e||C(!1)}})(),()=>{e=!0,t?.abort()}},[d,P,A,m,W]),(0,t.useEffect)(()=>{M(null)},[d,P,A]);const U=(0,t.useCallback)(e=>{qh(e)||M(e)},[]),$=(0,t.useCallback)(e=>{const t=(D.current?.getActiveRows()||[]).filter(e=>!qh(e));if(!t.length)return;const i=R?._rt_row_key,s=t.findIndex(e=>String(e._rt_row_key)===String(i)),n=s<0?0:(s+e+t.length)%t.length;M(t[n])},[R]);return i?m&&!u?(0,l.jsx)(ac,{}):(0,l.jsxs)("div",{className:"slr-rank-tracker","data-rt-ready":_?"true":"false","aria-busy":x||void 0,children:[(0,l.jsx)(pa,{selectedProject:i,domains:h,siteDomain:c,onProjectChange:a,keywordCount:I,keywordSync:B}),(0,l.jsxs)("div",{className:"slr-rank-tracker__body",children:[b&&(0,l.jsx)(n.Notice,{status:"error",isDismissible:!1,children:b}),k&&(0,l.jsx)(n.Notice,{status:"error",isDismissible:!1,children:k}),u&&N&&L&&z&&F&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(hh,{bootstrap:u,start:N,end:L,minDate:z,maxDate:F,projectDays:O,onRangeChange:(e,t)=>{w({start:e,end:t})}}),(0,l.jsx)(Sc,{dataset:_,bootstrap:u,loading:x,error:k}),(0,l.jsx)("div",{className:"slr-rt-actions",children:(0,l.jsx)(n.Button,{variant:"primary",className:"slr-rt-add-keywords",icon:"plus-alt2",onClick:()=>S(!0),children:(0,r.__)("Add keywords","seo-local-rank")})}),(0,l.jsx)(oc,{dataset:_,loading:x,selectedRowKey:R?._rt_row_key,onKeywordSelect:U,tableApiRef:D})]})]}),T?(0,l.jsx)(bh,{bootstrap:u,projectDomainId:d,onClose:()=>S(!1),onAdded:()=>{S(!1),G()}}):null,R?(0,l.jsx)(Th,{row:R,projectDomainId:d,domainId:Number(u?.domain?.domain_id||i?.domain_id||0),projectName:u?.domain?.name||i?.name||"",start:P,end:A,onClose:()=>M(null),onPrev:()=>$(-1),onNext:()=>$(1)}):null]}):(0,l.jsx)("div",{className:"slr-panel slr-empty-state",children:(0,l.jsx)("p",{children:(0,r.__)("No project selected.","seo-local-rank")})})}function Nc({settings:e,domainsPayload:i,selectedProject:a,onDisconnect:h,onProjectChange:c}){const[d,u]=(0,t.useState)(!1),[p,m]=(0,t.useState)(!1),[g,b]=(0,t.useState)(null),[f,v]=(0,t.useState)(""),w=i?.domains||[],_=w.length>1,y=i?.domain||e?.site_url||"";(0,t.useEffect)(()=>{const t=i?.project_domain_id||e?.project_domain_id||0;v(t>0?String(t):"")},[i?.project_domain_id,e?.project_domain_id]);const x=w.map(e=>{const t=e.project_domain_id||e.id;return{label:e.project_name?`${e.project_name} (${e.name_displayed||e.name})`:e.name_displayed||e.name||`#${t}`,value:String(t)}}),C=e?.user?.email,k=e?.plugin_version||window.slrAdmin?.version,E=a?`${a.project_name||""} (${a.name_displayed||a.name||y})`.trim():"—";return(0,l.jsxs)(l.Fragment,{children:[g&&(0,l.jsx)(n.Notice,{status:g.status,isDismissible:!0,onRemove:()=>b(null),children:g.message}),(0,l.jsxs)("div",{className:"slr-panel",children:[(0,l.jsx)("h2",{className:"slr-panel__title",children:(0,r.__)("Connection","seo-local-rank")}),(0,l.jsx)("p",{children:(0,l.jsx)("span",{className:"slr-status--connected",children:(0,r.__)("Logged in","seo-local-rank")})}),C&&(0,l.jsx)("p",{children:(0,r.sprintf)(/* translators: %s: account email */ /* translators: %s: account email */
     25(0,r.__)("Account: %s","seo-local-rank"),C)}),(0,l.jsx)("div",{className:"slr-settings__actions",children:(0,l.jsx)(n.Button,{variant:"secondary",onClick:async()=>{u(!0),b(null);try{const e=await s()({path:o("/connection/disconnect"),method:"POST"});b({status:"success",message:e.message||(0,r.__)("Session closed.","seo-local-rank")}),h()}catch(e){b({status:"error",message:e?.message||(0,r.__)("Could not log out.","seo-local-rank")})}finally{u(!1)}},isBusy:d,disabled:d,children:(0,r.__)("Log out","seo-local-rank")})})]}),(0,l.jsxs)("div",{className:"slr-panel",children:[(0,l.jsx)("h2",{className:"slr-panel__title",children:(0,r.__)("Project","seo-local-rank")}),0===w.length?(0,l.jsx)("p",{children:(0,t.createInterpolateElement)((0,r.sprintf)(/* translators: %s: site domain */ /* translators: %s: site domain */
     26(0,r.__)("There are no projects for <strong>%s</strong>.","seo-local-rank"),y),{strong:(0,l.jsx)("strong",{})})}):_?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)("p",{className:"slr-onboarding__help",children:(0,r.__)("The selected project is used on every plugin screen.","seo-local-rank")}),(0,l.jsx)(n.SelectControl,{label:(0,r.__)("Active project","seo-local-rank"),value:f,options:x,onChange:v}),(0,l.jsx)("div",{className:"slr-settings__actions",children:(0,l.jsx)(n.Button,{variant:"primary",onClick:async()=>{const e=parseInt(f,10);if(e){m(!0),b(null);try{await s()({path:o(`/domains/${e}/select`),method:"POST"}),b({status:"success",message:(0,r.__)("Project updated.","seo-local-rank")}),c()}catch(e){b({status:"error",message:e?.message||(0,r.__)("Could not change the project.","seo-local-rank")})}finally{m(!1)}}},isBusy:p,disabled:p||!f,children:(0,r.__)("Save project","seo-local-rank")})})]}):(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)("p",{className:"slr-onboarding__help",children:(0,r.__)("Active project","seo-local-rank")}),(0,l.jsx)("p",{children:E})]})]}),(0,l.jsxs)("div",{className:"slr-panel",children:[(0,l.jsx)("h2",{className:"slr-panel__title",children:(0,r.__)("About","seo-local-rank")}),(0,l.jsx)("p",{children:(0,r.sprintf)(/* translators: %s: plugin version */ /* translators: %s: plugin version */
     27(0,r.__)("Plugin version: %s","seo-local-rank"),k)})]})]})}function Lc({page:e}){const i="seolocalrank-settings"===e,a="seolocalrank-rank-tracker"===e,r="seolocalrank-ai-visibility"===e,[c,d]=(0,t.useState)(!0),[p,m]=(0,t.useState)(null),[g,b]=(0,t.useState)(null),[f,v]=(0,t.useState)(!1),w=(0,t.useCallback)(async()=>{d(!0);try{const e=await s()({path:o("/settings")});m(e)}catch{m({connected:!1}),b(null)}finally{d(!1)}},[]),_=(0,t.useCallback)(async()=>{v(!0);try{const e=await s()({path:o("/domains")});b(e)}catch{b({ok:!1,domains:[],project_domain_id:0,needs_selection:!1})}finally{v(!1)}},[]);if((0,t.useEffect)(()=>{w()},[w]),(0,t.useEffect)(()=>{p?.connected?_():b(null)},[p?.connected,_]),c||p?.connected&&f&&!g)return(0,l.jsx)("div",{className:"slr-app slr-app--loading",children:(0,l.jsx)(n.Spinner,{})});if(!p?.connected)return(0,l.jsx)("div",{className:"slr-app",children:(0,l.jsx)(wa,{settings:p,onConnected:w})});if(g?.needs_selection&&g?.domains?.length>1)return(0,l.jsx)("div",{className:"slr-app",children:(0,l.jsx)(h,{domains:g.domains,onSelected:_})});if(!i&&0===(g?.domains||[]).length)return(0,l.jsx)("div",{className:"slr-app",children:(0,l.jsx)(u,{settings:p,domainsPayload:g,onCreated:_})});const y=(x=g?.domains||[],(C=g?.project_domain_id||p?.project_domain_id||0)&&Array.isArray(x)&&x.find(e=>(e.project_domain_id||e.id)===C)||null);var x,C;return(0,l.jsx)("div",{className:"slr-app",children:i?(0,l.jsx)(Nc,{settings:p,domainsPayload:g,selectedProject:y,onDisconnect:w,onProjectChange:_}):a?(0,l.jsx)(jc,{domainsPayload:g,selectedProject:y,onProjectChange:_}):r?(0,l.jsx)(Yl,{domainsPayload:g,selectedProject:y,onProjectChange:_}):(0,l.jsx)(ga,{domainsPayload:g,selectedProject:y,onProjectChange:_})})}const Pc=document.getElementById("slr-admin-root");if(Pc){const e=(0,l.jsx)(t.StrictMode,{children:(0,l.jsx)(Lc,{page:Pc.dataset.page||"seolocalrank"})});t.createRoot?(0,t.createRoot)(Pc).render(e):(0,t.render)(e,Pc)}})();
  • seo-local-rank/trunk/languages/seo-local-rank-es_ES-slr-admin.json

    r3706047 r3720851  
    1 {"translation-revision-date":"2026-09-21T14:37:04.451Z","generator":"seo-local-rank i18n script","source":"build/index.js","domain":"messages","locale_data":{"messages":{"":{"domain":"messages","lang":"es_ES","plural-forms":"nplurals=2; plural=(n != 1);"},"Device":["Dispositivo"],"Local Pack":["Local Pack"],"AI Overview":["AI Overview"],"7 days":["7 días"],"Tags":["Tags"],"Location":["Localización"],"Volume":["Volumen"],"Position":["Posición"],"URL":["URL"],"Keyword":["Keyword"],"Depth":["Profundidad"],"Change":["Cambio"],"Last interval change":["Cambio último intervalo"],"1/7/30":["1/7/30"],"30 days":["30 días"],"90 days":["90 días"],"Last change":["Último cambio"],"Best ever":["Mejor histórica"],"Avg position":["Pos. media"],"Best":["Mejor"],"Worst":["Peor"],"Starting":["Inicial"],"CPC":["CPC"],"Competition":["Competencia"],"Traffic":["Tráfico"],"Impressions":["Impresiones"],"Clicks":["Clics"],"GSC Position":["Posición GSC"],"CTR":["CTR"],"Snippets":["Snippets"],"Updated at":["Actualizado"],"Created at":["Creada"],"Backlinks":["Enlaces"],"Pages":["Páginas"],"Referring domains":["Dominios referentes"],"Unique IPs":["IPs únicas"],"Domain rank":["Domain rank"],"Remaining":["Restantes"],"Backlink metrics":["Métricas de backlinks"],"Domain rank (DR)":["Domain rank (DR)"],"Backlink summary is being prepared.":["El resumen de backlinks se está preparando."],"Backlink trends":["Evolución de backlinks"],"Loading rank tracker":["Cargando Rank Tracker"],"Loading dashboard":["Cargando dashboard"],"Could not add keywords. Try again later.":["No se pudieron añadir las keywords. Inténtalo más tarde."],"Add keywords":["Añadir Keywords"],"Go to plans":["Ir a planes"],"Cancel":["Cancelar"],"Keyword limit reached":["Has alcanzado el límite de keywords"],"You should consider upgrade your plan to add more keywords.":["Deberías plantearte mejorar tu plan para añadir más keywords."],"keywords left":["palabras clave"],"Add keywords to %s":["Añadir keywords a %s"],"One keyword per line":["Una keyword por línea"],"Number of keywords is above the available keywords.":["El número de keywords supera las keywords disponibles."],"Where do you want to track your keywords?":["¿Dónde quieres monitorizar tus keywords?"],"Countries, provinces, cities…":["Países, provincias, ciudades…"],"Write a country, province or city":["Escribe un país, provincia o ciudad"],"No locations found.":["No se encontraron localizaciones."],"Remove location":["Quitar localización"],"On what type of device do you want to track the results?":["¿En qué tipo de dispositivo quieres monitorizar los resultados?"],"When selecting two devices, the number of used keywords doubles":["Al seleccionar dos dispositivos, el número de keywords usadas se duplica"],"Desktop":["Desktop"],"Mobile":["Móvil"],"Both":["Ambos"],"Add keywords to your project":["Añade keywords a tu proyecto"],"You can add multiple words and multiple locations, creating combinations between all of them.":["Puedes añadir varias palabras y varias localizaciones, creando combinaciones entre todas ellas."],"AI Overview Presence":["Presencia en AI Overview"],"%1$s of %2$s keywords":["%1$s de %2$s keywords"],"%1$s mentions of %2$s keywords":["%1$s menciones de %2$s keywords"],"%1$s citations of %2$s keywords":["%1$s citas de %2$s keywords"],"Score":["Score"],"Mentions":["Menciones"],"Citations":["Citas"],"+%d pts":["+%d pts"],"-%d pts":["-%d pts"],"AI Visibility":["Visibilidad IA"],"Score trend":["Evolución del score"],"Add prompts to see AI visibility trends.":["Añade prompts para ver la evolución de la visibilidad IA."],"AI visibility data will appear after the first scan.":["Los datos de visibilidad IA aparecerán tras el primer análisis."],"AI visibility score":["Score de visibilidad IA"],"Add prompts to see the visibility score.":["Añade prompts para ver el score de visibilidad."],"Score breakdown will appear after the first scan.":["El desglose del score aparecerá tras el primer análisis."],"Rank Tracker":["Rank Tracker"],"Collecting data":["Recopilando datos"],"Add keywords to start tracking rankings.":["Añade keywords para empezar a monitorizar posiciones."],"Rank data will appear after the first update.":["Los datos de ranking aparecerán tras la primera actualización."],"Average position":["Posición media"],"Organic visibility":["Visibilidad orgánica"],"Keywords":["Keywords"],"Add prompts to measure AI visibility.":["Añade prompts para medir la visibilidad IA."],"Prompts":["Prompts"],"Tracked backlinks":["Backlinks monitorizados"],"with issues":["con incidencias"],"SEO Audits":["Auditorías SEO"],"No audits yet for this project.":["Aún no hay auditorías para este proyecto."],"Average score":["Score medio"],"URLs audited":["URLs auditadas"],"Visibility index":["Índice de visibilidad"],"Visibility index data is not available yet.":["Los datos del índice de visibilidad aún no están disponibles."],"Mobile visibility":["Visibilidad móvil"],"Project updated.":["Proyecto actualizado."],"Could not change the project.":["No se pudo cambiar el proyecto."],"Session closed.":["Sesión cerrada."],"Could not log out.":["No se pudo cerrar sesión."],"Connection":["Conexión"],"Logged in":["Logueado"],"Account: %s":["Cuenta: %s"],"Log out":["Cerrar sesión"],"Project":["Proyecto"],"There are no projects for <strong>%s</strong>.":["No hay proyectos para <strong>%s</strong>."],"The selected project is used on every plugin screen.":["El proyecto seleccionado se usa en todas las pantallas del plugin."],"Active project":["Proyecto activo"],"Save project":["Guardar proyecto"],"About":["Acerca de"],"Plugin version: %s":["Versión del plugin: %s"],"AVG position":["Posición media"],"TOP 1-3":["TOP 1-3"],"TOP 4-10":["TOP 4-10"],"TOP 11-%s":["TOP 11-%s"],"TOP %s+":["TOP %s+"],"Loading…":["Cargando…"],"Add keywords to see rank data.":["Añade keywords para ver los datos de ranking."],"First":["Primera"],"Last":["Última"],"Prev":["Anterior"],"Next":["Siguiente"],"Show":["Mostrar"],"Search keyword, URL, location…":["Buscar keyword, URL, localización…"],"Keywords distribution":["Distribución de keywords"],"Total":["Total"],"New":["Nuevas"],"Lost":["Perdidas"],"TOP 11-20":["TOP 11-20"],"TOP 20+":["TOP 20+"],"Top 1–3":["Top 1–3"],"Top 4–10":["Top 4–10"],"Top 11+":["Top 11+"],"Top 11–20":["Top 11–20"],"Top 21–100":["Top 21–100"],"Top 101+":["Top 101+"],"Top 21–50":["Top 21–50"],"Top 51+":["Top 51+"],"Top 21+":["Top 21+"],"Mention rate":["Tasa de menciones"],"Citation rate":["Tasa de citas"],"Sentiment score":["Score de sentimiento"],"Share of voice":["Share of voice"],"LLM coverage":["Cobertura LLM"],"%d paused":["%d pausada","%d pausadas"],"%d%% updated":["%d%% actualizado"],"%d Keyword":["%d Keyword","%d Keywords"],"Search project…":["Buscar proyecto…"],"No projects found.":["No se encontraron proyectos."],"Upgrade":["Upgrade"],"No project selected.":["No hay proyecto seleccionado."],"Could not load the rank tracker. Try again later.":["No se pudo cargar el Rank Tracker. Inténtalo más tarde."],"Could not load keyword data. Try again later.":["No se pudieron cargar los datos de keywords. Inténtalo más tarde."],"Evolution":["Evolución"],"Positioning and organic visibility over the last 30 days.":["Posicionamiento y visibilidad orgánica de los últimos 30 días."],"Add keywords to see rank evolution.":["Añade keywords para ver la evolución del ranking."],"No distribution data yet.":["Aún no hay datos de distribución."],"Distribution will appear after the first update.":["La distribución aparecerá tras la primera actualización."],"%s+":["%s+"],"Buy plan":["Upgrade"],"People Also Ask":["People Also Ask"],"Videos":["Vídeos"],"Images":["Imágenes"],"Knowledge Panel":["Knowledge Panel"],"Placed Sites":["Sitios destacados"],"Forums & Discussions":["Foros y discusiones"],"Product Grid":["Product Grid"],"Now":["Ahora"],"%d hour ago":["hace %d hora","hace %d horas"],"Pending":["Pendiente"],"101+":["101+"],"Waiting for GSC data":["Esperando datos de GSC"],"Ranking target URL and cannibalization":["URL objetivo posicionada y canibalización"],"Ranking target URL":["URL objetivo posicionada"],"Possible cannibalization":["Posible canibalización"],"Keyword paused":["Keyword pausada"],"You are top 1":["Estás en el top 1"],"Best rank ever":["Mejor posición histórica"],"New keyword ranking":["Keyword nueva en ranking"],"NEW":["NUEVA"],"11+":["11+"],"Few results in search":["Pocos resultados en la búsqueda"],"Waiting to update":["Pendiente de actualizar"],"Waiting for volume":["Esperando volumen"],"Waiting for CPC":["Esperando CPC"],"Waiting for competition":["Esperando competencia"],"Local Map":["Mapa local"],"Last crawl data":["Datos del último rastreo"],"Snippet exists but does not appear":["El snippet existe pero no aparece"],"Your site appears in this snippet":["Tu sitio aparece en este snippet"],"A competitor appears in this snippet":["Un competidor aparece en este snippet"],"Project links: %s":["Enlaces del proyecto: %s"],"Brand words: %s":["Palabras de marca: %s"],"Project does not appear":["El proyecto no aparece"],"Brand":["Marca"],"%1$s (%2$s) — %3$d keyword":["%1$s (%2$s) — %3$d keyword","%1$s (%2$s) — %3$d keywords"],"Could not save the selection.":["No se pudo guardar la selección."],"Choose a project":["Elige un proyecto"],"There are several projects for this domain. Choose which one to use in WordPress.":["Hay varios proyectos para este dominio. Elige cuál quieres usar en WordPress."],"You can change it at any time from Settings.":["Puedes cambiarlo en cualquier momento desde Ajustes."],"Use this project":["Usar este proyecto"],"Could not load the dashboard. Try again later.":["No se pudo cargar el dashboard. Inténtalo más tarde."],"No project for this domain":["Sin proyecto para este dominio"],"There is no TrueRanker project for <strong>%s</strong>.":["No hay ningún proyecto en TrueRanker para <strong>%s</strong>."],"Creating a project from scratch will be available soon.":["Crear un proyecto desde cero estará disponible próximamente."],"1 day":["1 día"],"1 month":["1 mes"],"2 months":["2 meses"],"3 months":["3 meses"],"Previous month":["Mes anterior"],"Month":["Mes"],"Year":["Año"],"Next month":["Mes siguiente"],"Date range":["Rango de fechas"],"Close":["Cerrar"],"TOP 20 every day":["TOP 20 diario"],"We will monitor the TOP 20 of your keywords in Google every day.":["Monitorizaremos todos los días el TOP 20 de tus keywords en Google."],"TOP 50 every 3 days":["TOP 50 cada 3 días"],"We will monitor the TOP 50 of your keywords in Google every 3 days.":["Monitorizaremos cada 3 días el TOP 50 de tus keywords en Google."],"TOP 100 every 7 days":["TOP 100 cada 7 días"],"We will monitor the TOP 100 of your keywords in Google every 7 days.":["Monitorizaremos cada 7 días el TOP 100 de tus keywords en Google."],"Could not load countries.":["No se pudieron cargar los países."],"Enter the brand name.":["Introduce el nombre de la marca."],"Choose a country.":["Elige un país."],"Could not create the project.":["No se pudo crear el proyecto."],"Choose a country":["Elige un país"],"Create your project":["Crea tu proyecto"],"There is no TrueRanker project for this site. Fill in the brand, country and tracking frequency to get started.":["No hay ningún proyecto en TrueRanker para este sitio. Completa la marca, el país y la frecuencia de tracking para empezar."],"Domain":["Dominio"],"Taken from this WordPress site and cannot be changed.":["Se toma de este sitio WordPress y no se puede cambiar."],"Enter your brand to monitor its appearances in AI-generated answers.":["Introduce tu marca para monitorizar sus apariciones en las respuestas generadas con IA."],"Country":["País"],"Choose the country where you want to measure visibility. Later, for each keyword, you can pick any location (even in another country).":["Introduce el país donde quieres medir la visibilidad. Luego, en cada palabra clave, podrás elegir la ubicación que quieras (incluso de otro país)."],"Tracking":["Tracking"],"Choose the tracking options you want to apply to your project.":["Elige el intervalo y la profundidad de rastreo de este proyecto."],"Tracking options":["Opciones de tracking"],"Create project":["Crear proyecto"],"No ranking history for this range.":["No hay historial de ranking para este rango."],"Google's top 10 for your keyword indexed URL":["Top 10 de Google para la URL indexada de tu keyword"],"(Show SERP)":["(Mostrar SERP)"],"No SERP data.":["No hay datos de SERP."],"Target URL":["URL objetivo"],"Cannibalization":["Canibalización"],"Volume:":["Volumen:"],"CPC:":["CPC:"],"Competition:":["Competencia:"],"Search trend":["Tendencia de búsqueda"],"Keyword tags":["Tags de la keyword"],"No tags.":["Sin tags."],"Could not load keyword history. Try again later.":["No se pudo cargar el historial de la keyword. Inténtalo más tarde."],"Keyword: %s":["Keyword: %s"],"Keyword:":["Keyword:"],"Loading keyword stats…":["Cargando estadísticas de la keyword…"],"Previous keyword":["Keyword anterior"],"Next keyword":["Keyword siguiente"],"All":["Todas"],"Favorites":["Favoritas"],"Tag match":["Coincidencia de tags"],"Include all tags":["Incluye todos los tags"],"Include one tag":["Incluye un tag"],"Does not have this tag":["No tiene este tag"],"Does not have one of those tags":["No tiene uno de esos tags"],"All locations":["Todas las localizaciones"],"More filters":["Más filtros"],"URL match":["Coincidencia de URL"],"URL contains":["URL contiene"],"URL not contains":["URL no contiene"],"Exact URL":["URL exacta"],"Exact URL different":["URL exacta es diferente"],"Word":["Palabra"],"Rank change":["Cambio de posición"],"Keywords up":["Keywords que suben"],"Keywords down":["Keywords que bajan"],"No changes":["Sin cambios"],"No. of words":["N.º de palabras"],"Cannibalizations":["Canibalizaciones"],"All cannibalizations":["Todas las canibalizaciones"],"No cannibalizations":["Sin canibalizaciones"],"Target URL is not ranking higher":["La URL objetivo no está por encima"],"Target URL is ranking higher":["La URL objetivo está por encima"],"Target URL is set":["URL objetivo definida"],"Target URL is not set":["URL objetivo no definida"],"All keywords":["Todas las keywords"],"No AI Overview keywords":["Sin keywords de AI Overview"],"AI Overview keywords":["Keywords de AI Overview"],"Mentions keywords":["Keywords con menciones"],"Citations keywords":["Keywords con citas"],"Clear filters":["Quitar filtros"],"Save as view":["Guardar como vista"],"Delete view":["Eliminar vista"],"Enter your API key.":["Introduce tu API key."],"Could not connect with this API key.":["No se pudo conectar con esta API key."],"Enter a valid email.":["Introduce un email válido."],"Check your inbox: we have sent you the API key. Paste it below to connect.":["Revisa tu correo: te hemos enviado la API key. Pégala abajo para conectar."],"Could not send the API key. Please try again.":["No se pudo enviar la API key. Inténtalo de nuevo."],"TrueRanker helps you track keyword rankings, monitor backlinks and measure your AI visibility — all from WordPress.":["TrueRanker te ayuda a seguir posiciones de keywords, monitorizar backlinks y medir tu visibilidad en IA — todo desde WordPress."],"How do you want to get started?":["¿Cómo quieres empezar?"],"Connect existing account":["Conectar cuenta existente"],"Start from scratch":["Empezar desde cero"],"Connect your account":["Conecta tu cuenta"],"Paste your TrueRanker API key to link this WordPress site with your account.":["Pega tu API key de TrueRanker para vincular este sitio WordPress con tu cuenta."],"Get API key in TrueRanker":["Obtener API key en TrueRanker"],"API Key":["API Key"],"Connect":["Conectar"],"Back":["Atrás"],"We have sent the API key to this email. The field can no longer be changed.":["Hemos enviado la API key a este email. El campo ya no se puede cambiar."],"Enter your email. TrueRanker will send you an API key to connect this site. The key is not shown here: it arrives by email only.":["Introduce tu email. TrueRanker te enviará una API key para conectar este sitio. La clave no aparece aquí: llega solo al correo."],"Email":["Email"],"Send API key":["Enviar API key"],"When you receive the email, paste the API key here to connect.":["Cuando recibas el correo, pega la API key aquí para conectar."]}}}
     1{"translation-revision-date":"2026-09-30T09:41:13.902Z","generator":"seo-local-rank i18n script","source":"build/index.js","domain":"messages","locale_data":{"messages":{"":{"domain":"messages","lang":"es_ES","plural-forms":"nplurals=2; plural=(n != 1);"},"Competition":["Competencia"],"Location":["Localización"],"Device":["Dispositivo"],"Local Pack":["Local Pack"],"AI Overview":["AI Overview"],"7 days":["7 días"],"Tags":["Tags"],"Volume":["Volumen"],"Position":["Posición"],"URL":["URL"],"Keyword":["Keyword"],"Depth":["Profundidad"],"Change":["Cambio"],"Last interval change":["Cambio último intervalo"],"1/7/30":["1/7/30"],"30 days":["30 días"],"90 days":["90 días"],"Last change":["Último cambio"],"Best ever":["Mejor histórica"],"Avg position":["Pos. media"],"Best":["Mejor"],"Worst":["Peor"],"Starting":["Inicial"],"CPC":["CPC"],"Traffic":["Tráfico"],"Impressions":["Impresiones"],"Clicks":["Clics"],"GSC Position":["Posición GSC"],"CTR":["CTR"],"Snippets":["Snippets"],"Updated at":["Actualizado"],"Created at":["Creada"],"Backlinks":["Enlaces"],"Pages":["Páginas"],"Referring domains":["Dominios referentes"],"Unique IPs":["IPs únicas"],"Domain rank":["Domain rank"],"Remaining":["Restantes"],"Backlink metrics":["Métricas de backlinks"],"Domain rank (DR)":["Domain rank (DR)"],"Backlink summary is being prepared.":["El resumen de backlinks se está preparando."],"Backlink trends":["Evolución de backlinks"],"Share of voice":["Share of voice"],"Add prompts":["Añadir prompts"],"Could not load AI Visibility. Try again later.":["No se pudo cargar Visibilidad IA. Inténtalo más tarde."],"Could not load share of voice per LLM.":["No se pudo cargar el share of voice por LLM."],"No project selected.":["No hay proyecto seleccionado."],"Prompt results":["Resultados de prompts"],"AI Visibility Changes":["Cambios de visibilidad IA"],"Loading rank tracker":["Cargando Rank Tracker"],"Traction":["Tracción"],"Alert":["Alerta"],"Milestone":["Hito"],"No significant milestones detected in this period.":["No se han detectado hitos relevantes en este periodo."],"Loading dashboard":["Cargando dashboard"],"No prompts in this project":["No hay prompts en este proyecto"],"Add prompts to start measuring how AI models mention and cite your brand.":["Añade prompts para medir cómo los modelos de IA mencionan y citan tu marca."],"Track AI mentions":["Monitoriza menciones IA"],"See when ChatGPT, Claude, Gemini and others mention your brand.":["Comprueba cuándo ChatGPT, Claude, Gemini y otros mencionan tu marca."],"Compare models":["Compara modelos"],"Check mention and citation status for each LLM.":["Revisa menciones y citas en cada LLM."],"Beat competitors":["Supera a tus competidores"],"Measure share of voice against the sites AI recommends.":["Mide el share of voice frente a los sitios que recomienda la IA."],"First results usually appear after the next scan.":["Los primeros resultados suelen aparecer tras el siguiente análisis."],"Could not add keywords. Try again later.":["No se pudieron añadir las keywords. Inténtalo más tarde."],"Add keywords":["Añadir Keywords"],"Go to plans":["Ir a planes"],"Cancel":["Cancelar"],"Keyword limit reached":["Has alcanzado el límite de keywords"],"You should consider upgrade your plan to add more keywords.":["Deberías plantearte mejorar tu plan para añadir más keywords."],"keywords left":["palabras clave"],"Add keywords to %s":["Añadir keywords a %s"],"One keyword per line":["Una keyword por línea"],"Number of keywords is above the available keywords.":["El número de keywords supera las keywords disponibles."],"Where do you want to track your keywords?":["¿Dónde quieres monitorizar tus keywords?"],"Countries, provinces, cities…":["Países, provincias, ciudades…"],"Write a country, province or city":["Escribe un país, provincia o ciudad"],"No locations found.":["No se encontraron localizaciones."],"Remove location":["Quitar localización"],"On what type of device do you want to track the results?":["¿En qué tipo de dispositivo quieres monitorizar los resultados?"],"When selecting two devices, the number of used keywords doubles":["Al seleccionar dos dispositivos, el número de keywords usadas se duplica"],"Desktop":["Desktop"],"Mobile":["Móvil"],"Both":["Ambos"],"Add keywords to your project":["Añade keywords a tu proyecto"],"You can add multiple words and multiple locations, creating combinations between all of them.":["Puedes añadir varias palabras y varias localizaciones, creando combinaciones entre todas ellas."],"AI Overview Presence":["Presencia en AI Overview"],"%1$s of %2$s keywords":["%1$s de %2$s keywords"],"%1$s mentions of %2$s keywords":["%1$s menciones de %2$s keywords"],"%1$s citations of %2$s keywords":["%1$s citas de %2$s keywords"],"AI Visibility":["Visibilidad IA"],"Mentions":["Menciones"],"Citations":["Citas"],"Score":["Score"],"Score trend":["Evolución del score"],"+%d pts":["+%d pts"],"-%d pts":["-%d pts"],"Add prompts to see AI visibility trends.":["Añade prompts para ver la evolución de la visibilidad IA."],"AI visibility data will appear after the first scan.":["Los datos de visibilidad IA aparecerán tras el primer análisis."],"AI visibility score":["Score de visibilidad IA"],"Add prompts to see the visibility score.":["Añade prompts para ver el score de visibilidad."],"Score breakdown will appear after the first scan.":["El desglose del score aparecerá tras el primer análisis."],"%1$s %2$s vs prev":["%1$s %2$s vs ant."],"Competitors":["Competidores"],"%1$d of %2$d":["%1$d de %2$d"],"Add competitor":["Añadir competidor"],"Add first competitor":["Añadir el primer competidor"],"Website":["Sitio web"],"Rank Tracker":["Rank Tracker"],"Collecting data":["Recopilando datos"],"Add keywords to start tracking rankings.":["Añade keywords para empezar a monitorizar posiciones."],"Rank data will appear after the first update.":["Los datos de ranking aparecerán tras la primera actualización."],"Average position":["Posición media"],"Organic visibility":["Visibilidad orgánica"],"Keywords":["Keywords"],"Add prompts to measure AI visibility.":["Añade prompts para medir la visibilidad IA."],"Prompts":["Prompts"],"Tracked backlinks":["Backlinks monitorizados"],"with issues":["con incidencias"],"SEO Audits":["Auditorías SEO"],"No audits yet for this project.":["Aún no hay auditorías para este proyecto."],"Average score":["Score medio"],"URLs audited":["URLs auditadas"],"Visibility index":["Índice de visibilidad"],"Visibility index data is not available yet.":["Los datos del índice de visibilidad aún no están disponibles."],"Mobile visibility":["Visibilidad móvil"],"Project updated.":["Proyecto actualizado."],"Could not change the project.":["No se pudo cambiar el proyecto."],"Session closed.":["Sesión cerrada."],"Could not log out.":["No se pudo cerrar sesión."],"Connection":["Conexión"],"Logged in":["Logueado"],"Account: %s":["Cuenta: %s"],"Log out":["Cerrar sesión"],"Project":["Proyecto"],"There are no projects for <strong>%s</strong>.":["No hay proyectos para <strong>%s</strong>."],"The selected project is used on every plugin screen.":["El proyecto seleccionado se usa en todas las pantallas del plugin."],"Active project":["Proyecto activo"],"Save project":["Guardar proyecto"],"About":["Acerca de"],"Plugin version: %s":["Versión del plugin: %s"],"AI Visibility Score":["AI Visibility Score"],"%1$s %2$s pts":["%1$s %2$s pts"],"AVG position":["Posición media"],"TOP 1-3":["TOP 1-3"],"TOP 4-10":["TOP 4-10"],"TOP 11-%s":["TOP 11-%s"],"TOP %s+":["TOP %s+"],"Loading AI Visibility":["Cargando Visibilidad IA"],"First":["Primera"],"Last":["Última"],"Prev":["Anterior"],"Next":["Siguiente"],"Show":["Mostrar"],"Loading…":["Cargando…"],"Add keywords to see rank data.":["Añade keywords para ver los datos de ranking."],"Search keyword, URL, location…":["Buscar keyword, URL, localización…"],"Keywords distribution":["Distribución de keywords"],"Total":["Total"],"New":["Nuevas"],"Lost":["Perdidas"],"Pending":["Pendiente"],"Positive":["Positivo"],"Neutral":["Neutral"],"Negative":["Negativo"],"Prompt":["Prompt"],"Sentiment":["Sentimiento"],"Trend":["Tendencia"],"No prompts in this range.":["No hay prompts en este rango."],"Search prompt…":["Buscar prompt…"],"TOP 11-20":["TOP 11-20"],"TOP 20+":["TOP 20+"],"LLM coverage":["Cobertura LLM"],"Top 1–3":["Top 1–3"],"Top 4–10":["Top 4–10"],"Top 11+":["Top 11+"],"Top 11–20":["Top 11–20"],"Top 21–100":["Top 21–100"],"Top 101+":["Top 101+"],"Top 21–50":["Top 21–50"],"Top 51+":["Top 51+"],"Top 21+":["Top 21+"],"Mention rate":["Tasa de menciones"],"Citation rate":["Tasa de citas"],"Sentiment score":["Score de sentimiento"],"%d paused":["%d pausada","%d pausadas"],"%d%% updated":["%d%% actualizado"],"%d Keyword":["%d Keyword","%d Keywords"],"Search project…":["Buscar proyecto…"],"No projects found.":["No se encontraron proyectos."],"%d Prompt":["%d Prompt","%d Prompts"],"Upgrade":["Upgrade"],"Could not load the rank tracker. Try again later.":["No se pudo cargar el Rank Tracker. Inténtalo más tarde."],"Could not load keyword data. Try again later.":["No se pudieron cargar los datos de keywords. Inténtalo más tarde."],"Evolution":["Evolución"],"Positioning and organic visibility over the last 30 days.":["Posicionamiento y visibilidad orgánica de los últimos 30 días."],"Add keywords to see rank evolution.":["Añade keywords para ver la evolución del ranking."],"No distribution data yet.":["Aún no hay datos de distribución."],"Distribution will appear after the first update.":["La distribución aparecerá tras la primera actualización."],"%s+":["%s+"],"Buy plan":["Upgrade"],"People Also Ask":["People Also Ask"],"Videos":["Vídeos"],"Images":["Imágenes"],"Knowledge Panel":["Knowledge Panel"],"Placed Sites":["Sitios destacados"],"Forums & Discussions":["Foros y discusiones"],"Product Grid":["Product Grid"],"Now":["Ahora"],"%d hour ago":["hace %d hora","hace %d horas"],"101+":["101+"],"Waiting for GSC data":["Esperando datos de GSC"],"Ranking target URL and cannibalization":["URL objetivo posicionada y canibalización"],"Ranking target URL":["URL objetivo posicionada"],"Possible cannibalization":["Posible canibalización"],"Keyword paused":["Keyword pausada"],"You are top 1":["Estás en el top 1"],"Best rank ever":["Mejor posición histórica"],"New keyword ranking":["Keyword nueva en ranking"],"NEW":["NUEVA"],"11+":["11+"],"Few results in search":["Pocos resultados en la búsqueda"],"Waiting to update":["Pendiente de actualizar"],"Waiting for volume":["Esperando volumen"],"Waiting for CPC":["Esperando CPC"],"Waiting for competition":["Esperando competencia"],"Local Map":["Mapa local"],"Last crawl data":["Datos del último rastreo"],"Snippet exists but does not appear":["El snippet existe pero no aparece"],"Your site appears in this snippet":["Tu sitio aparece en este snippet"],"A competitor appears in this snippet":["Un competidor aparece en este snippet"],"Project links: %s":["Enlaces del proyecto: %s"],"Brand words: %s":["Palabras de marca: %s"],"Project does not appear":["El proyecto no aparece"],"Brand":["Marca"],"%1$s (%2$s) — %3$d keyword":["%1$s (%2$s) — %3$d keyword","%1$s (%2$s) — %3$d keywords"],"Could not save the selection.":["No se pudo guardar la selección."],"Choose a project":["Elige un proyecto"],"There are several projects for this domain. Choose which one to use in WordPress.":["Hay varios proyectos para este dominio. Elige cuál quieres usar en WordPress."],"You can change it at any time from Settings.":["Puedes cambiarlo en cualquier momento desde Ajustes."],"Use this project":["Usar este proyecto"],"Could not load the dashboard. Try again later.":["No se pudo cargar el dashboard. Inténtalo más tarde."],"No project for this domain":["Sin proyecto para este dominio"],"There is no TrueRanker project for <strong>%s</strong>.":["No hay ningún proyecto en TrueRanker para <strong>%s</strong>."],"Creating a project from scratch will be available soon.":["Crear un proyecto desde cero estará disponible próximamente."],"1 day":["1 día"],"1 month":["1 mes"],"2 months":["2 meses"],"3 months":["3 meses"],"6 months":["6 meses"],"1 year":["1 año"],"Previous month":["Mes anterior"],"Month":["Mes"],"Year":["Año"],"Next month":["Mes siguiente"],"Date range":["Rango de fechas"],"Close":["Cerrar"],"TOP 20 every day":["TOP 20 diario"],"We will monitor the TOP 20 of your keywords in Google every day.":["Monitorizaremos todos los días el TOP 20 de tus keywords en Google."],"TOP 50 every 3 days":["TOP 50 cada 3 días"],"We will monitor the TOP 50 of your keywords in Google every 3 days.":["Monitorizaremos cada 3 días el TOP 50 de tus keywords en Google."],"TOP 100 every 7 days":["TOP 100 cada 7 días"],"We will monitor the TOP 100 of your keywords in Google every 7 days.":["Monitorizaremos cada 7 días el TOP 100 de tus keywords en Google."],"Could not load countries.":["No se pudieron cargar los países."],"Enter the brand name.":["Introduce el nombre de la marca."],"Choose a country.":["Elige un país."],"Could not create the project.":["No se pudo crear el proyecto."],"Choose a country":["Elige un país"],"Create your project":["Crea tu proyecto"],"There is no TrueRanker project for this site. Fill in the brand, country and tracking frequency to get started.":["No hay ningún proyecto en TrueRanker para este sitio. Completa la marca, el país y la frecuencia de tracking para empezar."],"Domain":["Dominio"],"Taken from this WordPress site and cannot be changed.":["Se toma de este sitio WordPress y no se puede cambiar."],"Enter your brand to monitor its appearances in AI-generated answers.":["Introduce tu marca para monitorizar sus apariciones en las respuestas generadas con IA."],"Country":["País"],"Choose the country where you want to measure visibility. Later, for each keyword, you can pick any location (even in another country).":["Introduce el país donde quieres medir la visibilidad. Luego, en cada palabra clave, podrás elegir la ubicación que quieras (incluso de otro país)."],"Tracking":["Tracking"],"Choose the tracking options you want to apply to your project.":["Elige el intervalo y la profundidad de rastreo de este proyecto."],"Tracking options":["Opciones de tracking"],"Create project":["Crear proyecto"],"No ranking history for this range.":["No hay historial de ranking para este rango."],"Google's top 10 for your keyword indexed URL":["Top 10 de Google para la URL indexada de tu keyword"],"(Show SERP)":["(Mostrar SERP)"],"No SERP data.":["No hay datos de SERP."],"Target URL":["URL objetivo"],"Cannibalization":["Canibalización"],"Volume:":["Volumen:"],"CPC:":["CPC:"],"Competition:":["Competencia:"],"Search trend":["Tendencia de búsqueda"],"Keyword tags":["Tags de la keyword"],"No tags.":["Sin tags."],"Could not load keyword history. Try again later.":["No se pudo cargar el historial de la keyword. Inténtalo más tarde."],"Keyword: %s":["Keyword: %s"],"Keyword:":["Keyword:"],"Loading keyword stats…":["Cargando estadísticas de la keyword…"],"Previous keyword":["Keyword anterior"],"Next keyword":["Keyword siguiente"],"All":["Todas"],"Favorites":["Favoritas"],"Tag match":["Coincidencia de tags"],"Include all tags":["Incluye todos los tags"],"Include one tag":["Incluye un tag"],"Does not have this tag":["No tiene este tag"],"Does not have one of those tags":["No tiene uno de esos tags"],"All locations":["Todas las localizaciones"],"More filters":["Más filtros"],"URL match":["Coincidencia de URL"],"URL contains":["URL contiene"],"URL not contains":["URL no contiene"],"Exact URL":["URL exacta"],"Exact URL different":["URL exacta es diferente"],"Word":["Palabra"],"Rank change":["Cambio de posición"],"Keywords up":["Keywords que suben"],"Keywords down":["Keywords que bajan"],"No changes":["Sin cambios"],"No. of words":["N.º de palabras"],"Cannibalizations":["Canibalizaciones"],"All cannibalizations":["Todas las canibalizaciones"],"No cannibalizations":["Sin canibalizaciones"],"Target URL is not ranking higher":["La URL objetivo no está por encima"],"Target URL is ranking higher":["La URL objetivo está por encima"],"Target URL is set":["URL objetivo definida"],"Target URL is not set":["URL objetivo no definida"],"All keywords":["Todas las keywords"],"No AI Overview keywords":["Sin keywords de AI Overview"],"AI Overview keywords":["Keywords de AI Overview"],"Mentions keywords":["Keywords con menciones"],"Citations keywords":["Keywords con citas"],"Clear filters":["Quitar filtros"],"Save as view":["Guardar como vista"],"Delete view":["Eliminar vista"],"Current share of voice":["Share of voice actual"],"Share of voice per LLM":["Share of voice por LLM"],"Share of voice over time":["Share of voice en el tiempo"],"Enter your API key.":["Introduce tu API key."],"Could not connect with this API key.":["No se pudo conectar con esta API key."],"Enter a valid email.":["Introduce un email válido."],"Check your inbox: we have sent you the API key. Paste it below to connect.":["Revisa tu correo: te hemos enviado la API key. Pégala abajo para conectar."],"Could not send the API key. Please try again.":["No se pudo enviar la API key. Inténtalo de nuevo."],"TrueRanker helps you track keyword rankings, monitor backlinks and measure your AI visibility — all from WordPress.":["TrueRanker te ayuda a seguir posiciones de keywords, monitorizar backlinks y medir tu visibilidad en IA — todo desde WordPress."],"How do you want to get started?":["¿Cómo quieres empezar?"],"Connect existing account":["Conectar cuenta existente"],"Start from scratch":["Empezar desde cero"],"Connect your account":["Conecta tu cuenta"],"Paste your TrueRanker API key to link this WordPress site with your account.":["Pega tu API key de TrueRanker para vincular este sitio WordPress con tu cuenta."],"Get API key in TrueRanker":["Obtener API key en TrueRanker"],"API Key":["API Key"],"Connect":["Conectar"],"Back":["Atrás"],"We have sent the API key to this email. The field can no longer be changed.":["Hemos enviado la API key a este email. El campo ya no se puede cambiar."],"Enter your email. TrueRanker will send you an API key to connect this site. The key is not shown here: it arrives by email only.":["Introduce tu email. TrueRanker te enviará una API key para conectar este sitio. La clave no aparece aquí: llega solo al correo."],"Email":["Email"],"Send API key":["Enviar API key"],"When you receive the email, paste the API key here to connect.":["Cuando recibas el correo, pega la API key aquí para conectar."],"models mention":["modelos mencionan"]}}}
  • seo-local-rank/trunk/languages/seo-local-rank-es_ES.po

    r3706047 r3720851  
    3030#. Description of the plugin
    3131#: seolocalrank.php
    32 msgid "Track Google rankings, AI visibility and backlinks from WordPress. Connect TrueRanker and manage SEO in the admin."
    33 msgstr "Monitoriza rankings de Google, visibilidad IA y backlinks desde WordPress. Conecta TrueRanker y gestiona el SEO en el admin."
     32msgid "AI Visibility Tracker (brand radar) for ChatGPT and more, plus Google rankings and backlinks from WordPress."
     33msgstr "AI Visibility Tracker (brand radar) para ChatGPT y más, más rankings de Google y backlinks desde WordPress."
    3434
    3535#. Author URI of the plugin
    … …  
    6565#: src/Admin/Menu.php:51
    6666#: src/Admin/Menu.php:52
    67 #: assets/src/app/components/dashboard/KpiGrid.js:138
     67#: assets/src/app/components/dashboard/KpiGrid.js:139
    6868#: assets/src/app/components/dashboard/RankTrackerSection.js:116
    6969msgid "Rank Tracker"
    … …  
    7272#: src/Admin/Menu.php:60
    7373#: src/Admin/Menu.php:61
     74#: assets/src/app/components/dashboard/AiVisibilitySection.js:100
     75#: assets/src/app/components/dashboard/KpiGrid.js:180
     76msgid "AI Visibility"
     77msgstr "Visibilidad IA"
     78
     79#: src/Admin/Menu.php:69
     80#: src/Admin/Menu.php:70
    7481msgid "Settings"
    7582msgstr "Ajustes"
    … …  
    95102msgstr "Error de la API de TrueRanker."
    96103
    97 #: src/Rest/Controllers/DomainsController.php:205
     104#: src/Rest/Controllers/DomainsController.php:259
    98105msgid "Select a project for this site before loading the dashboard."
    99106msgstr "Selecciona un proyecto para este sitio antes de cargar el dashboard."
    100107
    101 #: src/Rest/Controllers/DomainsController.php:230
    102 #: src/Rest/Controllers/DomainsController.php:303
    103 #: src/Rest/Controllers/DomainsController.php:389
    104 #: src/Rest/Controllers/DomainsController.php:609
     108#: src/Rest/Controllers/DomainsController.php:284
     109#: src/Rest/Controllers/DomainsController.php:357
     110#: src/Rest/Controllers/DomainsController.php:443
     111#: src/Rest/Controllers/DomainsController.php:514
     112#: src/Rest/Controllers/DomainsController.php:601
     113#: src/Rest/Controllers/DomainsController.php:840
    105114#: src/Rest/Controllers/KeywordsController.php:251
    106115#: src/Rest/Controllers/KeywordsController.php:355
    … …  
    108117msgstr "El proyecto seleccionado no está disponible para este sitio."
    109118
    110 #: src/Rest/Controllers/DomainsController.php:278
    111 #: src/Rest/Controllers/DomainsController.php:354
     119#: src/Rest/Controllers/DomainsController.php:332
     120#: src/Rest/Controllers/DomainsController.php:408
    112121msgid "Select a project for this site before loading the rank tracker."
    113122msgstr "Selecciona un proyecto para este sitio antes de cargar el Rank Tracker."
    114123
    115 #: src/Rest/Controllers/DomainsController.php:364
     124#: src/Rest/Controllers/DomainsController.php:418
    116125#: src/Rest/Controllers/KeywordsController.php:231
    117126msgid "A valid start and end date is required."
    118127msgstr "Se requiere una fecha de inicio y de fin válida."
    119128
    120 #: src/Rest/Controllers/DomainsController.php:491
     129#: src/Rest/Controllers/DomainsController.php:489
     130#: src/Rest/Controllers/DomainsController.php:576
     131msgid "Select a project for this site before loading AI Visibility."
     132msgstr "Selecciona un proyecto para este sitio antes de cargar Visibilidad IA."
     133
     134#: src/Rest/Controllers/DomainsController.php:722
    121135msgid "A brand name is required."
    122136msgstr "El nombre de la marca es obligatorio."
    123137
    124 #: src/Rest/Controllers/DomainsController.php:501
     138#: src/Rest/Controllers/DomainsController.php:732
    125139msgid "Select a country."
    126140msgstr "Selecciona un país."
    127141
    128 #: src/Rest/Controllers/DomainsController.php:511
     142#: src/Rest/Controllers/DomainsController.php:742
    129143msgid "Invalid tracking option."
    130144msgstr "Opción de tracking no válida."
    131145
    132 #: src/Rest/Controllers/DomainsController.php:548
     146#: src/Rest/Controllers/DomainsController.php:779
    133147msgid "The project was created but no domain ID was returned."
    134148msgstr "El proyecto se creó pero no se devolvió ningún ID de dominio."
    135149
    136 #: src/Rest/Controllers/DomainsController.php:584
     150#: src/Rest/Controllers/DomainsController.php:815
    137151msgid "Invalid domain ID."
    138152msgstr "ID de dominio no válido."
    … …  
    203217msgstr "No tienes permiso para gestionar TrueRanker."
    204218
    205 #: assets/src/app/components/dashboard/AiVisibilitySection.js:30
    206 msgid "Score"
    207 msgstr "Score"
    208 
     219#: assets/src/app/components/ai-visibility/AiVisibilitySkeleton.js:8
     220msgid "Loading AI Visibility"
     221msgstr "Cargando Visibilidad IA"
     222
     223#: assets/src/app/components/ai-visibility/ChangesList.js:32
     224msgid "Traction"
     225msgstr "Tracción"
     226
     227#: assets/src/app/components/ai-visibility/ChangesList.js:34
     228msgid "Alert"
     229msgstr "Alerta"
     230
     231#: assets/src/app/components/ai-visibility/ChangesList.js:36
     232#: assets/src/app/components/rank-tracker/tableColumns.js:228
     233msgid "Competition"
     234msgstr "Competencia"
     235
     236#: assets/src/app/components/ai-visibility/ChangesList.js:38
     237msgid "Milestone"
     238msgstr "Hito"
     239
     240#: assets/src/app/components/ai-visibility/ChangesList.js:53
     241msgid "No significant milestones detected in this period."
     242msgstr "No se han detectado hitos relevantes en este periodo."
     243
     244#: assets/src/app/components/ai-visibility/CollectingOverlay.js:16
     245#: assets/src/app/components/dashboard/ChartPanel.js:45
     246#: assets/src/app/components/dashboard/KpiGrid.js:43
     247msgid "Collecting data"
     248msgstr "Recopilando datos"
     249
     250#: assets/src/app/components/ai-visibility/CompetitorsCard.js:75
     251msgid "Competitors"
     252msgstr "Competidores"
     253
     254#. translators: 1: current competitors, 2: plan limit
     255#: assets/src/app/components/ai-visibility/CompetitorsCard.js:81
     256#, js-format
     257msgid "%1$d of %2$d"
     258msgstr "%1$d de %2$d"
     259
     260#: assets/src/app/components/ai-visibility/CompetitorsCard.js:93
     261msgid "Add competitor"
     262msgstr "Añadir competidor"
     263
     264#: assets/src/app/components/ai-visibility/CompetitorsCard.js:107
     265#: assets/src/app/components/ai-visibility/ShareOfVoice.js:49
     266msgid "Add first competitor"
     267msgstr "Añadir el primer competidor"
     268
     269#: assets/src/app/components/ai-visibility/CompetitorsCard.js:115
     270msgid "Website"
     271msgstr "Sitio web"
     272
     273#: assets/src/app/components/ai-visibility/CompetitorsCard.js:116
     274#: assets/src/app/pages/AiVisibilityPage.js:243
     275#: assets/src/app/utils/dashboardFormat.js:138
     276msgid "Share of voice"
     277msgstr "Share of voice"
     278
     279#: assets/src/app/components/ai-visibility/EmptyPrompts.js:30
     280msgid "No prompts in this project"
     281msgstr "No hay prompts en este proyecto"
     282
     283#: assets/src/app/components/ai-visibility/EmptyPrompts.js:32
     284msgid "Add prompts to start measuring how AI models mention and cite your brand."
     285msgstr "Añade prompts para medir cómo los modelos de IA mencionan y citan tu marca."
     286
     287#: assets/src/app/components/ai-visibility/EmptyPrompts.js:44
     288msgid "Track AI mentions"
     289msgstr "Monitoriza menciones IA"
     290
     291#: assets/src/app/components/ai-visibility/EmptyPrompts.js:46
     292msgid "See when ChatGPT, Claude, Gemini and others mention your brand."
     293msgstr "Comprueba cuándo ChatGPT, Claude, Gemini y otros mencionan tu marca."
     294
     295#: assets/src/app/components/ai-visibility/EmptyPrompts.js:58
     296msgid "Compare models"
     297msgstr "Compara modelos"
     298
     299#: assets/src/app/components/ai-visibility/EmptyPrompts.js:60
     300msgid "Check mention and citation status for each LLM."
     301msgstr "Revisa menciones y citas en cada LLM."
     302
     303#: assets/src/app/components/ai-visibility/EmptyPrompts.js:72
     304msgid "Beat competitors"
     305msgstr "Supera a tus competidores"
     306
     307#: assets/src/app/components/ai-visibility/EmptyPrompts.js:74
     308msgid "Measure share of voice against the sites AI recommends."
     309msgstr "Mide el share of voice frente a los sitios que recomienda la IA."
     310
     311#: assets/src/app/components/ai-visibility/EmptyPrompts.js:90
     312#: assets/src/app/pages/AiVisibilityPage.js:219
     313msgid "Add prompts"
     314msgstr "Añadir prompts"
     315
     316#: assets/src/app/components/ai-visibility/EmptyPrompts.js:94
     317msgid "First results usually appear after the next scan."
     318msgstr "Los primeros resultados suelen aparecer tras el siguiente análisis."
     319
     320#: assets/src/app/components/ai-visibility/LlmCoverage.js:12
     321#: assets/src/app/utils/dashboardFormat.js:139
     322msgid "LLM coverage"
     323msgstr "Cobertura LLM"
     324
     325#: assets/src/app/components/ai-visibility/LlmCoverage.js:18
     326msgid "models mention"
     327msgstr "modelos mencionan"
     328
     329#. translators: 1: arrow 2: signed change
     330#: assets/src/app/components/ai-visibility/MentionsCitations.js:20
     331#, js-format
     332msgid "%1$s %2$s vs prev"
     333msgstr "%1$s %2$s vs ant."
     334
     335#: assets/src/app/components/ai-visibility/MentionsCitations.js:38
     336#: assets/src/app/components/ai-visibility/PromptsTable.js:51
     337#: assets/src/app/components/ai-visibility/ScoreTrend.js:26
    209338#: assets/src/app/components/dashboard/AiVisibilitySection.js:40
    210339#: assets/src/app/components/dashboard/KpiGrid.js:201
    … …  
    212341msgstr "Menciones"
    213342
     343#: assets/src/app/components/ai-visibility/MentionsCitations.js:45
     344#: assets/src/app/components/ai-visibility/PromptsTable.js:52
     345#: assets/src/app/components/ai-visibility/ScoreTrend.js:36
    214346#: assets/src/app/components/dashboard/AiVisibilitySection.js:49
    215347#: assets/src/app/components/dashboard/KpiGrid.js:208
    … …  
    217349msgstr "Citas"
    218350
    219 #. translators: %d: visibility score points gained
    220 #: assets/src/app/components/dashboard/AiVisibilitySection.js:85
    221 #, js-format
    222 msgid "+%d pts"
    223 msgstr "+%d pts"
    224 
    225 #. translators: %d: visibility score points lost
    226 #: assets/src/app/components/dashboard/AiVisibilitySection.js:91
    227 #, js-format
    228 msgid "-%d pts"
    229 msgstr "-%d pts"
    230 
    231 #: assets/src/app/components/dashboard/AiVisibilitySection.js:100
    232 #: assets/src/app/components/dashboard/KpiGrid.js:179
    233 msgid "AI Visibility"
    234 msgstr "Visibilidad IA"
    235 
    236 #: assets/src/app/components/dashboard/AiVisibilitySection.js:105
    237 msgid "Score trend"
    238 msgstr "Evolución del score"
    239 
    240 #: assets/src/app/components/dashboard/AiVisibilitySection.js:107
    241 msgid "Add prompts to see AI visibility trends."
    242 msgstr "Añade prompts para ver la evolución de la visibilidad IA."
    243 
    244 #: assets/src/app/components/dashboard/AiVisibilitySection.js:108
    245 #: assets/src/app/components/dashboard/KpiGrid.js:182
    246 msgid "AI visibility data will appear after the first scan."
    247 msgstr "Los datos de visibilidad IA aparecerán tras el primer análisis."
    248 
    249 #: assets/src/app/components/dashboard/AiVisibilitySection.js:116
    250 #: assets/src/app/components/dashboard/KpiGrid.js:195
    251 msgid "AI visibility score"
    252 msgstr "Score de visibilidad IA"
    253 
    254 #: assets/src/app/components/dashboard/AiVisibilitySection.js:118
    255 msgid "Add prompts to see the visibility score."
    256 msgstr "Añade prompts para ver el score de visibilidad."
    257 
    258 #: assets/src/app/components/dashboard/AiVisibilitySection.js:119
    259 msgid "Score breakdown will appear after the first scan."
    260 msgstr "El desglose del score aparecerá tras el primer análisis."
    261 
    262 #: assets/src/app/components/dashboard/BacklinksSection.js:36
    263 #: assets/src/app/components/dashboard/BacklinksSection.js:121
    264 #: assets/src/app/components/dashboard/KpiGrid.js:225
    265 msgid "Backlinks"
    266 msgstr "Enlaces"
    267 
    268 #: assets/src/app/components/dashboard/BacklinksSection.js:42
    269 msgid "Pages"
    270 msgstr "Páginas"
    271 
    272 #: assets/src/app/components/dashboard/BacklinksSection.js:48
    273 #: assets/src/app/components/dashboard/KpiGrid.js:241
    274 msgid "Referring domains"
    275 msgstr "Dominios referentes"
    276 
    277 #: assets/src/app/components/dashboard/BacklinksSection.js:54
    278 msgid "Unique IPs"
    279 msgstr "IPs únicas"
    280 
    281 #: assets/src/app/components/dashboard/BacklinksSection.js:62
    282 msgid "Domain rank"
    283 msgstr "Domain rank"
    284 
    285 #: assets/src/app/components/dashboard/BacklinksSection.js:62
    286 msgid "Remaining"
    287 msgstr "Restantes"
    288 
    289 #: assets/src/app/components/dashboard/BacklinksSection.js:90
    290 msgid "Backlink metrics"
    291 msgstr "Métricas de backlinks"
    292 
    293 #: assets/src/app/components/dashboard/BacklinksSection.js:126
    294 msgid "Domain rank (DR)"
    295 msgstr "Domain rank (DR)"
    296 
    297 #: assets/src/app/components/dashboard/BacklinksSection.js:128
    298 #: assets/src/app/components/dashboard/BacklinksSection.js:144
    299 #: assets/src/app/components/dashboard/KpiGrid.js:227
    300 msgid "Backlink summary is being prepared."
    301 msgstr "El resumen de backlinks se está preparando."
    302 
    303 #: assets/src/app/components/dashboard/BacklinksSection.js:142
    304 msgid "Backlink trends"
    305 msgstr "Evolución de backlinks"
    306 
    307 #: assets/src/app/components/dashboard/ChartPanel.js:45
    308 #: assets/src/app/components/dashboard/KpiGrid.js:43
    309 msgid "Collecting data"
    310 msgstr "Recopilando datos"
    311 
    312 #: assets/src/app/components/dashboard/DashboardSkeleton.js:5
    313 msgid "Loading dashboard"
    314 msgstr "Cargando dashboard"
    315 
    316 #: assets/src/app/components/dashboard/KpiGrid.js:140
    317 msgid "Add keywords to start tracking rankings."
    318 msgstr "Añade keywords para empezar a monitorizar posiciones."
    319 
    320 #: assets/src/app/components/dashboard/KpiGrid.js:141
    321 #: assets/src/app/components/dashboard/RankTrackerSection.js:125
    322 msgid "Rank data will appear after the first update."
    323 msgstr "Los datos de ranking aparecerán tras la primera actualización."
    324 
    325 #: assets/src/app/components/dashboard/KpiGrid.js:153
    326 #: assets/src/app/components/dashboard/RankTrackerSection.js:37
    327 msgid "Average position"
    328 msgstr "Posición media"
    329 
    330 #: assets/src/app/components/dashboard/KpiGrid.js:159
    331 #: assets/src/app/components/dashboard/RankTrackerSection.js:46
    332 msgid "Organic visibility"
    333 msgstr "Visibilidad orgánica"
    334 
    335 #: assets/src/app/components/dashboard/KpiGrid.js:170
    336 msgid "Keywords"
    337 msgstr "Keywords"
    338 
    339 #: assets/src/app/components/dashboard/KpiGrid.js:181
    340 msgid "Add prompts to measure AI visibility."
    341 msgstr "Añade prompts para medir la visibilidad IA."
    342 
    343 #: assets/src/app/components/dashboard/KpiGrid.js:215
    344 msgid "Prompts"
    345 msgstr "Prompts"
    346 
    347 #: assets/src/app/components/dashboard/KpiGrid.js:246
    348 msgid "Tracked backlinks"
    349 msgstr "Backlinks monitorizados"
    350 
    351 #: assets/src/app/components/dashboard/KpiGrid.js:251
    352 msgid "with issues"
    353 msgstr "con incidencias"
    354 
    355 #: assets/src/app/components/dashboard/KpiGrid.js:262
    356 msgid "SEO Audits"
    357 msgstr "Auditorías SEO"
    358 
    359 #: assets/src/app/components/dashboard/KpiGrid.js:264
    360 msgid "No audits yet for this project."
    361 msgstr "Aún no hay auditorías para este proyecto."
    362 
    363 #: assets/src/app/components/dashboard/KpiGrid.js:275
    364 msgid "Average score"
    365 msgstr "Score medio"
    366 
    367 #: assets/src/app/components/dashboard/KpiGrid.js:280
    368 msgid "URLs audited"
    369 msgstr "URLs auditadas"
    370 
    371 #: assets/src/app/components/dashboard/KpiGrid.js:288
    372 msgid "Visibility index"
    373 msgstr "Índice de visibilidad"
    374 
    375 #: assets/src/app/components/dashboard/KpiGrid.js:290
    376 msgid "Visibility index data is not available yet."
    377 msgstr "Los datos del índice de visibilidad aún no están disponibles."
    378 
    379 #: assets/src/app/components/dashboard/KpiGrid.js:302
    380 msgid "Mobile visibility"
    381 msgstr "Visibilidad móvil"
    382 
    383 #. translators: %d: number of paused keywords
    384 #: assets/src/app/components/dashboard/ProjectToolbar.js:68
    385 #, js-format
    386 msgid "%d paused"
    387 msgid_plural "%d paused"
    388 msgstr[0] "%d pausada"
    389 msgstr[1] "%d pausadas"
    390 
    391 #. translators: %d: percent of keywords updated
    392 #: assets/src/app/components/dashboard/ProjectToolbar.js:74
    393 #, js-format
    394 msgid "%d%% updated"
    395 msgstr "%d%% actualizado"
    396 
    397 #. translators: %d: number of keywords
    398 #: assets/src/app/components/dashboard/ProjectToolbar.js:92
    399 #, js-format
    400 msgid "%d Keyword"
    401 msgid_plural "%d Keywords"
    402 msgstr[0] "%d Keyword"
    403 msgstr[1] "%d Keywords"
    404 
    405 #: assets/src/app/components/dashboard/ProjectToolbar.js:234
    406 msgid "Search project…"
    407 msgstr "Buscar proyecto…"
    408 
    409 #: assets/src/app/components/dashboard/ProjectToolbar.js:266
    410 msgid "No projects found."
    411 msgstr "No se encontraron proyectos."
    412 
    413 #: assets/src/app/components/dashboard/ProjectToolbar.js:283
    414 msgid "Upgrade"
    415 msgstr "Upgrade"
    416 
    417 #: assets/src/app/components/dashboard/RankTrackerSection.js:121
    418 msgid "Evolution"
    419 msgstr "Evolución"
    420 
    421 #: assets/src/app/components/dashboard/RankTrackerSection.js:122
    422 msgid "Positioning and organic visibility over the last 30 days."
    423 msgstr "Posicionamiento y visibilidad orgánica de los últimos 30 días."
    424 
    425 #: assets/src/app/components/dashboard/RankTrackerSection.js:124
    426 msgid "Add keywords to see rank evolution."
    427 msgstr "Añade keywords para ver la evolución del ranking."
    428 
    429 #: assets/src/app/components/dashboard/RankTrackerSection.js:133
    430 #: assets/src/app/components/rank-tracker/DistributionPanel.js:101
    431 #: assets/src/app/components/rank-tracker/SummaryPanels.js:33
    432 #: assets/src/app/components/rank-tracker/SummaryPanels.js:74
    433 msgid "Keywords distribution"
    434 msgstr "Distribución de keywords"
    435 
    436 #: assets/src/app/components/dashboard/RankTrackerSection.js:135
    437 msgid "No distribution data yet."
    438 msgstr "Aún no hay datos de distribución."
    439 
    440 #: assets/src/app/components/dashboard/RankTrackerSection.js:136
    441 msgid "Distribution will appear after the first update."
    442 msgstr "La distribución aparecerá tras la primera actualización."
    443 
    444 #. translators: 1: project name, 2: hostname, 3: keyword count
    445 #: assets/src/app/components/ProjectSelectModal.js:30
    446 #, js-format
    447 msgid "%1$s (%2$s) — %3$d keyword"
    448 msgid_plural "%1$s (%2$s) — %3$d keywords"
    449 msgstr[0] "%1$s (%2$s) — %3$d keyword"
    450 msgstr[1] "%1$s (%2$s) — %3$d keywords"
    451 
    452 #: assets/src/app/components/ProjectSelectModal.js:59
    453 msgid "Could not save the selection."
    454 msgstr "No se pudo guardar la selección."
    455 
    456 #: assets/src/app/components/ProjectSelectModal.js:67
    457 msgid "Choose a project"
    458 msgstr "Elige un proyecto"
    459 
    460 #: assets/src/app/components/ProjectSelectModal.js:74
    461 msgid "There are several projects for this domain. Choose which one to use in WordPress."
    462 msgstr "Hay varios proyectos para este dominio. Elige cuál quieres usar en WordPress."
    463 
    464 #: assets/src/app/components/ProjectSelectModal.js:80
    465 msgid "You can change it at any time from Settings."
    466 msgstr "Puedes cambiarlo en cualquier momento desde Ajustes."
    467 
    468 #: assets/src/app/components/ProjectSelectModal.js:103
    469 msgid "Use this project"
    470 msgstr "Usar este proyecto"
    471 
    472 #: assets/src/app/components/rank-tracker/AddKeywordsModal.js:315
    473 msgid "Could not add keywords. Try again later."
    474 msgstr "No se pudieron añadir las keywords. Inténtalo más tarde."
    475 
    476 #: assets/src/app/components/rank-tracker/AddKeywordsModal.js:325
    477 #: assets/src/app/components/rank-tracker/AddKeywordsModal.js:355
    478 #: assets/src/app/components/rank-tracker/AddKeywordsModal.js:375
    479 #: assets/src/app/pages/RankTrackerPage.js:272
    480 msgid "Add keywords"
    481 msgstr "Añadir Keywords"
    482 
    483 #: assets/src/app/components/rank-tracker/AddKeywordsModal.js:334
    484 msgid "Go to plans"
    485 msgstr "Ir a planes"
    486 
    487 #: assets/src/app/components/rank-tracker/AddKeywordsModal.js:335
    488 msgid "Cancel"
    489 msgstr "Cancelar"
    490 
    491 #: assets/src/app/components/rank-tracker/AddKeywordsModal.js:338
    492 msgid "Keyword limit reached"
    493 msgstr "Has alcanzado el límite de keywords"
    494 
    495 #: assets/src/app/components/rank-tracker/AddKeywordsModal.js:341
    496 msgid "You should consider upgrade your plan to add more keywords."
    497 msgstr "Deberías plantearte mejorar tu plan para añadir más keywords."
    498 
    499 #: assets/src/app/components/rank-tracker/AddKeywordsModal.js:360
    500 msgid "keywords left"
    501 msgstr "palabras clave"
    502 
    503 #. translators: %s: project hostname
    504 #: assets/src/app/components/rank-tracker/AddKeywordsModal.js:372
    505 #, js-format
    506 msgid "Add keywords to %s"
    507 msgstr "Añadir keywords a %s"
    508 
    509 #: assets/src/app/components/rank-tracker/AddKeywordsModal.js:378
    510 msgid "One keyword per line"
    511 msgstr "Una keyword por línea"
    512 
    513 #: assets/src/app/components/rank-tracker/AddKeywordsModal.js:382
    514 msgid "Number of keywords is above the available keywords."
    515 msgstr "El número de keywords supera las keywords disponibles."
    516 
    517 #: assets/src/app/components/rank-tracker/AddKeywordsModal.js:416
    518 msgid "Where do you want to track your keywords?"
    519 msgstr "¿Dónde quieres monitorizar tus keywords?"
    520 
    521 #: assets/src/app/components/rank-tracker/AddKeywordsModal.js:419
    522 msgid "Countries, provinces, cities…"
    523 msgstr "Países, provincias, ciudades…"
    524 
    525 #: assets/src/app/components/rank-tracker/AddKeywordsModal.js:426
    526 msgid "Write a country, province or city"
    527 msgstr "Escribe un país, provincia o ciudad"
    528 
    529 #: assets/src/app/components/rank-tracker/AddKeywordsModal.js:442
    530 msgid "No locations found."
    531 msgstr "No se encontraron localizaciones."
    532 
    533 #: assets/src/app/components/rank-tracker/AddKeywordsModal.js:489
    534 msgid "Remove location"
    535 msgstr "Quitar localización"
    536 
    537 #: assets/src/app/components/rank-tracker/AddKeywordsModal.js:503
    538 msgid "On what type of device do you want to track the results?"
    539 msgstr "¿En qué tipo de dispositivo quieres monitorizar los resultados?"
    540 
    541 #: assets/src/app/components/rank-tracker/AddKeywordsModal.js:506
    542 msgid "When selecting two devices, the number of used keywords doubles"
    543 msgstr "Al seleccionar dos dispositivos, el número de keywords usadas se duplica"
    544 
    545 #: assets/src/app/components/rank-tracker/AddKeywordsModal.js:508
    546 #: assets/src/app/components/rank-tracker/FiltersBar.js:32
    547 #: assets/src/app/components/rank-tracker/tableColumns.js:82
    548 msgid "Device"
    549 msgstr "Dispositivo"
    550 
    551 #: assets/src/app/components/rank-tracker/AddKeywordsModal.js:515
    552 #: assets/src/app/components/rank-tracker/cellFormatters.js:324
    553 #: assets/src/app/components/rank-tracker/FiltersBar.js:40
    554 #: assets/src/app/components/rank-tracker/KeywordStatsModal.js:414
    555 msgid "Desktop"
    556 msgstr "Desktop"
    557 
    558 #: assets/src/app/components/rank-tracker/AddKeywordsModal.js:523
    559 #: assets/src/app/components/rank-tracker/cellFormatters.js:324
    560 #: assets/src/app/components/rank-tracker/FiltersBar.js:48
    561 #: assets/src/app/components/rank-tracker/KeywordStatsModal.js:414
    562 msgid "Mobile"
    563 msgstr "Móvil"
    564 
    565 #: assets/src/app/components/rank-tracker/AddKeywordsModal.js:530
    566 msgid "Both"
    567 msgstr "Ambos"
    568 
    569 #: assets/src/app/components/rank-tracker/AddKeywordsModal.js:544
    570 msgid "Add keywords to your project"
    571 msgstr "Añade keywords a tu proyecto"
    572 
    573 #: assets/src/app/components/rank-tracker/AddKeywordsModal.js:549
    574 msgid "You can add multiple words and multiple locations, creating combinations between all of them."
    575 msgstr "Puedes añadir varias palabras y varias localizaciones, creando combinaciones entre todas ellas."
    576 
    577 #: assets/src/app/components/rank-tracker/AioPanel.js:19
    578 #: assets/src/app/components/rank-tracker/SummaryPanels.js:53
    579 #: assets/src/app/components/rank-tracker/SummaryPanels.js:78
    580 msgid "AI Overview Presence"
    581 msgstr "Presencia en AI Overview"
    582 
    583 #. translators: 1: number of keywords with AI Overview, 2: total keywords
    584 #: assets/src/app/components/rank-tracker/AioPanel.js:27
    585 #, js-format
    586 msgid "%1$s of %2$s keywords"
    587 msgstr "%1$s de %2$s keywords"
    588 
    589 #. translators: 1: mention count, 2: total keywords
    590 #: assets/src/app/components/rank-tracker/AioPanel.js:43
    591 #, js-format
    592 msgid "%1$s mentions of %2$s keywords"
    593 msgstr "%1$s menciones de %2$s keywords"
    594 
    595 #. translators: 1: citation count, 2: total keywords
    596 #: assets/src/app/components/rank-tracker/AioPanel.js:53
    597 #, js-format
    598 msgid "%1$s citations of %2$s keywords"
    599 msgstr "%1$s citas de %2$s keywords"
    600 
    601 #: assets/src/app/components/rank-tracker/AvgPanel.js:51
    602 #: assets/src/app/components/rank-tracker/SummaryPanels.js:27
    603 #: assets/src/app/components/rank-tracker/SummaryPanels.js:70
    604 msgid "AVG position"
    605 msgstr "Posición media"
    606 
    607 #. translators: %s: ranking position threshold
    608 #: assets/src/app/components/rank-tracker/cellFormatters.js:103
    609 #: assets/src/app/components/rank-tracker/cellFormatters.js:114
    610 #, js-format
    611 msgid "%s+"
    612 msgstr "%s+"
    613 
    614 #: assets/src/app/components/rank-tracker/cellFormatters.js:128
    615 msgid "Buy plan"
    616 msgstr "Upgrade"
    617 
    618 #: assets/src/app/components/rank-tracker/cellFormatters.js:202
    619 msgid "People Also Ask"
    620 msgstr "People Also Ask"
    621 
    622 #: assets/src/app/components/rank-tracker/cellFormatters.js:203
    623 msgid "Videos"
    624 msgstr "Vídeos"
    625 
    626 #: assets/src/app/components/rank-tracker/cellFormatters.js:204
    627 msgid "Images"
    628 msgstr "Imágenes"
    629 
    630 #: assets/src/app/components/rank-tracker/cellFormatters.js:205
    631 #: assets/src/app/components/rank-tracker/tableColumns.js:276
    632 msgid "Local Pack"
    633 msgstr "Local Pack"
    634 
    635 #: assets/src/app/components/rank-tracker/cellFormatters.js:206
    636 msgid "Knowledge Panel"
    637 msgstr "Knowledge Panel"
    638 
    639 #: assets/src/app/components/rank-tracker/cellFormatters.js:207
    640 msgid "Placed Sites"
    641 msgstr "Sitios destacados"
    642 
    643 #: assets/src/app/components/rank-tracker/cellFormatters.js:208
    644 msgid "Forums & Discussions"
    645 msgstr "Foros y discusiones"
    646 
    647 #: assets/src/app/components/rank-tracker/cellFormatters.js:209
    648 msgid "Product Grid"
    649 msgstr "Product Grid"
    650 
    651 #: assets/src/app/components/rank-tracker/cellFormatters.js:215
    652 msgid "Now"
    653 msgstr "Ahora"
    654 
    655 #. translators: %d: number of hours
    656 #: assets/src/app/components/rank-tracker/cellFormatters.js:220
    657 #, js-format
    658 msgid "%d hour ago"
    659 msgid_plural "%d hours ago"
    660 msgstr[0] "hace %d hora"
    661 msgstr[1] "hace %d horas"
    662 
     351#: assets/src/app/components/ai-visibility/PromptsTable.js:42
    663352#: assets/src/app/components/rank-tracker/cellFormatters.js:235
    664353#: assets/src/app/components/rank-tracker/cellFormatters.js:385
    … …  
    670359msgstr "Pendiente"
    671360
     361#: assets/src/app/components/ai-visibility/PromptsTable.js:68
     362msgid "Positive"
     363msgstr "Positivo"
     364
     365#: assets/src/app/components/ai-visibility/PromptsTable.js:69
     366msgid "Neutral"
     367msgstr "Neutral"
     368
     369#: assets/src/app/components/ai-visibility/PromptsTable.js:70
     370msgid "Negative"
     371msgstr "Negativo"
     372
     373#: assets/src/app/components/ai-visibility/PromptsTable.js:99
     374#: assets/src/app/components/ai-visibility/PromptsTable.js:100
     375#: assets/src/app/components/rank-tracker/KeywordsTable.js:95
     376#: assets/src/app/components/rank-tracker/KeywordsTable.js:96
     377msgid "First"
     378msgstr "Primera"
     379
     380#: assets/src/app/components/ai-visibility/PromptsTable.js:101
     381#: assets/src/app/components/ai-visibility/PromptsTable.js:102
     382#: assets/src/app/components/rank-tracker/KeywordsTable.js:97
     383#: assets/src/app/components/rank-tracker/KeywordsTable.js:98
     384msgid "Last"
     385msgstr "Última"
     386
     387#: assets/src/app/components/ai-visibility/PromptsTable.js:103
     388#: assets/src/app/components/ai-visibility/PromptsTable.js:104
     389#: assets/src/app/components/rank-tracker/KeywordsTable.js:99
     390#: assets/src/app/components/rank-tracker/KeywordsTable.js:100
     391msgid "Prev"
     392msgstr "Anterior"
     393
     394#: assets/src/app/components/ai-visibility/PromptsTable.js:105
     395#: assets/src/app/components/ai-visibility/PromptsTable.js:106
     396#: assets/src/app/components/rank-tracker/KeywordsTable.js:101
     397#: assets/src/app/components/rank-tracker/KeywordsTable.js:102
     398msgid "Next"
     399msgstr "Siguiente"
     400
     401#: assets/src/app/components/ai-visibility/PromptsTable.js:107
     402#: assets/src/app/components/rank-tracker/KeywordsTable.js:103
     403msgid "Show"
     404msgstr "Mostrar"
     405
     406#: assets/src/app/components/ai-visibility/PromptsTable.js:158
     407msgid "Prompt"
     408msgstr "Prompt"
     409
     410#: assets/src/app/components/ai-visibility/PromptsTable.js:166
     411#: assets/src/app/components/rank-tracker/FiltersBar.js:90
     412#: assets/src/app/components/rank-tracker/tableColumns.js:73
     413msgid "Location"
     414msgstr "Localización"
     415
     416#: assets/src/app/components/ai-visibility/PromptsTable.js:185
     417msgid "Sentiment"
     418msgstr "Sentimiento"
     419
     420#: assets/src/app/components/ai-visibility/PromptsTable.js:195
     421msgid "Trend"
     422msgstr "Tendencia"
     423
     424#: assets/src/app/components/ai-visibility/PromptsTable.js:260
     425#: assets/src/app/components/ai-visibility/PromptsTable.js:312
     426#: assets/src/app/components/ai-visibility/ShareOfVoice.js:137
     427#: assets/src/app/components/rank-tracker/KeywordsTable.js:32
     428#: assets/src/app/components/rank-tracker/KeywordsTable.js:184
     429msgid "Loading…"
     430msgstr "Cargando…"
     431
     432#: assets/src/app/components/ai-visibility/PromptsTable.js:261
     433#: assets/src/app/components/ai-visibility/PromptsTable.js:313
     434msgid "No prompts in this range."
     435msgstr "No hay prompts en este rango."
     436
     437#: assets/src/app/components/ai-visibility/PromptsTable.js:336
     438msgid "Search prompt…"
     439msgstr "Buscar prompt…"
     440
     441#: assets/src/app/components/ai-visibility/ScoreCard.js:15
     442msgid "AI Visibility Score"
     443msgstr "AI Visibility Score"
     444
     445#. translators: 1: arrow, 2: signed delta, 3: unit
     446#: assets/src/app/components/ai-visibility/ScoreCard.js:22
     447#, js-format
     448msgid "%1$s %2$s pts"
     449msgstr "%1$s %2$s pts"
     450
     451#: assets/src/app/components/ai-visibility/ScoreTrend.js:15
     452#: assets/src/app/components/dashboard/AiVisibilitySection.js:30
     453msgid "Score"
     454msgstr "Score"
     455
     456#: assets/src/app/components/ai-visibility/ScoreTrend.js:71
     457#: assets/src/app/components/dashboard/AiVisibilitySection.js:105
     458msgid "Score trend"
     459msgstr "Evolución del score"
     460
     461#: assets/src/app/components/ai-visibility/ShareOfVoice.js:148
     462msgid "Current share of voice"
     463msgstr "Share of voice actual"
     464
     465#: assets/src/app/components/ai-visibility/ShareOfVoice.js:154
     466msgid "Share of voice per LLM"
     467msgstr "Share of voice por LLM"
     468
     469#: assets/src/app/components/ai-visibility/ShareOfVoice.js:161
     470msgid "Share of voice over time"
     471msgstr "Share of voice en el tiempo"
     472
     473#. translators: %d: visibility score points gained
     474#: assets/src/app/components/dashboard/AiVisibilitySection.js:85
     475#, js-format
     476msgid "+%d pts"
     477msgstr "+%d pts"
     478
     479#. translators: %d: visibility score points lost
     480#: assets/src/app/components/dashboard/AiVisibilitySection.js:91
     481#, js-format
     482msgid "-%d pts"
     483msgstr "-%d pts"
     484
     485#: assets/src/app/components/dashboard/AiVisibilitySection.js:107
     486msgid "Add prompts to see AI visibility trends."
     487msgstr "Añade prompts para ver la evolución de la visibilidad IA."
     488
     489#: assets/src/app/components/dashboard/AiVisibilitySection.js:108
     490#: assets/src/app/components/dashboard/KpiGrid.js:183
     491msgid "AI visibility data will appear after the first scan."
     492msgstr "Los datos de visibilidad IA aparecerán tras el primer análisis."
     493
     494#: assets/src/app/components/dashboard/AiVisibilitySection.js:116
     495#: assets/src/app/components/dashboard/KpiGrid.js:195
     496msgid "AI visibility score"
     497msgstr "Score de visibilidad IA"
     498
     499#: assets/src/app/components/dashboard/AiVisibilitySection.js:118
     500msgid "Add prompts to see the visibility score."
     501msgstr "Añade prompts para ver el score de visibilidad."
     502
     503#: assets/src/app/components/dashboard/AiVisibilitySection.js:119
     504msgid "Score breakdown will appear after the first scan."
     505msgstr "El desglose del score aparecerá tras el primer análisis."
     506
     507#: assets/src/app/components/dashboard/BacklinksSection.js:36
     508#: assets/src/app/components/dashboard/BacklinksSection.js:121
     509#: assets/src/app/components/dashboard/KpiGrid.js:225
     510msgid "Backlinks"
     511msgstr "Enlaces"
     512
     513#: assets/src/app/components/dashboard/BacklinksSection.js:42
     514msgid "Pages"
     515msgstr "Páginas"
     516
     517#: assets/src/app/components/dashboard/BacklinksSection.js:48
     518#: assets/src/app/components/dashboard/KpiGrid.js:241
     519msgid "Referring domains"
     520msgstr "Dominios referentes"
     521
     522#: assets/src/app/components/dashboard/BacklinksSection.js:54
     523msgid "Unique IPs"
     524msgstr "IPs únicas"
     525
     526#: assets/src/app/components/dashboard/BacklinksSection.js:62
     527msgid "Domain rank"
     528msgstr "Domain rank"
     529
     530#: assets/src/app/components/dashboard/BacklinksSection.js:62
     531msgid "Remaining"
     532msgstr "Restantes"
     533
     534#: assets/src/app/components/dashboard/BacklinksSection.js:90
     535msgid "Backlink metrics"
     536msgstr "Métricas de backlinks"
     537
     538#: assets/src/app/components/dashboard/BacklinksSection.js:126
     539msgid "Domain rank (DR)"
     540msgstr "Domain rank (DR)"
     541
     542#: assets/src/app/components/dashboard/BacklinksSection.js:128
     543#: assets/src/app/components/dashboard/BacklinksSection.js:144
     544#: assets/src/app/components/dashboard/KpiGrid.js:227
     545msgid "Backlink summary is being prepared."
     546msgstr "El resumen de backlinks se está preparando."
     547
     548#: assets/src/app/components/dashboard/BacklinksSection.js:142
     549msgid "Backlink trends"
     550msgstr "Evolución de backlinks"
     551
     552#: assets/src/app/components/dashboard/DashboardSkeleton.js:5
     553msgid "Loading dashboard"
     554msgstr "Cargando dashboard"
     555
     556#: assets/src/app/components/dashboard/KpiGrid.js:141
     557msgid "Add keywords to start tracking rankings."
     558msgstr "Añade keywords para empezar a monitorizar posiciones."
     559
     560#: assets/src/app/components/dashboard/KpiGrid.js:142
     561#: assets/src/app/components/dashboard/RankTrackerSection.js:125
     562msgid "Rank data will appear after the first update."
     563msgstr "Los datos de ranking aparecerán tras la primera actualización."
     564
     565#: assets/src/app/components/dashboard/KpiGrid.js:154
     566#: assets/src/app/components/dashboard/RankTrackerSection.js:37
     567msgid "Average position"
     568msgstr "Posición media"
     569
     570#: assets/src/app/components/dashboard/KpiGrid.js:160
     571#: assets/src/app/components/dashboard/RankTrackerSection.js:46
     572msgid "Organic visibility"
     573msgstr "Visibilidad orgánica"
     574
     575#: assets/src/app/components/dashboard/KpiGrid.js:171
     576msgid "Keywords"
     577msgstr "Keywords"
     578
     579#: assets/src/app/components/dashboard/KpiGrid.js:182
     580msgid "Add prompts to measure AI visibility."
     581msgstr "Añade prompts para medir la visibilidad IA."
     582
     583#: assets/src/app/components/dashboard/KpiGrid.js:215
     584msgid "Prompts"
     585msgstr "Prompts"
     586
     587#: assets/src/app/components/dashboard/KpiGrid.js:246
     588msgid "Tracked backlinks"
     589msgstr "Backlinks monitorizados"
     590
     591#: assets/src/app/components/dashboard/KpiGrid.js:251
     592msgid "with issues"
     593msgstr "con incidencias"
     594
     595#: assets/src/app/components/dashboard/KpiGrid.js:262
     596msgid "SEO Audits"
     597msgstr "Auditorías SEO"
     598
     599#: assets/src/app/components/dashboard/KpiGrid.js:264
     600msgid "No audits yet for this project."
     601msgstr "Aún no hay auditorías para este proyecto."
     602
     603#: assets/src/app/components/dashboard/KpiGrid.js:275
     604msgid "Average score"
     605msgstr "Score medio"
     606
     607#: assets/src/app/components/dashboard/KpiGrid.js:280
     608msgid "URLs audited"
     609msgstr "URLs auditadas"
     610
     611#: assets/src/app/components/dashboard/KpiGrid.js:288
     612msgid "Visibility index"
     613msgstr "Índice de visibilidad"
     614
     615#: assets/src/app/components/dashboard/KpiGrid.js:290
     616msgid "Visibility index data is not available yet."
     617msgstr "Los datos del índice de visibilidad aún no están disponibles."
     618
     619#: assets/src/app/components/dashboard/KpiGrid.js:302
     620msgid "Mobile visibility"
     621msgstr "Visibilidad móvil"
     622
     623#. translators: %d: number of paused keywords
     624#: assets/src/app/components/dashboard/ProjectToolbar.js:68
     625#, js-format
     626msgid "%d paused"
     627msgid_plural "%d paused"
     628msgstr[0] "%d pausada"
     629msgstr[1] "%d pausadas"
     630
     631#. translators: %d: percent of keywords updated
     632#: assets/src/app/components/dashboard/ProjectToolbar.js:74
     633#, js-format
     634msgid "%d%% updated"
     635msgstr "%d%% actualizado"
     636
     637#. translators: %d: number of keywords
     638#: assets/src/app/components/dashboard/ProjectToolbar.js:92
     639#, js-format
     640msgid "%d Keyword"
     641msgid_plural "%d Keywords"
     642msgstr[0] "%d Keyword"
     643msgstr[1] "%d Keywords"
     644
     645#: assets/src/app/components/dashboard/ProjectToolbar.js:236
     646msgid "Search project…"
     647msgstr "Buscar proyecto…"
     648
     649#: assets/src/app/components/dashboard/ProjectToolbar.js:268
     650msgid "No projects found."
     651msgstr "No se encontraron proyectos."
     652
     653#. translators: %d: number of prompts
     654#: assets/src/app/components/dashboard/ProjectToolbar.js:281
     655#, js-format
     656msgid "%d Prompt"
     657msgid_plural "%d Prompts"
     658msgstr[0] "%d Prompt"
     659msgstr[1] "%d Prompts"
     660
     661#: assets/src/app/components/dashboard/ProjectToolbar.js:296
     662msgid "Upgrade"
     663msgstr "Upgrade"
     664
     665#: assets/src/app/components/dashboard/RankTrackerSection.js:121
     666msgid "Evolution"
     667msgstr "Evolución"
     668
     669#: assets/src/app/components/dashboard/RankTrackerSection.js:122
     670msgid "Positioning and organic visibility over the last 30 days."
     671msgstr "Posicionamiento y visibilidad orgánica de los últimos 30 días."
     672
     673#: assets/src/app/components/dashboard/RankTrackerSection.js:124
     674msgid "Add keywords to see rank evolution."
     675msgstr "Añade keywords para ver la evolución del ranking."
     676
     677#: assets/src/app/components/dashboard/RankTrackerSection.js:133
     678#: assets/src/app/components/rank-tracker/DistributionPanel.js:101
     679#: assets/src/app/components/rank-tracker/SummaryPanels.js:33
     680#: assets/src/app/components/rank-tracker/SummaryPanels.js:74
     681msgid "Keywords distribution"
     682msgstr "Distribución de keywords"
     683
     684#: assets/src/app/components/dashboard/RankTrackerSection.js:135
     685msgid "No distribution data yet."
     686msgstr "Aún no hay datos de distribución."
     687
     688#: assets/src/app/components/dashboard/RankTrackerSection.js:136
     689msgid "Distribution will appear after the first update."
     690msgstr "La distribución aparecerá tras la primera actualización."
     691
     692#. translators: 1: project name, 2: hostname, 3: keyword count
     693#: assets/src/app/components/ProjectSelectModal.js:30
     694#, js-format
     695msgid "%1$s (%2$s) — %3$d keyword"
     696msgid_plural "%1$s (%2$s) — %3$d keywords"
     697msgstr[0] "%1$s (%2$s) — %3$d keyword"
     698msgstr[1] "%1$s (%2$s) — %3$d keywords"
     699
     700#: assets/src/app/components/ProjectSelectModal.js:59
     701msgid "Could not save the selection."
     702msgstr "No se pudo guardar la selección."
     703
     704#: assets/src/app/components/ProjectSelectModal.js:67
     705msgid "Choose a project"
     706msgstr "Elige un proyecto"
     707
     708#: assets/src/app/components/ProjectSelectModal.js:74
     709msgid "There are several projects for this domain. Choose which one to use in WordPress."
     710msgstr "Hay varios proyectos para este dominio. Elige cuál quieres usar en WordPress."
     711
     712#: assets/src/app/components/ProjectSelectModal.js:80
     713msgid "You can change it at any time from Settings."
     714msgstr "Puedes cambiarlo en cualquier momento desde Ajustes."
     715
     716#: assets/src/app/components/ProjectSelectModal.js:103
     717msgid "Use this project"
     718msgstr "Usar este proyecto"
     719
     720#: assets/src/app/components/rank-tracker/AddKeywordsModal.js:315
     721msgid "Could not add keywords. Try again later."
     722msgstr "No se pudieron añadir las keywords. Inténtalo más tarde."
     723
     724#: assets/src/app/components/rank-tracker/AddKeywordsModal.js:325
     725#: assets/src/app/components/rank-tracker/AddKeywordsModal.js:355
     726#: assets/src/app/components/rank-tracker/AddKeywordsModal.js:375
     727#: assets/src/app/pages/RankTrackerPage.js:272
     728msgid "Add keywords"
     729msgstr "Añadir Keywords"
     730
     731#: assets/src/app/components/rank-tracker/AddKeywordsModal.js:334
     732msgid "Go to plans"
     733msgstr "Ir a planes"
     734
     735#: assets/src/app/components/rank-tracker/AddKeywordsModal.js:335
     736msgid "Cancel"
     737msgstr "Cancelar"
     738
     739#: assets/src/app/components/rank-tracker/AddKeywordsModal.js:338
     740msgid "Keyword limit reached"
     741msgstr "Has alcanzado el límite de keywords"
     742
     743#: assets/src/app/components/rank-tracker/AddKeywordsModal.js:341
     744msgid "You should consider upgrade your plan to add more keywords."
     745msgstr "Deberías plantearte mejorar tu plan para añadir más keywords."
     746
     747#: assets/src/app/components/rank-tracker/AddKeywordsModal.js:360
     748msgid "keywords left"
     749msgstr "palabras clave"
     750
     751#. translators: %s: project hostname
     752#: assets/src/app/components/rank-tracker/AddKeywordsModal.js:372
     753#, js-format
     754msgid "Add keywords to %s"
     755msgstr "Añadir keywords a %s"
     756
     757#: assets/src/app/components/rank-tracker/AddKeywordsModal.js:378
     758msgid "One keyword per line"
     759msgstr "Una keyword por línea"
     760
     761#: assets/src/app/components/rank-tracker/AddKeywordsModal.js:382
     762msgid "Number of keywords is above the available keywords."
     763msgstr "El número de keywords supera las keywords disponibles."
     764
     765#: assets/src/app/components/rank-tracker/AddKeywordsModal.js:416
     766msgid "Where do you want to track your keywords?"
     767msgstr "¿Dónde quieres monitorizar tus keywords?"
     768
     769#: assets/src/app/components/rank-tracker/AddKeywordsModal.js:419
     770msgid "Countries, provinces, cities…"
     771msgstr "Países, provincias, ciudades…"
     772
     773#: assets/src/app/components/rank-tracker/AddKeywordsModal.js:426
     774msgid "Write a country, province or city"
     775msgstr "Escribe un país, provincia o ciudad"
     776
     777#: assets/src/app/components/rank-tracker/AddKeywordsModal.js:442
     778msgid "No locations found."
     779msgstr "No se encontraron localizaciones."
     780
     781#: assets/src/app/components/rank-tracker/AddKeywordsModal.js:489
     782msgid "Remove location"
     783msgstr "Quitar localización"
     784
     785#: assets/src/app/components/rank-tracker/AddKeywordsModal.js:503
     786msgid "On what type of device do you want to track the results?"
     787msgstr "¿En qué tipo de dispositivo quieres monitorizar los resultados?"
     788
     789#: assets/src/app/components/rank-tracker/AddKeywordsModal.js:506
     790msgid "When selecting two devices, the number of used keywords doubles"
     791msgstr "Al seleccionar dos dispositivos, el número de keywords usadas se duplica"
     792
     793#: assets/src/app/components/rank-tracker/AddKeywordsModal.js:508
     794#: assets/src/app/components/rank-tracker/FiltersBar.js:32
     795#: assets/src/app/components/rank-tracker/tableColumns.js:82
     796msgid "Device"
     797msgstr "Dispositivo"
     798
     799#: assets/src/app/components/rank-tracker/AddKeywordsModal.js:515
     800#: assets/src/app/components/rank-tracker/cellFormatters.js:324
     801#: assets/src/app/components/rank-tracker/FiltersBar.js:40
     802#: assets/src/app/components/rank-tracker/KeywordStatsModal.js:414
     803msgid "Desktop"
     804msgstr "Desktop"
     805
     806#: assets/src/app/components/rank-tracker/AddKeywordsModal.js:523
     807#: assets/src/app/components/rank-tracker/cellFormatters.js:324
     808#: assets/src/app/components/rank-tracker/FiltersBar.js:48
     809#: assets/src/app/components/rank-tracker/KeywordStatsModal.js:414
     810msgid "Mobile"
     811msgstr "Móvil"
     812
     813#: assets/src/app/components/rank-tracker/AddKeywordsModal.js:530
     814msgid "Both"
     815msgstr "Ambos"
     816
     817#: assets/src/app/components/rank-tracker/AddKeywordsModal.js:544
     818msgid "Add keywords to your project"
     819msgstr "Añade keywords a tu proyecto"
     820
     821#: assets/src/app/components/rank-tracker/AddKeywordsModal.js:549
     822msgid "You can add multiple words and multiple locations, creating combinations between all of them."
     823msgstr "Puedes añadir varias palabras y varias localizaciones, creando combinaciones entre todas ellas."
     824
     825#: assets/src/app/components/rank-tracker/AioPanel.js:19
     826#: assets/src/app/components/rank-tracker/SummaryPanels.js:53
     827#: assets/src/app/components/rank-tracker/SummaryPanels.js:78
     828msgid "AI Overview Presence"
     829msgstr "Presencia en AI Overview"
     830
     831#. translators: 1: number of keywords with AI Overview, 2: total keywords
     832#: assets/src/app/components/rank-tracker/AioPanel.js:27
     833#, js-format
     834msgid "%1$s of %2$s keywords"
     835msgstr "%1$s de %2$s keywords"
     836
     837#. translators: 1: mention count, 2: total keywords
     838#: assets/src/app/components/rank-tracker/AioPanel.js:43
     839#, js-format
     840msgid "%1$s mentions of %2$s keywords"
     841msgstr "%1$s menciones de %2$s keywords"
     842
     843#. translators: 1: citation count, 2: total keywords
     844#: assets/src/app/components/rank-tracker/AioPanel.js:53
     845#, js-format
     846msgid "%1$s citations of %2$s keywords"
     847msgstr "%1$s citas de %2$s keywords"
     848
     849#: assets/src/app/components/rank-tracker/AvgPanel.js:51
     850#: assets/src/app/components/rank-tracker/SummaryPanels.js:27
     851#: assets/src/app/components/rank-tracker/SummaryPanels.js:70
     852msgid "AVG position"
     853msgstr "Posición media"
     854
     855#. translators: %s: ranking position threshold
     856#: assets/src/app/components/rank-tracker/cellFormatters.js:103
     857#: assets/src/app/components/rank-tracker/cellFormatters.js:114
     858#, js-format
     859msgid "%s+"
     860msgstr "%s+"
     861
     862#: assets/src/app/components/rank-tracker/cellFormatters.js:128
     863msgid "Buy plan"
     864msgstr "Upgrade"
     865
     866#: assets/src/app/components/rank-tracker/cellFormatters.js:202
     867msgid "People Also Ask"
     868msgstr "People Also Ask"
     869
     870#: assets/src/app/components/rank-tracker/cellFormatters.js:203
     871msgid "Videos"
     872msgstr "Vídeos"
     873
     874#: assets/src/app/components/rank-tracker/cellFormatters.js:204
     875msgid "Images"
     876msgstr "Imágenes"
     877
     878#: assets/src/app/components/rank-tracker/cellFormatters.js:205
     879#: assets/src/app/components/rank-tracker/tableColumns.js:276
     880msgid "Local Pack"
     881msgstr "Local Pack"
     882
     883#: assets/src/app/components/rank-tracker/cellFormatters.js:206
     884msgid "Knowledge Panel"
     885msgstr "Knowledge Panel"
     886
     887#: assets/src/app/components/rank-tracker/cellFormatters.js:207
     888msgid "Placed Sites"
     889msgstr "Sitios destacados"
     890
     891#: assets/src/app/components/rank-tracker/cellFormatters.js:208
     892msgid "Forums & Discussions"
     893msgstr "Foros y discusiones"
     894
     895#: assets/src/app/components/rank-tracker/cellFormatters.js:209
     896msgid "Product Grid"
     897msgstr "Product Grid"
     898
     899#: assets/src/app/components/rank-tracker/cellFormatters.js:215
     900msgid "Now"
     901msgstr "Ahora"
     902
     903#. translators: %d: number of hours
     904#: assets/src/app/components/rank-tracker/cellFormatters.js:220
     905#, js-format
     906msgid "%d hour ago"
     907msgid_plural "%d hours ago"
     908msgstr[0] "hace %d hora"
     909msgstr[1] "hace %d horas"
     910
    672911#: assets/src/app/components/rank-tracker/cellFormatters.js:242
    673912#: assets/src/app/components/rank-tracker/cellFormatters.js:441
    … …  
    8061045msgstr "3 meses"
    8071046
    808 #: assets/src/app/components/rank-tracker/DateRangePicker.js:63
     1047#: assets/src/app/components/rank-tracker/DateRangePicker.js:26
     1048msgid "6 months"
     1049msgstr "6 meses"
     1050
     1051#: assets/src/app/components/rank-tracker/DateRangePicker.js:27
     1052msgid "1 year"
     1053msgstr "1 año"
     1054
     1055#: assets/src/app/components/rank-tracker/DateRangePicker.js:65
    8091056msgid "Previous month"
    8101057msgstr "Mes anterior"
    8111058
    812 #: assets/src/app/components/rank-tracker/DateRangePicker.js:71
     1059#: assets/src/app/components/rank-tracker/DateRangePicker.js:73
    8131060msgid "Month"
    8141061msgstr "Mes"
    8151062
    816 #: assets/src/app/components/rank-tracker/DateRangePicker.js:87
     1063#: assets/src/app/components/rank-tracker/DateRangePicker.js:89
    8171064msgid "Year"
    8181065msgstr "Año"
    8191066
    820 #: assets/src/app/components/rank-tracker/DateRangePicker.js:103
     1067#: assets/src/app/components/rank-tracker/DateRangePicker.js:105
    8211068msgid "Next month"
    8221069msgstr "Mes siguiente"
    8231070
    824 #: assets/src/app/components/rank-tracker/DateRangePicker.js:239
     1071#: assets/src/app/components/rank-tracker/DateRangePicker.js:246
    8251072msgid "Date range"
    8261073msgstr "Rango de fechas"
    8271074
    828 #: assets/src/app/components/rank-tracker/DateRangePicker.js:245
     1075#: assets/src/app/components/rank-tracker/DateRangePicker.js:252
    8291076msgid "Close"
    8301077msgstr "Cerrar"
    … …  
    8781125msgid "Tags"
    8791126msgstr "Tags"
    880 
    881 #: assets/src/app/components/rank-tracker/FiltersBar.js:90
    882 #: assets/src/app/components/rank-tracker/tableColumns.js:73
    883 msgid "Location"
    884 msgstr "Localización"
    8851127
    8861128#: assets/src/app/components/rank-tracker/FiltersBar.js:93
    … …  
    10091251msgstr "Eliminar vista"
    10101252
    1011 #: assets/src/app/components/rank-tracker/KeywordsTable.js:32
    1012 #: assets/src/app/components/rank-tracker/KeywordsTable.js:184
    1013 msgid "Loading…"
    1014 msgstr "Cargando…"
    1015 
    10161253#: assets/src/app/components/rank-tracker/KeywordsTable.js:33
    10171254#: assets/src/app/components/rank-tracker/SummaryPanels.js:65
    … …  
    10191256msgstr "Añade keywords para ver los datos de ranking."
    10201257
    1021 #: assets/src/app/components/rank-tracker/KeywordsTable.js:95
    1022 #: assets/src/app/components/rank-tracker/KeywordsTable.js:96
    1023 msgid "First"
    1024 msgstr "Primera"
    1025 
    1026 #: assets/src/app/components/rank-tracker/KeywordsTable.js:97
    1027 #: assets/src/app/components/rank-tracker/KeywordsTable.js:98
    1028 msgid "Last"
    1029 msgstr "Última"
    1030 
    1031 #: assets/src/app/components/rank-tracker/KeywordsTable.js:99
    1032 #: assets/src/app/components/rank-tracker/KeywordsTable.js:100
    1033 msgid "Prev"
    1034 msgstr "Anterior"
    1035 
    1036 #: assets/src/app/components/rank-tracker/KeywordsTable.js:101
    1037 #: assets/src/app/components/rank-tracker/KeywordsTable.js:102
    1038 msgid "Next"
    1039 msgstr "Siguiente"
    1040 
    1041 #: assets/src/app/components/rank-tracker/KeywordsTable.js:103
    1042 msgid "Show"
    1043 msgstr "Mostrar"
    1044 
    10451258#: assets/src/app/components/rank-tracker/KeywordsTable.js:312
    10461259msgid "Search keyword, URL, location…"
    … …  
    12051418msgstr "CPC"
    12061419
    1207 #: assets/src/app/components/rank-tracker/tableColumns.js:228
    1208 msgid "Competition"
    1209 msgstr "Competencia"
    1210 
    12111420#: assets/src/app/components/rank-tracker/tableColumns.js:236
    12121421msgid "Traffic"
    … …  
    12411450msgstr "Creada"
    12421451
    1243 #: assets/src/app/pages/CreateProjectStep.js:21
    1244 msgid "TOP 20 every day"
    1245 msgstr "TOP 20 diario"
    1246 
    1247 #: assets/src/app/pages/CreateProjectStep.js:22
    1248 msgid "We will monitor the TOP 20 of your keywords in Google every day."
    1249 msgstr "Monitorizaremos todos los días el TOP 20 de tus keywords en Google."
    1250 
    1251 #: assets/src/app/pages/CreateProjectStep.js:29
    1252 msgid "TOP 50 every 3 days"
    1253 msgstr "TOP 50 cada 3 días"
    1254 
    1255 #: assets/src/app/pages/CreateProjectStep.js:30
    1256 msgid "We will monitor the TOP 50 of your keywords in Google every 3 days."
    1257 msgstr "Monitorizaremos cada 3 días el TOP 50 de tus keywords en Google."
    1258 
    1259 #: assets/src/app/pages/CreateProjectStep.js:37
    1260 msgid "TOP 100 every 7 days"
    1261 msgstr "TOP 100 cada 7 días"
    1262 
    1263 #: assets/src/app/pages/CreateProjectStep.js:38
    1264 msgid "We will monitor the TOP 100 of your keywords in Google every 7 days."
    1265 msgstr "Monitorizaremos cada 7 días el TOP 100 de tus keywords en Google."
    1266 
    1267 #: assets/src/app/pages/CreateProjectStep.js:78
    1268 msgid "Could not load countries."
    1269 msgstr "No se pudieron cargar los países."
    1270 
    1271 #: assets/src/app/pages/CreateProjectStep.js:99
    1272 msgid "Enter the brand name."
    1273 msgstr "Introduce el nombre de la marca."
    1274 
    1275 #: assets/src/app/pages/CreateProjectStep.js:107
    1276 msgid "Choose a country."
    1277 msgstr "Elige un país."
    1278 
    1279 #: assets/src/app/pages/CreateProjectStep.js:129
    1280 msgid "Could not create the project."
    1281 msgstr "No se pudo crear el proyecto."
    1282 
    1283 #: assets/src/app/pages/CreateProjectStep.js:137
    1284 msgid "Choose a country"
    1285 msgstr "Elige un país"
    1286 
    1287 #: assets/src/app/pages/CreateProjectStep.js:153
    1288 msgid "Create your project"
    1289 msgstr "Crea tu proyecto"
    1290 
    1291 #: assets/src/app/pages/CreateProjectStep.js:155
    1292 msgid "There is no TrueRanker project for this site. Fill in the brand, country and tracking frequency to get started."
    1293 msgstr "No hay ningún proyecto en TrueRanker para este sitio. Completa la marca, el país y la frecuencia de tracking para empezar."
    1294 
    1295 #: assets/src/app/pages/CreateProjectStep.js:169
    1296 msgid "Domain"
    1297 msgstr "Dominio"
    1298 
    1299 #: assets/src/app/pages/CreateProjectStep.js:170
    1300 msgid "Taken from this WordPress site and cannot be changed."
    1301 msgstr "Se toma de este sitio WordPress y no se puede cambiar."
    1302 
    1303 #: assets/src/app/pages/CreateProjectStep.js:180
    1304 msgid "Enter your brand to monitor its appearances in AI-generated answers."
    1305 msgstr "Introduce tu marca para monitorizar sus apariciones en las respuestas generadas con IA."
    1306 
    1307 #: assets/src/app/pages/CreateProjectStep.js:191
    1308 msgid "Country"
    1309 msgstr "País"
    1310 
    1311 #: assets/src/app/pages/CreateProjectStep.js:192
    1312 msgid "Choose the country where you want to measure visibility. Later, for each keyword, you can pick any location (even in another country)."
    1313 msgstr "Introduce el país donde quieres medir la visibilidad. Luego, en cada palabra clave, podrás elegir la ubicación que quieras (incluso de otro país)."
    1314 
    1315 #: assets/src/app/pages/CreateProjectStep.js:206
    1316 msgid "Tracking"
    1317 msgstr "Tracking"
    1318 
    1319 #: assets/src/app/pages/CreateProjectStep.js:209
    1320 msgid "Choose the tracking options you want to apply to your project."
    1321 msgstr "Elige el intervalo y la profundidad de rastreo de este proyecto."
    1322 
    1323 #: assets/src/app/pages/CreateProjectStep.js:217
    1324 msgid "Tracking options"
    1325 msgstr "Opciones de tracking"
    1326 
    1327 #: assets/src/app/pages/CreateProjectStep.js:254
    1328 msgid "Create project"
    1329 msgstr "Crear proyecto"
    1330 
    1331 #: assets/src/app/pages/DashboardPage.js:40
    1332 msgid "Could not load the dashboard. Try again later."
    1333 msgstr "No se pudo cargar el dashboard. Inténtalo más tarde."
    1334 
    1335 #: assets/src/app/pages/DashboardPage.js:54
    1336 msgid "No project for this domain"
    1337 msgstr "Sin proyecto para este dominio"
    1338 
    1339 #. translators: %s: site domain
    1340 #: assets/src/app/pages/DashboardPage.js:59
    1341 #, js-format
    1342 msgid "There is no TrueRanker project for <strong>%s</strong>."
    1343 msgstr "No hay ningún proyecto en TrueRanker para <strong>%s</strong>."
    1344 
    1345 #: assets/src/app/pages/DashboardPage.js:66
    1346 msgid "Creating a project from scratch will be available soon."
    1347 msgstr "Crear un proyecto desde cero estará disponible próximamente."
    1348 
     1452#: assets/src/app/pages/AiVisibilityPage.js:73
     1453msgid "Could not load AI Visibility. Try again later."
     1454msgstr "No se pudo cargar Visibilidad IA. Inténtalo más tarde."
     1455
     1456#: assets/src/app/pages/AiVisibilityPage.js:131
     1457msgid "Could not load share of voice per LLM."
     1458msgstr "No se pudo cargar el share of voice por LLM."
     1459
     1460#: assets/src/app/pages/AiVisibilityPage.js:151
    13491461#: assets/src/app/pages/DashboardPage.js:75
    13501462#: assets/src/app/pages/RankTrackerPage.js:208
    13511463msgid "No project selected."
    13521464msgstr "No hay proyecto seleccionado."
     1465
     1466#: assets/src/app/pages/AiVisibilityPage.js:232
     1467msgid "Prompt results"
     1468msgstr "Resultados de prompts"
     1469
     1470#: assets/src/app/pages/AiVisibilityPage.js:254
     1471msgid "AI Visibility Changes"
     1472msgstr "Cambios de visibilidad IA"
     1473
     1474#: assets/src/app/pages/CreateProjectStep.js:21
     1475msgid "TOP 20 every day"
     1476msgstr "TOP 20 diario"
     1477
     1478#: assets/src/app/pages/CreateProjectStep.js:22
     1479msgid "We will monitor the TOP 20 of your keywords in Google every day."
     1480msgstr "Monitorizaremos todos los días el TOP 20 de tus keywords en Google."
     1481
     1482#: assets/src/app/pages/CreateProjectStep.js:29
     1483msgid "TOP 50 every 3 days"
     1484msgstr "TOP 50 cada 3 días"
     1485
     1486#: assets/src/app/pages/CreateProjectStep.js:30
     1487msgid "We will monitor the TOP 50 of your keywords in Google every 3 days."
     1488msgstr "Monitorizaremos cada 3 días el TOP 50 de tus keywords en Google."
     1489
     1490#: assets/src/app/pages/CreateProjectStep.js:37
     1491msgid "TOP 100 every 7 days"
     1492msgstr "TOP 100 cada 7 días"
     1493
     1494#: assets/src/app/pages/CreateProjectStep.js:38
     1495msgid "We will monitor the TOP 100 of your keywords in Google every 7 days."
     1496msgstr "Monitorizaremos cada 7 días el TOP 100 de tus keywords en Google."
     1497
     1498#: assets/src/app/pages/CreateProjectStep.js:78
     1499msgid "Could not load countries."
     1500msgstr "No se pudieron cargar los países."
     1501
     1502#: assets/src/app/pages/CreateProjectStep.js:99
     1503msgid "Enter the brand name."
     1504msgstr "Introduce el nombre de la marca."
     1505
     1506#: assets/src/app/pages/CreateProjectStep.js:107
     1507msgid "Choose a country."
     1508msgstr "Elige un país."
     1509
     1510#: assets/src/app/pages/CreateProjectStep.js:129
     1511msgid "Could not create the project."
     1512msgstr "No se pudo crear el proyecto."
     1513
     1514#: assets/src/app/pages/CreateProjectStep.js:137
     1515msgid "Choose a country"
     1516msgstr "Elige un país"
     1517
     1518#: assets/src/app/pages/CreateProjectStep.js:153
     1519msgid "Create your project"
     1520msgstr "Crea tu proyecto"
     1521
     1522#: assets/src/app/pages/CreateProjectStep.js:155
     1523msgid "There is no TrueRanker project for this site. Fill in the brand, country and tracking frequency to get started."
     1524msgstr "No hay ningún proyecto en TrueRanker para este sitio. Completa la marca, el país y la frecuencia de tracking para empezar."
     1525
     1526#: assets/src/app/pages/CreateProjectStep.js:169
     1527msgid "Domain"
     1528msgstr "Dominio"
     1529
     1530#: assets/src/app/pages/CreateProjectStep.js:170
     1531msgid "Taken from this WordPress site and cannot be changed."
     1532msgstr "Se toma de este sitio WordPress y no se puede cambiar."
     1533
     1534#: assets/src/app/pages/CreateProjectStep.js:180
     1535msgid "Enter your brand to monitor its appearances in AI-generated answers."
     1536msgstr "Introduce tu marca para monitorizar sus apariciones en las respuestas generadas con IA."
     1537
     1538#: assets/src/app/pages/CreateProjectStep.js:191
     1539msgid "Country"
     1540msgstr "País"
     1541
     1542#: assets/src/app/pages/CreateProjectStep.js:192
     1543msgid "Choose the country where you want to measure visibility. Later, for each keyword, you can pick any location (even in another country)."
     1544msgstr "Introduce el país donde quieres medir la visibilidad. Luego, en cada palabra clave, podrás elegir la ubicación que quieras (incluso de otro país)."
     1545
     1546#: assets/src/app/pages/CreateProjectStep.js:206
     1547msgid "Tracking"
     1548msgstr "Tracking"
     1549
     1550#: assets/src/app/pages/CreateProjectStep.js:209
     1551msgid "Choose the tracking options you want to apply to your project."
     1552msgstr "Elige el intervalo y la profundidad de rastreo de este proyecto."
     1553
     1554#: assets/src/app/pages/CreateProjectStep.js:217
     1555msgid "Tracking options"
     1556msgstr "Opciones de tracking"
     1557
     1558#: assets/src/app/pages/CreateProjectStep.js:254
     1559msgid "Create project"
     1560msgstr "Crear proyecto"
     1561
     1562#: assets/src/app/pages/DashboardPage.js:40
     1563msgid "Could not load the dashboard. Try again later."
     1564msgstr "No se pudo cargar el dashboard. Inténtalo más tarde."
     1565
     1566#: assets/src/app/pages/DashboardPage.js:54
     1567msgid "No project for this domain"
     1568msgstr "Sin proyecto para este dominio"
     1569
     1570#. translators: %s: site domain
     1571#: assets/src/app/pages/DashboardPage.js:59
     1572#, js-format
     1573msgid "There is no TrueRanker project for <strong>%s</strong>."
     1574msgstr "No hay ningún proyecto en TrueRanker para <strong>%s</strong>."
     1575
     1576#: assets/src/app/pages/DashboardPage.js:66
     1577msgid "Creating a project from scratch will be available soon."
     1578msgstr "Crear un proyecto desde cero estará disponible próximamente."
    13531579
    13541580#: assets/src/app/pages/OnboardingWizard.js:40
    … …  
    15601786msgstr "Score de sentimiento"
    15611787
    1562 #: assets/src/app/utils/dashboardFormat.js:138
    1563 msgid "Share of voice"
    1564 msgstr "Share of voice"
    1565 
    1566 #: assets/src/app/utils/dashboardFormat.js:139
    1567 msgid "LLM coverage"
    1568 msgstr "Cobertura LLM"
    1569 
    15701788#. translators: %s: ranking position threshold
    15711789#: assets/src/app/utils/rankTrackerCharts.js:69
  • seo-local-rank/trunk/languages/seo-local-rank.pot

    r3706047 r3720851  
    33msgid ""
    44msgstr ""
    5 "Project-Id-Version: TrueRanker 3.0.0\n"
     5"Project-Id-Version: TrueRanker 3.0.1\n"
    66"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/seo-local-rank\n"
    77"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
    … …  
    1010"Content-Type: text/plain; charset=UTF-8\n"
    1111"Content-Transfer-Encoding: 8bit\n"
    12 "POT-Creation-Date: 2026-09-21T16:37:02+02:00\n"
     12"POT-Creation-Date: 2026-09-30T11:41:11+02:00\n"
    1313"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
    1414"X-Generator: WP-CLI 2.12.0\n"
    … …  
    3030#. Description of the plugin
    3131#: seolocalrank.php
    32 msgid "Track Google rankings, AI visibility and backlinks from WordPress. Connect TrueRanker and manage SEO in the admin."
     32msgid "AI Visibility Tracker (brand radar) for ChatGPT and more, plus Google rankings and backlinks from WordPress."
    3333msgstr ""
    3434
    … …  
    6565#: src/Admin/Menu.php:51
    6666#: src/Admin/Menu.php:52
    67 #: assets/src/app/components/dashboard/KpiGrid.js:138
     67#: assets/src/app/components/dashboard/KpiGrid.js:139
    6868#: assets/src/app/components/dashboard/RankTrackerSection.js:116
    6969msgid "Rank Tracker"
    … …  
    7272#: src/Admin/Menu.php:60
    7373#: src/Admin/Menu.php:61
     74#: assets/src/app/components/dashboard/AiVisibilitySection.js:100
     75#: assets/src/app/components/dashboard/KpiGrid.js:180
     76msgid "AI Visibility"
     77msgstr ""
     78
     79#: src/Admin/Menu.php:69
     80#: src/Admin/Menu.php:70
    7481msgid "Settings"
    7582msgstr ""
    … …  
    95102msgstr ""
    96103
    97 #: src/Rest/Controllers/DomainsController.php:205
     104#: src/Rest/Controllers/DomainsController.php:259
    98105msgid "Select a project for this site before loading the dashboard."
    99106msgstr ""
    100107
    101 #: src/Rest/Controllers/DomainsController.php:230
    102 #: src/Rest/Controllers/DomainsController.php:303
    103 #: src/Rest/Controllers/DomainsController.php:389
    104 #: src/Rest/Controllers/DomainsController.php:609
     108#: src/Rest/Controllers/DomainsController.php:284
     109#: src/Rest/Controllers/DomainsController.php:357
     110#: src/Rest/Controllers/DomainsController.php:443
     111#: src/Rest/Controllers/DomainsController.php:514
     112#: src/Rest/Controllers/DomainsController.php:601
     113#: src/Rest/Controllers/DomainsController.php:840
    105114#: src/Rest/Controllers/KeywordsController.php:251
    106115#: src/Rest/Controllers/KeywordsController.php:355
    … …  
    108117msgstr ""
    109118
    110 #: src/Rest/Controllers/DomainsController.php:278
    111 #: src/Rest/Controllers/DomainsController.php:354
     119#: src/Rest/Controllers/DomainsController.php:332
     120#: src/Rest/Controllers/DomainsController.php:408
    112121msgid "Select a project for this site before loading the rank tracker."
    113122msgstr ""
    114123
    115 #: src/Rest/Controllers/DomainsController.php:364
     124#: src/Rest/Controllers/DomainsController.php:418
    116125#: src/Rest/Controllers/KeywordsController.php:231
    117126msgid "A valid start and end date is required."
    118127msgstr ""
    119128
    120 #: src/Rest/Controllers/DomainsController.php:491
     129#: src/Rest/Controllers/DomainsController.php:489
     130#: src/Rest/Controllers/DomainsController.php:576
     131msgid "Select a project for this site before loading AI Visibility."
     132msgstr ""
     133
     134#: src/Rest/Controllers/DomainsController.php:722
    121135msgid "A brand name is required."
    122136msgstr ""
    123137
    124 #: src/Rest/Controllers/DomainsController.php:501
     138#: src/Rest/Controllers/DomainsController.php:732
    125139msgid "Select a country."
    126140msgstr ""
    127141
    128 #: src/Rest/Controllers/DomainsController.php:511
     142#: src/Rest/Controllers/DomainsController.php:742
    129143msgid "Invalid tracking option."
    130144msgstr ""
    131145
    132 #: src/Rest/Controllers/DomainsController.php:548
     146#: src/Rest/Controllers/DomainsController.php:779
    133147msgid "The project was created but no domain ID was returned."
    134148msgstr ""
    135149
    136 #: src/Rest/Controllers/DomainsController.php:584
     150#: src/Rest/Controllers/DomainsController.php:815
    137151msgid "Invalid domain ID."
    138152msgstr ""
    … …  
    203217msgstr ""
    204218
    205 #: assets/src/app/components/dashboard/AiVisibilitySection.js:30
    206 msgid "Score"
    207 msgstr ""
    208 
     219#: assets/src/app/components/ai-visibility/AiVisibilitySkeleton.js:8
     220msgid "Loading AI Visibility"
     221msgstr ""
     222
     223#: assets/src/app/components/ai-visibility/ChangesList.js:32
     224msgid "Traction"
     225msgstr ""
     226
     227#: assets/src/app/components/ai-visibility/ChangesList.js:34
     228msgid "Alert"
     229msgstr ""
     230
     231#: assets/src/app/components/ai-visibility/ChangesList.js:36
     232#: assets/src/app/components/rank-tracker/tableColumns.js:228
     233msgid "Competition"
     234msgstr ""
     235
     236#: assets/src/app/components/ai-visibility/ChangesList.js:38
     237msgid "Milestone"
     238msgstr ""
     239
     240#: assets/src/app/components/ai-visibility/ChangesList.js:53
     241msgid "No significant milestones detected in this period."
     242msgstr ""
     243
     244#: assets/src/app/components/ai-visibility/CollectingOverlay.js:16
     245#: assets/src/app/components/dashboard/ChartPanel.js:45
     246#: assets/src/app/components/dashboard/KpiGrid.js:43
     247msgid "Collecting data"
     248msgstr ""
     249
     250#: assets/src/app/components/ai-visibility/CompetitorsCard.js:75
     251msgid "Competitors"
     252msgstr ""
     253
     254#. translators: 1: current competitors, 2: plan limit
     255#: assets/src/app/components/ai-visibility/CompetitorsCard.js:81
     256#, js-format
     257msgid "%1$d of %2$d"
     258msgstr ""
     259
     260#: assets/src/app/components/ai-visibility/CompetitorsCard.js:93
     261msgid "Add competitor"
     262msgstr ""
     263
     264#: assets/src/app/components/ai-visibility/CompetitorsCard.js:107
     265#: assets/src/app/components/ai-visibility/ShareOfVoice.js:49
     266msgid "Add first competitor"
     267msgstr ""
     268
     269#: assets/src/app/components/ai-visibility/CompetitorsCard.js:115
     270msgid "Website"
     271msgstr ""
     272
     273#: assets/src/app/components/ai-visibility/CompetitorsCard.js:116
     274#: assets/src/app/pages/AiVisibilityPage.js:243
     275#: assets/src/app/utils/dashboardFormat.js:138
     276msgid "Share of voice"
     277msgstr ""
     278
     279#: assets/src/app/components/ai-visibility/EmptyPrompts.js:30
     280msgid "No prompts in this project"
     281msgstr ""
     282
     283#: assets/src/app/components/ai-visibility/EmptyPrompts.js:32
     284msgid "Add prompts to start measuring how AI models mention and cite your brand."
     285msgstr ""
     286
     287#: assets/src/app/components/ai-visibility/EmptyPrompts.js:44
     288msgid "Track AI mentions"
     289msgstr ""
     290
     291#: assets/src/app/components/ai-visibility/EmptyPrompts.js:46
     292msgid "See when ChatGPT, Claude, Gemini and others mention your brand."
     293msgstr ""
     294
     295#: assets/src/app/components/ai-visibility/EmptyPrompts.js:58
     296msgid "Compare models"
     297msgstr ""
     298
     299#: assets/src/app/components/ai-visibility/EmptyPrompts.js:60
     300msgid "Check mention and citation status for each LLM."
     301msgstr ""
     302
     303#: assets/src/app/components/ai-visibility/EmptyPrompts.js:72
     304msgid "Beat competitors"
     305msgstr ""
     306
     307#: assets/src/app/components/ai-visibility/EmptyPrompts.js:74
     308msgid "Measure share of voice against the sites AI recommends."
     309msgstr ""
     310
     311#: assets/src/app/components/ai-visibility/EmptyPrompts.js:90
     312#: assets/src/app/pages/AiVisibilityPage.js:219
     313msgid "Add prompts"
     314msgstr ""
     315
     316#: assets/src/app/components/ai-visibility/EmptyPrompts.js:94
     317msgid "First results usually appear after the next scan."
     318msgstr ""
     319
     320#: assets/src/app/components/ai-visibility/LlmCoverage.js:12
     321#: assets/src/app/utils/dashboardFormat.js:139
     322msgid "LLM coverage"
     323msgstr ""
     324
     325#: assets/src/app/components/ai-visibility/LlmCoverage.js:18
     326msgid "models mention"
     327msgstr ""
     328
     329#. translators: 1: arrow 2: signed change
     330#: assets/src/app/components/ai-visibility/MentionsCitations.js:20
     331#, js-format
     332msgid "%1$s %2$s vs prev"
     333msgstr ""
     334
     335#: assets/src/app/components/ai-visibility/MentionsCitations.js:38
     336#: assets/src/app/components/ai-visibility/PromptsTable.js:51
     337#: assets/src/app/components/ai-visibility/ScoreTrend.js:26
    209338#: assets/src/app/components/dashboard/AiVisibilitySection.js:40
    210339#: assets/src/app/components/dashboard/KpiGrid.js:201
    … …  
    212341msgstr ""
    213342
     343#: assets/src/app/components/ai-visibility/MentionsCitations.js:45
     344#: assets/src/app/components/ai-visibility/PromptsTable.js:52
     345#: assets/src/app/components/ai-visibility/ScoreTrend.js:36
    214346#: assets/src/app/components/dashboard/AiVisibilitySection.js:49
    215347#: assets/src/app/components/dashboard/KpiGrid.js:208
    … …  
    217349msgstr ""
    218350
    219 #. translators: %d: visibility score points gained
    220 #: assets/src/app/components/dashboard/AiVisibilitySection.js:85
    221 #, js-format
    222 msgid "+%d pts"
    223 msgstr ""
    224 
    225 #. translators: %d: visibility score points lost
    226 #: assets/src/app/components/dashboard/AiVisibilitySection.js:91
    227 #, js-format
    228 msgid "-%d pts"
    229 msgstr ""
    230 
    231 #: assets/src/app/components/dashboard/AiVisibilitySection.js:100
    232 #: assets/src/app/components/dashboard/KpiGrid.js:179
    233 msgid "AI Visibility"
    234 msgstr ""
    235 
    236 #: assets/src/app/components/dashboard/AiVisibilitySection.js:105
    237 msgid "Score trend"
    238 msgstr ""
    239 
    240 #: assets/src/app/components/dashboard/AiVisibilitySection.js:107
    241 msgid "Add prompts to see AI visibility trends."
    242 msgstr ""
    243 
    244 #: assets/src/app/components/dashboard/AiVisibilitySection.js:108
    245 #: assets/src/app/components/dashboard/KpiGrid.js:182
    246 msgid "AI visibility data will appear after the first scan."
    247 msgstr ""
    248 
    249 #: assets/src/app/components/dashboard/AiVisibilitySection.js:116
    250 #: assets/src/app/components/dashboard/KpiGrid.js:195
    251 msgid "AI visibility score"
    252 msgstr ""
    253 
    254 #: assets/src/app/components/dashboard/AiVisibilitySection.js:118
    255 msgid "Add prompts to see the visibility score."
    256 msgstr ""
    257 
    258 #: assets/src/app/components/dashboard/AiVisibilitySection.js:119
    259 msgid "Score breakdown will appear after the first scan."
    260 msgstr ""
    261 
    262 #: assets/src/app/components/dashboard/BacklinksSection.js:36
    263 #: assets/src/app/components/dashboard/BacklinksSection.js:121
    264 #: assets/src/app/components/dashboard/KpiGrid.js:225
    265 msgid "Backlinks"
    266 msgstr ""
    267 
    268 #: assets/src/app/components/dashboard/BacklinksSection.js:42
    269 msgid "Pages"
    270 msgstr ""
    271 
    272 #: assets/src/app/components/dashboard/BacklinksSection.js:48
    273 #: assets/src/app/components/dashboard/KpiGrid.js:241
    274 msgid "Referring domains"
    275 msgstr ""
    276 
    277 #: assets/src/app/components/dashboard/BacklinksSection.js:54
    278 msgid "Unique IPs"
    279 msgstr ""
    280 
    281 #: assets/src/app/components/dashboard/BacklinksSection.js:62
    282 msgid "Domain rank"
    283 msgstr ""
    284 
    285 #: assets/src/app/components/dashboard/BacklinksSection.js:62
    286 msgid "Remaining"
    287 msgstr ""
    288 
    289 #: assets/src/app/components/dashboard/BacklinksSection.js:90
    290 msgid "Backlink metrics"
    291 msgstr ""
    292 
    293 #: assets/src/app/components/dashboard/BacklinksSection.js:126
    294 msgid "Domain rank (DR)"
    295 msgstr ""
    296 
    297 #: assets/src/app/components/dashboard/BacklinksSection.js:128
    298 #: assets/src/app/components/dashboard/BacklinksSection.js:144
    299 #: assets/src/app/components/dashboard/KpiGrid.js:227
    300 msgid "Backlink summary is being prepared."
    301 msgstr ""
    302 
    303 #: assets/src/app/components/dashboard/BacklinksSection.js:142
    304 msgid "Backlink trends"
    305 msgstr ""
    306 
    307 #: assets/src/app/components/dashboard/ChartPanel.js:45
    308 #: assets/src/app/components/dashboard/KpiGrid.js:43
    309 msgid "Collecting data"
    310 msgstr ""
    311 
    312 #: assets/src/app/components/dashboard/DashboardSkeleton.js:5
    313 msgid "Loading dashboard"
    314 msgstr ""
    315 
    316 #: assets/src/app/components/dashboard/KpiGrid.js:140
    317 msgid "Add keywords to start tracking rankings."
    318 msgstr ""
    319 
    320 #: assets/src/app/components/dashboard/KpiGrid.js:141
    321 #: assets/src/app/components/dashboard/RankTrackerSection.js:125
    322 msgid "Rank data will appear after the first update."
    323 msgstr ""
    324 
    325 #: assets/src/app/components/dashboard/KpiGrid.js:153
    326 #: assets/src/app/components/dashboard/RankTrackerSection.js:37
    327 msgid "Average position"
    328 msgstr ""
    329 
    330 #: assets/src/app/components/dashboard/KpiGrid.js:159
    331 #: assets/src/app/components/dashboard/RankTrackerSection.js:46
    332 msgid "Organic visibility"
    333 msgstr ""
    334 
    335 #: assets/src/app/components/dashboard/KpiGrid.js:170
    336 msgid "Keywords"
    337 msgstr ""
    338 
    339 #: assets/src/app/components/dashboard/KpiGrid.js:181
    340 msgid "Add prompts to measure AI visibility."
    341 msgstr ""
    342 
    343 #: assets/src/app/components/dashboard/KpiGrid.js:215
    344 msgid "Prompts"
    345 msgstr ""
    346 
    347 #: assets/src/app/components/dashboard/KpiGrid.js:246
    348 msgid "Tracked backlinks"
    349 msgstr ""
    350 
    351 #: assets/src/app/components/dashboard/KpiGrid.js:251
    352 msgid "with issues"
    353 msgstr ""
    354 
    355 #: assets/src/app/components/dashboard/KpiGrid.js:262
    356 msgid "SEO Audits"
    357 msgstr ""
    358 
    359 #: assets/src/app/components/dashboard/KpiGrid.js:264
    360 msgid "No audits yet for this project."
    361 msgstr ""
    362 
    363 #: assets/src/app/components/dashboard/KpiGrid.js:275
    364 msgid "Average score"
    365 msgstr ""
    366 
    367 #: assets/src/app/components/dashboard/KpiGrid.js:280
    368 msgid "URLs audited"
    369 msgstr ""
    370 
    371 #: assets/src/app/components/dashboard/KpiGrid.js:288
    372 msgid "Visibility index"
    373 msgstr ""
    374 
    375 #: assets/src/app/components/dashboard/KpiGrid.js:290
    376 msgid "Visibility index data is not available yet."
    377 msgstr ""
    378 
    379 #: assets/src/app/components/dashboard/KpiGrid.js:302
    380 msgid "Mobile visibility"
    381 msgstr ""
    382 
    383 #. translators: %d: number of paused keywords
    384 #: assets/src/app/components/dashboard/ProjectToolbar.js:68
    385 #, js-format
    386 msgid "%d paused"
    387 msgid_plural "%d paused"
    388 msgstr[0] ""
    389 msgstr[1] ""
    390 
    391 #. translators: %d: percent of keywords updated
    392 #: assets/src/app/components/dashboard/ProjectToolbar.js:74
    393 #, js-format
    394 msgid "%d%% updated"
    395 msgstr ""
    396 
    397 #. translators: %d: number of keywords
    398 #: assets/src/app/components/dashboard/ProjectToolbar.js:92
    399 #, js-format
    400 msgid "%d Keyword"
    401 msgid_plural "%d Keywords"
    402 msgstr[0] ""
    403 msgstr[1] ""
    404 
    405 #: assets/src/app/components/dashboard/ProjectToolbar.js:234
    406 msgid "Search project…"
    407 msgstr ""
    408 
    409 #: assets/src/app/components/dashboard/ProjectToolbar.js:266
    410 msgid "No projects found."
    411 msgstr ""
    412 
    413 #: assets/src/app/components/dashboard/ProjectToolbar.js:283
    414 msgid "Upgrade"
    415 msgstr ""
    416 
    417 #: assets/src/app/components/dashboard/RankTrackerSection.js:121
    418 msgid "Evolution"
    419 msgstr ""
    420 
    421 #: assets/src/app/components/dashboard/RankTrackerSection.js:122
    422 msgid "Positioning and organic visibility over the last 30 days."
    423 msgstr ""
    424 
    425 #: assets/src/app/components/dashboard/RankTrackerSection.js:124
    426 msgid "Add keywords to see rank evolution."
    427 msgstr ""
    428 
    429 #: assets/src/app/components/dashboard/RankTrackerSection.js:133
    430 #: assets/src/app/components/rank-tracker/DistributionPanel.js:101
    431 #: assets/src/app/components/rank-tracker/SummaryPanels.js:33
    432 #: assets/src/app/components/rank-tracker/SummaryPanels.js:74
    433 msgid "Keywords distribution"
    434 msgstr ""
    435 
    436 #: assets/src/app/components/dashboard/RankTrackerSection.js:135
    437 msgid "No distribution data yet."
    438 msgstr ""
    439 
    440 #: assets/src/app/components/dashboard/RankTrackerSection.js:136
    441 msgid "Distribution will appear after the first update."
    442 msgstr ""
    443 
    444 #. translators: 1: project name, 2: hostname, 3: keyword count
    445 #: assets/src/app/components/ProjectSelectModal.js:30
    446 #, js-format
    447 msgid "%1$s (%2$s) — %3$d keyword"
    448 msgid_plural "%1$s (%2$s) — %3$d keywords"
    449 msgstr[0] ""
    450 msgstr[1] ""
    451 
    452 #: assets/src/app/components/ProjectSelectModal.js:59
    453 msgid "Could not save the selection."
    454 msgstr ""
    455 
    456 #: assets/src/app/components/ProjectSelectModal.js:67
    457 msgid "Choose a project"
    458 msgstr ""
    459 
    460 #: assets/src/app/components/ProjectSelectModal.js:74
    461 msgid "There are several projects for this domain. Choose which one to use in WordPress."
    462 msgstr ""
    463 
    464 #: assets/src/app/components/ProjectSelectModal.js:80
    465 msgid "You can change it at any time from Settings."
    466 msgstr ""
    467 
    468 #: assets/src/app/components/ProjectSelectModal.js:103
    469 msgid "Use this project"
    470 msgstr ""
    471 
    472 #: assets/src/app/components/rank-tracker/AddKeywordsModal.js:315
    473 msgid "Could not add keywords. Try again later."
    474 msgstr ""
    475 
    476 #: assets/src/app/components/rank-tracker/AddKeywordsModal.js:325
    477 #: assets/src/app/components/rank-tracker/AddKeywordsModal.js:355
    478 #: assets/src/app/components/rank-tracker/AddKeywordsModal.js:375
    479 #: assets/src/app/pages/RankTrackerPage.js:272
    480 msgid "Add keywords"
    481 msgstr ""
    482 
    483 #: assets/src/app/components/rank-tracker/AddKeywordsModal.js:334
    484 msgid "Go to plans"
    485 msgstr ""
    486 
    487 #: assets/src/app/components/rank-tracker/AddKeywordsModal.js:335
    488 msgid "Cancel"
    489 msgstr ""
    490 
    491 #: assets/src/app/components/rank-tracker/AddKeywordsModal.js:338
    492 msgid "Keyword limit reached"
    493 msgstr ""
    494 
    495 #: assets/src/app/components/rank-tracker/AddKeywordsModal.js:341
    496 msgid "You should consider upgrade your plan to add more keywords."
    497 msgstr ""
    498 
    499 #: assets/src/app/components/rank-tracker/AddKeywordsModal.js:360
    500 msgid "keywords left"
    501 msgstr ""
    502 
    503 #. translators: %s: project hostname
    504 #: assets/src/app/components/rank-tracker/AddKeywordsModal.js:372
    505 #, js-format
    506 msgid "Add keywords to %s"
    507 msgstr ""
    508 
    509 #: assets/src/app/components/rank-tracker/AddKeywordsModal.js:378
    510 msgid "One keyword per line"
    511 msgstr ""
    512 
    513 #: assets/src/app/components/rank-tracker/AddKeywordsModal.js:382
    514 msgid "Number of keywords is above the available keywords."
    515 msgstr ""
    516 
    517 #: assets/src/app/components/rank-tracker/AddKeywordsModal.js:416
    518 msgid "Where do you want to track your keywords?"
    519 msgstr ""
    520 
    521 #: assets/src/app/components/rank-tracker/AddKeywordsModal.js:419
    522 msgid "Countries, provinces, cities…"
    523 msgstr ""
    524 
    525 #: assets/src/app/components/rank-tracker/AddKeywordsModal.js:426
    526 msgid "Write a country, province or city"
    527 msgstr ""
    528 
    529 #: assets/src/app/components/rank-tracker/AddKeywordsModal.js:442
    530 msgid "No locations found."
    531 msgstr ""
    532 
    533 #: assets/src/app/components/rank-tracker/AddKeywordsModal.js:489
    534 msgid "Remove location"
    535 msgstr ""
    536 
    537 #: assets/src/app/components/rank-tracker/AddKeywordsModal.js:503
    538 msgid "On what type of device do you want to track the results?"
    539 msgstr ""
    540 
    541 #: assets/src/app/components/rank-tracker/AddKeywordsModal.js:506
    542 msgid "When selecting two devices, the number of used keywords doubles"
    543 msgstr ""
    544 
    545 #: assets/src/app/components/rank-tracker/AddKeywordsModal.js:508
    546 #: assets/src/app/components/rank-tracker/FiltersBar.js:32
    547 #: assets/src/app/components/rank-tracker/tableColumns.js:82
    548 msgid "Device"
    549 msgstr ""
    550 
    551 #: assets/src/app/components/rank-tracker/AddKeywordsModal.js:515
    552 #: assets/src/app/components/rank-tracker/cellFormatters.js:324
    553 #: assets/src/app/components/rank-tracker/FiltersBar.js:40
    554 #: assets/src/app/components/rank-tracker/KeywordStatsModal.js:414
    555 msgid "Desktop"
    556 msgstr ""
    557 
    558 #: assets/src/app/components/rank-tracker/AddKeywordsModal.js:523
    559 #: assets/src/app/components/rank-tracker/cellFormatters.js:324
    560 #: assets/src/app/components/rank-tracker/FiltersBar.js:48
    561 #: assets/src/app/components/rank-tracker/KeywordStatsModal.js:414
    562 msgid "Mobile"
    563 msgstr ""
    564 
    565 #: assets/src/app/components/rank-tracker/AddKeywordsModal.js:530
    566 msgid "Both"
    567 msgstr ""
    568 
    569 #: assets/src/app/components/rank-tracker/AddKeywordsModal.js:544
    570 msgid "Add keywords to your project"
    571 msgstr ""
    572 
    573 #: assets/src/app/components/rank-tracker/AddKeywordsModal.js:549
    574 msgid "You can add multiple words and multiple locations, creating combinations between all of them."
    575 msgstr ""
    576 
    577 #: assets/src/app/components/rank-tracker/AioPanel.js:19
    578 #: assets/src/app/components/rank-tracker/SummaryPanels.js:53
    579 #: assets/src/app/components/rank-tracker/SummaryPanels.js:78
    580 msgid "AI Overview Presence"
    581 msgstr ""
    582 
    583 #. translators: 1: number of keywords with AI Overview, 2: total keywords
    584 #: assets/src/app/components/rank-tracker/AioPanel.js:27
    585 #, js-format
    586 msgid "%1$s of %2$s keywords"
    587 msgstr ""
    588 
    589 #. translators: 1: mention count, 2: total keywords
    590 #: assets/src/app/components/rank-tracker/AioPanel.js:43
    591 #, js-format
    592 msgid "%1$s mentions of %2$s keywords"
    593 msgstr ""
    594 
    595 #. translators: 1: citation count, 2: total keywords
    596 #: assets/src/app/components/rank-tracker/AioPanel.js:53
    597 #, js-format
    598 msgid "%1$s citations of %2$s keywords"
    599 msgstr ""
    600 
    601 #: assets/src/app/components/rank-tracker/AvgPanel.js:51
    602 #: assets/src/app/components/rank-tracker/SummaryPanels.js:27
    603 #: assets/src/app/components/rank-tracker/SummaryPanels.js:70
    604 msgid "AVG position"
    605 msgstr ""
    606 
    607 #. translators: %s: ranking position threshold
    608 #: assets/src/app/components/rank-tracker/cellFormatters.js:103
    609 #: assets/src/app/components/rank-tracker/cellFormatters.js:114
    610 #, js-format
    611 msgid "%s+"
    612 msgstr ""
    613 
    614 #: assets/src/app/components/rank-tracker/cellFormatters.js:128
    615 msgid "Buy plan"
    616 msgstr ""
    617 
    618 #: assets/src/app/components/rank-tracker/cellFormatters.js:202
    619 msgid "People Also Ask"
    620 msgstr ""
    621 
    622 #: assets/src/app/components/rank-tracker/cellFormatters.js:203
    623 msgid "Videos"
    624 msgstr ""
    625 
    626 #: assets/src/app/components/rank-tracker/cellFormatters.js:204
    627 msgid "Images"
    628 msgstr ""
    629 
    630 #: assets/src/app/components/rank-tracker/cellFormatters.js:205
    631 #: assets/src/app/components/rank-tracker/tableColumns.js:276
    632 msgid "Local Pack"
    633 msgstr ""
    634 
    635 #: assets/src/app/components/rank-tracker/cellFormatters.js:206
    636 msgid "Knowledge Panel"
    637 msgstr ""
    638 
    639 #: assets/src/app/components/rank-tracker/cellFormatters.js:207
    640 msgid "Placed Sites"
    641 msgstr ""
    642 
    643 #: assets/src/app/components/rank-tracker/cellFormatters.js:208
    644 msgid "Forums & Discussions"
    645 msgstr ""
    646 
    647 #: assets/src/app/components/rank-tracker/cellFormatters.js:209
    648 msgid "Product Grid"
    649 msgstr ""
    650 
    651 #: assets/src/app/components/rank-tracker/cellFormatters.js:215
    652 msgid "Now"
    653 msgstr ""
    654 
    655 #. translators: %d: number of hours
    656 #: assets/src/app/components/rank-tracker/cellFormatters.js:220
    657 #, js-format
    658 msgid "%d hour ago"
    659 msgid_plural "%d hours ago"
    660 msgstr[0] ""
    661 msgstr[1] ""
    662 
     351#: assets/src/app/components/ai-visibility/PromptsTable.js:42
    663352#: assets/src/app/components/rank-tracker/cellFormatters.js:235
    664353#: assets/src/app/components/rank-tracker/cellFormatters.js:385
    … …  
    670359msgstr ""
    671360
     361#: assets/src/app/components/ai-visibility/PromptsTable.js:68
     362msgid "Positive"
     363msgstr ""
     364
     365#: assets/src/app/components/ai-visibility/PromptsTable.js:69
     366msgid "Neutral"
     367msgstr ""
     368
     369#: assets/src/app/components/ai-visibility/PromptsTable.js:70
     370msgid "Negative"
     371msgstr ""
     372
     373#: assets/src/app/components/ai-visibility/PromptsTable.js:99
     374#: assets/src/app/components/ai-visibility/PromptsTable.js:100
     375#: assets/src/app/components/rank-tracker/KeywordsTable.js:95
     376#: assets/src/app/components/rank-tracker/KeywordsTable.js:96
     377msgid "First"
     378msgstr ""
     379
     380#: assets/src/app/components/ai-visibility/PromptsTable.js:101
     381#: assets/src/app/components/ai-visibility/PromptsTable.js:102
     382#: assets/src/app/components/rank-tracker/KeywordsTable.js:97
     383#: assets/src/app/components/rank-tracker/KeywordsTable.js:98
     384msgid "Last"
     385msgstr ""
     386
     387#: assets/src/app/components/ai-visibility/PromptsTable.js:103
     388#: assets/src/app/components/ai-visibility/PromptsTable.js:104
     389#: assets/src/app/components/rank-tracker/KeywordsTable.js:99
     390#: assets/src/app/components/rank-tracker/KeywordsTable.js:100
     391msgid "Prev"
     392msgstr ""
     393
     394#: assets/src/app/components/ai-visibility/PromptsTable.js:105
     395#: assets/src/app/components/ai-visibility/PromptsTable.js:106
     396#: assets/src/app/components/rank-tracker/KeywordsTable.js:101
     397#: assets/src/app/components/rank-tracker/KeywordsTable.js:102
     398msgid "Next"
     399msgstr ""
     400
     401#: assets/src/app/components/ai-visibility/PromptsTable.js:107
     402#: assets/src/app/components/rank-tracker/KeywordsTable.js:103
     403msgid "Show"
     404msgstr ""
     405
     406#: assets/src/app/components/ai-visibility/PromptsTable.js:158
     407msgid "Prompt"
     408msgstr ""
     409
     410#: assets/src/app/components/ai-visibility/PromptsTable.js:166
     411#: assets/src/app/components/rank-tracker/FiltersBar.js:90
     412#: assets/src/app/components/rank-tracker/tableColumns.js:73
     413msgid "Location"
     414msgstr ""
     415
     416#: assets/src/app/components/ai-visibility/PromptsTable.js:185
     417msgid "Sentiment"
     418msgstr ""
     419
     420#: assets/src/app/components/ai-visibility/PromptsTable.js:195
     421msgid "Trend"
     422msgstr ""
     423
     424#: assets/src/app/components/ai-visibility/PromptsTable.js:260
     425#: assets/src/app/components/ai-visibility/PromptsTable.js:312
     426#: assets/src/app/components/ai-visibility/ShareOfVoice.js:137
     427#: assets/src/app/components/rank-tracker/KeywordsTable.js:32
     428#: assets/src/app/components/rank-tracker/KeywordsTable.js:184
     429msgid "Loading…"
     430msgstr ""
     431
     432#: assets/src/app/components/ai-visibility/PromptsTable.js:261
     433#: assets/src/app/components/ai-visibility/PromptsTable.js:313
     434msgid "No prompts in this range."
     435msgstr ""
     436
     437#: assets/src/app/components/ai-visibility/PromptsTable.js:336
     438msgid "Search prompt…"
     439msgstr ""
     440
     441#: assets/src/app/components/ai-visibility/ScoreCard.js:15
     442msgid "AI Visibility Score"
     443msgstr ""
     444
     445#. translators: 1: arrow, 2: signed delta, 3: unit
     446#: assets/src/app/components/ai-visibility/ScoreCard.js:22
     447#, js-format
     448msgid "%1$s %2$s pts"
     449msgstr ""
     450
     451#: assets/src/app/components/ai-visibility/ScoreTrend.js:15
     452#: assets/src/app/components/dashboard/AiVisibilitySection.js:30
     453msgid "Score"
     454msgstr ""
     455
     456#: assets/src/app/components/ai-visibility/ScoreTrend.js:71
     457#: assets/src/app/components/dashboard/AiVisibilitySection.js:105
     458msgid "Score trend"
     459msgstr ""
     460
     461#: assets/src/app/components/ai-visibility/ShareOfVoice.js:148
     462msgid "Current share of voice"
     463msgstr ""
     464
     465#: assets/src/app/components/ai-visibility/ShareOfVoice.js:154
     466msgid "Share of voice per LLM"
     467msgstr ""
     468
     469#: assets/src/app/components/ai-visibility/ShareOfVoice.js:161
     470msgid "Share of voice over time"
     471msgstr ""
     472
     473#. translators: %d: visibility score points gained
     474#: assets/src/app/components/dashboard/AiVisibilitySection.js:85
     475#, js-format
     476msgid "+%d pts"
     477msgstr ""
     478
     479#. translators: %d: visibility score points lost
     480#: assets/src/app/components/dashboard/AiVisibilitySection.js:91
     481#, js-format
     482msgid "-%d pts"
     483msgstr ""
     484
     485#: assets/src/app/components/dashboard/AiVisibilitySection.js:107
     486msgid "Add prompts to see AI visibility trends."
     487msgstr ""
     488
     489#: assets/src/app/components/dashboard/AiVisibilitySection.js:108
     490#: assets/src/app/components/dashboard/KpiGrid.js:183
     491msgid "AI visibility data will appear after the first scan."
     492msgstr ""
     493
     494#: assets/src/app/components/dashboard/AiVisibilitySection.js:116
     495#: assets/src/app/components/dashboard/KpiGrid.js:195
     496msgid "AI visibility score"
     497msgstr ""
     498
     499#: assets/src/app/components/dashboard/AiVisibilitySection.js:118
     500msgid "Add prompts to see the visibility score."
     501msgstr ""
     502
     503#: assets/src/app/components/dashboard/AiVisibilitySection.js:119
     504msgid "Score breakdown will appear after the first scan."
     505msgstr ""
     506
     507#: assets/src/app/components/dashboard/BacklinksSection.js:36
     508#: assets/src/app/components/dashboard/BacklinksSection.js:121
     509#: assets/src/app/components/dashboard/KpiGrid.js:225
     510msgid "Backlinks"
     511msgstr ""
     512
     513#: assets/src/app/components/dashboard/BacklinksSection.js:42
     514msgid "Pages"
     515msgstr ""
     516
     517#: assets/src/app/components/dashboard/BacklinksSection.js:48
     518#: assets/src/app/components/dashboard/KpiGrid.js:241
     519msgid "Referring domains"
     520msgstr ""
     521
     522#: assets/src/app/components/dashboard/BacklinksSection.js:54
     523msgid "Unique IPs"
     524msgstr ""
     525
     526#: assets/src/app/components/dashboard/BacklinksSection.js:62
     527msgid "Domain rank"
     528msgstr ""
     529
     530#: assets/src/app/components/dashboard/BacklinksSection.js:62
     531msgid "Remaining"
     532msgstr ""
     533
     534#: assets/src/app/components/dashboard/BacklinksSection.js:90
     535msgid "Backlink metrics"
     536msgstr ""
     537
     538#: assets/src/app/components/dashboard/BacklinksSection.js:126
     539msgid "Domain rank (DR)"
     540msgstr ""
     541
     542#: assets/src/app/components/dashboard/BacklinksSection.js:128
     543#: assets/src/app/components/dashboard/BacklinksSection.js:144
     544#: assets/src/app/components/dashboard/KpiGrid.js:227
     545msgid "Backlink summary is being prepared."
     546msgstr ""
     547
     548#: assets/src/app/components/dashboard/BacklinksSection.js:142
     549msgid "Backlink trends"
     550msgstr ""
     551
     552#: assets/src/app/components/dashboard/DashboardSkeleton.js:5
     553msgid "Loading dashboard"
     554msgstr ""
     555
     556#: assets/src/app/components/dashboard/KpiGrid.js:141
     557msgid "Add keywords to start tracking rankings."
     558msgstr ""
     559
     560#: assets/src/app/components/dashboard/KpiGrid.js:142
     561#: assets/src/app/components/dashboard/RankTrackerSection.js:125
     562msgid "Rank data will appear after the first update."
     563msgstr ""
     564
     565#: assets/src/app/components/dashboard/KpiGrid.js:154
     566#: assets/src/app/components/dashboard/RankTrackerSection.js:37
     567msgid "Average position"
     568msgstr ""
     569
     570#: assets/src/app/components/dashboard/KpiGrid.js:160
     571#: assets/src/app/components/dashboard/RankTrackerSection.js:46
     572msgid "Organic visibility"
     573msgstr ""
     574
     575#: assets/src/app/components/dashboard/KpiGrid.js:171
     576msgid "Keywords"
     577msgstr ""
     578
     579#: assets/src/app/components/dashboard/KpiGrid.js:182
     580msgid "Add prompts to measure AI visibility."
     581msgstr ""
     582
     583#: assets/src/app/components/dashboard/KpiGrid.js:215
     584msgid "Prompts"
     585msgstr ""
     586
     587#: assets/src/app/components/dashboard/KpiGrid.js:246
     588msgid "Tracked backlinks"
     589msgstr ""
     590
     591#: assets/src/app/components/dashboard/KpiGrid.js:251
     592msgid "with issues"
     593msgstr ""
     594
     595#: assets/src/app/components/dashboard/KpiGrid.js:262
     596msgid "SEO Audits"
     597msgstr ""
     598
     599#: assets/src/app/components/dashboard/KpiGrid.js:264
     600msgid "No audits yet for this project."
     601msgstr ""
     602
     603#: assets/src/app/components/dashboard/KpiGrid.js:275
     604msgid "Average score"
     605msgstr ""
     606
     607#: assets/src/app/components/dashboard/KpiGrid.js:280
     608msgid "URLs audited"
     609msgstr ""
     610
     611#: assets/src/app/components/dashboard/KpiGrid.js:288
     612msgid "Visibility index"
     613msgstr ""
     614
     615#: assets/src/app/components/dashboard/KpiGrid.js:290
     616msgid "Visibility index data is not available yet."
     617msgstr ""
     618
     619#: assets/src/app/components/dashboard/KpiGrid.js:302
     620msgid "Mobile visibility"
     621msgstr ""
     622
     623#. translators: %d: number of paused keywords
     624#: assets/src/app/components/dashboard/ProjectToolbar.js:68
     625#, js-format
     626msgid "%d paused"
     627msgid_plural "%d paused"
     628msgstr[0] ""
     629msgstr[1] ""
     630
     631#. translators: %d: percent of keywords updated
     632#: assets/src/app/components/dashboard/ProjectToolbar.js:74
     633#, js-format
     634msgid "%d%% updated"
     635msgstr ""
     636
     637#. translators: %d: number of keywords
     638#: assets/src/app/components/dashboard/ProjectToolbar.js:92
     639#, js-format
     640msgid "%d Keyword"
     641msgid_plural "%d Keywords"
     642msgstr[0] ""
     643msgstr[1] ""
     644
     645#: assets/src/app/components/dashboard/ProjectToolbar.js:236
     646msgid "Search project…"
     647msgstr ""
     648
     649#: assets/src/app/components/dashboard/ProjectToolbar.js:268
     650msgid "No projects found."
     651msgstr ""
     652
     653#. translators: %d: number of prompts
     654#: assets/src/app/components/dashboard/ProjectToolbar.js:281
     655#, js-format
     656msgid "%d Prompt"
     657msgid_plural "%d Prompts"
     658msgstr[0] ""
     659msgstr[1] ""
     660
     661#: assets/src/app/components/dashboard/ProjectToolbar.js:296
     662msgid "Upgrade"
     663msgstr ""
     664
     665#: assets/src/app/components/dashboard/RankTrackerSection.js:121
     666msgid "Evolution"
     667msgstr ""
     668
     669#: assets/src/app/components/dashboard/RankTrackerSection.js:122
     670msgid "Positioning and organic visibility over the last 30 days."
     671msgstr ""
     672
     673#: assets/src/app/components/dashboard/RankTrackerSection.js:124
     674msgid "Add keywords to see rank evolution."
     675msgstr ""
     676
     677#: assets/src/app/components/dashboard/RankTrackerSection.js:133
     678#: assets/src/app/components/rank-tracker/DistributionPanel.js:101
     679#: assets/src/app/components/rank-tracker/SummaryPanels.js:33
     680#: assets/src/app/components/rank-tracker/SummaryPanels.js:74
     681msgid "Keywords distribution"
     682msgstr ""
     683
     684#: assets/src/app/components/dashboard/RankTrackerSection.js:135
     685msgid "No distribution data yet."
     686msgstr ""
     687
     688#: assets/src/app/components/dashboard/RankTrackerSection.js:136
     689msgid "Distribution will appear after the first update."
     690msgstr ""
     691
     692#. translators: 1: project name, 2: hostname, 3: keyword count
     693#: assets/src/app/components/ProjectSelectModal.js:30
     694#, js-format
     695msgid "%1$s (%2$s) — %3$d keyword"
     696msgid_plural "%1$s (%2$s) — %3$d keywords"
     697msgstr[0] ""
     698msgstr[1] ""
     699
     700#: assets/src/app/components/ProjectSelectModal.js:59
     701msgid "Could not save the selection."
     702msgstr ""
     703
     704#: assets/src/app/components/ProjectSelectModal.js:67
     705msgid "Choose a project"
     706msgstr ""
     707
     708#: assets/src/app/components/ProjectSelectModal.js:74
     709msgid "There are several projects for this domain. Choose which one to use in WordPress."
     710msgstr ""
     711
     712#: assets/src/app/components/ProjectSelectModal.js:80
     713msgid "You can change it at any time from Settings."
     714msgstr ""
     715
     716#: assets/src/app/components/ProjectSelectModal.js:103
     717msgid "Use this project"
     718msgstr ""
     719
     720#: assets/src/app/components/rank-tracker/AddKeywordsModal.js:315
     721msgid "Could not add keywords. Try again later."
     722msgstr ""
     723
     724#: assets/src/app/components/rank-tracker/AddKeywordsModal.js:325
     725#: assets/src/app/components/rank-tracker/AddKeywordsModal.js:355
     726#: assets/src/app/components/rank-tracker/AddKeywordsModal.js:375
     727#: assets/src/app/pages/RankTrackerPage.js:272
     728msgid "Add keywords"
     729msgstr ""
     730
     731#: assets/src/app/components/rank-tracker/AddKeywordsModal.js:334
     732msgid "Go to plans"
     733msgstr ""
     734
     735#: assets/src/app/components/rank-tracker/AddKeywordsModal.js:335
     736msgid "Cancel"
     737msgstr ""
     738
     739#: assets/src/app/components/rank-tracker/AddKeywordsModal.js:338
     740msgid "Keyword limit reached"
     741msgstr ""
     742
     743#: assets/src/app/components/rank-tracker/AddKeywordsModal.js:341
     744msgid "You should consider upgrade your plan to add more keywords."
     745msgstr ""
     746
     747#: assets/src/app/components/rank-tracker/AddKeywordsModal.js:360
     748msgid "keywords left"
     749msgstr ""
     750
     751#. translators: %s: project hostname
     752#: assets/src/app/components/rank-tracker/AddKeywordsModal.js:372
     753#, js-format
     754msgid "Add keywords to %s"
     755msgstr ""
     756
     757#: assets/src/app/components/rank-tracker/AddKeywordsModal.js:378
     758msgid "One keyword per line"
     759msgstr ""
     760
     761#: assets/src/app/components/rank-tracker/AddKeywordsModal.js:382
     762msgid "Number of keywords is above the available keywords."
     763msgstr ""
     764
     765#: assets/src/app/components/rank-tracker/AddKeywordsModal.js:416
     766msgid "Where do you want to track your keywords?"
     767msgstr ""
     768
     769#: assets/src/app/components/rank-tracker/AddKeywordsModal.js:419
     770msgid "Countries, provinces, cities…"
     771msgstr ""
     772
     773#: assets/src/app/components/rank-tracker/AddKeywordsModal.js:426
     774msgid "Write a country, province or city"
     775msgstr ""
     776
     777#: assets/src/app/components/rank-tracker/AddKeywordsModal.js:442
     778msgid "No locations found."
     779msgstr ""
     780
     781#: assets/src/app/components/rank-tracker/AddKeywordsModal.js:489
     782msgid "Remove location"
     783msgstr ""
     784
     785#: assets/src/app/components/rank-tracker/AddKeywordsModal.js:503
     786msgid "On what type of device do you want to track the results?"
     787msgstr ""
     788
     789#: assets/src/app/components/rank-tracker/AddKeywordsModal.js:506
     790msgid "When selecting two devices, the number of used keywords doubles"
     791msgstr ""
     792
     793#: assets/src/app/components/rank-tracker/AddKeywordsModal.js:508
     794#: assets/src/app/components/rank-tracker/FiltersBar.js:32
     795#: assets/src/app/components/rank-tracker/tableColumns.js:82
     796msgid "Device"
     797msgstr ""
     798
     799#: assets/src/app/components/rank-tracker/AddKeywordsModal.js:515
     800#: assets/src/app/components/rank-tracker/cellFormatters.js:324
     801#: assets/src/app/components/rank-tracker/FiltersBar.js:40
     802#: assets/src/app/components/rank-tracker/KeywordStatsModal.js:414
     803msgid "Desktop"
     804msgstr ""
     805
     806#: assets/src/app/components/rank-tracker/AddKeywordsModal.js:523
     807#: assets/src/app/components/rank-tracker/cellFormatters.js:324
     808#: assets/src/app/components/rank-tracker/FiltersBar.js:48
     809#: assets/src/app/components/rank-tracker/KeywordStatsModal.js:414
     810msgid "Mobile"
     811msgstr ""
     812
     813#: assets/src/app/components/rank-tracker/AddKeywordsModal.js:530
     814msgid "Both"
     815msgstr ""
     816
     817#: assets/src/app/components/rank-tracker/AddKeywordsModal.js:544
     818msgid "Add keywords to your project"
     819msgstr ""
     820
     821#: assets/src/app/components/rank-tracker/AddKeywordsModal.js:549
     822msgid "You can add multiple words and multiple locations, creating combinations between all of them."
     823msgstr ""
     824
     825#: assets/src/app/components/rank-tracker/AioPanel.js:19
     826#: assets/src/app/components/rank-tracker/SummaryPanels.js:53
     827#: assets/src/app/components/rank-tracker/SummaryPanels.js:78
     828msgid "AI Overview Presence"
     829msgstr ""
     830
     831#. translators: 1: number of keywords with AI Overview, 2: total keywords
     832#: assets/src/app/components/rank-tracker/AioPanel.js:27
     833#, js-format
     834msgid "%1$s of %2$s keywords"
     835msgstr ""
     836
     837#. translators: 1: mention count, 2: total keywords
     838#: assets/src/app/components/rank-tracker/AioPanel.js:43
     839#, js-format
     840msgid "%1$s mentions of %2$s keywords"
     841msgstr ""
     842
     843#. translators: 1: citation count, 2: total keywords
     844#: assets/src/app/components/rank-tracker/AioPanel.js:53
     845#, js-format
     846msgid "%1$s citations of %2$s keywords"
     847msgstr ""
     848
     849#: assets/src/app/components/rank-tracker/AvgPanel.js:51
     850#: assets/src/app/components/rank-tracker/SummaryPanels.js:27
     851#: assets/src/app/components/rank-tracker/SummaryPanels.js:70
     852msgid "AVG position"
     853msgstr ""
     854
     855#. translators: %s: ranking position threshold
     856#: assets/src/app/components/rank-tracker/cellFormatters.js:103
     857#: assets/src/app/components/rank-tracker/cellFormatters.js:114
     858#, js-format
     859msgid "%s+"
     860msgstr ""
     861
     862#: assets/src/app/components/rank-tracker/cellFormatters.js:128
     863msgid "Buy plan"
     864msgstr ""
     865
     866#: assets/src/app/components/rank-tracker/cellFormatters.js:202
     867msgid "People Also Ask"
     868msgstr ""
     869
     870#: assets/src/app/components/rank-tracker/cellFormatters.js:203
     871msgid "Videos"
     872msgstr ""
     873
     874#: assets/src/app/components/rank-tracker/cellFormatters.js:204
     875msgid "Images"
     876msgstr ""
     877
     878#: assets/src/app/components/rank-tracker/cellFormatters.js:205
     879#: assets/src/app/components/rank-tracker/tableColumns.js:276
     880msgid "Local Pack"
     881msgstr ""
     882
     883#: assets/src/app/components/rank-tracker/cellFormatters.js:206
     884msgid "Knowledge Panel"
     885msgstr ""
     886
     887#: assets/src/app/components/rank-tracker/cellFormatters.js:207
     888msgid "Placed Sites"
     889msgstr ""
     890
     891#: assets/src/app/components/rank-tracker/cellFormatters.js:208
     892msgid "Forums & Discussions"
     893msgstr ""
     894
     895#: assets/src/app/components/rank-tracker/cellFormatters.js:209
     896msgid "Product Grid"
     897msgstr ""
     898
     899#: assets/src/app/components/rank-tracker/cellFormatters.js:215
     900msgid "Now"
     901msgstr ""
     902
     903#. translators: %d: number of hours
     904#: assets/src/app/components/rank-tracker/cellFormatters.js:220
     905#, js-format
     906msgid "%d hour ago"
     907msgid_plural "%d hours ago"
     908msgstr[0] ""
     909msgstr[1] ""
     910
    672911#: assets/src/app/components/rank-tracker/cellFormatters.js:242
    673912#: assets/src/app/components/rank-tracker/cellFormatters.js:441
    … …  
    8061045msgstr ""
    8071046
    808 #: assets/src/app/components/rank-tracker/DateRangePicker.js:63
     1047#: assets/src/app/components/rank-tracker/DateRangePicker.js:26
     1048msgid "6 months"
     1049msgstr ""
     1050
     1051#: assets/src/app/components/rank-tracker/DateRangePicker.js:27
     1052msgid "1 year"
     1053msgstr ""
     1054
     1055#: assets/src/app/components/rank-tracker/DateRangePicker.js:65
    8091056msgid "Previous month"
    8101057msgstr ""
    8111058
    812 #: assets/src/app/components/rank-tracker/DateRangePicker.js:71
     1059#: assets/src/app/components/rank-tracker/DateRangePicker.js:73
    8131060msgid "Month"
    8141061msgstr ""
    8151062
    816 #: assets/src/app/components/rank-tracker/DateRangePicker.js:87
     1063#: assets/src/app/components/rank-tracker/DateRangePicker.js:89
    8171064msgid "Year"
    8181065msgstr ""
    8191066
    820 #: assets/src/app/components/rank-tracker/DateRangePicker.js:103
     1067#: assets/src/app/components/rank-tracker/DateRangePicker.js:105
    8211068msgid "Next month"
    8221069msgstr ""
    8231070
    824 #: assets/src/app/components/rank-tracker/DateRangePicker.js:239
     1071#: assets/src/app/components/rank-tracker/DateRangePicker.js:246
    8251072msgid "Date range"
    8261073msgstr ""
    8271074
    828 #: assets/src/app/components/rank-tracker/DateRangePicker.js:245
     1075#: assets/src/app/components/rank-tracker/DateRangePicker.js:252
    8291076msgid "Close"
    8301077msgstr ""
    … …  
    8771124#: assets/src/app/components/rank-tracker/tableColumns.js:301
    8781125msgid "Tags"
    879 msgstr ""
    880 
    881 #: assets/src/app/components/rank-tracker/FiltersBar.js:90
    882 #: assets/src/app/components/rank-tracker/tableColumns.js:73
    883 msgid "Location"
    8841126msgstr ""
    8851127
    … …  
    10091251msgstr ""
    10101252
    1011 #: assets/src/app/components/rank-tracker/KeywordsTable.js:32
    1012 #: assets/src/app/components/rank-tracker/KeywordsTable.js:184
    1013 msgid "Loading…"
    1014 msgstr ""
    1015 
    10161253#: assets/src/app/components/rank-tracker/KeywordsTable.js:33
    10171254#: assets/src/app/components/rank-tracker/SummaryPanels.js:65
    … …  
    10191256msgstr ""
    10201257
    1021 #: assets/src/app/components/rank-tracker/KeywordsTable.js:95
    1022 #: assets/src/app/components/rank-tracker/KeywordsTable.js:96
    1023 msgid "First"
    1024 msgstr ""
    1025 
    1026 #: assets/src/app/components/rank-tracker/KeywordsTable.js:97
    1027 #: assets/src/app/components/rank-tracker/KeywordsTable.js:98
    1028 msgid "Last"
    1029 msgstr ""
    1030 
    1031 #: assets/src/app/components/rank-tracker/KeywordsTable.js:99
    1032 #: assets/src/app/components/rank-tracker/KeywordsTable.js:100
    1033 msgid "Prev"
    1034 msgstr ""
    1035 
    1036 #: assets/src/app/components/rank-tracker/KeywordsTable.js:101
    1037 #: assets/src/app/components/rank-tracker/KeywordsTable.js:102
    1038 msgid "Next"
    1039 msgstr ""
    1040 
    1041 #: assets/src/app/components/rank-tracker/KeywordsTable.js:103
    1042 msgid "Show"
    1043 msgstr ""
    1044 
    10451258#: assets/src/app/components/rank-tracker/KeywordsTable.js:312
    10461259msgid "Search keyword, URL, location…"
    … …  
    12051418msgstr ""
    12061419
    1207 #: assets/src/app/components/rank-tracker/tableColumns.js:228
    1208 msgid "Competition"
    1209 msgstr ""
    1210 
    12111420#: assets/src/app/components/rank-tracker/tableColumns.js:236
    12121421msgid "Traffic"
    … …  
    12411450msgstr ""
    12421451
    1243 #: assets/src/app/pages/CreateProjectStep.js:21
    1244 msgid "TOP 20 every day"
    1245 msgstr ""
    1246 
    1247 #: assets/src/app/pages/CreateProjectStep.js:22
    1248 msgid "We will monitor the TOP 20 of your keywords in Google every day."
    1249 msgstr ""
    1250 
    1251 #: assets/src/app/pages/CreateProjectStep.js:29
    1252 msgid "TOP 50 every 3 days"
    1253 msgstr ""
    1254 
    1255 #: assets/src/app/pages/CreateProjectStep.js:30
    1256 msgid "We will monitor the TOP 50 of your keywords in Google every 3 days."
    1257 msgstr ""
    1258 
    1259 #: assets/src/app/pages/CreateProjectStep.js:37
    1260 msgid "TOP 100 every 7 days"
    1261 msgstr ""
    1262 
    1263 #: assets/src/app/pages/CreateProjectStep.js:38
    1264 msgid "We will monitor the TOP 100 of your keywords in Google every 7 days."
    1265 msgstr ""
    1266 
    1267 #: assets/src/app/pages/CreateProjectStep.js:78
    1268 msgid "Could not load countries."
    1269 msgstr ""
    1270 
    1271 #: assets/src/app/pages/CreateProjectStep.js:99
    1272 msgid "Enter the brand name."
    1273 msgstr ""
    1274 
    1275 #: assets/src/app/pages/CreateProjectStep.js:107
    1276 msgid "Choose a country."
    1277 msgstr ""
    1278 
    1279 #: assets/src/app/pages/CreateProjectStep.js:129
    1280 msgid "Could not create the project."
    1281 msgstr ""
    1282 
    1283 #: assets/src/app/pages/CreateProjectStep.js:137
    1284 msgid "Choose a country"
    1285 msgstr ""
    1286 
    1287 #: assets/src/app/pages/CreateProjectStep.js:153
    1288 msgid "Create your project"
    1289 msgstr ""
    1290 
    1291 #: assets/src/app/pages/CreateProjectStep.js:155
    1292 msgid "There is no TrueRanker project for this site. Fill in the brand, country and tracking frequency to get started."
    1293 msgstr ""
    1294 
    1295 #: assets/src/app/pages/CreateProjectStep.js:169
    1296 msgid "Domain"
    1297 msgstr ""
    1298 
    1299 #: assets/src/app/pages/CreateProjectStep.js:170
    1300 msgid "Taken from this WordPress site and cannot be changed."
    1301 msgstr ""
    1302 
    1303 #: assets/src/app/pages/CreateProjectStep.js:180
    1304 msgid "Enter your brand to monitor its appearances in AI-generated answers."
    1305 msgstr ""
    1306 
    1307 #: assets/src/app/pages/CreateProjectStep.js:191
    1308 msgid "Country"
    1309 msgstr ""
    1310 
    1311 #: assets/src/app/pages/CreateProjectStep.js:192
    1312 msgid "Choose the country where you want to measure visibility. Later, for each keyword, you can pick any location (even in another country)."
    1313 msgstr ""
    1314 
    1315 #: assets/src/app/pages/CreateProjectStep.js:206
    1316 msgid "Tracking"
    1317 msgstr ""
    1318 
    1319 #: assets/src/app/pages/CreateProjectStep.js:209
    1320 msgid "Choose the tracking options you want to apply to your project."
    1321 msgstr ""
    1322 
    1323 #: assets/src/app/pages/CreateProjectStep.js:217
    1324 msgid "Tracking options"
    1325 msgstr ""
    1326 
    1327 #: assets/src/app/pages/CreateProjectStep.js:254
    1328 msgid "Create project"
    1329 msgstr ""
    1330 
    1331 #: assets/src/app/pages/DashboardPage.js:40
    1332 msgid "Could not load the dashboard. Try again later."
    1333 msgstr ""
    1334 
    1335 #: assets/src/app/pages/DashboardPage.js:54
    1336 msgid "No project for this domain"
    1337 msgstr ""
    1338 
    1339 #. translators: %s: site domain
    1340 #: assets/src/app/pages/DashboardPage.js:59
    1341 #, js-format
    1342 msgid "There is no TrueRanker project for <strong>%s</strong>."
    1343 msgstr ""
    1344 
    1345 #: assets/src/app/pages/DashboardPage.js:66
    1346 msgid "Creating a project from scratch will be available soon."
    1347 msgstr ""
    1348 
     1452#: assets/src/app/pages/AiVisibilityPage.js:73
     1453msgid "Could not load AI Visibility. Try again later."
     1454msgstr ""
     1455
     1456#: assets/src/app/pages/AiVisibilityPage.js:131
     1457msgid "Could not load share of voice per LLM."
     1458msgstr ""
     1459
     1460#: assets/src/app/pages/AiVisibilityPage.js:151
    13491461#: assets/src/app/pages/DashboardPage.js:75
    13501462#: assets/src/app/pages/RankTrackerPage.js:208
    13511463msgid "No project selected."
     1464msgstr ""
     1465
     1466#: assets/src/app/pages/AiVisibilityPage.js:232
     1467msgid "Prompt results"
     1468msgstr ""
     1469
     1470#: assets/src/app/pages/AiVisibilityPage.js:254
     1471msgid "AI Visibility Changes"
     1472msgstr ""
     1473
     1474#: assets/src/app/pages/CreateProjectStep.js:21
     1475msgid "TOP 20 every day"
     1476msgstr ""
     1477
     1478#: assets/src/app/pages/CreateProjectStep.js:22
     1479msgid "We will monitor the TOP 20 of your keywords in Google every day."
     1480msgstr ""
     1481
     1482#: assets/src/app/pages/CreateProjectStep.js:29
     1483msgid "TOP 50 every 3 days"
     1484msgstr ""
     1485
     1486#: assets/src/app/pages/CreateProjectStep.js:30
     1487msgid "We will monitor the TOP 50 of your keywords in Google every 3 days."
     1488msgstr ""
     1489
     1490#: assets/src/app/pages/CreateProjectStep.js:37
     1491msgid "TOP 100 every 7 days"
     1492msgstr ""
     1493
     1494#: assets/src/app/pages/CreateProjectStep.js:38
     1495msgid "We will monitor the TOP 100 of your keywords in Google every 7 days."
     1496msgstr ""
     1497
     1498#: assets/src/app/pages/CreateProjectStep.js:78
     1499msgid "Could not load countries."
     1500msgstr ""
     1501
     1502#: assets/src/app/pages/CreateProjectStep.js:99
     1503msgid "Enter the brand name."
     1504msgstr ""
     1505
     1506#: assets/src/app/pages/CreateProjectStep.js:107
     1507msgid "Choose a country."
     1508msgstr ""
     1509
     1510#: assets/src/app/pages/CreateProjectStep.js:129
     1511msgid "Could not create the project."
     1512msgstr ""
     1513
     1514#: assets/src/app/pages/CreateProjectStep.js:137
     1515msgid "Choose a country"
     1516msgstr ""
     1517
     1518#: assets/src/app/pages/CreateProjectStep.js:153
     1519msgid "Create your project"
     1520msgstr ""
     1521
     1522#: assets/src/app/pages/CreateProjectStep.js:155
     1523msgid "There is no TrueRanker project for this site. Fill in the brand, country and tracking frequency to get started."
     1524msgstr ""
     1525
     1526#: assets/src/app/pages/CreateProjectStep.js:169
     1527msgid "Domain"
     1528msgstr ""
     1529
     1530#: assets/src/app/pages/CreateProjectStep.js:170
     1531msgid "Taken from this WordPress site and cannot be changed."
     1532msgstr ""
     1533
     1534#: assets/src/app/pages/CreateProjectStep.js:180
     1535msgid "Enter your brand to monitor its appearances in AI-generated answers."
     1536msgstr ""
     1537
     1538#: assets/src/app/pages/CreateProjectStep.js:191
     1539msgid "Country"
     1540msgstr ""
     1541
     1542#: assets/src/app/pages/CreateProjectStep.js:192
     1543msgid "Choose the country where you want to measure visibility. Later, for each keyword, you can pick any location (even in another country)."
     1544msgstr ""
     1545
     1546#: assets/src/app/pages/CreateProjectStep.js:206
     1547msgid "Tracking"
     1548msgstr ""
     1549
     1550#: assets/src/app/pages/CreateProjectStep.js:209
     1551msgid "Choose the tracking options you want to apply to your project."
     1552msgstr ""
     1553
     1554#: assets/src/app/pages/CreateProjectStep.js:217
     1555msgid "Tracking options"
     1556msgstr ""
     1557
     1558#: assets/src/app/pages/CreateProjectStep.js:254
     1559msgid "Create project"
     1560msgstr ""
     1561
     1562#: assets/src/app/pages/DashboardPage.js:40
     1563msgid "Could not load the dashboard. Try again later."
     1564msgstr ""
     1565
     1566#: assets/src/app/pages/DashboardPage.js:54
     1567msgid "No project for this domain"
     1568msgstr ""
     1569
     1570#. translators: %s: site domain
     1571#: assets/src/app/pages/DashboardPage.js:59
     1572#, js-format
     1573msgid "There is no TrueRanker project for <strong>%s</strong>."
     1574msgstr ""
     1575
     1576#: assets/src/app/pages/DashboardPage.js:66
     1577msgid "Creating a project from scratch will be available soon."
    13521578msgstr ""
    13531579
    … …  
    15601786msgstr ""
    15611787
    1562 #: assets/src/app/utils/dashboardFormat.js:138
    1563 msgid "Share of voice"
    1564 msgstr ""
    1565 
    1566 #: assets/src/app/utils/dashboardFormat.js:139
    1567 msgid "LLM coverage"
    1568 msgstr ""
    1569 
    15701788#. translators: %s: ranking position threshold
    15711789#: assets/src/app/utils/rankTrackerCharts.js:69
  • seo-local-rank/trunk/readme.txt

    r3706047 r3720851  
    11=== TrueRanker ===
    22Contributors: optimizza
    3 Tags: seo, rank tracker, google ranking, ai visibility, backlinks
     3Tags: seo, rank tracker, ai visibility, brand radar, backlinks
    44Requires at least: 6.6
    55Tested up to: 7.1
    66Requires PHP: 8.0
    7 Stable tag: 3.0.0
     7Stable tag: 3.0.1
    88License: GPLv2 or later
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
    1010
    11 Track Google rankings, AI visibility and backlinks from WordPress. Connect TrueRanker and manage SEO in the admin.
     11AI Visibility Tracker and brand radar for ChatGPT, Gemini, Claude and more — plus Google rankings and backlinks from WordPress.
    1212
    1313== Description ==
    1414
    15 TrueRanker is an SEO and AI-visibility suite: daily Google keyword rankings, local results, backlinks, site audits, competitor research, and how ChatGPT, Gemini, Claude, Perplexity, Grok, and DeepSeek cite your brand.
     15TrueRanker is the SEO suite for the AI-search era. Its flagship feature in WordPress is the **AI Visibility Tracker** — a brand radar that shows how ChatGPT, Gemini, Claude, Perplexity, Grok, and DeepSeek mention and cite your brand.
    1616
    17 This plugin is the WordPress interface to that suite. It is free and GPL-licensed. Rankings and reports live in your TrueRanker account at [trueranker.com](https://trueranker.com/). Connect with an API key (or start from scratch in the plugin) and work from the WordPress admin. TrueRanker offers a 14-day trial with no credit card.
     17Track custom prompts, measure AI visibility score, mentions, citations, sentiment, share of voice, and LLM coverage. Compare competitors and see which engines recommend you (or your rivals). All of that lives in the WordPress admin after you connect your TrueRanker account.
    1818
    19 We ship regular plugin updates so more of the suite lands in WordPress over time. This 3.0.0 release is a full rewrite of the v2 plugin.
     19You also get daily Google keyword rankings (Rank Tracker) and backlink summaries in the same dashboard. Rankings and deeper reports sync with your TrueRanker account at [trueranker.com](https://trueranker.com/). The plugin is free and GPL-licensed. TrueRanker offers a 14-day trial with no credit card.
    2020
    21 = In this plugin (3.0.0) =
     21= AI Visibility Tracker (brand radar) =
     22
     23The AI Visibility screen is a first-class WordPress admin page — not a bolted-on link:
     24
     25* **AI visibility score** with breakdown (mention rate, citation rate, sentiment, share of voice, LLM coverage).
     26* **Mentions and citations** across your prompt set, with change vs the previous period.
     27* **LLM coverage** — which of ChatGPT, Claude, Gemini, Perplexity, Grok, and DeepSeek mention your brand, and how often.
     28* **Competitors and share of voice** — see your brand radar against rivals, including share of voice per LLM and over time.
     29* **Prompt results** — a table of prompts by location, presence on each AI engine (mention / citation), sentiment, and trend.
     30* **Score trend** — score, mentions, and citations over time.
     31* **AI Visibility Changes** — when engines start or stop citing you for a prompt.
     32
     33Add and manage prompts from your TrueRanker account (opened signed-in from the plugin). Tracking and reporting for AI search stay in WordPress once data is available.
     34
     35= Also in this plugin =
    2236
    2337* **Onboarding.** Connect with your TrueRanker API key, or enter your email and TrueRanker sends the key to that address. If several projects match this site, pick one. If none match, create a project for the site domain.
    24 * **Dashboard.** KPIs and charts for Rank Tracker (average position, organic visibility, keyword count), AI Visibility (score, mentions, citations), and backlinks (referring domains, tracked links, domain rank). If SEO audits are enabled on the account, a score summary is shown too. Managing AI prompts, exploring backlinks, or running audits opens your TrueRanker account (signed in), not a separate WordPress screen.
    25 * **Rank Tracker.** Date range, summaries (average position, keyword distribution, AI Overviews), a sortable table (position, change, volume, CPC, Search Console metrics, Local Pack, URL, and more), keyword history and SERP snapshot, and add keywords by location and device (desktop, mobile, or both).
     38* **Dashboard.** KPIs and charts for Rank Tracker, AI Visibility (score, mentions, citations), and backlinks. If SEO audits are enabled on the account, a score summary is shown too.
     39* **Rank Tracker.** Date range, summaries (average position, keyword distribution, AI Overviews), a sortable keyword table, history/SERP snapshot, and add keywords by location and device (desktop, mobile, or both).
    2640* **Settings.** Active project and log out.
    2741* **Language.** English or Spanish, following the WordPress site language. Other locales fall back to English.
    … …  
    2943= In your TrueRanker account =
    3044
    31 These tools are part of the TrueRanker suite today. They are available in your account at [trueranker.com](https://trueranker.com/); they are not WordPress admin screens in 3.0.0:
     45These suite tools are available at [trueranker.com](https://trueranker.com/); they are not separate WordPress admin screens yet:
    3246
    3347* Local SEO tracker (map-pack / geo-grid)
    3448* Full SEO audit crawler
    35 * Competitor research
     49* Competitor research beyond the AI Visibility competitor cards
    3650* White-label and scheduled reports
    37 * AI Visibility prompt setup and engine-by-engine tracking
    3851* Backlink explorer and disavow workflow
     52* AI Visibility prompt creation and advanced setup
    3953
    4054= External service =
    … …  
    5670== Frequently Asked Questions ==
    5771
     72= What is the AI Visibility Tracker / brand radar? =
     73
     74It is TrueRanker's AI Visibility Tracker: a brand radar for generative search. In WordPress you see how often ChatGPT, Gemini, Claude, Perplexity, Grok, and DeepSeek mention or cite your brand for the prompts you track — including score, share of voice vs competitors, LLM coverage, sentiment, and prompt-level results. Prompt setup opens your TrueRanker account; the tracker UI runs in the WordPress admin.
     75
    5876= Where do I get my API key? =
    5977
    … …  
    6280= Do I need a TrueRanker account? =
    6381
    64 Yes. The plugin is free (GPLv2 or later). Rank tracking and the rest of the suite run on TrueRanker's service. Plans and the 14-day trial are on [trueranker.com](https://trueranker.com/).
     82Yes. The plugin is free (GPLv2 or later). AI Visibility tracking, rank tracking, and the rest of the suite run on TrueRanker's service. Plans and the 14-day trial are on [trueranker.com](https://trueranker.com/).
    6583
    6684= What data is sent to TrueRanker? =
    … …  
    7088When you start from scratch, the plugin sends the email address you type and a language code (`en` or `es`) from your WordPress locale. The API key is emailed to you and is not returned in the plugin response.
    7189
    72 After you connect, the plugin stores the API key on the server only (it is never exposed to the admin JavaScript). Authenticated requests send a session token plus what you do in the UI: this site's URL, project IDs, date ranges, and keywords with locations and device. All of that goes to `https://app.trueranker.com`.
     90After you connect, the plugin stores the API key on the server only (it is never exposed to the admin JavaScript). Authenticated requests send a session token plus what you do in the UI: this site's URL, project IDs, date ranges, keywords with locations and device, and AI Visibility project data. All of that goes to `https://app.trueranker.com`.
    7391
    7492= Will my settings be preserved when upgrading from v2? =
    … …  
    7896= What if my site runs an older WordPress or PHP? =
    7997
    80 3.0.0 requires WordPress 6.6+ and PHP 8.0+. WordPress will not offer this update on sites below those versions. Stay on 2.3.0 until you can upgrade the stack.
     983.0.x requires WordPress 6.6+ and PHP 8.0+. WordPress will not offer this update on sites below those versions. Stay on 2.3.0 until you can upgrade the stack.
    8199
    82100= The v2 plugin had a Dutch translation. Is it still included? =
    83101
    84 No. 3.0.0 ships English (source) and Spanish (`es_ES`, also used for other `es_*` locales). Other languages show English until a translation is added.
     102No. 3.0.x ships English (source) and Spanish (`es_ES`, also used for other `es_*` locales). Other languages show English until a translation is added.
    85103
    86104== Screenshots ==
    … …  
    901083. Keyword history, search trend and Google's top 10 URLs
    911094. Add keywords by location and device
     1105. AI Visibility Tracker brand radar: score, mentions, citations, LLM coverage and competitors share of voice
     1116. Prompt results across ChatGPT, Claude, Gemini, Perplexity, Grok and DeepSeek with sentiment and trend
     1127. Share of voice per LLM and share of voice over time for your brand vs competitors
    92113
    93114== Third-party resources ==
    … …  
    118139
    119140== Changelog ==
     141
     142= 3.0.1 =
     143* AI Visibility Tracker in WordPress: brand radar with score, mentions, citations, LLM coverage, competitors, prompt results, share of voice, and changes
     144* New screenshots for the AI Visibility Tracker (score overview, prompt results, share of voice)
     145* Readme and plugin description updated to highlight AI Visibility / brand radar across ChatGPT, Gemini, Claude, Perplexity, Grok, and DeepSeek
     146* Tested up to WordPress 7.1
    120147
    121148= 3.0.0 =
    … …  
    154181== Upgrade Notice ==
    155182
     183= 3.0.1 =
     184Adds the AI Visibility Tracker (brand radar) screen in WordPress with new screenshots. Requires PHP 8.0+ and WordPress 6.6+.
     185
    156186= 3.0.0 =
    157187Major rewrite. Your API key and selected domain are migrated automatically. Requires PHP 8.0+ and WordPress 6.6+.
  • seo-local-rank/trunk/seolocalrank.php

    r3706047 r3720851  
    1010 * Plugin Name:       TrueRanker
    1111 * Plugin URI:        https://trueranker.com
    12  * Description:       Track Google rankings, AI visibility and backlinks from WordPress. Connect TrueRanker and manage SEO in the admin.
    13  * Version:           3.0.0
     12 * Description:       AI Visibility Tracker (brand radar) for ChatGPT and more, plus Google rankings and backlinks from WordPress.
     13 * Version:           3.0.1
    1414 * Requires at least: 6.6
    1515 * Requires PHP:      8.0
    … …  
    2828}
    2929
    30 define( 'SLR_VERSION', '3.0.0' );
     30define( 'SLR_VERSION', '3.0.1' );
    3131define( 'SLR_PLUGIN_FILE', __FILE__ );
    3232define( 'SLR_PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
  • seo-local-rank/trunk/src/Admin/Assets.php

    r3706047 r3720851  
    7979                                'upgradeUrl'   => Options::get_upgrade_url(),
    8080                                'lang'         => Options::get_api_lang(),
     81                                'pageLang'     => Options::get_app_page_lang(),
    8182                                'version'      => SLR_VERSION,
    8283                                'page'         => $page,
  • seo-local-rank/trunk/src/Admin/Menu.php

    r3706047 r3720851  
    5858                add_submenu_page(
    5959                        self::PAGE_SLUG,
     60                        __( 'AI Visibility', 'seo-local-rank' ),
     61                        __( 'AI Visibility', 'seo-local-rank' ),
     62                        'manage_seolocalrank',
     63                        self::PAGE_SLUG . '-ai-visibility',
     64                        array( Screen::class, 'render' )
     65                );
     66
     67                add_submenu_page(
     68                        self::PAGE_SLUG,
    6069                        __( 'Settings', 'seo-local-rank' ),
    6170                        __( 'Settings', 'seo-local-rank' ),
  • seo-local-rank/trunk/src/Api/Endpoints.php

    r3706047 r3720851  
    3838        public const KEYWORD_PAUSE                  = '/keyword/pause';
    3939        public const PROVINCE_SEARCH                = '/province/search';
    40         public const AI_VISIBILITY_GET_DASHBOARD    = '/ai-visibility/get-dashboard';
    41         public const PROJECT_DOMAIN_BACKLINKS       = '/project/domain/backlinks';
     40        public const AI_VISIBILITY_GET_DASHBOARD       = '/ai-visibility/get-dashboard';
     41        public const AI_VISIBILITY_PAGE_LOAD           = '/ai-visibility/page-load';
     42        public const AI_VISIBILITY_GET_SHARE_OF_VOICE  = '/ai-visibility/get-share-of-voice';
     43        public const PROJECT_DOMAIN_BACKLINKS          = '/project/domain/backlinks';
    4244
    4345        /**
  • seo-local-rank/trunk/src/Rest/Controllers/DomainsController.php

    r3706047 r3720851  
    120120                register_rest_route(
    121121                        'seo-local-rank/v1',
     122                        '/domains/ai-visibility',
     123                        array(
     124                                'methods'             => 'GET',
     125                                'callback'            => array( $this, 'get_ai_visibility' ),
     126                                'permission_callback' => array( 'SeoLocalRank\\Rest\\RestPermissions', 'can_manage' ),
     127                                'args'                => array(
     128                                        'project_domain_id' => array(
     129                                                'type'              => 'integer',
     130                                                'required'          => false,
     131                                                'sanitize_callback' => 'absint',
     132                                        ),
     133                                        'start'             => array(
     134                                                'type'              => 'string',
     135                                                'required'          => false,
     136                                                'sanitize_callback' => 'sanitize_text_field',
     137                                        ),
     138                                        'end'               => array(
     139                                                'type'              => 'string',
     140                                                'required'          => false,
     141                                                'sanitize_callback' => 'sanitize_text_field',
     142                                        ),
     143                                ),
     144                        )
     145                );
     146
     147                register_rest_route(
     148                        'seo-local-rank/v1',
     149                        '/domains/ai-visibility/share-of-voice',
     150                        array(
     151                                'methods'             => 'GET',
     152                                'callback'            => array( $this, 'get_ai_visibility_share_of_voice' ),
     153                                'permission_callback' => array( 'SeoLocalRank\\Rest\\RestPermissions', 'can_manage' ),
     154                                'args'                => array(
     155                                        'project_domain_id' => array(
     156                                                'type'              => 'integer',
     157                                                'required'          => false,
     158                                                'sanitize_callback' => 'absint',
     159                                        ),
     160                                        'start'             => array(
     161                                                'type'              => 'string',
     162                                                'required'          => false,
     163                                                'sanitize_callback' => 'sanitize_text_field',
     164                                        ),
     165                                        'end'               => array(
     166                                                'type'              => 'string',
     167                                                'required'          => false,
     168                                                'sanitize_callback' => 'sanitize_text_field',
     169                                        ),
     170                                ),
     171                        )
     172                );
     173
     174                register_rest_route(
     175                        'seo-local-rank/v1',
    122176                        '/domains/countries',
    123177                        array(
    … …  
    416470
    417471                return new WP_REST_Response( $response, 200 );
     472        }
     473
     474        /**
     475         * GET /domains/ai-visibility — AI Visibility page payload (page-load).
     476         *
     477         * @param WP_REST_Request $request Request.
     478         */
     479        public function get_ai_visibility( WP_REST_Request $request ): WP_REST_Response {
     480                $requested_id = (int) $request->get_param( 'project_domain_id' );
     481                $project_id   = $requested_id > 0 ? $requested_id : Options::get_project_domain_id();
     482                $start        = $this->sanitize_ymd_date( $request->get_param( 'start' ) );
     483                $end          = $this->sanitize_ymd_date( $request->get_param( 'end' ) );
     484
     485                if ( $project_id <= 0 ) {
     486                        return new WP_REST_Response(
     487                                array(
     488                                        'ok'      => false,
     489                                        'message' => __( 'Select a project for this site before loading AI Visibility.', 'seo-local-rank' ),
     490                                ),
     491                                400
     492                        );
     493                }
     494
     495                try {
     496                        $payload = $this->fetch_domains_for_site();
     497                } catch ( ApiException $exception ) {
     498                        return new WP_REST_Response(
     499                                array(
     500                                        'ok'         => false,
     501                                        'message'    => $exception->getMessage(),
     502                                        'error_code' => $exception->get_error_code_key(),
     503                                ),
     504                                400
     505                        );
     506                }
     507
     508                $domains = $payload['domains'];
     509
     510                if ( ! $this->domain_id_in_list( $project_id, $domains ) ) {
     511                        return new WP_REST_Response(
     512                                array(
     513                                        'ok'      => false,
     514                                        'message' => __( 'The selected project is not available for this site.', 'seo-local-rank' ),
     515                                ),
     516                                400
     517                        );
     518                }
     519
     520                $body = array(
     521                        'project_domain_id' => $project_id,
     522                );
     523
     524                if ( '' !== $start && '' !== $end ) {
     525                        $body['start_date'] = $start;
     526                        $body['end_date']   = $end;
     527                }
     528
     529                try {
     530                        $response = $this->auth->request(
     531                                Endpoints::AI_VISIBILITY_PAGE_LOAD,
     532                                $body,
     533                                Client::TIMEOUT_GET_DATA
     534                        );
     535                } catch ( ApiException $exception ) {
     536                        return new WP_REST_Response(
     537                                array(
     538                                        'ok'         => false,
     539                                        'message'    => $exception->getMessage(),
     540                                        'error_code' => $exception->get_error_code_key(),
     541                                ),
     542                                400
     543                        );
     544                }
     545
     546                $data = is_array( $response['data'] ?? null ) ? $response['data'] : array();
     547                $data = $this->strip_ranktracker_secrets( $data );
     548
     549                $date_range = is_array( $response['date_range'] ?? null ) ? $response['date_range'] : array();
     550
     551                return new WP_REST_Response(
     552                        array(
     553                                'ok'         => true,
     554                                'data'       => $data,
     555                                'date_range' => $date_range,
     556                        ),
     557                        200
     558                );
     559        }
     560
     561        /**
     562         * GET /domains/ai-visibility/share-of-voice — share of voice per LLM.
     563         *
     564         * @param WP_REST_Request $request Request.
     565         */
     566        public function get_ai_visibility_share_of_voice( WP_REST_Request $request ): WP_REST_Response {
     567                $requested_id = (int) $request->get_param( 'project_domain_id' );
     568                $project_id   = $requested_id > 0 ? $requested_id : Options::get_project_domain_id();
     569                $start        = $this->sanitize_ymd_date( $request->get_param( 'start' ) );
     570                $end          = $this->sanitize_ymd_date( $request->get_param( 'end' ) );
     571
     572                if ( $project_id <= 0 ) {
     573                        return new WP_REST_Response(
     574                                array(
     575                                        'ok'      => false,
     576                                        'message' => __( 'Select a project for this site before loading AI Visibility.', 'seo-local-rank' ),
     577                                ),
     578                                400
     579                        );
     580                }
     581
     582                try {
     583                        $payload = $this->fetch_domains_for_site();
     584                } catch ( ApiException $exception ) {
     585                        return new WP_REST_Response(
     586                                array(
     587                                        'ok'         => false,
     588                                        'message'    => $exception->getMessage(),
     589                                        'error_code' => $exception->get_error_code_key(),
     590                                ),
     591                                400
     592                        );
     593                }
     594
     595                $domains = $payload['domains'];
     596
     597                if ( ! $this->domain_id_in_list( $project_id, $domains ) ) {
     598                        return new WP_REST_Response(
     599                                array(
     600                                        'ok'      => false,
     601                                        'message' => __( 'The selected project is not available for this site.', 'seo-local-rank' ),
     602                                ),
     603                                400
     604                        );
     605                }
     606
     607                $body = array(
     608                        'project_domain_id' => $project_id,
     609                );
     610
     611                if ( '' !== $start && '' !== $end ) {
     612                        $body['start_date'] = $start;
     613                        $body['end_date']   = $end;
     614                }
     615
     616                try {
     617                        $response = $this->auth->request(
     618                                Endpoints::AI_VISIBILITY_GET_SHARE_OF_VOICE,
     619                                $body,
     620                                Client::TIMEOUT_GET_DATA
     621                        );
     622                } catch ( ApiException $exception ) {
     623                        return new WP_REST_Response(
     624                                array(
     625                                        'ok'         => false,
     626                                        'message'    => $exception->getMessage(),
     627                                        'error_code' => $exception->get_error_code_key(),
     628                                ),
     629                                400
     630                        );
     631                }
     632
     633                $data    = is_array( $response['data'] ?? null ) ? $response['data'] : array();
     634                $per_llm = $data['per_llm'] ?? array();
     635
     636                if ( ! is_array( $per_llm ) ) {
     637                        $per_llm = array();
     638                }
     639
     640                return new WP_REST_Response(
     641                        array(
     642                                'ok'   => true,
     643                                'data' => array(
     644                                        'per_llm' => array_values( $per_llm ),
     645                                ),
     646                        ),
     647                        200
     648                );
    418649        }
    419650
    … …  
    721952                }
    722953
     954                if ( isset( $data['selectedDomain'] ) && is_array( $data['selectedDomain'] ) ) {
     955                        unset( $data['selectedDomain']['gsc_access_token'] );
     956                }
     957
    723958                if ( isset( $data['domains'] ) && is_array( $data['domains'] ) ) {
    724959                        foreach ( $data['domains'] as $index => $domain ) {
  • seo-local-rank/trunk/src/Settings/Options.php

    r3706047 r3720851  
    6060         */
    6161        public static function get_api_lang(): string {
    62                 $locale = determine_locale();
     62                return 'es' === self::get_app_page_lang() ? 'es' : 'en';
     63        }
    6364
    64                 return str_starts_with( $locale, 'es' ) ? 'es' : 'en';
     65        /**
     66         * TrueRanker UI language for SSO `ptg` paths (es, en, de, fr, pt, it, nl).
     67         */
     68        public static function get_app_page_lang(): string {
     69                $locale = strtolower( determine_locale() );
     70                $langs  = array( 'es', 'de', 'fr', 'pt', 'it', 'nl' );
     71
     72                foreach ( $langs as $lang ) {
     73                        if ( str_starts_with( $locale, $lang ) ) {
     74                                return $lang;
     75                        }
     76                }
     77
     78                return 'en';
    6579        }
    6680
    … …  
    8498
    8599        /**
    86          * Internal TrueRanker path (`ptg`) for an app page, localized es/en.
     100         * Internal TrueRanker path (`ptg`) for an app page, localized by WP locale.
    87101         *
    88102         * @param string $page               Destination key (upgrade, ai_visibility, …).
    … …  
    90104         */
    91105        public static function get_app_page_ptg( string $page, int $project_domain_id = 0 ): ?string {
    92                 $es = 'es' === self::get_api_lang();
     106                $lang = self::get_app_page_lang();
     107                $es   = 'es' === $lang;
    93108
    94109                switch ( $page ) {
    … …  
    101116                                }
    102117
    103                                 return $es
    104                                         ? sprintf( '/admin/dominio/visibilidad-ia/%d', $project_domain_id )
    105                                         : sprintf( '/en/admin/domain/ai-visibility/%d', $project_domain_id );
     118                                $paths = array(
     119                                        'es' => '/admin/dominio/visibilidad-ia/%d',
     120                                        'en' => '/en/admin/domain/ai-visibility/%d',
     121                                        'de' => '/de/admin/domain/ki-sichtbarkeit/%d',
     122                                        'fr' => '/fr/admin/domain/visibilite-ia/%d',
     123                                        'pt' => '/pt/admin/domain/visibilidade-ia/%d',
     124                                        'it' => '/it/admin/domain/visibilita-ia/%d',
     125                                        'nl' => '/nl/admin/domain/ai-zichtbaarheid/%d',
     126                                );
     127
     128                                return sprintf( $paths[ $lang ] ?? $paths['en'], $project_domain_id );
    106129
    107130                        case 'backlinks':
  • seo-local-rank/trunk/vendor/autoload.php

    r3706047 r3720851  
    1010require_once __DIR__ . '/composer/autoload_real.php';
    1111
    12 return ComposerAutoloaderInitc36edecd97896e353fd34f4becada30c::getLoader();
     12return ComposerAutoloaderInitaf5c655ed6fa2c9523abc3153ce63ac8::getLoader();
  • seo-local-rank/trunk/vendor/composer/autoload_real.php

    r3706047 r3720851  
    33// autoload_real.php @generated by Composer
    44
    5 class ComposerAutoloaderInitc36edecd97896e353fd34f4becada30c
     5class ComposerAutoloaderInitaf5c655ed6fa2c9523abc3153ce63ac8
    66{
    77    private static $loader;
    … …  
    2525        require __DIR__ . '/platform_check.php';
    2626
    27         spl_autoload_register(array('ComposerAutoloaderInitc36edecd97896e353fd34f4becada30c', 'loadClassLoader'), true, true);
     27        spl_autoload_register(array('ComposerAutoloaderInitaf5c655ed6fa2c9523abc3153ce63ac8', 'loadClassLoader'), true, true);
    2828        self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__));
    29         spl_autoload_unregister(array('ComposerAutoloaderInitc36edecd97896e353fd34f4becada30c', 'loadClassLoader'));
     29        spl_autoload_unregister(array('ComposerAutoloaderInitaf5c655ed6fa2c9523abc3153ce63ac8', 'loadClassLoader'));
    3030
    3131        require __DIR__ . '/autoload_static.php';
    32         call_user_func(\Composer\Autoload\ComposerStaticInitc36edecd97896e353fd34f4becada30c::getInitializer($loader));
     32        call_user_func(\Composer\Autoload\ComposerStaticInitaf5c655ed6fa2c9523abc3153ce63ac8::getInitializer($loader));
    3333
    3434        $loader->setClassMapAuthoritative(true);
  • seo-local-rank/trunk/vendor/composer/autoload_static.php

    r3706047 r3720851  
    55namespace Composer\Autoload;
    66
    7 class ComposerStaticInitc36edecd97896e353fd34f4becada30c
     7class ComposerStaticInitaf5c655ed6fa2c9523abc3153ce63ac8
    88{
    99    public static $prefixLengthsPsr4 = array (
    … …  
    5050    {
    5151        return \Closure::bind(function () use ($loader) {
    52             $loader->prefixLengthsPsr4 = ComposerStaticInitc36edecd97896e353fd34f4becada30c::$prefixLengthsPsr4;
    53             $loader->prefixDirsPsr4 = ComposerStaticInitc36edecd97896e353fd34f4becada30c::$prefixDirsPsr4;
    54             $loader->classMap = ComposerStaticInitc36edecd97896e353fd34f4becada30c::$classMap;
     52            $loader->prefixLengthsPsr4 = ComposerStaticInitaf5c655ed6fa2c9523abc3153ce63ac8::$prefixLengthsPsr4;
     53            $loader->prefixDirsPsr4 = ComposerStaticInitaf5c655ed6fa2c9523abc3153ce63ac8::$prefixDirsPsr4;
     54            $loader->classMap = ComposerStaticInitaf5c655ed6fa2c9523abc3153ce63ac8::$classMap;
    5555
    5656        }, null, ClassLoader::class);
Note: See TracChangeset for help on using the changeset viewer.