/*
* This file is part of the TYPO3 CMS project.
*
* It is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License, either version 2
* of the License, or any later version.
*
* For the full copyright and license information, please read the
* LICENSE.txt file that was distributed with this source code.
*
* The TYPO3 project - inspiring people to share!
*/
import{property as b,state as h,customElement as $}from"lit/decorators.js";import{LitElement as v,html as s,nothing as d}from"lit";import{classMap as R}from"lit/directives/class-map.js";import p from"@typo3/core/ajax/ajax-request.js";import y from"@typo3/core/event/regular-event.js";import i from"~labels/backend.modules.content_security_policy";import"bootstrap";var a=function(r,e,t,l){var o=arguments.length,c=o<3?e:l===null?l=Object.getOwnPropertyDescriptor(e,t):l,u;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")c=Reflect.decorate(r,e,t,l);else for(var m=r.length-1;m>=0;m--)(u=r[m])&&(c=(o<3?u(c):o>3?u(e,t,c):u(e,t))||c);return o>3&&c&&Object.defineProperty(e,t,c),c},f;(function(r){r.fixable="fixable",r.irrelevant="irrelevant",r.suspicious="suspicious"})(f||(f={}));let n=class extends v{constructor(){super(...arguments),this.selectedScope=null,this.reports=[],this.selectedReport=null,this.suggestions=[],this.previouslyFocusedRow=null}connectedCallback(){super.connectedCallback(),this.fetchReports(),this.peripheralEvent=new y("click",(e,t)=>{t.dataset.cspReportsHandler==="refresh"&&(e.preventDefault(),this.fetchReports())}),this.peripheralEvent.delegateTo(document,"[data-csp-reports-handler]")}disconnectedCallback(){super.disconnectedCallback(),this.peripheralEvent?.release()}updated(e){super.updated(e),e.has("selectedReport")&&this.selectedReport!==null&&this.updateComplete.then(()=>{this.querySelector("#report-details")?.focus()})}createRenderRoot(){return this}render(){return s`