GLOBALGRID2050 / EXPLORE CODE

Part of: Explore Code / Kuiper, cosmos and drawing engines / stars / library

Standalone (part 1)

A JavaScript module in the library folder of Stars that maps Renewable Energy Planning Database (REPD) master and heavy emitters UK, using SHA-256, and uses data from the GridAtlas repository.

700 lines of JavaScript from stars, in 1 file. Topic: Kuiper, cosmos and drawing engines. Section 1563 of 2044.

Cut 2026-12-06T03:07:51+00:00. A copy for reading; the repository at the stated commit is the source.

In the State lines below, domain stage, users and canonical status are rule-based first approximations from code and path evidence (rules explore-agent-rules-v1), not observed facts: the rules.

In this section

  1. Standalone geodesy · stars / library/standalone.mjs lines 540–1239

Standalone

A JavaScript module in the library folder of Stars that maps Renewable Energy Planning Database (REPD) master and heavy emitters UK, using SHA-256, and uses data from the GridAtlas repository.

Set aside from the main view: A comment at the top of the file says a tool wrote it. (noise-generated, proposed by noise.py). All set-aside files, with reasons. Nothing was deleted.

Evidence
  • line 2 comment: // Generated by the modular star 2026-12-05T23:26:43.596Z. Each export is one family's earliest-seen copy, unchanged; the comment links its source.

geodesystars / library/standalone.mjs · lines 540–1239 of 12585 (continued from section 1562) · Entry point · pattern segmentConductors (shared by 2 files)

What it does
It maps REPD master, heavy emitters UK, notice and substations. Defines 1111 functions or classes, including f1586_invariant, f8767_representativePoint, f8768_voltagesKv, f8772_voltageOf, f8773_ratingsOf. Side effects: changes the web page (DOM); reads or writes files; makes network requests; uses storage (browser storage, DuckDB or Parquet).
Why it exists in the grid workflow
Domain terms in the code: substations, 750kV, 400kV, 275kV, 132kV, 66kV.
Inputs & outputs
In: data source: gridatlas data; JSON file repd_master.json; JSON file heavy_emitters_uk.json; JSON file notice.json; form fields (user input). Out: canvas drawing. Coordinate systems named: OSGB36 / EPSG:27700 (British National Grid), WGS84 / EPSG:4326. Voltage levels named: 750kV, 400kV, 275kV, 132kV, 66kV, 33kV, 1.5kV, 1500V.
Downstream impact
Used directly by 4 files: Code (stars, https://ventusltd.github.io/stars/code.html); Proof (stars); Modular Star Workflow (stars); Testcode — Code Record Page (globalgrid2050, https://globalgrid2050.com/testcode/202609141754/code-record/). Reached from 383 other entry points, including Code Generator — Index Page (code-generator, https://ventusltd.github.io/code-generator/); Generate (code-generator, https://ventusltd.github.io/code-generator/); 404 (galaxies-wafers, https://ventusltd.github.io/galaxies-wafers/404.html).
What it achieves
It snaps coordinate (`snapCoordinate`), paints cursor (`paintCursor`) and sets plan (`setPlan`). Compiled library of self-contained JavaScript functions that appear in two or more places across Ventusltd code. Its code works with 33 kV, 132 kV and 275 kV. It responds to abort events.
Why it matters
Loaded by the Code page at https://ventusltd.github.io/stars/code.html and 1 other page. Run by Proof and Modular Star Workflow.
Application
stars · library · JavaScript module
VEDIC
MEASURE (GG2050-VEDIC-000001): GridAtlas / Geodesy · Mathematics / Spherical geometry. coordinate_pair, coordinate_pair → distance_km
VEDIC
REPRESENT (GG2050-VEDIC-000002): GridAtlas / Geodesy · Computer science / Geometry processing. geojson_geometry → coordinate_pair_or_null
VEDIC
VOLTAGE (GG2050-VEDIC-000003): GridAtlas / Geodesy · Computer science / Data normalisation. voltage_properties → kilovolt_list
Uses
GlobalGrid2050 — Renewable Energy Planning Database (REPD) Grid Atlas v8 Page (estate URL), Declared Connections (estate URL)
Used by
named by URL in Code (estate URL), run by Proof (script call), run by Modular Star Workflow (workflow run), named by URL in Testcode — Code Record Page (estate URL)
Produces
f1586_invariant, f8767_representativePoint, f8768_voltagesKv, f8772_voltageOf, f8773_ratingsOf, f8775_parametersOf, f5168_escapeHTML, f8321_suppliedArrivalFields, f8850__anonymous_, f8786_crossing, f8788_legality, f8789_startNodes
Defines here
f8925_escapeHtml, f8926_setVisibility, f8377_consistency, f8375_physicalInputs, f8333_legacyStem, f29061_pdfEscape, f29065_pdfFileStamp, pad, f8823__anonymous_, f8817_relation, f8804_sinkFor, f8832_encode, f10_buildReview, f1635_csvCell, f1609_displayDate, f9321_relationshipSummary, f9348_repdUpdatedTimestamp, f9113_deepFreeze, f9185_updateChart, f9203_signalLabel, f9083_round2, f130674_compile, f9209_validPayload, f9210_payloadTime, f1597__anonymous_, f1598_escapeHtml, f9061_startPlugins, f9079_normaliseProject, f9080_titleCase, f9081_isFinanceEvent
Cannot conclude
Whether this code runs, is used by a live app today, or is correct. This is a static reading.
Evidence
stars@030ebc202d35959fecd162327892f671d1d9a0cc library/standalone.mjs:540-1239 · blob fc3d8c8b93e14d4a56b8a26da47071d60bc5bc4d · GitHub at these lines
State
achieves: comment · context: readme_derived · stage: output · effects: dom, filesystem, network, storage · domain stage: unknown · users: none · canonical: unknown
export const f8925_escapeHtml = function escapeHtml(value) {
    return String(value == null ? '' : value)
      .replace(/[&<>"]/g, (character) => ({
        '&': '&amp;', '<': '&lt;', '>': '&gt;', '"': '&quot;'
      }[character]));
  };

// Family #8926 · element #8926 · 176 places in 4 repositories · https://github.com/Ventusltd/testcode/blob/a8a215982b13d6e2f6019b40bf0bef5755719773/sandbox/202609051152/atlas/cartridges/202609051152-substation-intelligence.js#L6094-L6098
export const f8926_setVisibility = function setVisibility(map, control, visible) {
    for (const id of ['l-pn-' + control.id + '-ring', 'l-pn-' + control.id]) {
      if (map.getLayer(id)) map.setLayoutProperty(id, 'visibility', visible ? 'visible' : 'none');
    }
  };

