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B,EAAgBtB,GAAW,EAE5B,OAAO3B,EAAoBU,EAAEr0C,EAC9B,EAEIs3C,EAAqBC,KAAwB,kBAAIA,KAAwB,mBAAK,GAClFD,EAAmBtuE,QAAQkuE,EAAqBT,KAAK,KAAM,IAC3Da,EAAmBpuE,KAAOguE,EAAqBT,KAAK,KAAMa,EAAmBpuE,KAAKutE,KAAKa,G,ICpFvF,IAAIE,EAAsB7D,EAAoBU,OAAEvpE,EAAW,CAAC,IAAI,MAAM,WAAa,OAAO6oE,EAAoB,KAAO,IACrH6D,EAAsB7D,EAAoBU,EAAEmD,E","sources":["webpack://myvue/webpack/runtime/chunk loaded","webpack://myvue/webpack/runtime/create fake namespace object","webpack://myvue/webpack/runtime/load script","webpack://myvue/./src/trends/App.vue?ffc9","webpack://myvue/./src/components/trends/Plots3.vue","webpack://myvue/./src/lib/ApiCom.ts","webpack://myvue/./src/lib/myd3/dom/ElementBuilder.ts","webpack://myvue/./src/lib/myd3/tooltip/HoverTooltip.ts","webpack://myvue/./src/lib/myd3/tooltip/TrendTooltip.ts","webpack://myvue/./src/lib/myd3/core/Series.ts","webpack://myvue/./src/lib/myd3/core/PlotModel.ts","webpack://myvue/./src/lib/myd3/core/DisplaySettings.ts","webpack://myvue/./src/lib/myd3/core/MultiSeries.ts","webpack://myvue/./src/lib/myd3/renderables/TraceRenderable.ts","webpack://myvue/./src/lib/myd3/utils/significance.ts","webpack://myvue/./src/lib/myd3/renderables/TrendRenderables.ts","webpack://myvue/./src/lib/myd3/renderables/RectangleRenderable.ts","webpack://myvue/./src/lib/myd3/tooltip/Tooltip.ts","webpack://myvue/./src/lib/myd3/renderables/ScatterLinesRenderable.ts","webpack://myvue/./src/lib/myd3/renderables/ChartRenderables.ts","webpack://myvue/./src/lib/myd3/renderables/HeatmapRenderable.ts","webpack://myvue/./src/lib/myd3/renderables/RadialBarsRenderable.ts","webpack://myvue/./src/lib/myd3/handlers/TraceHandler.ts","webpack://myvue/./src/lib/myd3/interaction/SettingsPanel.ts","webpack://myvue/./src/lib/myd3/interaction/ZoomController.ts","webpack://myvue/./src/lib/myd3/MyD3.ts","webpack://myvue/./src/lib/inla/inlaTrendToTraces.ts","webpack://myvue/./src/lib/trends/mergeObsPlots.js","webpack://myvue/./src/lib/trends/plotDisplayStore.js","webpack://myvue/./src/store/trends.ts","webpack://myvue/./src/components/trends/MyBase.vue?397c","webpack://myvue/./src/components/trends/MyBase.vue","webpack://myvue/./src/lib/inla/resolvePlotModel.ts","webpack://myvue/./src/components/trends/settings/MyPlotSettings.ts","webpack://myvue/./src/trends/map.ts","webpack://myvue/./src/components/trends/PlotsBase.vue","webpack://myvue/./src/components/trends/PlotsBase.vue?1bcb","webpack://myvue/./src/lib/siteShortcuts.ts","webpack://myvue/./src/components/trends/PlotCard.vue","webpack://myvue/./src/components/trends/PlotContent.vue","webpack://myvue/./src/components/trends/PlotContent.vue?1eaa","webpack://myvue/./src/components/trends/cards/MyTrendCard.vue","webpack://myvue/./src/components/trends/cards/MyTrendCard.vue?d531","webpack://myvue/./src/components/trends/ObsTypeSelect.vue","webpack://myvue/./src/components/trends/ObsTypeSelect.vue?c347","webpack://myvue/./src/components/trends/PlotCard.vue?772d","webpack://myvue/./src/components/trends/cards/TcMap.vue","webpack://myvue/./src/components/trends/cards/TcMap.vue?c1dc","webpack://myvue/./src/components/trends/settings/PlotSettings2.vue","webpack://myvue/./src/components/trends/settings/PlotSettingsBase.vue?cbeb","webpack://myvue/./src/components/trends/settings/PlotSettingsBase.vue","webpack://myvue/./src/components/trends/settings/PlotSettings2.vue?671a","webpack://myvue/./src/components/trends/cards/SpeciesImage.vue","webpack://myvue/./src/components/trends/cards/SpeciesImage.vue?bfa0","webpack://myvue/./src/components/trends/SpeciesImageCarousel.vue","webpack://myvue/./src/components/trends/SpeciesImageCarousel.vue?2c19","webpack://myvue/./src/components/trends/cards/PlotErrorSmall.vue","webpack://myvue/./src/components/trends/cards/PlotErrorSmall.vue?03ac","webpack://myvue/./src/components/trends/cards/TcMore.vue","webpack://myvue/./src/components/trends/cards/ContributorsAccordion.vue","webpack://myvue/./src/components/trends/cards/ContributorsAccordion.vue?55ca","webpack://myvue/./src/components/trends/cards/TrimInfo.vue","webpack://myvue/./src/components/trends/cards/TrimInfo.vue?2d2d","webpack://myvue/./src/components/trends/cards/TimingsInfo.vue","webpack://myvue/./src/components/trends/cards/TimingsInfo.vue?af5b","webpack://myvue/./src/components/trends/cards/DownloadData.vue","webpack://myvue/./src/components/trends/cards/DownloadData.vue?0e0f","webpack://myvue/./src/components/trends/GofDiagnostics.vue","webpack://myvue/./src/components/trends/GofDiagnostics.vue?e1ba","webpack://myvue/./src/components/trends/cards/TcMore.vue?1a25","webpack://myvue/./src/components/trends/cards/InlaComponentCard.vue","webpack://myvue/./src/components/account/admin/InlaSpatialMap.vue","webpack://myvue/./src/components/account/MyBase.vue?86c3","webpack://myvue/./src/components/account/MyBase.vue","webpack://myvue/./src/lib/inla/inverseLink.ts","webpack://myvue/./src/components/account/dashboard/tooltip.js","webpack://myvue/./src/components/account/admin/InlaSpatialMap.vue?305b","webpack://myvue/./src/components/trends/cards/InlaComponentCard.vue?9740","webpack://myvue/./src/components/trends/cards/SpeciesPreviewCarousel.vue","webpack://myvue/./src/components/trends/cards/SpeciesPreviewCarousel.vue?025b","webpack://myvue/./src/components/trends/TrendComponentGAM.vue","webpack://myvue/./src/components/trends/TrendComponentGAM.vue?4466","webpack://myvue/./src/components/trends/Plots3.vue?195d","webpack://myvue/./src/trends/App.vue?2ef3","webpack://myvue/./src/trends/App.vue","webpack://myvue/./src/trends/main.ts","webpack://myvue/./src/account/i18n.ts","webpack://myvue/./src/locales/ lazy ^\\.\\/.*\\.json$ chunkName: locale-[request] namespace object","webpack://myvue/webpack/bootstrap","webpack://myvue/webpack/runtime/compat get default export","webpack://myvue/webpack/runtime/define property getters","webpack://myvue/webpack/runtime/ensure chunk","webpack://myvue/webpack/runtime/get javascript chunk filename","webpack://myvue/webpack/runtime/get mini-css chunk filename","webpack://myvue/webpack/runtime/global","webpack://myvue/webpack/runtime/hasOwnProperty shorthand","webpack://myvue/webpack/runtime/make namespace object","webpack://myvue/webpack/runtime/runtimeId","webpack://myvue/webpack/runtime/publicPath","webpack://myvue/webpack/runtime/jsonp chunk loading","webpack://myvue/webpack/startup"],"sourcesContent":["var deferred = [];\n__webpack_require__.O = function(result, chunkIds, fn, priority) {\n\tif(chunkIds) {\n\t\tpriority = priority || 0;\n\t\tfor(var i = deferred.length; i > 0 && deferred[i - 1][2] > priority; i--) deferred[i] = deferred[i - 1];\n\t\tdeferred[i] = [chunkIds, fn, priority];\n\t\treturn;\n\t}\n\tvar notFulfilled = Infinity;\n\tfor (var i = 0; i < deferred.length; i++) {\n\t\tvar chunkIds = deferred[i][0];\n\t\tvar fn = deferred[i][1];\n\t\tvar priority = deferred[i][2];\n\t\tvar fulfilled = true;\n\t\tfor (var j = 0; j < chunkIds.length; j++) {\n\t\t\tif ((priority & 1 === 0 || notFulfilled >= priority) && Object.keys(__webpack_require__.O).every(function(key) { return __webpack_require__.O[key](chunkIds[j]); })) {\n\t\t\t\tchunkIds.splice(j--, 1);\n\t\t\t} else {\n\t\t\t\tfulfilled = false;\n\t\t\t\tif(priority < notFulfilled) notFulfilled = priority;\n\t\t\t}\n\t\t}\n\t\tif(fulfilled) {\n\t\t\tdeferred.splice(i--, 1)\n\t\t\tvar r = fn();\n\t\t\tif (r !== undefined) result = r;\n\t\t}\n\t}\n\treturn result;\n};","var getProto = Object.getPrototypeOf ? function(obj) { return Object.getPrototypeOf(obj); } : function(obj) { return obj.__proto__; };\nvar leafPrototypes;\n// create a fake namespace object\n// mode & 1: value is a module id, require it\n// mode & 2: merge all properties of value into the ns\n// mode & 4: return value when already ns object\n// mode & 16: return value when it's Promise-like\n// mode & 8|1: behave like require\n__webpack_require__.t = function(value, mode) {\n\tif(mode & 1) value = this(value);\n\tif(mode & 8) return value;\n\tif(typeof value === 'object' && value) {\n\t\tif((mode & 4) && value.__esModule) return value;\n\t\tif((mode & 16) && typeof value.then === 'function') return value;\n\t}\n\tvar ns = Object.create(null);\n\t__webpack_require__.r(ns);\n\tvar def = {};\n\tleafPrototypes = leafPrototypes || [null, getProto({}), getProto([]), getProto(getProto)];\n\tfor(var current = mode & 2 && value; typeof current == 'object' && !~leafPrototypes.indexOf(current); current = getProto(current)) {\n\t\tObject.getOwnPropertyNames(current).forEach(function(key) { def[key] = function() { return value[key]; }; });\n\t}\n\tdef['default'] = function() { return value; };\n\t__webpack_require__.d(ns, def);\n\treturn ns;\n};","var inProgress = {};\nvar dataWebpackPrefix = \"myvue:\";\n// loadScript function to load a script via script tag\n__webpack_require__.l = function(url, done, key, chunkId) {\n\tif(inProgress[url]) { inProgress[url].push(done); return; }\n\tvar script, needAttach;\n\tif(key !== undefined) {\n\t\tvar scripts = document.getElementsByTagName(\"script\");\n\t\tfor(var i = 0; i < scripts.length; i++) {\n\t\t\tvar s = scripts[i];\n\t\t\tif(s.getAttribute(\"src\") == url || s.getAttribute(\"data-webpack\") == dataWebpackPrefix + key) { script = s; break; }\n\t\t}\n\t}\n\tif(!script) {\n\t\tneedAttach = true;\n\t\tscript = document.createElement('script');\n\n\t\tscript.charset = 'utf-8';\n\t\tscript.timeout = 120;\n\t\tif (__webpack_require__.nc) {\n\t\t\tscript.setAttribute(\"nonce\", __webpack_require__.nc);\n\t\t}\n\t\tscript.setAttribute(\"data-webpack\", dataWebpackPrefix + key);\n\n\t\tscript.src = url;\n\t}\n\tinProgress[url] = [done];\n\tvar onScriptComplete = function(prev, event) {\n\t\t// avoid mem leaks in IE.\n\t\tscript.onerror = script.onload = null;\n\t\tclearTimeout(timeout);\n\t\tvar doneFns = inProgress[url];\n\t\tdelete inProgress[url];\n\t\tscript.parentNode && script.parentNode.removeChild(script);\n\t\tdoneFns && doneFns.forEach(function(fn) { return fn(event); });\n\t\tif(prev) return prev(event);\n\t}\n\tvar timeout = setTimeout(onScriptComplete.bind(null, undefined, { type: 'timeout', target: script }), 120000);\n\tscript.onerror = onScriptComplete.bind(null, script.onerror);\n\tscript.onload = onScriptComplete.bind(null, script.onload);\n\tneedAttach && document.head.appendChild(script);\n};","import { createElementVNode as _createElementVNode, openBlock as _openBlock, createElementBlock as _createElementBlock, resolveComponent as _resolveComponent, createVNode as _createVNode, createStaticVNode as _createStaticVNode, Fragment as _Fragment } from \"vue\"\n\nconst _hoisted_1 = {\n  xmlns: \"http://www.w3.org/2000/svg\",\n  style: {\"display\":\"none\"}\n}\nconst _hoisted_2 = /*#__PURE__*/_createStaticVNode(\"<symbol id=\\\"map1\\\" viewBox=\\\"0 0 16 16\\\" fill=\\\"currentColor\\\"><path fill-rule=\\\"evenodd\\\" d=\\\"M15.817.113A.5.5 0 0 1 16 .5v14a.5.5 0 0 1-.402.49l-5 1a.502.502 0 0 1-.196 0L5.5 15.01l-4.902.98A.5.5 0 0 1 0 15.5v-14a.5.5 0 0 1 .402-.49l5-1a.5.5 0 0 1 .196 0L10.5.99l4.902-.98a.5.5 0 0 1 .415.103zM10 1.91l-4-.8v12.98l4 .8V1.91zm1 12.98 4-.8V1.11l-4 .8v12.98zm-6-.8V1.11l-4 .8v12.98l4-.8z\\\"></path></symbol><symbol id=\\\"person-heart\\\" viewBox=\\\"0 0 16 16\\\" fill=\\\"currentColor\\\"><path d=\\\"M9 5a3 3 0 1 1-6 0 3 3 0 0 1 6 0Zm-9 8c0 1 1 1 1 1h10s1 0 1-1-1-4-6-4-6 3-6 4Zm13.5-8.09c1.387-1.425 4.855 1.07 0 4.277-4.854-3.207-1.387-5.702 0-4.276Z\\\"></path></symbol><symbol id=\\\"bi-1-circle\\\" viewBox=\\\"0 0 16 16\\\" fill=\\\"currentColor\\\"><path d=\\\"M1 8a7 7 0 1 0 14 0A7 7 0 0 0 1 8Zm15 0A8 8 0 1 1 0 8a8 8 0 0 1 16 0ZM9.283 4.002V12H7.971V5.338h-.065L6.072 6.656V5.385l1.899-1.383h1.312Z\\\"></path></symbol><symbol id=\\\"bi-2-circle\\\" viewBox=\\\"0 0 16 16\\\" fill=\\\"currentColor\\\"><path d=\\\"M1 8a7 7 0 1 0 14 0A7 7 0 0 0 1 8Zm15 0A8 8 0 1 1 0 8a8 8 0 0 1 16 0ZM6.646 6.24v.07H5.375v-.064c0-1.213.879-2.402 2.637-2.402 1.582 0 2.613.949 2.613 2.215 0 1.002-.6 1.667-1.287 2.43l-.096.107-1.974 2.22v.077h3.498V12H5.422v-.832l2.97-3.293c.434-.475.903-1.008.903-1.705 0-.744-.557-1.236-1.313-1.236-.843 0-1.336.615-1.336 1.306Z\\\"></path></symbol><symbol id=\\\"bi-3-circle\\\" viewBox=\\\"0 0 16 16\\\" fill=\\\"currentColor\\\"><path d=\\\"M7.918 8.414h-.879V7.342h.838c.78 0 1.348-.522 1.342-1.237 0-.709-.563-1.195-1.348-1.195-.79 0-1.312.498-1.348 1.055H5.275c.036-1.137.95-2.115 2.625-2.121 1.594-.012 2.608.885 2.637 2.062.023 1.137-.885 1.776-1.482 1.875v.07c.703.07 1.71.64 1.734 1.917.024 1.459-1.277 2.396-2.93 2.396-1.705 0-2.707-.967-2.754-2.144H6.33c.059.597.68 1.06 1.541 1.066.973.006 1.6-.563 1.588-1.354-.006-.779-.621-1.318-1.541-1.318Z\\\"></path><path d=\\\"M16 8A8 8 0 1 1 0 8a8 8 0 0 1 16 0ZM1 8a7 7 0 1 0 14 0A7 7 0 0 0 1 8Z\\\"></path></symbol><symbol id=\\\"bi-bounding-box\\\" viewBox=\\\"0 0 16 16\\\" fill=\\\"currentColor\\\"><path d=\\\"M5 2V0H0v5h2v6H0v5h5v-2h6v2h5v-5h-2V5h2V0h-5v2H5zm6 1v2h2v6h-2v2H5v-2H3V5h2V3h6zm1-2h3v3h-3V1zm3 11v3h-3v-3h3zM4 15H1v-3h3v3zM1 4V1h3v3H1z\\\"></path></symbol><symbol id=\\\"bi-geo-alt\\\" viewBox=\\\"0 0 16 16\\\" fill=\\\"currentColor\\\"><path d=\\\"M12.166 8.94c-.524 1.062-1.234 2.12-1.96 3.07A31.493 31.493 0 0 1 8 14.58a31.481 31.481 0 0 1-2.206-2.57c-.726-.95-1.436-2.008-1.96-3.07C3.304 7.867 3 6.862 3 6a5 5 0 0 1 10 0c0 .862-.305 1.867-.834 2.94zM8 16s6-5.686 6-10A6 6 0 0 0 2 6c0 4.314 6 10 6 10z\\\"></path><path d=\\\"M8 8a2 2 0 1 1 0-4 2 2 0 0 1 0 4zm0 1a3 3 0 1 0 0-6 3 3 0 0 0 0 6z\\\"></path></symbol><symbol id=\\\"bi-arrows-fullscreen\\\" viewBox=\\\"0 0 16 16\\\" fill=\\\"currentColor\\\"><path fill-rule=\\\"evenodd\\\" d=\\\"M5.828 10.172a.5.5 0 0 0-.707 0l-4.096 4.096V11.5a.5.5 0 0 0-1 0v3.975a.5.5 0 0 0 .5.5H4.5a.5.5 0 0 0 0-1H1.732l4.096-4.096a.5.5 0 0 0 0-.707zm4.344 0a.5.5 0 0 1 .707 0l4.096 4.096V11.5a.5.5 0 1 1 1 0v3.975a.5.5 0 0 1-.5.5H11.5a.5.5 0 0 1 0-1h2.768l-4.096-4.096a.5.5 0 0 1 0-.707zm0-4.344a.5.5 0 0 0 .707 0l4.096-4.096V4.5a.5.5 0 1 0 1 0V.525a.5.5 0 0 0-.5-.5H11.5a.5.5 0 0 0 0 1h2.768l-4.096 4.096a.5.5 0 0 0 0 .707zm-4.344 0a.5.5 0 0 1-.707 0L1.025 1.732V4.5a.5.5 0 0 1-1 0V.525a.5.5 0 0 1 .5-.5H4.5a.5.5 0 0 1 0 1H1.732l4.096 4.096a.5.5 0 0 1 0 .707z\\\"></path></symbol><symbol id=\\\"bi-download\\\" viewBox=\\\"0 0 16 16\\\" fill=\\\"currentColor\\\"><path d=\\\"M.5 9.9a.5.5 0 0 1 .5.5v2.5a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-2.5a.5.5 0 0 1 1 0v2.5a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2v-2.5a.5.5 0 0 1 .5-.5z\\\"></path><path d=\\\"M7.646 11.854a.5.5 0 0 0 .708 0l3-3a.5.5 0 0 0-.708-.708L8.5 10.293V1.5a.5.5 0 0 0-1 0v8.793L5.354 8.146a.5.5 0 1 0-.708.708l3 3z\\\"></path></symbol>\", 9)\nconst _hoisted_11 = [\n  _hoisted_2\n]\n\nexport function render(_ctx: any,_cache: any,$props: any,$setup: any,$data: any,$options: any) {\n  const _component_PlotsThree = _resolveComponent(\"PlotsThree\")!\n\n  return (_openBlock(), _createElementBlock(_Fragment, null, [\n    (_openBlock(), _createElementBlock(\"svg\", _hoisted_1, _hoisted_11)),\n    _createVNode(_component_PlotsThree)\n  ], 64))\n}","<template>\n  <div>\n    <!-- The spinner -->\n    <MySpinner :working=\"working\" :fatalError=\"fatalError\" :loadingInfoTexts=\"loadingInfoTexts\"></MySpinner>\n    <div class=\"container\">\n      <!-- TOP BAR -->\n      <PlotSettings2 ref=\"settings\" @settingsChanged=\"settingsChanged\" @settingsModify=\"settingsModify\" @mapSettingsChanged=\"mapSettingsChanged\"></PlotSettings2>\n      <!-- START OF ACTUAL CONTENT -->\n\n\n      <div class=\"main-panel\" id=\"mainContainer\">\n        <div v-if=\"species\">\n          <div class=\"species-header\">\n            <div class=\"species-thumb desktop-only\">\n              <SpeciesImageCarousel :species=\"species\" :images=\"species.images\" :bottom-bar=\"false\" :indicators=\"false\" mkey=\"1\"></SpeciesImageCarousel>\n            </div>\n\n            <div class=\"species-meta desktop-only\">\n              <h5 class=\"section-title\">{{ capitalizeAll(species.name) }}</h5>\n              <em class=\"species-latin\">{{ species.latin }}</em>\n              <div v-if=\"species\">\n                <a class=\"info-toggle\" data-bs-toggle=\"collapse\" href=\"#more\" @click=\"toggleMoreInfo()\">\n                  {{ isMoreInfoOpen ? $t('trends.speciesInfoHide') : $t('trends.speciesInfoShow') }}\n                </a>\n              </div>\n            </div>\n\n            <div class=\"species-trend\">\n              <h5 class=\"section-title\">Trend</h5>\n              <PlotErrorSmall :plot-error=\"plotError\"></PlotErrorSmall>\n              <!-- trendPlotData, not plot: the raw INLA plot has no traces (built client-side) -->\n              <TrendComponentGAM :plot=\"trendPlotData\" icon-size=\"16\" icon-size-large=\"64\" :has-enough-data=\"hasEnoughData\"></TrendComponentGAM>\n            </div>\n\n            <div class=\"species-numbers\">\n              <h5 class=\"section-title\">{{ $t('trends.numbers') }}</h5>\n              <div v-if=\"nbCounts\" :class=\"{'text-color-danger': !hasEnoughData}\">\n                <template v-if=\"siteStats && siteStats.has_complete_survey\">\n                  {{$tc('trends.moreCounts1Pos', {n: nbCounts, p: siteStats.nb_rows_positive})}}\n                  {{$tc('trends.moreCounts2', {n: contributors.length})}}\n                  {{$tc('trends.moreCounts3Pos', {n: nbLocations, s: siteStats.nb_sites_positive})}}\n                </template>\n                <template v-else>\n                  {{$tc('trends.moreCounts1', {n: nbCounts})}}\n                  {{$tc('trends.moreCounts2', {n: contributors.length})}}\n                  {{$tc('trends.moreCounts3', {n: nbLocations})}}\n                </template>\n              </div>\n            </div>\n\n            <div class=\"species-meta-mobile mobile-only\">\n              <h5 class=\"section-title\">{{ species.name }}</h5>\n              <em class=\"species-latin\">{{ species.latin }}</em>\n              <div v-if=\"species\">\n                <a class=\"info-toggle\" data-bs-toggle=\"collapse\" href=\"#more\" @click=\"toggleMoreInfo()\">\n                  {{ isMoreInfoOpen ? $t('trends.speciesInfoHide') : $t('trends.speciesInfoShow') }}\n                </a>\n              </div>\n            </div>\n\n          </div>\n        </div>\n\n        <div v-if=\"species\" class=\"collapse\" id=\"more\">\n          <div v-if=\"species.counts\" class=\"info-banner\">\n            LOL\n          </div>\n          <div v-for=\"(sub, subKey) in subSpecies\" :key=\"subKey\">\n            <hr class=\"more-divider\">\n            <h1 class=\"sub-species-title\">{{sub.name}}</h1>\n            <div class=\"more-detail-grid\">\n              <div class=\"more-detail-text\">\n                <div v-for=\"(desc, idx) in sub.desc\" :key=\"'desc_' + idx\">\n                  <h6 v-if=\"idx!='description'\" class=\"desc-heading\">{{speciesTitles[idx]}}</h6>\n                  <div class=\"desc-text\" v-html=\"desc\"></div>\n                </div>\n              </div>\n              <div class=\"more-detail-images desktop-only\">\n                <div v-for=\"(img, idx) in sub.images\" :key=\"idx\">\n                  <SpeciesImage :img=\"img\" class=\"detail-image\"></SpeciesImage>\n                </div>\n              </div>\n            </div>\n          </div>\n          <SpeciesImageCarousel :species=\"species\" :images=\"species.images\" class=\"mobile-only\" mkey=\"2\"></SpeciesImageCarousel>\n<!--          <div class=\"row mt-4\">-->\n<!--            <div class=\"col-xl-6 col-12\">-->\n<!--              <div v-for=\"(desc, idx) in species.desc\" :key=\"'desc_' + idx\">-->\n<!--                <h6 v-if=\"idx!='description'\">{{speciesTitles[idx]}}</h6>-->\n<!--                <div class=\"mb-3 text-muted\" v-html=\"desc\"></div>-->\n<!--              </div>-->\n<!--            </div>-->\n<!--            <div class=\"col-xl-6 col-12 d-none d-xl-block\">-->\n<!--              <div v-for=\"(img, idx) in speciesImages\" :key=\"idx\">-->\n<!--                QWEW {{speciesImages}}-->\n<!--                <SpeciesImage :img=\"img\" class=\"mb-3\"></SpeciesImage>-->\n<!--              </div>-->\n<!--            </div>-->\n<!--          </div>-->\n        </div>\n\n        <div v-else class=\"welcome-section\">\n          <h4 class=\"welcome-title\">{{ $t ('trends.intro.title') }}</h4>\n          <div class=\"welcome-text\">{{ $t ('trends.intro.text1') }}</div>\n          <div class=\"steps-block\">\n            <h4 class=\"steps-title\">{{ $t ('trends.intro.steps') }}</h4>\n\n            <div class=\"step-row\">\n              <svg width=\"20\" height=\"20\" class=\"step-icon step-icon-primary\"><use xlink:href=\"#bi-1-circle\"/></svg>\n              <span class=\"help1\" @click=\"openSpeciesDropdown()\" @mouseenter=\"highlight($event, 1, true)\" @mouseleave=\"highlight($event, 1, false)\">{{ $t ('trends.intro.step1') }}</span>\n            </div>\n            <div class=\"step-row\">\n              <svg width=\"20\" height=\"20\" class=\"step-icon step-icon-muted\"><use xlink:href=\"#bi-2-circle\"/></svg>\n              <span class=\"help2\" @mouseenter=\"highlight($event, 2, true)\" @mouseleave=\"highlight($event, 2, false)\">{{ $t ('trends.intro.step2') }}</span>\n            </div>\n            <div class=\"step-row\">\n              <svg width=\"20\" height=\"20\" class=\"step-icon step-icon-muted\"><use xlink:href=\"#bi-3-circle\"/></svg>\n              <span class=\"help2\" @mouseenter=\"highlight($event, 3, true)\" @mouseleave=\"highlight($event, 3, false)\">{{ $t ('trends.intro.step3') }}</span>\n            </div>\n          </div>\n\n          <div v-if=\"store.plotSettings?.availableCountTypes?.length > 0\">\n            <SpeciesPreviewCarousel @selectSpecies=\"selectSpecies\" :count-types=\"store.plotSettings.availableCountTypes\"></SpeciesPreviewCarousel>\n          </div>\n\n          <div class=\"welcome-text\">{{ $t ('trends.intro.text2') }}</div>\n        </div>\n\n\n      </div>\n      <div class=\"content-grid\">\n        <div v-if=\"isAdminOnlyView\" class=\"admin-only-banner grid-full\">\n          <span class=\"badge-circle badge-admin\"></span>\n          {{ $t('trends.obsTabs.adminOnlyBanner') }}\n        </div>\n        <PlotCard :plot=\"plot\" :plot-error=\"plotError\" plot-id=\"divPlot1\" :working=\"working\"\n                  :obs-plots=\"obsPlots\" :obs-plot-ids=\"obsPlotIds\"\n                  @select-obs-type=\"selectObsType\" :class=\"isGridLayout ? 'grid-full' : 'grid-half'\"></PlotCard>\n        <TcMap :id-map=\"idMap\" class=\"grid-half\"></TcMap>\n        <InlaComponentCard v-if=\"isInla\" :plot=\"plot\" :site-stats=\"siteStats\" class=\"grid-full\" />\n        <TcMore :contributors=\"contributors\" :overall=\"overall\" :summary=\"summary\" :timings=\"timings\" :plot-error=\"plotError\"\n                :gof=\"gof\" :obs-plots=\"obsPlots\" :obs-plot-ids=\"obsPlotIds\"\n                @download=\"download\" @select-sites=\"openSitesShortcut\" class=\"grid-full\"></TcMore>\n      </div>\n\n    </div>\n  </div>\n</template>\n\n<script>\n\nimport \"leaflet/dist/leaflet.css\"\nimport MySpinner from \"@/components/shared/MySpinner.vue\";\nimport PlotsBase from \"@/components/trends/PlotsBase.vue\";\nimport PlotCard from \"@/components/trends/PlotCard.vue\";\nimport TcMap from \"@/components/trends/cards/TcMap.vue\";\nimport PlotSettings2 from \"@/components/trends/settings/PlotSettings2.vue\";\nimport SpeciesImage from \"@/components/trends/cards/SpeciesImage.vue\";\nimport SpeciesImageCarousel from \"@/components/trends/SpeciesImageCarousel.vue\";\nimport PlotErrorSmall from \"@/components/trends/cards/PlotErrorSmall.vue\";\nimport TcMore from \"@/components/trends/cards/TcMore.vue\";\nimport InlaComponentCard from \"@/components/trends/cards/InlaComponentCard.vue\";\nimport SpeciesPreviewCarousel from \"@/components/trends/cards/SpeciesPreviewCarousel.vue\";\nimport TrendComponentGAM from \"@/components/trends/TrendComponentGAM.vue\";\n\n\nexport default {\n  extends: PlotsBase,\n  name: 'PlotsThree',\n  components: {\n    TrendComponentGAM,\n    SpeciesPreviewCarousel,\n    TcMore,\n    InlaComponentCard,\n    PlotErrorSmall,\n    SpeciesImageCarousel,\n    SpeciesImage,\n    PlotSettings2,\n    TcMap, PlotCard, MySpinner\n  },\n  data: function (){\n    return {\n      isMoreInfoOpen: false,\n    };\n  },\n  methods: {\n    highlight(evt, idx, enabled){\n      const elements = [];\n      if (enabled) evt.target.classList.add('help-text');\n      else evt.target.classList.remove('help-text');\n      // console.log(evt);\n      if (idx == 1){\n        elements.push(document.getElementById('nlSpecies'));\n      }\n      else if (idx == 2){\n        elements.push(document.getElementById('nlRegion'));\n      }\n      else if (idx == 3){\n        elements.push(document.getElementById('nlTimespan1'));\n        elements.push(document.getElementById('nlTimespan2'));\n        elements.push(document.getElementById('nlTimespan3'));\n        elements.push(document.getElementById('nlTimespan4'));\n      }\n      for (const el of elements){\n        if (enabled)\n          el.classList.add('highlight');\n        else\n          el.classList.remove('highlight');\n      }\n    },\n    toggleMoreInfo: function () {\n      this.isMoreInfoOpen = !this.isMoreInfoOpen;\n    },\n    /** WTF? I cannot import the function from the utils.js file. If I do, the preview (npm run serve) does not work! */\n    capitalizeAll: function(s){\n      return s.split(' ').map(w => w[0].toUpperCase() + w.substr(1).toLowerCase()).join(' ');\n    },\n    /**\n     * Opens the species dropdown. This code is hacky, but it's the only known way to do it programmatically.\n     */\n    openSpeciesDropdown(){\n      const elm = document.getElementById(\"nlSpecies\");\n      //  this disables the auto closing\n      elm.setAttribute(\"data-bs-auto-close\", \"false\");\n      //  now open the dropdown\n      // eslint-disable-next-line no-undef\n      new bootstrap.Dropdown(elm).show();\n      //  restore the original state\n      elm.removeAttribute(\"data-bs-auto-close\");\n      //  recreate the dropdown to apply the original state.\n      //  without the timeout it does not work (it's not opening).\n      setTimeout(() => {\n        // eslint-disable-next-line no-undef\n        new bootstrap.Dropdown(elm);\n      }, 40);\n    },\n    /** called from the species preview carousel via events */\n    selectSpecies: function (species){\n      this.$refs.settings.selectSpecies(species);\n    },\n    /** the plot card's dropdown picked either an observation type or a layout */\n    selectObsType: function (payload){\n      if (payload?.kind === 'layout'){\n        this.$refs.settings.selectObsLayout(payload.layout);\n        return;\n      }\n      // selectObservationType resets obsLayout to 'single' itself, so this is one refetch.\n      this.$refs.settings.selectObservationType(payload?.obsType);\n    },\n  },\n  computed: {\n    subSpecies(){\n      if (this.species?.counts){\n        const list = [];\n        for (const sub of this.species.counts){\n          list.push(this.store.speciesDict[sub]);\n        }\n        return list;\n      }\n      return [this.species];\n    },\n    /** true when an admin is viewing a non-public observation type */\n    isAdminOnlyView: function (){\n      return this.store?.plotSettings?.observationType?.public === false;\n    },\n    /** side-by-side needs the full row; the map drops below it */\n    isGridLayout: function (){\n      return this.store?.plotSettings?.obsLayout === 'grid';\n    },\n  }\n}\n</script>\n\n<style scoped>\n.main-panel {\n  border: 1px solid #e2e8f0;\n  border-radius: 0 0.625rem 0.625rem 0.625rem;\n  margin-bottom: 1rem;\n  padding: 1rem;\n  position: relative;\n  top: -1px;\n  z-index: 0;\n}\n\n.species-header {\n  display: grid;\n  grid-template-columns: auto 1fr 1fr 1fr;\n  gap: 1rem;\n  align-items: start;\n}\n\n@media (max-width: 1199.98px) {\n  .species-header {\n    grid-template-columns: 1fr 1fr;\n  }\n}\n\n.species-thumb {\n  width: clamp(80px, 10vw, 140px);\n}\n\n.species-meta,\n.species-trend,\n.species-numbers {\n  margin-bottom: 0.75rem;\n}\n\n.section-title {\n  font-size: 1rem;\n  font-weight: 600;\n  color: #1e293b;\n  margin: 0 0 0.375rem;\n}\n\n.species-latin {\n  color: #64748b;\n  font-size: 0.9375rem;\n}\n\n.info-toggle {\n  color: #2563eb;\n  text-decoration: underline;\n  text-underline-offset: 2px;\n  font-size: 0.875rem;\n  cursor: pointer;\n}\n\n.info-toggle:hover {\n  color: #1d4ed8;\n}\n\n.text-color-danger {\n  color: #dc2626;\n}\n\n.desktop-only {\n  display: block;\n}\n\n.mobile-only {\n  display: none;\n}\n\n@media (max-width: 1199.98px) {\n  .desktop-only {\n    display: none;\n  }\n  .mobile-only {\n    display: block;\n  }\n}\n\n.species-meta-mobile {\n  margin-bottom: 0.75rem;\n}\n\n.info-banner {\n  background: rgba(8, 145, 178, 0.08);\n  color: #0891b2;\n  padding: 0.75rem 1rem;\n  border-radius: 0.375rem;\n  font-size: 0.875rem;\n}\n\n.more-divider {\n  border-color: #e2e8f0;\n}\n\n.sub-species-title {\n  font-size: 1.5rem;\n  font-weight: 700;\n  color: #1e293b;\n}\n\n.more-detail-grid {\n  display: grid;\n  grid-template-columns: 1fr 1fr;\n  gap: 1.5rem;\n  margin-top: 1rem;\n}\n\n@media (max-width: 1199.98px) {\n  .more-detail-grid {\n    grid-template-columns: 1fr;\n  }\n}\n\n.desc-heading {\n  font-size: 0.875rem;\n  font-weight: 600;\n  color: #1e293b;\n  margin: 0.75rem 0 0.25rem;\n}\n\n.desc-text {\n  font-size: 0.875rem;\n  color: #64748b;\n  line-height: 1.6;\n  margin-bottom: 0.75rem;\n}\n\n.detail-image {\n  margin-bottom: 0.75rem;\n}\n\n.welcome-section {\n  font-size: 1.0625rem;\n  color: #64748b;\n  line-height: 1.6;\n}\n\n.welcome-title {\n  font-size: 1.25rem;\n  font-weight: 600;\n  color: #1e293b;\n}\n\n.welcome-text {\n  margin-bottom: 0.5rem;\n}\n\n.steps-block {\n  padding: 1rem;\n  font-size: 1.125rem;\n}\n\n.steps-title {\n  font-size: 1.125rem;\n  font-weight: 600;\n  color: #1e293b;\n  margin-bottom: 0.75rem;\n}\n\n.step-row {\n  display: flex;\n  flex-direction: row;\n  align-items: center;\n  margin-bottom: 0.25rem;\n}\n\n.step-icon {\n  flex-shrink: 0;\n  margin-right: 0.5rem;\n}\n\n.step-icon-primary {\n  color: #2563eb;\n}\n\n.step-icon-muted {\n  color: #64748b;\n}\n\n.content-grid {\n  display: grid;\n  grid-template-columns: 1fr 1fr;\n  gap: 1rem;\n}\n\n@media (max-width: 1199.98px) {\n  .content-grid {\n    grid-template-columns: 1fr;\n  }\n}\n\n.grid-half {\n  min-width: 0;\n}\n\n.grid-full {\n  grid-column: 1 / -1;\n}\n\n.admin-only-banner {\n  display: flex;\n  align-items: center;\n  gap: 0.5rem;\n  background: #fef3c7;\n  color: #92400e;\n  border: 1px solid #fde68a;\n  border-radius: 0.5rem;\n  padding: 0.5rem 0.9rem;\n  font-size: 0.8125rem;\n  font-weight: 600;\n}\n\n.help1 {\n  cursor: pointer;\n}\n\n.help2 {\n  cursor: help;\n}\n</style>\n<style>\n.help-text {\n  font-weight: bold;\n}\n</style>","import axios, {AxiosResponse} from \"axios\";\nimport {ApiProgress} from \"@/lib/ApiProgress\";\n\nexport interface ApiComRequestDef {\n    method: 'GET' | 'POST';\n    url?: string;\n    data?: any;\n    file?: File;\n    formData?: FormData;\n    download?: boolean;\n    filename?: string;\n    infoText?: string;\n    progress?: boolean;\n    config?: any;\n    app?: any;\n    responseHandler?: (data: any) => void;\n    errorHandler?: (error: any) => void;\n}\n\nclass ApiCommunication{\n    url: string;\n    private _requestCounts = new WeakMap<object, number>();\n    private _requestInfoTexts = new Map<number, {app: object, text: string}>();\n    private _nextReqId = 0;\n\n    constructor(url: string) {\n        this.url = url;\n        axios.defaults.xsrfCookieName = 'csrftoken';\n        axios.defaults.xsrfHeaderName = 'X-CSRFToken';\n    }\n\n    private _startRequest(app: any, infoText?: string): number {\n        const count = (this._requestCounts.get(app) || 0) + 1;\n        this._requestCounts.set(app, count);\n        const reqId = ++this._nextReqId;\n        if (infoText) {\n            this._requestInfoTexts.set(reqId, {app, text: infoText});\n        }\n        app.working = true;\n        this._updateInfoTexts(app);\n        return reqId;\n    }\n\n    private _endRequest(app: any, reqId: number): void {\n        const count = Math.max(0, (this._requestCounts.get(app) || 1) - 1);\n        this._requestCounts.set(app, count);\n        this._requestInfoTexts.delete(reqId);\n        this._syncWorkingState(app);\n        this._updateInfoTexts(app);\n    }\n\n    private _syncWorkingState(app: any): void {\n        const count = this._requestCounts.get(app) || 0;\n        if (count > 0) {\n            app.working = true;\n        } else if (!app.fatalError && !app.confirm) {\n            app.working = false;\n        }\n    }\n\n    private _updateInfoTexts(app: any): void {\n        if (!app || !('loadingInfoTexts' in app)) return;\n        const texts: string[] = [];\n        this._requestInfoTexts.forEach((entry) => {\n            if (entry.app === app) {\n                texts.push(entry.text);\n            }\n        });\n        app.loadingInfoTexts = texts;\n    }\n\n    getActiveRequestCount(app: any): number {\n        return this._requestCounts.get(app) || 0;\n    }\n\n    private _handleFatalError(app: any, response: AxiosResponse): boolean {\n        if (response.data.fatalError){\n            app.working = true;\n            app.raiseFatalError(\"Fatal Error\", response.data.fatalError.message, 500);\n            return true;\n        }\n        return false;\n    }\n\n    private _handleResponse(app: any, response: AxiosResponse, responseHandler: any, errorHandler: any): void {\n        const contentType = response.headers['content-type'];\n        if (contentType === 'application/json'){\n            if (this._handleFatalError(app, response)){\n                return;\n            }\n        }\n        else {\n            console.warn(\"Non-JSON contentType: \" + contentType);\n        }\n        try {\n            responseHandler(response.data);\n        }\n        catch (e){\n            console.log(e);\n            errorHandler(e);\n        }\n    }\n\n    get(app: any, responseHandler: any, errorHandler: any){\n        this.makeRequest({method: 'GET', app, responseHandler, errorHandler});\n    }\n    post(app: any, data: any, responseHandler: any, errorHandler: any, config?: any){\n        this.makeRequest({method: 'POST', app, data, responseHandler, errorHandler, config});\n    }\n    /** for long requests whose action reports its progress on the server, see ApiProgress */\n    postWithProgress(app: any, data: any, responseHandler: any, errorHandler: any){\n        this.makeRequest({method: 'POST', app, data, responseHandler, errorHandler, progress: true});\n    }\n    /** postFormData, with the upload's and the server's progress, see ApiProgress */\n    postFormDataWithProgress(app: any, formData: FormData, responseHandler: any, errorHandler: any){\n        this.makeRequest({method: 'POST', app, formData, responseHandler, errorHandler, progress: true});\n    }\n    /** a POST whose response is a file to save, with the server's and the download's progress, see ApiProgress */\n    downloadWithProgress(app: any, data: any, filename: string, errorHandler: any){\n        this.makeRequest({method: 'POST', app, data, filename, errorHandler, download: true, progress: true});\n    }\n    postFile(app: any, file: any, responseHandler: any, errorHandler: any){\n        this.makeRequest({method: 'POST', app, file, responseHandler, errorHandler});\n    }\n    postFormData(app: any, formData: FormData, responseHandler: any, errorHandler: any){\n        this.makeRequest({method: 'POST', app, formData, responseHandler, errorHandler});\n    }\n\n    static postDownload(url: string, data: any, filename: string|undefined = undefined){\n        axios.post(url, data, {responseType: 'blob'}).then((response: AxiosResponse) => {\n            ApiCommunication.saveBlob(response.data, filename);\n        });\n    }\n\n    private static saveBlob(data: any, filename?: string): void {\n        const blobUrl = window.URL.createObjectURL(new Blob([data]));\n        const link = document.createElement('a');\n        link.href = blobUrl;\n        if (filename) {\n            link.setAttribute('download', filename);\n        }\n        document.body.appendChild(link);\n        link.click();\n        link.remove();\n        // later, not now: revoking right after the click can cancel the download in some browsers\n        window.setTimeout(() => window.URL.revokeObjectURL(blobUrl), 60000);\n    }\n\n    makeRequest(def: ApiComRequestDef): void {\n        const url = def.url || this.url;\n        const app = def.app;\n\n        if (def.download) {\n            const reqId = app ? this._startRequest(app, def.infoText) : null;\n            const progress = def.progress && app ? new ApiProgress(app, {download: true}) : null;\n            let config: any = {responseType: 'blob'};\n            if (progress) {\n                config = progress.attachTo(config);\n                progress.start();\n            }\n            const end = () => {\n                progress?.stop();\n                if (app && reqId !== null) this._endRequest(app, reqId);\n            };\n            const errorHandler = def.errorHandler || ((e: any) => console.error(e));\n            axios.post(url, def.data, config).then((response: AxiosResponse) => {\n                if (response.headers['content-type'] !== 'application/json') {\n                    ApiCommunication.saveBlob(response.data, def.filename);\n                    end();\n                    return;\n                }\n                // a failed action answers with JSON (a fatalError), even when a file was asked for\n                return (response.data as Blob).text().then((text) => {\n                    const json = JSON.parse(text);\n                    if (app) {\n                        this._handleResponse(app, {...response, data: json},\n                            () => errorHandler(new Error(\"The server sent no file.\")), errorHandler);\n                    } else {\n                        errorHandler(new Error(json.fatalError ? json.fatalError.message : \"The server sent no file.\"));\n                    }\n                    end();\n                });\n            }).catch((error) => {\n                errorHandler(error); // first: the spinner only stays up for the error while it is set\n                end();\n            });\n            return;\n        }\n\n        const reqId = this._startRequest(app, def.infoText);\n        // eslint-disable-next-line @typescript-eslint/no-empty-function\n        const responseHandler = def.responseHandler || (() => {});\n        const errorHandler = def.errorHandler || ((e: any) => console.error(e));\n\n        let requestData = def.data;\n        let config = def.config;\n\n        if (def.file) {\n            const formData = new FormData();\n            formData.append('file', def.file);\n            requestData = formData;\n            config = { ...config, headers: { 'Content-Type': 'multipart/form-data' } };\n        } else if (def.formData) {\n            requestData = def.formData;\n            config = { ...config, headers: { 'Content-Type': 'multipart/form-data' } };\n        }\n\n        const progress = def.progress ? new ApiProgress(app, {upload: !!(def.file || def.formData)}) : null;\n        if (progress) {\n            config = progress.attachTo(config);\n            progress.start();\n        }\n\n        const promise = def.method === 'GET'\n            ? axios.get(url)\n            : axios.post(url, requestData, config);\n\n        const finish = (response: AxiosResponse) => {\n            this._handleResponse(app, response, responseHandler, errorHandler);\n            progress?.stop();\n            this._endRequest(app, reqId);\n        };\n\n        promise.then((response: AxiosResponse) => {\n            return progress ? progress.prepare().then(() => finish(response)) : finish(response);\n        }).catch((error) => {\n            progress?.stop();\n            console.log(error);\n            errorHandler(error);\n            this._endRequest(app, reqId);\n        });\n    }\n}\n\nclass ApiRequestBuilder{\n    actions: any[];\n    constructor(actionId: string, properties: any) {\n        this.actions = [];\n        if (actionId){\n            this.addAction(actionId, properties);\n        }\n    }\n    addAction(actionId: string, properties: any){\n        if (! properties) properties = {};\n        properties.action = actionId;\n        this.actions.push(properties);\n        return this;\n    }\n    build(){\n        return {\n            actions: this.actions\n        };\n    }\n}\n\nconst ApiUtil = {\n    addKeyToMapItemsAsId: function (map: any){\n        for (const id in map) {\n            map[id].id = id;\n        }\n        return map;\n    },\n    listToMapWithIdAsKey: function(l: any){\n        const map = {};\n        let item;\n        for (const idx in l){\n            item = l[idx];\n            // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n            // @ts-ignore\n            map[item.id] = item;\n        }\n        return map;\n    },\n    mapToList: function(map: any){\n        const list = [];\n        for (const id in map){\n            list.push(map[id]);\n        }\n        return list;\n    },\n    listFromIds: function (ids: any, map: any){\n        const l = [];\n        for (const idx in ids){\n            const id = ids[idx];\n            const o = map[id];\n            if (o) l.push(o);\n        }\n        return l;\n    },\n};\n\nexport {ApiCommunication, ApiRequestBuilder, ApiUtil}\n","type AttributeRecord = Record<string, unknown>;\n\n/**\n * Lightweight DOM helper used by the download toolbar.\n * Keeps all DOM mutation logic in a single place so we do not\n * clutter the visualization code with manual element handling.\n */\nclass DomElement {\n    private readonly element: HTMLElement;\n\n    constructor(element: HTMLElement) {\n        this.element = element;\n    }\n\n    el(): HTMLElement {\n        return this.element;\n    }\n\n    attr(key: string, value: unknown): DomElement {\n        if (value === null || value === undefined) {\n            return this;\n        }\n\n        if (key === \"class\" && typeof value === \"object\" && !Array.isArray(value)) {\n            const classList = Object.keys(value)\n                .filter(cls => Boolean((value as Record<string, boolean>)[cls]))\n                .join(\" \");\n            if (classList) {\n                this.element.setAttribute(\"class\", classList);\n            }\n            return this;\n        }\n\n        if (key === \"style\" && typeof value === \"object\" && !Array.isArray(value)) {\n            const styleString = Object.entries(value as Record<string, string | number>)\n                .map(([prop, val]) => `${prop}:${val}`)\n                .join(\";\");\n            if (styleString) {\n                this.element.setAttribute(\"style\", styleString);\n            }\n            return this;\n        }\n\n        this.element.setAttribute(key, String(value));\n        return this;\n    }\n\n    attrs(attributes: AttributeRecord): DomElement {\n        Object.entries(attributes).forEach(([key, val]) => this.attr(key, val));\n        return this;\n    }\n\n    text(content: string): DomElement {\n        this.element.textContent = content;\n        return this;\n    }\n}\n\nexport class ElementBuilder {\n    static create(tag: string, attributes?: AttributeRecord): DomElement {\n        const element = document.createElement(tag);\n        const domElement = new DomElement(element);\n        if (attributes) {\n            domElement.attrs(attributes);\n        }\n        return domElement;\n    }\n\n    static append(parent: HTMLElement | DomElement, tag: string, attributes?: AttributeRecord): DomElement {\n        const domElement = ElementBuilder.create(tag, attributes);\n        if (parent instanceof DomElement) {\n            parent.el().appendChild(domElement.el());\n        } else {\n            parent.appendChild(domElement.el());\n        }\n        return domElement;\n    }\n}\n\nexport type { DomElement };\n\n","/**\n * The read-out of the hovered year of a chart: where it goes. What it says is built\n * by tooltip/TrendTooltip.ts (or a host's customOptions.tooltipBuilder).\n *\n * It lives on <body>, not inside the chart: a small chart would clip it, and the\n * plot area is where the data is — the read-out should cover as little of it as it\n * can. Everything is placed in viewport coordinates and removed (not just hidden)\n * when the pointer leaves, so a chart that is unmounted leaves nothing behind.\n */\n\n/** Where the hovered year is, in the px of the plot area (the hover rect's own coordinates). */\ninterface HoverAnchor {\n    /** x of the hovered year. */\n    x: number;\n    /** Half the width around `x` that the marks of that year take (lanes, markers). */\n    spread: number;\n    pointerX: number;\n    pointerY: number;\n    /** Vertical extent of the marks of that year; null when it has none. */\n    top: number | null;\n    bottom: number | null;\n}\n\n/**\n * - `beside`: next to the hovered year, at the height of the pointer; changes sides at the edges\n * - `above`:  centred over the marks of the hovered year (under them when there is no room)\n * - `docked`: in the top-left corner of the plot; steps to the right one when the hovered year is under it\n */\ntype BoxPlacement = \"beside\" | \"above\" | \"docked\";\n\n/** A small label of its own, level with a point of the hovered year. */\ninterface HoverTag {\n    html: string;\n    /** y it belongs to, in plot-area px. */\n    y: number;\n    /** Colour of its leading edge (the series colour). */\n    color?: string;\n    className?: string;\n}\n\ninterface HoverTooltipHost {\n    /** The element covering the plot area (the hover rect): its box maps plot px to the screen. */\n    area: Element;\n    /** Size of the plot area in the chart's own px. */\n    width: number;\n    height: number;\n    /** The chart container — a box stays inside it sideways where it can. */\n    container: HTMLElement;\n    /** What overlays the top-right corner of the chart (the toolbar); a docked box keeps clear of it. */\n    toolbar?: () => HTMLElement | null | undefined;\n}\n\nconst STYLE_ID = \"myd3-tip-style\";\nconst EDGE = 8;\n\nconst CSS = `\n.myd3-tip-layer{position:fixed;left:0;top:0;width:0;height:0;z-index:1070;pointer-events:none}\n.myd3-tip{position:absolute;left:0;top:0;box-sizing:border-box;white-space:nowrap;text-align:left;font-size:12.5px;\n  line-height:1.35;color:#1e293b;font-variant-numeric:tabular-nums}\n.myd3-tip-grid{display:grid;align-items:center;column-gap:.65em;row-gap:1px}\n.myd3-tip-grid .k{display:flex;align-items:center}\n.myd3-tip .k svg{display:block}\n.myd3-tip-grid .v{font-weight:600;text-align:right}\n.myd3-tip-grid .c,.myd3-tip-grid .s,.myd3-tip-muted{color:#64748b}\n.myd3-tip-grid .s{text-align:right}\n.myd3-tip-year{font-weight:700}\n.myd3-tip-head{display:flex;align-items:baseline;justify-content:space-between;gap:1.4em;margin-bottom:3px}\n.myd3-tip-badge{display:inline-block;margin-top:4px;padding:1px 8px;border-radius:999px;font-weight:600;font-size:11px}\n.myd3-tip-card{padding:7px 11px 8px;background:#fff;border:1px solid #e2e8f0;border-radius:8px;\n  box-shadow:0 10px 26px -10px rgba(15,23,42,.3),0 1px 3px rgba(15,23,42,.08)}\n.myd3-tip-bubble{padding:5px 9px 6px;background:#1e293b;color:#f8fafc;border-radius:6px;font-size:12px;\n  box-shadow:0 8px 18px -8px rgba(15,23,42,.5)}\n.myd3-tip-bubble .c,.myd3-tip-bubble .s,.myd3-tip-bubble .myd3-tip-muted{color:#cbd5e1}\n.myd3-tip-bubble .k{padding:1px 2px;background:#fff;border-radius:3px}\n.myd3-tip-bubble .myd3-tip-badge{background:#fff !important}\n.myd3-tip-arrow{position:absolute;left:var(--myd3-arrow-x,50%);bottom:-4px;width:9px;height:9px;margin-left:-4.5px;\n  background:#1e293b;border-radius:1px;transform:rotate(45deg)}\n.myd3-tip.is-below .myd3-tip-arrow{bottom:auto;top:-4px}\n.myd3-tip-docked{padding:6px 10px 7px;background:rgba(255,255,255,.9);border:1px solid #e2e8f0;border-radius:6px}\n.myd3-tip-docked .myd3-tip-year{font-size:15px;line-height:1.25}\n.myd3-tip-docked .myd3-tip-head{margin-bottom:2px}\n.myd3-tip-tag{display:flex;align-items:center;gap:.45em;padding:1px 7px 1px 5px;background:rgba(255,255,255,.96);\n  border:1px solid #e2e8f0;border-left:3px solid var(--myd3-tag-color,#64748b);border-radius:4px;font-size:12px;\n  box-shadow:0 1px 3px rgba(15,23,42,.14)}\n.myd3-tip-tag b{font-weight:600}\n.myd3-tip-tag.is-left{padding:1px 5px 1px 7px;border-left:1px solid #e2e8f0;border-right:3px solid var(--myd3-tag-color,#64748b)}\n.myd3-tip-tag.is-meta{padding:1px 7px;border-left:1px solid #e2e8f0;border-right:1px solid #e2e8f0;background:#f1f5f9;color:#475569}\n.myd3-tip-tag .myd3-tip-badge{margin-top:0}\n`;\n\nconst clamp = (value: number, min: number, max: number) => Math.max(min, Math.min(max, value));\n\nclass HoverTooltip {\n    private layer?: HTMLElement;\n    private box?: HTMLElement;\n    private boxHtml = \"\";\n    private tags: HTMLElement[] = [];\n    private tagHtml: string[] = [];\n    /** The side a \"beside\" box (or the tags) last took — kept until it no longer fits. */\n    private side: \"right\" | \"left\" = \"right\";\n    /** The corner a docked box last took. */\n    private corner: \"left\" | \"right\" = \"left\";\n    private watchTimer?: number;\n    private readonly onScroll = () => this.hide();\n\n    constructor(private readonly host: HoverTooltipHost) {}\n\n    get isVisible(): boolean {\n        return this.layer !== undefined;\n    }\n\n    /** Show `html` as one box. An empty string shows nothing. */\n    showBox(html: string, placement: BoxPlacement, anchor: HoverAnchor, className = \"\") {\n        if (!html) {\n            this.hide();\n            return;\n        }\n        const layer = this.ensureLayer();\n        this.setTagCount(0);\n        if (!this.box) {\n            this.box = document.createElement(\"div\");\n            layer.appendChild(this.box);\n            this.boxHtml = \"\";\n        }\n        const box = this.box;\n        box.className = `myd3-tip ${className}`;\n        if (this.boxHtml !== html) {\n            box.innerHTML = html;\n            this.boxHtml = html;\n        }\n        const frame = this.frame();\n        const w = box.offsetWidth, h = box.offsetHeight;\n        const ax = frame.plot.left + anchor.x * frame.sx;\n        let left: number, top: number;\n\n        if (placement === \"above\") {\n            //  horizontally centred on the year, between the y-axis and the edge of the\n            //  chart; the arrow stays on the year\n            left = clamp(ax - w / 2, Math.max(EDGE, frame.plot.left - 6), Math.min(frame.vw - EDGE, frame.chart.right - 4) - w);\n            left = clamp(left, EDGE, Math.max(EDGE, frame.vw - EDGE - w));\n            const marksTop = frame.plot.top + (anchor.top ?? anchor.pointerY) * frame.sy;\n            const marksBottom = frame.plot.top + (anchor.bottom ?? anchor.pointerY) * frame.sy;\n            const gap = 10;\n            top = marksTop - gap - h;\n            let below = false;\n            if (top < EDGE && marksBottom + gap + h <= frame.vh - EDGE) {\n                top = marksBottom + gap;\n                below = true;\n            }\n            top = clamp(top, EDGE, Math.max(EDGE, frame.vh - EDGE - h));\n            box.classList.toggle(\"is-below\", below);\n            box.style.setProperty(\"--myd3-arrow-x\", `${Math.round(clamp(ax - left, 9, w - 9))}px`);\n        } else if (placement === \"docked\") {\n            const inset = 8;\n            const lefts = { left: frame.plot.left + inset, right: frame.plot.right - inset - w };\n            const under = (corner: \"left\" | \"right\") => {\n                const reach = anchor.spread * frame.sx + 18;\n                return ax + reach > lefts[corner] && ax - reach < lefts[corner] + w;\n            };\n            if (under(this.corner)) {\n                const other = this.corner === \"left\" ? \"right\" : \"left\";\n                if (!under(other)) this.corner = other;\n            }\n            left = lefts[this.corner];\n            top = frame.plot.top + inset;\n            if (this.corner === \"right\") {\n                //  the toolbar overlays this corner: hang below it\n                const bar = this.host.toolbar?.()?.getBoundingClientRect();\n                if (bar && bar.width > 0 && bar.left < left + w && bar.right > left && bar.bottom > top) {\n                    top = bar.bottom + 6;\n                }\n            }\n            left = clamp(left, EDGE, Math.max(EDGE, frame.vw - EDGE - w));\n            top = clamp(top, EDGE, Math.max(EDGE, frame.vh - EDGE - h));\n        } else {\n            const gap = 14 + anchor.spread * frame.sx;\n            left = this.pickSide(ax, gap, w, frame) === \"right\" ? ax + gap : ax - gap - w;\n            left = clamp(left, EDGE, Math.max(EDGE, frame.vw - EDGE - w));\n            //  level with the pointer, inside the plot area — or just the window when it is taller\n            const py = frame.plot.top + anchor.pointerY * frame.sy;\n            let lo = Math.max(EDGE, frame.plot.top), hi = Math.min(frame.vh - EDGE, frame.plot.bottom) - h;\n            if (hi < lo) {\n                lo = EDGE;\n                hi = Math.max(EDGE, frame.vh - EDGE - h);\n            }\n            top = clamp(py - h / 2, lo, hi);\n        }\n        HoverTooltip.place(box, left, top);\n    }\n\n    /** Show one small label per entry, in a column beside the hovered year. */\n    showTags(tags: HoverTag[], anchor: HoverAnchor) {\n        if (tags.length === 0) {\n            this.hide();\n            return;\n        }\n        this.ensureLayer();\n        if (this.box) {\n            this.box.remove();\n            this.box = undefined;\n        }\n        this.setTagCount(tags.length);\n        const frame = this.frame();\n        let widest = 0;\n        const entries = tags.map((tag, idx) => {\n            const el = this.tags[idx];\n            el.className = `myd3-tip myd3-tip-tag ${tag.className ?? \"\"}`;\n            if (this.tagHtml[idx] !== tag.html) {\n                el.innerHTML = tag.html;\n                this.tagHtml[idx] = tag.html;\n            }\n            el.style.setProperty(\"--myd3-tag-color\", tag.color ?? \"#64748b\");\n            const w = el.offsetWidth, h = el.offsetHeight;\n            widest = Math.max(widest, w);\n            return { el, w, h, top: frame.plot.top + tag.y * frame.sy - h / 2 };\n        });\n\n        const ax = frame.plot.left + anchor.x * frame.sx;\n        const gap = 10 + anchor.spread * frame.sx;\n        const side = this.pickSide(ax, gap, widest, frame);\n\n        //  level with their points, pushed apart where they would overlap, inside the plot area\n        const space = 3;\n        const order = [...entries].sort((a, b) => a.top - b.top);\n        const lo = Math.max(EDGE, frame.plot.top);\n        const hi = Math.min(frame.vh - EDGE, frame.plot.bottom);\n        let floor = lo;\n        for (const entry of order) {\n            entry.top = Math.max(entry.top, floor);\n            floor = entry.top + entry.h + space;\n        }\n        let ceiling = hi;\n        for (let idx = order.length - 1; idx >= 0; idx -= 1) {\n            const entry = order[idx];\n            entry.top = Math.min(entry.top, ceiling - entry.h);\n            ceiling = entry.top - space;\n        }\n        for (const entry of entries) {\n            //  the coloured edge faces the point\n            entry.el.classList.toggle(\"is-left\", side === \"left\");\n            const left = side === \"right\" ? ax + gap : ax - gap - entry.w;\n            HoverTooltip.place(entry.el, clamp(left, EDGE, Math.max(EDGE, frame.vw - EDGE - entry.w)), entry.top);\n        }\n    }\n\n    hide() {\n        if (!this.layer) return;\n        window.removeEventListener(\"scroll\", this.onScroll, true);\n        if (this.watchTimer !== undefined) window.clearInterval(this.watchTimer);\n        this.watchTimer = undefined;\n        this.layer.remove();\n        this.layer = undefined;\n        this.box = undefined;\n        this.tags = [];\n        this.tagHtml = [];\n    }\n\n    /** The chart is redrawn or gone. */\n    destroy() {\n        this.hide();\n    }\n\n    private ensureLayer(): HTMLElement {\n        if (this.layer) return this.layer;\n        HoverTooltip.ensureStyle();\n        const layer = document.createElement(\"div\");\n        layer.className = \"myd3-tip-layer\";\n        document.body.appendChild(layer);\n        this.layer = layer;\n        //  the layer does not scroll with the chart — whatever scrolls, the read-out goes\n        //  until the pointer moves again\n        window.addEventListener(\"scroll\", this.onScroll, { capture: true, passive: true });\n        //  a chart unmounted (or redrawn by another instance) under a resting pointer\n        //  never sends \"mouseleave\"\n        this.watchTimer = window.setInterval(() => {\n            if (!this.host.area.isConnected) this.hide();\n        }, 300);\n        return layer;\n    }\n\n    private setTagCount(count: number) {\n        while (this.tags.length > count) {\n            (this.tags.pop() as HTMLElement).remove();\n            this.tagHtml.pop();\n        }\n        while (this.layer && this.tags.length < count) {\n            const el = document.createElement(\"div\");\n            this.layer.appendChild(el);\n            this.tags.push(el);\n            this.tagHtml.push(\"\");\n        }\n    }\n\n    /** The plot area and the chart on screen, and the scale from plot px to screen px. */\n    private frame() {\n        const plot = this.host.area.getBoundingClientRect();\n        const chart = this.host.container.getBoundingClientRect();\n        return {\n            plot,\n            chart,\n            sx: this.host.width > 0 && plot.width > 0 ? plot.width / this.host.width : 1,\n            sy: this.host.height > 0 && plot.height > 0 ? plot.height / this.host.height : 1,\n            vw: document.documentElement.clientWidth,\n            vh: document.documentElement.clientHeight,\n        };\n    }\n\n    /**\n     * Right or left of the hovered year: the side taken last, for as long as `width`\n     * fits there between the y-axis and the edge of the chart; else the other one —\n     * and when the plot is too narrow for either, the side with more of the window.\n     */\n    private pickSide(ax: number, gap: number, width: number,\n                     frame: { plot: DOMRect; chart: DOMRect; vw: number }): \"right\" | \"left\" {\n        const lo = Math.max(EDGE, frame.plot.left);\n        const hi = Math.min(frame.vw - EDGE, frame.chart.right - 4);\n        const fits = { right: ax + gap + width <= hi, left: ax - gap - width >= lo };\n        if (!fits[this.side]) {\n            const other = this.side === \"right\" ? \"left\" : \"right\";\n            if (fits[other]) this.side = other;\n            else this.side = frame.vw - EDGE - (ax + gap) >= ax - gap - EDGE ? \"right\" : \"left\";\n        }\n        return this.side;\n    }\n\n    private static place(el: HTMLElement, left: number, top: number) {\n        el.style.left = `${Math.round(left)}px`;\n        el.style.top = `${Math.round(top)}px`;\n    }\n\n    private static ensureStyle() {\n        if (document.getElementById(STYLE_ID)) return;\n        const style = document.createElement(\"style\");\n        style.id = STYLE_ID;\n        style.textContent = CSS;\n        document.head.appendChild(style);\n    }\n}\n\nexport { HoverTooltip };\nexport type { HoverAnchor, HoverTag, BoxPlacement, HoverTooltipHost };\n","/**\n * What the read-out of the hovered year says, in the four styles of the display\n * settings (core/DisplaySettings.ts → TooltipStyle). Where it goes is the business\n * of tooltip/HoverTooltip.ts.\n *\n * Every style shows the same facts per series — value, confidence interval, number\n * of sites — and names a series by its legend key, not by its title: the title is\n * only spelled out where the chart has no legend to look the key up in. A series\n * without a value in the hovered year is simply not listed.\n */\nimport type { TooltipContext, TooltipTraceData } from \"../types\";\nimport type { HoverTag } from \"./HoverTooltip\";\n\ninterface TrendTooltipRow {\n    /** The series key as inline SVG (\"\" in a chart with a single series). */\n    key: string;\n    name: string;\n    color: string;\n    value: string;\n    /** \"low – high\", or \"\" without an interval. */\n    ci: string;\n    /** The site count of this row (\"\" when the chart shows one count for all rows). */\n    sites: string;\n    /** y of the hovered point in plot-area px (null when it cannot be placed). */\n    y: number | null;\n}\n\ninterface TrendTooltipModel {\n    year: string;\n    rows: TrendTooltipRow[];\n    /** The site count shared by all rows (\"\" when every row has its own, or none is known). */\n    sites: string;\n    /** Slope significance of the hovered year, when the chart asks for it. */\n    badge: { label: string; color: string } | null;\n    /** The year flag on the axis already says which year this is. */\n    yearOnAxis: boolean;\n}\n\ninterface TrendTooltipSource {\n    context: TooltipContext;\n    /** Inline SVG of the legend key of a trace's series (\"\" for none). */\n    keyOf(trace: any): string;\n    /** The chart has no legend to look a key up in — spell out the names of the rows. */\n    named: boolean;\n    yearOnAxis: boolean;\n    /** y of a hovered point in plot-area px. */\n    yOf(entry: TooltipTraceData): number | null;\n}\n\nconst ESCAPES: Record<string, string> = { \"&\": \"&amp;\", \"<\": \"&lt;\", \">\": \"&gt;\", '\"': \"&quot;\", \"'\": \"&#39;\" };\nconst escapeHtml = (value: unknown): string => `${value ?? \"\"}`.replace(/[&<>\"']/g, ch => ESCAPES[ch]);\n\nconst formatValue = (n: number): string =>\n    n.toLocaleString(undefined, { maximumFractionDigits: 2, minimumFractionDigits: 2 });\n\nconst isNumber = (value: unknown): value is number => typeof value === \"number\" && Number.isFinite(value);\n\nfunction buildTrendTooltipModel(source: TrendTooltipSource): TrendTooltipModel {\n    const { context } = source;\n    const options = context.customOptions;\n    const sitesText = (n: unknown) => (isNumber(n) && n >= 0 ? context.translate(\"trends.nbSites\", { n }) : \"\");\n    const sitesPerRow = options?.ttShowSitesAtBottom === false;\n\n    //  every entry shares the hovered x; a fine year grid can carry long fractions —\n    //  one decimal at most, and integer years read as \"2015\"\n    const header = context.traces.find(entry => entry.selX !== undefined && entry.selX !== null)?.selX;\n    const year = typeof header === \"number\"\n        ? (Number.isInteger(header) ? `${header}` : header.toFixed(1))\n        : `${header ?? \"\"}`;\n\n    //  the traces a row could come from at all (the chart's series), and the rows of this year\n    const candidates = context.traces.filter(entry => entry.trace?.series || entry.hasData).length;\n    const rows: TrendTooltipRow[] = [];\n    for (const entry of context.traces) {\n        const data = entry.selectedData?.data;\n        if (!entry.hasData || !isNumber(entry.selY) || data === undefined) continue;\n        //  a chart that shows one thing needs neither key nor name\n        const key = candidates > 1 ? source.keyOf(entry.trace) : \"\";\n        rows.push({\n            key,\n            name: candidates > 1 && (source.named || !key) ? `${entry.trace?.title ?? \"\"}` : \"\",\n            color: entry.trace?.colorFull ?? \"#64748b\",\n            value: formatValue(entry.selY),\n            ci: isNumber(data.ciLow) && isNumber(data.ciHigh)\n                ? `${formatValue(data.ciLow)} – ${formatValue(data.ciHigh)}`\n                : \"\",\n            sites: sitesPerRow ? sitesText(data.nbSites) : \"\",\n            y: source.yOf(entry),\n        });\n    }\n\n    let badge: TrendTooltipModel[\"badge\"] = null;\n    if (options?.ttShowSignificance) {\n        const significance = context.traces.find(entry => entry.hasData && entry.selectedData)\n            ?.selectedData?.data?.significance;\n        if (significance !== undefined) {\n            //  the palette of the significance line: increase green / decrease red / flat slate\n            const map: Record<number, [string, string]> = {\n                1: [\"increasing\", \"#16a34a\"],\n                2: [\"decreasing\", \"#dc2626\"],\n                0: [\"not significant\", \"#64748b\"],\n            };\n            const [label, color] = map[significance] ?? map[0];\n            badge = { label, color };\n        }\n    }\n\n    return {\n        year,\n        rows,\n        sites: sitesPerRow ? \"\" : sitesText(context.nbSites),\n        badge,\n        yearOnAxis: source.yearOnAxis,\n    };\n}\n\nconst badgeHtml = (badge: TrendTooltipModel[\"badge\"]): string => (badge\n    ? `<span class=\"myd3-tip-badge\" style=\"background:${badge.color}1a;color:${badge.color}\">${escapeHtml(badge.label)}</span>`\n    : \"\");\n\n/** The rows as a grid — key · name · value · interval · sites — with only the columns any row fills. */\nfunction gridHtml(rows: TrendTooltipRow[]): string {\n    const columns = {\n        key: rows.some(row => row.key),\n        name: rows.some(row => row.name),\n        ci: rows.some(row => row.ci),\n        sites: rows.some(row => row.sites),\n    };\n    const count = 1 + Object.values(columns).filter(Boolean).length;\n    let cells = \"\";\n    for (const row of rows) {\n        if (columns.key) cells += `<span class=\"k\">${row.key}</span>`;\n        if (columns.name) cells += `<span class=\"n\">${escapeHtml(row.name)}</span>`;\n        cells += `<span class=\"v\">${row.value}</span>`;\n        if (columns.ci) cells += `<span class=\"c\">${row.ci}</span>`;\n        if (columns.sites) cells += `<span class=\"s\">${escapeHtml(row.sites)}</span>`;\n    }\n    return `<div class=\"myd3-tip-grid\" style=\"grid-template-columns:repeat(${count},auto)\">${cells}</div>`;\n}\n\n/** \"card\": the year and the shared site count as a heading, the rows as a table under it. */\nfunction renderCard(model: TrendTooltipModel): string {\n    if (model.rows.length === 0) return \"\";\n    const head = `<div class=\"myd3-tip-head\"><span class=\"myd3-tip-year\">${escapeHtml(model.year)}</span>`\n        + (model.sites ? `<span class=\"myd3-tip-muted\">${escapeHtml(model.sites)}</span>` : \"\") + `</div>`;\n    return `<div class=\"myd3-tip-card\">${head}${gridHtml(model.rows)}${model.badge ? `<div>${badgeHtml(model.badge)}</div>` : \"\"}</div>`;\n}\n\n/**\n * \"bubble\": as little as it takes, in the dark of the year flag it belongs with —\n * the year itself only while the flag is off.\n */\nfunction renderBubble(model: TrendTooltipModel): string {\n    const rows = model.rows;\n    if (rows.length === 0) return \"\";\n    const yearHtml = model.yearOnAxis ? \"\" : `<span class=\"myd3-tip-year\">${escapeHtml(model.year)}</span>`;\n    let body: string;\n    if (rows.length === 1 && !rows[0].key && !rows[0].name) {\n        //  a chart with one series: everything on one line\n        const row = rows[0];\n        const sites = row.sites || model.sites;\n        const parts = [yearHtml, `<span class=\"v\">${row.value}</span>`,\n            row.ci ? `<span class=\"c\">${row.ci}</span>` : \"\",\n            sites ? `<span class=\"s\">${escapeHtml(sites)}</span>` : \"\"].filter(Boolean);\n        body = `<div class=\"myd3-tip-grid\" style=\"grid-template-columns:repeat(${parts.length},auto)\">${parts.join(\"\")}</div>`;\n    } else {\n        const head = [yearHtml, model.sites ? `<span class=\"myd3-tip-muted\">${escapeHtml(model.sites)}</span>` : \"\"].filter(Boolean);\n        body = (head.length ? `<div class=\"myd3-tip-head\">${head.join(\"\")}</div>` : \"\") + gridHtml(rows);\n    }\n    return `<div class=\"myd3-tip-bubble\">${body}${model.badge ? `<div>${badgeHtml(model.badge)}</div>` : \"\"}`\n        + `<i class=\"myd3-tip-arrow\"></i></div>`;\n}\n\n/** \"docked\": a read-out that stays put — the year large, the rows under it. */\nfunction renderDocked(model: TrendTooltipModel): string {\n    if (model.rows.length === 0) return \"\";\n    const head = `<div class=\"myd3-tip-head\"><span class=\"myd3-tip-year\">${escapeHtml(model.year)}</span>`\n        + (model.sites ? `<span class=\"myd3-tip-muted\">${escapeHtml(model.sites)}</span>` : \"\") + `</div>`;\n    return `<div class=\"myd3-tip-docked\">${head}${gridHtml(model.rows)}${model.badge ? `<div>${badgeHtml(model.badge)}</div>` : \"\"}</div>`;\n}\n\n/**\n * \"tags\": one label per hovered point, level with it. What belongs to the year as a\n * whole (the year while the flag is off, a shared site count, the significance)\n * goes into one more label at the foot of the plot (`footY`, plot-area px).\n */\nfunction renderTags(model: TrendTooltipModel, footY: number): HoverTag[] {\n    const rows = model.rows.filter(row => row.y !== null);\n    if (rows.length === 0) return [];\n    //  a single label carries the shared site count itself\n    const single = rows.length === 1;\n    const tags: HoverTag[] = rows.map(row => {\n        const sites = row.sites || (single ? model.sites : \"\");\n        return {\n            html: (row.key ? `<span class=\"k\">${row.key}</span>` : \"\")\n                + (row.name ? `<span>${escapeHtml(row.name)}</span>` : \"\")\n                + `<b>${row.value}</b>`\n                + (row.ci ? `<span class=\"myd3-tip-muted\">${row.ci}</span>` : \"\")\n                + (sites ? `<span class=\"myd3-tip-muted\">· ${escapeHtml(sites)}</span>` : \"\"),\n            y: row.y as number,\n            color: row.color,\n        };\n    });\n    const meta = [model.yearOnAxis ? \"\" : `<b>${escapeHtml(model.year)}</b>`,\n        single || !model.sites ? \"\" : `<span>${escapeHtml(model.sites)}</span>`,\n        badgeHtml(model.badge)].filter(Boolean);\n    if (meta.length) tags.push({ html: meta.join(\"\"), y: footY, className: \"is-meta\" });\n    return tags;\n}\n\nexport { buildTrendTooltipModel, renderCard, renderBubble, renderDocked, renderTags, escapeHtml };\nexport type { TrendTooltipModel, TrendTooltipRow, TrendTooltipSource };\n","import type { Trace } from \"./PlotModel\";\n\n/** Columns of the per-year random time effects (RTE) on a trend trace. */\nconst RTE_KEYS = { value: \"rteVal\", low: \"rteLow\", high: \"rteHigh\" } as const;\n\n/**\n * One logical series of a chart: the traces that describe the same thing. Trend\n * plots ship two traces per series (the drawn line + the per-year hover/RTE trace),\n * so \"how many series does this chart overlay\" is not the trace count.\n *\n * Traces are grouped by `settings.seriesKey` (set by whoever merges plots, e.g.\n * lib/trends/mergeObsPlots.js), falling back to the title.\n */\nclass Series {\n    readonly traces: Trace[] = [];\n    /** The trace carrying the random time effects, when the series has them. */\n    rteTrace: Trace | null = null;\n    /** Position among the RTE-bearing series (-1 without RTE) — its lane and marker. */\n    rteRank = -1;\n\n    constructor(\n        readonly key: string,\n        readonly label: string,\n        readonly index: number\n    ) {}\n\n    /** The trace whose colours represent the series (the drawn one, if any). */\n    get styleTrace(): Trace {\n        return this.traces.find(trace => trace.settings.hideGraph !== true) ?? this.traces[0];\n    }\n\n    get hasRte(): boolean {\n        return this.rteTrace !== null;\n    }\n}\n\nfunction traceHasRte(trace: Trace): boolean {\n    const settings = trace.settings;\n    if (!settings.keyRteLow || !settings.keyRteHigh || trace.items.length === 0) return false;\n    const first = trace.items[0].data;\n    return first[RTE_KEYS.low] !== undefined && first[RTE_KEYS.high] !== undefined;\n}\n\ninterface SeriesLayout {\n    series: Series[];\n    /** The series with random time effects, in rank order (= lane order, left to right). */\n    rteSeries: Series[];\n}\n\n/** Group the trend traces of a plot into series and index their random time effects. */\nfunction buildSeriesLayout(traces: Trace[]): SeriesLayout {\n    const byKey = new Map<string, Series>();\n    const series: Series[] = [];\n    for (const trace of traces) {\n        if (trace.settings.type !== \"trend\") continue;\n        const key = `${trace.settings.seriesKey ?? trace.title ?? `#${trace.traceIndex}`}`;\n        let entry = byKey.get(key);\n        if (!entry) {\n            entry = new Series(key, `${trace.settings.seriesLabel ?? trace.title ?? \"\"}`, series.length);\n            byKey.set(key, entry);\n            series.push(entry);\n        }\n        entry.traces.push(trace);\n        trace.series = entry;\n        if (!entry.rteTrace && traceHasRte(trace)) entry.rteTrace = trace;\n    }\n\n    const rteSeries = series.filter(entry => entry.hasRte);\n    rteSeries.forEach((entry, rank) => { entry.rteRank = rank; });\n    return { series, rteSeries };\n}\n\nexport { RTE_KEYS, Series, traceHasRte, buildSeriesLayout };\nexport type { SeriesLayout };\n","import type { TraceHandler } from \"../handlers/TraceHandler\";\nimport type { TraceRenderable } from \"../renderables\";\nimport type { MyD3 } from \"../MyD3\";\nimport type { Series, SeriesLayout } from \"./Series\";\nimport { buildSeriesLayout } from \"./Series\";\n\nclass MyPlotVisuals {\n    showLine = true;\n    showMarkers = false;\n    showErrorArea = true;\n    showErrorBars = false;\n    showErrorLines = false;\n    expertMode = false;\n}\n\nclass Plot {\n    traces: Trace[] = [];\n    renderables: TraceRenderable[] = [];\n    xMin = 0;\n    xMax = 0;\n    yMin = 0;\n    yMax = 0;\n    axisXType: \"linear\" | \"categorical\" = \"linear\";\n    axisYType: \"linear\" | \"categorical\" = \"linear\";\n    categoricalXLabels: string[] = [];\n    categoricalYLabels: string[] = [];\n    /** The trend traces grouped into logical series, with their random time effects indexed. */\n    seriesLayout: SeriesLayout = { series: [], rteSeries: [] };\n\n    prepare(plot: any, handlers: TraceHandler[]) {\n        if (!plot?.traces || !Array.isArray(plot.traces)) {\n            this.traces = [];\n            return;\n        }\n\n        const prepared: Trace[] = [];\n        for (const jsonTrace of plot.traces) {\n            const handler = handlers.find(item => item.canHandle(jsonTrace));\n            if (!handler) continue;\n            const trace = handler.read(jsonTrace);\n            trace.traceIndex = prepared.length;\n            prepared.push(trace);\n        }\n        this.traces = prepared;\n        this.seriesLayout = buildSeriesLayout(prepared);\n    }\n\n    prepareBounds(myD3: MyD3) {\n        if (this.traces.length === 0) return;\n\n        const renderables: TraceRenderable[] = [];\n        for (const trace of this.traces) {\n            renderables.push(...trace.traceHandler.yieldRenderables(trace, myD3));\n        }\n        renderables.sort((a, b) => a.sort - b.sort);\n        this.renderables = renderables;\n\n        for (const renderable of this.renderables) {\n            renderable.configureAxes(this);\n        }\n\n        for (const renderable of this.renderables) {\n            renderable.updateBounds();\n        }\n\n        this.xMin = Math.min(...this.traces.map(trace => trace.xMin));\n        this.xMax = Math.max(...this.traces.map(trace => trace.xMax));\n        const { yMin, yMax } = myD3.resolveYBounds(\n            Math.min(...this.traces.map(trace => trace.yMin)),\n            Math.max(...this.traces.map(trace => trace.yMax))\n        );\n        this.yMin = yMin;\n        this.yMax = yMax;\n    }\n}\n\nclass Trace {\n    items: TraceData[] = [];\n    settings: Record<string, any>;\n    title = \"\";\n    traceIndex = 0;\n    xMin = 0;\n    xMax = 0;\n    yMin = 0;\n    yMax = 0;\n    hsva: number[] = [240, 1.0, 1.0, 1.0];\n    colorFull = \"\";\n    colorFullAlpha10 = \"\";\n    colorFullAlpha25 = \"\";\n    colorDesaturated = \"\";\n    colorDark = \"\";\n    colorLight = \"\";\n    colorBarFill = \"\";\n    colorBarStroke = \"\";\n    colorText = \"\";\n    colorTextMuted = \"\";\n    focusMarker: any;\n    traceHandler: TraceHandler;\n    /** The logical series this trace belongs to (trend traces only; set by Plot.prepare). */\n    series?: Series;\n    keyX = \"year\";\n    keyY = \"trend\";\n    /** Stroke dash array for dashed lines (e.g., \"5,5\" or \"10,5,2,5\"). Empty string means solid line. */\n    dashArray = \"\";\n\n    constructor(traceJson: any, traceHandler: TraceHandler) {\n        this.traceHandler = traceHandler;\n        this.settings = traceJson.settings || {};\n        this.title = traceJson.title;\n        this.keyX = this.settings.keyX || this.keyX;\n        this.keyY = this.settings.keyY || this.keyY;\n        this.applyStyle();\n    }\n\n    private applyStyle() {\n        const style = this.settings.style;\n        if (style) {\n            this.hsva = style.hsva || this.hsva;\n            this.dashArray = style.dashArray || this.dashArray;\n        }\n        this.applyHsva(this.hsva[0], this.hsva[1], this.hsva[2], this.hsva[3]);\n        // An explicit hex colour (style.color) wins over the hue-derived palette,\n        // so trend/scatter traces can share the cohesive account chart colours.\n        if (style?.color) {\n            this.applyColorHex(style.color);\n        }\n    }\n\n    /**\n     * Override the derived colour set from a single hex (e.g. \"#2563eb\").\n     * Keeps every colour slot in the same family so lines, markers, fills and\n     * tooltip accents stay consistent with the account palette.\n     */\n    applyColorHex(hex: string) {\n        const m = /^#?([a-f\\d]{2})([a-f\\d]{2})([a-f\\d]{2})$/i.exec(hex.trim());\n        if (!m) return;\n        const r = parseInt(m[1], 16), g = parseInt(m[2], 16), b = parseInt(m[3], 16);\n        const mix = (t: number) => `rgb(${Math.round(r + (255 - r) * t)}, ${Math.round(g + (255 - g) * t)}, ${Math.round(b + (255 - b) * t)})`;\n        const shade = (t: number) => `rgb(${Math.round(r * (1 - t))}, ${Math.round(g * (1 - t))}, ${Math.round(b * (1 - t))})`;\n        const rgba = (a: number) => `rgba(${r}, ${g}, ${b}, ${a})`;\n        this.colorFull = `rgb(${r}, ${g}, ${b})`;\n        this.colorFullAlpha10 = rgba(0.1);\n        this.colorFullAlpha25 = rgba(0.25);\n        this.colorDesaturated = mix(0.45);\n        this.colorDark = shade(0.35);\n        this.colorLight = mix(0.55);\n        this.colorBarFill = rgba(0.5);\n        this.colorBarStroke = shade(0.3);\n        this.colorText = shade(0.1);\n        this.colorTextMuted = mix(0.3);\n    }\n\n    applyHsva(hue: number, saturation = 0.0, brightness = 1.0, alpha = 1.0) {\n        const fn = (h: number, s: number, b: number, a: number) => {\n            return `hsla(${h}, ${Math.round(saturation * s)}%, ${Math.round(brightness * b)}%, ${alpha * a})`;\n        };\n        this.colorFull = fn(hue, 100, 50, 1.0);\n        this.colorFullAlpha10 = fn(hue, 100, 50, 0.1);\n        this.colorFullAlpha25 = fn(hue, 100, 50, 0.25);\n        this.colorDesaturated = fn(hue, 30, 50, 1.0);\n        this.colorDark = fn(hue, 100, 25, 1.0);\n        this.colorLight = fn(hue, 100, 75, 1.0);\n        this.colorBarFill = fn(hue, 70, 40, 0.5);\n        this.colorBarStroke = fn(hue, 70, 20, 0.5);\n        this.colorText = fn(hue, 100, 60, 1.0);\n        this.colorTextMuted = fn(hue, 50, 60, 1.0);\n    }\n}\n\nclass TraceData {\n    data: any;\n\n    constructor(data: any) {\n        this.data = data;\n    }\n}\n\nexport { MyPlotVisuals, Plot, Trace, TraceData };\n\n","/**\n * The viewer-adjustable display settings of a chart: what the settings button in the\n * MyD3 toolbar edits. They are plain data (JSON-serialisable) so a host can persist\n * them; MyD3 itself never stores anything.\n *\n * Everything here is OPTIONAL behaviour layered over the classic rendering — see\n * `classicDisplaySettings()` for what a chart gets that does not opt in.\n */\n\n/**\n * How a chart with several series draws their per-year random time effects (RTE):\n * - `columns`: series side by side in fixed lanes; the year guides shade every year as a column\n * - `nested`:  all series on the exact year; intervals nested as bars of different widths\n * - `rows`:    one row per series over a shared year axis\n */\ntype MultiSeriesStyle = \"columns\" | \"nested\" | \"rows\";\n\nconst MULTI_SERIES_STYLES: MultiSeriesStyle[] = [\"columns\", \"nested\", \"rows\"];\n\n/** Styles that place the series side by side — the only ones the offsets apply to. */\nconst OFFSET_STYLES: MultiSeriesStyle[] = [\"columns\"];\n\n/**\n * How the values of the hovered year are shown (tooltip/HoverTooltip.ts):\n * - `card`:   a light card beside the hovered year, at the height of the pointer\n * - `bubble`: a dark bubble above the marks of the hovered year, pointing at it\n * - `tags`:   no box — a small label at every hovered point\n * - `docked`: a read-out fixed in a top corner of the plot\n */\ntype TooltipStyle = \"card\" | \"bubble\" | \"tags\" | \"docked\";\n\nconst TOOLTIP_STYLES: TooltipStyle[] = [\"card\", \"bubble\", \"tags\", \"docked\"];\n\ninterface AxisTitleSetting {\n    show: boolean;\n    /** Empty = the chart's own default title (customOptions.axisTitles). */\n    text: string;\n}\n\ninterface RteOffsetSettings {\n    /** Draw the year effects of the series side by side instead of on top of each other. */\n    enabled: boolean;\n    /** Offset of the first series in years; null centres the group on the year. */\n    start: number | null;\n    /** Distance between two neighbouring series, in years. */\n    step: number;\n    /** The confidence band of a series moves along with its year effects. */\n    followBand: boolean;\n    /** The trend line (and its hover marker) moves along, too. */\n    followLine: boolean;\n}\n\ninterface MultiSeriesSettings {\n    style: MultiSeriesStyle;\n    legend: boolean;\n    /** A tick mark for every single year on the x-axis. */\n    yearTicks: boolean;\n    /** The device of the style that ties a mark to its year (shaded columns, rules). */\n    yearGuides: boolean;\n    offset: RteOffsetSettings;\n}\n\n/** What marks the hovered year of a chart whose x-axis counts years. */\ninterface HoverSettings {\n    /** The year in a dark flag on the x-axis. */\n    yearFlag: boolean;\n    /** A tinted background behind the hovered year. */\n    yearBackground: boolean;\n}\n\ninterface TooltipSettings {\n    style: TooltipStyle;\n}\n\ninterface MyD3DisplaySettings {\n    axisTitles: { x: AxisTitleSetting; y: AxisTitleSetting };\n    multi: MultiSeriesSettings;\n    hover: HoverSettings;\n    tooltip: TooltipSettings;\n}\n\ntype DeepPartial<T> = { [K in keyof T]?: T[K] extends object | null ? DeepPartial<T[K]> : T[K] };\n\nfunction defaultDisplaySettings(): MyD3DisplaySettings {\n    return {\n        axisTitles: {\n            x: { show: true, text: \"\" },\n            y: { show: true, text: \"\" },\n        },\n        multi: {\n            style: \"columns\",\n            legend: true,\n            yearTicks: true,\n            yearGuides: false,\n            offset: {\n                enabled: true,\n                start: null,\n                step: 0.25,\n                followBand: true,\n                followLine: true,\n            },\n        },\n        hover: { yearFlag: true, yearBackground: false },\n        tooltip: { style: \"card\" },\n    };\n}\n\n/**\n * What a chart gets that does not opt in to the display settings\n * (customOptions.displaySettings): no legend, year ticks or year guides, and the\n * year effects of several series side by side while band and line stay put. The\n * hover defaults — the year flag and the tooltip — are the same for every chart.\n * Axis titles a chart declares are shown.\n */\nfunction classicDisplaySettings(): MyD3DisplaySettings {\n    const settings = defaultDisplaySettings();\n    settings.multi.legend = false;\n    settings.multi.yearTicks = false;\n    settings.multi.offset.followBand = false;\n    settings.multi.offset.followLine = false;\n    return settings;\n}\n\nconst bool = (value: unknown, fallback: boolean): boolean =>\n    typeof value === \"boolean\" ? value : fallback;\n\nconst num = (value: unknown, fallback: number, min: number, max: number): number => {\n    const n = typeof value === \"string\" && value.trim() !== \"\" ? Number(value) : value;\n    if (typeof n !== \"number\" || !Number.isFinite(n)) return fallback;\n    return Math.max(min, Math.min(max, n));\n};\n\nconst text = (value: unknown, fallback: string): string =>\n    typeof value === \"string\" ? value.slice(0, 80) : fallback;\n\n/** Limits of the numeric settings — shared with the settings panel's inputs. */\nconst OFFSET_LIMITS = {\n    start: { min: -0.5, max: 0.5, step: 0.05 },\n    step: { min: 0.05, max: 1, step: 0.05 },\n};\n\n/**\n * Merge stored/partial settings over the defaults, dropping anything that is not a\n * valid value (including keys and styles of older versions of this shape). Never\n * throws: persisted settings come from localStorage and may be stale or hand-edited.\n */\nfunction resolveDisplaySettings(input?: unknown, base: MyD3DisplaySettings = defaultDisplaySettings()): MyD3DisplaySettings {\n    const object = (value: unknown): any => (value && typeof value === \"object\" ? value : {});\n    const src = object(input);\n    const axis = (key: \"x\" | \"y\"): AxisTitleSetting => ({\n        show: bool(src.axisTitles?.[key]?.show, base.axisTitles[key].show),\n        text: text(src.axisTitles?.[key]?.text, base.axisTitles[key].text),\n    });\n    const multi = object(src.multi);\n    const offset = object(multi.offset);\n    const hover = object(src.hover);\n    const tooltip = object(src.tooltip);\n    const b = base.multi;\n    //  null (or an emptied input) means \"centred\"; anything unparsable keeps the base value\n    let start: number | null = b.offset.start;\n    if (offset.start === null || offset.start === \"\") {\n        start = null;\n    } else if (offset.start !== undefined) {\n        const parsed = num(offset.start, NaN, OFFSET_LIMITS.start.min, OFFSET_LIMITS.start.max);\n        if (!Number.isNaN(parsed)) start = parsed;\n    }\n    return {\n        axisTitles: { x: axis(\"x\"), y: axis(\"y\") },\n        multi: {\n            style: MULTI_SERIES_STYLES.includes(multi.style) ? multi.style : b.style,\n            legend: bool(multi.legend, b.legend),\n            yearTicks: bool(multi.yearTicks, b.yearTicks),\n            yearGuides: bool(multi.yearGuides, b.yearGuides),\n            offset: {\n                enabled: bool(offset.enabled, b.offset.enabled),\n                start,\n                step: num(offset.step, b.offset.step, OFFSET_LIMITS.step.min, OFFSET_LIMITS.step.max),\n                followBand: bool(offset.followBand, b.offset.followBand),\n                followLine: bool(offset.followLine, b.offset.followLine),\n            },\n        },\n        hover: {\n            yearFlag: bool(hover.yearFlag, base.hover.yearFlag),\n            yearBackground: bool(hover.yearBackground, base.hover.yearBackground),\n        },\n        tooltip: {\n            style: TOOLTIP_STYLES.includes(tooltip.style) ? tooltip.style : base.tooltip.style,\n        },\n    };\n}\n\nexport {\n    MULTI_SERIES_STYLES,\n    OFFSET_STYLES,\n    OFFSET_LIMITS,\n    TOOLTIP_STYLES,\n    defaultDisplaySettings,\n    classicDisplaySettings,\n    resolveDisplaySettings,\n};\nexport type {\n    MultiSeriesStyle,\n    TooltipStyle,\n    AxisTitleSetting,\n    RteOffsetSettings,\n    MultiSeriesSettings,\n    HoverSettings,\n    TooltipSettings,\n    MyD3DisplaySettings,\n    DeepPartial,\n};\n","import type { MyD3 } from \"../MyD3\";\nimport type { Trace } from \"./PlotModel\";\nimport type { SeriesLayout } from \"./Series\";\nimport type { MultiSeriesSettings, MultiSeriesStyle } from \"./DisplaySettings\";\nimport { OFFSET_STYLES } from \"./DisplaySettings\";\n\n/**\n * Lanes never leave their year: the outermost two are at most this many years\n * apart, however many series share the year and whatever step is configured.\n */\nconst MAX_LANE_SPREAD = 0.6;\n\n/**\n * Everything the renderables need to know about a chart that overlays several\n * series: which style draws their random time effects (RTE), and how far each\n * series is shifted sideways so marks sharing a year do not sit on top of each other.\n *\n * Exists for every chart — with fewer than two series all offsets are simply 0.\n */\nclass MultiSeriesContext {\n    constructor(private readonly myD3: MyD3) {}\n\n    get layout(): SeriesLayout {\n        return this.myD3.preparedPlot.seriesLayout;\n    }\n\n    get settings(): MultiSeriesSettings {\n        return this.myD3.display.multi;\n    }\n\n    /** Several series over a time axis — the chart the multi-series settings are about. */\n    get isMulti(): boolean {\n        const plot = this.myD3.preparedPlot;\n        return this.layout.series.length >= 2 && plot.axisXType === \"linear\" && plot.axisYType === \"linear\";\n    }\n\n    /** The active style, or null when the chart has a single series. */\n    get style(): MultiSeriesStyle | null {\n        return this.isMulti ? this.settings.style : null;\n    }\n\n    get rowsActive(): boolean {\n        return this.style === \"rows\";\n    }\n\n    /** Nested intervals need at least two RTE series to nest. */\n    get nestedActive(): boolean {\n        return this.style === \"nested\" && this.layout.rteSeries.length >= 2;\n    }\n\n    /**\n     * The year effects of the series are drawn side by side: every series in a lane\n     * of its own, the same in every year — so its band and line can move along.\n     */\n    get offsetsActive(): boolean {\n        return this.settings.offset.enabled\n            && this.layout.rteSeries.length >= 2\n            && OFFSET_STYLES.includes(this.settings.style)\n            && this.style !== null;\n    }\n\n    /** Width of one year on the x-axis of the current draw, in px. */\n    yearPx(): number {\n        const x = this.myD3.axisX;\n        if (typeof x !== \"function\") return 0;\n        const px = Math.abs(x(1) - x(0));\n        return Number.isFinite(px) ? px : 0;\n    }\n\n    /** Offset of lane `index` out of `n` in years (lane 0 is the leftmost unless `start` says otherwise). */\n    private laneYears(index: number, n: number): number {\n        const offset = this.settings.offset;\n        if (n < 2 || !(offset.step > 0)) return 0;\n        const step = Math.min(offset.step, MAX_LANE_SPREAD / (n - 1));\n        //  an explicit start scales with the step, so capping keeps the pattern's shape\n        const start = offset.start === null ? -(n - 1) / 2 * step : offset.start * (step / offset.step);\n        return start + index * step;\n    }\n\n    /** Offset of the lane of `trace`'s series in years (0 when the series are not side by side). */\n    laneOffset(trace: Trace): number {\n        const series = trace.series;\n        if (!series || !series.hasRte || !this.offsetsActive) return 0;\n        return this.laneYears(series.rteRank, this.layout.rteSeries.length);\n    }\n\n    /** px offset of the year effects of `trace`. */\n    rteDx(trace: Trace): number {\n        return this.laneOffset(trace) * this.yearPx();\n    }\n\n    /** px offset of the confidence band / trend line of `trace`'s series (0 unless it follows its lane). */\n    partDx(trace: Trace, part: \"band\" | \"line\"): number {\n        const offset = this.settings.offset;\n        if (part === \"band\" ? !offset.followBand : !offset.followLine) return 0;\n        return this.rteDx(trace);\n    }\n\n    /** Half the width the lanes of the current draw take around a year, in px. */\n    laneSpreadPx(): number {\n        if (!this.offsetsActive) return 0;\n        const n = this.layout.rteSeries.length;\n        const first = this.laneYears(0, n);\n        const last = this.laneYears(n - 1, n);\n        return Math.max(Math.abs(first), Math.abs(last)) * this.yearPx();\n    }\n}\n\nexport { MultiSeriesContext, MAX_LANE_SPREAD };\n","import type { MyD3 } from \"../MyD3\";\nimport type { Plot, Trace, TraceData } from \"../core/PlotModel\";\n\n/**\n * Base class for every renderable element that can appear inside a plot.\n * Keeps references to the owning MyD3 instance and the trace it belongs to.\n */\nabstract class TraceRenderable {\n    constructor(\n        protected readonly myD3: MyD3,\n        protected readonly trace: Trace,\n        public readonly sort: number\n    ) {}\n\n    /** The trace this renderable draws — lets MyD3 route it to the panel of its series. */\n    get sourceTrace(): Trace {\n        return this.trace;\n    }\n\n    abstract updateBounds(): void;\n\n    abstract render(): void;\n\n    // Allow renderables to override axis configuration if needed (categorical charts, etc.)\n    configureAxes(_plot: Plot): void {\n        // Default implementation - override in subclasses if needed\n        return;\n    }\n\n    static findMinMax(items: TraceData[], keys: string[], currentMin: number, currentMax: number): [number, number] {\n        let min = Number.isFinite(currentMin) ? currentMin : Infinity;\n        let max = Number.isFinite(currentMax) ? currentMax : -Infinity;\n\n        for (const item of items) {\n            for (const key of keys) {\n                const value = item.data[key];\n                if (value === value) { // filters NaN\n                    if (value < min) min = value;\n                    if (value > max) max = value;\n                }\n            }\n        }\n\n        return [min, max];\n    }\n\n    static findMinMax2(\n        items: TraceData[],\n        keysMin: string[],\n        keysMax: string[],\n        currentMin: number,\n        currentMax: number\n    ): [number, number] {\n        let min = Number.isFinite(currentMin) ? currentMin : Infinity;\n        let max = Number.isFinite(currentMax) ? currentMax : -Infinity;\n\n        for (const item of items) {\n            for (const key of keysMin) {\n                const value = item.data[key];\n                if (value === value && value < min) {\n                    min = value;\n                }\n            }\n            for (const key of keysMax) {\n                const value = item.data[key];\n                if (value === value && value > max) {\n                    max = value;\n                }\n            }\n        }\n\n        return [min, max];\n    }\n}\n\nexport { TraceRenderable };\n\n\n","import type { Trace } from \"../core/PlotModel\";\nimport type { SignificanceSegment } from \"../types\";\nimport type { MyD3 } from \"../MyD3\";\n\n// Modern increase/decrease hues, consistent with the site palette. Older cached\n// plots carry neon #00ff00 / #ff0000 baked into their trace settings, so we map\n// those legacy values across here rather than only fixing them at the source.\nconst MODERN_INCREASE = \"#16a34a\";\nconst MODERN_DECREASE = \"#dc2626\";\nconst LEGACY_INCREASE = new Set([\"#00ff00\", \"#0f0\", \"lime\"]);\nconst LEGACY_DECREASE = new Set([\"#ff0000\", \"#f00\", \"red\"]);\n\nfunction modernizeColor(color: string | undefined, modern: string, legacy: Set<string>): string | undefined {\n    if (!color) return color;\n    return legacy.has(color.toLowerCase()) ? modern : color;\n}\n\nfunction getStrokeColor(trace: Trace, significance: number, myD3?: MyD3): string {\n    const colors = trace.settings?.style?.colors;\n    if (myD3?.data?.type === \"TG\") {\n        return significance === 0 ? trace.colorDesaturated : trace.colorFull;\n    }\n    if (significance === 1) {\n        return modernizeColor(colors?.increase, MODERN_INCREASE, LEGACY_INCREASE) || trace.colorDark;\n    }\n    if (significance === 2) {\n        return modernizeColor(colors?.decrease, MODERN_DECREASE, LEGACY_DECREASE) || trace.colorDark;\n    }\n    return trace.colorFull;\n}\n\nfunction getStrokeWidth(myD3?: MyD3): number {\n    if (!myD3) return 1;\n    if (myD3.dlStrokeWidth && myD3.dlStrokeWidthMul) {\n        return myD3.dlStrokeWidth * myD3.dlStrokeWidthMul;\n    }\n    return 1;\n}\n\nfunction createSegmentsBySignificance(trace: Trace, myD3?: MyD3): SignificanceSegment[] {\n    const segments: SignificanceSegment[] = [];\n    let segment: SignificanceSegment | undefined;\n\n    for (let idx = 0; idx < trace.items.length; idx += 1) {\n        const item = trace.items[idx];\n        const significance = item.data.significance;\n        const isNewSegment = !segment || segment.significance !== significance;\n\n        if (isNewSegment) {\n            segment = {\n                significance,\n                stroke: getStrokeColor(trace, significance, myD3),\n                strokeWidth: getStrokeWidth(myD3),\n                x0: idx > 0 ? idx - 1 : 0,\n                x1: idx\n            };\n            segments.push(segment);\n        }\n\n        if (segment) {\n            segment.x1 = idx + 1;\n        }\n    }\n\n    return segments;\n}\n\nfunction stripShortSignificantSegments(segments: SignificanceSegment[], trace: Trace): SignificanceSegment[] {\n    const result: SignificanceSegment[] = [];\n    const threshold = 2 / 3; // 0.6666\n\n    for (let idx = 0; idx < segments.length; idx += 1) {\n        const seg = { ...segments[idx] };\n        const year0 = trace.items[seg.x0]?.data.year;\n        const year1 = trace.items[seg.x1 - 1]?.data.year;\n        const span = year1 - year0;\n\n        if (Number.isFinite(span) && span < threshold) {\n            const prev = result[result.length - 1];\n            const next = segments[idx + 1];\n\n            if (prev) {\n                prev.x1 = seg.x1;\n                if (next && prev.significance === next.significance) {\n                    prev.x1 = next.x1;\n                    idx += 1;\n                }\n                continue;\n            }\n\n            if (next) {\n                next.x0 = seg.x0;\n                continue;\n            }\n        }\n\n        const last = result[result.length - 1];\n        if (last && last.significance === seg.significance && last.x1 === seg.x0) {\n            last.x1 = seg.x1;\n        } else {\n            result.push(seg);\n        }\n    }\n\n    return result;\n}\n\nexport { createSegmentsBySignificance, stripShortSignificantSegments };\n\n\n","import * as d3 from \"d3\";\n\nimport type { Trace } from \"../core/PlotModel\";\nimport type { MyD3 } from \"../MyD3\";\nimport { TraceRenderable } from \"./TraceRenderable\";\nimport { createSegmentsBySignificance } from \"../utils/significance\";\n\n/** Optional smoothing for trend lines/areas via trace.settings.curve. */\nfunction resolveCurve(trace: Trace): d3.CurveFactory | null {\n    return trace.settings?.curve === \"monotoneX\" ? d3.curveMonotoneX : null;\n}\n\n/*  Random-time-effect (RTE) overlays of several series (e.g. all-in-one W_HGAM +\n *  SBB_HURDLE) sit on the same integer years and would be drawn on top of each\n *  other. How they are told apart is the chart's multi-series style\n *  (core/MultiSeries.ts, core/DisplaySettings.ts): side by side in lanes\n *  (\"dodged\", like ggplot2's position_dodge) or nested on the exact year. */\nconst RTE_MARKER_AREA = Math.PI * 9; // = a circle of r 3\nconst RTE_SHAPES = [d3.symbolCircle, d3.symbolDiamond, d3.symbolSquare, d3.symbolTriangle];\n/** Marker of the i-th RTE series (redundant to colour): filled circle, hollow circle,\n *  filled diamond, hollow diamond, ... -- a single series keeps the filled circle. */\nfunction rteMarker(rank: number): { d: string; hollow: boolean } {\n    const shape = RTE_SHAPES[Math.floor(rank / 2) % RTE_SHAPES.length];\n    return { d: d3.symbol().type(shape).size(RTE_MARKER_AREA)() ?? \"\", hollow: rank % 2 === 1 };\n}\n\n/**\n * Width of the interval bar of RTE series `rank` out of `n` in the nested style, as a\n * fraction of one year: the first series is the widest, each next one narrower. The\n * last series is not a bar at all — it keeps the classic dot + whisker.\n */\nfunction nestedBarFraction(rank: number, n: number): number {\n    if (n <= 2) return 0.6;\n    return 0.78 - rank * (0.48 / (n - 2));\n}\n\nclass LineRenderable extends TraceRenderable {\n    private readonly keyX: string;\n    private readonly keyY: string;\n\n    constructor(myD3: MyD3, trace: Trace, sort: number) {\n        super(myD3, trace, sort);\n        this.keyX = trace.keyX;\n        this.keyY = trace.keyY;\n    }\n\n    updateBounds(): void {\n        const trace = this.trace;\n        const [xMin, xMax] = TraceRenderable.findMinMax(trace.items, [trace.keyX], trace.xMin, trace.xMax);\n        const [yMin, yMax] = TraceRenderable.findMinMax(trace.items, [this.keyY], trace.yMin, trace.yMax);\n        trace.xMin = xMin;\n        trace.xMax = xMax;\n        trace.yMin = yMin;\n        trace.yMax = yMax;\n    }\n\n    render(): void {\n        const trace = this.trace;\n        const svg = this.myD3.svg;\n        const x = this.myD3.axisX;\n        const y = this.myD3.axisY;\n        const segments = createSegmentsBySignificance(trace, this.myD3);\n\n        const curve = resolveCurve(trace);\n        const dx = this.myD3.multi.partDx(trace, \"line\");\n        for (const segment of segments) {\n            const items = trace.items.slice(segment.x0, segment.x1);\n            const lineGen = d3.line()\n                .x((d: any) => x(d.data[this.keyX]) + dx)\n                .y((d: any) => y(d.data[this.keyY]));\n            if (curve) lineGen.curve(curve);\n            const path = svg.append(\"path\")\n                .datum(items)\n                .attr(\"fill\", \"none\")\n                .attr(\"stroke\", segment.stroke)\n                .attr(\"stroke-width\", segment.strokeWidth || this.myD3.dlStrokeWidthMul * this.myD3.dlStrokeWidth)\n                .attr(\"d\", lineGen);\n            if (trace.dashArray) {\n                path.attr(\"stroke-dasharray\", trace.dashArray);\n            }\n        }\n    }\n}\n\nclass AreaRenderable extends TraceRenderable {\n    private readonly keyY0 = \"ciLow\";\n    private readonly keyY1 = \"ciHigh\";\n\n    updateBounds(): void {\n        const trace = this.trace;\n        const [xMin, xMax] = TraceRenderable.findMinMax(trace.items, [trace.keyX], trace.xMin, trace.xMax);\n        const [yMin, yMax] = TraceRenderable.findMinMax2(\n            trace.items,\n            [this.keyY0],\n            [this.keyY1],\n            trace.yMin,\n            trace.yMax\n        );\n        trace.xMin = xMin;\n        trace.xMax = xMax;\n        trace.yMin = yMin;\n        trace.yMax = yMax;\n    }\n\n    render(): void {\n        const trace = this.trace;\n        // Traces without CI columns (or with the error area toggled off after\n        // construction) must not paint a NaN path.\n        if (!this.myD3.visuals.showErrorArea) return;\n        if (!trace.items.length || trace.items[0].data[this.keyY0] === undefined) return;\n        const svg = this.myD3.svg;\n        const x = this.myD3.axisX;\n        const y = this.myD3.axisY;\n        const dx = this.myD3.multi.partDx(trace, \"band\");\n\n        svg.append(\"path\")\n            .datum(trace.items)\n            .attr(\"fill\", trace.colorFullAlpha10)\n            .attr(\"stroke\", \"none\")\n            .attr(\"d\", d3.area()\n                .x((d: any) => x(d.data[trace.keyX]) + dx)\n                .y0((d: any) => y(d.data[this.keyY0]))\n                .y1((d: any) => y(d.data[this.keyY1]))\n            );\n    }\n}\n\n// Gradient ids are document-global, so several charts on one page must not collide.\nlet fillAreaGradientSeq = 0;\n\n/**\n * Soft gradient fill between the trend line and the x-axis (trace.settings.fillArea).\n * Unlike AreaRenderable this needs no CI columns — it shades the value itself.\n */\nclass FillAreaRenderable extends TraceRenderable {\n    updateBounds(): void {\n        // The line's own bounds already cover the filled region.\n    }\n\n    render(): void {\n        const trace = this.trace;\n        if (!trace.items.length) return;\n        const svg = this.myD3.svg;\n        const x = this.myD3.axisX;\n        const y = this.myD3.axisY;\n\n        fillAreaGradientSeq += 1;\n        const gradientId = `myd3-fill-area-${fillAreaGradientSeq}`;\n        const gradient = svg.append(\"defs\").append(\"linearGradient\")\n            .attr(\"id\", gradientId)\n            .attr(\"x1\", 0).attr(\"y1\", 0).attr(\"x2\", 0).attr(\"y2\", 1);\n        gradient.append(\"stop\").attr(\"offset\", \"0%\")\n            .attr(\"stop-color\", trace.colorFull).attr(\"stop-opacity\", 0.35);\n        gradient.append(\"stop\").attr(\"offset\", \"100%\")\n            .attr(\"stop-color\", trace.colorFull).attr(\"stop-opacity\", 0.02);\n\n        const baseline = y(Math.max(0, this.myD3.preparedPlot.yMin));\n        const areaGen = d3.area()\n            .x((d: any) => x(d.data[trace.keyX]))\n            .y0(baseline)\n            .y1((d: any) => y(d.data[trace.keyY]));\n        const curve = resolveCurve(trace);\n        if (curve) areaGen.curve(curve);\n\n        svg.append(\"path\")\n            .datum(trace.items)\n            .attr(\"fill\", `url(#${gradientId})`)\n            .attr(\"stroke\", \"none\")\n            .attr(\"d\", areaGen);\n    }\n}\n\nclass FocusMarkerRenderable extends TraceRenderable {\n    updateBounds(): void {\n        // nothing to do\n    }\n\n    render(): void {\n        const trace = this.trace;\n        const svg = this.myD3.svg;\n\n        //  the trace outlives the SVG, so a marker from an earlier draw is detached\n        //  by now (zoom/pan/resize rebuild the chart) — only keep a live one\n        if (trace.focusMarker && trace.focusMarker.node()?.isConnected) {\n            return;\n        }\n\n        const colorFill = trace.colorFull;\n        const marker = svg.append(\"circle\")\n            .style(\"fill\", \"#fff\")\n            .attr(\"stroke\", colorFill)\n            .attr(\"stroke-width\", 2)\n            .attr(\"r\", 5)\n            .style(\"opacity\", 0);\n        trace.focusMarker = marker;\n    }\n}\n\nclass ErrorBarsRenderable extends TraceRenderable {\n    mode: \"bars\" | \"lines\" = \"bars\";\n    keyLow = \"ciLow\";\n    keyHigh = \"ciHigh\";\n    keyValue = \"trend\";\n\n    updateBounds(): void {\n        const trace = this.trace;\n        const [xMin, xMax] = TraceRenderable.findMinMax(trace.items, [trace.keyX], trace.xMin, trace.xMax);\n        const [yMin, yMax] = TraceRenderable.findMinMax2(\n            trace.items,\n            [this.keyLow],\n            [this.keyHigh],\n            trace.yMin,\n            trace.yMax\n        );\n        trace.xMin = xMin;\n        trace.xMax = xMax;\n        trace.yMin = yMin;\n        trace.yMax = yMax;\n    }\n\n    render(): void {\n        if (this.mode === \"lines\") {\n            this.renderLines();\n        } else {\n            this.renderBars();\n        }\n    }\n\n    private renderBars(): void {\n        const trace = this.trace;\n        const svg = this.myD3.svg;\n        const x = this.myD3.axisX;\n        const y = this.myD3.axisY;\n        const barWidth = x(this.myD3.preparedPlot.xMin + 1) * 0.5;\n        const cls = `error-bars-${trace.traceIndex}`;\n\n        svg.selectAll(`rect.${cls}`)\n            .data(trace.items)\n            .enter()\n            .append(\"rect\")\n            .attr(\"class\", cls)\n            .attr(\"x\", (d: any) => x(d.data[trace.keyX]) - barWidth / 2)\n            .attr(\"y\", (d: any) => y(d.data[this.keyHigh]))\n            .attr(\"width\", barWidth)\n            .attr(\"height\", (d: any) => y(d.data[this.keyLow]) - y(d.data[this.keyHigh]))\n            .attr(\"fill\", trace.colorBarFill)\n            .attr(\"stroke\", trace.colorBarStroke);\n    }\n\n    private renderLines(): void {\n        const multi = this.myD3.multi;\n        const rank = this.trace.series?.rteRank ?? 0;\n        const n = multi.layout.rteSeries.length;\n        //  nested: every series but the last is an interval bar; the last one stays a\n        //  dot + whisker on the exact year (rteDx is 0 in that style)\n        if (multi.nestedActive && rank < n - 1) {\n            this.renderNestedBar(nestedBarFraction(rank, n));\n            return;\n        }\n        this.renderPointRange(rank);\n    }\n\n    /** x of the year effect of an item, shifted into the lane of its series. */\n    private rteX(): (d: any) => number {\n        const trace = this.trace;\n        const x = this.myD3.axisX;\n        const dx = this.myD3.multi.rteDx(trace);\n        return (d: any) => x(d.data[trace.keyX]) + dx;\n    }\n\n    /** The classic mark: a whisker over the interval with a marker on the value. */\n    private renderPointRange(rank: number): void {\n        const trace = this.trace;\n        const svg = this.myD3.svg;\n        const y = this.myD3.axisY;\n        const stroke = trace.colorDark;\n        const clsPoints = `error-points-${trace.traceIndex}`;\n        const clsLines = `error-lines-${trace.traceIndex}`;\n        const xPos = this.rteX();\n        const marker = rteMarker(rank);\n\n        //  whiskers first, so a hollow marker's white fill sits on top of its whisker\n        svg.selectAll(`line.${clsLines}`)\n            .data(trace.items)\n            .enter()\n            .append(\"line\")\n            .attr(\"class\", `${clsLines} myd3-rte-item`)\n            .attr(\"data-x\", (d: any) => d.data[trace.keyX])\n            .attr(\"x1\", xPos)\n            .attr(\"y1\", (d: any) => y(d.data[this.keyLow]))\n            .attr(\"x2\", xPos)\n            .attr(\"y2\", (d: any) => y(d.data[this.keyHigh]))\n            .attr(\"stroke\", stroke)\n            .style(\"stroke-width\", this.myD3.dlStrokeWidthMul);\n\n        svg.selectAll(`path.${clsPoints}`)\n            .data(trace.items)\n            .enter()\n            .append(\"path\")\n            //  myd3-rte-item + data-x let the hover handler dim the RTE items of the\n            //  non-hovered years (deliberately NOT myd3-year-marker — no size jump)\n            .attr(\"class\", `${clsPoints} myd3-rte-item`)\n            .attr(\"data-x\", (d: any) => d.data[trace.keyX])\n            .attr(\"transform\", (d: any) => `translate(${xPos(d)},${y(d.data[this.keyValue])})`)\n            .attr(\"d\", marker.d)\n            .attr(\"fill\", marker.hollow ? \"#fff\" : stroke)\n            .attr(\"stroke\", marker.hollow ? stroke : null)\n            .attr(\"stroke-width\", marker.hollow ? 1.5 : null);\n    }\n\n    /**\n     * \"Nested\" style: the interval as a soft bar centred on the exact year, the value\n     * as a tick across it. `fraction` is the bar width in years.\n     */\n    private renderNestedBar(fraction: number): void {\n        const trace = this.trace;\n        const svg = this.myD3.svg;\n        const x = this.myD3.axisX;\n        const y = this.myD3.axisY;\n        const width = Math.max(3, Math.min(30, fraction * this.myD3.multi.yearPx()));\n        const cls = `rte-nested-${trace.traceIndex}`;\n        const items = trace.items.filter((d: any) =>\n            Number.isFinite(d.data[this.keyLow]) && Number.isFinite(d.data[this.keyHigh]));\n\n        svg.selectAll(`rect.${cls}`)\n            .data(items)\n            .enter()\n            .append(\"rect\")\n            .attr(\"class\", `${cls} myd3-rte-item`)\n            .attr(\"data-x\", (d: any) => d.data[trace.keyX])\n            .attr(\"x\", (d: any) => x(d.data[trace.keyX]) - width / 2)\n            .attr(\"y\", (d: any) => y(d.data[this.keyHigh]))\n            .attr(\"width\", width)\n            .attr(\"height\", (d: any) => Math.max(1, y(d.data[this.keyLow]) - y(d.data[this.keyHigh])))\n            .attr(\"rx\", Math.min(2, width / 2))\n            .attr(\"fill\", trace.colorFullAlpha25);\n\n        svg.selectAll(`line.${cls}`)\n            .data(items)\n            .enter()\n            .append(\"line\")\n            .attr(\"class\", `${cls} myd3-rte-item`)\n            .attr(\"data-x\", (d: any) => d.data[trace.keyX])\n            .attr(\"x1\", (d: any) => x(d.data[trace.keyX]) - width / 2)\n            .attr(\"x2\", (d: any) => x(d.data[trace.keyX]) + width / 2)\n            .attr(\"y1\", (d: any) => y(d.data[this.keyValue]))\n            .attr(\"y2\", (d: any) => y(d.data[this.keyValue]))\n            .attr(\"stroke\", trace.colorDark)\n            .attr(\"stroke-width\", 2);\n    }\n}\n\nclass MarkersRenderable extends TraceRenderable {\n    updateBounds(): void {\n        // nothing to do\n    }\n\n    render(): void {\n        const trace = this.trace;\n        const svg = this.myD3.svg;\n        const x = this.myD3.axisX;\n        const y = this.myD3.axisY;\n        const cls = `marker-points-${trace.traceIndex}`;\n        const dx = this.myD3.multi.partDx(trace, \"line\");\n\n        svg.selectAll(`circle.${cls}`)\n            .data(trace.items)\n            .enter()\n            .append(\"circle\")\n            .attr(\"class\", `${cls} myd3-year-marker`)\n            .attr(\"data-x\", (d: any) => d.data[trace.keyX])\n            .attr(\"data-r\", 5)\n            .attr(\"cx\", (d: any) => x(d.data[trace.keyX]) + dx)\n            .attr(\"cy\", (d: any) => y(d.data[trace.keyY]))\n            .attr(\"r\", 5)\n            .attr(\"fill\", \"#fff\")\n            .attr(\"stroke\", trace.colorFull);\n    }\n}\n\nexport {\n    rteMarker,\n    nestedBarFraction,\n    LineRenderable,\n    AreaRenderable,\n    FillAreaRenderable,\n    FocusMarkerRenderable,\n    ErrorBarsRenderable,\n    MarkersRenderable\n};\n\n\n","import { TraceRenderable } from \"./TraceRenderable\";\nimport type { Trace } from \"../core/PlotModel\";\nimport type { MyD3 } from \"../MyD3\";\n\nclass RectangleRenderable extends TraceRenderable {\n    constructor(myD3: MyD3, trace: Trace, sort: number) {\n        super(myD3, trace, sort);\n    }\n\n    updateBounds(): void {\n        const trace = this.trace;\n        trace.xMin = Math.min(\n            ...trace.items.map(item => Math.min(item.data.x0, item.data.x1)),\n            trace.xMin\n        );\n        trace.xMax = Math.max(\n            ...trace.items.map(item => Math.max(item.data.x0, item.data.x1)),\n            trace.xMax\n        );\n    }\n\n    render(): void {\n        const myD3 = this.myD3;\n        const svg = myD3.svg;\n        const x = myD3.axisX;\n        const y = myD3.axisY;\n        const baseY = y(myD3.preparedPlot.yMin);\n        const topY = y((myD3.preparedPlot.yMax - myD3.preparedPlot.yMin) * 0.05 + myD3.preparedPlot.yMin);\n\n        for (const item of this.trace.items) {\n            const color = `hsla(${item.data.hue || 1}, 100%, 50%, 0.25)`;\n            svg.append(\"rect\")\n                .attr(\"x\", x(item.data.x0))\n                .attr(\"y\", topY)\n                .attr(\"width\", x(item.data.x1) - x(item.data.x0))\n                .attr(\"height\", baseY - topY)\n                .attr(\"fill\", color);\n        }\n    }\n}\n\nexport { RectangleRenderable };\n\n\n","/**\n * Reusable tooltip class for displaying HTML content with automatic positioning.\n * Works with D3 selections by appending a foreignObject to the current SVG root.\n */\nclass Tooltip {\n    private readonly container: any;\n    private readonly width: number;\n    private readonly height: number;\n\n    constructor(svg: any, width: number, height: number) {\n        this.width = width;\n        this.height = height;\n        // A div (not xhtml:body) as the foreignObject child: a nested <body> is invalid\n        // and, being tagged `body`, collides with page-wide body selectors in tooling.\n        this.container = svg.append(\"foreignObject\")\n            .attr(\"width\", width)\n            .attr(\"height\", height)\n            .style(\"pointer-events\", \"none\")\n            .append(\"xhtml:div\")\n            .style(\"opacity\", 0)\n            .style(\"position\", \"absolute\")\n            .style(\"pointer-events\", \"none\")\n            .style(\"top\", \"0px\")\n            .style(\"left\", \"0px\");\n    }\n\n    show(htmlContent: string, x: number, y: number) {\n        this.container.html(htmlContent);\n        this.container.style(\"opacity\", 0.85);\n        this.position(x, y);\n    }\n\n    hide() {\n        this.container.style(\"opacity\", 0);\n    }\n\n    private position(x: number, y: number) {\n        const bounds = this.container.node().getBoundingClientRect();\n        const margin = 10;\n        const safeMargin = 5;\n\n        let left = x - bounds.width / 2;\n        let top = y - bounds.height - margin;\n\n        const minLeft = safeMargin;\n        const maxLeft = this.width - bounds.width - safeMargin;\n        const minTop = safeMargin;\n        const maxTop = this.height - bounds.height - safeMargin;\n\n        if (left < minLeft) {\n            left = minLeft;\n        } else if (left > maxLeft) {\n            left = maxLeft;\n        }\n\n        if (top < minTop) {\n            top = y + margin;\n            if (top > maxTop) {\n                top = Math.max(minTop, Math.min(maxTop, y - bounds.height / 2));\n            }\n        } else if (top > maxTop) {\n            top = y - bounds.height - margin;\n            if (top < minTop) {\n                top = Math.max(minTop, Math.min(maxTop, y - bounds.height / 2));\n            }\n        }\n\n        left = Math.max(0, Math.min(this.width - bounds.width, left));\n        top = Math.max(0, Math.min(this.height - bounds.height, top));\n\n        this.container\n            .style(\"left\", `${left}px`)\n            .style(\"top\", `${top}px`);\n    }\n}\n\nexport { Tooltip };\n\n","import * as d3 from \"d3\";\n\nimport type { Trace } from \"../core/PlotModel\";\nimport type { MyD3 } from \"../MyD3\";\nimport { TraceRenderable } from \"./TraceRenderable\";\nimport { Tooltip } from \"../tooltip/Tooltip\";\n\nconst HIT_STROKE_WIDTH = 12;   // invisible hover corridor around each line\nconst HIT_POINT_RADIUS = 10;   // hover radius around markers (covers single-point traces)\nconst NEARBY_PIXELS = 24;      // other lines within this pixel y-distance join the tooltip\nconst DIMMED_OPACITY = 0.25;\n\nconst ESCAPE_MAP: Record<string, string> = {\n    \"&\": \"&amp;\",\n    \"<\": \"&lt;\",\n    \">\": \"&gt;\",\n    '\"': \"&quot;\",\n    \"'\": \"&#39;\"\n};\n\nfunction escapeHtml(value: string): string {\n    return String(value).replace(/[&<>\"']/g, c => ESCAPE_MAP[c]);\n}\n\nfunction resolveCurve(name?: string): d3.CurveFactory {\n    switch (name) {\n        case \"monotoneX\": return d3.curveMonotoneX;\n        case \"catmullRom\": return d3.curveCatmullRom;\n        case \"natural\": return d3.curveNatural;\n        default: return d3.curveLinear;\n    }\n}\n\n/**\n * Shared per-plot hover state for all scatterLines traces of one MyD3 instance:\n * highlights the hovered trace, dims the rest and shows a proximity tooltip.\n * Only used by plots of type \"OTHER\" — the classic rendering path's overlay\n * rect would swallow the per-path mouse events.\n *\n * The svg and scales are snapshotted at render time via sync(): reading them\n * from myD3 at event time would break after an image export, because\n * MyD3.draw(options) re-renders into a detached svg and overwrites\n * myD3.svg/axisX/axisY.\n */\nclass ScatterLinesInteraction {\n    private readonly renderables: ScatterLinesRenderable[] = [];\n    private tooltip?: Tooltip;\n    private svg: any;\n    private x: any;\n    private y: any;\n\n    register(renderable: ScatterLinesRenderable): void {\n        if (!this.renderables.includes(renderable)) this.renderables.push(renderable);\n    }\n\n    sync(svg: any, x: any, y: any): void {\n        if (this.svg && this.svg.node() !== svg.node()) {\n            // the previous svg (and the tooltip's foreignObject in it) is gone\n            this.tooltip = undefined;\n        }\n        this.svg = svg;\n        this.x = x;\n        this.y = y;\n    }\n\n    private ensureTooltip(): void {\n        if (this.tooltip) return;\n        const xRange = this.x.range();\n        const yRange = this.y.range();\n        this.tooltip = new Tooltip(this.svg, xRange[1] - xRange[0], yRange[0] - yRange[1]);\n    }\n\n    onHover(active: ScatterLinesRenderable, event: MouseEvent): void {\n        if (!this.svg) return;\n        const x = this.x;\n        const y = this.y;\n        const mouse = d3.pointer(event, this.svg.node());\n        const mx = mouse[0];\n        const my = mouse[1];\n\n        const activeTrace = active.getTrace();\n        if (activeTrace.items.length === 0) return;\n\n        // nearest data point of the hovered trace, by pixel x\n        let nearest = activeTrace.items[0];\n        let bestDx = Infinity;\n        for (const item of activeTrace.items) {\n            const dx = Math.abs(x(item.data[activeTrace.keyX]) - mx);\n            if (dx < bestDx) {\n                bestDx = dx;\n                nearest = item;\n            }\n        }\n        const year = nearest.data[activeTrace.keyX];\n        const count = nearest.data[activeTrace.keyY];\n\n        for (const renderable of this.renderables) {\n            renderable.setDimmed(renderable !== active);\n            renderable.setHighlighted(renderable === active);\n        }\n\n        // other traces with data at that year that pass close to the cursor\n        const nearby: { title: string; color: string; count: number; dist: number }[] = [];\n        for (const renderable of this.renderables) {\n            if (renderable === active) continue;\n            const trace = renderable.getTrace();\n            const item = trace.items.find(i => i.data[trace.keyX] === year);\n            if (!item) continue;\n            const value = item.data[trace.keyY];\n            if (!Number.isFinite(value)) continue;\n            const dist = Math.abs(y(value) - my);\n            if (dist <= NEARBY_PIXELS) {\n                nearby.push({\n                    title: trace.title,\n                    color: trace.colorText,\n                    count: value,\n                    dist\n                });\n            }\n        }\n        nearby.sort((a, b) => a.dist - b.dist);\n\n        let html = `<div style=\"background: rgba(255,255,255,0.97); border: 1px solid #ddd; padding: 6px 10px; border-radius: 6px; box-shadow: 0 2px 8px rgba(0,0,0,0.15); font-size: 12px; font-family: sans-serif; max-width: 260px;\">`;\n        html += `<div style=\"font-weight: 700; font-size: 13px; color: #333; margin-bottom: 4px;\">${year}</div>`;\n        html += this.buildRow(activeTrace.title, activeTrace.colorText, count, true);\n        for (const n of nearby) {\n            html += this.buildRow(n.title, n.color, n.count, false);\n        }\n        html += `</div>`;\n\n        this.ensureTooltip();\n        this.tooltip!.show(html, x(year), y(count));\n    }\n\n    private buildRow(title: string, color: string, count: number, bold: boolean): string {\n        const countText = Number.isFinite(count) ? count.toLocaleString() : \"–\";\n        return `<div style=\"display: flex; align-items: center; gap: 6px; margin: 2px 0;${bold ? \" font-weight: 700;\" : \"\"}\">` +\n            `<span style=\"width: 8px; height: 8px; border-radius: 50%; background: ${color}; flex-shrink: 0;\"></span>` +\n            `<span style=\"color: #444; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;\">${escapeHtml(title)}</span>` +\n            `<span style=\"color: ${color};\">${countText}</span>` +\n            `</div>`;\n    }\n\n    reset(): void {\n        for (const renderable of this.renderables) {\n            renderable.setDimmed(false);\n            renderable.setHighlighted(false);\n        }\n        this.tooltip?.hide();\n    }\n}\n\nconst interactions = new WeakMap<MyD3, ScatterLinesInteraction>();\n\nfunction getInteraction(myD3: MyD3): ScatterLinesInteraction {\n    let interaction = interactions.get(myD3);\n    if (!interaction) {\n        interaction = new ScatterLinesInteraction();\n        interactions.set(myD3, interaction);\n    }\n    return interaction;\n}\n\n/**\n * One site's line + year markers with per-trace hover. Items are tabular\n * rows with keyX (default \"year\") and keyY (\"count\" via settings). Lines\n * connect straight across years with no observation; markers show exactly\n * which years were surveyed.\n */\nclass ScatterLinesRenderable extends TraceRenderable {\n    private linePath: any;\n    private markers: any;\n    private baseStrokeWidth = 2;\n\n    getTrace(): Trace {\n        return this.trace;\n    }\n\n    updateBounds(): void {\n        const trace = this.trace;\n        if (trace.items.length === 0) return;\n        // NaN seeds: the data alone defines the range (the Trace defaults of\n        // xMin = xMax = 0 would otherwise drag the x-axis down to year 0)\n        const [xMin, xMax] = TraceRenderable.findMinMax(trace.items, [trace.keyX], Number.NaN, Number.NaN);\n        const [yMin, yMax] = TraceRenderable.findMinMax(trace.items, [trace.keyY], Number.NaN, Number.NaN);\n        trace.xMin = xMin;\n        trace.xMax = xMax;\n        trace.yMin = Math.min(0, yMin);\n        trace.yMax = yMax;\n    }\n\n    render(): void {\n        const trace = this.trace;\n        const svg = this.myD3.svg;\n        const x = this.myD3.axisX;\n        const y = this.myD3.axisY;\n        // Image export re-renders every renderable into a detached svg\n        // (MyD3.svgInit). Draw the visuals there too, but keep hit areas and\n        // interaction state bound to the live on-screen svg only.\n        const live = !!(svg.node() as Element).isConnected;\n\n        this.baseStrokeWidth = 2 * this.myD3.dlStrokeWidthMul;\n\n        const lineGen = d3.line()\n            .defined((d: any) => Number.isFinite(d.data[trace.keyY]))\n            .x((d: any) => x(d.data[trace.keyX]))\n            .y((d: any) => y(d.data[trace.keyY]))\n            .curve(resolveCurve(trace.settings?.curve));\n\n        const linePath = svg.append(\"path\")\n            .datum(trace.items)\n            .attr(\"fill\", \"none\")\n            .attr(\"stroke\", trace.colorFull)\n            .attr(\"stroke-width\", this.baseStrokeWidth)\n            .attr(\"d\", lineGen);\n\n        const cls = `scatter-line-markers-${trace.traceIndex}`;\n        const markers = svg.selectAll(`circle.${cls}`)\n            .data(trace.items)\n            .enter()\n            .append(\"circle\")\n            .attr(\"class\", cls)\n            .attr(\"cx\", (d: any) => x(d.data[trace.keyX]))\n            .attr(\"cy\", (d: any) => y(d.data[trace.keyY]))\n            .attr(\"r\", 3.5)\n            .attr(\"fill\", \"#fff\")\n            .attr(\"stroke\", trace.colorFull)\n            .attr(\"stroke-width\", 1.5);\n\n        if (!live) return; // exported image needs no hit areas or hover state\n\n        this.linePath = linePath;\n        this.markers = markers;\n\n        const interaction = getInteraction(this.myD3);\n        interaction.register(this);\n        interaction.sync(svg, x, y);\n\n        // Invisible wide corridor along the line for easy hovering...\n        const hitPath = svg.append(\"path\")\n            .datum(trace.items)\n            .attr(\"fill\", \"none\")\n            .attr(\"stroke\", \"transparent\")\n            .attr(\"stroke-width\", HIT_STROKE_WIDTH)\n            .attr(\"stroke-linecap\", \"round\")\n            .style(\"pointer-events\", \"stroke\")\n            .attr(\"d\", lineGen);\n\n        // ...plus hit circles so single-point traces stay hoverable\n        const hitCls = `scatter-line-hits-${trace.traceIndex}`;\n        const hitCircles = svg.selectAll(`circle.${hitCls}`)\n            .data(trace.items)\n            .enter()\n            .append(\"circle\")\n            .attr(\"class\", hitCls)\n            .attr(\"cx\", (d: any) => x(d.data[trace.keyX]))\n            .attr(\"cy\", (d: any) => y(d.data[trace.keyY]))\n            .attr(\"r\", HIT_POINT_RADIUS)\n            .attr(\"fill\", \"transparent\")\n            .style(\"pointer-events\", \"all\");\n\n        const onMove = (event: MouseEvent) => interaction.onHover(this, event);\n        const onLeave = () => interaction.reset();\n        hitPath.on(\"mousemove\", onMove).on(\"mouseleave\", onLeave);\n        hitCircles.on(\"mousemove\", onMove).on(\"mouseleave\", onLeave);\n    }\n\n    setHighlighted(on: boolean): void {\n        this.linePath?.attr(\"stroke-width\", on ? this.baseStrokeWidth * 2 : this.baseStrokeWidth);\n    }\n\n    setDimmed(on: boolean): void {\n        const opacity = on ? DIMMED_OPACITY : 1;\n        this.linePath?.style(\"opacity\", opacity);\n        this.markers?.style(\"opacity\", opacity);\n    }\n}\n\nexport { ScatterLinesRenderable };\n","import * as d3 from \"d3\";\n\nimport type { Plot, Trace } from \"../core/PlotModel\";\nimport type { MyD3 } from \"../MyD3\";\nimport { TraceRenderable } from \"./TraceRenderable\";\nimport { Tooltip } from \"../tooltip/Tooltip\";\n\nabstract class ChartRenderable extends TraceRenderable {\n    protected tooltip?: Tooltip;\n\n    protected ensureTooltip(): void {\n        if (!this.tooltip) {\n            const xRange = this.myD3.axisX.range();\n            const yRange = this.myD3.axisY.range();\n            const width = xRange[1] - xRange[0];\n            const height = yRange[0] - yRange[1];\n            this.tooltip = new Tooltip(this.myD3.svg, width, height);\n        }\n    }\n\n    protected prepareData(): any[] {\n        return this.trace.items.map(item => ({ ...item.data }));\n    }\n\n    protected getBarFillColor(d: any): string {\n        // An explicit per-item `color` (hex/css) wins over the hue-derived fill.\n        return d.color || `hsl(${d.hue},60%,70%)`;\n    }\n\n    protected getBarStrokeColor(d: any): string {\n        return d.color ? \"#fff\" : `hsl(${d.hue},40%,30%)`;\n    }\n\n    protected getSeriesColor(d: any): string {\n        // Saturated variant for tooltip dots / emphasized text.\n        return d.color || `hsl(${d.hue},60%,50%)`;\n    }\n\n    protected getTextColor(d: any): string {\n        // Labels wear ink, not the series color — the bar itself carries the identity.\n        return d.fg ?? \"#1e293b\";\n    }\n\n    protected calculateTotal(data: any[]): number {\n        return data.reduce((sum, datum) => sum + (typeof datum.value === \"number\" ? datum.value : 0), 0);\n    }\n\n    protected createTooltipContent(d: any, total: number): string {\n        const label = d.label || \"\";\n        const value = d.value || 0;\n        const formattedValue = typeof value === \"number\" ? value.toLocaleString() : value;\n        const percentage = total ? ((value / total) * 100).toFixed(1) : \"0\";\n\n        if (d._isGroupedItem && Array.isArray(d._groupedChildren)) {\n            return this.createGroupedTooltipContent(d, total, label, formattedValue, ` (${percentage}%)`);\n        }\n\n        const dotColor = this.getSeriesColor(d);\n        const labelColor = d.color ? \"#333\" : `hsl(${d.hue},60%,35%)`;\n        const unit = this.trace.settings?.valueLabel ? ` ${this.trace.settings.valueLabel}` : \"\";\n        // Percentages are only meaningful when the bars are parts of one whole\n        // (a ranking/composition); count-per-category charts opt out.\n        const pctHtml = this.trace.settings?.hidePercent\n            ? \"\"\n            : `<span style=\"color: #888;\">${percentage}%</span>`;\n        return `<div style=\"background: rgba(255,255,255,0.97); border: 1px solid #ddd; padding: 6px 10px; border-radius: 6px; box-shadow: 0 2px 8px rgba(0,0,0,0.15); font-size: 12px; font-family: sans-serif;\">\n            <div style=\"display: flex; align-items: center; gap: 6px; margin-bottom: 2px;\">\n                <span style=\"width: 8px; height: 8px; border-radius: 50%; background: ${dotColor}; flex-shrink: 0;\"></span>\n                <span style=\"font-weight: 700; color: ${labelColor};\">${label}</span>\n            </div>\n            <div style=\"display: flex; justify-content: space-between; gap: 12px; color: #444;\">\n                <span>${formattedValue}${unit}</span>\n                ${pctHtml}\n            </div>\n        </div>`;\n    }\n\n    protected createGroupedTooltipContent(d: any, total: number, label: string, formattedValue: string, percentage: string): string {\n        const childrenCount = d._groupedChildren.length;\n        const canvasWidth = this.myD3.dlWidth || 400;\n        const canvasHeight = this.myD3.dlHeight || 300;\n        const maxTooltipWidth = Math.min(350, canvasWidth * 0.8);\n        const maxTooltipHeight = Math.min(250, canvasHeight * 0.6);\n        const headerHeight = 80;\n        const itemHeight = 20;\n        const indicatorHeight = 25;\n        const maxVisibleItems = Math.max(3, Math.floor((maxTooltipHeight - headerHeight - indicatorHeight) / itemHeight));\n\n        let childrenHtml = \"\";\n        const visibleCount = Math.min(childrenCount, maxVisibleItems);\n\n        for (let i = 0; i < visibleCount; i += 1) {\n            const child = d._groupedChildren[i];\n            const childFormattedValue = typeof child.value === \"number\" ? child.value.toLocaleString() : child.value;\n            childrenHtml += `\n                <div style=\"text-align: left; margin: 2px 0; font-size: 11px; color: #666; padding: 1px 0;\">\n                    • ${this.truncateLabel(child.label, maxTooltipWidth - 40)}: ${childFormattedValue} (${child.percentage.toFixed(1)}%)\n                </div>`;\n        }\n\n        if (visibleCount < childrenCount) {\n            const remainingCount = childrenCount - visibleCount;\n            childrenHtml += `\n                <div style=\"text-align: center; margin: 6px 0 2px 0; font-size: 10px; color: #999; font-style: italic; padding: 4px 0; border-top: 1px dotted #ddd; background-color: #f8f9fa;\">\n                    ... and ${remainingCount} more item${remainingCount !== 1 ? \"s\" : \"\"}\n                </div>`;\n        }\n\n        return `<div class=\"fs-6\" style=\"border: 1px solid #ccc; padding: 8px; background-color: #fff; border-radius: 5px; text-align: center; font-family: sans-serif; box-shadow: 0 2px 4px rgba(0,0,0,0.1); max-width: ${maxTooltipWidth}px;\">\n            <strong style=\"color: hsl(${d.hue},50%,40%);\">${this.truncateLabel(label, maxTooltipWidth - 20)}</strong><br/>\n            <span style=\"color: hsl(${d.hue},50%,40%);\">${formattedValue}${percentage}</span><br/>\n            <div style=\"margin-top: 6px; padding-top: 6px; border-top: 1px solid #eee;\">\n                <div style=\"font-size: 10px; color: #888; margin-bottom: 4px;\">Contains ${childrenCount} item${childrenCount !== 1 ? \"s\" : \"\"}:</div>\n                <div>${childrenHtml}</div>\n            </div>\n        </div>`;\n    }\n\n    protected truncateLabel(text: string, maxWidth: number): string {\n        if (!text) return \"\";\n        const maxChars = Math.floor(maxWidth / 7);\n        if (text.length <= maxChars) return text;\n        return `${text.substring(0, Math.max(1, maxChars - 3))}...`;\n    }\n\n    protected showTooltip(event: MouseEvent, data: any, total: number): void {\n        this.ensureTooltip();\n        const mouse = d3.pointer(event, this.myD3.svg.node());\n        const html = this.createTooltipContent(data, total);\n        this.tooltip!.show(html, mouse[0], mouse[1]);\n    }\n\n    protected hideTooltip(): void {\n        this.tooltip?.hide();\n    }\n\n    updateBounds(): void {\n        // Default charts do not affect bounds; specialized charts can override\n        return;\n    }\n}\n\nclass PieRenderable extends ChartRenderable {\n    private readonly LABEL_FONT_SIZE = 11;\n    private readonly MIN_LABEL_ANGLE = Math.PI / 18; // ~10 degrees - minimum arc angle to show label\n\n    protected prepareData(): any[] {\n        return this.myD3.groupSmallItems(\n            super.prepareData(),\n            (item) => item.value || 0,\n            (item) => item.label || \"\",\n            (item, label) => ({ ...item, label }),\n            (item, value) => ({ ...item, value }),\n            this.myD3.customOptions?.groupSmallItems\n        );\n    }\n\n    private getPieSettings(): {\n        showLabels: boolean;\n        labelType: 'label' | 'value' | 'percent' | 'labelValue' | 'labelPercent';\n        minLabelAngle: number;\n        labelPosition: 'inside' | 'outside';\n        innerRadiusRatio: number;\n        keepOrder: boolean;\n        hoverGrow: boolean;\n        onSliceClick?: (item: any) => void;\n        centerText?: { value: string; label?: string; sub?: string | string[] };\n    } {\n        const settings = this.trace.settings || {};\n        return {\n            showLabels: settings.showLabels !== false, // default true\n            labelType: settings.labelType || 'label',\n            minLabelAngle: settings.minLabelAngle ?? this.MIN_LABEL_ANGLE,\n            labelPosition: settings.labelPosition || 'inside',\n            // 0 = classic pie; > 0 = donut (hole radius as a fraction of the outer radius)\n            innerRadiusRatio: settings.innerRadiusRatio ?? 0,\n            // true = slices follow data order (d3 default re-sorts by value)\n            keepOrder: settings.keepOrder === true,\n            hoverGrow: settings.hoverGrow === true,\n            onSliceClick: typeof settings.onSliceClick === \"function\" ? settings.onSliceClick : undefined,\n            centerText: settings.centerText,\n        };\n    }\n\n    private formatLabel(d: any, total: number, labelType: string): string {\n        const label = d.data?.label || d.label || \"\";\n        const value = d.data?.value ?? d.value ?? 0;\n        const percent = total > 0 ? ((value / total) * 100).toFixed(1) : \"0\";\n\n        switch (labelType) {\n            case 'value':\n                return value.toLocaleString();\n            case 'percent':\n                return `${percent}%`;\n            case 'labelValue':\n                return `${label}: ${value.toLocaleString()}`;\n            case 'labelPercent':\n                return `${label} (${percent}%)`;\n            case 'label':\n            default:\n                return label;\n        }\n    }\n\n    private getLabelColor(d: any): string {\n        // Slices with an explicit hex fill wear neutral ink (the white text-shadow\n        // halo keeps it legible on any colour); hue-based slices keep the dark tint.\n        if (d.data?.color ?? d.color) return \"#1e293b\";\n        const hue = d.data?.hue ?? d.hue ?? 0;\n        return `hsl(${hue}, 80%, 20%)`;\n    }\n\n    render(): void {\n        const data = this.prepareData();\n        const total = this.calculateTotal(data);\n        const pieSettings = this.getPieSettings();\n\n        const xRange = this.myD3.axisX.range();\n        const yRange = this.myD3.axisY.range();\n        const width = xRange[1] - xRange[0];\n        const height = yRange[0] - yRange[1];\n        const radius = Math.min(width, height) / 2;\n        const innerRadius = radius * pieSettings.innerRadiusRatio;\n\n        const group = this.myD3.svg.append(\"g\")\n            .attr(\"transform\", `translate(${width / 2},${height / 2})`);\n\n        const pieGen = d3.pie<any>().value((d: any) => d.value);\n        if (pieSettings.keepOrder) pieGen.sort(null);\n        // Donuts leave a sliver of headroom so the hover-grow effect stays inside the plot.\n        const restRadius = pieSettings.hoverGrow ? radius * 0.98 : radius;\n        const arcGen = d3.arc<any>().innerRadius(innerRadius).outerRadius(restRadius);\n        const arcGrown = d3.arc<any>().innerRadius(innerRadius).outerRadius(radius);\n        const arcs = pieGen(data);\n\n        // Draw pie segments\n        const paths = group.selectAll(\"path\")\n            .data(arcs)\n            .enter()\n            .append(\"path\")\n            .attr(\"d\", arcGen as any)\n            .attr(\"fill\", (d: any) => this.getBarFillColor(d.data))\n            .attr(\"stroke\", (d: any) => this.getBarStrokeColor(d.data))\n            .attr(\"stroke-width\", pieSettings.innerRadiusRatio > 0 ? 2 : 1)\n            .on(\"mouseenter\", (event: MouseEvent, d: any) => {\n                this.showTooltip(event, d.data, total);\n                if (pieSettings.hoverGrow) {\n                    d3.select(event.currentTarget as any).transition().duration(120).attr(\"d\", arcGrown as any);\n                    paths.style(\"opacity\", (a: any) => (a === d ? 1 : 0.55));\n                }\n            })\n            .on(\"mousemove\", (event: MouseEvent, d: any) => this.showTooltip(event, d.data, total))\n            .on(\"mouseleave\", (event: MouseEvent) => {\n                this.hideTooltip();\n                if (pieSettings.hoverGrow) {\n                    d3.select(event.currentTarget as any).transition().duration(120).attr(\"d\", arcGen as any);\n                    paths.style(\"opacity\", 1);\n                }\n            });\n\n        if (pieSettings.onSliceClick) {\n            paths.style(\"cursor\", \"pointer\")\n                .on(\"click\", (_event: MouseEvent, d: any) => pieSettings.onSliceClick!(d.data));\n        }\n\n        if (pieSettings.centerText && innerRadius > 0) {\n            this.renderCenterText(group, innerRadius, pieSettings.centerText);\n        }\n\n        // Draw labels if enabled\n        if (pieSettings.showLabels) {\n            this.renderLabels(group, arcs, arcGen, radius, total, pieSettings);\n        }\n    }\n\n    /** Total + caption inside a donut hole, sized to fit the hole. */\n    private renderCenterText(group: any, innerRadius: number, centerText: { value: string; label?: string; sub?: string | string[] }): void {\n        const valueSize = Math.max(14, Math.min(26, innerRadius * 0.42));\n        group.append(\"text\")\n            .attr(\"text-anchor\", \"middle\")\n            .attr(\"dy\", centerText.label ? \"-0.1em\" : \"0.35em\")\n            .style(\"font-size\", `${valueSize}px`)\n            .style(\"font-weight\", \"700\")\n            .style(\"fill\", \"#1e293b\")\n            .style(\"font-variant-numeric\", \"tabular-nums\")\n            .style(\"pointer-events\", \"none\")\n            .text(centerText.value);\n        if (centerText.label) {\n            group.append(\"text\")\n                .attr(\"text-anchor\", \"middle\")\n                .attr(\"dy\", \"1.5em\")\n                .style(\"font-size\", `${Math.max(9, valueSize * 0.45)}px`)\n                .style(\"letter-spacing\", \"0.04em\")\n                .style(\"text-transform\", \"uppercase\")\n                .style(\"fill\", \"#64748b\")\n                .style(\"pointer-events\", \"none\")\n                .text(centerText.label);\n        }\n        if (centerText.sub) {\n            // sub may be a single string or several stacked lines (used when the\n            // caption is too wide to fit the hole on one line, e.g. in German).\n            const subLines = Array.isArray(centerText.sub) ? centerText.sub : [centerText.sub];\n            const baseDy = centerText.label ? 2.7 : 1.6;\n            subLines.forEach((line, i) => {\n                group.append(\"text\")\n                    .attr(\"text-anchor\", \"middle\")\n                    .attr(\"dy\", `${baseDy + i * 1.15}em`)\n                    .style(\"font-size\", `${Math.max(8, valueSize * 0.34)}px`)\n                    .style(\"letter-spacing\", \"0.05em\")\n                    .style(\"text-transform\", \"uppercase\")\n                    .style(\"fill\", \"#94a3b8\")\n                    .style(\"pointer-events\", \"none\")\n                    .text(line);\n            });\n        }\n    }\n\n    private renderLabels(\n        group: any,\n        arcs: d3.PieArcDatum<any>[],\n        arcGen: d3.Arc<any, d3.DefaultArcObject>,\n        radius: number,\n        total: number,\n        settings: ReturnType<typeof this.getPieSettings>\n    ): void {\n        const labelArcGen = settings.labelPosition === 'outside'\n            ? d3.arc<any>().innerRadius(radius * 0.7).outerRadius(radius * 1.1)\n            : d3.arc<any>().innerRadius(radius * 0.4).outerRadius(radius * 0.7);\n\n        const labels = group.selectAll(\"text.pie-label\")\n            .data(arcs)\n            .enter()\n            .append(\"text\")\n            .attr(\"class\", \"pie-label\")\n            .attr(\"transform\", (d: any) => `translate(${labelArcGen.centroid(d)})`)\n            .attr(\"text-anchor\", \"middle\")\n            .attr(\"dominant-baseline\", \"middle\")\n            .style(\"font-size\", `${this.LABEL_FONT_SIZE}px`)\n            .style(\"font-family\", \"sans-serif\")\n            .style(\"font-weight\", \"600\")\n            .style(\"fill\", (d: any) => this.getLabelColor(d))\n            .style(\"pointer-events\", \"none\")\n            .style(\"text-shadow\", \"0 0 3px #fff, 0 0 3px #fff, 0 0 3px #fff\")\n            .text((d: any) => {\n                // Only show label if segment is large enough\n                const arcAngle = d.endAngle - d.startAngle;\n                if (arcAngle < settings.minLabelAngle) return \"\";\n                return this.formatLabel(d, total, settings.labelType);\n            });\n\n        // Truncate labels that are too long for their segment\n        labels.each(function(this: SVGTextElement, d: any) {\n            const arcAngle = d.endAngle - d.startAngle;\n            const arcLength = arcAngle * radius * 0.5; // approximate chord length at label position\n            const maxChars = Math.floor(arcLength / 6); // rough estimate of chars that fit\n\n            const text = d3.select(this);\n            const originalText = text.text();\n            if (originalText.length > maxChars && maxChars > 3) {\n                text.text(originalText.substring(0, maxChars - 2) + \"…\");\n            }\n        });\n    }\n}\n\nclass BarsRenderable extends ChartRenderable {\n    private readonly BAR_SPACE_RATIO = 0.8;\n    private readonly FONT_SIZE = \"12px\";\n    private readonly STROKE_WIDTH = 1;\n\n    protected prepareData(): any[] {\n        return this.myD3.groupSmallItems(\n            super.prepareData(),\n            (item) => item.value || 0,\n            (item) => item.label || \"\",\n            (item, label) => ({ ...item, label }),\n            (item, value) => ({ ...item, value }),\n            this.myD3.customOptions?.groupSmallItems\n        );\n    }\n\n    configureAxes(plot: Plot): void {\n        const data = this.prepareData();\n        if (data.length === 0) return;\n\n        const labels = data.map(d => d.label || \"\");\n        if (this.isHorizontalOrientation()) {\n            plot.axisYType = \"categorical\";\n            plot.categoricalYLabels = labels;\n        } else {\n            plot.axisXType = \"categorical\";\n            plot.categoricalXLabels = labels;\n        }\n    }\n\n    updateBounds(): void {\n        const data = this.prepareData();\n        if (data.length === 0) return;\n\n        const trace = this.trace;\n        const isHorizontal = this.isHorizontalOrientation();\n        const values = data.map(d => d.value || 0);\n        const minValue = Math.min(...values);\n        const maxValue = Math.max(...values);\n\n        if (isHorizontal) {\n            trace.xMin = Math.min(trace.xMin, Math.min(0, minValue));\n            trace.xMax = Math.max(trace.xMax, maxValue);\n            trace.yMin = Math.min(trace.yMin, 0);\n            trace.yMax = Math.max(trace.yMax, data.length);\n        } else {\n            trace.yMin = Math.min(trace.yMin, Math.min(0, minValue));\n            trace.yMax = Math.max(trace.yMax, maxValue);\n            trace.xMin = Math.min(trace.xMin, 0);\n            trace.xMax = Math.max(trace.xMax, data.length);\n        }\n    }\n\n    render(): void {\n        const data = this.prepareData();\n        if (data.length === 0) return;\n        const maxValue = Math.max(...data.map(d => d.value || 0));\n        if (maxValue === 0) return;\n\n        const dimensions = this.getChartDimensions();\n        const g = this.myD3.svg.append(\"g\");\n\n        if (this.isHorizontalOrientation()) {\n            this.renderHorizontalBars(g, data, dimensions.height);\n        } else {\n            this.renderVerticalBars(g, data, dimensions.width);\n        }\n    }\n\n    private isHorizontalOrientation(): boolean {\n        return this.trace.settings?.orientation === \"horizontal\";\n    }\n\n    private getChartDimensions(): { width: number; height: number } {\n        const xRange = this.myD3.axisX.range();\n        const yRange = this.myD3.axisY.range();\n        return {\n            width: xRange[1] - xRange[0],\n            height: yRange[0] - yRange[1]\n        };\n    }\n\n    private renderVerticalBars(group: any, data: any[], width: number): void {\n        const total = this.calculateTotal(data);\n        const axisY = this.myD3.axisY;\n        const barSpacing = width / data.length;\n        const barWidth = barSpacing * this.BAR_SPACE_RATIO;\n        const bars = this.createVerticalBarRects(group, data, axisY, barSpacing, barWidth);\n        if (this.myD3.shouldRenderBarLabels(barWidth, parseFloat(this.FONT_SIZE) + 2)) {\n            this.createVerticalBarLabels(group, data, axisY, barSpacing);\n        }\n        this.attachTooltips(bars, total);\n    }\n\n    private createVerticalBarRects(group: any, data: any[], axisY: any, barSpacing: number, barWidth: number) {\n        const axisX = this.myD3.axisX;\n        const plot = this.myD3.preparedPlot;\n\n        return group.selectAll(\"rect.vertical-bar\")\n            .data(data)\n            .enter()\n            .append(\"rect\")\n            .attr(\"class\", \"vertical-bar\")\n            .attr(\"x\", (d: any, index: number) => {\n                if (plot.axisXType === \"categorical\" && axisX.bandwidth) {\n                    const bandScale = d3.scaleBand()\n                        .domain(plot.categoricalXLabels.map((_, idx) => idx.toString()))\n                        .range(axisX.range())\n                        .padding(0.1);\n                    return bandScale(index.toString()) || 0;\n                }\n                return index * barSpacing + (barSpacing - barWidth) / 2;\n            })\n            .attr(\"y\", (d: any) => Math.min(axisY(0), axisY(d.value || 0)))\n            .attr(\"width\", (d: any, index: number) => {\n                if (plot.axisXType === \"categorical\" && axisX.bandwidth) {\n                    const bandScale = d3.scaleBand()\n                        .domain(plot.categoricalXLabels.map((_, idx) => idx.toString()))\n                        .range(axisX.range())\n                        .padding(0.1);\n                    return bandScale.bandwidth();\n                }\n                return barWidth;\n            })\n            .attr(\"height\", (d: any) => Math.abs(axisY(0) - axisY(d.value || 0)))\n            .attr(\"fill\", (d: any) => this.getBarFillColor(d))\n            .attr(\"stroke\", (d: any) => this.getBarStrokeColor(d))\n            .attr(\"stroke-width\", this.STROKE_WIDTH);\n    }\n\n    private createVerticalBarLabels(group: any, data: any[], axisY: any, barSpacing: number): void {\n        const axisX = this.myD3.axisX;\n        const plot = this.myD3.preparedPlot;\n        const fontSize = parseFloat(this.FONT_SIZE);\n        const xRange = axisX.range();\n        const yRange = axisY.range();\n        const plotBounds = { left: xRange[0], right: xRange[1], top: yRange[1], bottom: yRange[0] };\n        const alignment = this.myD3.getBarLabelAlignment(true);\n\n        const labels = group.selectAll(\"text.vertical-label\")\n            .data(data)\n            .enter()\n            .append(\"text\")\n            .attr(\"class\", \"vertical-label\")\n            .attr(\"x\", (_: any, index: number) => {\n                if (plot.axisXType === \"categorical\" && axisX.bandwidth) {\n                    const bandScale = d3.scaleBand()\n                        .domain(plot.categoricalXLabels.map((_, idx) => idx.toString()))\n                        .range(axisX.range())\n                        .padding(0.1);\n                    return (bandScale(index.toString()) || 0) + bandScale.bandwidth() / 2;\n                }\n                return index * barSpacing + barSpacing / 2;\n            })\n            .attr(\"y\", (d: any, index: number) => {\n                const barHeight = Math.abs(axisY(0) - axisY(d.value || 0));\n                const barTop = Math.min(axisY(0), axisY(d.value || 0));\n                const barBottom = Math.max(axisY(0), axisY(d.value || 0));\n\n                let barCenterX: number;\n                if (plot.axisXType === \"categorical\" && axisX.bandwidth) {\n                    const bandScale = d3.scaleBand()\n                        .domain(plot.categoricalXLabels.map((_, idx) => idx.toString()))\n                        .range(axisX.range())\n                        .padding(0.1);\n                    barCenterX = (bandScale(index.toString()) || 0) + bandScale.bandwidth() / 2;\n                } else {\n                    barCenterX = index * barSpacing + barSpacing / 2;\n                }\n\n                const barBounds = {\n                    left: barCenterX - barSpacing * 0.4,\n                    right: barCenterX + barSpacing * 0.4,\n                    top: barTop,\n                    bottom: barBottom,\n                    center: { x: barCenterX, y: barTop + barHeight / 2 }\n                };\n\n                const label = d.label || \"\";\n                const textBounds = {\n                    width: label.length * fontSize * 0.6,\n                    height: fontSize\n                };\n\n                const position = this.myD3.calculateBarLabelPosition(barBounds, plotBounds, textBounds, true);\n                return position.y;\n            })\n            .attr(\"text-anchor\", alignment.textAnchor)\n            .attr(\"dominant-baseline\", alignment.dominantBaseline)\n            .attr(\"transform\", (d: any, index: number) => {\n                let x: number;\n                if (plot.axisXType === \"categorical\" && axisX.bandwidth) {\n                    const bandScale = d3.scaleBand()\n                        .domain(plot.categoricalXLabels.map((_, idx) => idx.toString()))\n                        .range(axisX.range())\n                        .padding(0.1);\n                    x = (bandScale(index.toString()) || 0) + bandScale.bandwidth() / 2;\n                } else {\n                    x = index * barSpacing + barSpacing / 2;\n                }\n\n                const barHeight = Math.abs(axisY(0) - axisY(d.value || 0));\n                const barTop = Math.min(axisY(0), axisY(d.value || 0));\n                const barBottom = Math.max(axisY(0), axisY(d.value || 0));\n\n                const barBounds = {\n                    left: x - barSpacing * 0.4,\n                    right: x + barSpacing * 0.4,\n                    top: barTop,\n                    bottom: barBottom,\n                    center: { x, y: barTop + barHeight / 2 }\n                };\n\n                const label = d.label || \"\";\n                const textBounds = { width: label.length * fontSize * 0.6, height: fontSize };\n                const position = this.myD3.calculateBarLabelPosition(barBounds, plotBounds, textBounds, true);\n                return `rotate(-90, ${position.x}, ${position.y})`;\n            })\n            .style(\"font-size\", this.FONT_SIZE)\n            .style(\"font-family\", \"sans-serif\")\n            .style(\"fill\", (d: any) => this.getTextColor(d))\n            .text((d: any) => {\n                const label = d.label || \"\";\n                const maxTextWidth = plotBounds.bottom - plotBounds.top - 20;\n                return this.myD3.truncateTextWithEllipsis(label, maxTextWidth, fontSize);\n            });\n\n        this.myD3.applyBarLabelStyling(labels);\n        const total = this.calculateTotal(data);\n        this.attachTooltips(labels, total);\n    }\n\n    private renderHorizontalBars(group: any, data: any[], height: number): void {\n        const total = this.calculateTotal(data);\n        const axisX = this.myD3.axisX;\n        const barSpacing = height / data.length;\n        const barHeight = barSpacing * this.BAR_SPACE_RATIO;\n        const bars = this.createHorizontalBarRects(group, data, axisX, barSpacing, barHeight);\n        if (this.myD3.shouldRenderBarLabels(barHeight, parseFloat(this.FONT_SIZE))) {\n            this.createHorizontalBarLabels(group, data, axisX, barSpacing);\n        }\n        this.attachTooltips(bars, total);\n    }\n\n    private createHorizontalBarRects(group: any, data: any[], axisX: any, barSpacing: number, barHeight: number) {\n        const axisY = this.myD3.axisY;\n        const plot = this.myD3.preparedPlot;\n\n        return group.selectAll(\"rect.horizontal-bar\")\n            .data(data)\n            .enter()\n            .append(\"rect\")\n            .attr(\"class\", \"horizontal-bar\")\n            .attr(\"x\", (d: any) => Math.min(axisX(0), axisX(d.value || 0)))\n            .attr(\"y\", (_: any, index: number) => {\n                if (plot.axisYType === \"categorical\" && axisY.bandwidth) {\n                    const bandScale = d3.scaleBand()\n                        .domain(plot.categoricalYLabels.map((_, idx) => idx.toString()))\n                        .range(axisY.range())\n                        .padding(0.1);\n                    return bandScale(index.toString()) || 0;\n                }\n                return index * barSpacing + (barSpacing - barHeight) / 2;\n            })\n            .attr(\"width\", (d: any) => Math.abs(axisX(0) - axisX(d.value || 0)))\n            .attr(\"height\", (_: any, index: number) => {\n                if (plot.axisYType === \"categorical\" && axisY.bandwidth) {\n                    const bandScale = d3.scaleBand()\n                        .domain(plot.categoricalYLabels.map((_, idx) => idx.toString()))\n                        .range(axisY.range())\n                        .padding(0.1);\n                    return bandScale.bandwidth();\n                }\n                return barHeight;\n            })\n            .attr(\"fill\", (d: any) => this.getBarFillColor(d))\n            .attr(\"stroke\", (d: any) => this.getBarStrokeColor(d))\n            .attr(\"stroke-width\", this.STROKE_WIDTH);\n    }\n\n    private createHorizontalBarLabels(group: any, data: any[], axisX: any, barSpacing: number): void {\n        const axisY = this.myD3.axisY;\n        const plot = this.myD3.preparedPlot;\n        const fontSize = parseFloat(this.FONT_SIZE);\n        const xRange = axisX.range();\n        const yRange = axisY.range();\n        const plotBounds = { left: xRange[0], right: xRange[1], top: yRange[1], bottom: yRange[0] };\n        const alignment = this.myD3.getBarLabelAlignment(false);\n\n        const labels = group.selectAll(\"text.horizontal-label\")\n            .data(data)\n            .enter()\n            .append(\"text\")\n            .attr(\"class\", \"horizontal-label\")\n            .attr(\"x\", (d: any) => {\n                const barWidth = Math.abs(axisX(0) - axisX(d.value || 0));\n                const barLeft = Math.min(axisX(0), axisX(d.value || 0));\n                const barRight = Math.max(axisX(0), axisX(d.value || 0));\n                const barBounds = {\n                    left: barLeft,\n                    right: barRight,\n                    top: 0,\n                    bottom: 0,\n                    center: { x: barLeft + barWidth / 2, y: 0 }\n                };\n\n                const label = d.label || \"\";\n                const textBounds = { width: label.length * fontSize * 0.6, height: fontSize };\n                const position = this.myD3.calculateBarLabelPosition(barBounds, plotBounds, textBounds, false);\n                return position.x;\n            })\n            .attr(\"y\", (_: any, index: number) => {\n                if (plot.axisYType === \"categorical\" && axisY.bandwidth) {\n                    const bandScale = d3.scaleBand()\n                        .domain(plot.categoricalYLabels.map((_, idx) => idx.toString()))\n                        .range(axisY.range())\n                        .padding(0.1);\n                    return (bandScale(index.toString()) || 0) + bandScale.bandwidth() / 2;\n                }\n                return index * barSpacing + barSpacing / 2;\n            })\n            .attr(\"dy\", \"0.35em\")\n            .attr(\"text-anchor\", alignment.textAnchor)\n            .attr(\"dominant-baseline\", alignment.dominantBaseline)\n            .style(\"font-size\", this.FONT_SIZE)\n            .style(\"font-family\", \"sans-serif\")\n            .style(\"fill\", (d: any) => this.getTextColor(d))\n            .text((d: any) => {\n                const label = d.label || \"\";\n                const maxTextWidth = plotBounds.right - plotBounds.left - 20;\n                return this.myD3.truncateTextWithEllipsis(label, maxTextWidth, fontSize);\n            });\n\n        this.myD3.applyBarLabelStyling(labels);\n        const total = this.calculateTotal(data);\n        this.attachTooltips(labels, total);\n    }\n\n    private attachTooltips(selection: any, total: number): void {\n        selection\n            .on(\"mouseenter\", (event: MouseEvent, d: any) => this.showTooltip(event, d, total))\n            .on(\"mousemove\", (event: MouseEvent, d: any) => this.showTooltip(event, d, total))\n            .on(\"mouseleave\", () => this.hideTooltip());\n    }\n}\n\n/**\n * StackedBarsRenderable - Renders stacked bar charts with multiple series per category.\n * \n * Data format expected in trace.settings.stacks:\n * {\n *   categories: string[],           // e.g., ['2020', '2021', '2022'] - the x-axis labels\n *   series: Array<{\n *     id: string,                   // unique identifier for the series\n *     label: string,                // display name\n *     hue: number,                  // HSL hue value for coloring\n *     values: Map<string, number>   // category -> value mapping\n *   }>\n * }\n * \n * Settings:\n * - showLabels: boolean - whether to show value labels on segments (default: false)\n * - labelMinHeight: number - minimum segment height in pixels to show label (default: 20)\n */\nclass StackedBarsRenderable extends ChartRenderable {\n    private readonly BAR_SPACE_RATIO = 0.8;\n    private readonly FONT_SIZE = 11;\n    private readonly STROKE_WIDTH = 1;\n\n    private getStackSettings(): {\n        showLabels: boolean;\n        labelMinHeight: number;\n    } {\n        const settings = this.trace.settings || {};\n        return {\n            showLabels: settings.showLabels === true,\n            labelMinHeight: settings.labelMinHeight ?? 20,\n        };\n    }\n\n    configureAxes(plot: any): void {\n        const stacks = this.trace.settings?.stacks;\n        if (!stacks || !stacks.categories) return;\n\n        plot.axisXType = \"categorical\";\n        plot.categoricalXLabels = stacks.categories.map(String);\n    }\n\n    updateBounds(): void {\n        const stacks = this.trace.settings?.stacks;\n        if (!stacks) return;\n\n        const { categories, series } = stacks;\n        if (!categories || !series || series.length === 0) return;\n\n        // Calculate max stack height for each category\n        let maxStackHeight = 0;\n        for (const category of categories) {\n            let stackTotal = 0;\n            for (const s of series) {\n                const value = s.values?.get?.(String(category)) ?? s.values?.[String(category)] ?? 0;\n                stackTotal += value;\n            }\n            maxStackHeight = Math.max(maxStackHeight, stackTotal);\n        }\n\n        this.trace.yMin = 0;\n        this.trace.yMax = Math.max(this.trace.yMax, maxStackHeight * 1.05); // 5% padding\n        this.trace.xMin = 0;\n        this.trace.xMax = categories.length;\n    }\n\n    render(): void {\n        const stacks = this.trace.settings?.stacks;\n        if (!stacks) return;\n\n        const { categories, series } = stacks;\n        if (!categories || categories.length === 0 || !series || series.length === 0) return;\n\n        const xRange = this.myD3.axisX.range();\n        const axisY = this.myD3.axisY;\n        const width = xRange[1] - xRange[0];\n        const baselineY = axisY(0);\n\n        const group = this.myD3.svg.append(\"g\").attr(\"class\", \"stacked-bars\");\n\n        // Create band scale for categories\n        const bandScale = d3.scaleBand<string>()\n            .domain(categories.map(String))\n            .range([0, width])\n            .padding(1 - this.BAR_SPACE_RATIO);\n\n        const stackSettings = this.getStackSettings();\n\n        // For each category, draw stacked bars\n        for (const category of categories) {\n            const catStr = String(category);\n            const x = bandScale(catStr) ?? 0;\n            const barWidth = bandScale.bandwidth();\n\n            let cumulativeValue = 0; // Track cumulative value for stacking\n\n            // Stack series from bottom to top\n            for (const s of series) {\n                const value = s.values?.get?.(catStr) ?? s.values?.[catStr] ?? 0;\n                if (value <= 0) continue;\n\n                const segmentBottom = axisY(cumulativeValue);\n                const segmentTop = axisY(cumulativeValue + value);\n                const segmentHeight = Math.abs(segmentBottom - segmentTop);\n\n                // Draw the bar segment. An explicit series `color` (hex) wins\n                // over the hue-derived fill, keeping stacks on the shared palette.\n                const rect = group.append(\"rect\")\n                    .attr(\"class\", \"stacked-bar-segment\")\n                    .attr(\"x\", x)\n                    .attr(\"y\", segmentTop)\n                    .attr(\"width\", barWidth)\n                    .attr(\"height\", segmentHeight)\n                    .attr(\"fill\", s.color || `hsl(${s.hue}, 60%, 70%)`)\n                    .attr(\"stroke\", s.color ? \"#fff\" : `hsl(${s.hue}, 40%, 30%)`)\n                    .attr(\"stroke-width\", this.STROKE_WIDTH);\n\n                // Add tooltip\n                this.attachSegmentTooltip(rect, s, value, category);\n\n                // Add label if enabled and segment is tall enough\n                if (stackSettings.showLabels && segmentHeight >= stackSettings.labelMinHeight) {\n                    group.append(\"text\")\n                        .attr(\"class\", \"stacked-bar-label\")\n                        .attr(\"x\", x + barWidth / 2)\n                        .attr(\"y\", segmentTop + segmentHeight / 2)\n                        .attr(\"text-anchor\", \"middle\")\n                        .attr(\"dominant-baseline\", \"middle\")\n                        .style(\"font-size\", `${this.FONT_SIZE}px`)\n                        .style(\"font-family\", \"sans-serif\")\n                        .style(\"font-weight\", \"600\")\n                        .style(\"fill\", s.color || `hsl(${s.hue}, 80%, 20%)`)\n                        .style(\"pointer-events\", \"none\")\n                        .style(\"text-shadow\", \"0 0 2px #fff, 0 0 2px #fff\")\n                        .text(value.toLocaleString());\n                }\n\n                cumulativeValue += value;\n            }\n        }\n    }\n\n    private attachSegmentTooltip(selection: any, series: any, value: number, category: any): void {\n        const total = this.calculateStackTotal(category);\n        const percentage = total > 0 ? ((value / total) * 100).toFixed(1) : \"0\";\n\n        const dot = series.color || `hsl(${series.hue},60%,50%)`;\n        const emph = series.color || `hsl(${series.hue},60%,40%)`;\n        const buildTooltipHtml = () => {\n            return `<div style=\"background: rgba(255,255,255,0.97); border: 1px solid #ddd; padding: 6px 10px; border-radius: 6px; box-shadow: 0 2px 8px rgba(0,0,0,0.15); font-size: 12px; font-family: sans-serif; max-width: 180px;\">\n                <div style=\"font-weight: 700; font-size: 13px; color: #333; margin-bottom: 4px;\">${category}</div>\n                <div style=\"display: flex; align-items: center; gap: 6px; margin: 2px 0;\">\n                    <span style=\"width: 8px; height: 8px; border-radius: 50%; background: ${dot}; flex-shrink: 0;\"></span>\n                    <span style=\"color: #444; flex: 1;\">${series.label || series.id}</span>\n                    <span style=\"font-weight: 600; color: ${emph};\">${value.toLocaleString()}</span>\n                </div>\n                <div style=\"color: #888; font-size: 11px; margin-top: 2px;\">${percentage}% of year</div>\n                <div style=\"border-top: 1px solid #eee; margin-top: 4px; padding-top: 4px; display: flex; justify-content: space-between; font-weight: 600; color: #333;\">\n                    <span>Year Total</span><span>${total.toLocaleString()}</span>\n                </div>\n            </div>`;\n        };\n\n        selection\n            .on(\"mouseenter\", (event: MouseEvent) => {\n                this.ensureTooltip();\n                const mouse = d3.pointer(event, this.myD3.svg.node());\n                this.tooltip!.show(buildTooltipHtml(), mouse[0], mouse[1]);\n            })\n            .on(\"mousemove\", (event: MouseEvent) => {\n                const mouse = d3.pointer(event, this.myD3.svg.node());\n                this.tooltip!.show(buildTooltipHtml(), mouse[0], mouse[1]);\n            })\n            .on(\"mouseleave\", () => this.hideTooltip());\n    }\n\n    private calculateStackTotal(category: any): number {\n        const stacks = this.trace.settings?.stacks;\n        if (!stacks) return 0;\n\n        const catStr = String(category);\n        let total = 0;\n        for (const s of stacks.series) {\n            const value = s.values?.get?.(catStr) ?? s.values?.[catStr] ?? 0;\n            total += value;\n        }\n        return total;\n    }\n}\n\nexport { ChartRenderable, PieRenderable, BarsRenderable, StackedBarsRenderable };\n\n\n","import * as d3 from \"d3\";\nimport type { Plot } from \"../core/PlotModel\";\nimport { ChartRenderable } from \"./ChartRenderables\";\n\n/**\n * HeatmapRenderable — a categorical grid of value-shaded cells (site x year).\n *\n * Data lives in trace.settings.grid:\n *   xLabels: string[]            // columns\n *   yLabels: string[]            // rows; yLabels[0] renders at the TOP (categorical Y's band\n *                                 // scale runs top-down, so lists read in data order)\n *   values: (number|null)[][]    // values[row][col]; null/0 = empty cell\n *\n * Cells use the same YlOrRd sqrt ramp as the dashboard heatmap (SpeciesYearHeatmap).\n */\nclass HeatmapRenderable extends ChartRenderable {\n    private getGrid(): any {\n        return this.trace.settings?.grid;\n    }\n\n    configureAxes(plot: Plot): void {\n        const grid = this.getGrid();\n        if (!grid?.xLabels?.length || !grid?.yLabels?.length) return;\n        plot.axisXType = \"categorical\";\n        plot.categoricalXLabels = grid.xLabels.map(String);\n        plot.axisYType = \"categorical\";\n        plot.categoricalYLabels = grid.yLabels.map(String);\n    }\n\n    updateBounds(): void {\n        const grid = this.getGrid();\n        if (!grid) return;\n        this.trace.xMin = 0;\n        this.trace.xMax = grid.xLabels?.length || 0;\n        this.trace.yMin = 0;\n        this.trace.yMax = grid.yLabels?.length || 0;\n    }\n\n    render(): void {\n        const grid = this.getGrid();\n        if (!grid?.xLabels?.length || !grid?.yLabels?.length) return;\n\n        // Band scales replicated with the padding the dashboard heatmap uses,\n        // aligned to MyD3's categorical axes so cells sit under the tick labels.\n        const bandX = d3.scaleBand<string>()\n            .domain(grid.xLabels.map((_: any, i: number) => i.toString()))\n            .range(this.myD3.axisX.range())\n            .padding(0.06);\n        const bandY = d3.scaleBand<string>()\n            .domain(grid.yLabels.map((_: any, i: number) => i.toString()))\n            .range(this.myD3.axisY.range())\n            .padding(0.06);\n\n        let maxValue = 0;\n        for (const row of grid.values || []) {\n            for (const v of row || []) if (v && v > maxValue) maxValue = v;\n        }\n        const color = d3.scaleSequential(d3.interpolateYlOrRd).domain([0, Math.sqrt(maxValue || 1)]);\n\n        const g = this.myD3.svg.append(\"g\").attr(\"class\", \"heatmap\");\n        // Round corners only as far as the smaller cell dimension allows (thin cells turn\n        // into pills otherwise).\n        const rx = Math.min(2, bandX.bandwidth() * 0.3, bandY.bandwidth() * 0.3);\n        for (let r = 0; r < grid.yLabels.length; r += 1) {\n            for (let c = 0; c < grid.xLabels.length; c += 1) {\n                const value = grid.values?.[r]?.[c] ?? null;\n                const rect = g.append(\"rect\")\n                    .attr(\"x\", bandX(c.toString()) ?? 0)\n                    .attr(\"y\", bandY(r.toString()) ?? 0)\n                    .attr(\"width\", bandX.bandwidth())\n                    .attr(\"height\", bandY.bandwidth())\n                    .attr(\"rx\", rx)\n                    .attr(\"fill\", value ? color(Math.sqrt(value)) : \"#f1f5f9\");\n                this.attachCellTooltip(rect, grid.yLabels[r], grid.xLabels[c], value);\n            }\n        }\n    }\n\n    private attachCellTooltip(selection: any, rowLabel: string, colLabel: string, value: number | null): void {\n        // Optional unit after the value (e.g. \"1,234 Visits\")\n        const unit = this.trace.settings?.valueLabel ? ` ${this.trace.settings.valueLabel}` : \"\";\n        const html = `<div style=\"background: rgba(255,255,255,0.97); border: 1px solid #ddd; padding: 6px 10px; border-radius: 6px; box-shadow: 0 2px 8px rgba(0,0,0,0.15); font-size: 12px; font-family: sans-serif; max-width: 220px;\">\n            <div style=\"font-weight: 700; color: #333;\">${rowLabel}</div>\n            <div style=\"display: flex; justify-content: space-between; gap: 12px; color: #444;\">\n                <span>${colLabel}</span>\n                <span style=\"font-weight: 600; color: #1e293b;\">${value ? value.toLocaleString() + unit : \"–\"}</span>\n            </div>\n        </div>`;\n        selection\n            .on(\"mouseenter\", (event: MouseEvent) => {\n                this.ensureTooltip();\n                const mouse = d3.pointer(event, this.myD3.svg.node());\n                this.tooltip!.show(html, mouse[0], mouse[1]);\n            })\n            .on(\"mousemove\", (event: MouseEvent) => {\n                const mouse = d3.pointer(event, this.myD3.svg.node());\n                this.tooltip!.show(html, mouse[0], mouse[1]);\n            })\n            .on(\"mouseleave\", () => this.hideTooltip());\n    }\n}\n\nexport { HeatmapRenderable };\n","import * as d3 from \"d3\";\nimport { ChartRenderable } from \"./ChartRenderables\";\n\n/**\n * RadialBarsRenderable — bars arranged in a ring (e.g. the dashboard's seasonality\n * clock: one bar per month, bar length = value).\n *\n * Items are tabular rows with `label`, `value` and either an explicit `color`\n * or a `hue` (same color rules as pie/bars). Settings (`trace.settings`):\n *   innerRadiusRatio: number   // hole size as fraction of outer radius (default 0.35)\n *   showLabels: boolean        // ring of category labels (default true)\n *   centerText: { value, label? }  // text inside the hole\n *   valueLabel: string         // unit appended to the tooltip value\n *\n * Best drawn with customOptions.hideAxes = { x: true, y: true } — the ring\n * defines its own coordinate system.\n */\nclass RadialBarsRenderable extends ChartRenderable {\n    render(): void {\n        const data = this.prepareData();\n        if (!data.length) return;\n        const total = this.calculateTotal(data);\n        const settings = this.trace.settings || {};\n\n        const xRange = this.myD3.axisX.range();\n        const yRange = this.myD3.axisY.range();\n        const width = xRange[1] - xRange[0];\n        const height = yRange[0] - yRange[1];\n        const showLabels = settings.showLabels !== false;\n        const labelSpace = showLabels ? 22 : 4;\n        const radius = Math.min(width, height) / 2 - labelSpace;\n        if (radius <= 0) return;\n        const inner = radius * (settings.innerRadiusRatio ?? 0.35);\n\n        const group = this.myD3.svg.append(\"g\")\n            .attr(\"transform\", `translate(${width / 2},${height / 2})`);\n\n        const angle = d3.scaleBand<string>()\n            .domain(data.map((_: any, i: number) => i.toString()))\n            .range([0, 2 * Math.PI])\n            .align(0);\n        const maxValue = d3.max(data, (d: any) => d.value || 0) || 1;\n        const radial = d3.scaleRadial().domain([0, maxValue]).range([inner, radius]);\n\n        const arcGen = d3.arc<any>()\n            .innerRadius(inner)\n            .outerRadius((d: any) => radial(d.value || 0))\n            .startAngle((_d: any, i: number) => angle(i.toString()) || 0)\n            .endAngle((_d: any, i: number) => (angle(i.toString()) || 0) + angle.bandwidth())\n            .padAngle(0.03)\n            .padRadius(inner);\n\n        group.selectAll(\"path.radial-bar\")\n            .data(data)\n            .enter()\n            .append(\"path\")\n            .attr(\"class\", \"radial-bar\")\n            .attr(\"fill\", (d: any) => this.getBarFillColor(d))\n            .attr(\"d\", arcGen as any)\n            .on(\"mouseenter\", (event: MouseEvent, d: any) => {\n                d3.select(event.currentTarget as any).attr(\"opacity\", 0.8);\n                this.showTooltip(event, d, total);\n            })\n            .on(\"mousemove\", (event: MouseEvent, d: any) => this.showTooltip(event, d, total))\n            .on(\"mouseleave\", (event: MouseEvent) => {\n                d3.select(event.currentTarget as any).attr(\"opacity\", 1);\n                this.hideTooltip();\n            });\n\n        if (showLabels) {\n            group.selectAll(\"text.radial-label\")\n                .data(data)\n                .enter()\n                .append(\"text\")\n                .attr(\"class\", \"radial-label\")\n                .attr(\"text-anchor\", \"middle\")\n                .attr(\"dominant-baseline\", \"middle\")\n                .attr(\"transform\", (_d: any, i: number) => {\n                    const a = (angle(i.toString()) || 0) + angle.bandwidth() / 2 - Math.PI / 2;\n                    const r = radius + 14;\n                    return `translate(${Math.cos(a) * r},${Math.sin(a) * r})`;\n                })\n                .style(\"font-size\", \"10px\")\n                .style(\"font-family\", \"sans-serif\")\n                .style(\"fill\", \"#64748b\")\n                .text((d: any) => d.label || \"\");\n        }\n\n        const centerText = settings.centerText;\n        if (centerText && inner > 0) {\n            const valueSize = Math.max(12, Math.min(22, inner * 0.5));\n            group.append(\"text\")\n                .attr(\"text-anchor\", \"middle\")\n                .attr(\"dy\", centerText.label ? \"-0.1em\" : \"0.35em\")\n                .style(\"font-size\", `${valueSize}px`)\n                .style(\"font-weight\", \"700\")\n                .style(\"fill\", \"#1e293b\")\n                .style(\"font-variant-numeric\", \"tabular-nums\")\n                .style(\"pointer-events\", \"none\")\n                .text(centerText.value);\n            if (centerText.label) {\n                group.append(\"text\")\n                    .attr(\"text-anchor\", \"middle\")\n                    .attr(\"dy\", \"1.6em\")\n                    .style(\"font-size\", `${Math.max(8, valueSize * 0.45)}px`)\n                    .style(\"letter-spacing\", \"0.05em\")\n                    .style(\"text-transform\", \"uppercase\")\n                    .style(\"fill\", \"#94a3b8\")\n                    .style(\"pointer-events\", \"none\")\n                    .text(centerText.label);\n            }\n            if (centerText.sub) {\n                // sub may be a single string or several stacked lines (used when the\n                // caption is too wide to fit the hole on one line, e.g. in German).\n                const subLines = Array.isArray(centerText.sub) ? centerText.sub : [centerText.sub];\n                const baseDy = centerText.label ? 2.8 : 1.6;\n                subLines.forEach((line: string, i: number) => {\n                    group.append(\"text\")\n                        .attr(\"text-anchor\", \"middle\")\n                        .attr(\"dy\", `${baseDy + i * 1.15}em`)\n                        .style(\"font-size\", `${Math.max(8, valueSize * 0.34)}px`)\n                        .style(\"letter-spacing\", \"0.05em\")\n                        .style(\"text-transform\", \"uppercase\")\n                        .style(\"fill\", \"#94a3b8\")\n                        .style(\"pointer-events\", \"none\")\n                        .text(line);\n                });\n            }\n        }\n    }\n}\n\nexport { RadialBarsRenderable };\n","import type { MyD3 } from \"../MyD3\";\nimport { Trace, TraceData } from \"../core/PlotModel\";\nimport {\n    AreaRenderable,\n    BarsRenderable,\n    ErrorBarsRenderable,\n    FillAreaRenderable,\n    FocusMarkerRenderable,\n    HeatmapRenderable,\n    LineRenderable,\n    MarkersRenderable,\n    PieRenderable,\n    RadialBarsRenderable,\n    RectangleRenderable,\n    ScatterLinesRenderable,\n    StackedBarsRenderable,\n    TraceRenderable\n} from \"../renderables\";\n\nabstract class TraceHandler {\n    protected readItemsTabular(jsonTrace: any): TraceData[] {\n        const table = jsonTrace.items;\n        const header = table?.h || [];\n        const rows = table?.r || [];\n        const items: TraceData[] = [];\n\n        for (const row of rows) {\n            const values: Record<string, any> = {};\n            for (let idx = 0; idx < header.length; idx += 1) {\n                const key = header[idx];\n                values[key] = row[idx];\n            }\n            items.push(new TraceData(values));\n        }\n\n        return items;\n    }\n\n    read(jsonTrace: Record<string, any>): Trace {\n        return this.doRead(jsonTrace);\n    }\n\n    abstract canHandle(jsonTrace: any): boolean;\n    abstract doRead(jsonTrace: any): Trace;\n    abstract yieldRenderables(trace: Trace, myD3: MyD3): TraceRenderable[];\n}\n\nclass TrendHandler extends TraceHandler {\n    canHandle(jsonTrace: any): boolean {\n        return jsonTrace.settings?.type === \"trend\";\n    }\n\n    doRead(jsonTrace: any): Trace {\n        const items = this.readItemsTabular(jsonTrace);\n        const trace = new Trace(jsonTrace, this);\n        trace.items = items;\n        trace.xMin = Math.min(...trace.items.map(item => item.data[trace.keyX]));\n        trace.xMax = Math.max(...trace.items.map(item => item.data[trace.keyX]));\n        // Data extent only — the 0/2 trend-index frame is applied per plot in\n        // MyD3.resolveYBounds (customOptions.yIncludeValues), not per trace.\n        trace.yMin = Math.min(...trace.items.map(item => item.data[trace.keyY]));\n        trace.yMax = Math.max(...trace.items.map(item => item.data[trace.keyY]));\n        return trace;\n    }\n\n    yieldRenderables(trace: Trace, myD3: MyD3): TraceRenderable[] {\n        const renderables: TraceRenderable[] = [];\n        const settings = trace.settings;\n\n        if (settings.hideGraph !== true) {\n            if (myD3.visuals.showErrorArea) {\n                renderables.push(new AreaRenderable(myD3, trace, 10));\n            }\n            if (settings.fillArea === true) {\n                renderables.push(new FillAreaRenderable(myD3, trace, 15));\n            }\n            if (myD3.visuals.showLine) {\n                renderables.push(new LineRenderable(myD3, trace, 20));\n            }\n        }\n\n        if (settings?.hideFocus !== true) {\n            renderables.push(new FocusMarkerRenderable(myD3, trace, 30));\n            if (myD3.visuals.showMarkers) {\n                renderables.push(new MarkersRenderable(myD3, trace, 21));\n            }\n            if (myD3.visuals.showErrorBars) {\n                renderables.push(new ErrorBarsRenderable(myD3, trace, 19));\n            }\n            if (settings.keyRteLow && settings.keyRteHigh) {\n                const hasValues = trace.items.length > 0 &&\n                    trace.items[0].data[settings.keyRteLow] !== undefined &&\n                    trace.items[0].data[settings.keyRteHigh] !== undefined;\n\n                if (hasValues) {\n                    const renderable = new ErrorBarsRenderable(myD3, trace, 19);\n                    renderable.mode = \"lines\";\n                    renderable.keyValue = \"rteVal\";\n                    renderable.keyLow = \"rteLow\";\n                    renderable.keyHigh = \"rteHigh\";\n                    renderables.push(renderable);\n                }\n            }\n        }\n\n        return renderables;\n    }\n}\n\nclass RectangleHandler extends TraceHandler {\n    canHandle(jsonTrace: any): boolean {\n        return jsonTrace.settings?.type === \"rect\";\n    }\n\n    doRead(jsonTrace: any): Trace {\n        const trace = new Trace(jsonTrace, this);\n        for (const item of jsonTrace.items || []) {\n            trace.items.push(new TraceData(item));\n        }\n        return trace;\n    }\n\n    yieldRenderables(trace: Trace, myD3: MyD3): TraceRenderable[] {\n        return [new RectangleRenderable(myD3, trace, 0)];\n    }\n}\n\nclass PieHandler extends TraceHandler {\n    canHandle(jsonTrace: any): boolean {\n        return jsonTrace.settings?.type === \"pie\";\n    }\n\n    doRead(jsonTrace: any): Trace {\n        const items = this.readItemsTabular(jsonTrace);\n        const trace = new Trace(jsonTrace, this);\n        trace.items = items;\n        return trace;\n    }\n\n    yieldRenderables(trace: Trace, myD3: MyD3): TraceRenderable[] {\n        return [new PieRenderable(myD3, trace, 0)];\n    }\n}\n\nclass BarsHandler extends TraceHandler {\n    canHandle(jsonTrace: any): boolean {\n        return jsonTrace.settings?.type === \"bars\";\n    }\n\n    doRead(jsonTrace: any): Trace {\n        const items = this.readItemsTabular(jsonTrace);\n        const trace = new Trace(jsonTrace, this);\n        trace.items = items;\n        return trace;\n    }\n\n    yieldRenderables(trace: Trace, myD3: MyD3): TraceRenderable[] {\n        return [new BarsRenderable(myD3, trace, 0)];\n    }\n}\n\nclass StackedBarsHandler extends TraceHandler {\n    canHandle(jsonTrace: any): boolean {\n        return jsonTrace.settings?.type === \"stackedBars\";\n    }\n\n    doRead(jsonTrace: any): Trace {\n        const trace = new Trace(jsonTrace, this);\n        // Stacked bars don't use traditional items - data is in settings.stacks\n        return trace;\n    }\n\n    yieldRenderables(trace: Trace, myD3: MyD3): TraceRenderable[] {\n        return [new StackedBarsRenderable(myD3, trace, 0)];\n    }\n}\n\nclass ScatterLinesHandler extends TraceHandler {\n    canHandle(jsonTrace: any): boolean {\n        return jsonTrace.settings?.type === \"scatterLines\";\n    }\n\n    doRead(jsonTrace: any): Trace {\n        const trace = new Trace(jsonTrace, this);\n        trace.items = this.readItemsTabular(jsonTrace);\n        // bounds are derived from the items by ScatterLinesRenderable.updateBounds()\n        return trace;\n    }\n\n    yieldRenderables(trace: Trace, myD3: MyD3): TraceRenderable[] {\n        return [new ScatterLinesRenderable(myD3, trace, 20)];\n    }\n}\n\nclass RadialBarsHandler extends TraceHandler {\n    canHandle(jsonTrace: any): boolean {\n        return jsonTrace.settings?.type === \"radialBars\";\n    }\n\n    doRead(jsonTrace: any): Trace {\n        const trace = new Trace(jsonTrace, this);\n        trace.items = this.readItemsTabular(jsonTrace);\n        return trace;\n    }\n\n    yieldRenderables(trace: Trace, myD3: MyD3): TraceRenderable[] {\n        return [new RadialBarsRenderable(myD3, trace, 0)];\n    }\n}\n\nclass HeatmapHandler extends TraceHandler {\n    canHandle(jsonTrace: any): boolean {\n        return jsonTrace.settings?.type === \"heatmap\";\n    }\n\n    doRead(jsonTrace: any): Trace {\n        // Heatmaps don't use traditional items — the grid lives in settings.grid\n        return new Trace(jsonTrace, this);\n    }\n\n    yieldRenderables(trace: Trace, myD3: MyD3): TraceRenderable[] {\n        return [new HeatmapRenderable(myD3, trace, 0)];\n    }\n}\n\nconst defaultHandlers: TraceHandler[] = [\n    new RectangleHandler(),\n    new TrendHandler(),\n    new PieHandler(),\n    new BarsHandler(),\n    new StackedBarsHandler(),\n    new ScatterLinesHandler(),\n    new RadialBarsHandler(),\n    new HeatmapHandler()\n];\n\nfunction getTraceHandlers(): TraceHandler[] {\n    return defaultHandlers;\n}\n\nexport {\n    TraceHandler,\n    TrendHandler,\n    RectangleHandler,\n    PieHandler,\n    BarsHandler,\n    StackedBarsHandler,\n    ScatterLinesHandler,\n    RadialBarsHandler,\n    HeatmapHandler,\n    getTraceHandlers\n};\n\n\n","import { ElementBuilder } from \"../dom/ElementBuilder\";\nimport type { MultiSeriesStyle, MyD3DisplaySettings, TooltipStyle } from \"../core/DisplaySettings\";\nimport {\n    MULTI_SERIES_STYLES,\n    OFFSET_LIMITS,\n    OFFSET_STYLES,\n    TOOLTIP_STYLES,\n    defaultDisplaySettings\n} from \"../core/DisplaySettings\";\n\n/** What of the display settings applies to the chart the panel belongs to. */\ninterface SettingsAvailability {\n    /** Default title of the axis when the chart can label it, else null. */\n    axisX: string | null;\n    axisY: string | null;\n    /** The chart overlays several series. */\n    multi: boolean;\n    /** Several of those series have year effects — the offsets have something to move. */\n    offsets: boolean;\n    /** The x-axis counts years and shows them: the hovered year can be flagged on it. */\n    yearFlag: boolean;\n    /** The x-axis counts years: the hovered year can be given a background. */\n    yearBackground: boolean;\n    /** The chart shows the standard tooltip, which comes in several styles. */\n    tooltip: boolean;\n}\n\ninterface SettingsPanelHost {\n    /** The toolbar button the panel hangs under. */\n    anchor: HTMLElement;\n    /** The chart container: using the chart (hover, zoom, pan) keeps the panel open. */\n    chart: HTMLElement;\n    availability: SettingsAvailability;\n    /** Marks the panel with the app's access dot when editing is role-gated. */\n    badge: \"admin\" | \"staff\" | null;\n    t(key: string, fallback: string): string;\n    get(): MyD3DisplaySettings;\n    /** Apply edited settings: the chart redraws and tells its host. */\n    set(settings: MyD3DisplaySettings): void;\n    onClose(): void;\n}\n\nconst STYLE_ID = \"myd3-settings-style\";\n\n//  Looks like the rest of the page chrome (the observation-type menu, the options\n//  card): slate hairlines, one blue accent, small type.\nconst CSS = `\n.myd3-settings{position:absolute;z-index:1080;width:20rem;max-width:calc(100vw - 1rem);background:#fff;\n  border:1px solid #e2e8f0;border-radius:.75rem;color:#1e293b;font-size:.8125rem;line-height:1.4;text-align:left;\n  box-shadow:0 18px 40px -12px rgba(15,23,42,.28),0 2px 6px rgba(15,23,42,.06);\n  animation:myd3-settings-in .14s ease;transform-origin:top right}\n@keyframes myd3-settings-in{from{opacity:0;transform:translateY(-4px) scale(.98)}to{opacity:1;transform:none}}\n.myd3-settings-head{display:flex;align-items:center;gap:.45rem;padding:.7rem .85rem .6rem;border-bottom:1px solid #eef2f6}\n.myd3-settings-title{flex:1;margin:0;font-size:.875rem;font-weight:600}\n.myd3-settings-body{padding:0 .85rem .55rem;max-height:min(78vh,46rem);overflow-y:auto}\n.myd3-settings-section{padding:.7rem 0 .15rem}\n.myd3-settings-section+.myd3-settings-section{border-top:1px solid #eef2f6;margin-top:.5rem}\n.myd3-settings-section>h6{margin:0 0 .5rem;font-size:.75rem;font-weight:600;color:#64748b}\n.myd3-settings-check{display:flex;align-items:center;gap:.5rem;padding:.2rem 0;margin:0;color:#334155;cursor:pointer}\n.myd3-settings-check input{flex-shrink:0;width:.95rem;height:.95rem;margin:0;accent-color:#2563eb;cursor:inherit}\n.myd3-settings-check.is-disabled{color:#94a3b8;cursor:not-allowed}\n.myd3-settings-axis{display:grid;grid-template-columns:5.75rem 1fr;align-items:center;gap:.5rem;margin-bottom:.3rem}\n.myd3-settings input[type=text],.myd3-settings input[type=number]{width:100%;min-width:0;padding:.25rem .45rem;\n  border:1px solid #e2e8f0;border-radius:.4rem;background:#fff;color:#1e293b;font-size:.8125rem;\n  transition:border-color .12s ease,box-shadow .12s ease}\n.myd3-settings input[type=text]:focus-visible,.myd3-settings input[type=number]:focus-visible,\n.myd3-style-tile:focus-visible,.myd3-settings-reset:focus-visible{outline:none;border-color:#2563eb;\n  box-shadow:0 0 0 3px rgba(37,99,235,.15)}\n.myd3-settings input:disabled{background:#f8fafc;color:#94a3b8;cursor:not-allowed}\n.myd3-style-grid{display:grid;grid-auto-flow:column;grid-auto-columns:1fr;gap:.35rem}\n.myd3-style-tile{display:flex;flex-direction:column;align-items:center;gap:.2rem;padding:.35rem .2rem .3rem;\n  border:1px solid #e2e8f0;border-radius:.5rem;background:#fff;color:#475569;font-size:.72rem;font-weight:500;\n  cursor:pointer;transition:border-color .12s ease,background .12s ease,color .12s ease}\n.myd3-style-tile:hover{border-color:#cbd5e1;background:#f8fafc;color:#1e293b}\n.myd3-style-tile.is-active{border-color:#2563eb;background:rgba(37,99,235,.06);color:#2563eb;font-weight:600;\n  box-shadow:inset 0 0 0 1px #2563eb}\n.myd3-style-tile svg{display:block;width:100%;max-width:3.5rem;height:auto}\n.myd3-settings-hint{margin:.45rem 0 .4rem;min-height:2.8em;font-size:.75rem;color:#64748b}\n.myd3-settings-sub{margin-left:1.45rem}\n.myd3-settings-nums{display:grid;grid-template-columns:repeat(2,1fr);gap:.4rem;margin:.3rem 0 .4rem}\n.myd3-settings-nums label{display:block;margin:0 0 .15rem;font-size:.7rem;color:#64748b;white-space:nowrap}\n.myd3-settings-foot{display:flex;justify-content:flex-end;padding:.5rem .85rem .65rem;border-top:1px solid #eef2f6}\n.myd3-settings-reset{padding:.25rem .65rem;border:1px solid #e2e8f0;border-radius:.4rem;background:#fff;\n  color:#475569;font-size:.75rem;font-weight:500;cursor:pointer}\n.myd3-settings-reset:hover{border-color:#cbd5e1;color:#1e293b}\n@media (prefers-reduced-motion:reduce){.myd3-settings{animation:none}}\n`;\n\n//  Thumbnails of the multi-series styles: two series (blue, violet) over three years.\nconst A = \"#3b82f6\";\nconst B = \"#a855f7\";\nconst AXIS = '<line x1=\"2\" y1=\"25.5\" x2=\"46\" y2=\"25.5\" stroke=\"#94a3b8\"/>';\n/** dot + whisker of series A (filled) / B (hollow) at x, value y, half-length h */\nconst markA = (x: number, y: number, h: number) =>\n    `<line x1=\"${x}\" y1=\"${y - h}\" x2=\"${x}\" y2=\"${y + h}\" stroke=\"${A}\" stroke-width=\"1.2\"/>`\n    + `<circle cx=\"${x}\" cy=\"${y}\" r=\"2\" fill=\"${A}\"/>`;\nconst markB = (x: number, y: number, h: number) =>\n    `<line x1=\"${x}\" y1=\"${y - h}\" x2=\"${x}\" y2=\"${y + h}\" stroke=\"${B}\" stroke-width=\"1.2\"/>`\n    + `<circle cx=\"${x}\" cy=\"${y}\" r=\"2\" fill=\"#fff\" stroke=\"${B}\" stroke-width=\"1.2\"/>`;\nconst svgOpen = '<svg viewBox=\"0 0 48 30\" aria-hidden=\"true\">';\nconst THUMBNAILS: Record<MultiSeriesStyle, string> = {\n    columns: svgOpen + '<rect x=\"16\" y=\"2\" width=\"16\" height=\"23.5\" fill=\"#e2e8f0\"/>' + AXIS\n        + markA(5, 13, 5) + markB(11, 10, 6) + markA(21, 11, 5) + markB(27, 15, 6)\n        + markA(37, 15, 5) + markB(43, 9, 5) + \"</svg>\",\n    nested: svgOpen + AXIS\n        + [[8, 13, 10], [24, 11, 15], [40, 15, 9]].map(([x, yA, yB]) =>\n            `<rect x=\"${x - 5}\" y=\"${yA - 6}\" width=\"10\" height=\"12\" rx=\"1.5\" fill=\"${A}\" opacity=\".3\"/>`\n            + `<line x1=\"${x - 5}\" y1=\"${yA}\" x2=\"${x + 5}\" y2=\"${yA}\" stroke=\"${A}\" stroke-width=\"1.6\"/>`\n            + markB(x, yB, 6)).join(\"\") + \"</svg>\",\n    rows: svgOpen + '<line x1=\"2\" y1=\"13.5\" x2=\"46\" y2=\"13.5\" stroke=\"#cbd5e1\"/>' + AXIS\n        + markA(8, 8, 4) + markA(24, 6, 3.5) + markA(40, 9, 3.5)\n        + markB(8, 19, 3.5) + markB(24, 21, 3.5) + markB(40, 18, 4) + \"</svg>\",\n};\n\nconst STYLE_FALLBACK: Record<MultiSeriesStyle, [string, string]> = {\n    columns: [\"Columns\", \"The series stand side by side at their year; the year guides shade the years as columns.\"],\n    nested: [\"Nested\", \"Every series on the exact year; the intervals are bars of different widths.\"],\n    rows: [\"Rows\", \"One row per series over a shared year axis.\"],\n};\n\n//  Thumbnails of the tooltip styles: a trend line, the hovered point, and where the\n//  read-out sits.\nconst LINE_A = `<path d=\"M3,19 L14,15 L25,17 L36,11 L45,13\" fill=\"none\" stroke=\"${A}\" stroke-width=\"1.3\"/>`;\nconst LINE_B = `<path d=\"M3,9 L14,12 L25,8 L36,20 L45,18\" fill=\"none\" stroke=\"${B}\" stroke-width=\"1.3\"/>`;\nconst hoverDot = (x: number, y: number, color: string) =>\n    `<circle cx=\"${x}\" cy=\"${y}\" r=\"2.2\" fill=\"#fff\" stroke=\"${color}\" stroke-width=\"1.3\"/>`;\nconst paper = (x: number, y: number, w: number, h: number) =>\n    `<rect x=\"${x}\" y=\"${y}\" width=\"${w}\" height=\"${h}\" rx=\"1.5\" fill=\"#fff\" stroke=\"#94a3b8\" stroke-width=\".8\"/>`;\nconst ink = (x: number, y: number, w: number, color = \"#475569\") =>\n    `<line x1=\"${x}\" y1=\"${y}\" x2=\"${x + w}\" y2=\"${y}\" stroke=\"${color}\" stroke-width=\"1.4\"/>`;\nconst TOOLTIP_THUMBNAILS: Record<TooltipStyle, string> = {\n    card: svgOpen + AXIS + LINE_A + hoverDot(14, 15, A)\n        + paper(19, 5, 23, 13) + ink(22, 9, 7) + ink(22, 13.5, 16, \"#cbd5e1\") + \"</svg>\",\n    bubble: svgOpen + AXIS + LINE_A + hoverDot(25, 17, A)\n        + '<rect x=\"12\" y=\"3\" width=\"26\" height=\"8.5\" rx=\"2\" fill=\"#1e293b\"/>'\n        + '<path d=\"M22,11 L28,11 L25,14.2 Z\" fill=\"#1e293b\"/>' + ink(16, 7.2, 18, \"#fff\") + \"</svg>\",\n    tags: svgOpen + AXIS + LINE_A + LINE_B + hoverDot(25, 17, A) + hoverDot(25, 8, B)\n        + paper(29, 14, 15, 6) + `<line x1=\"29\" y1=\"14\" x2=\"29\" y2=\"20\" stroke=\"${A}\" stroke-width=\"1.6\"/>`\n        + paper(29, 5, 15, 6) + `<line x1=\"29\" y1=\"5\" x2=\"29\" y2=\"11\" stroke=\"${B}\" stroke-width=\"1.6\"/>` + \"</svg>\",\n    docked: svgOpen + '<line x1=\"2.5\" y1=\"2\" x2=\"2.5\" y2=\"25.5\" stroke=\"#94a3b8\"/>' + AXIS + LINE_A + hoverDot(36, 11, A)\n        + paper(5, 3.5, 19, 10.5) + ink(8, 7, 6) + ink(8, 10.5, 13, \"#cbd5e1\") + \"</svg>\",\n};\n\nconst TOOLTIP_FALLBACK: Record<TooltipStyle, [string, string]> = {\n    card: [\"Card\", \"Beside the hovered year, level with the pointer.\"],\n    bubble: [\"Bubble\", \"Dark, above the marks of the year; leaves the year itself to the flag on the axis.\"],\n    tags: [\"Tags\", \"No box: a small label at every point.\"],\n    docked: [\"Docked\", \"Stays in a top corner of the plot and steps aside for the hovered year.\"],\n};\n\n/**\n * The popover behind the settings button of a chart: edits a MyD3DisplaySettings\n * object and hands every change straight to the chart, which redraws live.\n *\n * Mounted on <body> (a small chart would clip it) in document coordinates, so it\n * scrolls with the page. It removes itself when the chart disappears.\n */\nclass SettingsPanel {\n    private root?: HTMLElement;\n    private syncers: Array<(settings: MyD3DisplaySettings) => void> = [];\n    private watchTimer?: number;\n    private readonly onKey = (e: KeyboardEvent) => {\n        if (e.key === \"Escape\") this.close();\n    };\n    private readonly onPointer = (e: Event) => {\n        const target = e.target as Node;\n        //  the panel is a palette for its chart — only a click elsewhere dismisses it\n        if (this.root?.contains(target) || this.host.chart.contains(target)) return;\n        this.close();\n    };\n\n    constructor(private readonly host: SettingsPanelHost) {}\n\n    get isOpen(): boolean {\n        return this.root !== undefined;\n    }\n\n    toggle() {\n        this.isOpen ? this.close() : this.open();\n    }\n\n    open() {\n        if (this.root) return;\n        SettingsPanel.ensureStyle();\n        this.syncers = [];\n        const t = this.host.t;\n        const root = ElementBuilder.create(\"div\", {\n            class: \"myd3-settings\",\n            role: \"dialog\",\n            \"aria-label\": t(\"trends.display.title\", \"Plot options\")\n        }).el();\n\n        const head = ElementBuilder.append(root, \"div\", { class: \"myd3-settings-head\" }).el();\n        ElementBuilder.append(head, \"h5\", { class: \"myd3-settings-title\" })\n            .text(t(\"trends.display.title\", \"Plot options\"));\n        if (this.host.badge) {\n            const dot = ElementBuilder.append(head, \"span\", { class: `badge-circle badge-${this.host.badge}` });\n            if (this.host.badge === \"admin\") dot.attr(\"title\", t(\"trends.obsTabs.adminOnly\", \"admin only\"));\n        }\n        const closeButton = ElementBuilder.append(head, \"button\", {\n            type: \"button\",\n            class: \"btn-close\",\n            style: { \"font-size\": \".65rem\" },\n            \"aria-label\": t(\"trends.image.close\", \"Close\")\n        }).el();\n        closeButton.onclick = () => this.close();\n\n        const body = ElementBuilder.append(root, \"div\", { class: \"myd3-settings-body\" }).el();\n        const availability = this.host.availability;\n        if (availability.axisX !== null || availability.axisY !== null) this.buildAxisSection(body);\n        if (availability.multi) {\n            this.buildStyleSection(body);\n            if (availability.offsets) this.buildOffsetSection(body);\n        }\n        if (availability.yearFlag || availability.yearBackground) this.buildHoverSection(body);\n        if (availability.tooltip) this.buildTooltipSection(body);\n\n        const foot = ElementBuilder.append(root, \"div\", { class: \"myd3-settings-foot\" }).el();\n        const reset = ElementBuilder.append(foot, \"button\", { type: \"button\", class: \"myd3-settings-reset\" })\n            .text(t(\"trends.display.reset\", \"Reset to defaults\")).el();\n        reset.onclick = () => {\n            this.host.set(defaultDisplaySettings());\n            this.sync();\n        };\n\n        document.body.appendChild(root);\n        this.root = root;\n        this.sync();\n        this.position();\n        this.host.anchor.setAttribute(\"aria-expanded\", \"true\");\n\n        document.addEventListener(\"keydown\", this.onKey);\n        document.addEventListener(\"pointerdown\", this.onPointer, true);\n        //  the chart can be redrawn into a new instance or unmounted while the panel is\n        //  open — it hangs off <body>, so nothing else would ever remove it\n        this.watchTimer = window.setInterval(() => {\n            if (!this.host.anchor.isConnected) this.close();\n        }, 400);\n    }\n\n    close() {\n        if (!this.root) return;\n        document.removeEventListener(\"keydown\", this.onKey);\n        document.removeEventListener(\"pointerdown\", this.onPointer, true);\n        if (this.watchTimer !== undefined) window.clearInterval(this.watchTimer);\n        this.watchTimer = undefined;\n        this.root.remove();\n        this.root = undefined;\n        this.syncers = [];\n        this.host.anchor.setAttribute(\"aria-expanded\", \"false\");\n        this.host.onClose();\n    }\n\n    /** Bring every control in line with the current settings (after a reset or an outside change). */\n    sync() {\n        const settings = this.host.get();\n        for (const syncer of this.syncers) syncer(settings);\n    }\n\n    /**\n     * Beside the chart when there is room — every change redraws it live, so it\n     * should stay in view: right of the toolbar, top edges aligned. Otherwise the\n     * panel hangs under its button, right edges aligned, inside the viewport.\n     */\n    private position() {\n        if (!this.root) return;\n        const button = this.host.anchor.getBoundingClientRect();\n        const toolbar = (this.host.anchor.parentElement ?? this.host.anchor).getBoundingClientRect();\n        const width = this.root.offsetWidth;\n        let left = toolbar.right + 16;\n        let top = toolbar.top;\n        if (left + width > window.innerWidth - 8) {\n            left = Math.max(8, Math.min(button.right - width, window.innerWidth - width - 8));\n            top = button.bottom + 6;\n            this.root.style.transformOrigin = \"top right\";\n        } else {\n            this.root.style.transformOrigin = \"top left\";\n        }\n        this.root.style.left = `${left + window.scrollX}px`;\n        this.root.style.top = `${top + window.scrollY}px`;\n    }\n\n    /** Edit a copy of the current settings and hand it to the chart. */\n    private update(mutate: (settings: MyD3DisplaySettings) => void) {\n        const next: MyD3DisplaySettings = JSON.parse(JSON.stringify(this.host.get()));\n        mutate(next);\n        this.host.set(next);\n        this.sync();\n    }\n\n    private section(parent: HTMLElement, title: string): HTMLElement {\n        const section = ElementBuilder.append(parent, \"div\", { class: \"myd3-settings-section\" }).el();\n        ElementBuilder.append(section, \"h6\").text(title);\n        return section;\n    }\n\n    /**\n     * A labelled checkbox bound to one boolean of the settings. `enabled` greys it\n     * out while another setting makes it meaningless.\n     */\n    private check(parent: HTMLElement, label: string,\n                  read: (s: MyD3DisplaySettings) => boolean,\n                  write: (s: MyD3DisplaySettings, value: boolean) => void,\n                  enabled: (s: MyD3DisplaySettings) => boolean = () => true): HTMLInputElement {\n        const wrap = ElementBuilder.append(parent, \"label\", { class: \"myd3-settings-check\" }).el();\n        const input = ElementBuilder.append(wrap, \"input\", { type: \"checkbox\" }).el() as HTMLInputElement;\n        ElementBuilder.append(wrap, \"span\").text(label);\n        input.onchange = () => this.update(s => write(s, input.checked));\n        this.syncers.push(s => {\n            input.checked = read(s);\n            input.disabled = !enabled(s);\n            wrap.classList.toggle(\"is-disabled\", input.disabled);\n        });\n        return input;\n    }\n\n    private buildAxisSection(body: HTMLElement) {\n        const t = this.host.t;\n        const section = this.section(body, t(\"trends.display.axes\", \"Axis labels\"));\n        const axes: Array<[\"x\" | \"y\", string | null, string]> = [\n            [\"x\", this.host.availability.axisX, t(\"trends.display.axisX\", \"X axis\")],\n            [\"y\", this.host.availability.axisY, t(\"trends.display.axisY\", \"Y axis\")],\n        ];\n        for (const [axis, fallback, label] of axes) {\n            if (fallback === null) continue;\n            const row = ElementBuilder.append(section, \"div\", { class: \"myd3-settings-axis\" }).el();\n            this.check(row, label, s => s.axisTitles[axis].show, (s, v) => { s.axisTitles[axis].show = v; });\n            const input = ElementBuilder.append(row, \"input\", {\n                type: \"text\",\n                maxlength: \"80\",\n                placeholder: fallback,\n                \"aria-label\": label\n            }).el() as HTMLInputElement;\n            //  empty = the chart's own title, shown as the placeholder\n            input.oninput = () => this.update(s => { s.axisTitles[axis].text = input.value; });\n            this.syncers.push(s => {\n                if (document.activeElement !== input) input.value = s.axisTitles[axis].text;\n                input.disabled = !s.axisTitles[axis].show;\n            });\n        }\n    }\n\n    /**\n     * A row of picture tiles to choose one of `values` from, with a line under it\n     * that describes the chosen one. `key` is the i18n group of their names and\n     * hints (`trends.display.<key>.<value>` / `…<value>Hint`).\n     */\n    private tiles<T extends string>(section: HTMLElement, label: string, key: string, values: T[],\n                                    thumbnails: Record<T, string>, fallback: Record<T, [string, string]>,\n                                    read: (s: MyD3DisplaySettings) => T,\n                                    write: (s: MyD3DisplaySettings, value: T) => void) {\n        const t = this.host.t;\n        const grid = ElementBuilder.append(section, \"div\", {\n            class: \"myd3-style-grid\",\n            role: \"radiogroup\",\n            \"aria-label\": label\n        }).el();\n        const tiles = new Map<T, HTMLElement>();\n        for (const value of values) {\n            const tile = ElementBuilder.append(grid, \"button\", {\n                type: \"button\",\n                class: \"myd3-style-tile\",\n                role: \"radio\",\n                \"data-value\": value\n            }).el();\n            tile.innerHTML = thumbnails[value];\n            ElementBuilder.append(tile, \"span\").text(t(`trends.display.${key}.${value}`, fallback[value][0]));\n            tile.onclick = () => this.update(s => write(s, value));\n            tiles.set(value, tile);\n        }\n        const hint = ElementBuilder.append(section, \"p\", { class: \"myd3-settings-hint\" }).el();\n        this.syncers.push(s => {\n            const current = read(s);\n            for (const [value, tile] of tiles) {\n                const active = current === value;\n                tile.classList.toggle(\"is-active\", active);\n                tile.setAttribute(\"aria-checked\", active ? \"true\" : \"false\");\n            }\n            hint.textContent = t(`trends.display.${key}.${current}Hint`, fallback[current][1]);\n        });\n    }\n\n    private buildStyleSection(body: HTMLElement) {\n        const t = this.host.t;\n        const title = t(\"trends.display.series\", \"Several series\");\n        const section = this.section(body, title);\n        this.tiles(section, title, \"style\", MULTI_SERIES_STYLES, THUMBNAILS, STYLE_FALLBACK,\n            s => s.multi.style, (s, v) => { s.multi.style = v; });\n\n        this.check(section, t(\"trends.display.legend\", \"Legend\"),\n            s => s.multi.legend, (s, v) => { s.multi.legend = v; },\n            //  the rows are labelled directly — there is no legend to switch\n            s => s.multi.style !== \"rows\");\n        this.check(section, t(\"trends.display.yearTicks\", \"Tick mark for every year\"),\n            s => s.multi.yearTicks, (s, v) => { s.multi.yearTicks = v; });\n        this.check(section, t(\"trends.display.yearGuides\", \"Year guides\"),\n            s => s.multi.yearGuides, (s, v) => { s.multi.yearGuides = v; });\n    }\n\n    private buildHoverSection(body: HTMLElement) {\n        const t = this.host.t;\n        const section = this.section(body, t(\"trends.display.hover\", \"Hovered year\"));\n        if (this.host.availability.yearFlag) {\n            this.check(section, t(\"trends.display.yearFlag\", \"Year on the axis\"),\n                s => s.hover.yearFlag, (s, v) => { s.hover.yearFlag = v; });\n        }\n        if (this.host.availability.yearBackground) {\n            this.check(section, t(\"trends.display.yearBackground\", \"Highlight the year\"),\n                s => s.hover.yearBackground, (s, v) => { s.hover.yearBackground = v; });\n        }\n    }\n\n    private buildTooltipSection(body: HTMLElement) {\n        const title = this.host.t(\"trends.display.tooltip\", \"Tooltip\");\n        const section = this.section(body, title);\n        section.classList.add(\"myd3-settings-tooltip\");\n        this.tiles(section, title, \"tooltipStyle\", TOOLTIP_STYLES, TOOLTIP_THUMBNAILS, TOOLTIP_FALLBACK,\n            s => s.tooltip.style, (s, v) => { s.tooltip.style = v; });\n    }\n\n    private buildOffsetSection(body: HTMLElement) {\n        const t = this.host.t;\n        const section = this.section(body, t(\"trends.display.offsets\", \"Offsets\"));\n        const usesOffsets = (s: MyD3DisplaySettings) => OFFSET_STYLES.includes(s.multi.style);\n        const active = (s: MyD3DisplaySettings) => usesOffsets(s) && s.multi.offset.enabled;\n\n        this.check(section, t(\"trends.display.offsetEnabled\", \"Draw the year effects side by side\"),\n            s => s.multi.offset.enabled, (s, v) => { s.multi.offset.enabled = v; }, usesOffsets);\n\n        const sub = ElementBuilder.append(section, \"div\", { class: \"myd3-settings-sub\" }).el();\n        const nums = ElementBuilder.append(sub, \"div\", { class: \"myd3-settings-nums\" }).el();\n        const uid = `myd3ds${SettingsPanel.seq++}`;\n        const number = (key: \"start\" | \"step\", label: string, placeholder = \"\") => {\n            const cell = ElementBuilder.append(nums, \"div\").el();\n            const limits = OFFSET_LIMITS[key];\n            ElementBuilder.append(cell, \"label\", { for: `${uid}-${key}` }).text(label);\n            const input = ElementBuilder.append(cell, \"input\", {\n                type: \"number\",\n                id: `${uid}-${key}`,\n                min: `${limits.min}`,\n                max: `${limits.max}`,\n                step: `${limits.step}`,\n                placeholder\n            }).el() as HTMLInputElement;\n            input.oninput = () => {\n                const raw = input.value.trim();\n                //  only the start may be empty (= centred on the year)\n                if (raw === \"\" && key !== \"start\") return;\n                if (raw !== \"\" && !Number.isFinite(Number(raw))) return;\n                this.update(s => {\n                    if (key === \"start\") s.multi.offset.start = raw === \"\" ? null : Number(raw);\n                    else s.multi.offset[key] = Number(raw);\n                });\n            };\n            //  leaving the field shows what was actually applied (clamped, or the old value)\n            input.onblur = () => this.sync();\n            this.syncers.push(s => {\n                const value = s.multi.offset[key];\n                if (document.activeElement !== input) input.value = value === null ? \"\" : `${value}`;\n                input.disabled = !active(s);\n            });\n        };\n        const years = t(\"trends.display.unitYears\", \"years\");\n        number(\"start\", `${t(\"trends.display.offsetStart\", \"Start\")} (${years})`, t(\"trends.display.auto\", \"auto\"));\n        number(\"step\", `${t(\"trends.display.offsetStep\", \"Step\")} (${years})`);\n\n        this.check(sub, t(\"trends.display.followBand\", \"Confidence band moves along\"),\n            s => s.multi.offset.followBand, (s, v) => { s.multi.offset.followBand = v; }, active);\n        this.check(sub, t(\"trends.display.followLine\", \"Trend line moves along\"),\n            s => s.multi.offset.followLine, (s, v) => { s.multi.offset.followLine = v; }, active);\n\n        const note = ElementBuilder.append(section, \"p\", { class: \"myd3-settings-hint\" }).el();\n        note.style.minHeight = \"0\";\n        this.syncers.push(s => {\n            note.textContent = usesOffsets(s) ? \"\" : t(\"trends.display.offsetNotUsed\",\n                \"This style keeps every series on its exact year, so there is nothing to offset.\");\n            note.style.display = usesOffsets(s) ? \"none\" : \"\";\n        });\n    }\n\n    /** ids of the number inputs must be unique across every chart on the page */\n    private static seq = 0;\n\n    private static ensureStyle() {\n        if (document.getElementById(STYLE_ID)) return;\n        const style = document.createElement(\"style\");\n        style.id = STYLE_ID;\n        style.textContent = CSS;\n        document.head.appendChild(style);\n    }\n}\n\nexport { SettingsPanel };\nexport type { SettingsAvailability, SettingsPanelHost };\n","import * as d3 from \"d3\";\nimport { ElementBuilder } from \"../dom/ElementBuilder\";\nimport type { MyD3ZoomOptions } from \"../types\";\n\ninterface ViewWindow {\n    xMin: number;\n    xMax: number;\n}\n\ninterface ZoomAttachContext {\n    /** d3 selection of the root <svg>. */\n    svgRoot: any;\n    /** DOM node of the margin-translated <g> — the plot-area coordinate origin. */\n    gNode: SVGGElement;\n    /** d3 selection of a topmost overlay <g> (pointer-events: none) for the selection band. */\n    overlay: any;\n    /** Plot area size in px. */\n    width: number;\n    height: number;\n    /** The linear x scale of the current draw (must have .invert). */\n    xScale: any;\n}\n\n/** Smallest allowed view span, as a fraction of the full extent. */\nconst MIN_SPAN_DIVISOR = 50;\n/** Drags shorter than this many px count as clicks and are ignored. */\nconst MIN_DRAG_PX = 5;\n/** Wheel zoom factor per scroll notch (deltaY of 100). */\nconst WHEEL_FACTOR = 1.25;\n\n//  Bootstrap Icons (search / arrows-move / arrow-counterclockwise), inlined so the\n//  library does not depend on the Django-served sprite.\nconst ICONS: Record<string, string> = {\n    zoom: '<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" height=\"16\" fill=\"currentColor\" viewBox=\"0 0 16 16\"><path d=\"M11.742 10.344a6.5 6.5 0 1 0-1.397 1.398h-.001q.044.06.098.115l3.85 3.85a1 1 0 0 0 1.415-1.414l-3.85-3.85a1 1 0 0 0-.115-.1zM12 6.5a5.5 5.5 0 1 1-11 0 5.5 5.5 0 0 1 11 0\"/></svg>',\n    pan: '<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" height=\"16\" fill=\"currentColor\" viewBox=\"0 0 16 16\"><path fill-rule=\"evenodd\" d=\"M7.646.146a.5.5 0 0 1 .708 0l2 2a.5.5 0 0 1-.708.708L8.5 1.707V5.5a.5.5 0 0 1-1 0V1.707L6.354 2.854a.5.5 0 1 1-.708-.708zM8 10a.5.5 0 0 1 .5.5v3.793l1.146-1.147a.5.5 0 0 1 .708.708l-2 2a.5.5 0 0 1-.708 0l-2-2a.5.5 0 0 1 .708-.708L7.5 14.293V10.5A.5.5 0 0 1 8 10M.146 8.354a.5.5 0 0 1 0-.708l2-2a.5.5 0 1 1 .708.708L1.707 7.5H5.5a.5.5 0 0 1 0 1H1.707l1.147 1.146a.5.5 0 0 1-.708.708zM10 8a.5.5 0 0 1 .5-.5h3.793l-1.147-1.146a.5.5 0 0 1 .708-.708l2 2a.5.5 0 0 1 0 .708l-2 2a.5.5 0 0 1-.708-.708L14.293 8.5H10.5A.5.5 0 0 1 10 8\"/></svg>',\n    reset: '<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" height=\"16\" fill=\"currentColor\" viewBox=\"0 0 16 16\"><path fill-rule=\"evenodd\" d=\"M8 3a5 5 0 1 1-4.546 2.914.5.5 0 0 0-.908-.417A6 6 0 1 0 8 2z\"/><path d=\"M8 4.466V.534a.25.25 0 0 0-.41-.192L5.23 2.308a.25.25 0 0 0 0 .384l2.36 1.966A.25.25 0 0 0 8 4.466\"/></svg>'\n};\n\n//  English fallbacks for MyD3 consumers constructed without a translate fn.\nconst LABEL_FALLBACKS: Record<string, string> = {\n    \"trends.zoom.zoomMode\": \"Zoom mode: drag to select a time range\",\n    \"trends.zoom.panMode\": \"Pan mode: drag to move the visible range\",\n    \"trends.zoom.reset\": \"Reset zoom\"\n};\n\n/**\n * Owns the zoom/pan state of one MyD3 chart: the current view window, the\n * interaction mode, all event wiring and the toolbar controls. The controller\n * survives redraws (MyD3 keeps it like the toolbar container); `attach` is\n * re-called after every draw with the fresh SVG.\n */\nclass ZoomController {\n    mode: \"zoom\" | \"pan\";\n    view: ViewWindow | null = null;\n\n    private readonly full: ViewWindow;\n    private readonly opts: MyD3ZoomOptions;\n    private readonly requestRedraw: () => void;\n    private readonly translate?: (key: string, params?: any) => string;\n\n    private ctx?: ZoomAttachContext;\n    private rafPending = false;\n    private panDragActive = false;\n    private controlsBuilt = false;\n    private zoomBtn?: HTMLButtonElement;\n    private panBtn?: HTMLButtonElement;\n    private resetBtn?: HTMLButtonElement;\n\n    constructor(\n        fullExtent: ViewWindow,\n        opts: MyD3ZoomOptions,\n        requestRedraw: () => void,\n        translate?: (key: string, params?: any) => string\n    ) {\n        this.full = { ...fullExtent };\n        this.opts = opts;\n        this.requestRedraw = requestRedraw;\n        this.translate = translate;\n        //  pan is the default: dragging moves the visible range, which is what users\n        //  expect from a chart; zoom-by-selection is opt-in via the toolbar\n        this.mode = this.panEnabled() ? \"pan\" : \"zoom\";\n    }\n\n    /** Merge precedence: component customOptions > backend plot settings > defaults (all on). */\n    static resolveOptions(backend?: MyD3ZoomOptions, custom?: MyD3ZoomOptions): MyD3ZoomOptions {\n        return { enabled: true, wheel: true, drag: true, pan: true, ...(backend || {}), ...(custom || {}) };\n    }\n\n    //  ---- window math ----\n\n    static clampWindow(win: ViewWindow, full: ViewWindow, minSpan: number): ViewWindow {\n        const fullSpan = full.xMax - full.xMin;\n        let span = Math.max(minSpan, win.xMax - win.xMin);\n        span = Math.min(span, fullSpan);\n        //  if the span was grown to minSpan, keep the window centered where it was\n        let xMin = win.xMin;\n        if (win.xMax - win.xMin < span) {\n            xMin = (win.xMin + win.xMax) / 2 - span / 2;\n        }\n        xMin = Math.max(full.xMin, Math.min(xMin, full.xMax - span));\n        return { xMin, xMax: xMin + span };\n    }\n\n    private minSpan(): number {\n        return (this.full.xMax - this.full.xMin) / MIN_SPAN_DIVISOR;\n    }\n\n    /** Zoom by `factor` keeping the domain value `cx` fixed. factor > 1 zooms in. */\n    zoomAt(cx: number, factor: number) {\n        const cur = this.view ?? this.full;\n        const span = (cur.xMax - cur.xMin) / factor;\n        if (span >= this.full.xMax - this.full.xMin) {\n            //  zoomed all the way out: snap back to the full extent\n            this.setView(null);\n            return;\n        }\n        const rel = (cx - cur.xMin) / (cur.xMax - cur.xMin);\n        const xMin = cx - rel * span;\n        this.setView(ZoomController.clampWindow({ xMin, xMax: xMin + span }, this.full, this.minSpan()));\n    }\n\n    /** Zoom into the [x0, x1] domain range (any order). */\n    zoomTo(x0: number, x1: number) {\n        //  a degenerate full extent (xMin === xMax, e.g. a single-x-value chart) has\n        //  no meaningful span to clamp into — clampWindow would divide a zero minSpan\n        //  and produce a zero-width, stuck view.\n        if (this.full.xMax <= this.full.xMin) return;\n        this.setView(ZoomController.clampWindow(\n            { xMin: Math.min(x0, x1), xMax: Math.max(x0, x1) }, this.full, this.minSpan()));\n    }\n\n    /** Shift `startView` by a domain-space delta, clamped to the full extent. */\n    panTo(startView: ViewWindow, domainDx: number) {\n        if (this.full.xMax <= this.full.xMin) return;\n        const span = startView.xMax - startView.xMin;\n        const xMin = Math.max(this.full.xMin, Math.min(startView.xMin + domainDx, this.full.xMax - span));\n        this.setView({ xMin, xMax: xMin + span });\n    }\n\n    reset() {\n        this.setView(null);\n    }\n\n    private setView(view: ViewWindow | null) {\n        this.view = view;\n        this.updateControls();\n        //  panning becomes available (or stops being) with the first/last zoom step\n        this.applyCursor(this.panDragActive);\n        this.scheduleRedraw();\n    }\n\n    private scheduleRedraw() {\n        if (this.rafPending) return;\n        this.rafPending = true;\n        requestAnimationFrame(() => {\n            this.rafPending = false;\n            this.requestRedraw();\n        });\n    }\n\n    //  ---- event wiring (re-called on every draw with the fresh SVG) ----\n\n    attach(ctx: ZoomAttachContext) {\n        this.ctx = ctx;\n        const svgNode = ctx.svgRoot.node() as SVGSVGElement;\n        if (this.opts.wheel !== false) {\n            svgNode.addEventListener(\"wheel\", (e: WheelEvent) => this.onWheel(e), { passive: false });\n        }\n        if (this.dragEnabled() || this.panEnabled()) {\n            svgNode.addEventListener(\"mousedown\", (e: MouseEvent) => this.onMouseDown(e));\n        }\n        svgNode.addEventListener(\"dblclick\", () => this.reset());\n        //  a redraw can land mid-pan-drag; keep the drag visuals consistent on the fresh SVG\n        if (this.panDragActive) ctx.svgRoot.style(\"pointer-events\", \"none\");\n        this.applyCursor(this.panDragActive);\n    }\n\n    private dragEnabled(): boolean {\n        return this.opts.drag !== false;\n    }\n\n    private panEnabled(): boolean {\n        return this.opts.pan !== false;\n    }\n\n    /**\n     * Panning needs something to pan into view — at the full extent there is\n     * nothing off-screen, so dragging falls back to zoom-by-selection.\n     */\n    private canPan(): boolean {\n        return this.panEnabled() && this.view !== null;\n    }\n\n    /** The effective mode: forced when only one drag interaction is possible. */\n    activeMode(): \"zoom\" | \"pan\" {\n        if (!this.canPan()) return \"zoom\";\n        if (!this.dragEnabled()) return \"pan\";\n        return this.mode;\n    }\n\n    private applyCursor(dragging: boolean) {\n        if (!this.ctx) return;\n        const mode = this.activeMode();\n        let cursor = \"default\";\n        if (mode === \"pan\") {\n            cursor = dragging ? \"grabbing\" : \"grab\";\n        }\n        else if (this.dragEnabled()) {\n            cursor = \"crosshair\";\n        }\n        this.ctx.svgRoot.style(\"cursor\", cursor);\n    }\n\n    /** Pointer x in plot-area px (handles the viewBox scaling via getScreenCTM). */\n    private pointerX(e: MouseEvent): number {\n        return d3.pointer(e, this.ctx!.gNode)[0];\n    }\n\n    private onWheel(e: WheelEvent) {\n        if (!this.ctx) return;\n        e.preventDefault();\n        const px = Math.max(0, Math.min(this.ctx.width, this.pointerX(e)));\n        const factor = Math.pow(WHEEL_FACTOR, -e.deltaY / 100);\n        this.zoomAt(this.ctx.xScale.invert(px), factor);\n    }\n\n    private onMouseDown(e: MouseEvent) {\n        if (e.button !== 0 || !this.ctx) return;\n        if (this.activeMode() === \"zoom\" && this.dragEnabled()) {\n            this.startSelection(e);\n        } else if (this.activeMode() === \"pan\") {\n            this.startPan(e);\n        }\n    }\n\n    private startSelection(e: MouseEvent) {\n        const ctx = this.ctx!;\n        e.preventDefault();\n        const startPx = Math.max(0, Math.min(ctx.width, this.pointerX(e)));\n        let lastPx = startPx;\n        const band = ctx.overlay.append(\"rect\")\n            .attr(\"y\", 0)\n            .attr(\"height\", ctx.height)\n            .attr(\"x\", startPx)\n            .attr(\"width\", 0)\n            .attr(\"fill\", \"rgba(100,116,139,0.15)\")\n            .attr(\"stroke\", \"#64748b\")\n            .attr(\"stroke-dasharray\", \"4,3\");\n        //  freeze the crosshair/tooltip underneath while selecting\n        ctx.svgRoot.style(\"pointer-events\", \"none\");\n        const onMove = (ev: MouseEvent) => {\n            lastPx = Math.max(0, Math.min(ctx.width, this.pointerX(ev)));\n            band.attr(\"x\", Math.min(startPx, lastPx)).attr(\"width\", Math.abs(lastPx - startPx));\n        };\n        const onUp = () => {\n            window.removeEventListener(\"mousemove\", onMove);\n            window.removeEventListener(\"mouseup\", onUp);\n            ctx.svgRoot.style(\"pointer-events\", null);\n            band.remove();\n            if (Math.abs(lastPx - startPx) >= MIN_DRAG_PX) {\n                this.zoomTo(ctx.xScale.invert(startPx), ctx.xScale.invert(lastPx));\n            }\n        };\n        window.addEventListener(\"mousemove\", onMove);\n        window.addEventListener(\"mouseup\", onUp);\n    }\n\n    private startPan(e: MouseEvent) {\n        const ctx = this.ctx!;\n        e.preventDefault();\n        const startPx = this.pointerX(e);\n        //  anchor in domain space: the value under the cursor at drag start. Each\n        //  mousemove re-derives the window so this same domain value tracks the\n        //  cursor, instead of a fixed span-per-px measured against the draw-time\n        //  gNode — margin.left is recomputed every redraw from y tick-label widths,\n        //  which shift while panning a count chart (y auto-fit), so a fixed px→domain\n        //  factor drifts. This is self-correcting: it reads the CURRENT view window\n        //  and CURRENT ctx.width on every move.\n        const anchorDomain = ctx.xScale.invert(startPx);\n        this.panDragActive = true;\n        ctx.svgRoot.style(\"pointer-events\", \"none\");\n        this.applyCursor(true);\n        const onMove = (ev: MouseEvent) => {\n            if (!this.ctx) return;\n            const px = this.pointerX(ev);\n            const cur = this.view ?? this.full;\n            const domainUnderCursorNow = cur.xMin + (px / this.ctx.width) * (cur.xMax - cur.xMin);\n            //  shift the current window (constant span, clamped) so anchorDomain\n            //  lands back under the cursor\n            this.panTo(cur, anchorDomain - domainUnderCursorNow);\n        };\n        const onUp = () => {\n            window.removeEventListener(\"mousemove\", onMove);\n            window.removeEventListener(\"mouseup\", onUp);\n            this.panDragActive = false;\n            //  this.ctx (not the captured ctx): redraws during the pan replaced the SVG\n            if (this.ctx) {\n                this.ctx.svgRoot.style(\"pointer-events\", null);\n            }\n            this.applyCursor(false);\n        };\n        window.addEventListener(\"mousemove\", onMove);\n        window.addEventListener(\"mouseup\", onUp);\n    }\n\n    //  ---- toolbar controls ----\n\n    private t(key: string): string {\n        const fallback = LABEL_FALLBACKS[key] || key;\n        if (!this.translate) return fallback;\n        const s = this.translate(key);\n        //  vue-i18n returns the key itself for missing translations\n        return s && s !== key ? s : fallback;\n    }\n\n    /** Build the button group once (into the MyD3 toolbar container), then keep it updated. */\n    ensureControls(toolbar: HTMLElement) {\n        if (this.controlsBuilt) {\n            this.updateControls();\n            return;\n        }\n        this.controlsBuilt = true;\n        const group = ElementBuilder.create(\"div\", { class: \"btn-group me-1\" }).el();\n        const mkButton = (icon: string, labelKey: string, onClick: () => void): HTMLButtonElement => {\n            const btn = ElementBuilder.append(group, \"button\", {\n                type: \"button\",\n                class: \"btn btn-sm btn-outline-secondary\",\n                title: this.t(labelKey)\n            }).el() as HTMLButtonElement;\n            btn.innerHTML = icon;\n            btn.onclick = onClick;\n            return btn;\n        };\n        if (this.dragEnabled() && this.panEnabled()) {\n            this.panBtn = mkButton(ICONS.pan, \"trends.zoom.panMode\", () => {\n                this.mode = \"pan\";\n                this.updateControls();\n                this.applyCursor(false);\n            });\n            this.zoomBtn = mkButton(ICONS.zoom, \"trends.zoom.zoomMode\", () => {\n                this.mode = \"zoom\";\n                this.updateControls();\n                this.applyCursor(false);\n            });\n        }\n        this.resetBtn = mkButton(ICONS.reset, \"trends.zoom.reset\", () => this.reset());\n        toolbar.insertBefore(group, toolbar.firstChild);\n        this.updateControls();\n    }\n\n    private updateControls() {\n        const setActive = (btn: HTMLButtonElement | undefined, active: boolean) => {\n            if (!btn) return;\n            btn.className = active ? \"btn btn-sm btn-secondary\" : \"btn btn-sm btn-outline-secondary\";\n        };\n        const mode = this.activeMode();\n        setActive(this.zoomBtn, mode === \"zoom\");\n        setActive(this.panBtn, mode === \"pan\");\n        //  nothing to pan while the whole extent is visible\n        if (this.panBtn) this.panBtn.disabled = !this.canPan();\n        if (this.resetBtn) this.resetBtn.style.display = this.view ? \"\" : \"none\";\n    }\n}\n\nexport { ZoomController };\nexport type { ViewWindow, ZoomAttachContext };\n","import * as d3 from \"d3\";\nimport { ElementBuilder } from \"./dom/ElementBuilder\";\nimport { HoverTooltip } from \"./tooltip/HoverTooltip\";\nimport type { HoverAnchor } from \"./tooltip/HoverTooltip\";\nimport { buildTrendTooltipModel, renderBubble, renderCard, renderDocked, renderTags } from \"./tooltip/TrendTooltip\";\nimport type { Trace } from \"./core/PlotModel\";\nimport { MyPlotVisuals, Plot } from \"./core/PlotModel\";\nimport type { MyD3DisplaySettings } from \"./core/DisplaySettings\";\nimport { classicDisplaySettings, resolveDisplaySettings } from \"./core/DisplaySettings\";\nimport { MultiSeriesContext } from \"./core/MultiSeries\";\nimport type { Series } from \"./core/Series\";\nimport { RTE_KEYS } from \"./core/Series\";\nimport type { TraceHandler } from \"./handlers/TraceHandler\";\nimport { getTraceHandlers } from \"./handlers/TraceHandler\";\nimport { SettingsPanel } from \"./interaction/SettingsPanel\";\nimport type { SettingsAvailability } from \"./interaction/SettingsPanel\";\nimport { ZoomController } from \"./interaction/ZoomController\";\nimport { nestedBarFraction, rteMarker } from \"./renderables\";\nimport {\n    createSegmentsBySignificance as buildSignificanceSegments,\n    stripShortSignificantSegments as collapseShortSegments\n} from \"./utils/significance\";\nimport type {\n    TooltipContext,\n    TooltipTraceData,\n    MyD3CustomOptions,\n    MyD3ZoomOptions,\n    SignificanceSegment,\n    RenderContext,\n    PlotData,\n    PlotPanel\n} from \"./types\";\n\n/** Ink of the chart chrome added by the display settings (titles, legend, guides). */\nconst INK = \"#334155\";\nconst INK_MUTED = \"#64748b\";\nconst ACCENT = \"#2563eb\";\n\ninterface LegendItem {\n    series: Series;\n    x: number;\n    row: number;\n}\n\ninterface LegendLayout {\n    items: LegendItem[];\n    fontSize: number;\n    rowHeight: number;\n    height: number;\n}\n\nlet measureContext: CanvasRenderingContext2D | null | undefined;\n\n/** Width of `text` in px at the given size, in the sans-serif the chart chrome uses. */\nfunction measureText(text: string, fontSize: number, weight = 400): number {\n    if (measureContext === undefined) {\n        measureContext = typeof document === \"undefined\" ? null : document.createElement(\"canvas\").getContext(\"2d\");\n    }\n    if (!measureContext) return text.length * fontSize * 0.6;\n    measureContext.font = `${weight} ${fontSize}px sans-serif`;\n    return measureContext.measureText(text).width;\n}\n\n/**\n * Containers waiting to be redrawn once they have a usable size, keyed by container.\n * At most one entry per element: a later draw into the same container supersedes the\n * earlier one, so a superseded instance can never repaint stale data over fresh.\n */\nconst pendingResizeRedraws = new WeakMap<HTMLElement, ResizeObserver>();\n\nfunction cancelResizeRedraw(elm: HTMLElement | undefined | null) {\n    if (!elm) return;\n    const observer = pendingResizeRedraws.get(elm);\n    if (!observer) return;\n    observer.disconnect();\n    pendingResizeRedraws.delete(elm);\n}\n\nclass MyD3 {\n    private _plotElementId?: string;\n    private _plotElement?: HTMLElement;\n    private readonly handlers: TraceHandler[];\n    customOptions?: MyD3CustomOptions;\n    visuals: MyPlotVisuals = new MyPlotVisuals();\n    data: any;\n    vueTranslation: any;\n    message: any;\n    preparedPlot: Plot;\n    svg: any;\n    axisX: any;\n    axisY: any;\n\n    toolbarContainer: any;\n    /** The download dialog, mounted on <body> while open (null otherwise). */\n    popupContainer: any;\n    popupBackdrop: any;\n    private popupKeyHandler?: (e: KeyboardEvent) => void;\n    private popupWatchTimer?: number;\n    zoomController?: ZoomController;\n    /**\n     * The display settings in effect (axis titles, multi-series style). The classic\n     * rendering unless the chart opted in through customOptions.displaySettings.\n     */\n    display: MyD3DisplaySettings = classicDisplaySettings();\n    /** Lanes and offsets of the series of this chart (all zero for a single series). */\n    readonly multi = new MultiSeriesContext(this);\n    /** The panels of the current draw: one, or one per series in the \"rows\" style. */\n    panels: PlotPanel[] = [];\n    private settingsPanel?: SettingsPanel;\n    private settingsButton?: HTMLButtonElement;\n    private settingsRedrawPending = false;\n    /** The read-out of the hovered year of the on-screen chart (mounted on <body> while shown). */\n    private hoverTooltip?: HoverTooltip;\n    /** The on-screen chart names its series itself (legend, or the labels of the \"rows\" style). */\n    private seriesNamed = false;\n    /** Legend keys as inline SVG for the tooltip, per series — valid for one draw. */\n    private readonly seriesKeyHtml = new Map<string, string>();\n    /** Hover crosshair lines: opt-in, the markers alone carry the read-out by default. */\n    crosshairEnabled = false;\n    private crosshairParts: any[] = [];\n    private zoomOptions: MyD3ZoomOptions = {};\n    /** clipPath ids are document-global; sequence them per draw so charts don't collide. */\n    private static clipSeq = 0;\n    /** form-control ids must be unique across every chart on the page. */\n    private static dlSeq = 0;\n    dlWidth = 1024;\n    dlHeight = 768;\n    dlFontSizeMul = 1.0;\n    dlStrokeWidth = 3.0;\n    dlStrokeWidthMul = 1.0;\n    dlTitle = \"\";\n    dlSubtitle = \"\";\n\n    public static getPreparedPlot(data: PlotData, handlers: TraceHandler[] = getTraceHandlers()): Plot {\n        const prepared = new Plot();\n        prepared.prepare(data, handlers);\n        return prepared;\n    }\n\n    public static createSegmentsBySignificance(trace: Trace, myD3?: MyD3): SignificanceSegment[] {\n        return buildSignificanceSegments(trace, myD3);\n    }\n\n    public static stripShortSignificantSegments(segments: SignificanceSegment[], trace: Trace): SignificanceSegment[] {\n        return collapseShortSegments(segments, trace);\n    }\n\n    constructor(\n        plotIdOrElement: string | HTMLElement,\n        data: PlotData,\n        customOptionsOrTranslate?: MyD3CustomOptions | ((key: string, params?: any) => string),\n        vueTranslation?: any,\n        handlers: TraceHandler[] = getTraceHandlers()\n    ) {\n        if (typeof plotIdOrElement === \"string\") {\n            this._plotElementId = plotIdOrElement;\n        } else {\n            this._plotElement = plotIdOrElement;\n        }\n\n        this.handlers = handlers;\n        this.data = data;\n\n        if (typeof customOptionsOrTranslate === \"function\") {\n            this.customOptions = {};\n            this.vueTranslation = customOptionsOrTranslate;\n        } else {\n            this.customOptions = customOptionsOrTranslate;\n            this.vueTranslation = vueTranslation;\n        }\n        this.customOptions = this.customOptions || {};\n        if (this.customOptions.displaySettings !== undefined) {\n            this.display = resolveDisplaySettings(this.customOptions.displaySettings);\n        }\n\n        this.preparedPlot = MyD3.getPreparedPlot(data, this.handlers);\n        this.preparedPlot.prepareBounds(this);\n\n        //  merge zoom config: component customOptions > backend plot-level settings > defaults\n        this.zoomOptions = ZoomController.resolveOptions((data as any)?.settings?.zoom, this.customOptions?.zoom);\n    }\n\n    private get plotElement(): HTMLElement {\n        if (this._plotElement) return this._plotElement;\n        if (this._plotElementId) return document.getElementById(this._plotElementId) as HTMLElement;\n        throw new Error(\"Plot element not found. Please provide a valid plotId or plotElement.\");\n    }\n\n    /**\n     * Axis tick font size in px. Explicit customOptions.axisFontSize wins; otherwise the\n     * height-proportional base is clamped to a readable range (categorical labels tighter,\n     * since they sit next to dense bands).\n     */\n    private axisTickFontSize(baseFontSize: number, axisType: 'linear' | 'categorical'): number {\n        const explicit = this.customOptions?.axisFontSize;\n        if (explicit) return explicit * this.dlFontSizeMul;\n        const max = axisType === 'categorical' ? 13 : 16;\n        return Math.max(10, Math.min(max, baseFontSize));\n    }\n\n    /**\n     * Layout for categorical X tick labels: rotation angle plus a thinning step so only\n     * every step-th label is rendered when they cannot all fit. Short labels (years, codes)\n     * prefer sparse horizontal ticks over rotation.\n     */\n    private resolveCategoricalXLayout(labels: string[], availableSpace: number, fontSize: number): { rotation: number; step: number } {\n        if (labels.length === 0 || availableSpace <= 0) return { rotation: 0, step: 1 };\n\n        const avgCharWidth = fontSize * 0.6;\n        const maxLabelWidth = Math.max(...labels.map(label => label.length)) * avgCharWidth;\n        const spacePerLabel = availableSpace / labels.length;\n\n        let rotation: number;\n        const explicit = this.customOptions?.labelsRotationAngle;\n        if (explicit !== undefined) {\n            rotation = explicit;\n        } else if (maxLabelWidth <= spacePerLabel * 0.9 || maxLabelWidth <= 6 * avgCharWidth) {\n            rotation = 0;\n        } else if (maxLabelWidth <= spacePerLabel * 1.5) {\n            rotation = -45;\n        } else {\n            rotation = -90;\n        }\n\n        // Horizontal footprint of one rendered label (rotated labels stack almost vertically).\n        const perLabel = rotation === 0 ? maxLabelWidth + avgCharWidth : fontSize * 1.6;\n        const step = Math.max(1, Math.ceil(perLabel / spacePerLabel));\n        return { rotation, step };\n    }\n\n    /**\n     * Apply rotation and proper alignment to axis labels\n     * @param textSelection D3 selection of text elements\n     * @param angle Rotation angle in degrees\n     * @param axis 'x' or 'y' axis\n     * @param fontSize Font size in pixels\n     */\n    private applyLabelRotation(textSelection: any, angle: number, axis: 'x' | 'y', fontSize: number): void {\n        if (angle === 0) {\n            // No rotation - use default alignment\n            if (axis === 'x') {\n                textSelection.style(\"text-anchor\", \"middle\");\n            }\n            return;\n        }\n\n        if (axis === 'x') {\n            // X-axis label rotation\n            textSelection\n                .style(\"text-anchor\", angle < 0 ? \"end\" : \"start\")\n                .attr(\"dx\", angle < 0 ? \"-0.5em\" : \"0.5em\")\n                .attr(\"dy\", \"0.15em\")\n                .attr(\"transform\", `rotate(${angle})`);\n        } else {\n            // Y-axis label rotation\n            textSelection\n                .style(\"text-anchor\", angle === 0 ? \"end\" : \"middle\")\n                .attr(\"dx\", angle === 0 ? \"-0.5em\" : \"0\")\n                .attr(\"dy\", angle === 0 ? \"0.35em\" : \"0.35em\")\n                .attr(\"transform\", `rotate(${angle})`);\n        }\n    }\n\n    private calcTextSize(preparedData: Plot, fontSize: number): { width: number, height: number } {\n        //  hidden rendering to estimate the text size\n        // When the Y labels are hidden they take no space, so don't measure them.\n        if (this.shouldHideYAxisLabels()) {\n            return { width: 0, height: Math.round(fontSize * 1.2) };\n        }\n\n        // Calculate the maximum width needed for y-axis labels by checking both min and max values\n        const yValues = [preparedData.yMin, preparedData.yMax];\n\n        // Also check some intermediate values to ensure we account for labels that might be wider\n        const range = preparedData.yMax - preparedData.yMin;\n        const step = range / 4;\n        for (let i = 1; i < 4; i++) {\n            yValues.push(preparedData.yMin + (step * i));\n        }\n\n        let maxWidth = 0;\n        let maxHeight = 0;\n\n        const hiddenSVG = d3.select(\"body\")\n            .append(\"svg\")\n            .style(\"position\", \"absolute\")\n            .style(\"left\", \"-9999px\")\n            .style(\"top\", \"-9999px\");\n\n        const measure = (str: string, size: number) => {\n            const text = hiddenSVG.append(\"text\").style(\"font-size\", `${size}px`).text(str);\n            const bbox = text.node()?.getBBox() || new DOMRect();\n            maxWidth = Math.max(maxWidth, bbox.width);\n            maxHeight = Math.max(maxHeight, bbox.height);\n            text.remove();\n        };\n\n        if (preparedData.axisYType === 'categorical') {\n            const size = this.axisTickFontSize(fontSize, 'categorical');\n            for (const label of preparedData.categoricalYLabels) measure(label, size);\n        } else {\n            const size = this.axisTickFontSize(fontSize, 'linear');\n            for (const value of yValues) measure(value.toFixed(2), size);\n        }\n\n        hiddenSVG.remove(); // Clean up the temporary SVG\n\n        return { width: Math.round(maxWidth), height: Math.round(maxHeight) };\n    }\n\n    /**\n     * Final linear y-domain for a data extent. The domain is widened to contain\n     * every `yIncludeValues` entry (default [0, 2] — the classic trend-index\n     * frame), then `yPadTopRatio` of the span is added above a data-driven\n     * maximum. Shared by the full-plot bounds (Plot.prepareBounds) and the zoom\n     * window (computeViewYBounds) so both honour the same conventions.\n     */\n    resolveYBounds(dataMin: number, dataMax: number): { yMin: number; yMax: number } {\n        const include = this.customOptions?.yIncludeValues ?? [0.0, 2.0];\n        const yMin = Math.min(dataMin, ...include);\n        let yMax = Math.max(dataMax, ...include);\n        const pad = this.customOptions?.yPadTopRatio ?? 0;\n        if (pad > 0 && yMax === dataMax && yMax > yMin) {\n            yMax += (yMax - yMin) * pad;\n        }\n        return { yMin, yMax };\n    }\n\n    /**\n     * Y bounds of the data visible inside the zoom window (value + CI columns),\n     * with the same domain rules as Plot.prepareBounds so the axis keeps its\n     * conventions. Falls back to the full bounds when the window holds no data.\n     */\n    private computeViewYBounds(view: { xMin: number; xMax: number }, traces?: Iterable<Trace> | null): { yMin: number; yMax: number } {\n        let lo = Infinity, hi = -Infinity;\n        for (const trace of traces ?? this.preparedPlot.traces) {\n            for (const item of trace.items) {\n                const xv = item.data[trace.keyX];\n                if (typeof xv !== \"number\" || xv < view.xMin || xv > view.xMax) continue;\n                for (const yv of [item.data[trace.keyY], item.data.ciLow, item.data.ciHigh]) {\n                    if (typeof yv === \"number\" && isFinite(yv)) {\n                        lo = Math.min(lo, yv);\n                        hi = Math.max(hi, yv);\n                    }\n                }\n            }\n        }\n        if (!isFinite(lo) || !isFinite(hi)) {\n            return { yMin: this.preparedPlot.yMin, yMax: this.preparedPlot.yMax };\n        }\n        return this.resolveYBounds(lo, hi);\n    }\n\n    /**\n     * Y bounds of one panel: the whole plot's for the single panel, the extent of its\n     * own traces for a row of the \"rows\" style — fitted to the zoom window if any.\n     */\n    private panelYBounds(traces: Set<Trace> | null, zoomView: { xMin: number; xMax: number } | null): { yMin: number; yMax: number } {\n        if (zoomView) return this.computeViewYBounds(zoomView, traces);\n        const whole = { yMin: this.preparedPlot.yMin, yMax: this.preparedPlot.yMax };\n        if (!traces) return whole;\n        let lo = Infinity, hi = -Infinity;\n        for (const trace of traces) {\n            lo = Math.min(lo, trace.yMin);\n            hi = Math.max(hi, trace.yMax);\n        }\n        return isFinite(lo) && isFinite(hi) ? this.resolveYBounds(lo, hi) : whole;\n    }\n\n    /** The panel a trace is drawn in (the only one, unless the \"rows\" style is active). */\n    private panelOf(trace: Trace): PlotPanel {\n        return this.panels.find(panel => !panel.traces || panel.traces.has(trace)) ?? this.panels[0];\n    }\n\n    /**\n     * Full x extent of the chart. Charts that overlay several series with year\n     * effects get half a year of air on both sides, so the lanes (and year columns)\n     * of the first and last year are not cut off by the frame.\n     */\n    private fullXDomain(): { xMin: number; xMax: number } {\n        const pad = this.customOptions?.displaySettings !== undefined\n            && this.multi.isMulti && this.multi.layout.rteSeries.length > 0 ? 0.5 : 0;\n        return { xMin: this.preparedPlot.xMin - pad, xMax: this.preparedPlot.xMax + pad };\n    }\n\n    /**\n     * Title of an axis, or \"\" when none is drawn: the text set in the display\n     * settings, else the chart's own default (customOptions.axisTitles).\n     */\n    private axisTitle(axis: \"x\" | \"y\"): string {\n        const setting = this.display.axisTitles[axis];\n        if (!setting.show) return \"\";\n        if (axis === \"x\" ? this.shouldHideXAxisLabels() : this.shouldHideYAxisLabels()) return \"\";\n        return (setting.text.trim() || this.customOptions?.axisTitles?.[axis] || \"\").trim();\n    }\n\n    /**\n     * Width the toolbar overlay takes from the top-right corner (px). At least the\n     * width of the full button set, so the legend does not re-wrap when the reset\n     * button comes and goes with the zoom.\n     */\n    private toolbarReserve(): number {\n        return Math.max(this.toolbarContainer?.offsetWidth ?? 0, 220) + 12;\n    }\n\n    /**\n     * Place the legend entries of a multi-series chart into rows no wider than\n     * `maxWidth`. Null when the chart draws no legend: a single series (the title\n     * names it), the \"rows\" style (every row is labelled directly) or switched off.\n     */\n    private layoutLegend(maxWidth: number, fontSize: number): LegendLayout | null {\n        const multi = this.multi;\n        if (!multi.isMulti || !multi.settings.legend || multi.rowsActive) return null;\n        const glyph = fontSize * 2.4;\n        const rowHeight = Math.round(fontSize * 1.7);\n        const items: LegendItem[] = [];\n        let x = 0, row = 0;\n        for (const series of multi.layout.series) {\n            const itemWidth = glyph + 6 + measureText(series.label, fontSize) + fontSize * 1.4;\n            if (x > 0 && x + itemWidth > maxWidth) {\n                x = 0;\n                row += 1;\n            }\n            items.push({ series, x, row });\n            x += itemWidth;\n        }\n        return { items, fontSize, rowHeight, height: (row + 1) * rowHeight + 4 };\n    }\n\n    /**\n     * The key of one series: a sample of its line with its year-effect mark on it,\n     * drawn the way the active style draws it. Centred on (0, 0), `size` px wide.\n     */\n    private drawSeriesKey(parent: any, series: Series, size: number): void {\n        const trace = series.styleTrace;\n        const line = parent.append(\"line\")\n            .attr(\"x1\", -size / 2).attr(\"x2\", size / 2)\n            .attr(\"y1\", 0).attr(\"y2\", 0)\n            .attr(\"stroke\", trace.colorFull)\n            .attr(\"stroke-width\", 2);\n        if (trace.dashArray) line.attr(\"stroke-dasharray\", trace.dashArray);\n        if (!series.hasRte) return;\n\n        const stroke = (series.rteTrace as Trace).colorDark;\n        const count = this.multi.layout.rteSeries.length;\n        if (this.multi.nestedActive && series.rteRank < count - 1) {\n            //  an interval bar with its value tick, as wide as the style draws the series\n            const w = size * 0.5 * nestedBarFraction(series.rteRank, count) / nestedBarFraction(0, count);\n            parent.append(\"rect\")\n                .attr(\"x\", -w / 2).attr(\"y\", -size * 0.26)\n                .attr(\"width\", w).attr(\"height\", size * 0.52)\n                .attr(\"rx\", 2)\n                .attr(\"fill\", \"#fff\");\n            parent.append(\"rect\")\n                .attr(\"x\", -w / 2).attr(\"y\", -size * 0.26)\n                .attr(\"width\", w).attr(\"height\", size * 0.52)\n                .attr(\"rx\", 2)\n                .attr(\"fill\", (series.rteTrace as Trace).colorFullAlpha25);\n            parent.append(\"line\")\n                .attr(\"x1\", -w / 2).attr(\"x2\", w / 2)\n                .attr(\"y1\", 0).attr(\"y2\", 0)\n                .attr(\"stroke\", stroke)\n                .attr(\"stroke-width\", 2);\n            return;\n        }\n        const marker = rteMarker(series.rteRank);\n        parent.append(\"path\")\n            .attr(\"d\", marker.d)\n            .attr(\"fill\", marker.hollow ? \"#fff\" : stroke)\n            .attr(\"stroke\", marker.hollow ? stroke : \"#fff\")\n            .attr(\"stroke-width\", marker.hollow ? 1.5 : 1);\n    }\n\n    /** The legend rows, sitting in the top margin directly above the plot area. */\n    private drawLegend(svg: any, legend: LegendLayout): void {\n        const glyph = legend.fontSize * 2.4;\n        const group = svg.append(\"g\")\n            .attr(\"class\", \"myd3-legend\")\n            .attr(\"transform\", `translate(0,${-legend.height})`);\n        for (const item of legend.items) {\n            const entry = group.append(\"g\")\n                .attr(\"transform\", `translate(${item.x},${item.row * legend.rowHeight + legend.rowHeight / 2})`);\n            this.drawSeriesKey(entry.append(\"g\").attr(\"transform\", `translate(${glyph / 2},0)`), item.series, glyph);\n            entry.append(\"text\")\n                .attr(\"x\", glyph + 6)\n                .attr(\"dominant-baseline\", \"central\")\n                .style(\"font-family\", \"sans-serif\")\n                .style(\"font-size\", `${legend.fontSize}px`)\n                .attr(\"fill\", INK)\n                .text(item.series.label);\n        }\n    }\n\n    /** \"Rows\" style: every row names its series in the strip above it (`header` px high). */\n    private drawRowLabels(svg: any, fontSize: number, header: number): void {\n        const glyph = fontSize * 2.4;\n        for (const panel of this.panels) {\n            const series: Series | null = panel.series;\n            if (!series) continue;\n            const entry = svg.append(\"g\")\n                .attr(\"class\", \"myd3-row-label\")\n                .attr(\"pointer-events\", \"none\")\n                .attr(\"transform\", `translate(0,${panel.top - header / 2 - 1})`);\n            this.drawSeriesKey(entry.append(\"g\").attr(\"transform\", `translate(${glyph / 2},0)`), series, glyph);\n            entry.append(\"text\")\n                .attr(\"x\", glyph + 6)\n                .attr(\"dominant-baseline\", \"central\")\n                .style(\"font-family\", \"sans-serif\")\n                .style(\"font-size\", `${fontSize}px`)\n                .style(\"font-weight\", 600)\n                .attr(\"fill\", INK)\n                .text(series.label);\n        }\n    }\n\n    private drawAxisTitles(svg: any, titleX: string, titleY: string, width: number, height: number,\n                           margin: { left: number; bottom: number }, fsX: number, fsY: number): void {\n        const style = (sel: any, fs: number) => sel\n            .attr(\"class\", \"myd3-axis-title\")\n            .attr(\"text-anchor\", \"middle\")\n            .style(\"font-family\", \"sans-serif\")\n            .style(\"font-size\", `${fs}px`)\n            .attr(\"fill\", INK_MUTED);\n        if (titleX) {\n            //  baseline a little above the bottom edge of the svg\n            style(svg.append(\"text\"), fsX)\n                .attr(\"x\", width / 2)\n                .attr(\"y\", height + margin.bottom - Math.round(fsX * 0.45))\n                .text(titleX);\n        }\n        if (titleY) {\n            style(svg.append(\"text\"), fsY)\n                .attr(\"transform\", `translate(${-margin.left + Math.round(fsY * 1.05)},${height / 2}) rotate(-90)`)\n                .text(titleY);\n        }\n    }\n\n    /**\n     * What ties a mark to its year in a chart that overlays several series: a tick\n     * for every year on the axis, and the guides of the active style — shaded year\n     * columns, or hairlines at the labelled years.\n     */\n    private drawYearGuides(guideLayer: any, svg: any, x: any, width: number, height: number, fontSize: number): void {\n        const settings = this.multi.settings;\n        const yearPx = this.multi.yearPx();\n        const [d0, d1] = x.domain();\n        const years: number[] = [];\n        for (let year = Math.ceil(d0); year <= Math.floor(d1); year += 1) years.push(year);\n        const clampX = (v: number) => Math.max(0, Math.min(width, v));\n\n        if (settings.yearTicks && yearPx >= 3 && !this.shouldHideXAxisLabels()) {\n            svg.append(\"g\")\n                .attr(\"class\", \"myd3-year-ticks\")\n                .selectAll(\"line\")\n                .data(years)\n                .enter()\n                .append(\"line\")\n                .attr(\"x1\", (d: number) => x(d) + 0.5)\n                .attr(\"x2\", (d: number) => x(d) + 0.5)\n                .attr(\"y1\", height)\n                .attr(\"y2\", height + 3.5)\n                .attr(\"stroke\", \"currentColor\")\n                .attr(\"opacity\", 0.55);\n        }\n        if (!settings.yearGuides) return;\n\n        if (this.multi.style === \"columns\") {\n            //  every other year is shaded, so each mark sits in the column of its year\n            guideLayer.selectAll(\"rect.myd3-year-column\")\n                .data(years.filter(year => year % 2 === 0))\n                .enter()\n                .append(\"rect\")\n                .attr(\"class\", \"myd3-year-column\")\n                .attr(\"x\", (d: number) => clampX(x(d - 0.5)))\n                .attr(\"width\", (d: number) => Math.max(0, clampX(x(d + 0.5)) - clampX(x(d - 0.5))))\n                .attr(\"y\", 0)\n                .attr(\"height\", height)\n                .attr(\"fill\", \"#f3f5f9\");\n        } else if (this.multi.style === \"nested\" || this.multi.style === \"rows\") {\n            //  hairlines at the labelled years carry the eye up from the axis (and\n            //  across the rows)\n            const ticks: number[] = x.ticks(Math.max(5, Math.floor(width / (fontSize * 5))));\n            guideLayer.selectAll(\"line.myd3-year-rule\")\n                .data(ticks.filter(Number.isInteger))\n                .enter()\n                .append(\"line\")\n                .attr(\"class\", \"myd3-year-rule\")\n                .attr(\"x1\", (d: number) => x(d) + 0.5)\n                .attr(\"x2\", (d: number) => x(d) + 0.5)\n                .attr(\"y1\", 0)\n                .attr(\"y2\", height)\n                .attr(\"stroke\", \"#e6ebf1\");\n        }\n    }\n\n    /**\n     * The x-axis counts years: a linear axis under trend traces whose x values look\n     * like years. Such a chart marks the hovered year (drawYearHover).\n     */\n    private isYearAxis(): boolean {\n        const plot = this.preparedPlot;\n        if (plot.axisXType !== \"linear\" || this.data?.type === \"OTHER\" || this.shouldHideXAxis()) return false;\n        if (plot.seriesLayout.series.length === 0) return false;\n        return Number.isFinite(plot.xMin) && plot.xMin >= 1000 && plot.xMax <= 3000;\n    }\n\n    /**\n     * What marks the hovered year of a chart over a year axis (display.hover): the\n     * year in a dark flag on the axis, and a tinted background behind the year.\n     * On-screen draws only — an export has no hover, and must not take over the\n     * hover parts of the chart it was drawn from.\n     */\n    private drawYearHover(guideLayer: any, svg: any, x: any, width: number, height: number, fontSize: number): void {\n        const hover = this.display.hover;\n        const showFlag = hover.yearFlag && !this.shouldHideXAxisLabels();\n        this.yearFlagShown = showFlag;\n        if (!showFlag && !hover.yearBackground) return;\n        const clampX = (v: number) => Math.max(0, Math.min(width, v));\n\n        const column = !hover.yearBackground ? null : guideLayer.append(\"rect\")\n            .attr(\"class\", \"myd3-year-hover\")\n            .attr(\"y\", 0)\n            .attr(\"height\", height)\n            .attr(\"fill\", ACCENT)\n            .attr(\"opacity\", 0.11)\n            .style(\"display\", \"none\");\n        const flag = !showFlag ? null : svg.append(\"g\")\n            .attr(\"class\", \"myd3-year-flag\")\n            .attr(\"pointer-events\", \"none\")\n            .style(\"display\", \"none\");\n        const flagBack = flag?.append(\"rect\").attr(\"rx\", 3).attr(\"fill\", \"#1e293b\");\n        const flagText = flag?.append(\"text\")\n            .attr(\"text-anchor\", \"middle\")\n            .attr(\"dominant-baseline\", \"central\")\n            .style(\"font-family\", \"sans-serif\")\n            .style(\"font-size\", `${fontSize}px`)\n            .style(\"font-weight\", 600)\n            .attr(\"fill\", \"#fff\");\n        const flagHeight = Math.round(fontSize * 1.5);\n\n        this.markHoveredYear = (value: unknown) => {\n            //  hosts may index years as strings (\"2015\")\n            const year = value === null || value === undefined || value === \"\" ? NaN : Number(value);\n            const visible = Number.isFinite(year) && x(year) >= -0.5 && x(year) <= width + 0.5;\n            column?.style(\"display\", visible ? null : \"none\");\n            if (flag) {\n                flag.style(\"display\", visible ? null : \"none\");\n                //  the flag sits on the tick labels — fade them so it is the one year that reads\n                svg.select(\".myd3-axis-x\").selectAll(\"text\").style(\"opacity\", visible ? 0.2 : null);\n            }\n            if (!visible) return;\n            if (column) {\n                //  the whole year the hovered point lies in (a fine year grid hovers fractions)\n                const whole = Math.round(year);\n                const left = clampX(x(whole - 0.5));\n                column.attr(\"x\", left).attr(\"width\", Math.max(0, clampX(x(whole + 0.5)) - left));\n            }\n            if (flag) {\n                const label = `${Math.round(year * 10) / 10}`;\n                const flagWidth = measureText(label, fontSize, 600) + 10;\n                flagText.text(label).attr(\"y\", flagHeight / 2);\n                flagBack.attr(\"x\", -flagWidth / 2).attr(\"width\", flagWidth).attr(\"height\", flagHeight);\n                flag.attr(\"transform\", `translate(${x(year)},${height + 5})`);\n            }\n        };\n    }\n\n    /** Marks the hovered year (null clears it); replaced by every on-screen draw over a year axis. */\n    private markHoveredYear: (year: unknown) => void = () => undefined;\n    /** The year flag is part of the current on-screen draw — the tooltip need not repeat the year. */\n    private yearFlagShown = false;\n\n    /**\n     * The legend key of a trace's series as inline SVG, for the tooltip — \"\" in a\n     * chart with a single series, which has nothing to tell apart.\n     */\n    private seriesKeyOf(trace: Trace): string {\n        const series = trace?.series;\n        if (!series || !this.multi.isMulti) return \"\";\n        let html = this.seriesKeyHtml.get(series.key);\n        if (html === undefined) {\n            const w = 24, h = 14;\n            const key = d3.create(\"svg\").attr(\"width\", w).attr(\"height\", h).attr(\"viewBox\", `0 0 ${w} ${h}`);\n            this.drawSeriesKey(key.append(\"g\").attr(\"transform\", `translate(${w / 2},${h / 2})`), series, w);\n            html = (key.node() as SVGSVGElement).outerHTML;\n            this.seriesKeyHtml.set(series.key, html);\n        }\n        return html;\n    }\n\n    /** Draw the left axis of one panel: nothing, a bare line, or ticks with labels. */\n    private drawLinearYAxis(svg: any, scale: any, tickCount: number, fontSize: number): void {\n        if (this.shouldHideYAxis()) {\n            // No axis at all (pie/radial charts define their own geometry)\n            return;\n        }\n        if (this.shouldHideYAxisLabels()) {\n            // Show a bare axis line (no labels, no tick stubs) when labels are hidden\n            svg.append(\"g\")\n                .call(d3.axisLeft(scale)\n                    .tickFormat(() => '')\n                    .tickSize(0)\n                );\n            return;\n        }\n        // Show axis with labels\n        svg.append(\"g\")\n            .call(d3.axisLeft(scale).ticks(tickCount))\n            .selectAll(\"text\")\n            .style(\"font-size\", fontSize + \"px\");\n    }\n\n    /**\n     * Calculate additional margin needed for rotated X-axis labels\n     * @param labels Array of categorical labels\n     * @param fontSize Font size in pixels\n     * @param width Available width\n     * @param maxHeight Maximum height available for labels (based on chart height and maxLabelSpaceRatio)\n     * @returns Additional bottom margin needed, clamped to maxHeight\n     */\n    private calcRotatedXLabelMargin(labels: string[], fontSize: number, width: number, maxHeight?: number): number {\n        if (labels.length === 0 || this.shouldHideXAxisLabels()) return 0;\n\n        // Check if labels should be rendered at all\n        const maxLabelSpaceRatio = this.customOptions?.maxLabelSpaceRatio ?? 0.25;\n        if (maxLabelSpaceRatio <= 0.0) return 0;\n\n        const rotationAngle = this.resolveCategoricalXLayout(labels, width, fontSize).rotation;\n        if (rotationAngle === 0) return 0;\n\n        // Estimate the height needed for rotated labels\n        const avgCharWidth = fontSize * 0.6;\n        const maxLabelLength = Math.max(...labels.map(label => label.length));\n        const maxLabelWidth = maxLabelLength * avgCharWidth;\n\n        // Calculate the vertical space needed based on rotation angle\n        const radians = Math.abs(rotationAngle) * Math.PI / 180;\n        const additionalHeight = maxLabelWidth * Math.sin(radians);\n\n        // Clamp to maximum allowed height if specified\n        const clampedHeight = maxHeight ? Math.min(additionalHeight, maxHeight) : additionalHeight;\n\n        return Math.round(clampedHeight);\n    }\n\n    /**\n     * Calculate maximum allowed margin for Y-axis labels\n     * @param totalWidth Total chart width\n     * @returns Maximum width allowed for Y-axis labels\n     */\n    private calcMaxYLabelMargin(totalWidth: number): number {\n        const maxLabelSpaceRatio = this.customOptions?.maxLabelSpaceRatio ?? 0.25; // Reduced from 0.5 to 0.25\n        if (maxLabelSpaceRatio <= 0.0) return 0;\n\n        return totalWidth * maxLabelSpaceRatio;\n    }\n\n    /**\n     * Check if labels should be rendered based on maxLabelSpaceRatio\n     */\n    private shouldRenderLabels(): boolean {\n        const maxLabelSpaceRatio = this.customOptions?.maxLabelSpaceRatio ?? 0.25; // Reduced from 0.5 to 0.25\n        return maxLabelSpaceRatio > 0.0;\n    }\n\n    private shouldHideXAxisLabels(): boolean {\n        return this.customOptions?.hideAxisLabels?.x === true || this.shouldHideXAxis();\n    }\n\n    private shouldHideYAxisLabels(): boolean {\n        return this.customOptions?.hideAxisLabels?.y === true || this.shouldHideYAxis();\n    }\n\n    private shouldHideXAxis(): boolean {\n        return this.customOptions?.hideAxes?.x === true;\n    }\n\n    private isZoomEligible(): boolean {\n        //  a categorical y-axis (e.g. horizontal bar charts) is not the temporal\n        //  chart zoom targets — the x-domain there is a value range, not a timeline,\n        //  and wheel/drag zoom would just trap the mouse over an unrelated chart.\n        return this.zoomOptions.enabled !== false\n            && this.preparedPlot.axisXType === \"linear\"\n            && this.preparedPlot.axisYType !== \"categorical\"\n            && !this.shouldHideXAxis();\n    }\n\n    private shouldHideYAxis(): boolean {\n        return this.customOptions?.hideAxes?.y === true;\n    }\n\n    /**\n     * Repaint once the container actually has a size.\n     *\n     * Callers draw once and never retry, so a draw that bailed on an unsized\n     * container would leave an empty <svg> for the life of the page. Watch the\n     * container and redraw on the first resize that gives it usable dimensions.\n     */\n    private redrawWhenSized(options?: any) {\n        if (typeof ResizeObserver === \"undefined\") return;\n        const elm = this.plotElement;\n        if (!elm) return;\n        cancelResizeRedraw(elm);\n        // Fires once on observe(), so an element sized between the bail and here\n        // still gets its redraw rather than waiting for a resize that never comes.\n        const observer = new ResizeObserver(() => {\n            if (elm.clientWidth <= 0 || elm.clientHeight <= 0) return;\n            cancelResizeRedraw(elm);\n            this.draw(options);\n        });\n        observer.observe(elm);\n        pendingResizeRedraws.set(elm, observer);\n    }\n\n    /**\n     * Draw the plot\n     */\n    draw(options?: any) {\n        const drawToAlt = (options && options.svg);\n        let svgRoot: any;\n        let margin: { left: number; right: number; top: number; bottom: number };\n        const preparedPlot = this.preparedPlot;\n\n        //  container size (cw/ch) and the base font size\n        let cw: number, ch: number;\n        if (drawToAlt) {\n            cw = options.width;\n            ch = options.height;\n        }\n        else {\n            const plotElm: any = this.plotElement;\n            cw = plotElm.clientWidth;\n            ch = plotElm.clientHeight;\n            this.dlWidth = cw;\n            this.dlHeight = ch;\n        }\n        // Use a percentage of the height for font size\n        const fontSize = ch * 0.025 * this.dlFontSizeMul;\n        const fsAxisX = this.axisTickFontSize(fontSize, preparedPlot.axisXType);\n        const fsAxisY = this.axisTickFontSize(fontSize, preparedPlot.axisYType);\n        // Text size of the y tick labels, to ensure proper margins\n        const baseTextSize = this.calcTextSize(preparedPlot, fontSize);\n\n        // Maximum allowed space for labels\n        const maxYLabelWidth = this.calcMaxYLabelMargin(cw);\n        const maxXLabelHeight = this.shouldRenderLabels() ? ch * (this.customOptions?.maxLabelSpaceRatio ?? 0.25) : 0;\n\n        if (drawToAlt) {\n            //  this means drawing to a hidden svg for image export or download\n            const m = Math.min(40, Math.min(cw, ch) * 0.1);\n            const leftMargin = this.shouldHideYAxisLabels()\n                ? 12\n                : Math.min(Math.max(baseTextSize.width + 10, fsAxisY * 2 + 12), maxYLabelWidth);\n\n            // Additional bottom margin for rotated X-axis labels in export with height limit\n            const additionalBottomMargin = preparedPlot.axisXType === 'categorical'\n                ? this.calcRotatedXLabelMargin(preparedPlot.categoricalXLabels, fsAxisX, cw - leftMargin - m, maxXLabelHeight - fsAxisX - 12)\n                : 0;\n\n            margin = {\n                left: leftMargin,\n                right: m,\n                top: Math.max(baseTextSize.height, m),\n                bottom: fsAxisX * 1 + 12 + additionalBottomMargin\n            };\n        }\n        else {\n            //  regular drawing on website\n            // Use the calculated text width for left margin to ensure y-axis labels are fully visible\n            // Add some padding (10px) to ensure labels don't touch the edge\n            // Efficient left margin - use actual text width but don't exceed reasonable limits\n            const minLeftMargin = Math.max(baseTextSize.width + 10, fsAxisY + 20); // Minimum reasonable margin\n            const leftMargin = this.shouldHideYAxisLabels() ? 12 : Math.min(minLeftMargin, maxYLabelWidth);\n\n            // Additional bottom margin for rotated X-axis labels with height limit\n            const additionalBottomMargin = preparedPlot.axisXType === 'categorical'\n                ? this.calcRotatedXLabelMargin(preparedPlot.categoricalXLabels, fsAxisX, cw - leftMargin - 20, maxXLabelHeight - fsAxisX - 12)\n                : 0;\n\n            margin = {\n                left: leftMargin,\n                right: 20,\n                top: baseTextSize.height,\n                bottom: fsAxisX * 1 + 12 + additionalBottomMargin\n            };\n        }\n\n        //  room for the axis titles and the legend (display settings)\n        const titleX = this.axisTitle(\"x\");\n        const titleY = this.axisTitle(\"y\");\n        const titleBand = (fs: number) => Math.round(fs * 1.25 + 8);\n        if (titleX) margin.bottom += titleBand(fsAxisX);\n        if (titleY) margin.left += titleBand(fsAxisY);\n        //  the toolbar overlays the top-right corner of the on-screen chart\n        const legend = this.layoutLegend(\n            cw - margin.left - margin.right - (drawToAlt ? 0 : this.toolbarReserve()), fsAxisX);\n        const fsTitle = fontSize * 2;\n        //  where the exported title/subtitle sit; a legend takes their usual place\n        //  right above the plot, so they are stacked on top of it\n        let titleLineY = 0, subtitleLineY = fsTitle;\n        //  \"rows\" style: every row carries the name of its series in a strip above it;\n        //  the strip of the first row sits in the top margin, like the legend otherwise\n        const rowHeader = this.multi.rowsActive ? Math.round(fsAxisX * 1.7) : 0;\n        const headHeight = legend ? legend.height : rowHeader;\n        if (headHeight > 0) {\n            margin.top += headHeight;\n            if (this.dlTitle || this.dlSubtitle) {\n                const subtitleBand = this.dlSubtitle ? fontSize * 1.5 + 6 : 0;\n                subtitleLineY = -headHeight - 6;\n                titleLineY = subtitleLineY - subtitleBand;\n                margin.top += subtitleBand + 6;\n            }\n        }\n\n        const width = cw - margin.left - margin.right;\n        const height = ch - margin.top - margin.bottom;\n\n        if (drawToAlt) {\n            svgRoot = options.svg;\n        }\n        else {\n            //  the read-out of the previous draw hangs off <body>\n            this.hoverTooltip?.destroy();\n            this.hoverTooltip = undefined;\n            this.plotElement.innerHTML = '';\n            svgRoot = d3.select(this.plotElement).append(\"svg\");\n        }\n        svgRoot.attr(\"viewBox\", `0 0 ${cw} ${ch}`);\n\n        // Before the container is laid out (initial mount / hidden tab / stylesheet\n        // still in flight) the inner plot area can compute to zero or negative height\n        // once margins are removed. Rendering then throws \"negative attribute\" errors\n        // on <rect>/<foreignObject>; bail and redraw ourselves once it has a real size.\n        if (width <= 0 || height <= 0) {\n            if (!drawToAlt) this.redrawWhenSized(options);\n            return;\n        }\n        if (!drawToAlt) cancelResizeRedraw(this.plotElement);\n\n        svgRoot.append(\"rect\")\n            .attr(\"width\", \"100%\")\n            .attr(\"height\", \"100%\")\n            .attr(\"fill\", \"white\");\n        const svg = svgRoot.append(\"g\")\n            .attr(\"transform\", \"translate(\" + margin.left + \",\" + margin.top + \")\");\n        this.svg = svg;\n\n        // first add title / subtitle\n        if (this.dlTitle) {\n            svg.append(\"text\")\n                .attr(\"x\", width / 2)\n                .attr(\"y\", titleLineY)\n                .attr(\"text-anchor\", \"middle\")\n                .style(\"font-size\", fsTitle + \"px\")\n                .style(\"font-family\", \"sans-serif\")\n                .text(this.dlTitle);\n        }\n        if (this.dlSubtitle) {\n            svg.append(\"text\")\n                .attr(\"x\", width / 2)\n                .attr(\"y\", subtitleLineY)\n                .attr(\"text-anchor\", \"middle\")\n                .style(\"font-size\", (fontSize * 1.5) + \"px\")\n                .style(\"font-family\", \"sans-serif\")\n                .style(\"fill\", \"#999\")\n                .text(this.dlSubtitle);\n        }\n\n        //  behind the axes and the data: the year guides of the multi-series styles\n        const guideLayer = svg.append(\"g\").attr(\"class\", \"myd3-year-guides\");\n        if (!drawToAlt) {\n            this.markHoveredYear = () => undefined;\n            this.yearFlagShown = false;\n            this.seriesKeyHtml.clear();\n            this.seriesNamed = legend !== null || this.multi.rowsActive;\n        }\n\n        const panels: PlotPanel[] = [];\n        const fullX = this.fullXDomain();\n\n        const zoomView = this.isZoomEligible() ? (this.zoomController?.view ?? null) : null;\n\n        // Add X axis - either linear or categorical\n        let x: any;\n        if (preparedPlot.axisXType === 'categorical') {\n            x = d3.scaleBand()\n                .domain(preparedPlot.categoricalXLabels.map((_, i) => i.toString()))\n                .range([0, width])\n                .padding(0.1);\n\n            // Only show axis if there are labels, they should be rendered, and X-axis labels are not hidden\n            if (preparedPlot.categoricalXLabels.length > 0 && preparedPlot.categoricalXLabels.some(label => label.trim() !== '') && this.shouldRenderLabels() && !this.shouldHideXAxisLabels()) {\n                const layout = this.resolveCategoricalXLayout(preparedPlot.categoricalXLabels, width, fsAxisX);\n\n                // Calculate available space per label for truncation\n                const spacePerLabel = x.bandwidth ? x.bandwidth() : width / preparedPlot.categoricalXLabels.length;\n                const maxLabelWidth = layout.rotation === 0\n                    ? spacePerLabel * layout.step // thinned labels may use the skipped bands' space\n                    : spacePerLabel * 2; // More space for rotated labels\n\n                // Render only every step-th tick so dense categorical axes stay readable\n                const tickValues = preparedPlot.categoricalXLabels\n                    .map((_, i) => i)\n                    .filter(i => i % layout.step === 0)\n                    .map(i => i.toString());\n\n                const xAxisGroup = svg.append(\"g\")\n                    .attr(\"transform\", \"translate(0,\" + height + \")\")\n                    .call(d3.axisBottom(x)\n                        .tickValues(tickValues)\n                        .tickFormat((d: any, i: number) => {\n                            const originalLabel = preparedPlot.categoricalXLabels[parseInt(d)] || '';\n                            return this.truncateTextWithEllipsis(originalLabel, maxLabelWidth, fsAxisX);\n                        })\n                    );\n\n                // Apply rotation to X-axis labels\n                const xAxisLabels = xAxisGroup.selectAll(\"text\")\n                    .style(\"font-size\", fsAxisX + \"px\");\n\n                this.applyLabelRotation(xAxisLabels, layout.rotation, 'x', fsAxisX);\n            } else if (preparedPlot.categoricalXLabels.length > 0 && (!this.shouldRenderLabels() || this.shouldHideXAxisLabels()) && !this.shouldHideXAxis()) {\n                // Show a bare axis line (no labels, no tick stubs) when labels are hidden\n                svg.append(\"g\")\n                    .attr(\"transform\", \"translate(0,\" + height + \")\")\n                    .call(d3.axisBottom(x)\n                        .tickFormat(() => '')\n                        .tickSize(0)\n                    );\n            }\n\n            // Create a mapping function for categorical to pixel coordinates\n            const xCategorical = x;\n            x = (d: any) => {\n                if (typeof d === 'number') {\n                    // For numeric indices, map to band center\n                    return xCategorical(d.toString()) + xCategorical.bandwidth() / 2;\n                }\n                return xCategorical(d);\n            };\n            // Copy bandwidth and other scale properties\n            x.bandwidth = () => xCategorical.bandwidth();\n            x.range = () => xCategorical.range();\n            x.domain = () => xCategorical.domain();\n        } else {\n            x = d3.scaleLinear()\n                .domain(zoomView ? [zoomView.xMin, zoomView.xMax] : [fullX.xMin, fullX.xMax])\n                .range([0, width]);\n\n            if (this.shouldHideXAxis()) {\n                // No axis at all (pie/radial charts define their own geometry)\n            } else if (this.shouldHideXAxisLabels()) {\n                // Show a bare axis line (no labels, no tick stubs) when labels are hidden\n                svg.append(\"g\")\n                    .attr(\"transform\", \"translate(0,\" + height + \")\")\n                    .call(d3.axisBottom(x)\n                        .tickFormat(() => '')\n                        .tickSize(0)\n                    );\n            } else {\n                // Show axis with labels\n                svg.append(\"g\")\n                    .attr(\"class\", \"myd3-axis-x\")\n                    .attr(\"transform\", \"translate(0,\" + height + \")\")\n                    .call(d3.axisBottom(x)\n                        .tickFormat(function (d: any, i: any) {\n                            return d;\n                        })\n                        .ticks(Math.max(5, Math.floor(width / (fsAxisX * 5))))\n                    )\n                    .selectAll(\"text\")\n                    .style(\"font-size\", fsAxisX + \"px\");\n            }\n        }\n\n        // Add Y axis - either linear or categorical\n        let y: any;\n        if (preparedPlot.axisYType === 'categorical') {\n            // Index 0 renders at the TOP (like a list), so descending data reads top-down.\n            y = d3.scaleBand()\n                .domain(preparedPlot.categoricalYLabels.map((_, i) => i.toString()))\n                .range([0, height])\n                .padding(0.1);\n\n            // Only show axis if there are labels, they should be rendered, and Y-axis labels are not hidden\n            if (preparedPlot.categoricalYLabels.length > 0 && preparedPlot.categoricalYLabels.some(label => label.trim() !== '') && this.shouldRenderLabels() && !this.shouldHideYAxisLabels()) {\n                // Horizontal labels, truncated to the margin; thinned when rows are denser than the font\n                const bandHeight = y.bandwidth ? y.bandwidth() : height / preparedPlot.categoricalYLabels.length;\n                const maxLabelWidth = margin.left - 10; // Use available left margin space\n                const yStep = Math.max(1, Math.ceil((fsAxisY * 1.2) / Math.max(1, bandHeight)));\n                const tickValues = preparedPlot.categoricalYLabels\n                    .map((_, i) => i)\n                    .filter(i => i % yStep === 0)\n                    .map(i => i.toString());\n\n                svg.append(\"g\")\n                    .call(d3.axisLeft(y)\n                        .tickValues(tickValues)\n                        .tickFormat((d: any, i: number) => {\n                            const originalLabel = preparedPlot.categoricalYLabels[parseInt(d)] || '';\n                            return this.truncateTextWithEllipsis(originalLabel, maxLabelWidth, fsAxisY);\n                        })\n                    )\n                    .selectAll(\"text\")\n                    .style(\"font-size\", fsAxisY + \"px\");\n            } else if (preparedPlot.categoricalYLabels.length > 0 && (!this.shouldRenderLabels() || this.shouldHideYAxisLabels()) && !this.shouldHideYAxis()) {\n                // Show a bare axis line (no labels, no tick stubs) when labels are hidden\n                svg.append(\"g\")\n                    .call(d3.axisLeft(y)\n                        .tickFormat(() => '')\n                        .tickSize(0)\n                    );\n            }\n\n            // Create a mapping function for categorical to pixel coordinates\n            const yCategorical = y;\n            y = (d: any) => {\n                if (typeof d === 'number') {\n                    // For numeric indices, map to band center\n                    return yCategorical(d.toString()) + yCategorical.bandwidth() / 2;\n                }\n                return yCategorical(d);\n            };\n            // Copy bandwidth and other scale properties\n            y.bandwidth = () => yCategorical.bandwidth();\n            y.range = () => yCategorical.range();\n            y.domain = () => yCategorical.domain();\n            panels.push({ index: 0, top: 0, height, y, traces: null, series: null });\n        } else {\n            //  one panel with one y scale — or, in the \"rows\" style, one per series,\n            //  stacked over the shared x-axis\n            const rows = this.multi.rowsActive ? this.multi.layout.series : null;\n            const count = rows ? rows.length : 1;\n            const gap = rows ? rowHeader + 8 : 0;\n            const panelHeight = (height - gap * (count - 1)) / count;\n            const tickCount = rows\n                ? Math.max(2, Math.floor(panelHeight / (fsAxisY * 3)))\n                : Math.max(5, Math.floor(height / (fsAxisY * 4)));\n            for (let idx = 0; idx < count; idx += 1) {\n                //  traces outside any series (e.g. rect overlays) go with the first row\n                const traces = rows\n                    ? new Set(preparedPlot.traces.filter(trace => (trace.series ?? rows[0]) === rows[idx]))\n                    : null;\n                const bounds = this.panelYBounds(traces, zoomView);\n                const top = idx * (panelHeight + gap);\n                const scale = d3.scaleLinear()\n                    .domain([bounds.yMin, bounds.yMax])\n                    .range([top + panelHeight, top]);\n                panels.push({ index: idx, top, height: panelHeight, y: scale, traces, series: rows ? rows[idx] : null });\n                this.drawLinearYAxis(svg, scale, tickCount, fsAxisY);\n                if (rows && idx < count - 1 && !this.shouldHideXAxis()) {\n                    //  a quiet floor under every row but the last (which has the x-axis)\n                    svg.append(\"line\")\n                        .attr(\"x1\", 0).attr(\"x2\", width)\n                        .attr(\"y1\", top + panelHeight + 0.5).attr(\"y2\", top + panelHeight + 0.5)\n                        .attr(\"stroke\", \"#cbd5e1\");\n                }\n            }\n            y = panels[0].y;\n        }\n\n        this.axisX = x;\n        this.axisY = y;\n        this.panels = panels;\n\n        if (this.multi.isMulti && preparedPlot.axisXType === \"linear\" && !this.shouldHideXAxis()) {\n            this.drawYearGuides(guideLayer, svg, x, width, height, fsAxisX);\n        }\n        if (!drawToAlt && this.isYearAxis()) {\n            this.drawYearHover(guideLayer, svg, x, width, height, fsAxisX);\n        }\n\n        // Optional light horizontal gridlines (opt-in; keeps other plots untouched).\n        // Drawn before the data renderables so they sit behind the lines/markers.\n        if (this.customOptions?.showGridlines && preparedPlot.axisYType === 'linear' && !this.shouldHideYAxis()) {\n            const grid = svg.append(\"g\").attr(\"class\", \"myd3-gridlines\");\n            for (const panel of panels) {\n                const ticks: number[] = panel.y.ticks(panels.length > 1\n                    ? Math.max(2, Math.floor(panel.height / (fsAxisY * 3)))\n                    : Math.max(4, Math.floor(height / (fsAxisY * 4))));\n                for (const tick of ticks) {\n                    grid.append(\"line\")\n                        .attr(\"x1\", 0)\n                        .attr(\"x2\", width)\n                        .attr(\"y1\", panel.y(tick))\n                        .attr(\"y2\", panel.y(tick))\n                        .attr(\"stroke\", \"#eef2f6\")\n                        .attr(\"stroke-width\", 1);\n                }\n            }\n        }\n\n        //  render data into a clipped layer (one per panel) so zoomed content cannot\n        //  spill past the axes\n        const clipped = this.isZoomEligible();\n        for (const panel of panels) {\n            let dataLayer = svg;\n            if (clipped) {\n                const clipId = `myd3-clip-${++MyD3.clipSeq}`;\n                svg.append(\"defs\").append(\"clipPath\").attr(\"id\", clipId)\n                    .append(\"rect\")\n                    .attr(\"x\", 0)\n                    .attr(\"y\", panel.top - 5)    //  small headroom so edge markers aren't half-clipped\n                    .attr(\"width\", width)\n                    .attr(\"height\", panel.height + 10);\n                dataLayer = svg.append(\"g\").attr(\"clip-path\", `url(#${clipId})`);\n            }\n            this.svg = dataLayer;\n            this.axisY = panel.y;\n            for (const renderable of this.preparedPlot.renderables) {\n                if (panel.traces && !panel.traces.has(renderable.sourceTrace)) continue;\n                renderable.render();\n            }\n        }\n        this.svg = svg;\n        this.axisY = y;\n\n        //  chart chrome of the display settings, on top of the data\n        if (this.multi.rowsActive) this.drawRowLabels(svg, fsAxisX, rowHeader);\n        if (legend) this.drawLegend(svg, legend);\n        this.drawAxisTitles(svg, titleX, titleY, width, height, margin, fsAxisX, fsAxisY);\n\n        if (this.data.type === \"OTHER\") {\n            //  more flexible rendering. the legacy code won't be executed here.\n        }\n        else {\n            this.classicPostRendering({\n                width: width,\n                height: height,\n                interactive: !drawToAlt,\n            });\n        }\n\n\n        if (!drawToAlt) {\n            this.addUI(svgRoot, svg, width, height);\n            if (this.isZoomEligible()) {\n                if (!this.zoomController) {\n                    this.zoomController = new ZoomController(\n                        fullX,\n                        this.zoomOptions,\n                        () => this.draw(),\n                        this.vueTranslation\n                    );\n                }\n                //  topmost overlay for the selection band; never intercepts events\n                const overlay = svg.append(\"g\").attr(\"pointer-events\", \"none\");\n                this.zoomController.attach({\n                    svgRoot,\n                    gNode: svg.node(),\n                    overlay,\n                    width,\n                    height,\n                    xScale: x\n                });\n                if (this.toolbarContainer) {\n                    this.zoomController.ensureControls(this.toolbarContainer);\n                }\n            }\n        }\n    }\n\n    private classicPostRendering(renderContext: RenderContext) {\n        const svg = this.svg;\n        const width = renderContext.width;\n        const height = renderContext.height;\n        const axisX = this.axisX;\n        const axisY = this.axisY;\n        const preparedPlot = this.preparedPlot;\n\n        // horizontal line at 1.0 (the trend-index baseline; count charts opt out),\n        // one per panel. Skipped when zooming has pushed 1.0 outside the visible y domain.\n        for (const panel of this.panels) {\n            const [yd0, yd1] = panel.y.domain();\n            const unityVisible = 1.0 >= Math.min(yd0, yd1) && 1.0 <= Math.max(yd0, yd1);\n            if (this.customOptions?.hideUnityLine || !unityVisible) continue;\n            svg.append('line')\n                .style(\"stroke\", \"#999\")\n                .style(\"stroke-width\", 1.0)// * this.dlStrokeWidthMul)\n                .attr(\"x1\", 0)\n                .attr(\"y1\", panel.y(1.0))\n                .attr(\"x2\", width)\n                .attr(\"y2\", panel.y(1.0))\n                .style(\"stroke-dasharray\", (\"3, 3\"));\n        }\n\n        //MYLINE (the lines that move with the mouse)\n        const myLine = svg.append('line')\n            .style(\"stroke\", \"#999\")\n            .style(\"stroke-width\", 1.0 * this.dlStrokeWidthMul)\n            .attr(\"x1\", 0)\n            .attr(\"y1\", 0)\n            .attr(\"x2\", 0)\n            .attr(\"y2\", height)\n            .style(\"opacity\", 0);\n        const myLine2 = svg.append('line')\n            .style(\"stroke\", \"#999\")\n            .style(\"stroke-width\", 1.0 * this.dlStrokeWidthMul)\n            .attr(\"x1\", 0)\n            .attr(\"y1\", 0)\n            .attr(\"x2\", width)\n            .attr(\"y2\", 0)\n            .style(\"opacity\", 0);\n        const myLine2Text = svg.append(\"text\")\n            .attr(\"x\", axisX(preparedPlot.xMin) + 3) // x-coordinate of the text\n            .attr(\"y\", axisY(preparedPlot.yMin)) // y-coordinate of the text\n            .attr(\"text-anchor\", \"start\") // alignment of the text\n            .attr(\"fill\", \"#999\").attr(\"font-size\", \"12px\")\n            .text(\"\"); // the text content\n\n        const allFocusMarkers: any[] = [];\n        for (const trace of preparedPlot.traces) {\n            if (trace.focusMarker) allFocusMarkers.push(trace.focusMarker);\n        }\n\n        if (this.message) {\n            const cx = width / 2;\n            const cy = height / 2;\n\n            const rw = cx;\n            const rh = 60;\n            const myRect = svg.append(\"rect\")\n                .attr(\"width\", \"\" + rw + \"px\")\n                .attr(\"height\", \"\" + rh + \"px\")\n                .attr(\"x\", cx - rw / 2)\n                .attr(\"y\", cy - rh / 2)\n                .attr(\"fill\", \"rgba(248,215,218,0.75)\")\n                .attr(\"stroke\", \"#842029\");\n\n            const myTest = svg\n                .append('text')\n                .attr(\"x\", cx)\n                .attr(\"y\", cy)\n                .attr(\"text-anchor\", \"middle\")\n                .attr(\"dominant-baseline\", \"central\")\n                .style(\"fill\", \"#842029\")\n                .text(this.message.text);\n        }\n\n\n\n        //THE mouse reactive rect on top\n        const myRect = svg.append(\"rect\")\n            .style(\"pointer-events\", \"all\")\n            .attr(\"width\", \"\" + width + \"px\")\n            .attr(\"height\", \"\" + height + \"px\")\n            .attr(\"fill\", \"none\");\n\n\n\n\n\n        this.crosshairParts = [myLine, myLine2, myLine2Text];\n        //  the read-out of the hovered year; an export copy has no hover\n        const tooltip = renderContext.interactive\n            ? new HoverTooltip({\n                area: myRect.node(),\n                width,\n                height,\n                container: this.plotElement,\n                toolbar: () => this.toolbarContainer,\n            })\n            : null;\n        if (tooltip) this.hoverTooltip = tooltip;\n        //  every per-year data point of this draw, so the hovered year can be emphasized\n        const yearMarkers = svg.selectAll(\"circle.myd3-year-marker\");\n        const rteItems = svg.selectAll(\".myd3-rte-item\");\n        const hideAndShow = [...allFocusMarkers];\n        const vueTranslation = this.vueTranslation;\n        //  no \"mouseover\" handler: the focus markers have no position before the first\n        //  mousemove (which shows each one where its trace has data) — revealing them\n        //  on entry parked them at the plot origin whenever a redraw happened under a\n        //  resting cursor\n        myRect\n            .on(\"mousemove\", (e: any) => {\n                const mouse = d3.pointer(e);\n                const mx = mouse[0];\n                const my = mouse[1];\n                const x0 = axisX.invert(mx);\n\n                myLine.attr(\"x1\", mx).attr(\"x2\", mx);\n                myLine2.attr(\"y1\", my).attr(\"y2\", my);\n                //  the y read-out belongs to the panel under the pointer (none in a gap between rows)\n                const hoverPanel = this.panels.find(panel => my >= panel.top && my <= panel.top + panel.height);\n                myLine2Text.attr(\"y\", my - 3).text(hoverPanel\n                    ? hoverPanel.y.invert(my).toLocaleString(undefined, { maximumFractionDigits: 2, minimumFractionDigits: 2 })\n                    : \"\");\n                //  applied on every move so the toolbar toggle takes effect mid-hover\n                this.setCrosshairVisible(this.crosshairEnabled);\n\n                // First pass: Find the closest X across all traces\n                let bestX: any = null;\n                let minDiff = Infinity;\n\n                for (const trace of preparedPlot.traces) {\n                    if (trace.settings?.hideFocus) continue;\n                    if (!trace.items || trace.items.length === 0) continue;\n\n                    const bisect = d3.bisector(function (d: any) { return d.data[trace.keyX]; }).center;\n                    const i = bisect(trace.items, x0, 0);\n                    const item = trace.items[i];\n\n                    if (item) {\n                        const xVal = item.data[trace.keyX];\n                        // Assuming x-axis is linear/numeric for distance calculation. \n                        // If categorical, this logic might need adjustment, but usually tooltips work on pixel distance or index.\n                        // Given axisX.invert(mx) returns a value, we assume we can compare.\n                        // For categorical, x0 might be a string or index? \n                        // The original code used x0 directly in bisect, implying it's comparable.\n\n                        // We calculate distance in domain space (e.g. years)\n                        // Note: bisect.center usually returns the index of the closest value.\n                        const diff = Math.abs(xVal - x0);\n                        if (diff < minDiff) {\n                            minDiff = diff;\n                            bestX = xVal;\n                        }\n                    }\n                }\n\n                MyD3.emphasizeYearMarkers(yearMarkers, bestX);\n                MyD3.emphasizeRteItems(rteItems, bestX);\n                this.markHoveredYear(bestX);\n\n                // Collect data for all traces based on bestX\n                const tooltipTraces: TooltipTraceData[] = [];\n                let nbSites = -1;\n\n                for (let idx = 0; idx < preparedPlot.traces.length; idx++) {\n                    const trace = preparedPlot.traces[idx];\n                    if (trace.settings?.hideFocus) continue;\n\n                    // Find data point matching bestX\n                    // We can use bisect again or just search. Since arrays are sorted, bisect is fast.\n                    // But we need exact match (or very close).\n                    let selectedData = null;\n                    let hasData = false;\n                    let selX = bestX;\n                    let selY = undefined;\n\n                    if (bestX !== null) {\n                        const bisect = d3.bisector(function (d: any) { return d.data[trace.keyX]; }).center;\n                        const i = bisect(trace.items, bestX, 0);\n                        const potentialItem = trace.items[i];\n\n                        // Check if it matches bestX\n                        if (potentialItem && potentialItem.data[trace.keyX] === bestX) {\n                            selectedData = potentialItem;\n                            hasData = true;\n                            selX = selectedData.data[trace.keyX];\n                            selY = selectedData.data[trace.keyY];\n                        }\n                    }\n\n                    if (hasData && selectedData) {\n                        //  the marker rides on the line: in the lane of its series, in the panel of its row\n                        const pixelX = axisX(selX) + this.multi.partDx(trace, \"line\");\n                        const pixelY = this.panelOf(trace).y(selY);\n\n                        if (trace.focusMarker) {\n                            trace.focusMarker.attr(\"cx\", pixelX).attr(\"cy\", pixelY);\n                            trace.focusMarker.style(\"opacity\", 1);\n                        }\n\n                        // Update nbSites from first trace that has it and has data\n                        if (selectedData.data.nbSites !== undefined && nbSites < 0) {\n                            nbSites = selectedData.data.nbSites;\n                        }\n                    } else {\n                        // Hide marker if no data for this year\n                        if (trace.focusMarker) {\n                            trace.focusMarker.style(\"opacity\", 0);\n                        }\n                    }\n\n                    // Collect trace data for tooltip building\n                    tooltipTraces.push({\n                        trace,\n                        selectedData,\n                        selX: bestX, // Use bestX so all entries show the same year header if used\n                        selY,\n                        isFirst: (idx === 0), // Keep original isFirst logic for tooltip rendering if needed\n                        hasData\n                    });\n                }\n\n                if (!tooltip) return;\n                if (bestX === null) {\n                    tooltip.hide();\n                    return;\n                }\n                const tooltipContext: TooltipContext = {\n                    traces: tooltipTraces,\n                    nbSites,\n                    dataType: this.data.type,\n                    translate: vueTranslation,\n                    customOptions: this.customOptions\n                };\n                this.showHoverTooltip(tooltip, tooltipContext, this.hoverAnchor(tooltipTraces, bestX, mx, my, height), height);\n            })\n            .on(\"mouseleave\", (e: any) => {\n                for (const idx in hideAndShow) {\n                    hideAndShow[idx].style(\"opacity\", 0);\n                }\n                this.setCrosshairVisible(false);\n                MyD3.emphasizeYearMarkers(yearMarkers, null);\n                MyD3.emphasizeRteItems(rteItems, null);\n                this.markHoveredYear(null);\n                tooltip?.hide();\n            })\n    }\n\n    /**\n     * Where the hovered year is in the plot area: its x, and how far up and down the\n     * marks of that year reach (values, confidence bands, year effects) — so the\n     * read-out can keep clear of them.\n     */\n    private hoverAnchor(entries: TooltipTraceData[], bestX: any, pointerX: number, pointerY: number,\n                        height: number): HoverAnchor {\n        let top = Infinity, bottom = -Infinity;\n        for (const entry of entries) {\n            const data = entry.selectedData?.data;\n            if (!entry.hasData || !data) continue;\n            const trace: Trace = entry.trace;\n            const y = this.panelOf(trace).y;\n            for (const key of [trace.keyY, \"ciLow\", \"ciHigh\", RTE_KEYS.value, RTE_KEYS.low, RTE_KEYS.high]) {\n                const value = data[key];\n                if (typeof value !== \"number\" || !Number.isFinite(value)) continue;\n                const py = y(value);\n                top = Math.min(top, py);\n                bottom = Math.max(bottom, py);\n            }\n        }\n        const found = Number.isFinite(top);\n        const clampY = (v: number) => Math.max(0, Math.min(height, v));\n        return {\n            x: this.axisX(bestX),\n            //  the lanes of the series, and the markers standing in the outermost ones\n            spread: this.multi.laneSpreadPx() + 5,\n            pointerX,\n            pointerY,\n            top: found ? clampY(top) : null,\n            bottom: found ? clampY(bottom) : null,\n        };\n    }\n\n    /** Show the read-out of the hovered year in the style of the display settings. */\n    private showHoverTooltip(tooltip: HoverTooltip, context: TooltipContext, anchor: HoverAnchor, height: number) {\n        const builder = this.customOptions?.tooltipBuilder;\n        if (builder) {\n            //  a host's own tooltip is a finished box; it is placed like the card\n            tooltip.showBox(builder(context), \"beside\", anchor);\n            return;\n        }\n        const model = buildTrendTooltipModel({\n            context,\n            keyOf: trace => this.seriesKeyOf(trace),\n            named: !this.seriesNamed,\n            yearOnAxis: this.yearFlagShown,\n            yOf: entry => (typeof entry.selY === \"number\" ? this.panelOf(entry.trace).y(entry.selY) : null),\n        });\n        switch (this.display.tooltip.style) {\n            case \"bubble\":\n                tooltip.showBox(renderBubble(model), \"above\", anchor);\n                break;\n            case \"docked\":\n                tooltip.showBox(renderDocked(model), \"docked\", anchor);\n                break;\n            case \"tags\":\n                tooltip.showTags(renderTags(model, height), anchor);\n                break;\n            default:\n                tooltip.showBox(renderCard(model), \"beside\", anchor);\n        }\n    }\n\n    /** Show/hide the crosshair lines of the current draw. */\n    private setCrosshairVisible(visible: boolean) {\n        for (const part of this.crosshairParts) part.style(\"opacity\", visible ? 1 : 0);\n    }\n\n    /**\n     * Grow the data points sitting on `bestX` (null resets them). The base radius\n     * travels on the element as `data-r`, the x value as `data-x`, so this needs to\n     * know nothing about the traces the markers came from.\n     */\n    private static emphasizeYearMarkers(markers: any, bestX: any) {\n        const key = bestX === null || bestX === undefined ? null : `${bestX}`;\n        markers.attr(\"r\", function (this: SVGCircleElement) {\n            const el = d3.select(this);\n            const base = parseFloat(el.attr(\"data-r\"));\n            if (isNaN(base)) return el.attr(\"r\");\n            return el.attr(\"data-x\") === key ? base * 1.8 : base;\n        });\n    }\n\n    /**\n     * Subtle emphasis for the random-time-effect items (circles + error lines):\n     * the items of all years EXCEPT `bestX` turn slightly transparent, so the\n     * hovered year's RTE stands out without any size change. null resets.\n     */\n    private static emphasizeRteItems(items: any, bestX: any) {\n        const key = bestX === null || bestX === undefined ? null : `${bestX}`;\n        items.style(\"opacity\", function (this: SVGElement) {\n            if (key === null) return null;\n            return d3.select(this).attr(\"data-x\") === key ? null : 0.55;\n        });\n    }\n\n    addUI(svgRoot: any, svg: any, width: number, height: number) {\n        const rootContainer = this.plotElement;\n        if (!rootContainer) return;\n        if (this.toolbarContainer) {\n            //  a zoom/pan redraw wiped the plot element (innerHTML = ''); the toolbar\n            //  node survives in JS — re-attach it instead of rebuilding\n            if (!this.toolbarContainer.isConnected) {\n                rootContainer.appendChild(this.toolbarContainer);\n            }\n            return;\n        }\n        this.toolbarContainer = ElementBuilder.append(rootContainer, \"div\", {\n            class: \"position-absolute top-0 end-0 m-2 text-end m-0\"\n        }).el();\n        //  the toolbar is position:absolute against the nearest positioned ancestor;\n        //  make rootContainer that ancestor unless the consumer already positioned it\n        //  (defensive: a consumer forgetting `position` on its chart container would\n        //  otherwise have the toolbar escape to some further-up positioned parent)\n        if (getComputedStyle(rootContainer).position === \"static\") {\n            rootContainer.style.position = \"relative\";\n        }\n\n        //  the crosshair only exists on the classic path (classicPostRendering)\n        if (this.data?.type !== \"OTHER\") {\n            const crosshairButton = ElementBuilder.append(this.toolbarContainer, \"button\", {\n                type: \"button\",\n                class: \"btn btn-sm btn-outline-secondary me-1\",\n                title: this.t(\"trends.zoom.crosshair\", \"Toggle crosshair\")\n            }).el() as HTMLButtonElement;\n            crosshairButton.innerHTML = '<svg width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" fill=\"none\"'\n                + ' stroke=\"currentColor\" stroke-width=\"1\"><line x1=\"8\" y1=\"1\" x2=\"8\" y2=\"15\"/>'\n                + '<line x1=\"1\" y1=\"8\" x2=\"15\" y2=\"8\"/><circle cx=\"8\" cy=\"8\" r=\"3.5\"/></svg>';\n            crosshairButton.onclick = () => {\n                this.crosshairEnabled = !this.crosshairEnabled;\n                if (!this.crosshairEnabled) this.setCrosshairVisible(false);\n                crosshairButton.className = this.crosshairEnabled\n                    ? \"btn btn-sm btn-secondary me-1\"\n                    : \"btn btn-sm btn-outline-secondary me-1\";\n            };\n        }\n\n        //  the settings button only exists where there is something to set\n        if (this.settingsAvailability() !== null) {\n            const settingsButton = ElementBuilder.append(this.toolbarContainer, \"button\", {\n                type: \"button\",\n                class: \"btn btn-sm btn-outline-secondary me-1 myd3-settings-button\",\n                title: this.t(\"trends.display.title\", \"Plot options\"),\n                \"aria-haspopup\": \"dialog\",\n                \"aria-expanded\": \"false\"\n            }).el() as HTMLButtonElement;\n            //  a gear: a dashed ring for the teeth around a solid one for the body\n            settingsButton.innerHTML = '<svg width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" fill=\"none\"'\n                + ' stroke=\"currentColor\"><circle cx=\"8\" cy=\"8\" r=\"5.75\" stroke-width=\"2.5\"'\n                + ' stroke-dasharray=\"2.258 2.258\"/><circle cx=\"8\" cy=\"8\" r=\"3.6\" stroke-width=\"2\"/></svg>';\n            const badge = this.customOptions?.displaySettingsBadge;\n            if (badge) {\n                //  the app-wide access dot (assets/css/access-badges.css), in the button's corner\n                settingsButton.style.position = \"relative\";\n                ElementBuilder.append(settingsButton, \"span\", {\n                    class: `badge-circle badge-${badge}`,\n                    style: { position: \"absolute\", top: \"2px\", right: \"2px\" }\n                });\n            }\n            settingsButton.onclick = () => this.toggleSettingsPanel();\n            this.settingsButton = settingsButton;\n        }\n\n        const imageButton = ElementBuilder.append(this.toolbarContainer, \"button\", {\n            type: \"button\",\n            class: \"btn btn-sm btn-outline-secondary\",\n            title: this.t(\"trends.image.save\", \"Save as image\")\n        }).el();\n        //  inlined (like the zoom icons) so the library does not depend on the\n        //  Django-served sprite, which is not on every page that hosts a chart\n        imageButton.innerHTML = '<svg width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" fill=\"none\"'\n            + ' stroke=\"currentColor\" stroke-width=\"1.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\">'\n            + '<path d=\"M8 2v8\"/><path d=\"M4.5 7 8 10.5 11.5 7\"/><path d=\"M2.5 13h11\"/></svg>';\n        imageButton.onclick = () => this.buildDownloadPopup();\n    }\n\n    /**\n     * What the settings button of this chart can configure — null when it has no\n     * button: the host did not make the display settings editable, or nothing of\n     * them applies to this chart.\n     */\n    private settingsAvailability(): SettingsAvailability | null {\n        const options = this.customOptions;\n        if (!options?.displaySettingsEditable || options.displaySettings === undefined) return null;\n        const axisDefault = (axis: \"x\" | \"y\", hidden: boolean) =>\n            !hidden && options.axisTitles?.[axis] ? options.axisTitles[axis] as string : null;\n        const yearAxis = this.isYearAxis();\n        const availability: SettingsAvailability = {\n            axisX: axisDefault(\"x\", this.shouldHideXAxisLabels()),\n            axisY: axisDefault(\"y\", this.shouldHideYAxisLabels()),\n            multi: this.multi.isMulti,\n            offsets: this.multi.isMulti && this.multi.layout.rteSeries.length >= 2,\n            yearFlag: yearAxis && !this.shouldHideXAxisLabels(),\n            yearBackground: yearAxis,\n            //  a host's own tooltip (tooltipBuilder) has no styles to choose from\n            tooltip: this.data?.type !== \"OTHER\" && !options.tooltipBuilder,\n        };\n        return Object.values(availability).some(value => value !== null && value !== false)\n            ? availability\n            : null;\n    }\n\n    private toggleSettingsPanel() {\n        const availability = this.settingsAvailability();\n        if (!availability || !this.settingsButton) return;\n        if (!this.settingsPanel) {\n            const button = this.settingsButton;\n            this.settingsPanel = new SettingsPanel({\n                anchor: button,\n                chart: this.plotElement,\n                availability,\n                badge: this.customOptions?.displaySettingsBadge ?? null,\n                t: (key, fallback) => this.t(key, fallback),\n                get: () => this.display,\n                set: settings => this.setDisplaySettings(settings, { notify: true }),\n                onClose: () => { button.className = button.className.replace(\"btn-secondary\", \"btn-outline-secondary\"); },\n            });\n        }\n        this.settingsPanel.toggle();\n        if (this.settingsPanel.isOpen) {\n            this.settingsButton.className = this.settingsButton.className.replace(\"btn-outline-secondary\", \"btn-secondary\");\n        }\n    }\n\n    /**\n     * Replace the display settings and redraw. `notify` tells the host\n     * (customOptions.onDisplaySettingsChange) — set by the settings panel; a host\n     * pushing settings into a sibling chart leaves it off.\n     */\n    setDisplaySettings(settings: unknown, options: { notify?: boolean } = {}) {\n        this.display = resolveDisplaySettings(settings);\n        if (this.customOptions) this.customOptions.displaySettings = this.display;\n        this.settingsPanel?.sync();\n        if (!this.settingsRedrawPending) {\n            this.settingsRedrawPending = true;\n            requestAnimationFrame(() => {\n                this.settingsRedrawPending = false;\n                //  the chart may have been unmounted in the meantime, or another instance\n                //  drew into the container (which detaches this one's toolbar)\n                if (this.plotSize() && this.toolbarContainer?.isConnected !== false) this.draw();\n            });\n        }\n        if (options.notify) this.customOptions?.onDisplaySettingsChange?.(this.display, this);\n    }\n\n    /**\n     * Translate with an English fallback — MyD3 can be constructed without a\n     * translate fn, and vue-i18n echoes the key back when it has no message.\n     */\n    private t(key: string, fallback: string): string {\n        if (typeof this.vueTranslation !== \"function\") return fallback;\n        const s = this.vueTranslation(key);\n        return s && s !== key ? s : fallback;\n    }\n\n    /**\n     * Open the download dialog. It is a Bootstrap-styled modal mounted on\n     * `document.body`: as a child of the plot container it was clipped by small\n     * charts, which put the expert controls and the format buttons out of reach.\n     */\n    buildDownloadPopup() {\n        if (this.popupContainer) return; //  already open\n\n        const $t = (key: string, fallback: string) => this.t(key, fallback);\n        const MIN_W = 400, MIN_H = 300, MAX_W = 2048, MAX_H = 2048;\n        const uid = `myd3dl${MyD3.dlSeq++}`;\n        const formatButtons: HTMLButtonElement[] = [];\n\n        const modal = ElementBuilder.create(\"div\", {\n            class: \"modal fade show\",\n            tabindex: \"-1\",\n            role: \"dialog\",\n            \"aria-modal\": \"true\",\n            \"aria-label\": $t(\"trends.image.dialogTitle\", \"Download plot as image\")\n        }).el();\n        modal.style.display = \"block\";\n        const backdrop = ElementBuilder.create(\"div\", { class: \"modal-backdrop fade show\" }).el();\n        const content = ElementBuilder.append(\n            ElementBuilder.append(modal, \"div\", {\n                class: \"modal-dialog modal-lg modal-dialog-centered modal-dialog-scrollable\"\n            }).el(),\n            \"div\", { class: \"modal-content\" }\n        ).el();\n\n        //  ---- helpers ----\n        const sectionTitle = (parent: HTMLElement, text: string) =>\n            ElementBuilder.append(parent, \"h6\", { class: \"fw-semibold mb-2\" }).text(text).el();\n\n        const field = (parent: HTMLElement, id: string, label: string,\n                       attrs: Record<string, unknown>): HTMLInputElement => {\n            ElementBuilder.append(parent, \"label\", { for: id, class: \"form-label small mb-1\" }).text(label);\n            return ElementBuilder.append(parent, \"input\", {\n                class: \"form-control form-control-sm\", id, ...attrs\n            }).el() as HTMLInputElement;\n        };\n\n        const clampInput = (input: HTMLInputElement, fallback: number, min: number, max: number): number => {\n            const parsed = parseFloat(input.value);\n            const value = isNaN(parsed) ? fallback : Math.max(min, Math.min(max, parsed));\n            input.value = `${value}`; //  reflect the clamp back to the user\n            return value;\n        };\n\n        //  ---- header ----\n        const header = ElementBuilder.append(content, \"div\", { class: \"modal-header\" }).el();\n        ElementBuilder.append(header, \"h5\", { class: \"modal-title\" })\n            .text($t(\"trends.image.dialogTitle\", \"Download plot as image\"));\n        const closeButton = ElementBuilder.append(header, \"button\", {\n            type: \"button\",\n            class: \"btn-close\",\n            \"aria-label\": $t(\"trends.image.close\", \"Close\")\n        }).el();\n\n        //  ---- body ----\n        const body = ElementBuilder.append(content, \"div\", { class: \"modal-body\" }).el();\n        ElementBuilder.append(body, \"p\", { class: \"text-muted small\" }).text($t(\"trends.image.text\",\n            \"You can download the plot as an image file. Please select the resolution you want to \"\n            + \"use and click a file format to start the download.\"));\n        const grid = ElementBuilder.append(body, \"div\", { class: \"row g-4\" }).el();\n\n        //  Scale a chart size into the accepted range, keeping its aspect ratio —\n        //  dashboard widgets are far below the minimum, and their unscaled size would\n        //  open the dialog in the invalid state.\n        const fitSize = (w: number, h: number): [number, number] => {\n            const grow = Math.max(MIN_W / w, MIN_H / h, 1);\n            w *= grow;\n            h *= grow;\n            const shrink = Math.min(MAX_W / w, MAX_H / h, 1);\n            return [Math.round(w * shrink), Math.round(h * shrink)];\n        };\n\n        //  resolution\n        const colSize = ElementBuilder.append(grid, \"div\", { class: \"col-md-6\" }).el();\n        sectionTitle(colSize, $t(\"trends.image.resolution\", \"Resolution\"));\n        const sizeRow = ElementBuilder.append(colSize, \"div\", { class: \"row g-2\" }).el();\n        const [startW, startH] = fitSize(this.dlWidth, this.dlHeight);\n        const inputW = field(ElementBuilder.append(sizeRow, \"div\", { class: \"col-6\" }).el(),\n            `${uid}-w`, $t(\"trends.image.width\", \"Width\"),\n            { type: \"number\", step: \"1\", min: `${MIN_W}`, max: `${MAX_W}`, value: `${startW}` });\n        const inputH = field(ElementBuilder.append(sizeRow, \"div\", { class: \"col-6\" }).el(),\n            `${uid}-h`, $t(\"trends.image.height\", \"Height\"),\n            { type: \"number\", step: \"1\", min: `${MIN_H}`, max: `${MAX_H}`, value: `${startH}` });\n\n        const presetRow = ElementBuilder.append(colSize, \"div\", { class: \"d-flex flex-wrap gap-1 mt-2\" }).el();\n        const presets: [string, number, number][] = [];\n        const screen = this.plotSize();\n        if (screen && screen.w > 0 && screen.h > 0) {\n            const [w, h] = fitSize(screen.w, screen.h);\n            presets.push([$t(\"trends.image.presetScreen\", \"As shown\"), w, h]);\n        }\n        presets.push([\"1024 × 768\", 1024, 768], [\"1600 × 1200\", 1600, 1200], [\"1920 × 1080\", 1920, 1080]);\n        for (const [label, w, h] of presets) {\n            const btn = ElementBuilder.append(presetRow, \"button\", {\n                type: \"button\", class: \"btn btn-sm btn-outline-secondary\"\n            }).text(label).el();\n            btn.onclick = () => {\n                inputW.value = `${w}`;\n                inputH.value = `${h}`;\n                resCheck();\n            };\n        }\n        ElementBuilder.append(colSize, \"div\", { class: \"form-text\" })\n            .text(`${MIN_W}–${MAX_W} × ${MIN_H}–${MAX_H} px`);\n        const errorText = ElementBuilder.append(colSize, \"div\", { class: \"text-danger small\" }).el();\n\n        //  labels drawn into the exported image\n        const colLabels = ElementBuilder.append(grid, \"div\", { class: \"col-md-6\" }).el();\n        sectionTitle(colLabels, $t(\"trends.image.labels\", \"Labels\"));\n        const inputTitle = field(ElementBuilder.append(colLabels, \"div\", { class: \"mb-2\" }).el(),\n            `${uid}-title`, $t(\"trends.image.title\", \"Title\"),\n            { type: \"text\", value: this.dlTitle || this.customOptions?.title || \"\" });\n        const inputSubtitle = field(ElementBuilder.append(colLabels, \"div\").el(),\n            `${uid}-subtitle`, $t(\"trends.image.subtitle\", \"Subtitle\"),\n            { type: \"text\", value: this.dlSubtitle || this.customOptions?.subtitle || \"\" });\n\n        //  expert-only rendering knobs\n        let inputStrokeWidth: HTMLInputElement | null = null;\n        let inputStrokeWidthMul: HTMLInputElement | null = null;\n        let inputFontSizeMul: HTMLInputElement | null = null;\n        if (this.customOptions?.expertMode) {\n            const expert = ElementBuilder.append(body, \"div\", { class: \"border rounded bg-light p-3 mt-4\" }).el();\n            const expertHead = ElementBuilder.append(expert, \"div\", {\n                class: \"d-flex align-items-center gap-2 mb-2\"\n            }).el();\n            ElementBuilder.append(expertHead, \"span\", { class: \"badge-circle badge-admin\" });\n            ElementBuilder.append(expertHead, \"h6\", { class: \"fw-semibold mb-0\" })\n                .text($t(\"trends.image.options\", \"Expert settings\"));\n            const expertRow = ElementBuilder.append(expert, \"div\", { class: \"row g-2\" }).el();\n            const expertCol = () => ElementBuilder.append(expertRow, \"div\", { class: \"col-sm-4\" }).el();\n            inputStrokeWidth = field(expertCol(), `${uid}-sw`, $t(\"trends.image.strokeWidthMain\", \"Stroke width\"),\n                { type: \"number\", step: \"0.05\", min: \"0.5\", max: \"20\", value: `${this.dlStrokeWidth}` });\n            inputStrokeWidthMul = field(expertCol(), `${uid}-swm`, $t(\"trends.image.strokeWidthMul\", \"Stroke width multiplier\"),\n                { type: \"number\", step: \"0.05\", min: \"0.25\", max: \"3\", value: `${this.dlStrokeWidthMul}` });\n            inputFontSizeMul = field(expertCol(), `${uid}-fsm`, $t(\"trends.image.fontSizeMul\", \"Font size multiplier\"),\n                { type: \"number\", step: \"0.05\", min: \"0.5\", max: \"3\", value: `${this.dlFontSizeMul}` });\n        }\n\n        //  ---- footer: one button per file format ----\n        const footer = ElementBuilder.append(content, \"div\", { class: \"modal-footer justify-content-between\" }).el();\n        ElementBuilder.append(footer, \"span\", { class: \"fw-semibold small\" })\n            .text($t(\"trends.image.save\", \"Save as image\"));\n        const formatsRow = ElementBuilder.append(footer, \"div\", { class: \"btn-group\" }).el();\n        for (const format of [\"SVG\", \"PNG\", \"JPEG\", \"WEBP\"]) {\n            const btn = ElementBuilder.append(formatsRow, \"button\", {\n                type: \"button\", class: \"btn btn-sm btn-primary\"\n            }).text(format).el() as HTMLButtonElement;\n            btn.onclick = () => {\n                if (!isValidResolution()) return;\n                this.dlWidth = parseInt(inputW.value);\n                this.dlHeight = parseInt(inputH.value);\n                if (inputFontSizeMul) this.dlFontSizeMul = clampInput(inputFontSizeMul, this.dlFontSizeMul, 0.5, 3.0);\n                if (inputStrokeWidth) this.dlStrokeWidth = clampInput(inputStrokeWidth, this.dlStrokeWidth, 0.5, 20.0);\n                if (inputStrokeWidthMul) this.dlStrokeWidthMul = clampInput(inputStrokeWidthMul, this.dlStrokeWidthMul, 0.25, 3.0);\n                this.dlTitle = inputTitle.value;\n                this.dlSubtitle = inputSubtitle.value;\n                this.download({\n                    type: format.toLowerCase(),\n                    width: this.dlWidth,\n                    height: this.dlHeight,\n                    name: this.customOptions?.downloadName || \"plot\"\n                });\n            };\n            formatButtons.push(btn);\n        }\n\n        //  ---- validation ----\n        const isValidResolution = () => {\n            const w = parseInt(inputW.value);\n            const h = parseInt(inputH.value);\n            return !isNaN(w) && !isNaN(h) && w >= MIN_W && h >= MIN_H && w <= MAX_W && h <= MAX_H;\n        };\n        const resCheck = () => {\n            const valid = isValidResolution();\n            errorText.textContent = valid ? \"\" : $t(\"trends.image.invalidResolution\", \"Invalid resolution\");\n            for (const btn of formatButtons) btn.disabled = !valid;\n            if (valid) {\n                this.dlWidth = parseInt(inputW.value);\n                this.dlHeight = parseInt(inputH.value);\n            }\n        };\n        inputW.addEventListener(\"input\", resCheck);\n        inputH.addEventListener(\"input\", resCheck);\n\n        //  ---- mount + dismissal ----\n        const close = () => this.closeDownloadPopup();\n        closeButton.onclick = close;\n        //  mousedown (not click) so a drag that ends outside the dialog does not close it\n        modal.addEventListener(\"mousedown\", (e: MouseEvent) => {\n            if (e.target === modal) close();\n        });\n        this.popupKeyHandler = (e: KeyboardEvent) => {\n            if (e.key === \"Escape\") close();\n        };\n        document.addEventListener(\"keydown\", this.popupKeyHandler);\n        //  the chart can be torn down (route change, component unmount) while the dialog\n        //  is open — it hangs off <body>, so nothing else would ever remove it\n        this.popupWatchTimer = window.setInterval(() => {\n            if (!this.plotSize()) close();\n        }, 500);\n\n        document.body.appendChild(backdrop);\n        document.body.appendChild(modal);\n        document.body.classList.add(\"modal-open\");\n        this.popupContainer = modal;\n        this.popupBackdrop = backdrop;\n        resCheck();\n        inputW.focus();\n        inputW.select();\n    }\n\n    /** Remove the dialog and everything it registered outside the chart. */\n    closeDownloadPopup() {\n        if (this.popupKeyHandler) {\n            document.removeEventListener(\"keydown\", this.popupKeyHandler);\n            this.popupKeyHandler = undefined;\n        }\n        if (this.popupWatchTimer !== undefined) {\n            window.clearInterval(this.popupWatchTimer);\n            this.popupWatchTimer = undefined;\n        }\n        if (this.popupContainer) this.popupContainer.remove();\n        if (this.popupBackdrop) this.popupBackdrop.remove();\n        this.popupContainer = undefined;\n        this.popupBackdrop = undefined;\n        //  a chart can sit inside another modal — only give the body its scroll back\n        //  once no modal at all is left open\n        if (!document.querySelector(\".modal.show\")) {\n            document.body.classList.remove(\"modal-open\");\n        }\n    }\n\n    /** On-screen size of the chart container, or null when it is gone from the DOM. */\n    private plotSize(): { w: number; h: number } | null {\n        let elm: HTMLElement | undefined;\n        try {\n            elm = this.plotElement;\n        }\n        catch (e) {\n            return null;\n        }\n        if (!elm || !elm.isConnected) return null;\n        return { w: Math.round(elm.clientWidth), h: Math.round(elm.clientHeight) };\n    }\n\n    /**\n     * Download the plot as an image\n     * @param type The type of image to download\n     */\n    download(options: any) {\n        if (options.type === 'svg') {\n            this.toSvg(options);\n        }\n        else {\n            this.toImage(options);\n        }\n    }\n\n\n    /**\n     * For downloading the plot as an image, we first create a SVG image as URL (which can be the src of an image)\n     * @private\n     */\n    private svgInit(options: any): any {\n        let svg;\n        if (options.width) {\n            //svg = d3.select('#' + this.plotId).select(\"svg\");\n            svg = d3.create(\"svg\").attr(\"width\", options.width).attr(\"height\", options.height);\n            options.svg = svg;\n            //  draw() leaves its scales, panels and hover parts on the instance; the\n            //  on-screen chart is still live and its hover handlers read them, so put\n            //  the on-screen ones back once the export copy is drawn\n            const onScreen = {\n                svg: this.svg,\n                axisX: this.axisX,\n                axisY: this.axisY,\n                panels: this.panels,\n                crosshairParts: this.crosshairParts,\n            };\n            this.draw(options);\n            Object.assign(this, onScreen);\n            //  no <foreignObject> may end up in an export (the tooltips of some renderables\n            //  are one): Chrome taints a canvas painted from an SVG that contains one, which\n            //  made every raster export fail with \"Tainted canvases may not be exported\"\n            svg.selectAll(\"foreignObject\").remove();\n        }\n        else {\n            svg = d3.select(this.plotElement).select(\"svg\");\n        }\n        const svgNode = svg.node() as SVGSVGElement;\n        if (!svgNode) {\n            throw new Error(\"Could not create SVG Node\");\n        }\n        const svgString = new XMLSerializer().serializeToString(svgNode);\n        const blob = new Blob([svgString], { type: \"image/svg+xml\" });\n        const DOMURL = window.URL || window.webkitURL || window;\n        const url = DOMURL.createObjectURL(blob);\n        console.log(\"Created SVG Image with len \" + url.length + \" and svg XML len = \" + svgString.length);\n        return {\n            svg: svg,\n            url: url\n        }\n    }\n\n    /**\n     * Creates an SVG image from the plot\n     * @private\n     */\n    private createSvgImage(options: any) {\n        const data = this.svgInit(options);\n        data.img = new Image();\n        data.img.src = data.url;\n        return data;\n    }\n\n    /**\n     * Creates a download link and clicks it\n     * @param url\n     * @param name\n     * @private\n     */\n    private downloadClick(url: string, name: string) {\n        const downloadLink = document.createElement(\"a\");\n        downloadLink.href = url;\n        downloadLink.download = name;\n        downloadLink.click();\n\n        const DOMURL = window.URL || window.webkitURL || window;\n        DOMURL.revokeObjectURL(url);\n    }\n\n    /**\n     * Downloads the plot as an image of the given type\n     * @param type the type of image to download (png, jpeg, ...)\n     * @private\n     */\n    private toImage(options: any) {\n        const data = this.createSvgImage(options);\n        let svgSize: any;\n        if (options.width) {\n            svgSize = { width: options.width, height: options.height };\n        }\n        else {\n            svgSize = data.svg.node().getBoundingClientRect();\n        }\n        console.log(\"SVG size = \" + svgSize.width + \" x \" + svgSize.height);\n        const dl = this.downloadClick;\n        data.img.onload = function () {\n            const canvas = document.createElement('canvas');\n            canvas.width = svgSize.width;\n            canvas.height = svgSize.height;\n            data.img.width = canvas.width;\n            data.img.height = canvas.height;\n            const ctx = canvas.getContext('2d');\n            if (!ctx) {\n                return;\n            }\n            ctx.drawImage(data.img, 0, 0);\n            const imgURI = canvas\n                .toDataURL(\"image/\" + options.type);\n            // .replace(\"image/png\", \"image/octet-stream\");\n            dl(imgURI, `${options.name}.${options.type}`);\n        }\n    }\n\n    /**\n     * Downloads the plot as an SVG image\n     * @private\n     */\n    private toSvg(options: any) {\n        const data = this.svgInit(options);\n        this.downloadClick(data.url, `${options.name}.svg`);\n    }\n\n    /**\n     * Truncate text to fit within available space with ellipsis\n     * @param text Original text\n     * @param maxWidth Maximum width in pixels\n     * @param fontSize Font size in pixels\n     * @returns Truncated text with ellipsis if needed\n     */\n    public truncateTextWithEllipsis(text: string, maxWidth: number, fontSize: number): string {\n        if (maxWidth <= 0) return '';\n\n        // Estimate character width (roughly 0.6 * fontSize for most fonts)\n        const avgCharWidth = fontSize * 0.6;\n        const ellipsisWidth = avgCharWidth * 3; // Width of \"...\"\n\n        // If the text fits, return as is\n        const textWidth = text.length * avgCharWidth;\n        if (textWidth <= maxWidth) {\n            return text;\n        }\n\n        // Calculate how many characters we can fit including ellipsis\n        const availableWidthForText = maxWidth - ellipsisWidth;\n        const maxChars = Math.floor(availableWidthForText / avgCharWidth);\n\n        if (maxChars <= 0) {\n            return '...';\n        }\n\n        return text.substring(0, maxChars) + '...';\n    }\n\n    /**\n     * Apply text shadow and positioning for bar chart labels\n     * @param textSelection D3 selection of text elements\n     */\n    public applyBarLabelStyling(textSelection: any): void {\n        textSelection\n            // A solid white outline (painted under the glyphs) keeps labels readable on any bar color\n            .style('paint-order', 'stroke')\n            .style('stroke', 'rgba(255,255,255,0.9)')\n            .style('stroke-width', '3px')\n            .style('stroke-linejoin', 'round')\n            .style('pointer-events', 'all')  // Enable mouse interactions for tooltips\n            .style('cursor', 'pointer');      // Show pointer cursor on hover\n    }\n\n    /**\n     * Whether on-bar labels should be drawn for bands of the given thickness.\n     * 'auto' (default) skips labels that would be physically unreadable.\n     */\n    public shouldRenderBarLabels(bandSize: number, minReadable: number): boolean {\n        const mode = this.customOptions?.barLabels ?? 'auto';\n        if (mode === 'never') return false;\n        if (mode === 'always') return true;\n        return bandSize >= minReadable;\n    }\n\n    /**\n     * Get the text anchor and alignment settings for bar labels\n     * @param isVertical Whether this is for a vertical bar chart (rotated text)\n     * @returns Object with text-anchor and dominant-baseline values\n     */\n    public getBarLabelAlignment(isVertical = false): { textAnchor: string; dominantBaseline: string } {\n        const align = this.customOptions?.align || \"start\";\n\n        if (isVertical) {\n            // For vertical bars (rotated -90 degrees), alignment logic is inverted\n            switch (align) {\n                case \"start\":\n                    return { textAnchor: \"end\", dominantBaseline: \"central\" };\n                case \"middle\":\n                    return { textAnchor: \"middle\", dominantBaseline: \"central\" };\n                case \"end\":\n                    return { textAnchor: \"start\", dominantBaseline: \"central\" };\n                default:\n                    return { textAnchor: \"end\", dominantBaseline: \"central\" };\n            }\n        } else {\n            // For horizontal bars (normal text)\n            switch (align) {\n                case \"start\":\n                    return { textAnchor: \"start\", dominantBaseline: \"central\" };\n                case \"middle\":\n                    return { textAnchor: \"middle\", dominantBaseline: \"central\" };\n                case \"end\":\n                    return { textAnchor: \"end\", dominantBaseline: \"central\" };\n                default:\n                    return { textAnchor: \"start\", dominantBaseline: \"central\" };\n            }\n        }\n    }\n\n    /**\n     * Calculate simple label position for bar charts\n     * @param barBounds Object with bar positioning info\n     * @param plotBounds Object with plot area bounds\n     * @param textBounds Object with text dimensions\n     * @param isVertical Whether this is for vertical bars\n     * @returns Object with x and y coordinates for label placement\n     */\n    public calculateBarLabelPosition(\n        barBounds: { left: number; right: number; top: number; bottom: number; center: { x: number; y: number } },\n        plotBounds: { left: number; right: number; top: number; bottom: number },\n        textBounds: { width: number; height: number },\n        isVertical = false\n    ): { x: number; y: number } {\n        const align = this.customOptions?.align || \"start\";\n        const margin = 5; // Small margin from bar edges\n\n        if (isVertical) {\n            // For vertical bars, position horizontally at bar center, vertically based on alignment\n            const x = barBounds.center.x;\n            let y: number;\n\n            switch (align) {\n                case \"start\":\n                    // For rotated text, \"start\" means top of the bar\n                    y = Math.max(plotBounds.top + textBounds.height / 2 + margin, barBounds.top + margin);\n                    break;\n                case \"end\":\n                    // For rotated text, \"end\" means bottom of the bar\n                    y = Math.min(plotBounds.bottom - textBounds.height / 2 - margin, barBounds.bottom - margin);\n                    break;\n                case \"middle\":\n                default:\n                    // Center in the bar or plot area\n                    y = barBounds.center.y;\n                    break;\n            }\n\n            // Ensure text stays within plot bounds\n            y = Math.max(plotBounds.top + textBounds.height / 2, Math.min(plotBounds.bottom - textBounds.height / 2, y));\n            return { x, y };\n        } else {\n            // For horizontal bars, position vertically at bar center, horizontally based on alignment\n            const y = barBounds.center.y;\n            let x: number;\n\n            switch (align) {\n                case \"start\":\n                    // Start at the beginning of the bar or plot area\n                    x = Math.max(plotBounds.left + margin, barBounds.left + margin);\n                    break;\n                case \"end\":\n                    // End at the end of the bar or plot area\n                    x = Math.min(plotBounds.right - margin, barBounds.right - margin);\n                    break;\n                case \"middle\":\n                default:\n                    // Center in the bar\n                    x = barBounds.center.x;\n                    break;\n            }\n\n            // Ensure text stays within plot bounds, respecting the text anchor\n            // (a start-anchored label extends to the right of x, not around it)\n            switch (align) {\n                case \"start\":\n                    x = Math.max(plotBounds.left + margin, Math.min(plotBounds.right - textBounds.width - margin, x));\n                    break;\n                case \"end\":\n                    x = Math.max(plotBounds.left + textBounds.width + margin, Math.min(plotBounds.right - margin, x));\n                    break;\n                default:\n                    x = Math.max(plotBounds.left + textBounds.width / 2, Math.min(plotBounds.right - textBounds.width / 2, x));\n            }\n            return { x, y };\n        }\n    }\n\n    /**\n     * Clamp text position to stay within plot boundaries\n     * @param position Current position\n     * @param textLength Estimated text length\n     * @param minBound Minimum boundary\n     * @param maxBound Maximum boundary\n     * @param isVertical Whether this is vertical positioning\n     * @returns Clamped position\n     */\n    private clampTextPosition(position: number, textLength: number, minBound: number, maxBound: number, isVertical = false): number {\n        const halfLength = textLength / 2;\n\n        if (isVertical) {\n            // For vertical text, check bounds differently\n            return Math.max(minBound + halfLength, Math.min(maxBound - halfLength, position));\n        } else {\n            // For horizontal text\n            return Math.max(minBound + halfLength, Math.min(maxBound - halfLength, position));\n        }\n    }\n\n    /**\n     * Combines small items in categorical data based on grouping options\n     */\n    public groupSmallItems<T extends any[]>(\n        data: T,\n        getValue: (item: T[0]) => number,\n        getLabel: (item: T[0]) => string,\n        setLabel: (item: T[0], label: string) => T[0],\n        setValue: (item: T[0], value: number) => T[0],\n        groupOptions?: MyD3CustomOptions['groupSmallItems']\n    ): T {\n        if (!groupOptions || (!groupOptions.maxItems && !groupOptions.minPercentage)) {\n            return data;\n        }\n\n        const sortedData = [...data].sort((a, b) => getValue(b) - getValue(a));\n        const groupLabel = groupOptions.groupLabel || 'Others';\n        const totalValue = sortedData.reduce((sum, item) => sum + getValue(item), 0);\n\n        let itemsToKeep: T[0][] = [];\n        let itemsToGroup: T[0][] = [];\n\n        // Apply minimum percentage threshold\n        if (groupOptions.minPercentage !== undefined && totalValue > 0) {\n            for (const item of sortedData) {\n                const percentage = (getValue(item) / totalValue) * 100;\n                if (percentage >= groupOptions.minPercentage) {\n                    itemsToKeep.push(item);\n                } else {\n                    itemsToGroup.push(item);\n                }\n            }\n        } else {\n            itemsToKeep = sortedData;\n        }\n\n        // Apply maximum items limit\n        if (groupOptions.maxItems !== undefined && itemsToKeep.length > groupOptions.maxItems) {\n            const keepItems = itemsToKeep.slice(0, groupOptions.maxItems);\n            const groupItems = itemsToKeep.slice(groupOptions.maxItems);\n            itemsToKeep = keepItems;\n            itemsToGroup = [...itemsToGroup, ...groupItems];\n        }\n\n        // Create grouped item if needed\n        if (itemsToGroup.length > 0) {\n            const groupedValue = itemsToGroup.reduce((sum, item) => sum + getValue(item), 0);\n\n            // Use the first item as template and modify its values\n            const groupedItem: any = setValue(setLabel(itemsToGroup[0], groupLabel), groupedValue);\n\n            // Ensure the grouped item has a hue property for rendering\n            // If the first item doesn't have a hue, assign a neutral one\n            if (groupedItem.hue === undefined || groupedItem.hue === null) {\n                groupedItem.hue = 0; // Gray color for grouped items\n            }\n\n            // Store grouped children information for enhanced tooltips\n            groupedItem._groupedChildren = itemsToGroup.map(item => ({\n                label: getLabel(item),\n                value: getValue(item),\n                percentage: totalValue > 0 ? (getValue(item) / totalValue) * 100 : 0\n            }));\n            (groupedItem as any)._isGroupedItem = true;\n\n            itemsToKeep.push(groupedItem);\n        }\n\n        return itemsToKeep as T;\n    }\n}\n\nexport { MyD3, MyPlotVisuals, MyD3CustomOptions, TooltipContext, TooltipTraceData };\n","import type { MyD3CustomOptions, PlotData } from \"../myd3/types\";\n\nexport interface InlaPanelRow {\n    x: number;\n    y: number;\n    ymin: number;\n    ymax: number;\n    y_der: number;\n    y_dermin: number;\n    y_dermax: number;\n    sig: \"increasing\" | \"decreasing\" | \"not significant\" | string;\n    // Random time effects (inla_hurdle.R, `year_effects` on): the integer year's trend +\n    // its year effect on the panel's scale; null on the other grid rows and absent in\n    // emissions without them.\n    rte_val?: number | null;\n    rte_low?: number | null;\n    rte_high?: number | null;\n}\n\n/**\n * MyD3 options for the component panels (p0/p1/p2). Since the 2026-08-14\n * emission change (inla_hurdle.R) these carry raw response scales — P(occupied),\n * P(colony|occ), animals per colony — not a 1.0-indexed trend. So: fit the\n * y-axis to the data instead of forcing the classic 0–2 index frame (keeping\n * the zero floor), pad the top so the CI band clears the frame, and drop the\n * y=1.0 index guide, which has no meaning on these scales. The indexed panels\n * (p12/p123) keep the MyD3 defaults. Legacy emissions (all five panels indexed,\n * no meta.raw_component_panels) still render correctly with these options —\n * the axis simply fits the indexed curve.\n */\nexport const RAW_SCALE_PANEL_OPTIONS: MyD3CustomOptions = {\n    yIncludeValues: [0],\n    yPadTopRatio: 0.05,\n    hideUnityLine: true,\n};\n\n// Matches myd3/utils/significance.ts: 1 -> increase colour, 2 -> decrease, 0/other -> full colour.\nexport const SIG_TO_INT: Record<string, number> = {\n    \"increasing\": 1,\n    \"decreasing\": 2,\n    \"not significant\": 0,\n};\n\n// Palette matches the canonical HGAM trace (bats/plotter/compute/cc_plotbuilder.py:188-189).\nconst INCREASE = \"#16a34a\";\nconst DECREASE = \"#dc2626\";\n// Neutral hue for \"not significant\" segments and the CI band — the account slate-500\n// (--color-text-muted) so the figure reads as native to the dashboard palette.\nconst NEUTRAL = \"#64748b\";\n\n/**\n * Hue (0-360) -> \"#rrggbb\".\n *\n * MyD3 resolves `style.color` through PlotModel.applyColorHex, whose regex accepts\n * ONLY a 6-digit hex — an `hsl()`/`hsla()` string is silently ignored and the trace\n * falls back to the hue-derived default (blue). Callers tinting a trace from a hue\n * must convert here first.\n */\nexport function hueToHex(hue: number, s = 0.7, l = 0.45): string {\n    const h = ((hue % 360) + 360) % 360;\n    const c = (1 - Math.abs(2 * l - 1)) * s;\n    const x = c * (1 - Math.abs(((h / 60) % 2) - 1));\n    const m = l - c / 2;\n    const seg = Math.floor(h / 60) % 6;\n    const rgb = [\n        [c, x, 0], [x, c, 0], [0, c, x], [0, x, c], [x, 0, c], [c, 0, x],\n    ][seg];\n    const hex = (v: number) =>\n        Math.round((v + m) * 255).toString(16).padStart(2, \"0\");\n    return `#${hex(rgb[0])}${hex(rgb[1])}${hex(rgb[2])}`;\n}\n\n/**\n * Pick, for every integer year covered by the panel, the row closest to it.\n *\n * On grids emitted in multiplier mode (inla_hurdle.R, year_grid_m > 0) the integer\n * years are exact grid members, so this reduces to an exact extraction. Legacy\n * 18-point grids only contain the two endpoint years — nearest-row snapping keeps\n * those rows' tooltips approximately placed (the curve is smooth, so the y at\n * x=2006.06 is visually the y at 2006) until the row is recomputed.\n */\nfunction rowPerYear(panel: InlaPanelRow[]): Map<number, InlaPanelRow> {\n    const best = new Map<number, InlaPanelRow>();\n    for (const row of panel) {\n        const year = Math.round(row.x);\n        const prev = best.get(year);\n        if (!prev || Math.abs(row.x - year) < Math.abs(prev.x - year)) {\n            best.set(year, row);\n        }\n    }\n    return best;\n}\n\n/**\n * Turn one INLA trend panel (p0/p1/p2/p12/p123) into a MyD3 \"trend\" PlotData.\n *\n * Two traces, mirroring the server-side HGAM pattern (D3PlotHelperGamCC.init_plot):\n * - the LINE trace: every grid point, per-segment significance colouring at the\n *   grid's full resolution, `hideFocus` so it never answers hover — the fine grid\n *   would otherwise put fractional years in the tooltip header.\n * - the YEAR trace: one row per integer year (see rowPerYear), `hideGraph` so it\n *   draws nothing — it exists solely to give the tooltip integer-year snap points\n *   and, when `opts.sitesPerYear` is provided, the per-year site count.\n *\n * The filled 95% CI band renders from ciLow/ciHigh via AreaRenderable\n * (visuals.showErrorArea is on by default). We map the emitted ymin/ymax to those\n * columns.\n *\n * Random time effects: when the panel carries rte_val/rte_low/rte_high on every\n * integer-year row (HURDLE fitted with year effects), the year trace gets the\n * rteVal/rteLow/rteHigh columns and keyRteLow/keyRteHigh -- exactly HGAM's per-year\n * trace (D3PlotHelperHGamCC), so TrendHandler draws the same dots with whiskers.\n * `opts.yearEffects: false` leaves them out (e.g. when overlaying several sources).\n *\n * `opts.color` collapses all three colours onto one flat hue. Overlaying several\n * sources in the compare tool needs each source to read as a single identifiable\n * line, which per-segment significance colouring would defeat. Omit it and the\n * significance palette applies as normal.\n *\n * It must be a 6-digit hex — see hueToHex above for why.\n */\nexport function inlaTrendToTraces(\n    panel: InlaPanelRow[],\n    opts: { title?: string; color?: string; sitesPerYear?: Record<string, number>; yearEffects?: boolean } = {},\n): PlotData {\n    const style = {\n        // color drives the neutral line segments + CI band; colors.increase/decrease\n        // recolour the locally-significant segments (myd3/utils/significance.ts).\n        color: opts.color || NEUTRAL,\n        colors: opts.color\n            ? { increase: opts.color, decrease: opts.color }\n            : { increase: INCREASE, decrease: DECREASE },\n    };\n\n    const lineH = [\"year\", \"y\", \"ciLow\", \"ciHigh\", \"significance\"];\n    const lineR = panel.map((row) => [\n        row.x,\n        row.y,\n        row.ymin,\n        row.ymax,\n        SIG_TO_INT[row.sig] ?? 0,\n    ]);\n    const lineTrace = {\n        title: opts.title || \"\",\n        settings: {\n            type: \"trend\",\n            keyX: \"year\",\n            keyY: \"y\",\n            hideFocus: true,\n            style,\n        },\n        items: { h: lineH, r: lineR },\n    };\n\n    const hasSites = opts.sitesPerYear !== undefined;\n    const yearRows = [...rowPerYear(panel).entries()].sort((a, b) => a[0] - b[0]);\n    const isRte = (v: number | null | undefined) => typeof v === \"number\" && Number.isFinite(v);\n    // only when every year has its value: a legacy grid without exact integer years\n    // (or an emission without year effects) draws the trend alone\n    const hasRte = opts.yearEffects !== false && yearRows.length > 0 && yearRows.every(([year, row]) =>\n        row.x === year && isRte(row.rte_val) && isRte(row.rte_low) && isRte(row.rte_high));\n    const yearH = [\"year\", \"y\", \"ciLow\", \"ciHigh\", \"significance\"];\n    if (hasSites) yearH.push(\"nbSites\");\n    if (hasRte) yearH.push(\"rteVal\", \"rteLow\", \"rteHigh\");\n    const yearR: number[][] = [];\n    for (const [year, row] of yearRows) {\n        const r = [\n            year,\n            row.y,\n            row.ymin,\n            row.ymax,\n            SIG_TO_INT[row.sig] ?? 0,\n        ];\n        // 0 when the year is absent from the map — same fallback the HGAM builder\n        // uses (cc_plotbuilder.py: sites_per_year miss -> 0).\n        if (hasSites) r.push(opts.sitesPerYear![String(year)] ?? 0);\n        if (hasRte) r.push(row.rte_val as number, row.rte_low as number, row.rte_high as number);\n        yearR.push(r);\n    }\n    const yearTrace = {\n        title: opts.title || \"\",\n        settings: {\n            type: \"trend\",\n            keyX: \"year\",\n            keyY: \"y\",\n            hideGraph: true,\n            style,\n            ...(hasRte ? { keyRteLow: \"rteLow\", keyRteHigh: \"rteHigh\" } : {}),\n        },\n        items: { h: yearH, r: yearR },\n    };\n\n    return { traces: [lineTrace, yearTrace] };\n}\n","/**\n * Merges the per-observation-type payloads from the plotter API (response.obsPlots,\n * see bats/plotter/api.py::_build_all_obs_type_plots) into a single MyD3 PlotData for\n * the \"all in one\" trend layout.\n *\n * Deliberately plain JS with the INLA converter injected: this keeps the module free\n * of build-step dependencies so `node --test` can exercise it directly, and keeps\n * merging separable from conversion.\n */\n\n/**\n * Per-type line identity. The base observation type (matching `baseObsId` — it is\n * the one the map and the species header describe) keeps a solid line; the rest are\n * dashed so overlapping trends stay tellable apart at a glance. If `baseObsId` is\n * absent or contributes no traces, the first contributing type in the requested\n * order keeps the solid line instead.\n */\nexport const OBS_TYPE_STYLE = {\n  W: { hue: 210, dash: '8,4' },\n  S: { hue: 30, brightness: 0.8, dash: '8,4' },\n  SBB: { hue: 280, dash: '2,3' },\n  SEC: { hue: 130, brightness: 0.6, dash: '6,3' },\n};\n// `brightness` (default 1) scales the lightness of every colour MyD3 derives from\n// the hue (the third hsva component). Orange and green at full brightness are too\n// light for a line on white — 2.5:1 and 1.3:1 against the surface — so those two\n// are darkened to pass 3:1. The resulting line colours (#007fff, #cc6600, #aa00ff,\n// #00991a) pass the dataviz palette validator: lightness band, chroma, colour-vision\n// separation and contrast.\n\nconst DEFAULT_STYLE = { hue: 0, dash: '4,4' };\n\n/** Traces for one type, already titled but not yet styled. */\nfunction tracesFor(payload, label, inlaToTraces) {\n  const plot = payload && payload.plot;\n  if (!plot) return [];\n  if (plot.type === 'inla') {\n    const panel = plot.trend && plot.trend.panels && plot.trend.panels.p123;\n    if (!panel) return [];\n    return inlaToTraces(panel, { title: label, sitesPerYear: plot.sites_per_year }).traces;\n  }\n  if (!plot.traces) return [];\n  // Deep copy: the same payload also feeds the side-by-side layout and the sources\n  // card, which must keep the server's own styling.\n  return JSON.parse(JSON.stringify(plot.traces)).map((trace) => ({\n    ...trace,\n    title: trace.title ? `${trace.title} (${label})` : label,\n  }));\n}\n\nexport function mergeObsPlots(obsPlots, order, labels, inlaToTraces, baseObsId) {\n  // Pre-compute per-type traces so we know, up front, which types actually\n  // contribute — needed both to resolve the fallback (first contributing type)\n  // and to decide whether the requested baseObsId is usable.\n  const byId = {};\n  // Carry the backend's top-level plot.settings (e.g. `zoom`) through the merge —\n  // take it from the first source plot in `order` that has one. It is chart-wide\n  // config, not per-series, so any contributing type is an equally valid donor.\n  // (Note the merged chart draws INLA sources through inlaToTraces, which builds a\n  // wholly new plot object — so an INLA plot can donate its `settings` here, but on\n  // the single/grid paths a backend `settings.zoom` never survives that adapter.)\n  let settings;\n  for (const obsId of order) {\n    const plot = obsPlots && obsPlots[obsId] && obsPlots[obsId].plot;\n    if (plot && plot.settings) {\n      settings = plot.settings;\n      break;\n    }\n  }\n  for (const obsId of order) {\n    const label = (labels && labels[obsId]) || obsId;\n    const own = tracesFor(obsPlots && obsPlots[obsId], label, inlaToTraces);\n    if (own.length) byId[obsId] = own;\n  }\n\n  let solidId = (baseObsId && byId[baseObsId]) ? baseObsId : null;\n  if (!solidId) {\n    for (const obsId of order) {\n      if (byId[obsId]) {\n        solidId = obsId;\n        break;\n      }\n    }\n  }\n\n  const traces = [];\n  for (const obsId of order) {\n    const own = byId[obsId];\n    if (!own) continue;\n    const style = OBS_TYPE_STYLE[obsId] || DEFAULT_STYLE;\n    const isSolid = obsId === solidId;\n    for (const trace of own) {\n      trace.settings = trace.settings || {};\n      // One series per observation type: MyD3 groups the traces of a type by this\n      // key (legend entry, lane of its year effects, row in the \"rows\" style) and\n      // names it by the bare label — the trace title may carry a model prefix.\n      trace.settings.seriesKey = obsId;\n      trace.settings.seriesLabel = (labels && labels[obsId]) || obsId;\n      trace.settings.style = { ...(trace.settings.style || {}) };\n      // PlotModel.applyStyle applies hsva first, then lets an explicit style.color\n      // (and its `colors` sibling) override the whole derived palette. INLA traces\n      // (inlaTrendToTraces.ts) always carry a `color`/`colors` pair, which would\n      // silently defeat the merge hue below — drop them so hsva actually wins.\n      delete trace.settings.style.color;\n      delete trace.settings.style.colors;\n      trace.settings.style.hsva = [style.hue, 1, style.brightness ?? 1, 1];\n      if (!isSolid) trace.settings.style.dashArray = style.dash;\n      traces.push(trace);\n    }\n  }\n  // Always 'TG': the backend serves single trend plots as that type, and MyD3 keys\n  // per-trace tooltip labels (and TG significance styling) off plot.type — dropping\n  // it here would leave the merged tooltip rows unlabelled.\n  const merged = { type: 'TG', traces };\n  if (settings) merged.settings = settings;\n  return merged;\n}\n","/**\n * Where the trends page keeps the display settings of its charts (axis titles, the\n * multi-series style, hover and tooltip — see lib/myd3/core/DisplaySettings.ts): in\n * this browser's localStorage. MyD3 itself never persists anything.\n *\n * Only admins may change the settings for now, so only admins read stored ones:\n * everybody else always gets `{}`, which MyD3 resolves to its defaults — a browser\n * an admin once used must not show a visitor that admin's choices.\n *\n * Plain JS with the storage injectable, so `node --test` can exercise it.\n */\n\n// v2: the settings changed shape and defaults (no \"stems\" style, no px cap, a\n// tooltip style) — what a browser stored under v1 is left behind, not migrated.\nexport const PLOT_DISPLAY_STORAGE_KEY = 'batlas.plotDisplaySettings.v2';\n\nfunction browserStorage() {\n  try {\n    return typeof window !== 'undefined' ? window.localStorage : null;\n  } catch (e) {\n    // access itself can throw when storage is blocked\n    return null;\n  }\n}\n\n/** The stored settings (possibly partial or stale — MyD3 sanitises them), or `{}`. */\nexport function loadPlotDisplaySettings(canEdit, storage = browserStorage()) {\n  if (!canEdit || !storage) return {};\n  try {\n    const parsed = JSON.parse(storage.getItem(PLOT_DISPLAY_STORAGE_KEY) || '{}');\n    return parsed && typeof parsed === 'object' && !Array.isArray(parsed) ? parsed : {};\n  } catch (e) {\n    return {};\n  }\n}\n\nexport function savePlotDisplaySettings(settings, storage = browserStorage()) {\n  if (!storage) return;\n  try {\n    storage.setItem(PLOT_DISPLAY_STORAGE_KEY, JSON.stringify(settings));\n  } catch (e) {\n    // private mode / quota: the settings then simply last until the next reload\n  }\n}\n","import {defineStore} from 'pinia'\n\nexport const useTrendsStore = defineStore('trends', {\n  state: () => ({\n    com: null,\n    user: null,\n    /**\n     * the plot settings object manages all the sane possible choices and the current settings for the trends page\n     */\n    plotSettings: null,\n\n    speciesDict: {},\n\n    // /**\n    //  * all the column definitions, for descriptors etc.\n    //  */\n    // columnDefs: null,\n    // /**\n    //  * a map holding all the species with the id (Mmyo, Mnat ...) as key\n    //  */\n    // species: null,\n    // /**\n    //  * all the statuses\n    //  */\n    // statuses: null,\n    // obervationTypes: null,\n    //\n    // /**\n    //  * holds all the suppliers (sources)\n    //  */\n    // suppliers: null,\n    // /**\n    //  * for plot options; holds all the sane possibilities for the selectors\n    //  */\n    // possibleChoices: null,\n    // plotOptions: null,\n    // sourceFiles: null,\n    // /**\n    //  * a summary of all the source files (summed up values) stored in the structure of an actual source file.\n    //  */\n    // sumupSourceFile: null,\n    // locations: null,\n  }),\n})\n","import script from \"./MyBase.vue?vue&type=script&lang=js\"\nexport * from \"./MyBase.vue?vue&type=script&lang=js\"\n\nconst __exports__ = script;\n\nexport default __exports__","<script>\nimport {defineComponent} from 'vue';\nimport {useTrendsStore} from \"@/store/trends\";\n\nexport default defineComponent({\n  data: function (){\n    return {\n      mStore: null,\n    }\n  },\n  // mounted: function() {\n  //   return;\n  // },\n  methods: {\n    _getStore() {\n      if (!this.mStore){\n        this.mStore = useTrendsStore();\n      }\n      return this.mStore;\n    },\n  },\n  computed: {\n    store: function () {\n      return this._getStore();\n    },\n    accountComponent: function () {\n      return this.store.accountComponent;\n    },\n    user: function () {\n      return this.store.user;\n    },\n  }\n});\n</script>\n","// Single source of truth on the frontend for which trend model a request uses.\n// The obs type carries its own default (backend obs_type.py `default_plot_model`,\n// surfaced through the observationTypes payload). The admin \"more options\" model\n// picker is an explicit override that wins when present.\n\nexport interface ObsTypeLike {\n    default_plot_model?: string | null;\n}\n\nexport function resolvePlotModel(\n    observationType: ObsTypeLike | null | undefined,\n    opts: { adminOverride?: string | null } = {},\n): string {\n    if (opts.adminOverride) { return opts.adminOverride; }\n    return (observationType && observationType.default_plot_model) || \"HGAM\";\n}\n","import {ApiUtil} from \"@/lib/ApiCom\";\nimport {resolvePlotModel} from \"@/lib/inla/resolvePlotModel\";\n\nclass PossibleChoices{\n\n}\n\n\nclass MyPlotSettings{\n    ////\n    // HELPER CONSTANTS\n    ////\n    // readonly $t: any;\n    component: any;\n    readonly allRegions: any;\n    readonly mapRegion: any;\n\n    constructor(component: any) {\n        // this.$t = vueTranslator;\n        this.component = component;\n        this.allRegions = {id:-1, name: component.$t('plotOptions.allRegions')};\n        this.mapRegion = {id:-2, name: component.$t('plotOptions.mapSection')};\n    }\n\n    ////\n    //  DATA CONTAINERS\n    ////\n    /**\n     * a map holding all the species with the id (Mmyo, Mnat ...) as key\n     * comes from the server, and is stored as is\n     */\n    speciesDict: any = null;\n    // speciesTitles: any = null;\n    observationTypes: any = {};\n    bioGeoRegions: any = {};\n    geoRegions1: any = {};\n    geoRegions2: any = {};\n    geoRegions3: any = {};\n    geoAdministrativeRegions: any = {};\n    mapBounds: any = null;\n    /** grid square sizes (km) available on the server, e.g. [10, 20, 30, 40, 50] */\n    availableGridSizes: number[] = [];\n    /** whether TK25 map-sheet aggregation can be offered as a grid alternative */\n    tk25Available = false;\n    /** obs type the server opens with (admin-configurable; W until set) */\n    defaultObservationTypeId = 'W';\n\n\n    ////\n    //  SELECTION / CURRENT SETTINGS\n    ////\n    /**\n     * the currently selected species with all it's info.\n     */\n    species: any = null;\n    /**\n     * the currently selected observation type\n     */\n    observationType: any = null;\n    /**\n     * the currently selected region\n     */\n    selectedRegion: any = null;\n    /**\n     * the year that was selected as starting year\n     */\n    yearStart = 2000;\n    /**\n     * the year that was selected as the end year\n     */\n    yearEnd = 2020;\n\n    ////\n    //  POSSIBLE CHOICES / what's available for selection\n    ////\n    /**\n     * the minimum year that's possible for the current options\n     */\n    yearMin = 2000;\n    /**\n     * the maximum year that's possible for the current options\n     */\n    yearMax = 2020;\n    /**\n     * filtered count types for the selection\n     */\n    availableCountTypes: any[] = [];\n    /**\n     * filtered observation types for the selection\n     */\n    availableObservationTypes: any[] = [];\n    /**\n     * filtered biogeo regions for the selection\n     */\n    availableBiogeo: any[] = [];\n    /**\n     * filtered geo1 regions for the selection\n     */\n    availableGeo1: any[] = [];\n    avalaibleGeoAdm: any[] = [];\n\n\n    ////\n    // MORE OPTIONS\n    ////\n    showLocations = false;\n    showSquares = true;\n    squareSize = 20;\n    /** map aggregation: arbitrary km grid ('grid') or TK25 map sheets ('tk25') */\n    mapAggregation: 'grid' | 'tk25' = 'grid';\n    showDistribution = true;\n    /**\n     * how the trend card presents observation types:\n     *  'single'   — one plot for `observationType` (default)\n     *  'combined' — every viewable type merged into one plot\n     *  'grid'     — one plot per viewable type, side by side\n     */\n    obsLayout: 'single' | 'combined' | 'grid' = 'single';\n    filterDate = false;\n    filterDateMonthStart = 12;\n    filterDateMonthEnd = 2;\n    filterDateIncludeNulls = false;\n    trimModel = 2;\n    trimSerialCorrelation = true;\n    trimOverdispersion = true;\n    trimTotals = false;\n    trimCovariateGeo = false;\n    trimChangepointsAll = false;\n    trimStepwise = false;\n    minCountsPerSite = 0;\n    fillYearGaps = true;\n\n    /** basemap tile source; see MyMap.createTileLayer for the URL/attribution table */\n    mapLayer = 'OSM';\n\n    // ---- Layer styling (client-only; never serialized to/from the server) ----\n    // Colours are explicit hex values from a native colour picker. MyMap resolves\n    // `fill` to a graduated light→base ramp when shading by count, and uses `border`\n    // as the independent cell outline — see map.ts.\n    /**\n     * observation cells. `fill`/`border` are the primary colours (used as-is when not\n     * graduated, and as the high-count end of the gradient). `fillTo`/`borderTo` are the\n     * low-count end of the count-shading gradient. `gradientMode` is the blend colour\n     * space, `gradientInvert` swaps the low/high ends.\n     */\n    mapStyleSite = {\n        fill: '#000000', fillTo: '#ffffff',\n        border: '#000000', borderTo: '#000000',\n        opacity: 0.55, weight: 1,\n        graduated: false, gradientMode: 'oklch', gradientInvert: false,\n        // cells whose every site was surveyed without ever holding the species\n        noDetectionFill: '#dc3545',\n    };\n    /** official FFH species range polygon */\n    mapStyleDistribution = {fill: '#dc2626', opacity: 0.3, weight: 0};\n    /** how strongly the area outside the selected region is dimmed (0.15–0.75) */\n    mapStyleRegionDim = 0.5;\n\n    /** immutable defaults so \"Reset styling\" can restore them */\n    static readonly MAP_STYLE_DEFAULTS = {\n        mapStyleSite: {\n            fill: '#000000', fillTo: '#ffffff',\n            border: '#000000', borderTo: '#000000',\n            opacity: 0.55, weight: 1,\n            graduated: false, gradientMode: 'oklch', gradientInvert: false,\n            // cells whose every site was surveyed without ever holding the species\n            noDetectionFill: '#dc3545',\n        },\n        mapStyleDistribution: {fill: '#dc2626', opacity: 0.3, weight: 0},\n        mapStyleRegionDim: 0.5,\n    };\n\n    resetMapStyle(){\n        const d = MyPlotSettings.MAP_STYLE_DEFAULTS;\n        this.mapStyleSite = {...d.mapStyleSite};\n        this.mapStyleDistribution = {...d.mapStyleDistribution};\n        this.mapStyleRegionDim = d.mapStyleRegionDim;\n    }\n\n\n    emitChange(data: any = undefined){\n        // this.component.$emit('settingsChanged', data);\n        console.warn(\"EMIT CHANGE NOT IMPLEMENTED\")\n    }\n    /**\n     * handles a server response and populates everything\n     * @param json the server response\n     */\n    handleResponse(json: any){\n        if (json.species) {\n            ApiUtil.addKeyToMapItemsAsId(json.species);\n            this.speciesDict = json.species;\n            this.observationTypes = ApiUtil.listToMapWithIdAsKey(json.observationTypes);\n            this.bioGeoRegions = ApiUtil.listToMapWithIdAsKey(json.biogeo);\n            for (const idx in this.bioGeoRegions) this.bioGeoRegions[idx].type = 'b';\n            this.geoAdministrativeRegions = ApiUtil.listToMapWithIdAsKey(json.geoadm);\n            for (const idx in this.geoAdministrativeRegions) this.geoAdministrativeRegions[idx].type = 'a';\n            this.geoRegions1 = ApiUtil.listToMapWithIdAsKey(json.geo1);\n            this.geoRegions2 = ApiUtil.listToMapWithIdAsKey(json.geo2);\n            this.geoRegions3 = ApiUtil.listToMapWithIdAsKey(json.geo3);\n        }\n\n        if (json.gridSizes)\n            this.availableGridSizes = json.gridSizes;\n        if (json.tk25Available != null)\n            this.tk25Available = json.tk25Available;\n        if (json.defaultObservationType)\n            this.defaultObservationTypeId = json.defaultObservationType;\n\n        if (json.possible_choices){\n            this.availableCountTypes = this.filterAvailable(this.speciesDict, json.possible_choices.count_types, 'latin');\n            this.availableObservationTypes = this.filterAvailable(this.observationTypes, json.possible_choices.obs_types, 'name');\n            this.availableBiogeo = this.filterAvailable(this.bioGeoRegions, json.possible_choices.biogeo_ids, 'name');\n            this.availableGeo1 = this.filterAvailable(this.geoRegions1, json.possible_choices.geo1_ids, 'name');\n            this.avalaibleGeoAdm = this.filterAvailable(this.geoAdministrativeRegions, json.possible_choices.geoadm_ids, 'name');\n            if (json.possible_choices.year_min != null) this.yearMin = json.possible_choices.year_min;\n            if (json.possible_choices.year_max != null) this.yearMax = json.possible_choices.year_max;\n        }\n        else{\n            console.warn(\"No possible choices!\");\n        }\n\n\n        if (! this.observationType){\n            this.observationType = this.observationTypes[this.defaultObservationTypeId]\n                || this.observationTypes['W'];\n        }\n        if (! this.selectedRegion){\n            this.selectedRegion = this.allRegions;\n        }\n\n        if (json.plot_options){\n            this.species = this.speciesDict[json.plot_options.species];\n            this.observationType = this.observationTypes[json.plot_options.observationType];\n\n            // Reflect a deep-linked region (backend set biogeo/geo1/geoadm) in the\n            // dropdown. Without this the plot is correct but the picker shows \"all\".\n            const po = json.plot_options;\n            if (po.biogeo != null) {\n                this.selectedRegion = this.bioGeoRegions[po.biogeo] || this.allRegions;\n            } else if (po.geo1 != null) {\n                this.selectedRegion = this.geoRegions1[po.geo1] || this.allRegions;\n            } else if (po.geoadm != null) {\n                this.selectedRegion = this.geoAdministrativeRegions[po.geoadm] || this.allRegions;\n            } else {\n                this.selectedRegion = this.allRegions;\n            }\n\n            this.yearStart = json.plot_options.yearStart;\n            this.yearEnd = json.plot_options.yearEnd;\n\n            this.showLocations = json.plot_options.showLocations;\n            this.showSquares = json.plot_options.showSquares;\n            this.squareSize = json.plot_options.squareSize;\n            if (json.plot_options.mapAggregation === 'grid' || json.plot_options.mapAggregation === 'tk25')\n                this.mapAggregation = json.plot_options.mapAggregation;\n            this.showDistribution = json.plot_options.showDistribution;\n            this.filterDate = json.plot_options.filterDate;\n            this.filterDateMonthStart = json.plot_options.filterDateMonthStart;\n            this.filterDateMonthEnd = json.plot_options.filterDateMonthEnd;\n            this.filterDateIncludeNulls = json.plot_options.filterDateIncludeNulls;\n            this.trimModel = json.plot_options.trimModel;\n            this.trimSerialCorrelation = json.plot_options.trimSerialCorrelation;\n            this.trimOverdispersion = json.plot_options.trimOverdispersion;\n            this.trimTotals = json.plot_options.trimTotals;\n            this.trimCovariateGeo = json.plot_options.trimCovariateGeo;\n            this.trimChangepointsAll = json.plot_options.trimChangepointsAll;\n            this.trimStepwise = json.plot_options.trimStepwise;\n            this.minCountsPerSite = json.plot_options.minCountsPerSite;\n            this.fillYearGaps = json.plot_options.fillYearGaps;\n        }\n        else{\n            console.warn(\"No options!\");\n        }\n\n        if (! this.species){\n            console.warn(\"No species selected.\");\n        }\n        console.log(\"MyPlotSettings::handleResponse - species id is \" + this.species?.id);\n    }\n\n    buildOptions() : any {\n        // The selected observation type is the single source of truth for the trend model\n        // (SBB -> INLA, everything else -> HGAM). See resolvePlotModel.\n        const options: any = {\n            plotModel: resolvePlotModel(this.observationType)\n        }\n        if (this.species) options.species = this.species.id;\n        if (this.observationType) options.observationType = this.observationType.id;\n        if (this.selectedRegion){\n            if (this.selectedRegion.id > 0){\n                if (this.selectedRegion.type === 'b'){\n                    options.biogeo = this.selectedRegion.id;\n                }\n                else{\n                    options.geo1 = this.selectedRegion.id;\n                }\n            }\n            else if (this.selectedRegion.id === -2){\n                options.geoBounds = this.mapBounds;\n            }\n            else if (isNaN(this.selectedRegion.id)){\n                if (this.selectedRegion.type === 'a'){\n                    options.geoadm = this.selectedRegion.id;\n                }\n            }\n        }\n        options.yearStart = this.yearStart;\n        options.yearEnd = this.yearEnd;\n\n        //extra options\n        if (this.canUseMoreOptions()) {\n            if (this.filterDate) {\n                options.filterDate = this.filterDate;\n                options.filterDateStart = this.filterDateMonthStart;\n                options.filterDateEnd = this.filterDateMonthEnd;\n                options.filterDateIncludeNulls = this.filterDateIncludeNulls;\n            }\n            options.trimOverdispersion = this.trimOverdispersion;\n            options.trimSerialCorrelation = this.trimSerialCorrelation;\n            options.trimCovariateGeo = this.trimCovariateGeo;\n            options.trimModel = this.trimModel;\n            options.trimTotals = this.trimTotals;\n            options.trimStepwise = this.trimStepwise;\n            options.trimChangepointsAll = this.trimChangepointsAll;\n            options.showLocations = this.showLocations;\n            options.showSquares = this.showSquares;\n            options.squareSize = this.squareSize;\n            options.mapAggregation = this.mapAggregation;\n            options.showDistribution = this.showDistribution;\n            options.fillYearGaps = this.fillYearGaps;\n            options.minCountsPerSite = this.minCountsPerSite;\n            // Multi-type layouts make the server build every viewable type. Admin-only\n            // by construction: this whole block is gated on canUseMoreOptions().\n            options.obsLayout = this.obsLayout;\n        }\n        return options;\n    }\n\n    /**\n     * call this method, when the map bounds have changed\n     * @param bounds leaflet bounds object\n     * @returns {boolean} true if the map bounds have changed\n     */\n    updateMapBounds(bounds: any) : boolean{\n        const oldBounds = this.mapBounds;\n        this.mapBounds = bounds;\n        if (bounds){\n            this.selectedRegion = this.mapRegion;\n            if (this.selectedRegion){ //} && this.selectedRegion.id === this.mapRegion.id) {\n                return true;\n            }\n        }\n        else{\n            if (this.selectedRegion?.id === this.mapRegion?.id) {\n                this.selectedRegion = this.allRegions;\n            }\n            if (oldBounds) return true;\n        }\n        return false;\n    }\n\n    /**\n     * filters the available items from the map, and returns a sorted list\n     * @param map the map containing all the items\n     * @param available the list of the keys that should be filtered\n     * @param sort the field that should be used for sorting\n     * @private\n     */\n    private filterAvailable(map: any, available: any, sort: string){\n        const list = [];\n        for (const idx in available){\n            const key = available[idx];\n            const item = map[key];\n            if (item){\n                list.push(item);\n            }\n        }\n        return list.sort(function (a, b){\n            // return (a[sort].localeCompare(b[sort]));\n            return (a[sort]?.localeCompare(b[sort] ?? '') ?? 0);\n        });\n    }\n\n    private canUseMoreOptions(){\n        const user = this.component.store.user;\n        if (user){\n            if (user.isAdmin){\n                return true;\n            }\n        }\n        return false;\n    }\n\n    get effectiveYearMax(){\n        const currentYear = new Date().getFullYear();\n        return this.yearMax != null ? Math.min(this.yearMax, currentYear) : currentYear;\n    }\n\n    yearsMin(){\n        const cap = this.effectiveYearMax;\n        let v = Math.floor(this.yearMin / 10) * 10;\n        const years = [];\n        while (v < cap){\n            years.push(v);\n            v += 10;\n        }\n        return years;\n    }\n\n    yearsMax(){\n        const effectiveMax = this.effectiveYearMax;\n        const addByModZero = (effectiveMax % 10) == 0 ? 0 : 1;\n        const maxV = Math.floor(effectiveMax / 10 + addByModZero) * 10;\n        let v = Math.floor(this.yearMin / 10 + 1) * 10;\n        const years = [];\n        while (v <= maxV){\n            years.push(v);\n            v += 10;\n        }\n        if (years.length > 0 && years[years.length - 1] > effectiveMax) {\n            years[years.length - 1] = effectiveMax;\n        }\n        return years;\n    }\n}\n\nexport {MyPlotSettings}","// eslint-disable-next-line @typescript-eslint/ban-ts-comment\n// @ts-ignore\nimport Leaflet from \"leaflet\";\n\n/** Upper-bound edges of the graduated site-count classes; 5 classes total. */\nconst COUNT_BIN_LABELS = ['1', '2–3', '4–7', '8–15', '16+'];\nfunction countBinIndex(nb: number): number {\n    if (nb <= 1) return 0;\n    if (nb <= 3) return 1;\n    if (nb <= 7) return 2;\n    if (nb <= 15) return 3;\n    return 4;\n}\n\n// ---- Colour interpolation. The count-shading gradient blends a low-count colour into\n// a high-count colour; the blend space (RGB/HSL/LAB/LCH/OKLCH) changes how the midtones\n// travel. OKLCH is perceptually smooth; RGB can go muddy. ----\ntype RGB = [number, number, number];\nfunction hexToRgb(hex: string): RGB {\n    let h = (hex || '').replace('#', '');\n    if (h.length === 3) h = h[0] + h[0] + h[1] + h[1] + h[2] + h[2];\n    const n = parseInt(h || '000000', 16);\n    return [(n >> 16) & 255, (n >> 8) & 255, n & 255];\n}\nfunction rgbToHex(r: number, g: number, b: number): string {\n    const c = (v: number) => Math.max(0, Math.min(255, Math.round(v))).toString(16).padStart(2, '0');\n    return '#' + c(r) + c(g) + c(b);\n}\nconst lerp = (a: number, b: number, t: number) => a + (b - a) * t;\n/** Interpolate an angle (degrees) along the shorter arc. */\nfunction lerpHue(a: number, b: number, t: number): number {\n    const d = ((b - a) % 360 + 540) % 360 - 180;\n    return ((a + d * t) % 360 + 360) % 360;\n}\n// sRGB companding (0..255 <-> linear 0..1)\nconst toLin = (c: number) => { c /= 255; return c <= 0.04045 ? c / 12.92 : Math.pow((c + 0.055) / 1.055, 2.4); };\nconst toSrgb = (c: number) => (c <= 0.0031308 ? c * 12.92 : 1.055 * Math.pow(c, 1 / 2.4) - 0.055) * 255;\nfunction rgbToXyz([r, g, b]: RGB): RGB {\n    const R = toLin(r), G = toLin(g), B = toLin(b);\n    return [R * 0.4124 + G * 0.3576 + B * 0.1805, R * 0.2126 + G * 0.7152 + B * 0.0722, R * 0.0193 + G * 0.1192 + B * 0.9505];\n}\nfunction xyzToRgb([x, y, z]: RGB): RGB {\n    return [toSrgb(x * 3.2406 + y * -1.5372 + z * -0.4986), toSrgb(x * -0.9689 + y * 1.8758 + z * 0.0415), toSrgb(x * 0.0557 + y * -0.2040 + z * 1.0570)];\n}\nconst _f = (t: number) => (t > 0.008856 ? Math.cbrt(t) : 7.787 * t + 16 / 116);\nconst _fi = (t: number) => { const t3 = t * t * t; return t3 > 0.008856 ? t3 : (t - 16 / 116) / 7.787; };\nfunction xyzToLab([x, y, z]: RGB): RGB {\n    const fx = _f(x / 0.95047), fy = _f(y), fz = _f(z / 1.08883);\n    return [116 * fy - 16, 500 * (fx - fy), 200 * (fy - fz)];\n}\nfunction labToXyz([L, a, b]: RGB): RGB {\n    const fy = (L + 16) / 116, fx = fy + a / 500, fz = fy - b / 200;\n    return [0.95047 * _fi(fx), _fi(fy), 1.08883 * _fi(fz)];\n}\nfunction labToLch([L, a, b]: RGB): RGB { const C = Math.hypot(a, b); let H = Math.atan2(b, a) * 180 / Math.PI; if (H < 0) H += 360; return [L, C, H]; }\nfunction lchToLab([L, C, H]: RGB): RGB { const h = H * Math.PI / 180; return [L, C * Math.cos(h), C * Math.sin(h)]; }\nfunction rgbToOklab([r, g, b]: RGB): RGB {\n    const R = toLin(r), G = toLin(g), B = toLin(b);\n    const l = Math.cbrt(0.4122214708 * R + 0.5363325363 * G + 0.0514459929 * B);\n    const m = Math.cbrt(0.2119034982 * R + 0.6806995451 * G + 0.1073969566 * B);\n    const s = Math.cbrt(0.0883024619 * R + 0.2817188376 * G + 0.6299787005 * B);\n    return [0.2104542553 * l + 0.7936177850 * m - 0.0040720468 * s, 1.9779984951 * l - 2.4285922050 * m + 0.4505937099 * s, 0.0259040371 * l + 0.7827717662 * m - 0.8086757660 * s];\n}\nfunction oklabToRgb([L, A, B]: RGB): RGB {\n    const l = (L + 0.3963377774 * A + 0.2158037573 * B) ** 3;\n    const m = (L - 0.1055613458 * A - 0.0638541728 * B) ** 3;\n    const s = (L - 0.0894841775 * A - 1.2914855480 * B) ** 3;\n    return [toSrgb(4.0767416621 * l - 3.3077115913 * m + 0.2309699292 * s), toSrgb(-1.2684380046 * l + 2.6097574011 * m - 0.3413193965 * s), toSrgb(-0.0041960863 * l - 0.7034186147 * m + 1.7076147010 * s)];\n}\nfunction rgbToHsl([r, g, b]: RGB): RGB {\n    r /= 255; g /= 255; b /= 255;\n    const max = Math.max(r, g, b), min = Math.min(r, g, b), d = max - min, l = (max + min) / 2;\n    let h = 0, s = 0;\n    if (d) { s = l > 0.5 ? d / (2 - max - min) : d / (max + min); h = max === r ? (g - b) / d + (g < b ? 6 : 0) : max === g ? (b - r) / d + 2 : (r - g) / d + 4; h *= 60; }\n    return [h, s, l];\n}\nfunction hslToRgb([h, s, l]: RGB): RGB {\n    h = ((h % 360) + 360) % 360 / 360; s = Math.max(0, Math.min(1, s)); l = Math.max(0, Math.min(1, l));\n    const q = l < 0.5 ? l * (1 + s) : l + s - l * s, p = 2 * l - q;\n    const hk = (t: number) => { t = (t % 1 + 1) % 1; if (t < 1 / 6) return p + (q - p) * 6 * t; if (t < 1 / 2) return q; if (t < 2 / 3) return p + (q - p) * (2 / 3 - t) * 6; return p; };\n    return [hk(h + 1 / 3) * 255, hk(h) * 255, hk(h - 1 / 3) * 255];\n}\n/** Blend two hex colours at t (0..1) in the requested colour space. */\nfunction interpolate(hexA: string, hexB: string, t: number, mode: string): string {\n    const ca = hexToRgb(hexA), cb = hexToRgb(hexB), hx = (c: RGB) => rgbToHex(c[0], c[1], c[2]);\n    if (mode === 'hsl') { const A = rgbToHsl(ca), B = rgbToHsl(cb); return hx(hslToRgb([lerpHue(A[0], B[0], t), lerp(A[1], B[1], t), lerp(A[2], B[2], t)])); }\n    if (mode === 'lab') { const A = xyzToLab(rgbToXyz(ca)), B = xyzToLab(rgbToXyz(cb)); return hx(xyzToRgb(labToXyz([lerp(A[0], B[0], t), lerp(A[1], B[1], t), lerp(A[2], B[2], t)]))); }\n    if (mode === 'lch') { const A = labToLch(xyzToLab(rgbToXyz(ca))), B = labToLch(xyzToLab(rgbToXyz(cb))); return hx(xyzToRgb(labToXyz(lchToLab([lerp(A[0], B[0], t), lerp(A[1], B[1], t), lerpHue(A[2], B[2], t)])))); }\n    if (mode === 'oklch') { const A = labToLch(rgbToOklab(ca)), B = labToLch(rgbToOklab(cb)); return hx(oklabToRgb(lchToLab([lerp(A[0], B[0], t), lerp(A[1], B[1], t), lerpHue(A[2], B[2], t)]))); }\n    return hx([lerp(ca[0], cb[0], t), lerp(ca[1], cb[1], t), lerp(ca[2], cb[2], t)]); // rgb\n}\n/** Colour for a normalised count position (0 = low, 1 = high) along the gradient. */\nfunction gradientColorAt(low: string, high: string, t: number, mode: string, invert: boolean): string {\n    return interpolate(low, high, invert ? 1 - t : t, mode);\n}\n/** The five class colours for the legend / count bins. */\nfunction gradientSteps(low: string, high: string, mode: string, invert: boolean): string[] {\n    return [0, 1, 2, 3, 4].map(i => gradientColorAt(low, high, i / 4, mode, invert));\n}\n\nclass Geo{\n    public static RADIUS_EARTH_KM = 6371;\n    public static RADIUS_EARTH_MI = 3958.8;\n    public static CENTER_LAT_GERMANY = 51.1638175\n    public static deg2rad(deg: number): number {\n        return deg * (Math.PI/180);\n    }\n    public static haversine(lat1: number, lon1: number, lat2:number, lon2:number): number {\n        const R = Geo.RADIUS_EARTH_KM;\n        const rlat1 = Geo.deg2rad(lat1);\n        const rlat2 = Geo.deg2rad(lat2);\n        const difflat = rlat2 - rlat1;\n        const difflon = Geo.deg2rad(lon2 - lon1);\n        return 2 * R * Math.asin(Math.sqrt(Math.sin(difflat/2)*Math.sin(difflat/2)+Math.cos(rlat1)*Math.cos(rlat2)*Math.sin(difflon/2)*Math.sin(difflon/2)));\n    }\n}\nclass SquaresHelper {\n    centerLat: number;\n    squareSizeInKm: number;\n    squareSizeLat: number;\n    squareSizeLon: number;\n    offsetX: number;\n    offsetY: number;\n\n    constructor(squareSizeInKm: number) {\n        this.centerLat = Geo.CENTER_LAT_GERMANY;\n        this.squareSizeInKm = squareSizeInKm;\n\n        //  you can calculate the distance for the latitude right away.\n        const dstY = Geo.haversine(this.centerLat, 0.0, this.centerLat + 0.1, 0.0)\n        this.squareSizeLat = (this.squareSizeInKm / dstY) * 0.1\n        //  actually you need to calculate the square size of the longitude individually, but we simplify it with squares\n        const dstX = Geo.haversine(this.centerLat, 0.0, this.centerLat, 0.1);\n        this.squareSizeLon = (this.squareSizeInKm / dstX) * 0.1\n\n        const nbLon = Math.ceil(180.0 / dstX)\n        const nbLat = Math.ceil(90.0 / dstY)\n        this.offsetX = nbLon * this.squareSizeLon;\n        this.offsetY = nbLat * this.squareSizeLat;\n        // this.offsetY = 0.0;\n        // this.offsetX = 0.0;\n    }\n    coordsByIndex(indexLat: number, indexLon: number): number[]{\n        const lat = indexLat * this.squareSizeLat - this.offsetY;\n        const lon = indexLon * this.squareSizeLon - this.offsetX;\n        return [lat, lon];\n    }\n}\nclass MyMap {\n    /** the helper that handles resolving indices to actual GPS coordinates */\n    squaresHelper: SquaresHelper;\n    /** the Vue component */\n    component: any;\n    /** the id of the map element */\n    idMap: string;\n    /** the Leaflet map */\n    map: any;\n    /** the layer holding the distribution of the bats */\n    distributionLayer: any;\n    /** the layer holding the geometry data of the selected region */\n    regionLayer: any;\n    /** the layer holding the observations of the bats */\n    squaresLayer: any;\n    /** the layer holding per-site location markers */\n    locationsLayer: any;\n    /** the legend */\n    legendDiv: any;\n    /** the tile layer holding the map tiles*/\n    layer: any;\n    tmpLayer: string;\n\n    /** the button control holds the drag and select button */\n    dragAndSelectButtonContainer: any;\n    infoControl: any;\n    infoDiv: any;\n\n    // dragAndSelectButton: any;\n    // dragAndSelect = false;\n    // dragAndSelectStarted = false;\n    // dragAndSelectStartPos: Leaflet.LatLng = Leaflet.latLng(0,0);\n    // /** the selection rectangle (for drag&select) */\n    // selectRectangle: Leaflet.Rectangle;\n    // /** used to darken the world outside the selected area */\n    // outerWorldBounds: Leaflet.Polygon;\n    //\n    // callbackSelectRectangle: any;\n\n    /** for some reason, i need to use the method this way to work. can't define it the regular way */\n    // dnsDown = (e: Leaflet.LeafletMouseEvent) => {\n    //     if (this.dragAndSelect) {\n    //         // selectRectangle.setBounds([e.latlng, e.latlng]);\n    //         this.dragAndSelectStarted = true;\n    //         this.dragAndSelectStartPos = e.latlng;\n    //         this.selectRectangle.setBounds([e.latlng, e.latlng]);\n    //     }\n    // };\n    // dnsUp = (e: Leaflet.LeafletMouseEvent) => {\n    //     if (this.dragAndSelect){\n    //         if (this.dragAndSelectStarted) {\n    //             this.updateSelectRectangle(e.latlng);\n    //             const bounds = this.selectRectangle.getBounds();\n    //             this.dragAndSelectStarted = false;\n    //             this.dragAndSelect = false;\n    //             this.createOuterWorldBounds();\n    //             this.removeDragAndSelectRect();\n    //\n    //             const div: HTMLElement = Leaflet.DomUtil.create('div');\n    //\n    //             div.innerHTML += '<svg class=\"me-2\" width=\"32\" height=\"32\"><use xlink:href=\"#bi-bounding-box\"/></svg>';\n    //             const button: HTMLAnchorElement = Leaflet.DomUtil.create(\"a\", \"fs-6 me-2\", div);\n    //             button.innerText = this.component.$t('trends.clearSelection');\n    //             button.href = \"#\";\n    //             Leaflet.DomEvent.on(button, \"click\", (e: Leaflet.DomEvent.Event) => {\n    //                 Leaflet.DomEvent.stopPropagation(e);\n    //                 Leaflet.DomEvent.preventDefault(e);\n    //                 this.deleteSelection();\n    //                 this.centerMap();\n    //             });\n    //\n    //             const button2: HTMLAnchorElement = Leaflet.DomUtil.create(\"a\", \"fs-6\", div);\n    //             button2.innerText = this.component.$t('trends.zoomInArea');\n    //             button2.href = \"#\";\n    //             Leaflet.DomEvent.on(button2, \"click\", (e: Leaflet.DomEvent.Event) => {\n    //                 Leaflet.DomEvent.stopPropagation(e);\n    //                 Leaflet.DomEvent.preventDefault(e);\n    //                 this.map.fitBounds(bounds);\n    //             });\n    //\n    //             this.showInfo(div);\n    //             // this.map.fitBounds(this.selectRectangle.getBounds());\n    //             if (this.callbackSelectRectangle){\n    //                 this.callbackSelectRectangle(bounds);\n    //             }\n    //         }\n    //         this.setDragAndSelect(false);\n    //     }\n    // }\n    // dnsMove = (e: Leaflet.LeafletMouseEvent) => {\n    //     if (this.dragAndSelect && this.dragAndSelectStarted) {\n    //         this.updateSelectRectangle(e.latlng);\n    //         e.originalEvent.preventDefault();\n    //     }\n    // }\n\n    constructor(component: any){\n        this.idMap = component.idMap;\n        this.component = component;\n        this.tmpLayer = this.settings.mapLayer;\n        this.squaresHelper = new SquaresHelper(this.settings.squareSize);\n    }\n\n    /**\n     * Rebuilds the index→coordinate helper for a new grid cell size. Server-side squares\n     * arrive as grid indices, so the helper must match the size the server gridded at,\n     * otherwise reconstructed squares/markers are misplaced.\n     */\n    setSquareSize(sizeInKm: number){\n        if (! sizeInKm) return;\n        if (this.squaresHelper && this.squaresHelper.squareSizeInKm === sizeInKm) return;\n        this.squaresHelper = new SquaresHelper(sizeInKm);\n    }\n\n    create(){\n        if (this.map){\n            return;\n        }\n        const options = {\n            center: [51.5, 10],\n            zoom: 5.0,\n            zoomSnap: 0.25,\n            // Keep the default SVG renderer for vector layers: the canvas renderer\n            // bitmap-scales during Leaflet's fractional-zoom animation and drifts out\n            // of sync with the tiles. The PNG export rasterises the SVG overlay instead.\n            // minZoom: 4.0,\n            // maxZoom: 7.0,\n            // zoomControl: false\n            // zoomAnimation: false,\n            // fadeAnimation: false,\n        };\n        if (! document.getElementById(this.idMap)){\n            console.warn(\"Oh no! No map element found!\");\n            return;\n        }\n        const map = new Leaflet.map(this.idMap, options);\n\n\n\n        this.map = map;\n        this.createTileLayer();\n        this.createInfoControl();\n        // Legend before the tool buttons: within the top-right corner Leaflet stacks\n        // controls in add order, so the legend sits above the download/fullscreen buttons.\n        this.createLegend();\n        this.createControls();\n        // this.updateUI();\n    }\n\n    /** True when this frame's data comes from an import that records complete surveys. */\n    hasCompleteSurvey(): boolean {\n        return !!this.component?.siteStats?.has_complete_survey;\n    }\n\n    /** Style resolvers: turn the colour settings into concrete Leaflet path options. */\n    styleForCell(nbLoc: number, nbLocPos?: number): any {\n        const s = this.settings.mapStyleSite;\n        // A cell where every site was surveyed and none ever held the species is a\n        // result, not a gap -- flag it instead of shading it by site count. Strict\n        // === 0: undefined means a legacy cell with no information, and must not match.\n        if (this.hasCompleteSurvey() && nbLocPos === 0) {\n            return {\n                color: s.noDetectionFill,\n                weight: s.weight,\n                opacity: 1,\n                fillColor: s.noDetectionFill,\n                fillOpacity: s.opacity,\n            };\n        }\n        let fill = s.fill, border = s.border;\n        if (s.graduated) {\n            const t = countBinIndex(nbLoc) / 4;\n            // `fillTo`/`borderTo` are the low-count end; the primary colour is the high-count end.\n            fill = gradientColorAt(s.fillTo, s.fill, t, s.gradientMode, s.gradientInvert);\n            border = gradientColorAt(s.borderTo, s.border, t, s.gradientMode, s.gradientInvert);\n        }\n        return {\n            color: border,\n            weight: s.weight,\n            opacity: 1,\n            fillColor: fill,\n            fillOpacity: s.opacity,\n        };\n    }\n    styleForDistribution(): any {\n        const s = this.settings.mapStyleDistribution;\n        return {\n            color: s.fill,\n            weight: s.weight,\n            opacity: 1,\n            fillColor: s.fill,\n            fillOpacity: s.opacity,\n        };\n    }\n    styleForRegionMask(): any {\n        return {color: '#000000', weight: 0, opacity: 0, fillColor: '#000000', fillOpacity: this.settings.mapStyleRegionDim};\n    }\n\n    /**\n     * Live-restyle the region mask (e.g. when the dimming slider moves) without a refetch\n     * or refit. No-op when no region is selected — there is nothing to dim on the full map.\n     */\n    updateRegionStyle(){\n        if (this.regionLayer && this.regionLayer.setStyle) {\n            this.regionLayer.setStyle(this.styleForRegionMask());\n        }\n    }\n\n    /** Standard orientation/utility controls: scale bar, recenter, fullscreen, export. */\n    createControls(){\n        Leaflet.control.scale({imperial: false, position: 'bottomright'}).addTo(this.map);\n\n        const makeButton = (title: string, iconHref: string, onClick: () => void) => {\n            const ctl = Leaflet.control({position: 'topright'});\n            ctl.onAdd = () => {\n                const div: HTMLElement = Leaflet.DomUtil.create('div', 'leaflet-bar leaflet-control map-tool');\n                const a: HTMLAnchorElement = Leaflet.DomUtil.create('a', '', div);\n                a.href = '#';\n                a.title = title;\n                a.setAttribute('role', 'button');\n                a.setAttribute('aria-label', title);\n                a.innerHTML = '<svg width=\"18\" height=\"18\" aria-hidden=\"true\"><use xlink:href=\"#' + iconHref + '\"/></svg>';\n                Leaflet.DomEvent.on(a, 'click', (e: any) => {\n                    Leaflet.DomEvent.stopPropagation(e);\n                    Leaflet.DomEvent.preventDefault(e);\n                    onClick();\n                });\n                return div;\n            };\n            ctl.addTo(this.map);\n        };\n\n        makeButton(this.t('trends.mapTools.recenter', 'Recenter'), 'bi-geo-alt', () => this.centerMap());\n        makeButton(this.t('trends.mapTools.fullscreen', 'Fullscreen'), 'bi-arrows-fullscreen', () => this.toggleFullscreen());\n        makeButton(this.t('trends.mapTools.exportImage', 'Export image'), 'bi-download', () => this.exportPng());\n\n        // Leaving fullscreen must restore the pre-fullscreen size. resizedFn sizes the map\n        // as Math.max(clientHeight, width*0.7), so a fullscreen-inflated inline height would\n        // stick (the max never shrinks). Clear the inline heights first so resizedFn\n        // recomputes from the CSS-driven size, then run the normal resize path.\n        document.addEventListener('fullscreenchange', () => {\n            if (! document.fullscreenElement) {\n                const elmMap = document.getElementById(this.idMap);\n                if (elmMap) elmMap.style.height = '';\n                const plotId = this.component?.getPlotId?.();\n                const elmPlot = plotId ? document.getElementById(plotId) : null;\n                if (elmPlot) elmPlot.style.height = '';\n            }\n            if (this.component?.resizedListener) this.component.resizedListener();\n        });\n    }\n\n    /** Small i18n helper: use the component translator when present, else a fallback string. */\n    t(key: string, fallback: string): string {\n        try {\n            const v = this.component?.$t ? this.component.$t(key) : null;\n            return (v && v !== key) ? v : fallback;\n        } catch (e) {\n            return fallback;\n        }\n    }\n\n    toggleFullscreen(){\n        const el = this.map?.getContainer?.();\n        if (! el) return;\n        // Resizing is handled by the fullscreenchange listener (component.resizedListener),\n        // which recomputes the height once the container has settled at its new size.\n        if (! document.fullscreenElement) {\n            if (el.requestFullscreen) el.requestFullscreen().catch(() => { /* unsupported/blocked */ });\n        } else {\n            document.exitFullscreen();\n        }\n    }\n\n    // updateUI(){\n    //     if (this.component?.store?.plotSettings?.plotMode === 'CLASSIC') {\n    //         this.createDragAndSelect();\n    //         // this.createDragAndSelectRect();\n    //     }\n    //     else{\n    //         this.removeDragAndSelectButton();\n    //         this.deleteSelection();\n    //         // this.removeDragAndSelectRect();\n    //     }\n    // }\n\n    centerMap(){\n        if (! this.map) return;\n        const corner1 = Leaflet.latLng(47.3, 5.8),\n            corner2 = Leaflet.latLng(55.1, 15.1),\n            bounds = Leaflet.latLngBounds(corner1, corner2);\n        this.map.fitBounds(bounds);\n    }\n\n    get settings(){\n        return this.component.$refs.settings.settings;\n    }\n\n    /**\n     * Available basemaps. `crossOrigin: 'anonymous'` is set on every tile layer so the\n     * PNG export can draw tiles onto a canvas without tainting it; OSM, Carto and Esri\n     * all send permissive CORS headers. OpenTopoMap may not, so exporting on Topo can\n     * fall back to the \"no basemap\" path — handled gracefully in exportPng().\n     */\n    static readonly BASEMAPS: Record<string, any> = {\n        OSM: {\n            url: 'https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png',\n            attribution: '© OpenStreetMap contributors', maxZoom: 19,\n        },\n        Carto: {\n            url: 'https://{s}.basemaps.cartocdn.com/light_all/{z}/{x}/{y}{r}.png',\n            attribution: '© OpenStreetMap contributors © CARTO', subdomains: 'abcd', maxZoom: 20,\n        },\n        ArcGIS: {\n            url: 'https://server.arcgisonline.com/ArcGIS/rest/services/Canvas/World_Light_Gray_Base/MapServer/tile/{z}/{y}/{x}',\n            attribution: 'Sources: Esri, HERE, Garmin, © OpenStreetMap contributors, and the GIS User Community', maxZoom: 16,\n        },\n        Topo: {\n            url: 'https://{s}.tile.opentopomap.org/{z}/{x}/{y}.png',\n            attribution: '© OpenStreetMap contributors, SRTM | © OpenTopoMap (CC-BY-SA)', maxZoom: 17,\n        },\n        Satellite: {\n            url: 'https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}',\n            attribution: 'Source: Esri, Maxar, Earthstar Geographics, and the GIS User Community', maxZoom: 19,\n        },\n    };\n\n    createTileLayer(){\n        if (this.layer && this.tmpLayer === this.settings.mapLayer) {\n            return; // unchanged\n        }\n        const cfg = MyMap.BASEMAPS[this.settings.mapLayer] || MyMap.BASEMAPS.OSM;\n        const options: any = {\n            attribution: cfg.attribution,\n            maxZoom: cfg.maxZoom,\n            crossOrigin: 'anonymous',\n        };\n        if (cfg.subdomains) options.subdomains = cfg.subdomains;\n\n        if (this.layer) {\n            this.map.removeLayer(this.layer);\n        }\n        this.layer = new Leaflet.TileLayer(cfg.url, options);\n        this.tmpLayer = this.settings.mapLayer;\n        this.layer.addTo(this.map);\n        this.layer.bringToBack();\n    }\n\n    createInfoControl(){\n        const ctl = Leaflet.control({position: 'bottomleft'});\n        ctl.onAdd = (map: any) => {\n            ctl._addedToMap = true;\n            // const div: HTMLElement = Leaflet.DomUtil.create('div', 'leaflet-bar leaflet-control map-info fs-5');\n            const div: HTMLElement = Leaflet.DomUtil.create('div', 'map-info fs-5');\n            this.infoDiv = div;\n            return div;\n        };\n        ctl.onRemove = (map: any) => {\n            ctl._addedToMap = false;\n        };\n        this.infoControl = ctl;\n        this.infoControl.addTo(this.map);\n    }\n\n    showInfo(content: any){\n        if (! this.infoControl) return;\n        this.infoDiv.innerHTML = '';\n        if (! this.infoControl._addedToMap)\n            this.infoControl.addTo(this.map);\n        if (typeof content === 'string' && content.length > 0)\n            this.infoDiv.innerHTML = content;\n        else if (content instanceof HTMLElement){\n            this.infoDiv.appendChild(content);\n        }\n    }\n    hideInfo(){\n        if (! this.infoControl) return;\n        if (this.infoControl._addedToMap)\n            this.infoControl.remove();\n    }\n\n    /** Builds the legend HTML from current settings + the data in memory. */\n    legendHtml(): string {\n        const settings = this.settings;\n        const rows: string[] = [];\n\n        // Observation cells: graduated scale (with counts) or a single swatch.\n        if (settings.showSquares) {\n            const squares = this.component?.squares || [];\n            const nbCells = squares.length;\n            const nbSites = this.component?.nbLocations || 0;\n            const obsLabel = this.component.$t('trends.observations');\n            if (settings.mapStyleSite.graduated) {\n                const ms = settings.mapStyleSite;\n                const steps = gradientSteps(ms.fillTo, ms.fill, ms.gradientMode, ms.gradientInvert);\n                const borderSteps = gradientSteps(ms.borderTo, ms.border, ms.gradientMode, ms.gradientInvert);\n                rows.push('<div class=\"lg-title\">' + obsLabel + '</div>');\n                const scale = COUNT_BIN_LABELS.map((lbl, i) =>\n                    '<span class=\"lg-bin\"><i style=\"background:' + steps[i] + ';border-color:' +\n                    borderSteps[i] + '\"></i>' + lbl + '</span>').join('');\n                rows.push('<div class=\"lg-scale\">' + scale + '</div>');\n                rows.push('<div class=\"lg-sub\">' + this.t('trends.mapTools.sitesPerCell', 'sites per cell') + '</div>');\n            } else {\n                rows.push('<div class=\"lg-row\"><i class=\"lg-sw\" style=\"background:' +\n                    settings.mapStyleSite.fill + ';border-color:' + settings.mapStyleSite.border +\n                    '\"></i><span>' + obsLabel + '</span></div>');\n            }\n            const nbNoDetection = squares.filter((sq: any) => sq.nb_loc_pos === 0).length;\n            if (this.hasCompleteSurvey() && nbNoDetection) {\n                rows.push('<div class=\"lg-row\"><i class=\"lg-sw\" style=\"background:' +\n                    settings.mapStyleSite.noDetectionFill + ';border-color:' +\n                    settings.mapStyleSite.noDetectionFill + '\"></i><span>' +\n                    this.t('trends.mapTools.noDetection', 'no detections') + '</span></div>');\n            }\n            rows.push('<div class=\"lg-count\">' +\n                this.t('trends.mapTools.cellsCount', 'cells') + ': ' + nbCells + ' · ' +\n                this.component.$tc('trends.sites', {n: nbSites}) + '</div>');\n        }\n\n        // Distribution range swatch.\n        if (settings.showDistribution) {\n            rows.push('<div class=\"lg-row\"><i class=\"lg-sw\" style=\"background:' +\n                settings.mapStyleDistribution.fill + '\"></i><span>' +\n                this.component.$t('trends.distribution') + '</span></div>');\n        }\n        return rows.join('');\n    }\n\n    createLegend(){\n        const html = this.legendHtml();\n        if (this.legendDiv) {\n            this.legendDiv.innerHTML = html;\n            return;\n        }\n        const legend = Leaflet.control({position: 'topright'});\n        legend.onAdd = () => {\n            const div = Leaflet.DomUtil.create('div', 'map-legend');\n            div.innerHTML = html;\n            this.legendDiv = div;\n            return div;\n        };\n        legend.addTo(this.map);\n    }\n\n    /**\n     * Rasterise the current map to a PNG the admin can drop into a report. Composites\n     * the loaded basemap tiles and the vector canvas (cells / distribution / markers)\n     * onto one bitmap — no extra library — then draws a legend and attribution.\n     * Needs CORS-enabled tiles (set in createTileLayer); if the basemap tainted the\n     * canvas we surface a hint instead of a broken download.\n     */\n    exportPng(){\n        const container: HTMLElement | undefined = this.map?.getContainer?.();\n        if (! container) return;\n        const cRect = container.getBoundingClientRect();\n        const dpr = window.devicePixelRatio || 1;\n        const w = Math.round(cRect.width);\n        const h = Math.round(cRect.height);\n\n        const canvas = document.createElement('canvas');\n        canvas.width = w * dpr;\n        canvas.height = h * dpr;\n        const ctx = canvas.getContext('2d');\n        if (! ctx) return;\n        ctx.scale(dpr, dpr);\n        ctx.fillStyle = '#ffffff';\n        ctx.fillRect(0, 0, w, h);\n\n        const drawEl = (el: any) => {\n            const r = el.getBoundingClientRect();\n            if (r.width === 0 || r.height === 0) return;\n            try {\n                ctx.drawImage(el, r.left - cRect.left, r.top - cRect.top, r.width, r.height);\n            } catch (e) { /* skip an un-drawable element */ }\n        };\n\n        // Basemap tiles first.\n        container.querySelectorAll('.leaflet-tile-pane img').forEach((img: any) => {\n            if (img.complete && img.naturalWidth > 0) drawEl(img);\n        });\n\n        const finish = () => {\n            this.drawExportLegend(ctx, w, h);\n            try {\n                canvas.toBlob((blob: Blob | null) => {\n                    if (! blob) return;\n                    const url = URL.createObjectURL(blob);\n                    const a = document.createElement('a');\n                    const species = this.component?.species?.id || 'map';\n                    a.href = url;\n                    a.download = `map_${species}_${this.settings.mapAggregation}.png`;\n                    document.body.appendChild(a);\n                    a.click();\n                    document.body.removeChild(a);\n                    URL.revokeObjectURL(url);\n                }, 'image/png');\n            } catch (e) {\n                // Tainted canvas (basemap without CORS headers, e.g. Topo). Guide the admin.\n                this.showInfo(this.t('trends.mapTools.exportTainted',\n                    'Could not export this basemap. Switch to OpenStreetMap, Carto or Satellite and try again.'));\n            }\n        };\n\n        // Vector layers live in the SVG overlay pane; serialise it to an image and\n        // draw it over the tiles. It carries no external refs, so it never taints.\n        const svg = container.querySelector('.leaflet-overlay-pane svg') as SVGElement | null;\n        if (! svg) { finish(); return; }\n        const svgRect = svg.getBoundingClientRect();\n        const clone = svg.cloneNode(true) as SVGElement;\n        // Measure the on-screen box from the original (transformed) element, then strip\n        // the positioning transform on the clone so the rasterised image holds only the\n        // viewBox-mapped content — we place that content back at svgRect via drawImage.\n        (clone as any).style.transform = 'none';\n        clone.setAttribute('width', String(svgRect.width));\n        clone.setAttribute('height', String(svgRect.height));\n        const xml = new XMLSerializer().serializeToString(clone);\n        const img = new Image();\n        img.onload = () => {\n            try { ctx.drawImage(img, svgRect.left - cRect.left, svgRect.top - cRect.top, svgRect.width, svgRect.height); } catch (e) { /* ignore */ }\n            finish();\n        };\n        img.onerror = () => finish();\n        img.src = 'data:image/svg+xml;charset=utf-8,' + encodeURIComponent(xml);\n    }\n\n    /** Draws a compact legend + basemap attribution onto the export canvas. */\n    drawExportLegend(ctx: any, w: number, h: number){\n        const settings = this.settings;\n        const pad = 10;\n        const lines: Array<{sw?: string, steps?: string[], text: string, bold?: boolean}> = [];\n\n        if (settings.showSquares) {\n            if (settings.mapStyleSite.graduated) {\n                const ms = settings.mapStyleSite;\n                lines.push({text: this.component.$t('trends.observations'), bold: true});\n                lines.push({steps: gradientSteps(ms.fillTo, ms.fill, ms.gradientMode, ms.gradientInvert),\n                    text: COUNT_BIN_LABELS.join('  ')});\n            } else {\n                lines.push({sw: settings.mapStyleSite.fill,\n                    text: this.component.$t('trends.observations')});\n            }\n            const nbNoDetection = (this.component?.squares || [])\n                .filter((sq: any) => sq.nb_loc_pos === 0).length;\n            if (this.hasCompleteSurvey() && nbNoDetection) {\n                lines.push({sw: settings.mapStyleSite.noDetectionFill,\n                    text: this.t('trends.mapTools.noDetection', 'no detections')});\n            }\n        }\n        if (settings.showDistribution) {\n            lines.push({sw: settings.mapStyleDistribution.fill,\n                text: this.component.$t('trends.distribution')});\n        }\n        if (! lines.length) return;\n\n        const lineH = 18;\n        const boxW = 190;\n        const boxH = pad * 2 + lines.length * lineH;\n        const x0 = w - boxW - pad;\n        const y0 = pad;\n\n        ctx.fillStyle = 'rgba(255,255,255,0.92)';\n        ctx.strokeStyle = '#cbd5e1';\n        ctx.lineWidth = 1;\n        ctx.fillRect(x0, y0, boxW, boxH);\n        ctx.strokeRect(x0, y0, boxW, boxH);\n\n        ctx.textBaseline = 'middle';\n        ctx.font = '12px system-ui, sans-serif';\n        let y = y0 + pad + lineH / 2;\n        for (const ln of lines) {\n            let x = x0 + pad;\n            if (ln.steps) {\n                for (const c of ln.steps) {\n                    ctx.fillStyle = c;\n                    ctx.fillRect(x, y - 6, 12, 12);\n                    x += 13;\n                }\n                x += 4;\n            } else if (ln.sw) {\n                ctx.fillStyle = ln.sw;\n                ctx.fillRect(x, y - 6, 12, 12);\n                x += 18;\n            }\n            ctx.fillStyle = '#0f172a';\n            ctx.font = ln.bold ? '600 12px system-ui, sans-serif' : '12px system-ui, sans-serif';\n            ctx.fillText(ln.text, x, y);\n            y += lineH;\n        }\n\n        // Basemap attribution, bottom-left.\n        const cfg = MyMap.BASEMAPS[settings.mapLayer] || MyMap.BASEMAPS.OSM;\n        const attr = (cfg.attribution || '').replace(/<[^>]*>/g, '');\n        if (attr) {\n            ctx.font = '10px system-ui, sans-serif';\n            const tw = ctx.measureText(attr).width;\n            ctx.fillStyle = 'rgba(255,255,255,0.8)';\n            ctx.fillRect(2, h - 16, tw + 8, 14);\n            ctx.fillStyle = '#475569';\n            ctx.fillText(attr, 6, h - 9);\n        }\n    }\n\n    // createDragAndSelectRect(){\n    //     // if (this.selectRectangle){\n    //     //     this.selectRectangle.remove();\n    //     // }\n    //     this.removeDragAndSelectRect();\n    //     this.selectRectangle = Leaflet.rectangle([[0,0], [0,0]], { color: \"#000\", weight: 2, fillColor: \"#00f\", fillOpacity: 0.25 });\n    //     this.selectRectangle.addTo(this.map);\n    // }\n    // removeDragAndSelectRect(){\n    //     if (this.selectRectangle){\n    //         this.selectRectangle.remove();\n    //         this.selectRectangle = undefined;\n    //     }\n    // }\n\n    // removeDragAndSelectButton(){\n    //     if (!this.dragAndSelectButtonContainer) return;\n    //     //  remove the info panel (rect)\n    //     this.dragAndSelectButtonContainer.remove();\n    //     this.dragAndSelectButtonContainer = undefined;\n    //     //  remove the element representing the select rectangle\n    //     this.removeDragAndSelectRect();\n    //     //  remove the drag and select button\n    //     this.map.off(\"mousedown\", this.dnsDown);\n    //     this.map.off(\"mouseup\", this.dnsUp);\n    //     this.map.off(\"mousemove\", this.dnsMove);\n    // }\n    // createDragAndSelect(){\n    //     if (this.dragAndSelectButtonContainer) return;\n    //     const ctl = Leaflet.control({position: 'topleft'});\n    //     this.dragAndSelectButtonContainer = ctl;\n    //     ctl.onAdd = (map: any) => {//function (map) {\n    //         const div: HTMLElement = Leaflet.DomUtil.create('div', 'leaflet-bar leaflet-control');\n    //         const button: HTMLAnchorElement = Leaflet.DomUtil.create(\"a\", \"leaflet-control-custom\", div);\n    //         button.href = \"#\";\n    //         button.title = this.component.$t('trends.map.dragAndSelect');\n    //         button.innerHTML = '<svg class=\"bi\" width=\"24\" height=\"24\"><use xlink:href=\"#bi-bounding-box\"/></svg>';\n    //         this.dragAndSelectButton = button;\n    //\n    //         Leaflet.DomEvent.on(button, \"click\", (e: Leaflet.DomEvent.Event) => {\n    //             Leaflet.DomEvent.stopPropagation(e);\n    //             Leaflet.DomEvent.preventDefault(e);\n    //             this.setDragAndSelect(! this.dragAndSelect);\n    //         });\n    //\n    //         return div;\n    //     };\n    //     ctl.addTo(this.map);\n    //\n    //\n    //     // Handle map click event to update the drag-and-select rectangle\n    //     this.map.on(\"mousedown\", this.dnsDown);\n    //     this.map.on(\"mouseup\", this.dnsUp);\n    //     // Handle map mousemove event to update the drag-and-select rectangle during dragging\n    //     this.map.on(\"mousemove\", this.dnsMove);\n    // }\n\n    // deleteSelection(){\n    //     this.removeOuterWorldBounds();\n    //     this.removeDragAndSelectRect();\n    //     this.component.$nextTick(() => {\n    //         this.hideInfo()\n    //         if (this.callbackSelectRectangle){\n    //             this.callbackSelectRectangle(null);\n    //         }\n    //     });\n    // }\n\n    // setDragAndSelect(enabled: boolean){\n    //     this.dragAndSelect = enabled;\n    //     this.dragAndSelectStarted = false;\n    //     if (this.dragAndSelect){\n    //         this.createDragAndSelectRect();\n    //         let html = \"\";\n    //         html += '<svg class=\"bi me-2\" width=\"32\" height=\"32\"><use xlink:href=\"#bi-bounding-box\"/></svg>';\n    //         html += this.component.$t('trends.dragAndSelect');\n    //         this.showInfo(html);\n    //         this.map.dragging.disable();\n    //         this.dragAndSelectButton.style.backgroundColor = \"black\";\n    //         this.dragAndSelectButton.style.color = \"white\";\n    //     }\n    //     else{\n    //         // this.hideInfo();\n    //         this.map.dragging.enable();\n    //         this.dragAndSelectButton.style.backgroundColor = \"white\";\n    //         this.dragAndSelectButton.style.color = \"black\";\n    //     }\n    // }\n\n    // updateSelectRectangle(latlng: Leaflet.LatLng){\n    //     const minLat = Math.min(this.dragAndSelectStartPos.lat, latlng.lat);\n    //     const maxLat = Math.max(this.dragAndSelectStartPos.lat, latlng.lat);\n    //     const minLng = Math.min(this.dragAndSelectStartPos.lng, latlng.lng);\n    //     const maxLng = Math.max(this.dragAndSelectStartPos.lng, latlng.lng);\n    //     this.selectRectangle.setBounds([[minLat, minLng], [maxLat, maxLng]]);\n    // }\n\n    // createOuterWorldBounds(){\n    //     this.removeOuterWorldBounds();\n    //     const outerBounds = [\n    //         [-90, -1800],\n    //         [-90, 1800],\n    //         [90, 1800],\n    //         [90, -1800],\n    //     ];\n    //     const rectBounds = this.selectRectangle.getBounds();\n    //     const innerBounds = [\n    //         [rectBounds.getSouth(), rectBounds.getWest()],\n    //         [rectBounds.getSouth(), rectBounds.getEast()],\n    //         [rectBounds.getNorth(), rectBounds.getEast()],\n    //         [rectBounds.getNorth(), rectBounds.getWest()],\n    //     ];\n    //\n    //     this.outerWorldBounds = Leaflet.polygon([outerBounds, innerBounds], { color: '#000', opacity: 1.0, fillOpacity: 0.5 }).addTo(this.map);\n    // }\n\n    // removeOuterWorldBounds(){\n    //     if (this.outerWorldBounds){\n    //         this.outerWorldBounds.remove(this.map);\n    //     }\n    //     this.outerWorldBounds = undefined;\n    // }\n\n    // createDistributionLayer(distributionSquares: any[]){\n    //     if (!this.map) return;\n    //     // if (this.map){\n    //     //     this.map.off();\n    //     //     this.map.remove();\n    //     //     this.create();\n    //     // }\n    //     this.createTileLayer();\n    //     this.createLegend(); //this is a quick hack to make the legend update (colors change)\n    //     const settings = this.settings;\n    //     if (this.distributionLayer) {\n    //         this.map.removeLayer(this.distributionLayer);\n    //     }\n    //     if (!settings.showDistribution) return;\n    //     const allSquares = [];\n    //     const options: any = JSON.parse(JSON.stringify(settings.mapOptionsDistribution));\n    //     for (const idx in distributionSquares) {\n    //         const s = distributionSquares[idx];\n    //\n    //         const poly = this.polygonFromSquare(s, options);\n    //         if (! poly) continue;\n    //         allSquares.push(poly);\n    //     }\n    //     const distributionLayer = new Leaflet.LayerGroup(allSquares);\n    //     distributionLayer.addTo(this.map);\n    //     this.distributionLayer = distributionLayer;\n    // }\n\n    createDistributionLayerFull(geojsonData: any){\n        if (this.distributionLayer) {\n            this.map.removeLayer(this.distributionLayer);\n            this.distributionLayer = null;\n        }\n        if (!this.settings.showDistribution || ! geojsonData) return;\n\n        this.distributionLayer = Leaflet.geoJSON(geojsonData, this.styleForDistribution()).addTo(this.map);\n        if (this.distributionLayer.bringToBack) this.distributionLayer.bringToBack();\n    }\n\n    /**\n     * Renders one marker at the centre of every observation grid square. The squares\n     * are already incognito-filtered and aggregated server-side, so this stays privacy\n     * safe (no exact site coordinates are exposed). Honors the `showLocations` toggle.\n     */\n    createLocationsLayer(squares: any[]){\n        if (this.locationsLayer) {\n            this.map.removeLayer(this.locationsLayer);\n            this.locationsLayer = null;\n        }\n        if (!this.settings.showLocations || ! squares) return;\n\n        const markers = [];\n        const s = this.settings.mapStyleSite;\n        const markerOptions = {\n            radius: 4,\n            color: s.border,\n            weight: 1,\n            opacity: 1,\n            fillColor: s.fill,\n            fillOpacity: 0.9,\n        };\n        for (const idx in squares) {\n            const center = this.squareCenter(squares[idx]);\n            if (! center) continue;\n            const marker = Leaflet.circleMarker(center, markerOptions);\n            const nb = squares[idx].nb_loc;\n            if (nb != null) {\n                marker.bindPopup('<h6>' + this.component.$tc('trends.sites', {n: nb}) + '</h6>');\n            }\n            markers.push(marker);\n        }\n        this.locationsLayer = new Leaflet.LayerGroup(markers);\n        this.locationsLayer.addTo(this.map);\n    }\n\n    /** Returns the [lat, lon] centre of a grid square, from a polygon or grid indices. */\n    squareCenter(s: any): number[] | undefined {\n        if (s.polygon && s.polygon.length) {\n            let latSum = 0, lonSum = 0;\n            for (const p of s.polygon) { latSum += p[0]; lonSum += p[1]; }\n            return [latSum / s.polygon.length, lonSum / s.polygon.length];\n        }\n        if (s.i) {\n            const [lat1, lon1] = this.squaresHelper.coordsByIndex(s.i[0], s.i[1]);\n            const end = s.i2 ? [s.i2[0] + 1, s.i2[1] + 1] : [s.i[0] + 1, s.i[1] + 1];\n            const [lat2, lon2] = this.squaresHelper.coordsByIndex(end[0], end[1]);\n            return [(lat1 + lat2) / 2, (lon1 + lon2) / 2];\n        }\n        return undefined;\n    }\n\n\n    /** \"Inverts\" a json geometry by cutting holes into the world polygon. */\n    createHolesFromGeometry(geojsonData: any){\n        const outerBounds = [\n            [-90, -1800],  // Using extended longitude range like in your working code\n            [-90, 1800],\n            [90, 1800],\n            [90, -1800],\n        ];\n\n        const innerBounds: any[] = [];\n\n        const extractCoordinates = (geometry: any) => {\n            if (geometry.type === 'Polygon') {\n                // Convert from [lng, lat] to [lat, lng] for Leaflet\n                const coords = geometry.coordinates[0].map((coord: any) => [coord[1], coord[0]]);\n                innerBounds.push(coords);\n\n                // Also add any holes from the original polygon\n                for (let i = 1; i < geometry.coordinates.length; i++) {\n                    const hole = geometry.coordinates[i].map((coord: any) => [coord[1], coord[0]]);\n                    innerBounds.push(hole);\n                }\n            } else if (geometry.type === 'MultiPolygon') {\n                geometry.coordinates.forEach((polygon: any) => {\n                    // Add the outer ring\n                    const coords = polygon[0].map((coord: any) => [coord[1], coord[0]]);\n                    innerBounds.push(coords);\n\n                    // Add any holes from this polygon\n                    for (let i = 1; i < polygon.length; i++) {\n                        const hole = polygon[i].map((coord: any) => [coord[1], coord[0]]);\n                        innerBounds.push(hole);\n                    }\n                });\n            }\n        };\n\n        if (geojsonData.type === 'FeatureCollection') {\n            geojsonData.features.forEach((feature: any) => {\n                extractCoordinates(feature.geometry);\n            });\n        } else if (geojsonData.type === 'Feature') {\n            extractCoordinates(geojsonData.geometry);\n        } else {\n            // Direct geometry object\n            extractCoordinates(geojsonData);\n        }\n        return [innerBounds, outerBounds];\n    }\n    // createRegionLayer(geojsonData: any){\n    //     if (this.regionLayer) {\n    //         this.map.removeLayer(this.regionLayer);\n    //     }\n    //     if (! geojsonData) return;\n    //\n    //     // const [innerBounds, outerBounds] = this.createHolesFromGeometry(geojsonData);\n    //     // if (innerBounds.length > 0) {\n    //     //     const options: any = JSON.parse(JSON.stringify(this.settings.mapOptionsHide));\n    //     //     this.regionLayer = Leaflet.polygon([outerBounds, ...innerBounds], options).addTo(this.map);\n    //     // } else {\n    //     //     // Fallback: just create world polygon if no inner bounds\n    //     //     const options: any = JSON.parse(JSON.stringify(this.settings.mapOptionsRegion));\n    //     //     this.regionLayer = Leaflet.geoJSON(geojsonData, options).addTo(this.map);\n    //     // }\n    //\n    //     const options: any = JSON.parse(JSON.stringify(this.settings.mapOptionsRegion));\n    //     this.regionLayer = Leaflet.geoJSON(geojsonData, options).addTo(this.map);\n    // }\n\n\n    createRegionLayer(geojsonData: any){\n        if (this.regionLayer) {\n            this.map.removeLayer(this.regionLayer);\n        }\n        if (! geojsonData) {\n            this.regionLayer = null;\n            this.createLegend(); // Update legend when no region data\n            setTimeout(() => {\n                this.centerMap();\n            }, 240);\n            return;\n        }\n        // Try to render an inverse mask: darken everything outside the selected region\n        const [innerBounds, outerBounds] = this.createHolesFromGeometry(geojsonData);\n        if (innerBounds && innerBounds.length > 0) {\n            this.regionLayer = Leaflet.polygon([outerBounds, ...innerBounds], this.styleForRegionMask()).addTo(this.map);\n        }\n        else{\n            // Fallback: draw the region normally if we couldn't extract any bounds\n            this.regionLayer = Leaflet.geoJSON(geojsonData, this.styleForRegionMask()).addTo(this.map);\n        }\n        this.createLegend(); // Update legend when region layer is created\n\n        // Fit map to the bounds of the geojsonData\n        try {\n            let bounds: any = null;\n            if (innerBounds && innerBounds.length > 0) {\n                const points: Leaflet.LatLng[] = [];\n                for (const ring of innerBounds) {\n                    for (const coord of ring) {\n                        // coord is [lat, lng]\n                        points.push(Leaflet.latLng(coord[0], coord[1]));\n                    }\n                }\n                if (points.length > 0) {\n                    bounds = Leaflet.latLngBounds(points);\n                }\n            }\n            if (bounds && bounds.isValid && bounds.isValid()) {\n                // Defer the fit like the no-region centerMap() branch above:\n                // on a backend-preloaded route the map is created while its\n                // container is still hidden (v-show), so fitting immediately\n                // frames the region into a zero-sized viewport and zooms fully\n                // out. Waiting lets resizedFn() size the container first; we\n                // invalidateSize() so the fit uses its final dimensions.\n                const regionBounds = bounds;\n                setTimeout(() => {\n                    if (! this.map) return;\n                    this.map.invalidateSize();\n                    this.map.fitBounds(regionBounds);\n                }, 240);\n            }\n        } catch (err) {\n            console.warn('Could not fit map to region bounds', err);\n        }\n    }\n\n    createSitesLayer(squares: any[]){\n        const settings = this.settings;\n        if (this.squaresLayer) {\n            this.map.removeLayer(this.squaresLayer);\n        }\n\n        if (!settings.showSquares) return;\n        const allSquares = [];\n        for (const idx in squares) {\n            const s = squares[idx];\n            const baseStyle = this.styleForCell(s.nb_loc || 0, s.nb_loc_pos);\n            const poly = this.polygonFromSquare(s, baseStyle);\n            if (! poly) continue;\n\n            // Hover: lift the cell with a heavier outline, then restore its base style.\n            poly.on('mouseover', (e: any) => {\n                e.target.setStyle({weight: Math.max(2, (baseStyle.weight || 0) + 2), color: '#0f172a'});\n                if (e.target.bringToFront) e.target.bringToFront();\n            });\n            poly.on('mouseout', (e: any) => {\n                e.target.setStyle(baseStyle);\n            });\n\n            poly.bindTooltip(this.cellTooltipHtml(s), {sticky: true, direction: 'top', className: 'map-cell-tooltip'});\n            poly.bindPopup(this.cellPopupHtml(s));\n            allSquares.push(poly);\n        }\n        const squaresLayer = new Leaflet.LayerGroup(allSquares);\n        squaresLayer.addTo(this.map);\n        this.squaresLayer = squaresLayer;\n    }\n\n    /** Resolve a contributors dict {supplierId: count} to display names. */\n    contributorNames(contributors: any): string[] {\n        const names: string[] = [];\n        for (const cIdx in contributors || {}) {\n            let c = undefined;\n            for (const cmp of this.component?.contributors || []) {\n                if (cmp.id == cIdx) c = cmp;\n            }\n            names.push(c ? c.name : ('#' + cIdx));\n        }\n        return names;\n    }\n\n    /** Compact hover tooltip: TK25 sheet id as title in TK25 mode, else the site count. */\n    cellTooltipHtml(s: any): string {\n        const title = s.tk25\n            ? this.t('trends.mapTools.tk25Sheet', 'TK25 sheet') + ' ' + s.tk25\n            : this.component.$tc('trends.sites', {n: s.nb_loc});\n        let html = '<strong>' + title + '</strong>';\n        if (s.tk25) {\n            html += '<br>' + this.component.$tc('trends.sites', {n: s.nb_loc});\n        }\n        const names = this.contributorNames(s.contributors);\n        if (names.length) {\n            const shown = names.slice(0, 3).join(', ');\n            const more = names.length > 3 ? ' +' + (names.length - 3) : '';\n            html += '<br><span class=\"tt-muted\">' + shown + more + '</span>';\n        }\n        if (this.hasCompleteSurvey() && s.nb_loc_pos !== undefined) {\n            html += '<br>' + this.component.$tc('trends.sites', {n: s.nb_loc_pos}) + ' · ' +\n                this.t('trends.mapTools.withDetections', 'with detections');\n        }\n        return html;\n    }\n\n    /** Fuller click popup with the complete contributor list. */\n    cellPopupHtml(s: any): string {\n        const title = s.tk25\n            ? this.t('trends.mapTools.tk25Sheet', 'TK25 sheet') + ' ' + s.tk25\n            : this.component.$tc('trends.sites', {n: s.nb_loc});\n        let html = '<h6>' + title + '</h6>';\n        if (s.tk25) {\n            html += '<div>' + this.component.$tc('trends.sites', {n: s.nb_loc}) + '</div>';\n        }\n        html += '<div class=\"text-muted\">';\n        const names = this.contributorNames(s.contributors);\n        html += names.length ? names.join(', ') : 'No contributors';\n        html += '</div>';\n        if (this.hasCompleteSurvey() && s.nb_loc_pos !== undefined) {\n            html += '<div>' + this.component.$tc('trends.sites', {n: s.nb_loc_pos}) + ' · ' +\n                this.t('trends.mapTools.withDetections', 'with detections') + '</div>';\n        }\n        return html;\n    }\n\n    polygonFromSquare(s: any, options: any){\n        if (s.polygon) {\n            return Leaflet.polygon(s.polygon, options);\n        }\n        else if (s.i){\n            const [lat1, lon1] = this.squaresHelper.coordsByIndex(s.i[0], s.i[1]);\n            let lat2, lon2;\n            if (s.i2){\n                [lat2, lon2] = this.squaresHelper.coordsByIndex(s.i2[0] + 1, s.i2[1] + 1);\n            }\n            else{\n                [lat2, lon2] = this.squaresHelper.coordsByIndex(s.i[0] + 1, s.i[1] + 1);\n            }\n\n            const poly = [\n                [lat1, lon1],\n                [lat1, lon2],\n                [lat2, lon2],\n                [lat2, lon1]\n            ];\n            return Leaflet.polygon(poly, options);\n        }\n        return undefined;\n    }\n}\n\nexport {MyMap}","<script>\nimport {defineComponent} from 'vue';\nimport {ApiCommunication, ApiRequestBuilder} from \"@/lib/ApiCom\";\nimport {MyD3} from \"@/lib/myd3/MyD3\";\nimport {inlaTrendToTraces} from \"@/lib/inla/inlaTrendToTraces\";\nimport {mergeObsPlots} from \"@/lib/trends/mergeObsPlots\";\nimport {loadPlotDisplaySettings, savePlotDisplaySettings} from \"@/lib/trends/plotDisplayStore\";\nimport {User} from \"@/lib/User\";\nimport MyBase from \"@/components/trends/MyBase.vue\";\nimport {MyPlotSettings} from \"@/components/trends/settings/MyPlotSettings\";\nimport {MyMap} from \"@/trends/map\";\nimport {sitesShortcutUrlForPlotOptions} from \"@/lib/siteShortcuts\";\nimport axios from \"axios\";\n\nconst ApiCom = new ApiCommunication('/api_plot');\n\nexport default defineComponent({\n  extends: MyBase,\n  data: function (){\n    return {\n      prefix: \"x\", //used for html ids etc.; prevents collisions with other components (for previewing multiple layouts)\n\n      working: true,\n      fatalError: null,\n      loadingInfoTexts: [],\n\n      map: null,\n      plotSettings: null,\n\n      //  these are obsolete. actually you should use the plotsettings (below)\n      //  TODO: make them computed props\n      species: null,\n      speciesTitles: null,\n      //  these are obsolete. actually you should use the plotsettings (above)\n\n      squares: [],\n      locations: [],\n      contributors:[],\n      nbLocations: 0,\n      nbCounts: 0,\n      siteStats: null,\n\n      plot: null,\n      plotError: null,\n      overall: null,\n      summary: null,\n      timings: null,\n      gof: null,\n      isInla: false,\n      obsPlots: null,\n    };\n  },\n  created: function() {\n    if (! this.store.plotSettings){\n      this.store.plotSettings = new MyPlotSettings(this);\n    }\n    // The MyD3 charts currently on the page (deliberately not reactive): a display\n    // setting changed in one of them is pushed to the others.\n    this.liveCharts = [];\n    window.addEventListener(\"resize\", this.resizedListener);\n  },\n  unmounted: function() {\n    window.removeEventListener(\"resize\", this.resizedListener);\n  },\n  mounted() {\n    this.createMap();\n    this.resizedListener();\n    if (window.trendData){\n      // Django pre-injects trendData into the page, bypassing ApiCom entirely.\n      // Since no API request is made, ApiCom's request tracking won't reset working.\n      this.handleResponse(window.trendData);\n      this.working = false;\n    }\n  },\n  methods: {\n    resizedListener: function(){\n      if (this.resizeTimeoutId){\n        clearTimeout(this.resizeTimeoutId);\n      }\n      this.resizeTimeoutId = setTimeout(this.resizedFn, 150);\n    },\n    resizedFn: function(){\n      const elmMap = document.getElementById(this.idMap);\n      const elmMap2 = document.getElementById(\"box2\");\n      // Absent in the side-by-side layout, where each type owns its own container\n      // and takes its height from CSS.\n      const elmPlot = document.getElementById(this.getPlotId());\n      // Size from the empty-state box while it exists, from the map otherwise.\n      const basis = elmMap2 || elmMap;\n      if (basis) {\n        // Clear our own previous inline height before measuring, so clientHeight\n        // reflects the CSS-intended height (e.g. the map's 45vh). Measuring with\n        // the inline height in place ratchets: a height computed in the\n        // no-species empty state would override the CSS forever and could\n        // never shrink again.\n        basis.style.height = '';\n        const w = basis.clientWidth;\n        // Hidden or not laid out yet (e.g. mid re-render) — don't size from a\n        // zero-width element; keep CSS heights and let the next call fix it up.\n        if (w > 0) {\n          const h = Math.max(basis.clientHeight, Math.floor(w * 0.7));\n          if (elmMap2) elmMap2.style.height = h + 'px';\n          if (elmMap) elmMap.style.height = h + 'px';\n          if (elmPlot) elmPlot.style.height = h + 'px';\n        }\n      }\n      if (this.map?.map) this.map.map.invalidateSize();\n      this.updatePlot();\n    },\n    get: function (){\n      const data = new ApiRequestBuilder('GET', this.buildOptions()).build();\n      ApiCom.post(this, data, this.handleResponse, this.handleError);\n    },\n    handleResponse: function (json){\n      const settingsComponent = this.$refs.settings;\n      const settings = settingsComponent.settings;\n      if (json.user){\n        this.store.user = new User(json.user);\n      }\n      settingsComponent.handleResponse(json);\n      if (json.species) {\n        this.speciesDict = settings.speciesDict;\n        this.species = settings.species;\n\n        this.speciesTitles = json.speciesDesc.titles;\n\n\n        const images = json.speciesImages;\n\n        this.store.speciesDict = this.speciesDict;\n        for (const speciesId in this.speciesDict){\n          const s = this.speciesDict[speciesId];\n          if (s.counts){\n            //  these are special counts, not actual species\n            const sImages = [];\n            // const sDescs = {}\n            for (const sub of s.counts){\n              const subImages = images[sub] || [];\n              sImages.push(...subImages);\n              // sImages[sub] = subImages;\n\n              const subDescId = json.speciesDesc.species[sub];\n              if (subDescId){\n                const desc = json.speciesDesc.data[subDescId];\n                // sDescs[sub] = desc;\n                // this.speciesDict[speciesId].desc = desc;\n              }\n            }\n            s.images = sImages;\n            // if (s.id === \"WHISKERED\"){\n            //   alert(JSON.stringify(s));\n            // }\n          }\n          else{\n            s.images = images[speciesId] || [];\n            const descId = json.speciesDesc.species[speciesId];\n            if (descId){\n              const desc = json.speciesDesc.data[descId];\n              s.desc = desc;\n            }\n          }\n        }\n\n        // for (const speciesId in this.speciesDict){\n        //   this.speciesDict[speciesId].images = [];\n        //   const descId = json.speciesDesc.species[speciesId];\n        //   if (descId){\n        //     const desc = json.speciesDesc.data[descId];\n        //     this.speciesDict[speciesId].desc = desc;\n        //   }\n        // }\n        //\n        // for (const speciesId in images){\n        //   const s = this.speciesDict[speciesId];\n        //   s.images = images[speciesId];\n        // }\n      }\n\n      this.speciesDict = settings.speciesDict;\n      this.species = settings.species;\n\n      this.store.plotSettings.handleResponse(json);\n\n      this.plot = json.plot;\n      this.obsPlots = json.obsPlots || null;\n      this.updatePlot();\n\n      this.nbLocations = json.nb_loc;\n      this.nbCounts = json.nb_rows;\n      // Detection breakdown; present only for frames containing data from an import\n      // that records complete surveys (fnt_counts v12 provenance).\n      this.siteStats = json.site_stats || null;\n      this.plotError = json.plot_error;\n      this.overall = json.overall;\n      this.summary = json.summary;\n      this.timings = json.timings;\n      this.gof = json.gof;\n\n\n      this.contributors = json.contributors;\n\n      // Cache the distribution geojson so map-only toggles can re-render without a refetch.\n      this.distfull = json.distfull;\n      this.map.createDistributionLayerFull(this.distfull);\n      this.map.createRegionLayer(json.region);\n\n      this.squareSize = json.square_size;\n      this.squares = json.squares;\n      // The grid cell size may have changed server-side; rebuild the client-side\n      // index→coordinate helper so reconstructed squares/markers align with the new grid.\n      this.map.setSquareSize(json.square_size);\n      this.updateMapSquare();\n      this.map.createLocationsLayer(this.squares);\n      // Rebuild the legend now that squares/site counts are in memory (createRegionLayer\n      // above ran its own createLegend before this.squares was assigned).\n      this.map.createLegend();\n      // this.centerMap();\n      this.resizedListener();\n    },\n    updatePlot: function(){\n      this.liveCharts = [];\n      const layout = this.store.plotSettings?.obsLayout || 'single';\n      if (layout === 'grid' && this.obsPlots && this.obsPlotIds.length){\n        // The grid cells are rendered by Vue from obsPlots, which we assigned moments\n        // ago — they do not exist in the DOM until the re-render lands.\n        this.$nextTick(this.drawObsGrid);\n        return;\n      }\n      const plotId = this.getPlotId();\n      if (layout === 'combined' && this.obsPlots && this.obsPlotIds.length){\n        this.drawCombined(plotId);\n        return;\n      }\n      if (this.plot) {\n        const customOptions = this.getCustomOptions();\n        // INLA hurdle: draw the composite p123 into the main trend card via the adapter.\n        // The raw inla plot ships an empty `traces` array (traces are built client-side).\n        // No ttShowSignificance: the per-segment line colouring already shows it, and\n        // the tooltip now belongs to the per-year trace (value + site count).\n        this.isInla = this.plot.type === 'inla';\n        const plotData = this.isInla ? this.trendPlotData : this.plot;\n        const d3 = new MyD3(plotId, plotData, customOptions, this.$tc);\n\n        // Ensure subtitle end-year reflects actual data (max year from traces)\n        try {\n          const s = this.store.plotSettings;\n          const dataMinYear = Math.ceil(d3.preparedPlot?.xMin || s.yearStart);\n          const dataMaxYear = Math.floor(d3.preparedPlot?.xMax || s.yearEnd);\n          d3.customOptions.subtitle = `${s.selectedRegion.name} (${dataMinYear} - ${dataMaxYear})`;\n        } catch (e) {\n          // Ignore and keep existing subtitle\n        }\n\n        const meaning = this.overall?.slope.meaning.toLowerCase();\n        if (! this.hasEnoughData){\n          d3.message = {\n            text: this.$tc(\"trends.plotError.generic_error\"),\n          };\n        }\n        else if (meaning?.startsWith(\"uncertain\")){\n          d3.message = {\n            text: this.$tc(\"trends.slope.Uncertain\"),\n            color: \"orange\"\n          }\n        }\n\n        d3.draw();\n        this.liveCharts.push(d3);\n\n      }\n      else{\n        //TODO: maybe implement for d3 (missing plot - for now at least clear it)\n        this.isInla = false;\n        const plotId = this.getPlotId();\n        const el = document.getElementById(plotId);\n        if (el) el.innerHTML = '';\n      }\n    },\n    /** \"all in one\": every viewable type's traces merged into a single chart */\n    drawCombined: function(plotId){\n      this.isInla = false;\n      const baseObsId = this.store.plotSettings.observationType?.id;\n      const merged = mergeObsPlots(this.obsPlots, this.obsPlotIds, this.obsTypeLabels, inlaTrendToTraces, baseObsId);\n      const el = document.getElementById(plotId);\n      if (!el) return;\n      if (!merged.traces.length){\n        el.innerHTML = '';\n        return;\n      }\n      const customOptions = this.getCustomOptions();\n      // Each obs type surveys its own set of sites, so the shared bottom \"n sites\"\n      // read-out (taken from the first trace) would be wrong for the other lines —\n      // show each line's own count in its tooltip row instead.\n      const contributing = this.obsPlotIds.filter((id) => this.obsPlots[id]?.plot).length;\n      customOptions.ttShowSitesAtBottom = contributing <= 1;\n      const chart = new MyD3(plotId, merged, customOptions, this.$tc);\n      chart.draw();\n      this.liveCharts.push(chart);\n    },\n    /** \"side by side\": one chart per viewable type, each in its own container */\n    drawObsGrid: function(){\n      this.isInla = false;\n      const s = this.store.plotSettings;\n      for (const obsId of this.obsPlotIds){\n        const el = document.getElementById('divPlotObs_' + obsId);\n        if (!el) continue;\n        const entry = this.obsPlots[obsId];\n        let plotData = entry && entry.plot;\n        if (!plotData){\n          el.innerHTML = '';\n          continue;\n        }\n        const customOptions = this.getCustomOptions();\n        customOptions.subtitle = `${this.obsTypeLabels[obsId]} — ${s.selectedRegion.name} (${s.yearStart} - ${s.yearEnd})`;\n        if (plotData.type === 'inla'){\n          plotData = inlaTrendToTraces(plotData.trend.panels.p123,\n              {title: this.obsTypeLabels[obsId], sitesPerYear: plotData.sites_per_year});\n        }\n        const chart = new MyD3('divPlotObs_' + obsId, plotData, customOptions, this.$tc);\n        chart.draw();\n        this.liveCharts.push(chart);\n      }\n    },\n    /**\n     * A display setting was changed in the settings panel of `source` (which has\n     * already redrawn itself): remember it and bring the other charts in line.\n     */\n    displaySettingsChanged: function(settings, source){\n      savePlotDisplaySettings(settings);\n      for (const chart of this.liveCharts){\n        if (chart !== source) chart.setDisplaySettings(settings);\n      }\n    },\n    getPlotId: function(){\n      if (document.getElementById(\"divPlotTop\") && document.getElementById(\"divPlotTop\").clientHeight > 0){\n        return \"divPlotTop\";\n      }\n      return \"divPlot1\";\n    },\n    handleError: function(error){\n      this.fatalError = error;\n    },\n    raiseFatalError: function(name, message, status){\n      this.fatalError = {\n        name: name,\n        status: status,\n        message: message\n      };\n      this.working = true;\n    },\n\n    /**\n     * called (by event) when settings have changed, and a request of the plot data is neccessary.\n     */\n    settingsChanged: function () {\n      const settings = this.$refs.settings.settings;\n      const speciesChanged = this.species !== settings.species;\n      this.species = settings.species;\n      this.selectedRegion = settings.selectedRegion;\n      // this.map.updateUI();\n      // if (speciesChanged) {\n        this.updateBrowserUrl();\n      // }\n      this.requestData();\n    },\n    /**\n     * called (by event) when settings were modified, but there is no intention\n     * to automatically request the data (affects more settings).\n     */\n    settingsModify: function () {\n      // this.map.updateUI();\n    },\n    requestData: function (){\n      const data = new ApiRequestBuilder('options', this.$refs.settings.buildOptions()).build();\n      ApiCom.post(this, data, this.handleResponse, this.handleError);\n    },\n    download: function(data){\n      this.requestRawData(data);\n    },\n    openSitesShortcut: function (){\n      // admin shortcut: preselect this trend's sites (species + region) on /account/sites\n      const plotOptions = this.$refs.settings.buildOptions();\n      window.location.href = sitesShortcutUrlForPlotOptions(plotOptions, this.$i18n?.locale);\n    },\n    requestRawData: function (options){\n      const plotOptions = this.$refs.settings.buildOptions();\n      const requestData = {\n        options: options,\n        plotOptions: plotOptions\n      };\n      axios.post('/dl/rawData/void', requestData, {\n        responseType: 'blob', // important\n      }).then((response) => {\n        // generate a filename\n        const filename = `${plotOptions.plotModel}_${plotOptions.observationType}_${plotOptions.species}_${plotOptions.yearStart}-${plotOptions.yearEnd}.${options.type}`;\n        // create file link in browser's memory\n        const href = URL.createObjectURL(response.data);\n\n        // create \"a\" HTML element with href to file & click\n        const link = document.createElement('a');\n        link.href = href;\n        link.setAttribute('download', filename); //or any other extension\n        document.body.appendChild(link);\n        link.click();\n\n        // clean up \"a\" element & remove ObjectURL\n        document.body.removeChild(link);\n        URL.revokeObjectURL(href);\n      });\n    },\n\n    createMap: function (){\n      if (this.map){\n        return;\n      }\n      const map = new MyMap(this);\n      map.create();\n      map.callbackSelectRectangle = (bounds) => {\n        this.$refs.settings.updateMapBounds(bounds)\n      };\n      this.map = map;\n      map.map.on('moveend', this.moveMap)\n    },\n\n    centerMap: function (){\n      this.map.centerMap();\n    },\n\n    /**\n     * A map-only setting changed (distribution / markers / map style). Re-render the\n     * map layers from the data already in memory — no server round-trip needed.\n     */\n    mapSettingsChanged: function (){\n      if (! this.map) return;\n      this.map.createTileLayer();\n      this.map.createDistributionLayerFull(this.distfull);\n      this.map.createLocationsLayer(this.squares);\n      this.updateMapSquare();\n      this.map.updateRegionStyle();\n      this.map.createLegend();\n    },\n    getCustomOptions: function () {\n      const s = this.store.plotSettings;\n      const isAdmin = this.store?.user?.isAdmin || false;\n      const customOptions = {\n        downloadName: s.species.id,\n        expertMode: isAdmin,\n        title: s.species.latin,\n        subtitle: `${s.selectedRegion.name} (${s.yearStart} - ${s.yearEnd})`,\n        showGridlines: true,\n        // What the axes of a trend plot are called; shown by default.\n        axisTitles: {\n          x: this.$t('trends.axis.year'),\n          y: this.$t('trends.axis.populationIndex'),\n        },\n        // Display settings (axis titles, the multi-series style of the \"all in one\"\n        // plot): kept in this browser, and only admins may change them for now —\n        // everyone else gets the defaults and no settings button.\n        displaySettings: loadPlotDisplaySettings(isAdmin),\n        displaySettingsEditable: isAdmin,\n        displaySettingsBadge: 'admin',\n        onDisplaySettingsChange: this.displaySettingsChanged,\n      };\n      return customOptions;\n    },\n    // updateMap: function (){\n    //   //  this is actually not used anymore\n    //   //  it was built for location markers\n    //   if (! this.map) return;\n    //   if (this.markersLayer){\n    //     this.map.removeLayer(this.markersLayer);\n    //   }\n    //   if (!this.showLocations) return;\n    //   const allMarkers = [];\n    //   const icon = Leaflet.icon({\n    //     iconUrl: '/static/bats/misc/marker.svg',\n    //     iconSize: [40, 40],\n    //     iconAnchor: [20, 40]\n    //   });\n    //   const options = {icon: icon};\n    //   for (let idx in this.locations){\n    //     const loc = this.locations[idx];\n    //     if (loc.lat !== undefined && loc.lon !== undefined) {\n    //       // const marker = Leaflet.marker([loc.lat, loc.lon], options).addTo(map);\n    //       const marker = Leaflet.marker([loc.lat, loc.lon], options);\n    //       let popupHtml = '<h6>' + loc.name + '</h6><p class=\"text-muted\">';\n    //       if (loc.contributors){\n    //         for (let pidx in loc.contributors){\n    //           if (pidx > 0) popupHtml += ', ';\n    //           popupHtml += loc.contributors[pidx].name;\n    //         }\n    //       }\n    //       popupHtml += '</p>';\n    //       marker.bindPopup(popupHtml);\n    //       allMarkers.push(marker);\n    //     }\n    //   }\n    //\n    //   const markersLayer = new Leaflet.LayerGroup(allMarkers);\n    //   markersLayer.addTo(this.map);\n    //   this.markersLayer = markersLayer;\n    //\n    //   // const featureGroup = new Leaflet.FeatureGroup(allMarkers);\n    //   // this.map.fitBounds(featureGroup.getBounds());\n    // },\n    updateMapSquare: function () {\n      if (!this.map) return;\n      this.map.createSitesLayer(this.squares);\n    },\n\n    // hsv2Rgb: function(h, s, v) {\n    //   let r, g, b, i, f, p, q, t;\n    //   if (arguments.length === 1) {\n    //     s = h.s, v = h.v, h = h.h;\n    //   }\n    //   i = Math.floor(h * 6);\n    //   f = h * 6 - i;\n    //   p = v * (1 - s);\n    //   q = v * (1 - f * s);\n    //   t = v * (1 - (1 - f) * s);\n    //   switch (i % 6) {\n    //     case 0: r = v, g = t, b = p; break;\n    //     case 1: r = q, g = v, b = p; break;\n    //     case 2: r = p, g = v, b = t; break;\n    //     case 3: r = p, g = q, b = v; break;\n    //     case 4: r = t, g = p, b = v; break;\n    //     case 5: r = v, g = p, b = q; break;\n    //   }\n    //   return {\n    //     r: Math.round(r * 255),\n    //     g: Math.round(g * 255),\n    //     b: Math.round(b * 255)\n    //   };\n    // },\n    updateBrowserUrl: function(){\n      // Build the canonical trends path from current state, without vue-router:\n      //   /[en/]trends/<species>[/<obsCode>][/<regionSlug>]\n      // Obs code omitted when 'W'; region omitted for \"all regions\" (id -1)\n      // and map-bounds (id -2). Region slug comes from the server (region.slug).\n      if (!this.species) return;\n      const url = new URL(window.location.href);\n      const first = url.pathname.split(\"/\")[1];\n      const langPrefix = (first === \"en\" || first === \"de\") ? \"/\" + first : \"\";\n\n      const speciesSlug = (this.species.latin || this.species.id).toLowerCase().replace(/ /g, \"-\");\n      const parts = [speciesSlug];\n\n      const settings = this.$refs.settings?.settings;\n      const obs = settings?.observationType;\n      const region = settings?.selectedRegion;\n      if (obs && obs.id && obs.id !== \"W\") {\n        parts.push(obs.id);\n      }\n      if (region && region.slug && region.id !== -1 && region.id !== -2) {\n        parts.push(region.slug);\n      }\n\n      url.pathname = langPrefix + \"/trends/\" + parts.join(\"/\");\n      window.history.replaceState({}, '', url);\n    },\n  },\n  computed:{\n    // isMobile: function(){\n    //   if(/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)){\n    //     return true;\n    //   }else{\n    //     return false;\n    //   }\n    // },\n    hasEnoughData: function(){\n      return this.nbCounts >= 500;\n    },\n    //TODO: maybe reuse in PlotSettings (redundancy)\n    allRegions: function(){\n      return {id:-1, name: this.$t('plotOptions.allRegions')};\n    },\n    //TODO: maybe reuse in PlotSettings (redundancy)\n    mapRegion: function(){\n      return {id:-2, name: this.$t('plotOptions.mapSection')};\n    },\n    /**\n     * return a HTML id for the leaflet map\n     */\n    idMap: function (){\n      return this.prefix + 'map';\n    },\n    /**\n     * The MyD3 PlotData behind the main trend chart AND the top-bar trend summary\n     * (TrendComponentGAM). HGAM plots ship ready-made traces; INLA plots ship raw\n     * panel arrays that the adapter turns into two traces — the drawn line (full\n     * grid, significance colouring) and the hidden per-year hover trace carrying\n     * nbSites (from plot.sites_per_year, injected server-side).\n     */\n    trendPlotData: function(){\n      if (!this.plot) return null;\n      if (this.plot.type !== 'inla') return this.plot;\n      return inlaTrendToTraces(this.plot.trend.panels.p123,\n          {sitesPerYear: this.plot.sites_per_year});\n    },\n    /** ids present in obsPlots, in the server's own order (W, S, SBB, SEC) */\n    obsPlotIds: function(){\n      if (!this.obsPlots) return [];\n      const all = this.store.plotSettings?.observationTypes || {};\n      return Object.keys(all).filter((id) => id in this.obsPlots);\n    },\n    /** short legend labels, keyed by obs type id */\n    obsTypeLabels: function(){\n      const labels = {};\n      for (const id of this.obsPlotIds){\n        const key = 'trends.obsTabs.labels.' + id;\n        const short = this.$t(key);\n        labels[id] = (short === key) ? id : short;\n      }\n      return labels;\n    },\n  },\n});\n</script>\n<style>\n.my-scrollable{\n  overflow-x: hidden;\n  overflow-y: auto;\n}\n</style>","import script from \"./PlotsBase.vue?vue&type=script&lang=js\"\nexport * from \"./PlotsBase.vue?vue&type=script&lang=js\"\n\nimport \"./PlotsBase.vue?vue&type=style&index=0&id=6af03fb4&lang=css\"\n\nconst __exports__ = script;\n\nexport default __exports__","import { User } from '@/lib/User';\nimport { urlFor } from '@/lib/i18nUrl';\n\n/**\n * Shortcuts that preselect a bunch of sites on /account/sites.\n *\n * Every shortcut button (trends page, MyFiles, ...) must be gated by\n * canSeeSiteShortcuts() so the audience can be changed in one place.\n * The backend counterpart is the staff-guarded fetch_shortcut_site_ids\n * action in bats/upload/api.py — keep the two in sync.\n *\n * The selection criteria travel as query params on the sites-page URL\n * (handled in MySitesPage.applySelectionShortcut):\n *   ?selectImport=<DatasetImport id>   sites contained in that import\n *   ?selectPlot=<urlencoded JSON>      sites the trend pipeline uses for\n *                                      these plot options\n * NOTE (planned): a dataScope param will additionally restrict all\n * site-page data fetches to the originating dataset's data.\n */\nexport function canSeeSiteShortcuts(user: User | null): boolean {\n  // currently staff only\n  return !!user && (user.isStaff || user.isAdmin);\n}\n\nexport function sitesShortcutUrlForImport(importId: number, lang?: string): string {\n  return urlFor('/account/sites', lang) + '?selectImport=' + encodeURIComponent(String(importId));\n}\n\nexport function sitesShortcutUrlForPlotOptions(plotOptions: object, lang?: string): string {\n  // rtab=raw: coming from a trend, land on the raw-data tab (species is\n  // preselected from plotOptions.species by the shortcut handler)\n  return urlFor('/account/sites', lang) + '?selectPlot=' + encodeURIComponent(JSON.stringify(plotOptions))\n      + '&rtab=raw';\n}\n","<template>\n  <MyTrendCard :title=\"$t('trends.populationTrend')\" icon=\"graph1\">\n    <template #actions>\n      <ObsTypeSelect @select=\"$emit('select-obs-type', $event)\"></ObsTypeSelect>\n    </template>\n    <div v-if=\"isGrid\" class=\"obs-grid\">\n      <div v-for=\"obsId in obsPlotIds\" :key=\"obsId\" class=\"obs-grid-cell\">\n        <div class=\"obs-grid-title\">\n          {{ obsLabel(obsId) }}\n          <span v-if=\"isAdminOnly(obsId)\" class=\"badge-circle badge-admin\"\n                :title=\"$t('trends.obsTabs.adminOnly')\"></span>\n        </div>\n        <PlotContent :plot=\"obsPlots[obsId].plot\" :plot-error=\"obsPlots[obsId].plot_error\"\n                     :plotId=\"'divPlotObs_' + obsId\" :working=\"working\"></PlotContent>\n      </div>\n    </div>\n    <PlotContent v-else :plot=\"effectivePlot\" :plot-error=\"effectivePlotError\" :plotId=\"plotId\" :working=\"working\"></PlotContent>\n  </MyTrendCard>\n</template>\n\n<script>\nimport {defineComponent} from 'vue';\nimport PlotContent from \"@/components/trends/PlotContent.vue\";\nimport MyTrendCard from \"@/components/trends/cards/MyTrendCard.vue\";\nimport ObsTypeSelect from \"@/components/trends/ObsTypeSelect.vue\";\nimport MyBase from \"@/components/trends/MyBase.vue\";\n\nexport default defineComponent({\n  extends: MyBase,\n  name: 'PlotCard',\n  components: {MyTrendCard, PlotContent, ObsTypeSelect},\n  emits: ['select-obs-type'],\n  props: {\n    plot: null,\n    plotId: {type: String, default: \"divPlot1\"},\n    plotError: Object,\n    working: {type: Boolean, default: false},\n    obsPlots: Object,\n    obsPlotIds: {type: Array, default: () => []},\n  },\n  methods: {\n    obsLabel: function (obsId){\n      const key = 'trends.obsTabs.labels.' + obsId;\n      const short = this.$t(key);\n      return (short === key) ? obsId : short;\n    },\n    isAdminOnly: function (obsId){\n      return this.store?.plotSettings?.observationTypes?.[obsId]?.public === false;\n    },\n  },\n  computed: {\n    isGrid: function (){\n      return this.store?.plotSettings?.obsLayout === 'grid'\n        && !!this.obsPlots && this.obsPlotIds.length > 0;\n    },\n    /**\n     * In the 'combined' layout, divPlot1 is drawn by drawCombined() from obsPlots,\n     * not from the base type's `plot`. The overlay must therefore reflect whether\n     * the MERGED chart has anything to show, not whether the base type succeeded.\n     */\n    isCombined: function (){\n      return this.store?.plotSettings?.obsLayout === 'combined';\n    },\n    hasCombinedContent: function (){\n      if (!this.obsPlots) return false;\n      return Object.values(this.obsPlots).some((entry) => !!entry?.plot);\n    },\n    effectivePlot: function (){\n      if (this.isCombined && this.hasCombinedContent) return true;\n      return this.plot;\n    },\n    effectivePlotError: function (){\n      if (this.isCombined && this.hasCombinedContent) return null;\n      return this.plotError;\n    },\n  },\n});\n</script>\n\n<!-- Add \"scoped\" attribute to limit CSS to this component only -->\n<style scoped>\n.obs-grid {\n  display: grid;\n  grid-template-columns: 1fr 1fr;\n  gap: 1.25rem;\n}\n\n@media (max-width: 1199.98px) {\n  .obs-grid {\n    grid-template-columns: 1fr;\n  }\n}\n\n/* Each chart gets its own quiet sub-panel so the title and plot read as one\n   unit instead of four charts bleeding into shared whitespace. */\n.obs-grid-cell {\n  min-width: 0;\n  background: #ffffff;\n  border: 1px solid #e8eef5;\n  border-radius: 0.625rem;\n  padding: 0.85rem 1rem 0.5rem;\n}\n\n/* Eyebrow label, echoing the section labels in the obs-type menu */\n.obs-grid-title {\n  display: flex;\n  align-items: center;\n  gap: 0.4rem;\n  font-size: 0.72rem;\n  font-weight: 600;\n  color: #64748b;\n  text-transform: uppercase;\n  letter-spacing: 0.05em;\n  margin-bottom: 0.35rem;\n}\n</style>\n","<template>\n  <div class=\"plot-content\">\n    <div :id=\"plotId\" class=\"plot-area\"></div>\n    <div v-if=\"!store.plotSettings?.species\" class=\"plot-overlay empty-state\">\n      <div class=\"empty-state-inner\">\n        <svg width=\"128\" height=\"128\" class=\"empty-icon\"><use xlink:href=\"#graph1\"/></svg>\n        <p class=\"empty-text\">{{ $t('trends.intro.trend1' )}}<br><a class=\"empty-link\" href=\"/methodology\">{{ $t('trends.intro.trend2' )}}</a></p>\n      </div>\n    </div>\n    <div v-else-if=\"!plot && !working\" class=\"plot-overlay error-overlay\">\n      <svg width=\"64\" height=\"64\" class=\"error-icon\"><use xlink:href=\"#exclamation-triangle\"/></svg>\n      <div class=\"error-content\">\n        <h5 class=\"error-title\">{{ $t('trends.plotError.generic_error') }}</h5>\n        <div v-if=\"plotError && user?.isAdmin\" class=\"error-detail\">\n          <span class=\"badge-circle badge-admin me-1\"></span>\n          [{{plotError.severity}}]:\n          {{plotError.message}}\n        </div>\n        <div v-else class=\"error-detail\">\n          {{ $t('trends.plotError.generic_error_plot') }}\n        </div>\n      </div>\n    </div>\n  </div>\n</template>\n\n<script>\nimport {defineComponent} from 'vue';\nimport MyBase from \"@/components/trends/MyBase.vue\";\n\nexport default defineComponent({\n  extends: MyBase,\n  name: 'PlotContent',\n  components: {},\n  props: {\n    plot: null,\n    plotId: {type: String, default: \"divPlot1\"},\n    plotError: Object,\n    working: {type: Boolean, default: false},\n  },\n  // data: function (){\n  //   return {\n  //   }\n  // },\n  // methods: {\n  //   hello: function () {\n  //     return;\n  //   },\n  // },\n});\n</script>\n\n<style scoped>\n.plot-content {\n  position: relative;\n  width: 100%;\n  min-height: 45vh;\n}\n\n.plot-area {\n  height: 45vh;\n}\n\n.plot-overlay {\n  position: absolute;\n  top:0;\n  left:0;\n  width: 100%;\n  height: 100%;\n  display: flex;\n  align-items: center;\n  justify-content: center;\n}\n\n/* Empty State */\n.empty-state {\n  flex-direction: column;\n}\n\n.empty-state-inner {\n  text-align: center;\n}\n\n.empty-icon {\n  color: #94a3b8;\n}\n\n.empty-text {\n  font-size: 1.0625rem;\n  color: #64748b;\n  margin-top: 1.5rem;\n  line-height: 1.6;\n}\n\n.empty-link {\n  color: #64748b;\n  text-decoration: underline;\n  text-underline-offset: 2px;\n}\n\n.empty-link:hover {\n  color: #2563eb;\n}\n\n/* Error Overlay */\n.error-overlay {\n  gap: 0.75rem;\n  padding: 1.25rem;\n  background: rgba(220, 38, 38, 0.06);\n  border: 1px solid rgba(220, 38, 38, 0.2);\n  border-radius: 0.625rem;\n}\n\n.error-icon {\n  flex-shrink: 0;\n  color: #dc2626;\n}\n\n.error-title {\n  font-size: 1rem;\n  font-weight: 600;\n  color: #991b1b;\n  margin: 0 0 0.25rem;\n}\n\n.error-detail {\n  font-size: 0.875rem;\n  color: #1e293b;\n  line-height: 1.5;\n}\n</style>\n","import { render } from \"./PlotContent.vue?vue&type=template&id=9b5e7ac8&scoped=true\"\nimport script from \"./PlotContent.vue?vue&type=script&lang=js\"\nexport * from \"./PlotContent.vue?vue&type=script&lang=js\"\n\nimport \"./PlotContent.vue?vue&type=style&index=0&id=9b5e7ac8&scoped=true&lang=css\"\n\nimport exportComponent from \"/home/s/PycharmProjects/batdemo/myvue/node_modules/vue-loader/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['render',render],['__scopeId',\"data-v-9b5e7ac8\"]])\n\nexport default __exports__","<template>\n  <div class=\"trend-card-wrapper\">\n    <!-- Borderless: title sits inline above the content, no card chrome -->\n    <template v-if=\"cardStyle === 'borderless'\">\n      <h3 class=\"borderless-title\">{{ title }}</h3>\n      <slot></slot>\n    </template>\n    <!-- Default card: dashboard-style section card with an accent header + optional icon -->\n    <div v-else class=\"section-card\">\n      <div class=\"section-header\">\n        <div class=\"section-title-group\">\n          <svg v-if=\"icon\" class=\"bi\" width=\"18\" height=\"18\"><use :xlink:href=\"'#' + icon\"/></svg>\n          <h5 class=\"section-title\">{{ title }}</h5>\n        </div>\n        <div class=\"section-actions\"><slot name=\"actions\"></slot></div>\n      </div>\n      <div class=\"section-body\"><slot></slot></div>\n    </div>\n  </div>\n</template>\n\n<script>\nimport {defineComponent} from 'vue';\nimport MyBase from \"@/components/trends/MyBase.vue\";\n\nexport default defineComponent({\n  extends: MyBase,\n  name: 'MyTrendCard',\n  components: {},\n  props: {\n    title: String,\n    // Optional bootstrap-icon id (without '#') shown before the title.\n    icon: {type: String, default: \"\"},\n    cardStyle: {type: String, default: \"card\"}\n  },\n});\n</script>\n\n<style scoped>\n.section-card {\n  background: #ffffff;\n  border: 1px solid #e2e8f0;\n  border-radius: 0.875rem;\n  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);\n  overflow: hidden;\n}\n\n.section-header {\n  display: flex;\n  justify-content: space-between;\n  align-items: center;\n  gap: 1rem;\n  padding: 0.85rem 1.1rem;\n  background: #f8fafc;\n  border-bottom: 1px solid #f1f5f9;\n  border-left: 3px solid #2563eb;\n}\n\n.section-title-group {\n  display: flex;\n  align-items: center;\n  gap: 0.5rem;\n  color: #64748b;\n  min-width: 0;\n}\n\n.section-title-group .bi { color: #2563eb; flex-shrink: 0; }\n\n.section-title {\n  margin: 0;\n  font-size: 1rem;\n  font-weight: 600;\n  color: #1e293b;\n  line-height: 1.4;\n}\n\n.section-actions { flex-shrink: 0; }\n\n.section-body {\n  padding: 1rem;\n}\n\n.borderless-title {\n  font-size: 1.5rem;\n  font-weight: 700;\n  color: #1e293b;\n  margin: 0 0 0.75rem;\n}\n</style>\n","import { render } from \"./MyTrendCard.vue?vue&type=template&id=4f07e000&scoped=true\"\nimport script from \"./MyTrendCard.vue?vue&type=script&lang=js\"\nexport * from \"./MyTrendCard.vue?vue&type=script&lang=js\"\n\nimport \"./MyTrendCard.vue?vue&type=style&index=0&id=4f07e000&scoped=true&lang=css\"\n\nimport exportComponent from \"/home/s/PycharmProjects/batdemo/myvue/node_modules/vue-loader/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['render',render],['__scopeId',\"data-v-4f07e000\"]])\n\nexport default __exports__","<template>\n  <div v-if=\"tabs.length >= 2 || isAdmin\" ref=\"root\" class=\"obs-select\">\n    <button ref=\"trigger\" type=\"button\" class=\"obs-trigger\" :class=\"{'is-open': open}\"\n            aria-haspopup=\"listbox\" :aria-expanded=\"open\" @click=\"toggle\">\n      <span class=\"obs-trigger-label\">{{ currentLabel }}</span>\n      <span v-if=\"currentIsAdminOnly\" class=\"badge-circle badge-admin\" :title=\"$t('trends.obsTabs.adminOnly')\"\n            :aria-label=\"$t('trends.obsTabs.adminOnly')\"></span>\n      <svg class=\"obs-chevron\" width=\"12\" height=\"12\" viewBox=\"0 0 12 12\" aria-hidden=\"true\">\n        <path d=\"M2.5 4.5L6 8l3.5-3.5\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.6\"\n              stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\n      </svg>\n    </button>\n\n    <Teleport to=\"body\">\n      <ul v-if=\"open\" ref=\"menu\" class=\"obs-menu\" role=\"listbox\" :style=\"menuStyle\"\n          @keydown=\"onMenuKeydown\">\n        <li v-for=\"t in tabs\" :key=\"t.id\" role=\"none\">\n          <button type=\"button\" class=\"obs-option\" role=\"option\"\n                  :class=\"{'is-active': isActive(t), 'is-disabled': !isSelectable(t)}\"\n                  :aria-selected=\"isActive(t)\"\n                  :disabled=\"!isSelectable(t)\"\n                  :title=\"isAvailable(t) || isActive(t) ? t.name : $t('trends.obsTabs.noData')\"\n                  @click=\"select(t)\">\n            <svg class=\"obs-check\" width=\"14\" height=\"14\" viewBox=\"0 0 14 14\" aria-hidden=\"true\">\n              <path v-if=\"isActive(t)\" d=\"M2.5 7.5L5.5 10.5L11.5 3.5\" fill=\"none\" stroke=\"currentColor\"\n                    stroke-width=\"1.8\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\n            </svg>\n            <span class=\"obs-option-label\">{{ label(t) }}</span>\n            <span v-if=\"isAdminOnly(t)\" class=\"badge-circle badge-admin\" :title=\"$t('trends.obsTabs.adminOnly')\"\n                  :aria-label=\"$t('trends.obsTabs.adminOnly')\"></span>\n            <span v-if=\"!isAvailable(t) && !isActive(t)\" class=\"obs-nodata\">{{ $t('trends.obsTabs.noData') }}</span>\n          </button>\n        </li>\n        <template v-if=\"isAdmin\">\n          <li role=\"none\"><div class=\"obs-section\">{{ $t('trends.obsTabs.layoutSectionLabel') }}</div></li>\n          <li v-for=\"opt in layoutOptions\" :key=\"opt.layout\" role=\"none\">\n            <button type=\"button\" class=\"obs-option\" role=\"option\"\n                    :class=\"{'is-active': settings?.obsLayout === opt.layout}\"\n                    :aria-selected=\"settings?.obsLayout === opt.layout\"\n                    @click=\"selectLayout(opt.layout)\">\n              <svg class=\"obs-check\" width=\"14\" height=\"14\" viewBox=\"0 0 14 14\" aria-hidden=\"true\">\n                <path v-if=\"settings?.obsLayout === opt.layout\" d=\"M2.5 7.5L5.5 10.5L11.5 3.5\" fill=\"none\"\n                      stroke=\"currentColor\" stroke-width=\"1.8\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\n              </svg>\n              <span class=\"obs-option-label\">{{ opt.label }}</span>\n              <span class=\"badge-circle badge-admin\" :title=\"$t('trends.obsTabs.adminOnly')\"\n                    :aria-label=\"$t('trends.obsTabs.adminOnly')\"></span>\n            </button>\n          </li>\n        </template>\n      </ul>\n    </Teleport>\n  </div>\n</template>\n\n<script>\nimport {defineComponent} from 'vue';\nimport MyBase from \"@/components/trends/MyBase.vue\";\n\nexport default defineComponent({\n  extends: MyBase,\n  name: 'ObsTypeSelect',\n  emits: ['select'],\n  data() {\n    return {\n      open: false,\n      menuStyle: {},\n    };\n  },\n  computed: {\n    settings() {\n      return this.store?.plotSettings;\n    },\n    tabs() {\n      if (!this.settings?.observationTypes) return [];\n      // server order (W, S, SBB, SEC); anonymous users only ever receive public types\n      return Object.values(this.settings.observationTypes);\n    },\n    currentLabel() {\n      const layout = this.settings?.obsLayout;\n      if (layout && layout !== 'single') {\n        const opt = this.layoutOptions.find((o) => o.layout === layout);\n        if (opt) return opt.label;\n      }\n      const cur = this.settings?.observationType;\n      return cur ? this.label(cur) : '';\n    },\n    currentIsAdminOnly() {\n      return this.isAdminOnly(this.settings?.observationType);\n    },\n    isAdmin() {\n      return this.store?.user?.isAdmin || false;\n    },\n    layoutOptions() {\n      return [\n        {layout: 'combined', label: this.$t('trends.obsTabs.layoutCombined')},\n        {layout: 'grid', label: this.$t('trends.obsTabs.layoutGrid')},\n      ];\n    },\n  },\n  beforeUnmount() {\n    this.teardown();\n  },\n  methods: {\n    label(t) {\n      if (!t) return '';\n      const key = 'trends.obsTabs.labels.' + t.id;\n      const short = this.$t(key);\n      return short === key ? t.id : short;\n    },\n    isActive(t) {\n      return this.settings?.observationType?.id === t.id;\n    },\n    isAvailable(t) {\n      return (this.settings?.availableObservationTypes || []).some((a) => a.id === t.id);\n    },\n    isAdminOnly(t) {\n      return !!t && t.public === false;\n    },\n    isSelectable(t) {\n      // The active type stays inert (already shown); unavailable types have no data.\n      return this.isAvailable(t) && !this.isActive(t);\n    },\n    select(t) {\n      if (!this.isSelectable(t)) return;\n      this.$emit('select', {kind: 'obsType', obsType: t});\n      this.close();\n    },\n    selectLayout(layout) {\n      this.$emit('select', {kind: 'layout', layout: layout});\n      this.close();\n    },\n    toggle() {\n      this.open ? this.close() : this.openMenu();\n    },\n    openMenu() {\n      this.positionMenu();\n      this.open = true;\n      document.addEventListener('pointerdown', this.onDocPointerDown, true);\n      window.addEventListener('resize', this.close, true);\n      window.addEventListener('scroll', this.close, true);\n      this.$nextTick(() => this.focusActiveOption());\n    },\n    close() {\n      if (!this.open) return;\n      this.open = false;\n      this.teardown();\n      const trigger = this.$refs.trigger;\n      if (trigger) trigger.focus();\n    },\n    teardown() {\n      document.removeEventListener('pointerdown', this.onDocPointerDown, true);\n      window.removeEventListener('resize', this.close, true);\n      window.removeEventListener('scroll', this.close, true);\n    },\n    positionMenu() {\n      const trigger = this.$refs.trigger;\n      if (!trigger) return;\n      const r = trigger.getBoundingClientRect();\n      // Fixed + right-anchored so the menu escapes the card's overflow:hidden and\n      // lines up with the trigger's right edge without needing the menu width.\n      this.menuStyle = {\n        top: (r.bottom + 6) + 'px',\n        right: (window.innerWidth - r.right) + 'px',\n        minWidth: r.width + 'px',\n      };\n    },\n    onDocPointerDown(e) {\n      const root = this.$refs.root;\n      const menu = this.$refs.menu;\n      if (root && root.contains(e.target)) return;\n      if (menu && menu.contains(e.target)) return;\n      this.close();\n    },\n    optionButtons() {\n      const menu = this.$refs.menu;\n      if (!menu) return [];\n      return Array.from(menu.querySelectorAll('.obs-option:not([disabled])'));\n    },\n    focusActiveOption() {\n      // The active type is inert (disabled), so land focus on the first selectable\n      // option; the menu itself is focusable via the buttons for arrow navigation.\n      const buttons = this.optionButtons();\n      if (buttons.length) buttons[0].focus();\n    },\n    onMenuKeydown(e) {\n      if (e.key === 'Escape') {\n        e.preventDefault();\n        this.close();\n        return;\n      }\n      if (e.key !== 'ArrowDown' && e.key !== 'ArrowUp') return;\n      e.preventDefault();\n      const buttons = this.optionButtons();\n      if (!buttons.length) return;\n      const idx = buttons.indexOf(document.activeElement);\n      const step = e.key === 'ArrowDown' ? 1 : -1;\n      const next = (idx + step + buttons.length) % buttons.length;\n      buttons[next].focus();\n    },\n  },\n});\n</script>\n\n<style scoped>\n.obs-select {\n  position: relative;\n  display: inline-flex;\n}\n\n.obs-trigger {\n  display: inline-flex;\n  align-items: center;\n  gap: 0.4rem;\n  border: 1px solid #e2e8f0;\n  background: #ffffff;\n  border-radius: 0.5rem;\n  padding: 0.28rem 0.55rem;\n  font-size: 0.8rem;\n  font-weight: 600;\n  color: #1e293b;\n  line-height: 1.3;\n  cursor: pointer;\n  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;\n}\n\n.obs-trigger:hover {\n  border-color: #cbd5e1;\n  background: #f8fafc;\n}\n\n.obs-trigger.is-open,\n.obs-trigger:focus-visible {\n  outline: none;\n  border-color: #2563eb;\n  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);\n}\n\n.obs-trigger-label {\n  white-space: nowrap;\n}\n\n.obs-chevron {\n  color: #64748b;\n  flex-shrink: 0;\n  transition: transform 0.18s ease;\n}\n\n.obs-trigger.is-open .obs-chevron {\n  transform: rotate(180deg);\n  color: #2563eb;\n}\n\n/* admin dot uses the shared badge-circle/badge-admin classes (assets/css/access-badges.css) */\n</style>\n\n<style>\n/* Menu is teleported to <body>, so its rules are global (not scoped). Namespaced\n   under .obs-menu to stay isolated. */\n.obs-menu {\n  position: fixed;\n  z-index: 1080;\n  margin: 0;\n  padding: 0.3rem;\n  list-style: none;\n  background: #ffffff;\n  border: 1px solid #e2e8f0;\n  border-radius: 0.6rem;\n  box-shadow: 0 10px 24px -8px rgba(15, 23, 42, 0.25), 0 2px 6px rgba(15, 23, 42, 0.06);\n  max-height: min(60vh, 320px);\n  overflow-y: auto;\n  animation: obs-menu-in 0.14s ease;\n  transform-origin: top right;\n}\n\n@keyframes obs-menu-in {\n  from { opacity: 0; transform: translateY(-4px) scale(0.98); }\n  to   { opacity: 1; transform: translateY(0) scale(1); }\n}\n\n.obs-menu .obs-option {\n  display: flex;\n  align-items: center;\n  gap: 0.45rem;\n  width: 100%;\n  border: 0;\n  background: transparent;\n  border-radius: 0.4rem;\n  padding: 0.4rem 0.55rem;\n  font-size: 0.8rem;\n  font-weight: 500;\n  color: #334155;\n  line-height: 1.35;\n  text-align: left;\n  cursor: pointer;\n  transition: background 0.12s ease, color 0.12s ease;\n}\n\n.obs-menu .obs-option:hover:not(.is-disabled),\n.obs-menu .obs-option:focus-visible:not(.is-disabled) {\n  outline: none;\n  background: #f1f5f9;\n  color: #1e293b;\n}\n\n.obs-menu .obs-option.is-active {\n  color: #2563eb;\n  font-weight: 600;\n  background: rgba(37, 99, 235, 0.08);\n}\n\n.obs-menu .obs-option.is-disabled:not(.is-active) {\n  color: #94a3b8;\n  cursor: not-allowed;\n}\n\n.obs-menu .obs-check {\n  color: #2563eb;\n  flex-shrink: 0;\n}\n\n.obs-menu .obs-option-label {\n  flex: 1 1 auto;\n  white-space: nowrap;\n}\n\n.obs-menu .obs-nodata {\n  font-size: 0.68rem;\n  font-weight: 500;\n  color: #94a3b8;\n  white-space: nowrap;\n}\n\n.obs-menu .obs-section {\n  padding: 0.45rem 0.55rem 0.25rem;\n  font-size: 0.68rem;\n  font-weight: 600;\n  color: #94a3b8;\n  text-transform: uppercase;\n  letter-spacing: 0.04em;\n  border-top: 1px solid #e2e8f0;\n  margin-top: 0.25rem;\n}\n\n@media (prefers-reduced-motion: reduce) {\n  .obs-menu { animation: none; }\n  .obs-chevron { transition: none; }\n}\n</style>\n","import { render } from \"./ObsTypeSelect.vue?vue&type=template&id=8916edca&scoped=true\"\nimport script from \"./ObsTypeSelect.vue?vue&type=script&lang=js\"\nexport * from \"./ObsTypeSelect.vue?vue&type=script&lang=js\"\n\nimport \"./ObsTypeSelect.vue?vue&type=style&index=0&id=8916edca&scoped=true&lang=css\"\nimport \"./ObsTypeSelect.vue?vue&type=style&index=1&id=8916edca&lang=css\"\n\nimport exportComponent from \"/home/s/PycharmProjects/batdemo/myvue/node_modules/vue-loader/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['render',render],['__scopeId',\"data-v-8916edca\"]])\n\nexport default __exports__","import { render } from \"./PlotCard.vue?vue&type=template&id=a1eea2d4&scoped=true\"\nimport script from \"./PlotCard.vue?vue&type=script&lang=js\"\nexport * from \"./PlotCard.vue?vue&type=script&lang=js\"\n\nimport \"./PlotCard.vue?vue&type=style&index=0&id=a1eea2d4&scoped=true&lang=css\"\n\nimport exportComponent from \"/home/s/PycharmProjects/batdemo/myvue/node_modules/vue-loader/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['render',render],['__scopeId',\"data-v-a1eea2d4\"]])\n\nexport default __exports__","<template>\n  <MyTrendCard :title=\"$t('trends.map')\" icon=\"map1\">\n    <div id=\"box2\" v-if=\"!store.plotSettings?.species\">\n      <div class=\"map-empty-state\">\n        <div class=\"empty-inner\">\n          <svg width=\"128\" height=\"128\" class=\"empty-icon\"><use xlink:href=\"#map1\"/></svg>\n          <p class=\"empty-text\">{{ $t('trends.intro.map1' )}}</p>\n        </div>\n      </div>\n    </div>\n    <div v-show=\"store.plotSettings?.species\" :id=\"idMap\" class=\"map-container\"></div>\n  </MyTrendCard>\n</template>\n\n<script>\nimport {defineComponent} from 'vue';\nimport MyBase from \"@/components/trends/MyBase.vue\";\nimport MyTrendCard from \"@/components/trends/cards/MyTrendCard.vue\";\n\nexport default defineComponent({\n  extends: MyBase,\n  name: 'TcMap',\n  components: {MyTrendCard},\n  props: {\n    idMap: String\n  },\n  data: function (){\n    return {\n    }\n  },\n  mounted: function() {\n    return;\n  },\n  methods: {\n    hello: function () {\n      return;\n    },\n  },\n});\n</script>\n\n<style scoped>\n.map-container {\n  height: 45vh;\n}\n\n.map-empty-state {\n  width: 100%;\n  height: 100%;\n  display: flex;\n  align-items: center;\n  justify-content: center;\n}\n\n.empty-inner {\n  text-align: center;\n}\n\n.empty-icon {\n  color: #94a3b8;\n}\n\n.empty-text {\n  font-size: 1.0625rem;\n  color: #64748b;\n  margin-top: 1.5rem;\n  line-height: 1.6;\n}\n</style>\n<style>\n.map-info {\n  padding: 5px;\n  background-color: white;\n}\n\n/* While fullscreen, fill the screen regardless of the inline height set by resizedFn. */\n.map-container:fullscreen {\n  width: 100% !important;\n  height: 100% !important;\n}\n\n/* Information-carrying legend */\n.map-legend {\n  padding: 8px 10px;\n  background: rgba(255, 255, 255, 0.94);\n  border: 1px solid #e2e8f0;\n  border-radius: 8px;\n  box-shadow: 0 4px 12px -4px rgba(15, 23, 42, 0.2);\n  font-size: 12px;\n  line-height: 1.4;\n  color: #1e293b;\n  max-width: 220px;\n}\n\n.map-legend .lg-title {\n  font-weight: 600;\n  margin-bottom: 4px;\n}\n\n.map-legend .lg-scale {\n  display: flex;\n  gap: 2px;\n  align-items: flex-end;\n}\n\n.map-legend .lg-bin {\n  display: flex;\n  flex-direction: column;\n  align-items: center;\n  gap: 2px;\n  font-size: 10px;\n  color: #64748b;\n}\n\n.map-legend .lg-bin i {\n  width: 22px;\n  height: 12px;\n  border: 1px solid rgba(15, 23, 42, 0.2);\n}\n\n.map-legend .lg-sub {\n  font-size: 10px;\n  color: #94a3b8;\n  margin-top: 2px;\n}\n\n.map-legend .lg-row {\n  display: flex;\n  align-items: center;\n  gap: 6px;\n  margin-top: 4px;\n}\n\n.map-legend .lg-sw {\n  width: 14px;\n  height: 14px;\n  border-radius: 3px;\n  border: 1px solid rgba(15, 23, 42, 0.2);\n  flex-shrink: 0;\n}\n\n.map-legend .lg-count {\n  margin-top: 6px;\n  padding-top: 5px;\n  border-top: 1px solid #eef2f6;\n  font-size: 11px;\n  color: #64748b;\n}\n\n/* Custom tool buttons (recenter / fullscreen / export) */\n.leaflet-control.map-tool a {\n  display: flex;\n  align-items: center;\n  justify-content: center;\n  width: 30px;\n  height: 30px;\n  color: #334155;\n}\n\n.leaflet-control.map-tool a:hover {\n  color: #0f172a;\n  background: #f1f5f9;\n}\n\n/* Hover tooltip on grid cells */\n.map-cell-tooltip {\n  font-size: 12px;\n}\n\n.map-cell-tooltip .tt-muted {\n  color: #000;\n  font-size: 11px;\n}\n</style>\n","import { render } from \"./TcMap.vue?vue&type=template&id=11e5e3f5&scoped=true\"\nimport script from \"./TcMap.vue?vue&type=script&lang=js\"\nexport * from \"./TcMap.vue?vue&type=script&lang=js\"\n\nimport \"./TcMap.vue?vue&type=style&index=0&id=11e5e3f5&scoped=true&lang=css\"\nimport \"./TcMap.vue?vue&type=style&index=1&id=11e5e3f5&lang=css\"\n\nimport exportComponent from \"/home/s/PycharmProjects/batdemo/myvue/node_modules/vue-loader/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['render',render],['__scopeId',\"data-v-11e5e3f5\"]])\n\nexport default __exports__","<template>\n  <div>\n    <div class=\"settings-row\">\n      <div class=\"settings-bar\">\n        <ul class=\"nav\">\n          <li class=\"nav-item dropdown settings-tab settings-tab-primary\">\n            <a class=\"nav-link dropdown-toggle\" data-bs-toggle=\"dropdown\" href=\"#\" role=\"button\" id=\"nlSpecies\">\n              <i v-if=\"settings.species\">{{ settings.species.latin }}</i>\n              <strong v-else class=\"prompt-label\">\n                <svg width=\"20\" height=\"20\" class=\"prompt-icon\"><use xlink:href=\"#bi-1-circle\"/></svg>\n                {{ $t('plotOptions.selectSpecies') }}\n              </strong>\n            </a>\n            <ul class=\"settings-dropdown dropdown-menu cols-scrollable\">\n              <li v-for=\"(spec, key) in settings.availableCountTypes\" :key=\"key\" class=\"dropdown-item settings-dropdown-item\"\n                  @click=\"selectSpecies(spec)\"\n                  :class=\"{'active': settings.species && settings.species.id === spec.id}\">\n                <i>{{spec.latin}}</i> <span class=\"species-common\">({{capitalizeAll(spec.name)}})</span>\n              </li>\n            </ul>\n          </li>\n          <!--          <li class=\"nav-item dropdown\">-->\n          <!--            <a class=\"nav-link dropdown-toggle\" data-bs-toggle=\"dropdown\" href=\"#\" role=\"button\">{{ (settings.observationType) ? settings.observationType.name : $t('plotOptions.selectObsType') }}</a>-->\n          <!--            <ul class=\"my-dropdown dropdown-menu cols-scrollable\">-->\n          <!--              <li v-for=\"(t, key) in settings.availableObservationTypes\" :key=\"key\" class=\"dropdown-item my-dropdown-item\"-->\n          <!--                  @click=\"selectObservationType(t)\"-->\n          <!--                  :class=\"{'active': settings.observationType && settings.observationType.id === t.id}\">-->\n          <!--                {{ t.name }}-->\n          <!--              </li>-->\n          <!--            </ul>-->\n          <!--          </li>-->\n          <li class=\"nav-item dropdown\">\n            <a class=\"nav-link dropdown-toggle\" :class=\"{'disabled': !settings.species}\" data-bs-toggle=\"dropdown\" href=\"#\" role=\"button\" id=\"nlRegion\">\n              <svg v-if=\"!settings.species\" width=\"20\" height=\"20\" class=\"prompt-icon\"><use xlink:href=\"#bi-2-circle\"/></svg>\n              {{ (settings.selectedRegion) ?\n                    settings.selectedRegion.type === \"b\" ? capitalizeAll(settings.selectedRegion.name)\n                                                     : settings.selectedRegion.name\n                : $t('plotOptions.selectRegion') }}\n            </a>\n            <ul class=\"settings-dropdown dropdown-menu cols-scrollable\">\n              <li class=\"dropdown-item settings-dropdown-item\" @click=\"selectGeo1(settings.allRegions)\" :class=\"{'active': settings.selectedRegion && settings.selectedRegion.id === settings.allRegions.id}\">{{ settings.allRegions.name }}</li>\n              <hr v-if=\"settings.availableBiogeo?.length > 0\">\n              <li v-for=\"(geo, key) in settings.availableBiogeo\" :key=\"'bg' + key\" class=\"dropdown-item settings-dropdown-item\"\n                  @click=\"selectBioGeo(geo)\"\n                  :class=\"{'active': geo.id === settings.selectedRegion.id}\">\n                {{ capitalizeAll(geo.name) }}\n              </li>\n              <hr v-if=\"settings.availableGeo1?.length > 0\">\n              <li v-for=\"(geo, key) in settings.availableGeo1\" :key=\"key\" class=\"dropdown-item settings-dropdown-item\"\n                  @click=\"selectGeo1(geo)\"\n                  :class=\"{'active': geo.id === settings.selectedRegion.id}\">\n                {{ geo.name }}\n              </li>\n              <hr v-if=\"settings.avalaibleGeoAdm?.length > 1\">\n              <li v-for=\"(geo, key) in settings.avalaibleGeoAdm\" :key=\"'ga' + key\" class=\"dropdown-item settings-dropdown-item\"\n                  @click=\"selectGeoAdm(geo)\"\n                  :class=\"{'active': geo.id === settings.selectedRegion.id}\">\n                {{ geo.name }}\n              </li>\n            </ul>\n          </li>\n\n          <div class=\"nav-item timespan-label\">\n            <div id=\"nlTimespan1\">\n              <svg v-if=\"!settings.species\" width=\"20\" height=\"20\" class=\"prompt-icon\"><use xlink:href=\"#bi-3-circle\"/></svg>\n              <span>{{ $t('plotOptions.timespan') }}</span>\n            </div>\n          </div>\n          <li class=\"nav-item dropdown\">\n            <a class=\"nav-link dropdown-toggle\" :class=\"{'disabled': !settings.species}\" data-bs-toggle=\"dropdown\" href=\"#\" role=\"button\" id=\"nlTimespan2\">{{ settings.yearStart <= settings.yearMin ? 'Min.' : settings.yearStart }}</a>\n            <ul class=\"settings-dropdown dropdown-menu cols-scrollable\">\n              <li v-for=\"(y, index) in settings.yearsMin()\" :key=\"index\" class=\"dropdown-item settings-dropdown-item\"\n                  @click=\"selectYearStart(y)\"\n                  :class=\"{'active': settings.yearStart && settings.yearStart === y}\">\n                {{ index === 0 ? 'Min.' : y }}\n              </li>\n            </ul>\n          </li>\n          <div class=\"nav-item timespan-separator\">\n            <span id=\"nlTimespan3\">{{ $t('plotOptions.timespanTo') }}</span>\n          </div>\n          <li class=\"nav-item dropdown\">\n            <a class=\"nav-link dropdown-toggle\" :class=\"{'disabled': !settings.species}\" data-bs-toggle=\"dropdown\" href=\"#\" role=\"button\" id=\"nlTimespan4\">{{ settings.yearEnd >= settings.effectiveYearMax ? 'Max.' : settings.yearEnd }}</a>\n            <ul class=\"settings-dropdown dropdown-menu cols-scrollable\">\n              <li v-for=\"(y, index) in settings.yearsMax()\" :key=\"index\" class=\"dropdown-item settings-dropdown-item\"\n                  @click=\"selectYearEnd(y)\"\n                  :class=\"{'active': settings.yearEnd && settings.yearEnd === y}\">\n                {{ y >= settings.effectiveYearMax ? 'Max.' : y }}\n              </li>\n            </ul>\n          </li>\n          <a v-if=\"settings.canUseMoreOptions()\" class=\"nav-link more-options-link\" data-bs-toggle=\"collapse\" href=\"#collapseMoreOptions\" role=\"button\">{{$t('plotOptions.moreOptions')}} <span class=\"badge-circle badge-admin\"></span></a>\n        </ul>\n      </div>\n    </div>\n\n    <div v-if=\"settings.canUseMoreOptions()\" class=\"collapse options-panel\" id=\"collapseMoreOptions\">\n      <div class=\"options-panel-head\">\n        <div>\n          <div class=\"options-eyebrow\">{{ $t(\"plotOptions.moreOptions\") }} <span class=\"badge-circle badge-admin\"></span></div>\n          <div class=\"options-panel-title\">{{ $t(\"plotOptions.more.adminTitle\") }}</div>\n        </div>\n        <button type=\"button\" class=\"options-close\" data-bs-toggle=\"collapse\" data-bs-target=\"#collapseMoreOptions\"\n                :aria-label=\"$t('plotOptions.more.close')\">\n          <span aria-hidden=\"true\">&times;</span>\n        </button>\n      </div>\n\n      <div class=\"options-grid\">\n        <!-- OBSERVATIONS -->\n        <section class=\"options-card\">\n          <div class=\"options-eyebrow\">{{ $t(\"plotOptions.more.data\") }}</div>\n\n          <div class=\"opt-field\">\n            <label class=\"opt-label\" for=\"selObsType\">{{ $t(\"plotOptions.more.obsType\") }}</label>\n            <select class=\"form-select form-select-sm opt-select\" id=\"selObsType\"\n                    v-model=\"settings.observationType\" @change=\"selectObservationType(settings.observationType)\">\n              <option v-for=\"(obsType, key) in settings.observationTypes\" :key=\"key\" :value=\"obsType\">\n                {{ obsType.id }} — {{ obsType.name }}\n              </option>\n            </select>\n          </div>\n\n          <div class=\"opt-field\">\n            <label class=\"opt-label\">{{ $t(\"plotOptions.more.obsLayout\") }}</label>\n            <div class=\"opt-segment opt-segment-3\" role=\"group\">\n              <button type=\"button\" class=\"opt-segment-btn\" :class=\"{'is-active': settings.obsLayout === 'single'}\"\n                      @click=\"selectObsLayout('single')\">{{ $t(\"plotOptions.more.obsLayoutSingle\") }}</button>\n              <button type=\"button\" class=\"opt-segment-btn\" :class=\"{'is-active': settings.obsLayout === 'combined'}\"\n                      @click=\"selectObsLayout('combined')\">{{ $t(\"plotOptions.more.obsLayoutCombined\") }}</button>\n              <button type=\"button\" class=\"opt-segment-btn\" :class=\"{'is-active': settings.obsLayout === 'grid'}\"\n                      @click=\"selectObsLayout('grid')\">{{ $t(\"plotOptions.more.obsLayoutGrid\") }}</button>\n            </div>\n            <span class=\"opt-toggle-hint\">{{ $t(\"plotOptions.more.obsLayoutHint\") }}</span>\n          </div>\n        </section>\n\n        <!-- MAP -->\n        <section class=\"options-card\">\n          <div class=\"options-eyebrow\">{{ $t(\"plotOptions.more.map\") }}</div>\n\n          <label class=\"opt-toggle\">\n            <span class=\"opt-toggle-text\">\n              <span class=\"opt-toggle-title\">{{ $t(\"plotOptions.more.gridSquares\") }}</span>\n            </span>\n            <span class=\"form-check form-switch opt-switch\">\n              <input class=\"form-check-input\" type=\"checkbox\" role=\"switch\" id=\"cbSquares\"\n                     v-model=\"settings.showSquares\" @change=\"emitMapChange()\">\n            </span>\n          </label>\n\n          <div v-if=\"settings.tk25Available\" class=\"opt-field opt-field-inset\"\n               :class=\"{'opt-field-muted': !settings.showSquares}\">\n            <label class=\"opt-label\">{{ $t(\"plotOptions.more.aggregation\") }}</label>\n            <div class=\"opt-segment\" role=\"group\">\n              <button type=\"button\" class=\"opt-segment-btn\" :class=\"{'is-active': settings.mapAggregation === 'grid'}\"\n                      @click=\"selectMapAggregation('grid')\">{{ $t(\"plotOptions.more.aggregationGrid\") }}</button>\n              <button type=\"button\" class=\"opt-segment-btn\" :class=\"{'is-active': settings.mapAggregation === 'tk25'}\"\n                      @click=\"selectMapAggregation('tk25')\">{{ $t(\"plotOptions.more.aggregationTk25\") }}</button>\n            </div>\n          </div>\n\n          <div v-if=\"settings.mapAggregation === 'grid' && settings.availableGridSizes.length > 1\"\n               class=\"opt-field opt-field-inset\"\n               :class=\"{'opt-field-muted': !settings.showSquares}\">\n            <label class=\"opt-label\" for=\"selGridSize\">{{ $t(\"plotOptions.more.gridSize\") }}</label>\n            <select class=\"form-select form-select-sm opt-select\" id=\"selGridSize\"\n                    v-model.number=\"settings.squareSize\" @change=\"emitChange()\">\n              <option v-for=\"size in settings.availableGridSizes\" :key=\"size\" :value=\"size\">{{ size }} × {{ size }} km</option>\n            </select>\n          </div>\n\n          <label class=\"opt-toggle\">\n            <span class=\"opt-toggle-text\">\n              <span class=\"opt-toggle-title\">{{ $t(\"plotOptions.more.distributionLayer\") }}</span>\n            </span>\n            <span class=\"form-check form-switch opt-switch\">\n              <input class=\"form-check-input\" type=\"checkbox\" role=\"switch\" id=\"cbDistribution\"\n                     v-model=\"settings.showDistribution\" @change=\"emitMapChange()\">\n            </span>\n          </label>\n\n          <label class=\"opt-toggle\">\n            <span class=\"opt-toggle-text\">\n              <span class=\"opt-toggle-title\">{{ $t(\"plotOptions.more.locationMarkers\") }}</span>\n            </span>\n            <span class=\"form-check form-switch opt-switch\">\n              <input class=\"form-check-input\" type=\"checkbox\" role=\"switch\" id=\"cbMarkers\"\n                     v-model=\"settings.showLocations\" @change=\"emitMapChange()\">\n            </span>\n          </label>\n\n          <div class=\"opt-field\">\n            <label class=\"opt-label\" for=\"selBasemap\">{{ $t(\"plotOptions.more.mapStyle\") }}</label>\n            <select class=\"form-select form-select-sm opt-select\" id=\"selBasemap\"\n                    v-model=\"settings.mapLayer\" @change=\"selectMapLayer(settings.mapLayer)\">\n              <option v-for=\"bm in basemaps\" :key=\"bm.key\" :value=\"bm.key\">{{ bm.label }}</option>\n            </select>\n          </div>\n        </section>\n      </div>\n\n      <!-- APPEARANCE: two columns — cells on the left, distribution/region on the right -->\n      <section class=\"options-card options-card-wide\">\n        <div class=\"options-eyebrow\">{{ $t(\"plotOptions.more.appearance\") }}</div>\n\n        <div class=\"appearance-grid\">\n          <!-- Column 1: observation cells -->\n          <div class=\"appearance-col\">\n            <div class=\"style-row-head\">\n              <span class=\"style-row-title\">{{ $t(\"plotOptions.more.styleCells\") }}</span>\n              <label class=\"style-inline-toggle\">\n                <input class=\"form-check-input\" type=\"checkbox\" role=\"switch\"\n                       v-model=\"settings.mapStyleSite.graduated\" @change=\"emitMapChange()\">\n                <span>{{ $t(\"plotOptions.more.shadeByCount\") }}</span>\n              </label>\n            </div>\n\n            <div class=\"color-row\">\n              <label class=\"color-pick\">\n                <span class=\"color-pick-label\">{{ $t(\"plotOptions.more.fill\") }}</span>\n                <span class=\"color-chip\" :style=\"{background: settings.mapStyleSite.fill}\">\n                  <input type=\"color\" :value=\"settings.mapStyleSite.fill\" @input=\"setStyleColor('mapStyleSite', 'fill', $event.target.value)\">\n                </span>\n                <span class=\"color-hex\">{{ settings.mapStyleSite.fill }}</span>\n              </label>\n              <label class=\"color-pick\">\n                <span class=\"color-pick-label\">{{ $t(\"plotOptions.more.border\") }}</span>\n                <span class=\"color-chip\" :style=\"{background: settings.mapStyleSite.border}\">\n                  <input type=\"color\" :value=\"settings.mapStyleSite.border\" @input=\"setStyleColor('mapStyleSite', 'border', $event.target.value)\">\n                </span>\n                <span class=\"color-hex\">{{ settings.mapStyleSite.border }}</span>\n              </label>\n            </div>\n            <div class=\"color-row\">\n              <label class=\"color-pick\">\n                <span class=\"color-pick-label\">{{ $t(\"plotOptions.more.cellNoDetection\") }}</span>\n                <span class=\"color-chip\" :style=\"{background: settings.mapStyleSite.noDetectionFill}\">\n                  <input type=\"color\" :value=\"settings.mapStyleSite.noDetectionFill\" @input=\"setStyleColor('mapStyleSite', 'noDetectionFill', $event.target.value)\">\n                </span>\n                <span class=\"color-hex\">{{ settings.mapStyleSite.noDetectionFill }}</span>\n              </label>\n            </div>\n            <div v-if=\"settings.mapStyleSite.graduated\" class=\"color-row color-row--sub\">\n              <label class=\"color-pick\">\n                <span class=\"color-pick-label\">{{ $t(\"plotOptions.more.fadeTo\") }}</span>\n                <span class=\"color-chip\" :style=\"{background: settings.mapStyleSite.fillTo}\">\n                  <input type=\"color\" :value=\"settings.mapStyleSite.fillTo\" @input=\"setStyleColor('mapStyleSite', 'fillTo', $event.target.value)\">\n                </span>\n                <span class=\"color-hex\">{{ settings.mapStyleSite.fillTo }}</span>\n              </label>\n              <label class=\"color-pick\">\n                <span class=\"color-pick-label\">{{ $t(\"plotOptions.more.fadeTo\") }}</span>\n                <span class=\"color-chip\" :style=\"{background: settings.mapStyleSite.borderTo}\">\n                  <input type=\"color\" :value=\"settings.mapStyleSite.borderTo\" @input=\"setStyleColor('mapStyleSite', 'borderTo', $event.target.value)\">\n                </span>\n                <span class=\"color-hex\">{{ settings.mapStyleSite.borderTo }}</span>\n              </label>\n            </div>\n\n            <div v-if=\"settings.mapStyleSite.graduated\" class=\"gradient-tools\">\n              <div class=\"gradient-preview\" :style=\"{background: cellGradientCss}\"\n                   :title=\"$t('plotOptions.more.gradientPreview')\"></div>\n              <label class=\"style-inline-toggle\">\n                <input class=\"form-check-input\" type=\"checkbox\" role=\"switch\"\n                       v-model=\"settings.mapStyleSite.gradientInvert\" @change=\"emitMapChange()\">\n                <span>{{ $t(\"plotOptions.more.reverse\") }}</span>\n              </label>\n              <label class=\"gradient-blend\">\n                <span>{{ $t(\"plotOptions.more.blend\") }}</span>\n                <select class=\"form-select form-select-sm\" v-model=\"settings.mapStyleSite.gradientMode\" @change=\"emitMapChange()\">\n                  <option v-for=\"m in gradientModes\" :key=\"m\" :value=\"m\">{{ m.toUpperCase() }}</option>\n                </select>\n              </label>\n            </div>\n\n            <div class=\"style-controls\">\n              <label class=\"style-slider\">\n                <span>{{ $t(\"plotOptions.more.opacity\") }}</span>\n                <input type=\"range\" min=\"0.1\" max=\"0.7\" step=\"0.05\"\n                       v-model.number=\"settings.mapStyleSite.opacity\" @input=\"emitMapChange()\">\n              </label>\n              <div class=\"opt-segment opt-segment-3\" role=\"group\">\n                <button type=\"button\" class=\"opt-segment-btn\" :class=\"{'is-active': settings.mapStyleSite.weight === 0}\"\n                        @click=\"selectWeight('mapStyleSite', 0)\">{{ $t(\"plotOptions.more.outlineNone\") }}</button>\n                <button type=\"button\" class=\"opt-segment-btn\" :class=\"{'is-active': settings.mapStyleSite.weight === 1}\"\n                        @click=\"selectWeight('mapStyleSite', 1)\">{{ $t(\"plotOptions.more.outlineThin\") }}</button>\n                <button type=\"button\" class=\"opt-segment-btn\" :class=\"{'is-active': settings.mapStyleSite.weight === 2}\"\n                        @click=\"selectWeight('mapStyleSite', 2)\">{{ $t(\"plotOptions.more.outlineBold\") }}</button>\n              </div>\n            </div>\n          </div>\n\n          <!-- Column 2: distribution + region dimming -->\n          <div class=\"appearance-col\">\n            <div class=\"style-row-head\">\n              <span class=\"style-row-title\">{{ $t(\"plotOptions.more.styleDistribution\") }}</span>\n            </div>\n            <div class=\"color-row\">\n              <label class=\"color-pick\">\n                <span class=\"color-pick-label\">{{ $t(\"plotOptions.more.fill\") }}</span>\n                <span class=\"color-chip\" :style=\"{background: settings.mapStyleDistribution.fill}\">\n                  <input type=\"color\" :value=\"settings.mapStyleDistribution.fill\" @input=\"setStyleColor('mapStyleDistribution', 'fill', $event.target.value)\">\n                </span>\n                <span class=\"color-hex\">{{ settings.mapStyleDistribution.fill }}</span>\n              </label>\n            </div>\n            <div class=\"style-controls\">\n              <label class=\"style-slider\">\n                <span>{{ $t(\"plotOptions.more.opacity\") }}</span>\n                <input type=\"range\" min=\"0.1\" max=\"0.7\" step=\"0.05\"\n                       v-model.number=\"settings.mapStyleDistribution.opacity\" @input=\"emitMapChange()\">\n              </label>\n            </div>\n\n            <div class=\"style-row-head style-row-head--spaced\">\n              <span class=\"style-row-title\">{{ $t(\"plotOptions.more.styleRegionDim\") }}</span>\n            </div>\n            <div class=\"style-controls\">\n              <label class=\"style-slider style-slider-wide\">\n                <span>{{ $t(\"plotOptions.more.dimStrength\") }}</span>\n                <input type=\"range\" min=\"0.15\" max=\"0.75\" step=\"0.05\"\n                       v-model.number=\"settings.mapStyleRegionDim\" @input=\"emitMapChange()\">\n              </label>\n            </div>\n            <p class=\"style-hint\">{{ $t(\"plotOptions.more.dimHint\") }}</p>\n\n            <button type=\"button\" class=\"style-reset\" @click=\"resetStyling()\">\n              {{ $t(\"plotOptions.more.resetStyle\") }}\n            </button>\n          </div>\n        </div>\n      </section>\n\n      <div class=\"options-actions\">\n        <button type=\"button\" class=\"btn-primary-action\" data-bs-toggle=\"collapse\" data-bs-target=\"#collapseMoreOptions\">\n          {{ $t(\"plotOptions.more.close\") }}\n        </button>\n      </div>\n    </div>\n  </div>\n</template>\n\n<script>\nimport {defineComponent} from 'vue';\nimport PlotSettingsBase from \"@/components/trends/settings/PlotSettingsBase.vue\";\nimport {set} from \"vue-demi\";\n\nexport default defineComponent({\n  extends: PlotSettingsBase,\n  name: 'PlotSettings2',\n  components: {},\n  props: {\n  },\n  data: function (){\n    return {\n      // Basemap choices (keys must match MyMap.BASEMAPS in map.ts).\n      basemaps: [\n        {key: 'OSM', label: 'OpenStreetMap'},\n        {key: 'Carto', label: 'Carto Light'},\n        {key: 'ArcGIS', label: 'ArcGIS Light'},\n        {key: 'Topo', label: 'Terrain'},\n        {key: 'Satellite', label: 'Satellite'},\n      ],\n      // Gradient blend colour spaces, best perceptual pick first.\n      gradientModes: ['oklch', 'lab', 'lch', 'hsl', 'rgb'],\n    }\n  },\n  // mounted: function() {\n  //   // this.plotVisuals = new MyPlotVisuals();\n  //   return;\n  // },\n  methods: {\n    set,\n    /**\n     * to notify the parent container of changed settings.\n     * @param data a description of what has changed (optional)\n     */\n\n    selectSpecies: function(species){\n      this.settings.species  = species;\n      this.emitChange({species: species});\n    },\n    selectBioGeo: function(bg){\n      this.settings.selectedRegion = bg;\n      this.emitChange({region: bg});\n    },\n    selectGeo1: function(geo1){\n      this.settings.selectedRegion = geo1;\n      this.emitChange({region: geo1});\n    },\n    selectGeoAdm: function(geoAdm){\n      this.settings.selectedRegion = geoAdm;\n      this.emitChange({region: geoAdm});\n    },\n    selectObservationType: function(t){\n      this.settings.observationType  = t;\n      // Picking a concrete type leaves any multi-type layout — set both before the\n      // single emitChange below, so this costs one refetch and not two.\n      this.settings.obsLayout = 'single';\n      this.emitChange({obsType: t});\n    },\n    /** switch how observation types are presented; needs a refetch (server builds them) */\n    selectObsLayout: function(layout){\n      if (this.settings.obsLayout === layout) return;\n      this.settings.obsLayout = layout;\n      this.emitChange({obsLayout: layout});\n    },\n    selectMapLayer: function(layer){\n      this.settings.mapLayer = layer;\n      this.emitMapChange();\n    },\n    setStyleColor: function(styleKey, prop, hex){\n      this.settings[styleKey][prop] = hex;\n      this.emitMapChange();\n    },\n    selectWeight: function(styleKey, weight){\n      this.settings[styleKey].weight = weight;\n      this.emitMapChange();\n    },\n    resetStyling: function(){\n      this.settings.resetMapStyle();\n      this.emitMapChange();\n    },\n    selectMapAggregation: function(mode){\n      if (this.settings.mapAggregation === mode) return;\n      this.settings.mapAggregation = mode;\n      // squares are built server-side, so this needs a refetch (not a client re-render)\n      this.emitChange();\n    },\n    selectYearStart: function(y){\n      if (y >= this.settings.yearEnd){\n        this.settings.yearEnd = y + 10;\n      }\n      this.settings.yearStart = y;\n      this.emitChange({yearStart: this.settings.yearStart, yearEnd: this.settings.yearEnd});\n    },\n    selectYearEnd: function(y){\n      if (y <= this.settings.yearStart){\n        this.settings.yearStart = y - 10;\n      }\n      this.settings.yearEnd = y;\n      this.emitChange({yearStart: this.settings.yearStart, yearEnd: this.settings.yearEnd});\n    },\n    /** WTF? I cannot import the function from the utils.js file. If I do, the preview (npm run serve) does not work! */\n    capitalizeAll: function(s){\n      return s.split(' ').map(w => w[0].toUpperCase() + w.substr(1).toLowerCase()).join(' ');\n    },\n  },\n  computed: {\n    // Live fill-gradient preview. Uses native CSS colour-space interpolation, which\n    // mirrors the map's JS blend closely enough to preview blend mode + direction.\n    cellGradientCss: function(){\n      const s = this.settings.mapStyleSite;\n      const space = {rgb: 'srgb', hsl: 'hsl', lab: 'lab', lch: 'lch', oklch: 'oklch'}[s.gradientMode] || 'oklch';\n      const low = s.gradientInvert ? s.fill : s.fillTo;      // low-count end (left)\n      const high = s.gradientInvert ? s.fillTo : s.fill;     // high-count end (right)\n      return 'linear-gradient(90deg in ' + space + ', ' + low + ', ' + high + ')';\n    },\n  }\n});\n</script>\n\n<style scoped>\n.settings-row {\n  margin-top: 0.5rem;\n  z-index: 1;\n}\n\n.settings-bar {\n  z-index: 1;\n}\n\n.settings-tab-primary {\n  background: #f8fafc;\n  border: 1px solid #e2e8f0;\n  border-bottom: none;\n  border-radius: 0.375rem 0.375rem 0 0;\n}\n\n.settings-dropdown {\n  z-index: 1002;\n}\n\n.settings-dropdown-item {\n  cursor: pointer;\n}\n\n.species-common {\n  color: #64748b;\n}\n\n.prompt-label {\n  font-weight: 600;\n}\n\n.prompt-icon {\n  flex-shrink: 0;\n  margin-right: 0.5rem;\n}\n\n.timespan-label {\n  display: flex;\n  flex-direction: row;\n  align-items: center;\n  color: #64748b;\n  margin-left: 0.75rem;\n  margin-right: 0.25rem;\n}\n\n.timespan-separator {\n  display: flex;\n  flex-direction: row;\n  align-items: center;\n  color: #64748b;\n  margin: 0 0.25rem;\n}\n\n.more-options-link {\n  color: #2563eb;\n}\n\n/* In-flow (not an overlay): opening the panel pushes the plot & map down so their\n   live changes stay visible. Full container width, matching the content below. */\n.options-panel {\n  width: 100%;\n  background: #ffffff;\n  border: 1px solid #e2e8f0;\n  border-radius: 0.75rem;\n  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);\n  padding: 1.25rem 1.25rem 1rem;\n  margin: 0.5rem 0 1rem;\n}\n\n.options-panel-head {\n  display: flex;\n  align-items: flex-start;\n  justify-content: space-between;\n  gap: 1rem;\n  padding-bottom: 1rem;\n  margin-bottom: 1rem;\n  border-bottom: 1px solid #eef2f6;\n}\n\n.options-panel-title {\n  font-size: 1.0625rem;\n  font-weight: 600;\n  color: #0f172a;\n  line-height: 1.2;\n}\n\n.options-eyebrow {\n  font-size: 0.6875rem;\n  font-weight: 600;\n  letter-spacing: 0.08em;\n  text-transform: uppercase;\n  color: #94a3b8;\n  margin-bottom: 0.35rem;\n}\n\n.options-close {\n  display: inline-flex;\n  align-items: center;\n  justify-content: center;\n  width: 2rem;\n  height: 2rem;\n  flex-shrink: 0;\n  border: 1px solid #e2e8f0;\n  border-radius: 0.5rem;\n  background: #ffffff;\n  color: #64748b;\n  cursor: pointer;\n  font-size: 1.25rem;\n  line-height: 1;\n  transition: all 0.15s ease;\n}\n\n.options-close:hover {\n  background: #f8fafc;\n  color: #0f172a;\n  border-color: #cbd5e1;\n}\n\n.options-grid {\n  display: grid;\n  grid-template-columns: 1fr 1fr;\n  gap: 0.875rem;\n}\n\n@media (max-width: 575.98px) {\n  .options-grid {\n    grid-template-columns: 1fr;\n  }\n}\n\n.options-card {\n  background: #f8fafc;\n  border: 1px solid #eef2f6;\n  border-radius: 0.625rem;\n  padding: 0.875rem 0.9375rem 1rem;\n}\n\n.options-card .options-eyebrow {\n  margin-bottom: 0.75rem;\n}\n\n.opt-field {\n  margin-bottom: 0.875rem;\n}\n\n.opt-field:last-child {\n  margin-bottom: 0;\n}\n\n.opt-field-inset {\n  margin: -0.25rem 0 0.875rem 0;\n  padding-left: 0.125rem;\n}\n\n.opt-field-muted {\n  opacity: 0.45;\n  pointer-events: none;\n}\n\n.opt-label {\n  display: block;\n  font-size: 0.8125rem;\n  font-weight: 500;\n  color: #475569;\n  margin-bottom: 0.3125rem;\n}\n\n.opt-select {\n  border-color: #dbe2ea;\n  color: #1e293b;\n}\n\n.opt-select:focus {\n  border-color: #2563eb;\n  box-shadow: 0 0 0 0.2rem rgba(37, 99, 235, 0.15);\n}\n\n/* Toggle rows */\n.opt-toggle {\n  display: flex;\n  align-items: center;\n  justify-content: space-between;\n  gap: 0.75rem;\n  padding: 0.5rem 0;\n  margin: 0;\n  cursor: pointer;\n  border-top: 1px solid #eef2f6;\n}\n\n.opt-toggle:first-of-type {\n  border-top: none;\n}\n\n.opt-toggle-text {\n  display: flex;\n  flex-direction: column;\n  min-width: 0;\n}\n\n.opt-toggle-title {\n  font-size: 0.875rem;\n  font-weight: 500;\n  color: #1e293b;\n}\n\n.opt-toggle-hint {\n  font-size: 0.75rem;\n  color: #94a3b8;\n  margin-top: 0.0625rem;\n}\n\n.opt-toggle-disabled {\n  cursor: not-allowed;\n}\n\n.opt-toggle-disabled .opt-toggle-title {\n  color: #94a3b8;\n}\n\n.opt-switch {\n  margin: 0;\n  padding: 0;\n  min-height: 0;\n  flex-shrink: 0;\n}\n\n.opt-switch .form-check-input {\n  width: 2.25rem;\n  height: 1.25rem;\n  margin: 0;\n  cursor: pointer;\n  background-color: #cbd5e1;\n  border-color: #cbd5e1;\n}\n\n.opt-switch .form-check-input:checked {\n  background-color: #2563eb;\n  border-color: #2563eb;\n}\n\n.opt-switch .form-check-input:focus {\n  box-shadow: 0 0 0 0.2rem rgba(37, 99, 235, 0.15);\n  border-color: #2563eb;\n}\n\n.opt-switch .form-check-input:disabled {\n  opacity: 0.5;\n}\n\n/* Segmented control (map style) */\n.opt-segment {\n  display: grid;\n  grid-template-columns: 1fr 1fr;\n  gap: 0.25rem;\n  padding: 0.25rem;\n  background: #eef2f6;\n  border-radius: 0.5rem;\n}\n\n.opt-segment-btn {\n  border: none;\n  background: transparent;\n  color: #64748b;\n  font-size: 0.8125rem;\n  font-weight: 500;\n  padding: 0.375rem 0.5rem;\n  border-radius: 0.375rem;\n  cursor: pointer;\n  transition: all 0.15s ease;\n}\n\n.opt-segment-btn:hover {\n  color: #1e293b;\n}\n\n.opt-segment-btn.is-active {\n  background: #ffffff;\n  color: #2563eb;\n  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.12);\n}\n\n/* Appearance / layer styling */\n.options-card-wide {\n  margin-top: 0.875rem;\n}\n\n.style-row {\n  padding: 0.625rem 0;\n  border-top: 1px solid #eef2f6;\n}\n\n.style-row:first-of-type {\n  border-top: none;\n  padding-top: 0.25rem;\n}\n\n.style-row-head {\n  display: flex;\n  align-items: center;\n  justify-content: space-between;\n  gap: 0.75rem;\n  margin-bottom: 0.5rem;\n}\n\n.style-row-title {\n  font-size: 0.8125rem;\n  font-weight: 600;\n  color: #334155;\n}\n\n.style-inline-toggle {\n  display: inline-flex;\n  align-items: center;\n  gap: 0.4rem;\n  margin: 0;\n  font-size: 0.75rem;\n  color: #64748b;\n  cursor: pointer;\n}\n\n.style-inline-toggle .form-check-input {\n  width: 2rem;\n  height: 1.1rem;\n  margin: 0;\n  cursor: pointer;\n  background-color: #cbd5e1;\n  border-color: #cbd5e1;\n}\n\n.style-inline-toggle .form-check-input:checked {\n  background-color: #2563eb;\n  border-color: #2563eb;\n}\n\n/* Two-column appearance layout */\n.appearance-grid {\n  display: grid;\n  grid-template-columns: 1fr 1fr;\n  gap: 1.25rem 1.75rem;\n}\n\n@media (max-width: 767.98px) {\n  .appearance-grid {\n    grid-template-columns: 1fr;\n    gap: 1rem;\n  }\n}\n\n.appearance-col {\n  min-width: 0;\n}\n\n.appearance-col .style-row-head {\n  margin-bottom: 0.6rem;\n}\n\n.style-row-head--spaced {\n  margin-top: 1rem;\n  padding-top: 0.9rem;\n  border-top: 1px solid #eef2f6;\n}\n\n/* Gradient tools: live preview + direction + blend space */\n.gradient-tools {\n  display: flex;\n  flex-wrap: wrap;\n  align-items: center;\n  gap: 0.75rem;\n  margin: 0.35rem 0 0.75rem;\n}\n\n.gradient-preview {\n  flex: 1 1 6rem;\n  height: 1.1rem;\n  min-width: 5rem;\n  border-radius: 0.35rem;\n  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.18);\n}\n\n.gradient-blend {\n  display: inline-flex;\n  align-items: center;\n  gap: 0.4rem;\n  margin: 0;\n  font-size: 0.75rem;\n  color: #64748b;\n}\n\n.gradient-blend select {\n  width: auto;\n  min-width: 5.5rem;\n  border-color: #dbe2ea;\n  color: #1e293b;\n}\n\n.style-hint {\n  margin: 0.5rem 0 0;\n  font-size: 0.72rem;\n  color: #94a3b8;\n  line-height: 1.4;\n}\n\n.style-controls {\n  display: flex;\n  flex-wrap: wrap;\n  align-items: center;\n  gap: 0.75rem;\n}\n\n/* Fill / border colour rows: two aligned picks per row, one chip each */\n.color-row {\n  display: grid;\n  grid-template-columns: 1fr 1fr;\n  gap: 0.5rem 1rem;\n  margin-bottom: 0.5rem;\n}\n\n.color-row--sub {\n  margin-top: -0.15rem;\n}\n\n.color-row--sub .color-pick-label {\n  color: #94a3b8;\n}\n\n.color-pick {\n  display: flex;\n  align-items: center;\n  gap: 0.5rem;\n  margin: 0;\n  min-width: 0;\n  cursor: pointer;\n}\n\n.color-pick-label {\n  flex: 0 0 3.25rem;\n  font-size: 0.75rem;\n  font-weight: 500;\n  color: #64748b;\n}\n\n/* Chip shows the current colour and wraps the native picker */\n.color-chip {\n  position: relative;\n  overflow: hidden;\n  display: inline-flex;\n  flex-shrink: 0;\n  width: 2.25rem;\n  height: 1.375rem;\n  border-radius: 0.35rem;\n  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.2);\n  transition: transform 0.1s ease;\n}\n\n.color-pick:hover .color-chip {\n  transform: scale(1.06);\n}\n\n.color-pick:focus-within .color-chip {\n  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.2), 0 0 0 0.2rem rgba(37, 99, 235, 0.25);\n}\n\n.color-chip input[type=\"color\"] {\n  position: absolute;\n  inset: -25%;\n  width: 150%;\n  height: 150%;\n  margin: 0;\n  padding: 0;\n  border: none;\n  background: transparent;\n  opacity: 0;\n  cursor: pointer;\n}\n\n.color-hex {\n  font-family: var(--bs-font-monospace, monospace);\n  font-size: 0.7rem;\n  color: #94a3b8;\n  text-transform: lowercase;\n}\n\n.style-slider {\n  display: inline-flex;\n  align-items: center;\n  gap: 0.4rem;\n  margin: 0;\n  font-size: 0.75rem;\n  color: #64748b;\n}\n\n.style-slider input[type=\"range\"] {\n  width: 6rem;\n  accent-color: #2563eb;\n  cursor: pointer;\n}\n\n.style-slider-wide input[type=\"range\"] {\n  width: 10rem;\n}\n\n.opt-segment-3 {\n  grid-template-columns: 1fr 1fr 1fr;\n}\n\n.style-reset {\n  margin-top: 0.75rem;\n  border: 1px solid #e2e8f0;\n  background: #ffffff;\n  color: #475569;\n  font-size: 0.8125rem;\n  padding: 0.35rem 0.85rem;\n  border-radius: 0.45rem;\n  cursor: pointer;\n  transition: all 0.15s ease;\n}\n\n.style-reset:hover {\n  background: #f8fafc;\n  color: #0f172a;\n  border-color: #cbd5e1;\n}\n\n.options-actions {\n  display: flex;\n  justify-content: flex-end;\n  gap: 0.75rem;\n  padding-top: 1rem;\n}\n\n.btn-primary-action {\n  background: #2563eb;\n  color: #ffffff;\n  border: 1px solid #2563eb;\n  padding: 0.5rem 1.5rem;\n  border-radius: 0.5rem;\n  font-size: 0.9375rem;\n  font-weight: 500;\n  cursor: pointer;\n  transition: background 0.15s ease;\n}\n\n.btn-primary-action:hover {\n  background: #1d4ed8;\n}\n\n.highlight {\n  font-weight: bold;\n  position: relative;\n  animation-name: highlight-pulse;\n  animation-duration: 0.4s;\n  animation-iteration-count: infinite;\n  animation-timing-function: ease-in-out;\n  animation-direction: alternate;\n}\n\n@keyframes highlight-pulse {\n  from { left: -1px; color: #991b1b; }\n  to { left: 1px; color: #dc2626; }\n}\n</style>","import script from \"./PlotSettingsBase.vue?vue&type=script&lang=js\"\nexport * from \"./PlotSettingsBase.vue?vue&type=script&lang=js\"\n\nconst __exports__ = script;\n\nexport default __exports__","<script>\nimport {defineComponent} from 'vue';\nimport MyBase from \"@/components/trends/MyBase.vue\";\nimport {MyPlotSettings} from \"@/components/trends/settings/MyPlotSettings\";\n\nexport default defineComponent({\n  extends: MyBase,\n  name: 'PlotSettingsBase',\n  components: {},\n  props: {\n  },\n  data: function (){\n    return {\n    }\n  },\n  methods: {\n    emitChange: function(data = undefined){\n      this.$emit('settingsChanged', data);\n    },\n    emitModify: function(data = undefined){\n      this.$emit('settingsModify', data);\n    },\n    /** map-only settings changed: re-render map layers without re-querying the server */\n    emitMapChange: function(){\n      this.$emit('mapSettingsChanged');\n    },\n    handleResponse: function (json){\n      this.settings.handleResponse(json);\n    },\n    buildOptions: function (){\n      return this.settings.buildOptions();\n    },\n    updateMapBounds: function(map){\n      if (this.settings.updateMapBounds(map))\n        this.emitChange();\n    },\n  },\n  computed: {\n    settings: function () {\n      const settings = this.store.plotSettings;\n      if (! settings){\n        this._getStore().plotSettings = new MyPlotSettings(this);\n      }\n      return this.store.plotSettings;\n    },\n    isAdmin: function () {\n      return this.store?.user?.isAdmin || false;\n    },\n  }\n});\n</script>\n","import { render } from \"./PlotSettings2.vue?vue&type=template&id=427ba1c1&scoped=true\"\nimport script from \"./PlotSettings2.vue?vue&type=script&lang=js\"\nexport * from \"./PlotSettings2.vue?vue&type=script&lang=js\"\n\nimport \"./PlotSettings2.vue?vue&type=style&index=0&id=427ba1c1&scoped=true&lang=css\"\n\nimport exportComponent from \"/home/s/PycharmProjects/batdemo/myvue/node_modules/vue-loader/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['render',render],['__scopeId',\"data-v-427ba1c1\"]])\n\nexport default __exports__","<template>\n  <div>\n    <picture>\n      <source :srcset=\"getSpeciesImage(img, 'avif')\" type=\"image/avif\">\n      <source :srcset=\"getSpeciesImage(img, 'webp')\" type=\"image/webp\">\n      <source :srcset=\"getSpeciesImage(img, 'jpg')\" type=\"image/jpeg\">\n      <img :src=\"getSpeciesImage(img, 'jpg')\" :class=\"cssClassesImage\">\n    </picture>\n    <div v-if=\"bottomBar === true\" class=\"image-caption\" :class=\"bottomBarClass\" v-html=\"bottomText\">\n    </div>\n  </div>\n</template>\n\n<script>\nimport {defineComponent} from 'vue';\n\nexport default defineComponent({\n  name: 'SpeciesImage',\n  components: {},\n  props: {\n    img: Object,\n    bottomBar: {type: Boolean, default: true},\n    bottomBarClass: {type: String, default: ''},\n    bottomBarText: {type: String, default: null},\n  },\n  data: function (){\n    return {\n    }\n  },\n  mounted: function() {\n    return;\n  },\n  methods: {\n    getSpeciesImage: function(imgData, extension){\n      if (! imgData){\n        return \"\";\n      }\n      return '/static/bats/species/' + imgData.p + '.' + extension;\n    },\n  },\n  computed: {\n    cssClassesImage: function(){\n      return {\n        'species-img': true,\n        'species-img-top': this.bottomBar,\n        'species-img-full': !this.bottomBar,\n      }\n    },\n    bottomText: function (){\n      if (this.bottomBarText) return this.bottomBarText;\n      else if (this.img.c) return '© ' + this.img.c;\n      else return 'Unknown photographer';\n    }\n  },\n});\n</script>\n\n<style scoped>\n.species-img {\n  display: block;\n  width: 100%;\n}\n\n.species-img-top {\n  border-radius: 0.625rem 0.625rem 0 0;\n}\n\n.species-img-full {\n  border-radius: 0.625rem;\n}\n\n.image-caption {\n  background: #1e293b;\n  color: #e2e8f0;\n  border-radius: 0 0 0.625rem 0.625rem;\n  text-align: center;\n  padding: 0.375rem 0.5rem;\n  font-size: 0.75rem;\n}\n</style>","import { render } from \"./SpeciesImage.vue?vue&type=template&id=0b21e81d&scoped=true\"\nimport script from \"./SpeciesImage.vue?vue&type=script&lang=js\"\nexport * from \"./SpeciesImage.vue?vue&type=script&lang=js\"\n\nimport \"./SpeciesImage.vue?vue&type=style&index=0&id=0b21e81d&scoped=true&lang=css\"\n\nimport exportComponent from \"/home/s/PycharmProjects/batdemo/myvue/node_modules/vue-loader/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['render',render],['__scopeId',\"data-v-0b21e81d\"]])\n\nexport default __exports__","<template>\n  <div :id=\"carouselId\" class=\"carousel slide\" data-bs-interval=\"false\">\n    <div v-if=\"indicators === true\" class=\"carousel-indicators\">\n      <button v-for=\"(img, idx) in images\" :class=\"{'active': idx == 0}\" :key=\"'b'+species.id+'-'+idx\"\n              type=\"button\" :data-bs-target=\"'#' + carouselId\" :data-bs-slide-to=\"idx\">\n      </button>\n    </div>\n    <div class=\"carousel-inner\">\n      <div v-for=\"(img, idx) in images\" class=\"carousel-item\" :class=\"{'active': idx == 0}\" :key=\"'i'+species.id+'-'+idx\" data-bs-interval=\"false\">\n        <SpeciesImage :img=\"img\" :bottom-bar=\"bottomBar\" bottomBarClass=\"pb-5\"></SpeciesImage>\n      </div>\n    </div>\n    <button v-if=\"images.length>1\" class=\"carousel-control-prev\" type=\"button\" :data-bs-target=\"'#' + carouselId\" data-bs-slide=\"prev\">\n      <span class=\"carousel-control-prev-icon\" aria-hidden=\"true\"></span>\n      <span class=\"visually-hidden\">Previous</span>\n    </button>\n    <button v-if=\"images.length>1\" class=\"carousel-control-next\" type=\"button\" :data-bs-target=\"'#' + carouselId\" data-bs-slide=\"next\">\n      <span class=\"carousel-control-next-icon\" aria-hidden=\"true\"></span>\n      <span class=\"visually-hidden\">Next</span>\n    </button>\n  </div>\n</template>\n\n<script>\nimport {defineComponent} from 'vue';\nimport SpeciesImage from \"@/components/trends/cards/SpeciesImage.vue\";\n\nexport default defineComponent({\n  name: 'SpeciesImageCarousel',\n  components: {SpeciesImage},\n  props: {\n    species: Object,\n    images: Object,\n    bottomBar: {type: Boolean, default: true},\n    indicators: {type: Boolean, default: true},\n    mkey: {type: String, default: ''}\n  },\n  data: function (){\n    return {\n    }\n  },\n  mounted: function() {\n    return;\n  },\n  methods: {\n  },\n  computed: {\n    carouselId: function (){\n      return 'speciesCarousel' + this.mkey;\n    }\n  },\n});\n</script>\n\n<style scoped>\n.carousel-control-prev,\n.carousel-control-next {\n  opacity: 0.6;\n  transition: opacity 0.15s ease;\n}\n\n.carousel-control-prev:hover,\n.carousel-control-next:hover {\n  opacity: 1;\n}\n</style>\n","import { render } from \"./SpeciesImageCarousel.vue?vue&type=template&id=76ce92c3&scoped=true\"\nimport script from \"./SpeciesImageCarousel.vue?vue&type=script&lang=js\"\nexport * from \"./SpeciesImageCarousel.vue?vue&type=script&lang=js\"\n\nimport \"./SpeciesImageCarousel.vue?vue&type=style&index=0&id=76ce92c3&scoped=true&lang=css\"\n\nimport exportComponent from \"/home/s/PycharmProjects/batdemo/myvue/node_modules/vue-loader/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['render',render],['__scopeId',\"data-v-76ce92c3\"]])\n\nexport default __exports__","<template>\n  <div v-if=\"plotError\" class=\"error-banner\">\n    <div v-if=\"user && user.isAdmin\">\n      <h6 class=\"error-heading\">Error (for Admins only): <span class=\"badge-circle badge-admin\"></span></h6>\n      <span class=\"error-msg\">{{plotError.message}}</span>\n    </div>\n    <div v-else>\n      <h6 class=\"error-heading\">{{ $t('trends.plotError.generic_error') }}</h6>\n      <span class=\"error-msg\">{{ $t('trends.plotError.generic_error_text') }}</span>\n    </div>\n  </div>\n</template>\n\n<script>\nimport {defineComponent} from 'vue';\nimport MyBase from \"@/components/trends/MyBase.vue\";\n\nexport default defineComponent({\n  extends: MyBase,\n  name: 'PlotErrorSmall',\n  components: {},\n  props: {\n    plotError: Object\n  },\n  // data: function (){\n  //   return {\n  //   }\n  // },\n  // mounted: function() {\n  //   return;\n  // },\n  // methods: {\n  //   hello: function () {\n  //     return;\n  //   },\n  // },\n});\n</script>\n\n<style scoped>\n.error-banner {\n  padding: 0.75rem 1rem;\n  background: rgba(220, 38, 38, 0.08);\n  border: 1px solid rgba(220, 38, 38, 0.2);\n  border-radius: 0.375rem;\n}\n\n.error-heading {\n  font-size: 0.8125rem;\n  font-weight: 600;\n  color: #991b1b;\n  margin: 0 0 0.25rem;\n}\n\n.error-msg {\n  font-size: 0.8125rem;\n  color: #1e293b;\n  line-height: 1.5;\n}\n</style>\n","import { render } from \"./PlotErrorSmall.vue?vue&type=template&id=a5c7c8a0&scoped=true\"\nimport script from \"./PlotErrorSmall.vue?vue&type=script&lang=js\"\nexport * from \"./PlotErrorSmall.vue?vue&type=script&lang=js\"\n\nimport \"./PlotErrorSmall.vue?vue&type=style&index=0&id=a5c7c8a0&scoped=true&lang=css\"\n\nimport exportComponent from \"/home/s/PycharmProjects/batdemo/myvue/node_modules/vue-loader/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['render',render],['__scopeId',\"data-v-a5c7c8a0\"]])\n\nexport default __exports__","<template>\n  <MyTrendCard :title=\"title\">\n    <template v-if=\"showPicker\" #actions>\n      <label class=\"src-picker\">\n        <span class=\"src-picker-label\">{{ $t('trends.sourcesObsType') }}</span>\n        <select class=\"form-select form-select-sm src-picker-select\" v-model=\"selectedObsId\">\n          <option v-for=\"obsId in obsPlotIds\" :key=\"obsId\" :value=\"obsId\">{{ obsLabel(obsId) }}</option>\n        </select>\n      </label>\n    </template>\n    <div id=\"box3\">\n      <div v-if=\"!store.plotSettings?.species\" class=\"contrib-empty\">\n        <div class=\"empty-inner\">\n          <svg width=\"128\" height=\"128\" class=\"empty-icon\"><use xlink:href=\"#person-heart\"/></svg>\n          <p class=\"empty-lead\">{{ $t('trends.intro.contributors1' )}}</p>\n          <p class=\"empty-lead\">{{ $t('trends.intro.contributors2' )}}</p>\n\n          <p class=\"empty-lead\"><a class=\"empty-link\" href=\"/accounts/signup\">{{ $t('trends.intro.contributorsAccLink') }}</a></p>\n\n          <p class=\"empty-lead\"><a class=\"empty-link\" href=\"mailto:info@batlas.info\">info@batlas.info</a></p>\n\n          <p class=\"empty-lead privacy-note\"><strong>{{ $t('trends.intro.privacy1' )}}</strong><br>\n            {{ $t('trends.intro.privacy1a' )}}\n            <a class=\"empty-link\" href=\"/static/bats/misc/BATLAS-Vereinbarung-Datentransfer-und-Datennutzung.docx\">{{ $t('trends.intro.privacy1b' )}}</a>\n            {{ $t('trends.intro.privacy1c' )}} {{ $t('trends.intro.privacy1d' )}}\n          </p>\n\n          <ul class=\"privacy-list\">\n            <li>{{ $t('trends.intro.privacy2a' )}}</li>\n            <li>{{ $t('trends.intro.privacy2b' )}}</li>\n          </ul>\n\n        </div>\n      </div>\n      <div v-else>\n        <div v-if=\"activeContributors\">\n          <ContributorsAccordion :contributors=\"activeContributors\"></ContributorsAccordion>\n        </div>\n\n        <div v-if=\"user && user.name && user.isAdmin\">\n          <div v-if=\"active.plot_error\" class=\"src-error\">\n            <span class=\"badge-circle badge-admin me-1\"></span>\n            [{{ active.plot_error.name }}]: {{ active.plot_error.message }}\n          </div>\n          <div v-if=\"active.timings\">\n            <TimingsInfo :timings=\"active.timings\"></TimingsInfo>\n          </div>\n          <div v-if=\"active.gof\">\n            <GofDiagnostics :gof-data=\"active.gof\" class=\"admin-section\"></GofDiagnostics>\n          </div>\n          <div v-if=\"active.overall\">\n            <h5 class=\"admin-sub-title\">TRIM <span class=\"badge-circle badge-admin\"></span></h5>\n            <TrimInfo :summary=\"active.summary\" :overall=\"active.overall\" @download=\"download\"></TrimInfo>\n          </div>\n          <DownloadData @download=\"download\" @select-sites=\"$emit('select-sites')\"></DownloadData>\n        </div>\n      </div>\n    </div>\n  </MyTrendCard>\n</template>\n\n<script>\nimport {defineComponent} from 'vue';\nimport MyBase from \"@/components/trends/MyBase.vue\";\nimport MyTrendCard from \"@/components/trends/cards/MyTrendCard.vue\";\nimport ContributorsAccordion from \"@/components/trends/cards/ContributorsAccordion.vue\";\nimport TrimInfo from \"@/components/trends/cards/TrimInfo.vue\";\nimport TimingsInfo from \"@/components/trends/cards/TimingsInfo.vue\";\nimport DownloadData from \"@/components/trends/cards/DownloadData.vue\";\nimport GofDiagnostics from \"@/components/trends/GofDiagnostics.vue\";\n\nexport default defineComponent({\n  extends: MyBase,\n  name: 'TcMore',\n  components: {GofDiagnostics, DownloadData, TimingsInfo, TrimInfo, ContributorsAccordion, MyTrendCard},\n  props: {\n    overall: Object,\n    summary: Object,\n    timings: Object,\n    contributors: Object,\n    plotError: Object,\n    gof: Object,\n    obsPlots: Object,\n    obsPlotIds: {type: Array, default: () => []},\n  },\n  data: function (){\n    return {\n      /** which type's stats the card shows in a multi-type layout */\n      selectedObsId: null,\n    }\n  },\n  watch: {\n    // The payload changes on every refetch; a type can disappear from it (visibility,\n    // a failed build). Re-clamp so the card can never point at nothing.\n    obsPlotIds: {\n      immediate: true,\n      handler: function (ids){\n        if (!ids.length){\n          this.selectedObsId = null;\n          return;\n        }\n        if (!this.selectedObsId || !ids.includes(this.selectedObsId)){\n          const base = this.store?.plotSettings?.observationType?.id;\n          this.selectedObsId = ids.includes(base) ? base : ids[0];\n        }\n      },\n    },\n  },\n  mounted: function() {\n    return;\n  },\n  methods: {\n    supplierHasInfo: function (supplier){\n      return !!(supplier.url || supplier.desc || supplier.contributors);\n    },\n    download: function (data){\n      this.$emit('download', data);\n    },\n    obsLabel: function (obsId){\n      const key = 'trends.obsTabs.labels.' + obsId;\n      const short = this.$t(key);\n      return (short === key) ? obsId : short;\n    },\n  },\n  computed: {\n    showPicker: function (){\n      return this.store?.plotSettings?.obsLayout !== 'single'\n        && !!this.obsPlots && this.obsPlotIds.length > 1\n        && !!this.store.plotSettings?.species;\n    },\n    /**\n     * The stats this card is showing. In a multi-type layout that is the picked type's\n     * payload; otherwise it is the flat props, which already describe the base type.\n     */\n    active: function (){\n      if (this.showPicker && this.selectedObsId && this.obsPlots[this.selectedObsId]){\n        return this.obsPlots[this.selectedObsId];\n      }\n      return {\n        contributors: this.contributors,\n        overall: this.overall,\n        summary: this.summary,\n        timings: this.timings,\n        gof: this.gof,\n        plot_error: this.plotError,\n      };\n    },\n    activeContributors: function (){\n      return this.active.contributors;\n    },\n    title: function(){\n      if (this.activeContributors){\n        return this.$tc('trends.nbSources', {n: this.activeContributors.length})\n      }\n      return this.$t('trends.contribute');\n    }\n  }\n});\n</script>\n\n<style scoped>\n.contrib-empty {\n  max-width: 720px;\n  margin: 0 auto;\n}\n\n.empty-inner {\n  text-align: center;\n}\n\n.empty-icon {\n  color: #94a3b8;\n}\n\n.empty-lead {\n  font-size: 1.0625rem;\n  color: #64748b;\n  line-height: 1.6;\n  margin: 0.5rem 0;\n}\n\n.empty-lead:first-of-type {\n  margin-top: 1.5rem;\n}\n\n.empty-link {\n  color: #2563eb;\n  text-decoration: underline;\n  text-underline-offset: 2px;\n}\n\n.empty-link:hover {\n  color: #1d4ed8;\n}\n\n.privacy-note {\n  margin-top: 1.5rem;\n}\n\n.privacy-list {\n  text-align: left;\n  margin-top: 1.5rem;\n  font-size: 1.0625rem;\n  color: #64748b;\n  line-height: 1.6;\n  padding-left: 1.5rem;\n}\n\n.privacy-list li {\n  margin: 0.5rem 0;\n}\n\n.admin-section {\n  margin-top: 1.5rem;\n}\n\n.admin-sub-title {\n  font-size: 1rem;\n  font-weight: 600;\n  color: #1e293b;\n  margin: 1.5rem 0 0.75rem;\n}\n\n.src-picker {\n  display: inline-flex;\n  align-items: center;\n  gap: 0.4rem;\n  margin: 0;\n}\n\n.src-picker-label {\n  font-size: 0.8rem;\n  font-weight: 600;\n  color: #64748b;\n  white-space: nowrap;\n}\n\n.src-picker-select {\n  width: auto;\n  font-size: 0.8rem;\n}\n\n.src-error {\n  font-size: 0.8125rem;\n  color: #991b1b;\n  margin-top: 1rem;\n}\n</style>\n","<template>\n  <div v-if=\"contributors\" class=\"contrib-list\">\n    <div\n      class=\"file-card\"\n      v-for=\"(contributor, index) in contributors\"\n      :key=\"index\"\n    >\n      <!-- Card Header -->\n      <div\n        class=\"file-header\"\n        :class=\"{ 'clickable': supplierHasInfo(contributor) }\"\n        @click=\"supplierHasInfo(contributor) && toggleOpen(index)\"\n      >\n        <div class=\"file-header-left\">\n          <div class=\"contrib-icon-wrap\">\n            <img v-if=\"contributor.icon\" :src=\"'/dl/pic/'+contributor.icon\" class=\"contrib-icon-img\">\n            <svg v-else class=\"contrib-icon-svg\"><use xlink:href=\"#bat1\"/></svg>\n          </div>\n          <div class=\"file-header-info\">\n            <h6 class=\"file-name\">{{ contributor.name }}</h6>\n            <div class=\"file-meta\">\n              <span class=\"meta-tag\">{{ $tc('trends.contribCounts1', {n: contributor.cnt}) }}</span>\n              <span class=\"meta-tag\">{{ $tc('trends.contribCounts2', {n: contributor.locs}) }}</span>\n            </div>\n          </div>\n        </div>\n        <div class=\"file-header-right\" v-if=\"supplierHasInfo(contributor)\">\n          <span class=\"collapse-indicator\">{{ openItems[index] ? '&#9650;' : '&#9660;' }}</span>\n        </div>\n      </div>\n\n      <!-- Card Body -->\n      <div v-if=\"supplierHasInfo(contributor)\" v-show=\"openItems[index]\" class=\"file-body\">\n        <p v-if=\"contributor.description\" class=\"contrib-desc\">{{ contributor.description }}</p>\n        <p v-if=\"contributor.contributors\" class=\"contrib-people\">{{ contributor.contributors }}</p>\n        <p v-if=\"contributor.url\" class=\"contrib-url\"><a :href=\"contributor.url\">{{ contributor.url }}</a></p>\n      </div>\n    </div>\n  </div>\n</template>\n\n<script>\nimport {defineComponent} from 'vue';\nimport MyBase from \"@/components/trends/MyBase.vue\";\n\nexport default defineComponent({\n  extends: MyBase,\n  name: 'ContributorsAccordion',\n  components: {},\n  props: {\n    contributors: Object,\n  },\n  data: function (){\n    return {\n      openItems: {},\n    }\n  },\n  mounted: function() {\n    return;\n  },\n  methods: {\n    supplierHasInfo: function (supplier){\n      if (supplier.url || supplier.desc || supplier.contributors) return true;\n      return false;\n    },\n    toggleOpen: function (index){\n      const updated = {...this.openItems};\n      updated[index] = !updated[index];\n      this.openItems = updated;\n    },\n  },\n});\n</script>\n\n<style scoped>\n.contrib-list {\n  display: flex;\n  flex-direction: column;\n  gap: 0.625rem;\n}\n\n.file-card {\n  --color-primary: #2563eb;\n  --color-primary-light: rgba(37, 99, 235, 0.08);\n  --color-primary-muted: rgba(37, 99, 235, 0.15);\n  --color-text: #1e293b;\n  --color-text-muted: #64748b;\n  --color-border: #e2e8f0;\n  --color-border-light: #f1f5f9;\n  --color-bg: #ffffff;\n  --color-bg-subtle: #f8fafc;\n  --radius-md: 0.625rem;\n  --radius-lg: 0.875rem;\n  --transition-fast: 0.15s ease;\n\n  background: var(--color-bg);\n  border: 1px solid var(--color-border);\n  border-radius: var(--radius-lg);\n  overflow: hidden;\n}\n\n/* Header */\n.file-header {\n  display: flex;\n  justify-content: space-between;\n  align-items: center;\n  padding: 0.875rem 1.25rem;\n  background: var(--color-bg-subtle);\n  border-bottom: 1px solid var(--color-border-light);\n  gap: 1rem;\n}\n\n.file-header.clickable {\n  cursor: pointer;\n  transition: background var(--transition-fast);\n}\n\n.file-header.clickable:hover {\n  background: #f1f5f9;\n}\n\n.file-header-left {\n  display: flex;\n  align-items: center;\n  gap: 0.75rem;\n  min-width: 0;\n}\n\n.contrib-icon-wrap {\n  width: 48px;\n  height: 48px;\n  flex-shrink: 0;\n  display: flex;\n  align-items: center;\n  justify-content: center;\n}\n\n.contrib-icon-img {\n  max-width: 48px;\n  max-height: 48px;\n  width: auto;\n  height: auto;\n  border-radius: var(--radius-md);\n}\n\n.contrib-icon-svg {\n  width: 32px;\n  height: 32px;\n  color: #94a3b8;\n}\n\n.file-header-info {\n  min-width: 0;\n}\n\n.file-name {\n  margin: 0;\n  font-size: 0.9375rem;\n  font-weight: 600;\n  color: var(--color-text);\n  line-height: 1.4;\n}\n\n.file-meta {\n  display: flex;\n  flex-wrap: wrap;\n  gap: 0.5rem;\n  margin-top: 0.25rem;\n}\n\n.meta-tag {\n  font-size: 0.75rem;\n  color: var(--color-text-muted);\n}\n\n.file-header-right {\n  display: flex;\n  align-items: center;\n  gap: 0.75rem;\n  flex-shrink: 0;\n}\n\n.collapse-indicator {\n  font-size: 0.75rem;\n  color: var(--color-text-muted);\n}\n\n/* Body */\n.file-body {\n  padding: 1.25rem;\n}\n\n.contrib-desc {\n  font-size: 0.875rem;\n  color: var(--color-text-muted);\n  line-height: 1.6;\n  margin: 0 0 0.75rem;\n}\n\n.contrib-desc:last-child {\n  margin-bottom: 0;\n}\n\n.contrib-people {\n  font-size: 0.875rem;\n  color: var(--color-text);\n  line-height: 1.5;\n  margin: 0 0 0.75rem;\n}\n\n.contrib-people:last-child {\n  margin-bottom: 0;\n}\n\n.contrib-url {\n  margin: 0;\n}\n\n.contrib-url a {\n  color: var(--color-primary);\n  text-decoration: underline;\n  text-underline-offset: 2px;\n  font-size: 0.875rem;\n}\n\n.contrib-url a:hover {\n  color: #1d4ed8;\n}\n</style>\n","import { render } from \"./ContributorsAccordion.vue?vue&type=template&id=6d7e224a&scoped=true\"\nimport script from \"./ContributorsAccordion.vue?vue&type=script&lang=js\"\nexport * from \"./ContributorsAccordion.vue?vue&type=script&lang=js\"\n\nimport \"./ContributorsAccordion.vue?vue&type=style&index=0&id=6d7e224a&scoped=true&lang=css\"\n\nimport exportComponent from \"/home/s/PycharmProjects/batdemo/myvue/node_modules/vue-loader/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['render',render],['__scopeId',\"data-v-6d7e224a\"]])\n\nexport default __exports__","<template>\n  <div class=\"trim-info\">\n    <table class=\"data-table\">\n      <tbody>\n      <tr :class=\"{'row-danger': overall.slope.meaning === 'Uncertain'}\"><td class=\"cell-label\">Trend</td><td>{{overall.slope.meaning}}</td></tr>\n      <tr><td class=\"cell-label\">p</td><td>{{overall.slope.p}}</td></tr>\n      <tr><td class=\"cell-label\">add</td><td>{{overall.slope.add.toFixed(8)}} ({{overall.slope.se_add.toFixed(8)}})</td></tr>\n      <tr><td class=\"cell-label\">mul</td><td>{{overall.slope.mul.toFixed(8)}} ({{overall.slope.se_mul.toFixed(8)}})</td></tr>\n      <tr :class=\"{'row-danger': summary.convergence.startsWith('No convergence')}\"><td class=\"cell-label\">Convergence</td><td>{{summary.convergence}}</td></tr>\n      <tr v-if=\"summary.overdispersion\"><td class=\"cell-label\">overdispersion</td><td>{{summary.overdispersion.toFixed(8)}}</td></tr>\n      <tr v-if=\"summary.serialcorrelation\"><td class=\"cell-label\">serial correlation</td><td>{{summary.serialcorrelation.toFixed(8)}}</td></tr>\n      </tbody>\n    </table>\n\n    <h5 class=\"sub-title\">Timings</h5>\n    <table class=\"data-table\">\n      <tbody>\n      <tr v-for=\"(m,idx) in summary.timings\" :key=\"idx\"><td class=\"cell-label\">{{ m.m }}</td><td class=\"cell-mono\">{{m.t.toFixed(3)}} seconds</td></tr>\n      </tbody>\n    </table>\n\n    <h5 class=\"sub-title\">Goodness Of Fit</h5>\n    <table class=\"data-table\">\n      <tbody>\n      <tr><td class=\"cell-label\">Chi Square</td><td>{{summary.gof.chi2.chi2.toFixed(2)}}</td><td>{{summary.gof.chi2.df}}</td><td>{{summary.gof.chi2.p}}</td></tr>\n      <tr><td class=\"cell-label\">Likelihood Ratio</td><td>{{summary.gof.lr.LR.toFixed(2)}}</td><td>{{summary.gof.lr.df}}</td><td>{{summary.gof.lr.p}}</td></tr>\n      <tr><td class=\"cell-label\">AIC</td><td colspan=\"3\">{{summary.gof.aic.toFixed(2)}}</td></tr>\n      </tbody>\n    </table>\n  </div>\n</template>\n\n<script>\nimport {defineComponent} from 'vue';\nimport MyBase from \"@/components/trends/MyBase.vue\";\n\nexport default defineComponent({\n  extends: MyBase,\n  name: 'TrimInfo',\n  components: {},\n  props: {\n    overall: Object,\n    summary: Object,\n  },\n  data: function (){\n    return {\n    }\n  },\n  mounted: function() {\n    return;\n  },\n  // methods: {\n  //   downloadCsv: function () {\n  //     this.$emit('download', {type: 'csv'});\n  //   },\n  //   downloadCsvDemo: function () {\n  //     this.$emit('download', {type: 'csv', demo: 1});\n  //   },\n  // },\n});\n</script>\n\n<style scoped>\n.data-table {\n  width: 100%;\n  border-collapse: collapse;\n  font-size: 0.8125rem;\n}\n\n.data-table td {\n  padding: 0.375rem 0.5rem;\n  border-bottom: 1px solid #f1f5f9;\n  color: #1e293b;\n}\n\n.data-table tr:hover {\n  background: #f8fafc;\n}\n\n.cell-label {\n  font-weight: 500;\n  color: #64748b;\n}\n\n.cell-mono {\n  font-family: 'SF Mono', Monaco, 'Cascadia Code', monospace;\n}\n\n.row-danger {\n  background: rgba(220, 38, 38, 0.08);\n}\n\n.row-danger td {\n  color: #991b1b;\n}\n\n.sub-title {\n  font-size: 1rem;\n  font-weight: 600;\n  color: #1e293b;\n  margin: 1.5rem 0 0.75rem;\n}\n</style>\n","import { render } from \"./TrimInfo.vue?vue&type=template&id=b7fbc67e&scoped=true\"\nimport script from \"./TrimInfo.vue?vue&type=script&lang=js\"\nexport * from \"./TrimInfo.vue?vue&type=script&lang=js\"\n\nimport \"./TrimInfo.vue?vue&type=style&index=0&id=b7fbc67e&scoped=true&lang=css\"\n\nimport exportComponent from \"/home/s/PycharmProjects/batdemo/myvue/node_modules/vue-loader/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['render',render],['__scopeId',\"data-v-b7fbc67e\"]])\n\nexport default __exports__","<template>\n  <div class=\"timings-info\">\n    <h5 class=\"timings-title\">Timings <span class=\"badge-circle badge-admin\"></span></h5>\n    <table class=\"data-table\">\n      <tbody>\n      <tr v-for=\"(m,idx) in timings\" :key=\"idx\"><td class=\"timing-label\">{{ m.m }}</td><td class=\"timing-value\">{{m.t.toFixed(3)}} seconds</td></tr>\n      </tbody>\n    </table>\n  </div>\n</template>\n\n<script>\nimport {defineComponent} from 'vue';\nimport MyBase from \"@/components/trends/MyBase.vue\";\n\nexport default defineComponent({\n  extends: MyBase,\n  name: 'TimingsInfo',\n  components: {},\n  props: {\n    timings: Object\n  },\n  data: function (){\n    return {\n    }\n  },\n  mounted: function() {\n    return;\n  },\n});\n</script>\n\n<style scoped>\n.timings-title {\n  font-size: 1rem;\n  font-weight: 600;\n  color: #1e293b;\n  margin: 1.5rem 0 0.75rem;\n}\n\n.data-table {\n  width: 100%;\n  border-collapse: collapse;\n  font-size: 0.8125rem;\n}\n\n.data-table td {\n  padding: 0.375rem 0.5rem;\n  border-bottom: 1px solid #f1f5f9;\n  color: #1e293b;\n}\n\n.data-table tr:hover {\n  background: #f8fafc;\n}\n\n.timing-label {\n  font-weight: 500;\n}\n\n.timing-value {\n  color: #64748b;\n  font-family: 'SF Mono', Monaco, 'Cascadia Code', monospace;\n}\n</style>\n","import { render } from \"./TimingsInfo.vue?vue&type=template&id=e40671ec&scoped=true\"\nimport script from \"./TimingsInfo.vue?vue&type=script&lang=js\"\nexport * from \"./TimingsInfo.vue?vue&type=script&lang=js\"\n\nimport \"./TimingsInfo.vue?vue&type=style&index=0&id=e40671ec&scoped=true&lang=css\"\n\nimport exportComponent from \"/home/s/PycharmProjects/batdemo/myvue/node_modules/vue-loader/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['render',render],['__scopeId',\"data-v-e40671ec\"]])\n\nexport default __exports__","<template>\n  <div class=\"download-section\">\n    <h5 class=\"download-title\">Download Data <span class=\"badge-circle badge-admin\"></span></h5>\n    <div class=\"download-actions\">\n      <button class=\"btn-primary-action\" @click=\"downloadCsv\">CSV</button>\n      <button v-if=\"showSelectSites\" class=\"btn-outline-action\" @click=\"$emit('select-sites')\">\n        {{ $t('trends.selectSites') }}</button>\n    </div>\n  </div>\n</template>\n\n<script>\nimport {defineComponent} from 'vue';\nimport MyBase from \"@/components/trends/MyBase.vue\";\nimport {canSeeSiteShortcuts} from \"@/lib/siteShortcuts\";\n\nexport default defineComponent({\n  extends: MyBase,\n  name: 'DownloadData',\n  components: {},\n  props: {\n  },\n  computed: {\n    showSelectSites() {\n      // shared shortcut gate + admins only on the public trends page\n      return canSeeSiteShortcuts(this.user) && !!this.user?.isAdmin;\n    },\n  },\n  data: function (){\n    return {\n    }\n  },\n  mounted: function() {\n    return;\n  },\n  methods: {\n    downloadCsv: function () {\n      this.$emit('download', {type: 'csv'});\n    },\n    downloadCsvDemo: function () {\n      this.$emit('download', {type: 'csv', demo: 1});\n    },\n  },\n});\n</script>\n\n<style scoped>\n.download-title {\n  font-size: 1rem;\n  font-weight: 600;\n  color: #1e293b;\n  margin: 1.5rem 0 0.75rem;\n}\n\n.btn-primary-action {\n  display: inline-flex;\n  align-items: center;\n  gap: 0.375rem;\n  padding: 0.5rem 1.25rem;\n  font-size: 0.875rem;\n  font-weight: 500;\n  color: white;\n  background: #2563eb;\n  border: none;\n  border-radius: 0.625rem;\n  cursor: pointer;\n  transition: all 0.15s ease;\n}\n\n.btn-primary-action:hover {\n  background: #1d4ed8;\n  transform: translateY(-1px);\n  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);\n}\n\n.download-actions {\n  display: flex;\n  flex-wrap: wrap;\n  align-items: center;\n  gap: 0.5rem;\n}\n\n.btn-outline-action {\n  display: inline-flex;\n  align-items: center;\n  gap: 0.375rem;\n  padding: 0.5rem 1.25rem;\n  font-size: 0.875rem;\n  font-weight: 500;\n  color: #2563eb;\n  background: transparent;\n  border: 1px solid rgba(37, 99, 235, 0.35);\n  border-radius: 0.625rem;\n  cursor: pointer;\n  transition: all 0.15s ease;\n}\n\n.btn-outline-action:hover {\n  background: rgba(37, 99, 235, 0.08);\n  border-color: #2563eb;\n  transform: translateY(-1px);\n  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.15);\n}\n</style>\n","import { render } from \"./DownloadData.vue?vue&type=template&id=fa77bfa4&scoped=true\"\nimport script from \"./DownloadData.vue?vue&type=script&lang=js\"\nexport * from \"./DownloadData.vue?vue&type=script&lang=js\"\n\nimport \"./DownloadData.vue?vue&type=style&index=0&id=fa77bfa4&scoped=true&lang=css\"\n\nimport exportComponent from \"/home/s/PycharmProjects/batdemo/myvue/node_modules/vue-loader/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['render',render],['__scopeId',\"data-v-fa77bfa4\"]])\n\nexport default __exports__","<template>\n  <div class=\"gof-diagnostics\">\n    <div class=\"gof-header\">\n      <div class=\"gof-title-group\">\n        <svg width=\"20\" height=\"20\"><use xlink:href=\"#bar-chart\"/></svg>\n        <h5 class=\"gof-title\">{{ $t('trends.gof.title') }} <span class=\"badge-circle badge-admin\"></span></h5>\n      </div>\n      <button class=\"btn-ghost\" @click=\"toggleExpanded\">\n        {{ expanded ? $t('trends.gof.collapse') : $t('trends.gof.expand') }}\n      </button>\n    </div>\n\n    <div v-if=\"expanded && gofData\" class=\"gof-content\">\n      <div v-if=\"gofData.stats\" class=\"stats-summary\">\n        <div class=\"stats-row\">\n          <div class=\"stat-item\">\n            <span class=\"stat-key\">{{ $t('trends.gof.stats.deviance') }}</span>\n            <span class=\"stat-val\">{{ formatNumber(gofData.stats.deviance) }}</span>\n          </div>\n          <div class=\"stat-item\">\n            <span class=\"stat-key\">{{ $t('trends.gof.stats.aic') }}</span>\n            <span class=\"stat-val\">{{ formatNumber(gofData.stats.aic) }}</span>\n          </div>\n          <div class=\"stat-item\">\n            <span class=\"stat-key\">{{ $t('trends.gof.stats.gcv') }}</span>\n            <span class=\"stat-val\">{{ formatNumber(gofData.stats.gcv) }}</span>\n          </div>\n          <div class=\"stat-item\">\n            <span class=\"stat-key\">{{ $t('trends.gof.stats.n') }}</span>\n            <span class=\"stat-val\">{{ gofData.stats.n_sampled }} / {{ gofData.stats.n_points }}</span>\n          </div>\n        </div>\n      </div>\n\n      <div class=\"plots-grid\">\n        <div class=\"plot-card\">\n          <div class=\"plot-card-header\">{{ $t('trends.gof.qq.title') }}</div>\n          <div class=\"plot-card-body\">\n            <div :id=\"plotIds.qq\" class=\"gof-plot\"></div>\n            <span class=\"plot-hint\">{{ $t('trends.gof.qq.hint') }}</span>\n          </div>\n        </div>\n\n        <div class=\"plot-card\">\n          <div class=\"plot-card-header\">{{ $t('trends.gof.residVsFit.title') }}</div>\n          <div class=\"plot-card-body\">\n            <div :id=\"plotIds.residVsFit\" class=\"gof-plot\"></div>\n            <span class=\"plot-hint\">{{ $t('trends.gof.residVsFit.hint') }}</span>\n          </div>\n        </div>\n\n        <div class=\"plot-card\">\n          <div class=\"plot-card-header\">{{ $t('trends.gof.histogram.title') }}</div>\n          <div class=\"plot-card-body\">\n            <div :id=\"plotIds.histogram\" class=\"gof-plot\"></div>\n            <span class=\"plot-hint\">{{ $t('trends.gof.histogram.hint') }}</span>\n          </div>\n        </div>\n\n        <div class=\"plot-card\">\n          <div class=\"plot-card-header\">{{ $t('trends.gof.obsVsFit.title') }}</div>\n          <div class=\"plot-card-body\">\n            <div :id=\"plotIds.obsVsFit\" class=\"gof-plot\"></div>\n            <span class=\"plot-hint\">{{ $t('trends.gof.obsVsFit.hint') }}</span>\n          </div>\n        </div>\n      </div>\n    </div>\n\n    <div v-else-if=\"expanded && !gofData\" class=\"info-banner\">\n      {{ $t('trends.gof.noData') }}\n    </div>\n  </div>\n</template>\n\n<script>\nimport { defineComponent } from 'vue';\nimport * as d3 from 'd3';\n\nexport default defineComponent({\n  name: 'GofDiagnostics',\n  props: {\n    gofData: {\n      type: Object,\n      default: null\n    },\n    plotIdPrefix: {\n      type: String,\n      default: 'gof'\n    }\n  },\n  data() {\n    return {\n      expanded: false\n    };\n  },\n  computed: {\n    plotIds() {\n      return {\n        qq: `${this.plotIdPrefix}-qq`,\n        residVsFit: `${this.plotIdPrefix}-residVsFit`,\n        histogram: `${this.plotIdPrefix}-histogram`,\n        obsVsFit: `${this.plotIdPrefix}-obsVsFit`\n      };\n    }\n  },\n  watch: {\n    expanded(val) {\n      if (val && this.gofData) {\n        this.$nextTick(() => this.renderPlots());\n      }\n    },\n    gofData() {\n      if (this.expanded && this.gofData) {\n        this.$nextTick(() => this.renderPlots());\n      }\n    }\n  },\n  methods: {\n    toggleExpanded() {\n      this.expanded = !this.expanded;\n    },\n    formatNumber(n) {\n      if (n === null || n === undefined) return 'N/A';\n      return typeof n === 'number' ? n.toFixed(2) : n;\n    },\n    renderPlots() {\n      if (!this.gofData) return;\n      \n      // Render each diagnostic plot\n      if (this.gofData.qq) this.renderQQPlot();\n      if (this.gofData.residVsFit) this.renderResidVsFitPlot();\n      if (this.gofData.histogram) this.renderHistogram();\n      if (this.gofData.obsVsFit) this.renderObsVsFitPlot();\n    },\n    \n    getPlotDimensions(elementId) {\n      const element = document.getElementById(elementId);\n      if (!element) return { width: 300, height: 200 };\n      const rect = element.getBoundingClientRect();\n      return { \n        width: rect.width || 300, \n        height: 200 \n      };\n    },\n    \n    renderQQPlot() {\n      const { qq } = this.gofData;\n      const elementId = this.plotIds.qq;\n      const { width, height } = this.getPlotDimensions(elementId);\n      const margin = { top: 10, right: 20, bottom: 30, left: 40 };\n      \n      // Clear previous plot\n      d3.select(`#${elementId}`).selectAll('*').remove();\n      \n      const svg = d3.select(`#${elementId}`)\n        .append('svg')\n        .attr('width', width)\n        .attr('height', height);\n      \n      const g = svg.append('g')\n        .attr('transform', `translate(${margin.left},${margin.top})`);\n      \n      const innerWidth = width - margin.left - margin.right;\n      const innerHeight = height - margin.top - margin.bottom;\n      \n      const xExtent = d3.extent(qq.theoretical);\n      const yExtent = d3.extent(qq.residuals);\n      \n      const x = d3.scaleLinear()\n        .domain(xExtent)\n        .range([0, innerWidth]);\n      \n      const y = d3.scaleLinear()\n        .domain(yExtent)\n        .range([innerHeight, 0]);\n      \n      // Reference line (y = x)\n      const lineExtent = [Math.max(xExtent[0], yExtent[0]), Math.min(xExtent[1], yExtent[1])];\n      g.append('line')\n        .attr('x1', x(lineExtent[0]))\n        .attr('y1', y(lineExtent[0]))\n        .attr('x2', x(lineExtent[1]))\n        .attr('y2', y(lineExtent[1]))\n        .attr('stroke', '#dc3545')\n        .attr('stroke-width', 1.5)\n        .attr('stroke-dasharray', '5,5');\n      \n      // Points\n      const points = qq.theoretical.map((t, i) => ({ x: t, y: qq.residuals[i] }));\n      g.selectAll('circle')\n        .data(points)\n        .enter()\n        .append('circle')\n        .attr('cx', d => x(d.x))\n        .attr('cy', d => y(d.y))\n        .attr('r', 2)\n        .attr('fill', 'steelblue')\n        .attr('opacity', 0.5);\n      \n      // Axes\n      g.append('g')\n        .attr('transform', `translate(0,${innerHeight})`)\n        .call(d3.axisBottom(x).ticks(5));\n      \n      g.append('g')\n        .call(d3.axisLeft(y).ticks(5));\n    },\n    \n    renderResidVsFitPlot() {\n      const { residVsFit } = this.gofData;\n      const elementId = this.plotIds.residVsFit;\n      const { width, height } = this.getPlotDimensions(elementId);\n      const margin = { top: 10, right: 20, bottom: 30, left: 40 };\n\n      d3.select(`#${elementId}`).selectAll('*').remove();\n\n      const svg = d3.select(`#${elementId}`)\n        .append('svg')\n        .attr('width', width)\n        .attr('height', height);\n\n      const g = svg.append('g')\n        .attr('transform', `translate(${margin.left},${margin.top})`);\n\n      const innerWidth = width - margin.left - margin.right;\n      const innerHeight = height - margin.top - margin.bottom;\n\n      // Use eta (linear predictor) if available, fall back to fitted for backwards compatibility\n      const xData = residVsFit.eta || residVsFit.fitted;\n\n      const x = d3.scaleLinear()\n        .domain(d3.extent(xData))\n        .range([0, innerWidth]);\n\n      const y = d3.scaleLinear()\n        .domain(d3.extent(residVsFit.residuals))\n        .range([innerHeight, 0]);\n\n      // Horizontal reference line at y = 0\n      g.append('line')\n        .attr('x1', 0)\n        .attr('y1', y(0))\n        .attr('x2', innerWidth)\n        .attr('y2', y(0))\n        .attr('stroke', '#dc3545')\n        .attr('stroke-width', 1.5)\n        .attr('stroke-dasharray', '5,5');\n\n      // Points\n      const points = xData.map((val, i) => ({ x: val, y: residVsFit.residuals[i] }));\n      g.selectAll('circle')\n        .data(points)\n        .enter()\n        .append('circle')\n        .attr('cx', d => x(d.x))\n        .attr('cy', d => y(d.y))\n        .attr('r', 2)\n        .attr('fill', 'steelblue')\n        .attr('opacity', 0.5);\n\n      // Axes\n      g.append('g')\n        .attr('transform', `translate(0,${innerHeight})`)\n        .call(d3.axisBottom(x).ticks(5));\n\n      g.append('g')\n        .call(d3.axisLeft(y).ticks(5));\n    },\n    \n    renderHistogram() {\n      const { histogram } = this.gofData;\n      const elementId = this.plotIds.histogram;\n      const { width, height } = this.getPlotDimensions(elementId);\n      const margin = { top: 10, right: 20, bottom: 30, left: 40 };\n\n      d3.select(`#${elementId}`).selectAll('*').remove();\n\n      const svg = d3.select(`#${elementId}`)\n        .append('svg')\n        .attr('width', width)\n        .attr('height', height);\n\n      const g = svg.append('g')\n        .attr('transform', `translate(${margin.left},${margin.top})`);\n\n      const innerWidth = width - margin.left - margin.right;\n      const innerHeight = height - margin.top - margin.bottom;\n\n      // Support both old format (breaks/counts) and new format (xmin/xmax/count)\n      let bins, xDomain, counts;\n      if (histogram.xmin && histogram.xmax) {\n        // New format from gratia-style extraction\n        bins = histogram.xmin.map((xmin, i) => ({\n          x0: xmin,\n          x1: histogram.xmax[i],\n          count: histogram.count[i]\n        }));\n        xDomain = [histogram.xmin[0], histogram.xmax[histogram.xmax.length - 1]];\n        counts = histogram.count;\n      } else {\n        // Old format with breaks/counts\n        bins = histogram.breaks.slice(0, -1).map((b, i) => ({\n          x0: b,\n          x1: histogram.breaks[i + 1],\n          count: histogram.counts[i]\n        }));\n        xDomain = [histogram.breaks[0], histogram.breaks[histogram.breaks.length - 1]];\n        counts = histogram.counts;\n      }\n\n      const x = d3.scaleLinear()\n        .domain(xDomain)\n        .range([0, innerWidth]);\n\n      const y = d3.scaleLinear()\n        .domain([0, d3.max(counts)])\n        .range([innerHeight, 0]);\n\n      // Bars\n      g.selectAll('rect')\n        .data(bins)\n        .enter()\n        .append('rect')\n        .attr('x', d => x(d.x0) + 1)\n        .attr('width', d => Math.max(0, x(d.x1) - x(d.x0) - 1))\n        .attr('y', d => y(d.count))\n        .attr('height', d => innerHeight - y(d.count))\n        .attr('fill', 'steelblue')\n        .attr('opacity', 0.7);\n\n      // Axes\n      g.append('g')\n        .attr('transform', `translate(0,${innerHeight})`)\n        .call(d3.axisBottom(x).ticks(5));\n\n      g.append('g')\n        .call(d3.axisLeft(y).ticks(5));\n    },\n    \n    renderObsVsFitPlot() {\n      const { obsVsFit } = this.gofData;\n      const elementId = this.plotIds.obsVsFit;\n      const { width, height } = this.getPlotDimensions(elementId);\n      const margin = { top: 10, right: 20, bottom: 30, left: 40 };\n      \n      d3.select(`#${elementId}`).selectAll('*').remove();\n      \n      const svg = d3.select(`#${elementId}`)\n        .append('svg')\n        .attr('width', width)\n        .attr('height', height);\n      \n      const g = svg.append('g').attr('transform', `translate(${margin.left},${margin.top})`);\n      \n      const innerWidth = width - margin.left - margin.right;\n      const innerHeight = height - margin.top - margin.bottom;\n      \n      const allVals = [...obsVsFit.fitted, ...obsVsFit.observed];\n      const extent = d3.extent(allVals);\n      \n      const x = d3.scaleLinear()\n        .domain(extent)\n        .range([0, innerWidth]);\n      \n      const y = d3.scaleLinear()\n        .domain(extent)\n        .range([innerHeight, 0]);\n      \n      // Reference line (y = x)\n      g.append('line')\n        .attr('x1', x(extent[0]))\n        .attr('y1', y(extent[0]))\n        .attr('x2', x(extent[1]))\n        .attr('y2', y(extent[1]))\n        .attr('stroke', '#dc3545')\n        .attr('stroke-width', 1.5)\n        .attr('stroke-dasharray', '5,5');\n      \n      // Points\n      const points = obsVsFit.fitted.map((f, i) => ({ x: f, y: obsVsFit.observed[i] }));\n      g.selectAll('circle')\n        .data(points)\n        .enter()\n        .append('circle')\n        .attr('cx', d => x(d.x))\n        .attr('cy', d => y(d.y))\n        .attr('r', 2)\n        .attr('fill', 'steelblue')\n        .attr('opacity', 0.5);\n      \n      // Axes\n      g.append('g')\n        .attr('transform', `translate(0,${innerHeight})`)\n        .call(d3.axisBottom(x).ticks(5));\n      \n      g.append('g')\n        .call(d3.axisLeft(y).ticks(5));\n    }\n  }\n});\n</script>\n\n<style scoped>\n.gof-diagnostics {\n  --color-primary: #2563eb;\n  --color-text: #1e293b;\n  --color-text-muted: #64748b;\n  --color-border: #e2e8f0;\n  --color-border-light: #f1f5f9;\n  --color-bg: #ffffff;\n  --color-bg-subtle: #f8fafc;\n  --radius-sm: 0.375rem;\n  --radius-md: 0.625rem;\n  --radius-lg: 0.875rem;\n  --transition-fast: 0.15s ease;\n\n  margin-top: 1.5rem;\n  background: var(--color-bg-subtle);\n  border: 1px solid var(--color-border);\n  border-radius: var(--radius-lg);\n  overflow: hidden;\n}\n\n.gof-header {\n  display: flex;\n  justify-content: space-between;\n  align-items: center;\n  padding: 0.75rem 1rem;\n  border-bottom: 1px solid var(--color-border-light);\n}\n\n.gof-title-group {\n  display: flex;\n  align-items: center;\n  gap: 0.5rem;\n  color: var(--color-text-muted);\n}\n\n.gof-title {\n  margin: 0;\n  font-size: 0.9375rem;\n  font-weight: 600;\n  color: var(--color-text);\n}\n\n.btn-ghost {\n  padding: 0.25rem 0.75rem;\n  font-size: 0.8125rem;\n  font-weight: 500;\n  color: var(--color-text-muted);\n  background: transparent;\n  border: 1px solid var(--color-border);\n  border-radius: var(--radius-sm);\n  cursor: pointer;\n  transition: all var(--transition-fast);\n}\n\n.btn-ghost:hover {\n  color: var(--color-text);\n  background: var(--color-bg);\n  border-color: var(--color-text-muted);\n}\n\n.gof-content {\n  padding: 1rem;\n  background: var(--color-bg);\n}\n\n/* Stats Summary */\n.stats-summary {\n  padding: 0.75rem;\n  background: var(--color-bg);\n  border: 1px solid var(--color-border-light);\n  border-radius: var(--radius-md);\n  margin-bottom: 1rem;\n}\n\n.stats-row {\n  display: grid;\n  grid-template-columns: repeat(4, 1fr);\n  gap: 0.5rem;\n  text-align: center;\n}\n\n@media (max-width: 575px) {\n  .stats-row {\n    grid-template-columns: repeat(2, 1fr);\n  }\n}\n\n.stat-key {\n  display: block;\n  font-size: 0.6875rem;\n  font-weight: 600;\n  text-transform: uppercase;\n  letter-spacing: 0.03em;\n  color: var(--color-text-muted);\n  margin-bottom: 0.125rem;\n}\n\n.stat-val {\n  font-size: 0.8125rem;\n  font-weight: 500;\n  color: var(--color-text);\n}\n\n/* Plots Grid */\n.plots-grid {\n  display: grid;\n  grid-template-columns: repeat(2, 1fr);\n  gap: 0.75rem;\n}\n\n@media (max-width: 767px) {\n  .plots-grid {\n    grid-template-columns: 1fr;\n  }\n}\n\n.plot-card {\n  background: var(--color-bg);\n  border: 1px solid var(--color-border);\n  border-radius: var(--radius-md);\n  overflow: hidden;\n}\n\n.plot-card-header {\n  padding: 0.5rem 0.75rem;\n  font-size: 0.75rem;\n  font-weight: 600;\n  color: var(--color-text-muted);\n  background: var(--color-bg-subtle);\n  border-bottom: 1px solid var(--color-border-light);\n}\n\n.plot-card-body {\n  padding: 0.75rem;\n}\n\n.gof-plot {\n  width: 100%;\n  height: 200px;\n  background: var(--color-bg);\n}\n\n.plot-hint {\n  display: block;\n  font-size: 0.6875rem;\n  color: var(--color-text-muted);\n  margin-top: 0.375rem;\n  line-height: 1.4;\n}\n\n/* Info Banner */\n.info-banner {\n  padding: 0.75rem 1rem;\n  margin: 1rem;\n  font-size: 0.875rem;\n  color: #0c4a6e;\n  background: rgba(8, 145, 178, 0.08);\n  border: 1px solid rgba(8, 145, 178, 0.2);\n  border-radius: var(--radius-sm);\n}\n</style>\n","import { render } from \"./GofDiagnostics.vue?vue&type=template&id=48a0842a&scoped=true\"\nimport script from \"./GofDiagnostics.vue?vue&type=script&lang=js\"\nexport * from \"./GofDiagnostics.vue?vue&type=script&lang=js\"\n\nimport \"./GofDiagnostics.vue?vue&type=style&index=0&id=48a0842a&scoped=true&lang=css\"\n\nimport exportComponent from \"/home/s/PycharmProjects/batdemo/myvue/node_modules/vue-loader/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['render',render],['__scopeId',\"data-v-48a0842a\"]])\n\nexport default __exports__","import { render } from \"./TcMore.vue?vue&type=template&id=127eb84e&scoped=true\"\nimport script from \"./TcMore.vue?vue&type=script&lang=js\"\nexport * from \"./TcMore.vue?vue&type=script&lang=js\"\n\nimport \"./TcMore.vue?vue&type=style&index=0&id=127eb84e&scoped=true&lang=css\"\n\nimport exportComponent from \"/home/s/PycharmProjects/batdemo/myvue/node_modules/vue-loader/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['render',render],['__scopeId',\"data-v-127eb84e\"]])\n\nexport default __exports__","<template>\n  <div class=\"inla-components\">\n    <h3 class=\"ic-title\">{{ $t('trends.inla.componentsTitle') }}</h3>\n    <p class=\"ic-intro\">{{ $t('trends.inla.componentsIntro') }}</p>\n    <div class=\"ic-cols\">\n      <div class=\"ic-col\" v-for=\"col in columns\" :key=\"col.part\">\n        <div class=\"ic-col-head\">\n          <span class=\"ic-num\">{{ col.part }}</span>\n          <span class=\"ic-name\">{{ col.name }}</span>\n          <span class=\"ic-sub\">{{ col.sub }}</span>\n        </div>\n        <div v-if=\"showPartSites\" class=\"ic-sites\">\n          {{ $tc('trends.inla.partSites', {n: siteStats[col.statKey]}) }}\n        </div>\n        <div class=\"ic-trend\" :id=\"col.trendId\"></div>\n        <InlaSpatialMap :spatial=\"plot.spatial\" :fixed-part=\"col.part\" :labels=\"mapLabels\" />\n      </div>\n    </div>\n  </div>\n</template>\n\n<script>\nimport { defineComponent } from 'vue';\nimport { MyD3 } from '@/lib/myd3/MyD3';\nimport { inlaTrendToTraces, RAW_SCALE_PANEL_OPTIONS } from '@/lib/inla/inlaTrendToTraces';\nimport InlaSpatialMap from '@/components/account/admin/InlaSpatialMap.vue';\n\nexport default defineComponent({\n  name: 'InlaComponentCard',\n  components: { InlaSpatialMap },\n  props: {\n    plot: { type: Object, required: true },\n    siteStats: { type: Object, default: null },\n  },\n  computed: {\n    // p0/p1/p2 are the component panels; part 1/2/3 aligns them with the spatial map parts.\n    columns() {\n      return [\n        { part: 1, key: 'p0', trendId: 'divInlaTrend1', statKey: 'nb_sites',\n          name: this.$t('trends.inla.part1Name'), sub: this.$t('trends.inla.part1Sub') },\n        { part: 2, key: 'p1', trendId: 'divInlaTrend2', statKey: 'nb_sites_positive',\n          name: this.$t('trends.inla.part2Name'), sub: this.$t('trends.inla.part2Sub') },\n        { part: 3, key: 'p2', trendId: 'divInlaTrend3', statKey: 'nb_sites_multi',\n          name: this.$t('trends.inla.part3Name'), sub: this.$t('trends.inla.part3Sub') },\n      ];\n    },\n    // Only shown for data from an import that records complete surveys; for an\n    // ordinary dataset all three numbers would just repeat the summary sentence.\n    showPartSites() {\n      return !!(this.siteStats && this.siteStats.has_complete_survey);\n    },\n    mapLabels() {\n      return {\n        partLabel: this.$t('trends.inla.map.partLabel'),\n        note: this.$t('trends.inla.map.note'),\n        tkPrefix: this.$t('trends.inla.map.tkPrefix'),\n        noPosterior: this.$t('trends.inla.map.noPosterior'),\n        crInterval: this.$t('trends.inla.map.crInterval'),\n        rawEta: this.$t('trends.inla.map.rawEta'),\n        parts: [\n          { name: this.$t('trends.inla.part1Name'), sub: this.$t('trends.inla.part1Sub') },\n          { name: this.$t('trends.inla.part2Name'), sub: this.$t('trends.inla.part2Sub') },\n          { name: this.$t('trends.inla.part3Name'), sub: this.$t('trends.inla.part3Sub') },\n        ],\n      };\n    },\n  },\n  watch: {\n    plot() { this.$nextTick(this.renderTrends); },\n  },\n  mounted() {\n    this.$nextTick(this.renderTrends);\n  },\n  methods: {\n    renderTrends() {\n      const panels = this.plot && this.plot.trend && this.plot.trend.panels;\n      if (!panels) { return; }\n      for (const col of this.columns) {\n        const panel = panels[col.key];\n        if (!panel) { continue; }\n        const pd = inlaTrendToTraces(panel);\n        new MyD3(col.trendId, pd, { ...RAW_SCALE_PANEL_OPTIONS, ttShowSignificance: true, showGridlines: true }, this.$tc).draw();\n      }\n    },\n  },\n});\n</script>\n\n<style scoped>\n.inla-components {\n  margin-top: 0.5rem;\n  padding: 1.1rem 1.2rem 1.35rem;\n  border: 1px solid #e2e8f0;\n  border-radius: 0.85rem;\n  background: #fff;\n}\n.ic-title {\n  margin: 0 0 0.15rem;\n  font-size: 1.02rem;\n  font-weight: 700;\n  color: #1e293b;\n}\n.ic-intro {\n  margin: 0 0 1.1rem;\n  font-size: 0.82rem;\n  line-height: 1.4;\n  color: #64748b;\n  max-width: 60ch;\n}\n.ic-cols {\n  display: grid;\n  grid-template-columns: repeat(3, 1fr);\n  gap: 1.4rem;\n}\n@media (max-width: 991.98px) {\n  .ic-cols { grid-template-columns: 1fr; }\n}\n.ic-col-head {\n  display: flex;\n  align-items: baseline;\n  gap: 0.4rem;\n  margin-bottom: 0.45rem;\n  padding-bottom: 0.45rem;\n  border-bottom: 1px solid #eef2f7;\n}\n.ic-num {\n  align-self: center;\n  display: inline-flex;\n  align-items: center;\n  justify-content: center;\n  width: 1.15rem;\n  height: 1.15rem;\n  border-radius: 999px;\n  background: rgba(37, 99, 235, 0.12);\n  color: #2563eb;\n  font-size: 0.7rem;\n  font-weight: 700;\n}\n.ic-name { font-size: 0.9rem; font-weight: 600; color: #1e293b; }\n.ic-sub { font-size: 0.75rem; color: #64748b; }\n.ic-sites { margin: -0.2rem 0 0.5rem; font-size: 0.78rem; font-weight: 600; color: #475569; }\n.ic-trend { width: 100%; min-height: 220px; margin-bottom: 0.6rem; position: relative; }\n</style>\n","<template>\n  <div class=\"inla-map-wrap\">\n    <div class=\"inla-map-controls\">\n      <label class=\"inla-map-label\" v-if=\"!fixedPart\">{{ txt.partLabel }}</label>\n      <div class=\"inla-seg\" v-if=\"!fixedPart\">\n        <button\n          v-for=\"p in partMeta\" :key=\"p.num\" type=\"button\"\n          class=\"inla-seg-btn\" :class=\"{ active: part === p.num }\"\n          @click=\"part = p.num\">\n          <span class=\"inla-seg-num\">{{ p.num }}</span>{{ p.name }}\n        </button>\n      </div>\n      <span class=\"inla-map-note\">{{ txt.note }}</span>\n    </div>\n\n    <div class=\"inla-map-frame\">\n      <div ref=\"map\" class=\"inla-map\"></div>\n      <div class=\"inla-map-legend\" v-if=\"legend.length\">\n        <span class=\"legend-title\">{{ activePart.name }} · {{ activePart.sub }}</span>\n        <div class=\"legend-scale\">\n          <span v-for=\"(c, i) in legend\" :key=\"i\" class=\"legend-swatch\" :style=\"{ background: c }\"></span>\n        </div>\n        <div class=\"legend-ends\"><span>{{ fmt(domainMin) }}</span><span>{{ fmt(domainMax) }}</span></div>\n      </div>\n    </div>\n\n    <Teleport to=\"body\">\n      <div ref=\"tip\" class=\"inla-map-tip\" style=\"display:none\"></div>\n    </Teleport>\n  </div>\n</template>\n\n<script>\nimport { defineComponent } from 'vue';\nimport * as d3 from 'd3';\nimport L from 'leaflet';\nimport 'leaflet/dist/leaflet.css';\nimport MyBase from '@/components/account/MyBase.vue';\nimport { ApiCommunication, ApiRequestBuilder } from '@/lib/ApiCom';\nimport { inverseLinkForPart } from '@/lib/inla/inverseLink';\nimport { placeTip } from '@/components/account/dashboard/tooltip';\n\nconst PART_META = [\n  { num: 1, name: 'Occupancy', sub: 'P(present)' },\n  { num: 2, name: 'Conditional', sub: 'P(>1 | present)' },\n  { num: 3, name: 'Group size', sub: 'count | >1' },\n];\n\n// Public plotter endpoint. tk25_geo is served here (bats/plotter/api.py) without an\n// is_staff gate, so this works on the anonymous /trends page as well as in admin.\nconst GeoCom = new ApiCommunication('/api_plot');\n\nexport default defineComponent({\n  extends: MyBase,\n  name: 'InlaSpatialMap',\n  props: {\n    spatial: { type: Object, required: true },   // plot.spatial: {part1,part2,part3,car_index_to_tk25}\n    fixedPart: { type: Number, default: null },  // 1|2|3 pins one part (public); null = 3-way selector (admin)\n    labels: { type: Object, default: null },     // i18n strings (public); null = English literals (admin)\n  },\n  data() {\n    return { map: null, geoLayer: null, features: [], resizeObserver: null,\n             part: this.fixedPart || 1, legend: [], domainMin: 0, domainMax: 1 };\n  },\n  computed: {\n    // Merge optional i18n labels over the English defaults so admin (labels=null) is unchanged.\n    partMeta() {\n      const L = this.labels;\n      if (!L || !L.parts) { return PART_META; }\n      return PART_META.map((p, i) => ({\n        num: p.num,\n        name: (L.parts[i] && L.parts[i].name) || p.name,\n        sub: (L.parts[i] && L.parts[i].sub) || p.sub,\n      }));\n    },\n    txt() {\n      const L = this.labels || {};\n      return {\n        partLabel: L.partLabel || 'Hurdle part',\n        note: L.note || 'colour = posterior mean, response scale',\n        tkPrefix: L.tkPrefix || 'TK25',\n        noPosterior: L.noPosterior || 'no posterior for this sheet',\n        crInterval: L.crInterval || '95% CrI',\n        rawEta: L.rawEta || 'raw η',\n      };\n    },\n    activePart() { return this.partMeta[this.part - 1]; },\n    // sheet number -> { value (response scale), row (raw), ciLow, ciHigh } for the selected part.\n    dataBySheet() {\n      const rows = this.spatial['part' + this.part] || [];\n      const link = inverseLinkForPart(this.part);\n      const c2t = this.spatial.car_index_to_tk25 || {};\n      const out = {};\n      for (const r of rows) {\n        const sheet = c2t[String(r.ID)];\n        if (sheet === undefined || !Number.isFinite(r.mean)) continue;\n        out[sheet] = {\n          value: link(r.mean),\n          ciLow: Number.isFinite(r.QL) ? link(r.QL) : undefined,\n          ciHigh: Number.isFinite(r.QH) ? link(r.QH) : undefined,\n          row: r,\n        };\n      }\n      return out;\n    },\n  },\n  watch: {\n    part() { this.renderLayer(); },\n    spatial() { this.fetchGeometry(); },\n    fixedPart(v) { if (v) { this.part = v; } },\n  },\n  mounted() {\n    this.map = L.map(this.$refs.map, {\n      zoomControl: false, attributionControl: false,\n      scrollWheelZoom: false, dragging: false, doubleClickZoom: false,\n      keyboard: false, touchZoom: false, boxZoom: false,\n      zoomAnimation: false, fadeAnimation: false, markerZoomAnimation: false,\n    }).setView([49.0, 11.5], 6);\n    // The container can still be unsized here (hidden parent, stylesheet in flight):\n    // Leaflet caches a 0x0 size, fitBounds then computes a NaN zoom and every\n    // projection after it yields \"Invalid LatLng object: (NaN, NaN)\". Re-measure and\n    // re-fit on the first resize that gives the container real dimensions.\n    if (typeof ResizeObserver !== 'undefined') {\n      this.resizeObserver = new ResizeObserver(() => this.refitMap());\n      this.resizeObserver.observe(this.$refs.map);\n    }\n    this.fetchGeometry();\n  },\n  beforeUnmount() {\n    if (this.resizeObserver) { this.resizeObserver.disconnect(); this.resizeObserver = null; }\n    if (this.map) this.map.remove();\n  },\n  methods: {\n    fmt(v) { return (v === undefined || v === null || !Number.isFinite(v)) ? 'n/a' : v.toFixed(3); },\n    fetchGeometry() {\n      const sheets = Object.values(this.spatial.car_index_to_tk25 || {});\n      const rb = new ApiRequestBuilder();\n      rb.addAction('tk25_geo', { sheets });\n      // Post to the public plotter endpoint; pass `this` only for ApiCom's spinner bookkeeping.\n      GeoCom.post(this, rb.build(),\n        (json) => {\n          this.features = json.geo || [];\n          this.renderLayer();\n        },\n        () => { this.features = []; this.renderLayer(); });\n    },\n    colorScale() {\n      const vals = Object.values(this.dataBySheet).map(d => d.value);\n      this.domainMin = d3.min(vals);\n      this.domainMax = d3.max(vals);\n      if (this.domainMin === undefined) { this.domainMin = 0; this.domainMax = 1; }\n      return d3.scaleSequential(d3.interpolateViridis).domain([this.domainMin, this.domainMax]);\n    },\n    styleFor(sheet, scale) {\n      const d = this.dataBySheet[sheet];\n      return {\n        fillColor: d === undefined ? '#eef2f7' : scale(d.value),\n        fillOpacity: 0.85, weight: 0.5, color: '#94a3b8',\n      };\n    },\n    renderLayer() {\n      if (!this.map) return;\n      if (this.geoLayer) { this.geoLayer.remove(); this.geoLayer = null; }\n      if (!this.features.length) { this.legend = []; return; }\n      const scale = this.colorScale();\n      const fc = {\n        type: 'FeatureCollection',\n        features: this.features.map(f => ({\n          type: 'Feature', properties: { id: f.id, name: f.name }, geometry: f.geometry,\n        })),\n      };\n      this.geoLayer = L.geoJSON(fc, {\n        style: (feat) => this.styleFor(feat.properties.id, scale),\n        onEachFeature: (feat, layer) => {\n          layer.on('mouseover', (e) => { layer.setStyle({ weight: 2, color: '#1e293b' }); this.showTip(feat, e.originalEvent); });\n          layer.on('mousemove', (e) => this.showTip(feat, e.originalEvent));\n          layer.on('mouseout', () => { if (this.geoLayer) this.geoLayer.resetStyle(layer); this.hideTip(); });\n        },\n      }).addTo(this.map);\n      this.refitMap();\n      this.legend = d3.range(0, 1.0001, 0.2).map(t => scale(this.domainMin + t * (this.domainMax - this.domainMin)));\n    },\n    /**\n     * Re-measure the container and re-frame the layer. Recovers a map that was built\n     * at zero size — invalidateSize() replaces Leaflet's cached size and the refit\n     * then computes a real zoom over the NaN one fitBounds produced.\n     */\n    refitMap() {\n      if (!this.map || !this.geoLayer) return;\n      const el = this.$refs.map;\n      if (!el || !el.clientWidth || !el.clientHeight) return;\n      this.map.invalidateSize();\n      try { this.map.fitBounds(this.geoLayer.getBounds(), { padding: [8, 8] }); } catch (e) { /* empty */ }\n    },\n    showTip(feat, event) {\n      const tip = this.$refs.tip; if (!tip || !event) return;\n      const sheet = feat.properties.id;\n      const d = this.dataBySheet[sheet];\n      const p = this.activePart;\n      const head = `<div class=\"mt-name\">${this.txt.tkPrefix} ${sheet}</div>` +\n        `<div class=\"mt-sub\"><span class=\"mt-num\">${p.num}</span>${p.name} · ${p.sub}</div>`;\n      let body;\n      if (d === undefined) {\n        body = `<div class=\"mt-empty\">${this.txt.noPosterior}</div>`;\n      } else {\n        const ci = (d.ciLow !== undefined && d.ciHigh !== undefined)\n          ? `<div class=\"mt-row\"><span>${this.txt.crInterval}</span><b>${this.fmt(d.ciLow)} – ${this.fmt(d.ciHigh)}</b></div>` : '';\n        const sd = Number.isFinite(d.row.sd)\n          ? `<div class=\"mt-row\"><span>${this.txt.rawEta}</span><b>${d.row.mean.toFixed(2)} ± ${d.row.sd.toFixed(2)}</b></div>` : '';\n        body = `<div class=\"mt-val\">${this.fmt(d.value)}</div>` +\n          `<div class=\"mt-rows\">${ci}${sd}</div>`;\n      }\n      tip.innerHTML = head + body;\n      tip.style.display = 'block';\n      placeTip(tip, event);\n    },\n    hideTip() { if (this.$refs.tip) this.$refs.tip.style.display = 'none'; },\n  },\n});\n</script>\n\n<style scoped>\n.inla-map-wrap {\n  --color-primary: #2563eb;\n  --color-text: #1e293b;\n  --color-text-muted: #64748b;\n  --color-border: #e2e8f0;\n  position: relative;\n  width: 100%;\n}\n\n/* ---------- Controls ---------- */\n.inla-map-controls {\n  display: flex;\n  align-items: center;\n  flex-wrap: wrap;\n  gap: 0.6rem;\n  margin-bottom: 0.7rem;\n}\n.inla-map-label {\n  font-size: 0.6875rem;\n  font-weight: 700;\n  text-transform: uppercase;\n  letter-spacing: 0.08em;\n  color: var(--color-text-muted);\n}\n.inla-seg {\n  display: inline-flex;\n  border: 1px solid var(--color-border);\n  border-radius: 0.5rem;\n  overflow: hidden;\n  background: #fff;\n}\n.inla-seg-btn {\n  display: inline-flex;\n  align-items: center;\n  gap: 0.35rem;\n  border: none;\n  background: transparent;\n  padding: 0.3rem 0.6rem;\n  font-size: 0.78rem;\n  color: var(--color-text-muted);\n  cursor: pointer;\n  transition: background 0.15s ease, color 0.15s ease;\n}\n.inla-seg-btn + .inla-seg-btn { border-left: 1px solid var(--color-border); }\n.inla-seg-btn:hover { background: #f1f5f9; color: var(--color-text); }\n.inla-seg-btn.active { background: var(--color-primary); color: #fff; }\n.inla-seg-num {\n  display: inline-flex;\n  align-items: center;\n  justify-content: center;\n  width: 1.05rem;\n  height: 1.05rem;\n  border-radius: 999px;\n  background: rgba(37, 99, 235, 0.12);\n  color: var(--color-primary);\n  font-size: 0.68rem;\n  font-weight: 700;\n}\n.inla-seg-btn.active .inla-seg-num { background: rgba(255, 255, 255, 0.25); color: #fff; }\n.inla-map-note { color: var(--color-text-muted); font-size: 0.72rem; margin-left: auto; }\n\n/* ---------- Map ---------- */\n.inla-map-frame { position: relative; }\n.inla-map {\n  width: 100%;\n  height: 460px;\n  border-radius: 0.75rem;\n  background: #f8fafc;\n  border: 1px solid var(--color-border);\n}\n.inla-map-legend {\n  position: absolute; bottom: 12px; right: 12px; z-index: 500;\n  background: rgba(255, 255, 255, 0.94); padding: 0.45rem 0.6rem;\n  border: 1px solid var(--color-border); border-radius: 0.5rem;\n  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.12);\n  font-size: 0.68rem; color: var(--color-text-muted);\n}\n.legend-title { display: block; margin-bottom: 0.28rem; font-weight: 600; color: var(--color-text); }\n.legend-scale { display: flex; border-radius: 3px; overflow: hidden; }\n.legend-swatch { width: 24px; height: 9px; }\n.legend-ends { display: flex; justify-content: space-between; margin-top: 0.18rem; font-variant-numeric: tabular-nums; }\n\n/* ---------- Tooltip (dark card, matches the dashboard maps) ---------- */\n.inla-map-tip {\n  position: fixed; pointer-events: none; z-index: 1000;\n  background: rgba(15, 23, 42, 0.95); color: #fff; border-radius: 0.6rem;\n  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.32); padding: 0.55rem 0.7rem;\n  font-size: 0.76rem; min-width: 140px;\n}\n.inla-map-tip :deep(.mt-name) { font-weight: 700; font-size: 0.85rem; }\n.inla-map-tip :deep(.mt-sub) {\n  display: flex; align-items: center; gap: 0.3rem;\n  opacity: 0.72; font-size: 0.68rem; margin-bottom: 0.35rem;\n}\n.inla-map-tip :deep(.mt-num),\n.inla-map-tip :deep(.mt-val) { font-variant-numeric: tabular-nums; }\n.inla-map-tip :deep(.mt-num) {\n  display: inline-flex; align-items: center; justify-content: center;\n  width: 1rem; height: 1rem; border-radius: 999px;\n  background: rgba(255, 255, 255, 0.16); font-size: 0.62rem; font-weight: 700;\n}\n.inla-map-tip :deep(.mt-val) { font-size: 1.05rem; font-weight: 700; letter-spacing: -0.01em; }\n.inla-map-tip :deep(.mt-rows) {\n  margin-top: 0.35rem; padding-top: 0.3rem;\n  border-top: 1px solid rgba(255, 255, 255, 0.15); display: grid; gap: 0.15rem;\n}\n.inla-map-tip :deep(.mt-row) {\n  display: flex; justify-content: space-between; gap: 1.2rem; font-variant-numeric: tabular-nums;\n}\n.inla-map-tip :deep(.mt-row span) { opacity: 0.72; }\n.inla-map-tip :deep(.mt-empty) { opacity: 0.72; font-style: italic; }\n</style>\n","import script from \"./MyBase.vue?vue&type=script&lang=js\"\nexport * from \"./MyBase.vue?vue&type=script&lang=js\"\n\nconst __exports__ = script;\n\nexport default __exports__","<script>\nimport {defineComponent} from 'vue';\nimport {useAccountStore} from \"@/store/account\";\n\nexport default defineComponent({\n  data: function (){\n    return {\n      mStore: null,\n    }\n  },\n  // mounted: function() {\n  //   return;\n  // },\n  methods: {\n    _getStore() {\n      if (!this.mStore){\n        this.mStore = useAccountStore();\n      }\n      return this.mStore;\n    },\n  },\n  computed: {\n    store: function () {\n      return this._getStore();\n    },\n    accountComponent: function () {\n      return this.store.accountComponent;\n    },\n    user: function () {\n      return this.store.user;\n    },\n  }\n});\n</script>\n","// Inverse links applied client-side to the raw linear predictor emitted per spatial part.\nexport function plogis(x: number): number {\n    return 1 / (1 + Math.exp(-x));\n}\nexport function expLink(x: number): number {\n    return Math.exp(x);\n}\nexport function inverseLinkForPart(part: 1 | 2 | 3): (x: number) => number {\n    return part === 3 ? expLink : plogis;\n}\n","// Shared positioning for the dashboard chart tooltips (.chart-tip).\n//\n// The tooltips live inside .section-card, which uses `overflow: hidden`, so an\n// absolutely-positioned tip gets clipped the moment it reaches a card edge.\n// These tips are therefore `position: fixed` (escaping the card clip) and placed\n// against the viewport here, flipping to the other side of the cursor and\n// clamping to the screen so the tip is always fully visible — even near an edge\n// or when it is large.\n//\n// The tip element must already be visible with its content set before calling\n// (so offsetWidth / offsetHeight reflect the rendered size).\nexport function placeTip(tip, event, gap = 14) {\n  if (!tip) return;\n  const tw = tip.offsetWidth;\n  const th = tip.offsetHeight;\n  const vw = window.innerWidth;\n  const vh = window.innerHeight;\n  const pad = 8; // keep this far from the viewport edge\n\n  // Prefer below-right of the cursor; flip to the other side if it would overflow.\n  let left = event.clientX + gap;\n  if (left + tw + pad > vw) left = event.clientX - gap - tw;\n  left = Math.min(Math.max(left, pad), Math.max(pad, vw - tw - pad));\n\n  let top = event.clientY + gap;\n  if (top + th + pad > vh) top = event.clientY - gap - th;\n  top = Math.min(Math.max(top, pad), Math.max(pad, vh - th - pad));\n\n  tip.style.left = left + 'px';\n  tip.style.top = top + 'px';\n}\n","import { render } from \"./InlaSpatialMap.vue?vue&type=template&id=d32d9b0a&scoped=true\"\nimport script from \"./InlaSpatialMap.vue?vue&type=script&lang=js\"\nexport * from \"./InlaSpatialMap.vue?vue&type=script&lang=js\"\n\nimport \"./InlaSpatialMap.vue?vue&type=style&index=0&id=d32d9b0a&scoped=true&lang=css\"\n\nimport exportComponent from \"/home/s/PycharmProjects/batdemo/myvue/node_modules/vue-loader/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['render',render],['__scopeId',\"data-v-d32d9b0a\"]])\n\nexport default __exports__","import { render } from \"./InlaComponentCard.vue?vue&type=template&id=60138bb2&scoped=true\"\nimport script from \"./InlaComponentCard.vue?vue&type=script&lang=js\"\nexport * from \"./InlaComponentCard.vue?vue&type=script&lang=js\"\n\nimport \"./InlaComponentCard.vue?vue&type=style&index=0&id=60138bb2&scoped=true&lang=css\"\n\nimport exportComponent from \"/home/s/PycharmProjects/batdemo/myvue/node_modules/vue-loader/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['render',render],['__scopeId',\"data-v-60138bb2\"]])\n\nexport default __exports__","<template>\n  <div id=\"carouselSP\" class=\"carousel carousel-dark slide\" data-bs-ride=\"carousel\">\n    <div class=\"carousel-inner\">\n      <div class=\"carousel-item\" v-for=\"(page, key) in pages\" :key=\"key\" :class=\"{'active': key==0}\" data-bs-interval=\"false\">\n        <div class=\"preview-row\">\n          <div v-for=\"(spec, key) in page.imgs\" :key=\"key\" class=\"preview-item\" @click=\"clickSpecies(spec)\">\n            <SpeciesImage :img=\"spec.images[Math.floor(Math.random() * spec.images.length)]\" class=\"preview-image\" style=\"max-width: 224px;\" :bottom-bar-text=\"previewSpeciesHtml(spec)\" bottom-bar-class=\"preview-caption\"></SpeciesImage>\n          </div>\n        </div>\n      </div>\n    </div>\n\n    <div class=\"carousel-indicators\">\n<!--      <button class=\"\" type=\"button\" data-bs-target=\"#carouselSP\" data-bs-slide=\"prev\"></button>-->\n      <button type=\"button\" data-bs-target=\"#carouselSP\" data-bs-slide-to=\"0\" class=\"active\" aria-current=\"true\" aria-label=\"Slide 1\"></button>\n      <button v-for=\"(page, index) in pages.slice(1)\" :key=\"index\" type=\"button\" data-bs-target=\"#carouselSP\" :data-bs-slide-to=\"index + 1\" :aria-label=\"'Slide ' + (index+2)\"></button>\n<!--      <button class=\"\" type=\"button\" data-bs-target=\"#carouselSP\" data-bs-slide=\"prev\"></button>-->\n    </div>\n  </div>\n</template>\n\n<script>\nimport {defineComponent} from 'vue';\nimport MyBase from \"@/components/trends/MyBase.vue\";\nimport SpeciesImage from \"@/components/trends/cards/SpeciesImage.vue\";\n\nexport default defineComponent({\n  extends: MyBase,\n  name: 'SpeciesPreviewCarousel',\n  components: {SpeciesImage},\n  props: {\n    countTypes: Array\n  },\n  data: function (){\n    return {\n      pages: [],\n      width: 0\n    }\n  },\n  mounted: function() {\n    const pages = [];\n    const elm = document.getElementById('mainContainer');\n    // const countTypes = this.store.plotSettings.availableCountTypes;\n    const countTypes = this.countTypes;\n    if (elm) {\n      const computedStyles = window.getComputedStyle(elm);\n      const width = parseFloat(computedStyles.width);\n      this.width = width;\n      let nbPerRow = Math.floor(width / 224);\n      if (countTypes.length == 16 && nbPerRow > 4){\n        nbPerRow = 4;\n      }\n      const nbRows = Math.ceil(countTypes.length / nbPerRow);\n      console.log(\"mounted\", width, nbPerRow, nbRows, countTypes.length);\n      for (let i = 0; i < nbRows; i++) {\n      // console.log(i, nbRows);\n        const imgs = countTypes.slice(i * nbPerRow, (i + 1) * nbPerRow);\n        pages.push({\n          imgs\n        });\n      }\n    }\n    this.pages = pages;\n  },\n  methods: {\n    previewSpeciesHtml: function (spec){\n      // return `<em>${spec.latin}</em><div class=\"fs-6\">${this.capitalizeAll(spec.name)}</div>`;\n      return `<em>${spec.latin}</em>`;\n      // return <em>' + spec.latin + '</em><span' + capitalizeAll(spec.name)\n    },\n    clickSpecies: function (spec){\n      this.$emit('selectSpecies', spec);\n    },\n  },\n});\n</script>\n\n<style scoped>\n.preview-row {\n  display: flex;\n  flex-direction: row;\n  justify-content: space-evenly;\n}\n\n.preview-item {\n  margin: 0.5rem;\n  cursor: pointer;\n  transition: transform 0.15s ease, box-shadow 0.15s ease;\n  border-radius: 0.625rem;\n}\n\n.preview-item:hover {\n  transform: translateY(-2px);\n  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);\n}\n\n.preview-image {\n  margin-bottom: 0.75rem;\n}\n\ndiv.carousel-indicators {\n  position: relative;\n}\n\ndiv.carousel-indicators button {\n  width: 20px;\n  height: 20px;\n  border-radius: 50%;\n  background-color: #94a3b8;\n  border: none;\n  padding: 0;\n  cursor: pointer;\n  transition: background-color 0.15s ease;\n}\n\ndiv.carousel-indicators button.active {\n  background-color: #2563eb;\n}\n</style>\n","import { render } from \"./SpeciesPreviewCarousel.vue?vue&type=template&id=7aaed9e4&scoped=true\"\nimport script from \"./SpeciesPreviewCarousel.vue?vue&type=script&lang=js\"\nexport * from \"./SpeciesPreviewCarousel.vue?vue&type=script&lang=js\"\n\nimport \"./SpeciesPreviewCarousel.vue?vue&type=style&index=0&id=7aaed9e4&scoped=true&lang=css\"\n\nimport exportComponent from \"/home/s/PycharmProjects/batdemo/myvue/node_modules/vue-loader/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['render',render],['__scopeId',\"data-v-7aaed9e4\"]])\n\nexport default __exports__","<template>\n  <div class=\"trend-gam\">\n    <div v-if=\"! hasEnoughData\" :class=\"cssTrend(undefined)\" class=\"trend-row\">\n      <svg class=\"trend-icon\" :width=\"iconSizeLarge\" :height=\"iconSizeLarge\"><use xlink:href=\"#question-circle\"/></svg>\n      <div>{{ $t('trends.slope.Uncertain') }}<br>{{ $t('trends.plotError.generic_error') }}</div>\n    </div>\n    <div v-else>\n      <div v-for=\"(seg, key) in significantSegments\" :key=\"key\" class=\"trend-row\" :class=\"cssTrend(seg)\">\n        <svg class=\"trend-icon\" :width=\"iconSize\" :height=\"iconSize\"><use :xlink:href=\"svgTrend(seg)\"/></svg>\n        <div>{{ timespanText(seg) }}</div>\n      </div>\n    </div>\n  </div>\n</template>\n\n<script>\nimport {defineComponent} from 'vue';\nimport {MyD3} from \"@/lib/myd3/MyD3\";\n\nclass SignificantSegment {\n  yearStart = 0;\n  yearEnd = 0;\n  significance = 0;\n  constructor(trace, segment){\n    this.yearStart = Math.round(trace.items[segment.x0]?.data?.year);\n    this.yearEnd = Math.round(trace.items[segment.x1]?.data?.year || trace.items[trace.items.length - 1]?.data?.year);\n    this.significance = segment.significance;\n  }\n}\nexport default defineComponent({\n  name: 'TrendComponentGAM',\n  components: {},\n  props: {\n    plot: null,\n    hasEnoughData: {type: Boolean, default: true},\n    iconSizeLarge: {type: Number, default: 64},\n    iconSize: {type: Number, default: 16}\n  },\n  data: function (){\n    return {\n      pp: null,\n      significantSegments: [],\n      displayInsignificants: true,\n    }\n  },\n  mounted: function() {\n    if (this.plot){\n      this.updateFromPlot();\n    }\n\n  },\n  watch: {\n    plot: function(){\n      this.updateFromPlot();\n    }\n  },\n  methods: {\n    updateFromPlot: function(){\n      if (!this.plot){\n        this.pp = null;\n        this.significantSegments = [];\n        return;\n      }\n      this.pp = MyD3.getPreparedPlot(this.plot);\n      //  find the trace with a significance\n      let significantTrace = undefined;\n      for (const trace of this.pp.traces){\n        for (const itm of trace.items){\n          if (itm.data?.significance !== undefined){\n            significantTrace = trace;\n            break;\n          }\n        }\n        if (significantTrace) break;\n      }\n\n      const sigsegs = [];\n      if (significantTrace){\n        const segmentsRaw = MyD3.createSegmentsBySignificance(significantTrace);\n        const segments = MyD3.stripShortSignificantSegments(segmentsRaw, significantTrace);\n        // now find all the significant segments\n        for (const seg of segments){\n          if (this.displayInsignificants || seg.significance > 0){\n            sigsegs.push(new SignificantSegment(significantTrace, seg));\n          }\n        }\n      }\n      this.significantSegments = sigsegs;\n    },\n    cssTrend: function(seg){\n      const css = {};\n      if (! this.hasEnoughData){\n        css['trend-color-danger'] = true;\n      }\n      else{\n        const color = this.colorBySeg(seg);\n        css['trend-color-' + color] = true;\n      }\n      return css;\n    },\n\n    colorBySeg(seg){\n      if (! this.hasEnoughData || !seg){\n        return \"muted\";\n      }\n      if (seg.significance === 1){\n        return \"success\";\n      }\n      else if (seg.significance === 2){\n        return \"danger\";\n      }\n      else{\n        return \"muted\";\n      }\n    },\n\n    svgTrend: function(seg){\n      if (! this.hasEnoughData){\n        return \"#question-circle\";\n      }\n      if (seg.significance === 1){\n        return \"#arrow-up-right-circle\";\n      }\n      else if (seg.significance === 2){\n        return \"#arrow-down-right-circle\";\n      }\n      else{\n        return \"#arrow-right-circle\";\n      }\n    },\n\n    timespanText: function (seg){\n      if (seg.yearStart === seg.yearEnd) return `${seg.yearStart}`;\n      return `${seg.yearStart} - ${seg.yearEnd}`;\n    }\n  },\n});\n</script>\n\n<style scoped>\n.trend-row {\n  display: flex;\n  align-items: center;\n  gap: 0.5rem;\n  font-size: 0.875rem;\n  font-weight: 500;\n  line-height: 1.4;\n  padding: 0.125rem 0;\n}\n\n.trend-icon {\n  flex-shrink: 0;\n}\n\n.trend-color-success { color: #059669; }\n.trend-color-danger { color: #dc2626; }\n.trend-color-muted { color: #64748b; }\n</style>\n","import { render } from \"./TrendComponentGAM.vue?vue&type=template&id=1361b420&scoped=true\"\nimport script from \"./TrendComponentGAM.vue?vue&type=script&lang=js\"\nexport * from \"./TrendComponentGAM.vue?vue&type=script&lang=js\"\n\nimport \"./TrendComponentGAM.vue?vue&type=style&index=0&id=1361b420&scoped=true&lang=css\"\n\nimport exportComponent from \"/home/s/PycharmProjects/batdemo/myvue/node_modules/vue-loader/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['render',render],['__scopeId',\"data-v-1361b420\"]])\n\nexport default __exports__","import { render } from \"./Plots3.vue?vue&type=template&id=96e7337c&scoped=true\"\nimport script from \"./Plots3.vue?vue&type=script&lang=js\"\nexport * from \"./Plots3.vue?vue&type=script&lang=js\"\n\nimport \"./Plots3.vue?vue&type=style&index=0&id=96e7337c&scoped=true&lang=css\"\nimport \"./Plots3.vue?vue&type=style&index=1&id=96e7337c&lang=css\"\n\nimport exportComponent from \"/home/s/PycharmProjects/batdemo/myvue/node_modules/vue-loader/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['render',render],['__scopeId',\"data-v-96e7337c\"]])\n\nexport default __exports__","\nimport {defineComponent} from 'vue';\nimport PlotsThree from \"@/components/trends/Plots3.vue\";\n\nexport default defineComponent({\n  name: 'App',\n  components: {\n    PlotsThree,\n  },\n  data: function () {\n    return {\n      myView: \"\",\n    }\n  },\n  created() {\n    this.myView = document.getElementById(\"app\")?.getAttribute(\"my_view\") || \"plot\";\n  }\n});\n","import { render } from \"./App.vue?vue&type=template&id=1fb8d404&ts=true\"\nimport script from \"./App.vue?vue&type=script&lang=ts\"\nexport * from \"./App.vue?vue&type=script&lang=ts\"\n\nimport \"./App.vue?vue&type=style&index=0&id=1fb8d404&lang=css\"\n\nimport exportComponent from \"/home/s/PycharmProjects/batdemo/myvue/node_modules/vue-loader/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['render',render]])\n\nexport default __exports__","import {createApp} from 'vue'\nimport App from './App.vue'\nimport '@/assets/css/access-badges.css'\nimport {createPinia} from \"pinia\";\nimport {setupI18n} from \"@/account/i18n\";\n\ndeclare const vueI18n:any;\n// alert(vueI18n);\n\nconst pinia = createPinia()\nconst i18n = setupI18n(vueI18n)\nconst app = createApp(App)\napp.use(pinia)\napp.use(i18n)\n\napp.mount('#app')","import {nextTick} from 'vue'\nimport {createI18n, I18n} from 'vue-i18n'\n\n// export const SUPPORT_LOCALES = ['en', 'ja']\n\nexport function setupI18n(d: any) {\n    const html = document.querySelector('html');\n    let lang = 'en';\n    if (html){\n        lang = html.getAttribute('lang') || 'en';\n    }\n\n    if (d){\n        const messages: Record<string, any> = {};\n        messages[lang] = d;\n        const options = {\n            locale: lang,\n            messages\n        };\n        return createI18n(options);\n    }\n\n    const options = {\n        locale: lang\n    };\n    const i18n = createI18n(options);\n    setI18nLanguage(i18n, options.locale);\n    return i18n;\n}\n\nexport function setI18nLanguage(i18n: I18n, locale: string) {\n    if (i18n.mode === 'legacy') {\n        i18n.global.locale = locale;\n    } else {\n        // i18n.global.locale.value = locale\n    }\n    // /**\n    //  * NOTE:\n    //  * If you need to specify the language setting for headers, such as the `fetch` API, set it here.\n    //  * The following is an example for axios.\n    //  *\n    //  * axios.defaults.headers.common['Accept-Language'] = locale\n    //  */\n    // const html = document.querySelector('html');\n    // if (html)\n    //     html.setAttribute('lang', locale)\n    //\n    // {\n    //     // loadLocaleMessages(i18n, locale);\n    // }\n    loadLocaleMessages(i18n, locale);\n}\n\nexport async function loadLocaleMessages(i18n: any, locale: string) {\n    // load locale messages with dynamic import\n    const messages = await import(\n        /* webpackChunkName: \"locale-[request]\" */ `../locales/${locale}.json`\n        )\n\n    // set locale and locale message\n    i18n.global.setLocaleMessage(locale, messages.default)\n\n    return nextTick()\n}","var map = {\n\t\"./de.json\": [\n\t\t5894,\n\t\t706\n\t],\n\t\"./en.json\": [\n\t\t4174,\n\t\t990\n\t]\n};\nfunction webpackAsyncContext(req) {\n\tif(!__webpack_require__.o(map, req)) {\n\t\treturn Promise.resolve().then(function() {\n\t\t\tvar e = new Error(\"Cannot find module '\" + req + \"'\");\n\t\t\te.code = 'MODULE_NOT_FOUND';\n\t\t\tthrow e;\n\t\t});\n\t}\n\n\tvar ids = map[req], id = ids[0];\n\treturn __webpack_require__.e(ids[1]).then(function() {\n\t\treturn __webpack_require__.t(id, 3 | 16);\n\t});\n}\nwebpackAsyncContext.keys = function() { return Object.keys(map); };\nwebpackAsyncContext.id = 9842;\nmodule.exports = webpackAsyncContext;","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n// expose the modules object (__webpack_modules__)\n__webpack_require__.m = __webpack_modules__;\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = function(module) {\n\tvar getter = module && module.__esModule ?\n\t\tfunction() { return module['default']; } :\n\t\tfunction() { return module; };\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = function(exports, definition) {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.f = {};\n// This file contains only the entry chunk.\n// The chunk loading function for additional chunks\n__webpack_require__.e = function(chunkId) {\n\treturn Promise.all(Object.keys(__webpack_require__.f).reduce(function(promises, key) {\n\t\t__webpack_require__.f[key](chunkId, promises);\n\t\treturn promises;\n\t}, []));\n};","// This function allow to reference async chunks\n__webpack_require__.u = function(chunkId) {\n\t// return url for filenames based on template\n\treturn \"js/\" + {\"706\":\"locale-de-json\",\"990\":\"locale-en-json\"}[chunkId] + \".js\";\n};","// This function allow to reference async chunks\n__webpack_require__.miniCssF = function(chunkId) {\n\t// return url for filenames based on template\n\treturn undefined;\n};","__webpack_require__.g = (function() {\n\tif (typeof globalThis === 'object') return globalThis;\n\ttry {\n\t\treturn this || new Function('return this')();\n\t} catch (e) {\n\t\tif (typeof window === 'object') return window;\n\t}\n})();","__webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); }","// define __esModule on exports\n__webpack_require__.r = function(exports) {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","__webpack_require__.j = 667;","__webpack_require__.p = \"/static/src/vue/dist/\";","// no baseURI\n\n// object to store loaded and loading chunks\n// undefined = chunk not loaded, null = chunk preloaded/prefetched\n// [resolve, reject, Promise] = chunk loading, 0 = chunk loaded\nvar installedChunks = {\n\t667: 0\n};\n\n__webpack_require__.f.j = function(chunkId, promises) {\n\t\t// JSONP chunk loading for javascript\n\t\tvar installedChunkData = __webpack_require__.o(installedChunks, chunkId) ? installedChunks[chunkId] : undefined;\n\t\tif(installedChunkData !== 0) { // 0 means \"already installed\".\n\n\t\t\t// a Promise means \"currently loading\".\n\t\t\tif(installedChunkData) {\n\t\t\t\tpromises.push(installedChunkData[2]);\n\t\t\t} else {\n\t\t\t\tif(true) { // all chunks have JS\n\t\t\t\t\t// setup Promise in chunk cache\n\t\t\t\t\tvar promise = new Promise(function(resolve, reject) { installedChunkData = installedChunks[chunkId] = [resolve, reject]; });\n\t\t\t\t\tpromises.push(installedChunkData[2] = promise);\n\n\t\t\t\t\t// start chunk loading\n\t\t\t\t\tvar url = __webpack_require__.p + __webpack_require__.u(chunkId);\n\t\t\t\t\t// create error before stack unwound to get useful stacktrace later\n\t\t\t\t\tvar error = new Error();\n\t\t\t\t\tvar loadingEnded = function(event) {\n\t\t\t\t\t\tif(__webpack_require__.o(installedChunks, chunkId)) {\n\t\t\t\t\t\t\tinstalledChunkData = installedChunks[chunkId];\n\t\t\t\t\t\t\tif(installedChunkData !== 0) installedChunks[chunkId] = undefined;\n\t\t\t\t\t\t\tif(installedChunkData) {\n\t\t\t\t\t\t\t\tvar errorType = event && (event.type === 'load' ? 'missing' : event.type);\n\t\t\t\t\t\t\t\tvar realSrc = event && event.target && event.target.src;\n\t\t\t\t\t\t\t\terror.message = 'Loading chunk ' + chunkId + ' failed.\\n(' + errorType + ': ' + realSrc + ')';\n\t\t\t\t\t\t\t\terror.name = 'ChunkLoadError';\n\t\t\t\t\t\t\t\terror.type = errorType;\n\t\t\t\t\t\t\t\terror.request = realSrc;\n\t\t\t\t\t\t\t\tinstalledChunkData[1](error);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t};\n\t\t\t\t\t__webpack_require__.l(url, loadingEnded, \"chunk-\" + chunkId, chunkId);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n};\n\n// no prefetching\n\n// no preloaded\n\n// no HMR\n\n// no HMR manifest\n\n__webpack_require__.O.j = function(chunkId) { return installedChunks[chunkId] === 0; };\n\n// install a JSONP callback for chunk loading\nvar webpackJsonpCallback = function(parentChunkLoadingFunction, data) {\n\tvar chunkIds = data[0];\n\tvar moreModules = data[1];\n\tvar runtime = data[2];\n\t// add \"moreModules\" to the modules object,\n\t// then flag all \"chunkIds\" as loaded and fire callback\n\tvar moduleId, chunkId, i = 0;\n\tif(chunkIds.some(function(id) { return installedChunks[id] !== 0; })) {\n\t\tfor(moduleId in moreModules) {\n\t\t\tif(__webpack_require__.o(moreModules, moduleId)) {\n\t\t\t\t__webpack_require__.m[moduleId] = moreModules[moduleId];\n\t\t\t}\n\t\t}\n\t\tif(runtime) var result = runtime(__webpack_require__);\n\t}\n\tif(parentChunkLoadingFunction) parentChunkLoadingFunction(data);\n\tfor(;i < chunkIds.length; i++) {\n\t\tchunkId = chunkIds[i];\n\t\tif(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) {\n\t\t\tinstalledChunks[chunkId][0]();\n\t\t}\n\t\tinstalledChunks[chunkId] = 0;\n\t}\n\treturn __webpack_require__.O(result);\n}\n\nvar chunkLoadingGlobal = self[\"webpackChunkmyvue\"] = self[\"webpackChunkmyvue\"] || [];\nchunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0));\nchunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal));","// startup\n// Load entry module and return exports\n// This entry module depends on other loaded chunks and execution need to be delayed\nvar __webpack_exports__ = __webpack_require__.O(undefined, [504,996], function() { return __webpack_require__(9816); })\n__webpack_exports__ = __webpack_require__.O(__webpack_exports__);\n"],"names":["deferred","leafPrototypes","getProto","inProgress","dataWebpackPrefix","_hoisted_1","xmlns","style","_hoisted_11","_createStaticVNode","class","id","_createElementVNode","width","height","ApiCommunication","constructor","url","_defineProperty","WeakMap","Map","this","axios","xsrfCookieName","xsrfHeaderName","_startRequest","app","infoText","count","_requestCounts","get","set","reqId","_nextReqId","_requestInfoTexts","text","working","_updateInfoTexts","_endRequest","Math","max","delete","_syncWorkingState","fatalError","confirm","texts","forEach","entry","push","loadingInfoTexts","getActiveRequestCount","_handleFatalError","response","data","raiseFatalError","message","_handleResponse","responseHandler","errorHandler","headers","e","makeRequest","method","post","config","postWithProgress","progress","postFormDataWithProgress","formData","downloadWithProgress","filename","download","postFile","file","postFormData","postDownload","undefined","responseType","then","saveBlob","blobUrl","window","URL","createObjectURL","Blob","link","document","createElement","href","setAttribute","body","appendChild","click","remove","setTimeout","revokeObjectURL","def","ApiProgress","attachTo","start","end","stop","json","JSON","parse","Error","catch","error","requestData","FormData","append","upload","promise","finish","prepare","ApiRequestBuilder","actionId","properties","actions","addAction","action","build","ApiUtil","map","l","item","idx","DomElement","element","el","attr","key","value","Array","isArray","classList","Object","keys","filter","cls","Boolean","join","styleString","entries","prop","val","String","attrs","attributes","content","textContent","ElementBuilder","create","tag","domElement","parent","STYLE_ID","clamp","min","HoverTooltip","host","hide","isVisible","layer","showBox","html","placement","anchor","className","ensureLayer","setTagCount","box","boxHtml","innerHTML","frame","w","offsetWidth","h","offsetHeight","ax","plot","left","x","sx","top","vw","chart","right","marksTop","pointerY","sy","marksBottom","bottom","gap","below","vh","toggle","setProperty","round","inset","lefts","under","corner","reach","spread","other","bar","toolbar","getBoundingClientRect","pickSide","py","lo","hi","place","showTags","tags","length","widest","tagHtml","color","y","side","order","sort","a","b","floor","ceiling","removeEventListener","onScroll","watchTimer","clearInterval","destroy","ensureStyle","addEventListener","capture","passive","setInterval","area","isConnected","pop","container","documentElement","clientWidth","clientHeight","fits","getElementById","head","ESCAPES","escapeHtml","replace","ch","formatValue","n","toLocaleString","maximumFractionDigits","minimumFractionDigits","isNumber","Number","isFinite","badgeHtml","badge","label","gridHtml","rows","columns","some","row","name","ci","sites","values","cells","RTE_KEYS","Series","index","styleTrace","traces","find","trace","settings","hideGraph","hasRte","rteTrace","traceHasRte","keyRteLow","keyRteHigh","items","first","MyPlotVisuals","Plot","series","rteSeries","handlers","prepared","jsonTrace","handler","canHandle","read","traceIndex","seriesLayout","byKey","type","seriesKey","title","seriesLabel","rank","rteRank","buildSeriesLayout","prepareBounds","myD3","renderables","traceHandler","yieldRenderables","renderable","configureAxes","updateBounds","xMin","xMax","yMin","yMax","resolveYBounds","Trace","traceJson","keyX","keyY","applyStyle","hsva","dashArray","applyHsva","applyColorHex","hex","m","exec","trim","r","parseInt","g","mix","t","shade","rgba","colorFull","colorFullAlpha10","colorFullAlpha25","colorDesaturated","colorDark","colorLight","colorBarFill","colorBarStroke","colorText","colorTextMuted","hue","saturation","brightness","alpha","fn","s","TraceData","MULTI_SERIES_STYLES","OFFSET_STYLES","TOOLTIP_STYLES","bool","fallback","num","OFFSET_LIMITS","step","resolveDisplaySettings","input","base","axisTitles","show","multi","legend","yearTicks","yearGuides","offset","enabled","followBand","followLine","hover","yearFlag","yearBackground","tooltip","object","src","axis","slice","parsed","NaN","isNaN","includes","MultiSeriesContext","layout","preparedPlot","display","isMulti","axisXType","axisYType","rowsActive","nestedActive","offsetsActive","yearPx","axisX","px","abs","laneYears","laneOffset","rteDx","partDx","part","laneSpreadPx","last","TraceRenderable","sourceTrace","_plot","findMinMax","currentMin","currentMax","Infinity","findMinMax2","keysMin","keysMax","LEGACY_INCREASE","Set","LEGACY_DECREASE","modernizeColor","modern","legacy","has","toLowerCase","getStrokeColor","significance","colors","increase","decrease","getStrokeWidth","dlStrokeWidth","dlStrokeWidthMul","createSegmentsBySignificance","segments","segment","stroke","strokeWidth","x0","x1","resolveCurve","curve","d3","RTE_MARKER_AREA","PI","RTE_SHAPES","rteMarker","shape","d","size","hollow","nestedBarFraction","LineRenderable","super","render","svg","axisY","dx","lineGen","path","datum","AreaRenderable","keyY0","keyY1","visuals","showErrorArea","y0","y1","fillAreaGradientSeq","FillAreaRenderable","gradientId","gradient","baseline","areaGen","FocusMarkerRenderable","focusMarker","node","colorFill","marker","ErrorBarsRenderable","keyLow","keyHigh","mode","renderLines","renderBars","barWidth","selectAll","enter","renderNestedBar","renderPointRange","rteX","clsPoints","clsLines","xPos","keyValue","fraction","MarkersRenderable","RectangleRenderable","baseY","topY","Tooltip","htmlContent","position","bounds","maxLeft","maxTop","ESCAPE_MAP","ScatterLinesInteraction","register","sync","ensureTooltip","xRange","range","yRange","onHover","active","event","mouse","mx","my","activeTrace","getTrace","nearest","bestDx","year","setDimmed","setHighlighted","nearby","i","dist","buildRow","bold","countText","c","reset","interactions","ScatterLinesRenderable","live","baseStrokeWidth","defined","linePath","markers","interaction","getInteraction","hitPath","hitCls","hitCircles","onMove","onLeave","on","opacity","ChartRenderable","prepareData","getBarFillColor","getBarStrokeColor","getSeriesColor","getTextColor","fg","calculateTotal","reduce","sum","createTooltipContent","total","formattedValue","percentage","toFixed","_isGroupedItem","_groupedChildren","createGroupedTooltipContent","valueLabel","hidePercent","childrenCount","canvasWidth","dlWidth","canvasHeight","dlHeight","maxTooltipWidth","maxTooltipHeight","maxVisibleItems","childrenHtml","visibleCount","child","childFormattedValue","truncateLabel","remainingCount","maxWidth","maxChars","substring","showTooltip","hideTooltip","PieRenderable","groupSmallItems","customOptions","getPieSettings","showLabels","labelType","minLabelAngle","MIN_LABEL_ANGLE","labelPosition","innerRadiusRatio","keepOrder","hoverGrow","onSliceClick","centerText","formatLabel","percent","getLabelColor","pieSettings","radius","innerRadius","group","pieGen","restRadius","arcGen","outerRadius","arcGrown","arcs","paths","currentTarget","transition","duration","_event","renderCenterText","renderLabels","valueSize","sub","subLines","baseDy","line","labelArcGen","centroid","LABEL_FONT_SIZE","endAngle","startAngle","each","arcLength","originalText","BarsRenderable","labels","isHorizontalOrientation","categoricalYLabels","categoricalXLabels","isHorizontal","minValue","maxValue","dimensions","getChartDimensions","renderHorizontalBars","renderVerticalBars","orientation","barSpacing","BAR_SPACE_RATIO","bars","createVerticalBarRects","shouldRenderBarLabels","parseFloat","FONT_SIZE","createVerticalBarLabels","attachTooltips","bandwidth","domain","_","toString","padding","bandScale","STROKE_WIDTH","fontSize","plotBounds","alignment","getBarLabelAlignment","barHeight","barTop","barBottom","barCenterX","barBounds","center","textBounds","calculateBarLabelPosition","textAnchor","dominantBaseline","maxTextWidth","truncateTextWithEllipsis","applyBarLabelStyling","createHorizontalBarRects","createHorizontalBarLabels","barLeft","selection","StackedBarsRenderable","getStackSettings","labelMinHeight","stacks","categories","maxStackHeight","category","stackTotal","stackSettings","catStr","cumulativeValue","segmentBottom","segmentTop","segmentHeight","rect","attachSegmentTooltip","calculateStackTotal","dot","emph","buildTooltipHtml","HeatmapRenderable","getGrid","grid","xLabels","yLabels","bandX","bandY","v","sqrt","rx","attachCellTooltip","rowLabel","colLabel","unit","RadialBarsRenderable","labelSpace","inner","angle","align","radial","_d","padAngle","padRadius","cos","sin","TraceHandler","readItemsTabular","table","header","doRead","defaultHandlers","fillArea","showLine","hideFocus","showMarkers","showErrorBars","getTraceHandlers","A","B","AXIS","markA","markB","svgOpen","THUMBNAILS","nested","yA","yB","STYLE_FALLBACK","LINE_A","LINE_B","hoverDot","paper","ink","TOOLTIP_THUMBNAILS","card","bubble","docked","TOOLTIP_FALLBACK","SettingsPanel","close","target","root","contains","isOpen","open","syncers","role","onclick","availability","buildAxisSection","buildStyleSection","offsets","buildOffsetSection","buildHoverSection","buildTooltipSection","foot","onKey","onPointer","onClose","syncer","button","parentElement","innerWidth","transformOrigin","scrollX","scrollY","update","mutate","next","stringify","section","check","write","wrap","onchange","checked","disabled","axes","maxlength","placeholder","oninput","activeElement","tiles","thumbnails","tile","hint","current","add","usesOffsets","nums","uid","seq","number","cell","limits","for","raw","onblur","years","note","minHeight","ICONS","LABEL_FALLBACKS","ZoomController","fullExtent","opts","requestRedraw","translate","full","panEnabled","resolveOptions","backend","custom","wheel","drag","pan","clampWindow","win","minSpan","fullSpan","span","zoomAt","cx","factor","cur","view","setView","zoomTo","panTo","startView","domainDx","updateControls","applyCursor","panDragActive","scheduleRedraw","rafPending","requestAnimationFrame","attach","ctx","svgNode","svgRoot","onWheel","dragEnabled","onMouseDown","canPan","activeMode","dragging","cursor","pointerX","gNode","preventDefault","pow","deltaY","xScale","invert","startSelection","startPan","startPx","lastPx","band","overlay","ev","onUp","anchorDomain","domainUnderCursorNow","ensureControls","controlsBuilt","mkButton","icon","labelKey","onClick","btn","panBtn","zoomBtn","resetBtn","insertBefore","firstChild","setActive","INK","measureContext","measureText","weight","getContext","font","pendingResizeRedraws","cancelResizeRedraw","elm","observer","disconnect","MyD3","getPreparedPlot","buildSignificanceSegments","stripShortSignificantSegments","result","threshold","seg","year0","year1","prev","collapseShortSegments","plotIdOrElement","customOptionsOrTranslate","vueTranslation","classicDisplaySettings","_plotElementId","_plotElement","displaySettings","zoomOptions","zoom","plotElement","axisTickFontSize","baseFontSize","axisType","explicit","axisFontSize","dlFontSizeMul","resolveCategoricalXLayout","availableSpace","rotation","avgCharWidth","maxLabelWidth","spacePerLabel","labelsRotationAngle","perLabel","ceil","applyLabelRotation","textSelection","calcTextSize","preparedData","shouldHideYAxisLabels","yValues","maxHeight","hiddenSVG","measure","str","bbox","getBBox","DOMRect","dataMin","dataMax","include","yIncludeValues","pad","yPadTopRatio","computeViewYBounds","xv","yv","ciLow","ciHigh","panelYBounds","zoomView","whole","panelOf","panels","panel","fullXDomain","axisTitle","setting","shouldHideXAxisLabels","toolbarReserve","toolbarContainer","layoutLegend","glyph","rowHeight","itemWidth","drawSeriesKey","drawLegend","drawRowLabels","drawAxisTitles","titleX","titleY","margin","fsX","fsY","sel","fs","drawYearGuides","guideLayer","d0","d1","clampX","ticks","isInteger","isYearAxis","shouldHideXAxis","drawYearHover","showFlag","yearFlagShown","column","flag","flagBack","flagText","flagHeight","markHoveredYear","visible","select","flagWidth","seriesKeyOf","seriesKeyHtml","outerHTML","drawLinearYAxis","scale","tickCount","shouldHideYAxis","call","tickFormat","tickSize","calcRotatedXLabelMargin","maxLabelSpaceRatio","rotationAngle","radians","additionalHeight","clampedHeight","calcMaxYLabelMargin","totalWidth","shouldRenderLabels","hideAxisLabels","hideAxes","isZoomEligible","redrawWhenSized","options","ResizeObserver","draw","observe","drawToAlt","cw","plotElm","fsAxisX","fsAxisY","baseTextSize","maxYLabelWidth","maxXLabelHeight","leftMargin","additionalBottomMargin","minLeftMargin","titleBand","fsTitle","titleLineY","subtitleLineY","rowHeader","headHeight","dlTitle","dlSubtitle","subtitleBand","hoverTooltip","clear","seriesNamed","fullX","zoomController","tickValues","xAxisLabels","originalLabel","xCategorical","bandHeight","yStep","yCategorical","panelHeight","showGridlines","tick","clipped","dataLayer","clipId","clipSeq","classicPostRendering","interactive","addUI","renderContext","yd0","yd1","unityVisible","hideUnityLine","myLine","myLine2","myLine2Text","allFocusMarkers","cy","rw","rh","myRect","crosshairParts","yearMarkers","rteItems","hideAndShow","hoverPanel","setCrosshairVisible","crosshairEnabled","bestX","minDiff","bisect","xVal","diff","emphasizeYearMarkers","emphasizeRteItems","tooltipTraces","nbSites","selY","selectedData","hasData","selX","potentialItem","pixelX","pixelY","isFirst","tooltipContext","dataType","showHoverTooltip","hoverAnchor","found","clampY","context","builder","tooltipBuilder","model","source","sitesText","sitesPerRow","ttShowSitesAtBottom","candidates","keyOf","named","yOf","ttShowSignificance","yearOnAxis","buildTrendTooltipModel","yearHtml","parts","renderBubble","renderDocked","footY","single","meta","renderTags","renderCard","rootContainer","getComputedStyle","crosshairButton","settingsAvailability","settingsButton","displaySettingsBadge","toggleSettingsPanel","imageButton","buildDownloadPopup","displaySettingsEditable","axisDefault","hidden","yearAxis","settingsPanel","setDisplaySettings","notify","settingsRedrawPending","plotSize","onDisplaySettingsChange","popupContainer","$t","MIN_W","MIN_H","MAX_W","MAX_H","dlSeq","formatButtons","modal","tabindex","backdrop","sectionTitle","field","clampInput","closeButton","fitSize","grow","shrink","colSize","sizeRow","startW","startH","inputW","inputH","presetRow","presets","screen","resCheck","errorText","colLabels","inputTitle","inputSubtitle","subtitle","inputStrokeWidth","inputStrokeWidthMul","inputFontSizeMul","expertMode","expert","expertHead","expertRow","expertCol","footer","formatsRow","format","isValidResolution","downloadName","valid","closeDownloadPopup","popupKeyHandler","popupWatchTimer","popupBackdrop","focus","querySelector","toSvg","toImage","svgInit","onScreen","assign","svgString","XMLSerializer","serializeToString","blob","webkitURL","createSvgImage","img","Image","downloadClick","downloadLink","svgSize","dl","onload","canvas","drawImage","imgURI","toDataURL","ellipsisWidth","availableWidthForText","bandSize","minReadable","barLabels","isVertical","clampTextPosition","textLength","minBound","maxBound","halfLength","getValue","getLabel","setLabel","setValue","groupOptions","maxItems","minPercentage","sortedData","groupLabel","totalValue","itemsToKeep","itemsToGroup","keepItems","groupItems","groupedValue","groupedItem","RAW_SCALE_PANEL_OPTIONS","SIG_TO_INT","rowPerYear","best","inlaTrendToTraces","lineR","ymin","ymax","sig","lineTrace","hasSites","sitesPerYear","yearRows","isRte","yearEffects","every","rte_val","rte_low","rte_high","yearH","yearR","OBS_TYPE_STYLE","W","dash","S","SBB","SEC","DEFAULT_STYLE","tracesFor","payload","inlaToTraces","trend","p123","sites_per_year","PLOT_DISPLAY_STORAGE_KEY","browserStorage","localStorage","loadPlotDisplaySettings","canEdit","storage","getItem","useTrendsStore","defineStore","state","com","user","plotSettings","speciesDict","defineComponent","mStore","methods","_getStore","computed","store","accountComponent","resolvePlotModel","observationType","adminOverride","default_plot_model","MyPlotSettings","component","fill","fillTo","border","borderTo","graduated","gradientMode","gradientInvert","noDetectionFill","allRegions","mapRegion","resetMapStyle","MAP_STYLE_DEFAULTS","mapStyleSite","mapStyleDistribution","mapStyleRegionDim","emitChange","handleResponse","species","observationTypes","bioGeoRegions","biogeo","geoAdministrativeRegions","geoadm","geoRegions1","geo1","geoRegions2","geo2","geoRegions3","geo3","gridSizes","availableGridSizes","tk25Available","defaultObservationType","defaultObservationTypeId","possible_choices","availableCountTypes","filterAvailable","count_types","availableObservationTypes","obs_types","availableBiogeo","biogeo_ids","availableGeo1","geo1_ids","avalaibleGeoAdm","geoadm_ids","year_min","yearMin","year_max","yearMax","selectedRegion","plot_options","po","yearStart","yearEnd","showLocations","showSquares","squareSize","mapAggregation","showDistribution","filterDate","filterDateMonthStart","filterDateMonthEnd","filterDateIncludeNulls","trimModel","trimSerialCorrelation","trimOverdispersion","trimTotals","trimCovariateGeo","trimChangepointsAll","trimStepwise","minCountsPerSite","fillYearGaps","buildOptions","plotModel","geoBounds","mapBounds","canUseMoreOptions","filterDateStart","filterDateEnd","obsLayout","updateMapBounds","oldBounds","available","list","localeCompare","isAdmin","effectiveYearMax","currentYear","Date","getFullYear","yearsMin","cap","yearsMax","effectiveMax","addByModZero","maxV","COUNT_BIN_LABELS","hexToRgb","lerp","lerpHue","toLin","toSrgb","rgbToXyz","R","G","xyzToRgb","z","_f","cbrt","_fi","t3","xyzToLab","fx","fy","labToXyz","L","fz","labToLch","C","hypot","H","atan2","lchToLab","rgbToOklab","rgbToHsl","interpolate","hexA","hexB","ca","cb","hx","padStart","rgbToHex","q","p","hk","hslToRgb","oklabToRgb","gradientColorAt","low","high","gradientSteps","Geo","deg2rad","deg","haversine","lat1","lon1","lat2","lon2","RADIUS_EARTH_KM","rlat1","rlat2","difflat","difflon","asin","SquaresHelper","squareSizeInKm","centerLat","CENTER_LAT_GERMANY","dstY","squareSizeLat","dstX","squareSizeLon","nbLon","nbLat","offsetX","offsetY","coordsByIndex","indexLat","indexLon","MyMap","idMap","tmpLayer","mapLayer","squaresHelper","setSquareSize","sizeInKm","Leaflet","zoomSnap","createTileLayer","createInfoControl","createLegend","createControls","hasCompleteSurvey","siteStats","has_complete_survey","styleForCell","nbLoc","nbLocPos","fillColor","fillOpacity","nb","styleForDistribution","styleForRegionMask","updateRegionStyle","regionLayer","setStyle","imperial","addTo","makeButton","iconHref","ctl","onAdd","div","stopPropagation","centerMap","toggleFullscreen","exportPng","fullscreenElement","elmMap","plotId","getPlotId","elmPlot","resizedListener","getContainer","exitFullscreen","requestFullscreen","corner1","corner2","fitBounds","$refs","cfg","BASEMAPS","OSM","attribution","maxZoom","crossOrigin","subdomains","removeLayer","bringToBack","_addedToMap","infoDiv","onRemove","infoControl","showInfo","HTMLElement","hideInfo","legendHtml","squares","nbCells","nbLocations","obsLabel","ms","steps","borderSteps","lbl","nbNoDetection","sq","nb_loc_pos","$tc","legendDiv","cRect","dpr","devicePixelRatio","fillStyle","fillRect","querySelectorAll","complete","naturalWidth","drawEl","drawExportLegend","toBlob","removeChild","svgRect","clone","cloneNode","transform","xml","onerror","encodeURIComponent","lines","sw","boxH","strokeStyle","lineWidth","strokeRect","textBaseline","ln","fillText","tw","createDistributionLayerFull","geojsonData","distributionLayer","createLocationsLayer","locationsLayer","markerOptions","squareCenter","nb_loc","bindPopup","polygon","latSum","lonSum","i2","createHolesFromGeometry","innerBounds","extractCoordinates","geometry","coords","coordinates","coord","hole","features","feature","createRegionLayer","outerBounds","points","ring","isValid","regionBounds","invalidateSize","err","createSitesLayer","squaresLayer","allSquares","baseStyle","poly","polygonFromSquare","bringToFront","bindTooltip","cellTooltipHtml","sticky","direction","cellPopupHtml","contributorNames","contributors","names","cIdx","cmp","tk25","Carto","ArcGIS","Topo","Satellite","ApiCom","extends","MyBase","prefix","speciesTitles","locations","nbCounts","plotError","overall","summary","timings","gof","isInla","obsPlots","created","liveCharts","unmounted","mounted","createMap","trendData","resizeTimeoutId","clearTimeout","resizedFn","elmMap2","basis","updatePlot","handleError","settingsComponent","User","speciesDesc","titles","images","speciesImages","speciesId","counts","sImages","subImages","subDescId","descId","desc","nb_rows","site_stats","plot_error","distfull","region","square_size","updateMapSquare","obsPlotIds","$nextTick","drawObsGrid","drawCombined","getCustomOptions","plotData","trendPlotData","dataMinYear","dataMaxYear","meaning","slope","hasEnoughData","startsWith","baseObsId","merged","byId","obsId","own","solidId","isSolid","mergeObsPlots","obsTypeLabels","contributing","displaySettingsChanged","setItem","savePlotDisplaySettings","status","settingsChanged","updateBrowserUrl","settingsModify","requestRawData","openSitesShortcut","plotOptions","location","lang","urlFor","sitesShortcutUrlForPlotOptions","$i18n","locale","callbackSelectRectangle","moveMap","mapSettingsChanged","latin","pathname","split","langPrefix","obs","slug","history","replaceState","all","short","components","props","default","_createElementBlock","_ctx","_hoisted_9","_hoisted_10","_hoisted_12","_hoisted_13","_hoisted_14","severity","_hoisted_15","_hoisted_3","_hoisted_4","_hoisted_5","_hoisted_6","_hoisted_7","_hoisted_8","cardStyle","_Fragment","_hoisted_2","_renderSlot","ref","viewBox","emits","menuStyle","tabs","currentLabel","opt","layoutOptions","o","currentIsAdminOnly","isAdminOnly","beforeUnmount","teardown","isActive","isAvailable","public","isSelectable","$emit","kind","obsType","selectLayout","openMenu","positionMenu","onDocPointerDown","focusActiveOption","trigger","minWidth","menu","optionButtons","from","buttons","onMenuKeydown","indexOf","_createBlock","_Teleport","to","onKeydown","_hoisted_16","_hoisted_17","MyTrendCard","PlotContent","ObsTypeSelect","isGrid","isCombined","hasCombinedContent","effectivePlot","effectivePlotError","_component_MyTrendCard","_createVNode","_component_ObsTypeSelect","onSelect","$event","_component_PlotContent","hello","emitModify","emitMapChange","PlotSettingsBase","basemaps","gradientModes","selectSpecies","selectBioGeo","bg","selectGeo1","selectGeoAdm","geoAdm","selectObservationType","selectObsLayout","selectMapLayer","setStyleColor","styleKey","selectWeight","resetStyling","selectMapAggregation","selectYearStart","selectYearEnd","capitalizeAll","toUpperCase","substr","cellGradientCss","rgb","hsl","lab","lch","oklch","spec","geo","_hoisted_24","_hoisted_25","_hoisted_26","_hoisted_29","_hoisted_30","_hoisted_32","_hoisted_33","_hoisted_34","_hoisted_35","_hoisted_37","_hoisted_39","_hoisted_40","_hoisted_41","_hoisted_43","_hoisted_47","_hoisted_48","_hoisted_49","_hoisted_50","_hoisted_51","onChange","_hoisted_53","_hoisted_54","_hoisted_55","_hoisted_56","_hoisted_57","_hoisted_58","_hoisted_59","_hoisted_60","_hoisted_61","_hoisted_62","_hoisted_63","_hoisted_64","_hoisted_65","_hoisted_67","_hoisted_68","_hoisted_69","_hoisted_70","_hoisted_71","_hoisted_72","_hoisted_73","_hoisted_74","_hoisted_75","_hoisted_76","bm","_hoisted_78","_hoisted_79","_hoisted_80","_hoisted_81","_hoisted_82","_hoisted_83","_hoisted_84","_hoisted_85","_hoisted_86","_hoisted_87","background","onInput","_hoisted_89","_hoisted_90","_hoisted_91","_hoisted_93","_hoisted_94","_hoisted_95","_hoisted_96","_hoisted_98","_hoisted_99","_hoisted_100","_hoisted_101","_hoisted_103","_hoisted_104","_hoisted_105","_hoisted_107","_hoisted_108","_hoisted_110","_hoisted_111","_hoisted_113","_hoisted_114","_hoisted_115","_hoisted_116","_hoisted_117","_hoisted_118","_hoisted_119","_hoisted_120","_hoisted_121","_hoisted_123","_hoisted_124","_hoisted_125","_hoisted_126","_hoisted_127","_hoisted_128","_hoisted_129","_hoisted_130","_hoisted_131","_hoisted_132","bottomBar","bottomBarClass","bottomBarText","getSpeciesImage","imgData","extension","cssClassesImage","bottomText","srcset","SpeciesImage","indicators","mkey","carouselId","_component_SpeciesImage","openItems","supplierHasInfo","supplier","toggleOpen","updated","contributor","cnt","locs","description","_hoisted_18","_hoisted_19","colspan","se_add","mul","se_mul","convergence","overdispersion","serialcorrelation","chi2","df","lr","LR","_hoisted_20","_hoisted_21","aic","showSelectSites","isStaff","downloadCsv","downloadCsvDemo","demo","gofData","plotIdPrefix","expanded","plotIds","qq","residVsFit","histogram","obsVsFit","watch","renderPlots","toggleExpanded","formatNumber","renderQQPlot","renderResidVsFitPlot","renderHistogram","renderObsVsFitPlot","getPlotDimensions","elementId","innerHeight","xExtent","theoretical","yExtent","residuals","lineExtent","xData","eta","fitted","bins","xDomain","xmin","xmax","breaks","allVals","observed","extent","f","stats","deviance","gcv","n_sampled","n_points","_hoisted_22","_hoisted_23","_hoisted_27","_hoisted_28","_hoisted_38","_hoisted_42","GofDiagnostics","DownloadData","TimingsInfo","TrimInfo","ContributorsAccordion","selectedObsId","immediate","ids","showPicker","activeContributors","_component_ContributorsAccordion","_component_TimingsInfo","_component_GofDiagnostics","_component_TrimInfo","onDownload","_component_DownloadData","onSelectSites","useAccountStore","plogis","exp","expLink","PART_META","GeoCom","spatial","required","fixedPart","geoLayer","resizeObserver","domainMin","domainMax","partMeta","txt","partLabel","tkPrefix","noPosterior","crInterval","rawEta","activePart","dataBySheet","c2t","car_index_to_tk25","out","sheet","ID","mean","QL","QH","renderLayer","fetchGeometry","zoomControl","attributionControl","scrollWheelZoom","doubleClickZoom","keyboard","touchZoom","boxZoom","zoomAnimation","fadeAnimation","markerZoomAnimation","refitMap","fmt","sheets","rb","colorScale","vals","styleFor","fc","feat","onEachFeature","showTip","originalEvent","resetStyle","hideTip","getBounds","tip","sd","th","clientX","clientY","placeTip","InlaSpatialMap","trendId","statKey","showPartSites","mapLabels","renderTrends","col","pd","_component_InlaSpatialMap","countTypes","pages","computedStyles","nbPerRow","nbRows","imgs","previewSpeciesHtml","clickSpecies","page","random","SignificantSegment","iconSizeLarge","iconSize","pp","significantSegments","displayInsignificants","updateFromPlot","significantTrace","itm","sigsegs","segmentsRaw","cssTrend","css","colorBySeg","svgTrend","timespanText","PlotsBase","TrendComponentGAM","SpeciesPreviewCarousel","TcMore","InlaComponentCard","PlotErrorSmall","SpeciesImageCarousel","PlotSettings2","TcMap","PlotCard","MySpinner","isMoreInfoOpen","highlight","evt","elements","toggleMoreInfo","openSpeciesDropdown","bootstrap","Dropdown","removeAttribute","selectObsType","subSpecies","isAdminOnlyView","isGridLayout","_component_MySpinner","_component_PlotSettings2","onSettingsChanged","onSettingsModify","onMapSettingsChanged","_component_SpeciesImageCarousel","$options","_component_PlotErrorSmall","_component_TrendComponentGAM","nb_rows_positive","nb_sites_positive","subKey","_hoisted_31","onMouseenter","onMouseleave","_hoisted_36","_component_SpeciesPreviewCarousel","onSelectSpecies","_component_PlotCard","onSelectObsType","_component_TcMap","_component_InlaComponentCard","_component_TcMore","PlotsThree","myView","getAttribute","_cache","$props","$setup","$data","_component_PlotsThree","_resolveComponent","_openBlock","pinia","createPinia","i18n","messages","createI18n","global","async","setLocaleMessage","nextTick","loadLocaleMessages","setI18nLanguage","setupI18n","vueI18n","createApp","App","use","mount","webpackAsyncContext","req","__webpack_require__","Promise","resolve","code","module","exports","__webpack_module_cache__","moduleId","cachedModule","__webpack_modules__","O","chunkIds","priority","notFulfilled","fulfilled","j","splice","getter","__esModule","getPrototypeOf","obj","__proto__","ns","getOwnPropertyNames","definition","defineProperty","enumerable","chunkId","promises","u","miniCssF","globalThis","Function","prototype","hasOwnProperty","done","script","needAttach","scripts","getElementsByTagName","charset","timeout","nc","onScriptComplete","doneFns","parentNode","bind","Symbol","toStringTag","installedChunks","installedChunkData","reject","errorType","realSrc","request","webpackJsonpCallback","parentChunkLoadingFunction","moreModules","runtime","chunkLoadingGlobal","self","__webpack_exports__"],"sourceRoot":""}