(()=>{"use strict";var e={582(e){e.exports=window.wp.coreData},143(e){e.exports=window.wp.data},87(e){e.exports=window.wp.element},233(e){e.exports=window.wp.preferences},53(e){e.exports=window.wp.privateApis},686(e,t,r){r.d(t,{j:()=>n});var o=Object.prototype.hasOwnProperty;function i(e,t,r){for(r of e.keys())if(n(r,t))return r}function n(e,t){var r,s,a;if(e===t)return!0;if(e&&t&&(r=e.constructor)===t.constructor){if(r===Date)return e.getTime()===t.getTime();if(r===RegExp)return e.toString()===t.toString();if(r===Array){if((s=e.length)===t.length)for(;s--&&n(e[s],t[s]););return-1===s}if(r===Set){if(e.size!==t.size)return!1;for(s of e){if((a=s)&&"object"==typeof a&&!(a=i(t,a)))return!1;if(!t.has(a))return!1}return!0}if(r===Map){if(e.size!==t.size)return!1;for(s of e){if((a=s[0])&&"object"==typeof a&&!(a=i(t,a)))return!1;if(!n(s[1],t.get(a)))return!1}return!0}if(r===ArrayBuffer)e=new Uint8Array(e),t=new Uint8Array(t);else if(r===DataView){if((s=e.byteLength)===t.byteLength)for(;s--&&e.getInt8(s)===t.getInt8(s););return-1===s}if(ArrayBuffer.isView(e)){if((s=e.byteLength)===t.byteLength)for(;s--&&e[s]===t[s];);return-1===s}if(!r||"object"==typeof e){for(r in s=0,e){if(o.call(e,r)&&++s&&!o.call(t,r))return!1;if(!(r in t)||!n(e[r],t[r]))return!1}return Object.keys(t).length===s}}return e!=e&&t!=t}},32(e,t,r){r.d(t,{P:()=>i,z:()=>n});var o=["titleField","mediaField","descriptionField","showTitle","showMedia","showDescription","showLevels","infiniteScrollEnabled"];function i(e,t,r){if(!t)return e;let i=e;for(const e of o)e in t&&(i={...i,[e]:t[e]});if(t.filters&&t.filters.length>0){const r=new Set(t.filters.map(e=>e.field)),o=(e.filters??[]).filter(e=>!r.has(e.field));i={...i,filters:[...o,...t.filters]}}if(t.sort){r&&e.sort?.field===r.sort?.field&&e.sort?.direction===r.sort?.direction&&(i={...i,sort:t.sort})}return t.layout&&(i={...i,layout:{...i.layout,...t.layout}}),t.groupBy&&(i={...i,groupBy:t.groupBy}),i}function n(e,t,r){if(!t)return e;let i=e;for(const e of o)if(e in t){const{[e]:t,...r}=i;i=r}if(t.filters&&t.filters.length>0){const r=new Set(t.filters.map(e=>e.field));i={...i,filters:(e.filters??[]).filter(e=>!r.has(e.field))}}if(t.sort&&e.sort?.field===t.sort.field&&e.sort?.direction===t.sort.direction&&(i={...i,sort:r?.sort}),t.layout&&"layout"in i&&i.layout){const e={...i.layout};for(const r of Object.keys(t.layout))delete e[r];i={...i,layout:Object.keys(e).length>0?e:void 0}}if(t.groupBy&&"groupBy"in i){const{groupBy:e,...t}=i;i=t}return i}},376(e,t,r){r.d(t,{Q:()=>a});var o=r(143),i=r(233),n=r(270),s=r(32);async function a(e){const{kind:t,name:r,slug:a,defaultView:f,activeViewOverrides:u,queryParams:l}=e,c=(0,n.A)(t,r,a),d=(0,o.select)(i.store).get("core/views",c)??f,p=l?.page??1,w=l?.search??"",y=e.defaultLayouts?.[d?.type],g={...y&&!0!==y?y:{},...u};return(0,s.P)({...d,page:p,search:w},g,f)}},228(e,t,r){r.d(t,{T:()=>n});var o=r(53),{lock:i,unlock:n}=(0,o.__dangerousOptInToUnstableAPIsOnlyForCoreModules)("I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.","@wordpress/views")},270(e,t,r){function o(e,t,r){return`dataviews-${e}-${t}-${r}`}r.d(t,{A:()=>o})},862(e,t,r){r.d(t,{n:()=>s});var o=r(143),i=r(582),n=r(228);function s({kind:e,name:t}){return(0,o.useSelect)(r=>(0,n.T)(r(i.store)).getViewConfig(e,t),[e,t])}},275(e,t,r){r.d(t,{l:()=>u});var o=r(686),i=r(87),n=r(143),s=r(233),a=r(270),f=r(32);function u(e){const{kind:t,name:r,slug:u,defaultView:l,activeViewOverrides:c,queryParams:d,onChangeQueryParams:p}=e,w=(0,a.A)(t,r,u),y=(0,n.useSelect)(e=>e(s.store).get("core/views",w),[w]),{set:g}=(0,n.useDispatch)(s.store),v=(0,i.useMemo)(()=>y??l??{},[y,l]),h=Number(d?.page??v.page??1),b=d?.search??v.search??"",m=(0,i.useMemo)(()=>{const t=e.defaultLayouts?.[v.type];return{...t&&!0!==t?t:{},...c}},[e.defaultLayouts,v.type,c]);return{view:(0,i.useMemo)(()=>(0,f.P)({...v,page:h,search:b},m,l),[v,h,b,m,l]),isModified:!!y,updateView:(0,i.useCallback)(e=>{const t={page:e?.page,search:e?.search},r=(0,f.z)(function(e,t){const r={...e};for(const e of t)delete r[e];return r}(e,["page","search"]),m,l);p&&!(0,o.j)(t,{page:h,search:b})&&p(t);const i=(0,f.z)(v,m,l),n=(0,f.z)(l,m,l);(0,o.j)(i,r)||((0,o.j)(r,n)?g("core/views",w,void 0):g("core/views",w,r))},[p,h,b,v,l,m,g,w]),resetToDefault:(0,i.useCallback)(()=>{g("core/views",w,void 0)},[w,g])}}}},t={};function r(o){var i=t[o];if(void 0!==i)return i.exports;var n=t[o]={exports:{}};return e[o](n,n.exports,r),n.exports}r.d=(e,t)=>{for(var o in t)r.o(t,o)&&!r.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var o={};r.r(o),r.d(o,{loadView:()=>n.Q,useView:()=>i.l,useViewConfig:()=>s.n});var i=r(275),n=r(376),s=r(862);(window.wp=window.wp||{}).views=o})();