// Family #8377 · element #8377 · 170 places in 4 repositories · https://github.com/Ventusltd/testcode/blob/a8a215982b13d6e2f6019b40bf0bef5755719773/sandbox/202609051152/atlas/cartridges/202609050354-sld-sandbox-v9-8.js#L778-L847
export const f8377_consistency = function consistency(inputs, stats) {
    const i = inputs;
    const string = i.mode === 'string';

    const inverterAcMw = string
      ? (stats.total_blocks * i.y_invs * i.string_inv_kva) / 1000
      : stats.total_blocks * i.inv_ac_mw_c;
    const skidAcMva = string
      ? stats.total_blocks * i.string_skid_mva
      : (i.mv_per_ring_c * i.rings_c) * i.central_skid_mva_c;
    const exportMva = Math.min(inverterAcMw, skidAcMva);

    /* Three ratios, three names. They describe different pairs of things and
       collapsing them is how a plant specified at 1.2 gets reported as 2.4.

         design    array DC MWp / inverter AC MW    what "DC/AC" means
         export    array DC MWp / export MVA        what drives clipping
         headroom  inverter AC MW / export MVA      how hard the inverters are
                                                    pushed against their skids

       The third is the one that says whether the inverters are oversized
       against the transformers, and in this design they deliberately are. */
    const designRatio = inverterAcMw > 0 ? stats.dc_mwp / inverterAcMw : null;
    const exportRatio = exportMva > 0 ? stats.dc_mwp / exportMva : null;
    const headroomRatio = exportMva > 0 ? inverterAcMw / exportMva : null;
    const statedRatio = string ? Number(i.dc_ac_ratio) : (
      i.inv_ac_mw_c > 0 ? i.inv_dc_mw_c / i.inv_ac_mw_c : null);

    const notes = [];
    /* Descriptive, not a verdict.
       An earlier version of this called a design ratio below one a
       contradiction that "nobody builds". That was wrong about this design:
       the reference sandbox documents 28 string inverters at 352 kVA making
       9,856 kVA ahead of an 8.96 MVA skid, and oversizing inverters against
       the transformer is a deliberate choice, not an arithmetic fault. The
       panel states the number and what it means; it does not grade it. */
    if (Number.isFinite(designRatio) && designRatio < 1) {
      notes.push('Array DC divided by inverter AC is ' + designRatio.toFixed(2)
        + ' from the module, string and inverter counts shown.');
    }
    // The stated ratio is an instruction. If the hardware does not honour it,
    // the hardware is what will be built.
    if (Number.isFinite(designRatio) && Number.isFinite(statedRatio)
        && statedRatio > 0 && Math.abs(designRatio - statedRatio) / statedRatio > 0.05) {
      notes.push('Stated DC/AC ' + statedRatio.toFixed(2) + ', but the module '
        + 'and inverter counts give ' + designRatio.toFixed(2)
        + '. The model displays both and does not rewrite either input.');
    }
    // The transformers, not the inverters, set the export.
    if (Number.isFinite(inverterAcMw) && Number.isFinite(skidAcMva)
        && inverterAcMw > skidAcMva * 1.001) {
      // Stated as the design fact it is, with the ratio, not as a fault.
      notes.push('Inverters total ' + inverterAcMw.toFixed(1) + ' MW against '
        + skidAcMva.toFixed(1) + ' MVA of skid transformer, a ratio of '
        + (headroomRatio || 0).toFixed(2) + '. Export is set by the '
        + 'lower nameplate in this screening model. The connection agreement '
        + 'and electrical design determine the applicable export constraint.');
    }
    return {
      dc_mwp: stats.dc_mwp,
      inverter_ac_mw: inverterAcMw,
      skid_ac_mva: skidAcMva,
      export_mva: exportMva,
      design_dc_ac: designRatio,
      export_dc_ac: exportRatio,
      inverter_to_export: headroomRatio,
      stated_dc_ac: Number.isFinite(statedRatio) ? statedRatio : null,
      notes,
    };
  };

// Family #8375 · element #8375 · 164 places in 4 repositories · https://github.com/Ventusltd/testcode/blob/a8a215982b13d6e2f6019b40bf0bef5755719773/sandbox/202609051152/atlas/cartridges/202609050354-sld-sandbox-v9-8.js#L689-L701
export const f8375_physicalInputs = function physicalInputs(inputs) {
    const i = inputs;
    if (i.mode === 'central') {
      return {
        mod_wp: i.mod_wp_c, mod_l: i.mod_l_c, mod_w: i.mod_w_c,
        gcr: i.gcr_c, gross_factor: i.gross_factor_c,
      };
    }
    return {
      mod_wp: i.mod_wp, mod_l: i.mod_l, mod_w: i.mod_w,
      gcr: i.gcr, gross_factor: i.gross_factor,
    };
  };

// Family #8333 · element #8333 · 80 places in 4 repositories · https://github.com/Ventusltd/testcode/blob/a8a215982b13d6e2f6019b40bf0bef5755719773/sandbox/202609051152/atlas/cartridges/202609041945-streaming-parquet-bridge-v9-5.js#L88-L94
export const f8333_legacyStem = function legacyStem(pathname) {
    const name = decodeURIComponent(pathname.split('/').pop() || '').toLowerCase();
    if (name === 'repd_master.json') return 'repd_master_v8_oracle';
    if (name === 'heavy_emitters_uk.json') return 'heavy_emitters_uk';
    if (name.endsWith('.geojson')) return name.slice(0, -8);
    return '';
  };

// Family #29061 · element #29061 · 41 places in 4 repositories · https://github.com/Ventusltd/testcode/blob/a8a215982b13d6e2f6019b40bf0bef5755719773/sandbox/202609060418/atlas/cartridges/202609060418-substation-intelligence.js#L5264-L5270
export const f29061_pdfEscape = function pdfEscape(text) {
return String(text == null ? '' : text)
.replace(/\\/g, '\\\\')
.replace(/\(/g, '\\(')
.replace(/\)/g, '\\)')
.replace(/[^\x20-\x7e]/g, '');
};

