Welcome to mirror list, hosted at ThFree Co, Russian Federation.

PrivacyManager.umd.min.js « dist « vue « PrivacyManager « plugins - github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 5fcc2c2b5ab1ee9df337a9fec73c6cedab6538a6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
(function(e,t){"object"===typeof exports&&"object"===typeof module?module.exports=t(require("CoreHome"),require("vue"),require("CorePluginsAdmin"),require("SegmentEditor")):"function"===typeof define&&define.amd?define(["CoreHome",,"CorePluginsAdmin","SegmentEditor"],t):"object"===typeof exports?exports["PrivacyManager"]=t(require("CoreHome"),require("vue"),require("CorePluginsAdmin"),require("SegmentEditor")):e["PrivacyManager"]=t(e["CoreHome"],e["Vue"],e["CorePluginsAdmin"],e["SegmentEditor"])})("undefined"!==typeof self?self:this,(function(e,t,n,a){return function(e){var t={};function n(a){if(t[a])return t[a].exports;var o=t[a]={i:a,l:!1,exports:{}};return e[a].call(o.exports,o,o.exports,n),o.l=!0,o.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 o in e)n.d(a,o,function(t){return e[t]}.bind(null,o));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/PrivacyManager/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},f06f:function(e,t){e.exports=a},fae3:function(e,t,n){"use strict";if(n.r(t),n.d(t,"ManageGdpr",(function(){return ne})),n.d(t,"AnonymizeIp",(function(){return pe})),n.d(t,"OptOutCustomizer",(function(){return Re})),n.d(t,"AnonymizeLogData",(function(){return Et})),n.d(t,"DoNotTrackPreference",(function(){return wt})),n.d(t,"ReportDeletionSettings",(function(){return Ft})),n.d(t,"DeleteOldLogs",(function(){return Wt})),n.d(t,"DeleteOldReports",(function(){return cn})),n.d(t,"ScheduleReportDeletion",(function(){return kn})),"undefined"!==typeof window){var a=window.document.currentScript,o=a&&a.src.match(/(.+\/)[^/]+\.js(\?.*)?$/);o&&(n.p=o[1])}var i=n("8bbf"),l={class:"manageGdpr"},r={class:"intro"},c=Object(i["createElementVNode"])("br",null,null,-1),s=Object(i["createElementVNode"])("br",null,null,-1),d=Object(i["createElementVNode"])("br",null,null,-1),u=Object(i["createElementVNode"])("br",null,null,-1),m=["innerHTML"],b={class:"form-group row"},p={class:"col s12 input-field"},g={for:"gdprsite",class:"siteSelectorLabel"},O={class:"sites_autocomplete"},j={class:"form-group row segmentFilterGroup"},v={class:"col s12"},h={style:{margin:"8px 0",display:"inline-block"}},f=Object(i["createElementVNode"])("br",null,null,-1),y=Object(i["createTextVNode"])(),V=Object(i["createElementVNode"])("br",null,null,-1),S=Object(i["createElementVNode"])("br",null,null,-1),D=Object(i["createElementVNode"])("br",null,null,-1),N={class:"checkInclude"},E={colspan:"8"},C=["title"],k={class:"checkInclude"},w=["title"],P={class:"visitId"},_={class:"visitorId"},M=["title","onClick"],A={class:"visitorIp"},z=["title","onClick"],F={class:"userId"},I=["title","onClick"],T=["title"],x=["src"],B=["title"],L=["src"],U=["title"],R=["src"],H=["title"],G=["src"],q=["onClick"],K=Object(i["createElementVNode"])("img",{src:"plugins/Live/images/visitorProfileLaunch.png",style:{"margin-right":"3.5px"}},null,-1),W={class:"ui-confirm",id:"confirmDeleteDataSubject",ref:"confirmDeleteDataSubject"},Y=["value"],J=["value"];function Q(e,t,n,a,o,$){var Q=Object(i["resolveComponent"])("SiteSelector"),X=Object(i["resolveComponent"])("SegmentGenerator"),Z=Object(i["resolveComponent"])("SaveButton"),ee=Object(i["resolveComponent"])("ContentBlock"),te=Object(i["resolveComponent"])("Field"),ne=Object(i["resolveDirective"])("content-table");return Object(i["openBlock"])(),Object(i["createElementBlock"])("div",l,[Object(i["createVNode"])(ee,{"content-title":e.translate("PrivacyManager_GdprTools")},{default:Object(i["withCtx"])((function(){return[Object(i["createElementVNode"])("div",r,[Object(i["createElementVNode"])("p",null,[Object(i["createTextVNode"])(Object(i["toDisplayString"])(e.translate("PrivacyManager_GdprToolsPageIntro1"))+" ",1),c,s,Object(i["createTextVNode"])(" "+Object(i["toDisplayString"])(e.translate("PrivacyManager_GdprToolsPageIntro2"))+" ",1),d]),Object(i["createElementVNode"])("ol",null,[Object(i["createElementVNode"])("li",null,Object(i["toDisplayString"])(e.translate("PrivacyManager_GdprToolsPageIntroAccessRight")),1),Object(i["createElementVNode"])("li",null,Object(i["toDisplayString"])(e.translate("PrivacyManager_GdprToolsPageIntroEraseRight")),1)]),Object(i["createElementVNode"])("p",null,[u,Object(i["createElementVNode"])("span",{innerHTML:e.$sanitize(e.overviewHintText)},null,8,m)])]),Object(i["createElementVNode"])("h3",null,Object(i["toDisplayString"])(e.translate("PrivacyManager_SearchForDataSubject")),1),Object(i["createElementVNode"])("div",b,[Object(i["createElementVNode"])("div",p,[Object(i["createElementVNode"])("div",null,[Object(i["createElementVNode"])("label",g,Object(i["toDisplayString"])(e.translate("PrivacyManager_SelectWebsite")),1),Object(i["createElementVNode"])("div",O,[Object(i["createVNode"])(Q,{id:"gdprsite",modelValue:e.site,"onUpdate:modelValue":t[0]||(t[0]=function(t){return e.site=t}),"show-all-sites-item":!0,"switch-site-on-select":!1,"show-selected-site":!0},null,8,["modelValue"])])])])]),Object(i["createElementVNode"])("div",j,[Object(i["createElementVNode"])("div",v,[Object(i["createElementVNode"])("div",null,[Object(i["createElementVNode"])("label",h,Object(i["toDisplayString"])(e.translate("PrivacyManager_FindDataSubjectsBy")),1),Object(i["createElementVNode"])("div",null,[Object(i["createVNode"])(X,{modelValue:e.segment_filter,"onUpdate:modelValue":t[1]||(t[1]=function(t){return e.segment_filter=t}),"visit-segments-only":!0,idsite:e.site.id},null,8,["modelValue","idsite"])])])])]),Object(i["createVNode"])(Z,{class:"findDataSubjects",value:e.translate("PrivacyManager_FindMatchingDataSubjects"),onConfirm:t[2]||(t[2]=function(t){return e.findDataSubjects()}),disabled:!e.segment_filter,saving:e.isLoading},null,8,["value","disabled","saving"])]})),_:1},8,["content-title"]),Object(i["withDirectives"])(Object(i["createElementVNode"])("div",null,[Object(i["createElementVNode"])("h2",null,Object(i["toDisplayString"])(e.translate("PrivacyManager_NoDataSubjectsFound")),1)],512),[[i["vShow"],!e.dataSubjects.length&&e.hasSearched]]),Object(i["withDirectives"])(Object(i["createElementVNode"])("div",null,[Object(i["createElementVNode"])("h2",null,Object(i["toDisplayString"])(e.translate("PrivacyManager_MatchingDataSubjects")),1),Object(i["createElementVNode"])("p",null,[Object(i["createTextVNode"])(Object(i["toDisplayString"])(e.translate("PrivacyManager_VisitsMatchedCriteria"))+" "+Object(i["toDisplayString"])(e.translate("PrivacyManager_ExportingNote"))+" ",1),f,y,V,Object(i["createTextVNode"])(" "+Object(i["toDisplayString"])(e.translate("PrivacyManager_DeletionFromMatomoOnly"))+" ",1),S,D,Object(i["createTextVNode"])(" "+Object(i["toDisplayString"])(e.translate("PrivacyManager_ResultIncludesAllVisits")),1)]),Object(i["withDirectives"])(Object(i["createElementVNode"])("table",null,[Object(i["createElementVNode"])("thead",null,[Object(i["createElementVNode"])("tr",null,[Object(i["createElementVNode"])("th",N,[Object(i["createElementVNode"])("div",null,[Object(i["createVNode"])(te,{uicontrol:"checkbox",name:"activateAll","model-value":e.toggleAll,"onUpdate:modelValue":t[3]||(t[3]=function(t){e.toggleAll=t,e.toggleActivateAll()}),"full-width":!0},null,8,["model-value"])])]),Object(i["createElementVNode"])("th",null,Object(i["toDisplayString"])(e.translate("General_Website")),1),Object(i["createElementVNode"])("th",null,Object(i["toDisplayString"])(e.translate("General_VisitId")),1),Object(i["createElementVNode"])("th",null,Object(i["toDisplayString"])(e.translate("General_VisitorID")),1),Object(i["createElementVNode"])("th",null,Object(i["toDisplayString"])(e.translate("General_VisitorIP")),1),Object(i["createElementVNode"])("th",null,Object(i["toDisplayString"])(e.translate("General_UserId")),1),Object(i["createElementVNode"])("th",null,Object(i["toDisplayString"])(e.translate("General_Details")),1),Object(i["withDirectives"])(Object(i["createElementVNode"])("th",null,Object(i["toDisplayString"])(e.translate("General_Action")),513),[[i["vShow"],e.profileEnabled]])])]),Object(i["createElementVNode"])("tbody",null,[Object(i["withDirectives"])(Object(i["createElementVNode"])("tr",null,[Object(i["createElementVNode"])("td",E,Object(i["toDisplayString"])(e.translate("PrivacyManager_ResultTruncated","400")),1)],512),[[i["vShow"],e.dataSubjects.length>400]]),(Object(i["openBlock"])(!0),Object(i["createElementBlock"])(i["Fragment"],null,Object(i["renderList"])(e.dataSubjects,(function(t,n){return Object(i["openBlock"])(),Object(i["createElementBlock"])("tr",{title:"".concat(e.translate("PrivacyManager_LastAction"),": ").concat(t.lastActionDateTime),key:n},[Object(i["createElementVNode"])("td",k,[Object(i["createElementVNode"])("div",null,[Object(i["createVNode"])(te,{uicontrol:"checkbox",name:"subject".concat(t.idVisit),modelValue:e.dataSubjectsActive[n],"onUpdate:modelValue":function(t){return e.dataSubjectsActive[n]=t},"full-width":!0},null,8,["name","modelValue","onUpdate:modelValue"])])]),Object(i["createElementVNode"])("td",{class:"site",title:"(".concat(e.translate("General_Id")," ").concat(t.idSite,")")},Object(i["toDisplayString"])(t.siteName),9,w),Object(i["createElementVNode"])("td",P,Object(i["toDisplayString"])(t.idVisit),1),Object(i["createElementVNode"])("td",_,[Object(i["createElementVNode"])("a",{title:e.translate("PrivacyManager_AddVisitorIdToSearch"),onClick:function(n){return e.addFilter("visitorId",t.visitorId)}},Object(i["toDisplayString"])(t.visitorId),9,M)]),Object(i["createElementVNode"])("td",A,[Object(i["createElementVNode"])("a",{title:e.translate("PrivacyManager_AddVisitorIPToSearch"),onClick:function(n){return e.addFilter("visitIp",t.visitIp)}},Object(i["toDisplayString"])(t.visitIp),9,z)]),Object(i["createElementVNode"])("td",F,[Object(i["createElementVNode"])("a",{title:e.translate("PrivacyManager_AddUserIdToSearch"),onClick:function(n){return e.addFilter("userId",t.userId)}},Object(i["toDisplayString"])(t.userId),9,I)]),Object(i["createElementVNode"])("td",null,[Object(i["createElementVNode"])("span",{title:"".concat(t.deviceType," ").concat(t.deviceModel),style:{"margin-right":"3.5px"}},[Object(i["createElementVNode"])("img",{height:"16",src:t.deviceTypeIcon},null,8,x)],8,T),Object(i["createElementVNode"])("span",{title:t.operatingSystem,style:{"margin-right":"3.5px"}},[Object(i["createElementVNode"])("img",{height:"16",src:t.operatingSystemIcon},null,8,L)],8,B),Object(i["createElementVNode"])("span",{title:"".concat(t.browser," ").concat(t.browserFamilyDescription),style:{"margin-right":"3.5px"}},[Object(i["createElementVNode"])("img",{height:"16",src:t.browserIcon},null,8,R)],8,U),Object(i["createElementVNode"])("span",{title:"".concat(t.country," ").concat(t.region||"")},[Object(i["createElementVNode"])("img",{height:"16",src:t.countryFlag},null,8,G)],8,H)]),Object(i["withDirectives"])(Object(i["createElementVNode"])("td",null,[Object(i["createElementVNode"])("a",{class:"visitorLogTooltip",title:"View visitor profile",onClick:function(n){return e.showProfile(t.visitorId,t.idSite)}},[K,Object(i["createElementVNode"])("span",null,Object(i["toDisplayString"])(e.translate("Live_ViewVisitorProfile")),1)],8,q)],512),[[i["vShow"],e.profileEnabled]])],8,C)})),128))])],512),[[ne]]),Object(i["createVNode"])(Z,{class:"exportDataSubjects",style:{"margin-right":"3.5px"},onConfirm:t[4]||(t[4]=function(t){return e.exportDataSubject()}),disabled:!e.hasActiveDataSubjects,value:e.translate("PrivacyManager_ExportSelectedVisits")},null,8,["disabled","value"]),Object(i["createVNode"])(Z,{class:"deleteDataSubjects",onConfirm:t[5]||(t[5]=function(t){return e.deleteDataSubject()}),disabled:!e.hasActiveDataSubjects||e.isDeleting,value:e.translate("PrivacyManager_DeleteSelectedVisits")},null,8,["disabled","value"])],512),[[i["vShow"],e.dataSubjects.length]]),Object(i["createElementVNode"])("div",W,[Object(i["createElementVNode"])("h2",null,Object(i["toDisplayString"])(e.translate("PrivacyManager_DeleteVisitsConfirm")),1),Object(i["createElementVNode"])("input",{role:"yes",type:"button",value:e.translate("General_Yes")},null,8,Y),Object(i["createElementVNode"])("input",{role:"no",type:"button",value:e.translate("General_No")},null,8,J)],512)])}var X=n("19dc"),Z=n("f06f"),ee=n("a5a2"),te=Object(i["defineComponent"])({components:{ContentBlock:X["ContentBlock"],SiteSelector:X["SiteSelector"],SegmentGenerator:Z["SegmentGenerator"],SaveButton:ee["SaveButton"],Field:ee["Field"]},directives:{ContentTable:X["ContentTable"]},data:function(){return{isLoading:!1,isDeleting:!1,site:{id:"all",name:Object(X["translate"])("UsersManager_AllWebsites")},segment_filter:"userId==",dataSubjects:[],toggleAll:!0,hasSearched:!1,profileEnabled:X["Matomo"].visitorProfileEnabled,dataSubjectsActive:[]}},setup:function(){var e=X["AjaxHelper"].fetch({method:"SitesManager.getSitesIdWithAdminAccess",filter_limit:"-1"});return{getSites:function(){return e}}},methods:{showSuccessNotification:function(e){var t=X["NotificationsStore"].show({message:e,context:"success",id:"manageGdpr",type:"transient"});setTimeout((function(){X["NotificationsStore"].scrollToNotification(t)}),200)},linkTo:function(e){return"?".concat(X["MatomoUrl"].stringify(Object.assign(Object.assign({},X["MatomoUrl"].urlParsed.value),{},{module:"PrivacyManager",action:e})))},toggleActivateAll:function(){this.dataSubjectsActive.fill(this.toggleAll)},showProfile:function(e,t){X["Matomo"].helper.showVisitorProfilePopup(e,t)},exportDataSubject:function(){var e=this,t=this.activatedDataSubjects;X["AjaxHelper"].post({module:"API",method:"PrivacyManager.exportDataSubjects",format:"json",filter_limit:-1},{visits:t}).then((function(t){e.showSuccessNotification(Object(X["translate"])("PrivacyManager_VisitsSuccessfullyExported")),X["Matomo"].helper.sendContentAsDownload("exported_data_subjects.json",JSON.stringify(t))}))},deleteDataSubject:function(){var e=this;X["Matomo"].helper.modalConfirm(this.$refs.confirmDeleteDataSubject,{yes:function(){e.isDeleting=!0;var t=e.activatedDataSubjects;X["AjaxHelper"].post({module:"API",method:"PrivacyManager.deleteDataSubjects",filter_limit:-1},{visits:t}).then((function(){e.dataSubjects=[],e.showSuccessNotification(Object(X["translate"])("PrivacyManager_VisitsSuccessfullyDeleted")),e.findDataSubjects()})).finally((function(){e.isDeleting=!1}))}})},addFilter:function(e,t){this.segment_filter+=",".concat(e,"==").concat(t),this.findDataSubjects()},findDataSubjects:function(){var e=this;this.dataSubjects=[],this.dataSubjectsActive=[],this.isLoading=!0,this.toggleAll=!0,this.hasSearched=!1,this.getSites().then((function(t){var n=e.site.id;"all"!==n||X["Matomo"].hasSuperUserAccess||(n=t,Array.isArray(t)&&(n=t.join(","))),X["AjaxHelper"].fetch({idSite:n,module:"API",method:"PrivacyManager.findDataSubjects",segment:e.segment_filter}).then((function(t){e.hasSearched=!0,e.dataSubjectsActive=t.map((function(){return!0})),e.dataSubjects=t})).finally((function(){e.isLoading=!1}))}))}},computed:{hasActiveDataSubjects:function(){return!!this.activatedDataSubjects.length},activatedDataSubjects:function(){var e=this;return this.dataSubjects.filter((function(t,n){return e.dataSubjectsActive[n]})).map((function(e){return{idsite:e.idSite,idvisit:e.idVisit}}))},overviewHintText:function(){return Object(X["translate"])("PrivacyManager_GdprToolsOverviewHint",'<a href="'.concat(this.linkTo("gdprOverview"),'">'),"</a>")}}});te.render=Q;var ne=te,ae=Object(i["createElementVNode"])("br",null,null,-1),oe=Object(i["createElementVNode"])("br",null,null,-1),ie=Object(i["createElementVNode"])("br",null,null,-1),le=Object(i["createElementVNode"])("br",null,null,-1),re={key:0},ce=Object(i["createElementVNode"])("br",null,null,-1),se=Object(i["createElementVNode"])("br",null,null,-1),de={class:"alert-warning alert"};function ue(e,t,n,a,o,l){var r=Object(i["resolveComponent"])("Field"),c=Object(i["resolveComponent"])("SaveButton"),s=Object(i["resolveDirective"])("form");return Object(i["withDirectives"])((Object(i["openBlock"])(),Object(i["createElementBlock"])("div",null,[Object(i["createElementVNode"])("div",null,[Object(i["createVNode"])(r,{uicontrol:"checkbox",name:"anonymizeIpSettings",title:e.translate("PrivacyManager_UseAnonymizeIp"),modelValue:e.actualEnabled,"onUpdate:modelValue":t[0]||(t[0]=function(t){return e.actualEnabled=t}),"inline-help":e.anonymizeIpEnabledHelp},null,8,["title","modelValue","inline-help"])]),Object(i["withDirectives"])(Object(i["createElementVNode"])("div",null,[Object(i["createElementVNode"])("div",null,[Object(i["createVNode"])(r,{uicontrol:"radio",name:"maskLength",title:e.translate("PrivacyManager_AnonymizeIpMaskLengtDescription"),modelValue:e.actualMaskLength,"onUpdate:modelValue":t[1]||(t[1]=function(t){return e.actualMaskLength=t}),options:e.maskLengthOptions,"inline-help":e.translate("PrivacyManager_GeolocationAnonymizeIpNote")},null,8,["title","modelValue","options","inline-help"])]),Object(i["createElementVNode"])("div",null,[Object(i["createVNode"])(r,{uicontrol:"radio",name:"useAnonymizedIpForVisitEnrichment",title:e.translate("PrivacyManager_UseAnonymizedIpForVisitEnrichment"),modelValue:e.actualUseAnonymizedIpForVisitEnrichment,"onUpdate:modelValue":t[2]||(t[2]=function(t){return e.actualUseAnonymizedIpForVisitEnrichment=t}),options:e.useAnonymizedIpForVisitEnrichmentOptions,"inline-help":e.translate("PrivacyManager_UseAnonymizedIpForVisitEnrichmentNote")},null,8,["title","modelValue","options","inline-help"])])],512),[[i["vShow"],e.actualEnabled]]),Object(i["createElementVNode"])("div",null,[Object(i["createVNode"])(r,{uicontrol:"checkbox",name:"anonymizeUserId",title:e.translate("PrivacyManager_PseudonymizeUserId"),modelValue:e.actualAnonymizeUserId,"onUpdate:modelValue":t[3]||(t[3]=function(t){return e.actualAnonymizeUserId=t})},{"inline-help":Object(i["withCtx"])((function(){return[Object(i["createTextVNode"])(Object(i["toDisplayString"])(e.translate("PrivacyManager_PseudonymizeUserIdNote"))+" ",1),ae,oe,Object(i["createElementVNode"])("em",null,Object(i["toDisplayString"])(e.translate("PrivacyManager_PseudonymizeUserIdNote2")),1)]})),_:1},8,["title","modelValue"])]),Object(i["createElementVNode"])("div",null,[Object(i["createVNode"])(r,{uicontrol:"checkbox",name:"anonymizeOrderId",title:e.translate("PrivacyManager_UseAnonymizeOrderId"),modelValue:e.actualAnonymizeOrderId,"onUpdate:modelValue":t[4]||(t[4]=function(t){return e.actualAnonymizeOrderId=t}),"inline-help":e.translate("PrivacyManager_AnonymizeOrderIdNote")},null,8,["title","modelValue","inline-help"])]),Object(i["createElementVNode"])("div",null,[Object(i["createVNode"])(r,{uicontrol:"checkbox",name:"forceCookielessTracking",title:e.translate("PrivacyManager_ForceCookielessTracking"),modelValue:e.actualForceCookielessTracking,"onUpdate:modelValue":t[5]||(t[5]=function(t){return e.actualForceCookielessTracking=t})},{"inline-help":Object(i["withCtx"])((function(){return[Object(i["createTextVNode"])(Object(i["toDisplayString"])(e.translate("PrivacyManager_ForceCookielessTrackingDescription",e.trackerFileName))+" ",1),ie,le,Object(i["createElementVNode"])("em",null,Object(i["toDisplayString"])(e.translate("PrivacyManager_ForceCookielessTrackingDescription2")),1),e.trackerWritable?Object(i["createCommentVNode"])("",!0):(Object(i["openBlock"])(),Object(i["createElementBlock"])("span",re,[ce,se,Object(i["createElementVNode"])("p",de,Object(i["toDisplayString"])(e.translate("PrivacyManager_ForceCookielessTrackingDescriptionNotWritable",e.trackerFileName)),1)]))]})),_:1},8,["title","modelValue"])]),Object(i["createElementVNode"])("div",null,[Object(i["createVNode"])(r,{uicontrol:"select",name:"anonymizeReferrer",title:e.translate("PrivacyManager_AnonymizeReferrer"),modelValue:e.actualAnonymizeReferrer,"onUpdate:modelValue":t[6]||(t[6]=function(t){return e.actualAnonymizeReferrer=t}),options:e.referrerAnonymizationOptions,"inline-help":e.translate("PrivacyManager_AnonymizeReferrerNote")},null,8,["title","modelValue","options","inline-help"])]),Object(i["createVNode"])(c,{onConfirm:t[7]||(t[7]=function(t){return e.save()}),saving:e.isLoading},null,8,["saving"])],512)),[[s]])}function me(e){return!0===e||1===e||"1"===e?1:0}var be=Object(i["defineComponent"])({props:{anonymizeIpEnabled:Boolean,anonymizeUserId:Boolean,maskLength:{type:Number,required:!0},useAnonymizedIpForVisitEnrichment:[Boolean,String,Number],anonymizeOrderId:Boolean,forceCookielessTracking:Boolean,anonymizeReferrer:String,maskLengthOptions:{type:Array,required:!0},useAnonymizedIpForVisitEnrichmentOptions:{type:Array,required:!0},trackerFileName:{type:String,required:!0},trackerWritable:{type:Boolean,required:!0},referrerAnonymizationOptions:{type:Object,required:!0}},components:{Field:ee["Field"],SaveButton:ee["SaveButton"]},directives:{Form:ee["Form"]},data:function(){return{isLoading:!1,actualEnabled:this.anonymizeIpEnabled,actualMaskLength:this.maskLength,actualUseAnonymizedIpForVisitEnrichment:me(this.useAnonymizedIpForVisitEnrichment),actualAnonymizeUserId:!!this.anonymizeUserId,actualAnonymizeOrderId:!!this.anonymizeOrderId,actualForceCookielessTracking:!!this.forceCookielessTracking,actualAnonymizeReferrer:this.anonymizeReferrer}},methods:{save:function(){var e=this;this.isLoading=!0,X["AjaxHelper"].post({module:"API",method:"PrivacyManager.setAnonymizeIpSettings"},{anonymizeIPEnable:this.actualEnabled?"1":"0",anonymizeUserId:this.actualAnonymizeUserId?"1":"0",anonymizeOrderId:this.actualAnonymizeOrderId?"1":"0",forceCookielessTracking:this.actualForceCookielessTracking?"1":"0",anonymizeReferrer:this.actualAnonymizeReferrer?this.actualAnonymizeReferrer:"",maskLength:this.actualMaskLength,useAnonymizedIpForVisitEnrichment:this.actualUseAnonymizedIpForVisitEnrichment}).then((function(){var e=X["NotificationsStore"].show({message:Object(X["translate"])("CoreAdminHome_SettingsSaveSuccess"),context:"success",id:"privacyManagerSettings",type:"toast"});X["NotificationsStore"].scrollToNotification(e)})).finally((function(){e.isLoading=!1}))}},computed:{anonymizeIpEnabledHelp:function(){var e=Object(X["translate"])("PrivacyManager_AnonymizeIpInlineHelp"),t=Object(X["translate"])("PrivacyManager_AnonymizeIpDescription");return"".concat(e," ").concat(t)}}});be.render=ue;var pe=be,ge={class:"optOutCustomizer"},Oe=["innerHTML"],je={key:0,id:"opt-out-styling"},ve=["value"],he=["value"],fe=["value"],ye=["value"],Ve=Object(i["createStaticVNode"])('<option value="px">px</option><option value="pt">pt</option><option value="em">em</option><option value="rem">rem</option><option value="%">%</option>',5),Se=[Ve],De=["value"],Ne=["src"],Ee={class:"form-group row"},Ce={class:"col s12 m6"},ke={for:"codeType1"},we={for:"codeType2"},Pe={key:0},_e={class:"col s12 m6"},Me=["innerHTML"],Ae={ref:"pre"},ze=["innerHTML"],Fe={class:"system notification notification-info optOutTestReminder"},Ie=["innerHTML"];function Te(e,t,n,a,o,l){var r=Object(i["resolveComponent"])("Field"),c=Object(i["resolveDirective"])("select-on-focus");return Object(i["openBlock"])(),Object(i["createElementBlock"])(i["Fragment"],null,[Object(i["createElementVNode"])("div",ge,[Object(i["createElementVNode"])("p",null,[Object(i["createTextVNode"])(Object(i["toDisplayString"])(e.translate("CoreAdminHome_OptOutExplanation"))+" ",1),Object(i["createElementVNode"])("span",{innerHTML:e.$sanitize(e.readThisToLearnMore)},null,8,Oe)]),Object(i["createElementVNode"])("h3",null,Object(i["toDisplayString"])(e.translate("PrivacyManager_OptOutAppearance")),1),Object(i["createElementVNode"])("div",null,[Object(i["createElementVNode"])("span",null,[Object(i["createElementVNode"])("label",null,[Object(i["withDirectives"])(Object(i["createElementVNode"])("input",{id:"applyStyling",type:"checkbox",name:"applyStyling","onUpdate:modelValue":t[0]||(t[0]=function(t){return e.applyStyling=t}),onKeydown:t[1]||(t[1]=function(t){return e.updateCode()}),onChange:t[2]||(t[2]=function(t){return e.updateCode()})},null,544),[[i["vModelCheckbox"],e.applyStyling]]),Object(i["createElementVNode"])("span",null,Object(i["toDisplayString"])(e.translate("PrivacyManager_ApplyStyling")),1)])])]),e.applyStyling?(Object(i["openBlock"])(),Object(i["createElementBlock"])("div",je,[Object(i["createElementVNode"])("p",null,[Object(i["createElementVNode"])("span",null,[Object(i["createTextVNode"])(Object(i["toDisplayString"])(e.translate("PrivacyManager_FontColor"))+": ",1),Object(i["createElementVNode"])("input",{type:"color",value:e.fontColor,onKeydown:t[3]||(t[3]=function(t){return e.onFontColorChange(t)}),onChange:t[4]||(t[4]=function(t){return e.onFontColorChange(t)})},null,40,ve)]),Object(i["createElementVNode"])("span",null,[Object(i["createTextVNode"])(Object(i["toDisplayString"])(e.translate("PrivacyManager_BackgroundColor"))+": ",1),Object(i["createElementVNode"])("input",{type:"color",value:e.backgroundColor,onKeydown:t[5]||(t[5]=function(t){return e.onBgColorChange(t)}),onChange:t[6]||(t[6]=function(t){return e.onBgColorChange(t)})},null,40,he)]),Object(i["createElementVNode"])("span",null,[Object(i["createTextVNode"])(Object(i["toDisplayString"])(e.translate("PrivacyManager_FontSize"))+": ",1),Object(i["createElementVNode"])("input",{id:"FontSizeInput",type:"number",min:"1",max:"100",value:e.fontSize,onKeydown:t[7]||(t[7]=function(t){return e.onFontSizeChange(t)}),onChange:t[8]||(t[8]=function(t){return e.onFontSizeChange(t)})},null,40,fe)]),Object(i["createElementVNode"])("span",null,[Object(i["createElementVNode"])("select",{class:"browser-default",value:e.fontSizeUnit,onKeydown:t[9]||(t[9]=function(t){return e.onFontSizeUnitChange(t)}),onChange:t[10]||(t[10]=function(t){return e.onFontSizeUnitChange(t)})},Se,40,ye)]),Object(i["createElementVNode"])("span",null,[Object(i["createTextVNode"])(Object(i["toDisplayString"])(e.translate("PrivacyManager_FontFamily"))+": ",1),Object(i["createElementVNode"])("input",{id:"FontFamilyInput",type:"text",value:e.fontFamily,onKeydown:t[11]||(t[11]=function(t){return e.onFontFamilyChange(t)}),onChange:t[12]||(t[12]=function(t){return e.onFontFamilyChange(t)})},null,40,De)])])])):Object(i["createCommentVNode"])("",!0),Object(i["createElementVNode"])("div",null,[Object(i["createElementVNode"])("span",null,[Object(i["createElementVNode"])("label",null,[Object(i["withDirectives"])(Object(i["createElementVNode"])("input",{id:"showIntro",type:"checkbox",name:"showIntro","onUpdate:modelValue":t[13]||(t[13]=function(t){return e.showIntro=t}),onKeydown:t[14]||(t[14]=function(t){return e.updateCode()}),onChange:t[15]||(t[15]=function(t){return e.updateCode()})},null,544),[[i["vModelCheckbox"],e.showIntro]]),Object(i["createElementVNode"])("span",null,Object(i["toDisplayString"])(e.translate("PrivacyManager_ShowIntro")),1)])])]),Object(i["createElementVNode"])("h3",null,Object(i["toDisplayString"])(e.translate("PrivacyManager_OptOutPreview")),1),Object(i["createElementVNode"])("iframe",{id:"previewIframe",style:{border:"1px solid #333",height:"200px",width:"600px"},src:e.iframeUrl,class:Object(i["normalizeClass"])({withBg:e.withBg})},null,10,Ne)]),Object(i["createElementVNode"])("div",null,[Object(i["createElementVNode"])("div",Ee,[Object(i["createElementVNode"])("div",Ce,[Object(i["createElementVNode"])("h3",null,Object(i["toDisplayString"])(e.translate("PrivacyManager_OptOutHtmlCode")),1),Object(i["createElementVNode"])("p",null,[Object(i["createElementVNode"])("label",ke,[Object(i["withDirectives"])(Object(i["createElementVNode"])("input",{type:"radio",id:"codeType1",name:"codeType",value:"tracker","onUpdate:modelValue":t[16]||(t[16]=function(t){return e.codeType=t}),onKeydown:t[17]||(t[17]=function(t){return e.updateCode()}),onChange:t[18]||(t[18]=function(t){return e.updateCode()})},null,544),[[i["vModelRadio"],e.codeType]]),Object(i["createElementVNode"])("span",null,Object(i["toDisplayString"])(e.translate("PrivacyManager_OptOutUseTracker")),1)])]),Object(i["createElementVNode"])("p",null,[Object(i["createElementVNode"])("label",we,[Object(i["withDirectives"])(Object(i["createElementVNode"])("input",{type:"radio",id:"codeType2",name:"codeType",value:"selfContained","onUpdate:modelValue":t[19]||(t[19]=function(t){return e.codeType=t}),onKeydown:t[20]||(t[20]=function(t){return e.updateCode()}),onChange:t[21]||(t[21]=function(t){return e.updateCode()})},null,544),[[i["vModelRadio"],e.codeType]]),Object(i["createElementVNode"])("span",null,Object(i["toDisplayString"])(e.translate("PrivacyManager_OptOutUseStandalone")),1)])]),"selfContained"===e.codeType?(Object(i["openBlock"])(),Object(i["createElementBlock"])("div",Pe,[Object(i["createElementVNode"])("div",null,[Object(i["createVNode"])(r,{uicontrol:"select",name:"language",modelValue:e.language,"onUpdate:modelValue":t[22]||(t[22]=function(t){return e.language=t}),title:e.translate("General_Language"),options:e.languageOptions,onKeydown:t[23]||(t[23]=function(t){return e.updateCode()}),onChange:t[24]||(t[24]=function(t){return e.updateCode()})},null,8,["modelValue","title","options"])])])):Object(i["createCommentVNode"])("",!0)]),Object(i["createElementVNode"])("div",_e,[Object(i["createElementVNode"])("div",{class:"form-help",innerHTML:e.$sanitize(e.codeTypeHelp)},null,8,Me)])])]),Object(i["createElementVNode"])("div",null,[Object(i["withDirectives"])(Object(i["createElementVNode"])("pre",Ae,[Object(i["createTextVNode"])(Object(i["toDisplayString"])(e.codeBox)+"\n    ",1)],512),[[c,{}]]),Object(i["createElementVNode"])("p",{innerHTML:e.$sanitize(e.optOutExplanationIntro)},null,8,ze),Object(i["createElementVNode"])("div",Fe,[Object(i["createElementVNode"])("p",null,[Object(i["createElementVNode"])("strong",null,Object(i["toDisplayString"])(e.translate("PrivacyManager_OptOutRememberToTest")),1)]),Object(i["createElementVNode"])("p",null,Object(i["toDisplayString"])(e.translate("PrivacyManager_OptOutRememberToTestBody")),1),Object(i["createElementVNode"])("p",null,[Object(i["createElementVNode"])("ul",null,[Object(i["createElementVNode"])("li",null,Object(i["toDisplayString"])(e.translate("PrivacyManager_OptOutRememberToTestStep1")),1),Object(i["createElementVNode"])("li",null,Object(i["toDisplayString"])(e.translate("PrivacyManager_OptOutRememberToTestStep2")),1),Object(i["createElementVNode"])("li",null,Object(i["toDisplayString"])(e.translate("PrivacyManager_OptOutRememberToTestStep3")),1),Object(i["createElementVNode"])("li",null,Object(i["toDisplayString"])(e.translate("PrivacyManager_OptOutRememberToTestStep4")),1)])])]),Object(i["createElementVNode"])("h3",null,Object(i["toDisplayString"])(e.translate("PrivacyManager_BuildYourOwn")),1),Object(i["createElementVNode"])("p",{innerHTML:e.$sanitize(e.optOutCustomOptOutLink)},null,8,Ie)])],64)}function xe(e){var t=parseInt(e,16),n=t>>16&255,a=t>>8&255,o=255&t;return n>=225&&a>=225&&o>=225}var Be=window,Le=Be.$,Ue=Object(i["defineComponent"])({props:{currentLanguageCode:{type:String,required:!0},languageOptions:{type:Object,required:!0},matomoUrl:String},components:{Field:ee["Field"]},directives:{SelectOnFocus:X["SelectOnFocus"]},data:function(){return{fontSizeUnit:"px",backgroundColor:"#FFFFFF",fontColor:"#000000",fontSize:"12",fontFamily:"Arial",showIntro:!0,applyStyling:!1,codeType:"tracker",code:"",language:this.currentLanguageCode}},created:function(){this.onFontColorChange=Object(X["debounce"])(this.onFontColorChange,50),this.onBgColorChange=Object(X["debounce"])(this.onBgColorChange,50),this.onFontSizeChange=Object(X["debounce"])(this.onFontSizeChange,50),this.onFontSizeUnitChange=Object(X["debounce"])(this.onFontSizeUnitChange,50),this.onFontFamilyChange=Object(X["debounce"])(this.onFontFamilyChange,50),this.matomoUrl&&this.updateCode()},methods:{onFontColorChange:function(e){this.fontColor=e.target.value,this.updateCode()},onBgColorChange:function(e){this.backgroundColor=e.target.value,this.updateCode()},onFontSizeChange:function(e){this.fontSize=e.target.value,this.updateCode()},onFontSizeUnitChange:function(e){this.fontSizeUnit=e.target.value,this.updateCode()},onFontFamilyChange:function(e){this.fontFamily=e.target.value,this.updateCode()},updateCode:function(){var e=this,t="CoreAdminHome.getOptOutJSEmbedCode";"selfContained"===this.codeType&&(t="CoreAdminHome.getOptOutSelfContainedEmbedCode"),X["AjaxHelper"].fetch({method:t,backgroundColor:this.backgroundColor.substr(1),fontColor:this.fontColor.substr(1),fontSize:this.fontSizeWithUnit,fontFamily:this.fontFamily,showIntro:!0===this.showIntro?1:0,applyStyling:!0===this.applyStyling?1:0,matomoUrl:this.matomoUrl,language:"selfContained"===this.codeType?this.language:"auto"}).then((function(t){e.code=t.value||""}))}},watch:{codeBox:function(){var e=this.$refs.pre,t=Le(e).queue("fx").length>0;t||Le(e).effect("highlight",{},1500)}},computed:{fontSizeWithUnit:function(){return this.fontSize?"".concat(this.fontSize).concat(this.fontSizeUnit):""},withBg:function(){return!!this.matomoUrl&&""===this.backgroundColor&&""!==this.fontColor&&xe(this.fontColor.slice(1))},codeBox:function(){return this.matomoUrl?this.code:""},iframeUrl:function(){var e=X["MatomoUrl"].stringify({module:"CoreAdminHome",action:"optOut",language:this.language,backgroundColor:this.backgroundColor.substr(1),fontColor:this.fontColor.substr(1),fontSize:this.fontSizeWithUnit,fontFamily:this.fontFamily,applyStyling:!0===this.applyStyling?1:0,showIntro:!0===this.showIntro?1:0});return"".concat(this.matomoUrl,"index.php?").concat(e)},readThisToLearnMore:function(){var e="https://matomo.org/faq/how-to/faq_25918/";return Object(X["translate"])("General_ReadThisToLearnMore","<a rel='noreferrer noopener' target='_blank' href='".concat(e,"'>"),"</a>")},optOutExplanationIntro:function(){return Object(X["translate"])("CoreAdminHome_OptOutExplanationIntro",'<a href="'.concat(this.iframeUrl,'" rel="noreferrer noopener" target="_blank">'),"</a>")},optOutCustomOptOutLink:function(){var e="https://developer.matomo.org/guides/tracking-javascript-guide#optional-creating-a-custom-opt-out-form";return Object(X["translate"])("CoreAdminHome_OptOutCustomOptOutLink",'<a href="'.concat(e,'" rel="noreferrer noopener" target="_blank">'),"</a>")},codeTypeHelp:function(){return Object(X["translate"])("PrivacyManager_OptOutCodeTypeExplanation")}}});Ue.render=Te;var Re=Ue,He={class:"anonymizeLogData"},Ge={class:"form-group row"},qe={class:"col s12 input-field"},Ke={for:"anonymizeSite",class:"siteSelectorLabel"},We={class:"sites_autocomplete"},$e={class:"form-group row"},Ye={class:"col s6 input-field"},Je={for:"anonymizeStartDate",class:"active"},Qe=["value"],Xe={class:"col s6 input-field"},Ze={for:"anonymizeEndDate",class:"active"},et=["value"],tt={name:"anonymizeIp"},nt={name:"anonymizeLocation"},at={name:"anonymizeTheUserId"},ot={class:"form-group row"},it={class:"col s12 m6"},lt={for:"visit_columns"},rt={class:"innerFormField",name:"visit_columns"},ct=["onClick","title"],st={class:"col s12 m6"},dt={class:"form-help"},ut={class:"inline-help"},mt={class:"form-group row"},bt={class:"col s12"},pt={class:"form-group row"},gt={class:"col s12 m6"},Ot={for:"action_columns"},jt={class:"innerFormField",name:"action_columns"},vt=["onClick","title"],ht={class:"col s12 m6"},ft={class:"form-help"},yt={class:"inline-help"},Vt=Object(i["createElementVNode"])("span",{class:"icon-info"},null,-1);function St(e,t,n,a,o,l){var r=Object(i["resolveComponent"])("SiteSelector"),c=Object(i["resolveComponent"])("Field"),s=Object(i["resolveComponent"])("SaveButton"),d=Object(i["resolveComponent"])("PasswordConfirmation");return Object(i["openBlock"])(),Object(i["createElementBlock"])("div",He,[Object(i["createElementVNode"])("div",Ge,[Object(i["createElementVNode"])("div",qe,[Object(i["createElementVNode"])("div",null,[Object(i["createElementVNode"])("label",Ke,Object(i["toDisplayString"])(e.translate("PrivacyManager_AnonymizeSites")),1),Object(i["createElementVNode"])("div",We,[Object(i["createVNode"])(r,{id:"anonymizeSite",modelValue:e.site,"onUpdate:modelValue":t[0]||(t[0]=function(t){return e.site=t}),"show-all-sites-item":!0,"switch-site-on-select":!1,"show-selected-site":!0},null,8,["modelValue"])])])])]),Object(i["createElementVNode"])("div",$e,[Object(i["createElementVNode"])("div",Ye,[Object(i["createElementVNode"])("div",null,[Object(i["createElementVNode"])("label",Je,Object(i["toDisplayString"])(e.translate("PrivacyManager_AnonymizeRowDataFrom")),1),Object(i["createElementVNode"])("input",{type:"text",id:"anonymizeStartDate",class:"anonymizeStartDate",ref:"anonymizeStartDate",name:"anonymizeStartDate",value:e.startDate,onKeydown:t[1]||(t[1]=function(t){return e.onKeydownStartDate(t)}),onChange:t[2]||(t[2]=function(t){return e.onKeydownStartDate(t)})},null,40,Qe)])]),Object(i["createElementVNode"])("div",Xe,[Object(i["createElementVNode"])("div",null,[Object(i["createElementVNode"])("label",Ze,Object(i["toDisplayString"])(e.translate("PrivacyManager_AnonymizeRowDataTo")),1),Object(i["createElementVNode"])("input",{type:"text",class:"anonymizeEndDate",id:"anonymizeEndDate",ref:"anonymizeEndDate",name:"anonymizeEndDate",value:e.endDate,onKeydown:t[3]||(t[3]=function(t){return e.onKeydownEndDate(t)}),onChange:t[4]||(t[4]=function(t){return e.onKeydownEndDate(t)})},null,40,et)])])]),Object(i["createElementVNode"])("div",tt,[Object(i["createVNode"])(c,{uicontrol:"checkbox",name:"anonymizeIp",title:e.translate("PrivacyManager_AnonymizeIp"),modelValue:e.anonymizeIp,"onUpdate:modelValue":t[5]||(t[5]=function(t){return e.anonymizeIp=t}),introduction:e.translate("General_Visit"),"inline-help":e.translate("PrivacyManager_AnonymizeIpHelp")},null,8,["title","modelValue","introduction","inline-help"])]),Object(i["createElementVNode"])("div",nt,[Object(i["createVNode"])(c,{uicontrol:"checkbox",name:"anonymizeLocation",title:e.translate("PrivacyManager_AnonymizeLocation"),modelValue:e.anonymizeLocation,"onUpdate:modelValue":t[6]||(t[6]=function(t){return e.anonymizeLocation=t}),"inline-help":e.translate("PrivacyManager_AnonymizeLocationHelp")},null,8,["title","modelValue","inline-help"])]),Object(i["createElementVNode"])("div",at,[Object(i["createVNode"])(c,{uicontrol:"checkbox",name:"anonymizeTheUserId",title:e.translate("PrivacyManager_AnonymizeUserId"),modelValue:e.anonymizeUserId,"onUpdate:modelValue":t[7]||(t[7]=function(t){return e.anonymizeUserId=t}),"inline-help":e.translate("PrivacyManager_AnonymizeUserIdHelp")},null,8,["title","modelValue","inline-help"])]),Object(i["createElementVNode"])("div",ot,[Object(i["createElementVNode"])("div",it,[Object(i["createElementVNode"])("div",null,[Object(i["createElementVNode"])("label",lt,Object(i["toDisplayString"])(e.translate("PrivacyManager_UnsetVisitColumns")),1),(Object(i["openBlock"])(!0),Object(i["createElementBlock"])(i["Fragment"],null,Object(i["renderList"])(e.selectedVisitColumns,(function(t,n){return Object(i["openBlock"])(),Object(i["createElementBlock"])("div",{class:Object(i["normalizeClass"])("selectedVisitColumns selectedVisitColumns".concat(n," multiple valign-wrapper")),key:n},[Object(i["createElementVNode"])("div",rt,[Object(i["createVNode"])(c,{uicontrol:"select",name:"visit_columns","model-value":t.column,"onUpdate:modelValue":function(n){t.column=n,e.onVisitColumnChange()},"full-width":!0,options:e.availableVisitColumns},null,8,["model-value","onUpdate:modelValue","options"])]),Object(i["withDirectives"])(Object(i["createElementVNode"])("span",{class:"icon-minus valign",onClick:function(t){return e.removeVisitColumn(n)},title:e.translate("General_Remove")},null,8,ct),[[i["vShow"],n+1!==e.selectedVisitColumns.length]])],2)})),128))])]),Object(i["createElementVNode"])("div",st,[Object(i["createElementVNode"])("div",dt,[Object(i["createElementVNode"])("span",ut,Object(i["toDisplayString"])(e.translate("PrivacyManager_UnsetVisitColumnsHelp")),1)])])]),Object(i["createElementVNode"])("div",mt,[Object(i["createElementVNode"])("div",bt,[Object(i["createElementVNode"])("h3",null,Object(i["toDisplayString"])(e.translate("General_Action")),1)])]),Object(i["createElementVNode"])("div",pt,[Object(i["createElementVNode"])("div",gt,[Object(i["createElementVNode"])("div",null,[Object(i["createElementVNode"])("label",Ot,Object(i["toDisplayString"])(e.translate("PrivacyManager_UnsetActionColumns")),1),(Object(i["openBlock"])(!0),Object(i["createElementBlock"])(i["Fragment"],null,Object(i["renderList"])(e.selectedActionColumns,(function(t,n){return Object(i["openBlock"])(),Object(i["createElementBlock"])("div",{class:Object(i["normalizeClass"])("selectedActionColumns selectedActionColumns".concat(n," multiple valign-wrapper")),key:n},[Object(i["createElementVNode"])("div",jt,[Object(i["createVNode"])(c,{uicontrol:"select",name:"action_columns","model-value":t.column,"onUpdate:modelValue":function(n){t.column=n,e.onActionColumnChange()},"full-width":!0,options:e.availableActionColumns},null,8,["model-value","onUpdate:modelValue","options"])]),Object(i["withDirectives"])(Object(i["createElementVNode"])("span",{class:"icon-minus valign",onClick:function(t){return e.removeActionColumn(n)},title:e.translate("General_Remove")},null,8,vt),[[i["vShow"],n+1!==e.selectedActionColumns.length]])],2)})),128))])]),Object(i["createElementVNode"])("div",ht,[Object(i["createElementVNode"])("div",ft,[Object(i["createElementVNode"])("span",yt,Object(i["toDisplayString"])(e.translate("PrivacyManager_UnsetActionColumnsHelp")),1)])])]),Object(i["createElementVNode"])("p",null,[Vt,Object(i["createTextVNode"])(" "+Object(i["toDisplayString"])(e.translate("PrivacyManager_AnonymizeProcessInfo")),1)]),Object(i["createVNode"])(s,{class:"anonymizePastData",onConfirm:t[8]||(t[8]=function(t){return e.showPasswordConfirmModal=!0}),disabled:e.isAnonymizePastDataDisabled,value:e.translate("PrivacyManager_AnonymizeDataNow")},null,8,["disabled","value"]),Object(i["createVNode"])(d,{modelValue:e.showPasswordConfirmModal,"onUpdate:modelValue":t[9]||(t[9]=function(t){return e.showPasswordConfirmModal=t}),onConfirmed:e.scheduleAnonymization},{default:Object(i["withCtx"])((function(){return[Object(i["createElementVNode"])("h2",null,Object(i["toDisplayString"])(e.translate("PrivacyManager_AnonymizeDataConfirm")),1),Object(i["createElementVNode"])("div",null,Object(i["toDisplayString"])(e.translate("UsersManager_ConfirmWithPassword")),1)]})),_:1},8,["modelValue","onConfirmed"])])}function Dt(e){return e<10?"0".concat(e):e}var Nt=Object(i["defineComponent"])({components:{PasswordConfirmation:ee["PasswordConfirmation"],SiteSelector:X["SiteSelector"],Field:ee["Field"],SaveButton:ee["SaveButton"]},data:function(){var e=new Date,t="".concat(e.getFullYear(),"-").concat(Dt(e.getMonth()+1),"-").concat(Dt(e.getDay()+1));return{isLoading:!1,isDeleting:!1,anonymizeIp:!1,anonymizeLocation:!1,anonymizeUserId:!1,site:{id:"all",name:"All Websites"},availableVisitColumns:[],availableActionColumns:[],selectedVisitColumns:[{column:""}],selectedActionColumns:[{column:""}],startDate:t,endDate:t,showPasswordConfirmModal:!1}},created:function(){var e=this;this.onKeydownStartDate=Object(X["debounce"])(this.onKeydownStartDate,50),this.onKeydownEndDate=Object(X["debounce"])(this.onKeydownEndDate,50),X["AjaxHelper"].fetch({method:"PrivacyManager.getAvailableVisitColumnsToAnonymize"}).then((function(t){e.availableVisitColumns=[],t.forEach((function(t){e.availableVisitColumns.push({key:t.column_name,value:t.column_name})}))})),X["AjaxHelper"].fetch({method:"PrivacyManager.getAvailableLinkVisitActionColumnsToAnonymize"}).then((function(t){e.availableActionColumns=[],t.forEach((function(t){e.availableActionColumns.push({key:t.column_name,value:t.column_name})}))})),setTimeout((function(){var t=X["Matomo"].getBaseDatePickerOptions(null),n=X["Matomo"].getBaseDatePickerOptions(null);$(e.$refs.anonymizeStartDate).datepicker(t),$(e.$refs.anonymizeEndDate).datepicker(n)}))},methods:{onVisitColumnChange:function(){var e=this.selectedVisitColumns.every((function(e){return!(null===e||void 0===e||!e.column)}));e&&this.addVisitColumn()},addVisitColumn:function(){this.selectedVisitColumns.push({column:""})},removeVisitColumn:function(e){if(e>-1){var t=this.selectedVisitColumns.length-1;t===e?this.selectedVisitColumns[e]={column:""}:this.selectedVisitColumns.splice(e,1)}},onActionColumnChange:function(){var e=this.selectedActionColumns.every((function(e){return!(null===e||void 0===e||!e.column)}));e&&this.addActionColumn()},addActionColumn:function(){this.selectedActionColumns.push({column:""})},removeActionColumn:function(e){if(e>-1){var t=this.selectedActionColumns.length-1;t===e?this.selectedActionColumns[e]={column:""}:this.selectedActionColumns.splice(e,1)}},scheduleAnonymization:function(e){var t="".concat(this.startDate,",").concat(this.endDate);this.startDate===this.endDate&&(t=this.startDate);var n={date:t};n.idSites=this.site.id,n.anonymizeIp=this.anonymizeIp?"1":"0",n.anonymizeLocation=this.anonymizeLocation?"1":"0",n.anonymizeUserId=this.anonymizeUserId?"1":"0",n.unsetVisitColumns=this.selectedVisitColumns.filter((function(e){return!(null===e||void 0===e||!e.column)})).map((function(e){return e.column})),n.unsetLinkVisitActionColumns=this.selectedActionColumns.filter((function(e){return!(null===e||void 0===e||!e.column)})).map((function(e){return e.column})),n.passwordConfirmation=e,X["AjaxHelper"].post({method:"PrivacyManager.anonymizeSomeRawData"},n).then((function(){window.location.reload(!0)}))},onKeydownStartDate:function(e){this.startDate=e.target.value},onKeydownEndDate:function(e){this.endDate=e.target.value}},computed:{isAnonymizePastDataDisabled:function(){return!this.anonymizeIp&&!this.anonymizeLocation&&!this.selectedVisitColumns&&!this.selectedActionColumns}}});Nt.render=St;var Et=Nt;function Ct(e,t,n,a,o,l){var r=Object(i["resolveComponent"])("Field"),c=Object(i["resolveComponent"])("SaveButton"),s=Object(i["resolveDirective"])("form");return Object(i["withDirectives"])((Object(i["openBlock"])(),Object(i["createElementBlock"])("div",null,[Object(i["createElementVNode"])("div",null,[Object(i["createVNode"])(r,{uicontrol:"radio",name:"doNotTrack",modelValue:e.enabled,"onUpdate:modelValue":t[0]||(t[0]=function(t){return e.enabled=t}),options:e.doNotTrackOptions,"inline-help":e.translate("PrivacyManager_DoNotTrack_Description")},null,8,["modelValue","options","inline-help"])]),Object(i["createVNode"])(c,{onConfirm:t[1]||(t[1]=function(t){return e.save()}),saving:e.isLoading},null,8,["saving"])],512)),[[s]])}var kt=Object(i["defineComponent"])({props:{dntSupport:Boolean,doNotTrackOptions:{type:Array,required:!0}},components:{Field:ee["Field"],SaveButton:ee["SaveButton"]},directives:{Form:ee["Form"]},data:function(){return{isLoading:!1,enabled:this.dntSupport?1:0}},methods:{save:function(){var e=this;this.isLoading=!0;var t="deactivateDoNotTrack";this.enabled&&"0"!==this.enabled&&(t="activateDoNotTrack"),X["AjaxHelper"].post({module:"API",method:"PrivacyManager.".concat(t)}).then((function(){var e=X["NotificationsStore"].show({message:Object(X["translate"])("CoreAdminHome_SettingsSaveSuccess"),context:"success",id:"privacyManagerSettings",type:"transient"});X["NotificationsStore"].scrollToNotification(e)})).finally((function(){e.isLoading=!1}))}}});kt.render=Ct;var wt=kt;function Pt(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 Mt(e,t,n){return t&&_t(e.prototype,t),n&&_t(e,n),e}function At(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 http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
 */var zt=function(){function e(){var t=this;Pt(this,e),At(this,"privateState",Object(i["reactive"])({settings:{},showEstimate:!1,loadingEstimation:!1,estimation:"",isModified:!1})),At(this,"state",Object(i["computed"])((function(){return Object(i["readonly"])(t.privateState)}))),At(this,"enableDeleteReports",Object(i["computed"])((function(){return t.state.value.settings.enableDeleteReports}))),At(this,"enableDeleteLogs",Object(i["computed"])((function(){return t.state.value.settings.enableDeleteLogs}))),At(this,"currentRequest",void 0)}return Mt(e,[{key:"updateSettings",value:function(e){this.initSettings(e),this.privateState.isModified=!0}},{key:"initSettings",value:function(e){this.privateState.settings=Object.assign(Object.assign({},this.privateState.settings),e),this.reloadDbStats()}},{key:"savePurgeDataSettings",value:function(e,t,n){return this.privateState.isModified=!1,X["AjaxHelper"].post({module:"API",method:e},Object.assign(Object.assign({},t),{},{enableDeleteLogs:t.enableDeleteLogs?"1":"0",enableDeleteReports:t.enableDeleteReports?"1":"0",passwordConfirmation:n})).then((function(){var e=X["NotificationsStore"].show({message:Object(X["translate"])("CoreAdminHome_SettingsSaveSuccess"),context:"success",id:"privacyManagerSettings",type:"toast"});X["NotificationsStore"].scrollToNotification(e)}))}},{key:"isEitherDeleteSectionEnabled",value:function(){return this.state.value.settings.enableDeleteLogs||this.state.value.settings.enableDeleteReports}},{key:"isManualEstimationLinkShowing",value:function(){return window.$("#getPurgeEstimateLink").length>0}},{key:"reloadDbStats",value:function(e){var t=this;if(this.currentRequest&&(this.currentRequest.abort(),this.currentRequest=void 0),e||this.isEitherDeleteSectionEnabled()&&!this.isManualEstimationLinkShowing()){this.privateState.loadingEstimation=!0,this.privateState.estimation="",this.privateState.showEstimate=!1;var n=this.privateState.settings,a=Object.assign(Object.assign({},n),{},{enableDeleteLogs:n.enableDeleteLogs?"1":"0",enableDeleteReports:n.enableDeleteReports?"1":"0"});!0===e&&(a.forceEstimate=1),this.currentRequest=new AbortController,X["AjaxHelper"].post({module:"PrivacyManager",action:"getDatabaseSize",format:"html"},a,{abortController:this.currentRequest,format:"html"}).then((function(e){t.privateState.estimation=e,t.privateState.showEstimate=!0,t.privateState.loadingEstimation=!1})).finally((function(){t.currentRequest=void 0,t.privateState.loadingEstimation=!1}))}}}]),e}(),Ft=new zt,It={id:"formDeleteSettings"},Tt={id:"deleteLogSettingEnabled"},xt={class:"alert alert-warning deleteOldLogsWarning",style:{width:"50%"}},Bt={href:"https://matomo.org/faq/general/faq_125",rel:"noreferrer noopener",target:"_blank"},Lt={id:"deleteLogSettings"},Ut={key:0},Rt={key:1},Ht={key:2},Gt={key:3};function qt(e,t,n,a,o,l){var r=this,c=Object(i["resolveComponent"])("Field"),s=Object(i["resolveComponent"])("SaveButton"),d=Object(i["resolveComponent"])("PasswordConfirmation"),u=Object(i["resolveDirective"])("form");return Object(i["withDirectives"])((Object(i["openBlock"])(),Object(i["createElementBlock"])("div",It,[Object(i["createElementVNode"])("div",Tt,[Object(i["createElementVNode"])("div",null,[Object(i["createVNode"])(c,{uicontrol:"checkbox",name:"deleteEnable","model-value":e.enabled,"onUpdate:modelValue":t[0]||(t[0]=function(t){e.enabled=t,e.reloadDbStats()}),title:e.translate("PrivacyManager_UseDeleteLog"),"inline-help":e.translate("PrivacyManager_DeleteRawDataInfo")},null,8,["model-value","title","inline-help"])]),Object(i["withDirectives"])(Object(i["createElementVNode"])("div",xt,[Object(i["createElementVNode"])("a",Bt,Object(i["toDisplayString"])(e.translate("General_ClickHere")),1)],512),[[i["vShow"],e.enabled]])]),Object(i["withDirectives"])(Object(i["createElementVNode"])("div",Lt,[Object(i["createElementVNode"])("div",null,[Object(i["createVNode"])(c,{uicontrol:"text",name:"deleteOlderThan","model-value":e.deleteOlderThan,"onUpdate:modelValue":t[1]||(t[1]=function(t){e.deleteOlderThan=t,e.reloadDbStats()}),title:e.deleteOlderThanTitle,"inline-help":e.translate("PrivacyManager_LeastDaysInput","1")},null,8,["model-value","title","inline-help"])])],512),[[i["vShow"],e.enabled]]),Object(i["createVNode"])(s,{onConfirm:t[2]||(t[2]=function(e){return r.showPasswordConfirmModal=!0}),saving:e.isLoading},null,8,["saving"]),Object(i["createVNode"])(d,{modelValue:e.showPasswordConfirmModal,"onUpdate:modelValue":t[3]||(t[3]=function(t){return e.showPasswordConfirmModal=t}),onConfirmed:e.saveSettings},{default:Object(i["withCtx"])((function(){return[e.enabled&&!e.enableDeleteReports?(Object(i["openBlock"])(),Object(i["createElementBlock"])("h2",Ut,Object(i["toDisplayString"])(e.translate("PrivacyManager_DeleteLogsConfirm")),1)):Object(i["createCommentVNode"])("",!0),e.enabled&&e.enableDeleteReports?(Object(i["openBlock"])(),Object(i["createElementBlock"])("h2",Rt,Object(i["toDisplayString"])(e.translate("PrivacyManager_DeleteBothConfirm")),1)):Object(i["createCommentVNode"])("",!0),e.enabled?(Object(i["openBlock"])(),Object(i["createElementBlock"])("div",Ht,Object(i["toDisplayString"])(e.translate("UsersManager_ConfirmWithPassword")),1)):Object(i["createCommentVNode"])("",!0),e.enabled?Object(i["createCommentVNode"])("",!0):(Object(i["openBlock"])(),Object(i["createElementBlock"])("h2",Gt,Object(i["toDisplayString"])(e.translate("UsersManager_ConfirmWithPassword")),1))]})),_:1},8,["modelValue","onConfirmed"])],512)),[[u]])}var Kt=Object(i["defineComponent"])({props:{isDataPurgeSettingsEnabled:Boolean,deleteData:{type:Object,required:!0},scheduleDeletionOptions:{type:Object,required:!0}},components:{PasswordConfirmation:ee["PasswordConfirmation"],Field:ee["Field"],SaveButton:ee["SaveButton"]},directives:{Form:ee["Form"]},data:function(){return{isLoading:!1,enabled:1===parseInt(this.deleteData.config.delete_logs_enable,10),deleteOlderThan:this.deleteData.config.delete_logs_older_than,showPasswordConfirmModal:!1}},created:function(){var e=this;setTimeout((function(){Ft.initSettings(e.settings)}))},methods:{saveSettings:function(e){var t=this,n="PrivacyManager.setDeleteLogsSettings";this.isLoading=!0,Ft.savePurgeDataSettings(n,this.settings,e).finally((function(){t.isLoading=!1}))},reloadDbStats:function(){Ft.updateSettings(this.settings)}},computed:{settings:function(){return{enableDeleteLogs:!!this.enabled,deleteLogsOlderThan:this.deleteOlderThan}},deleteOlderThanTitle:function(){return"".concat(Object(X["translate"])("PrivacyManager_DeleteLogsOlderThan")," (").concat(Object(X["translate"])("Intl_PeriodDays"),")")},enableDeleteReports:function(){return!!Ft.enableDeleteReports.value}}});Kt.render=qt;var Wt=Kt,$t={id:"formDeleteSettings"},Yt={id:"deleteReportsSettingEnabled"},Jt={class:"alert alert-warning",style:{width:"50%"}},Qt=Object(i["createElementVNode"])("br",null,null,-1),Xt=Object(i["createElementVNode"])("br",null,null,-1),Zt={id:"deleteReportsSettings"},en={key:0},tn={key:1},nn={key:2},an={key:3};function on(e,t,n,a,o,l){var r=this,c=Object(i["resolveComponent"])("Field"),s=Object(i["resolveComponent"])("SaveButton"),d=Object(i["resolveComponent"])("PasswordConfirmation"),u=Object(i["resolveDirective"])("form");return Object(i["withDirectives"])((Object(i["openBlock"])(),Object(i["createElementBlock"])("div",$t,[Object(i["createElementVNode"])("div",Yt,[Object(i["createElementVNode"])("div",null,[Object(i["createVNode"])(c,{uicontrol:"checkbox",name:"deleteReportsEnable","model-value":e.enabled,"onUpdate:modelValue":t[0]||(t[0]=function(t){e.enabled=t,e.reloadDbStats()}),title:e.translate("PrivacyManager_UseDeleteReports"),"inline-help":e.translate("PrivacyManager_DeleteAggregateReportsDetailedInfo")},null,8,["model-value","title","inline-help"])]),Object(i["withDirectives"])(Object(i["createElementVNode"])("div",Jt,[Object(i["createElementVNode"])("span",null,[Object(i["createTextVNode"])(Object(i["toDisplayString"])(e.translate("PrivacyManager_DeleteReportsInfo2",e.deleteOldLogsText)),1),Qt,Xt,Object(i["createTextVNode"])(" "+Object(i["toDisplayString"])(e.translate("PrivacyManager_DeleteReportsInfo3",e.deleteOldLogsText)),1)])],512),[[i["vShow"],e.enabled]])]),Object(i["withDirectives"])(Object(i["createElementVNode"])("div",Zt,[Object(i["createElementVNode"])("div",null,[Object(i["createVNode"])(c,{uicontrol:"text",name:"deleteReportsOlderThan","model-value":e.deleteOlderThan,"onUpdate:modelValue":t[1]||(t[1]=function(t){e.deleteOlderThan=t,e.reloadDbStats()}),title:e.deleteReportsOlderThanTitle,"inline-help":e.translate("PrivacyManager_LeastMonthsInput","1")},null,8,["model-value","title","inline-help"])]),Object(i["createElementVNode"])("div",null,[Object(i["createVNode"])(c,{uicontrol:"checkbox",name:"deleteReportsKeepBasic","model-value":e.keepBasic,"onUpdate:modelValue":t[2]||(t[2]=function(t){e.keepBasic=t,e.reloadDbStats()}),title:e.deleteReportsKeepBasicTitle,"inline-help":e.translate("PrivacyManager_KeepBasicMetricsReportsDetailedInfo")},null,8,["model-value","title","inline-help"])]),Object(i["createElementVNode"])("h3",null,Object(i["toDisplayString"])(e.translate("PrivacyManager_KeepDataFor")),1),Object(i["createElementVNode"])("div",null,[Object(i["createElementVNode"])("div",null,[Object(i["createVNode"])(c,{uicontrol:"checkbox",name:"deleteReportsKeepDay","model-value":e.keepDataForDay,"onUpdate:modelValue":t[3]||(t[3]=function(t){e.keepDataForDay=t,e.reloadDbStats()}),title:e.translate("General_DailyReports")},null,8,["model-value","title"])]),Object(i["createElementVNode"])("div",null,[Object(i["createVNode"])(c,{uicontrol:"checkbox",name:"deleteReportsKeepWeek","model-value":e.keepDataForWeek,"onUpdate:modelValue":t[4]||(t[4]=function(t){e.keepDataForWeek=t,e.reloadDbStats()}),title:e.translate("General_WeeklyReports")},null,8,["model-value","title"])]),Object(i["createElementVNode"])("div",null,[Object(i["createVNode"])(c,{uicontrol:"checkbox",name:"deleteReportsKeepMonth","model-value":e.keepDataForMonth,"onUpdate:modelValue":t[5]||(t[5]=function(t){e.keepDataForMonth=t,e.reloadDbStats()}),title:"".concat(e.translate("General_MonthlyReports")," (").concat(e.translate("General_Recommended"),")")},null,8,["model-value","title"])]),Object(i["createElementVNode"])("div",null,[Object(i["createVNode"])(c,{uicontrol:"checkbox",name:"deleteReportsKeepYear","model-value":e.keepDataForYear,"onUpdate:modelValue":t[6]||(t[6]=function(t){e.keepDataForYear=t,e.reloadDbStats()}),title:"".concat(e.translate("General_YearlyReports")," (").concat(e.translate("General_Recommended"),")")},null,8,["model-value","title"])]),Object(i["createElementVNode"])("div",null,[Object(i["createVNode"])(c,{uicontrol:"checkbox",name:"deleteReportsKeepRange","model-value":e.keepDataForRange,"onUpdate:modelValue":t[7]||(t[7]=function(t){e.keepDataForRange=t,e.reloadDbStats()}),title:e.translate("General_RangeReports")},null,8,["model-value","title"])]),Object(i["createElementVNode"])("div",null,[Object(i["createVNode"])(c,{uicontrol:"checkbox",name:"deleteReportsKeepSegments","model-value":e.keepDataForSegments,"onUpdate:modelValue":t[8]||(t[8]=function(t){e.keepDataForSegments=t,e.reloadDbStats()}),title:e.translate("PrivacyManager_KeepReportSegments")},null,8,["model-value","title"])])])],512),[[i["vShow"],e.enabled]]),Object(i["createVNode"])(s,{onConfirm:t[9]||(t[9]=function(e){return r.showPasswordConfirmModal=!0}),saving:e.isLoading},null,8,["saving"]),Object(i["createVNode"])(d,{modelValue:e.showPasswordConfirmModal,"onUpdate:modelValue":t[10]||(t[10]=function(t){return e.showPasswordConfirmModal=t}),onConfirmed:e.saveSettings},{default:Object(i["withCtx"])((function(){return[e.enabled&&!e.enableDeleteLogs?(Object(i["openBlock"])(),Object(i["createElementBlock"])("h2",en,Object(i["toDisplayString"])(e.translate("PrivacyManager_DeleteReportsConfirm")),1)):Object(i["createCommentVNode"])("",!0),e.enabled&&e.enableDeleteLogs?(Object(i["openBlock"])(),Object(i["createElementBlock"])("h2",tn,Object(i["toDisplayString"])(e.translate("PrivacyManager_DeleteBothConfirm")),1)):Object(i["createCommentVNode"])("",!0),e.enabled?(Object(i["openBlock"])(),Object(i["createElementBlock"])("div",nn,Object(i["toDisplayString"])(e.translate("UsersManager_ConfirmWithPassword")),1)):Object(i["createCommentVNode"])("",!0),e.enabled?Object(i["createCommentVNode"])("",!0):(Object(i["openBlock"])(),Object(i["createElementBlock"])("h2",an,Object(i["toDisplayString"])(e.translate("UsersManager_ConfirmWithPassword")),1))]})),_:1},8,["modelValue","onConfirmed"])],512)),[[u]])}function ln(e){return e?"1":"0"}var rn=Object(i["defineComponent"])({props:{isDataPurgeSettingsEnabled:Boolean,deleteData:{type:Object,required:!0},scheduleDeletionOptions:{type:Object,required:!0}},components:{Field:ee["Field"],SaveButton:ee["SaveButton"],PasswordConfirmation:ee["PasswordConfirmation"]},directives:{Form:ee["Form"]},data:function(){return{isLoading:!1,enabled:1===parseInt(this.deleteData.config.delete_reports_enable,10),deleteOlderThan:this.deleteData.config.delete_reports_older_than,keepBasic:1===parseInt(this.deleteData.config.delete_reports_keep_basic_metrics,10),keepDataForDay:1===parseInt(this.deleteData.config.delete_reports_keep_day_reports,10),keepDataForWeek:1===parseInt(this.deleteData.config.delete_reports_keep_week_reports,10),keepDataForMonth:1===parseInt(this.deleteData.config.delete_reports_keep_month_reports,10),keepDataForYear:1===parseInt(this.deleteData.config.delete_reports_keep_year_reports,10),keepDataForRange:1===parseInt(this.deleteData.config.delete_reports_keep_range_reports,10),keepDataForSegments:1===parseInt(this.deleteData.config.delete_reports_keep_segment_reports,10),showPasswordConfirmModal:!1}},created:function(){var e=this;setTimeout((function(){Ft.initSettings(e.settings)}))},methods:{saveSettings:function(e){var t=this,n="PrivacyManager.setDeleteReportsSettings";this.isLoading=!0,Ft.savePurgeDataSettings(n,this.settings,e).finally((function(){t.isLoading=!1}))},reloadDbStats:function(){Ft.updateSettings(this.settings)}},computed:{settings:function(){return{enableDeleteReports:this.enabled,deleteReportsOlderThan:this.deleteOlderThan,keepBasic:ln(this.keepBasic),keepDay:ln(this.keepDataForDay),keepWeek:ln(this.keepDataForWeek),keepMonth:ln(this.keepDataForMonth),keepYear:ln(this.keepDataForYear),keepRange:ln(this.keepDataForRange),keepSegments:ln(this.keepDataForSegments)}},deleteOldLogsText:function(){return Object(X["translate"])("PrivacyManager_UseDeleteLog")},deleteReportsOlderThanTitle:function(){var e=Object(X["translate"])("PrivacyManager_DeleteReportsOlderThan");return"".concat(e," (").concat(Object(X["translate"])("Intl_PeriodMonths"),")")},deleteReportsKeepBasicTitle:function(){var e=Object(X["translate"])("PrivacyManager_KeepBasicMetrics");return"".concat(e," (").concat(Object(X["translate"])("General_Recommended"),")")},enableDeleteLogs:function(){return!!Ft.enableDeleteLogs.value}}});rn.render=on;var cn=rn,sn={id:"formDeleteSettings"},dn={id:"deleteSchedulingSettings"},un={id:"deleteSchedulingSettingsInlineHelp",class:"inline-help-node"},mn={key:0},bn=Object(i["createElementVNode"])("br",null,null,-1),pn=Object(i["createElementVNode"])("br",null,null,-1),gn=Object(i["createElementVNode"])("br",null,null,-1),On=Object(i["createElementVNode"])("br",null,null,-1),jn={key:0,id:"deleteDataEstimateSect",class:"form-group row"},vn={class:"col s12",id:"databaseSizeHeadline"},hn={class:"col s12 m6"},fn=["innerHTML"],yn=Object(i["createTextVNode"])(" "),Vn={class:"col s12 m6"},Sn={key:0,class:"form-help"},Dn={class:"ui-confirm",id:"saveSettingsBeforePurge"},Nn=Object(i["createElementVNode"])("input",{role:"yes",type:"button",value:"{{ translate('General_Ok') }}"},null,-1);function En(e,t,n,a,o,l){var r=Object(i["resolveComponent"])("ActivityIndicator"),c=Object(i["resolveComponent"])("Field"),s=Object(i["resolveComponent"])("SaveButton"),d=Object(i["resolveComponent"])("PasswordConfirmation"),u=Object(i["resolveComponent"])("ContentBlock"),m=Object(i["resolveDirective"])("form");return Object(i["openBlock"])(),Object(i["createElementBlock"])(i["Fragment"],null,[Object(i["withDirectives"])(Object(i["createElementVNode"])("div",sn,[Object(i["withDirectives"])(Object(i["createVNode"])(u,{id:"scheduleSettingsHeadline","content-title":e.translate("PrivacyManager_DeleteSchedulingSettings")},{default:Object(i["withCtx"])((function(){return[Object(i["createElementVNode"])("div",dn,[Object(i["createElementVNode"])("div",null,[Object(i["createVNode"])(c,{uicontrol:"select",name:"deleteLowestInterval",title:e.translate("PrivacyManager_DeleteDataInterval"),modelValue:e.deleteLowestInterval,"onUpdate:modelValue":t[1]||(t[1]=function(t){return e.deleteLowestInterval=t}),options:e.scheduleDeletionOptions},{"inline-help":Object(i["withCtx"])((function(){return[Object(i["createElementVNode"])("div",un,[e.deleteData.lastRun?(Object(i["openBlock"])(),Object(i["createElementBlock"])("span",mn,[Object(i["createElementVNode"])("strong",null,Object(i["toDisplayString"])(e.translate("PrivacyManager_LastDelete"))+":",1),Object(i["createTextVNode"])(" "+Object(i["toDisplayString"])(e.deleteData.lastRunPretty)+" ",1),bn,pn])):Object(i["createCommentVNode"])("",!0),Object(i["createElementVNode"])("strong",null,Object(i["toDisplayString"])(e.translate("PrivacyManager_NextDelete"))+":",1),Object(i["createTextVNode"])(" "+Object(i["toDisplayString"])(e.deleteData.nextRunPretty)+" ",1),gn,On,Object(i["withDirectives"])(Object(i["createElementVNode"])("a",{id:"purgeDataNowLink",href:"#",onClick:t[0]||(t[0]=Object(i["withModifiers"])((function(t){return e.executeDataPurge()}),["prevent"]))},Object(i["toDisplayString"])(e.translate("PrivacyManager_PurgeNow")),513),[[i["vShow"],e.showPurgeNowLink]]),Object(i["createVNode"])(r,{"loading-message":e.translate("PrivacyManager_PurgingData"),loading:e.loadingDataPurge},null,8,["loading-message","loading"]),Object(i["withDirectives"])(Object(i["createElementVNode"])("span",{id:"db-purged-message"},Object(i["toDisplayString"])(e.translate("PrivacyManager_DBPurged")),513),[[i["vShow"],e.dataWasPurged]])])]})),_:1},8,["title","modelValue","options"])])]),"1"===e.deleteData.config.enable_database_size_estimate||1===e.deleteData.config.enable_database_size_estimate?(Object(i["openBlock"])(),Object(i["createElementBlock"])("div",jn,[Object(i["createElementVNode"])("h3",vn,Object(i["toDisplayString"])(e.translate("PrivacyManager_ReportsDataSavedEstimate")),1),Object(i["createElementVNode"])("div",hn,[Object(i["withDirectives"])(Object(i["createElementVNode"])("div",{id:"deleteDataEstimate",innerHTML:e.$sanitize(e.estimation)},null,8,fn),[[i["vShow"],e.showEstimate]]),yn,Object(i["createVNode"])(r,{loading:e.loadingEstimation},null,8,["loading"])]),Object(i["createElementVNode"])("div",Vn,["1"!==e.deleteData.config.enable_auto_database_size_estimate&&1!==e.deleteData.config.enable_auto_database_size_estimate?(Object(i["openBlock"])(),Object(i["createElementBlock"])("div",Sn,[Object(i["createElementVNode"])("a",{id:"getPurgeEstimateLink",href:"#",onClick:t[2]||(t[2]=Object(i["withModifiers"])((function(t){return e.getPurgeEstimate()}),["prevent"]))},Object(i["toDisplayString"])(e.translate("PrivacyManager_GetPurgeEstimate")),1)])):Object(i["createCommentVNode"])("",!0)])])):Object(i["createCommentVNode"])("",!0),Object(i["createVNode"])(s,{onConfirm:t[3]||(t[3]=function(t){return e.showPasswordConfirmModal=!0}),saving:e.isLoading},null,8,["saving"]),Object(i["createVNode"])(d,{modelValue:e.showPasswordConfirmModal,"onUpdate:modelValue":t[4]||(t[4]=function(t){return e.showPasswordConfirmModal=t}),onConfirmed:e.save},{default:Object(i["withCtx"])((function(){return[Object(i["createElementVNode"])("h2",null,Object(i["toDisplayString"])(e.translate("UsersManager_ConfirmWithPassword")),1)]})),_:1},8,["modelValue","onConfirmed"]),Object(i["createVNode"])(d,{modelValue:e.showPasswordConfirmModalForPurge,"onUpdate:modelValue":t[5]||(t[5]=function(t){return e.showPasswordConfirmModalForPurge=t}),onConfirmed:e.executePurgeNow},{default:Object(i["withCtx"])((function(){return[Object(i["createElementVNode"])("h2",null,Object(i["toDisplayString"])(e.translate("PrivacyManager_PurgeNowConfirm")),1),Object(i["createElementVNode"])("div",null,Object(i["toDisplayString"])(e.translate("UsersManager_ConfirmWithPassword")),1)]})),_:1},8,["modelValue","onConfirmed"])]})),_:1},8,["content-title"]),[[i["vShow"],e.isEitherDeleteSectionEnabled]])],512),[[m]]),Object(i["createElementVNode"])("div",Dn,[Object(i["createElementVNode"])("h2",null,Object(i["toDisplayString"])(e.translate("PrivacyManager_SaveSettingsBeforePurge")),1),Nn])],64)}var Cn=Object(i["defineComponent"])({props:{isDataPurgeSettingsEnabled:Boolean,deleteData:{type:Object,required:!0},scheduleDeletionOptions:{type:Object,required:!0}},components:{ContentBlock:X["ContentBlock"],ActivityIndicator:X["ActivityIndicator"],Field:ee["Field"],SaveButton:ee["SaveButton"],PasswordConfirmation:ee["PasswordConfirmation"]},directives:{Form:ee["Form"]},data:function(){return{isLoading:!1,loadingDataPurge:!1,dataWasPurged:!1,showPurgeNowLink:!0,deleteLowestInterval:this.deleteData.config.delete_logs_schedule_lowest_interval,showPasswordConfirmModal:!1,showPasswordConfirmModalForPurge:!1}},methods:{save:function(e){var t="PrivacyManager.setScheduleReportDeletionSettings";Ft.savePurgeDataSettings(t,{deleteLowestInterval:this.deleteLowestInterval},e)},executeDataPurge:function(){Ft.state.value.isModified?X["Matomo"].helper.modalConfirm("#saveSettingsBeforePurge",{yes:function(){return null}}):this.showPasswordConfirmModalForPurge=!0},getPurgeEstimate:function(){return Ft.reloadDbStats(!0)},executePurgeNow:function(e){var t=this;return this.loadingDataPurge=!0,this.showPurgeNowLink=!1,X["AjaxHelper"].post({module:"API",method:"PrivacyManager.executeDataPurge"},{passwordConfirmation:e}).then((function(){Ft.reloadDbStats(),t.dataWasPurged=!0,setTimeout((function(){t.dataWasPurged=!1,t.showPurgeNowLink=!0}),2e3)})).catch((function(){t.showPurgeNowLink=!0})).finally((function(){t.loadingDataPurge=!1}))}},computed:{showEstimate:function(){return Ft.state.value.showEstimate},isEitherDeleteSectionEnabled:function(){return Ft.isEitherDeleteSectionEnabled()},estimation:function(){return Ft.state.value.estimation},loadingEstimation:function(){return Ft.state.value.loadingEstimation}}});Cn.render=En;var kn=Cn;
/*!
 * Matomo - free/libre analytics platform
 *
 * @link https://matomo.org
 * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
 */}})}));
//# sourceMappingURL=PrivacyManager.umd.min.js.map