UNPKG

@mr-fougere/react-trustpilot-widgets

Version:

This library provides a set of customizable Trustpilot widgets for embedding on your website or application. It allows you to integrate Trustpilot's review display system, product ratings, and review collection functionality.

1,373 lines (1,368 loc) 62.3 kB
import De, { createContext as gr, useContext as Rr, useRef as xr, useEffect as ke, useMemo as je } from "react"; import { useScript as br, usePreferredLanguage as Er } from "@uidotdev/usehooks"; var I = /* @__PURE__ */ ((r) => (r.Unknown = "unknown", r.Loading = "loading", r.Ready = "ready", r.Error = "error", r))(I || {}), i = /* @__PURE__ */ ((r) => (r.Horizontal = "Horizontal", r.MicroButton = "MicroButton", r.MicroCombo = "MicroCombo", r.MicroReviewCount = "MicroReviewCount", r.MicroStar = "MicroStar", r.MicroTrustScore = "MicroTrustScore", r.Mini = "Mini", r.Starter = "Starter", r.ReviewCollector = "ReviewCollector", r.Carousel = "Carousel", r.DropDown = "DropDown", r.Grid = "Grid", r.List = "List", r.ListFiltered = "ListFiltered", r.MiniCarousel = "MiniCarousel", r.PopUp = "PopUp", r.Quote = "Quote", r.Slider = "Slider", r.ProductMini = "ProductMini", r.ProductMiniMultiSource = "ProductMiniMultiSource", r.ProductQA = "ProductQA", r.ProductReviews = "ProductReviews", r.ProductReviewsCarousel = "ProductReviewsCarousel", r.ProductReviewsGallery = "ProductReviewsGallery", r.ProductReviewsMultiSource = "ProductReviewsMultiSource", r.ProductReviewsMultiSourceSEO = "ProductReviewsMultiSourceSEO", r.ProductReviewsSEO = "ProductReviewsSEO", r))(i || {}), H = { exports: {} }, U = {}; /** * @license React * react-jsx-runtime.production.min.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ var Me; function Pr() { if (Me) return U; Me = 1; var r = De, f = Symbol.for("react.element"), m = Symbol.for("react.fragment"), d = Object.prototype.hasOwnProperty, p = r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, g = { key: !0, ref: !0, __self: !0, __source: !0 }; function S(R, h, E) { var P, C = {}, O = null, Y = null; E !== void 0 && (O = "" + E), h.key !== void 0 && (O = "" + h.key), h.ref !== void 0 && (Y = h.ref); for (P in h) d.call(h, P) && !g.hasOwnProperty(P) && (C[P] = h[P]); if (R && R.defaultProps) for (P in h = R.defaultProps, h) C[P] === void 0 && (C[P] = h[P]); return { $$typeof: f, type: R, key: O, ref: Y, props: C, _owner: p.current }; } return U.Fragment = m, U.jsx = S, U.jsxs = S, U; } var $ = {}; /** * @license React * react-jsx-runtime.development.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ var Oe; function yr() { return Oe || (Oe = 1, process.env.NODE_ENV !== "production" && function() { var r = De, f = Symbol.for("react.element"), m = Symbol.for("react.portal"), d = Symbol.for("react.fragment"), p = Symbol.for("react.strict_mode"), g = Symbol.for("react.profiler"), S = Symbol.for("react.provider"), R = Symbol.for("react.context"), h = Symbol.for("react.forward_ref"), E = Symbol.for("react.suspense"), P = Symbol.for("react.suspense_list"), C = Symbol.for("react.memo"), O = Symbol.for("react.lazy"), Y = Symbol.for("react.offscreen"), te = Symbol.iterator, Ie = "@@iterator"; function Le(e) { if (e === null || typeof e != "object") return null; var t = te && e[te] || e[Ie]; return typeof t == "function" ? t : null; } var k = r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED; function x(e) { { for (var t = arguments.length, n = new Array(t > 1 ? t - 1 : 0), o = 1; o < t; o++) n[o - 1] = arguments[o]; Fe("error", e, n); } } function Fe(e, t, n) { { var o = k.ReactDebugCurrentFrame, s = o.getStackAddendum(); s !== "" && (t += "%s", n = n.concat([s])); var c = n.map(function(u) { return String(u); }); c.unshift("Warning: " + t), Function.prototype.apply.call(console[e], console, c); } } var Ue = !1, $e = !1, Ye = !1, We = !1, Ge = !1, ie; ie = Symbol.for("react.module.reference"); function Ve(e) { return !!(typeof e == "string" || typeof e == "function" || e === d || e === g || Ge || e === p || e === E || e === P || We || e === Y || Ue || $e || Ye || typeof e == "object" && e !== null && (e.$$typeof === O || e.$$typeof === C || e.$$typeof === S || e.$$typeof === R || e.$$typeof === h || // This needs to include all possible module reference object // types supported by any Flight configuration anywhere since // we don't know which Flight build this will end up being used // with. e.$$typeof === ie || e.getModuleId !== void 0)); } function Ne(e, t, n) { var o = e.displayName; if (o) return o; var s = t.displayName || t.name || ""; return s !== "" ? n + "(" + s + ")" : n; } function ne(e) { return e.displayName || "Context"; } function M(e) { if (e == null) return null; if (typeof e.tag == "number" && x("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof e == "function") return e.displayName || e.name || null; if (typeof e == "string") return e; switch (e) { case d: return "Fragment"; case m: return "Portal"; case g: return "Profiler"; case p: return "StrictMode"; case E: return "Suspense"; case P: return "SuspenseList"; } if (typeof e == "object") switch (e.$$typeof) { case R: var t = e; return ne(t) + ".Consumer"; case S: var n = e; return ne(n._context) + ".Provider"; case h: return Ne(e, e.render, "ForwardRef"); case C: var o = e.displayName || null; return o !== null ? o : M(e.type) || "Memo"; case O: { var s = e, c = s._payload, u = s._init; try { return M(u(c)); } catch { return null; } } } return null; } var T = Object.assign, L = 0, oe, ae, ue, se, ce, le, fe; function de() { } de.__reactDisabledLog = !0; function He() { { if (L === 0) { oe = console.log, ae = console.info, ue = console.warn, se = console.error, ce = console.group, le = console.groupCollapsed, fe = console.groupEnd; var e = { configurable: !0, enumerable: !0, value: de, writable: !0 }; Object.defineProperties(console, { info: e, log: e, warn: e, error: e, group: e, groupCollapsed: e, groupEnd: e }); } L++; } } function ze() { { if (L--, L === 0) { var e = { configurable: !0, enumerable: !0, writable: !0 }; Object.defineProperties(console, { log: T({}, e, { value: oe }), info: T({}, e, { value: ae }), warn: T({}, e, { value: ue }), error: T({}, e, { value: se }), group: T({}, e, { value: ce }), groupCollapsed: T({}, e, { value: le }), groupEnd: T({}, e, { value: fe }) }); } L < 0 && x("disabledDepth fell below zero. This is a bug in React. Please file an issue."); } } var J = k.ReactCurrentDispatcher, q; function W(e, t, n) { { if (q === void 0) try { throw Error(); } catch (s) { var o = s.stack.trim().match(/\n( *(at )?)/); q = o && o[1] || ""; } return ` ` + q + e; } } var Q = !1, G; { var Je = typeof WeakMap == "function" ? WeakMap : Map; G = new Je(); } function he(e, t) { if (!e || Q) return ""; { var n = G.get(e); if (n !== void 0) return n; } var o; Q = !0; var s = Error.prepareStackTrace; Error.prepareStackTrace = void 0; var c; c = J.current, J.current = null, He(); try { if (t) { var u = function() { throw Error(); }; if (Object.defineProperty(u.prototype, "props", { set: function() { throw Error(); } }), typeof Reflect == "object" && Reflect.construct) { try { Reflect.construct(u, []); } catch (y) { o = y; } Reflect.construct(e, [], u); } else { try { u.call(); } catch (y) { o = y; } e.call(u.prototype); } } else { try { throw Error(); } catch (y) { o = y; } e(); } } catch (y) { if (y && o && typeof y.stack == "string") { for (var a = y.stack.split(` `), b = o.stack.split(` `), v = a.length - 1, w = b.length - 1; v >= 1 && w >= 0 && a[v] !== b[w]; ) w--; for (; v >= 1 && w >= 0; v--, w--) if (a[v] !== b[w]) { if (v !== 1 || w !== 1) do if (v--, w--, w < 0 || a[v] !== b[w]) { var _ = ` ` + a[v].replace(" at new ", " at "); return e.displayName && _.includes("<anonymous>") && (_ = _.replace("<anonymous>", e.displayName)), typeof e == "function" && G.set(e, _), _; } while (v >= 1 && w >= 0); break; } } } finally { Q = !1, J.current = c, ze(), Error.prepareStackTrace = s; } var A = e ? e.displayName || e.name : "", D = A ? W(A) : ""; return typeof e == "function" && G.set(e, D), D; } function qe(e, t, n) { return he(e, !1); } function Qe(e) { var t = e.prototype; return !!(t && t.isReactComponent); } function V(e, t, n) { if (e == null) return ""; if (typeof e == "function") return he(e, Qe(e)); if (typeof e == "string") return W(e); switch (e) { case E: return W("Suspense"); case P: return W("SuspenseList"); } if (typeof e == "object") switch (e.$$typeof) { case h: return qe(e.render); case C: return V(e.type, t, n); case O: { var o = e, s = o._payload, c = o._init; try { return V(c(s), t, n); } catch { } } } return ""; } var F = Object.prototype.hasOwnProperty, pe = {}, ve = k.ReactDebugCurrentFrame; function N(e) { if (e) { var t = e._owner, n = V(e.type, e._source, t ? t.type : null); ve.setExtraStackFrame(n); } else ve.setExtraStackFrame(null); } function Ke(e, t, n, o, s) { { var c = Function.call.bind(F); for (var u in e) if (c(e, u)) { var a = void 0; try { if (typeof e[u] != "function") { var b = Error((o || "React class") + ": " + n + " type `" + u + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof e[u] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`."); throw b.name = "Invariant Violation", b; } a = e[u](t, u, o, n, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"); } catch (v) { a = v; } a && !(a instanceof Error) && (N(s), x("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", o || "React class", n, u, typeof a), N(null)), a instanceof Error && !(a.message in pe) && (pe[a.message] = !0, N(s), x("Failed %s type: %s", n, a.message), N(null)); } } } var Xe = Array.isArray; function K(e) { return Xe(e); } function Be(e) { { var t = typeof Symbol == "function" && Symbol.toStringTag, n = t && e[Symbol.toStringTag] || e.constructor.name || "Object"; return n; } } function Ze(e) { try { return we(e), !1; } catch { return !0; } } function we(e) { return "" + e; } function me(e) { if (Ze(e)) return x("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", Be(e)), we(e); } var ge = k.ReactCurrentOwner, er = { key: !0, ref: !0, __self: !0, __source: !0 }, Re, xe; function rr(e) { if (F.call(e, "ref")) { var t = Object.getOwnPropertyDescriptor(e, "ref").get; if (t && t.isReactWarning) return !1; } return e.ref !== void 0; } function tr(e) { if (F.call(e, "key")) { var t = Object.getOwnPropertyDescriptor(e, "key").get; if (t && t.isReactWarning) return !1; } return e.key !== void 0; } function ir(e, t) { typeof e.ref == "string" && ge.current; } function nr(e, t) { { var n = function() { Re || (Re = !0, x("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", t)); }; n.isReactWarning = !0, Object.defineProperty(e, "key", { get: n, configurable: !0 }); } } function or(e, t) { { var n = function() { xe || (xe = !0, x("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", t)); }; n.isReactWarning = !0, Object.defineProperty(e, "ref", { get: n, configurable: !0 }); } } var ar = function(e, t, n, o, s, c, u) { var a = { // This tag allows us to uniquely identify this as a React Element $$typeof: f, // Built-in properties that belong on the element type: e, key: t, ref: n, props: u, // Record the component responsible for creating this element. _owner: c }; return a._store = {}, Object.defineProperty(a._store, "validated", { configurable: !1, enumerable: !1, writable: !0, value: !1 }), Object.defineProperty(a, "_self", { configurable: !1, enumerable: !1, writable: !1, value: o }), Object.defineProperty(a, "_source", { configurable: !1, enumerable: !1, writable: !1, value: s }), Object.freeze && (Object.freeze(a.props), Object.freeze(a)), a; }; function ur(e, t, n, o, s) { { var c, u = {}, a = null, b = null; n !== void 0 && (me(n), a = "" + n), tr(t) && (me(t.key), a = "" + t.key), rr(t) && (b = t.ref, ir(t, s)); for (c in t) F.call(t, c) && !er.hasOwnProperty(c) && (u[c] = t[c]); if (e && e.defaultProps) { var v = e.defaultProps; for (c in v) u[c] === void 0 && (u[c] = v[c]); } if (a || b) { var w = typeof e == "function" ? e.displayName || e.name || "Unknown" : e; a && nr(u, w), b && or(u, w); } return ar(e, a, b, s, o, ge.current, u); } } var X = k.ReactCurrentOwner, be = k.ReactDebugCurrentFrame; function j(e) { if (e) { var t = e._owner, n = V(e.type, e._source, t ? t.type : null); be.setExtraStackFrame(n); } else be.setExtraStackFrame(null); } var B; B = !1; function Z(e) { return typeof e == "object" && e !== null && e.$$typeof === f; } function Ee() { { if (X.current) { var e = M(X.current.type); if (e) return ` Check the render method of \`` + e + "`."; } return ""; } } function sr(e) { return ""; } var Pe = {}; function cr(e) { { var t = Ee(); if (!t) { var n = typeof e == "string" ? e : e.displayName || e.name; n && (t = ` Check the top-level render call using <` + n + ">."); } return t; } } function ye(e, t) { { if (!e._store || e._store.validated || e.key != null) return; e._store.validated = !0; var n = cr(t); if (Pe[n]) return; Pe[n] = !0; var o = ""; e && e._owner && e._owner !== X.current && (o = " It was passed a child from " + M(e._owner.type) + "."), j(e), x('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', n, o), j(null); } } function Se(e, t) { { if (typeof e != "object") return; if (K(e)) for (var n = 0; n < e.length; n++) { var o = e[n]; Z(o) && ye(o, t); } else if (Z(e)) e._store && (e._store.validated = !0); else if (e) { var s = Le(e); if (typeof s == "function" && s !== e.entries) for (var c = s.call(e), u; !(u = c.next()).done; ) Z(u.value) && ye(u.value, t); } } } function lr(e) { { var t = e.type; if (t == null || typeof t == "string") return; var n; if (typeof t == "function") n = t.propTypes; else if (typeof t == "object" && (t.$$typeof === h || // Note: Memo only checks outer props here. // Inner props are checked in the reconciler. t.$$typeof === C)) n = t.propTypes; else return; if (n) { var o = M(t); Ke(n, e.props, "prop", o, e); } else if (t.PropTypes !== void 0 && !B) { B = !0; var s = M(t); x("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", s || "Unknown"); } typeof t.getDefaultProps == "function" && !t.getDefaultProps.isReactClassApproved && x("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead."); } } function fr(e) { { for (var t = Object.keys(e.props), n = 0; n < t.length; n++) { var o = t[n]; if (o !== "children" && o !== "key") { j(e), x("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", o), j(null); break; } } e.ref !== null && (j(e), x("Invalid attribute `ref` supplied to `React.Fragment`."), j(null)); } } var _e = {}; function Ce(e, t, n, o, s, c) { { var u = Ve(e); if (!u) { var a = ""; (e === void 0 || typeof e == "object" && e !== null && Object.keys(e).length === 0) && (a += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports."); var b = sr(); b ? a += b : a += Ee(); var v; e === null ? v = "null" : K(e) ? v = "array" : e !== void 0 && e.$$typeof === f ? (v = "<" + (M(e.type) || "Unknown") + " />", a = " Did you accidentally export a JSX literal instead of a component?") : v = typeof e, x("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", v, a); } var w = ur(e, t, n, s, c); if (w == null) return w; if (u) { var _ = t.children; if (_ !== void 0) if (o) if (K(_)) { for (var A = 0; A < _.length; A++) Se(_[A], e); Object.freeze && Object.freeze(_); } else x("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."); else Se(_, e); } if (F.call(t, "key")) { var D = M(e), y = Object.keys(t).filter(function(mr) { return mr !== "key"; }), ee = y.length > 0 ? "{key: someKey, " + y.join(": ..., ") + ": ...}" : "{key: someKey}"; if (!_e[D + ee]) { var wr = y.length > 0 ? "{" + y.join(": ..., ") + ": ...}" : "{}"; x(`A props object containing a "key" prop is being spread into JSX: let props = %s; <%s {...props} /> React keys must be passed directly to JSX without using spread: let props = %s; <%s key={someKey} {...props} />`, ee, D, wr, D), _e[D + ee] = !0; } } return e === d ? fr(w) : lr(w), w; } } function dr(e, t, n) { return Ce(e, t, n, !0); } function hr(e, t, n) { return Ce(e, t, n, !1); } var pr = hr, vr = dr; $.Fragment = d, $.jsx = pr, $.jsxs = vr; }()), $; } var Te; function Sr() { return Te || (Te = 1, process.env.NODE_ENV === "production" ? H.exports = Pr() : H.exports = yr()), H.exports; } var z = Sr(); class re extends Error { constructor(f) { super(f), Object.setPrototypeOf(this, new.target.prototype); } } const Ae = gr(void 0), _r = () => { const r = Rr(Ae); if (!r) throw new re( "useTrustpilot must be used within a TrustpilotProvider" ); return r; }, Cr = (r) => { const f = {}; return Object.entries(r).forEach(([m, d]) => { const p = `data-${m.replace(/([A-Z])/g, "-$1").toLowerCase()}`; f[p] = String(d); }), f; }, Mr = ({ children: r, ...f }) => { const m = xr(null), { widgetUrl: d, businessUnitId: p, status: g, locale: S, loadTrustpilotWidget: R } = _r(); ke(() => { g === I.Ready && R(m); }, [m, g, R]); const h = p && d && (g === I.Ready || g === I.Unknown); f.locale || (f.locale = S); const E = je( () => Cr({ ...f, businessunitId: p }), [f, p] ); return h ? /* @__PURE__ */ z.jsx( "div", { className: "trustpilot-widget", style: { maxWidth: "max-content", maxHeight: "max-content" }, ref: m, ...E, children: /* @__PURE__ */ z.jsx("a", { href: d, target: "_blank", children: r }) } ) : null; }, Or = "https://widget.trustpilot.com/bootstrap/v5/tp.widget.bootstrap.min.js", Tr = { [i.Horizontal]: "5406e65db0d04a09e042d5fc", [i.MicroButton]: "5419b757fa0340045cd0c938", [i.MicroCombo]: "5419b6ffb0d04a076446a9af", [i.MicroReviewCount]: "5419b6a8b0d04a076446a9ad", [i.MicroStar]: "5419b732fbfb950b10de65e5", [i.MicroTrustScore]: "5419b637fa0340045cd0c936", [i.Mini]: "53aa8807dec7e10d38f59f32", [i.Starter]: "5613c9cde69ddc09340c6beb", [i.ReviewCollector]: "56278e9abfbbba0bdcd568bc", [i.Carousel]: "53aa8912dec7e10d38f59f36", [i.DropDown]: "5418052cfbfb950d88702476", [i.Grid]: "539adbd6dec7e10e686debee", [i.List]: "539ad60defb9600b94d7df2c", [i.ListFiltered]: "539ad998dec7e10e686debe0", [i.MiniCarousel]: "539ad0ffdec7e10e686debd7", [i.PopUp]: "5418015fb0d04a0c9cf721f2", [i.Quote]: "54d0e1d8764ea9078c79e6ee", [i.Slider]: "54ad5defc6454f065c28af8b", [i.ProductMini]: "54d39695764ea907c0f34825", [i.ProductMiniMultiSource]: "577258fb31f02306e4e3aaf9", [i.ProductQA]: "5e8f516485a0810001753930", [i.ProductReviews]: "544a426205dc0a09088833c6", [i.ProductReviewsCarousel]: "60f537b5b0f1639de1fe048c", [i.ProductReviewsGallery]: "546f0626f97a75059086a588", [i.ProductReviewsMultiSource]: "57177697fdb1180308e3815f", [i.ProductReviewsMultiSourceSEO]: "5763bccae0a06d08e809ecbb", [i.ProductReviewsSEO]: "5717796816f630043868e2e8" }, Dr = { [i.Horizontal]: { min: { height: "50px", width: "140px" }, max: { height: "24px", width: "100%" } }, [i.MicroButton]: { min: { height: "24px", width: "64px" }, max: { height: "48px", width: "100%" } }, [i.MicroCombo]: { min: { height: "100px", width: "120px" }, max: { height: "24px", width: "100%" } }, [i.MicroReviewCount]: { min: { height: "50px", width: "140px" }, max: { height: "24px", width: "100%" } }, [i.MicroStar]: { min: { height: "64px", width: "100px" }, max: { height: "24px", width: "100%" } }, [i.MicroTrustScore]: { min: { height: "52px", width: "120px" }, max: { height: "24px", width: "100%" } }, [i.Mini]: { min: { height: "90px", width: "120px" }, max: { height: "130px", width: "100%" } }, [i.Starter]: {}, [i.ReviewCollector]: {}, [i.Carousel]: { min: { height: "140px", width: "300px" }, max: { height: "140px", width: "100%" } }, [i.DropDown]: { min: { height: "30px", width: "255px" }, max: { height: "30px", width: "760px" } }, [i.Grid]: { min: { height: "400px", width: "220px" }, max: { height: "500px", width: "100%" } }, [i.List]: { min: { height: "400px", width: "148px" }, max: { height: "400px", width: "750px" } }, [i.ListFiltered]: { min: { height: "400px", width: "230px" }, max: { height: "400px", width: "750px" } }, [i.MiniCarousel]: { min: { height: "350px", width: "180px" }, max: { height: "320px", width: "750px" } }, [i.PopUp]: { min: { height: "50px", width: "148px" }, max: { height: "25px", width: "100%" } }, [i.Quote]: { min: { height: "300px", width: "200px" }, max: { height: "300px", width: "520px" } }, [i.Slider]: { min: { height: "240px", width: "290px" }, max: { height: "240px", width: "1200px" } }, [i.ProductMini]: { min: { height: "24px", width: "190px" }, max: { height: "24px", width: "100%" } }, [i.ProductMiniMultiSource]: { min: { height: "24px", width: "190px" }, max: { height: "24px", width: "100%" } }, [i.ProductQA]: {}, [i.ProductReviews]: { min: { height: "400px", width: "220px" }, max: { height: "400px", width: "860px" } }, [i.ProductReviewsCarousel]: { min: { height: "140px", width: "520px" }, max: { height: "140px", width: "860px" } }, [i.ProductReviewsGallery]: { min: { height: "350px", width: "520px" }, max: { height: "700px", width: "100%" } }, [i.ProductReviewsMultiSource]: { min: { height: "400px", width: "160px" }, max: { height: "950px", width: "750px" } }, [i.ProductReviewsMultiSourceSEO]: { min: { height: "400px", width: "160px" }, max: { height: "950px", width: "750px" } }, [i.ProductReviewsSEO]: { min: { height: "400px", width: "220px" }, max: { height: "400px", width: "860px" } } }, kr = ({ type: r, height: f, width: m }) => { var g, S, R, h; const d = Dr[r], p = {}; switch (f) { case "max": p.styleHeight = (g = d.max) == null ? void 0 : g.height; break; case "min": p.styleHeight = (S = d.min) == null ? void 0 : S.height; break; default: p.styleHeight = f; break; } switch (m) { case "max": p.styleWidth = (R = d.max) == null ? void 0 : R.width; break; case "min": p.styleWidth = (h = d.min) == null ? void 0 : h.width; break; default: p.styleWidth = m; break; } return p; }, l = ({ height: r = "min", width: f = "max", type: m, ...d }) => /* @__PURE__ */ z.jsx( Mr, { ...d, ...kr({ height: r, width: f, type: m }), templateId: Tr[m] } ), jr = { /** * --- * TrustBox Widget ReviewCollector - Collect Review * --- * * Deliver a seal of trust and collect organic reviews. * * Helps you collect reviews directly from your own site. Has a clean and simple design. * * --- * * @param height Defines the widget height in `px` or `%`. Supports `min` and `max` for responsive sizing. * @param width Defines the widget width in `px` or `%`. Supports `min` and `max` for responsive sizing. * @param locale Overrides the language set in the provider. * @param fontFamily Defines the font family. * @param borderColor Custom the widget border color. * @param children Custom loading element (default: none). * * @returns The TrustBox ReviewCollector widget. * * ![Description de l'image](https://widget.trustpilot.com/trustboxes/56278e9abfbbba0bdcd568bc/screenshot.png) */ ReviewCollector: (r) => l({ ...r, type: i.ReviewCollector }) }, Ar = { /** * --- * TrustBox Widget Horizontal - Essential * --- * * Stay top of mind throughout the consumer’s journey. * * Minimalistic design. Highly versatile. * * ---- * * @param height Defines the widget height in `px` or `%`. Supports `min` and `max` for responsive sizing. * @param width Defines the widget width in `px` or `%`. Supports `min` and `max` for responsive sizing. * @param locale Overrides the language set in the provider. * @param theme Defines the widget theme (`light` or `dark`). * @param fontFamily Defines the font family. * @param children Custom loading element (default: none). * * @returns The TrustBox Horizontal widget. * * ![Description de l'image](https://widget.trustpilot.com/trustboxes/5406e65db0d04a09e042d5fc/screenshot.png) */ Horizontal: (r) => l({ ...r, type: i.Horizontal }), /** * --- * TrustBox Widget MicroButton - Essential * --- * * Something extra to accompany your social media icons. * * Show off your total number of reviews. * * --- * * @param height Defines the widget height in `px` or `%`. Supports `min` and `max` for responsive sizing. * @param width Defines the widget width in `px` or `%`. Supports `min` and `max` for responsive sizing. * @param locale Overrides the language set in the provider. * @param fontFamily Defines the font family. * @param children Custom loading element (default: none). * * @returns The TrustBox MicroButton widget. * * ![Description de l'image](https://widget.trustpilot.com/trustboxes/5419b757fa0340045cd0c938/screenshot.png) */ MicroButton: (r) => l({ ...r, type: i.MicroButton }), /** * --- * TrustBox Widget MicroCombo - Essential * --- * * A great little starter or something extra to accompany larger TrustBoxes. * * Show off your current review count and star rating. So small it fits anywhere! * * --- * * @param height Defines the widget height in `px` or `%`. Supports `min` and `max` for responsive sizing. * @param width Defines the widget width in `px` or `%`. Supports `min` and `max` for responsive sizing. * @param locale Overrides the language set in the provider. * @param theme Defines the widget theme (`light` or `dark`). * @param fontFamily Defines the font family. * @param children Custom loading element (default: none). * * @returns The TrustBox MicroCombo widget. * * ![Description de l'image](https://widget.trustpilot.com/trustboxes/5419b6ffb0d04a076446a9af/screenshot.png) */ MicroCombo: (r) => l({ ...r, type: i.MicroCombo }), /** * --- * TrustBox Widget MicroReviewCount - Essential * --- * * Show your customers that you value real feedback with this free widget. * * Display your current review count, or hide it until you’ve reached your preferred amount of reviews. Fits seamlessly anywhere on your website * * --- * * @param height Defines the widget height in `px` or `%`. Supports `min` and `max` for responsive sizing. * @param width Defines the widget width in `px` or `%`. Supports `min` and `max` for responsive sizing. * @param locale Overrides the language set in the provider. * @param theme Defines the widget theme (`light` or `dark`). * @param fontFamily Defines the font family. * @param children Custom loading element (default: none). * @param styleAlignment Defines the alignment of the widget's content. * - `left`: Aligns content to the left. * - `center`: Centers the content. * - `right`: Aligns content to the right. * @param minReviewCount Minimum number of reviews required to display the widget. * * @returns The TrustBox MicroReviewCount widget. * * ![Description de l'image](https://widget.trustpilot.com/trustboxes/5419b6a8b0d04a076446a9ad/screenshot.png) */ MicroReviewCount: (r) => l({ ...r, type: i.MicroReviewCount }), /** * --- * TrustBox Widget MicroStar - Essential * --- * * A great little starter or something extra to accompany larger TrustBoxes. * * Show off your current review count and star rating. So small it fits anywhere! * * --- * * @param height Defines the widget height in `px` or `%`. Supports `min` and `max` for responsive sizing. * @param width Defines the widget width in `px` or `%`. Supports `min` and `max` for responsive sizing. * @param locale Overrides the language set in the provider. * @param theme Defines the widget theme (`light` or `dark`). * @param fontFamily Defines the font family. * @param children Custom loading element (default: none). * @returns The TrustBox MicroStar widget. * * ![Description de l'image](https://widget.trustpilot.com/trustboxes/5419b732fbfb950b10de65e5/screenshot.png) */ MicroStar: (r) => l({ ...r, type: i.MicroStar }), /** * --- * TrustBox Widget MicroTrustScore - Essential * --- * * A great little starter or something extra to accompany larger TrustBoxes. * * Show off your TrustScore. So small it fits anywhere! * * --- * * @param height Defines the widget height in `px` or `%`. Supports `min` and `max` for responsive sizing. * @param width Defines the widget width in `px` or `%`. Supports `min` and `max` for responsive sizing. * @param locale Overrides the language set in the provider. * @param theme Defines the widget theme (`light` or `dark`). * @param fontFamily Defines the font family. * @param children Custom loading element (default: none). * @returns The TrustBox MicroTrustScore widget. * * ![Description de l'image](https://widget.trustpilot.com/trustboxes/5419b637fa0340045cd0c936/screenshot.png) */ MicroTrustScore: (r) => l({ ...r, type: i.MicroTrustScore }), /** * --- * TrustBox Widget Mini - Essential * --- * * Get down to basics with the Mini. * * Gets to the point. Delivers a seal of trust. * * --- * * @param height Defines the widget height in `px` or `%`. Supports `min` and `max` for responsive sizing. * @param width Defines the widget width in `px` or `%`. Supports `min` and `max` for responsive sizing. * @param locale Overrides the language set in the provider. * @param theme Defines the widget theme (`light` or `dark`). * @param fontFamily Defines the font family. * @param children Custom loading element (default: none). * * @returns The TrustBox Mini widget. * * ![Description de l'image](https://widget.trustpilot.com/trustboxes/53aa8807dec7e10d38f59f32/screenshot.png) */ Mini: (r) => l({ ...r, type: i.Mini }), /** * --- * TrustBox Widget Starter - Essential * --- * * Get down to basics and watch the reviews roll in. * * Showcases your stars and review count. Links to your profile page on Trustpilot * * --- * * @param height Defines the widget height in `px` or `%`. Supports `min` and `max` for responsive sizing. * @param width Defines the widget width in `px` or `%`. Supports `min` and `max` for responsive sizing. * @param locale Overrides the language set in the provider. * @param theme Defines the widget theme (`light` or `dark`). * @param fontFamily Defines the font family. * @param children Custom loading element (default: none). * @returns The TrustBox Starter widget. * * ![Description de l'image](https://widget.trustpilot.com/trustboxes/5613c9cde69ddc09340c6beb/screenshot.png) */ Starter: (r) => l({ ...r, type: i.Starter }) }, Ir = { /** * --- * TrustBox Widget ProductMini - Product Review * --- * * Highlight your customers’ favorite products! * * Gives an overview of star ratings. Makes product comparisons easy * * --- * * @param height Defines the widget height in `px` or `%`. Supports `min` and `max` for responsive sizing. * @param width Defines the widget width in `px` or `%`. Supports `min` and `max` for responsive sizing. * @param locale Overrides the language set in the provider. * @param theme Defines the widget theme (`light` or `dark`). * @param fontFamily Defines the font family. * @param sku Product SKU(s) associated with the reviews. Can be a single string or an array of SKUs. * @param starColor Define the color of the stars * @param scrollToList Determines whether the widget should scroll to the review list when clicked. * @param noReviews the visibility of the "No Review" message. * - `hide`: Do not display when no reviews are available. * - `show`: Display even if no reviews are available. * @param styleAlignment Defines the alignment of the widget's content. * - `left`: Aligns content to the left. * - `center`: Centers the content. * - `right`: Aligns content to the right. * @param children Custom loading element (default: none). * * @returns The TrustBox ProductMini widget. * * ![Description de l'image](https://widget.trustpilot.com/trustboxes/54d39695764ea907c0f34825/screenshot.png) */ ProductMini: (r) => l({ ...r, type: i.ProductMini }), /** * --- * TrustBox Widget ProductMiniMultiSource - Product Review * --- * * Import all your product reviews and highlight your customers’ favourite products! * * Get all the benefits of the Product Mini plus the option to import reviews from other sources * * --- * * @param height Defines the widget height in `px` or `%`. Supports `min` and `max` for responsive sizing. * @param width Defines the widget width in `px` or `%`. Supports `min` and `max` for responsive sizing. * @param locale Overrides the language set in the provider. * @param theme Defines the widget theme (`light` or `dark`). * @param fontFamily Defines the font family. * @param sku Product SKU(s) associated with the reviews. Can be a single string or an array of SKUs. * @param starColor Define the color of the stars * @param scrollToList Determines whether the widget should scroll to the review list when clicked. * @param noReviews the visibility of the "No Review" message. * - `hide`: Do not display when no reviews are available. * - `show`: Display even if no reviews are available. * @param styleAlignment Defines the alignment of the widget's content. * - `left`: Aligns content to the left. * - `center`: Centers the content. * - `right`: Aligns content to the right. * @param children Custom loading element (default: none). * * @returns The TrustBox ProductMiniMultiSource widget. * * ![Description de l'image](https://widget.trustpilot.com/trustboxes/577258fb31f02306e4e3aaf9/screenshot.png) */ ProductMiniMultiSource: (r) => l({ ...r, type: i.ProductMiniMultiSource }), /** * --- * TrustBox Widget ProductReviews - Product Review * --- * * A convenient overview of your products’ reviews. * * Shows reviews directly on the website. Focuses on one specific product * * --- * * @param height Defines the widget height in `px` or `%`. Supports `min` and `max` for responsive sizing. * @param width Defines the widget width in `px` or `%`. Supports `min` and `max` for responsive sizing. * @param locale Overrides the language set in the provider. * @param theme Defines the widget theme (`light` or `dark`). * @param fontFamily Defines the font family. * @param sku Product SKU(s) associated with the reviews. Can be a single string or an array of SKUs * @param starColor Define the color of the stars * @param noReviews the visibility of the "No Review" message. * - `hide`: Do not display when no reviews are available. * - `show`: Display even if no reviews are available. * @param children Custom loading element (default: none). * * ⚠️ **Warning:** If you use the next parameter, be sure to inform the customer * that reviews are being filtered. * * @param reviewLanguages Filter review to display by language of the review * * @returns The TrustBox ProductReviews widget. * * ![Description de l'image](https://widget.trustpilot.com/trustboxes/544a426205dc0a09088833c6/screenshot.png) */ ProductReviews: (r) => l({ ...r, type: i.ProductReviews }), /** * --- * TrustBox Widget ProductReviewsCarousel - Product Review * --- * * A simple way to display customer feedback for your products. * * Fits seamlessly on your website’s product pages. Shows 15 of your latest product reviews * * --- * * @param height Defines the widget height in `px` or `%`. Supports `min` and `max` for responsive sizing. * @param width Defines the widget width in `px` or `%`. Supports `min` and `max` for responsive sizing. * @param locale Overrides the language set in the provider. * @param theme Defines the widget theme (`light` or `dark`). * @param fontFamily Defines the font family. * @param sku Product SKU(s) associated with the reviews. Can be a single string or an array of SKUs. * @param starColor Define the color of the stars * @param thirdPartyReviews Determines whether third-party reviews should be included. * @param noReviews the visibility of the "No Review" message. * - `hide`: Do not display when no reviews are available. * - `show`: Display even if no reviews are available. * @param children Custom loading element (default: none). * * ⚠️ **Warning:** If you use the next parameter, be sure to inform the customer * that reviews are being filtered. * * @param reviewLanguages Filter review to display by language of the review * * @returns The TrustBox ProductReviewsCarousel widget. * * ![Description de l'image](https://widget.trustpilot.com/trustboxes/60f537b5b0f1639de1fe048c/screenshot.png) */ ProductReviewsCarousel: (r) => l({ ...r, type: i.ProductReviewsCarousel }), /** * --- * TrustBox Widget ProductReviewsGallery - Product Review * --- * * Lead with photos and videos to visually complement your product reviews. * * Fits seamlessly on your website’s product pages * * --- * * @param height Defines the widget height in `px` or `%`. Supports `min` and `max` for responsive sizing. * @param width Defines the widget width in `px` or `%`. Supports `min` and `max` for responsive sizing. * @param locale Overrides the language set in the provider. * @param theme Defines the widget theme (`light` or `dark`). * @param fontFamily Defines the font family. * @param sku Product SKU(s) associated with the reviews. Can be a single string or an array of SKUs. * @param starColor Define the color of the stars * @param noReviews the visibility of the "No Review" message. * - `hide`: Do not display when no reviews are available. * - `show`: Display even if no reviews are available. * @param children Custom loading element (default: none). * * @returns The TrustBox ProductReviewsGallery widget. * * ![Description de l'image](https://widget.trustpilot.com/trustboxes/546f0626f97a75059086a588/screenshot.png) */ ProductReviewsGallery: (r) => l({ ...r, type: i.ProductReviewsGallery }), /** * --- * TrustBox Widget ProductReviewsMultiSource - Product Review * --- * * A TrustBox to display product reviews from multiple sources. * * Easily combine your Trustpilot product reviews with reviews imported from other sources * * --- * * @param height Defines the widget height in `px` or `%`. Supports `min` and `max` for responsive sizing. * @param width Defines the widget width in `px` or `%`. Supports `min` and `max` for responsive sizing. * @param locale Overrides the language set in the provider. * @param theme Defines the widget theme (`light` or `dark`). * @param fontFamily Defines the font family. * @param sku Product SKU(s) associated with the reviews. Can be a single string or an array of SKUs. * @param starColor Define the color of the stars * @param linkColor Define the color of the link to the review * @param noReviews the visibility of the "No Review" message. * - `hide`: Do not display when no reviews are available. * - `show`: Display even if no reviews are available. * @param children Custom loading element (default: none). * * ⚠️ **Warning:** If you use the next parameter, be sure to inform the customer * that reviews are being filtered. * * @param reviewLanguages Filter review to display by language of the review * * @returns The TrustBox ProductReviewsMultiSource widget. * * ![Description de l'image](https://widget.trustpilot.com/trustboxes/57177697fdb1180308e3815f/screenshot.png) */ ProductReviewsMultiSource: (r) => l({ ...r, type: i.ProductReviewsMultiSource }), /** * --- * TrustBox Widget ProductReviewsMultiSourceSEO - Product Review * --- * * Import all your product reviews and boost your website SEO. * * All the benefits of the MultiSource TrustBox, now with SEO power to boost your website’s ranking * * --- * * @param height Defines the widget height in `px` or `%`. Supports `min` and `max` for responsive sizing. * @param width Defines the widget width in `px` or `%`. Supports `min` and `max` for responsive sizing. * @param locale Overrides the language set in the provider. * @param theme Defines the widget theme (`light` or `dark`). * @param fontFamily Defines the font family. * @param sku Product SKU(s) associated with the reviews. Can be a single string or an array of SKUs. * @param starColor Define the color of the stars * @param name * @param linkColor Define the color of the link to the review * @param noReviews the visibility of the "No Review" message. * - `hide`: Do not display when no reviews are available. * - `show`: Display even if no reviews are available. * @param children Custom loading element (default: none). * * ⚠️ **Warning:** If you use the next parameter, be sure to inform the customer * that reviews are being filtered. * * @param reviewLanguages Filter review to display by language of the review * * @returns The TrustBox ProductReviewsMultiSourceSEO widget. * * ![Description de l'image](https://widget.trustpilot.com/trustboxes/5763bccae0a06d08e809ecbb/screenshot.png) */ ProductReviewsMultiSourceSEO: (r) => l({ ...r, type: i.ProductReviewsMultiSourceSEO }), /** * --- * TrustBox Widget ProductReviewSEO - Product Review * --- * * Get the power of SEO with your product reviews. * * Shows reviews directly on your website. Boosts the organic ranking of your site * * --- * * @param height Defines the widget height in `px` or `%`. Supports `min` and `max` for responsive sizing. * @param width Defines the widget width in `px` or `%`. Supports `min` and `max` for responsive sizing. * @param locale Overrides the language set in the provider. * @param theme Defines the widget theme (`light` or `dark`). * @param fontFamily Defines the font family. * @param sku Product SKU(s) associated with the reviews. Can be a single string or an array of SKUs. * @param starColor Define the color of the stars * @param name * @param noReviews the visibility of the "No Review" message. * - `hide`: Do not display when no reviews are available. * - `show`: Display even if no reviews are available. * @param children Custom loading element (default: none). * * ⚠️ **Warning:** If you use the next parameter, be sure to inform the customer * that reviews are being filtered. * * @param reviewLanguages Filter review to display by language of the review * * @returns The TrustBox ProductReviewSEO widget. * * ![Description de l'image](https://widget.trustpilot.com/trustboxes/5717796816f630043868e2e8/screenshot.png) */ ProductReviewSEO: (r) => l({ ...r, type: i.ProductReviewsSEO }) }, Lr = { /** * --- * TrustBox Widget Carousel - Testimonial * --- * * An eye-catching non-clickable TrustBox suitable for your checkout page. * * Focuses on overall TrustScore. Shows 15 latest reviews * * --- * * @param height Defines the widget height in `px` or `%`. Supports `min` and `m