// Family #29065 · element #29065 · 41 places in 4 repositories · https://github.com/Ventusltd/testcode/blob/a8a215982b13d6e2f6019b40bf0bef5755719773/sandbox/202609060418/atlas/cartridges/202609060418-substation-intelligence.js#L5347-L5352
export const f29065_pdfFileStamp = function pdfFileStamp() {
var d = new Date();
var pad = function (n) { return (n < 10 ? '0' : '') + n; };
return d.getUTCFullYear() + pad(d.getUTCMonth() + 1) + pad(d.getUTCDate())
+ pad(d.getUTCHours()) + pad(d.getUTCMinutes());
};

// Family #8823 · element #8823 · 352 places in 4 repositories · https://github.com/Ventusltd/testcode/blob/a8a215982b13d6e2f6019b40bf0bef5755719773/sandbox/202609051152/atlas/cartridges/202609051152-substation-intelligence.js#L3751-L3753
export const f8823__anonymous_ = (a, b) =>
        String(a.from_node).localeCompare(String(b.from_node))
        || String(a.to_node).localeCompare(String(b.to_node));

// Family #8817 · element #8817 · 176 places in 4 repositories · https://github.com/Ventusltd/testcode/blob/a8a215982b13d6e2f6019b40bf0bef5755719773/sandbox/202609051152/atlas/cartridges/202609051152-substation-intelligence.js#L3622-L3625
export const f8817_relation = function relation(nearOwner, farOwner) {
      if (nearOwner == null || farOwner == null) return 'undetermined';
      return nearOwner === farOwner ? 'internal' : 'boundary';
    };

// Family #8804 · element #8804 · 175 places in 4 repositories · https://github.com/Ventusltd/testcode/blob/a8a215982b13d6e2f6019b40bf0bef5755719773/sandbox/202609051152/atlas/cartridges/202609051152-substation-intelligence.js#L2956-L2972
export const f8804_sinkFor = function sinkFor(model, atNode) {
    if (!model || typeof model.componentOf !== 'function') return null;
    const atBus = model.busOf(atNode);
    const component = model.componentOf(atBus);
    let best = null;
    let bestDegree = -1;
    for (const bus of model.buses) {
      if (bus === atBus) continue;
      if (model.componentOf(bus) !== component) continue;
      const d = model.degreeOf(bus);
      if (d > bestDegree || (d === bestDegree && best !== null && bus < best)) {
        best = bus;
        bestDegree = d;
      }
    }
    return best;
  };

// Family #8832 · element #8832 · 172 places in 4 repositories · https://github.com/Ventusltd/testcode/blob/a8a215982b13d6e2f6019b40bf0bef5755719773/sandbox/202609051152/atlas/cartridges/202609051152-substation-intelligence.js#L3954-L3959
export const f8832_encode = function encode(text) {
    try {
      return typeof TextEncoder === 'function'
        ? new TextEncoder().encode(text) : null;
    } catch (_) { return null; }
  };

// Family #10 · element #10 · 38 places in 4 repositories · https://github.com/Ventusltd/testcode/blob/a8a215982b13d6e2f6019b40bf0bef5755719773/sandbox/202609051905/layer-apps/solar-bess-topology-v7/cable-geometry-visualiser/calculations.js#L120-L164
export const f10_buildReview = function buildReview(inputs, layout) {
        const inputConflicts = [];
        const reviewPoints   = [];
        const standingAssumptions = [
            "Within group cable spacing is assumed touching unless separately modelled.",
            "Mixed service visual uses one worst case OD for all shown services and is schematic only.",
            "Bend model is a single cable body sweep only.",
            "Burial depth is recorded as an indicative input only.",
            "4-core and 5-core multicore formations are drawn as a single cable OD."
        ];

        if (inputs.grouping_basis === "mixed_service")
            reviewPoints.push("Mixed service grouping selected. Visual remains schematic and uses one worst case OD for all shown services.");

        if (inputs.spacing_basis === "centre_to_centre") {
            if (inputs.spacing_h_mm <= inputs.cable_od_mm)
                inputConflicts.push("Horizontal centre to centre spacing is less than or equal to cable outer diameter. This collapses to touching or overlap risk.");
            if (inputs.spacing_v_mm <= inputs.cable_od_mm)
                inputConflicts.push("Vertical centre to centre spacing is less than or equal to cable outer diameter. This collapses to touching or overlap risk.");
        }

        if (inputs.spacing_basis === "touching" && inputs.grouping_basis !== "same_circuit")
            reviewPoints.push("Touching groups outside a single circuit basis should be reviewed.");
        if (layout.formationWidth >= 3000)
            reviewPoints.push("Formation width is at or above 3000 mm and may need corridor review.");
        if (layout.formationDepth > 2000)
            reviewPoints.push("Formation depth is above 2000 mm and may need trench or enclosure review.");
        if (inputs.burial_depth_mm > 3000)
            reviewPoints.push("Burial depth input is unusually deep. Confirm civil, thermal and utility basis.");
        if (inputs.bend_factor < 12)
            reviewPoints.push("Low bend factor entered. Confirm against manufacturer installation data. This is not a generic limit.");
        if (inputs.service_type === "mv" && inputs.formation_type === "trefoil_single_row" && layout.approxGroupCtcH < (inputs.cable_od_mm * 3))
            reviewPoints.push("33kV trefoil group spacing is tight. Check separation against the relevant rating and installation standard before use.");
        if (layout.hasUnevenLastRow)
            reviewPoints.push("Worst case envelope is based on the fullest row. The final row is shallower or narrower than the plotted maximum envelope.");

        const worstSeverity = inputConflicts.length ? "error" : reviewPoints.length ? "warn" : "ok";
        const summary = worstSeverity === "ok"
            ? "Geometry capture complete. No active conflicts or review points detected."
            : worstSeverity === "warn"
                ? "Geometry capture complete with review points."
                : "Input conflict detected. Review before using output.";

        return { inputConflicts, reviewPoints, standingAssumptions, worstSeverity, summary };
    };

// Family #1635 · element #1635 · 1087 places in 3 repositories · https://github.com/Ventusltd/testcode/blob/a8a215982b13d6e2f6019b40bf0bef5755719773/sandbox/202609051152/pipeline/scripts/plugins/projects-v9-1.js#L69-L73
export const f1635_csvCell = function csvCell(value) {
  let text = value === null || value === undefined ? "" : String(value);
  if (/^(?:[=+\-@]|\s+[=+\-@]|\t|\r|\n)/u.test(text)) text = `'${text}`;
  return `"${text.replaceAll('"', '""')}"`;
};

