@tivio/sdk-react 2.2.0 → 2.2.1
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +2 -0
- package/dist/index.js +1 -1
- package/dist/services/sentry.d.ts +0 -4
- package/package.json +3 -2
- package/scripts/postpublish.ts +10 -0
package/README.md
CHANGED
@@ -3,6 +3,8 @@
|
|
3
3
|
## Changelog
|
4
4
|
|
5
5
|
* Unreleased
|
6
|
+
* v2.2.1
|
7
|
+
* patch: disable Sentry when no config is supplied to `TivioProvider`
|
6
8
|
* v2.2.0
|
7
9
|
* patch: reduced bundle size
|
8
10
|
* minor: disable Sentry when no config is supplied to `TivioProvider` or when Tivio is disabled `{ enable: false }`, or when Sentry is disabled via config `{ enableSentry: false }`
|
package/dist/index.js
CHANGED
@@ -1 +1 @@
|
|
1
|
-
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react"),require("@sentry/browser"),require("firebase/app"),require("firebase/auth"),require("firebase/firestore"),require("mobx"),require("react-dom"),require("styled-components")):"function"==typeof define&&define.amd?define("@tivio/sdk-react",["react","@sentry/browser","firebase/app","firebase/auth","firebase/firestore","mobx","react-dom","styled-components"],t):"object"==typeof exports?exports["@tivio/sdk-react"]=t(require("react"),require("@sentry/browser"),require("firebase/app"),require("firebase/auth"),require("firebase/firestore"),require("mobx"),require("react-dom"),require("styled-components")):e["@tivio/sdk-react"]=t(e.react,e["@sentry/browser"],e["firebase/app"],e["firebase/auth"],e["firebase/firestore"],e.mobx,e["react-dom"],e["styled-components"])}(this,(function(e,t,n,r,o,i,u,a){return function(){"use strict";var s={823:function(e,t,n){n.r(t),n.d(t,{MobXProviderContext:function(){return ie},Observer:function(){return x},PropTypes:function(){return me},Provider:function(){return ue},disposeOnUnmount:function(){return ve},enableStaticRendering:function(){return m},inject:function(){return ce},isUsingStaticRendering:function(){return g},observer:function(){return re},observerBatching:function(){return s},useAsObservableSource:function(){return C},useLocalObservable:function(){return j},useLocalStore:function(){return E},useObserver:function(){return k},useStaticRendering:function(){return T}});var r=n(965),o=n(297),i=n.n(o);if(!o.useState)throw new Error("mobx-react-lite requires React with Hooks support");if(!r.makeObservable)throw new Error("mobx-react-lite@3 requires mobx at least version 6 to be available");var u=n(268);function a(e){e()}function s(e){e||(e=a),(0,r.configure)({reactionScheduler:e})}var c=[];function l(e){return(0,r.getDependencyTree)(e)}var f="undefined"==typeof FinalizationRegistry?void 0:FinalizationRegistry;function d(e){return{reaction:e,mounted:!1,changedBeforeMount:!1,cleanAt:Date.now()+v}}var v=1e4,p=f?function(e){var t=new Map,n=1,r=new e((function(e){var n=t.get(e);n&&(n.reaction.dispose(),t.delete(e))}));return{addReactionToTrack:function(e,o,i){var u=n++;return r.register(i,u,e),e.current=d(o),e.current.finalizationRegistryCleanupToken=u,t.set(u,e.current),e.current},recordReactionAsCommitted:function(e){r.unregister(e),e.current&&e.current.finalizationRegistryCleanupToken&&t.delete(e.current.finalizationRegistryCleanupToken)},forceCleanupTimerToRunNowForTests:function(){},resetCleanupScheduleForTests:function(){}}}(f):function(){var e,t=new Set;function n(){void 0===e&&(e=setTimeout(r,1e4))}function r(){e=void 0;var r=Date.now();t.forEach((function(e){var n=e.current;n&&r>=n.cleanAt&&(n.reaction.dispose(),e.current=null,t.delete(e))})),t.size>0&&n()}return{addReactionToTrack:function(e,r,o){var i;return e.current=d(r),i=e,t.add(i),n(),e.current},recordReactionAsCommitted:function(e){t.delete(e)},forceCleanupTimerToRunNowForTests:function(){e&&(clearTimeout(e),r())},resetCleanupScheduleForTests:function(){var n,r;if(t.size>0){try{for(var o=function(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}(t),i=o.next();!i.done;i=o.next()){var u=i.value,a=u.current;a&&(a.reaction.dispose(),u.current=null)}}catch(e){n={error:e}}finally{try{i&&!i.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}t.clear()}e&&(clearTimeout(e),e=void 0)}}}(),b=p.addReactionToTrack,h=p.recordReactionAsCommitted,y=(p.resetCleanupScheduleForTests,p.forceCleanupTimerToRunNowForTests,!1);function m(e){y=e}function g(){return y}function P(e){return"observer"+e}var w=function(){};function _(e,t){if(void 0===t&&(t="observed"),g())return e();var n,u=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),u=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)u.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return u}(i().useState(new w),1)[0],a=(n=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),u=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)u.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return u}((0,o.useState)(0),2)[1],(0,o.useCallback)((function(){n((function(e){return e+1}))}),c)),s=i().useRef(null);if(!s.current)var f=new r.Reaction(P(t),(function(){d.mounted?a():d.changedBeforeMount=!0})),d=b(s,f,u);var v,p,y=s.current.reaction;if(i().useDebugValue(y,l),i().useEffect((function(){return h(s),s.current?(s.current.mounted=!0,s.current.changedBeforeMount&&(s.current.changedBeforeMount=!1,a())):(s.current={reaction:new r.Reaction(P(t),(function(){a()})),mounted:!0,changedBeforeMount:!1,cleanAt:1/0},a()),function(){s.current.reaction.dispose(),s.current=null}}),[]),y.track((function(){try{v=e()}catch(e){p=e}})),p)throw p;return v}var O=function(){return(O=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};var S={$$typeof:!0,render:!0,compare:!0,type:!0};function x(e){var t=e.children,n=e.render,r=t||n;return"function"!=typeof r?null:_(r)}function j(e,t){return(0,o.useState)((function(){return(0,r.observable)(e(),t,{autoBind:!0})}))[0]}x.displayName="Observer";function C(e){var t=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),u=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)u.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return u}((0,o.useState)((function(){return(0,r.observable)(e,{},{deep:!1})})),1)[0];return(0,r.runInAction)((function(){Object.assign(t,e)})),t}function E(e,t){var n=t&&C(t);return(0,o.useState)((function(){return(0,r.observable)(e(n),void 0,{autoBind:!0})}))[0]}function k(e,t){return void 0===t&&(t="observed"),_(e,t)}function T(e){m(e)}s(u.unstable_batchedUpdates);var M=0,R={};function D(e){return R[e]||(R[e]=function(e){if("function"==typeof Symbol)return Symbol(e);var t="__$mobx-react "+e+" ("+M+")";return M++,t}(e)),R[e]}function I(e,t){if(L(e,t))return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(var o=0;o<n.length;o++)if(!Object.hasOwnProperty.call(t,n[o])||!L(e[n[o]],t[n[o]]))return!1;return!0}function L(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t}var U={$$typeof:1,render:1,compare:1,type:1,childContextTypes:1,contextType:1,contextTypes:1,defaultProps:1,getDefaultProps:1,getDerivedStateFromError:1,getDerivedStateFromProps:1,mixins:1,displayName:1,propTypes:1};function W(e,t,n){Object.hasOwnProperty.call(e,t)?e[t]=n:Object.defineProperty(e,t,{enumerable:!1,configurable:!0,writable:!0,value:n})}var A=D("patchMixins"),V=D("patchedDefinition");function B(e,t){for(var n=this,r=arguments.length,o=new Array(r>2?r-2:0),i=2;i<r;i++)o[i-2]=arguments[i];t.locks++;try{var u;return null!=e&&(u=e.apply(this,o)),u}finally{t.locks--,0===t.locks&&t.methods.forEach((function(e){e.apply(n,o)}))}}function z(e,t){return function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];B.call.apply(B,[this,e,t].concat(r))}}function N(e,t,n){var r=function(e,t){var n=e[A]=e[A]||{},r=n[t]=n[t]||{};return r.locks=r.locks||0,r.methods=r.methods||[],r}(e,t);r.methods.indexOf(n)<0&&r.methods.push(n);var o=Object.getOwnPropertyDescriptor(e,t);if(!o||!o[V]){var i=e[t],u=q(e,t,o?o.enumerable:void 0,r,i);Object.defineProperty(e,t,u)}}function q(e,t,n,r,o){var i,u=z(o,r);return(i={})[V]=!0,i.get=function(){return u},i.set=function(o){if(this===e)u=z(o,r);else{var i=q(this,t,n,r,o);Object.defineProperty(this,t,i)}},i.configurable=!0,i.enumerable=n,i}var F=r.$mobx||"$mobx",$=D("isMobXReactObserver"),Q=D("isUnmounted"),G=D("skipRender"),X=D("isForcingUpdate");function H(e){var t=e.prototype;if(e[$]){var n=Y(t);console.warn("The provided component class ("+n+") \n has already been declared as an observer component.")}else e[$]=!0;if(t.componentWillReact)throw new Error("The componentWillReact life-cycle event is no longer supported");if(e.__proto__!==o.PureComponent)if(t.shouldComponentUpdate){if(t.shouldComponentUpdate!==K)throw new Error("It is not allowed to use shouldComponentUpdate in observer based components.")}else t.shouldComponentUpdate=K;Z(t,"props"),Z(t,"state");var r=t.render;return t.render=function(){return J.call(this,r)},N(t,"componentWillUnmount",(function(){var e;if(!0!==g()&&(null==(e=this.render[F])||e.dispose(),this[Q]=!0,!this.render[F])){var t=Y(this);console.warn("The reactive render of an observer class component ("+t+") \n was overriden after MobX attached. This may result in a memory leak if the \n overriden reactive render was not properly disposed.")}})),e}function Y(e){return e.displayName||e.name||e.constructor&&(e.constructor.displayName||e.constructor.name)||"<component>"}function J(e){var t=this;if(!0===g())return e.call(this);W(this,G,!1),W(this,X,!1);var n=Y(this),i=e.bind(this),u=!1,a=new r.Reaction(n+".render()",(function(){if(!u&&(u=!0,!0!==t[Q])){var e=!0;try{W(t,X,!0),t[G]||o.Component.prototype.forceUpdate.call(t),e=!1}finally{W(t,X,!1),e&&a.dispose()}}}));function s(){u=!1;var e=void 0,t=void 0;if(a.track((function(){try{t=(0,r._allowStateChanges)(!1,i)}catch(t){e=t}})),e)throw e;return t}return a.reactComponent=this,s[F]=a,this.render=s,s.call(this)}function K(e,t){return g()&&console.warn("[mobx-react] It seems that a re-rendering of a React component is triggered while in static (server-side) mode. Please make sure components are rendered only once server-side."),this.state!==t||!I(this.props,e)}function Z(e,t){var n=D("reactProp_"+t+"_valueHolder"),o=D("reactProp_"+t+"_atomHolder");function i(){return this[o]||W(this,o,(0,r.createAtom)("reactive "+t)),this[o]}Object.defineProperty(e,t,{configurable:!0,enumerable:!0,get:function(){var e=!1;return r._allowStateReadsStart&&r._allowStateReadsEnd&&(e=(0,r._allowStateReadsStart)(!0)),i.call(this).reportObserved(),r._allowStateReadsStart&&r._allowStateReadsEnd&&(0,r._allowStateReadsEnd)(e),this[n]},set:function(e){this[X]||I(this[n],e)?W(this,n,e):(W(this,n,e),W(this,G,!0),i.call(this).reportChanged(),W(this,G,!1))}})}var ee="function"==typeof Symbol&&Symbol.for,te=ee?Symbol.for("react.forward_ref"):"function"==typeof o.forwardRef&&(0,o.forwardRef)((function(e){return null})).$$typeof,ne=ee?Symbol.for("react.memo"):"function"==typeof o.memo&&(0,o.memo)((function(e){return null})).$$typeof;function re(e){if(!0===e.isMobxInjector&&console.warn("Mobx observer: You are trying to use 'observer' on a component that already has 'inject'. Please apply 'observer' before applying 'inject'"),ne&&e.$$typeof===ne)throw new Error("Mobx observer: You are trying to use 'observer' on a function component wrapped in either another observer or 'React.memo'. The observer already applies 'React.memo' for you.");if(te&&e.$$typeof===te){var t=e.render;if("function"!=typeof t)throw new Error("render property of ForwardRef was not a function");return(0,o.forwardRef)((function(){var e=arguments;return(0,o.createElement)(x,null,(function(){return t.apply(void 0,e)}))}))}return"function"!=typeof e||e.prototype&&e.prototype.render||e.isReactClass||Object.prototype.isPrototypeOf.call(o.Component,e)?H(e):function(e,t){if(g())return e;var n,r,i,u=O({forwardRef:!1},t),a=e.displayName||e.name,s=function(t,n){return _((function(){return e(t,n)}),a)};return s.displayName=a,n=u.forwardRef?(0,o.memo)((0,o.forwardRef)(s)):(0,o.memo)(s),r=e,i=n,Object.keys(r).forEach((function(e){S[e]||Object.defineProperty(i,e,Object.getOwnPropertyDescriptor(r,e))})),n.displayName=a,n}(e)}function oe(){return(oe=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}var ie=i().createContext({});function ue(e){var t=e.children,n=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,["children"]),r=i().useContext(ie),o=i().useRef(oe({},r,n)).current;return i().createElement(ie.Provider,{value:o},t)}function ae(e,t,n,r){var o,u,a,s=i().forwardRef((function(n,r){var o=oe({},n),u=i().useContext(ie);return Object.assign(o,e(u||{},o)||{}),r&&(o.ref=r),i().createElement(t,o)}));return r&&(s=re(s)),s.isMobxInjector=!0,o=t,u=s,a=Object.getOwnPropertyNames(Object.getPrototypeOf(o)),Object.getOwnPropertyNames(o).forEach((function(e){U[e]||-1!==a.indexOf(e)||Object.defineProperty(u,e,Object.getOwnPropertyDescriptor(o,e))})),s.wrappedComponent=t,s.displayName=function(e,t){var n=e.displayName||e.name||e.constructor&&e.constructor.name||"Component";return t?"inject-with-"+t+"("+n+")":"inject("+n+")"}(t,n),s}function se(e){return function(t,n){return e.forEach((function(e){if(!(e in n)){if(!(e in t))throw new Error("MobX injector: Store '"+e+"' is not available! Make sure it is provided by some Provider");n[e]=t[e]}})),n}}function ce(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];if("function"==typeof arguments[0]){var r=arguments[0];return function(e){return ae(r,e,r.name,!0)}}return function(e){return ae(se(t),e,t.join("-"),!1)}}ue.displayName="MobXProvider";var le=D("disposeOnUnmountProto"),fe=D("disposeOnUnmountInst");function de(){var e=this;[].concat(this[le]||[],this[fe]||[]).forEach((function(t){var n="string"==typeof t?e[t]:t;null!=n&&(Array.isArray(n)?n.map((function(e){return e()})):n())}))}function ve(e,t){if(Array.isArray(t))return t.map((function(t){return ve(e,t)}));var n=Object.getPrototypeOf(e).constructor,r=Object.getPrototypeOf(e.constructor),o=Object.getPrototypeOf(Object.getPrototypeOf(e));if(n!==i().Component&&n!==i().PureComponent&&r!==i().Component&&r!==i().PureComponent&&o!==i().Component&&o!==i().PureComponent)throw new Error("[mobx-react] disposeOnUnmount only supports direct subclasses of React.Component or React.PureComponent.");if("string"!=typeof t&&"function"!=typeof t&&!Array.isArray(t))throw new Error("[mobx-react] disposeOnUnmount only works if the parameter is either a property key or a function.");var u="string"==typeof t,a=!!e[le]||!!e[fe];return(u?e[le]||(e[le]=[]):e[fe]||(e[fe]=[])).push(t),a||N(e,"componentWillUnmount",de),"string"!=typeof t?t:void 0}function pe(e){function t(t,n,o,i,u,a){for(var s=arguments.length,c=new Array(s>6?s-6:0),l=6;l<s;l++)c[l-6]=arguments[l];return(0,r.untracked)((function(){if(i=i||"<<anonymous>>",a=a||o,null==n[o]){if(t){var r=null===n[o]?"null":"undefined";return new Error("The "+u+" `"+a+"` is marked as required in `"+i+"`, but its value is `"+r+"`.")}return null}return e.apply(void 0,[n,o,i,u,a].concat(c))}))}var n=t.bind(null,!1);return n.isRequired=t.bind(null,!0),n}function be(e){var t=typeof e;return Array.isArray(e)?"array":e instanceof RegExp?"object":function(e,t){return"symbol"===e||"Symbol"===t["@@toStringTag"]||"function"==typeof Symbol&&t instanceof Symbol}(t,e)?"symbol":t}function he(e,t){return pe((function(n,o,i,u,a){return(0,r.untracked)((function(){if(e&&be(n[o])===t.toLowerCase())return null;var u;switch(t){case"Array":u=r.isObservableArray;break;case"Object":u=r.isObservableObject;break;case"Map":u=r.isObservableMap;break;default:throw new Error("Unexpected mobxType: "+t)}var s=n[o];if(!u(s)){var c=function(e){var t=be(e);if("object"===t){if(e instanceof Date)return"date";if(e instanceof RegExp)return"regexp"}return t}(s),l=e?" or javascript `"+t.toLowerCase()+"`":"";return new Error("Invalid prop `"+a+"` of type `"+c+"` supplied to `"+i+"`, expected `mobx.Observable"+t+"`"+l+".")}return null}))}))}function ye(e,t){return pe((function(n,o,i,u,a){for(var s=arguments.length,c=new Array(s>5?s-5:0),l=5;l<s;l++)c[l-5]=arguments[l];return(0,r.untracked)((function(){if("function"!=typeof t)return new Error("Property `"+a+"` of component `"+i+"` has invalid PropType notation.");var r=he(e,"Array")(n,o,i,u,a);if(r instanceof Error)return r;for(var s=n[o],l=0;l<s.length;l++)if((r=t.apply(void 0,[s,l,i,u,a+"["+l+"]"].concat(c)))instanceof Error)return r;return null}))}))}var me={observableArray:he(!1,"Array"),observableArrayOf:ye.bind(null,!1),observableMap:he(!1,"Map"),observableObject:he(!1,"Object"),arrayOrObservableArray:he(!0,"Array"),arrayOrObservableArrayOf:ye.bind(null,!0),objectOrObservableObject:he(!0,"Object")};if(!o.Component)throw new Error("mobx-react requires React to be available");if(!r.observable)throw new Error("mobx-react requires mobx to be available")},903:function(e,t,n){var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.ContextProvider=void 0;var o=r(n(297)),i=n(925);t.ContextProvider=function(e){return o.default.createElement(i.ChannelsContextProvider,null,o.default.createElement(i.SectionsContextProvider,null,o.default.createElement(i.VideosContextProvider,null,o.default.createElement(i.UserContextProvider,null,o.default.createElement(i.OrganizationSubscriptionsContextProvider,null,o.default.createElement(i.PurchasesWithVideosContextProvider,null,o.default.createElement(i.ScreensContextProvider,null,o.default.createElement(i.RowItemsContextProvider,null,e.children))))))))}},585:function(e,t,n){var r=this&&this.__assign||function(){return(r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},o=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),u=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.withPlayerContext=t.PlayerProvider=t.PlayerContext=void 0;var a=u(n(297)),s=n(517);t.PlayerContext=a.default.createContext(void 0),t.PlayerProvider=function(e){var n=e.children,r=e.playerWrapperId,o=c(void 0===r?"default":r),i=l(),u=a.default.createElement(t.PlayerContext.Provider,{value:o},n);return i&&(u=a.default.createElement(i.Provider,{value:{player:o}},u)),u};var c=function(e){var t=(0,a.useState)(null),n=t[0],r=t[1];return(0,a.useEffect)((function(){s.bundlePromise.then((function(t){var n,o=null===(n=t.getters)||void 0===n?void 0:n.getPlayerWrapper({playerWrapperId:e});r(o)})).catch((function(){}))}),[e]),n},l=function(){var e=(0,a.useState)(null),t=e[0],n=e[1];return(0,a.useEffect)((function(){s.bundlePromise.then((function(e){var t,r=null===(t=e.components)||void 0===t?void 0:t.PlayerDataContext;n(r)})).catch((function(){}))}),[]),t};t.withPlayerContext=function(e){return function(n){return function(o){return a.default.createElement(t.PlayerProvider,{playerWrapperId:e},a.default.createElement(n,r({},o)))}}}},602:function(e,t,n){var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return o(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.useTivioReadyData=t.useTivioData=t.TivioProvider=void 0;var u=i(n(297)),a=n(958),s=n(643),c=n(256),l=n(903),f=(0,s.createUseRemoteBundle)(),d=u.default.createContext(null);t.TivioProvider=function(e){var t=e.children,n=e.conf,r=(0,a.createInternalConf)(null!=n?n:null),o=f(r);(0,u.useEffect)((function(){!1!==(null==n?void 0:n.enable)&&!1!==(null==n?void 0:n.enableSentry)?(0,c.injectSentryToWindow)():(0,c.disableSentry)()}),[]);var i="ready"===(null==o?void 0:o.state)&&o.components?u.default.createElement(o.components.Provider,{language:r.language,disableUnmounting:r.disableUnmounting},t):t;return u.default.createElement(l.ContextProvider,null,u.default.createElement(d.Provider,{value:o},i))},t.useTivioData=function(){var e=(0,u.useContext)(d);if(null===e)throw new Error("Make sure to wrap your app in <TivioProvider conf={...}><App/></TivioProvider>");return e},t.useTivioReadyData=function(){var e=(0,t.useTivioData)();return"ready"===e.state?e:null}},411:function(e,t,n){var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return o(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.TivioWidget=void 0;var u=i(n(297)),a=n(602),s=n(57);t.TivioWidget=u.default.forwardRef((function(e,t){var n=e.id,r=e.onBlur,o=e.onEnabled;if("string"!=typeof n||!n.length)return u.default.createElement(s.TivioWidgetError,{error:"TivioWidget must have a mandatory property 'id'."});var i=(0,a.useTivioData)(),c=i.state,l=i.error,f=i.components,d=i.conf,v=d.ErrorComponent,p=d.LoaderComponent;switch((0,u.useEffect)((function(){"error"===c&&(null==o||o(!1))}),[c]),c){case"error":return u.default.createElement(v,{error:l});case"loading":return u.default.createElement(p,null);case"ready":return f?u.default.createElement(f.Widget,{id:n,ref:t,onEnabled:o,onBlur:r}):null}}))},57:function(e,t,n){var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.TivioWidgetError=void 0;var o=r(n(297));t.TivioWidgetError=function(e){var t=e.error;return o.default.createElement("div",{style:{backgroundColor:"#d84f92",color:"#fff",padding:"1rem"}},t)}},868:function(e,t,n){var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.TivioWidgetLoader=void 0;var o=r(n(297));t.TivioWidgetLoader=function(){return o.default.createElement("div",null,"loading...")}},448:function(e,t,n){var r=this&&this.__assign||function(){return(r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},o=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),u=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.ChannelsContextProvider=t.ChannelsContext=void 0;var a=u(n(297)),s=(0,a.createContext)({data:{},setData:function(){return null}});t.ChannelsContext=s,t.ChannelsContextProvider=function(e){var t=(0,a.useState)({}),n=t[0],o=t[1],i=(0,a.useRef)(n);return a.default.createElement(s.Provider,{value:{data:n,setData:function(e,t){var n,u=r(r({},i.current),((n={})[e]=t,n));i.current=u,o(u)}}},e.children)}},571:function(e,t,n){var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return o(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.OrganizationSubscriptionsContext=t.OrganizationSubscriptionsContextProvider=void 0;var u=i(n(297)),a=(0,u.createContext)({subscriptions:[],setSubscriptions:function(){return null}});t.OrganizationSubscriptionsContext=a,t.OrganizationSubscriptionsContextProvider=function(e){var t=(0,u.useState)([]),n=t[0],r=t[1];return u.default.createElement(a.Provider,{value:{subscriptions:n,setSubscriptions:r}},e.children)}},860:function(e,t,n){var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return o(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.PurchasesWithVideosContextProvider=t.PurchasesWithVideosContext=void 0;var u=i(n(297)),a=(0,u.createContext)({purchases:[],setPurchases:function(){return null}});t.PurchasesWithVideosContext=a,t.PurchasesWithVideosContextProvider=function(e){var t=(0,u.useState)([]),n=t[0],r=t[1];return u.default.createElement(a.Provider,{value:{purchases:n,setPurchases:r}},e.children)}},988:function(e,t,n){var r=this&&this.__assign||function(){return(r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},o=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),u=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.RowItemsContextProvider=t.RowItemsContext=void 0;var a=u(n(297)),s=(0,a.createContext)(null);t.RowItemsContext=s,t.RowItemsContextProvider=function(e){var t=(0,a.useState)({}),n=t[0],o=t[1],i=(0,a.useCallback)((function(e,t){o((function(n){var o;return r(r({},n),((o={})[e]=t,o))}))}),[n]);return a.default.createElement(s.Provider,{value:{data:n,setData:i}},e.children)}},853:function(e,t,n){var r=this&&this.__assign||function(){return(r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},o=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),u=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.ScreensContextProvider=t.ScreensContext=void 0;var a=u(n(297)),s=(0,a.createContext)(null);t.ScreensContext=s,t.ScreensContextProvider=function(e){var t=(0,a.useState)({}),n=t[0],o=t[1],i=(0,a.useCallback)((function(e,t){var i,u=r(r({},n),((i={})[e]=t,i));o(u)}),[n]);return a.default.createElement(s.Provider,{value:{data:n,setData:i}},e.children)}},141:function(e,t,n){var r=this&&this.__assign||function(){return(r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},o=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),u=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.SectionsContextProvider=t.SectionsContext=void 0;var a=u(n(297)),s=(0,a.createContext)({data:{},setData:function(){return null}});t.SectionsContext=s,t.SectionsContextProvider=function(e){var t=(0,a.useState)({}),n=t[0],o=t[1],i=(0,a.useRef)(n);return a.default.createElement(s.Provider,{value:{data:n,setData:function(e,t){var n,u=r(r({},i.current),((n={})[e]=t,n));i.current=u,o(u)}}},e.children)}},661:function(e,t,n){var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return o(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.UserContext=t.UserContextProvider=void 0;var u=i(n(297)),a=(0,u.createContext)({user:null,setUser:function(){return null}});t.UserContext=a,t.UserContextProvider=function(e){var t=(0,u.useState)(null),n=t[0],r=t[1];return u.default.createElement(a.Provider,{value:{user:n,setUser:r}},e.children)}},760:function(e,t,n){var r=this&&this.__assign||function(){return(r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},o=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),u=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.VideosContextProvider=t.VideosContext=void 0;var a=u(n(297)),s=(0,a.createContext)({data:{},setData:function(){return null}});t.VideosContext=s,t.VideosContextProvider=function(e){var t=(0,a.useState)({}),n=t[0],o=t[1],i=(0,a.useRef)(n);return a.default.createElement(s.Provider,{value:{data:n,setData:function(e,t){var n,u=r(r({},i.current),((n={})[e]=t,n));i.current=u,o(u)}}},e.children)}},925:function(e,t,n){var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),o(n(448),t),o(n(571),t),o(n(860),t),o(n(853),t),o(n(141),t),o(n(661),t),o(n(760),t),o(n(988),t)},766:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.ChannelsContext=t.SectionsContext=t.VideosContext=t.useChannelsInWidget=t.useSectionsInChannel=t.useVideosInSection=t.useVideo=t.useSection=t.useIsLoaded=t.useChannel=t.useWidget=void 0;var r=n(297),o=n(920),i=n(782),u=n(925);Object.defineProperty(t,"ChannelsContext",{enumerable:!0,get:function(){return u.ChannelsContext}}),Object.defineProperty(t,"SectionsContext",{enumerable:!0,get:function(){return u.SectionsContext}}),Object.defineProperty(t,"VideosContext",{enumerable:!0,get:function(){return u.VideosContext}});var a=(0,i.createLogger)({isConsoleEnabled:!0,isSentryEnabled:!1});t.useWidget=function(e){var t=(0,o.useTivioData)().subscriptions,n=(0,r.useState)(""),i=n[0],u=n[1],a=(0,r.useState)(null),s=a[0],c=a[1],l=(0,r.useRef)(void 0);return(0,r.useEffect)((function(){return t&&t.subscribeToWidget(e,(function(e,t,n){var r,o,i;e&&u(e.message),t&&(null===(r=t.lastVideo)||void 0===r||r.transaction,null===(o=t.lastVideo)||void 0===o||o.subscriptions,null===(i=t.lastVideo)||void 0===i||i.monetizations,c(t)),n&&(l.current=n)})),function(){var e;null===(e=l.current)||void 0===e||e.call(l)}}),[t]),{error:i,widget:s}},t.useChannel=function(e){var t=(0,o.useTivioData)().subscriptions,n=(0,r.useState)(null),i=n[0],u=n[1],s=(0,r.useState)(null),c=s[0],l=s[1];return(0,r.useEffect)((function(){t&&(a.info("subscribe to channel with id "+e),t.subscribeToChannel(e,(function(e,t){e&&(a.error("failed to subscribe to channel: ",e),u(e.message)),t&&(a.error("channel data received"),l(t))})))}),[t]),{error:i,data:c}},t.useSection=function(e){var t=(0,o.useTivioData)().subscriptions,n=(0,r.useState)(null),i=n[0],u=n[1],s=(0,r.useState)(null),c=s[0],l=s[1];return(0,r.useEffect)((function(){t&&(a.info("subscribe to section with id "+e),t.subscribeToSection(e,(function(e,t){e&&(a.error("failed to subscribe to section: ",e),u(e.message)),t&&(a.info("section data received"),l(t))})))}),[t]),{error:i,data:c}},t.useVideo=function(e){var t=(0,o.useTivioData)().subscriptions,n=(0,r.useState)(null),i=n[0],u=n[1],a=(0,r.useState)(null),s=a[0],c=a[1],l=(0,r.useRef)(void 0);return(0,r.useEffect)((function(){if(e)return t?(t.subscribeToVideo(e,(function(e,t,n){e&&u(e.message),t&&(t.transaction,t.subscriptions,t.monetizations,c({id:t.id,cover:t.cover,assets:t.assets,created:t.created,sectionId:t.sectionId,channelId:t.channelId,duration:t.duration,path:t.path,image:t.image,itemType:t.itemType,isPlayable:t.isPlayable,monetization:t.monetization,transaction:t.transaction,transactionId:t.transactionId,subscriptions:t.subscriptions,subscriptionIds:t.subscriptionIds,monetizations:t.monetizations,isPlaylist:t.isPlaylist,name:t.name,description:t.description,price:t.price,uri:t.uri,url:t.url})),l.current=n})),function(){var e;null===(e=l.current)||void 0===e||e.call(l)}):void 0;u("not-found")}),[t,e]),{error:i,data:s}},t.useVideosInSection=function(e,t){void 0===t&&(t=10);var n=(0,o.useTivioData)().subscriptions,i=(0,r.useContext)(u.VideosContext),s=i.data[null!=e?e:""];return(0,r.useEffect)((function(){n&&e&&(s||(a.info("subscribe to videos in section "+e),n.subscribeToVideosInSection(e,(function(t,n,r,o){t&&(a.error("failed to subscribe to videos in section: ",t),i.setData(e,{error:t,data:null,isLoading:o})),n&&(a.info("videos data received"),n.videos.forEach((function(e){return e.monetization})),n.videos.forEach((function(e){return e.subscriptions.map((function(e){return e.price}))})),n.videos.forEach((function(e){var t;return null===(t=e.transaction)||void 0===t?void 0:t.price})),i.setData(e,{data:{items:n.videos,hasNextPage:n.hasNextPage,fetchMore:function(){return null==r?void 0:r()}},error:t,isLoading:o}))}),t)))}),[n,e,i]),{error:s?s.error:null,data:s?s.data:null,isLoading:!!s&&s.isLoading}},t.useSectionsInChannel=function(e,t){void 0===t&&(t=10);var n=(0,o.useTivioData)().subscriptions,i=(0,r.useContext)(u.SectionsContext),s=i.data[e];return(0,r.useEffect)((function(){n&&(s||(a.info("subscribe to sections in channel with id "+e),n.subscribeToSectionsInChannel(e,(function(t,n,r,o){t&&(a.error("failed to subscribe to sections in channel: ",t),i.setData(e,{error:t,data:null,isLoading:o})),n&&(a.info("sections data received"),i.setData(e,{error:t,data:{items:n.sections,hasNextPage:n.hasNextPage,fetchMore:function(){return null==r?void 0:r()}},isLoading:o}))}),t)))}),[n]),{error:s?s.error:null,data:s?s.data:null,isLoading:!!s&&s.isLoading}},t.useChannelsInWidget=function(e,t){void 0===t&&(t=10);var n=(0,o.useTivioData)().subscriptions,i=(0,r.useContext)(u.ChannelsContext),s=i.data[e];return(0,r.useEffect)((function(){n&&(s||(a.info("subscribe to channels in widget with id: "+e),n.subscribeToChannelsInWidget(e,(function(t,n,r,o){t&&(a.error("failed to subscribe to channels in widget: ",t),i.setData(e,{error:t,data:null,isLoading:o})),n&&(a.info("channels data received"),i.setData(e,{error:t,data:{items:n.channels,hasNextPage:n.hasNextPage,fetchMore:function(){return null==r?void 0:r()}},isLoading:o}))}),t)))}),[n]),{error:s?s.error:null,data:s?s.data:null,isLoading:!!s&&s.isLoading}},t.useIsLoaded=function(){var e=(0,r.useState)(!1),t=e[0],n=e[1],i=(0,o.useTivioData)();return(0,r.useEffect)((function(){i.getters&&i.getters.isTivioLoaded(n)}),[i]),{isTivioLoaded:t}}},682:function(e,t,n){var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),o(n(883),t),o(n(596),t),o(n(469),t),o(n(639),t),o(n(802),t),o(n(350),t),o(n(766),t),o(n(862),t),o(n(311),t),o(n(197),t),o(n(419),t),o(n(814),t)},862:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.useExportedConfig=t.useAdSegment=t.useStartMarker=t.useSeekState=t.useCurrentMarker=t.useAd=t.useIntro=t.useBetOffer=t.useMarkers=t.usePlayerEvent=void 0;var r=n(297),o=n(585),i=n(602);t.usePlayerEvent=function(e){var t=(0,r.useContext)(o.PlayerContext);if(void 0===t)throw new Error("usePlayerEvent must be inside PlayerContext");var n=(0,r.useState)(null),i=n[0],u=n[1];return(0,r.useEffect)((function(){if(null==t?void 0:t.events)return t.events.addListener(e,u),function(){return t.events.removeListener(e,u)}}),[null==t?void 0:t.events]),i},t.useMarkers=function(){var e=(0,r.useContext)(o.PlayerContext);if(void 0===e)throw new Error("useMarkers must be inside PlayerContext");var t=(0,r.useState)(null),n=t[0],i=t[1];return(0,r.useEffect)((function(){if(null==e?void 0:e.events)return e.events.addListener("markers",i),function(){return e.events.removeListener("markers",i)}}),[null==e?void 0:e.events]),n},t.useBetOffer=function(){var e=(0,r.useContext)(o.PlayerContext);if(void 0===e)throw new Error("useBetOffer must be inside PlayerContext");var t=(0,r.useState)(null),n=t[0],i=t[1];return(0,r.useEffect)((function(){if(null==e?void 0:e.events)return e.events.addListener("bet-offer",i),function(){return e.events.removeListener("bet-offer",i)}}),[null==e?void 0:e.events]),n},t.useIntro=function(){var e=(0,r.useContext)(o.PlayerContext);if(void 0===e)throw new Error("useIntro must be inside PlayerContext");var t=(0,r.useState)(null),n=t[0],i=t[1];return(0,r.useEffect)((function(){if(null==e?void 0:e.events)return e.events.addListener("intro",i),function(){return e.events.removeListener("intro",i)}}),[null==e?void 0:e.events]),n},t.useAd=function(){var e=(0,r.useContext)(o.PlayerContext);if(void 0===e)throw new Error("useAd must be inside PlayerContext");var t=(0,r.useState)(null),n=t[0],i=t[1],u=function(){var e=(0,r.useRef)(0),t=(0,r.useState)(null),n=(t[0],t[1]);return(0,r.useCallback)((function(){e.current++,n(e.current)}),[])}();return(0,r.useEffect)((function(){if(null==e?void 0:e.events){e.events.addListener("ad",i);var t="ad-rerender",n="ad-seconds-to-skippable-changed";return e.events.isSupported(t)&&e.events.addListener(t,u),e.events.isSupported(n)&&e.events.addListener(n,u),function(){e.events.removeListener("ad",i),e.events.isSupported(t)&&e.events.removeListener(t,u),e.events.isSupported(n)&&e.events.addListener(n,u)}}}),[null==e?void 0:e.events]),n},t.useCurrentMarker=function(){var e=(0,r.useContext)(o.PlayerContext);if(void 0===e)throw new Error("useCurrentMarker must be inside PlayerContext");var t=(0,r.useState)(null),n=t[0],i=t[1];return(0,r.useEffect)((function(){if(null==e?void 0:e.events)return e.events.addListener("current-marker",i),function(){return e.events.removeListener("current-marker",i)}}),[null==e?void 0:e.events]),n},t.useSeekState=function(){var e=(0,r.useContext)(o.PlayerContext);if(void 0===e)throw new Error("useSeekState must be inside PlayerContext");var t=(0,r.useState)(null),n=t[0],i=t[1];return(0,r.useEffect)((function(){if(null==e?void 0:e.events){var t=function(){return i(!1)},n=function(){return i(!0)};return e.events.addListener("disable-seek",t),e.events.addListener("enable-seek",n),function(){e.events.removeListener("disable-seek",t),e.events.removeListener("enable-seek",n)}}}),[null==e?void 0:e.events]),n},t.useStartMarker=function(){var e=(0,r.useContext)(o.PlayerContext);if(void 0===e)throw new Error("useStartMarker must be inside PlayerContext");var t=(0,r.useState)(null),n=t[0],i=t[1];return(0,r.useEffect)((function(){if(null==e?void 0:e.events)return e.events.addListener("start-marker",i),function(){return e.events.removeListener("start-marker",i)}}),[null==e?void 0:e.events]),n},t.useAdSegment=function(){var e=(0,r.useContext)(o.PlayerContext);if(void 0===e)throw new Error("useAdSegmentMarker must be inside PlayerContext");var t=(0,r.useState)(null),n=t[0],i=t[1];return(0,r.useEffect)((function(){if(null==e?void 0:e.events)return e.events.addListener("ad-segment-changed",i),function(){return e.events.removeListener("ad-segment-changed",i)}}),[null==e?void 0:e.events]),n},t.useExportedConfig=function(){var e,t=(0,i.useTivioData)(),n=(0,r.useState)(null),o=n[0],u=n[1],a=null===(e=null==t?void 0:t.getters)||void 0===e?void 0:e.getExportedConfig;return(0,r.useEffect)((function(){null==a||a().then(u)}),[a]),o}},201:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.useError=void 0;var r=n(297);t.useError=function(){var e=(0,r.useState)(null),t=e[0],n=e[1];return{error:t,raiseError:function(e){n(e)},resetError:function(){return n(null)}}}},419:function(e,t,n){var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function u(e){try{s(r.next(e))}catch(e){i(e)}}function a(e){try{s(r.throw(e))}catch(e){i(e)}}function s(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(u,a)}s((r=r.apply(e,t||[])).next())}))},o=this&&this.__generator||function(e,t){var n,r,o,i,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;u;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return u.label++,{value:i[1],done:!1};case 5:u.label++,r=i[1],i=[0];continue;case 7:i=u.ops.pop(),u.trys.pop();continue;default:if(!((o=(o=u.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){u=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){u.label=i[1];break}if(6===i[0]&&u.label<o[1]){u.label=o[1],o=i;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(i);break}o[2]&&u.ops.pop(),u.trys.pop();continue}i=t.call(e,u)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.useFreePurchase=void 0;var i=n(602);t.useFreePurchase=function(){var e=(0,i.useTivioData)().auth;return{purchase:function(t){return r(void 0,void 0,void 0,(function(){return o(this,(function(n){switch(n.label){case 0:return e?[4,e.createFreePurchase(t)]:[3,2];case 1:n.sent(),n.label=2;case 2:return[2]}}))}))}}}},639:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.useItemsInRow=void 0;var r=n(297),o=n(602),i=n(201);t.useItemsInRow=function(e,t){void 0===t&&(t={noLimit:!1,limit:3});var n=(0,o.useTivioData)().subscriptions,u=(0,r.useState)(null),a=u[0],s=u[1],c=(0,i.useError)(),l=c.error,f=c.raiseError,d=(0,r.useRef)();return(0,r.useEffect)((function(){return n&&(d.current=n.subscribeToItemsInRow(e,(function(e,t){e&&f(e),t&&s({items:t.items,fetchMore:t.fetchMore})}),t)),function(){var e;null===(e=d.current)||void 0===e||e.call(d)}}),[n]),{pagination:a,error:l}}},311:function(e,t,n){var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function u(e){try{s(r.next(e))}catch(e){i(e)}}function a(e){try{s(r.throw(e))}catch(e){i(e)}}function s(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(u,a)}s((r=r.apply(e,t||[])).next())}))},o=this&&this.__generator||function(e,t){var n,r,o,i,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;u;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return u.label++,{value:i[1],done:!1};case 5:u.label++,r=i[1],i=[0];continue;case 7:i=u.ops.pop(),u.trys.pop();continue;default:if(!((o=(o=u.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){u=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){u.label=i[1];break}if(6===i[0]&&u.label<o[1]){u.label=o[1],o=i;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(i);break}o[2]&&u.ops.pop(),u.trys.pop();continue}i=t.call(e,u)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.useOrganizationSubscriptions=void 0;var i=n(297),u=n(571),a=n(602),s=n(766);t.useOrganizationSubscriptions=function(){var e=(0,i.useContext)(u.OrganizationSubscriptionsContext),t=e.setSubscriptions,n=e.subscriptions,c=(0,a.useTivioData)().getters,l=(0,s.useIsLoaded)().isTivioLoaded;return(0,i.useEffect)((function(){r(void 0,void 0,void 0,(function(){var e;return o(this,(function(r){switch(r.label){case 0:return c&&l&&0===n.length?[4,c.getOrganizationSubscriptions()]:[3,2];case 1:(e=r.sent())&&t(e),r.label=2;case 2:return[2]}}))}))}),[l]),{subscriptions:n}}},350:function(e,t,n){var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function u(e){try{s(r.next(e))}catch(e){i(e)}}function a(e){try{s(r.throw(e))}catch(e){i(e)}}function s(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(u,a)}s((r=r.apply(e,t||[])).next())}))},o=this&&this.__generator||function(e,t){var n,r,o,i,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;u;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return u.label++,{value:i[1],done:!1};case 5:u.label++,r=i[1],i=[0];continue;case 7:i=u.ops.pop(),u.trys.pop();continue;default:if(!((o=(o=u.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){u=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){u.label=i[1];break}if(6===i[0]&&u.label<o[1]){u.label=o[1],o=i;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(i);break}o[2]&&u.ops.pop(),u.trys.pop();continue}i=t.call(e,u)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.usePurchaseSubscription=void 0;var i=n(297),u=n(602),a=n(883);t.usePurchaseSubscription=function(e){var t=(0,i.useState)(null),n=t[0],s=t[1],c=(0,i.useState)(""),l=c[0],f=c[1],d=(0,u.useTivioData)().purchaseSubscriptionWithQerko,v=(0,a.useUser)().user,p=(0,i.useCallback)((function(){return r(void 0,void 0,void 0,(function(){var t,n;return o(this,(function(r){switch(r.label){case 0:if(f(""),!d)throw new Error("purchaseVideoWithQerko not in bundle");r.label=1;case 1:return r.trys.push([1,3,,4]),[4,d(e)];case 2:return t=r.sent(),s(t),[3,4];case 3:return(n=r.sent())instanceof Error&&f(n.message),[3,4];case 4:return[2]}}))}))}),[d]),b=(0,i.useMemo)((function(){if(!v)return"NEW";var t=v.purchases.find((function(t){return t.monetizationId===e}));return t?t.status:"NEW"}),[v]);return(0,i.useEffect)((function(){p()}),[p]),{paymentError:l,paymentInfo:n,paymentStatus:b,getPaymentInfo:p}}},197:function(e,t,n){var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function u(e){try{s(r.next(e))}catch(e){i(e)}}function a(e){try{s(r.throw(e))}catch(e){i(e)}}function s(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(u,a)}s((r=r.apply(e,t||[])).next())}))},o=this&&this.__generator||function(e,t){var n,r,o,i,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;u;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return u.label++,{value:i[1],done:!1};case 5:u.label++,r=i[1],i=[0];continue;case 7:i=u.ops.pop(),u.trys.pop();continue;default:if(!((o=(o=u.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){u=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){u.label=i[1];break}if(6===i[0]&&u.label<o[1]){u.label=o[1],o=i;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(i);break}o[2]&&u.ops.pop(),u.trys.pop();continue}i=t.call(e,u)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.usePurchasesWithVideos=void 0;var i=n(297),u=n(860),a=n(602),s=n(883);t.usePurchasesWithVideos=function(){var e=(0,s.useUser)().user,t=(0,a.useTivioData)().auth,n=(0,i.useContext)(u.PurchasesWithVideosContext),c=n.purchases,l=n.setPurchases;return(0,i.useEffect)((function(){r(void 0,void 0,void 0,(function(){var n;return o(this,(function(r){switch(r.label){case 0:return t?e&&e.purchasedVods.length!==c.length?(n=l,[4,t.getPurchasedVodsWithInitializedVideos()]):[3,2]:[2];case 1:n.apply(void 0,[r.sent()]),r.label=2;case 2:return[2]}}))}))}),[e,t]),{purchases:c}}},814:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.useRowsInScreen=void 0;var r=n(297),o=n(602),i=n(201);t.useRowsInScreen=function(e,t){void 0===t&&(t={noLimit:!1,limit:3});var n=(0,o.useTivioData)().subscriptions,u=(0,r.useState)(null),a=u[0],s=u[1],c=(0,i.useError)(),l=c.error,f=c.raiseError,d=(0,r.useRef)();return(0,r.useEffect)((function(){return n&&(d.current=n.subscribeToRowsInScreen(e,(function(e,t){e&&f(e),t&&s({fetchMore:t.fetchMore,items:t.items})}),t)),function(){var e;null===(e=d.current)||void 0===e||e.call(d)}}),[n]),{pagination:a,error:l}}},469:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.useScreen=void 0;var r=n(965),o=n(297),i=n(925),u=n(602);t.useScreen=function(e,t){var n,a,s,c=(0,u.useTivioData)().subscriptions,l=(0,o.useContext)(i.ScreensContext),f=null==l?void 0:l.data[e],d=(0,o.useRef)(null);return(0,o.useEffect)((function(){return c&&l&&null==d.current&&(d.current=null==c?void 0:c.subscribeToScreen(e,(function(t,n){var o;t&&l.setData(e,{error:t,data:null,isLoading:!1}),n&&l.setData(e,{error:t,data:{id:n.screenId,name:n.name,description:n.description,assets:(0,r.toJS)(n.assets),rows:(null!==(o=n.rows)&&void 0!==o?o:[]).map((function(e){return{id:e.rowId,name:e.name,rowId:e.rowId,description:e.description,assets:(0,r.toJS)(e.assets),itemComponent:e.itemComponent,rowComponent:e.rowComponent}}))},isLoading:!1})}),t)),function(){var e;null===(e=d.current)||void 0===e||e.call(d)}}),[c]),{error:null!==(n=null==f?void 0:f.error)&&void 0!==n?n:null,data:null!==(a=null==f?void 0:f.data)&&void 0!==a?a:null,isLoading:null===(s=null==f?void 0:f.isLoading)||void 0===s||s}}},596:function(e,t,n){var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function u(e){try{s(r.next(e))}catch(e){i(e)}}function a(e){try{s(r.throw(e))}catch(e){i(e)}}function s(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(u,a)}s((r=r.apply(e,t||[])).next())}))},o=this&&this.__generator||function(e,t){var n,r,o,i,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;u;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return u.label++,{value:i[1],done:!1};case 5:u.label++,r=i[1],i=[0];continue;case 7:i=u.ops.pop(),u.trys.pop();continue;default:if(!((o=(o=u.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){u=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){u.label=i[1];break}if(6===i[0]&&u.label<o[1]){u.label=o[1],o=i;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(i);break}o[2]&&u.ops.pop(),u.trys.pop();continue}i=t.call(e,u)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.useScreens=void 0;var i=n(297),u=n(602);t.useScreens=function(){var e=(0,u.useTivioData)().getters,t=(0,i.useState)([]),n=t[0],a=t[1];return(0,i.useEffect)((function(){e&&r(void 0,void 0,void 0,(function(){var t;return o(this,(function(n){switch(n.label){case 0:return[4,e.getOrganizationScreens()];case 1:return t=n.sent(),a(t),[2]}}))}))}),[e]),{screens:n}}},802:function(e,t,n){var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function u(e){try{s(r.next(e))}catch(e){i(e)}}function a(e){try{s(r.throw(e))}catch(e){i(e)}}function s(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(u,a)}s((r=r.apply(e,t||[])).next())}))},o=this&&this.__generator||function(e,t){var n,r,o,i,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;u;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return u.label++,{value:i[1],done:!1};case 5:u.label++,r=i[1],i=[0];continue;case 7:i=u.ops.pop(),u.trys.pop();continue;default:if(!((o=(o=u.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){u=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){u.label=i[1];break}if(6===i[0]&&u.label<o[1]){u.label=o[1],o=i;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(i);break}o[2]&&u.ops.pop(),u.trys.pop();continue}i=t.call(e,u)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.useTransactionPayment=void 0;var i=n(823),u=n(297),a=n(920),s=n(602);t.useTransactionPayment=function(e,t){var n=(0,u.useState)(null),c=n[0],l=n[1],f=(0,u.useState)(""),d=f[0],v=f[1],p=(0,s.useTivioData)().purchaseVideoWithQerko,b=(0,a.useUser)().user,h=(0,u.useCallback)((function(){return r(void 0,void 0,void 0,(function(){var n,r;return o(this,(function(o){switch(o.label){case 0:if(v(""),!p)throw new Error("purchaseVideoWithQerko not in bundle");o.label=1;case 1:return o.trys.push([1,3,,4]),[4,p(e,t)];case 2:return n=o.sent(),l(n),[3,4];case 3:return r=o.sent(),v(r.message),[3,4];case 4:return[2]}}))}))}),[p]);(0,u.useEffect)((function(){h()}),[]);var y=(0,i.useObserver)((function(){if(c&&b){var n=b.purchases.find((function(n){return n.monetizationId===t&&n.videoId===e}));if(n)return n.status}return"new"}));return{paymentInfo:c,paymentError:d,paymentStatus:y,getPaymentInfo:h}}},883:function(e,t,n){var r=this&&this.__assign||function(){return(r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.useUser=void 0;var o=n(297),i=n(782),u=n(661),a=n(602),s=(0,i.createLogger)({isConsoleEnabled:!0,isSentryEnabled:!1});t.useUser=function(){var e=(0,o.useContext)(u.UserContext),t=e.user,n=e.setUser,i=(0,a.useTivioData)().subscriptions,c=(0,o.useState)(null),l=c[0],f=c[1];return(0,o.useEffect)((function(){i&&!t&&i.subscribeToUser((function(e,t){e&&(s.error(e),f(e)),t&&n(r({},t))}))}),[i]),{user:t,error:l}}},958:function(e,t,n){var r=this&&this.__assign||function(){return(r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.createInternalConf=t.defaultConf=void 0;var o=n(57),i=n(868),u=n(782),a=n(373),s=n(675);t.defaultConf={secret:null,resolverUrl:"https://tivio-resolver-production.tiv.io/serveBundle/resolver2.js",disableUnmounting:!1,fetchPackage:a.fetchPackage,pubSub:(0,s.getPubSub)(),LoaderComponent:i.TivioWidgetLoader,ErrorComponent:o.TivioWidgetError},t.createInternalConf=function(e){return r(r(r(r({},t.defaultConf),null!=e?e:{}),null==(null==e?void 0:e.secret)?{enable:!1}:{}),{logger:void 0!==(null==e?void 0:e.logger)?e.logger:(0,u.createLogger)({isConsoleEnabled:!0}),sdkVersion:"2.2.0"})}},393:function(e,t){Object.defineProperty(t,"__esModule",{value:!0})},920:function(e,t,n){var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),t.bundlePromise=t.withPlayerContext=t.PlayerProvider=void 0;var i=n(585);Object.defineProperty(t,"PlayerProvider",{enumerable:!0,get:function(){return i.PlayerProvider}}),Object.defineProperty(t,"withPlayerContext",{enumerable:!0,get:function(){return i.withPlayerContext}});var u=n(517);Object.defineProperty(t,"bundlePromise",{enumerable:!0,get:function(){return u.bundlePromise}}),o(n(682),t),o(n(602),t),o(n(411),t),o(n(57),t),o(n(868),t),o(n(393),t),o(n(643),t),o(n(675),t),o(n(173),t),(0,n(256).initSentry)()},643:function(e,t,n){var r=this&&this.__assign||function(){return(r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},o=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function u(e){try{s(r.next(e))}catch(e){i(e)}}function a(e){try{s(r.throw(e))}catch(e){i(e)}}function s(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(u,a)}s((r=r.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var n,r,o,i,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;u;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return u.label++,{value:i[1],done:!1};case 5:u.label++,r=i[1],i=[0];continue;case 7:i=u.ops.pop(),u.trys.pop();continue;default:if(!((o=(o=u.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){u=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){u.label=i[1];break}if(6===i[0]&&u.label<o[1]){u.label=o[1],o=i;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(i);break}o[2]&&u.ops.pop(),u.trys.pop();continue}i=t.call(e,u)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.createUseRemoteBundle=t.createRemotePackageLoader=t.fetchBundle=void 0;var u=n(297),a=n(229),s=n(614),c=function(e){var t=e.resolverUrl;return(0,e.fetchPackage)(t)},l=function(e,t){return o(void 0,void 0,void 0,(function(){return i(this,(function(n){switch(n.label){case 0:return t.bundleUrlOverride?(console.info("@tivio: Fetching bundle directly based on config.bundleUrlOverride",t.bundleUrlOverride),[4,fetch(t.bundleUrlOverride)]):[3,3];case 1:return[4,n.sent().text()];case 2:return[2,n.sent()];case 3:return[2,c(t).then((function(n){var r,o={},i={exports:o};try{new Function("require","module","exports",n)(a.resolveShared,i,o)}catch(e){return Promise.reject("Cannot load Tivio Resolver "+e)}return"function"!=typeof(null===(r=i.exports.tivio)||void 0===r?void 0:r.fetch)?Promise.reject("Invalid Tivio Resolver export"):i.exports.tivio.fetch(e,t.sdkVersion)}))]}}))}))};t.fetchBundle=l;var f=function(){return function(e,t){return o(void 0,void 0,void 0,(function(){return i(this,(function(n){return[2,l(e,t).then((function(e){var t={},n={exports:t};try{new Function("require","module","exports",e)(a.resolveShared,n,t)}catch(e){return Promise.reject("Cannot load module "+e)}return"object"!=typeof n.exports.Tivio?Promise.reject('Tivio package does not export "Tivio" namespace'):"object"!=typeof n.exports.Tivio.components?Promise.reject('Tivio namespace does not export "components" member'):"function"!=typeof n.exports.Tivio.setUser?Promise.reject('Tivio namespace does not export "setUser" member'):"function"!=typeof n.exports.Tivio.init?Promise.reject('Tivio namespace does not export "init" member'):n.exports.Tivio}))]}))}))}};t.createRemotePackageLoader=f,t.createUseRemoteBundle=function(){var e=f(),t=!1;return function(n){var a=(0,s.createSettings)(n),c=(0,u.useState)({auth:null,components:null,conf:n,error:null,getters:null,init:null,purchaseSubscriptionWithQerko:null,purchaseVideoWithQerko:null,setLanguage:null,settings:a,setUser:null,sources:null,hooks:null,state:"loading",subscriptions:null}),l=c[0],f=c[1];return(0,u.useEffect)((function(){null!=n.secret&&!1!==n.enable&&e(n.secret,n).then((function(e){return o(void 0,void 0,void 0,(function(){var r;return i(this,(function(o){switch(o.label){case 0:return t?[3,2]:[4,e.init(n)];case 1:o.sent(),t=!0,o.label=2;case 2:return a.onSetUser(e.setUser),r={auth:e.auth,components:e.components,conf:n,error:null,getters:e.getters,init:e.init,purchaseSubscriptionWithQerko:e.purchaseSubscriptionWithQerko,purchaseVideoWithQerko:e.purchaseVideoWithQerko,setLanguage:e.setLanguage,settings:a,setUser:e.setUser,sources:e.sources,hooks:e.hooks,state:"ready",subscriptions:e.subscriptions},f(r),n.pubSub.publish("on-ready",r),[2]}}))}))})).catch((function(e){var t;null===(t=n.logger)||void 0===t||t.exception(e),f(r(r({},l),{conf:n,error:""+e,settings:a,state:"error"})),n.pubSub.publish("on-error",e)}))}),[]),l}}},517:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.bundlePromise=void 0;var r=n(675);t.bundlePromise=new Promise((function(e,t){(0,r.getPubSub)().subscribe("on-ready",(function(t){e(t)})),(0,r.getPubSub)().subscribe("on-error",(function(e){t(e)}))})).catch((function(e){throw console.error("@tivio/sdk-react failed to load. Reason:",e),e})).then((function(e){return console.info("@tivio/sdk-react loaded successfully."),e}))},229:function(e,t,n){var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return o(t,e),t},u=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.resolveShared=void 0;var a=u(n(421));n(942),n(714);var s=i(n(965)),c=i(n(823)),l=i(n(297)),f=i(n(268)),d=i(n(914)),v={mobx:s,"mobx-react":c,firebase:a.default,"firebase/app":a.default,"firebase/auth":null,"firebase/firestore":null,react:l,React:l,"react-dom":f,"styled-components":d};t.resolveShared=function(e){if(!(e in v))throw new Error("Could not resolve shared dependency "+e);return v[e]}},782:function(e,t,n){var r=this&&this.__spreadArray||function(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))};Object.defineProperty(t,"__esModule",{value:!0}),t.createLogger=void 0;var o=n(256);t.createLogger=function(e){var t=!1!==e.isSentryEnabled,n=function(n,i){e.isConsoleEnabled&&console[n].apply(console,r(["Tivio SDK "],i,!1)),t&&(null===o.Sentry||void 0===o.Sentry||o.Sentry.captureMessage(""+i,o.Sentry.Severity.fromString(n)))};return{error:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];n("error",e)},info:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];n("info",e)},warn:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];n("warn",e)},debug:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];n("debug",e)},exception:function(n){e.isConsoleEnabled&&console.error(n),t&&(null===o.Sentry||void 0===o.Sentry||o.Sentry.captureException(n))}}}},373:function(e,t){var n=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function u(e){try{s(r.next(e))}catch(e){i(e)}}function a(e){try{s(r.throw(e))}catch(e){i(e)}}function s(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(u,a)}s((r=r.apply(e,t||[])).next())}))},r=this&&this.__generator||function(e,t){var n,r,o,i,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;u;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return u.label++,{value:i[1],done:!1};case 5:u.label++,r=i[1],i=[0];continue;case 7:i=u.ops.pop(),u.trys.pop();continue;default:if(!((o=(o=u.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){u=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){u.label=i[1];break}if(6===i[0]&&u.label<o[1]){u.label=o[1],o=i;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(i);break}o[2]&&u.ops.pop(),u.trys.pop();continue}i=t.call(e,u)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.fetchPackage=void 0;var o={cache:"no-store"},i=function(e){var t=e.headers.get("content-type");return 200!==e.status?Promise.reject('Incorrect status "'+e.status+'" was obtained while fetching the module.'):t&&(t.includes("application/javascript")||t.includes("text/javascript"))?e.text():Promise.reject('Incorrect content "'+t+'" was obtained while fetching the module.')},u=function(e){return Promise.reject("Network failure: "+e)};t.fetchPackage=function(e){return n(void 0,void 0,void 0,(function(){return r(this,(function(t){return[2,fetch(e,o).then(i).catch(u)]}))}))}},675:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.getPubSub=t.createPubSub=void 0,t.createPubSub=function(){var e=new Map;return{publish:function(t,n){var r;null===(r=e.get(t))||void 0===r||r.forEach((function(e){(0,e.onMessage)(n)}))},subscribe:function(t,n){var r=(new Date).getTime();return e.has(t)||e.set(t,[]),e.get(t).push({id:r,onMessage:n}),function(){var n,o=null!==(n=e.get(t))&&void 0!==n?n:[],i=o.findIndex((function(e){return e.id===r}));-1!==i&&o.splice(i,1)}}}};var n=null;t.getPubSub=function(){return null===n&&(n=(0,t.createPubSub)()),n}},256:function(e,t,n){var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return o(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.injectSentryToWindow=t.initSentry=t.disableSentry=t.Sentry=void 0;var u=i(n(736)),a="true"===process.env.DISABLE_SENTRY;t.Sentry=a?null:u,t.disableSentry=function(){t.Sentry=null},t.initSentry=function(){t.Sentry?(null===t.Sentry||void 0===t.Sentry||t.Sentry.init({dsn:"https://8b9d489695004b0da95481f939b0455d@o507550.ingest.sentry.io/5600271",release:"@tivio/sdk-react@2.2.0",tracesSampleRate:1}),console.info("@tivio: Sentry enabled")):console.info("@tivio: Sentry disabled")},t.injectSentryToWindow=function(){t.Sentry&&(window.sentry=t.Sentry,console.info("@tivio: Sentry added to window"))}},614:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.createSettings=void 0,t.createSettings=function(e){var t=null,n=null;return{onSetUser:function(r){var o;"function"!=typeof r?null===(o=e.logger)||void 0===o||o.exception("Tivio Bundle setUser handler must be a function"):(t=r,null!==n&&r(n.userId,n.userPayload))},setUser:function(e,r){"function"==typeof t?(n=null,t(e,r)):n={userId:e,userPayload:r}}}}},173:function(e,t){Object.defineProperty(t,"__esModule",{value:!0})},736:function(e){e.exports=t},421:function(e){e.exports=n},942:function(e){e.exports=r},714:function(e){e.exports=o},965:function(e){e.exports=i},297:function(t){t.exports=e},268:function(e){e.exports=u},914:function(e){e.exports=a}},c={};function l(e){var t=c[e];if(void 0!==t)return t.exports;var n=c[e]={exports:{}};return s[e].call(n.exports,n,n.exports,l),n.exports}return l.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return l.d(t,{a:t}),t},l.d=function(e,t){for(var n in t)l.o(t,n)&&!l.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},l.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},l.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},l(920)}()}));
|
1
|
+
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react"),require("@sentry/browser"),require("firebase/app"),require("firebase/auth"),require("firebase/firestore"),require("mobx"),require("react-dom"),require("styled-components")):"function"==typeof define&&define.amd?define("@tivio/sdk-react",["react","@sentry/browser","firebase/app","firebase/auth","firebase/firestore","mobx","react-dom","styled-components"],t):"object"==typeof exports?exports["@tivio/sdk-react"]=t(require("react"),require("@sentry/browser"),require("firebase/app"),require("firebase/auth"),require("firebase/firestore"),require("mobx"),require("react-dom"),require("styled-components")):e["@tivio/sdk-react"]=t(e.react,e["@sentry/browser"],e["firebase/app"],e["firebase/auth"],e["firebase/firestore"],e.mobx,e["react-dom"],e["styled-components"])}(this,(function(e,t,n,r,o,i,u,a){return function(){"use strict";var s={823:function(e,t,n){n.r(t),n.d(t,{MobXProviderContext:function(){return ie},Observer:function(){return S},PropTypes:function(){return me},Provider:function(){return ue},disposeOnUnmount:function(){return ve},enableStaticRendering:function(){return m},inject:function(){return ce},isUsingStaticRendering:function(){return g},observer:function(){return re},observerBatching:function(){return s},useAsObservableSource:function(){return C},useLocalObservable:function(){return j},useLocalStore:function(){return E},useObserver:function(){return k},useStaticRendering:function(){return T}});var r=n(965),o=n(297),i=n.n(o);if(!o.useState)throw new Error("mobx-react-lite requires React with Hooks support");if(!r.makeObservable)throw new Error("mobx-react-lite@3 requires mobx at least version 6 to be available");var u=n(268);function a(e){e()}function s(e){e||(e=a),(0,r.configure)({reactionScheduler:e})}var c=[];function l(e){return(0,r.getDependencyTree)(e)}var f="undefined"==typeof FinalizationRegistry?void 0:FinalizationRegistry;function d(e){return{reaction:e,mounted:!1,changedBeforeMount:!1,cleanAt:Date.now()+v}}var v=1e4,p=f?function(e){var t=new Map,n=1,r=new e((function(e){var n=t.get(e);n&&(n.reaction.dispose(),t.delete(e))}));return{addReactionToTrack:function(e,o,i){var u=n++;return r.register(i,u,e),e.current=d(o),e.current.finalizationRegistryCleanupToken=u,t.set(u,e.current),e.current},recordReactionAsCommitted:function(e){r.unregister(e),e.current&&e.current.finalizationRegistryCleanupToken&&t.delete(e.current.finalizationRegistryCleanupToken)},forceCleanupTimerToRunNowForTests:function(){},resetCleanupScheduleForTests:function(){}}}(f):function(){var e,t=new Set;function n(){void 0===e&&(e=setTimeout(r,1e4))}function r(){e=void 0;var r=Date.now();t.forEach((function(e){var n=e.current;n&&r>=n.cleanAt&&(n.reaction.dispose(),e.current=null,t.delete(e))})),t.size>0&&n()}return{addReactionToTrack:function(e,r,o){var i;return e.current=d(r),i=e,t.add(i),n(),e.current},recordReactionAsCommitted:function(e){t.delete(e)},forceCleanupTimerToRunNowForTests:function(){e&&(clearTimeout(e),r())},resetCleanupScheduleForTests:function(){var n,r;if(t.size>0){try{for(var o=function(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}(t),i=o.next();!i.done;i=o.next()){var u=i.value,a=u.current;a&&(a.reaction.dispose(),u.current=null)}}catch(e){n={error:e}}finally{try{i&&!i.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}t.clear()}e&&(clearTimeout(e),e=void 0)}}}(),b=p.addReactionToTrack,h=p.recordReactionAsCommitted,y=(p.resetCleanupScheduleForTests,p.forceCleanupTimerToRunNowForTests,!1);function m(e){y=e}function g(){return y}function P(e){return"observer"+e}var w=function(){};function _(e,t){if(void 0===t&&(t="observed"),g())return e();var n,u=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),u=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)u.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return u}(i().useState(new w),1)[0],a=(n=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),u=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)u.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return u}((0,o.useState)(0),2)[1],(0,o.useCallback)((function(){n((function(e){return e+1}))}),c)),s=i().useRef(null);if(!s.current)var f=new r.Reaction(P(t),(function(){d.mounted?a():d.changedBeforeMount=!0})),d=b(s,f,u);var v,p,y=s.current.reaction;if(i().useDebugValue(y,l),i().useEffect((function(){return h(s),s.current?(s.current.mounted=!0,s.current.changedBeforeMount&&(s.current.changedBeforeMount=!1,a())):(s.current={reaction:new r.Reaction(P(t),(function(){a()})),mounted:!0,changedBeforeMount:!1,cleanAt:1/0},a()),function(){s.current.reaction.dispose(),s.current=null}}),[]),y.track((function(){try{v=e()}catch(e){p=e}})),p)throw p;return v}var O=function(){return(O=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};var x={$$typeof:!0,render:!0,compare:!0,type:!0};function S(e){var t=e.children,n=e.render,r=t||n;return"function"!=typeof r?null:_(r)}function j(e,t){return(0,o.useState)((function(){return(0,r.observable)(e(),t,{autoBind:!0})}))[0]}S.displayName="Observer";function C(e){var t=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),u=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)u.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return u}((0,o.useState)((function(){return(0,r.observable)(e,{},{deep:!1})})),1)[0];return(0,r.runInAction)((function(){Object.assign(t,e)})),t}function E(e,t){var n=t&&C(t);return(0,o.useState)((function(){return(0,r.observable)(e(n),void 0,{autoBind:!0})}))[0]}function k(e,t){return void 0===t&&(t="observed"),_(e,t)}function T(e){m(e)}s(u.unstable_batchedUpdates);var M=0,R={};function D(e){return R[e]||(R[e]=function(e){if("function"==typeof Symbol)return Symbol(e);var t="__$mobx-react "+e+" ("+M+")";return M++,t}(e)),R[e]}function I(e,t){if(L(e,t))return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(var o=0;o<n.length;o++)if(!Object.hasOwnProperty.call(t,n[o])||!L(e[n[o]],t[n[o]]))return!1;return!0}function L(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t}var U={$$typeof:1,render:1,compare:1,type:1,childContextTypes:1,contextType:1,contextTypes:1,defaultProps:1,getDefaultProps:1,getDerivedStateFromError:1,getDerivedStateFromProps:1,mixins:1,displayName:1,propTypes:1};function W(e,t,n){Object.hasOwnProperty.call(e,t)?e[t]=n:Object.defineProperty(e,t,{enumerable:!1,configurable:!0,writable:!0,value:n})}var A=D("patchMixins"),V=D("patchedDefinition");function B(e,t){for(var n=this,r=arguments.length,o=new Array(r>2?r-2:0),i=2;i<r;i++)o[i-2]=arguments[i];t.locks++;try{var u;return null!=e&&(u=e.apply(this,o)),u}finally{t.locks--,0===t.locks&&t.methods.forEach((function(e){e.apply(n,o)}))}}function z(e,t){return function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];B.call.apply(B,[this,e,t].concat(r))}}function N(e,t,n){var r=function(e,t){var n=e[A]=e[A]||{},r=n[t]=n[t]||{};return r.locks=r.locks||0,r.methods=r.methods||[],r}(e,t);r.methods.indexOf(n)<0&&r.methods.push(n);var o=Object.getOwnPropertyDescriptor(e,t);if(!o||!o[V]){var i=e[t],u=q(e,t,o?o.enumerable:void 0,r,i);Object.defineProperty(e,t,u)}}function q(e,t,n,r,o){var i,u=z(o,r);return(i={})[V]=!0,i.get=function(){return u},i.set=function(o){if(this===e)u=z(o,r);else{var i=q(this,t,n,r,o);Object.defineProperty(this,t,i)}},i.configurable=!0,i.enumerable=n,i}var F=r.$mobx||"$mobx",$=D("isMobXReactObserver"),Q=D("isUnmounted"),G=D("skipRender"),X=D("isForcingUpdate");function H(e){var t=e.prototype;if(e[$]){var n=Y(t);console.warn("The provided component class ("+n+") \n has already been declared as an observer component.")}else e[$]=!0;if(t.componentWillReact)throw new Error("The componentWillReact life-cycle event is no longer supported");if(e.__proto__!==o.PureComponent)if(t.shouldComponentUpdate){if(t.shouldComponentUpdate!==K)throw new Error("It is not allowed to use shouldComponentUpdate in observer based components.")}else t.shouldComponentUpdate=K;Z(t,"props"),Z(t,"state");var r=t.render;return t.render=function(){return J.call(this,r)},N(t,"componentWillUnmount",(function(){var e;if(!0!==g()&&(null==(e=this.render[F])||e.dispose(),this[Q]=!0,!this.render[F])){var t=Y(this);console.warn("The reactive render of an observer class component ("+t+") \n was overriden after MobX attached. This may result in a memory leak if the \n overriden reactive render was not properly disposed.")}})),e}function Y(e){return e.displayName||e.name||e.constructor&&(e.constructor.displayName||e.constructor.name)||"<component>"}function J(e){var t=this;if(!0===g())return e.call(this);W(this,G,!1),W(this,X,!1);var n=Y(this),i=e.bind(this),u=!1,a=new r.Reaction(n+".render()",(function(){if(!u&&(u=!0,!0!==t[Q])){var e=!0;try{W(t,X,!0),t[G]||o.Component.prototype.forceUpdate.call(t),e=!1}finally{W(t,X,!1),e&&a.dispose()}}}));function s(){u=!1;var e=void 0,t=void 0;if(a.track((function(){try{t=(0,r._allowStateChanges)(!1,i)}catch(t){e=t}})),e)throw e;return t}return a.reactComponent=this,s[F]=a,this.render=s,s.call(this)}function K(e,t){return g()&&console.warn("[mobx-react] It seems that a re-rendering of a React component is triggered while in static (server-side) mode. Please make sure components are rendered only once server-side."),this.state!==t||!I(this.props,e)}function Z(e,t){var n=D("reactProp_"+t+"_valueHolder"),o=D("reactProp_"+t+"_atomHolder");function i(){return this[o]||W(this,o,(0,r.createAtom)("reactive "+t)),this[o]}Object.defineProperty(e,t,{configurable:!0,enumerable:!0,get:function(){var e=!1;return r._allowStateReadsStart&&r._allowStateReadsEnd&&(e=(0,r._allowStateReadsStart)(!0)),i.call(this).reportObserved(),r._allowStateReadsStart&&r._allowStateReadsEnd&&(0,r._allowStateReadsEnd)(e),this[n]},set:function(e){this[X]||I(this[n],e)?W(this,n,e):(W(this,n,e),W(this,G,!0),i.call(this).reportChanged(),W(this,G,!1))}})}var ee="function"==typeof Symbol&&Symbol.for,te=ee?Symbol.for("react.forward_ref"):"function"==typeof o.forwardRef&&(0,o.forwardRef)((function(e){return null})).$$typeof,ne=ee?Symbol.for("react.memo"):"function"==typeof o.memo&&(0,o.memo)((function(e){return null})).$$typeof;function re(e){if(!0===e.isMobxInjector&&console.warn("Mobx observer: You are trying to use 'observer' on a component that already has 'inject'. Please apply 'observer' before applying 'inject'"),ne&&e.$$typeof===ne)throw new Error("Mobx observer: You are trying to use 'observer' on a function component wrapped in either another observer or 'React.memo'. The observer already applies 'React.memo' for you.");if(te&&e.$$typeof===te){var t=e.render;if("function"!=typeof t)throw new Error("render property of ForwardRef was not a function");return(0,o.forwardRef)((function(){var e=arguments;return(0,o.createElement)(S,null,(function(){return t.apply(void 0,e)}))}))}return"function"!=typeof e||e.prototype&&e.prototype.render||e.isReactClass||Object.prototype.isPrototypeOf.call(o.Component,e)?H(e):function(e,t){if(g())return e;var n,r,i,u=O({forwardRef:!1},t),a=e.displayName||e.name,s=function(t,n){return _((function(){return e(t,n)}),a)};return s.displayName=a,n=u.forwardRef?(0,o.memo)((0,o.forwardRef)(s)):(0,o.memo)(s),r=e,i=n,Object.keys(r).forEach((function(e){x[e]||Object.defineProperty(i,e,Object.getOwnPropertyDescriptor(r,e))})),n.displayName=a,n}(e)}function oe(){return(oe=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}var ie=i().createContext({});function ue(e){var t=e.children,n=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,["children"]),r=i().useContext(ie),o=i().useRef(oe({},r,n)).current;return i().createElement(ie.Provider,{value:o},t)}function ae(e,t,n,r){var o,u,a,s=i().forwardRef((function(n,r){var o=oe({},n),u=i().useContext(ie);return Object.assign(o,e(u||{},o)||{}),r&&(o.ref=r),i().createElement(t,o)}));return r&&(s=re(s)),s.isMobxInjector=!0,o=t,u=s,a=Object.getOwnPropertyNames(Object.getPrototypeOf(o)),Object.getOwnPropertyNames(o).forEach((function(e){U[e]||-1!==a.indexOf(e)||Object.defineProperty(u,e,Object.getOwnPropertyDescriptor(o,e))})),s.wrappedComponent=t,s.displayName=function(e,t){var n=e.displayName||e.name||e.constructor&&e.constructor.name||"Component";return t?"inject-with-"+t+"("+n+")":"inject("+n+")"}(t,n),s}function se(e){return function(t,n){return e.forEach((function(e){if(!(e in n)){if(!(e in t))throw new Error("MobX injector: Store '"+e+"' is not available! Make sure it is provided by some Provider");n[e]=t[e]}})),n}}function ce(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];if("function"==typeof arguments[0]){var r=arguments[0];return function(e){return ae(r,e,r.name,!0)}}return function(e){return ae(se(t),e,t.join("-"),!1)}}ue.displayName="MobXProvider";var le=D("disposeOnUnmountProto"),fe=D("disposeOnUnmountInst");function de(){var e=this;[].concat(this[le]||[],this[fe]||[]).forEach((function(t){var n="string"==typeof t?e[t]:t;null!=n&&(Array.isArray(n)?n.map((function(e){return e()})):n())}))}function ve(e,t){if(Array.isArray(t))return t.map((function(t){return ve(e,t)}));var n=Object.getPrototypeOf(e).constructor,r=Object.getPrototypeOf(e.constructor),o=Object.getPrototypeOf(Object.getPrototypeOf(e));if(n!==i().Component&&n!==i().PureComponent&&r!==i().Component&&r!==i().PureComponent&&o!==i().Component&&o!==i().PureComponent)throw new Error("[mobx-react] disposeOnUnmount only supports direct subclasses of React.Component or React.PureComponent.");if("string"!=typeof t&&"function"!=typeof t&&!Array.isArray(t))throw new Error("[mobx-react] disposeOnUnmount only works if the parameter is either a property key or a function.");var u="string"==typeof t,a=!!e[le]||!!e[fe];return(u?e[le]||(e[le]=[]):e[fe]||(e[fe]=[])).push(t),a||N(e,"componentWillUnmount",de),"string"!=typeof t?t:void 0}function pe(e){function t(t,n,o,i,u,a){for(var s=arguments.length,c=new Array(s>6?s-6:0),l=6;l<s;l++)c[l-6]=arguments[l];return(0,r.untracked)((function(){if(i=i||"<<anonymous>>",a=a||o,null==n[o]){if(t){var r=null===n[o]?"null":"undefined";return new Error("The "+u+" `"+a+"` is marked as required in `"+i+"`, but its value is `"+r+"`.")}return null}return e.apply(void 0,[n,o,i,u,a].concat(c))}))}var n=t.bind(null,!1);return n.isRequired=t.bind(null,!0),n}function be(e){var t=typeof e;return Array.isArray(e)?"array":e instanceof RegExp?"object":function(e,t){return"symbol"===e||"Symbol"===t["@@toStringTag"]||"function"==typeof Symbol&&t instanceof Symbol}(t,e)?"symbol":t}function he(e,t){return pe((function(n,o,i,u,a){return(0,r.untracked)((function(){if(e&&be(n[o])===t.toLowerCase())return null;var u;switch(t){case"Array":u=r.isObservableArray;break;case"Object":u=r.isObservableObject;break;case"Map":u=r.isObservableMap;break;default:throw new Error("Unexpected mobxType: "+t)}var s=n[o];if(!u(s)){var c=function(e){var t=be(e);if("object"===t){if(e instanceof Date)return"date";if(e instanceof RegExp)return"regexp"}return t}(s),l=e?" or javascript `"+t.toLowerCase()+"`":"";return new Error("Invalid prop `"+a+"` of type `"+c+"` supplied to `"+i+"`, expected `mobx.Observable"+t+"`"+l+".")}return null}))}))}function ye(e,t){return pe((function(n,o,i,u,a){for(var s=arguments.length,c=new Array(s>5?s-5:0),l=5;l<s;l++)c[l-5]=arguments[l];return(0,r.untracked)((function(){if("function"!=typeof t)return new Error("Property `"+a+"` of component `"+i+"` has invalid PropType notation.");var r=he(e,"Array")(n,o,i,u,a);if(r instanceof Error)return r;for(var s=n[o],l=0;l<s.length;l++)if((r=t.apply(void 0,[s,l,i,u,a+"["+l+"]"].concat(c)))instanceof Error)return r;return null}))}))}var me={observableArray:he(!1,"Array"),observableArrayOf:ye.bind(null,!1),observableMap:he(!1,"Map"),observableObject:he(!1,"Object"),arrayOrObservableArray:he(!0,"Array"),arrayOrObservableArrayOf:ye.bind(null,!0),objectOrObservableObject:he(!0,"Object")};if(!o.Component)throw new Error("mobx-react requires React to be available");if(!r.observable)throw new Error("mobx-react requires mobx to be available")},903:function(e,t,n){var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.ContextProvider=void 0;var o=r(n(297)),i=n(925);t.ContextProvider=function(e){return o.default.createElement(i.ChannelsContextProvider,null,o.default.createElement(i.SectionsContextProvider,null,o.default.createElement(i.VideosContextProvider,null,o.default.createElement(i.UserContextProvider,null,o.default.createElement(i.OrganizationSubscriptionsContextProvider,null,o.default.createElement(i.PurchasesWithVideosContextProvider,null,o.default.createElement(i.ScreensContextProvider,null,o.default.createElement(i.RowItemsContextProvider,null,e.children))))))))}},585:function(e,t,n){var r=this&&this.__assign||function(){return(r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},o=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),u=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.withPlayerContext=t.PlayerProvider=t.PlayerContext=void 0;var a=u(n(297)),s=n(517);t.PlayerContext=a.default.createContext(void 0),t.PlayerProvider=function(e){var n=e.children,r=e.playerWrapperId,o=c(void 0===r?"default":r),i=l(),u=a.default.createElement(t.PlayerContext.Provider,{value:o},n);return i&&(u=a.default.createElement(i.Provider,{value:{player:o}},u)),u};var c=function(e){var t=(0,a.useState)(null),n=t[0],r=t[1];return(0,a.useEffect)((function(){s.bundlePromise.then((function(t){var n,o=null===(n=t.getters)||void 0===n?void 0:n.getPlayerWrapper({playerWrapperId:e});r(o)})).catch((function(){}))}),[e]),n},l=function(){var e=(0,a.useState)(null),t=e[0],n=e[1];return(0,a.useEffect)((function(){s.bundlePromise.then((function(e){var t,r=null===(t=e.components)||void 0===t?void 0:t.PlayerDataContext;n(r)})).catch((function(){}))}),[]),t};t.withPlayerContext=function(e){return function(n){return function(o){return a.default.createElement(t.PlayerProvider,{playerWrapperId:e},a.default.createElement(n,r({},o)))}}}},602:function(e,t,n){var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return o(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.useTivioReadyData=t.useTivioData=t.TivioProvider=void 0;var u=i(n(297)),a=n(958),s=n(643),c=n(256),l=n(903),f=(0,s.createUseRemoteBundle)(),d=u.default.createContext(null);t.TivioProvider=function(e){var t=e.children,n=e.conf,r=(0,u.useMemo)((function(){return(0,a.createInternalConf)(null!=n?n:null)}),[]),o=f(r);(0,u.useEffect)((function(){!1===(null==r?void 0:r.enable)||!1===(null==r?void 0:r.enableSentry)?(0,c.disableSentry)():(0,c.initSentry)()}),[]);var i="ready"===(null==o?void 0:o.state)&&o.components?u.default.createElement(o.components.Provider,{language:r.language,disableUnmounting:r.disableUnmounting},t):t;return u.default.createElement(l.ContextProvider,null,u.default.createElement(d.Provider,{value:o},i))},t.useTivioData=function(){var e=(0,u.useContext)(d);if(null===e)throw new Error("Make sure to wrap your app in <TivioProvider conf={...}><App/></TivioProvider>");return e},t.useTivioReadyData=function(){var e=(0,t.useTivioData)();return"ready"===e.state?e:null}},411:function(e,t,n){var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return o(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.TivioWidget=void 0;var u=i(n(297)),a=n(602),s=n(57);t.TivioWidget=u.default.forwardRef((function(e,t){var n=e.id,r=e.onBlur,o=e.onEnabled;if("string"!=typeof n||!n.length)return u.default.createElement(s.TivioWidgetError,{error:"TivioWidget must have a mandatory property 'id'."});var i=(0,a.useTivioData)(),c=i.state,l=i.error,f=i.components,d=i.conf,v=d.ErrorComponent,p=d.LoaderComponent;switch((0,u.useEffect)((function(){"error"===c&&(null==o||o(!1))}),[c]),c){case"error":return u.default.createElement(v,{error:l});case"loading":return u.default.createElement(p,null);case"ready":return f?u.default.createElement(f.Widget,{id:n,ref:t,onEnabled:o,onBlur:r}):null}}))},57:function(e,t,n){var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.TivioWidgetError=void 0;var o=r(n(297));t.TivioWidgetError=function(e){var t=e.error;return o.default.createElement("div",{style:{backgroundColor:"#d84f92",color:"#fff",padding:"1rem"}},t)}},868:function(e,t,n){var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.TivioWidgetLoader=void 0;var o=r(n(297));t.TivioWidgetLoader=function(){return o.default.createElement("div",null,"loading...")}},448:function(e,t,n){var r=this&&this.__assign||function(){return(r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},o=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),u=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.ChannelsContextProvider=t.ChannelsContext=void 0;var a=u(n(297)),s=(0,a.createContext)({data:{},setData:function(){return null}});t.ChannelsContext=s,t.ChannelsContextProvider=function(e){var t=(0,a.useState)({}),n=t[0],o=t[1],i=(0,a.useRef)(n);return a.default.createElement(s.Provider,{value:{data:n,setData:function(e,t){var n,u=r(r({},i.current),((n={})[e]=t,n));i.current=u,o(u)}}},e.children)}},571:function(e,t,n){var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return o(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.OrganizationSubscriptionsContext=t.OrganizationSubscriptionsContextProvider=void 0;var u=i(n(297)),a=(0,u.createContext)({subscriptions:[],setSubscriptions:function(){return null}});t.OrganizationSubscriptionsContext=a,t.OrganizationSubscriptionsContextProvider=function(e){var t=(0,u.useState)([]),n=t[0],r=t[1];return u.default.createElement(a.Provider,{value:{subscriptions:n,setSubscriptions:r}},e.children)}},860:function(e,t,n){var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return o(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.PurchasesWithVideosContextProvider=t.PurchasesWithVideosContext=void 0;var u=i(n(297)),a=(0,u.createContext)({purchases:[],setPurchases:function(){return null}});t.PurchasesWithVideosContext=a,t.PurchasesWithVideosContextProvider=function(e){var t=(0,u.useState)([]),n=t[0],r=t[1];return u.default.createElement(a.Provider,{value:{purchases:n,setPurchases:r}},e.children)}},988:function(e,t,n){var r=this&&this.__assign||function(){return(r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},o=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),u=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.RowItemsContextProvider=t.RowItemsContext=void 0;var a=u(n(297)),s=(0,a.createContext)(null);t.RowItemsContext=s,t.RowItemsContextProvider=function(e){var t=(0,a.useState)({}),n=t[0],o=t[1],i=(0,a.useCallback)((function(e,t){o((function(n){var o;return r(r({},n),((o={})[e]=t,o))}))}),[n]);return a.default.createElement(s.Provider,{value:{data:n,setData:i}},e.children)}},853:function(e,t,n){var r=this&&this.__assign||function(){return(r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},o=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),u=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.ScreensContextProvider=t.ScreensContext=void 0;var a=u(n(297)),s=(0,a.createContext)(null);t.ScreensContext=s,t.ScreensContextProvider=function(e){var t=(0,a.useState)({}),n=t[0],o=t[1],i=(0,a.useCallback)((function(e,t){var i,u=r(r({},n),((i={})[e]=t,i));o(u)}),[n]);return a.default.createElement(s.Provider,{value:{data:n,setData:i}},e.children)}},141:function(e,t,n){var r=this&&this.__assign||function(){return(r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},o=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),u=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.SectionsContextProvider=t.SectionsContext=void 0;var a=u(n(297)),s=(0,a.createContext)({data:{},setData:function(){return null}});t.SectionsContext=s,t.SectionsContextProvider=function(e){var t=(0,a.useState)({}),n=t[0],o=t[1],i=(0,a.useRef)(n);return a.default.createElement(s.Provider,{value:{data:n,setData:function(e,t){var n,u=r(r({},i.current),((n={})[e]=t,n));i.current=u,o(u)}}},e.children)}},661:function(e,t,n){var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return o(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.UserContext=t.UserContextProvider=void 0;var u=i(n(297)),a=(0,u.createContext)({user:null,setUser:function(){return null}});t.UserContext=a,t.UserContextProvider=function(e){var t=(0,u.useState)(null),n=t[0],r=t[1];return u.default.createElement(a.Provider,{value:{user:n,setUser:r}},e.children)}},760:function(e,t,n){var r=this&&this.__assign||function(){return(r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},o=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),u=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.VideosContextProvider=t.VideosContext=void 0;var a=u(n(297)),s=(0,a.createContext)({data:{},setData:function(){return null}});t.VideosContext=s,t.VideosContextProvider=function(e){var t=(0,a.useState)({}),n=t[0],o=t[1],i=(0,a.useRef)(n);return a.default.createElement(s.Provider,{value:{data:n,setData:function(e,t){var n,u=r(r({},i.current),((n={})[e]=t,n));i.current=u,o(u)}}},e.children)}},925:function(e,t,n){var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),o(n(448),t),o(n(571),t),o(n(860),t),o(n(853),t),o(n(141),t),o(n(661),t),o(n(760),t),o(n(988),t)},766:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.ChannelsContext=t.SectionsContext=t.VideosContext=t.useChannelsInWidget=t.useSectionsInChannel=t.useVideosInSection=t.useVideo=t.useSection=t.useIsLoaded=t.useChannel=t.useWidget=void 0;var r=n(297),o=n(920),i=n(782),u=n(925);Object.defineProperty(t,"ChannelsContext",{enumerable:!0,get:function(){return u.ChannelsContext}}),Object.defineProperty(t,"SectionsContext",{enumerable:!0,get:function(){return u.SectionsContext}}),Object.defineProperty(t,"VideosContext",{enumerable:!0,get:function(){return u.VideosContext}});var a=(0,i.createLogger)({isConsoleEnabled:!0,isSentryEnabled:!1});t.useWidget=function(e){var t=(0,o.useTivioData)().subscriptions,n=(0,r.useState)(""),i=n[0],u=n[1],a=(0,r.useState)(null),s=a[0],c=a[1],l=(0,r.useRef)(void 0);return(0,r.useEffect)((function(){return t&&t.subscribeToWidget(e,(function(e,t,n){var r,o,i;e&&u(e.message),t&&(null===(r=t.lastVideo)||void 0===r||r.transaction,null===(o=t.lastVideo)||void 0===o||o.subscriptions,null===(i=t.lastVideo)||void 0===i||i.monetizations,c(t)),n&&(l.current=n)})),function(){var e;null===(e=l.current)||void 0===e||e.call(l)}}),[t]),{error:i,widget:s}},t.useChannel=function(e){var t=(0,o.useTivioData)().subscriptions,n=(0,r.useState)(null),i=n[0],u=n[1],s=(0,r.useState)(null),c=s[0],l=s[1];return(0,r.useEffect)((function(){t&&(a.info("subscribe to channel with id "+e),t.subscribeToChannel(e,(function(e,t){e&&(a.error("failed to subscribe to channel: ",e),u(e.message)),t&&(a.error("channel data received"),l(t))})))}),[t]),{error:i,data:c}},t.useSection=function(e){var t=(0,o.useTivioData)().subscriptions,n=(0,r.useState)(null),i=n[0],u=n[1],s=(0,r.useState)(null),c=s[0],l=s[1];return(0,r.useEffect)((function(){t&&(a.info("subscribe to section with id "+e),t.subscribeToSection(e,(function(e,t){e&&(a.error("failed to subscribe to section: ",e),u(e.message)),t&&(a.info("section data received"),l(t))})))}),[t]),{error:i,data:c}},t.useVideo=function(e){var t=(0,o.useTivioData)().subscriptions,n=(0,r.useState)(null),i=n[0],u=n[1],a=(0,r.useState)(null),s=a[0],c=a[1],l=(0,r.useRef)(void 0);return(0,r.useEffect)((function(){if(e)return t?(t.subscribeToVideo(e,(function(e,t,n){e&&u(e.message),t&&(t.transaction,t.subscriptions,t.monetizations,c({id:t.id,cover:t.cover,assets:t.assets,created:t.created,sectionId:t.sectionId,channelId:t.channelId,duration:t.duration,path:t.path,image:t.image,itemType:t.itemType,isPlayable:t.isPlayable,monetization:t.monetization,transaction:t.transaction,transactionId:t.transactionId,subscriptions:t.subscriptions,subscriptionIds:t.subscriptionIds,monetizations:t.monetizations,isPlaylist:t.isPlaylist,name:t.name,description:t.description,price:t.price,uri:t.uri,url:t.url})),l.current=n})),function(){var e;null===(e=l.current)||void 0===e||e.call(l)}):void 0;u("not-found")}),[t,e]),{error:i,data:s}},t.useVideosInSection=function(e,t){void 0===t&&(t=10);var n=(0,o.useTivioData)().subscriptions,i=(0,r.useContext)(u.VideosContext),s=i.data[null!=e?e:""];return(0,r.useEffect)((function(){n&&e&&(s||(a.info("subscribe to videos in section "+e),n.subscribeToVideosInSection(e,(function(t,n,r,o){t&&(a.error("failed to subscribe to videos in section: ",t),i.setData(e,{error:t,data:null,isLoading:o})),n&&(a.info("videos data received"),n.videos.forEach((function(e){return e.monetization})),n.videos.forEach((function(e){return e.subscriptions.map((function(e){return e.price}))})),n.videos.forEach((function(e){var t;return null===(t=e.transaction)||void 0===t?void 0:t.price})),i.setData(e,{data:{items:n.videos,hasNextPage:n.hasNextPage,fetchMore:function(){return null==r?void 0:r()}},error:t,isLoading:o}))}),t)))}),[n,e,i]),{error:s?s.error:null,data:s?s.data:null,isLoading:!!s&&s.isLoading}},t.useSectionsInChannel=function(e,t){void 0===t&&(t=10);var n=(0,o.useTivioData)().subscriptions,i=(0,r.useContext)(u.SectionsContext),s=i.data[e];return(0,r.useEffect)((function(){n&&(s||(a.info("subscribe to sections in channel with id "+e),n.subscribeToSectionsInChannel(e,(function(t,n,r,o){t&&(a.error("failed to subscribe to sections in channel: ",t),i.setData(e,{error:t,data:null,isLoading:o})),n&&(a.info("sections data received"),i.setData(e,{error:t,data:{items:n.sections,hasNextPage:n.hasNextPage,fetchMore:function(){return null==r?void 0:r()}},isLoading:o}))}),t)))}),[n]),{error:s?s.error:null,data:s?s.data:null,isLoading:!!s&&s.isLoading}},t.useChannelsInWidget=function(e,t){void 0===t&&(t=10);var n=(0,o.useTivioData)().subscriptions,i=(0,r.useContext)(u.ChannelsContext),s=i.data[e];return(0,r.useEffect)((function(){n&&(s||(a.info("subscribe to channels in widget with id: "+e),n.subscribeToChannelsInWidget(e,(function(t,n,r,o){t&&(a.error("failed to subscribe to channels in widget: ",t),i.setData(e,{error:t,data:null,isLoading:o})),n&&(a.info("channels data received"),i.setData(e,{error:t,data:{items:n.channels,hasNextPage:n.hasNextPage,fetchMore:function(){return null==r?void 0:r()}},isLoading:o}))}),t)))}),[n]),{error:s?s.error:null,data:s?s.data:null,isLoading:!!s&&s.isLoading}},t.useIsLoaded=function(){var e=(0,r.useState)(!1),t=e[0],n=e[1],i=(0,o.useTivioData)();return(0,r.useEffect)((function(){i.getters&&i.getters.isTivioLoaded(n)}),[i]),{isTivioLoaded:t}}},682:function(e,t,n){var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),o(n(883),t),o(n(596),t),o(n(469),t),o(n(639),t),o(n(802),t),o(n(350),t),o(n(766),t),o(n(862),t),o(n(311),t),o(n(197),t),o(n(419),t),o(n(814),t)},862:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.useExportedConfig=t.useAdSegment=t.useStartMarker=t.useSeekState=t.useCurrentMarker=t.useAd=t.useIntro=t.useBetOffer=t.useMarkers=t.usePlayerEvent=void 0;var r=n(297),o=n(585),i=n(602);t.usePlayerEvent=function(e){var t=(0,r.useContext)(o.PlayerContext);if(void 0===t)throw new Error("usePlayerEvent must be inside PlayerContext");var n=(0,r.useState)(null),i=n[0],u=n[1];return(0,r.useEffect)((function(){if(null==t?void 0:t.events)return t.events.addListener(e,u),function(){return t.events.removeListener(e,u)}}),[null==t?void 0:t.events]),i},t.useMarkers=function(){var e=(0,r.useContext)(o.PlayerContext);if(void 0===e)throw new Error("useMarkers must be inside PlayerContext");var t=(0,r.useState)(null),n=t[0],i=t[1];return(0,r.useEffect)((function(){if(null==e?void 0:e.events)return e.events.addListener("markers",i),function(){return e.events.removeListener("markers",i)}}),[null==e?void 0:e.events]),n},t.useBetOffer=function(){var e=(0,r.useContext)(o.PlayerContext);if(void 0===e)throw new Error("useBetOffer must be inside PlayerContext");var t=(0,r.useState)(null),n=t[0],i=t[1];return(0,r.useEffect)((function(){if(null==e?void 0:e.events)return e.events.addListener("bet-offer",i),function(){return e.events.removeListener("bet-offer",i)}}),[null==e?void 0:e.events]),n},t.useIntro=function(){var e=(0,r.useContext)(o.PlayerContext);if(void 0===e)throw new Error("useIntro must be inside PlayerContext");var t=(0,r.useState)(null),n=t[0],i=t[1];return(0,r.useEffect)((function(){if(null==e?void 0:e.events)return e.events.addListener("intro",i),function(){return e.events.removeListener("intro",i)}}),[null==e?void 0:e.events]),n},t.useAd=function(){var e=(0,r.useContext)(o.PlayerContext);if(void 0===e)throw new Error("useAd must be inside PlayerContext");var t=(0,r.useState)(null),n=t[0],i=t[1],u=function(){var e=(0,r.useRef)(0),t=(0,r.useState)(null),n=(t[0],t[1]);return(0,r.useCallback)((function(){e.current++,n(e.current)}),[])}();return(0,r.useEffect)((function(){if(null==e?void 0:e.events){e.events.addListener("ad",i);var t="ad-rerender",n="ad-seconds-to-skippable-changed";return e.events.isSupported(t)&&e.events.addListener(t,u),e.events.isSupported(n)&&e.events.addListener(n,u),function(){e.events.removeListener("ad",i),e.events.isSupported(t)&&e.events.removeListener(t,u),e.events.isSupported(n)&&e.events.addListener(n,u)}}}),[null==e?void 0:e.events]),n},t.useCurrentMarker=function(){var e=(0,r.useContext)(o.PlayerContext);if(void 0===e)throw new Error("useCurrentMarker must be inside PlayerContext");var t=(0,r.useState)(null),n=t[0],i=t[1];return(0,r.useEffect)((function(){if(null==e?void 0:e.events)return e.events.addListener("current-marker",i),function(){return e.events.removeListener("current-marker",i)}}),[null==e?void 0:e.events]),n},t.useSeekState=function(){var e=(0,r.useContext)(o.PlayerContext);if(void 0===e)throw new Error("useSeekState must be inside PlayerContext");var t=(0,r.useState)(null),n=t[0],i=t[1];return(0,r.useEffect)((function(){if(null==e?void 0:e.events){var t=function(){return i(!1)},n=function(){return i(!0)};return e.events.addListener("disable-seek",t),e.events.addListener("enable-seek",n),function(){e.events.removeListener("disable-seek",t),e.events.removeListener("enable-seek",n)}}}),[null==e?void 0:e.events]),n},t.useStartMarker=function(){var e=(0,r.useContext)(o.PlayerContext);if(void 0===e)throw new Error("useStartMarker must be inside PlayerContext");var t=(0,r.useState)(null),n=t[0],i=t[1];return(0,r.useEffect)((function(){if(null==e?void 0:e.events)return e.events.addListener("start-marker",i),function(){return e.events.removeListener("start-marker",i)}}),[null==e?void 0:e.events]),n},t.useAdSegment=function(){var e=(0,r.useContext)(o.PlayerContext);if(void 0===e)throw new Error("useAdSegmentMarker must be inside PlayerContext");var t=(0,r.useState)(null),n=t[0],i=t[1];return(0,r.useEffect)((function(){if(null==e?void 0:e.events)return e.events.addListener("ad-segment-changed",i),function(){return e.events.removeListener("ad-segment-changed",i)}}),[null==e?void 0:e.events]),n},t.useExportedConfig=function(){var e,t=(0,i.useTivioData)(),n=(0,r.useState)(null),o=n[0],u=n[1],a=null===(e=null==t?void 0:t.getters)||void 0===e?void 0:e.getExportedConfig;return(0,r.useEffect)((function(){null==a||a().then(u)}),[a]),o}},201:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.useError=void 0;var r=n(297);t.useError=function(){var e=(0,r.useState)(null),t=e[0],n=e[1];return{error:t,raiseError:function(e){n(e)},resetError:function(){return n(null)}}}},419:function(e,t,n){var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function u(e){try{s(r.next(e))}catch(e){i(e)}}function a(e){try{s(r.throw(e))}catch(e){i(e)}}function s(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(u,a)}s((r=r.apply(e,t||[])).next())}))},o=this&&this.__generator||function(e,t){var n,r,o,i,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;u;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return u.label++,{value:i[1],done:!1};case 5:u.label++,r=i[1],i=[0];continue;case 7:i=u.ops.pop(),u.trys.pop();continue;default:if(!((o=(o=u.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){u=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){u.label=i[1];break}if(6===i[0]&&u.label<o[1]){u.label=o[1],o=i;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(i);break}o[2]&&u.ops.pop(),u.trys.pop();continue}i=t.call(e,u)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.useFreePurchase=void 0;var i=n(602);t.useFreePurchase=function(){var e=(0,i.useTivioData)().auth;return{purchase:function(t){return r(void 0,void 0,void 0,(function(){return o(this,(function(n){switch(n.label){case 0:return e?[4,e.createFreePurchase(t)]:[3,2];case 1:n.sent(),n.label=2;case 2:return[2]}}))}))}}}},639:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.useItemsInRow=void 0;var r=n(297),o=n(602),i=n(201);t.useItemsInRow=function(e,t){void 0===t&&(t={noLimit:!1,limit:3});var n=(0,o.useTivioData)().subscriptions,u=(0,r.useState)(null),a=u[0],s=u[1],c=(0,i.useError)(),l=c.error,f=c.raiseError,d=(0,r.useRef)();return(0,r.useEffect)((function(){return n&&(d.current=n.subscribeToItemsInRow(e,(function(e,t){e&&f(e),t&&s({items:t.items,fetchMore:t.fetchMore})}),t)),function(){var e;null===(e=d.current)||void 0===e||e.call(d)}}),[n]),{pagination:a,error:l}}},311:function(e,t,n){var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function u(e){try{s(r.next(e))}catch(e){i(e)}}function a(e){try{s(r.throw(e))}catch(e){i(e)}}function s(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(u,a)}s((r=r.apply(e,t||[])).next())}))},o=this&&this.__generator||function(e,t){var n,r,o,i,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;u;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return u.label++,{value:i[1],done:!1};case 5:u.label++,r=i[1],i=[0];continue;case 7:i=u.ops.pop(),u.trys.pop();continue;default:if(!((o=(o=u.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){u=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){u.label=i[1];break}if(6===i[0]&&u.label<o[1]){u.label=o[1],o=i;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(i);break}o[2]&&u.ops.pop(),u.trys.pop();continue}i=t.call(e,u)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.useOrganizationSubscriptions=void 0;var i=n(297),u=n(571),a=n(602),s=n(766);t.useOrganizationSubscriptions=function(){var e=(0,i.useContext)(u.OrganizationSubscriptionsContext),t=e.setSubscriptions,n=e.subscriptions,c=(0,a.useTivioData)().getters,l=(0,s.useIsLoaded)().isTivioLoaded;return(0,i.useEffect)((function(){r(void 0,void 0,void 0,(function(){var e;return o(this,(function(r){switch(r.label){case 0:return c&&l&&0===n.length?[4,c.getOrganizationSubscriptions()]:[3,2];case 1:(e=r.sent())&&t(e),r.label=2;case 2:return[2]}}))}))}),[l]),{subscriptions:n}}},350:function(e,t,n){var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function u(e){try{s(r.next(e))}catch(e){i(e)}}function a(e){try{s(r.throw(e))}catch(e){i(e)}}function s(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(u,a)}s((r=r.apply(e,t||[])).next())}))},o=this&&this.__generator||function(e,t){var n,r,o,i,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;u;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return u.label++,{value:i[1],done:!1};case 5:u.label++,r=i[1],i=[0];continue;case 7:i=u.ops.pop(),u.trys.pop();continue;default:if(!((o=(o=u.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){u=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){u.label=i[1];break}if(6===i[0]&&u.label<o[1]){u.label=o[1],o=i;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(i);break}o[2]&&u.ops.pop(),u.trys.pop();continue}i=t.call(e,u)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.usePurchaseSubscription=void 0;var i=n(297),u=n(602),a=n(883);t.usePurchaseSubscription=function(e){var t=(0,i.useState)(null),n=t[0],s=t[1],c=(0,i.useState)(""),l=c[0],f=c[1],d=(0,u.useTivioData)().purchaseSubscriptionWithQerko,v=(0,a.useUser)().user,p=(0,i.useCallback)((function(){return r(void 0,void 0,void 0,(function(){var t,n;return o(this,(function(r){switch(r.label){case 0:if(f(""),!d)throw new Error("purchaseVideoWithQerko not in bundle");r.label=1;case 1:return r.trys.push([1,3,,4]),[4,d(e)];case 2:return t=r.sent(),s(t),[3,4];case 3:return(n=r.sent())instanceof Error&&f(n.message),[3,4];case 4:return[2]}}))}))}),[d]),b=(0,i.useMemo)((function(){if(!v)return"NEW";var t=v.purchases.find((function(t){return t.monetizationId===e}));return t?t.status:"NEW"}),[v]);return(0,i.useEffect)((function(){p()}),[p]),{paymentError:l,paymentInfo:n,paymentStatus:b,getPaymentInfo:p}}},197:function(e,t,n){var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function u(e){try{s(r.next(e))}catch(e){i(e)}}function a(e){try{s(r.throw(e))}catch(e){i(e)}}function s(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(u,a)}s((r=r.apply(e,t||[])).next())}))},o=this&&this.__generator||function(e,t){var n,r,o,i,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;u;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return u.label++,{value:i[1],done:!1};case 5:u.label++,r=i[1],i=[0];continue;case 7:i=u.ops.pop(),u.trys.pop();continue;default:if(!((o=(o=u.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){u=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){u.label=i[1];break}if(6===i[0]&&u.label<o[1]){u.label=o[1],o=i;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(i);break}o[2]&&u.ops.pop(),u.trys.pop();continue}i=t.call(e,u)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.usePurchasesWithVideos=void 0;var i=n(297),u=n(860),a=n(602),s=n(883);t.usePurchasesWithVideos=function(){var e=(0,s.useUser)().user,t=(0,a.useTivioData)().auth,n=(0,i.useContext)(u.PurchasesWithVideosContext),c=n.purchases,l=n.setPurchases;return(0,i.useEffect)((function(){r(void 0,void 0,void 0,(function(){var n;return o(this,(function(r){switch(r.label){case 0:return t?e&&e.purchasedVods.length!==c.length?(n=l,[4,t.getPurchasedVodsWithInitializedVideos()]):[3,2]:[2];case 1:n.apply(void 0,[r.sent()]),r.label=2;case 2:return[2]}}))}))}),[e,t]),{purchases:c}}},814:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.useRowsInScreen=void 0;var r=n(297),o=n(602),i=n(201);t.useRowsInScreen=function(e,t){void 0===t&&(t={noLimit:!1,limit:3});var n=(0,o.useTivioData)().subscriptions,u=(0,r.useState)(null),a=u[0],s=u[1],c=(0,i.useError)(),l=c.error,f=c.raiseError,d=(0,r.useRef)();return(0,r.useEffect)((function(){return n&&(d.current=n.subscribeToRowsInScreen(e,(function(e,t){e&&f(e),t&&s({fetchMore:t.fetchMore,items:t.items})}),t)),function(){var e;null===(e=d.current)||void 0===e||e.call(d)}}),[n]),{pagination:a,error:l}}},469:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.useScreen=void 0;var r=n(965),o=n(297),i=n(925),u=n(602);t.useScreen=function(e,t){var n,a,s,c=(0,u.useTivioData)().subscriptions,l=(0,o.useContext)(i.ScreensContext),f=null==l?void 0:l.data[e],d=(0,o.useRef)(null);return(0,o.useEffect)((function(){return c&&l&&null==d.current&&(d.current=null==c?void 0:c.subscribeToScreen(e,(function(t,n){var o;t&&l.setData(e,{error:t,data:null,isLoading:!1}),n&&l.setData(e,{error:t,data:{id:n.screenId,name:n.name,description:n.description,assets:(0,r.toJS)(n.assets),rows:(null!==(o=n.rows)&&void 0!==o?o:[]).map((function(e){return{id:e.rowId,name:e.name,rowId:e.rowId,description:e.description,assets:(0,r.toJS)(e.assets),itemComponent:e.itemComponent,rowComponent:e.rowComponent}}))},isLoading:!1})}),t)),function(){var e;null===(e=d.current)||void 0===e||e.call(d)}}),[c]),{error:null!==(n=null==f?void 0:f.error)&&void 0!==n?n:null,data:null!==(a=null==f?void 0:f.data)&&void 0!==a?a:null,isLoading:null===(s=null==f?void 0:f.isLoading)||void 0===s||s}}},596:function(e,t,n){var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function u(e){try{s(r.next(e))}catch(e){i(e)}}function a(e){try{s(r.throw(e))}catch(e){i(e)}}function s(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(u,a)}s((r=r.apply(e,t||[])).next())}))},o=this&&this.__generator||function(e,t){var n,r,o,i,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;u;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return u.label++,{value:i[1],done:!1};case 5:u.label++,r=i[1],i=[0];continue;case 7:i=u.ops.pop(),u.trys.pop();continue;default:if(!((o=(o=u.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){u=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){u.label=i[1];break}if(6===i[0]&&u.label<o[1]){u.label=o[1],o=i;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(i);break}o[2]&&u.ops.pop(),u.trys.pop();continue}i=t.call(e,u)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.useScreens=void 0;var i=n(297),u=n(602);t.useScreens=function(){var e=(0,u.useTivioData)().getters,t=(0,i.useState)([]),n=t[0],a=t[1];return(0,i.useEffect)((function(){e&&r(void 0,void 0,void 0,(function(){var t;return o(this,(function(n){switch(n.label){case 0:return[4,e.getOrganizationScreens()];case 1:return t=n.sent(),a(t),[2]}}))}))}),[e]),{screens:n}}},802:function(e,t,n){var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function u(e){try{s(r.next(e))}catch(e){i(e)}}function a(e){try{s(r.throw(e))}catch(e){i(e)}}function s(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(u,a)}s((r=r.apply(e,t||[])).next())}))},o=this&&this.__generator||function(e,t){var n,r,o,i,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;u;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return u.label++,{value:i[1],done:!1};case 5:u.label++,r=i[1],i=[0];continue;case 7:i=u.ops.pop(),u.trys.pop();continue;default:if(!((o=(o=u.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){u=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){u.label=i[1];break}if(6===i[0]&&u.label<o[1]){u.label=o[1],o=i;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(i);break}o[2]&&u.ops.pop(),u.trys.pop();continue}i=t.call(e,u)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.useTransactionPayment=void 0;var i=n(823),u=n(297),a=n(920),s=n(602);t.useTransactionPayment=function(e,t){var n=(0,u.useState)(null),c=n[0],l=n[1],f=(0,u.useState)(""),d=f[0],v=f[1],p=(0,s.useTivioData)().purchaseVideoWithQerko,b=(0,a.useUser)().user,h=(0,u.useCallback)((function(){return r(void 0,void 0,void 0,(function(){var n,r;return o(this,(function(o){switch(o.label){case 0:if(v(""),!p)throw new Error("purchaseVideoWithQerko not in bundle");o.label=1;case 1:return o.trys.push([1,3,,4]),[4,p(e,t)];case 2:return n=o.sent(),l(n),[3,4];case 3:return r=o.sent(),v(r.message),[3,4];case 4:return[2]}}))}))}),[p]);(0,u.useEffect)((function(){h()}),[]);var y=(0,i.useObserver)((function(){if(c&&b){var n=b.purchases.find((function(n){return n.monetizationId===t&&n.videoId===e}));if(n)return n.status}return"new"}));return{paymentInfo:c,paymentError:d,paymentStatus:y,getPaymentInfo:h}}},883:function(e,t,n){var r=this&&this.__assign||function(){return(r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.useUser=void 0;var o=n(297),i=n(782),u=n(661),a=n(602),s=(0,i.createLogger)({isConsoleEnabled:!0,isSentryEnabled:!1});t.useUser=function(){var e=(0,o.useContext)(u.UserContext),t=e.user,n=e.setUser,i=(0,a.useTivioData)().subscriptions,c=(0,o.useState)(null),l=c[0],f=c[1];return(0,o.useEffect)((function(){i&&!t&&i.subscribeToUser((function(e,t){e&&(s.error(e),f(e)),t&&n(r({},t))}))}),[i]),{user:t,error:l}}},958:function(e,t,n){var r=this&&this.__assign||function(){return(r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.createInternalConf=t.defaultConf=void 0;var o=n(57),i=n(868),u=n(782),a=n(373),s=n(675);t.defaultConf={secret:null,resolverUrl:"https://tivio-resolver-production.tiv.io/serveBundle/resolver2.js",disableUnmounting:!1,fetchPackage:a.fetchPackage,pubSub:(0,s.getPubSub)(),LoaderComponent:i.TivioWidgetLoader,ErrorComponent:o.TivioWidgetError},t.createInternalConf=function(e){return r(r(r(r({},t.defaultConf),null!=e?e:{}),null==(null==e?void 0:e.secret)?{enable:!1}:{}),{logger:void 0!==(null==e?void 0:e.logger)?e.logger:(0,u.createLogger)({isConsoleEnabled:!0}),sdkVersion:"2.2.1"})}},393:function(e,t){Object.defineProperty(t,"__esModule",{value:!0})},920:function(e,t,n){var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),t.bundlePromise=t.withPlayerContext=t.PlayerProvider=void 0;var i=n(585);Object.defineProperty(t,"PlayerProvider",{enumerable:!0,get:function(){return i.PlayerProvider}}),Object.defineProperty(t,"withPlayerContext",{enumerable:!0,get:function(){return i.withPlayerContext}});var u=n(517);Object.defineProperty(t,"bundlePromise",{enumerable:!0,get:function(){return u.bundlePromise}}),o(n(682),t),o(n(602),t),o(n(411),t),o(n(57),t),o(n(868),t),o(n(393),t),o(n(643),t),o(n(675),t),o(n(173),t)},643:function(e,t,n){var r=this&&this.__assign||function(){return(r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},o=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function u(e){try{s(r.next(e))}catch(e){i(e)}}function a(e){try{s(r.throw(e))}catch(e){i(e)}}function s(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(u,a)}s((r=r.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var n,r,o,i,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;u;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return u.label++,{value:i[1],done:!1};case 5:u.label++,r=i[1],i=[0];continue;case 7:i=u.ops.pop(),u.trys.pop();continue;default:if(!((o=(o=u.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){u=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){u.label=i[1];break}if(6===i[0]&&u.label<o[1]){u.label=o[1],o=i;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(i);break}o[2]&&u.ops.pop(),u.trys.pop();continue}i=t.call(e,u)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.createUseRemoteBundle=t.createRemotePackageLoader=t.fetchBundle=void 0;var u=n(297),a=n(229),s=n(614),c=function(e){var t=e.resolverUrl;return(0,e.fetchPackage)(t)},l=function(e,t){return o(void 0,void 0,void 0,(function(){return i(this,(function(n){switch(n.label){case 0:return t.bundleUrlOverride?(console.info("@tivio: Fetching bundle directly based on config.bundleUrlOverride",t.bundleUrlOverride),[4,fetch(t.bundleUrlOverride)]):[3,3];case 1:return[4,n.sent().text()];case 2:return[2,n.sent()];case 3:return[2,c(t).then((function(n){var r,o={},i={exports:o};try{new Function("require","module","exports",n)(a.resolveShared,i,o)}catch(e){return Promise.reject("Cannot load Tivio Resolver "+e)}return"function"!=typeof(null===(r=i.exports.tivio)||void 0===r?void 0:r.fetch)?Promise.reject("Invalid Tivio Resolver export"):i.exports.tivio.fetch(e,t.sdkVersion)}))]}}))}))};t.fetchBundle=l;var f=function(){return function(e,t){return o(void 0,void 0,void 0,(function(){return i(this,(function(n){return[2,l(e,t).then((function(e){var t={},n={exports:t};try{new Function("require","module","exports",e)(a.resolveShared,n,t)}catch(e){return Promise.reject("Cannot load module "+e)}return"object"!=typeof n.exports.Tivio?Promise.reject('Tivio package does not export "Tivio" namespace'):"object"!=typeof n.exports.Tivio.components?Promise.reject('Tivio namespace does not export "components" member'):"function"!=typeof n.exports.Tivio.setUser?Promise.reject('Tivio namespace does not export "setUser" member'):"function"!=typeof n.exports.Tivio.init?Promise.reject('Tivio namespace does not export "init" member'):n.exports.Tivio}))]}))}))}};t.createRemotePackageLoader=f,t.createUseRemoteBundle=function(){var e=f(),t=!1;return function(n){var a=(0,s.createSettings)(n),c=(0,u.useState)({auth:null,components:null,conf:n,error:null,getters:null,init:null,purchaseSubscriptionWithQerko:null,purchaseVideoWithQerko:null,setLanguage:null,settings:a,setUser:null,sources:null,hooks:null,state:"loading",subscriptions:null}),l=c[0],f=c[1];return(0,u.useEffect)((function(){null!=n.secret&&!1!==n.enable&&e(n.secret,n).then((function(e){return o(void 0,void 0,void 0,(function(){var r;return i(this,(function(o){switch(o.label){case 0:return t?[3,2]:[4,e.init(n)];case 1:o.sent(),t=!0,o.label=2;case 2:return a.onSetUser(e.setUser),r={auth:e.auth,components:e.components,conf:n,error:null,getters:e.getters,init:e.init,purchaseSubscriptionWithQerko:e.purchaseSubscriptionWithQerko,purchaseVideoWithQerko:e.purchaseVideoWithQerko,setLanguage:e.setLanguage,settings:a,setUser:e.setUser,sources:e.sources,hooks:e.hooks,state:"ready",subscriptions:e.subscriptions},f(r),n.pubSub.publish("on-ready",r),[2]}}))}))})).catch((function(e){var t;null===(t=n.logger)||void 0===t||t.exception(e),f(r(r({},l),{conf:n,error:""+e,settings:a,state:"error"})),n.pubSub.publish("on-error",e)}))}),[]),l}}},517:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.bundlePromise=void 0;var r=n(675);t.bundlePromise=new Promise((function(e,t){(0,r.getPubSub)().subscribe("on-ready",(function(t){e(t)})),(0,r.getPubSub)().subscribe("on-error",(function(e){t(e)}))})).catch((function(e){throw console.error("@tivio/sdk-react failed to load. Reason:",e),e})).then((function(e){return console.info("@tivio/sdk-react loaded successfully."),e}))},229:function(e,t,n){var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return o(t,e),t},u=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.resolveShared=void 0;var a=u(n(421));n(942),n(714);var s=i(n(965)),c=i(n(823)),l=i(n(297)),f=i(n(268)),d=i(n(914)),v={mobx:s,"mobx-react":c,firebase:a.default,"firebase/app":a.default,"firebase/auth":null,"firebase/firestore":null,react:l,React:l,"react-dom":f,"styled-components":d};t.resolveShared=function(e){if(!(e in v))throw new Error("Could not resolve shared dependency "+e);return v[e]}},782:function(e,t,n){var r=this&&this.__spreadArray||function(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))};Object.defineProperty(t,"__esModule",{value:!0}),t.createLogger=void 0;var o=n(256);t.createLogger=function(e){var t=!1!==e.isSentryEnabled,n=function(n,i){e.isConsoleEnabled&&console[n].apply(console,r(["Tivio SDK "],i,!1)),t&&(null===o.Sentry||void 0===o.Sentry||o.Sentry.captureMessage(""+i,o.Sentry.Severity.fromString(n)))};return{error:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];n("error",e)},info:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];n("info",e)},warn:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];n("warn",e)},debug:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];n("debug",e)},exception:function(n){e.isConsoleEnabled&&console.error(n),t&&(null===o.Sentry||void 0===o.Sentry||o.Sentry.captureException(n))}}}},373:function(e,t){var n=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function u(e){try{s(r.next(e))}catch(e){i(e)}}function a(e){try{s(r.throw(e))}catch(e){i(e)}}function s(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(u,a)}s((r=r.apply(e,t||[])).next())}))},r=this&&this.__generator||function(e,t){var n,r,o,i,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;u;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return u.label++,{value:i[1],done:!1};case 5:u.label++,r=i[1],i=[0];continue;case 7:i=u.ops.pop(),u.trys.pop();continue;default:if(!((o=(o=u.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){u=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){u.label=i[1];break}if(6===i[0]&&u.label<o[1]){u.label=o[1],o=i;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(i);break}o[2]&&u.ops.pop(),u.trys.pop();continue}i=t.call(e,u)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.fetchPackage=void 0;var o={cache:"no-store"},i=function(e){var t=e.headers.get("content-type");return 200!==e.status?Promise.reject('Incorrect status "'+e.status+'" was obtained while fetching the module.'):t&&(t.includes("application/javascript")||t.includes("text/javascript"))?e.text():Promise.reject('Incorrect content "'+t+'" was obtained while fetching the module.')},u=function(e){return Promise.reject("Network failure: "+e)};t.fetchPackage=function(e){return n(void 0,void 0,void 0,(function(){return r(this,(function(t){return[2,fetch(e,o).then(i).catch(u)]}))}))}},675:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.getPubSub=t.createPubSub=void 0,t.createPubSub=function(){var e=new Map;return{publish:function(t,n){var r;null===(r=e.get(t))||void 0===r||r.forEach((function(e){(0,e.onMessage)(n)}))},subscribe:function(t,n){var r=(new Date).getTime();return e.has(t)||e.set(t,[]),e.get(t).push({id:r,onMessage:n}),function(){var n,o=null!==(n=e.get(t))&&void 0!==n?n:[],i=o.findIndex((function(e){return e.id===r}));-1!==i&&o.splice(i,1)}}}};var n=null;t.getPubSub=function(){return null===n&&(n=(0,t.createPubSub)()),n}},256:function(e,t,n){var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return o(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.initSentry=t.disableSentry=t.Sentry=void 0;var u=i(n(736)),a="true"===process.env.DISABLE_SENTRY;t.Sentry=a?null:u,t.disableSentry=function(){t.Sentry=null,console.info("@tivio: Sentry disabled")},t.initSentry=function(){t.Sentry&&(t.Sentry.init({dsn:"https://8b9d489695004b0da95481f939b0455d@o507550.ingest.sentry.io/5600271",release:"@tivio/sdk-react@2.2.1",tracesSampleRate:1}),console.info("@tivio: Sentry enabled"),s())};var s=function(){window.sentry=t.Sentry,console.info("@tivio: Sentry added to window")}},614:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.createSettings=void 0,t.createSettings=function(e){var t=null,n=null;return{onSetUser:function(r){var o;"function"!=typeof r?null===(o=e.logger)||void 0===o||o.exception("Tivio Bundle setUser handler must be a function"):(t=r,null!==n&&r(n.userId,n.userPayload))},setUser:function(e,r){"function"==typeof t?(n=null,t(e,r)):n={userId:e,userPayload:r}}}}},173:function(e,t){Object.defineProperty(t,"__esModule",{value:!0})},736:function(e){e.exports=t},421:function(e){e.exports=n},942:function(e){e.exports=r},714:function(e){e.exports=o},965:function(e){e.exports=i},297:function(t){t.exports=e},268:function(e){e.exports=u},914:function(e){e.exports=a}},c={};function l(e){var t=c[e];if(void 0!==t)return t.exports;var n=c[e]={exports:{}};return s[e].call(n.exports,n,n.exports,l),n.exports}return l.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return l.d(t,{a:t}),t},l.d=function(e,t){for(var n in t)l.o(t,n)&&!l.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},l.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},l.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},l(920)}()}));
|
@@ -2,7 +2,3 @@ import * as _Sentry from '@sentry/browser';
|
|
2
2
|
export declare let Sentry: null | typeof _Sentry;
|
3
3
|
export declare const disableSentry: () => void;
|
4
4
|
export declare const initSentry: () => void;
|
5
|
-
/**
|
6
|
-
* Inject Sentry to window in order to use it inside core-js, core-react, etc.
|
7
|
-
*/
|
8
|
-
export declare const injectSentryToWindow: () => void;
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@tivio/sdk-react",
|
3
|
-
"version": "2.2.
|
3
|
+
"version": "2.2.1",
|
4
4
|
"main": "dist/index.js",
|
5
5
|
"typings": "dist/index.d.ts",
|
6
6
|
"source": "src/index.ts",
|
@@ -15,6 +15,7 @@
|
|
15
15
|
"test": "jest --config=./jest.config.js --coverage",
|
16
16
|
"clean": "rm -rf dist",
|
17
17
|
"prepublishOnly": "yarn && yarn ts-node ./scripts/prepublish.ts && yarn run build",
|
18
|
+
"postpublish": "yarn ts-node ./scripts/postpublish.ts",
|
18
19
|
"publish:alpha": "npm publish --tag alpha"
|
19
20
|
},
|
20
21
|
"peerDependencies": {
|
@@ -23,7 +24,7 @@
|
|
23
24
|
},
|
24
25
|
"dependencies": {
|
25
26
|
"@sentry/browser": "^6.1.0",
|
26
|
-
"@tivio/common": "1.1.
|
27
|
+
"@tivio/common": "1.1.26",
|
27
28
|
"firebase": "^8.2.3",
|
28
29
|
"mobx": "^6.0.4",
|
29
30
|
"mobx-react": "^7.1.0",
|
@@ -0,0 +1,10 @@
|
|
1
|
+
import {
|
2
|
+
execCommand,
|
3
|
+
} from '@tivio/build-utils'
|
4
|
+
|
5
|
+
console.info('Reverting version of @tivio/common dependency in package.json to *...')
|
6
|
+
|
7
|
+
// Using sed instead of fs.write because it does not change the order
|
8
|
+
// of the other line
|
9
|
+
// eslint-disable-next-line no-useless-escape
|
10
|
+
execCommand('sed -i \'s#"@tivio/common":.*#"@tivio/common": "*",#g\' package.json')
|