{
  "version": 3,
  "sources": ["day_strips_core.js"],
  "sourcesContent": ["/*\n * static/js/day_strips_core.js \u2014 which three-hour block a point on the day\n * strips names (SNOW-1219).\n *\n * The weather sheet's day strips (templates/includes/_day_strips.html)\n * share one time axis split into eight three-hour blocks, each 12.5% of\n * the plot. A tap or a drag along the timeline selects the block under\n * it. This module is that arithmetic and nothing else;\n * static/js/day_strips.js is the DOM half.\n *\n * Exports (frozen `self.pwaDayStripsCore`):\n *\n *   BLOCK_COUNT                   \u2014 8\n *   blockAt(x, left, width)      \u2192 the block under a client x, clamped to\n *     0..7, or null when the plot has no width\n */\n\n// @ts-check\n\n(function () {\n  'use strict';\n\n  var BLOCK_COUNT = 8;\n\n  /**\n   * The block under a horizontal position on a plot.\n   *\n   * A drag that runs off either end of the timeline keeps the end block, so\n   * dragging past the last hour holds 21\u201324 rather than dropping the\n   * selection.\n   *\n   * @param {number} x The pointer's client x.\n   * @param {number} left The timeline's left edge, client px.\n   * @param {number} width The timeline's width, px.\n   * @returns {?number}\n   */\n  function blockAt(x, left, width) {\n    if (!(width > 0) || !Number.isFinite(x) || !Number.isFinite(left)) {\n      return null;\n    }\n    var index = Math.floor(((x - left) / width) * BLOCK_COUNT);\n    return Math.max(0, Math.min(BLOCK_COUNT - 1, index));\n  }\n\n  self.pwaDayStripsCore = Object.freeze({\n    BLOCK_COUNT: BLOCK_COUNT,\n    blockAt: blockAt,\n  });\n})();\n"],
  "mappings": "CAmBC,UAAY,CACX,aAEA,IAAIA,EAAc,EAclB,SAASC,EAAQC,EAAGC,EAAMC,EAAO,CAC/B,GAAI,EAAEA,EAAQ,IAAM,CAAC,OAAO,SAASF,CAAC,GAAK,CAAC,OAAO,SAASC,CAAI,EAC9D,OAAO,KAET,IAAIE,EAAQ,KAAK,OAAQH,EAAIC,GAAQC,EAASJ,CAAW,EACzD,OAAO,KAAK,IAAI,EAAG,KAAK,IAAIA,EAAc,EAAGK,CAAK,CAAC,CACrD,CAEA,KAAK,iBAAmB,OAAO,OAAO,CACpC,YAAaL,EACb,QAASC,CACX,CAAC,CACH,GAAG",
  "names": ["BLOCK_COUNT", "blockAt", "x", "left", "width", "index"]
}
