{
  "version": 3,
  "sources": ["map_beyond_switzerland.js"],
  "sourcesContent": ["// @ts-check\n/*\n * static/js/map_beyond_switzerland.js \u2014 the winter map past the Swiss\n * border, on /map/ (SNOW-1460) and the GPX Explorer (SNOW-1540).\n *\n * Loaded only for a reader in the map_beyond_switzerland flag\n * (public/map.html), after the map bundle and the 3-D view, and after the\n * four files it reads at parse time: swisstopo_extent.js,\n * beyond_switzerland_core.js, osm_clip_core.js and alpine_relief_core.js.\n * contour_core.js is not one of them: only the contour worker imports it,\n * and the protocol's name comes from beyond_switzerland_core.\n * It does nothing unless `#map` carries data-map-beyond-switzerland. What\n * it owns:\n *\n *   - THE PROTOCOLS. `osmclip://`, `alpinerelief://` and `dem-contours://`\n *     (SNOW-1533), registered once per MapLibre namespace (the\n *     map_3d_terrain.registerDemProtocol pattern). Each handler posts\n *     {id, url} to its worker (osm_clip_worker.js, alpine_relief_worker.js,\n *     contour_worker.js) and resolves with the bytes of the matching reply.\n *     Contour tiles go to a pool of two contour workers in turn, each with\n *     its own elevation cache: tracing is the slow part, and one worker\n *     traces serially. With no `data-contour-worker-url` (the kill switch\n *     map_beyond_switzerland_contours is off) `dem-contours://` is not\n *     registered and the plan leaves the contours out. An abort posts {type: 'cancel', id} and\n *     rejects with an AbortError; a worker's error reply, or the worker\n *     failing, rejects. The workers start on the first tile request, each\n *     sent an `init` with the scripts it imports and the polygons it needs.\n *   - THE SPLICE. On every style.load, and on styledata (MapLibre 4.x does\n *     not always fire style.load after a setStyle; map.js reinstalls its\n *     own layers on styledata for the same reason), the winter style gets\n *     beyond_switzerland_core's plan: the OSM, relief and contour sources\n *     and layers. At boot, after a basemap swap and after the 3-D view's swap.\n *     The plan is idempotent, and a style already holding the OSM source is\n *     skipped before the style is read, so the repeated events cost\n *     nothing. If the style has loaded already when this runs, it splices\n *     at once.\n *   - THE 3-D COVERAGE. With the 3-D view on the page, it is handed the\n *     Alpine ring (window.pwaMapView.setCoverage).\n *   - THE RELIEF'S TUNING. Every reader gets alpine_relief_core's\n *     TUNING_DEFAULTS. `tune(values)` normalises a new one, posts it to the\n *     relief worker as {type: 'tune'} if the worker has started (its init\n *     carries the current one otherwise), and gives the relief source's\n *     tiles a `?v=` of alpine_relief_core.tuningKey so MapLibre fetches\n *     them again; a later splice adds the source with the same key, so a\n *     basemap swap keeps the tuning. Only with data-relief-tuning on `#map`\n *     (a staff reader; map_relief_tuning.js is the panel) is a tuning saved\n *     on this device under TUNING_STORAGE_KEY read back at boot.\n *\n * Publishes `window.pwaBeyondSwitzerland` (splice, tune, tuning,\n * TUNING_STORAGE_KEY) for the tuning panel, the debugger and the tests.\n *\n * And `self.pwaBeyondSwitzerlandAttach(map, el)`, for a page whose map is\n * drawn after this file runs: the GPX Explorer (SNOW-1540) calls it on each\n * map it draws, with the element that carries the same data-* URLs as\n * /map/'s #map. The workers are started once per element, so a second map\n * reuses them.\n */\n(function mapBeyondSwitzerlandInit() {\n  'use strict';\n\n  const core = self.pwaBeyondSwitzerlandCore;\n  const clipCore = self.pwaOsmClipCore;\n  const reliefCore = self.pwaAlpineReliefCore;\n  const extent = self.pwaSwisstopoExtent;\n  const win = /** @type {any} */ (window);\n  if (!core || !clipCore || !reliefCore || !extent) return;\n\n  /** Where the staff tuning panel keeps a tuning on this device. */\n  const TUNING_STORAGE_KEY = 'snowdesk.map.reliefTuning';\n\n  /**\n   * The MapLibre namespaces the protocols are on. Page-wide: a namespace\n   * holds one handler per protocol, so the first element's workers answer\n   * every map on the page.\n   *\n   * @type {WeakSet<object>}\n   */\n  const registered = new WeakSet();\n\n  /**\n   * The workers, the protocols' handlers and the relief's tuning for one\n   * element's URLs: made once per element, so a page that draws a new map\n   * (the explorer, on each upload) reuses the workers it has started and\n   * the handlers MapLibre already holds.\n   *\n   * @param {HTMLElement} el The element carrying the data-* URLs.\n   * @returns {{bind: (map: any) => void, api: NonNullable<Window['pwaBeyondSwitzerland']>}}\n   */\n  function createEngine(el) {\n    const data = el.dataset;\n    /** @type {any} The map the tuning and `splice()` act on: the last bound. */\n    let current = null;\n\n\n    /** The relief's tuning now; the defaults until a staff reader sets one. */\n    let tuning = reliefCore.TUNING_DEFAULTS;\n    /** Whether `tuning` was set, so the relief tiles carry its key. */\n    let tuned = false;\n\n    /**\n     * One worker, started on the first request, answering {id, url} with\n     * {id, data} or {id, error}.\n     *\n     * @param {string} workerUrl\n     * @param {() => object} init The `init` message, built when it starts.\n     * @returns {{request: (url: string, abortController?: AbortController) => Promise<ArrayBuffer>, post: (message: object) => boolean}}\n     */\n    function workerChannel(workerUrl, init) {\n      /** @type {?Worker} */\n      let worker = null;\n      let nextId = 1;\n      /** @type {Map<number, {resolve: (data: ArrayBuffer) => void, reject: (err: Error) => void}>} */\n      const pending = new Map();\n\n      /** @param {MessageEvent} event */\n      const onMessage = (event) => {\n        const reply = event.data || {};\n        const entry = pending.get(reply.id);\n        if (!entry) return;\n        pending.delete(reply.id);\n        if (reply.error) entry.reject(new Error(reply.error));\n        else entry.resolve(reply.data);\n      };\n\n      /** The worker itself failed: every request in flight rejects. */\n      const onError = () => {\n        const failed = [...pending.values()];\n        pending.clear();\n        if (worker) worker.terminate();\n        worker = null;\n        for (const entry of failed) entry.reject(new Error(`beyond_switzerland: ${workerUrl} failed`));\n      };\n\n      /** @returns {Worker} */\n      const ensure = () => {\n        if (worker) return worker;\n        worker = new Worker(workerUrl);\n        worker.addEventListener('message', onMessage);\n        worker.addEventListener('error', onError);\n        worker.postMessage(init());\n        return worker;\n      };\n\n      return {\n        /** Post to the worker if it has started; an unstarted one's init carries it. */\n        post(message) {\n          if (!worker) return false;\n          worker.postMessage(message);\n          return true;\n        },\n        request(url, abortController) {\n          const signal = abortController ? abortController.signal : null;\n          if (signal && signal.aborted) return Promise.reject(new DOMException('Aborted', 'AbortError'));\n          const target = ensure();\n          const id = nextId;\n          nextId += 1;\n          return new Promise((resolve, reject) => {\n            pending.set(id, { resolve, reject });\n            if (signal) {\n              signal.addEventListener('abort', () => {\n                if (!pending.has(id)) return;\n                pending.delete(id);\n                target.postMessage({ type: 'cancel', id });\n                reject(new DOMException('Aborted', 'AbortError'));\n              }, { once: true });\n            }\n            target.postMessage({ id, url });\n          });\n        },\n      };\n    }\n\n    const osm = workerChannel(data.osmClipWorkerUrl || '', () => ({\n      type: 'init',\n      kitUrl: data.vectorTileKitUrl || '',\n      coreUrl: data.osmClipCoreUrl || '',\n      styleUrl: data.osmStyleUrl || '',\n      extent: extent.EXTENT,\n    }));\n    const relief = workerChannel(data.alpineReliefWorkerUrl || '', () => ({\n      type: 'init',\n      coreUrl: data.alpineReliefCoreUrl || '',\n      demTileUrl: data.demTileUrl || '',\n      relief: extent.DETAILED_RELIEF,\n      tuning,\n    }));\n    /**\n     * The contour workers: CONTOUR_WORKERS channels, each started on its first\n     * request with its own init (and so its own elevation cache), taken in\n     * turn, since one worker traces its tiles one after another.\n     */\n    const CONTOUR_WORKERS = 2;\n    /**\n     * SNOW-1533's kill switch: with map_beyond_switzerland_contours off the\n     * page names no contour worker, and no contours are planned or fetched.\n     */\n    const contours = Boolean(data.contourWorkerUrl);\n    const contourPool = Array.from({ length: CONTOUR_WORKERS }, () => workerChannel(data.contourWorkerUrl || '', () => ({\n      type: 'init',\n      kitUrl: data.vectorTileKitUrl || '',\n      clipCoreUrl: data.osmClipCoreUrl || '',\n      coreUrl: data.contourCoreUrl || '',\n      demTileUrl: data.demTileUrl || '',\n      extent: extent.EXTENT,\n      gate: core.ALPINE_GATE,\n    })));\n    let nextContour = 0;\n\n    /**\n     * The next contour worker, round-robin.\n     *\n     * @returns {ReturnType<typeof workerChannel>}\n     */\n    function contourChannel() {\n      const channel = contourPool[nextContour];\n      nextContour = (nextContour + 1) % contourPool.length;\n      return channel;\n    }\n\n    /**\n     * The relief source's tiles with the current tuning's key.\n     *\n     * @returns {string[]}\n     */\n    function reliefTiles() {\n      const key = reliefCore.tuningKey(tuning);\n      return core.reliefSource().tiles.map((/** @type {string} */ url) => `${url}?v=${key}`);\n    }\n\n    /** Point the relief source on the map at the current tuning's tiles. */\n    function applyTuning() {\n      if (!current) return;\n      const source = current.getSource(core.RELIEF_SOURCE_ID);\n      if (source && typeof source.setTiles === 'function') source.setTiles(reliefTiles());\n    }\n\n    /**\n     * Change the relief's tuning: what the worker paints with, and the tiles'\n     * key, so MapLibre paints them again.\n     *\n     * @param {unknown} values Anything normaliseTuning reads.\n     * @returns {Readonly<Record<string, number>>} The tuning now in use.\n     */\n    function tune(values) {\n      tuning = reliefCore.normaliseTuning(values);\n      tuned = true;\n      relief.post({ type: 'tune', tuning });\n      applyTuning();\n      return tuning;\n    }\n\n    /**\n     * Register the protocols on a MapLibre namespace, once: the contours'\n     * only while the kill switch is on.\n     *\n     * @param {any} maplibre\n     * @returns {boolean} Whether this call registered them.\n     */\n    function registerProtocols(maplibre) {\n      if (!maplibre || typeof maplibre.addProtocol !== 'function' || registered.has(maplibre)) return false;\n      registered.add(maplibre);\n      maplibre.addProtocol(\n        clipCore.PROTOCOL,\n        (/** @type {{url: string}} */ params, /** @type {AbortController} */ abortController) =>\n          osm.request(params.url, abortController).then((bytes) => ({ data: bytes })),\n      );\n      maplibre.addProtocol(\n        reliefCore.PROTOCOL,\n        (/** @type {{url: string}} */ params, /** @type {AbortController} */ abortController) =>\n          relief.request(params.url, abortController).then((bytes) => ({ data: bytes })),\n      );\n      if (contours) maplibre.addProtocol(\n        core.CONTOUR_PROTOCOL,\n        (/** @type {{url: string}} */ params, /** @type {AbortController} */ abortController) =>\n          contourChannel().request(params.url, abortController).then((bytes) => ({ data: bytes })),\n      );\n      return true;\n    }\n\n    /**\n     * Add the plan to a map's style, if it is the winter style and not\n     * spliced yet.\n     *\n     * @param {any} map The MapLibre map to splice into.\n     * @returns {boolean} Whether anything was added.\n     */\n    function spliceInto(map) {\n      // No isStyleLoaded() guard: in MapLibre 4.x it stays false until every\n      // source's tiles and the sprite are in, and once the map goes idle no\n      // further styledata is promised, so a guarded splice could never run.\n      // map_view_3d's reinstall works the same way: try, and let a style\n      // mid-swap throw into the catch; the next style.load splices.\n      let style;\n      try {\n        style = map.getStyle();\n      } catch (_err) {\n        return false;\n      }\n      // plan() refuses a style that already has the OSM source, so it is\n      // planned as if the source were absent; the adds below skip what exists.\n      const sources = Object.assign({}, style && style.sources);\n      delete sources[core.OSM_SOURCE_ID];\n      const plan = core.plan(Object.assign({}, style, { sources }), { contours });\n      if (!plan) return false;\n      // A tuned relief keeps its key across a basemap swap.\n      const reliefDef = plan.sources[core.RELIEF_SOURCE_ID];\n      if (tuned && reliefDef) plan.sources[core.RELIEF_SOURCE_ID] = Object.assign({}, reliefDef, { tiles: reliefTiles() });\n      const last = plan.layers.length ? plan.layers[plan.layers.length - 1].layer.id : null;\n      // Done once the last planned layer is in, not once the source is: an\n      // add that threw partway leaves the source but not the rest.\n      if (map.getSource(core.OSM_SOURCE_ID) && (!last || map.getLayer(last))) return false;\n      try {\n        for (const [id, source] of Object.entries(plan.sources)) {\n          if (!map.getSource(id)) map.addSource(id, source);\n        }\n        for (const { layer, beforeId } of plan.layers) {\n          if (map.getLayer(layer.id)) continue;\n          map.addLayer(layer, beforeId && map.getLayer(beforeId) ? beforeId : undefined);\n        }\n      } catch (err) {\n        console.warn('[map] SNOW-1460: splice failed; retried on the next style event', err);\n        return false;\n      }\n      return true;\n    }\n\n    // A staff reader's saved tuning, before the first splice adds the source.\n    if (data.reliefTuning !== undefined) {\n      try {\n        const saved = window.localStorage.getItem(TUNING_STORAGE_KEY);\n        if (saved) {\n          tuning = reliefCore.normaliseTuning(JSON.parse(saved));\n          tuned = true;\n        }\n      } catch (_err) {\n        // No storage, or junk in it: the defaults.\n      }\n    }\n\n\n    return {\n      /** Splice this map now and after every style event; tune acts on it. */\n      bind(map) {\n        current = map;\n        registerProtocols(win.maplibregl);\n        const splice = () => spliceInto(map);\n        map.on('style.load', splice);\n        map.on('styledata', splice);\n        splice();\n      },\n      api: Object.freeze({\n        splice: () => (current ? spliceInto(current) : false),\n        tune,\n        tuning: () => tuning,\n        TUNING_STORAGE_KEY,\n      }),\n    };\n  }\n\n  /** @type {WeakMap<HTMLElement, ReturnType<typeof createEngine>>} */\n  const engines = new WeakMap();\n\n  /**\n   * Draw the winter map past the border on a map: the protocols, and the\n   * splice on every style.load. Nothing unless `el` carries\n   * data-map-beyond-switzerland=\"true\" (the flag, server-side).\n   *\n   * @param {any} map The MapLibre map.\n   * @param {?HTMLElement} el The element carrying the data-* URLs.\n   * @returns {?NonNullable<Window['pwaBeyondSwitzerland']>} The splice/tune API, or null off the flag.\n   */\n  function attach(map, el) {\n    if (!map || !el || el.dataset.mapBeyondSwitzerland !== 'true') return null;\n    let engine = engines.get(el);\n    if (!engine) {\n      engine = createEngine(el);\n      engines.set(el, engine);\n    }\n    engine.bind(map);\n    return engine.api;\n  }\n\n  // SNOW-1540: the explorer draws a map per upload, after this has run,\n  // and calls attach itself (static/js/explorer.js).\n  self.pwaBeyondSwitzerlandAttach = attach;\n\n  // /map/: its one map, booted by the map bundle before this file runs.\n  const api = attach(win.snowdeskMap, document.getElementById('map'));\n  if (!api) return;\n\n  if (win.pwaMapView && typeof win.pwaMapView.setCoverage === 'function') {\n    win.pwaMapView.setCoverage(core.ALPINE_GATE);\n  }\n\n  window.pwaBeyondSwitzerland = api;\n})();\n"],
  "mappings": "CAyDC,UAAoC,CACnC,aAEA,MAAMA,EAAO,KAAK,yBACZC,EAAW,KAAK,eAChBC,EAAa,KAAK,oBAClBC,EAAS,KAAK,mBACdC,EAA0B,OAChC,GAAI,CAACJ,GAAQ,CAACC,GAAY,CAACC,GAAc,CAACC,EAAQ,OAGlD,MAAME,EAAqB,4BASrBC,EAAa,IAAI,QAWvB,SAASC,EAAaC,EAAI,CACxB,MAAMC,EAAOD,EAAG,QAEhB,IAAIE,EAAU,KAIVC,EAAST,EAAW,gBAEpBU,EAAQ,GAUZ,SAASC,EAAcC,EAAWC,EAAM,CAEtC,IAAIC,EAAS,KACTC,EAAS,EAEb,MAAMC,EAAU,IAAI,IAGdC,EAAaC,GAAU,CAC3B,MAAMC,EAA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AQ,OAAO,KACtE,IAAI0D,EAASF,EAAQ,IAAIxD,CAAE,EAC3B,OAAK0D,IACHA,EAAS3D,EAAaC,CAAE,EACxBwD,EAAQ,IAAIxD,EAAI0D,CAAM,GAExBA,EAAO,KAAKb,CAAG,EACRa,EAAO,GAChB,CAIA,KAAK,2BAA6BD,EAGlC,MAAME,EAAMF,EAAO7D,EAAI,YAAa,SAAS,eAAe,KAAK,CAAC,EAC7D+D,IAED/D,EAAI,YAAc,OAAOA,EAAI,WAAW,aAAgB,YAC1DA,EAAI,WAAW,YAAYJ,EAAK,WAAW,EAG7C,OAAO,qBAAuBmE,EAChC,GAAG",
  "names": ["core", "clipCore", "reliefCore", "extent", "win", "TUNING_STORAGE_KEY", "registered", "createEngine", "el", "data", "current", "tuning", "tuned", "workerChannel", "workerUrl", "init", "worker", "nextId", "pending", "onMessage", "event", "reply", "entry", "onError", "failed", "ensure", "message", "url", "abortController", "signal", "target", "id", "resolve", "reject", "osm", "relief", "CONTOUR_WORKERS", "contours", "contourPool", "nextContour", "contourChannel", "channel", "reliefTiles", "key", "applyTuning", "source", "tune", "values", "registerProtocols", "maplibre", "params", "bytes", "spliceInto", "map", "style", "sources", "plan", "reliefDef", "last", "layer", "beforeId", "err", "saved", "splice", "engines", "attach", "engine", "api"]
}