// Family #1609 · element #1609 · 935 places in 3 repositories · https://github.com/Ventusltd/testcode/blob/a8a215982b13d6e2f6019b40bf0bef5755719773/sandbox/202609051152/pipeline/scripts/plugins/projects-v9-2.js#L49-L53
export const f1609_displayDate = function displayDate(value) {
  if (!value) return "not supplied by REPD";
  const [year, month, day] = String(value).split("-");
  return year && month && day ? `${day}/${month}/${year}` : String(value);
};

// Family #9321 · element #9321 · 832 places in 3 repositories · https://github.com/Ventusltd/testcode/blob/a8a215982b13d6e2f6019b40bf0bef5755719773/sandbox/202609051152/pipeline/scripts/plugins/projects-v9-2.js#L55-L60
export const f9321_relationshipSummary = function relationshipSummary(project) {
  const development = Array.isArray(project.development_repd_refs) ? project.development_repd_refs.length : 0;
  const direct = Array.isArray(project.direct_related_repd_refs) ? project.direct_related_repd_refs.length : 0;
  const siblings = Array.isArray(project.planning_sibling_repd_refs) ? project.planning_sibling_repd_refs.length : 0;
  return `${development} development · ${direct} direct · ${siblings} planning sibling record(s)`;
};

// Family #9348 · element #9348 · 680 places in 3 repositories · https://github.com/Ventusltd/testcode/blob/a8a215982b13d6e2f6019b40bf0bef5755719773/sandbox/202609051152/pipeline/scripts/plugins/projects-v9-3.js#L57-L61
export const f9348_repdUpdatedTimestamp = function repdUpdatedTimestamp(project) {
  if (!project.repd_record_updated) return null;
  const value = Date.parse(`${project.repd_record_updated}T00:00:00Z`);
  return Number.isFinite(value) ? value : null;
};

// Family #9113 · element #9113 · 468 places in 3 repositories · https://github.com/Ventusltd/testcode/blob/a8a215982b13d6e2f6019b40bf0bef5755719773/sandbox/202609051152/pipeline/scripts/data/canonical-projects.js#L77-L81
export const f9113_deepFreeze = function deepFreeze(value) {
  if (!value || typeof value !== "object" || Object.isFrozen(value)) return value;
  Object.values(value).forEach(deepFreeze);
  return Object.freeze(value);
};

// Family #9185 · element #9185 · 441 places in 3 repositories · https://github.com/Ventusltd/testcode/blob/a8a215982b13d6e2f6019b40bf0bef5755719773/sandbox/202609051152/pipeline/scripts/plugins/gauges-v9-1.js#L10-L13
export const f9185_updateChart = function updateChart(chart, value, maximum) {
  chart.data.datasets[0].data = [value, Math.max(maximum - value, 0)];
  chart.update();
};

// Family #9203 · element #9203 · 455 places in 3 repositories · https://github.com/Ventusltd/testcode/blob/a8a215982b13d6e2f6019b40bf0bef5755719773/sandbox/202609051152/pipeline/scripts/plugins/newspaper-v9-2.js#L28-L37
export const f9203_signalLabel = function signalLabel(item) {
  const event = String(item.event || "PROJECT UPDATE").toUpperCase();
  if (event === "CONSENT") return { label: "APPROVED*", cls: "approved" };
  if (event === "OPERATIONAL") return { label: "OPERATIONAL*", cls: "operational" };
  if (event === "CONSTRUCTION") return { label: "CONSTRUCTION*", cls: "construction" };
  if (["FINANCIAL CLOSE", "ACQUISITION"].includes(event)) {
    return { label: event === "ACQUISITION" ? "M&A*" : "FINANCED*", cls: "finance" };
  }
  return { label: `${event}*`.slice(0, 22), cls: "" };
};

// Family #9083 · element #9083 · 314 places in 3 repositories · https://github.com/Ventusltd/testcode/blob/a8a215982b13d6e2f6019b40bf0bef5755719773/sandbox/202609051152/pipeline/scripts/data/canonical-projects-v9-1.js#L9-L11
export const f9083_round2 = function round2(value) {
  return Math.round((value + Number.EPSILON) * 100) / 100;
};

// Family #130674 · element #130674 · 58 places in 3 repositories · https://github.com/Ventusltd/galaxies-wafers/blob/5814793812add74605660fa821e6a39b8de80588/app.mjs#L199-L203
export const f130674_compile = function compile(g, type, src) {
  const s = g.createShader(type); g.shaderSource(s, src); g.compileShader(s);
  if (!g.getShaderParameter(s, g.COMPILE_STATUS)) throw new Error(g.getShaderInfoLog(s));
  return s;
};

// Family #9209 · element #9209 · 308 places in 3 repositories · https://github.com/Ventusltd/testcode/blob/a8a215982b13d6e2f6019b40bf0bef5755719773/sandbox/202609051152/pipeline/scripts/plugins/newspaper-v9-2.js#L114-L118
export const f9209_validPayload = function validPayload(payload) {
  return payload
    && Array.isArray(payload.items)
    && Number.isFinite(Number(payload.headline_count ?? payload.items.length));
};

// Family #9210 · element #9210 · 308 places in 3 repositories · https://github.com/Ventusltd/testcode/blob/a8a215982b13d6e2f6019b40bf0bef5755719773/sandbox/202609051152/pipeline/scripts/plugins/newspaper-v9-2.js#L120-L123
export const f9210_payloadTime = function payloadTime(payload) {
  const timestamp = Date.parse(String(payload && payload.updated || ""));
  return Number.isFinite(timestamp) ? timestamp : 0;
};

// Family #1597 · element #1597 · 265 places in 3 repositories · https://github.com/Ventusltd/testcode/blob/a8a215982b13d6e2f6019b40bf0bef5755719773/sandbox/202609051152/pipeline/scripts/core/utils.js#L2-L8
export const f1597__anonymous_ = (character) => ({
    "&": "&amp;",
    "<": "&lt;",
    ">": "&gt;",
    '"': "&quot;",
    "'": "&#39;",
  })[character];

// Family #1598 · element #9078 · 265 places in 3 repositories · https://github.com/Ventusltd/testcode/blob/a8a215982b13d6e2f6019b40bf0bef5755719773/sandbox/202609051152/pipeline/scripts/core/utils.js#L1-L9
export const f1598_escapeHtml = function escapeHtml(value) {
  return String(value ?? "").replace(/[&<>"']/g, (character) => ({
    "&": "&amp;",
    "<": "&lt;",
    ">": "&gt;",
    '"': "&quot;",
    "'": "&#39;",
  })[character]);
};

