{"version":3,"file":"refapp-video.umd.js","sources":["../../src/components/base/prop-definitions.js","../../../shared/eventsTracking.js","../../src/lib/tagging/mixin.js","../../src/components/base/provider.vue","../../src/components/base/video.vue","../../src/components/base/content.vue","../../src/components/base/controls.vue","../../src/components/refapp-video.vue","../../src/widget.js"],"sourcesContent":["export const tagging = {\n taggingId: {\n type: String,\n required: true,\n },\n};\n\nexport const content = {\n headingLevel: {\n type: Number,\n default: 3,\n },\n heading: {\n type: String,\n required: false,\n default: null,\n },\n text: {\n type: String,\n required: false,\n default: null,\n },\n ctalink: {\n type: String,\n required: false,\n default: null,\n },\n ctatext: {\n type: String,\n required: false,\n default: null,\n },\n alignment: {\n type: String,\n required: false,\n default: 'center',\n },\n display: {\n type: Object,\n required: false,\n default: () => ({\n headingFont: 'sans',\n contentFont: 'serif',\n }),\n },\n};\n\nexport const video = {\n loop: {\n type: Boolean,\n default: false,\n },\n autoplay: {\n type: Boolean,\n default: false,\n },\n muted: {\n type: Boolean,\n default: true,\n },\n /**\n * Sample source\n * {\n * src: 'assets/video1.mp4',\n * type: 'video/mp4',\n * screenSize: 'sm',\n * }\n * Where screensizes are: sm (360p) | md (720p) | lg (1080p+)\n * NB: at present size entries MUST BE IN ASCENDING ORDER\n */\n sources: {\n required: true,\n validator(value) {\n return (\n Array.isArray(value) &&\n value.every((source) => ['src', 'type', 'screenSize'].every((key) => key in source))\n );\n },\n },\n controls: {\n type: Boolean,\n required: false,\n default: false,\n },\n poster: {\n type: String,\n required: false,\n default: '',\n },\n};\n","export default class EventsTracking {\n /**\n * This class aims to remove code duplication among components by moving most of the tracking\n * logic in one place and exposing generic methods that these components may consume in whatever\n * manner they need.\n * @param {String} taggingId String id used to identify a component and its tracking config\n * @param {Object} componentInstance Execution scope of the component\n * @returns {void}\n */\n constructor(taggingId, componentInstance) {\n const brandLevelTaggingConfig = document.querySelector(\n `[data-brand-level-tagging-id=\"${taggingId}\"]`,\n );\n const instanceTaggingConfig = document.getElementById(taggingId);\n if (!instanceTaggingConfig) return;\n\n const taggingConfiguration = this.tryParseJson(instanceTaggingConfig.textContent.trim());\n let brandLevelTaggingConfiguration = {};\n if (brandLevelTaggingConfig) {\n brandLevelTaggingConfiguration = this.tryParseJson(\n brandLevelTaggingConfig.textContent.trim(),\n );\n }\n\n const trackedEvents = Object.keys(taggingConfiguration);\n\n if (!taggingConfiguration || trackedEvents.length === 0) return;\n\n const taggableComponent = document.querySelector(`[data-refapp-tagging-id=\"${taggingId}\"]`);\n trackedEvents.forEach((event) =>\n this.trackerInit(\n taggableComponent,\n taggingConfiguration[event],\n brandLevelTaggingConfiguration[event],\n event,\n componentInstance[`${event}TrackerOptions`],\n ),\n );\n }\n\n /**\n * The tracker init function assigns event listeners according to the configuration supplied\n * @param {HTMLElement} taggableComponent Element to which the listener is to be added\n * @param {Object} trackerConfig Configuration object for this particular event\n * @param {Object} brandLevelConfig Addon configuration object for the brand level will be merged\n * @param {String} eventName name of the HTML event to attach a listener to\n * @param {Object} handlerOptions HTML event listener options, default values use capture phase\n * and the listener is only executed once\n * @returns {void}\n */\n trackerInit(\n taggableComponent,\n trackerConfig,\n brandLevelConfig,\n eventName,\n handlerOptions = { capture: true, once: true },\n ) {\n if (!taggableComponent) return;\n\n // monitor slider movement events, whichever the user interaction source\n taggableComponent.addEventListener(\n eventName,\n this.handleEvent.bind(this, eventName, trackerConfig, brandLevelConfig),\n handlerOptions,\n );\n }\n\n /**\n * Event handler passed to each of the tracked events\n * @param {String} trackedEvent Name of the tracked event\n * @param {Array} trackerConfig Array of same-type events\n * @param {Array=} brandLevelConfig Array of brand-level properties to merge in the final event\n * @param {Event} e Event instance received by the handler function\n * @returns {void}\n */\n handleEvent(trackedEvent, trackerConfig, brandLevelConfig = [], e) {\n const element = e.target.closest('[data-refapp-tagging-target]');\n if (!element) return;\n\n const taggingTarget = element.dataset?.refappTaggingTarget;\n\n if (!taggingTarget) return;\n const event = trackerConfig.find((c) => c.target === taggingTarget);\n const extras = this.tryParseJson(e.target.dataset?.refappTaggingExtras);\n const brandEvent = brandLevelConfig.find((c) => c.target === taggingTarget);\n\n if (!event) return;\n\n window.dataLayer = [\n ...(window.dataLayer || []),\n {\n ...event.payload,\n ...extras,\n ...(brandEvent ? brandEvent.payload : {}),\n },\n ];\n }\n\n /**\n * Utility function that attempts to parse a JSON string into a JS object\n * @param {String} jsonString String to attempt to parse into a json object\n * @returns {Object}\n */\n tryParseJson = (jsonString) => {\n try {\n return JSON.parse(jsonString);\n } catch (e) {\n return {};\n }\n };\n}\n","import EventsTracking from '../../../../shared/eventsTracking';\n\nexport default {\n mounted() {\n const { taggingId } = this;\n\n this.clickTrackerOptions = { capture: false, once: false };\n this.playbackTrackerOptions = { capture: true, once: true };\n this.tracking = new EventsTracking(taggingId, this);\n },\n};\n","\n\n\n","\n\n\n\n\n","\n\n\n\n\n","\n\n\n\n\n","\n\n\n\n\n\n","import RefappVideoProvider from './components/base/provider.vue';\nimport RefappVideoBase from './components/base/video.vue';\nimport RefappVideo from './components/refapp-video.vue';\n\nexport default {\n install(app) {\n const components = [RefappVideoProvider, RefappVideoBase, RefappVideo];\n components.forEach((c) => app.component(c.name, c));\n },\n};\n"],"names":["value","source","key","EventsTracking","taggingId","componentInstance","__publicField","jsonString","brandLevelTaggingConfig","instanceTaggingConfig","taggingConfiguration","brandLevelTaggingConfiguration","trackedEvents","taggableComponent","event","trackerConfig","brandLevelConfig","eventName","handlerOptions","trackedEvent","e","element","taggingTarget","_a","c","extras","_b","brandEvent","tagging","videoProps","contentProps","taggingProps","propDefs","props","acc","curr","computed","PLAYBACK_CLASS","mediaQueries","src","video","playbackControls","observer","entries","entry","button","isPlaybackStopped","size","RefappVideoControls","RefappVideoContent","RefappVideoBase","app","RefappVideoProvider","RefappVideo"],"mappings":";mGAOuB,CACrB,aAAc,CACZ,KAAM,OACN,QAAS,CACV,EACD,QAAS,CACP,KAAM,OACN,SAAU,GACV,QAAS,IACV,EACD,KAAM,CACJ,KAAM,OACN,SAAU,GACV,QAAS,IACV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