PageSourceSearch

https://www.ny-bankruptcy.com/wp-content/cache/min/1/wp-content/pl…/filters/filters.js?ver=1790344562

js ny-bankruptcy.com collected 2026-09-26 11:14:44 UTC 4,676 bytes, 35 lines download raw bytes

1(function(){'use strict';var SEP='::';function active(form){return form.querySelector('[data-hzo-filters-active]')}
2function countEl(form){return form.querySelector('[data-hzo-filters-count]')}
3function inputs(form){return Array.prototype.slice.call(form.querySelectorAll('input[type="checkbox"],input[type="radio"]'))}
4function labelFor(input){if(input.getAttribute('data-label')){return input.getAttribute('data-label')}
5var lab=input.closest('label');return((lab?lab.textContent:input.value)||'').trim()}
6function keyOf(name,value){return name+SEP+value}
7function removeLabelFor(form,label){var tpl=form.getAttribute('data-hzo-filters-remove-label');return tpl?tpl.replace(/\{label\}/g,label):'Remove '+label+' filter'}
8function makeChip(form,name,value,label){var chip=document.createElement('span');chip.className='hzo-tag hzo-tag--removable';chip.setAttribute('data-value',keyOf(name,value));chip.setAttribute('data-label',label);chip.appendChild(document.createTextNode(label));var btn=document.createElement('button');btn.type='button';btn.className='hzo-tag__remove';btn.setAttribute('aria-label',removeLabelFor(form,label));btn.innerHTML='<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" aria-hidden="true"><line x1="18" y1="6" x2="6" y2="18"/><line x1="6" y1="6" x2="18" y2="18"/></svg>';chip.appendChild(btn);return chip}
9function findChip(form,name,value){var box=active(form);if(!box){return null}
10var chips=box.querySelectorAll('.hzo-tag');for(var i=0;i<chips.length;i++){if(chips[i].getAttribute('data-value')===keyOf(name,value)){return chips[i]}}
11return null}
12function addChip(form,input){var box=active(form);if(!box||findChip(form,input.name,input.value)){return}
13box.appendChild(makeChip(form,input.name,input.value,labelFor(input)))}
14function removeChip(form,name,value){var chip=findChip(form,name,value);if(chip){chip.parentNode.removeChild(chip)}}
15function dropGroupChips(form,name){var box=active(form);if(!box){return}
16var chips=box.querySelectorAll('.hzo-tag');for(var i=0;i<chips.length;i++){if((chips[i].getAttribute('data-value')||'').indexOf(name+SEP)===0){chips[i].parentNode.removeChild(chips[i])}}}
17function activeList(form){var out=[];inputs(form).forEach(function(i){if(i.checked){out.push({name:i.name,value:i.value,label:labelFor(i)})}});return out}
18function setCount(form,text){var el=countEl(form);if(el){el.textContent=text}}
19function announceText(form,n){var tpl=n?form.getAttribute('data-hzo-filters-announce'):form.getAttribute('data-hzo-filters-announce-empty');if(tpl){return tpl.replace(/\{count\}/g,String(n)).replace(/\{s\}/g,n===1?'':'s')}
20return n?(n+' filter'+(n===1?'':'s')+' applied'):'No filters applied'}
21function emit(form){var list=activeList(form);
21if(form.hasAttribute('data-hzo-filters-demo')||form.hasAttribute('data-hzo-filters-announce')||form.hasAttribute('data-hzo-filters-announce-empty')){setCount(form,announceText(form,list.length))}
22form.dispatchEvent(new CustomEvent('hzo:filterchange',{bubbles:!0,detail:{active:list,form:form}}))}
23document.addEventListener('change',function(e){var input=e.target;if(!input||(input.type!=='checkbox'&&input.type!=='radio')){return}
24var form=input.closest('[data-hzo-filters]');if(!form){return}
25if(input.type==='radio'){dropGroupChips(form,input.name);if(input.checked){addChip(form,input)}}else if(input.checked){addChip(form,input)}else{removeChip(form,input.name,input.value)}
26emit(form)});document.addEventListener('hzo:tagremoved',function(e){var form=e.target.closest?e.target.closest('[data-hzo-filters]'):null;if(!form){return}
27var parts=String((e.detail&&e.detail.value)||'').split(SEP);if(parts.length===2){inputs(form).forEach(function(i){if(i.name===parts[0]&&i.value===parts[1]){i.checked=!1}})}
28emit(form)});document.addEventListener('click',function(e){var clear=e.target.closest?e.target.closest('[data-hzo-filters-clear]'):null;if(!clear){return}
29var form=clear.closest('[data-hzo-filters]');if(!form){return}
30e.preventDefault();inputs(form).forEach(function(i){i.checked=!1});var box=active(form);if(box){box.innerHTML=''}
31emit(form)});function setup(form){if(!form||form.getAttribute('data-hzo-filters-ready')==='true'){return}
32form.setAttribute('data-hzo-filters-ready','true')}
33function init(scope){var forms=(scope||document).querySelectorAll('[data-hzo-filters]');for(var i=0;i<forms.length;i++){setup(forms[i])}}
34if(document.readyState==='loading'){document.addEventListener('DOMContentLoaded',function(){init()})}else{init()}
35window.hzo=window.hzo||{};window.hzo.filters=window.hzo.filters||{};window.hzo.filters.setCount=setCount;window.hzo.filters.init=init;window.hzo.filters.setup=setup})()

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.