// Family #9061 · element #9061 · 162 places in 3 repositories · https://github.com/Ventusltd/testcode/blob/a8a215982b13d6e2f6019b40bf0bef5755719773/sandbox/202609051152/pipeline/scripts/core/plugin-host.js#L1-L14
export const f9061_startPlugins = function startPlugins(plugins) {
  const started = new Set();
  for (const plugin of plugins) {
    if (!plugin || typeof plugin.id !== "string" || typeof plugin.start !== "function") {
      throw new TypeError("Every V7 plugin requires an id and start function.");
    }
    if (started.has(plugin.id)) throw new Error(`Duplicate V7 plugin id: ${plugin.id}`);
    const missing = (plugin.dependsOn || []).filter((dependency) => !started.has(dependency));
    if (missing.length) throw new Error(`V7 plugin ${plugin.id} has unmet dependencies: ${missing.join(", ")}`);
    plugin.start();
    started.add(plugin.id);
  }
  return Object.freeze([...started]);
};

// Family #9079 · element #9079 · 162 places in 3 repositories · https://github.com/Ventusltd/testcode/blob/a8a215982b13d6e2f6019b40bf0bef5755719773/sandbox/202609051152/pipeline/scripts/core/utils.js#L11-L18
export const f9079_normaliseProject = function normaliseProject(value) {
  return String(value || "")
    .toLowerCase()
    .replace(/&/g, " and ")
    .replace(/[^a-z0-9]+/g, " ")
    .replace(/\s+/g, " ")
    .trim();
};

// Family #9080 · element #9080 · 162 places in 3 repositories · https://github.com/Ventusltd/testcode/blob/a8a215982b13d6e2f6019b40bf0bef5755719773/sandbox/202609051152/pipeline/scripts/core/utils.js#L20-L24
export const f9080_titleCase = function titleCase(value) {
  return value
    ? value.toLowerCase().split(" ").map((word) => word.charAt(0).toUpperCase() + word.slice(1)).join(" ")
    : "";
};

// Family #9081 · element #9081 · 162 places in 3 repositories · https://github.com/Ventusltd/testcode/blob/a8a215982b13d6e2f6019b40bf0bef5755719773/sandbox/202609051152/pipeline/scripts/core/utils.js#L26-L28
export const f9081_isFinanceEvent = function isFinanceEvent(event) {
  return ["FINANCIAL CLOSE", "ACQUISITION"].includes(String(event || "").toUpperCase());
};

// Family #9226 · element #9226 · 301 places in 3 repositories · https://github.com/Ventusltd/testcode/blob/a8a215982b13d6e2f6019b40bf0bef5755719773/sandbox/202609051152/pipeline/scripts/plugins/newspaper-v9-5-1.js#L113-L116
export const f9226_payloadTime = function payloadTime(payload) {
  const timestamp = Date.parse(String(payload?.updated || ""));
  return Number.isFinite(timestamp) ? timestamp : 0;
};

// Family #1336 · element #1336 · 79 places in 3 repositories · https://github.com/Ventusltd/testcode/blob/a8a215982b13d6e2f6019b40bf0bef5755719773/sandbox/202609051901/layer-apps/solar-bess-topology-v7/gis-sld-financial-sandbox/gis-sld-v5-helpers.js#L34-L38
export const f1336_money = function money(v) {
    const rounded = Math.round(v);
    if (rounded < 0) return "-£" + Math.abs(rounded).toLocaleString();
    return "£" + rounded.toLocaleString();
};

// Family #1339 · element #1339 · 79 places in 3 repositories · https://github.com/Ventusltd/testcode/blob/a8a215982b13d6e2f6019b40bf0bef5755719773/sandbox/202609051901/layer-apps/solar-bess-topology-v7/gis-sld-financial-sandbox/gis-sld-v5-helpers.js#L48-L52
export const f1339_isValidLngLat = function isValidLngLat(c) {
    return Array.isArray(c) && c.length >= 2
        && Number.isFinite(+c[0]) && Number.isFinite(+c[1])
        && +c[0] >= -180 && +c[0] <= 180 && +c[1] >= -90 && +c[1] <= 90;
};

// Family #1340 · element #1340 · 79 places in 3 repositories · https://github.com/Ventusltd/testcode/blob/a8a215982b13d6e2f6019b40bf0bef5755719773/sandbox/202609051901/layer-apps/solar-bess-topology-v7/gis-sld-financial-sandbox/gis-sld-v5-helpers.js#L54-L59
export const f1340_pickProp = function pickProp(obj, keys, fallback = null) {
    for (const k of keys) {
        if (obj && obj[k] !== undefined && obj[k] !== null && obj[k] !== "") return obj[k];
    }
    return fallback;
};

// Family #130710 · element #130710 · 42 places in 3 repositories · https://github.com/Ventusltd/galaxies-wafers/blob/5814793812add74605660fa821e6a39b8de80588/lib.mjs#L38-L46
export const f130710_parseKey = function parseKey(raw) {
  if (typeof raw !== 'string') raw = String(raw ?? '');
  const s = raw.trim().replace(/[ ,_]/g, '');
  if (!/^[0-9]+$/.test(s)) return { ok: false, why: 'a line number is digits only' };
  const n = Number(s);
  if (!Number.isSafeInteger(n)) return { ok: false, why: 'that number is too large to be held exactly' };
  if (n < 1) return { ok: false, why: 'the numbering starts at 1' };
  return { ok: true, key: n };
};

// Family #130711 · element #130711 · 42 places in 3 repositories · https://github.com/Ventusltd/galaxies-wafers/blob/5814793812add74605660fa821e6a39b8de80588/lib.mjs#L48-L56
export const f130711_indexOfKey = function indexOfKey(keys, key) {
  let lo = 0, hi = keys.length - 1;
  while (lo <= hi) {
    const m = (lo + hi) >> 1;
    if (keys[m] === key) return m;
    if (keys[m] < key) lo = m + 1; else hi = m - 1;
  }
  return -1;
};

// Family #130712 · element #130712 · 42 places in 3 repositories · https://github.com/Ventusltd/galaxies-wafers/blob/5814793812add74605660fa821e6a39b8de80588/lib.mjs#L59-L70
export const f130712_ownersOf = function ownersOf(families, famLines) {
  const owner = new Map();
  for (let f = 0; f < families.length; f++) {
    const o = families[f].lineOffset, c = families[f].lineCount;
    for (let i = o; i < o + c; i++) {
      const k = famLines[i], cur = owner.get(k);
      if (cur === undefined) owner.set(k, [f]);
      else if (cur[cur.length - 1] !== f) cur.push(f);
    }
  }
  return owner;
};

