@elementor/editor-controls 4.4.0-1110 → 4.4.0-1112

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -5380,7 +5380,7 @@ import * as React88 from "react";
5380
5380
  import { useEffect as useEffect16, useRef as useRef17, useState as useState19 } from "react";
5381
5381
  import { useCurrentUserCapabilities } from "@elementor/editor-current-user";
5382
5382
  import { iconPropTypeUtil, svgSrcPropTypeUtil, urlPropTypeUtil as urlPropTypeUtil4 } from "@elementor/editor-props";
5383
- import { Box as Box20, Card as Card2, CardOverlay as CardOverlay2, Popover as Popover6, Stack as Stack17, styled as styled11, usePopupState as usePopupState10 } from "@elementor/ui";
5383
+ import { Box as Box21, Card as Card2, CardOverlay as CardOverlay2, Popover as Popover6, Stack as Stack17, styled as styled11, usePopupState as usePopupState10 } from "@elementor/ui";
5384
5384
  import { useWpMediaAttachment as useWpMediaAttachment2, useWpMediaFrame as useWpMediaFrame2 } from "@elementor/wp-media";
5385
5385
  import { __ as __38 } from "@wordpress/i18n";
5386
5386
 
@@ -5471,10 +5471,603 @@ import {
5471
5471
  } from "@elementor/editor-ui";
5472
5472
  import { ComponentsIcon } from "@elementor/icons";
5473
5473
  import { useSessionStorage as useSessionStorage2 } from "@elementor/session";
5474
- import { Box as Box17, CircularProgress as CircularProgress3, Divider as Divider4, Link as Link3, Stack as Stack15, styled as styled9, Typography as Typography9 } from "@elementor/ui";
5474
+ import { Box as Box18, CircularProgress as CircularProgress3, Divider as Divider5, Link as Link3, Stack as Stack15, styled as styled9, Typography as Typography9 } from "@elementor/ui";
5475
5475
  import { useDebounceState } from "@elementor/utils";
5476
5476
  import { __ as __35 } from "@wordpress/i18n";
5477
5477
 
