Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@wistia/react-embeds

Package Overview
Dependencies
Maintainers
0
Versions
25
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@wistia/react-embeds - npm Package Compare versions

Comparing version 0.0.23 to 0.0.24

dist/index.browser.mjs

306

dist/index.browser.dev.js

@@ -7,2 +7,64 @@ 'use strict';

function _arrayLikeToArray(r, a) {
(null == a || a > r.length) && (a = r.length);
for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];
return n;
}
function _arrayWithHoles(r) {
if (Array.isArray(r)) return r;
}
function _assertThisInitialized(e) {
if (undefined === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
return e;
}
function _callSuper(t, o, e) {
return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e));
}
function _classCallCheck(a, n) {
if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function");
}
function _defineProperties(e, r) {
for (var t = 0; t < r.length; t++) {
var o = r[t];
o.enumerable = o.enumerable || false, o.configurable = true, "value" in o && (o.writable = true), Object.defineProperty(e, _toPropertyKey(o.key), o);
}
}
function _createClass(e, r, t) {
return r && _defineProperties(e.prototype, r), Object.defineProperty(e, "prototype", {
writable: false
}), e;
}
function _defineProperty(e, r, t) {
return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
value: t,
enumerable: true,
configurable: true,
writable: true
}) : e[r] = t, e;
}
function _getPrototypeOf(t) {
return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) {
return t.__proto__ || Object.getPrototypeOf(t);
}, _getPrototypeOf(t);
}
function _inherits(t, e) {
if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function");
t.prototype = Object.create(e && e.prototype, {
constructor: {
value: t,
writable: true,
configurable: true
}
}), Object.defineProperty(t, "prototype", {
writable: false
}), e && _setPrototypeOf(t, e);
}
function _isNativeReflectConstruct() {
try {
var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
} catch (t) {}
return (_isNativeReflectConstruct = function () {
return !!t;
})();
}
function _iterableToArrayLimit(r, l) {

@@ -16,11 +78,8 @@ var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];