// Family #130713 · element #130713 · 42 places in 3 repositories · https://github.com/Ventusltd/galaxies-wafers/blob/5814793812add74605660fa821e6a39b8de80588/lib.mjs#L87-L91
export const f130713_fanoutCount = function fanoutCount(owner) {
  let n = 0;
  for (const v of owner.values()) if (v.length > 1) n++;
  return n;
};

// Family #130715 · element #130715 · 42 places in 3 repositories · https://github.com/Ventusltd/galaxies-wafers/blob/5814793812add74605660fa821e6a39b8de80588/lib.mjs#L114-L117
export const f130715_esc = function esc(s) {
  return String(s ?? '').replace(/[&<>"']/g, c =>
    ({ '&': '&amp;', '<': '&lt;', '>': '&gt;', '"': '&quot;', "'": '&#39;' }[c]));
};

// Family #9062 · element #9062 · 158 places in 3 repositories · https://github.com/Ventusltd/testcode/blob/a8a215982b13d6e2f6019b40bf0bef5755719773/sandbox/202609051152/pipeline/scripts/core/project-filter-v9-2.js#L3-L12
export const f9062_normaliseSearchV9_2 = function normaliseSearchV9_2(value) {
  return String(value ?? "")
    .normalize("NFKD")
    .replace(/[\u0300-\u036f]/g, "")
    .toLocaleLowerCase("en-GB")
    .replace(/&/g, " and ")
    .replace(/[^a-z0-9.-]+/g, " ")
    .replace(/\s+/g, " ")
    .trim();
};

// Family #9066 · element #9066 · 158 places in 3 repositories · https://github.com/Ventusltd/testcode/blob/a8a215982b13d6e2f6019b40bf0bef5755719773/sandbox/202609051152/pipeline/scripts/core/project-filter-v9-2.js#L60-L72
export const f9066_summariseProjectsV9_2 = function summariseProjectsV9_2(projects) {
  let capacity = 0;
  let largest = 0;
  for (const project of projects) {
    capacity += Number(project.capacity_mw) || 0;
    largest = Math.max(largest, Number(project.capacity_mw) || 0);
  }
  return {
    count: projects.length,
    capacity_mw: Math.round((capacity + Number.EPSILON) * 100) / 100,
    largest_mw: largest,
  };
};

// Family #9082 · element #9082 · 158 places in 3 repositories · https://github.com/Ventusltd/testcode/blob/a8a215982b13d6e2f6019b40bf0bef5755719773/sandbox/202609051152/pipeline/scripts/data/canonical-projects-v9-1.js#L5-L7
export const f9082_invariant = function invariant(condition, message) {
  if (!condition) throw new Error(`V9.1 canonical projects: ${message}`);
};

// Family #9177 · element #9177 · 158 places in 3 repositories · https://github.com/Ventusltd/testcode/blob/a8a215982b13d6e2f6019b40bf0bef5755719773/sandbox/202609051152/pipeline/scripts/plugins/capacity-presentation-v9-3.js#L3-L6
export const f9177_parseDisplayNumber = function parseDisplayNumber(value) {
  const numeric = Number(String(value ?? "").replaceAll(",", "").trim());
  return Number.isFinite(numeric) ? numeric : null;
};

// Family #9191 · element #9191 · 158 places in 3 repositories · https://github.com/Ventusltd/testcode/blob/a8a215982b13d6e2f6019b40bf0bef5755719773/sandbox/202609051152/pipeline/scripts/plugins/gauges-v9-2.js#L19-L25
export const f9191_formatCapacityV9_2 = function formatCapacityV9_2(value) {
  const rounded = Math.round(((Number(value) || 0) + Number.EPSILON) * 100) / 100;
  return rounded.toLocaleString("en-GB", {
    minimumFractionDigits: 0,
    maximumFractionDigits: 2,
  });
};

// Family #9192 · element #9192 · 158 places in 3 repositories · https://github.com/Ventusltd/testcode/blob/a8a215982b13d6e2f6019b40bf0bef5755719773/sandbox/202609051152/pipeline/scripts/plugins/gauges-v9-2.js#L27-L29
export const f9192_formatLargestV9_2 = function formatLargestV9_2(value) {
  return (Number(value) || 0).toLocaleString("en-GB", { maximumFractionDigits: 2 });
};

// Family #9067 · element #9067 · 156 places in 3 repositories · https://github.com/Ventusltd/testcode/blob/a8a215982b13d6e2f6019b40bf0bef5755719773/sandbox/202609051152/pipeline/scripts/core/project-state.js#L16-L25
export const f9067_defaultFilters = function defaultFilters() {
  return {
    technology: "all",
    lifecycleView: "ALL",
    officialStatus: "All",
    county: "All",
    region: "All",
    query: "",
  };
};

// Family #9070 · element #9070 · 156 places in 3 repositories · https://github.com/Ventusltd/testcode/blob/a8a215982b13d6e2f6019b40bf0bef5755719773/sandbox/202609051152/pipeline/scripts/core/project-state.js#L38-L46
export const f9070_optionsFor = function optionsFor(projects) {
  const unique = (field) => [...new Set(projects.map((project) => project[field]).filter(Boolean))]
    .sort((left, right) => left.localeCompare(right, "en-GB"));
  return Object.freeze({
    officialStatuses: Object.freeze(unique("status")),
    counties: Object.freeze(unique("county")),
    regions: Object.freeze(unique("region")),
  });
};

// Family #9072 · element #9072 · 156 places in 3 repositories · https://github.com/Ventusltd/testcode/blob/a8a215982b13d6e2f6019b40bf0bef5755719773/sandbox/202609051152/pipeline/scripts/core/project-state.js#L66-L70
export const f9072_beginCanonicalProjectLoad = function beginCanonicalProjectLoad(state) {
  state.status = state.all.length ? "refreshing" : "loading";
  state.error = null;
  return state;
};

// Family #9074 · element #9074 · 156 places in 3 repositories · https://github.com/Ventusltd/testcode/blob/a8a215982b13d6e2f6019b40bf0bef5755719773/sandbox/202609051152/pipeline/scripts/core/project-state.js#L92-L96
export const f9074_failCanonicalProjectLoad = function failCanonicalProjectLoad(state, error) {
  state.status = state.all.length ? "stale" : "error";
  state.error = error instanceof Error ? error.message : String(error || "Unknown project-data error");
  return state;
};

// Family #9106 · element #9106 · 156 places in 3 repositories · https://github.com/Ventusltd/testcode/blob/a8a215982b13d6e2f6019b40bf0bef5755719773/sandbox/202609051152/pipeline/scripts/data/canonical-projects.js#L35-L37
export const f9106_isObject = function isObject(value) {
  return value !== null && typeof value === "object" && !Array.isArray(value);
};

// Family #9107 · element #9107 · 156 places in 3 repositories · https://github.com/Ventusltd/testcode/blob/a8a215982b13d6e2f6019b40bf0bef5755719773/sandbox/202609051152/pipeline/scripts/data/canonical-projects.js#L39-L41
export const f9107_isFiniteNumber = function isFiniteNumber(value) {
  return typeof value === "number" && Number.isFinite(value);
};

// Family #9108 · element #9108 · 156 places in 3 repositories · https://github.com/Ventusltd/testcode/blob/a8a215982b13d6e2f6019b40bf0bef5755719773/sandbox/202609051152/pipeline/scripts/data/canonical-projects.js#L43-L47
export const f9108_isIsoDate = function isIsoDate(value) {
  if (typeof value !== "string" || !/^\d{4}-\d{2}-\d{2}$/.test(value)) return false;
  const parsed = new Date(`${value}T00:00:00Z`);
  return Number.isFinite(parsed.getTime()) && parsed.toISOString().slice(0, 10) === value;
};

// Family #9114 · element #9114 · 156 places in 3 repositories · https://github.com/Ventusltd/testcode/blob/a8a215982b13d6e2f6019b40bf0bef5755719773/sandbox/202609051152/pipeline/scripts/data/canonical-projects.js#L83-L87
export const f9114_isSameOriginRelativePath = function isSameOriginRelativePath(path) {
  if (typeof path !== "string" || !path || path.startsWith("/") || path.startsWith("//")) return false;
  if (/^[a-z][a-z\d+.-]*:/i.test(path)) return false;
  return !path.split("/").includes("..");
};

// Family #9118 · element #9118 · 156 places in 3 repositories · https://github.com/Ventusltd/testcode/blob/a8a215982b13d6e2f6019b40bf0bef5755719773/sandbox/202609051152/pipeline/scripts/data/canonical-projects.js#L198-L201
export const f9118__anonymous_ = (left, right) => (
    right.capacity_mw - left.capacity_mw
    || left.gg_project_id.localeCompare(right.gg_project_id)
  );

// Family #9119 · element #9119 · 156 places in 3 repositories · https://github.com/Ventusltd/testcode/blob/a8a215982b13d6e2f6019b40bf0bef5755719773/sandbox/202609051152/pipeline/scripts/data/canonical-projects.js#L197-L202
export const f9119_sortCanonicalProjects = function sortCanonicalProjects(projects) {
  return [...projects].sort((left, right) => (
    right.capacity_mw - left.capacity_mw
    || left.gg_project_id.localeCompare(right.gg_project_id)
  ));
};

// Family #9124 · element #9124 · 156 places in 3 repositories · https://github.com/Ventusltd/testcode/blob/a8a215982b13d6e2f6019b40bf0bef5755719773/sandbox/202609051152/pipeline/scripts/data/canonical-projects.js#L227-L240
export const f9124_searchCanonicalProjects = function searchCanonicalProjects(projects, query, fields) {
  const needle = String(query || "").trim().toLocaleLowerCase("en-GB");
  if (!needle) return [...projects];
  const direct = projects.filter((project) => (
    project.repd_ref.toLocaleLowerCase("en-GB") === needle
    || project.gg_project_id.toLocaleLowerCase("en-GB") === needle
  ));
  if (direct.length) return direct;
  return projects.filter((project) => fields.some((field) => {
    const value = project[field];
    const values = Array.isArray(value) ? value : [value];
    return values.some((item) => String(item ?? "").toLocaleLowerCase("en-GB").includes(needle));
  }));
};

// Family #9135 · element #9135 · 156 places in 3 repositories · https://github.com/Ventusltd/testcode/blob/a8a215982b13d6e2f6019b40bf0bef5755719773/sandbox/202609051152/pipeline/scripts/plugins/canonical-project-controls.js#L21-L23
export const f9135_invariant = function invariant(condition, message) {
  if (!condition) throw new Error(`V7.2 canonical controls: ${message}`);
};

// Family #9137 · element #9137 · 156 places in 3 repositories · https://github.com/Ventusltd/testcode/blob/a8a215982b13d6e2f6019b40bf0bef5755719773/sandbox/202609051152/pipeline/scripts/plugins/canonical-project-controls.js#L31-L33
export const f9137_hasValidatedModel = function hasValidatedModel(state) {
  return Boolean(state?.contract && Array.isArray(state.all) && state.all.length > 0);
};

// Family #9140 · element #9140 · 156 places in 3 repositories · https://github.com/Ventusltd/testcode/blob/a8a215982b13d6e2f6019b40bf0bef5755719773/sandbox/202609051152/pipeline/scripts/plugins/canonical-project-controls.js#L54-L57
export const f9140__anonymous_ = (result, project) => {
    result[project.technology] = (result[project.technology] || 0) + 1;
    return result;
  };

// Family #9142 · element #9142 · 156 places in 3 repositories · https://github.com/Ventusltd/testcode/blob/a8a215982b13d6e2f6019b40bf0bef5755719773/sandbox/202609051152/pipeline/scripts/plugins/canonical-project-controls.js#L52-L66
export const f9142_technologyOptions = function technologyOptions(state) {
  const presentation = state.contract.interface.technology_labels_and_units;
  const counts = state.all.reduce((result, project) => {
    result[project.technology] = (result[project.technology] || 0) + 1;
    return result;
  }, { solar: 0, bess: 0 });
  return [
    { id: "all", label: "All", unit: null, count: state.all.length },
    { id: "solar", ...presentation.solar, count: counts.solar },
    { id: "bess", ...presentation.bess, count: counts.bess },
  ].map((option) => ({
    ...option,
    selected: state.filters.technology === option.id,
  }));
};

// Family #9151 · element #9151 · 156 places in 3 repositories · https://github.com/Ventusltd/testcode/blob/a8a215982b13d6e2f6019b40bf0bef5755719773/sandbox/202609051152/pipeline/scripts/plugins/canonical-project-export.js#L9-L11
export const f9151_invariant = function invariant(condition, message) {
  if (!condition) throw new Error(`V7.2 canonical export: ${message}`);
};

// Family #9152 · element #9152 · 156 places in 3 repositories · https://github.com/Ventusltd/testcode/blob/a8a215982b13d6e2f6019b40bf0bef5755719773/sandbox/202609051152/pipeline/scripts/plugins/canonical-project-export.js#L13-L15
export const f9152_joinRefs = function joinRefs(values) {
  return values.join("|");
};

// Family #9153 · element #9153 · 156 places in 3 repositories · https://github.com/Ventusltd/testcode/blob/a8a215982b13d6e2f6019b40bf0bef5755719773/sandbox/202609051152/pipeline/scripts/plugins/canonical-project-export.js#L71-L74
export const f9153_neutraliseSpreadsheetFormula = function neutraliseSpreadsheetFormula(value) {
  if (typeof value !== "string") return value;
  return /^(?:[=+\-@]|\s+[=+\-@]|\t|\r|\n)/u.test(value) ? `'${value}` : value;
};

// Family #9158 · element #9158 · 156 places in 3 repositories · https://github.com/Ventusltd/testcode/blob/a8a215982b13d6e2f6019b40bf0bef5755719773/sandbox/202609051152/pipeline/scripts/plugins/canonical-project-table.js#L7-L9
export const f9158_invariant = function invariant(condition, message) {
  if (!condition) throw new Error(`V7.2 canonical table: ${message}`);
};

// Family #9160 · element #9160 · 156 places in 3 repositories · https://github.com/Ventusltd/testcode/blob/a8a215982b13d6e2f6019b40bf0bef5755719773/sandbox/202609051152/pipeline/scripts/plugins/canonical-project-table.js#L17-L25
export const f9160_hasValidatedModel = function hasValidatedModel(state) {
  return Boolean(
    state?.contract
    && state?.metadata
    && Array.isArray(state.all)
    && state.all.length > 0
    && Array.isArray(state.filtered),
  );
};

// Family #9162 · element #9162 · 156 places in 3 repositories · https://github.com/Ventusltd/testcode/blob/a8a215982b13d6e2f6019b40bf0bef5755719773/sandbox/202609051152/pipeline/scripts/plugins/canonical-project-table.js#L27-L37
export const f9162_isCanonicalOrder = function isCanonicalOrder(projects) {
  return projects.every((project, index) => {
    if (index === 0) return true;
    const previous = projects[index - 1];
    return previous.capacity_mw > project.capacity_mw
      || (
        previous.capacity_mw === project.capacity_mw
        && previous.gg_project_id.localeCompare(project.gg_project_id) <= 0
      );
  });
};

// Family #9163 · element #9163 · 156 places in 3 repositories · https://github.com/Ventusltd/testcode/blob/a8a215982b13d6e2f6019b40bf0bef5755719773/sandbox/202609051152/pipeline/scripts/plugins/canonical-project-table.js#L39-L41
export const f9163_displayOfficial = function displayOfficial(value, missingValueLabel) {
  return value === null || value === undefined || value === "" ? missingValueLabel : String(value);
};

// Family #9164 · element #9164 · 156 places in 3 repositories · https://github.com/Ventusltd/testcode/blob/a8a215982b13d6e2f6019b40bf0bef5755719773/sandbox/202609051152/pipeline/scripts/plugins/canonical-project-table.js#L43-L45
export const f9164_displayCapacity = function displayCapacity(project) {
  return `${new Intl.NumberFormat("en-GB", { maximumFractionDigits: 2 }).format(project.capacity_mw)} ${project.capacity_unit}`;
};

// Family #9167 · element #9167 · 156 places in 3 repositories · https://github.com/Ventusltd/testcode/blob/a8a215982b13d6e2f6019b40bf0bef5755719773/sandbox/202609051152/pipeline/scripts/plugins/canonical-project-table.js#L62-L67
export const f9167_sameFlatRecord = function sameFlatRecord(left, right) {
  if (!left || !right || typeof left !== "object" || typeof right !== "object") return false;
  const keys = Object.keys(left).sort();
  return keys.join("\n") === Object.keys(right).sort().join("\n")
    && keys.every((key) => left[key] === right[key]);
};

// Family #9168 · element #9168 · 156 places in 3 repositories · https://github.com/Ventusltd/testcode/blob/a8a215982b13d6e2f6019b40bf0bef5755719773/sandbox/202609051152/pipeline/scripts/plugins/canonical-project-table.js#L69-L74
export const f9168_buildCanonicalNewsSearchUrl = function buildCanonicalNewsSearchUrl(project) {
  const url = new URL("https://www.google.com/search");
  url.searchParams.set("q", `${project.name} ${project.technology_label} UK`);
  url.searchParams.set("tbm", "nws");
  return url.href;
};

// Family #9217 · element #9217 · 155 places in 3 repositories · https://github.com/Ventusltd/testcode/blob/a8a215982b13d6e2f6019b40bf0bef5755719773/sandbox/202609051152/pipeline/scripts/plugins/newspaper-v9-5-1.js#L12-L18
export const f9217_canonicalItem = function canonicalItem(item) {
  return item
    && item.role === "PRIMARY_MATCH"
    && item.eligible_for_news_signal === true
    && String(item.repd_ref || "")
    && item.gg_project_id === `GG2050-REPD-${item.repd_ref}`;
};

// Family #9198 · element #9198 · 154 places in 3 repositories · https://github.com/Ventusltd/testcode/blob/a8a215982b13d6e2f6019b40bf0bef5755719773/sandbox/202609051152/pipeline/scripts/plugins/gauges.js#L32-L36
export const f9198_totalFor = function totalFor(projects, technology) {
  return projects
    .filter((project) => project.technology === technology)
    .reduce((sum, project) => sum + project.capacity_mw, 0);
};

// Family #9221 · element #9221 · 154 places in 3 repositories · https://github.com/Ventusltd/testcode/blob/a8a215982b13d6e2f6019b40bf0bef5755719773/sandbox/202609051152/pipeline/scripts/plugins/newspaper-v9-5-1.js#L54-L56
export const f9221_itemTechnology = function itemTechnology(item) {
  return String(item.canonical_technology || item.technology || "").toUpperCase();
};

// Family #8465 · element #8465 · 173 places in 3 repositories · https://github.com/Ventusltd/testcode/blob/a8a215982b13d6e2f6019b40bf0bef5755719773/sandbox/202609051152/atlas/cartridges/202609050354-sld-sandbox-v9-8.js#L3193-L3203
export const f8465_representativePoint = function representativePoint(geometry) {
    if (!geometry) return null;
    const { type, coordinates } = geometry;
    if (type === 'Point') return [coordinates[0], coordinates[1]];
    const ring = type === 'Polygon' ? coordinates[0]