5478
+ // src/controls/icon-library/custom-icon-libraries.ts
5479
+ import { httpService as httpService3 } from "@elementor/http-client";
5480
+ import { useQuery as useQuery2 } from "@elementor/query";
5481
+
5482
+ // src/controls/open-icon-library.ts
5483
+ import { stringPropTypeUtil as stringPropTypeUtil14 } from "@elementor/editor-props";
5484
+ function enqueueIconFonts(library) {
5485
+ window.elementor?.helpers?.enqueueIconFonts?.(library);
5486
+ }
5487
+ function createIconPropValue(icon, library) {
5488
+ return {
5489
+ value: stringPropTypeUtil14.create(icon),
5490
+ library: stringPropTypeUtil14.create(library)
5491
+ };
5492
+ }
5493
+
5494
+ // src/controls/icon-library/fontello-svg-font.ts
5495
+ function parseFontelloSvgFont(configJson, svgFont, prefix, displayPrefix, iconNames) {
5496
+ const codepoints = parseConfigCodepoints(configJson, prefix);
5497
+ const configPaths = parseConfigSvgPaths(configJson, prefix);
5498
+ const glyphs = parseSvgFontGlyphs(svgFont);
5499
+ const resolvedDisplayPrefix = displayPrefix || prefix.replace(/-$/, "");
5500
+ const result = {};
5501
+ for (const name of iconNames) {
5502
+ const fromConfig = configPaths.get(name) ?? (prefix && name.startsWith(prefix) ? configPaths.get(name.slice(prefix.length)) : void 0);
5503
+ const glyph = fromConfig ?? findGlyph(glyphs, codepoints, name, prefix);
5504
+ if (!glyph) {
5505
+ continue;
5506
+ }
5507
+ const value = `${resolvedDisplayPrefix} ${prefix}${name}`.trim();
5508
+ result[value] = buildIconSvg(glyph);
5509
+ }
5510
+ return result;
5511
+ }
5512
+ function parseConfigCodepoints(configJson, prefix) {
5513
+ const map = /* @__PURE__ */ new Map();
5514
+ try {
5515
+ const data = JSON.parse(configJson);
5516
+ if (!Array.isArray(data.glyphs)) {
5517
+ return map;
5518
+ }
5519
+ for (const glyph of data.glyphs) {
5520
+ if (typeof glyph.css !== "string" || glyph.css === "" || typeof glyph.code !== "number") {
5521
+ continue;
5522
+ }
5523
+ map.set(glyph.css, glyph.code);
5524
+ if (prefix !== "" && !glyph.css.startsWith(prefix)) {
5525
+ map.set(`${prefix}${glyph.css}`, glyph.code);
5526
+ }
5527
+ }
5528
+ } catch {
5529
+ return map;
5530
+ }
5531
+ return map;
5532
+ }
5533
+ function parseConfigSvgPaths(configJson, prefix) {
5534
+ const map = /* @__PURE__ */ new Map();
5535
+ try {
5536
+ const data = JSON.parse(configJson);
5537
+ if (!Array.isArray(data.glyphs)) {
5538
+ return map;
5539
+ }
5540
+ for (const glyph of data.glyphs) {
5541
+ if (typeof glyph.css !== "string" || glyph.css === "") {
5542
+ continue;
5543
+ }
5544
+ let path = "";
5545
+ let advance = 1e3;
5546
+ if (typeof glyph.svg === "string") {
5547
+ path = glyph.svg;
5548
+ } else if (glyph.svg && typeof glyph.svg === "object" && "path" in glyph.svg && typeof glyph.svg.path === "string") {
5549
+ path = glyph.svg.path;
5550
+ if ("width" in glyph.svg && typeof glyph.svg.width === "number" && glyph.svg.width > 0) {
5551
+ advance = glyph.svg.width;
5552
+ }
5553
+ }
5554
+ if (path === "") {
5555
+ continue;
5556
+ }
5557
+ const record = { d: path, units: 1e3, advance };
5558
+ map.set(glyph.css, record);
5559
+ if (prefix !== "" && !glyph.css.startsWith(prefix)) {
5560
+ map.set(`${prefix}${glyph.css}`, record);
5561
+ }
5562
+ }
5563
+ } catch {
5564
+ return map;
5565
+ }
5566
+ return map;
5567
+ }
5568
+ function parseSvgFontGlyphs(svgFont) {
5569
+ const byName = /* @__PURE__ */ new Map();
5570
+ const byCode = /* @__PURE__ */ new Map();
5571
+ const doc = new DOMParser().parseFromString(stripDoctype(svgFont), "image/svg+xml");
5572
+ const font = doc.querySelector("font");
5573
+ const face = doc.querySelector("font-face");
5574
+ const fontAdvance = positiveInt(font?.getAttribute("horiz-adv-x"), 1e3);
5575
+ const units2 = positiveInt(face?.getAttribute("units-per-em"), fontAdvance);
5576
+ doc.querySelectorAll("glyph").forEach((node) => {
5577
+ const d = node.getAttribute("d") ?? "";
5578
+ if (d === "") {
5579
+ return;
5580
+ }
5581
+ const record = {
5582
+ d,
5583
+ units: units2,
5584
+ advance: positiveInt(node.getAttribute("horiz-adv-x"), fontAdvance)
5585
+ };
5586
+ const name = node.getAttribute("glyph-name") ?? "";
5587
+ const unicode = node.getAttribute("unicode") ?? "";
5588
+ const code = unicode.codePointAt(0);
5589
+ if (name) {
5590
+ byName.set(name, record);
5591
+ }
5592
+ if (code !== void 0) {
5593
+ byCode.set(code, record);
5594
+ }
5595
+ });
5596
+ return { byName, byCode };
5597
+ }
5598
+ function findGlyph(glyphs, codepoints, iconName, prefix) {
5599
+ const names = [iconName];
5600
+ if (prefix !== "" && iconName.startsWith(prefix)) {
5601
+ names.push(iconName.slice(prefix.length));
5602
+ }
5603
+ for (const name of names) {
5604
+ const byName = glyphs.byName.get(name);
5605
+ if (byName) {
5606
+ return byName;
5607
+ }
5608
+ const code = codepoints.get(name);
5609
+ const byCode = code !== void 0 ? glyphs.byCode.get(code) : void 0;
5610
+ if (byCode) {
5611
+ return byCode;
5612
+ }
5613
+ }
5614
+ return null;
5615
+ }
5616
+ function buildIconSvg(glyph) {
5617
+ return `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 ${glyph.advance} ${glyph.units}" fill="currentColor" width="100%" height="100%"><g transform="translate(0,${glyph.units}) scale(1,-1)"><path d="${escapeAttribute(glyph.d)}" fill="currentColor"></path></g></svg>`;
5618
+ }
5619
+ function stripDoctype(svgFont) {
5620
+ return svgFont.replace(/<!DOCTYPE[^>]*>/is, "");
5621
+ }
5622
+ function positiveInt(value, fallback) {
5623
+ if (!value) {
5624
+ return fallback;
5625
+ }
5626
+ const parsed = Number.parseInt(value, 10);
5627
+ return parsed > 0 ? parsed : fallback;
5628
+ }
5629
+ function escapeAttribute(value) {
5630
+ return value.replace(/&/g, "&amp;").replace(/"/g, "&quot;").replace(/</g, "&lt;").replace(/>/g, "&gt;");
5631
+ }
5632
+
5633
+ // src/controls/icon-library/icomoon-selection.ts
5634
+ var DEFAULT_ICOMOON_VIEWBOX = 1024;
5635
+ function parseIcomoonSelection(selectionJson, prefix, displayPrefix, iconNames) {
5636
+ let data;
5637
+ try {
5638
+ data = JSON.parse(selectionJson);
5639
+ } catch {
5640
+ return {};
5641
+ }
5642
+ const resolvedDisplayPrefix = displayPrefix || prefix.replace(/-$/, "");
5643
+ const names = iconNames.length > 0 ? iconNames : namesFromSelection(data);
5644
+ const result = {};
5645
+ for (const name of names) {
5646
+ const markup = svgForName(data, name, prefix);
5647
+ if (!markup) {
5648
+ continue;
5649
+ }
5650
+ result[`${resolvedDisplayPrefix} ${prefix}${name}`.trim()] = markup;
5651
+ }
5652
+ return result;
5653
+ }
5654
+ function namesFromSelection(data) {
5655
+ if (!Array.isArray(data.icons)) {
5656
+ return [];
5657
+ }
5658
+ return data.icons.flatMap((icon) => {
5659
+ const name = iconEntryName(icon);
5660
+ return name ? [name] : [];
5661
+ });
5662
+ }
5663
+ function svgForName(data, iconName, prefix) {
5664
+ const candidates = [iconName];
5665
+ if (prefix && iconName.startsWith(prefix)) {
5666
+ candidates.push(iconName.slice(prefix.length));
5667
+ }
5668
+ for (const icon of data.icons ?? []) {
5669
+ const name = iconEntryName(icon);
5670
+ if (!name || !candidates.includes(name)) {
5671
+ continue;
5672
+ }
5673
+ const paths = Array.isArray(icon.icon?.paths) ? icon.icon.paths.filter((path) => typeof path === "string" && path !== "") : [];
5674
+ if (paths.length === 0) {
5675
+ return null;
5676
+ }
5677
+ const size = typeof icon.icon?.width === "number" && icon.icon.width > 0 ? icon.icon.width : DEFAULT_ICOMOON_VIEWBOX;
5678
+ const pathMarkup = paths.map((d) => `<path d="${escapeAttribute2(d)}" fill="currentColor"></path>`).join("");
5679
+ return `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 ${size} ${size}" fill="currentColor" width="100%" height="100%">` + pathMarkup + "</svg>";
5680
+ }
5681
+ return null;
5682
+ }
5683
+ function iconEntryName(icon) {
5684
+ if (typeof icon.properties?.name === "string") {
5685
+ return icon.properties.name;
5686
+ }
5687
+ const tag = icon.icon?.tags;
5688
+ return Array.isArray(tag) && typeof tag[0] === "string" ? tag[0] : "";
5689
+ }
5690
+ function escapeAttribute2(value) {
5691
+ return value.replace(/&/g, "&amp;").replace(/"/g, "&quot;").replace(/</g, "&lt;").replace(/>/g, "&gt;");
5692
+ }
5693
+
5694
+ // src/controls/icon-library/custom-icon-libraries.ts
5695
+ var NATIVE_TAB_NAMES = /* @__PURE__ */ new Set(["all", "recommended", "GoPro"]);
5696
+ var DEFAULT_ICON_SIZE = 512;
5697
+ var CUSTOM_ICON_LIBRARIES_QUERY_KEY = ["custom-icon-libraries"];
5698
+ var CUSTOM_ICON_SVG_URL = "elementor/v1/atomic-widgets/custom-icon-svg";
5699
+ var SUPPORTED_CUSTOM_ICON_TYPES = /* @__PURE__ */ new Set(["fontello", "icomoon", "fontastic"]);
5700
+ var svgMapCache = /* @__PURE__ */ new Map();
5701
+ var inFlightSvgMaps = /* @__PURE__ */ new Map();
5702
+ function isDeletedCustomIconLibrary(library, iconValue) {
5703
+ const libraryName = String(library);
5704
+ if (!libraryName || !iconValue) {
5705
+ return false;
5706
+ }
5707
+ if (NATIVE_TAB_NAMES.has(libraryName) || libraryName.startsWith("fa-")) {
5708
+ return false;
5709
+ }
5710
+ return !getCustomIconLibraryConfigs().some((item) => item.name === libraryName);
5711
+ }
5712
+ function useCustomIconLibraries(enabled) {
5713
+ return useQuery2({
5714
+ queryKey: CUSTOM_ICON_LIBRARIES_QUERY_KEY,
5715
+ queryFn: ({ signal }) => loadCustomIconLibraries(signal),
5716
+ enabled: enabled && areCustomIconLibrariesEnabled(),
5717
+ staleTime: Infinity
5718
+ });
5719
+ }
5720
+ async function loadCustomIconLibraries(signal) {
5721
+ const catalogs = await Promise.all(
5722
+ getCustomIconLibraryConfigs().map((library) => loadCustomLibrary(library, signal))
5723
+ );
5724
+ return catalogs.flat();
5725
+ }
5726
+ async function resolveCustomIconSvg(library, iconValue, signal) {
5727
+ const config = getCustomIconLibraryConfigs().find((item) => item.name === String(library));
5728
+ if (!config) {
5729
+ svgMapCache.delete(String(library));
5730
+ return null;
5731
+ }
5732
+ const map = await loadLibrarySvgMap(String(library), config, signal);
5733
+ const markup = map[iconValue];
5734
+ return typeof markup === "string" && markup !== "" ? markup : null;
5735
+ }
5736
+ function areCustomIconLibrariesEnabled() {
5737
+ return true === window.elementorCommon?.config?.fontAwesome?.v7?.customIconLibrariesEnabled;
5738
+ }
5739
+ function getCustomIconLibraryConfigs() {
5740
+ if (!areCustomIconLibrariesEnabled()) {
5741
+ return [];
5742
+ }
5743
+ const libraries = window.elementor?.config;
5744
+ const items2 = Array.isArray(libraries?.icons?.libraries) ? libraries.icons.libraries : [];
5745
+ return items2.flatMap((value) => {
5746
+ const library = normalizeCustomIconLibraryConfig(value);
5747
+ return library ? [library] : [];
5748
+ });
5749
+ }
5750
+ function normalizeCustomIconLibraryConfig(value) {
5751
+ if (!value || typeof value !== "object") {
5752
+ return null;
5753
+ }
5754
+ const library = value;
5755
+ const name = coerceLibraryName(library.name);
5756
+ if (name === "" || NATIVE_TAB_NAMES.has(name) || library.native === true || name.startsWith("fa-")) {
5757
+ return null;
5758
+ }
5759
+ if (typeof library.prefix !== "string") {
5760
+ return null;
5761
+ }
5762
+ if (!library.fetchJson && library.icons === void 0) {
5763
+ return null;
5764
+ }
5765
+ const resolved = {
5766
+ ...library,
5767
+ name,
5768
+ prefix: library.prefix,
5769
+ ...getPackUrls(name, library)
5770
+ };
5771
+ if (!resolveCustomIconType(resolved)) {
5772
+ return null;
5773
+ }
5774
+ return resolved;
5775
+ }
5776
+ function coerceLibraryName(value) {
5777
+ if (typeof value === "string") {
5778
+ return value;
5779
+ }
5780
+ if (typeof value === "number" && Number.isFinite(value)) {
5781
+ return String(value);
5782
+ }
5783
+ return "";
5784
+ }
5785
+ function getPackUrls(library, config) {
5786
+ const derived = derivePackAssetUrls(config.fetchJson, resolveCustomIconType(config));
5787
+ const packs = window.elementorCommon?.config?.fontAwesome?.v7?.customIconPacks;
5788
+ if (!packs || typeof packs !== "object") {
5789
+ return derived;
5790
+ }
5791
+ const pack = packs[library];
5792
+ if (!pack || typeof pack !== "object") {
5793
+ return derived;
5794
+ }
5795
+ const packType = typeof pack.type === "string" ? pack.type : config.custom_icon_type;
5796
+ return {
5797
+ ...derived,
5798
+ configUrl: typeof pack.configUrl === "string" ? pack.configUrl : derived.configUrl,
5799
+ fontUrl: typeof pack.fontUrl === "string" ? pack.fontUrl : derived.fontUrl,
5800
+ selectionUrl: typeof pack.selectionUrl === "string" ? pack.selectionUrl : derived.selectionUrl,
5801
+ custom_icon_type: packType ?? derived.custom_icon_type
5802
+ };
5803
+ }
5804
+ function resolveCustomIconType(library) {
5805
+ const type = typeof library.custom_icon_type === "string" ? library.custom_icon_type.toLowerCase() : "";
5806
+ return SUPPORTED_CUSTOM_ICON_TYPES.has(type) ? type : "";
5807
+ }
5808
+ function derivePackAssetUrls(fetchJson, type) {
5809
+ if (!fetchJson) {
5810
+ return type ? { custom_icon_type: type } : {};
5811
+ }
5812
+ try {
5813
+ const url = new URL(fetchJson, window.location.origin);
5814
+ const base = url.href.replace(/\/[^/?#]+(?:\?.*)?$/, "");
5815
+ if ("icomoon" === type) {
5816
+ return {
5817
+ custom_icon_type: type,
5818
+ selectionUrl: `${base}/selection.json`,
5819
+ fontUrl: `${base}/fonts/icomoon.svg`
5820
+ };
5821
+ }
5822
+ if ("fontastic" === type) {
5823
+ return {
5824
+ custom_icon_type: type,
5825
+ fontUrl: `${base}/fonts/fontastic.svg`
5826
+ };
5827
+ }
5828
+ if ("fontello" === type) {
5829
+ return {
5830
+ custom_icon_type: type,
5831
+ configUrl: `${base}/config.json`,
5832
+ fontUrl: `${base}/font/fontello.svg`
5833
+ };
5834
+ }
5835
+ return {};
5836
+ } catch {
5837
+ return type ? { custom_icon_type: type } : {};
5838
+ }
5839
+ }
5840
+ async function loadCustomLibrary(library, signal) {
5841
+ enqueueIconFonts(library.name);
5842
+ const names = parseIconNames(await loadLibraryPayload(library, signal));
5843
+ const svgMap = await loadLibrarySvgMap(library.name, library, signal);
5844
+ return names.map((name) => {
5845
+ const value = createCustomIconSelectionValue(library, name);
5846
+ return {
5847
+ id: `${library.name}:${name}`,
5848
+ name,
5849
+ label: name.replace(/-/g, " "),
5850
+ library: library.name,
5851
+ value,
5852
+ aliases: [],
5853
+ width: DEFAULT_ICON_SIZE,
5854
+ height: DEFAULT_ICON_SIZE,
5855
+ paths: [],
5856
+ glyphClass: value,
5857
+ svgMarkup: svgMap[value]
5858
+ };
5859
+ });
5860
+ }
5861
+ async function loadLibrarySvgMap(library, config, signal) {
5862
+ if (!config) {
5863
+ svgMapCache.delete(library);
5864
+ inFlightSvgMaps.delete(library);
5865
+ return {};
5866
+ }
5867
+ const cached = svgMapCache.get(library);
5868
+ if (cached && Object.keys(cached).length > 0) {
5869
+ return cached;
5870
+ }
5871
+ const pending = inFlightSvgMaps.get(library);
5872
+ if (pending) {
5873
+ return pending;
5874
+ }
5875
+ const request = fetchLibrarySvgMap(library, config, signal).finally(() => {
5876
+ inFlightSvgMaps.delete(library);
5877
+ });
5878
+ inFlightSvgMaps.set(library, request);
5879
+ return request;
5880
+ }
5881
+ async function fetchLibrarySvgMap(library, config, signal) {
5882
+ const fromRest = await loadSvgMapFromRest(library, signal);
5883
+ const restIcons = fromRest.icons;
5884
+ if (Object.keys(restIcons).length > 0 && !fromRest.truncated) {
5885
+ svgMapCache.set(library, restIcons);
5886
+ return restIcons;
5887
+ }
5888
+ const fromPack = await loadSvgMapFromPackFiles(config, signal);
5889
+ const merged = { ...fromPack, ...restIcons };
5890
+ if (Object.keys(merged).length > 0) {
5891
+ svgMapCache.set(library, merged);
5892
+ return merged;
5893
+ }
5894
+ return {};
5895
+ }
5896
+ async function loadSvgMapFromRest(library, signal) {
5897
+ try {
5898
+ const response = await httpService3().get(CUSTOM_ICON_SVG_URL, { params: { library: String(library) }, signal });
5899
+ return unwrapIconMap(response);
5900
+ } catch {
5901
+ return { icons: {}, truncated: false };
5902
+ }
5903
+ }
5904
+ function unwrapIconMap(payload) {
5905
+ let current = payload;
5906
+ for (let depth = 0; depth < 4; depth++) {
5907
+ if (!current || typeof current !== "object") {
5908
+ return { icons: {}, truncated: false };
5909
+ }
5910
+ const record = current;
5911
+ if (record.icons && typeof record.icons === "object" && !Array.isArray(record.icons)) {
5912
+ const icons = {};
5913
+ Object.entries(record.icons).forEach(([key, value]) => {
5914
+ if (typeof value === "string" && value !== "") {
5915
+ icons[key] = value;
5916
+ }
5917
+ });
5918
+ return {
5919
+ icons,
5920
+ truncated: true === record.truncated
5921
+ };
5922
+ }
5923
+ current = "data" in record ? record.data : void 0;
5924
+ }
5925
+ return { icons: {}, truncated: false };
5926
+ }
5927
+ async function loadSvgMapFromPackFiles(library, signal) {
5928
+ const type = resolveCustomIconType(library);
5929
+ if (!type) {
5930
+ return {};
5931
+ }
5932
+ if ("icomoon" === type && library.selectionUrl) {
5933
+ try {
5934
+ const response = await fetch(library.selectionUrl, { signal, mode: "cors" });
5935
+ if (response.ok) {
5936
+ const selectionJson = await response.text();
5937
+ const names2 = parseIconNames(safeJson(selectionJson));
5938
+ const payloadNames2 = names2.length > 0 ? names2 : parseIconNames({ icons: library.icons });
5939
+ const fromSelection = parseIcomoonSelection(
5940
+ selectionJson,
5941
+ library.prefix,
5942
+ library.displayPrefix ?? "",
5943
+ payloadNames2
5944
+ );
5945
+ if (Object.keys(fromSelection).length > 0) {
5946
+ return fromSelection;
5947
+ }
5948
+ }
5949
+ } catch {
5950
+ }
5951
+ }
5952
+ const fontUrls = uniqueUrls([
5953
+ library.fontUrl,
5954
+ "fontello" === type && library.fetchJson ? packSiblingUrl(library.fetchJson, "font/fontello.svg") : null,
5955
+ "fontastic" === type && library.fetchJson ? packSiblingUrl(library.fetchJson, "fonts/fontastic.svg") : null,
5956
+ "icomoon" === type && library.fetchJson ? packSiblingUrl(library.fetchJson, "fonts/icomoon.svg") : null
5957
+ ]);
5958
+ if (fontUrls.length === 0) {
5959
+ return {};
5960
+ }
5961
+ let configJson = "{}";
5962
+ if (library.configUrl) {
5963
+ try {
5964
+ const configResponse = await fetch(library.configUrl, { signal, mode: "cors" });
5965
+ if (configResponse.ok) {
5966
+ configJson = await configResponse.text();
5967
+ }
5968
+ } catch {
5969
+ configJson = "{}";
5970
+ }
5971
+ }
5972
+ const names = parseIconNames(safeJson(configJson));
5973
+ const payloadNames = names.length > 0 ? names : parseIconNames({ icons: library.icons });
5974
+ for (const fontUrl of fontUrls) {
5975
+ try {
5976
+ const fontResponse = await fetch(fontUrl, { signal, mode: "cors" });
5977
+ if (!fontResponse.ok) {
5978
+ continue;
5979
+ }
5980
+ const fromFont = parseFontelloSvgFont(
5981
+ configJson,
5982
+ await fontResponse.text(),
5983
+ library.prefix,
5984
+ library.displayPrefix ?? "",
5985
+ payloadNames
5986
+ );
5987
+ if (Object.keys(fromFont).length > 0) {
5988
+ return fromFont;
5989
+ }
5990
+ } catch {
5991
+ continue;
5992
+ }
5993
+ }
5994
+ return {};
5995
+ }
5996
+ function packSiblingUrl(fetchJson, relativePath) {
5997
+ try {
5998
+ const url = new URL(fetchJson, window.location.origin);
5999
+ url.pathname = url.pathname.replace(/\/[^/]+$/, `/${relativePath}`);
6000
+ return url.href;
6001
+ } catch {
6002
+ return null;
6003
+ }
6004
+ }
6005
+ function uniqueUrls(urls) {
6006
+ return [...new Set(urls.filter((url) => typeof url === "string" && url !== ""))];
6007
+ }
6008
+ function safeJson(value) {
6009
+ try {
6010
+ return JSON.parse(value);
6011
+ } catch {
6012
+ return null;
6013
+ }
6014
+ }
6015
+ async function loadLibraryPayload(library, signal) {
6016
+ if (library.icons !== void 0) {
6017
+ return { icons: library.icons };
6018
+ }
6019
+ if (!library.fetchJson) {
6020
+ return null;
6021
+ }
6022
+ try {
6023
+ const response = await fetch(library.fetchJson, { signal, mode: "cors" });
6024
+ return response.ok ? response.json() : null;
6025
+ } catch {
6026
+ return null;
6027
+ }
6028
+ }
6029
+ function parseIconNames(payload) {
6030
+ if (!payload || typeof payload !== "object") {
6031
+ return [];
6032
+ }
6033
+ const icons = payload.icons;
6034
+ if (Array.isArray(icons)) {
6035
+ return icons.flatMap((entry) => {
6036
+ if (typeof entry === "string") {
6037
+ return [normalizeIconName(entry)];
6038
+ }
6039
+ if (entry && typeof entry === "object" && "name" in entry && typeof entry.name === "string") {
6040
+ return [normalizeIconName(entry.name)];
6041
+ }
6042
+ if (entry && typeof entry === "object" && "properties" in entry && entry.properties && typeof entry.properties === "object" && "name" in entry.properties && typeof entry.properties.name === "string") {
6043
+ return [normalizeIconName(entry.properties.name)];
6044
+ }
6045
+ return [];
6046
+ }).filter(Boolean);
6047
+ }
6048
+ if (icons && typeof icons === "object") {
6049
+ return Object.keys(icons).map(normalizeIconName).filter(Boolean);
6050
+ }
6051
+ const glyphs = payload.glyphs;
6052
+ if (Array.isArray(glyphs)) {
6053
+ return glyphs.flatMap((entry) => {
6054
+ if (entry && typeof entry === "object" && "css" in entry && typeof entry.css === "string") {
6055
+ return [normalizeIconName(entry.css)];
6056
+ }
6057
+ return [];
6058
+ }).filter(Boolean);
6059
+ }
6060
+ return [];
6061
+ }
6062
+ function normalizeIconName(name) {
6063
+ return name.trim().replace(/^:/, "").replace(/:$/, "");
6064
+ }
6065
+ function createCustomIconSelectionValue(library, name) {
6066
+ const prefix = library.prefix;
6067
+ const displayPrefix = library.displayPrefix || prefix.replace(/-$/, "");
6068
+ return `${displayPrefix} ${prefix}${name}`.trim();
6069
+ }
6070
+
5478
6071
  // src/controls/icon-library/font-awesome-7-data.ts
5479
6072
  var FONT_AWESOME_7_LIBRARIES = [
5480
6073
  { file: "solid", library: "fa-solid" },
@@ -5500,7 +6093,8 @@ function getFontAwesome7EditorConfig() {
5500
6093
  }
5501
6094
  return {
5502
6095
  jsonFiles: config.jsonFiles,
5503
- jsonBaseUrl
6096
+ jsonBaseUrl,
6097
+ filter: config.filter
5504
6098
  };
5505
6099
  }
5506
6100
  var FONT_AWESOME_ICON_NAME_PATTERN = /^fa\S*\s+fa-([^\s]+)/;
@@ -5691,16 +6285,22 @@ function getSelectedIconId(iconClass, library) {
5691
6285
  return `${library}:${name}`;
5692
6286
  }
5693
6287
  function findFontAwesome7Icon(icons, iconClass, library) {
5694
- const selectedId = getSelectedIconId(iconClass, library);
5695
- if (!selectedId || !library) {
6288
+ if (!iconClass || !library) {
5696
6289
  return void 0;
5697
6290
  }
5698
- const selectedName = selectedId.slice(`${library}:`.length);
6291
+ const selectedId = getSelectedIconId(iconClass, library);
6292
+ const selectedName = selectedId?.slice(`${library}:`.length);
5699
6293
  return icons.find((icon) => {
5700
6294
  if (icon.library !== library) {
5701
6295
  return false;
5702
6296
  }
5703
- return icon.id === selectedId || icon.name === selectedName || icon.aliases.includes(selectedName);
6297
+ if (icon.value === iconClass || icon.id === selectedId) {
6298
+ return true;
6299
+ }
6300
+ if (!selectedName) {
6301
+ return false;
6302
+ }
6303
+ return icon.name === selectedName || icon.aliases.includes(selectedName);
5704
6304
  });
5705
6305
  }
5706
6306
  function toCatalogIcon(icon, library) {
@@ -5715,22 +6315,111 @@ function toCatalogIcon(icon, library) {
5715
6315
 
5716
6316
  // src/controls/icon-library/font-awesome-glyph.tsx
5717
6317
  import * as React81 from "react";
6318
+ import { Box as Box15 } from "@elementor/ui";
6319
+
6320
+ // src/controls/icon-library/sanitize-icon-svg-markup.ts
6321
+ var ALLOWED_SVG_TAGS = /* @__PURE__ */ new Set(["svg", "g", "path", "title", "desc"]);
6322
+ var ALLOWED_SVG_ATTRS = /* @__PURE__ */ new Set([
6323
+ "d",
6324
+ "fill",
6325
+ "viewbox",
6326
+ "xmlns",
6327
+ "width",
6328
+ "height",
6329
+ "transform",
6330
+ "overflow",
6331
+ "aria-hidden",
6332
+ "aria-label",
6333
+ "role"
6334
+ ]);
6335
+ function sanitizeIconSvgMarkup(markup) {
6336
+ if (typeof markup !== "string" || markup === "") {
6337
+ return "";
6338
+ }
6339
+ const doc = new DOMParser().parseFromString(markup, "image/svg+xml");
6340
+ if (doc.querySelector("parsererror")) {
6341
+ return "";
6342
+ }
6343
+ const svg = doc.querySelector("svg");
6344
+ if (!svg) {
6345
+ return "";
6346
+ }
6347
+ pruneNode(svg);
6348
+ return svg.tagName.toLowerCase() === "svg" ? svg.outerHTML : "";
6349
+ }
6350
+ function pruneNode(node) {
6351
+ [...node.children].forEach((child) => {
6352
+ if (!ALLOWED_SVG_TAGS.has(child.tagName.toLowerCase())) {
6353
+ child.remove();
6354
+ return;
6355
+ }
6356
+ pruneNode(child);
6357
+ });
6358
+ [...node.attributes].forEach((attribute) => {
6359
+ if (!ALLOWED_SVG_ATTRS.has(attribute.name.toLowerCase())) {
6360
+ node.removeAttribute(attribute.name);
6361
+ }
6362
+ });
6363
+ }
6364
+
6365
+ // src/controls/icon-library/font-awesome-glyph.tsx
5718
6366
  var FontAwesomeGlyph = ({ icon, size, color, label }) => {
5719
- return /* @__PURE__ */ React81.createElement(
5720
- "svg",
5721
- {
5722
- xmlns: "http://www.w3.org/2000/svg",
5723
- viewBox: `0 0 ${icon.width} ${icon.height}`,
5724
- width: size,
5725
- height: size,
5726
- fill: color,
5727
- overflow: "visible",
5728
- "aria-hidden": label ? void 0 : true,
5729
- "aria-label": label,
5730
- role: label ? "img" : void 0
5731
- },
5732
- icon.paths.map((path, index) => /* @__PURE__ */ React81.createElement("path", { key: `${index}-${path}`, d: path }))
5733
- );
6367
+ const svgMarkup = sanitizeIconSvgMarkup(icon.svgMarkup);
6368
+ if (svgMarkup) {
6369
+ return /* @__PURE__ */ React81.createElement(
6370
+ Box15,
6371
+ {
6372
+ component: "span",
6373
+ "aria-hidden": label ? void 0 : true,
6374
+ "aria-label": label,
6375
+ role: label ? "img" : void 0,
6376
+ sx: {
6377
+ width: size,
6378
+ height: size,
6379
+ color,
6380
+ display: "inline-flex",
6381
+ "& svg": {
6382
+ width: "100%",
6383
+ height: "100%",
6384
+ fill: "currentColor"
6385
+ },
6386
+ "& path": {
6387
+ fill: "currentColor"
6388
+ }
6389
+ },
6390
+ dangerouslySetInnerHTML: { __html: svgMarkup }
6391
+ }
6392
+ );
6393
+ }
6394
+ if (icon.paths.length > 0) {
6395
+ return /* @__PURE__ */ React81.createElement(
6396
+ "svg",
6397
+ {
6398
+ xmlns: "http://www.w3.org/2000/svg",
6399
+ viewBox: `0 0 ${icon.width} ${icon.height}`,
6400
+ width: size,
6401
+ height: size,
6402
+ fill: color,
6403
+ overflow: "visible",
6404
+ "aria-hidden": label ? void 0 : true,
6405
+ "aria-label": label,
6406
+ role: label ? "img" : void 0
6407
+ },
6408
+ icon.paths.map((path, index) => /* @__PURE__ */ React81.createElement("path", { key: `${index}-${path}`, d: path }))
6409
+ );
6410
+ }
6411
+ if (icon.glyphClass) {
6412
+ return /* @__PURE__ */ React81.createElement(
6413
+ "i",
6414
+ {
6415
+ className: icon.glyphClass,
6416
+ "aria-hidden": label ? void 0 : true,
6417
+ "aria-label": label,
6418
+ style: { fontSize: size, color, lineHeight: 1 }
6419
+ }
6420
+ );
6421
+ }
6422
+ return null;
5734
6423
  };
5735
6424
 
5736
6425
  // src/controls/icon-library/icon-library-filter.tsx
@@ -5740,7 +6429,9 @@ import { CheckIcon, FilterIcon as FilterIcon2, LibraryIcon, ListIcon, StarFilled
5740
6429
  import {
5741
6430
  bindMenu as bindMenu3,
5742
6431
  bindToggle as bindToggle2,
5743
- Box as Box15,
6432
+ Box as Box16,
6433
+ Divider as Divider4,
6434
+ ListSubheader,
5744
6435
  Menu as Menu4,
5745
6436
  MenuItem as MenuItem2,
5746
6437
  Stack as Stack13,
@@ -5758,48 +6449,34 @@ var ICON_LIBRARY_ACTION_TOOLTIP_ENTER_DELAY = 0;
5758
6449
  var FILTER_MENU_WIDTH = 280;
5759
6450
  var FILTER_INDICATOR_SIZE = 6;
5760
6451
  var FILTER_INDICATOR_OFFSET = 4;
5761
- var LIBRARY_FILTER_ORDER = {
5762
- regular: 0,
5763
- solid: 1,
5764
- brands: 2
5765
- };
5766
- var LIBRARY_FILTER_CONFIG = {
5767
- "fa-regular": {
5768
- getLabel: () => __32("Font Awesome - Regular", "elementor"),
5769
- Icon: StarIcon,
5770
- order: LIBRARY_FILTER_ORDER.regular
5771
- },
5772
- "fa-solid": {
5773
- getLabel: () => __32("Font Awesome - Solid", "elementor"),
5774
- Icon: StarFilledIcon,
5775
- order: LIBRARY_FILTER_ORDER.solid
5776
- },
5777
- "fa-brands": {
5778
- getLabel: () => __32("Font Awesome - Brands", "elementor"),
5779
- Icon: LibraryIcon,
5780
- order: LIBRARY_FILTER_ORDER.brands
5781
- }
5782
- };
6452
+ var FILTER_TYPE_ALL = "all";
6453
+ var FILTER_TYPE_GROUP = "group";
6454
+ var FILTER_TYPE_ITEM = "item";
6455
+ var FILTER_ICONS = {
6456
+ list: ListIcon,
6457
+ star: StarIcon,
6458
+ "star-filled": StarFilledIcon,
6459
+ library: LibraryIcon
6460
+ };
6461
+ var DEFAULT_FILTER = [
6462
+ { type: FILTER_TYPE_ALL, label: "All icons", icon: "list" },
6463
+ { type: FILTER_TYPE_ITEM, value: "fa-regular", label: "Font Awesome - Regular", icon: "star" },
6464
+ { type: FILTER_TYPE_ITEM, value: "fa-solid", label: "Font Awesome - Solid", icon: "star-filled" },
6465
+ { type: FILTER_TYPE_ITEM, value: "fa-brands", label: "Font Awesome - Brands", icon: "library" }
6466
+ ];
5783
6467
  var IconLibraryFilter = ({ value, onChange }) => {
5784
6468
  const popupId = useId4();
5785
6469
  const popupState = usePopupState8({
5786
6470
  variant: "popover",
5787
6471
  popupId
5788
6472
  });
5789
- const options = FONT_AWESOME_7_LIBRARIES.map(({ library }) => ({
5790
- value: library,
5791
- label: LIBRARY_FILTER_CONFIG[library].getLabel(),
5792
- Icon: LIBRARY_FILTER_CONFIG[library].Icon,
5793
- order: LIBRARY_FILTER_CONFIG[library].order
5794
- })).sort((firstOption, secondOption) => firstOption.order - secondOption.order);
6473
+ const entries = getFilterEntries();
6474
+ const selectableValues = entries.flatMap((entry) => entry.type === FILTER_TYPE_ITEM ? [entry.value] : []);
5795
6475
  const isFiltered = value.length > 0;
5796
6476
  const filterButtonLabel = isFiltered ? __32("Filter by library, active", "elementor") : __32("Filter by library", "elementor");
5797
- const handleAllIconsClick = () => {
5798
- onChange([]);
5799
- };
5800
6477
  const handleLibraryClick = (library) => {
5801
6478
  const nextValue = value.includes(library) ? value.filter((selectedLibrary) => selectedLibrary !== library) : [...value, library];
5802
- onChange(nextValue.length === FONT_AWESOME_7_LIBRARIES.length ? [] : nextValue);
6479
+ onChange(nextValue.length === selectableValues.length ? [] : nextValue);
5803
6480
  };
5804
6481
  return /* @__PURE__ */ React82.createElement(React82.Fragment, null, /* @__PURE__ */ React82.createElement(
5805
6482
  Tooltip8,
@@ -5823,7 +6500,7 @@ var IconLibraryFilter = ({ value, onChange }) => {
5823
6500
  },
5824
6501
  /* @__PURE__ */ React82.createElement(FilterIcon2, { fontSize: "tiny" }),
5825
6502
  isFiltered ? /* @__PURE__ */ React82.createElement(
5826
- Box15,
6503
+ Box16,
5827
6504
  {
5828
6505
  component: "span",
5829
6506
  "aria-hidden": "true",
@@ -5850,35 +6527,91 @@ var IconLibraryFilter = ({ value, onChange }) => {
5850
6527
  },
5851
6528
  sx: { "& .MuiPaper-root": { minWidth: FILTER_MENU_WIDTH } }
5852
6529
  },
6530
+ entries.flatMap(
6531
+ (entry, index) => renderFilterEntry(entry, index, value, isFiltered, () => onChange([]), handleLibraryClick)
6532
+ )
6533
+ ));
6534
+ };
6535
+ var renderFilterEntry = (entry, index, selectedLibraries, isFiltered, onAllIconsClick, onLibraryClick) => {
6536
+ if (entry.type === FILTER_TYPE_GROUP) {
6537
+ return [
6538
+ /* @__PURE__ */ React82.createElement(Divider4, { key: `divider-${index}` }),
6539
+ /* @__PURE__ */ React82.createElement(ListSubheader, { key: `group-${index}`, disableSticky: true }, entry.label)
6540
+ ];
6541
+ }
6542
+ if (entry.type === FILTER_TYPE_ALL) {
6543
+ return [
6544
+ /* @__PURE__ */ React82.createElement(
6545
+ MenuItem2,
6546
+ {
6547
+ key: `all-${index}`,
6548
+ role: "menuitemcheckbox",
6549
+ "aria-checked": !isFiltered,
6550
+ selected: !isFiltered,
6551
+ onClick: onAllIconsClick
6552
+ },
6553
+ renderFilterMenuItemContent(entry.label, getFilterIcon(entry.icon), !isFiltered)
6554
+ )
6555
+ ];
6556
+ }
6557
+ const isSelected = selectedLibraries.includes(entry.value);
6558
+ return [
5853
6559
  /* @__PURE__ */ React82.createElement(
5854
6560
  MenuItem2,
5855
6561
  {
6562
+ key: entry.value,
5856
6563
  role: "menuitemcheckbox",
5857
- "aria-checked": !isFiltered,
5858
- selected: !isFiltered,
5859
- onClick: handleAllIconsClick
6564
+ "aria-checked": isSelected,
6565
+ selected: isSelected,
6566
+ onClick: () => onLibraryClick(entry.value)
5860
6567
  },
5861
- renderFilterMenuItemContent(__32("All icons", "elementor"), ListIcon, !isFiltered)
5862
- ),
5863
- options.map(({ value: library, label, Icon }) => /* @__PURE__ */ React82.createElement(
5864
- MenuItem2,
5865
- {
5866
- key: library,
5867
- role: "menuitemcheckbox",
5868
- "aria-checked": value.includes(library),
5869
- selected: value.includes(library),
5870
- onClick: () => handleLibraryClick(library)
5871
- },
5872
- renderFilterMenuItemContent(label, Icon, value.includes(library))
5873
- ))
5874
- ));
6568
+ renderFilterMenuItemContent(entry.label, getFilterIcon(entry.icon), isSelected)
6569
+ )
6570
+ ];
5875
6571
  };
6572
+ var getFilterIcon = (icon) => FILTER_ICONS[icon ?? ""] ?? LibraryIcon;
5876
6573
  var renderFilterMenuItemContent = (label, Icon, selected) => /* @__PURE__ */ React82.createElement(Stack13, { direction: "row", alignItems: "center", gap: 1, width: "100%" }, /* @__PURE__ */ React82.createElement(Icon, { fontSize: "tiny" }), /* @__PURE__ */ React82.createElement(Typography7, { variant: "caption", sx: { flex: 1 } }, label), selected ? /* @__PURE__ */ React82.createElement(CheckIcon, { fontSize: "tiny", "aria-hidden": "true" }) : null);
6574
+ function getFilterEntries() {
6575
+ const filter = window.elementorCommon?.config?.fontAwesome?.v7?.filter;
6576
+ if (!Array.isArray(filter)) {
6577
+ return [...DEFAULT_FILTER];
6578
+ }
6579
+ const entries = filter.map(parseFilterEntry).filter((entry) => entry !== null);
6580
+ return entries.length > 0 ? entries : [...DEFAULT_FILTER];
6581
+ }
6582
+ function parseFilterEntry(value) {
6583
+ if (!value || typeof value !== "object") {
6584
+ return null;
6585
+ }
6586
+ const entry = value;
6587
+ if (typeof entry.label !== "string" || entry.label === "") {
6588
+ return null;
6589
+ }
6590
+ if (entry.type === FILTER_TYPE_GROUP) {
6591
+ return { type: FILTER_TYPE_GROUP, label: entry.label };
6592
+ }
6593
+ if (entry.type === FILTER_TYPE_ALL) {
6594
+ return {
6595
+ type: FILTER_TYPE_ALL,
6596
+ label: entry.label,
6597
+ icon: typeof entry.icon === "string" ? entry.icon : void 0
6598
+ };
6599
+ }
6600
+ if (entry.type === FILTER_TYPE_ITEM && typeof entry.value === "string" && entry.value !== "") {
6601
+ return {
6602
+ type: FILTER_TYPE_ITEM,
6603
+ value: entry.value,
6604
+ label: entry.label,
6605
+ icon: typeof entry.icon === "string" ? entry.icon : void 0
6606
+ };
6607
+ }
6608
+ return null;
6609
+ }
5877
6610
 
5878
6611
  // src/controls/icon-library/icon-library-grid.tsx
5879
6612
  import * as React83 from "react";
5880
6613
  import { useLayoutEffect as useLayoutEffect3, useRef as useRef16, useState as useState17 } from "react";
5881
- import { Box as Box16, Tooltip as Tooltip9, useTheme as useTheme3 } from "@elementor/ui";
6614
+ import { Box as Box17, Tooltip as Tooltip9, useTheme as useTheme3 } from "@elementor/ui";
5882
6615
  import { useVirtualizer } from "@tanstack/react-virtual";
5883
6616
  import { __ as __33 } from "@wordpress/i18n";
5884
6617
  var ICON_LIBRARY_GRID_FALLBACK_COLUMN_COUNT = 4;
@@ -6024,7 +6757,7 @@ var IconLibraryGrid = ({
6024
6757
  }
6025
6758
  };
6026
6759
  return /* @__PURE__ */ React83.createElement(
6027
- Box16,
6760
+ Box17,
6028
6761
  {
6029
6762
  ref: containerRef,
6030
6763
  sx: {
@@ -6036,7 +6769,7 @@ var IconLibraryGrid = ({
6036
6769
  }
6037
6770
  },
6038
6771
  items2.length === 0 && noResultsComponent ? noResultsComponent : /* @__PURE__ */ React83.createElement(
6039
- Box16,
6772
+ Box17,
6040
6773
  {
6041
6774
  role: "grid",
6042
6775
  "aria-label": __33("Icons", "elementor"),
@@ -6054,7 +6787,7 @@ var IconLibraryGrid = ({
6054
6787
  const startIndex = virtualRow.index * columnCount;
6055
6788
  const rowItems = items2.slice(startIndex, startIndex + columnCount);
6056
6789
  return /* @__PURE__ */ React83.createElement(
6057
- Box16,
6790
+ Box17,
6058
6791
  {
6059
6792
  key: virtualRow.key,
6060
6793
  role: "row",
@@ -6078,7 +6811,7 @@ var IconLibraryGrid = ({
6078
6811
  const isSelected = selectedValue === item.id;
6079
6812
  const tabIndex = focusedIndex === index ? 0 : -1;
6080
6813
  return /* @__PURE__ */ React83.createElement(
6081
- Box16,
6814
+ Box17,
6082
6815
  {
6083
6816
  key: item.id,
6084
6817
  role: "presentation",
@@ -6095,7 +6828,7 @@ var IconLibraryGrid = ({
6095
6828
  disableFocusListener: true
6096
6829
  },
6097
6830
  /* @__PURE__ */ React83.createElement(
6098
- Box16,
6831
+ Box17,
6099
6832
  {
6100
6833
  component: "button",
6101
6834
  type: "button",
@@ -6149,14 +6882,14 @@ var IconLibraryGrid = ({
6149
6882
  }
6150
6883
  }
6151
6884
  },
6152
- item.paths.length > 0 ? /* @__PURE__ */ React83.createElement(
6885
+ /* @__PURE__ */ React83.createElement(
6153
6886
  FontAwesomeGlyph,
6154
6887
  {
6155
6888
  icon: item,
6156
6889
  size: ICON_GLYPH_SIZE,
6157
6890
  color: "currentColor"
6158
6891
  }
6159
- ) : null
6892
+ )
6160
6893
  )
6161
6894
  )
6162
6895
  );
@@ -6253,10 +6986,10 @@ var IconLibraryViewToggle = ({ value, onChange }) => {
6253
6986
  var ViewMenuItem = ({ label, selected, onClick }) => /* @__PURE__ */ React84.createElement(MenuItem3, { role: "menuitemradio", "aria-checked": selected, selected, onClick }, /* @__PURE__ */ React84.createElement(Stack14, { direction: "row", alignItems: "center", gap: 1, width: "100%" }, /* @__PURE__ */ React84.createElement(Typography8, { variant: "caption", sx: { flex: 1 } }, label), selected ? /* @__PURE__ */ React84.createElement(CheckIcon2, { fontSize: "tiny", "aria-hidden": "true" }) : null));
6254
6987
 
6255
6988
  // src/controls/icon-library/use-font-awesome-7-catalog.ts
6256
- import { useQuery as useQuery2 } from "@elementor/query";
6989
+ import { useQuery as useQuery3 } from "@elementor/query";
6257
6990
  var FONT_AWESOME_7_CATALOG_QUERY_KEY = ["font-awesome-7-catalog"];
6258
6991
  function useFontAwesome7Catalog(enabled) {
6259
- return useQuery2({
6992
+ return useQuery3({
6260
6993
  queryKey: FONT_AWESOME_7_CATALOG_QUERY_KEY,
6261
6994
  queryFn: ({ signal }) => loadFontAwesome7Catalog(signal),
6262
6995
  enabled,
@@ -6302,7 +7035,10 @@ var IconLibraryPopover = ({
6302
7035
  ICON_LIBRARY_VIEW_STORAGE_PREFIX
6303
7036
  );
6304
7037
  const view = isIconLibraryView(storedView) ? storedView : DEFAULT_ICON_LIBRARY_VIEW;
6305
- const { data: icons = [], isLoading } = useFontAwesome7Catalog(open);
7038
+ const { data: fontAwesomeIcons = [], isLoading: isFontAwesomeLoading } = useFontAwesome7Catalog(open);
7039
+ const { data: customIcons = [], isLoading: isCustomLoading } = useCustomIconLibraries(open);
7040
+ const isLoading = isFontAwesomeLoading || isCustomLoading;
7041
+ const icons = useMemo12(() => [...fontAwesomeIcons, ...customIcons], [customIcons, fontAwesomeIcons]);
6306
7042
  const items2 = useMemo12(
6307
7043
  () => createIconLibraryItems(icons, searchValue, activeLibraries),
6308
7044
  [activeLibraries, icons, searchValue]
@@ -6322,7 +7058,7 @@ var IconLibraryPopover = ({
6322
7058
  return;
6323
7059
  }
6324
7060
  onSelect({
6325
- value: createIconSelectionValue(icon.library, icon.name),
7061
+ value: icon.glyphClass ?? createIconSelectionValue(icon.library, icon.name),
6326
7062
  library: icon.library
6327
7063
  });
6328
7064
  };
@@ -6347,7 +7083,7 @@ var IconLibraryPopover = ({
6347
7083
  id: "icon-library-search",
6348
7084
  sx: { flex: 1, px: 0, pb: 0 }
6349
7085
  }
6350
- ), /* @__PURE__ */ React85.createElement(IconLibraryFilter, { value: activeLibraries, onChange: setActiveLibraries })), /* @__PURE__ */ React85.createElement(Divider4, null), /* @__PURE__ */ React85.createElement(Box17, { sx: { flex: 1, overflow: "hidden", minHeight: 0, minWidth: 0 } }, /* @__PURE__ */ React85.createElement(
7086
+ ), /* @__PURE__ */ React85.createElement(IconLibraryFilter, { value: activeLibraries, onChange: setActiveLibraries })), /* @__PURE__ */ React85.createElement(Divider5, null), /* @__PURE__ */ React85.createElement(Box18, { sx: { flex: 1, overflow: "hidden", minHeight: 0, minWidth: 0 } }, /* @__PURE__ */ React85.createElement(
6351
7087
  IconLibraryContent,
6352
7088
  {
6353
7089
  isLoading,
@@ -6385,7 +7121,7 @@ var IconLibraryContent = ({
6385
7121
  }
6386
7122
  );
6387
7123
  if (view === "grid") {
6388
- return /* @__PURE__ */ React85.createElement(Box17, { sx: { width: "100%", height: "100%", minWidth: 0, minHeight: 0 } }, /* @__PURE__ */ React85.createElement(
7124
+ return /* @__PURE__ */ React85.createElement(Box18, { sx: { width: "100%", height: "100%", minWidth: 0, minHeight: 0 } }, /* @__PURE__ */ React85.createElement(
6389
7125
  IconLibraryGrid,
6390
7126
  {
6391
7127
  items: items2,
@@ -6425,7 +7161,7 @@ var IconLibraryEmptyState = ({
6425
7161
  var IconLibraryRow = (item) => {
6426
7162
  const icon = item;
6427
7163
  return /* @__PURE__ */ React85.createElement(Stack15, { direction: "row", alignItems: "center", gap: 1, sx: { width: "100%" } }, /* @__PURE__ */ React85.createElement(
6428
- Box17,
7164
+ Box18,
6429
7165
  {
6430
7166
  sx: {
6431
7167
  width: ICON_TILE_SIZE,
@@ -6440,7 +7176,7 @@ var IconLibraryRow = (item) => {
6440
7176
  flexShrink: 0
6441
7177
  }
6442
7178
  },
6443
- icon.paths.length > 0 ? /* @__PURE__ */ React85.createElement(FontAwesomeGlyph, { icon, size: ICON_GLYPH_SIZE2, color: "currentColor" }) : null
7179
+ /* @__PURE__ */ React85.createElement(FontAwesomeGlyph, { icon, size: ICON_GLYPH_SIZE2, color: "currentColor" })
6444
7180
  ), /* @__PURE__ */ React85.createElement(Typography9, { variant: "caption", color: "text.primary", noWrap: true }, icon.label));
6445
7181
  };
6446
7182
  var CatalogUnavailable = () => /* @__PURE__ */ React85.createElement(Stack15, { alignItems: "center", justifyContent: "center", height: "100%", p: 2.5, gap: 1.5 }, /* @__PURE__ */ React85.createElement(ComponentsIcon, { fontSize: "large" }), /* @__PURE__ */ React85.createElement(Typography9, { align: "center", variant: "subtitle2", color: "text.secondary" }, __35("Icons couldn't be loaded.", "elementor")));
@@ -6451,19 +7187,10 @@ var createIconLibraryItems = (icons, searchValue, libraries) => filterFontAwesom
6451
7187
  value: icon.id
6452
7188
  }));
6453
7189
 
6454
- // src/controls/open-icon-library.ts
6455
- import { stringPropTypeUtil as stringPropTypeUtil14 } from "@elementor/editor-props";
6456
- function createIconPropValue(icon, library) {
6457
- return {
6458
- value: stringPropTypeUtil14.create(icon),
6459
- library: stringPropTypeUtil14.create(library)
6460
- };
6461
- }
6462
-
6463
7190
  // src/controls/svg-media-overlay.tsx
6464
7191
  import * as React86 from "react";
6465
7192
  import { LibraryIcon as LibraryIcon2, UploadIcon as UploadIcon2 } from "@elementor/icons";
6466
- import { Box as Box18, Button as Button5, Stack as Stack16, styled as styled10, ThemeProvider, Typography as Typography10 } from "@elementor/ui";
7193
+ import { Box as Box19, Button as Button5, Stack as Stack16, styled as styled10, ThemeProvider, Typography as Typography10 } from "@elementor/ui";
6467
7194
  import { __ as __36 } from "@wordpress/i18n";
6468
7195
  var SVG_MEDIA_CONTROL_CONTAINER_TEST_ID = "svg-media-control-container";
6469
7196
  var SVG_MEDIA_ACTION_GROUP_TEST_ID = "svg-media-action-group";
@@ -6508,7 +7235,7 @@ var SvgMediaOverlay = ({
6508
7235
  },
6509
7236
  __36("Select", "elementor")
6510
7237
  ), /* @__PURE__ */ React86.createElement(
6511
- Box18,
7238
+ Box19,
6512
7239
  {
6513
7240
  sx: {
6514
7241
  width: "1px",
@@ -6524,7 +7251,7 @@ var SvgMediaOverlay = ({
6524
7251
  description: infotipDescription,
6525
7252
  isEnabled: !isAdmin
6526
7253
  },
6527
- /* @__PURE__ */ React86.createElement(Box18, { component: "span", sx: { display: "inline-flex" } }, /* @__PURE__ */ React86.createElement(UploadControl, { isAdmin, onUpload }))
7254
+ /* @__PURE__ */ React86.createElement(Box19, { component: "span", sx: { display: "inline-flex" } }, /* @__PURE__ */ React86.createElement(UploadControl, { isAdmin, onUpload }))
6528
7255
  )), showIconLibrary ? /* @__PURE__ */ React86.createElement(
6529
7256
  Button5,
6530
7257
  {
@@ -6568,15 +7295,18 @@ var UploadButton = ({
6568
7295
 
6569
7296
  // src/controls/svg-media-preview.tsx
6570
7297
  import * as React87 from "react";
6571
- import { Box as Box19, CardMedia as CardMedia2, CircularProgress as CircularProgress4 } from "@elementor/ui";
7298
+ import { Box as Box20, CardMedia as CardMedia2, CircularProgress as CircularProgress4 } from "@elementor/ui";
6572
7299
  import { __ as __37 } from "@wordpress/i18n";
6573
7300
  var ICON_PREVIEW_SIZE = 50;
6574
7301
  var ICON_PREVIEW_COLOR = "#000000";
6575
7302
  var SvgMediaPreview = ({ isFetching, src, iconClassName, iconLibrary }) => {
6576
7303
  const shouldLoadIconCatalog = Boolean(iconClassName && iconLibrary);
6577
- const { data: icons = [], isLoading } = useFontAwesome7Catalog(shouldLoadIconCatalog);
7304
+ const { data: fontAwesomeIcons = [], isLoading: isFontAwesomeLoading } = useFontAwesome7Catalog(shouldLoadIconCatalog);
7305
+ const { data: customIcons = [], isLoading: isCustomLoading } = useCustomIconLibraries(shouldLoadIconCatalog);
7306
+ const icons = [...fontAwesomeIcons, ...customIcons];
6578
7307
  const selectedIcon = findFontAwesome7Icon(icons, iconClassName, iconLibrary);
6579
- if (isFetching || shouldLoadIconCatalog && isLoading) {
7308
+ const isLoadingCatalog = shouldLoadIconCatalog && (isFontAwesomeLoading || isCustomLoading);
7309
+ if (isFetching || isLoadingCatalog) {
6580
7310
  return /* @__PURE__ */ React87.createElement(CircularProgress4, { role: "progressbar" });
6581
7311
  }
6582
7312
  if (selectedIcon) {
@@ -6587,7 +7317,7 @@ var SvgMediaPreview = ({ isFetching, src, iconClassName, iconLibrary }) => {
6587
7317
  }
6588
7318
  return /* @__PURE__ */ React87.createElement(SvgPreview, { src });
6589
7319
  };
6590
- var IconPreview = ({ icon }) => /* @__PURE__ */ React87.createElement(Box19, { sx: { color: ICON_PREVIEW_COLOR } }, /* @__PURE__ */ React87.createElement(
7320
+ var IconPreview = ({ icon }) => /* @__PURE__ */ React87.createElement(Box20, { sx: { color: ICON_PREVIEW_COLOR } }, /* @__PURE__ */ React87.createElement(
6591
7321
  FontAwesomeGlyph,
6592
7322
  {
6593
7323
  icon,
@@ -6597,7 +7327,7 @@ var IconPreview = ({ icon }) => /* @__PURE__ */ React87.createElement(Box19, { s
6597
7327
  }
6598
7328
  ));
6599
7329
  var IconPreviewPlaceholder = () => /* @__PURE__ */ React87.createElement(
6600
- Box19,
7330
+ Box20,
6601
7331
  {
6602
7332
  "aria-hidden": true,
6603
7333
  sx: {
@@ -6757,7 +7487,7 @@ var SvgMediaControl = createControl(({ showIconLibrary = false }) => {
6757
7487
  }
6758
7488
  )
6759
7489
  ) : null, /* @__PURE__ */ React88.createElement(
6760
- Box20,
7490
+ Box21,
6761
7491
  {
6762
7492
  ref: controlContainerRef,
6763
7493
  "data-testid": SVG_MEDIA_CONTROL_CONTAINER_TEST_ID,
@@ -6918,7 +7648,7 @@ import {
6918
7648
  backgroundOverlayPropTypeUtil,
6919
7649
  colorPropTypeUtil as colorPropTypeUtil3
6920
7650
  } from "@elementor/editor-props";
6921
- import { Box as Box21, CardMedia as CardMedia4, styled as styled12, Tab, TabPanel, Tabs, UnstableColorIndicator as UnstableColorIndicator3 } from "@elementor/ui";
7651
+ import { Box as Box22, CardMedia as CardMedia4, styled as styled12, Tab, TabPanel, Tabs, UnstableColorIndicator as UnstableColorIndicator3 } from "@elementor/ui";
6922
7652
  import { useWpMediaAttachment as useWpMediaAttachment4 } from "@elementor/wp-media";
6923
7653
  import { __ as __44 } from "@wordpress/i18n";
6924
7654
 
@@ -7320,7 +8050,7 @@ var ItemContent2 = () => {
7320
8050
  gradient: initialBackgroundGradientOverlay.value
7321
8051
  });
7322
8052
  const { rowRef } = useRepeaterContext();
7323
- return /* @__PURE__ */ React95.createElement(Box21, { sx: { width: "100%" } }, /* @__PURE__ */ React95.createElement(Box21, { sx: { borderBottom: 1, borderColor: "divider" } }, /* @__PURE__ */ React95.createElement(
8053
+ return /* @__PURE__ */ React95.createElement(Box22, { sx: { width: "100%" } }, /* @__PURE__ */ React95.createElement(Box22, { sx: { borderBottom: 1, borderColor: "divider" } }, /* @__PURE__ */ React95.createElement(
7324
8054
  Tabs,
7325
8055
  {
7326
8056
  size: "small",
@@ -7469,7 +8199,7 @@ var BackgroundClipField = () => {
7469
8199
  import * as React97 from "react";
7470
8200
  import { useMemo as useMemo13 } from "react";
7471
8201
  import { createArrayPropUtils as createArrayPropUtils2 } from "@elementor/editor-props";
7472
- import { Box as Box22 } from "@elementor/ui";
8202
+ import { Box as Box23 } from "@elementor/ui";
7473
8203
  var PLACEHOLDER_REGEX = /\$\{([^}]+)\}/g;
7474
8204
  var RepeatableControl = createControl(
7475
8205
  ({
@@ -7615,7 +8345,7 @@ var ItemLabel4 = ({ value }) => {
7615
8345
  const label = showPlaceholder ? placeholder : interpolate(patternLabel, value);
7616
8346
  const isReadOnly = !!childProps?.readOnly;
7617
8347
  const color = getTextColor(isReadOnly, showPlaceholder);
7618
- return /* @__PURE__ */ React97.createElement(Box22, { component: "span", color }, label);
8348
+ return /* @__PURE__ */ React97.createElement(Box23, { component: "span", color }, label);
7619
8349
  };
7620
8350
  var getAllProperties = (pattern) => {
7621
8351
  const properties = pattern.match(PLACEHOLDER_REGEX)?.map((match) => match.slice(2, -1)) || [];
@@ -7802,7 +8532,7 @@ import * as React112 from "react";
7802
8532
  import { useRef as useRef28 } from "react";
7803
8533
  import { transformFunctionsPropTypeUtil, transformPropTypeUtil } from "@elementor/editor-props";
7804
8534
  import { AdjustmentsIcon as AdjustmentsIcon2, InfoCircleFilledIcon as InfoCircleFilledIcon2 } from "@elementor/icons";
7805
- import { bindTrigger as bindTrigger5, Box as Box26, IconButton as IconButton8, Tooltip as Tooltip11, Typography as Typography11, usePopupState as usePopupState11 } from "@elementor/ui";
8535
+ import { bindTrigger as bindTrigger5, Box as Box27, IconButton as IconButton8, Tooltip as Tooltip11, Typography as Typography11, usePopupState as usePopupState11 } from "@elementor/ui";
7806
8536
  import { __ as __57 } from "@wordpress/i18n";
7807
8537
 
7808
8538
  // src/controls/transform-control/initial-values.ts
@@ -7858,7 +8588,7 @@ var initialSkewValue = skewTransformPropTypeUtil.create({
7858
8588
 
7859
8589
  // src/controls/transform-control/transform-content.tsx
7860
8590
  import * as React106 from "react";
7861
- import { Box as Box23, Tab as Tab2, TabPanel as TabPanel2, Tabs as Tabs2 } from "@elementor/ui";
8591
+ import { Box as Box24, Tab as Tab2, TabPanel as TabPanel2, Tabs as Tabs2 } from "@elementor/ui";
7862
8592
  import { __ as __52 } from "@wordpress/i18n";
7863
8593
 
7864
8594
  // src/controls/transform-control/functions/move.tsx
@@ -8129,7 +8859,7 @@ var TransformContent = () => {
8129
8859
  rotate: initialRotateValue.value,
8130
8860
  skew: initialSkewValue.value
8131
8861
  });
8132
- return /* @__PURE__ */ React106.createElement(PopoverContent, null, /* @__PURE__ */ React106.createElement(Box23, { sx: { width: "100%" } }, /* @__PURE__ */ React106.createElement(Box23, { sx: { borderBottom: 1, borderColor: "divider" } }, /* @__PURE__ */ React106.createElement(
8862
+ return /* @__PURE__ */ React106.createElement(PopoverContent, null, /* @__PURE__ */ React106.createElement(Box24, { sx: { width: "100%" } }, /* @__PURE__ */ React106.createElement(Box24, { sx: { borderBottom: 1, borderColor: "divider" } }, /* @__PURE__ */ React106.createElement(
8133
8863
  Tabs2,
8134
8864
  {
8135
8865
  size: "small",
@@ -8169,7 +8899,7 @@ var TransformIcon = ({ value }) => {
8169
8899
 
8170
8900
  // src/controls/transform-control/transform-label.tsx
8171
8901
  import * as React108 from "react";
8172
- import { Box as Box24 } from "@elementor/ui";
8902
+ import { Box as Box25 } from "@elementor/ui";
8173
8903
  import { __ as __53 } from "@wordpress/i18n";
8174
8904
  var orderedAxis = ["x", "y", "z"];
8175
8905
  var formatLabel = (value, functionType) => {
@@ -8200,14 +8930,14 @@ var TransformLabel = (props) => {
8200
8930
  }
8201
8931
  };
8202
8932
  var Label2 = ({ label, value }) => {
8203
- return /* @__PURE__ */ React108.createElement(Box24, { component: "span" }, label, ": ", value);
8933
+ return /* @__PURE__ */ React108.createElement(Box25, { component: "span" }, label, ": ", value);
8204
8934
  };
8205
8935
 
8206
8936
  // src/controls/transform-control/transform-settings-control.tsx
8207
8937
  import * as React111 from "react";
8208
8938
  import { PopoverHeader as PopoverHeader5 } from "@elementor/editor-ui";
8209
8939
  import { AdjustmentsIcon } from "@elementor/icons";
8210
- import { bindPopover as bindPopover6, Box as Box25, Divider as Divider5, Popover as Popover7 } from "@elementor/ui";
8940
+ import { bindPopover as bindPopover6, Box as Box26, Divider as Divider6, Popover as Popover7 } from "@elementor/ui";
8211
8941
  import { __ as __56 } from "@wordpress/i18n";
8212
8942
 
8213
8943
  // src/controls/transform-control/transform-base-controls/children-perspective-control.tsx
@@ -8316,8 +9046,8 @@ var TransformSettingsControl = ({
8316
9046
  icon: /* @__PURE__ */ React111.createElement(AdjustmentsIcon, { fontSize: SIZE10 })
8317
9047
  }
8318
9048
  ),
8319
- /* @__PURE__ */ React111.createElement(Divider5, null),
8320
- /* @__PURE__ */ React111.createElement(PopoverContent, { sx: { px: 2, py: 1.5 } }, /* @__PURE__ */ React111.createElement(PropKeyProvider, { bind: "transform-origin" }, /* @__PURE__ */ React111.createElement(TransformOriginControl, null)), showChildrenPerspective && /* @__PURE__ */ React111.createElement(React111.Fragment, null, /* @__PURE__ */ React111.createElement(Box25, { sx: { my: 0.5 } }, /* @__PURE__ */ React111.createElement(Divider5, null)), /* @__PURE__ */ React111.createElement(ChildrenPerspectiveControl, null)))
9049
+ /* @__PURE__ */ React111.createElement(Divider6, null),
9050
+ /* @__PURE__ */ React111.createElement(PopoverContent, { sx: { px: 2, py: 1.5 } }, /* @__PURE__ */ React111.createElement(PropKeyProvider, { bind: "transform-origin" }, /* @__PURE__ */ React111.createElement(TransformOriginControl, null)), showChildrenPerspective && /* @__PURE__ */ React111.createElement(React111.Fragment, null, /* @__PURE__ */ React111.createElement(Box26, { sx: { my: 0.5 } }, /* @__PURE__ */ React111.createElement(Divider6, null)), /* @__PURE__ */ React111.createElement(ChildrenPerspectiveControl, null)))
8321
9051
  );
8322
9052
  };
8323
9053
 
@@ -8339,7 +9069,7 @@ var TransformRepeaterControl = createControl(
8339
9069
  }
8340
9070
  );
8341
9071
  var ToolTip = /* @__PURE__ */ React112.createElement(
8342
- Box26,
9072
+ Box27,
8343
9073
  {
8344
9074
  component: "span",
8345
9075
  "aria-label": void 0,
@@ -8412,7 +9142,7 @@ import {
8412
9142
  selectionSizePropTypeUtil as selectionSizePropTypeUtil2
8413
9143
  } from "@elementor/editor-props";
8414
9144
  import { InfoCircleFilledIcon as InfoCircleFilledIcon3 } from "@elementor/icons";
8415
- import { Alert as Alert2, AlertTitle as AlertTitle3, Box as Box28, Typography as Typography12 } from "@elementor/ui";
9145
+ import { Alert as Alert2, AlertTitle as AlertTitle3, Box as Box29, Typography as Typography12 } from "@elementor/ui";
8416
9146
  import { hasProInstalled as hasProInstalled2 } from "@elementor/utils";
8417
9147
  import { __ as __60 } from "@wordpress/i18n";
8418
9148
 
@@ -8643,7 +9373,7 @@ import { useMemo as useMemo16, useRef as useRef30 } from "react";
8643
9373
  import { keyValuePropTypeUtil as keyValuePropTypeUtil2 } from "@elementor/editor-props";
8644
9374
  import { PromotionAlert, PromotionChip } from "@elementor/editor-ui";
8645
9375
  import { ChevronDownIcon as ChevronDownIcon3, VariationsIcon } from "@elementor/icons";
8646
- import { bindPopover as bindPopover7, bindTrigger as bindTrigger6, Box as Box27, Popover as Popover8, UnstableTag as UnstableTag3, usePopupState as usePopupState12 } from "@elementor/ui";
9376
+ import { bindPopover as bindPopover7, bindTrigger as bindTrigger6, Box as Box28, Popover as Popover8, UnstableTag as UnstableTag3, usePopupState as usePopupState12 } from "@elementor/ui";
8647
9377
  import { __ as __59 } from "@wordpress/i18n";
8648
9378
 
8649
9379
  // src/utils/tracking.ts
@@ -8771,7 +9501,7 @@ var TransitionSelector = ({
8771
9501
  left: rect.right + 36
8772
9502
  };
8773
9503
  };
8774
- return /* @__PURE__ */ React114.createElement(Box27, { ref: defaultRef }, /* @__PURE__ */ React114.createElement(ControlActions, null, /* @__PURE__ */ React114.createElement(
9504
+ return /* @__PURE__ */ React114.createElement(Box28, { ref: defaultRef }, /* @__PURE__ */ React114.createElement(ControlActions, null, /* @__PURE__ */ React114.createElement(
8775
9505
  UnstableTag3,
8776
9506
  {
8777
9507
  variant: "outlined",
@@ -8803,7 +9533,7 @@ var TransitionSelector = ({
8803
9533
  icon: VariationsIcon,
8804
9534
  disabledItems: includeCurrentValueInOptions(value, disabledItems),
8805
9535
  categoryItemContentTemplate: (item) => /* @__PURE__ */ React114.createElement(
8806
- Box27,
9536
+ Box28,
8807
9537
  {
8808
9538
  sx: {
8809
9539
  display: "flex",
@@ -8945,7 +9675,7 @@ var disableAddItemTooltipContent = /* @__PURE__ */ React115.createElement(
8945
9675
  icon: /* @__PURE__ */ React115.createElement(InfoCircleFilledIcon3, null)
8946
9676
  },
8947
9677
  /* @__PURE__ */ React115.createElement(AlertTitle3, null, __60("Transitions", "elementor")),
8948
- /* @__PURE__ */ React115.createElement(Box28, { component: "span" }, /* @__PURE__ */ React115.createElement(Typography12, { variant: "body2" }, __60("Switch to 'Normal' state to add a transition.", "elementor")))
9678
+ /* @__PURE__ */ React115.createElement(Box29, { component: "span" }, /* @__PURE__ */ React115.createElement(Typography12, { variant: "body2" }, __60("Switch to 'Normal' state to add a transition.", "elementor")))
8949
9679
  );
8950
9680
  var TransitionRepeaterControl = createControl(
8951
9681
  ({
@@ -9019,7 +9749,7 @@ import * as React116 from "react";
9019
9749
  import * as dayjs from "dayjs";
9020
9750
  import { isTransformable as isTransformable2, stringPropTypeUtil as stringPropTypeUtil20 } from "@elementor/editor-props";
9021
9751
  import { DateTimePropTypeUtil } from "@elementor/editor-props";
9022
- import { Box as Box29, DatePicker, LocalizationProvider, TimePicker } from "@elementor/ui";
9752
+ import { Box as Box30, DatePicker, LocalizationProvider, TimePicker } from "@elementor/ui";
9023
9753
  var DATE_FORMAT = "YYYY-MM-DD";
9024
9754
  var TIME_FORMAT = "HH:mm";
9025
9755
  var DateTimeControl = createControl(({ inputDisabled }) => {
@@ -9063,7 +9793,7 @@ var DateTimeControl = createControl(({ inputDisabled }) => {
9063
9793
  const base = dayjs.default();
9064
9794
  return base.hour(h).minute(m).second(0).millisecond(0);
9065
9795
  };
9066
- return /* @__PURE__ */ React116.createElement(PropProvider, { ...propContext, value, setValue }, /* @__PURE__ */ React116.createElement(ControlActions, null, /* @__PURE__ */ React116.createElement(LocalizationProvider, null, /* @__PURE__ */ React116.createElement(Box29, { display: "flex", gap: 1, alignItems: "center" }, /* @__PURE__ */ React116.createElement(PropKeyProvider, { bind: "date" }, /* @__PURE__ */ React116.createElement(
9796
+ return /* @__PURE__ */ React116.createElement(PropProvider, { ...propContext, value, setValue }, /* @__PURE__ */ React116.createElement(ControlActions, null, /* @__PURE__ */ React116.createElement(LocalizationProvider, null, /* @__PURE__ */ React116.createElement(Box30, { display: "flex", gap: 1, alignItems: "center" }, /* @__PURE__ */ React116.createElement(PropKeyProvider, { bind: "date" }, /* @__PURE__ */ React116.createElement(
9067
9797
  DatePicker,
9068
9798
  {
9069
9799
  value: parseDateValue(stringPropTypeUtil20.extract(value?.date)),
@@ -9271,12 +10001,12 @@ var BoundTimeStringControl = ({ bind, ariaLabel }) => {
9271
10001
  import * as React124 from "react";
9272
10002
  import { useCallback as useCallback4, useState as useState23 } from "react";
9273
10003
  import { escapedHtmlPropTypeUtil as escapedHtmlPropTypeUtil2 } from "@elementor/editor-props";
9274
- import { Box as Box32 } from "@elementor/ui";
10004
+ import { Box as Box33 } from "@elementor/ui";
9275
10005
 
9276
10006
  // src/components/inline-editor.tsx
9277
10007
  import * as React121 from "react";
9278
10008
  import { useEffect as useEffect18, useRef as useRef31 } from "react";
9279
- import { Box as Box30 } from "@elementor/ui";
10009
+ import { Box as Box31 } from "@elementor/ui";
9280
10010
  import Bold from "@tiptap/extension-bold";
9281
10011
  import Document from "@tiptap/extension-document";
9282
10012
  import HardBreak from "@tiptap/extension-hard-break";
@@ -9434,7 +10164,7 @@ var InlineEditor = React121.forwardRef((props, ref) => {
9434
10164
  if (mountElement) {
9435
10165
  return null;
9436
10166
  }
9437
- return /* @__PURE__ */ React121.createElement(Box30, { ref: containerRef, sx, className: wrapperClassName }, /* @__PURE__ */ React121.createElement(EditorContent, { ref, editor }));
10167
+ return /* @__PURE__ */ React121.createElement(Box31, { ref: containerRef, sx, className: wrapperClassName }, /* @__PURE__ */ React121.createElement(EditorContent, { ref, editor }));
9438
10168
  });
9439
10169
  var useOnUpdate = (callback, dependencies) => {
9440
10170
  const hasMounted = useRef31(false);
@@ -9462,7 +10192,7 @@ import {
9462
10192
  UnderlineIcon
9463
10193
  } from "@elementor/icons";
9464
10194
  import {
9465
- Box as Box31,
10195
+ Box as Box32,
9466
10196
  IconButton as IconButton9,
9467
10197
  ToggleButton as ToggleButton5,
9468
10198
  ToggleButtonGroup as ToggleButtonGroup2,
@@ -9596,7 +10326,7 @@ var InlineEditorToolbar = ({
9596
10326
  }
9597
10327
  }, [editor, inControlPanel]);
9598
10328
  return /* @__PURE__ */ React123.createElement(
9599
- Box31,
10329
+ Box32,
9600
10330
  {
9601
10331
  ref: toolbarRef,
9602
10332
  sx: {
@@ -9779,7 +10509,7 @@ var InlineEditingControl = createControl(({ sx, attributes, props, context: { el
9779
10509
  },
9780
10510
  [setValue]
9781
10511
  );
9782
- return /* @__PURE__ */ React124.createElement(ControlActions, null, /* @__PURE__ */ React124.createElement(Box32, { sx: { position: "relative" } }, editor && editor.isEditable && /* @__PURE__ */ React124.createElement(
10512
+ return /* @__PURE__ */ React124.createElement(ControlActions, null, /* @__PURE__ */ React124.createElement(Box33, { sx: { position: "relative" } }, editor && editor.isEditable && /* @__PURE__ */ React124.createElement(
9783
10513
  InlineEditorToolbar,
9784
10514
  {
9785
10515
  editor,
@@ -9793,7 +10523,7 @@ var InlineEditingControl = createControl(({ sx, attributes, props, context: { el
9793
10523
  inControlPanel: true
9794
10524
  }
9795
10525
  ), /* @__PURE__ */ React124.createElement(
9796
- Box32,
10526
+ Box33,
9797
10527
  {
9798
10528
  sx: (theme) => ({
9799
10529
  p: 0.8,
@@ -9857,7 +10587,7 @@ var InlineEditingControl = createControl(({ sx, attributes, props, context: { el
9857
10587
  import * as React128 from "react";
9858
10588
  import { emailsPropTypeUtil } from "@elementor/editor-props";
9859
10589
  import { CollapsibleContent } from "@elementor/editor-ui";
9860
- import { Box as Box33, Divider as Divider6, Stack as Stack25 } from "@elementor/ui";
10590
+ import { Box as Box34, Divider as Divider7, Stack as Stack25 } from "@elementor/ui";
9861
10591
  import { __ as __66 } from "@wordpress/i18n";
9862
10592
 
9863
10593
  // src/controls/email-form-action-control/fields.tsx
@@ -10159,7 +10889,7 @@ var EmailFormActionControl = createControl(
10159
10889
  return /* @__PURE__ */ React128.createElement(PropProvider, { ...propContext, value, setValue }, /* @__PURE__ */ React128.createElement(Stack25, { gap: 2 }, /* @__PURE__ */ React128.createElement(ControlLabel, null, label ? label + " " + __66("settings", "elementor") : __66("Email settings", "elementor")), /* @__PURE__ */ React128.createElement(SendToField, { placeholder: toPlaceholder }), /* @__PURE__ */ React128.createElement(SubjectField, null), /* @__PURE__ */ React128.createElement(MessageField, null), /* @__PURE__ */ React128.createElement(FromEmailField, null), /* @__PURE__ */ React128.createElement(AdvancedSettings, null)));
10160
10890
  }
10161
10891
  );
10162
- var AdvancedSettings = () => /* @__PURE__ */ React128.createElement(CollapsibleContent, { defaultOpen: false }, /* @__PURE__ */ React128.createElement(Box33, { sx: { pt: 2 } }, /* @__PURE__ */ React128.createElement(Stack25, { gap: 2 }, /* @__PURE__ */ React128.createElement(FromNameField, null), /* @__PURE__ */ React128.createElement(ReplyToField, null), /* @__PURE__ */ React128.createElement(CcField, null), /* @__PURE__ */ React128.createElement(BccField, null), /* @__PURE__ */ React128.createElement(Divider6, null), /* @__PURE__ */ React128.createElement(MetaDataField, null), /* @__PURE__ */ React128.createElement(SendAsField, null))));
10892
+ var AdvancedSettings = () => /* @__PURE__ */ React128.createElement(CollapsibleContent, { defaultOpen: false }, /* @__PURE__ */ React128.createElement(Box34, { sx: { pt: 2 } }, /* @__PURE__ */ React128.createElement(Stack25, { gap: 2 }, /* @__PURE__ */ React128.createElement(FromNameField, null), /* @__PURE__ */ React128.createElement(ReplyToField, null), /* @__PURE__ */ React128.createElement(CcField, null), /* @__PURE__ */ React128.createElement(BccField, null), /* @__PURE__ */ React128.createElement(Divider7, null), /* @__PURE__ */ React128.createElement(MetaDataField, null), /* @__PURE__ */ React128.createElement(SendAsField, null))));
10163
10893
 
10164
10894
  // src/controls/attachment-type-control.tsx
10165
10895
  import * as React129 from "react";
@@ -10285,7 +11015,7 @@ import { __ as __68 } from "@wordpress/i18n";
10285
11015
  import * as React132 from "react";
10286
11016
  import { forwardRef as forwardRef12, useCallback as useCallback5, useImperativeHandle, useState as useState26 } from "react";
10287
11017
  import { PromotionChip as PromotionChip2, PromotionInfotip } from "@elementor/editor-ui";
10288
- import { Box as Box34 } from "@elementor/ui";
11018
+ import { Box as Box35 } from "@elementor/ui";
10289
11019
  function getV4Promotion(key) {
10290
11020
  return window.elementor?.config?.v4Promotions?.[key];
10291
11021
  }
@@ -10317,7 +11047,7 @@ var PromotionTrigger = forwardRef12(
10317
11047
  onCtaClick: () => trackUpgradePromotionClick(trackingData)
10318
11048
  },
10319
11049
  /* @__PURE__ */ React132.createElement(
10320
- Box34,
11050
+ Box35,
10321
11051
  {
10322
11052
  onClick: (e) => {
10323
11053
  e.stopPropagation();
@@ -10416,7 +11146,7 @@ import { CopyIcon as CopyIcon2, EyeIcon as EyeIcon2, EyeOffIcon as EyeOffIcon2,
10416
11146
  import {
10417
11147
  bindPopover as bindPopover9,
10418
11148
  bindTrigger as bindTrigger7,
10419
- Box as Box35,
11149
+ Box as Box36,
10420
11150
  IconButton as IconButton12,
10421
11151
  Infotip as Infotip4,
10422
11152
  Tooltip as Tooltip17,
@@ -10525,7 +11255,7 @@ var Repeater3 = ({
10525
11255
  color: "secondary",
10526
11256
  slotProps: { popper: { sx: { width: 300 } } }
10527
11257
  },
10528
- /* @__PURE__ */ React136.createElement(Box35, { sx: { ...isButtonDisabled ? { cursor: "not-allowed" } : {} } }, addButton)
11258
+ /* @__PURE__ */ React136.createElement(Box36, { sx: { ...isButtonDisabled ? { cursor: "not-allowed" } : {} } }, addButton)
10529
11259
  ) : addButton), 0 < uniqueKeys.length && /* @__PURE__ */ React136.createElement(SortableProvider, { value: uniqueKeys, onChange: onChangeOrder }, uniqueKeys.map((key) => {
10530
11260
  const index = uniqueKeys.indexOf(key);
10531
11261
  const value = items2[index];
@@ -10597,7 +11327,7 @@ var RepeaterItem = ({
10597
11327
  const duplicateLabel = __70("Duplicate", "elementor");
10598
11328
  const toggleLabel = propDisabled ? __70("Show", "elementor") : __70("Hide", "elementor");
10599
11329
  const removeLabel = __70("Remove", "elementor");
10600
- return /* @__PURE__ */ React136.createElement(Box35, { sx: { display: "contents" } }, /* @__PURE__ */ React136.createElement(
11330
+ return /* @__PURE__ */ React136.createElement(Box36, { sx: { display: "contents" } }, /* @__PURE__ */ React136.createElement(
10601
11331
  RepeaterTag,
10602
11332
  {
10603
11333
  disabled,
@@ -10614,7 +11344,7 @@ var RepeaterItem = ({
10614
11344
  startIcon,
10615
11345
  actions: /* @__PURE__ */ React136.createElement(React136.Fragment, null, showDuplicate && /* @__PURE__ */ React136.createElement(Tooltip17, { title: duplicateLabel, placement: "top" }, /* @__PURE__ */ React136.createElement(IconButton12, { size: SIZE12, onClick: duplicateItem, "aria-label": duplicateLabel }, /* @__PURE__ */ React136.createElement(CopyIcon2, { fontSize: SIZE12 }))), showToggle && /* @__PURE__ */ React136.createElement(Tooltip17, { title: toggleLabel, placement: "top" }, /* @__PURE__ */ React136.createElement(IconButton12, { size: SIZE12, onClick: toggleDisableItem, "aria-label": toggleLabel }, propDisabled ? /* @__PURE__ */ React136.createElement(EyeOffIcon2, { fontSize: SIZE12 }) : /* @__PURE__ */ React136.createElement(EyeIcon2, { fontSize: SIZE12 }))), actions?.(value), showRemove && /* @__PURE__ */ React136.createElement(Tooltip17, { title: removeLabel, placement: "top" }, /* @__PURE__ */ React136.createElement(IconButton12, { size: SIZE12, onClick: removeItem, "aria-label": removeLabel }, /* @__PURE__ */ React136.createElement(XIcon4, { fontSize: SIZE12 }))))
10616
11346
  }
10617
- ), /* @__PURE__ */ React136.createElement(RepeaterPopover, { width: ref?.getBoundingClientRect().width, ...popoverProps, anchorEl: ref }, /* @__PURE__ */ React136.createElement(Box35, null, children({ anchorEl: ref }))));
11347
+ ), /* @__PURE__ */ React136.createElement(RepeaterPopover, { width: ref?.getBoundingClientRect().width, ...popoverProps, anchorEl: ref }, /* @__PURE__ */ React136.createElement(Box36, null, children({ anchorEl: ref }))));
10618
11348
  };
10619
11349
  var usePopover = (openOnMount, onOpen, onPopoverClose) => {
10620
11350
  const [ref, setRef] = useState27(null);
@@ -10908,9 +11638,11 @@ export {
10908
11638
  injectIntoRepeaterItemActions,
10909
11639
  injectIntoRepeaterItemIcon,
10910
11640
  injectIntoRepeaterItemLabel,
11641
+ isDeletedCustomIconLibrary,
10911
11642
  isUnitExtendedOption,
10912
11643
  registerControlReplacement,
10913
11644
  resetFontAwesome7IconsCache,
11645
+ resolveCustomIconSvg,
10914
11646
  resolveFontAwesome7Icon,
10915
11647
  trackUpgradePromotionClick,
10916
11648
  trackViewPromotion,