????
Current Path : /home/ncom/public_html/wp-content/plugins/optinmonster/vue/dist/js/ |
Current File : /home/ncom/public_html/wp-content/plugins/optinmonster/vue/dist/js/campaign-edit.b4900c7b.js.map |
{"version":3,"file":"js/campaign-edit.b4900c7b.js","mappings":"uNAAA,IAAIA,EAAS,WAAkB,IAAIC,EAAIC,KAAKC,EAAGF,EAAIG,MAAMD,GAAG,OAAQF,EAAII,QAASF,EAAG,YAAY,CAACG,YAAY,2BAA2B,CAACH,EAAG,MAAM,CAACG,YAAY,oBAAoB,CAACH,EAAG,cAAc,CAACG,YAAY,6CAA6CC,MAAM,CAAC,GAAK,CAAEC,KAAM,eAAgB,CAACP,EAAIQ,GAAG,8BAA8BN,EAAG,IAAI,CAACG,YAAY,4CAA4CC,MAAM,CAAC,KAAON,EAAIS,YAAY,MAAS,kBAAiBT,EAAIU,WAAW,CAACV,EAAIQ,GAAG,sBAAsB,GAAIR,EAAIW,UAAWT,EAAG,eAAe,CAACA,EAAG,KAAK,CAACF,EAAIQ,GAAG,kBAAkBN,EAAG,OAAO,CAACU,GAAG,CAAC,OAAS,SAASC,GAAgC,OAAxBA,EAAOC,iBAAwBd,EAAIe,KAAKC,MAAM,KAAMC,UAAU,IAAI,CAACf,EAAG,KAAK,CAACA,EAAG,OAAO,CAACF,EAAIQ,GAAGR,EAAIkB,GAAGlB,EAAIU,YAAYR,EAAG,gBAAgB,CAACI,MAAM,CAAC,GAAK,2BAA2B,OAASN,EAAImB,UAAUjB,EAAG,MAAM,CAACG,YAAY,oDAAoDe,MAAM,CAAEC,SAAUrB,EAAIsB,aAAc,CAACpB,EAAG,cAAc,CAACG,YAAY,yCAAyCC,MAAM,CAAC,MAAQ,kBAAkBiB,YAAYvB,EAAIwB,GAAG,CAAC,CAACC,IAAI,QAAQC,GAAG,WAAW,MAAO,CAAC1B,EAAIQ,GAAG,kBAAkB,EAAEmB,OAAM,IAAO,MAAK,EAAM,aAAa,CAACzB,EAAG,IAAI,CAACF,EAAIQ,GAAG,2E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,WCQpPC,GAAY,OACd,EACAhF,EACA2C,GACA,EACA,KACA,KACA,MAIF,EAAeqC,EAAiB,O","sources":["webpack://optinmonster-wordpress-plugin-vue-app/./src/pages/Campaign.vue","webpack://optinmonster-wordpress-plugin-vue-app/src/pages/Campaign.vue","webpack://optinmonster-wordpress-plugin-vue-app/./src/pages/Campaign.vue?d26d","webpack://optinmonster-wordpress-plugin-vue-app/./src/pages/Campaign.vue?f20e"],"sourcesContent":["var render = function render(){var _vm=this,_c=_vm._self._c;return (_vm.routeId)?_c('core-page',{staticClass:\"omapi-campaign-settings\"},[_c('div',{staticClass:\"omapi-card__flex\"},[_c('router-link',{staticClass:\"omapi-link-arrow-before omapi-button__link\",attrs:{\"to\":{ name: 'campaigns' }}},[_vm._v(\"Return to Campaigns List\")]),_c('a',{staticClass:\"omapi-link-arrow-after omapi-button__link\",attrs:{\"href\":_vm.builderLink,\"title\":`Edit Campaign “${_vm.title}”`}},[_vm._v(\" Edit Campaign \")])],1),(_vm.isLoading)?_c('core-loading',[_c('h1',[_vm._v(\"Loading...\")])]):_c('form',{on:{\"submit\":function($event){$event.preventDefault();return _vm.save.apply(null, arguments)}}},[_c('h1',[_c('span',[_vm._v(_vm._s(_vm.title))])]),_c('common-alerts',{attrs:{\"id\":\"om-notification-campaign\",\"alerts\":_vm.alerts}}),_c('div',{staticClass:\"omapi-card__flex omapi-campaign-settings-sections\",class:{ disabled: _vm.isDisabled }},[_c('common-card',{staticClass:\"omapi-campaign-settings__publishstatus\",attrs:{\"title\":\"Publish Status\"},scopedSlots:_vm._u([{key:\"title\",fn:function(){return [_vm._v(\"Publish Status\")]},proxy:true}],null,false,3797716272)},[_c('p',[_vm._v(\"To publish your campaign live on your site, click Publish, then Save.\")]),_c('campaigns-status-setting',{attrs:{\"status-text\":_vm.statusText,\"changed\":_vm.changed,\"saving\":_vm.saving},on:{\"updateStatus\":_vm.onChangeStatus,\"onSave\":_vm.save}})],1),_c('common-card',{staticClass:\"omapi-campaign-settings__wrapper\",attrs:{\"size\":\"two-thirds\",\"title\":\"WordPress Output Settings\",\"content-class\":\"omapi-card__border\",\"footer-class\":\"omapi-card__child\"},scopedSlots:_vm._u([{key:\"title\",fn:function(){return [_vm._v(\"WordPress Output Settings\")]},proxy:true},{key:\"footer\",fn:function(){return [_c('campaigns-users-setting',{attrs:{\"campaign-id\":_vm.id}}),(!_vm.hasError)?_c('campaigns-advanced-settings',{attrs:{\"campaign\":_vm.campaign}},[_c('core-save-button',{attrs:{\"color\":\"green\",\"disabled\":!_vm.changed,\"saving\":_vm.saving}})],1):_vm._e(),(!_vm.hasError && _vm.isWooActive)?_c('campaigns-woo-settings',{attrs:{\"campaign\":_vm.campaign}},[_c('core-save-button',{attrs:{\"color\":\"green\",\"disabled\":!_vm.changed,\"saving\":_vm.saving}})],1):_vm._e(),(!_vm.hasError && _vm.isEddActive)?_c('campaigns-edd-settings',{attrs:{\"campaign\":_vm.campaign}},[_c('core-save-button',{attrs:{\"color\":\"green\",\"disabled\":!_vm.changed,\"saving\":_vm.saving}})],1):_vm._e(),(!_vm.hasError && _vm.memberpress.isActive)?_c('campaigns-member-press-settings',{attrs:{\"campaign\":_vm.campaign}},[_c('core-save-button',{attrs:{\"color\":\"green\",\"disabled\":!_vm.changed,\"saving\":_vm.saving}})],1):_vm._e()]},proxy:true}],null,false,856168967)},[(_vm.hasError)?_c('p',{staticClass:\"text-setting\"},[_vm._v(\"An error was encountered.\")]):[_c('p',{staticClass:\"text-setting\"},[_vm._v(\" Control when and where your campaigns are displayed once the targeting conditions are met. \")]),('Inline' === _vm.campaignType)?_c('campaigns-inline-settings',{attrs:{\"campaign\":_vm.campaign}}):_vm._e(),(_vm.hasMailPoet)?_c('campaigns-mailpoet-settings',{attrs:{\"campaign\":_vm.campaign}}):_vm._e()]],2),_c('campaigns-right-column',{attrs:{\"campaign-id\":_vm.id}})],1)],1)],1):_vm._e()\n}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","<template>\n\t<core-page v-if=\"routeId\" class=\"omapi-campaign-settings\">\n\t\t<div class=\"omapi-card__flex\">\n\t\t\t<router-link :to=\"{ name: 'campaigns' }\" class=\"omapi-link-arrow-before omapi-button__link\"\n\t\t\t\t>Return to Campaigns List</router-link\n\t\t\t>\n\t\t\t<a\n\t\t\t\t:href=\"builderLink\"\n\t\t\t\t:title=\"`Edit Campaign “${title}”`\"\n\t\t\t\tclass=\"omapi-link-arrow-after omapi-button__link\"\n\t\t\t>\n\t\t\t\tEdit Campaign\n\t\t\t</a>\n\t\t</div>\n\t\t<core-loading v-if=\"isLoading\"><h1>Loading...</h1></core-loading>\n\t\t<form v-else @submit.prevent=\"save\">\n\t\t\t<h1>\n\t\t\t\t<span>{{ title }}</span>\n\t\t\t</h1>\n\t\t\t<common-alerts id=\"om-notification-campaign\" :alerts=\"alerts\" />\n\n\t\t\t<div class=\"omapi-card__flex omapi-campaign-settings-sections\" :class=\"{ disabled: isDisabled }\">\n\t\t\t\t<common-card title=\"Publish Status\" class=\"omapi-campaign-settings__publishstatus\">\n\t\t\t\t\t<template #title>Publish Status</template>\n\t\t\t\t\t<p>To publish your campaign live on your site, click Publish, then Save.</p>\n\t\t\t\t\t<campaigns-status-setting\n\t\t\t\t\t\t:status-text=\"statusText\"\n\t\t\t\t\t\t:changed=\"changed\"\n\t\t\t\t\t\t:saving=\"saving\"\n\t\t\t\t\t\t@updateStatus=\"onChangeStatus\"\n\t\t\t\t\t\t@onSave=\"save\"\n\t\t\t\t\t/>\n\t\t\t\t</common-card>\n\t\t\t\t<common-card\n\t\t\t\t\tsize=\"two-thirds\"\n\t\t\t\t\ttitle=\"WordPress Output Settings\"\n\t\t\t\t\tcontent-class=\"omapi-card__border\"\n\t\t\t\t\tfooter-class=\"omapi-card__child\"\n\t\t\t\t\tclass=\"omapi-campaign-settings__wrapper\"\n\t\t\t\t>\n\t\t\t\t\t<template #title>WordPress Output Settings</template>\n\t\t\t\t\t<p v-if=\"hasError\" class=\"text-setting\">An error was encountered.</p>\n\t\t\t\t\t<template v-else>\n\t\t\t\t\t\t<p class=\"text-setting\">\n\t\t\t\t\t\t\tControl when and where your campaigns are displayed once the targeting conditions are met.\n\t\t\t\t\t\t</p>\n\n\t\t\t\t\t\t<campaigns-inline-settings v-if=\"'Inline' === campaignType\" :campaign=\"campaign\" />\n\n\t\t\t\t\t\t<campaigns-mailpoet-settings v-if=\"hasMailPoet\" :campaign=\"campaign\" />\n\t\t\t\t\t</template>\n\n\t\t\t\t\t<template #footer>\n\t\t\t\t\t\t<campaigns-users-setting :campaign-id=\"id\" />\n\n\t\t\t\t\t\t<campaigns-advanced-settings v-if=\"!hasError\" :campaign=\"campaign\">\n\t\t\t\t\t\t\t<core-save-button color=\"green\" :disabled=\"!changed\" :saving=\"saving\" />\n\t\t\t\t\t\t</campaigns-advanced-settings>\n\n\t\t\t\t\t\t<campaigns-woo-settings v-if=\"!hasError && isWooActive\" :campaign=\"campaign\">\n\t\t\t\t\t\t\t<core-save-button color=\"green\" :disabled=\"!changed\" :saving=\"saving\" />\n\t\t\t\t\t\t</campaigns-woo-settings>\n\n\t\t\t\t\t\t<campaigns-edd-settings v-if=\"!hasError && isEddActive\" :campaign=\"campaign\">\n\t\t\t\t\t\t\t<core-save-button color=\"green\" :disabled=\"!changed\" :saving=\"saving\" />\n\t\t\t\t\t\t</campaigns-edd-settings>\n\n\t\t\t\t\t\t<campaigns-member-press-settings v-if=\"!hasError && memberpress.isActive\" :campaign=\"campaign\">\n\t\t\t\t\t\t\t<core-save-button color=\"green\" :disabled=\"!changed\" :saving=\"saving\" />\n\t\t\t\t\t\t</campaigns-member-press-settings>\n\t\t\t\t\t</template>\n\t\t\t\t</common-card>\n\n\t\t\t\t<campaigns-right-column :campaign-id=\"id\" />\n\t\t\t</div>\n\t\t</form>\n\t</core-page>\n</template>\n\n<script lang=\"js\">\nimport get from 'lodash/get'\nimport { mapState, mapGetters, mapActions, mapMutations } from 'vuex'\nimport { campaign } from '@/campaigns/mixins/campaign'\nimport { findDiffPosition } from '@/utils'\n\nexport default {\n\tmixins : [ campaign ],\n\tbeforeRouteLeave (to, from, next) {\n\t\tif (!this.changed || confirm('You have unsaved changes. Are you sure you want to lose these changes?')) {\n\t\t\tthis.resetCampaign()\n\t\t\treturn next()\n\t\t}\n\t},\n\tdata () {\n\t\treturn {\n\t\t\tchanged : false,\n\t\t\torig : false,\n\t\t\torigMeta : {},\n\t\t\tnewStatus : '',\n\t\t\tsaving : false,\n\t\t}\n\t},\n\tcomputed : {\n\t\t...mapState([ 'alerts' ]),\n\t\t...mapState('campaigns', [ 'campaigns' ]),\n\t\t...mapGetters('campaigns', [ 'getCampaign', 'hasError' ]),\n\t\t...mapGetters('wp', [ 'hasMailPoet', 'isWooActive', 'isEddActive', 'memberpress' ]),\n\t\t...mapGetters([ 'isFetched', 'isFetching' ]),\n\t\trouteId () {\n\t\t\treturn this.$get('$route.params.campaignId', '')\n\t\t},\n\t\t/**\n\t\t * Get the campaign object.\n\t\t * @returns {Object} The campaign object.\n\t\t */\n\t\tcampaign () {\n\t\t\treturn this.getCampaign(this.routeId)\n\t\t},\n\t\tfetchedCampaign () {\n\t\t\treturn this.isFetched(this.routeId)\n\t\t},\n\t\tfetchingCampaign () {\n\t\t\treturn this.isFetching(this.routeId)\n\t\t},\n\t\tshouldFetch () {\n\t\t\treturn !this.fetchingCampaign && !this.fetchedCampaign\n\t\t},\n\t\tisLoading () {\n\t\t\tif (this.showAlerts) {\n\t\t\t\treturn false\n\t\t\t}\n\t\t\treturn !this.fetchedCampaign ||\n\t\t\t\tthis.$store.getters.isLoading([ 'campaigns', 'me' ])\n\t\t},\n\t\tisDisabled () {\n\t\t\tif (this.hasError) {\n\t\t\t\treturn false\n\t\t\t}\n\t\t\treturn this.isLoading || !this.isFetched('wpResources')\n\t\t},\n\t\tshowAlerts () {\n\t\t\treturn Boolean(this.alerts.length)\n\t\t},\n\t\ttitle () {\n\t\t\treturn this.$get('campaign.name', 'No Campaign Found')\n\t\t},\n\t\t/**\n\t\t * Get the appropriate text for the campaign status column.\n\t\t *\n\t\t * - Seeing \"Draft\" status always indicates app status is Paused\n\t\t * (regardless of embed code status)\n\t\t *\n\t\t * - Seeing \"Pending\" status always indicates either embed code status\n\t\t * is disabled, or app status is Paused\n\t\t *\n\t\t * - Seeing \"Published\" status always indicates app status is Active\n\t\t * and embed code status is enabled\n\t\t *\n\t\t * @returns {string} The text for the campaign status.\n\t\t */\n\t\tstatusText () {\n\t\t\tconst published = 'active' !== this.newStatus\n\n\t\t\tif (this.isSplit) {\n\t\t\t\treturn published ? 'Published' : 'Draft'\n\t\t\t}\n\n\t\t\tif (published) {\n\t\t\t\treturn this.settingEnabled ? 'Pending' : 'Draft'\n\t\t\t}\n\n\t\t\treturn this.settingEnabled ? 'Published' : 'Pending'\n\t\t},\n\t},\n\twatch : {\n\t\tisLoading (isLoading) {\n\t\t\tif (!isLoading) {\n\t\t\t\tthis.fetch()\n\t\t\t}\n\t\t},\n\t\ttitle () {\n\t\t\tthis.updateTitle()\n\t\t},\n\t\tcampaign (newVal, oldVal) {\n\t\t\tif (!this.fetchedCampaign || !get(oldVal, 'wp')) {\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tif (!this.orig) {\n\t\t\t\tthis.orig = this.getMetaString(oldVal)\n\t\t\t}\n\n\t\t\tif (this.newStatus !== this.campaignStatus) {\n\t\t\t\tthis.changed = true\n\t\t\t\treturn\n\t\t\t}\n\t\t\tnewVal = this.getMetaString(newVal)\n\t\t\tconst diff = findDiffPosition(newVal, this.orig)\n\t\t\tthis.changed = -1 !== diff\n\t\t},\n\t\tsettingEnabled (newVal, oldVal) {\n\t\t\tif (newVal !== oldVal) {\n\t\t\t\tthis.changed = true\n\t\t\t}\n\t\t},\n\t\tnewStatus () {\n\t\t\tif (!this.changed) {\n\t\t\t\tthis.changed = this.newStatus !== this.campaignStatus\n\t\t\t}\n\t\t},\n\t},\n\tmounted () {\n\t\tif (!this.routeId) {\n\t\t\treturn\n\t\t}\n\n\t\tthis.fetch()\n\t\tthis.updateTitle()\n\n\t\twindow.addEventListener('beforeunload', this.maybePreventExit)\n\t},\n\tbeforeDestroy () {\n\t\twindow.removeEventListener('beforeunload', this.maybePreventExit)\n\t},\n\tmethods : {\n\t\t...mapActions('campaigns', [ 'fetchCampaign', 'fetchWpDataForCampaign', 'saveWordPress' ]),\n\t\t...mapMutations([ 'fetching', 'fetched' ]),\n\t\tfetch () {\n\t\t\tif (this.fetchingCampaign) {\n\t\t\t\t// Already in progress.\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tif (!this.fetchedCampaign) {\n\t\t\t\tthis.fetching(this.routeId)\n\t\t\t}\n\n\t\t\tthis.fetchCampaign({ campaignId: this.routeId })\n\t\t\t\t.then(() => this.fetchWpData())\n\t\t\t\t.catch(() => {})\n\t\t},\n\t\tfetchWpData () {\n\t\t\tconst result = this.fetchedCampaign\n\t\t\t\t? Promise.resolve()\n\t\t\t\t: this.fetchWpDataForCampaign({ campaignId: this.routeId })\n\n\t\t\treturn result\n\t\t\t\t.then(() => this.fetched(this.routeId))\n\t\t\t\t.then(() => this.afterFetched())\n\t\t\t\t.catch(() => {})\n\t\t},\n\t\tsave () {\n\t\t\tthis.$store.commit('clearAlerts')\n\n\t\t\tthis.saving = true\n\n\t\t\tthis.setStatus({ campaigns: [ this.id ], status: this.newStatus })\n\t\t\tthis.saveWordPress({\n\t\t\t\tcampaignId : this.id,\n\t\t\t\tsettings : this.getSettings(),\n\t\t\t}).then(() => {\n\t\t\t\tthis.fetchWpData()\n\t\t\t})\n\t\t},\n\t\tafterFetched () {\n\t\t\tthis.orig = this.getMetaString(this.campaign)\n\t\t\tthis.origMeta = this.$get('campaign.wp.post_meta', {})\n\t\t\tthis.newStatus = this.campaignStatus\n\t\t\tthis.changed = false\n\t\t\tthis.saving = false\n\t\t},\n\t\tupdateTitle () {\n\t\t\tconst title = this.$get('campaign.name', this.id)\n\t\t\tif (title) {\n\t\t\t\tthis.$store.dispatch('setTitle', { title: `Output Settings: ${title}`, setBannerTitle: false })\n\t\t\t\tthis.$store.commit('setBannerTitle', 'Campaign Output Settings')\n\t\t\t}\n\t\t},\n\t\tgetMetaString (val) {\n\t\t\tconst settings = this.getSettings(get(val, 'wp.post_meta', {}))\n\t\t\treturn JSON.stringify(settings) + this.newStatus\n\t\t},\n\t\t/**\n\t\t * The browser `beforeunload` callback to help catch users who are\n\t\t * navigating away from our page, but have unsaved changes.\n\t\t *\n\t\t * See https://developer.mozilla.org/en-US/docs/Web/API/WindowEventHandlers/onbeforeunload\n\t\t *\n\t\t * @param {Object} event The `beforeunload` event object.\n\t\t *\n\t\t * @returns {string} The message to display in the browser alert.\n\t\t */\n\t\tmaybePreventExit (event) {\n\t\t\tif (this.changed) {\n\t\t\t\t// Cancel the event\n\t\t\t\tevent.preventDefault()\n\n\t\t\t\t// Chrome requires returnValue to be set\n\t\t\t\tevent.returnValue = 'You have unsaved changes. Are you sure you want to lose these changes?'\n\n\t\t\t\treturn event.returnValue\n\t\t\t}\n\t\t},\n\t\tresetCampaign () {\n\t\t\tthis.newStatus = this.campaignStatus\n\t\t\tthis.updateCampaignMeta({\n\t\t\t\tcampaignId : this.id,\n\t\t\t\tmeta : this.origMeta,\n\t\t\t})\n\t\t},\n\t\tonChangeStatus (status) {\n\t\t\tswitch (status) {\n\t\t\tcase 'Pending':\n\t\t\t\tthis.toggleEmbed('active' !== this.newStatus)\n\t\t\t\tbreak\n\t\t\tcase 'Published':\n\t\t\t\tthis.newStatus = 'active'\n\t\t\t\tthis.toggleEmbed(true)\n\t\t\t\tbreak\n\t\t\tcase 'Draft':\n\t\t\t\tthis.newStatus = 'paused'\n\t\t\t\tthis.toggleEmbed(false)\n\t\t\t\tbreak\n\t\t\tdefault:\n\t\t\t\tbreak\n\t\t\t}\n\t\t},\n\t\t/**\n\t\t * Toggle the embed code on/off.\n\t\t *\n\t\t * @since 2.0.0\n\t\t *\n\t\t * @param {boolean} enabled Whether to set embed enabled/disabled.\n\t\t *\n\t\t * @returns {void}\n\t\t */\n\t\ttoggleEmbed (enabled) {\n\t\t\tif (enabled !== this.settingEnabled) {\n\t\t\t\tthis.settingEnabled = enabled\n\t\t\t}\n\t\t},\n\t},\n};\n</script>\n\n<style lang=\"scss\">\n@import '../assets/scss/variables';\n@import '../assets/scss/pages/campaign';\n</style>\n","import mod from \"-!../../node_modules/thread-loader/dist/cjs.js!../../node_modules/babel-loader/lib/index.js??clonedRuleSet-40.use[1]!../../node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./Campaign.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../node_modules/thread-loader/dist/cjs.js!../../node_modules/babel-loader/lib/index.js??clonedRuleSet-40.use[1]!../../node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./Campaign.vue?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./Campaign.vue?vue&type=template&id=a371f01a&\"\nimport script from \"./Campaign.vue?vue&type=script&lang=js&\"\nexport * from \"./Campaign.vue?vue&type=script&lang=js&\"\nimport style0 from \"./Campaign.vue?vue&type=style&index=0&id=a371f01a&prod&lang=scss&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../node_modules/@vue/vue-loader-v15/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n null,\n null\n \n)\n\nexport default component.exports"],"names":["render","_vm","this","_c","_self","routeId","staticClass","attrs","name","_v","builderLink","title","isLoading","on","$event","preventDefault","save","apply","arguments","_s","alerts","class","disabled","isDisabled","scopedSlots","_u","key","fn","proxy","statusText","changed","saving","onChangeStatus","id","hasError","_e","campaign","isWooActive","isEddActive","memberpress","isActive","campaignType","hasMailPoet","staticRenderFns","mixins","beforeRouteLeave","data","orig","origMeta","newStatus","computed","fetchedCampaign","fetchingCampaign","shouldFetch","showAlerts","watch","newVal","settingEnabled","mounted","window","beforeDestroy","methods","fetch","campaignId","then","catch","fetchWpData","Promise","campaigns","status","settings","afterFetched","updateTitle","setBannerTitle","getMetaString","maybePreventExit","event","resetCampaign","meta","toggleEmbed","component"],"sourceRoot":""}