1import{e as U}from"./chunk-Q2ZFVKXM.js";import"./chunk-M7DG3TJ5.js";import"./chunk-CS7JNEUM.js";import"./chunk-VWNPD7LZ.js";import"./chunk-XCWTICCW.js";import"./chunk-WHRLM6FK.js";import"./chunk-APGALGRK.js";import"./chunk-FTK7S3EN.js";import"./chunk-4HQBTCBE.js";import"./chunk-5PGW6P4A.js";import"./chunk-UGFWVRF2.js";import"./chunk-N5UYJU7J.js";import"./chunk-KYGTR74U.js";import"./chunk-3MUYEG6H.js";import"./chunk-YLU46Y7C.js";import"./chunk-V2KAVRA2.js";import"./chunk-S7M6U5S4.js";import"./chunk-Z5TDZRP3.js";import"./chunk-4SCR5DG6.js";import{k as M,l as R}from"./chunk-HKJJRB33.js";import"./chunk-FV2C7TY2.js";import"./chunk-CPTKFTIM.js";import"./chunk-JKRMJKA3.js";import"./chunk-SLVDMFGS.js";import"./chunk-THY3MMC6.js";import"./chunk-UFTGMRMD.js";import{d as D}from"./chunk-FXQWEZUV.js";import{m as H}from"./chunk-WZDDNYQF.js";import{j as h,k as u}from"./chunk-VIIPYZKN.js";import"./chunk-LVPPWY67.js";import"./chunk-XJW42NPY.js";import"./chunk-JCFZDGYA.js";import{b as $}from"./chunk-PUCUMHJM.js";import"./chunk-UA47CARV.js";import{$b as p,Ba as E,Oc as S,Sb as d,Ub as m,Vb as f,Vc as _,Wc as C,Xb as g,Ya as b,Yb as v,Zb as r,_b as a,ac as w,eb as l,fa as s,gc as T,ic as O,id as V,kc as F,la as x,ma as A,mc as c,qa as y,sb as I,uc as P,vc as k,wb as L}from"./chunk-ZZOWLDLZ.js";import"./chunk-FPO36RWJ.js";var Q=["summary"];function W(n,o){if(n&1&&w(0,"ucp-heading-intro",2),n&2){let e=c();r("heading",e.element.heading)("introText",e.element.introText)("level",e.headingLevel())}}function j(n,o){if(n&1&&T(0,10),n&2){let e=c().$implicit,t=c(3);r("ucpRenderComponent",e)("headingLevelContext",t.element.heading?t.headingLevel()+1:t.headingLevel())}}function z(n,o){if(n&1&&d(0,j,1,2,"ng-container",10),n&2){let e=o.$implicit;m(e?0:-1)}}function q(n,o){if(n&1){let e=O();a(0,"details",4)(1,"summary",5,0),_(3,"kebabCase"),_(4,"removeUrlParams"),F("click",function(i){let B=x(e).$index,N=c(2);return A(N.toggleAccordion(i,B))}),a(5,"span",6,1),w(7,"span",7)(8,"ucp-ui-icon",8),p()(),a(9,"div",9),g(10,z,1,1,null,null,f),p()()}if(n&2){let e=o.$implicit,t=o.$index,i=c(2);r("open",i.selectedAccordions[t]),l(),r("id","ucp-"+C(4,6,C(3,4,e.titleHtml))),l(6),r("innerHTML",e.titleHtml,b),l(),r("name",i.selectedAccordions[t]?"chevron_up":"chevron_down"),l(2),v(e.contentElementList)}}function K(n,o){if(n&1&&g(0,q,12,8,"details",4,f),n&2){let e=c();v(e.accordionList)}}var re=(()=>{class n extends D{constructor(){super(...arguments),this.detailsElements=V("summary"),this.intersectionObserverService=s(M),this.removeUrlParamsPipe=s(u),this.kebabCasePipe=s(h),this.activatedRoute=s(H),this.#e=s(y),this.accordionList=[],this.selectedAccordions=[],this.#t=!0}#e;#t;ngOnInit(){this.accordionList=this.element.accordionElementList}ngAfterViewInit(){super.ngAfterViewInit(),this.detailsElements().forEach(t=>{this.intersectionObserverService.observe(t.nativeElement.id,t.nativeElement)});let e=this.activatedRoute.snapshot.fragment;e?this.handleNewFragment(e):this.element.openFirst&&(this.selectedAccordions[0]=!0),this.#e.defaultView?.addEventListener("hashchange",this.onHashChange.bind(this))}ngOnDestroy(){this.detailsElements().forEach(e=>{this.intersectionObserverService.unobserve(e.nativeElement.id)}),this.#e.defaultView?.removeEventListener("hashchange",this.onHashChange)}onHashChange(){let e=this.findIndexOfChildWithId(window.location.hash.substring(1));e>=0&&(this.closeAllAccordions(),this.selectedAccordions[e]=!0,this.scrollAccordionIntoView(e))}handleNewFragment(e){let t=this.findIndexOfChildWithId(e);if(t>-1){this.#t=!1,this.selectedAccordions[t]=!0,this.scrollAccordionIntoView(t);return}}findIndexOfChildWithId(e){return this.element.accordionElementList?.findIndex(t=>"ucp-"+this.removeUrlParamsPipe.transform(this.kebabCasePipe.transform(t.titleHtml))===e)}scrollAccordionIntoView(e){if(this.#t)return;let t=this.detailsElements()[e];t&&this.isAccordionOpen(e)&&(setTimeout(()=>{window.scroll(0,1)}),setTimeout(()=>{t.nativeElement.scrollIntoView({behavior:"smooth",block:"start"})},260))}isAccordionOpen(e){return this.selectedAccordions[e]}toggleAccordion(e,t){if(e.preventDefault(),!this.element.oneElement)this.selectedAccordions[t]=!this.selectedAccordions[t];else{let i=this.selectedAccordions[t];this.closeAllAccordions(),this.selectedAccordions[t]=!i}}closeAllAccordions(){for(let e=0;e<=this.element.accordionElementList?.length-1;e++)this.selectedAccordions[e]=!1}static{this.\u0275fac=(()=>{let e;return function(i){return(e||(e=E(n)))(i||n)}})()}static{this.\u0275cmp=I({type:n,selectors:[["ucp-accordion"]],viewQuery:function(t,i){t&1&&P(i.detailsElements,Q,5),t&2&&k()},features:[S([u,h]),L],decls:3,vars:2,consts:[["summary",""],["accordionElement",""],[3,"heading","introText","level"],[1,"accordion-container","tw-w-full","tw-mx-auto"],[1,"accordion-element","tw-bg-foreground","tw-mb-1",3,"open"],[1,"tw-list-none","tw-cursor-pointer",3,"click","id"],[1,"accordion-element-btn","tw-flex","tw-justify-between","tw-w-full","tw-p-6","tw-rounded-sm","tw-font-medium","tw-text-left","tw-text-lg","typography-md:tw-text-xl","typography-lg:tw-text-2xl","typography-lg:tw-font-title"],[1,"tw-flex-1",3,"innerHTML"],[1,"arrow-icon","tw-rounded-full","tw-size-8","t
1w-text-white","tw-bg-primary","dark:tw-bg-secondary","tw-flex-shrink-0","tw-flex-grow-0",3,"name"],[1,"tw-px-6","tw-pt-6","tw-pb-10"],[3,"ucpRenderComponent","headingLevelContext"]],template:function(t,i){t&1&&(d(0,W,1,3,"ucp-heading-intro",2),a(1,"div",3),d(2,K,2,0),p()),t&2&&(m(i.element.heading||i.element.introText?0:-1),l(2),m((i.accordionList==null?null:i.accordionList.length)>0?2:-1))},dependencies:[$,R,U,h,u],styles:[".accordion-element[_ngcontent-%COMP%] summary[_ngcontent-%COMP%]{scroll-margin-top:var(--ucp-ui-opener-sticky-notch-height, 0)}"]})}}return n})();export{re as AccordionComponent};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.