import d from "react";
import { useService as p } from "@wix/services-manager-react";
var f = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
function y(e) {
  if (e.__esModule) return e;
  var t = e.default;
  if (typeof t == "function") {
    var n = function i() {
      return this instanceof i ? Reflect.construct(t, arguments, this.constructor) : t.apply(this, arguments);
    };
    n.prototype = t.prototype;
  } else n = {};
  return Object.defineProperty(n, "__esModule", { value: !0 }), Object.keys(e).forEach(function(i) {
    var r = Object.getOwnPropertyDescriptor(e, i);
    Object.defineProperty(n, i, r.get ? r : {
      enumerable: !0,
      get: function() {
        return e[i];
      }
    });
  }), n;
}
var s = {}, _ = {}, u = {}, m = {}, w = {};
const O = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
  __proto__: null,
  wixContext: w
}, Symbol.toStringTag, { value: "Module" })), j = /* @__PURE__ */ y(O);
var l = {};
Object.defineProperty(l, "__esModule", { value: !0 });
l.ThreadMode = void 0;
l.defineService = h;
l.implementService = S;
var v;
(function(e) {
  e[e.MAIN = 0] = "MAIN", e[e.REMOTE = 1] = "REMOTE";
})(v || (l.ThreadMode = v = {}));
function h(e) {
  return e;
}
function S(e, t) {
  return t;
}
S.withConfig = function() {
  return function(e, t) {
    return t;
  };
};
(function(e) {
  Object.defineProperty(e, "__esModule", { value: !0 }), e.resolveSignalsReadyFromContext = e.resolveServiceGetterFromContext = e.implementService = e.defineService = void 0;
  const t = j;
  var n = l;
  Object.defineProperty(e, "defineService", { enumerable: !0, get: function() {
    return n.defineService;
  } }), Object.defineProperty(e, "implementService", { enumerable: !0, get: function() {
    return n.implementService;
  } });
  const i = () => t.wixContext?.getService || globalThis?.__wix_context__?.getService;
  e.resolveServiceGetterFromContext = i;
  const r = () => (t.wixContext?.awaitRemoteSignals || globalThis?.__wix_context__?.awaitRemoteSignals || (() => Promise.resolve()))();
  e.resolveSignalsReadyFromContext = r;
})(m);
Object.defineProperty(u, "__esModule", { value: !0 });
u.implementStaticService = u.defineStaticService = void 0;
const b = m;
u.defineStaticService = b.defineService;
u.implementStaticService = b.implementService;
(function(e) {
  var t = f && f.__createBinding || (Object.create ? function(i, r, o, c) {
    c === void 0 && (c = o);
    var a = Object.getOwnPropertyDescriptor(r, o);
    (!a || ("get" in a ? !r.__esModule : a.writable || a.configurable)) && (a = { enumerable: !0, get: function() {
      return r[o];
    } }), Object.defineProperty(i, c, a);
  } : function(i, r, o, c) {
    c === void 0 && (c = o), i[c] = r[o];
  }), n = f && f.__exportStar || function(i, r) {
    for (var o in i) o !== "default" && !Object.prototype.hasOwnProperty.call(r, o) && t(r, i, o);
  };
  Object.defineProperty(e, "__esModule", { value: !0 }), n(u, e);
})(_);
Object.defineProperty(s, "__esModule", { value: !0 });
var g = s.InteractionsDefinition = void 0;
const P = _;
g = s.InteractionsDefinition = (0, P.defineStaticService)("viewer-core/interactions");
const R = (e) => (t) => {
  const { hasInteractions: n } = p(g), i = `#${t.id}`;
  return n(i) ? (
    // @ts-expect-error - not a known react element - custom element
    d.createElement(
      "wix-interact-element",
      { "data-wix-path": i },
      d.createElement(e, { ...t })
    )
  ) : d.createElement(e, { ...t });
};
export {
  R as withInteractions
};
//# sourceMappingURL=builder-interactions.mjs.map