PageSourceSearch

https://www.submarinecablemap.com/assets/ResultsHeader-0JUjoh1B.js

js submarinecablemap.com collected 2026-10-01 08:29:57 UTC 13,450 bytes, 379 lines download raw bytes

1import { r as reactExports, c as useParams, j as jsxRuntimeExports } from "./index-DQqjuvIf.js";
2function ArrowTopRightOnSquareIcon({
3  title,
4  titleId,
5  ...props
6}, svgRef) {
7  return /* @__PURE__ */ reactExports.createElement("svg", Object.assign({
8    xmlns: "http://www.w3.org/2000/svg",
9    fill: "none",
10    viewBox: "0 0 24 24",
11    strokeWidth: 1.5,
12    stroke: "currentColor",
13    "aria-hidden": "true",
14    "data-slot": "icon",
15    ref: svgRef,
16    "aria-labelledby": titleId
17  }, props), title ? /* @__PURE__ */ reactExports.createElement("title", {
18    id: titleId
19  }, title) : null, /* @__PURE__ */ reactExports.createElement("path", {
20    strokeLinecap: "round",
21    strokeLinejoin: "round",
22    d: "M13.5 6H5.25A2.25 2.25 0 0 0 3 8.25v10.5A2.25 2.25 0 0 0 5.25 21h10.5A2.25 2.25 0 0 0 18 18.75V10.5m-10.5 6L21 3m0 0h-5.25M21 3v5.25"
23  }));
24}
25const ForwardRef = /* @__PURE__ */ reactExports.forwardRef(ArrowTopRightOnSquareIcon);
26var Component = {};
27var toggleSelection = function() {
28  var selection = document.getSelection();
29  if (!selection.rangeCount) {
30    return function() {
31    };
32  }
33  var active = document.activeElement;
34  var ranges = [];
35  for (var i = 0; i < selection.rangeCount; i++) {
36    ranges.push(selection.getRangeAt(i));
37  }
38  switch (active.tagName.toUpperCase()) {
39    case "INPUT":
40    case "TEXTAREA":
41      active.blur();
42      break;
43    default:
44      active = null;
45      break;
46  }
47  selection.removeAllRanges();
48  return function() {
49    selection.type === "Caret" && selection.removeAllRanges();
50    if (!selection.rangeCount) {
51      ranges.forEach(function(range) {
52        selection.addRange(range);
53      });
54    }
55    active && active.focus();
56  };
57};
58var deselectCurrent = toggleSelection;
59var clipboardToIE11Formatting = {
60  "text/plain": "Text",
61  "text/html": "Url",
62  "default": "Text"
63};
64var defaultMessage = "Copy to clipboard: #{key}, Enter";
65function format(message) {
66  var copyKey = (/mac os x/i.test(navigator.userAgent) ? "⌘" : "Ctrl") + "+C";
67  return message.replace(/#{\s*key\s*}/g, copyKey);
68}
69function copy(text, options) {
70  var debug, message, reselectPrevious, range, selection, mark, success = false;
71  if (!options) {
72    options = {};
73  }
74  debug = options.debug || false;
75  try {
76    reselectPrevious = deselectCurrent();
77    range = document.createRange();
78    selection = document.getSelection();
79    mark = document.createElement("span");
80    mark.textContent = text;
81    mark.ariaHidden = "true";
82    mark.style.all = "unset";
83    mark.style.position = "fixed";
84    mark.style.top = 0;
85    mark.style.clip = "rect(0, 0, 0, 0)";
86    mark.style.whiteSpace = "pre";
87    mark.style.webkitUserSelect = "text";
88    mark.style.MozUserSelect = "text";
89    mark.style.msUserSelect = "text";
90    mark.style.userSelect = "text";
91    mark.addEventListener("copy", function(e) {
92      e.stopPropagation();
93      if (options.format) {
94        e.preventDefault();
95        if (typeof e.clipboardData === "undefined") {
96          debug && console.warn("unable to use e.clipboardData");
97          debug && console.warn("trying IE specific stuff");
98          window.clipboardData.clearData();
99          var format2 = clipboardToIE11Formatting[options.format] || clipboardToIE11Formatting["default"];
100          window.clipboardData.setData(format2, text);
101        } else {
102          e.clipboardData.clearData();
103          e.clipboardData.setData(options.format, text);
104        }
105      }
106      if (options.onCopy) {
107        e.preventDefault();
108        options.onCopy(e.clipboardData);
109      }
110    });
111    document.body.appendChild(mark);
112    range.selectNodeContents(mark);
113    selection.addRange(range);
114    var successful = document.execCommand("copy");
115    if (!successful) {
116      throw new Error("copy command was unsuccessful");
117    }
118    success = true;
119  } catch (err) {
120    debug && console.error("unable to copy using execCommand: ", err);
121    debug && console.warn("trying IE specific stuff");
122    try {
123      window.clipboardData.setData(options.format || "text", text);
124      options.onCopy && options.onCopy(window.clipboardData);
125      success = true;
126    } catch (err2) {
127      debug && console.error("unable to copy using clipboardData: ", err2);
128      debug && console.error("falling back to prompt");
129      message = format("message" in options ? options.message : defaultMessage);
130      window.prompt(message, text);
131    }
132  } finally {
133    if (selection) {
134      if (typeof selection.removeRange == "function") {
135        selection.removeRange(range);
136      } else {
137        selection.removeAllRanges();
138      }
139    }
140    if (mark) {
141      document.body.removeChild(mark);
142    }
143    reselectPrevious();
144  }
145  return success;
146}
147var copyToClipboard = copy;
148function _typeof(obj) {
149  "@babel/helpers - typeof";
150  return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(obj2) {
151    return typeof obj2;
152  } : function(obj2) {
153    return obj2 && "function" == typeof Symbol && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2;
154  }, _typeof(obj);
155}
156Object.defineProperty(Component, "__esModule", {
157  value: true
158});
159Component.CopyToClipboard = void 0;
160var _react = _interopRequireDefault(reactExports);
161var _copyToClipboard = _interopRequireDefault(copyToClipboard);
162var _excluded = ["text", "onCopy", "options", "children"];
163function _interopRequireDefault(obj) {
164  return obj && obj.__esModule ? obj : { "default": obj };
165}
166function ownKeys(object, enumerableOnly) {
167  var keys = Object.keys(object);
168  if (Object.getOwnPropertySymbols) {
169    var symbols = Object.getOwnPropertySymbols(object);
170    enumerableOnly && (symbols = symbols.filter(function(sym) {
171      return Object.getOwnPropertyDescriptor(object, sym).enumerable;
172    })), keys.push.apply(keys, symbols);
173  }
174  return keys;
175}
176function _objectSpread(target) {
177  for (var i = 1; i < arguments.length; i++) {
178    var source = null != arguments[i] ? arguments[i] : {};
179    i % 2 ? ownKeys(Object(source), true).forEach(function(key) {
180      _defineProperty(target, key, source[key]);
181    }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function(key) {
182      Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
183    });
184  }
185  return target;
186}
187function _objectWithoutProperties(source, excluded) {
188  if (source == null) return {};
189  var target = _objectWithoutPropertiesLoose(source, excluded);
190  var key, i;
191  if (Object.getOwnPropertySymbols) {
192    var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
193    for (i = 0; i < sourceSymbolKeys.length; i++) {
194      key = sourceSymbolKeys[i];
195      if (excluded.indexOf(key) >= 0) continue;
196      if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
197      target[key] = source[key];
198    }
199  }
200  return target;
201}
202function _objectWithoutPropertiesLoose(source, excluded) {
203  if (source == null) return {};
204  var target = {};
205  var sourceKeys = Object.keys(source);
206  var key, i;
207  for (i = 0; i < sourceKeys.length; i++) {
208    key = sourceKeys[i];
209    if (excluded.indexOf(key) >= 0) continue;
210    target[key] = source[key];
211  }
212  return target;
213}
214function _classCallCheck(instance, Constructor) {
215  if (!(instance instanceof Constructor)) {
216    throw new TypeError("Cannot call a class as a function");
217  }
218}
219function _defineProperties(target, props) {
220  for (var i = 0; i < props.length; i++) {
221    var descriptor = props[i];
222    descriptor.enumerable = descriptor.enumerable || false;
223    descriptor.configurable = true;
224    if ("value" in descriptor) descriptor.writable = true;
225    Object.defineProperty(target, descriptor.key, descriptor);
226  }
227}
228function _createClass(Constructor, protoProps, staticProps) {
229  if (protoProps) _defineProperties(Constructor.prototype, protoProps);
230  Object.defineProperty(Constructor, "prototype", { writable: false });
231  return Constructor;
232}
233function _inherits(subClass, superClass) {
234  if (typeof superClass !== "function" && superClass !== null) {
235    throw new TypeError("Super expression must either be null or a function");
236  }
237  subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } });
238  Object.defineProperty(subClass, "prototype", { writable: false });
239  if (superClass) _setPrototypeOf(subClass, superClass);
240}
241function _setPrototypeOf(o, p) {
242  _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf2(o2, p2) {
243    o2.__proto__ = p2;
244    return o2;
245  };
246  return _setPrototypeOf(o, p);
247}
248function _createSuper(Derived) {
249  var hasNativeReflectConstruct = _isNativeReflectConstruct();
250  return function _createSuperInternal() {
251    var Super = _getPrototypeOf(Derived), result;
252    if (hasNativeReflectConstruct) {
253      var NewTarget = _getPrototypeOf(this).constructor;
254      result = Reflect.construct(Super, arguments, NewTarget);
255    } else {
256      result = Super.apply(this, arguments);
257    }
258    return _possibleConstructorReturn(this, result);
259  };
260}
261function _possibleConstructorReturn(self, call) {
262  if (call && (_typeof(call) === "object" || typeof call === "function")) {
263    return call;
264  } else if (call !== void 0) {
265    throw new TypeError("Derived constructors may only return object or undefined");
266  }
267  return _assertThisInitialized(self);
268}
269function _assertThisInitialized(self) {
270  if (self === void 0) {
271    throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
272  }
273  return self;
274}
275function _isNativeReflectConstruct() {
276  if (typeof Reflect === "undefined" || !Reflect.construct) return false;
277  if (Reflect.construct.sham) return false;
278  if (typeof Proxy === "function") return true;
279  try {
280    Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
281    }));
282    return true;
283  } catch (e) {
284    return false;
285  }
286}
287function _getPrototypeOf(o) {
288  _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf2(o2) {
289    return o2.__proto__ || Object.getPrototypeOf(o2);
290  };
291  return _getPrototypeOf(o);
292}
293function _defineProperty(obj, key, value) {
294  if (key in obj) {
295    Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
296  } else {
297    obj[key] = value;
298  }
299  return obj;
300}
301var CopyToClipboard$1 = /* @__PURE__ */ function(_React$PureComponent) {
302  _inherits(CopyToClipboard2, _React$PureComponent);
303  var _super = _createSuper(CopyToClipboard2);
304  function CopyToClipboard2() {
305    var _this;
306    _classCallCheck(this, CopyToClipboard2);
307    for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
308      args[_key] = arguments[_key];
309    }
310    _this = _super.call.apply(_super, [this].concat(args));
311    _defineProperty(_assertThisInitialized(_this), "onClick", function(event) {
312      var _this$props = _this.props, text = _this$props.text, onCopy = _this$props.onCopy, children = _this$props.children, options = _this$props.options;
313      var elem = _react["default"].Children.only(children);
314      var result = (0, _copyToClipboard["default"])(text, options);
315      if (onCopy) {
316        onCopy(text, result);
317      }
318      if (elem && elem.props && typeof elem.props.onClick === "function") {
319        elem.props.onClick(event);
320      }
321    });
322    return _this;
323  }
324  _createClass(CopyToClipboard2, [{
325    key: "render",
326    value: function render() {
327      var _this$props2 = this.props;
328      _this$props2.text;
329      _this$props2.onCopy;
330      _this$props2.options;
331      var children = _this$props2.children, props = _objectWithoutProperties(_this$props2, _excluded);
332      var elem = _react["default"].Children.only(children);
333      return /* @__PURE__ */ _react["default"].cloneElement(elem, _objectSpread(_objectSpread({}, props), {}, {
334        onClick: this.onClick
335      }));
336    }
337  }]);
338  return CopyToClipboard2;
339}(_react["default"].PureComponent);
340Component.CopyToClipboard = CopyToClipboard$1;
341_defineProperty(CopyToClipboard$1, "defaultProps", {
342  onCopy: void 0,
343  options: void 0
344});
345var _require = Component, CopyToClipboard = _require.CopyToClipboard;
346CopyToClipboard.CopyToClipboard = CopyToClipboard;
347var lib = CopyToClipboard;
348const ResultsHeader = ({
349  name
350}) => {
351  const params = useParams();
352  const [copy2, setCopy] = reactExports.useState({
353    value: window.location.href,
354    copied: false
355  });
356  reactExports.useEffect(() => {
357    setCopy({
358      value: window.location.href,
359      copied: false
360    });
361  }, [params]);
362  const copyLink = () => {
363    setCopy({
364      value: window.location.href,
365      copied: true
366    });
367  };
368  return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "my-4", children: [
369    /* @__PURE__ */ jsxRuntimeExports.jsx("h2", { children: name }),
370    /* @__PURE__ */ jsxRuntimeExports.jsx(lib.CopyToClipboard, { text: copy2.value, onCopy: () => copyLink(), children: /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { className: "text-sm inline-block leading-4 " + (copy2.copied ? "text-gray-500 hover:text-gray-500 cursor-default" : "text-tg-blue hover:text-tg-blue-darker cursor-pointer"), children: [
371      /* @__PURE__ */ jsxRuntimeExports.jsx(ForwardRef, { className: "w-4 h-4 mr-1 float-left" }),
372      " ",
373      copy2.copied ? "Copied" : "Copy link"
374    ] }) })
375  ] });
376};
377export {
378  ResultsHeader as R
379};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.