UNPKG

graphdb-workbench

Version:
1 lines 7.9 kB
"use strict";var index=require("./index-jdsA9lN2.js"),translation_service=require("./translation.service-CC6jY4U-.js"),workbenchApi=require("@ontotext/workbench-api");const ontoCookieConsentCss=".cookie-consent-modal{position:fixed;bottom:0;left:0;right:0;background-color:var(--gw-dialog-background);box-shadow:0 -2px 10px rgba(0, 0, 0, 0.1);padding:20px;z-index:1050;width:100%}.cookie-consent-content{display:flex;justify-content:center;align-items:center}.cookie-consent-content button{margin-left:12px}.cookie-policy-modal{padding:24px 40px;overflow-y:auto}.cookie-policy-modal .modal-dialog{width:60% !important;max-width:60% !important}.cookie-policy-modal .title{font-size:xx-large;font-weight:bolder}.cookie-policy-modal .heading{font-size:x-large;font-weight:bolder;margin-top:12px}.cookie-policy-modal .subheading{font-size:large;font-weight:bolder;margin-top:8px}.cookie-policy-modal .text{font-size:math}",OntoCookieConsent=class{constructor(e){index.registerInstance(this,e),this.consentGiven=index.createEvent(this,"consentGiven"),this.showModal=!1,this.openModal=e=>{e.preventDefault(),this.showModal=!0},this.handleConsentClick=()=>{this.consentGiven.emit()}}onDialogClose(){this.showModal=!1}render(){return index.h(index.Host,{key:"dba3fc373e9ad60ada7f86d11acbe1b1ed24a92d"},index.h("div",{key:"414c970a3a4b263e8f3f5d066dc8bb22b8194c48",class:"cookie-consent-modal"},index.h("section",{key:"6a1cccadb167b301738fb6a453b7d300e93ba18b",class:"cookie-consent-content"},index.h("span",{key:"aa62410b522125feeb48eaa568a78c761e6b9596"},index.h("translate-label",{key:"0696068c1aa8738bb3ddf0e548d9140ba12609e1",labelKey:"cookie.cookie_consent"}),index.h("a",{key:"efd9792a6a424b86606b3904615c53f19a2cdb6e",id:"cookie-policy-link",href:"#",onClick:this.openModal,class:"btn btn-link p-0"},index.h("translate-label",{key:"12e95d1446f81b47c973e285ee71da5fbfa4934f",labelKey:"cookie.cookie_policy_url_label"})),"."),index.h("button",{key:"a91e7d9e7eddef1b50d82570f4211a0e1e1ae7b0",id:"accept-cookie-policy",class:"onto-btn onto-btn-primary",onClick:this.handleConsentClick},index.h("translate-label",{key:"5ca81d4f299a7b7f13ed0f77ac7d1ceaeaad318a",labelKey:"common.button.ok"})))),this.showModal&&index.h("onto-cookie-policy-dialog",{key:"e54d3f134771ff5f59a288d0d6c9949c6f59567f",dialogHandler:this}))}};OntoCookieConsent.style=ontoCookieConsentCss;const ontoCookiePolicyDialogCss="section h4{font-size:x-large;font-weight:bolder;margin-top:12px}";var CookieType;!function(e){e.THIRD_PARTY="thirdParty",e.STATISTIC="statistic"}(CookieType||(CookieType={}));const OntoCookiePolicyDialog=class{constructor(e){index.registerInstance(this,e),this.logger=translation_service.LoggerProvider.logger,this.user=workbenchApi.ServiceProvider.get(workbenchApi.SecurityContextService).getAuthenticatedUser(),this.securityService=workbenchApi.ServiceProvider.get(workbenchApi.SecurityService)}toggleChanged(e){this.setUserCookieConsent(this.updateCookieConsent(e.detail)),this.securityService.updateAuthenticatedUser(this.user.toUser()).catch(this.logger.error)}render(){var e,o;const a={dialogTitle:translation_service.TranslationService.translate("cookie.policy.title"),onClose:()=>this.dialogHandler.onDialogClose(),modalClass:"cookie-policy-modal"},i=new workbenchApi.CookieConsent(null===(o=null===(e=this.user)||void 0===e?void 0:e.appSettings)||void 0===o?void 0:o.COOKIE_CONSENT);return index.h("onto-dialog",{key:"c76529daf7d24ad06970ba3b8e7f87446daeec37",config:a},index.h("div",{key:"412c71cf9a3b8e094962a4e4299679f16394869a",slot:"body"},index.h("section",{key:"0d730d3c02ab298d66de7ab56100bc1f13d989c6"},index.h("h4",{key:"4cbcc42d566ebf8e4c7507df9b367e9caa847565"},index.h("translate-label",{key:"ceed3f8d2aa7de9b614af25c6c4cb66ac1d74869",labelKey:"cookie.policy.purpose_heading"})),index.h("p",{key:"f9a72d8c3fbc9a04ea488e6045e6d8d74d8e7265"},index.h("translate-label",{key:"046cacb46e54bc228dcb7bf3a692f9fb28798de5",labelKey:"cookie.policy.purpose_text"})),index.h("p",{key:"70bbd5c2f6d30771477b3ee6e822a8def976e050"},index.h("translate-label",{key:"cc95a3b4ea1292ea33226bfb27db8fdc8a03969a",labelKey:"cookie.policy.purpose_enterprise_text"}))),index.h("section",{key:"4340f499aaa0de9b0bd7a5b089efd93a66f864bd"},index.h("h4",{key:"c31244de543a54f52382d572c203f15c9f6bc61d"},index.h("translate-label",{key:"3193fab62ec3f9132793a3100600017c12606546",labelKey:"cookie.policy.privacy_commitment_heading"})),index.h("p",{key:"ba75b0d207a6e4423ad87317abdae05a386109cd"},index.h("translate-label",{key:"8362dabe248988373af6ffe8219ddd229b585d45",labelKey:"cookie.policy.privacy_commitment_text"})),index.h("ul",{key:"ac3a59a29d8ff17f59834734e10fa38c5891024e"},index.h("li",{key:"d8cda68c7424c76138f7da948cd522d4994cbd4f"},index.h("translate-label",{key:"9f10c3678b02c7153a3aef73e86d9fe6b4fd5557",labelKey:"cookie.policy.privacy_commitment_1"})),index.h("li",{key:"623c725c85c2706425b8f5f27750393c8b88a761"},index.h("translate-label",{key:"acdbad3cc0590aa0094ae6d0e0d5a00964291c41",labelKey:"cookie.policy.privacy_commitment_2"})))),index.h("section",{key:"aecf76c57fcfce12f1f67643a587f390b975eb95"},index.h("h4",{key:"5264365da2a50c4c24cb5a8d14dd039ff7c3f5de"},index.h("translate-label",{key:"c3b7711c0959ddcce90986b2dcc5e42e2aacedcb",labelKey:"cookie.policy.cookies_heading"})),index.h("p",{key:"92b79942b35a9e6224c95c0b955505a49cc67b00"},index.h("translate-label",{key:"86822629019ad073ef2d90899da1397a87d5796f",labelKey:"cookie.policy.cookies_text"}))),index.h("section",{key:"3ea0f6201a2d78b40045adb4aa26eb8baa382adc"},index.h("h4",{key:"b96b6a082351c803d229038c2ca7acc99294ab86"},index.h("translate-label",{key:"6aab9024ff0fd8734706bd7caec59335c3ddc7ac",labelKey:"cookie.policy.manage_cookies_heading"})),index.h("onto-toggle-switch",{key:"c97358e1147cbb36d950302ee2fc29733e088ef9",checked:null==i?void 0:i.statistic,labelKey:"cookie.policy.statistic_cookies",tooltipTranslationKey:"cookie.policy.statistic_tooltip",context:CookieType.STATISTIC}),index.h("p",{key:"e6172a9fb3b8e1b0ab10609b1ebda7fcf350e93b"},index.h("translate-label",{key:"701fb389671ed440a1080e6e76fd1344cb4e5b6e",labelKey:"cookie.policy.statistic_text"})),index.h("onto-toggle-switch",{key:"e36a2699b2140e33288dd2cac9702d8fca6784db",checked:null==i?void 0:i.thirdParty,labelKey:"cookie.policy.third_party_cookies",tooltipTranslationKey:"cookie.policy.third_party_tooltip",context:CookieType.THIRD_PARTY}),index.h("p",{key:"98cced78a81c9942b5f5169fee662c368192946e"},index.h("translate-label",{key:"df1ba989e1fc792fa9f56e4f9661fdb28fa55f90",labelKey:"cookie.policy.third_party_cookies_text"}))),index.h("p",{key:"a892129a7183dd84e10eb31cf5a6a1698b61b5d7"},index.h("span",{key:"c2b6a400347f2019c7647273c3d7029f0ad9b039"},index.h("translate-label",{key:"d43317f8f68615516c7a81e8aa787756bdec1205",labelKey:"cookie.policy.change_cookies"}),index.h("i",{key:"8f9efc29f7630c1d6e58fdf50241ff625fc8c7bf"}," ",index.h("translate-label",{key:"6c906a77d90237a17b5c3e1887c41b532830040d",labelKey:"menu.setup.label"})," > ",index.h("translate-label",{key:"75f59cf20cd4a1fbee4afb3388b5f341fd957613",labelKey:"menu.my.settings.label"})," > ",index.h("translate-label",{key:"352f8f0b324655e86bc9175e8c70567e34e68f2a",labelKey:"security.user.settings"})," > ",index.h("translate-label",{key:"0067f9f65859f946006115d1957337f42a805274",labelKey:"cookie.policy.change_cookies_location4"})," ")))))}updateCookieConsent(e){var o,a;const i=new workbenchApi.CookieConsent(null===(a=null===(o=this.user)||void 0===o?void 0:o.appSettings)||void 0===a?void 0:a.COOKIE_CONSENT);return i[e.context]=e.checked,i.updatedAt=(new Date).getTime(),i}setUserCookieConsent(e){this.user.appSettings||(this.user.appSettings=new workbenchApi.AppSettings),this.user.appSettings.COOKIE_CONSENT=e}};OntoCookiePolicyDialog.style=ontoCookiePolicyDialogCss,exports.onto_cookie_consent=OntoCookieConsent,exports.onto_cookie_policy_dialog=OntoCookiePolicyDialog;