HEX
Server: Microsoft-IIS/10.0
System: Windows NT ITPWINWEBSVR22 10.0 build 20348 (Windows Server 2022) AMD64
User: www.conferencesearch.co.uk (0)
PHP: 8.3.30
Disabled: NONE
Upload Files
File: D:/web/matomo.circ/plugins/SitesManager/vue/dist/SitesManager.umd.min.js
(function(e,t){"object"===typeof exports&&"object"===typeof module?module.exports=t(require("CoreHome"),require("vue"),require("CorePluginsAdmin")):"function"===typeof define&&define.amd?define(["CoreHome",,"CorePluginsAdmin"],t):"object"===typeof exports?exports["SitesManager"]=t(require("CoreHome"),require("vue"),require("CorePluginsAdmin")):e["SitesManager"]=t(e["CoreHome"],e["Vue"],e["CorePluginsAdmin"])})("undefined"!==typeof self?self:this,(function(e,t,n){return function(e){var t={};function n(a){if(t[a])return t[a].exports;var r=t[a]={i:a,l:!1,exports:{}};return e[a].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=e,n.c=t,n.d=function(e,t,a){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:a})},n.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"===typeof e&&e&&e.__esModule)return e;var a=Object.create(null);if(n.r(a),Object.defineProperty(a,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)n.d(a,r,function(t){return e[t]}.bind(null,r));return a},n.n=function(e){var t=e&&e.__esModule?function(){return e["default"]}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="plugins/SitesManager/vue/dist/",n(n.s="fae3")}({"19dc":function(t,n){t.exports=e},"8bbf":function(e,n){e.exports=t},a5a2:function(e,t){e.exports=n},fae3:function(e,t,n){"use strict";if(n.r(t),n.d(t,"SiteTypesStore",(function(){return h})),n.d(t,"CurrencyStore",(function(){return j})),n.d(t,"TimezoneStore",(function(){return k})),n.d(t,"SitesManagement",(function(){return ht})),n.d(t,"ManageGlobalSettings",(function(){return Zt})),n.d(t,"ExcludeQueryParameterSettings",(function(){return Xt})),n.d(t,"SiteWithoutData",(function(){return En})),"undefined"!==typeof window){var a=window.document.currentScript,r=a&&a.src.match(/(.+\/)[^/]+\.js(\?.*)?$/);r&&(n.p=r[1])}var i=n("8bbf"),o=n("19dc");function l(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}function c(e,t,n){return t&&s(e.prototype,t),n&&s(e,n),e}function u(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}
/*!
 * Matomo - free/libre analytics platform
 *
 * @link    https://matomo.org
 * @license https://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
 */var d=window,m=d.$,b=function(){function e(){var t=this;l(this,e),u(this,"state",Object(i["reactive"])({isLoading:!1,typesById:{}})),u(this,"typesById",Object(i["computed"])((function(){return Object(i["readonly"])(t.state).typesById}))),u(this,"isLoading",Object(i["computed"])((function(){return Object(i["readonly"])(t.state).isLoading}))),u(this,"types",Object(i["computed"])((function(){return Object.values(t.typesById.value)}))),u(this,"response",void 0)}return c(e,[{key:"init",value:function(){return this.fetchAvailableTypes()}},{key:"fetchAvailableTypes",value:function(){var e=this;return this.response?Promise.resolve(this.response):(this.state.isLoading=!0,this.response=o["AjaxHelper"].fetch({method:"API.getAvailableMeasurableTypes",filter_limit:"-1"}).then((function(t){return t.forEach((function(t){e.state.typesById[t.id]=t})),e.types.value})).finally((function(){e.state.isLoading=!1})),this.response)}},{key:"getEditSiteIdParameter",value:function(){var e=o["MatomoUrl"].hashQuery.value.match(/editsiteid=([0-9]+)/);if(e){var t="1"===o["MatomoUrl"].urlParsed.value.showaddsite||"true"===o["MatomoUrl"].urlParsed.value.showaddsite,n=e[1];return n&&m.isNumeric(n)&&!t?n:void 0}}},{key:"removeEditSiteIdParameterFromHash",value:function(){var e=Object.assign({},o["MatomoUrl"].hashParsed.value);delete e.editsiteid,o["MatomoUrl"].updateHash(e)}}]),e}(),h=new b;function p(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function g(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}function f(e,t,n){return t&&g(e.prototype,t),n&&g(e,n),e}function S(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}
/*!
 * Matomo - free/libre analytics platform
 *
 * @link    https://matomo.org
 * @license https://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
 */var O=function(){function e(){var t=this;p(this,e),S(this,"privateState",Object(i["reactive"])({isLoading:!1,currencies:{}})),S(this,"currencies",Object(i["computed"])((function(){return Object(i["readonly"])(t.privateState).currencies}))),S(this,"isLoading",Object(i["computed"])((function(){return Object(i["readonly"])(t.privateState).isLoading}))),S(this,"initializePromise",null)}return f(e,[{key:"init",value:function(){return this.initializePromise||(this.initializePromise=this.fetchCurrencies()),this.initializePromise}},{key:"fetchCurrencies",value:function(){var e=this;return this.privateState.isLoading=!0,o["AjaxHelper"].fetch({method:"SitesManager.getCurrencyList"}).then((function(t){e.privateState.currencies=t})).finally((function(){e.privateState.isLoading=!1}))}}]),e}(),j=new O;function y(e,t){return V(e)||N(e,t)||E(e,t)||v()}function v(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function E(e,t){if(e){if("string"===typeof e)return x(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?x(e,t):void 0}}function x(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,a=new Array(t);n<t;n++)a[n]=e[n];return a}function N(e,t){var n=null==e?null:"undefined"!==typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var a,r,i=[],o=!0,l=!1;try{for(n=n.call(e);!(o=(a=n.next()).done);o=!0)if(i.push(a.value),t&&i.length===t)break}catch(s){l=!0,r=s}finally{try{o||null==n["return"]||n["return"]()}finally{if(l)throw r}}return i}}function V(e){if(Array.isArray(e))return e}function M(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function T(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}function w(e,t,n){return t&&T(e.prototype,t),n&&T(e,n),e}function P(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}
/*!
 * Matomo - free/libre analytics platform
 *
 * @link    https://matomo.org
 * @license https://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
 */var C=function(){function e(){var t=this;M(this,e),P(this,"privateState",Object(i["reactive"])({isLoading:!1,timezones:[],timezoneSupportEnabled:!1})),P(this,"state",Object(i["computed"])((function(){return Object(i["readonly"])(t.privateState)}))),P(this,"timezones",Object(i["computed"])((function(){return t.state.value.timezones}))),P(this,"timezoneSupportEnabled",Object(i["computed"])((function(){return t.state.value.timezoneSupportEnabled}))),P(this,"isLoading",Object(i["computed"])((function(){return t.state.value.isLoading}))),P(this,"initializePromise",null)}return w(e,[{key:"init",value:function(){var e=this;return this.initializePromise||(this.privateState.isLoading=!0,this.initializePromise=Promise.all([this.checkTimezoneSupportEnabled(),this.fetchTimezones()]).finally((function(){e.privateState.isLoading=!1}))),this.initializePromise}},{key:"fetchTimezones",value:function(){var e=this;return o["AjaxHelper"].fetch({method:"SitesManager.getTimezonesList"}).then((function(t){var n=[];Object.entries(t).forEach((function(e){var t=y(e,2),a=t[0],r=t[1];Object.entries(r).forEach((function(e){var t=y(e,2),r=t[0],i=t[1];n.push({group:a,label:r,code:i})}))})),e.privateState.timezones=n}))}},{key:"checkTimezoneSupportEnabled",value:function(){var e=this;return o["AjaxHelper"].fetch({method:"SitesManager.isTimezoneSupportEnabled"}).then((function(t){e.privateState.timezoneSupportEnabled=t.value}))}}]),e}(),k=new C,D={class:"SitesManager",ref:"root"},_={class:"sites-manager-header"},G=["innerHTML"],A=Object(i["createElementVNode"])("br",null,null,-1),L=["innerHTML"],U={class:"loadingPiwik"},I=["alt"],B={class:"ui-confirm add-site-dialog"},z={class:"center"},H=["title","onClick"],Q={class:"ui-button-text"},F={class:"sitesManagerList"},R={key:0},W={class:"bottomButtonBar"};function $(e,t,n,a,r,o){var l=this,s=Object(i["resolveComponent"])("EnrichedHeadline"),c=Object(i["resolveComponent"])("ButtonBar"),u=Object(i["resolveComponent"])("MatomoDialog"),d=Object(i["resolveComponent"])("SiteFields"),m=Object(i["resolveDirective"])("content-intro");return Object(i["openBlock"])(),Object(i["createElementBlock"])("div",D,[Object(i["createElementVNode"])("div",_,[Object(i["withDirectives"])(Object(i["createElementVNode"])("div",null,[Object(i["withDirectives"])(Object(i["createElementVNode"])("h2",null,[Object(i["createVNode"])(s,{"help-url":e.externalRawLink("https://matomo.org/docs/manage-websites/"),"feature-name":e.translate("SitesManager_WebsitesManagement")},{default:Object(i["withCtx"])((function(){return[Object(i["createTextVNode"])(Object(i["toDisplayString"])(e.headlineText),1)]})),_:1},8,["help-url","feature-name"])],512),[[i["vShow"],e.availableTypes.length]]),Object(i["createElementVNode"])("p",null,[Object(i["createTextVNode"])(Object(i["toDisplayString"])(e.translate("SitesManager_MainDescription"))+" ",1),Object(i["createElementVNode"])("span",{innerHTML:e.$sanitize(e.mainDescription)},null,8,G),Object(i["withDirectives"])(Object(i["createElementVNode"])("span",null,[A,Object(i["createElementVNode"])("span",{innerHTML:e.$sanitize(e.superUserAccessMessage)},null,8,L)],512),[[i["vShow"],e.hasSuperUserAccess]])])],512),[[m]])]),Object(i["createElementVNode"])("div",null,[Object(i["createElementVNode"])("div",{class:Object(i["normalizeClass"])({hide_only:!e.isLoading})},[Object(i["createElementVNode"])("div",U,[Object(i["createElementVNode"])("img",{src:"plugins/Morpheus/images/loading-blue.gif",alt:e.translate("General_LoadingData")},null,8,I),Object(i["createTextVNode"])(" "+Object(i["toDisplayString"])(e.translate("General_LoadingData")),1)])],2)]),Object(i["createElementVNode"])("div",null,[Object(i["createVNode"])(c,{"site-is-being-edited":e.isSiteBeingEdited,"has-prev":e.hasPrev,hasNext:e.hasNext,"offset-start":e.offsetStart,"offset-end":e.offsetEnd,"total-number-of-sites":e.totalNumberOfSites,"is-loading":e.isLoading,"search-term":e.searchTerm,"is-searching":!!e.activeSearchTerm,"onUpdate:searchTerm":t[0]||(t[0]=function(t){return e.searchTerm=t}),onAdd:t[1]||(t[1]=function(t){return e.addNewEntity()}),onSearch:t[2]||(t[2]=function(t){return e.searchSites(t)}),onPrev:t[3]||(t[3]=function(t){return e.previousPage()}),onNext:t[4]||(t[4]=function(t){return e.nextPage()})},null,8,["site-is-being-edited","has-prev","hasNext","offset-start","offset-end","total-number-of-sites","is-loading","search-term","is-searching"])]),Object(i["createVNode"])(u,{modelValue:e.showAddSiteDialog,"onUpdate:modelValue":t[5]||(t[5]=function(t){return e.showAddSiteDialog=t})},{default:Object(i["withCtx"])((function(){return[Object(i["createElementVNode"])("div",B,[Object(i["createElementVNode"])("div",null,[Object(i["createElementVNode"])("h2",null,Object(i["toDisplayString"])(e.translate("SitesManager_ChooseMeasurableTypeHeadline")),1),Object(i["createElementVNode"])("div",z,[Object(i["createElementVNode"])("p",null,[(Object(i["openBlock"])(!0),Object(i["createElementBlock"])(i["Fragment"],null,Object(i["renderList"])(e.availableTypes,(function(t){return Object(i["openBlock"])(),Object(i["createElementBlock"])("button",{type:"button",key:t.id,title:t.description,class:"modal-close btn",onClick:function(n){e.addSite(t.id)},"aria-disabled":"false"},[Object(i["createElementVNode"])("span",Q,Object(i["toDisplayString"])(t.name),1)],8,H)})),128))])])])])]})),_:1},8,["modelValue"]),Object(i["createElementVNode"])("div",F,[e.activeSearchTerm&&0===e.sites.length&&!e.isLoading?(Object(i["openBlock"])(),Object(i["createElementBlock"])("p",R,[Object(i["createTextVNode"])(Object(i["toDisplayString"])(e.translate("SitesManager_NotFound"))+" ",1),Object(i["createElementVNode"])("strong",null,Object(i["toDisplayString"])(e.activeSearchTerm),1)])):Object(i["createCommentVNode"])("",!0),(Object(i["openBlock"])(!0),Object(i["createElementBlock"])(i["Fragment"],null,Object(i["renderList"])(e.sites,(function(n,a){return Object(i["openBlock"])(),Object(i["createElementBlock"])("div",{key:n.idsite},[Object(i["createVNode"])(d,{site:n,"timezone-support-enabled":e.timezoneSupportEnabled,"utc-time":e.utcTime,"global-settings":e.globalSettings,onEditSite:t[6]||(t[6]=function(e){return l.isSiteBeingEdited=!0}),onCancelEditSite:t[7]||(t[7]=function(t){return e.afterCancelEdit(t)}),onDelete:t[8]||(t[8]=function(t){return e.afterDelete(t)}),onSave:function(t){return e.afterSave(t.site,t.settingValues,a,t.isNew)}},null,8,["site","timezone-support-enabled","utc-time","global-settings","onSave"])])})),128))]),Object(i["createElementVNode"])("div",W,[Object(i["createVNode"])(c,{"site-is-being-edited":e.isSiteBeingEdited,"has-prev":e.hasPrev,hasNext:e.hasNext,"offset-start":e.offsetStart,"offset-end":e.offsetEnd,"total-number-of-sites":e.totalNumberOfSites,"is-loading":e.isLoading,"search-term":e.searchTerm,"is-searching":!!e.activeSearchTerm,"onUpdate:searchTerm":t[9]||(t[9]=function(t){return e.searchTerm=t}),onAdd:t[10]||(t[10]=function(t){return e.addNewEntity()}),onSearch:t[11]||(t[11]=function(t){return e.searchSites(t)}),onPrev:t[12]||(t[12]=function(t){return e.previousPage()}),onNext:t[13]||(t[13]=function(t){return e.nextPage()})},null,8,["site-is-being-edited","has-prev","hasNext","offset-start","offset-end","total-number-of-sites","is-loading","search-term","is-searching"])])],512)}var K={class:"sitesButtonBar clearfix"},q={class:"search"},Y=["value","placeholder","disabled"],X=["title"],J={class:"paging"},Z=["disabled"],ee={style:{cursor:"pointer"}},te={class:"counter"},ne=["disabled"],ae={style:{cursor:"pointer"},class:"pointer"};function re(e,t,n,a,r,o){return Object(i["openBlock"])(),Object(i["createElementBlock"])("div",K,[Object(i["withDirectives"])(Object(i["createElementVNode"])("a",{class:Object(i["normalizeClass"])(["btn addSite",{disabled:e.siteIsBeingEdited}]),onClick:t[0]||(t[0]=function(t){return e.addNewEntity()}),tabindex:"1"},Object(i["toDisplayString"])(e.availableTypes.length>1?e.translate("SitesManager_AddMeasurable"):e.translate("SitesManager_AddSite")),3),[[i["vShow"],e.hasSuperUserAccess&&e.availableTypes]]),Object(i["withDirectives"])(Object(i["createElementVNode"])("div",q,[Object(i["createElementVNode"])("input",{value:e.searchTerm,onKeydown:t[1]||(t[1]=function(t){return e.onKeydown(t)}),placeholder:e.translate("Actions_SubmenuSitesearch"),type:"text",disabled:e.siteIsBeingEdited},null,40,Y),Object(i["createElementVNode"])("div",{onClick:t[2]||(t[2]=function(t){return e.searchSite()}),title:e.translate("General_ClickToSearch"),class:"search_ico icon-search"},null,8,X)],512),[[i["vShow"],e.hasPrev||e.hasNext||e.isSearching]]),Object(i["withDirectives"])(Object(i["createElementVNode"])("div",J,[Object(i["createElementVNode"])("a",{class:"btn prev",disabled:!(e.hasPrev&&!e.isLoading&&!e.siteIsBeingEdited)||void 0,onClick:t[3]||(t[3]=function(t){return e.previousPage()})},[Object(i["createElementVNode"])("span",ee,"« "+Object(i["toDisplayString"])(e.translate("General_Previous")),1)],8,Z),Object(i["withDirectives"])(Object(i["createElementVNode"])("span",te,[Object(i["createElementVNode"])("span",null,Object(i["toDisplayString"])(e.paginationText),1)],512),[[i["vShow"],e.hasPrev||e.hasNext]]),Object(i["createElementVNode"])("a",{class:"btn next",disabled:!(e.hasNext&&!e.isLoading&&!e.siteIsBeingEdited)||void 0,onClick:t[4]||(t[4]=function(t){return e.nextPage()})},[Object(i["createElementVNode"])("span",ae,Object(i["toDisplayString"])(e.translate("General_Next"))+" »",1)],8,ne)],512),[[i["vShow"],e.hasPrev||e.hasNext]])])}var ie=Object(i["defineComponent"])({props:{siteIsBeingEdited:{type:Boolean,required:!0},hasPrev:{type:Boolean,required:!0},hasNext:{type:Boolean,required:!0},offsetStart:{type:Number,required:!0},offsetEnd:{type:Number,required:!0},totalNumberOfSites:{type:Number},isLoading:{type:Boolean,required:!0},searchTerm:{type:String,required:!0},isSearching:{type:Boolean,required:!0}},emits:["add","search","prev","next","update:searchTerm"],created:function(){h.init(),this.onKeydown=Object(o["debounce"])(this.onKeydown,50)},computed:{hasSuperUserAccess:function(){return o["Matomo"].hasSuperUserAccess},availableTypes:function(){return h.types.value},paginationText:function(){var e;return e=this.isSearching?Object(o["translate"])("General_PaginationWithoutTotal","".concat(this.offsetStart),"".concat(this.offsetEnd)):Object(o["translate"])("General_Pagination","".concat(this.offsetStart),"".concat(this.offsetEnd),null===this.totalNumberOfSites?"?":"".concat(this.totalNumberOfSites))," ".concat(e," ")}},methods:{addNewEntity:function(){this.$emit("add")},searchSite:function(){this.siteIsBeingEdited||this.$emit("search")},previousPage:function(){this.$emit("prev")},nextPage:function(){this.$emit("next")},onKeydown:function(e){var t=this;setTimeout((function(){"Enter"!==e.key?t.$emit("update:searchTerm",e.target.value):t.searchSiteOnEnter(e)}))},searchSiteOnEnter:function(e){e.preventDefault(),this.searchSite()}}});ie.render=re;var oe=ie,le=["idsite","type"],se={class:"card-content"},ce={key:0,class:"row"},ue={class:"col m3"},de={class:"title"},me={class:"title"},be=["target","title","href"],he={class:"col m4"},pe={class:"title"},ge={class:"title"},fe={class:"title"},Se={class:"title"},Oe={class:"col m4"},je={class:"title"},ye=Object(i["createTextVNode"])(": "),ve=["href"],Ee={key:0},xe={class:"title"},Ne={key:1},Ve={class:"title"},Me={key:2},Te={class:"title"},we={class:"col m1 text-right"},Pe=["title"],Ce=Object(i["createElementVNode"])("span",{class:"icon-edit"},null,-1),ke=[Ce],De=["title"],_e=Object(i["createElementVNode"])("span",{class:"icon-delete"},null,-1),Ge=[_e],Ae={key:1},Le={class:"form-group row"},Ue={class:"col s12 m6 input-field"},Ie=["placeholder"],Be=Object(i["createElementVNode"])("div",{class:"col s12 m6"},null,-1),ze={id:"timezoneHelpText",class:"inline-help-node"},He={key:0},Qe=Object(i["createElementVNode"])("br",null,null,-1),Fe=Object(i["createElementVNode"])("br",null,null,-1),Re={class:"editingSiteFooter"},We=["disabled","value"],$e=["disabled"],Ke=["innerHTML"];function qe(e,t,n,a,r,o){var l,s,c,u=Object(i["resolveComponent"])("ActivityIndicator"),d=Object(i["resolveComponent"])("GroupedSettings"),m=Object(i["resolveComponent"])("Field"),b=Object(i["resolveComponent"])("PasswordConfirmation");return Object(i["openBlock"])(),Object(i["createElementBlock"])("div",{class:Object(i["normalizeClass"])(["site card hoverable",{editingSite:!!e.editMode}]),idsite:e.theSite.idsite,type:e.theSite.type,ref:"root"},[Object(i["createElementVNode"])("div",se,[e.editMode?Object(i["createCommentVNode"])("",!0):(Object(i["openBlock"])(),Object(i["createElementBlock"])("div",ce,[Object(i["createElementVNode"])("div",ue,[Object(i["createElementVNode"])("h4",null,Object(i["toDisplayString"])(e.theSite.name),1),Object(i["createElementVNode"])("ul",null,[Object(i["createElementVNode"])("li",null,[Object(i["createElementVNode"])("span",de,Object(i["toDisplayString"])(e.translate("General_Id"))+":",1),Object(i["createTextVNode"])(" "+Object(i["toDisplayString"])(e.theSite.idsite),1)]),Object(i["withDirectives"])(Object(i["createElementVNode"])("li",null,[Object(i["createElementVNode"])("span",me,Object(i["toDisplayString"])(e.translate("SitesManager_Type"))+":",1),Object(i["createTextVNode"])(" "+Object(i["toDisplayString"])(e.currentType.name),1)],512),[[i["vShow"],e.availableTypes.length>1]]),Object(i["withDirectives"])(Object(i["createElementVNode"])("li",null,[Object(i["createElementVNode"])("a",{target:e.isInternalSetupUrl?"_self":"_blank",title:e.translate("SitesManager_ShowTrackingTag"),href:e.setupUrl},Object(i["toDisplayString"])(e.translate("SitesManager_ShowTrackingTag")),9,be)],512),[[i["vShow"],e.theSite.idsite&&e.howToSetupUrl]])])]),Object(i["createElementVNode"])("div",he,[Object(i["createElementVNode"])("ul",null,[Object(i["createElementVNode"])("li",null,[Object(i["createElementVNode"])("span",pe,Object(i["toDisplayString"])(e.translate("SitesManager_Timezone"))+":",1),Object(i["createTextVNode"])(" "+Object(i["toDisplayString"])(e.theSite.timezone_name),1)]),Object(i["createElementVNode"])("li",null,[Object(i["createElementVNode"])("span",ge,Object(i["toDisplayString"])(e.translate("SitesManager_Currency"))+":",1),Object(i["createTextVNode"])(" "+Object(i["toDisplayString"])(e.theSite.currency_name),1)]),Object(i["withDirectives"])(Object(i["createElementVNode"])("li",null,[Object(i["createElementVNode"])("span",fe,Object(i["toDisplayString"])(e.translate("Goals_Ecommerce"))+":",1),Object(i["createTextVNode"])(" "+Object(i["toDisplayString"])(e.translate("General_Yes")),1)],512),[[i["vShow"],1===e.theSite.ecommerce||"1"===e.theSite.ecommerce]]),Object(i["withDirectives"])(Object(i["createElementVNode"])("li",null,[Object(i["createElementVNode"])("span",Se,Object(i["toDisplayString"])(e.translate("Actions_SubmenuSitesearch"))+":",1),Object(i["createTextVNode"])(" "+Object(i["toDisplayString"])(e.translate("General_Yes")),1)],512),[[i["vShow"],1===e.theSite.sitesearch||"1"===e.theSite.sitesearch]])])]),Object(i["createElementVNode"])("div",Oe,[Object(i["createElementVNode"])("ul",null,[Object(i["createElementVNode"])("li",null,[Object(i["createElementVNode"])("span",je,Object(i["toDisplayString"])(e.translate("SitesManager_Urls")),1),ye,(Object(i["openBlock"])(!0),Object(i["createElementBlock"])(i["Fragment"],null,Object(i["renderList"])(e.theSite.alias_urls,(function(t,n){return Object(i["openBlock"])(),Object(i["createElementBlock"])("span",{key:t},[Object(i["createElementVNode"])("a",{target:"_blank",rel:"noreferrer noopener",href:t},Object(i["toDisplayString"])(t)+Object(i["toDisplayString"])(n===e.theSite.alias_urls.length-1?"":", "),9,ve)])})),128))]),null!==(l=e.theSite.excluded_ips)&&void 0!==l&&l.length?(Object(i["openBlock"])(),Object(i["createElementBlock"])("li",Ee,[Object(i["createElementVNode"])("span",xe,Object(i["toDisplayString"])(e.translate("SitesManager_ExcludedIps"))+":",1),Object(i["createTextVNode"])(" "+Object(i["toDisplayString"])(e.theSite.excluded_ips.split(/\s*,\s*/g).join(", ")),1)])):Object(i["createCommentVNode"])("",!0),null!==(s=e.theSite.excluded_parameters)&&void 0!==s&&s.length?(Object(i["openBlock"])(),Object(i["createElementBlock"])("li",Ne,[Object(i["createElementVNode"])("span",Ve,Object(i["toDisplayString"])(e.translate("SitesManager_ExcludedParameters"))+":",1),Object(i["createTextVNode"])(" "+Object(i["toDisplayString"])(e.theSite.excluded_parameters.split(/\s*,\s*/g).join(", ")),1)])):Object(i["createCommentVNode"])("",!0),null!==(c=e.theSite.excluded_user_agents)&&void 0!==c&&c.length?(Object(i["openBlock"])(),Object(i["createElementBlock"])("li",Me,[Object(i["createElementVNode"])("span",Te,Object(i["toDisplayString"])(e.translate("SitesManager_ExcludedUserAgents"))+":",1),Object(i["createTextVNode"])(" "+Object(i["toDisplayString"])(e.theSite.excluded_user_agents.split(/\s*,\s*/g).join(", ")),1)])):Object(i["createCommentVNode"])("",!0)])]),Object(i["createElementVNode"])("div",we,[Object(i["createElementVNode"])("ul",null,[Object(i["createElementVNode"])("li",null,[Object(i["createElementVNode"])("button",{class:"table-action",onClick:t[0]||(t[0]=function(t){return e.editSite()}),title:e.translate("General_Edit")},ke,8,Pe)]),Object(i["createElementVNode"])("li",null,[Object(i["withDirectives"])(Object(i["createElementVNode"])("button",{class:"table-action",onClick:t[1]||(t[1]=function(t){return e.getMessagesToWarnOnSiteRemoval()}),title:e.translate("General_Delete")},Ge,8,De),[[i["vShow"],e.theSite.idsite]])])])])])),e.editMode?(Object(i["openBlock"])(),Object(i["createElementBlock"])("div",Ae,[Object(i["createElementVNode"])("div",Le,[Object(i["createElementVNode"])("div",Ue,[Object(i["withDirectives"])(Object(i["createElementVNode"])("input",{type:"text","onUpdate:modelValue":t[2]||(t[2]=function(t){return e.theSite.name=t}),maxlength:"90",placeholder:e.translate("General_Name")},null,8,Ie),[[i["vModelText"],e.theSite.name]]),Object(i["createElementVNode"])("label",null,Object(i["toDisplayString"])(e.translate("General_Name")),1)]),Be]),Object(i["createVNode"])(u,{loading:e.isLoading},null,8,["loading"]),(Object(i["openBlock"])(!0),Object(i["createElementBlock"])(i["Fragment"],null,Object(i["renderList"])(e.measurableSettings,(function(t){return Object(i["openBlock"])(),Object(i["createElementBlock"])("div",{key:t.pluginName},[Object(i["createVNode"])(d,{"group-name":t.pluginName,settings:t.settings,"all-setting-values":e.settingValues,onChange:function(n){return e.settingValues["".concat(t.pluginName,".").concat(n.name)]=n.value}},null,8,["group-name","settings","all-setting-values","onChange"])])})),128)),Object(i["createVNode"])(m,{uicontrol:"select",name:"currency",modelValue:e.theSite.currency,"onUpdate:modelValue":t[3]||(t[3]=function(t){return e.theSite.currency=t}),title:e.translate("SitesManager_Currency"),"inline-help":e.translate("SitesManager_CurrencySymbolWillBeUsedForGoals"),options:e.currencies},null,8,["modelValue","title","inline-help","options"]),Object(i["createVNode"])(m,{uicontrol:"select",name:"timezone",modelValue:e.theSite.timezone,"onUpdate:modelValue":t[4]||(t[4]=function(t){return e.theSite.timezone=t}),title:e.translate("SitesManager_Timezone"),"inline-help":"#timezoneHelpText",options:e.timezones},null,8,["modelValue","title","options"]),Object(i["createElementVNode"])("div",ze,[Object(i["createElementVNode"])("div",null,[e.timezoneSupportEnabled?Object(i["createCommentVNode"])("",!0):(Object(i["openBlock"])(),Object(i["createElementBlock"])("span",He,[Object(i["createTextVNode"])(Object(i["toDisplayString"])(e.translate("SitesManager_AdvancedTimezoneSupportNotFound"))+" ",1),Qe])),Object(i["createTextVNode"])(" "+Object(i["toDisplayString"])(e.utcTimeIs)+" ",1),Fe,Object(i["createTextVNode"])(" "+Object(i["toDisplayString"])(e.translate("SitesManager_ChangingYourTimezoneWillOnlyAffectDataForward")),1)])]),Object(i["createElementVNode"])("div",Re,[Object(i["withDirectives"])(Object(i["createElementVNode"])("input",{disabled:e.isSaving,type:"submit",class:"btn",value:e.translate("General_Save"),onClick:t[5]||(t[5]=function(t){return e.saveSite()})},null,8,We),[[i["vShow"],!e.isLoading]]),Object(i["createElementVNode"])("button",{class:"btn btn-link",disabled:e.isSaving,onClick:t[6]||(t[6]=function(t){return e.cancelEditSite(e.site)})},Object(i["toDisplayString"])(e.translate("General_Cancel","","")),9,$e)])])):Object(i["createCommentVNode"])("",!0)]),Object(i["createVNode"])(b,{modelValue:e.showRemoveDialog,"onUpdate:modelValue":t[7]||(t[7]=function(t){return e.showRemoveDialog=t}),onConfirmed:e.deleteSite},{default:Object(i["withCtx"])((function(){return[Object(i["createElementVNode"])("h2",null,Object(i["toDisplayString"])(e.removeDialogTitle),1),Object(i["createElementVNode"])("p",null,Object(i["toDisplayString"])(e.translate("SitesManager_DeleteSiteExplanation")),1),e.deleteSiteExplanation?(Object(i["openBlock"])(),Object(i["createElementBlock"])("p",{key:0,innerHTML:e.$sanitize(e.deleteSiteExplanation)},null,8,Ke)):Object(i["createCommentVNode"])("",!0)]})),_:1},8,["modelValue","onConfirmed"])],10,le)}var Ye=n("a5a2");function Xe(e,t){return nt(e)||tt(e,t)||Ze(e,t)||Je()}function Je(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function Ze(e,t){if(e){if("string"===typeof e)return et(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?et(e,t):void 0}}function et(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,a=new Array(t);n<t;n++)a[n]=e[n];return a}function tt(e,t){var n=null==e?null:"undefined"!==typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var a,r,i=[],o=!0,l=!1;try{for(n=n.call(e);!(o=(a=n.next()).done);o=!0)if(i.push(a.value),t&&i.length===t)break}catch(s){l=!0,r=s}finally{try{o||null==n["return"]||n["return"]()}finally{if(l)throw r}}return i}}function nt(e){if(Array.isArray(e))return e}var at=Object(i["computed"])((function(){return k.timezones.value.map((function(e){var t=e.group,n=e.label,a=e.code;return{group:t,key:n,value:a}}))}));function rt(e){return"undefined"===typeof e.idsite}var it=Object(i["defineComponent"])({props:{site:{type:Object,required:!0},timezoneSupportEnabled:{type:Boolean},utcTime:{type:Date,required:!0},globalSettings:{type:Object,required:!0}},data:function(){return{isLoading:!1,isSaving:!1,editMode:!1,theSite:Object.assign({},this.site),measurableSettings:[],settingValues:{},showRemoveDialog:!1,deleteSiteExplanation:""}},components:{PasswordConfirmation:Ye["PasswordConfirmation"],Field:Ye["Field"],GroupedSettings:Ye["GroupedSettings"],ActivityIndicator:o["ActivityIndicator"]},emits:["delete","editSite","cancelEditSite","save"],created:function(){j.init(),k.init(),h.init(),this.onSiteChanged()},watch:{site:function(){this.onSiteChanged()},measurableSettings:function(e){if(e.length){var t={};e.forEach((function(e){e.settings.forEach((function(n){t["".concat(e.pluginName,".").concat(n.name)]=n.value}))})),this.settingValues=t}}},methods:{onSiteChanged:function(){var e=this.site;this.theSite=Object.assign({},e);var t=rt(e);if(t){var n=this.globalSettings;this.theSite.timezone=n.defaultTimezone,this.theSite.currency=n.defaultCurrency}var a=h.getEditSiteIdParameter();(t||a&&"".concat(e.idsite)===a)&&this.editSite()},editSite:function(){var e=this;if(this.editMode=!0,this.$emit("editSite",{idSite:this.theSite.idsite}),this.measurableSettings=[],rt(this.theSite)){if(!this.currentType)return;this.measurableSettings=this.currentType.settings||[]}else this.isLoading=!0,o["AjaxHelper"].fetch({method:"SitesManager.getSiteSettings",idSite:this.theSite.idsite}).then((function(t){e.measurableSettings=t})).finally((function(){e.isLoading=!1}))},saveSite:function(){var e=this;if(!this.isSaving){this.isSaving=!0;var t={siteName:this.theSite.name,timezone:this.theSite.timezone,currency:this.theSite.currency,type:this.theSite.type,settingValues:{}},n=rt(this.theSite),a="SitesManager.addSite";n||(a="SitesManager.updateSite",t.idSite=this.theSite.idsite),Object.entries(this.settingValues).forEach((function(e){var n=Xe(e,2),a=n[0],r=n[1],i=a.split("."),o=Xe(i,2),l=o[0],s=o[1],c=t.settingValues;c[l]||(c[l]=[]);var u=r;!1===r?u="0":!0===r?u="1":Array.isArray(r)&&(u=r.filter((function(e){return!!e}))),c[l].push({name:s,value:u})})),o["AjaxHelper"].post({method:a},t).then((function(a){e.editMode=!1,!e.theSite.idsite&&a&&a.value&&(e.theSite.idsite="".concat(a.value));var r=k.timezones.value.find((function(t){return t.code===e.theSite.timezone}));e.theSite.timezone_name=(null===r||void 0===r?void 0:r.label)||e.theSite.timezone,e.theSite.currency&&(e.theSite.currency_name=j.currencies.value[e.theSite.currency]);var i=o["NotificationsStore"].show({message:n?Object(o["translate"])("SitesManager_WebsiteCreated"):Object(o["translate"])("SitesManager_WebsiteUpdated"),context:"success",id:"websitecreated",type:"transient"});o["NotificationsStore"].scrollToNotification(i),h.removeEditSiteIdParameterFromHash(),e.$emit("save",{site:e.theSite,settingValues:t.settingValues,isNew:n})})).finally((function(){e.isSaving=!1}))}},cancelEditSite:function(e){this.editMode=!1,h.removeEditSiteIdParameterFromHash(),this.$emit("cancelEditSite",{site:e,element:this.$refs.root})},deleteSite:function(e){var t=this;o["AjaxHelper"].post({idSite:this.theSite.idsite,module:"API",format:"json",method:"SitesManager.deleteSite"},{passwordConfirmation:e}).then((function(){t.$emit("delete",t.theSite)}))},getMessagesToWarnOnSiteRemoval:function(){var e=this;o["AjaxHelper"].post({idSite:this.theSite.idsite,module:"API",format:"json",method:"SitesManager.getMessagesToWarnOnSiteRemoval"}).then((function(t){e.deleteSiteExplanation="",t.length&&(e.deleteSiteExplanation+=t.join("<br>")),e.showRemoveDialog=!0}))}},computed:{availableTypes:function(){return h.types.value},setupUrl:function(){var e=this.theSite,t="",n="";return this.isInternalSetupUrl&&(t=o["MatomoUrl"].stringify({idSite:e.idsite,period:o["MatomoUrl"].parsed.value.period,date:o["MatomoUrl"].parsed.value.date,updated:"false"}),n=-1===this.howToSetupUrl.indexOf("?")?"?":"&"),"".concat(this.howToSetupUrl).concat(n).concat(t)},utcTimeIs:function(){var e=this.utcTime,t=function(e){return e.toString().padStart(2,"0")},n=t(e.getHours()),a=t(e.getMinutes()),r=t(e.getSeconds()),i="".concat(Object(o["format"])(this.utcTime)," ").concat(n,":").concat(a,":").concat(r);return Object(o["translate"])("SitesManager_UTCTimeIs",i)},timezones:function(){return at.value},currencies:function(){return j.currencies.value},currentType:function(){var e=this.site,t=h.typesById.value[e.type];return t||{name:e.type}},howToSetupUrl:function(){var e=this.currentType;if(e)return e.howToSetupUrl},isInternalSetupUrl:function(){var e=this.howToSetupUrl;return!!e&&"?"==="".concat(e).substring(0,1)},removeDialogTitle:function(){return Object(o["translate"])("SitesManager_DeleteConfirm",'"'.concat(this.theSite.name,'" (idSite = ').concat(this.theSite.idsite,")"))}}});it.render=qe;var ot=it;function lt(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function st(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}function ct(e,t,n){return t&&st(e.prototype,t),n&&st(e,n),e}function ut(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}
/*!
 * Matomo - free/libre analytics platform
 *
 * @link    https://matomo.org
 * @license https://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
 */var dt=function(){function e(){var t=this;lt(this,e),ut(this,"privateState",Object(i["reactive"])({isLoading:!1,globalSettings:{keepURLFragmentsGlobal:!1,defaultCurrency:"",defaultTimezone:"",excludedIpsGlobal:"",excludedQueryParametersGlobal:"",excludedUserAgentsGlobal:"",excludedReferrersGlobal:"",searchKeywordParametersGlobal:"",searchCategoryParametersGlobal:"",exclusionTypeForQueryParams:""}})),ut(this,"isLoading",Object(i["computed"])((function(){return Object(i["readonly"])(t.privateState).isLoading}))),ut(this,"globalSettings",Object(i["computed"])((function(){return Object(i["readonly"])(t.privateState).globalSettings})))}return ct(e,[{key:"init",value:function(){return this.fetchGlobalSettings()}},{key:"saveGlobalSettings",value:function(e){var t=this;return this.privateState.isLoading=!0,o["AjaxHelper"].post({module:"SitesManager",format:"json",action:"setGlobalSettings"},e,{withTokenInUrl:!0}).finally((function(){t.privateState.isLoading=!1}))}},{key:"fetchGlobalSettings",value:function(){var e=this;this.privateState.isLoading=!0,o["AjaxHelper"].fetch({module:"SitesManager",action:"getGlobalSettings"}).then((function(t){e.privateState.globalSettings=Object.assign(Object.assign({},t),{},{excludedIpsGlobal:t.excludedIpsGlobal||"",excludedQueryParametersGlobal:t.excludedQueryParametersGlobal||"",excludedUserAgentsGlobal:t.excludedUserAgentsGlobal||"",excludedReferrersGlobal:t.excludedReferrersGlobal||"",searchKeywordParametersGlobal:t.searchKeywordParametersGlobal||"",searchCategoryParametersGlobal:t.searchCategoryParametersGlobal||"",exclusionTypeForQueryParams:t.exclusionTypeForQueryParams||""})})).finally((function(){e.privateState.isLoading=!1}))}}]),e}(),mt=new dt,bt=Object(i["defineComponent"])({props:{dummy:String},components:{MatomoDialog:o["MatomoDialog"],ButtonBar:oe,SiteFields:ot,EnrichedHeadline:o["EnrichedHeadline"]},directives:{ContentIntro:o["ContentIntro"]},data:function(){var e=new Date,t=new Date(e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate(),e.getUTCHours(),e.getUTCMinutes(),e.getUTCSeconds());return{pageSize:10,currentPage:0,showAddSiteDialog:!1,searchTerm:"",activeSearchTerm:"",fetchedSites:[],isLoadingInitialEntities:!1,utcTime:t,totalNumberOfSites:null,isSiteBeingEdited:!1,fetchLimitedSitesAbortController:null}},created:function(){var e=this;k.init(),h.init(),mt.init(),this.isLoadingInitialEntities=!0,Promise.all([h.fetchAvailableTypes(),this.fetchLimitedSitesWithAdminAccess(),this.getTotalNumberOfSites()]).then((function(){e.triggerAddSiteIfRequested()})).finally((function(){e.isLoadingInitialEntities=!1})),Object(i["watch"])((function(){return o["MatomoUrl"].hashQuery.value}),(function(){e.checkGlobalSettingsHash()}))},computed:{sites:function(){var e=this.fetchedSites.filter((function(e){return!e.idsite})).length;return this.fetchedSites.slice(0,this.pageSize+e)},isLoading:function(){return!!this.fetchLimitedSitesAbortController||this.isLoadingInitialEntities||null===this.totalNumberOfSites||h.isLoading.value||k.isLoading.value||mt.isLoading.value},availableTypes:function(){return h.types.value},timezoneSupportEnabled:function(){return k.timezoneSupportEnabled.value},globalSettings:function(){return mt.globalSettings.value},headlineText:function(){return Object(o["translate"])("SitesManager_XManagement",this.availableTypes.length>1?Object(o["translate"])("General_Measurables"):Object(o["translate"])("SitesManager_Sites"))},mainDescription:function(){return Object(o["translate"])("SitesManager_YouCurrentlyHaveAccessToNWebsites","<strong>".concat(this.totalNumberOfSites,"</strong>"))},hasSuperUserAccess:function(){return o["Matomo"].hasSuperUserAccess},superUserAccessMessage:function(){return Object(o["translate"])("SitesManager_SuperUserAccessCan","<a href='#globalSettings'>","</a>")},hasPrev:function(){return this.currentPage>=1},hasNext:function(){return this.fetchedSites.filter((function(e){return!!e.idsite})).length>=this.pageSize+1},offsetStart:function(){return this.currentPage*this.pageSize+1},offsetEnd:function(){return this.offsetStart+this.sites.filter((function(e){return!!e.idsite})).length-1}},methods:{checkGlobalSettingsHash:function(){var e=o["MatomoUrl"].hashQuery.value;!o["Matomo"].hasSuperUserAccess||"globalSettings"!==e&&"/globalSettings"!==e||o["MatomoUrl"].updateLocation(Object.assign(Object.assign({},o["MatomoUrl"].urlParsed.value),{},{action:"globalSettings"}))},addNewEntity:function(){this.availableTypes.length>1?this.showAddSiteDialog=!0:1===this.availableTypes.length&&this.addSite(this.availableTypes[0].id)},addSite:function(e){var t=e,n={isAllowed:!0,measurableType:t};o["Matomo"].postEvent("SitesManager.initAddSite",n),n&&!n.isAllowed||(t||(t="website"),this.fetchedSites.unshift({type:t}),this.isSiteBeingEdited=!0)},afterCancelEdit:function(e){var t=e.site,n=e.element;this.isSiteBeingEdited=!1,t.idsite?n.scrollIntoView():this.fetchedSites=this.fetchedSites.filter((function(e){return!!e.idsite}))},fetchLimitedSitesWithAdminAccess:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";this.fetchLimitedSitesAbortController&&this.fetchLimitedSitesAbortController.abort(),this.fetchLimitedSitesAbortController=new AbortController;var n=this.pageSize+1,a=this.currentPage*this.pageSize,r={method:"SitesManager.getSitesWithAdminAccess",fetchAliasUrls:1,limit:n+a,filter_offset:a,filter_limit:n};return t&&(r.pattern=t),o["AjaxHelper"].fetch(r).then((function(t){e.fetchedSites=t||[]})).then((function(n){return e.activeSearchTerm=t,n})).finally((function(){e.fetchLimitedSitesAbortController=null}))},getTotalNumberOfSites:function(){var e=this;return o["AjaxHelper"].fetch({method:"SitesManager.getSitesIdWithAdminAccess",filter_limit:"-1"}).then((function(t){e.totalNumberOfSites=t.length}))},triggerAddSiteIfRequested:function(){var e=h.getEditSiteIdParameter(),t=o["MatomoUrl"].urlParsed.value.showaddsite;"1"===t?this.addNewEntity():e&&(this.searchTerm=e,this.fetchLimitedSitesWithAdminAccess(this.searchTerm))},previousPage:function(){this.currentPage=Math.max(0,this.currentPage-1),this.fetchLimitedSitesWithAdminAccess(this.activeSearchTerm)},nextPage:function(){this.currentPage=Math.max(0,this.currentPage+1),this.fetchLimitedSitesWithAdminAccess(this.activeSearchTerm)},searchSites:function(){this.currentPage=0,this.fetchLimitedSitesWithAdminAccess(this.searchTerm)},afterDelete:function(e){var t={showaddsite:0};if(o["MatomoUrl"].urlParsed.value.idSite==="".concat(e.idsite)){var n=this.sites.find((function(t){return t.idsite!==e.idsite}));n&&(t=Object.assign(Object.assign({},t),{},{idSite:n.idsite}))}o["Matomo"].helper.redirect(t)},afterSave:function(e,t,n,a){var r=["excluded_ips","excluded_parameters","excluded_user_agents","sitesearch_keyword_parameters","sitesearch_category_parameters"],i=Object.assign({},e);Object.values(t).forEach((function(e){e.forEach((function(e){"urls"===e.name?i.alias_urls=e.value:-1!==r.indexOf(e.name)?i[e.name]=e.value.join(", "):i[e.name]=e.value}))})),this.fetchedSites[n]=i,a&&null!==this.totalNumberOfSites&&(this.totalNumberOfSites+=1),this.isSiteBeingEdited=!1}}});bt.render=$;var ht=bt,pt={class:"SitesManager"},gt=Object(i["createElementVNode"])("a",{name:"globalSettings",id:"globalSettings"},null,-1),ft={id:"excludedIpsGlobalHelp",class:"inline-help-node"},St=Object(i["createElementVNode"])("br",null,null,-1),Ot=Object(i["createElementVNode"])("br",null,null,-1),jt=["innerHTML"],yt={id:"excludedUserAgentsGlobalHelp",class:"inline-help-node"},vt=Object(i["createElementVNode"])("br",null,null,-1),Et=Object(i["createElementVNode"])("br",null,null,-1),xt={id:"excludedReferrersGlobalHelp",class:"inline-help-node"},Nt=Object(i["createElementVNode"])("br",null,null,-1),Vt=Object(i["createElementVNode"])("br",null,null,-1),Mt=Object(i["createElementVNode"])("br",null,null,-1),Tt=Object(i["createElementVNode"])("br",null,null,-1),wt=Object(i["createElementVNode"])("br",null,null,-1),Pt={id:"timezoneHelp",class:"inline-help-node"},Ct={key:0},kt=Object(i["createElementVNode"])("br",null,null,-1),Dt=Object(i["createElementVNode"])("br",null,null,-1),_t={id:"keepURLFragmentsHelp",class:"inline-help-node"},Gt=["innerHTML"],At={class:"alert alert-info"};function Lt(e,t,n,a,r,o){var l=Object(i["resolveComponent"])("Field"),s=Object(i["resolveComponent"])("ExcludeQueryParameterSettings"),c=Object(i["resolveComponent"])("SaveButton"),u=Object(i["resolveComponent"])("ContentBlock");return Object(i["openBlock"])(),Object(i["createElementBlock"])("div",pt,[Object(i["withDirectives"])(Object(i["createVNode"])(u,{"content-title":e.translate("SitesManager_GlobalWebsitesSettings")},{default:Object(i["withCtx"])((function(){return[gt,Object(i["createElementVNode"])("div",ft,[Object(i["createElementVNode"])("div",null,[Object(i["createTextVNode"])(Object(i["toDisplayString"])(e.translate("SitesManager_HelpExcludedIpAddresses","1.2.3.4/24","1.2.3.*","1.2.*.*"))+" ",1),St,Ot,Object(i["createElementVNode"])("span",{innerHTML:e.$sanitize(e.yourCurrentIpAddressIs)},null,8,jt)])]),Object(i["createElementVNode"])("div",yt,[Object(i["createElementVNode"])("div",null,[Object(i["createTextVNode"])(Object(i["toDisplayString"])(e.translate("SitesManager_GlobalExcludedUserAgentHelp1"))+" ",1),vt,Et,Object(i["createTextVNode"])(" "+Object(i["toDisplayString"])(e.translate("SitesManager_GlobalListExcludedUserAgents_Desc"))+" "+Object(i["toDisplayString"])(e.translate("SitesManager_GlobalExcludedUserAgentHelp2"))+" "+Object(i["toDisplayString"])(e.translate("SitesManager_GlobalExcludedUserAgentHelp3","/bot|spider|crawl|scanner/i")),1)])]),Object(i["createElementVNode"])("div",xt,[Object(i["createElementVNode"])("div",null,[Object(i["createTextVNode"])(Object(i["toDisplayString"])(e.translate("SitesManager_ExcludedReferrersHelp"))+" ",1),Nt,Vt,Object(i["createTextVNode"])(" "+Object(i["toDisplayString"])(e.translate("SitesManager_ExcludedReferrersHelpDetails"))+" ",1),Mt,Object(i["createTextVNode"])(" "+Object(i["toDisplayString"])(e.translate("SitesManager_ExcludedReferrersHelpExamples","www.example.org","http://example.org/mypath","https://www.example.org/?param=1","https://sub.example.org/"))+" ",1),Tt,wt,Object(i["createTextVNode"])(" "+Object(i["toDisplayString"])(e.translate("SitesManager_ExcludedReferrersHelpSubDomains",".sub.example.org","http://sub.example.org/mypath","https://new.sub.example.org/")),1)])]),Object(i["createElementVNode"])("div",Pt,[Object(i["createElementVNode"])("div",null,[e.timezoneSupportEnabled?Object(i["createCommentVNode"])("",!0):(Object(i["openBlock"])(),Object(i["createElementBlock"])("span",Ct,[Object(i["createTextVNode"])(Object(i["toDisplayString"])(e.translate("SitesManager_AdvancedTimezoneSupportNotFound"))+" ",1),kt])),Object(i["createTextVNode"])(" "+Object(i["toDisplayString"])(e.translate("SitesManager_UTCTimeIs",e.utcTimeDate))+" ",1),Dt,Object(i["createTextVNode"])(" "+Object(i["toDisplayString"])(e.translate("SitesManager_ChangingYourTimezoneWillOnlyAffectDataForward")),1)])]),Object(i["createElementVNode"])("div",_t,[Object(i["createElementVNode"])("div",{innerHTML:e.$sanitize(e.keepUrlFragmentHelp)},null,8,Gt),Object(i["createElementVNode"])("div",null,Object(i["toDisplayString"])(e.translate("SitesManager_KeepURLFragmentsHelp2")),1)]),Object(i["createElementVNode"])("div",null,[Object(i["createVNode"])(l,{uicontrol:"textarea",name:"excludedIpsGlobal","var-type":"array",modelValue:e.excludedIpsGlobal,"onUpdate:modelValue":t[0]||(t[0]=function(t){return e.excludedIpsGlobal=t}),title:e.translate("SitesManager_ListOfIpsToBeExcludedOnAllWebsites"),introduction:e.translate("SitesManager_GlobalListExcludedIps"),"inline-help":"#excludedIpsGlobalHelp",disabled:e.isLoading},null,8,["modelValue","title","introduction","disabled"])]),Object(i["createVNode"])(s,{exclusionTypeForQueryParams:e.exclusionTypeForQueryParams,"onUpdate:exclusionTypeForQueryParams":t[1]||(t[1]=function(t){return e.exclusionTypeForQueryParams=t}),excludedQueryParametersGlobal:e.excludedQueryParametersGlobal,"onUpdate:excludedQueryParametersGlobal":t[2]||(t[2]=function(t){return e.excludedQueryParametersGlobal=t}),commonSensitiveQueryParams:e.commonSensitiveQueryParams},null,8,["exclusionTypeForQueryParams","excludedQueryParametersGlobal","commonSensitiveQueryParams"]),Object(i["createElementVNode"])("div",null,[Object(i["createVNode"])(l,{uicontrol:"textarea",name:"excludedUserAgentsGlobal","var-type":"array",modelValue:e.excludedUserAgentsGlobal,"onUpdate:modelValue":t[3]||(t[3]=function(t){return e.excludedUserAgentsGlobal=t}),title:e.translate("SitesManager_GlobalListExcludedUserAgents_Desc"),introduction:e.translate("SitesManager_GlobalListExcludedUserAgents"),"inline-help":"#excludedUserAgentsGlobalHelp",disabled:e.isLoading},null,8,["modelValue","title","introduction","disabled"])]),Object(i["createElementVNode"])("div",null,[Object(i["createVNode"])(l,{uicontrol:"textarea",name:"excludedReferrersGlobal","var-type":"array",modelValue:e.excludedReferrersGlobal,"onUpdate:modelValue":t[4]||(t[4]=function(t){return e.excludedReferrersGlobal=t}),title:e.translate("SitesManager_GlobalListExcludedReferrersDesc"),introduction:e.translate("SitesManager_GlobalListExcludedReferrers"),"inline-help":"#excludedReferrersGlobalHelp",disabled:e.isLoading},null,8,["modelValue","title","introduction","disabled"])]),Object(i["createElementVNode"])("div",null,[Object(i["createVNode"])(l,{uicontrol:"checkbox",name:"keepURLFragmentsGlobal",modelValue:e.keepURLFragmentsGlobal,"onUpdate:modelValue":t[5]||(t[5]=function(t){return e.keepURLFragmentsGlobal=t}),title:e.translate("SitesManager_KeepURLFragmentsLong"),introduction:e.translate("SitesManager_KeepURLFragments"),"inline-help":"#keepURLFragmentsHelp",disabled:e.isLoading},null,8,["modelValue","title","introduction","disabled"])]),Object(i["createElementVNode"])("h3",null,Object(i["toDisplayString"])(e.translate("SitesManager_TrackingSiteSearch")),1),Object(i["createElementVNode"])("p",null,Object(i["toDisplayString"])(e.translate("SitesManager_SiteSearchUse")),1),Object(i["createElementVNode"])("div",At,Object(i["toDisplayString"])(e.translate("SitesManager_SearchParametersNote"))+" "+Object(i["toDisplayString"])(e.translate("SitesManager_SearchParametersNote2")),1),Object(i["createElementVNode"])("div",null,[Object(i["createVNode"])(l,{uicontrol:"text",name:"searchKeywordParametersGlobal","var-type":"array",modelValue:e.searchKeywordParametersGlobal,"onUpdate:modelValue":t[6]||(t[6]=function(t){return e.searchKeywordParametersGlobal=t}),title:e.translate("SitesManager_SearchKeywordLabel"),"inline-help":e.translate("SitesManager_SearchKeywordParametersDesc"),disabled:e.isLoading},null,8,["modelValue","title","inline-help","disabled"])]),Object(i["createElementVNode"])("div",null,[Object(i["createVNode"])(l,{uicontrol:"text",name:"searchCategoryParametersGlobal","var-type":"array",modelValue:e.searchCategoryParametersGlobal,"onUpdate:modelValue":t[7]||(t[7]=function(t){return e.searchCategoryParametersGlobal=t}),title:e.translate("SitesManager_SearchCategoryLabel"),"inline-help":e.searchCategoryParamsInlineHelp,disabled:e.isLoading},null,8,["modelValue","title","inline-help","disabled"])]),Object(i["createElementVNode"])("div",null,[Object(i["createVNode"])(l,{uicontrol:"select",name:"defaultTimezone",options:e.timezoneOptions,title:e.translate("SitesManager_SelectDefaultTimezone"),introduction:e.translate("SitesManager_DefaultTimezoneForNewWebsites"),"inline-help":"#timezoneHelp",disabled:e.isLoading,modelValue:e.defaultTimezone,"onUpdate:modelValue":t[8]||(t[8]=function(t){return e.defaultTimezone=t})},null,8,["options","title","introduction","disabled","modelValue"])]),Object(i["createElementVNode"])("div",null,[Object(i["createVNode"])(l,{uicontrol:"select",name:"defaultCurrency",modelValue:e.defaultCurrency,"onUpdate:modelValue":t[9]||(t[9]=function(t){return e.defaultCurrency=t}),options:e.currencies,title:e.translate("SitesManager_SelectDefaultCurrency"),introduction:e.translate("SitesManager_DefaultCurrencyForNewWebsites"),"inline-help":e.translate("SitesManager_CurrencySymbolWillBeUsedForGoals"),disabled:e.isLoading},null,8,["modelValue","options","title","introduction","inline-help","disabled"])]),Object(i["createVNode"])(c,{saving:e.isSaving,onConfirm:t[10]||(t[10]=function(t){return e.saveGlobalSettings()})},null,8,["saving"])]})),_:1},8,["content-title"]),[[i["vShow"],e.hasSuperUserAccess]])])}var Ut={class:"siteManagerGlobalExcludedUrlParameters"},It={id:"excludedQueryParametersGlobalHelp",class:"inline-help-node"},Bt={id:"excludedQueryParametersGlobalExclusionTypeHelp",class:"inline-help-node"},zt=Object(i["createElementVNode"])("span",{class:"icon-chevron-down"},null,-1),Ht=Object(i["createElementVNode"])("span",{class:"icon-chevron-up"},null,-1),Qt={key:0},Ft=Object(i["createElementVNode"])("br",null,null,-1),Rt=Object(i["createElementVNode"])("br",null,null,-1),Wt=Object(i["createElementVNode"])("br",null,null,-1),$t=Object(i["createElementVNode"])("br",null,null,-1),Kt=["value"];function qt(e,t,n,a,r,o){var l=Object(i["resolveComponent"])("Field");return Object(i["openBlock"])(),Object(i["createElementBlock"])("div",Ut,[Object(i["createElementVNode"])("div",It,[Object(i["createElementVNode"])("div",null,Object(i["toDisplayString"])(e.translate("SitesManager_ListOfQueryParametersToExclude","/^sess.*|.*[dD]ate$/")),1)]),Object(i["createElementVNode"])("div",Bt,[Object(i["withDirectives"])(Object(i["createElementVNode"])("div",null,Object(i["toDisplayString"])(e.translate("SitesManager_ExclusionTypeDescriptionCommonSessionParameters")),513),[[i["vShow"],"common_session_parameters"===e.localExclusionTypeForQueryParams]]),Object(i["withDirectives"])(Object(i["createElementVNode"])("div",null,[Object(i["createElementVNode"])("p",null,Object(i["toDisplayString"])(e.translate("SitesManager_ExclusionTypeDescriptionMatomoRecommendedPII")),1),Object(i["createElementVNode"])("div",null,[e.showListOfCommonExclusions?Object(i["createCommentVNode"])("",!0):(Object(i["openBlock"])(),Object(i["createElementBlock"])("a",{key:0,href:"javascript:;",onClick:t[0]||(t[0]=Object(i["withModifiers"])((function(t){return e.showListOfCommonExclusions=!0}),["prevent"]))},[Object(i["createTextVNode"])(Object(i["toDisplayString"])(e.translate("SitesManager_ExclusionViewListLink"))+" ",1),zt])),e.showListOfCommonExclusions?(Object(i["openBlock"])(),Object(i["createElementBlock"])("a",{key:1,href:"javascript:;",onClick:t[1]||(t[1]=Object(i["withModifiers"])((function(t){return e.showListOfCommonExclusions=!1}),["prevent"]))},[Object(i["createTextVNode"])(Object(i["toDisplayString"])(e.translate("SitesManager_ExclusionViewListLink"))+" ",1),Ht])):Object(i["createCommentVNode"])("",!0)]),e.showListOfCommonExclusions?(Object(i["openBlock"])(),Object(i["createElementBlock"])("div",Qt,Object(i["toDisplayString"])(e.commonSensitiveQueryParams.join(", ")),1)):Object(i["createCommentVNode"])("",!0),Ft,Rt,Object(i["createTextVNode"])(" "+Object(i["toDisplayString"])(e.translate("SitesManager_MatomoWillAutomaticallyExcludeCommonSessionParametersInAddition","phpsessid, sessionid, ...")),1)],512),[[i["vShow"],"matomo_recommended_pii"===e.localExclusionTypeForQueryParams]]),Object(i["withDirectives"])(Object(i["createElementVNode"])("div",null,[Object(i["createTextVNode"])(Object(i["toDisplayString"])(e.translate("SitesManager_ExclusionTypeDescriptionCustom"))+" ",1),Wt,$t,Object(i["createTextVNode"])(" "+Object(i["toDisplayString"])(e.translate("SitesManager_MatomoWillAutomaticallyExcludeCommonSessionParametersInAddition","phpsessid, sessionid, ...")),1)],512),[[i["vShow"],"custom"===e.localExclusionTypeForQueryParams]])]),Object(i["createElementVNode"])("div",null,[Object(i["createVNode"])(l,{uicontrol:"radio",name:"exclusionType",introduction:e.translate("SitesManager_GlobalListExcludedQueryParameters"),options:e.exclusionTypeOptions,modelValue:e.localExclusionTypeForQueryParams,"onUpdate:modelValue":t[2]||(t[2]=function(t){return e.localExclusionTypeForQueryParams=t}),"inline-help":"#excludedQueryParametersGlobalExclusionTypeHelp"},null,8,["introduction","options","modelValue"])]),Object(i["withDirectives"])(Object(i["createElementVNode"])("div",null,[Object(i["createVNode"])(l,{uicontrol:"textarea",name:"excludedQueryParametersGlobal","var-type":"array",class:"limited-height-scrolling-textarea",modelValue:e.localExcludedQueryParametersGlobal,"onUpdate:modelValue":t[3]||(t[3]=function(t){return e.localExcludedQueryParametersGlobal=t}),"model-value":e.localExcludedQueryParametersGlobal.join("\n"),onInput:t[4]||(t[4]=function(t){return e.onInputExcludedQueryParametersGlobal(t.target.value)}),title:e.translate("SitesManager_ListOfQueryParametersToBeExcludedOnAllWebsites"),"inline-help":"#excludedQueryParametersGlobalHelp"},null,8,["modelValue","model-value","title"]),Object(i["createElementVNode"])("input",{type:"button",onClick:t[5]||(t[5]=function(t){return e.addCommonPIIQueryParams()}),class:"btn",value:e.translate("SitesManager_AddSensibleExclusionsToMyCustomListButtonText")},null,8,Kt)],512),[[i["vShow"],"custom"===e.localExclusionTypeForQueryParams]])])}var Yt=Object(i["defineComponent"])({components:{Field:Ye["Field"]},props:{exclusionTypeForQueryParams:{type:String,default:"common_session_parameters"},excludedQueryParametersGlobal:{type:Array,default:function(){return[]}},commonSensitiveQueryParams:{type:Array,default:function(){return[]}}},data:function(){return{localExclusionTypeForQueryParams:this.exclusionTypeForQueryParams,localExcludedQueryParametersGlobal:this.excludedQueryParametersGlobal,exclusionTypeOptions:[{value:Object(o["translate"])("SitesManager_ExclusionTypeOptionCommonSessionParameters"),key:"common_session_parameters"},{value:Object(o["translate"])("SitesManager_ExclusionTypeOptionMatomoRecommendedPII"),key:"matomo_recommended_pii"},{value:Object(o["translate"])("SitesManager_ExclusionTypeOptionCustom"),key:"custom"}],showListOfCommonExclusions:!1}},watch:{exclusionTypeForQueryParams:{handler:function(e){this.localExclusionTypeForQueryParams=e}},localExclusionTypeForQueryParams:{handler:function(e){this.updateExclusionType(e)},immediate:!0},excludedQueryParametersGlobal:{handler:function(e){this.localExcludedQueryParametersGlobal=e}}},methods:{updateExclusionType:function(e){"custom"!==e&&(this.localExcludedQueryParametersGlobal=[],this.onInputExcludedQueryParametersGlobal("")),this.$emit("update:exclusionTypeForQueryParams",e)},onInputExcludedQueryParametersGlobal:function(e){var t=e.split("\n");this.$emit("update:excludedQueryParametersGlobal",t)},addCommonPIIQueryParams:function(){var e=this,t=this.localExcludedQueryParametersGlobal.filter((function(t){return!e.commonSensitiveQueryParams.includes(t)}));t=t.concat(this.commonSensitiveQueryParams),this.localExcludedQueryParametersGlobal=t,this.$emit("update:excludedQueryParametersGlobal",t)}}});Yt.render=qt;var Xt=Yt,Jt=Object(i["defineComponent"])({components:{ExcludeQueryParameterSettings:Xt,ContentBlock:o["ContentBlock"],Field:Ye["Field"],SaveButton:Ye["SaveButton"]},props:{commonSensitiveQueryParams:{type:Array,default:function(){return[]}}},data:function(){var e=new Date,t=new Date(e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate(),e.getUTCHours(),e.getUTCMinutes(),e.getUTCSeconds()),n=mt.globalSettings.value;return{currentIpAddress:null,utcTime:t,keepURLFragmentsGlobal:n.keepURLFragmentsGlobal,defaultTimezone:n.defaultTimezone,defaultCurrency:n.defaultCurrency,excludedIpsGlobal:(n.excludedIpsGlobal||"").split(","),excludedQueryParametersGlobal:(n.excludedQueryParametersGlobal||"").split(","),excludedUserAgentsGlobal:(n.excludedUserAgentsGlobal||"").split(","),excludedReferrersGlobal:(n.excludedReferrersGlobal||"").split(","),searchKeywordParametersGlobal:(n.searchKeywordParametersGlobal||"").split(","),searchCategoryParametersGlobal:(n.searchCategoryParametersGlobal||"").split(","),isSaving:!1,exclusionTypeForQueryParams:n.exclusionTypeForQueryParams}},created:function(){var e=this;j.init(),k.init(),mt.init(),Object(i["watch"])((function(){return mt.globalSettings.value}),(function(t){e.keepURLFragmentsGlobal=t.keepURLFragmentsGlobal,e.defaultTimezone=t.defaultTimezone,e.defaultCurrency=t.defaultCurrency,e.excludedIpsGlobal=(t.excludedIpsGlobal||"").split(","),e.excludedQueryParametersGlobal=(t.excludedQueryParametersGlobal||"").split(","),e.excludedUserAgentsGlobal=(t.excludedUserAgentsGlobal||"").split(","),e.excludedReferrersGlobal=(t.excludedReferrersGlobal||"").split(","),e.searchKeywordParametersGlobal=(t.searchKeywordParametersGlobal||"").split(","),e.searchCategoryParametersGlobal=(t.searchCategoryParametersGlobal||"").split(","),e.exclusionTypeForQueryParams=t.exclusionTypeForQueryParams})),o["AjaxHelper"].fetch({method:"API.getIpFromHeader"}).then((function(t){e.currentIpAddress=t.value}))},methods:{saveGlobalSettings:function(){var e=this;this.isSaving=!0,mt.saveGlobalSettings({keepURLFragments:this.keepURLFragmentsGlobal,currency:this.defaultCurrency,timezone:this.defaultTimezone,excludedIps:this.excludedIpsGlobal.join(","),excludedQueryParameters:this.excludedQueryParametersGlobal.join(","),excludedUserAgents:this.excludedUserAgentsGlobal.join(","),excludedReferrers:this.excludedReferrersGlobal.join(","),searchKeywordParameters:this.searchKeywordParametersGlobal.join(","),searchCategoryParameters:this.searchCategoryParametersGlobal.join(","),exclusionTypeForQueryParams:this.exclusionTypeForQueryParams}).then((function(){o["Matomo"].helper.redirect({showaddsite:!1})})).finally((function(){e.isSaving=!1}))}},computed:{isLoading:function(){return mt.isLoading.value||k.isLoading.value||j.isLoading.value},timezones:function(){return k.timezones.value},timezoneOptions:function(){return this.timezones.map((function(e){var t=e.group,n=e.label,a=e.code;return{group:t,key:n,value:a}}))},currencies:function(){return j.currencies.value},hasSuperUserAccess:function(){return o["Matomo"].hasSuperUserAccess},yourCurrentIpAddressIs:function(){return Object(o["translate"])("SitesManager_YourCurrentIpAddressIs","<i>".concat(this.currentIpAddress,"</i>"))},timezoneSupportEnabled:function(){return k.timezoneSupportEnabled.value},utcTimeDate:function(){var e=this.utcTime,t=function(e){return e.toString().padStart(2,"0")},n=t(e.getHours()),a=t(e.getMinutes()),r=t(e.getSeconds());return"".concat(Object(o["format"])(this.utcTime)," ").concat(n,":").concat(a,":").concat(r)},keepUrlFragmentHelp:function(){return Object(o["translate"])("SitesManager_KeepURLFragmentsHelp","<em>#</em>","<em>example.org/index.html#first_section</em>","<em>example.org/index.html</em>")},searchCategoryParamsInlineHelp:function(){var e=[Object(o["translate"])("Goals_Optional"),Object(o["translate"])("SitesManager_SearchCategoryDesc"),Object(o["translate"])("SitesManager_SearchCategoryParametersDesc")];return e.join(" ")}}});Jt.render=Lt;var Zt=Jt,en=Object(i["createElementVNode"])("span",{class:"icon-chevron-left"},null,-1),tn={id:"start-tracking-data-header"},nn={key:0,class:"row",id:"start-tracking-detection"},an=["src","alt"],rn=["href"],on={class:"row",id:"start-tracking-method-list"},ln=Object(i["createElementVNode"])("span",{class:"icon-search"},null,-1),sn=["href","onClick"],cn=["src"],un={class:"list-entry-text"},dn={id:"start-tracking-skip"},mn=["href"],bn=["data-method"],hn=["src","alt"];function pn(e,t,n,a,r,o){var l=Object(i["resolveComponent"])("VueEntryContainer"),s=Object(i["resolveComponent"])("ActivityIndicator");return Object(i["openBlock"])(),Object(i["createElementBlock"])("div",null,[e.showMethodDetails?(Object(i["openBlock"])(),Object(i["createElementBlock"])("a",{key:0,id:"start-tracking-back",onClick:t[0]||(t[0]=Object(i["withModifiers"])((function(t){e.showOverview()}),["prevent"]))},[en,Object(i["createTextVNode"])(" "+Object(i["toDisplayString"])(e.translate("Mobile_NavigationBack")),1)])):Object(i["createCommentVNode"])("",!0),Object(i["createElementVNode"])("h1",tn,Object(i["toDisplayString"])(e.headline),1),Object(i["createVNode"])(l,{id:"start-tracking-cta",html:e.ctaContent},null,8,["html"]),Object(i["createVNode"])(s,{"loading-message":"".concat(e.translate("SitesManager_DetectingYourSite"),"…"),loading:e.loading},null,8,["loading-message","loading"]),e.loading||e.showMethodDetails?Object(i["createCommentVNode"])("",!0):(Object(i["openBlock"])(),Object(i["createElementBlock"])(i["Fragment"],{key:1},[e.recommendedMethod?(Object(i["openBlock"])(),Object(i["createElementBlock"])("div",nn,[Object(i["createElementVNode"])("img",{src:e.recommendedMethod.icon,alt:"".concat(e.recommendedMethod.name," logo")},null,8,an),Object(i["createElementVNode"])("h2",null,Object(i["toDisplayString"])(e.recommendedMethod.recommendationTitle),1),Object(i["createElementVNode"])("p",null,Object(i["toDisplayString"])(e.recommendedMethod.recommendationText),1),Object(i["createElementVNode"])("a",{href:"#".concat(e.recommendedMethod.id.toLowerCase()),class:"btn",id:"showMethod",onClick:t[1]||(t[1]=Object(i["withModifiers"])((function(t){return e.showMethod(e.recommendedMethod.id)}),["prevent"]))},Object(i["toDisplayString"])(e.recommendedMethod.recommendationButton),9,rn)])):Object(i["createCommentVNode"])("",!0),Object(i["createElementVNode"])("div",on,[ln,Object(i["createElementVNode"])("h2",null,Object(i["toDisplayString"])(e.translate("SitesManager_SiteWithoutDataOtherInstallMethods")),1),Object(i["createElementVNode"])("p",null,Object(i["toDisplayString"])(e.translate("SitesManager_SiteWithoutDataOtherInstallMethodsIntro")),1),Object(i["createElementVNode"])("ul",null,[(Object(i["openBlock"])(!0),Object(i["createElementBlock"])(i["Fragment"],null,Object(i["renderList"])(e.trackingMethods,(function(t){return Object(i["openBlock"])(),Object(i["createElementBlock"])("li",{class:"list-entry",key:t.id},[Object(i["createElementVNode"])("a",{href:"#".concat(t.id.toLowerCase()),onClick:Object(i["withModifiers"])((function(n){return e.showMethod(t.id)}),["prevent"])},[t.icon?(Object(i["openBlock"])(),Object(i["createElementBlock"])("img",{key:0,src:t.icon,class:"list-entry-icon"},null,8,cn)):Object(i["createCommentVNode"])("",!0),Object(i["createElementVNode"])("span",un,Object(i["toDisplayString"])(t.name),1)],8,sn)])})),128))])]),Object(i["createElementVNode"])("div",dn,[Object(i["createElementVNode"])("h2",null,Object(i["toDisplayString"])(e.translate("SitesManager_SiteWithoutDataNotYetReady")),1),Object(i["createElementVNode"])("div",null,Object(i["toDisplayString"])(e.translate("SitesManager_SiteWithoutDataTemporarilyHidePage")),1),Object(i["createElementVNode"])("a",{href:e.ignoreSitesWithoutDataLink,class:"ignoreSitesWithoutData"},Object(i["toDisplayString"])(e.translate("SitesManager_SiteWithoutDataHidePageForHour")),9,mn)])],64)),e.showMethodDetails?(Object(i["openBlock"])(),Object(i["createElementBlock"])("div",{key:2,id:"start-tracking-details","data-method":e.showMethodDetails.id},[Object(i["createElementVNode"])("img",{src:e.showMethodDetails.icon,alt:"".concat(e.showMethodDetails.name," logo")},null,8,hn),Object(i["createVNode"])(l,{html:e.showMethodDetails.content},null,8,["html"])],8,bn)):Object(i["createCommentVNode"])("",!0)])}function gn(e,t){return yn(e)||jn(e,t)||Sn(e,t)||fn()}function fn(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function Sn(e,t){if(e){if("string"===typeof e)return On(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?On(e,t):void 0}}function On(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,a=new Array(t);n<t;n++)a[n]=e[n];return a}function jn(e,t){var n=null==e?null:"undefined"!==typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var a,r,i=[],o=!0,l=!1;try{for(n=n.call(e);!(o=(a=n.next()).done);o=!0)if(i.push(a.value),t&&i.length===t)break}catch(s){l=!0,r=s}finally{try{o||null==n["return"]||n["return"]()}finally{if(l)throw r}}return i}}function yn(e){if(Array.isArray(e))return e}var vn=Object(i["defineComponent"])({props:{ctaContent:String},components:{ActivityIndicator:o["ActivityIndicator"],VueEntryContainer:o["VueEntryContainer"]},data:function(){return{loading:!0,updateCheckInterval:1e3,currentInterval:1e3,maxInterval:3e4,showMethodDetails:null,recommendedMethod:null,trackingMethods:[]}},created:function(){var e=this,t={module:"SitesManager",action:"getTrackingMethodsForSite"};o["AjaxHelper"].fetch(t).then((function(t){e.trackingMethods=t.trackingMethods,e.recommendedMethod=t.recommendedMethod,e.loading=!1,Object(i["watch"])((function(){return o["MatomoUrl"].hashParsed.value.activeTab}),(function(t){e.showMethodDetails=e.findTrackingMethod(t)})),o["MatomoUrl"].hashParsed.value.activeTab&&(e.showMethodDetails=e.findTrackingMethod(o["MatomoUrl"].hashParsed.value.activeTab)),e.checkIfSiteHasData()}))},methods:{findTrackingMethod:function(e){if(this.recommendedMethod&&e&&this.recommendedMethod.id.toLowerCase()===e.toLowerCase())return this.recommendedMethod;var t=null;return Object.entries(this.trackingMethods).forEach((function(n){var a=gn(n,2),r=a[1];e&&r.id.toLowerCase()===e.toLowerCase()&&(t=r)})),t},showMethod:function(e){o["MatomoUrl"].updateHash(Object.assign(Object.assign({},o["MatomoUrl"].hashParsed.value),{},{activeTab:e.toLowerCase()}))},showOverview:function(){o["MatomoUrl"].updateHash(Object.assign(Object.assign({},o["MatomoUrl"].hashParsed.value),{},{activeTab:null}))},checkIfSiteHasData:function(){var e=this,t={method:"Live.getMostRecentVisitsDateTime",date:"today",period:"day",idSite:o["Matomo"].idSite},n={createErrorNotification:!1};o["AjaxHelper"].fetch(t,n).then((function(t){t&&""!==t.value?window.broadcast.propagateNewPage("date=today"):(window.setTimeout(e.checkIfSiteHasData,e.currentInterval),e.currentInterval=Math.min(e.currentInterval+e.updateCheckInterval,e.maxInterval))})).catch((function(){}))}},computed:{ignoreSitesWithoutDataLink:function(){return"?".concat(o["MatomoUrl"].stringify(Object.assign(Object.assign({},o["MatomoUrl"].urlParsed.value),{},{module:"SitesManager",action:"ignoreNoDataMessage"})))},headline:function(){return this.showMethodDetails&&this.showMethodDetails.name?99===this.showMethodDetails.type?this.showMethodDetails.name:Object(o["translate"])("SitesManager_SiteWithoutDataInstallWithX",this.showMethodDetails.name):Object(o["translate"])("SitesManager_SiteWithoutDataChooseTrackingMethod")}}});vn.render=pn;var En=vn;
/*!
 * Matomo - free/libre analytics platform
 *
 * @link    https://matomo.org
 * @license https://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
 */}})}));
//# sourceMappingURL=SitesManager.umd.min.js.map