File: /home/parhudrw/public_html/wp-content/plugins/optinmonster/vue/dist/js/templates.78814755.js.map
{"version":3,"file":"js/templates.78814755.js","mappings":"0MAAO,MAAMA,EAAW,CACvBC,IAAAA,GACC,MAAO,CACNC,KAAM,CACLC,UAAW,CACVC,KAAM,YACNC,MAAO,CACNC,KAAM,YACNC,OAAQ,CAAEC,IAAK,WAGjBC,UAAW,CACVL,KAAM,YACNC,MAAO,CACNC,KAAM,YACNC,OAAQ,CAAC,KAKd,E,6FClBM,MAAMG,EAAgB,CAACC,EAAUC,EAAUC,EAAWC,KAC5D,IAAIC,EAASC,SAASC,eAAeL,GACrC,GAAIG,EACH,OAAOA,EAGR,IAAKJ,EAEJ,YADAO,QAAQC,MAAM,0CAIf,MAAMC,EAAOJ,SAASK,qBAAqB,QAAQ,IAAML,SAASM,gBAclE,OAbAP,EAASC,SAASO,cAAc,UAChCR,EAAOS,KAAO,kBACdT,EAAOU,GAAKb,EACZG,EAAOW,IAAMf,EACbI,EAAOY,OAAQ,EACfZ,EAAOa,QAAQC,QAAUhB,EACzBE,EAAOa,QAAQE,KAAOhB,GACjB,IAAAiB,kBACJhB,EAAOa,QAAQI,KAAM,IAAAC,iBAAkB,MAAQ,EAAAC,YAGhDd,EAAKe,YAAYpB,GAEVA,GChBKqB,EAAwB,CACpC,OAAAC,GACCC,KAAKC,mBAGL,WAEA,WAEA,WAEA,WAEA,UAEAD,KAAKE,OAAOC,UAAWC,IACtB,MAAMC,EAAS,CACd,8BACA,0BACA,0BACA,sBACA,2BACA,4BACA,oBACA,0BAEKC,EAAW,CAAC,uBAElB,IAAIC,EAAcH,EAASlB,KAAKsB,WAAW,gBAAkBH,EAAOI,SAASL,EAASlB,MACjFqB,IACJA,EAAcD,EAASG,SAASL,EAASlB,OAGtCqB,GACHP,KAAKU,oBAGR,EACA,aAAAC,IACC,SAAkB,IAClB,SAAgB,IAChB,SAAqB,IACrB,SAAqB,IACrB,SAAkB,EACnB,EACAC,QAAS,CACR,eAAAX,CAAg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,OAAAA,GACA,KAAAG,OAAAwF,SAAA,4BAAAC,MAAA,QAEA,KAAAvH,cAAA,+BAAAwH,WAAAC,0BAAA,KAAAD,WAAAE,uBACA,EACAC,OAAAA,GACA,KAAAC,oBAAAL,MAAA,QACA,KAAAM,KAAAC,MAAA,qCACA,EACAtF,QAAA,KACAuF,EAAAA,EAAAA,IAAA,mCACAC,YAAAA,CAAA5C,GACA,KAAAyC,KAAAC,MAAA,uBACA,KAAAhG,OAAAe,OAAA,2BAAAuC,EACA,EACAP,KAAAA,CAAApF,GACA,OAAAwI,IACAxI,EACA,CAEAiG,GAAAA,EAAAsB,KAAA3B,KAAA4B,GAAA,IAAAA,EAAAlG,IAAA,IAGA2E,GAAAwC,OAAA,KAAAC,QAAAzC,EAAA0C,YAAAC,QAAA,KAAAF,UAAAG,SAAA,cAGA5C,GAAAA,EAAAb,MAGAa,GAAA,KAAAyC,QAAAzC,EAAA0C,YAAAG,UAGA7C,GAAAA,EAAAhG,KAAAkG,eAEA,CACA,OACA,OACA,MACA,OACA,OAGA,ICzMwP,I,WCQpP4C,GAAY,OACd,EACAzF,EACAmB,GACA,EACA,KACA,KACA,MAIF,EAAesE,E","sources":["webpack://optinmonster-wordpress-plugin-vue-app/./src/components/mixins/creation.js","webpack://optinmonster-wordpress-plugin-vue-app/./node_modules/optinmonster-js-library/src/utils/apiJsScript.js","webpack://optinmonster-wordpress-plugin-vue-app/./node_modules/optinmonster-js-library/src/vue/templates/mixins/templatePreviewsSetup.js","webpack://optinmonster-wordpress-plugin-vue-app/./src/pages/Templates.vue","webpack://optinmonster-wordpress-plugin-vue-app/src/pages/Templates.vue","webpack://optinmonster-wordpress-plugin-vue-app/./src/pages/Templates.vue?03fe","webpack://optinmonster-wordpress-plugin-vue-app/./src/pages/Templates.vue?7e80"],"sourcesContent":["export const creation = {\n\tdata() {\n\t\treturn {\n\t\t\ttabs: {\n\t\t\t\ttemplates: {\n\t\t\t\t\tname: 'Templates',\n\t\t\t\t\troute: {\n\t\t\t\t\t\tpath: 'templates',\n\t\t\t\t\t\tparams: { tab: 'popup' },\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tplaybooks: {\n\t\t\t\t\tname: 'Playbooks',\n\t\t\t\t\troute: {\n\t\t\t\t\t\tpath: 'playbooks',\n\t\t\t\t\t\tparams: {},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t};\n\t},\n};\n","import { isProduction, isDevelopment, currentEnv } from './env';\n\nexport const loadApiScript = (apiJsUrl, scriptId, accountid, userId) => {\n\tlet script = document.getElementById(scriptId);\n\tif (script) {\n\t\treturn script;\n\t}\n\n\tif (!apiJsUrl) {\n\t\tconsole.error('apiJsUrl not provided to loadApiScript');\n\t\treturn;\n\t}\n\n\tconst head = document.getElementsByTagName('head')[0] || document.documentElement;\n\tscript = document.createElement('script');\n\tscript.type = 'text/javascript';\n\tscript.id = scriptId;\n\tscript.src = apiJsUrl;\n\tscript.async = true;\n\tscript.dataset.account = accountid;\n\tscript.dataset.user = userId;\n\tif (!isProduction()) {\n\t\tscript.dataset.env = isDevelopment() ? 'dev' : currentEnv;\n\t}\n\n\thead.appendChild(script);\n\n\treturn script;\n};\n","import {\n\tcloseCampaigns,\n\tinitCampaignsDemo,\n\tinitCampaignsWp,\n\tinitCampaignsPreview,\n\tinitCampaignsBgClick,\n\tinitMobilePreview,\n} from 'optinmonster-js-library/src/utils/omapi';\nimport { urls } from 'optinmonster-js-library/src/vue/utils';\nimport { loadApiScript } from 'optinmonster-js-library/src/utils/apiJsScript';\n\nexport const templatePreviewsSetup = {\n\tcreated() {\n\t\tthis.listenApiLoaded();\n\n\t\t// Ensure campaigns are flagged as demos.\n\t\tinitCampaignsDemo();\n\t\t// Ensure campaigns are flagged as wp.\n\t\tinitCampaignsWp();\n\t\t// Make previews closeable by clicking background.\n\t\tinitCampaignsBgClick();\n\t\t// Disable form fields\n\t\tinitCampaignsPreview();\n\t\t// Handle mobile template previews\n\t\tinitMobilePreview();\n\n\t\tthis.$store.subscribe((mutation) => {\n\t\t\tconst ignore = [\n\t\t\t\t'templates/setLoadingPreview',\n\t\t\t\t'templates/setPreviewing',\n\t\t\t\t'templates/filterOptions',\n\t\t\t\t'templates/templates',\n\t\t\t\t'templates/permittedTypes',\n\t\t\t\t'templates/recentTemplates',\n\t\t\t\t'templates/popular',\n\t\t\t\t'templates/setApiLoaded',\n\t\t\t];\n\t\t\tconst triggers = ['route/ROUTE_CHANGED'];\n\n\t\t\tlet shouldClose = mutation.type.startsWith('templates/') && !ignore.includes(mutation.type);\n\t\t\tif (!shouldClose) {\n\t\t\t\tshouldClose = triggers.includes(mutation.type);\n\t\t\t}\n\n\t\t\tif (shouldClose) {\n\t\t\t\tthis.closeAllPreviews();\n\t\t\t}\n\t\t});\n\t},\n\tbeforeDestroy() {\n\t\tinitCampaignsDemo(false);\n\t\tinitCampaignsWp(false);\n\t\tinitCampaignsPreview(false);\n\t\tinitCampaignsBgClick(false);\n\t\tinitMobilePreview(false);\n\t},\n\tmethods: {\n\t\tlistenApiLoaded(cb = 'addEventListener') {\n\t\t\t['om.Api.init', 'om.Main.init', 'om.Campaigns.init', 'om.Campaign.init'].forEach((evt) =>\n\t\t\t\tdocument[cb](evt, this.setApiLoaded)\n\t\t\t);\n\t\t},\n\t\t/**\n\t\t * Handle finishing the API load.\n\t\t *\n\t\t * Remove the apiLoaded event listener and set the\n\t\t * apiLoaded flag to true once the api has loaded.\n\t\t *\n\t\t * @returns {void}\n\t\t */\n\t\tsetApiLoaded() {\n\t\t\tthis.listenApiLoaded('removeEventListener');\n\t\t\tthis.$store.commit('templates/setApiLoaded');\n\t\t},\n\t\t/**\n\t\t * Handles closing all open campaigns and resetting preview state.\n\t\t *\n\t\t * @returns {void}\n\t\t */\n\t\tcloseAllPreviews() {\n\t\t\tcloseCampaigns();\n\t\t\tthis.$store.commit('templates/setLoadingPreview', '');\n\t\t\tthis.$store.commit('templates/setPreviewing', '');\n\t\t},\n\t\t/**\n\t\t * Handles generating our api script tag.\n\t\t *\n\t\t * @param {string} scriptId The script id.\n\t\t * @param {int} accountid The account id.\n\t\t * @param {int} userId The user id.\n\t\t *\n\t\t * @returns {string} The script tag\n\t\t */\n\t\tloadApiScript(scriptId, accountid, userId) {\n\t\t\treturn loadApiScript(urls.apiJs(), scriptId, accountid, userId);\n\t\t},\n\t},\n};\n","var render = function render(){var _vm=this,_c=_vm._self._c;return (_vm.reachedCampaignLimit)?_c('templates-limit-exceeded'):_c('core-page',{attrs:{\"classes\":\"templates-wrapper\"}},[_c('common-page-tabnav',{attrs:{\"current\":\"templates\",\"tabs\":_vm.tabs}}),_c('h1',[_vm._v(\"Select a Campaign Type:\")]),_c('common-alerts',{attrs:{\"alerts\":_vm.alerts}}),_c('div',{staticClass:\"templates-content\"},[_c('templates-types'),_c('div',{staticClass:\"omapi-content-area\"},[_c('templates-upsell-alerts'),_c('div',{staticClass:\"template-content\"},[_c('div',{staticClass:\"template-content-left\"},[(_vm.isLoading)?_c('div',{staticClass:\"archie-loader-wrapper\"},[_c('div',[_c('core-loading',{staticClass:\"loader\"})],1)]):_c('templates-filters')],1),_c('div',{staticClass:\"template-content-right\"},[(_vm.hasTemplates)?_c('div',{staticClass:\"omapi-template-listing-wrap\"},[_c('templates-grid',{attrs:{\"templates\":_vm.selectedTemplates}}),(_vm.isLoading)?_c('svg-loading',{style:({ margin: '0 auto' })}):_vm._e()],1):(_vm.isLoading)?_c('div',{staticClass:\"archie-loader-wrapper\"},[_c('div',[_c('core-loading',{staticClass:\"loader\"})],1)]):_c('div',{staticClass:\"no-templates-available\"},[(_vm.validType && _vm.search)?_c('core-feedback',{attrs:{\"feedback-type\":\"templates\"}},[_c('em',[_vm._v(\" Looks like we don't have that template yet. Tell us more about the template you're looking for below and we'll consider adding it to our library. \")]),_c('em',[_vm._v(\" Or, if you need it right away, \"),_c('a',{attrs:{\"href\":\"https://optinmonster.com/vip-service/?utm_source=plugin&utm_medium=template_search\",\"target\":\"_blank\",\"rel\":\"noopener noreferrer\"}},[_vm._v(\" purchase a VIP Campaign \")]),_vm._v(\" and we'll do it for you within two business days. \")])]):_c('core-alert',{attrs:{\"type\":_vm.validType ? 'info' : 'warn'}},[_c('div',{staticClass:\"alert-message\"},[_vm._v(\" \"+_vm._s(_vm.noTemplatesMessage)+\" \")])])],1)])])],1)],1),_c('campaigns-modal-create-campaign'),_c('templates-modal-not-connected'),_c('templates-modal-no-access')],1)\n}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","<template>\n\t<templates-limit-exceeded v-if=\"reachedCampaignLimit\" />\n\t<core-page v-else classes=\"templates-wrapper\">\n\t\t<common-page-tabnav current=\"templates\" :tabs=\"tabs\" />\n\t\t<h1>Select a Campaign Type:</h1>\n\t\t<common-alerts :alerts=\"alerts\" />\n\t\t<div class=\"templates-content\">\n\t\t\t<templates-types />\n\n\t\t\t<div class=\"omapi-content-area\">\n\t\t\t\t<templates-upsell-alerts />\n\n\t\t\t\t<div class=\"template-content\">\n\t\t\t\t\t<div class=\"template-content-left\">\n\t\t\t\t\t\t<div v-if=\"isLoading\" class=\"archie-loader-wrapper\">\n\t\t\t\t\t\t\t<div><core-loading class=\"loader\" /></div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<templates-filters v-else />\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class=\"template-content-right\">\n\t\t\t\t\t\t<div v-if=\"hasTemplates\" class=\"omapi-template-listing-wrap\">\n\t\t\t\t\t\t\t<templates-grid :templates=\"selectedTemplates\" />\n\t\t\t\t\t\t\t<svg-loading v-if=\"isLoading\" :style=\"{ margin: '0 auto' }\" />\n\t\t\t\t\t\t</div>\n\n\t\t\t\t\t\t<div v-else-if=\"isLoading\" class=\"archie-loader-wrapper\">\n\t\t\t\t\t\t\t<div><core-loading class=\"loader\" /></div>\n\t\t\t\t\t\t</div>\n\n\t\t\t\t\t\t<div v-else class=\"no-templates-available\">\n\t\t\t\t\t\t\t<core-feedback v-if=\"validType && search\" feedback-type=\"templates\">\n\t\t\t\t\t\t\t\t<em>\n\t\t\t\t\t\t\t\t\tLooks like we don't have that template yet. Tell us more about the template you're\n\t\t\t\t\t\t\t\t\tlooking for below and we'll consider adding it to our library.\n\t\t\t\t\t\t\t\t</em>\n\t\t\t\t\t\t\t\t<em>\n\t\t\t\t\t\t\t\t\tOr, if you need it right away,\n\t\t\t\t\t\t\t\t\t<a\n\t\t\t\t\t\t\t\t\t\thref=\"https://optinmonster.com/vip-service/?utm_source=plugin&utm_medium=template_search\"\n\t\t\t\t\t\t\t\t\t\ttarget=\"_blank\"\n\t\t\t\t\t\t\t\t\t\trel=\"noopener noreferrer\"\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\tpurchase a VIP Campaign\n\t\t\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t\t\t\tand we'll do it for you within two business days.\n\t\t\t\t\t\t\t\t</em>\n\t\t\t\t\t\t\t</core-feedback>\n\t\t\t\t\t\t\t<core-alert v-else :type=\"validType ? 'info' : 'warn'\">\n\t\t\t\t\t\t\t\t<div class=\"alert-message\">\n\t\t\t\t\t\t\t\t\t{{ noTemplatesMessage }}\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</core-alert>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n\t\t<campaigns-modal-create-campaign />\n\t\t<templates-modal-not-connected />\n\t\t<templates-modal-no-access />\n\t</core-page>\n</template>\n\n<script lang=\"js\">\nimport orderBy from 'lodash/orderBy'\nimport upperFirst from 'lodash/upperFirst'\nimport { mapActions, mapState, mapGetters } from 'vuex'\nimport { templatePreviewsSetup } from 'optinmonster-js-library/src/vue/templates/mixins/templatePreviewsSetup'\nimport { creation } from '@/components/mixins/creation'\n\nexport default {\n\tmixins : [ templatePreviewsSetup, creation ],\n\tcomputed : {\n\t\t...mapState('templates', [\n\t\t\t'activeType',\n\t\t\t'search',\n\t\t\t'sort',\n\t\t\t'popular',\n\t\t\t'templates',\n\t\t]),\n\t\t...mapGetters([ 'reachedCampaignLimit' ]),\n\t\t...mapGetters('templates', [ 'typePermitted', 'featured', 'filters', 'filterGamified', 'validType' ]),\n\t\talerts () {\n\t\t\treturn this.$get('$store.state.alerts', [])\n\t\t},\n\t\tisLoading () {\n\t\t\treturn this.$store.getters.isLoading('templates')\n\t\t},\n\t\tpopularTemplates () {\n\t\t\tconst popular = this.popular[this.activeType]\n\n\t\t\treturn popular && popular.length ? this.order(popular) : []\n\t\t},\n\t\tfeaturedTemplates () {\n\t\t\tconst featured = this.featured[this.activeType]\n\n\t\t\treturn featured && featured.length ? this.order(featured) : []\n\t\t},\n\t\tshowableTemplates () {\n\t\t\tconst filterPasses = (key, value) => {\n\t\t\t\treturn this.filters[key].length\n\t\t\t\t\t? !this.filters[key].find(f => !value.includes(f))\n\t\t\t\t\t: true\n\t\t\t}\n\n\t\t\tconst prop = [ 'popular', 'featured' ].includes(this.sort) ? `${this.sort}Templates` : 'templates'\n\t\t\tconst templates = this[ prop ]\n\t\t\t\t.filter((template) => {\n\t\t\t\t\tif ('' === this.search) {\n\t\t\t\t\t\treturn true\n\t\t\t\t\t}\n\n\t\t\t\t\tconst term = this.search.toLowerCase()\n\t\t\t\t\tconst nameMatch = template.name.toLowerCase().includes(term)\n\t\t\t\t\tconst keywordMatch = template.keywords.some((k) => k.toLowerCase().includes(term))\n\t\t\t\t\tconst categoryMatch = template.categories.some((c) => c.name.toLowerCase().includes(term))\n\t\t\t\t\tconst featuresMatch = template.features.some((f) => f.name.toLowerCase().includes(term))\n\t\t\t\t\tconst seasonsMatch = template.seasons.some((s) => s.name.toLowerCase().includes(term))\n\n\t\t\t\t\treturn nameMatch || keywordMatch || categoryMatch || featuresMatch || seasonsMatch\n\t\t\t\t}).filter((template) => {\n\t\t\t\t\tconst device = 'mobile' === this.filters.device\n\t\t\t\t\t\t? template.mobile\n\t\t\t\t\t\t: !template.mobile\n\n\t\t\t\t\tif (!device) {\n\t\t\t\t\t\treturn false\n\t\t\t\t\t}\n\n\t\t\t\t\tconst taxonomies = [ 'goals', 'categories', 'tags', 'seasons', 'features' ]\n\n\t\t\t\t\treturn !taxonomies.find(t => {\n\t\t\t\t\t\treturn !filterPasses(t, template[t].map(term => term.id))\n\t\t\t\t\t})\n\t\t\t\t})\n\n\t\t\treturn this.order(templates)\n\t\t},\n\t\tselectedTemplates () {\n\t\t\treturn this.showableTemplates.filter(template => {\n\t\t\t\treturn this.filterGamified\n\t\t\t\t\t? template.tags.find(tag => 1 === tag.id)\n\t\t\t\t\t: template.type === this.activeType\n\t\t\t})\n\t\t},\n\t\thasTemplates () {\n\t\t\treturn this.selectedTemplates.length\n\t\t},\n\t\tshouldShowUpsells () {\n\t\t\treturn this.$store.getters.connected\n\t\t\t\t? !this.typePermitted(this.activeType)\n\t\t\t\t: false\n\t\t},\n\t\tnoTemplatesMessage () {\n\t\t\treturn this.validType\n\t\t\t\t? 'No templates available for your current selection.'\n\t\t\t\t: `${upperFirst(this.activeType)} is not a valid type. Please select one of the options above.`\n\t\t},\n\t},\n\tcreated () {\n\t\tthis.$store.dispatch('campaigns/fetchDashboard').catch(() => {})\n\n\t\tthis.loadApiScript('omwpapi-templates-apijs', this.$constants.TEMPLATES_PREVIEW_ACCOUNT, this.$constants.TEMPLATES_PREVIEW_USER)\n\t},\n\tmounted () {\n\t\tthis.fetchTemplateData().catch(() => {})\n\t\tthis.$bus.$emit('dashboard-view-mounted', 'templates')\n\t},\n\tmethods : {\n\t\t...mapActions('templates', [ 'fetchTemplateData' ]),\n\t\tapplyFilters (filters) {\n\t\t\tthis.$bus.$emit('applied-bulk-filter')\n\t\t\tthis.$store.commit('templates/appliedFilters', filters)\n\t\t},\n\t\torder(templates) {\n\t\t\treturn orderBy(\n\t\t\t\ttemplates,\n\t\t\t\t[\n\t\t\t\t\t// featured badge\n\t\t\t\t\t(template) => (template.tags.find(tag => 2 === tag.id) ? 1 : 0),\n\n\t\t\t\t\t// new badge (created within the last 3 months)\n\t\t\t\t\t(template) => Number(this.$moment(template.created_at).isAfter(this.$moment().subtract(3, 'months'))),\n\n\t\t\t\t\t// order number\n\t\t\t\t\t(template) => template.order,\n\n\t\t\t\t\t// creation date\n\t\t\t\t\t(template) => this.$moment(template.created_at).valueOf(),\n\n\t\t\t\t\t// name\n\t\t\t\t\t(template) => template.name.toLowerCase(),\n\t\t\t\t],\n\t\t\t\t[\n\t\t\t\t\t'desc',\n\t\t\t\t\t'desc',\n\t\t\t\t\t'asc',\n\t\t\t\t\t'desc',\n\t\t\t\t\t'asc',\n\t\t\t\t]\n\t\t\t);\n\t\t},\n\t},\n\n};\n</script>\n<style lang=\"scss\">\n@import '../assets/scss/variables';\n@import '../assets/scss/pages/templates';\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!./Templates.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!./Templates.vue?vue&type=script&lang=js\"","import { render, staticRenderFns } from \"./Templates.vue?vue&type=template&id=679bbbf4\"\nimport script from \"./Templates.vue?vue&type=script&lang=js\"\nexport * from \"./Templates.vue?vue&type=script&lang=js\"\nimport style0 from \"./Templates.vue?vue&type=style&index=0&id=679bbbf4&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":["creation","data","tabs","templates","name","route","path","params","tab","playbooks","loadApiScript","apiJsUrl","scriptId","accountid","userId","script","document","getElementById","console","error","head","getElementsByTagName","documentElement","createElement","type","id","src","async","dataset","account","user","isProduction","env","isDevelopment","currentEnv","appendChild","templatePreviewsSetup","created","this","listenApiLoaded","$store","subscribe","mutation","ignore","triggers","shouldClose","startsWith","includes","closeAllPreviews","beforeDestroy","methods","cb","forEach","evt","setApiLoaded","commit","apiJs","render","_vm","_c","_self","reachedCampaignLimit","attrs","_v","alerts","staticClass","isLoading","hasTemplates","selectedTemplates","style","margin","_e","validType","search","_s","noTemplatesMessage","staticRenderFns","mixins","computed","mapState","mapGetters","$get","getters","popularTemplates","popular","activeType","length","order","featuredTemplates","featured","showableTemplates","filterPasses","key","value","filters","find","f","prop","sort","filter","template","term","toLowerCase","nameMatch","keywordMatch","keywords","some","k","categoryMatch","categories","c","featuresMatch","features","seasonsMatch","seasons","s","device","mobile","taxonomies","t","map","filterGamified","tags","tag","shouldShowUpsells","connected","typePermitted","upperFirst","dispatch","catch","$constants","TEMPLATES_PREVIEW_ACCOUNT","TEMPLATES_PREVIEW_USER","mounted","fetchTemplateData","$bus","$emit","mapActions","applyFilters","orderBy","Number","$moment","created_at","isAfter","subtract","valueOf","component"],"sourceRoot":""}