a = [],
f = !0,
o = !1;
f = true,
o = false;
try {
if (i = (t = t.call(r)).next, 0 === l) {
if (Object(t) !== t) return;
f = !1;
} else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);
if (i = (t = t.call(r)).next, 0 === l) ; else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);
} catch (r) {
o = !0, n = r;
o = true, n = r;
} finally {

@@ -36,2 +95,5 @@ try {

}
function _nonIterableRest() {
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
}
function ownKeys(e, r) {

@@ -50,3 +112,3 @@ var t = Object.keys(e);

var t = null != arguments[r] ? arguments[r] : {};
r % 2 ? ownKeys(Object(t), !0).forEach(function (r) {
r % 2 ? ownKeys(Object(t), true).forEach(function (r) {
_defineProperty(e, r, t[r]);

@@ -59,142 +121,36 @@ }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) {

}
function _classCallCheck(instance, Constructor) {
if (!(instance instanceof Constructor)) {
throw new TypeError("Cannot call a class as a function");
}
function _possibleConstructorReturn(t, e) {
if (e && ("object" == typeof e || "function" == typeof e)) return e;
if (undefined !== e) throw new TypeError("Derived constructors may only return object or undefined");
return _assertThisInitialized(t);
}
function _defineProperties(target, props) {
for (var i = 0; i < props.length; i++) {
var descriptor = props[i];
descriptor.enumerable = descriptor.enumerable || false;
descriptor.configurable = true;
if ("value" in descriptor) descriptor.writable = true;
Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor);
}
function _setPrototypeOf(t, e) {
return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) {
return t.__proto__ = e, t;
}, _setPrototypeOf(t, e);
}
function _createClass(Constructor, protoProps, staticProps) {
if (protoProps) _defineProperties(Constructor.prototype, protoProps);
if (staticProps) _defineProperties(Constructor, staticProps);
Object.defineProperty(Constructor, "prototype", {
writable: false
});
return Constructor;
function _slicedToArray(r, e) {
return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest();
}
function _defineProperty(obj, key, value) {
key = _toPropertyKey(key);
if (key in obj) {
Object.defineProperty(obj, key, {
value: value,
enumerable: true,
configurable: true,
writable: true
});
} else {
obj[key] = value;
function _toPrimitive(t, r) {
if ("object" != typeof t || !t) return t;
var e = t[Symbol.toPrimitive];
if (undefined !== e) {
var i = e.call(t, r || "default");
if ("object" != typeof i) return i;
throw new TypeError("@@toPrimitive must return a primitive value.");
}
return obj;
return ("string" === r ? String : Number)(t);
}
function _inherits(subClass, superClass) {
if (typeof superClass !== "function" && superClass !== null) {
throw new TypeError("Super expression must either be null or a function");
}
subClass.prototype = Object.create(superClass && superClass.prototype, {
constructor: {
value: subClass,
writable: true,
configurable: true
}
});
Object.defineProperty(subClass, "prototype", {
writable: false
});
if (superClass) _setPrototypeOf(subClass, superClass);
function _toPropertyKey(t) {
var i = _toPrimitive(t, "string");
return "symbol" == typeof i ? i : i + "";
}
function _getPrototypeOf(o) {
_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) {
return o.__proto__ || Object.getPrototypeOf(o);
};
return _getPrototypeOf(o);
}
function _setPrototypeOf(o, p) {
_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) {
o.__proto__ = p;
return o;
};
return _setPrototypeOf(o, p);
}
function _isNativeReflectConstruct() {
if (typeof Reflect === "undefined" || !Reflect.construct) return false;
if (Reflect.construct.sham) return false;
if (typeof Proxy === "function") return true;
try {
Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
return true;
} catch (e) {
return false;
function _unsupportedIterableToArray(r, a) {
if (r) {
if ("string" == typeof r) return _arrayLikeToArray(r, a);
var t = {}.toString.call(r).slice(8, -1);
return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : undefined;
}
}
function _assertThisInitialized(self) {
if (self === void 0) {
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
}
return self;
}
function _possibleConstructorReturn(self, call) {
if (call && (typeof call === "object" || typeof call === "function")) {
return call;
} else if (call !== void 0) {
throw new TypeError("Derived constructors may only return object or undefined");
}
return _assertThisInitialized(self);
}
function _createSuper(Derived) {
var hasNativeReflectConstruct = _isNativeReflectConstruct();
return function _createSuperInternal() {
var Super = _getPrototypeOf(Derived),
result;
if (hasNativeReflectConstruct) {
var NewTarget = _getPrototypeOf(this).constructor;
result = Reflect.construct(Super, arguments, NewTarget);
} else {
result = Super.apply(this, arguments);
}
return _possibleConstructorReturn(this, result);
};
}
function _slicedToArray(arr, i) {
return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
}
function _arrayWithHoles(arr) {
if (Array.isArray(arr)) return arr;
}
function _unsupportedIterableToArray(o, minLen) {
if (!o) return;
if (typeof o === "string") return _arrayLikeToArray(o, minLen);
var n = Object.prototype.toString.call(o).slice(8, -1);
if (n === "Object" && o.constructor) n = o.constructor.name;
if (n === "Map" || n === "Set") return Array.from(o);
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
}
function _arrayLikeToArray(arr, len) {
if (len == null || len > arr.length) len = arr.length;
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
return arr2;
}
function _nonIterableRest() {
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
}
function _toPrimitive(input, hint) {
if (typeof input !== "object" || input === null) return input;
var prim = input[Symbol.toPrimitive];
if (prim !== undefined) {
var res = prim.call(input, hint || "default");
if (typeof res !== "object") return res;
throw new TypeError("@@toPrimitive must return a primitive value.");
}
return (hint === "string" ? String : Number)(input);
}
function _toPropertyKey(arg) {
var key = _toPrimitive(arg, "string");
return typeof key === "symbol" ? key : String(key);
}

@@ -229,4 +185,2 @@ var WistiaContext = /*#__PURE__*/react.createContext();

var WistiaChannel = /*#__PURE__*/function (_Component) {
_inherits(WistiaChannel, _Component);
var _super = _createSuper(WistiaChannel);
function WistiaChannel() {

@@ -238,4 +192,4 @@ var _this;

}
_this = _super.call.apply(_super, [this].concat(args));
_defineProperty(_assertThisInitialized(_this), "state", {
_this = _callSuper(this, WistiaChannel, [].concat(args));
_defineProperty(_this, "state", {
safeToRender: false

@@ -245,3 +199,4 @@ });

}
_createClass(WistiaChannel, [{
_inherits(WistiaChannel, _Component);
return _createClass(WistiaChannel, [{
key: "classNames",

@@ -282,3 +237,3 @@ get: function get() {

// instead use the bound head manager methods directly
(_this$context = this.context) === null || _this$context === void 0 || (_this$context = _this$context.wistiaContext) === null || _this$context === void 0 || _this$context.addChannelId(this.props.hashedId);
(_this$context = this.context) === null || _this$context === undefined || (_this$context = _this$context.wistiaContext) === null || _this$context === undefined || _this$context.addChannelId(this.props.hashedId);
return this.state.safeToRender ? /*#__PURE__*/jsxRuntime.jsx("div", {

@@ -290,3 +245,2 @@ className: this.classNames,

}]);
return WistiaChannel;
}(react.Component);

@@ -337,4 +291,2 @@

var WistiaPlayer = /*#__PURE__*/function (_Component) {
_inherits(WistiaPlayer, _Component);
var _super = _createSuper(WistiaPlayer);
function WistiaPlayer() {

@@ -346,10 +298,10 @@ var _this;

}
_this = _super.call.apply(_super, [this].concat(args));
_defineProperty(_assertThisInitialized(_this), "player", null);
_defineProperty(_assertThisInitialized(_this), "state", {
_this = _callSuper(this, WistiaPlayer, [].concat(args));
_defineProperty(_this, "player", null);
_defineProperty(_this, "state", {
safeToRender: false
});
_defineProperty(_assertThisInitialized(_this), "setupPlayerAfterReady", function (player) {
_defineProperty(_this, "setupPlayerAfterReady", function (player) {
var _this$context$dispatc, _this$context;
(_this$context$dispatc = (_this$context = _this.context).dispatch) === null || _this$context$dispatc === void 0 || _this$context$dispatc.call(_this$context, {
(_this$context$dispatc = (_this$context = _this.context).dispatch) === null || _this$context$dispatc === undefined || _this$context$dispatc.call(_this$context, {
type: 'add-wistia-player',

@@ -365,3 +317,4 @@ payload: {

}
_createClass(WistiaPlayer, [{
_inherits(WistiaPlayer, _Component);
return _createClass(WistiaPlayer, [{
key: "classNames",

@@ -512,3 +465,3 @@ get: function get() {

this.removeEventBindings(this.player);
(_this$player = this.player) === null || _this$player === void 0 || _this$player.remove();
(_this$player = this.player) === null || _this$player === undefined || _this$player.remove();
this.context.dispatch({

@@ -537,3 +490,3 @@ type: 'remove-wistia-player',

// instead use the bound head manager methods directly
(_this$context2 = this.context) === null || _this$context2 === void 0 || (_this$context2 = _this$context2.wistiaContext) === null || _this$context2 === void 0 || _this$context2.addVideoId(this.props.hashedId);
(_this$context2 = this.context) === null || _this$context2 === undefined || (_this$context2 = _this$context2.wistiaContext) === null || _this$context2 === undefined || _this$context2.addVideoId(this.props.hashedId);
if (!this.state.safeToRender) {

@@ -604,6 +557,6 @@ return null;

// execute handler if it's an event we care about
(_this2$event = _this2[event]) === null || _this2$event === void 0 || _this2$event.call.apply(_this2$event, [_this2].concat(args));
(_this2$event = _this2[event]) === null || _this2$event === undefined || _this2$event.call.apply(_this2$event, [_this2].concat(args));
// execute handler for event if it was passed in as a prop
handler === null || handler === void 0 || handler.apply(void 0, args);
handler === null || handler === undefined || handler.apply(undefined, args);
});

@@ -621,3 +574,3 @@ };

}
return (_this2$props$event = (_this2$props = _this2.props)[event]) === null || _this2$props$event === void 0 ? void 0 : _this2$props$event.call.apply(_this2$props$event, [_this2$props].concat(args));
return (_this2$props$event = (_this2$props = _this2.props)[event]) === null || _this2$props$event === undefined ? undefined : _this2$props$event.call.apply(_this2$props$event, [_this2$props].concat(args));
});

@@ -644,3 +597,3 @@ });

}
(_this3$props$event = (_this3$props = _this3.props)[event]) === null || _this3$props$event === void 0 || _this3$props$event.call(_this3$props, player);
(_this3$props$event = (_this3$props = _this3.props)[event]) === null || _this3$props$event === undefined || _this3$props$event.call(_this3$props, player);
};

@@ -666,3 +619,2 @@ this.initConfigOptions = {

}]);
return WistiaPlayer;
}(react.Component);

@@ -818,5 +770,5 @@

var _ref$href = _ref.href,
href = _ref$href === void 0 ? DEFAULT_HREF : _ref$href,
href = _ref$href === undefined ? DEFAULT_HREF : _ref$href,
_ref$origin = _ref.origin,
origin = _ref$origin === void 0 ? DEFAULT_ORIGIN : _ref$origin;
origin = _ref$origin === undefined ? DEFAULT_ORIGIN : _ref$origin;
_classCallCheck(this, HeadManager);

@@ -832,3 +784,3 @@ _defineProperty(this, ORIGIN_K, DEFAULT_ORIGIN);

}
_createClass(HeadManager, [{
return _createClass(HeadManager, [{
key: "activeChannelProjectHashedId",

@@ -888,3 +840,2 @@ get: function get() {

}]);
return HeadManager;
}();

@@ -910,7 +861,7 @@

var hasLoadedPlayerScript;
defineProperties(HeadManager.prototype, getOwnPropertyDescriptors( /*#__PURE__*/function () {
function _class2() {
_classCallCheck(this, _class2);
defineProperties(HeadManager.prototype, getOwnPropertyDescriptors(/*#__PURE__*/function () {
function _class() {
_classCallCheck(this, _class);
}
_createClass(_class2, [{
return _createClass(_class, [{
key: "addChannelId",

@@ -937,3 +888,2 @@ value: function addChannelId() {

}]);
return _class2;
}().prototype));

@@ -957,9 +907,5 @@ }

_props$context = props.context,
context = _props$context === void 0 ? {} : _props$context,
context = _props$context === undefined ? {} : _props$context,
href = props.href,
origin = props.origin;
var _useReducer = react.useReducer(reducer, initialState),
_useReducer2 = _slicedToArray(_useReducer, 2),
state = _useReducer2[0],
dispatch = _useReducer2[1];
var headManager = useHeadManager({

@@ -973,3 +919,3 @@ href: href,

{
headManager === null || headManager === void 0 || headManager.addChannelId(action.payload.hashedId);
headManager === null || headManager === undefined || headManager.addChannelId(action.payload.hashedId);
return state;

@@ -979,3 +925,3 @@ }

{
headManager === null || headManager === void 0 || headManager.addVideoId(action.payload.hashedId);
headManager === null || headManager === undefined || headManager.addVideoId(action.payload.hashedId);
return state;

@@ -1003,2 +949,6 @@ }

}
var _useReducer = react.useReducer(reducer, initialState),
_useReducer2 = _slicedToArray(_useReducer, 2),
state = _useReducer2[0],
dispatch = _useReducer2[1];
var wistiaContext = react.useMemo(function () {

@@ -1005,0 +955,0 @@ var memoizedContext = _objectSpread2({}, context);

@@ -6,2 +6,64 @@ 'use strict';

function _arrayLikeToArray(r, a) {
(null == a || a > r.length) && (a = r.length);
for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];
return n;
}
function _arrayWithHoles(r) {
if (Array.isArray(r)) return r;
}
function _assertThisInitialized(e) {
if (undefined === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
return e;
}
function _callSuper(t, o, e) {
return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e));
}
function _classCallCheck(a, n) {
if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function");
}
function _defineProperties(e, r) {
for (var t = 0; t < r.length; t++) {
var o = r[t];
o.enumerable = o.enumerable || false, o.configurable = true, "value" in o && (o.writable = true), Object.defineProperty(e, _toPropertyKey(o.key), o);
}
}
function _createClass(e, r, t) {
return r && _defineProperties(e.prototype, r), Object.defineProperty(e, "prototype", {
writable: false
}), e;
}
function _defineProperty(e, r, t) {
return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
value: t,
enumerable: true,
configurable: true,
writable: true
}) : e[r] = t, e;
}
function _getPrototypeOf(t) {
return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) {
return t.__proto__ || Object.getPrototypeOf(t);
}, _getPrototypeOf(t);
}
function _inherits(t, e) {
if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function");
t.prototype = Object.create(e && e.prototype, {
constructor: {
value: t,
writable: true,
configurable: true
}
}), Object.defineProperty(t, "prototype", {
writable: false
}), e && _setPrototypeOf(t, e);
}
function _isNativeReflectConstruct() {
try {
var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
} catch (t) {}
return (_isNativeReflectConstruct = function () {
return !!t;
})();
}
function _iterableToArrayLimit(r, l) {

@@ -15,11 +77,8 @@ var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];

a = [],
f = !0,
o = !1;
f = true,
o = false;
try {
if (i = (t = t.call(r)).next, 0 === l) {
if (Object(t) !== t) return;
f = !1;
} else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);
if (i = (t = t.call(r)).next, 0 === l) ; else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);
} catch (r) {
o = !0, n = r;
o = true, n = r;
} finally {

@@ -35,2 +94,5 @@ try {

}
function _nonIterableRest() {
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
}
function ownKeys(e, r) {

@@ -49,3 +111,3 @@ var t = Object.keys(e);

var t = null != arguments[r] ? arguments[r] : {};
r % 2 ? ownKeys(Object(t), !0).forEach(function (r) {
r % 2 ? ownKeys(Object(t), true).forEach(function (r) {
_defineProperty(e, r, t[r]);

@@ -58,142 +120,36 @@ }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) {

}
function _classCallCheck(instance, Constructor) {
if (!(instance instanceof Constructor)) {
throw new TypeError("Cannot call a class as a function");
}
function _possibleConstructorReturn(t, e) {
if (e && ("object" == typeof e || "function" == typeof e)) return e;
if (undefined !== e) throw new TypeError("Derived constructors may only return object or undefined");
return _assertThisInitialized(t);
}
function _defineProperties(target, props) {
for (var i = 0; i < props.length; i++) {
var descriptor = props[i];
descriptor.enumerable = descriptor.enumerable || false;
descriptor.configurable = true;
if ("value" in descriptor) descriptor.writable = true;
Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor);
}
function _setPrototypeOf(t, e) {
return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) {
return t.__proto__ = e, t;
}, _setPrototypeOf(t, e);
}
function _createClass(Constructor, protoProps, staticProps) {
if (protoProps) _defineProperties(Constructor.prototype, protoProps);
if (staticProps) _defineProperties(Constructor, staticProps);
Object.defineProperty(Constructor, "prototype", {
writable: false
});
return Constructor;
function _slicedToArray(r, e) {
return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest();
}
function _defineProperty(obj, key, value) {
key = _toPropertyKey(key);
if (key in obj) {
Object.defineProperty(obj, key, {
value: value,
enumerable: true,
configurable: true,
writable: true
});
} else {
obj[key] = value;
function _toPrimitive(t, r) {
if ("object" != typeof t || !t) return t;
var e = t[Symbol.toPrimitive];
if (undefined !== e) {
var i = e.call(t, r || "default");
if ("object" != typeof i) return i;
throw new TypeError("@@toPrimitive must return a primitive value.");
}
return obj;
return ("string" === r ? String : Number)(t);
}
function _inherits(subClass, superClass) {
if (typeof superClass !== "function" && superClass !== null) {
throw new TypeError("Super expression must either be null or a function");
}
subClass.prototype = Object.create(superClass && superClass.prototype, {
constructor: {
value: subClass,
writable: true,
configurable: true
}
});
Object.defineProperty(subClass, "prototype", {
writable: false
});
if (superClass) _setPrototypeOf(subClass, superClass);
function _toPropertyKey(t) {
var i = _toPrimitive(t, "string");
return "symbol" == typeof i ? i : i + "";
}
function _getPrototypeOf(o) {
_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) {
return o.__proto__ || Object.getPrototypeOf(o);
};
return _getPrototypeOf(o);
}
function _setPrototypeOf(o, p) {
_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) {
o.__proto__ = p;
return o;
};
return _setPrototypeOf(o, p);
}
function _isNativeReflectConstruct() {
if (typeof Reflect === "undefined" || !Reflect.construct) return false;
if (Reflect.construct.sham) return false;
if (typeof Proxy === "function") return true;
try {
Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
return true;
} catch (e) {
return false;
function _unsupportedIterableToArray(r, a) {
if (r) {
if ("string" == typeof r) return _arrayLikeToArray(r, a);
var t = {}.toString.call(r).slice(8, -1);
return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : undefined;
}
}
function _assertThisInitialized(self) {
if (self === void 0) {
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
}
return self;
}
function _possibleConstructorReturn(self, call) {
if (call && (typeof call === "object" || typeof call === "function")) {
return call;
} else if (call !== void 0) {
throw new TypeError("Derived constructors may only return object or undefined");
}
return _assertThisInitialized(self);
}
function _createSuper(Derived) {
var hasNativeReflectConstruct = _isNativeReflectConstruct();
return function _createSuperInternal() {
var Super = _getPrototypeOf(Derived),
result;
if (hasNativeReflectConstruct) {
var NewTarget = _getPrototypeOf(this).constructor;
result = Reflect.construct(Super, arguments, NewTarget);
} else {
result = Super.apply(this, arguments);
}
return _possibleConstructorReturn(this, result);
};
}
function _slicedToArray(arr, i) {
return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
}
function _arrayWithHoles(arr) {
if (Array.isArray(arr)) return arr;
}
function _unsupportedIterableToArray(o, minLen) {
if (!o) return;
if (typeof o === "string") return _arrayLikeToArray(o, minLen);
var n = Object.prototype.toString.call(o).slice(8, -1);
if (n === "Object" && o.constructor) n = o.constructor.name;
if (n === "Map" || n === "Set") return Array.from(o);
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
}
function _arrayLikeToArray(arr, len) {
if (len == null || len > arr.length) len = arr.length;
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
return arr2;
}
function _nonIterableRest() {
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
}
function _toPrimitive(input, hint) {
if (typeof input !== "object" || input === null) return input;
var prim = input[Symbol.toPrimitive];
if (prim !== undefined) {
var res = prim.call(input, hint || "default");
if (typeof res !== "object") return res;
throw new TypeError("@@toPrimitive must return a primitive value.");
}
return (hint === "string" ? String : Number)(input);
}
function _toPropertyKey(arg) {
var key = _toPrimitive(arg, "string");
return typeof key === "symbol" ? key : String(key);
}

@@ -228,4 +184,2 @@ var WistiaContext = /*#__PURE__*/react.createContext();

var WistiaChannel = /*#__PURE__*/function (_Component) {
_inherits(WistiaChannel, _Component);
var _super = _createSuper(WistiaChannel);
function WistiaChannel() {

@@ -237,4 +191,4 @@ var _this;

}
_this = _super.call.apply(_super, [this].concat(args));
_defineProperty(_assertThisInitialized(_this), "state", {
_this = _callSuper(this, WistiaChannel, [].concat(args));
_defineProperty(_this, "state", {
safeToRender: false

@@ -244,3 +198,4 @@ });

}
_createClass(WistiaChannel, [{
_inherits(WistiaChannel, _Component);
return _createClass(WistiaChannel, [{
key: "classNames",

@@ -281,3 +236,3 @@ get: function get() {

// instead use the bound head manager methods directly
(_this$context = this.context) === null || _this$context === void 0 || (_this$context = _this$context.wistiaContext) === null || _this$context === void 0 || _this$context.addChannelId(this.props.hashedId);
(_this$context = this.context) === null || _this$context === undefined || (_this$context = _this$context.wistiaContext) === null || _this$context === undefined || _this$context.addChannelId(this.props.hashedId);
return this.state.safeToRender ? /*#__PURE__*/jsxRuntime.jsx("div", {

@@ -289,3 +244,2 @@ className: this.classNames,

}]);
return WistiaChannel;
}(react.Component);

@@ -326,4 +280,2 @@

var WistiaPlayer = /*#__PURE__*/function (_Component) {
_inherits(WistiaPlayer, _Component);
var _super = _createSuper(WistiaPlayer);
function WistiaPlayer() {

@@ -335,10 +287,10 @@ var _this;

}
_this = _super.call.apply(_super, [this].concat(args));
_defineProperty(_assertThisInitialized(_this), "player", null);
_defineProperty(_assertThisInitialized(_this), "state", {
_this = _callSuper(this, WistiaPlayer, [].concat(args));
_defineProperty(_this, "player", null);
_defineProperty(_this, "state", {
safeToRender: false
});
_defineProperty(_assertThisInitialized(_this), "setupPlayerAfterReady", function (player) {
_defineProperty(_this, "setupPlayerAfterReady", function (player) {
var _this$context$dispatc, _this$context;
(_this$context$dispatc = (_this$context = _this.context).dispatch) === null || _this$context$dispatc === void 0 || _this$context$dispatc.call(_this$context, {
(_this$context$dispatc = (_this$context = _this.context).dispatch) === null || _this$context$dispatc === undefined || _this$context$dispatc.call(_this$context, {
type: 'add-wistia-player',

@@ -354,3 +306,4 @@ payload: {

}
_createClass(WistiaPlayer, [{
_inherits(WistiaPlayer, _Component);
return _createClass(WistiaPlayer, [{
key: "classNames",

@@ -501,3 +454,3 @@ get: function get() {

this.removeEventBindings(this.player);
(_this$player = this.player) === null || _this$player === void 0 || _this$player.remove();
(_this$player = this.player) === null || _this$player === undefined || _this$player.remove();
this.context.dispatch({

@@ -526,3 +479,3 @@ type: 'remove-wistia-player',

// instead use the bound head manager methods directly
(_this$context2 = this.context) === null || _this$context2 === void 0 || (_this$context2 = _this$context2.wistiaContext) === null || _this$context2 === void 0 || _this$context2.addVideoId(this.props.hashedId);
(_this$context2 = this.context) === null || _this$context2 === undefined || (_this$context2 = _this$context2.wistiaContext) === null || _this$context2 === undefined || _this$context2.addVideoId(this.props.hashedId);
if (!this.state.safeToRender) {

@@ -593,6 +546,6 @@ return null;

// execute handler if it's an event we care about
(_this2$event = _this2[event]) === null || _this2$event === void 0 || _this2$event.call.apply(_this2$event, [_this2].concat(args));
(_this2$event = _this2[event]) === null || _this2$event === undefined || _this2$event.call.apply(_this2$event, [_this2].concat(args));
// execute handler for event if it was passed in as a prop
handler === null || handler === void 0 || handler.apply(void 0, args);
handler === null || handler === undefined || handler.apply(undefined, args);
});

@@ -610,3 +563,3 @@ };

}
return (_this2$props$event = (_this2$props = _this2.props)[event]) === null || _this2$props$event === void 0 ? void 0 : _this2$props$event.call.apply(_this2$props$event, [_this2$props].concat(args));
return (_this2$props$event = (_this2$props = _this2.props)[event]) === null || _this2$props$event === undefined ? undefined : _this2$props$event.call.apply(_this2$props$event, [_this2$props].concat(args));
});

@@ -633,3 +586,3 @@ });

}
(_this3$props$event = (_this3$props = _this3.props)[event]) === null || _this3$props$event === void 0 || _this3$props$event.call(_this3$props, player);
(_this3$props$event = (_this3$props = _this3.props)[event]) === null || _this3$props$event === undefined || _this3$props$event.call(_this3$props, player);
};

@@ -655,3 +608,2 @@ this.initConfigOptions = {

}]);
return WistiaPlayer;
}(react.Component);

@@ -743,5 +695,5 @@

var _ref$href = _ref.href,
href = _ref$href === void 0 ? DEFAULT_HREF : _ref$href,
href = _ref$href === undefined ? DEFAULT_HREF : _ref$href,
_ref$origin = _ref.origin,
origin = _ref$origin === void 0 ? DEFAULT_ORIGIN : _ref$origin;
origin = _ref$origin === undefined ? DEFAULT_ORIGIN : _ref$origin;
_classCallCheck(this, HeadManager);

@@ -757,3 +709,3 @@ _defineProperty(this, ORIGIN_K, DEFAULT_ORIGIN);

}
_createClass(HeadManager, [{
return _createClass(HeadManager, [{
key: "activeChannelProjectHashedId",

@@ -813,3 +765,2 @@ get: function get() {

}]);
return HeadManager;
}();

@@ -835,7 +786,7 @@

var hasLoadedPlayerScript;
defineProperties(HeadManager.prototype, getOwnPropertyDescriptors( /*#__PURE__*/function () {
function _class2() {
_classCallCheck(this, _class2);
defineProperties(HeadManager.prototype, getOwnPropertyDescriptors(/*#__PURE__*/function () {
function _class() {
_classCallCheck(this, _class);
}
_createClass(_class2, [{
return _createClass(_class, [{
key: "addChannelId",

@@ -862,3 +813,2 @@ value: function addChannelId() {

}]);
return _class2;
}().prototype));

@@ -882,9 +832,5 @@ }

_props$context = props.context,
context = _props$context === void 0 ? {} : _props$context,
context = _props$context === undefined ? {} : _props$context,
href = props.href,
origin = props.origin;
var _useReducer = react.useReducer(reducer, initialState),
_useReducer2 = _slicedToArray(_useReducer, 2),
state = _useReducer2[0],
dispatch = _useReducer2[1];
var headManager = useHeadManager({

@@ -898,3 +844,3 @@ href: href,

{
headManager === null || headManager === void 0 || headManager.addChannelId(action.payload.hashedId);
headManager === null || headManager === undefined || headManager.addChannelId(action.payload.hashedId);
return state;

@@ -904,3 +850,3 @@ }

{
headManager === null || headManager === void 0 || headManager.addVideoId(action.payload.hashedId);
headManager === null || headManager === undefined || headManager.addVideoId(action.payload.hashedId);
return state;

@@ -928,2 +874,6 @@ }

}
var _useReducer = react.useReducer(reducer, initialState),
_useReducer2 = _slicedToArray(_useReducer, 2),
state = _useReducer2[0],
dispatch = _useReducer2[1];
var wistiaContext = react.useMemo(function () {

@@ -930,0 +880,0 @@ var memoizedContext = _objectSpread2({}, context);

@@ -8,29 +8,23 @@ 'use strict';

function _defineProperty(obj, key, value) {
key = _toPropertyKey(key);
if (key in obj) {
Object.defineProperty(obj, key, {
value: value,
enumerable: true,
configurable: true,
writable: true
});
} else {
obj[key] = value;
}
return obj;
function _defineProperty(e, r, t) {
return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
value: t,
enumerable: true,
configurable: true,
writable: true
}) : e[r] = t, e;
}
function _toPrimitive(input, hint) {
if (typeof input !== "object" || input === null) return input;
var prim = input[Symbol.toPrimitive];
if (prim !== undefined) {
var res = prim.call(input, hint || "default");
if (typeof res !== "object") return res;
function _toPrimitive(t, r) {
if ("object" != typeof t || !t) return t;
var e = t[Symbol.toPrimitive];
if (undefined !== e) {
var i = e.call(t, r || "default");
if ("object" != typeof i) return i;
throw new TypeError("@@toPrimitive must return a primitive value.");
}
return (hint === "string" ? String : Number)(input);
return ("string" === r ? String : Number)(t);
}
function _toPropertyKey(arg) {
var key = _toPrimitive(arg, "string");
return typeof key === "symbol" ? key : String(key);
function _toPropertyKey(t) {
var i = _toPrimitive(t, "string");
return "symbol" == typeof i ? i : i + "";
}

@@ -95,3 +89,3 @@

// instead use the bound head manager methods directly
(_this$context = this.context) === null || _this$context === void 0 || (_this$context = _this$context.wistiaContext) === null || _this$context === void 0 || _this$context.addChannelId(this.props.hashedId);
(_this$context = this.context) === null || _this$context === undefined || (_this$context = _this$context.wistiaContext) === null || _this$context === undefined || _this$context.addChannelId(this.props.hashedId);
return this.state.safeToRender ? /*#__PURE__*/jsxRuntime.jsx("div", {

@@ -151,3 +145,3 @@ className: this.classNames,

var _this$context$dispatc, _this$context;
(_this$context$dispatc = (_this$context = this.context).dispatch) === null || _this$context$dispatc === void 0 || _this$context$dispatc.call(_this$context, {
(_this$context$dispatc = (_this$context = this.context).dispatch) === null || _this$context$dispatc === undefined || _this$context$dispatc.call(_this$context, {
type: 'add-wistia-player',

@@ -271,3 +265,3 @@ payload: {

this.removeEventBindings(this.player);
(_this$player = this.player) === null || _this$player === void 0 || _this$player.remove();
(_this$player = this.player) === null || _this$player === undefined || _this$player.remove();
this.context.dispatch({

@@ -292,3 +286,3 @@ type: 'remove-wistia-player',

// instead use the bound head manager methods directly
(_this$context2 = this.context) === null || _this$context2 === void 0 || (_this$context2 = _this$context2.wistiaContext) === null || _this$context2 === void 0 || _this$context2.addVideoId(this.props.hashedId);
(_this$context2 = this.context) === null || _this$context2 === undefined || (_this$context2 = _this$context2.wistiaContext) === null || _this$context2 === undefined || _this$context2.addVideoId(this.props.hashedId);
if (!this.state.safeToRender) {

@@ -349,6 +343,6 @@ return null;

// execute handler if it's an event we care about
(_this$event = this[event]) === null || _this$event === void 0 || _this$event.call(this, ...args);
(_this$event = this[event]) === null || _this$event === undefined || _this$event.call(this, ...args);
// execute handler for event if it was passed in as a prop
handler === null || handler === void 0 || handler(...args);
handler === null || handler === undefined || handler(...args);
});

@@ -362,3 +356,3 @@ };

var _this$props$event, _this$props;
return (_this$props$event = (_this$props = this.props)[event]) === null || _this$props$event === void 0 ? void 0 : _this$props$event.call(_this$props, ...args);
return (_this$props$event = (_this$props = this.props)[event]) === null || _this$props$event === undefined ? undefined : _this$props$event.call(_this$props, ...args);
}));

@@ -378,3 +372,3 @@ if (this.props.customEvents) {

}
(_this$props$event2 = (_this$props2 = this.props)[event]) === null || _this$props$event2 === void 0 || _this$props$event2.call(_this$props2, player);
(_this$props$event2 = (_this$props2 = this.props)[event]) === null || _this$props$event2 === undefined || _this$props$event2.call(_this$props2, player);
};

@@ -527,3 +521,3 @@ this.initConfigOptions = {

addExternalScript(src) {
this.head.push( /*#__PURE__*/jsxRuntime.jsx("script", {
this.head.push(/*#__PURE__*/jsxRuntime.jsx("script", {
async: true,

@@ -539,3 +533,3 @@ src: src,

};
this.head.push( /*#__PURE__*/jsxRuntime.jsx("script", {
this.head.push(/*#__PURE__*/jsxRuntime.jsx("script", {
dangerouslySetInnerHTML: html,

@@ -592,3 +586,3 @@ type: MEDIA_TYPE_LD

};
this.head.push( /*#__PURE__*/jsxRuntime.jsx("script", {
this.head.push(/*#__PURE__*/jsxRuntime.jsx("script", {
dangerouslySetInnerHTML: html,

@@ -677,3 +671,3 @@ type: MEDIA_TYPE_JS

var _this$RAW_DATA$assets;
return (_this$RAW_DATA$assets = this[RAW_DATA$1].assets.filter(asset => asset.type === 'still_image')[0]) === null || _this$RAW_DATA$assets === void 0 ? void 0 : _this$RAW_DATA$assets.url.replace('.bin', '.jpg');
return (_this$RAW_DATA$assets = this[RAW_DATA$1].assets.filter(asset => asset.type === 'still_image')[0]) === null || _this$RAW_DATA$assets === undefined ? undefined : _this$RAW_DATA$assets.url.replace('.bin', '.jpg');
}

@@ -1057,3 +1051,2 @@ get title() {

} = props;
const [state, dispatch] = react.useReducer(reducer, initialState);
const headManager = useHeadManager({

@@ -1067,3 +1060,3 @@ href,

{
headManager === null || headManager === void 0 || headManager.addChannelId(action.payload.hashedId);
headManager === null || headManager === undefined || headManager.addChannelId(action.payload.hashedId);
return state;

@@ -1073,3 +1066,3 @@ }

{
headManager === null || headManager === void 0 || headManager.addVideoId(action.payload.hashedId);
headManager === null || headManager === undefined || headManager.addVideoId(action.payload.hashedId);
return state;

@@ -1102,2 +1095,3 @@ }

}
const [state, dispatch] = react.useReducer(reducer, initialState);
const wistiaContext = react.useMemo(() => {

@@ -1104,0 +1098,0 @@ const memoizedContext = {

{
"name": "@wistia/react-embeds",
"version": "0.0.23",
"version": "0.0.24",
"description": "React component wrappers for Wistia embeddables",

@@ -8,2 +8,8 @@ "browser": "browser.js",

"module": "dist/index.node.mjs",
"exports": {
"browser": {
"require": "./browser.js",
"import": "./dist/index.browser.mjs"
}
},
"files": [

@@ -10,0 +16,0 @@ "dist"

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc