PageSourceSearch

https://www.platformhg.com/themes/phg/dist/assets/accordion.1b43d4b4.js

js platformhg.com collected 2026-10-04 07:09:25 UTC 2,706 bytes, 1 lines download raw bytes

1import{f as s,t as o}from"./player.es.1831a12d.js";import{f as r}from"./main.83327c66.js";const l={el:null,closeOtherItems:!0,items:[]},h={el:null,btn:null,focusableItems:[],container:null,innerFocusOpen:!1,isOpen:!1,animationFrame:null,parent:null};function g(t){return Array.from(t).map(u)}function u(t){if(!t)return;const e=Object.create(l);return f.call(e,t),e}function f(t){this.el=t,this.closeOtherItems=this.el.dataset.independantItems!=="true";const e=this.el.querySelectorAll(".js-accordion"),i=Array.from(e);this.items=i.map(c=>d(c,this))}function d(t,e){if(!t)return;const i=Object.create(h);return m.call(i,t,e),i}function m(t,e){this.el=t,this.parent=e,this.btn=this.el.querySelector(".js-accordion-btn"),this.container=this.el.querySelector(".js-accordion-container"),typeof this.el.dataset.innerFocusOpen=="string"&&(this.innerFocusOpen=this.el.dataset.innerFocusOpen==="true"),this.el.dataset.active&&(this.container.style.height=Math.ceil(this.container.scrollHeight)+"px"),this.focusableItems=this.container.querySelectorAll('a[href], area[href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), button:not([disabled]), [tabindex="0"]'),this.focusableItems=Array.from(this.focusableItems),p.call(this)}function p(){s(this.btn,"click").subscribe(b.bind(this)),o(this.container).subscribe(t=>{t.target===this.container&&(this.isOpen?this.container.style.height="auto":(this.innerFocusOpen||(this.container.hidden=!0),this.btn.setAttribute("aria-expanded",!1)))}),s(this.container,"focusin").pipe(r(()=>!this.isOpen&&this.innerFocusOpen)).subscribe(a.bind(this)),s(this.container,"focusout").pipe(r(t=>!~this.focusableItems.indexOf(t.relatedTarget)&&this.innerFocusOpen)).subscribe(n.bind(this)),document.getElementsByClassName("c-property-listing__search").length&&document.addEventListener("click",t=>{t.target.closest(".c-search")||this.isOpen&&n.call(this)})}function b(){this.isOpen?n.call(this):a.call(this)}function a(){this.animationFrame&&cancelAnimationFrame(this.animationFrame),this.innerFocusOpen||(this.container.hidden=!1),this.container.style.height=Math.ceil(this.container.scrollHeight)+"px",this.el.dataset.active=!0,this.btn.setAttribute("aria-expanded",!0),O.call(this),this.isOpen=!0}function n(){this.animationFrame&&cancelAnimationFrame(this.animationFrame),this.container.style.height=Math.ceil(this.container.scrollHeight)+"px",this.animationFrame=requestAnimationFrame(()=>{this.el.removeAttribute("data-active"),this.container.style.height=0,this.animationFrame=null}),this.isOpen=!1}function O(){!this.parent||!this.parent.closeOtherItems||this.parent.items.forEach(t=>{t!==this&&n.call(t)})}export{g as Accordions,d as createAccordion};

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.