var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
  for (var name in all)
    __defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
  if (from && typeof from === "object" || typeof from === "function") {
    for (let key of __getOwnPropNames(from))
      if (!__hasOwnProp.call(to, key) && key !== except)
        __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
  }
  return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
var use_attach_symbol_to_map_exports = {};
__export(use_attach_symbol_to_map_exports, {
  useAttachSymbolToMap: () => useAttachSymbolToMap
});
module.exports = __toCommonJS(use_attach_symbol_to_map_exports);
var import_lodash_es = require("lodash");
var import_maplibre = require("react-map-gl/maplibre");
var import_use_attach_image_from_icon = require("./use-attach-image-from-icon.js");
var import_attach_image_from_string = require("../functions/attach-image-from-string.js");
const useAttachSymbolToMap = (icon, suffix = "", outputSize) => {
  const { current: map } = (0, import_maplibre.useMap)();
  const customIconAttached = (0, import_use_attach_image_from_icon.useAttachImageFromIcon)(icon, suffix, outputSize);
  if ((0, import_lodash_es.isNil)(map)) {
    return null;
  }
  if (!customIconAttached && (0, import_lodash_es.isString)(icon)) {
    (0, import_attach_image_from_string.attachImageFromString)(map, icon, suffix, outputSize);
  }
};
