PageSourceSearch

https://static.jamestownestatehomes.com/jamestown/js/partial/oifilter.js?v=2229736

js jamestownestatehomes.com collected 2026-09-30 17:46:37 UTC 5,625 bytes, 3 lines download raw bytes

1import{a as s}from"../chunk-WVJHLTE6.js";var m=null;function B(t){if(window.history&&"pushState"in window.history){let e=t.data.data.url;window.history.pushState(null,"",e);let o=document.querySelector('link[rel="canonical"]');o!==null&&(o.href=e)}}s(B,"update_url");function v(t,e,o){return t.reduce(function(i,d){let c=d[e];return i[c]||(i[c]=[]),i[c].push(d[o]),i},{})}s(v,"groupBy");function S(t){let e=new FormData(t),o=[];e.forEach(function(d,c){let f={name:c,value:d};o.push(f)});let i=v(o,"name","value");e=new FormData;for(let d in i)i.hasOwnProperty(d)&&e.append(d,i[d].join("|"));return e}s(S,"getFormData");function T(t){if(t){let e;for(e=0;e<t.elements.length;e++)t.elements[e].setAttribute("disabled","disabled");let o=document.getElementsByClassName("oi-disable-while-pending");for(e=0;e<o.length;e++)o[e].setAttribute("disabled","disabled");let i=document.getElementsByClassName("model-filters");for(e=0;e<i.length;e++)i[e].style.opacity="0.6"}}s(T,"oiFilterDisableForm");function y(t){if(t){let e;for(e=0;e<t.elements.length;e++)t.elements[e].disabled=!1,t.elements[e].removeAttribute("disabled");let o=document.getElementsByClassName("oi-disable-while-pending");for(e=0;e<o.length;e++)o[e].disabled=!1,o[e].removeAttribute("disabled");let i=document.getElementsByClassName("model-filters");for(e=0;e<i.length;e++)i[e].style.opacity="1"}}s(y,"oiFilterEnableFormNow");function g(t){t&&setTimeout(function(){y(t)},500)}s(g,"oiFilterEnableForm");function A(t,e){(e===void 0||e===!1)&&T(t)}s(A,"oiFilterAjaxBeforesend");function h(t,e){let o=!1;E.forEach(n=>n.abort()),m==null||m.abort();let i=t.dataset.filterType,d=`/xhr/filter/${i}/`,c=S(t),f=t.dataset.detailPage?t.dataset.detailPage:!1;oi.axios({method:"post",url:d,data:c,headers:{"Content-Type":"application/json"},transformRequest:[function(n,r){return A(t,!1),n}]}).then(function(n){if(n.data.data.result_list){if(n.data.options){let a=n.data.options;for(let u in a)document.getElementById(u).innerHTML=a[u]}if(n.data.paginator&&n.data.paginator!==""){let a=t.querySelector('input[name="page"]');a&&(a.value=n.data.paginator.next)}e.innerHTML=n.data.data.result_list;let r=document.getElementById("oi-filter-amount");if(r!==null&&(r.innerHTML=n.data.data.amount||0),n.data.result_list_lot){let a=document.getElementById("oi-filter-results-lot");a.innerHTML=n.data.result_list}if(n.data.result_list_land){let a=document.getElementById("oi-filter-results-land");a.innerHTML=n.data.result_list}if(n.data.map_items&&n.data.map_items!==""){let a=document.querySelector(".oi-all-map-items");a.innerHTML=n.data.map_items}if(B(n),window.afterResultsSuccess!==void 0&&window.afterResultsSuccess(),oi.loaded.map["oi-map"]&&!f){let a=i;(a==="lot"||a==="mlslisting")&&(a="location"),oi.loaded.map["oi-map"].set_markers(a),oi.loaded.map["oi-map"].fit()}let l=n.data.data.ftype_remaining||[];m=new oi.filter.LoadedBatch({form:t.id||t.dataset.resultsTarget,items:l,filterType:i,beforeLoad:s(()=>b(),"beforeLoad"),afterLoad:s(()=>L(),"afterLoad"),beforeBatchLoad:s(()=>void 0,"beforeBatchLoad"),afterBatchLoad:s(a=>w(a,e),"afterBatchLoad")}),l.length||p()}else p()}).catch(function(n){if(n.response)if(n.response.status==400){let r="",l=n.response.data.errors;for(let a in l){let u=l[a];r=`${u.code} - ${u.description}
2`}g(t)}else n.response.status==302&&(o=!0,window.location.href=n.response.data.data.redirect);else n.request?console.error(n.request):console.error(n.message)}).then(function(){let n=t.querySelector('input[name="m"]');n!==null&&(n.value="0"),o||g(t)})}s(h,"oiFilterGetResults");window.addEventListener("load",()=>{let t=document.querySelectorAll(".oi-filter-form");t.length&&t.forEach(o=>{let i=o.querySelectorAll(".oi-filter-click"),d=o.querySelectorAll(".oi-filter-change"),c=document.getElementById("oi-filter-results");i.forEach(n=>{n.addEventListener("click",r=>{r.preventDefault(),h(o,c)})}),d.forEach(n=>{n.addEventListener("change",r=>{r.preventDefault(),h(o,c)})});let f=o.querySelectorAll(".oi-filter-reset");f!==null&&c!==null&&f.forEach(n=>{n.addEventListener("click",r=>{let l;r.preventDefault();let a=document.getElementsByClassName("oi-clear-on-reset");if(a)for(l=0;l<a.length;
2l++)a[l].type=="select-one"&&(a[l].selectedIndex=0),a[l].id=="boyl-input"&&(a[l].value=!1),a[l].type=="checkbox"&&(a[l].checked=!1);let u=document.getElementsByClassName("filter-button-on");if(u)for(l=0;l<u.length;l++)u[l].classList.remove("filter-button-on");h(o,c)})})});let e=document.location.pathname;window.addEventListener("popstate",o=>{if(e===o.target.location.pathname)return!1;location.reload()})});window.addEventListener("pageshow",t=>{t.persisted&&document.querySelectorAll(".oi-filter-form").forEach(e=>{y(e)})});function b(){}s(b,"onBeforeLoad");function q(){let t=new CustomEvent("oiItemsLoaded",{detail:{message:"items loaded"}});document.dispatchEvent(t)}s(q,"dispatchItemsLoaded");function p(){q()}s(p,"clearLoadState");function L(){p()}s(L,"onAfterLoad");function w(t,e){e==null||e.insertAdjacentHTML("beforeend",t.data.data.result_list)}s(w,"onAfterBatchLoad");var E=[];window.addEventListener("load",()=>{document.querySelectorAll(".oi-filter-form").forEach(t=>{let e=JSON.parse(t.dataset.remainingItems||"[]");if(!e.length){p();return}let o=document.querySelector(t.dataset.resultsTarget||"#oi-filter-results"),i=new oi.filter.LoadedBatch({items:e,form:t.id||t.dataset.resultsTarget,filterType:t.dataset.filterType||"",beforeLoad:s(()=>b(),"beforeLoad"),afterLoad:s(()=>L(),"afterLoad"),beforeBatchLoad:s(()=>void 0,"beforeBatchLoad"),afterBatchLoad:s(d=>w(d,o),"afterBatchLoad")});E.push(i)})});
3//# sourceMappingURL=oifilter.js.map

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.