mirror of
https://github.com/WordPress/WordPress.git
synced 2024-11-02 16:59:35 +01:00
2ec4c366e6
Update webpack version to latest version https://www.npmjs.com/package/webpack. This aligns closer with how the Gutenberg plugin handles WordPress packages. Related update in Gutenberg from August 2021: https://github.com/WordPress/gutenberg/pull/33818. Props walbo, desrosj, mukesh27. Fixes #51750. Built from https://develop.svn.wordpress.org/trunk@53135 git-svn-id: http://core.svn.wordpress.org/trunk@52724 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2 lines
45 KiB
JavaScript
2 lines
45 KiB
JavaScript
/*! This file is auto-generated */
|
|
!function(){"use strict";var e={2167:function(e){function t(e){return t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},t(e)}function n(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function r(e,t){var n=e._map,r=e._arrayTreeMap,i=e._objectTreeMap;if(n.has(t))return n.get(t);for(var o=Object.keys(t).sort(),s=Array.isArray(t)?r:i,a=0;a<o.length;a++){var u=o[a];if(void 0===(s=s.get(u)))return;var c=t[u];if(void 0===(s=s.get(c)))return}var l=s.get("_ekm_value");return l?(n.delete(l[0]),l[0]=t,s.set("_ekm_value",l),n.set(t,l),l):void 0}var i=function(){function e(t){if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.clear(),t instanceof e){var n=[];t.forEach((function(e,t){n.push([t,e])})),t=n}if(null!=t)for(var r=0;r<t.length;r++)this.set(t[r][0],t[r][1])}var i,o,s;return i=e,o=[{key:"set",value:function(n,r){if(null===n||"object"!==t(n))return this._map.set(n,r),this;for(var i=Object.keys(n).sort(),o=[n,r],s=Array.isArray(n)?this._arrayTreeMap:this._objectTreeMap,a=0;a<i.length;a++){var u=i[a];s.has(u)||s.set(u,new e),s=s.get(u);var c=n[u];s.has(c)||s.set(c,new e),s=s.get(c)}var l=s.get("_ekm_value");return l&&this._map.delete(l[0]),s.set("_ekm_value",o),this._map.set(n,o),this}},{key:"get",value:function(e){if(null===e||"object"!==t(e))return this._map.get(e);var n=r(this,e);return n?n[1]:void 0}},{key:"has",value:function(e){return null===e||"object"!==t(e)?this._map.has(e):void 0!==r(this,e)}},{key:"delete",value:function(e){return!!this.has(e)&&(this.set(e,void 0),!0)}},{key:"forEach",value:function(e){var n=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this;this._map.forEach((function(i,o){null!==o&&"object"===t(o)&&(i=i[1]),e.call(r,i,o,n)}))}},{key:"clear",value:function(){this._map=new Map,this._arrayTreeMap=new Map,this._objectTreeMap=new Map}},{key:"size",get:function(){return this._map.size}}],o&&n(i.prototype,o),s&&n(i,s),e}();e.exports=i}},t={};function n(r){var i=t[r];if(void 0!==i)return i.exports;var o=t[r]={exports:{}};return e[r](o,o.exports,n),o.exports}n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,{a:t}),t},n.d=function(e,t){for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var r={};!function(){n.r(r),n.d(r,{EntityProvider:function(){return Wt},__experimentalFetchLinkSuggestions:function(){return en},__experimentalFetchUrlData:function(){return nn},store:function(){return an},useEntityBlockEditor:function(){return Jt},useEntityId:function(){return zt},useEntityProp:function(){return Xt}});var e={};n.r(e),n.d(e,{__experimentalBatch:function(){return z},__experimentalReceiveCurrentGlobalStylesId:function(){return j},__experimentalReceiveThemeBaseGlobalStyles:function(){return G},__experimentalSaveSpecifiedEntityEdits:function(){return J},__unstableCreateUndoLevel:function(){return H},addEntities:function(){return q},deleteEntityRecord:function(){return $},editEntityRecord:function(){return Q},receiveAutosaves:function(){return te},receiveCurrentTheme:function(){return M},receiveCurrentUser:function(){return N},receiveEmbedPreview:function(){return B},receiveEntityRecords:function(){return V},receiveThemeSupports:function(){return F},receiveUploadPermissions:function(){return Z},receiveUserPermission:function(){return ee},receiveUserQuery:function(){return D},redo:function(){return K},saveEditedEntityRecord:function(){return X},saveEntityRecord:function(){return W},undo:function(){return Y}});var t={};n.r(t),n.d(t,{__experimentalGetCurrentGlobalStylesId:function(){return at},__experimentalGetCurrentThemeBaseGlobalStyles:function(){return mt},__experimentalGetDirtyEntityRecords:function(){return $e},__experimentalGetEntitiesBeingSaved:function(){return Qe},__experimentalGetEntityRecordNoResolver:function(){return je},__experimentalGetTemplateForLink:function(){return Et},canUser:function(){return dt},canUserEditEntityRecord:function(){return ft},getAuthors:function(){return Pe},getAutosave:function(){return yt},getAutosaves:function(){return pt},getCurrentTheme:function(){return st},getCurrentUser:function(){return De},getEditedEntityRecord:function(){return We},getEmbedPreview:function(){return ct},getEntitiesByKind:function(){return qe},getEntity:function(){return Ve},getEntityRecord:function(){return Me},getEntityRecordEdits:function(){return Ye},getEntityRecordNonTransientEdits:function(){return Ke},getEntityRecords:function(){return Be},getLastEntityDeleteError:function(){return et},getLastEntitySaveError:function(){return Ze},getRawEntityRecord:function(){return Ge},getRedoEdit:function(){return rt},getReferenceByDistinctEdits:function(){return ht},getThemeSupports:function(){return ut},getUndoEdit:function(){return nt},getUserQueryResults:function(){return Ne},hasEditsForEntityRecord:function(){return He},hasEntityRecords:function(){return Fe},hasFetchedAutosaves:function(){return vt},hasRedo:function(){return ot},hasUndo:function(){return it},isAutosavingEntityRecord:function(){return ze},isDeletingEntityRecord:function(){return Je},isPreviewEmbedFallback:function(){return lt},isRequestingEmbedPreview:function(){return Oe},isSavingEntityRecord:function(){return Xe}});var i={};n.r(i),n.d(i,{__experimentalGetCurrentGlobalStylesId:function(){return Pt},__experimentalGetCurrentThemeBaseGlobalStyles:function(){return Dt},__experimentalGetTemplateForLink:function(){return Ot},canUser:function(){return At},canUserEditEntityRecord:function(){return xt},getAuthors:function(){return _t},getAutosave:function(){return Lt},getAutosaves:function(){return Ct},getCurrentTheme:function(){return It},getCurrentUser:function(){return bt},getEditedEntityRecord:function(){return kt},getEmbedPreview:function(){return Ut},getEntityRecord:function(){return Rt},getEntityRecords:function(){return Tt},getRawEntityRecord:function(){return wt},getThemeSupports:function(){return St}});var o=window.wp.data,s=window.lodash,a=window.wp.isShallowEqual,u=n.n(a);var c=e=>t=>(n,r)=>void 0===n||e(r)?t(n,r):n;var l=e=>t=>(n,r)=>t(n,e(r));function d(e,t){if(!e)return t;let n=!1;const r={};for(const i in t)(0,s.isEqual)(e[i],t[i])?r[i]=e[i]:(n=!0,r[i]=t[i]);if(!n)return e;for(const t in e)r.hasOwnProperty(t)||(r[t]=e[t]);return r}var f,p=e=>t=>function(){let n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0;const i=r[e];if(void 0===i)return n;const o=t(n[i],r);return o===n[i]?n:{...n,[i]:o}},y=window.wp.apiFetch,v=n.n(y),h=window.wp.i18n,E=new Uint8Array(16);function m(){if(!f&&!(f="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto)))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return f(E)}var g=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;for(var _=function(e){return"string"==typeof e&&g.test(e)},b=[],R=0;R<256;++R)b.push((R+256).toString(16).substr(1));var w=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=(b[e[t+0]]+b[e[t+1]]+b[e[t+2]]+b[e[t+3]]+"-"+b[e[t+4]]+b[e[t+5]]+"-"+b[e[t+6]]+b[e[t+7]]+"-"+b[e[t+8]]+b[e[t+9]]+"-"+b[e[t+10]]+b[e[t+11]]+b[e[t+12]]+b[e[t+13]]+b[e[t+14]]+b[e[t+15]]).toLowerCase();if(!_(n))throw TypeError("Stringified UUID is invalid");return n};var k=function(e,t,n){var r=(e=e||{}).random||(e.rng||m)();if(r[6]=15&r[6]|64,r[8]=63&r[8]|128,t){n=n||0;for(var i=0;i<16;++i)t[n+i]=r[i];return t}return w(r)},T=window.wp.url,I=window.wp.deprecated,S=n.n(I);function U(e,t){return{type:"RECEIVE_ITEMS",items:(0,s.castArray)(e),persistedEdits:t}}function A(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];return{type:"REMOVE_ITEMS",itemIds:(0,s.castArray)(n),kind:e,name:t,invalidateCache:r}}function x(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0;return{...U(e,n),query:t}}let C=null;async function L(e){if(null===C){const e=await v()({path:"/batch/v1",method:"OPTIONS"});C=e.endpoints[0].args.requests.maxItems}const t=[];for(const n of(0,s.chunk)(e,C)){const e=await v()({path:"/batch/v1",method:"POST",data:{validation:"require-all-validate",requests:n.map((e=>({path:e.path,body:e.data,method:e.method,headers:e.headers})))}});let r;r=e.failed?e.responses.map((e=>({error:null==e?void 0:e.body}))):e.responses.map((e=>{const t={};return e.status>=200&&e.status<300?t.output=e.body:t.error=e.body,t})),t.push(...r)}return t}class O{constructor(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];this.set=new Set(...t),this.subscribers=new Set}get size(){return this.set.size}add(){return this.set.add(...arguments),this.subscribers.forEach((e=>e())),this}delete(){const e=this.set.delete(...arguments);return this.subscribers.forEach((e=>e())),e}subscribe(e){return this.subscribers.add(e),()=>{this.subscribers.delete(e)}}}const P="core";function D(e,t){return{type:"RECEIVE_USER_QUERY",users:(0,s.castArray)(t),queryID:e}}function N(e){return{type:"RECEIVE_CURRENT_USER",currentUser:e}}function q(e){return{type:"ADD_ENTITIES",entities:e}}function V(e,t,n,r){let i,o=arguments.length>4&&void 0!==arguments[4]&&arguments[4],a=arguments.length>5?arguments[5]:void 0;return"postType"===e&&(n=(0,s.castArray)(n).map((e=>"auto-draft"===e.status?{...e,title:""}:e))),i=r?x(n,r,a):U(n,a),{...i,kind:e,name:t,invalidateCache:o}}function M(e){return{type:"RECEIVE_CURRENT_THEME",currentTheme:e}}function j(e){return{type:"RECEIVE_CURRENT_GLOBAL_STYLES_ID",id:e}}function G(e,t){return{type:"RECEIVE_THEME_GLOBAL_STYLES",stylesheet:e,globalStyles:t}}function F(){return S()("wp.data.dispatch( 'core' ).receiveThemeSupports",{since:"5.9"}),{type:"DO_NOTHING"}}function B(e,t){return{type:"RECEIVE_EMBED_PREVIEW",url:e,preview:t}}const $=function(e,t,n,r){let{__unstableFetch:i=v()}=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};return async o=>{let{dispatch:a}=o;const u=await a(ue(e)),c=(0,s.find)(u,{kind:e,name:t});let l,d=!1;if(!c||null!=c&&c.__experimentalNoFetch)return;const f=await a.__unstableAcquireStoreLock(P,["entities","data",e,t,n],{exclusive:!0});try{a({type:"DELETE_ENTITY_RECORD_START",kind:e,name:t,recordId:n});try{let o=`${c.baseURL}/${n}`;r&&(o=(0,T.addQueryArgs)(o,r)),d=await i({path:o,method:"DELETE"}),await a(A(e,t,n,!0))}catch(e){l=e}return a({type:"DELETE_ENTITY_RECORD_FINISH",kind:e,name:t,recordId:n,error:l}),d}finally{a.__unstableReleaseStoreLock(f)}}},Q=function(e,t,n,r){let i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};return o=>{let{select:a,dispatch:u}=o;const c=a.getEntity(e,t);if(!c)throw new Error(`The entity being edited (${e}, ${t}) does not have a loaded config.`);const{transientEdits:l={},mergedEdits:d={}}=c,f=a.getRawEntityRecord(e,t,n),p=a.getEditedEntityRecord(e,t,n),y={kind:e,name:t,recordId:n,edits:Object.keys(r).reduce(((e,t)=>{const n=f[t],i=p[t],o=d[t]?{...i,...r[t]}:r[t];return e[t]=(0,s.isEqual)(n,o)?void 0:o,e}),{}),transientEdits:l};u({type:"EDIT_ENTITY_RECORD",...y,meta:{undo:!i.undoIgnore&&{...y,edits:Object.keys(r).reduce(((e,t)=>(e[t]=p[t],e)),{})}}})}},Y=()=>e=>{let{select:t,dispatch:n}=e;const r=t.getUndoEdit();r&&n({type:"EDIT_ENTITY_RECORD",...r,meta:{isUndo:!0}})},K=()=>e=>{let{select:t,dispatch:n}=e;const r=t.getRedoEdit();r&&n({type:"EDIT_ENTITY_RECORD",...r,meta:{isRedo:!0}})};function H(){return{type:"CREATE_UNDO_LEVEL"}}const W=function(e,t,n){let{isAutosave:r=!1,__unstableFetch:i=v()}=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return async o=>{let{select:a,resolveSelect:u,dispatch:c}=o;const l=await c(ue(e)),d=(0,s.find)(l,{kind:e,name:t});if(!d||null!=d&&d.__experimentalNoFetch)return;const f=d.key||ne,p=n[f],y=await c.__unstableAcquireStoreLock(P,["entities","data",e,t,p||k()],{exclusive:!0});try{for(const[r,i]of Object.entries(n))if("function"==typeof i){const o=i(a.getEditedEntityRecord(e,t,p));c.editEntityRecord(e,t,p,{[r]:o},{undoIgnore:!0}),n[r]=o}let o,s;c({type:"SAVE_ENTITY_RECORD_START",kind:e,name:t,recordId:p,isAutosave:r});try{const s=`${d.baseURL}${p?"/"+p:""}`,l=a.getRawEntityRecord(e,t,p);if(r){const r=a.getCurrentUser(),d=r?r.id:void 0,f=u.getAutosave(l.type,l.id,d);let p={...l,...f,...n};if(p=Object.keys(p).reduce(((e,t)=>(["title","excerpt","content"].includes(t)&&(e[t]=p[t]),e)),{status:"auto-draft"===p.status?"draft":p.status}),o=await i({path:`${s}/autosaves`,method:"POST",data:p}),l.id===o.id){let n={...l,...p,...o};n=Object.keys(n).reduce(((e,t)=>(["title","excerpt","content"].includes(t)?e[t]=n[t]:e[t]="status"===t?"auto-draft"===l.status&&"draft"===n.status?n.status:l.status:l[t],e)),{}),c.receiveEntityRecords(e,t,n,void 0,!0)}else c.receiveAutosaves(l.id,o)}else{let r=n;d.__unstablePrePersist&&(r={...r,...d.__unstablePrePersist(l,r)}),o=await i({path:s,method:p?"PUT":"POST",data:r}),c.receiveEntityRecords(e,t,o,void 0,!0,r)}}catch(e){s=e}return c({type:"SAVE_ENTITY_RECORD_FINISH",kind:e,name:t,recordId:p,error:s,isAutosave:r}),o}finally{c.__unstableReleaseStoreLock(y)}}},z=e=>async t=>{let{dispatch:n}=t;const r=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:L,t=0,n=[];const r=new O;return{add(e){const i=++t;r.add(i);const o=e=>new Promise(((t,o)=>{n.push({input:e,resolve:t,reject:o}),r.delete(i)}));return(0,s.isFunction)(e)?Promise.resolve(e(o)).finally((()=>{r.delete(i)})):o(e)},async run(){let t;r.size&&await new Promise((e=>{const t=r.subscribe((()=>{r.size||(t(),e())}))}));try{if(t=await e(n.map((e=>{let{input:t}=e;return t}))),t.length!==n.length)throw new Error("run: Array returned by processor must be same size as input array.")}catch(e){for(const{reject:t}of n)t(e);throw e}let i=!0;for(const[e,{resolve:r,reject:a}]of(0,s.zip)(t,n)){var o;null!=e&&e.error?(a(e.error),i=!1):r(null!==(o=null==e?void 0:e.output)&&void 0!==o?o:e)}return n=[],i}}}(),i={saveEntityRecord:(e,t,i,o)=>r.add((r=>n.saveEntityRecord(e,t,i,{...o,__unstableFetch:r}))),saveEditedEntityRecord:(e,t,i,o)=>r.add((r=>n.saveEditedEntityRecord(e,t,i,{...o,__unstableFetch:r}))),deleteEntityRecord:(e,t,i,o,s)=>r.add((r=>n.deleteEntityRecord(e,t,i,o,{...s,__unstableFetch:r})))},o=e.map((e=>e(i))),[,...a]=await Promise.all([r.run(),...o]);return a},X=(e,t,n,r)=>async i=>{let{select:o,dispatch:a}=i;if(!o.hasEditsForEntityRecord(e,t,n))return;const u=await a(ue(e)),c=(0,s.find)(u,{kind:e,name:t});if(!c)return;const l=c.key||ne,d=o.getEntityRecordNonTransientEdits(e,t,n),f={[l]:n,...d};return await a.saveEntityRecord(e,t,f,r)},J=(e,t,n,r,i)=>async o=>{let{select:s,dispatch:a}=o;if(!s.hasEditsForEntityRecord(e,t,n))return;const u=s.getEntityRecordNonTransientEdits(e,t,n),c={};for(const e in u)r.some((t=>t===e))&&(c[e]=u[e]);return await a.saveEntityRecord(e,t,c,i)};function Z(e){return{type:"RECEIVE_USER_PERMISSION",key:"create/media",isAllowed:e}}function ee(e,t){return{type:"RECEIVE_USER_PERMISSION",key:e,isAllowed:t}}function te(e,t){return{type:"RECEIVE_AUTOSAVES",postId:e,autosaves:(0,s.castArray)(t)}}const ne="id",re=["title","excerpt","content"],ie=[{label:(0,h.__)("Base"),name:"__unstableBase",kind:"root",baseURL:"/"},{label:(0,h.__)("Site"),name:"site",kind:"root",baseURL:"/wp/v2/settings",getTitle:e=>(0,s.get)(e,["title"],(0,h.__)("Site Title"))},{label:(0,h.__)("Post Type"),name:"postType",kind:"root",key:"slug",baseURL:"/wp/v2/types",baseURLParams:{context:"edit"},rawAttributes:re},{name:"media",kind:"root",baseURL:"/wp/v2/media",baseURLParams:{context:"edit"},plural:"mediaItems",label:(0,h.__)("Media")},{name:"taxonomy",kind:"root",key:"slug",baseURL:"/wp/v2/taxonomies",baseURLParams:{context:"edit"},plural:"taxonomies",label:(0,h.__)("Taxonomy")},{name:"sidebar",kind:"root",baseURL:"/wp/v2/sidebars",plural:"sidebars",transientEdits:{blocks:!0},label:(0,h.__)("Widget areas")},{name:"widget",kind:"root",baseURL:"/wp/v2/widgets",baseURLParams:{context:"edit"},plural:"widgets",transientEdits:{blocks:!0},label:(0,h.__)("Widgets")},{name:"widgetType",kind:"root",baseURL:"/wp/v2/widget-types",baseURLParams:{context:"edit"},plural:"widgetTypes",label:(0,h.__)("Widget types")},{label:(0,h.__)("User"),name:"user",kind:"root",baseURL:"/wp/v2/users",baseURLParams:{context:"edit"},plural:"users"},{name:"comment",kind:"root",baseURL:"/wp/v2/comments",baseURLParams:{context:"edit"},plural:"comments",label:(0,h.__)("Comment")},{name:"menu",kind:"root",baseURL:"/wp/v2/menus",baseURLParams:{context:"edit"},plural:"menus",label:(0,h.__)("Menu")},{name:"menuItem",kind:"root",baseURL:"/wp/v2/menu-items",baseURLParams:{context:"edit"},plural:"menuItems",label:(0,h.__)("Menu Item"),rawAttributes:["title","content"]},{name:"menuLocation",kind:"root",baseURL:"/wp/v2/menu-locations",baseURLParams:{context:"edit"},plural:"menuLocations",label:(0,h.__)("Menu Location"),key:"name"},{name:"navigationArea",kind:"root",baseURL:"/wp/v2/block-navigation-areas",baseURLParams:{context:"edit"},plural:"navigationAreas",label:(0,h.__)("Navigation Area"),key:"name",getTitle:e=>null==e?void 0:e.description},{label:(0,h.__)("Global Styles"),name:"globalStyles",kind:"root",baseURL:"/wp/v2/global-styles",baseURLParams:{context:"edit"},plural:"globalStylesVariations",getTitle:e=>{var t;return(null==e||null===(t=e.title)||void 0===t?void 0:t.rendered)||(null==e?void 0:e.title)}},{label:(0,h.__)("Themes"),name:"theme",kind:"root",baseURL:"/wp/v2/themes",baseURLParams:{context:"edit"},key:"stylesheet"},{label:(0,h.__)("Plugins"),name:"plugin",kind:"root",baseURL:"/wp/v2/plugins",baseURLParams:{context:"edit"},key:"plugin"}],oe=[{name:"postType",loadEntities:async function(){const e=await v()({path:"/wp/v2/types?context=edit"});return(0,s.map)(e,((e,t)=>{var n;const r=["wp_template","wp_template_part"].includes(t);return{kind:"postType",baseURL:`/${null!==(n=null==e?void 0:e.rest_namespace)&&void 0!==n?n:"wp/v2"}/${e.rest_base}`,baseURLParams:{context:"edit"},name:t,label:e.labels.singular_name,transientEdits:{blocks:!0,selection:!0},mergedEdits:{meta:!0},rawAttributes:re,getTitle:e=>{var t;return(null==e||null===(t=e.title)||void 0===t?void 0:t.rendered)||(null==e?void 0:e.title)||(r?(0,s.startCase)(e.slug):String(e.id))},__unstablePrePersist:r?void 0:se,__unstable_rest_base:e.rest_base}}))}},{name:"taxonomy",loadEntities:async function(){const e=await v()({path:"/wp/v2/taxonomies?context=edit"});return(0,s.map)(e,((e,t)=>{var n;return{kind:"taxonomy",baseURL:`/${null!==(n=null==e?void 0:e.rest_namespace)&&void 0!==n?n:"wp/v2"}/${e.rest_base}`,baseURLParams:{context:"edit"},name:t,label:e.labels.singular_name}}))}}],se=(e,t)=>{const n={};return"auto-draft"===(null==e?void 0:e.status)&&(t.status||n.status||(n.status="draft"),t.title&&"Auto Draft"!==t.title||n.title||null!=e&&e.title&&"Auto Draft"!==(null==e?void 0:e.title)||(n.title="")),n};const ae=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"get",r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];const i=(0,s.find)(ie,{kind:e,name:t}),o="root"===e?"":(0,s.upperFirst)((0,s.camelCase)(e)),a=(0,s.upperFirst)((0,s.camelCase)(t))+(r?"s":""),u=r&&i.plural?(0,s.upperFirst)((0,s.camelCase)(i.plural)):a;return`${n}${o}${u}`},ue=e=>async t=>{let{select:n,dispatch:r}=t,i=n.getEntitiesByKind(e);if(i&&0!==i.length)return i;const o=(0,s.find)(oe,{name:e});return o?(i=await o.loadEntities(),r(q(i)),i):[]};var ce=function(e){return"string"==typeof e?e.split(","):Array.isArray(e)?e:null};var le=function(e){const t=new WeakMap;return n=>{let r;return t.has(n)?r=t.get(n):(r=e(n),(0,s.isObjectLike)(n)&&t.set(n,r)),r}}((function(e){const t={stableKey:"",page:1,perPage:10,fields:null,include:null,context:"default"},n=Object.keys(e).sort();for(let r=0;r<n.length;r++){const i=n[r];let o=e[i];switch(i){case"page":t[i]=Number(o);break;case"per_page":t.perPage=Number(o);break;case"context":t.context=o;break;default:"_fields"===i&&(t.fields=ce(o),o=t.fields.join()),"include"===i&&(t.include=ce(o).map(Number),o=t.include.join()),t.stableKey+=(t.stableKey?"&":"")+(0,T.addQueryArgs)("",{[i]:o}).slice(1)}}return t}));function de(e){const{query:t}=e;if(!t)return"default";return le(t).context}function fe(e,t,n,r){if(1===n&&-1===r)return t;const i=(n-1)*r,o=Math.max(e.length,i+t.length),s=new Array(o);for(let n=0;n<o;n++){const r=n>=i&&n<i+t.length;s[n]=r?t[n-i]:e[n]}return s}const pe=(0,s.flowRight)([c((e=>"query"in e)),l((e=>e.query?{...e,...le(e.query)}:e)),p("context"),p("stableKey")])((function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1?arguments[1]:void 0;const{type:n,page:r,perPage:i,key:o=ne}=t;return"RECEIVE_ITEMS"!==n?e:fe(e||[],(0,s.map)(t.items,o),r,i)}));var ye=(0,o.combineReducers)({items:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"RECEIVE_ITEMS":{const n=de(t),r=t.key||ne;return{...e,[n]:{...e[n],...t.items.reduce(((t,i)=>{var o;const s=i[r];return t[s]=d(null==e||null===(o=e[n])||void 0===o?void 0:o[s],i),t}),{})}}}case"REMOVE_ITEMS":return(0,s.mapValues)(e,(e=>(0,s.omit)(e,t.itemIds)))}return e},itemIsComplete:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"RECEIVE_ITEMS":{const n=de(t),{query:r,key:i=ne}=t,o=r?le(r):{},s=!r||!Array.isArray(o.fields);return{...e,[n]:{...e[n],...t.items.reduce(((t,r)=>{var o;const a=r[i];return t[a]=(null==e||null===(o=e[n])||void 0===o?void 0:o[a])||s,t}),{})}}}case"REMOVE_ITEMS":return(0,s.mapValues)(e,(e=>(0,s.omit)(e,t.itemIds)))}return e},queries:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"RECEIVE_ITEMS":return pe(e,t);case"REMOVE_ITEMS":const n=t.itemIds.reduce(((e,t)=>(e[t]=!0,e)),{});return(0,s.mapValues)(e,(e=>(0,s.mapValues)(e,(e=>(0,s.filter)(e,(e=>!n[e]))))));default:return e}}});function ve(e){return(0,s.flowRight)([c((t=>t.name&&t.kind&&t.name===e.name&&t.kind===e.kind)),l((t=>({...t,key:e.key||ne})))])((0,o.combineReducers)({queriedData:ye,edits:function(){var e,t;let n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0;switch(r.type){case"RECEIVE_ITEMS":if("default"!==(null!==(e=null==r||null===(t=r.query)||void 0===t?void 0:t.context)&&void 0!==e?e:"default"))return n;const i={...n};for(const e of r.items){const t=e[r.key],n=i[t];if(!n)continue;const o=Object.keys(n).reduce(((t,i)=>((0,s.isEqual)(n[i],(0,s.get)(e[i],"raw",e[i]))||r.persistedEdits&&(0,s.isEqual)(n[i],r.persistedEdits[i])||(t[i]=n[i]),t)),{});Object.keys(o).length?i[t]=o:delete i[t]}return i;case"EDIT_ENTITY_RECORD":const o={...n[r.recordId],...r.edits};return Object.keys(o).forEach((e=>{void 0===o[e]&&delete o[e]})),{...n,[r.recordId]:o}}return n},saving:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"SAVE_ENTITY_RECORD_START":case"SAVE_ENTITY_RECORD_FINISH":return{...e,[t.recordId]:{pending:"SAVE_ENTITY_RECORD_START"===t.type,error:t.error,isAutosave:t.isAutosave}}}return e},deleting:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"DELETE_ENTITY_RECORD_START":case"DELETE_ENTITY_RECORD_FINISH":return{...e,[t.recordId]:{pending:"DELETE_ENTITY_RECORD_START"===t.type,error:t.error}}}return e}}))}function he(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:ie,t=arguments.length>1?arguments[1]:void 0;return"ADD_ENTITIES"===t.type?[...e,...t.entities]:e}const Ee=[];let me;Ee.offset=0;var ge,_e,be=(0,o.combineReducers)({terms:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;return"RECEIVE_TERMS"===t.type?{...e,[t.taxonomy]:t.terms}:e},users:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{byId:{},queries:{}},t=arguments.length>1?arguments[1]:void 0;return"RECEIVE_USER_QUERY"===t.type?{byId:{...e.byId,...(0,s.keyBy)(t.users,"id")},queries:{...e.queries,[t.queryID]:(0,s.map)(t.users,(e=>e.id))}}:e},currentTheme:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0,t=arguments.length>1?arguments[1]:void 0;return"RECEIVE_CURRENT_THEME"===t.type?t.currentTheme.stylesheet:e},currentGlobalStylesId:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0,t=arguments.length>1?arguments[1]:void 0;return"RECEIVE_CURRENT_GLOBAL_STYLES_ID"===t.type?t.id:e},currentUser:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;return"RECEIVE_CURRENT_USER"===t.type?t.currentUser:e},themeBaseGlobalStyles:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;return"RECEIVE_THEME_GLOBAL_STYLES"===t.type?{...e,[t.stylesheet]:t.globalStyles}:e},taxonomies:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0;return"RECEIVE_TAXONOMIES"===t.type?t.taxonomies:e},entities:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;const n=he(e.config,t);let r=e.reducer;if(!r||n!==e.config){const e=(0,s.groupBy)(n,"kind");r=(0,o.combineReducers)(Object.entries(e).reduce(((e,t)=>{let[n,r]=t;const i=(0,o.combineReducers)(r.reduce(((e,t)=>({...e,[t.name]:ve(t)})),{}));return e[n]=i,e}),{}))}const i=r(e.data,t);return i===e.data&&n===e.config&&r===e.reducer?e:{reducer:r,data:i,config:n}},undo:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Ee,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"EDIT_ENTITY_RECORD":case"CREATE_UNDO_LEVEL":let n="CREATE_UNDO_LEVEL"===t.type;const r=!n&&(t.meta.isUndo||t.meta.isRedo);let i;if(n?t=me:r||(me=Object.keys(t.edits).some((e=>!t.transientEdits[e]))?t:{...t,edits:{...me&&me.edits,...t.edits}}),r){if(i=[...e],i.offset=e.offset+(t.meta.isUndo?-1:1),!e.flattenedUndo)return i;n=!0,me.meta.undo||(me.meta.undo={edits:{}}),t=me}if(!t.meta.undo)return e;if(!n&&!Object.keys(t.edits).some((e=>!t.transientEdits[e])))return i=[...e],i.flattenedUndo={...e.flattenedUndo,...t.edits},i.offset=e.offset,i;i=i||e.slice(0,e.offset||void 0),i.offset=i.offset||0,i.pop(),n||i.push({kind:t.meta.undo.kind,name:t.meta.undo.name,recordId:t.meta.undo.recordId,edits:{...e.flattenedUndo,...t.meta.undo.edits}});const o=Object.values(t.meta.undo.edits).filter((e=>"function"!=typeof e)),s=Object.values(t.edits).filter((e=>"function"!=typeof e));return u()(o,s)||i.push({kind:t.kind,name:t.name,recordId:t.recordId,edits:n?{...e.flattenedUndo,...t.edits}:t.edits}),i}return e},embedPreviews:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;if("RECEIVE_EMBED_PREVIEW"===t.type){const{url:n,preview:r}=t;return{...e,[n]:r}}return e},userPermissions:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;return"RECEIVE_USER_PERMISSION"===t.type?{...e,[t.key]:t.isAllowed}:e},autosaves:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;if("RECEIVE_AUTOSAVES"===t.type){const{postId:n,autosaves:r}=t;return{...e,[n]:r}}return e}});function Re(e){return[e]}function we(){var e={clear:function(){e.head=null}};return e}function ke(e,t,n){var r;if(e.length!==t.length)return!1;for(r=n;r<e.length;r++)if(e[r]!==t[r])return!1;return!0}function Te(e,t){var n,r;function i(){n=_e?new WeakMap:we()}function o(){var n,i,o,s,a,u=arguments.length;for(s=new Array(u),o=0;o<u;o++)s[o]=arguments[o];for(a=t.apply(null,s),(n=r(a)).isUniqueByDependants||(n.lastDependants&&!ke(a,n.lastDependants,0)&&n.clear(),n.lastDependants=a),i=n.head;i;){if(ke(i.args,s,1))return i!==n.head&&(i.prev.next=i.next,i.next&&(i.next.prev=i.prev),i.next=n.head,i.prev=null,n.head.prev=i,n.head=i),i.val;i=i.next}return i={val:e.apply(null,s)},s[0]=null,i.args=s,n.head&&(n.head.prev=i,i.next=n.head),n.head=i,i.val}return t||(t=Re),r=_e?function(e){var t,r,i,o,s,a=n,u=!0;for(t=0;t<e.length;t++){if(r=e[t],!(s=r)||"object"!=typeof s){u=!1;break}a.has(r)?a=a.get(r):(i=new WeakMap,a.set(r,i),a=i)}return a.has(ge)||((o=we()).isUniqueByDependants=u,a.set(ge,o)),a.get(ge)}:function(){return n},o.getDependants=t,o.clear=i,i(),o}ge={},_e="undefined"!=typeof WeakMap;var Ie=n(2167),Se=n.n(Ie);const Ue=new WeakMap;function Ae(e,t){var n,r;const{stableKey:i,page:o,perPage:a,include:u,fields:c,context:l}=le(t);let d;if(null!==(n=e.queries)&&void 0!==n&&null!==(r=n[l])&&void 0!==r&&r[i]&&(d=e.queries[l][i]),!d)return null;const f=-1===a?0:(o-1)*a,p=-1===a?d.length:Math.min(f+a,d.length),y=[];for(let t=f;t<p;t++){var v;const n=d[t];if(Array.isArray(u)&&!u.includes(n))continue;if(null===(v=e.items[l])||void 0===v||!v.hasOwnProperty(n))return null;const r=e.items[l][n];let i;if(Array.isArray(c)){i={};for(let e=0;e<c.length;e++){const t=c[e].split("."),n=(0,s.get)(r,t);(0,s.set)(i,t,n)}}else{var h;if(null===(h=e.itemIsComplete[l])||void 0===h||!h[n])return null;i=r}y.push(i)}return y}const xe=Te((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=Ue.get(e);if(n){const e=n.get(t);if(void 0!==e)return e}else n=new(Se()),Ue.set(e,n);const r=Ae(e,t);return n.set(t,r),r}));const Ce={},Le=[],Oe=(0,o.createRegistrySelector)((e=>(t,n)=>e(P).isResolving("getEmbedPreview",[n])));function Pe(e,t){S()("select( 'core' ).getAuthors()",{since:"5.9",alternative:"select( 'core' ).getUsers({ who: 'authors' })"});const n=(0,T.addQueryArgs)("/wp/v2/users/?who=authors&per_page=100",t);return Ne(e,n)}function De(e){return e.currentUser}const Ne=Te(((e,t)=>{const n=e.users.queries[t];return(0,s.map)(n,(t=>e.users.byId[t]))}),((e,t)=>[e.users.queries[t],e.users.byId]));function qe(e,t){return(0,s.filter)(e.entities.config,{kind:t})}function Ve(e,t,n){return(0,s.find)(e.entities.config,{kind:t,name:n})}const Me=Te(((e,t,n,r,i)=>{var o,a;const u=(0,s.get)(e.entities.data,[t,n,"queriedData"]);if(!u)return;const c=null!==(o=null==i?void 0:i.context)&&void 0!==o?o:"default";if(void 0===i){var l;if(null===(l=u.itemIsComplete[c])||void 0===l||!l[r])return;return u.items[c][r]}const d=null===(a=u.items[c])||void 0===a?void 0:a[r];if(d&&i._fields){const e={},t=ce(i._fields);for(let n=0;n<t.length;n++){const r=t[n].split("."),i=(0,s.get)(d,r);(0,s.set)(e,r,i)}return e}return d}),((e,t,n,r,i)=>{var o;const a=null!==(o=null==i?void 0:i.context)&&void 0!==o?o:"default";return[(0,s.get)(e.entities.data,[t,n,"queriedData","items",a,r]),(0,s.get)(e.entities.data,[t,n,"queriedData","itemIsComplete",a,r])]}));function je(e,t,n,r){return Me(e,t,n,r)}const Ge=Te(((e,t,n,r)=>{const i=Me(e,t,n,r);return i&&Object.keys(i).reduce(((r,o)=>(!function(e,t){return(e.rawAttributes||[]).includes(t)}(Ve(e,t,n),o)?r[o]=i[o]:r[o]=(0,s.get)(i[o],"raw",i[o]),r)),{})}),((e,t,n,r,i)=>{var o;const a=null!==(o=null==i?void 0:i.context)&&void 0!==o?o:"default";return[e.entities.config,(0,s.get)(e.entities.data,[t,n,"queriedData","items",a,r]),(0,s.get)(e.entities.data,[t,n,"queriedData","itemIsComplete",a,r])]}));function Fe(e,t,n,r){return Array.isArray(Be(e,t,n,r))}function Be(e,t,n,r){const i=(0,s.get)(e.entities.data,[t,n,"queriedData"]);return i?xe(i,r):Le}const $e=Te((e=>{const{entities:{data:t}}=e,n=[];return Object.keys(t).forEach((r=>{Object.keys(t[r]).forEach((i=>{const o=Object.keys(t[r][i].edits).filter((t=>Me(e,r,i,t)&&He(e,r,i,t)));if(o.length){const t=Ve(e,r,i);o.forEach((o=>{var s;const a=We(e,r,i,o);n.push({key:a[t.key||ne],title:(null==t||null===(s=t.getTitle)||void 0===s?void 0:s.call(t,a))||"",name:i,kind:r})}))}}))})),n}),(e=>[e.entities.data])),Qe=Te((e=>{const{entities:{data:t}}=e,n=[];return Object.keys(t).forEach((r=>{Object.keys(t[r]).forEach((i=>{const o=Object.keys(t[r][i].saving).filter((t=>Xe(e,r,i,t)));if(o.length){const t=Ve(e,r,i);o.forEach((o=>{var s;const a=We(e,r,i,o);n.push({key:a[t.key||ne],title:(null==t||null===(s=t.getTitle)||void 0===s?void 0:s.call(t,a))||"",name:i,kind:r})}))}}))})),n}),(e=>[e.entities.data]));function Ye(e,t,n,r){return(0,s.get)(e.entities.data,[t,n,"edits",r])}const Ke=Te(((e,t,n,r)=>{const{transientEdits:i}=Ve(e,t,n)||{},o=Ye(e,t,n,r)||{};return i?Object.keys(o).reduce(((e,t)=>(i[t]||(e[t]=o[t]),e)),{}):o}),((e,t,n,r)=>[e.entities.config,(0,s.get)(e.entities.data,[t,n,"edits",r])]));function He(e,t,n,r){return Xe(e,t,n,r)||Object.keys(Ke(e,t,n,r)).length>0}const We=Te(((e,t,n,r)=>({...Ge(e,t,n,r),...Ye(e,t,n,r)})),((e,t,n,r,i)=>{var o;const a=null!==(o=null==i?void 0:i.context)&&void 0!==o?o:"default";return[e.entities.config,(0,s.get)(e.entities.data,[t,n,"queriedData","items",a,r]),(0,s.get)(e.entities.data,[t,n,"queriedData","itemIsComplete",a,r]),(0,s.get)(e.entities.data,[t,n,"edits",r])]}));function ze(e,t,n,r){const{pending:i,isAutosave:o}=(0,s.get)(e.entities.data,[t,n,"saving",r],{});return Boolean(i&&o)}function Xe(e,t,n,r){return(0,s.get)(e.entities.data,[t,n,"saving",r,"pending"],!1)}function Je(e,t,n,r){return(0,s.get)(e.entities.data,[t,n,"deleting",r,"pending"],!1)}function Ze(e,t,n,r){return(0,s.get)(e.entities.data,[t,n,"saving",r,"error"])}function et(e,t,n,r){return(0,s.get)(e.entities.data,[t,n,"deleting",r,"error"])}function tt(e){return e.undo.offset}function nt(e){return e.undo[e.undo.length-2+tt(e)]}function rt(e){return e.undo[e.undo.length+tt(e)]}function it(e){return Boolean(nt(e))}function ot(e){return Boolean(rt(e))}function st(e){return Me(e,"root","theme",e.currentTheme)}function at(e){return e.currentGlobalStylesId}function ut(e){var t,n;return null!==(t=null===(n=st(e))||void 0===n?void 0:n.theme_supports)&&void 0!==t?t:Ce}function ct(e,t){return e.embedPreviews[t]}function lt(e,t){const n=e.embedPreviews[t],r='<a href="'+t+'">'+t+"</a>";return!!n&&n.html===r}function dt(e,t,n,r){const i=(0,s.compact)([t,n,r]).join("/");return(0,s.get)(e,["userPermissions",i])}function ft(e,t,n,r){const i=Ve(e,t,n);if(!i)return!1;return dt(e,"update",i.__unstable_rest_base,r)}function pt(e,t,n){return e.autosaves[n]}function yt(e,t,n,r){if(void 0===r)return;const i=e.autosaves[n];return(0,s.find)(i,{author:r})}const vt=(0,o.createRegistrySelector)((e=>(t,n,r)=>e(P).hasFinishedResolution("getAutosaves",[n,r]))),ht=Te((()=>[]),(e=>[e.undo.length,e.undo.offset,e.undo.flattenedUndo]));function Et(e,t){const n=Be(e,"postType","wp_template",{"find-template":t}),r=null!=n&&n.length?n[0]:null;return r?We(e,"postType","wp_template",r.id):r}function mt(e){const t=st(e);return t?e.themeBaseGlobalStyles[t.stylesheet]:null}var gt=e=>function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return async t=>{let{resolveSelect:r}=t;await r[e](...n)}};const _t=e=>async t=>{let{dispatch:n}=t;const r=(0,T.addQueryArgs)("/wp/v2/users/?who=authors&per_page=100",e),i=await v()({path:r});n.receiveUserQuery(r,i)},bt=()=>async e=>{let{dispatch:t}=e;const n=await v()({path:"/wp/v2/users/me"});t.receiveCurrentUser(n)},Rt=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",r=arguments.length>3?arguments[3]:void 0;return async i=>{let{select:o,dispatch:a}=i;const u=await a(ue(e)),c=(0,s.find)(u,{kind:e,name:t});if(!c||null!=c&&c.__experimentalNoFetch)return;const l=await a.__unstableAcquireStoreLock(P,["entities","data",e,t,n],{exclusive:!1});try{void 0!==r&&r._fields&&(r={...r,_fields:(0,s.uniq)([...ce(r._fields)||[],c.key||ne]).join()});const i=(0,T.addQueryArgs)(c.baseURL+(n?"/"+n:""),{...c.baseURLParams,...r});if(void 0!==r){r={...r,include:[n]};if(o.hasEntityRecords(e,t,r))return}const u=await v()({path:i});a.receiveEntityRecords(e,t,u,r)}catch(e){}finally{a.__unstableReleaseStoreLock(l)}}},wt=gt("getEntityRecord"),kt=gt("getEntityRecord"),Tt=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return async r=>{let{dispatch:i}=r;const o=await i(ue(e)),a=(0,s.find)(o,{kind:e,name:t});if(!a||null!=a&&a.__experimentalNoFetch)return;const u=await i.__unstableAcquireStoreLock(P,["entities","data",e,t],{exclusive:!1});try{var c;n._fields&&(n={...n,_fields:(0,s.uniq)([...ce(n._fields)||[],a.key||ne]).join()});const r=(0,T.addQueryArgs)(a.baseURL,{...a.baseURLParams,...n});let o=Object.values(await v()({path:r}));if(n._fields&&(o=o.map((e=>(n._fields.split(",").forEach((t=>{e.hasOwnProperty(t)||(e[t]=void 0)})),e)))),i.receiveEntityRecords(e,t,o,n),!(null!==(c=n)&&void 0!==c&&c._fields||n.context)){const n=a.key||ne,r=o.filter((e=>e[n])).map((r=>[e,t,r[n]]));i({type:"START_RESOLUTIONS",selectorName:"getEntityRecord",args:r}),i({type:"FINISH_RESOLUTIONS",selectorName:"getEntityRecord",args:r})}}catch(e){}finally{i.__unstableReleaseStoreLock(u)}}};Tt.shouldInvalidate=(e,t,n)=>("RECEIVE_ITEMS"===e.type||"REMOVE_ITEMS"===e.type)&&e.invalidateCache&&t===e.kind&&n===e.name;const It=()=>async e=>{let{dispatch:t,resolveSelect:n}=e;const r=await n.getEntityRecords("root","theme",{status:"active"});t.receiveCurrentTheme(r[0])},St=gt("getCurrentTheme"),Ut=e=>async t=>{let{dispatch:n}=t;try{const t=await v()({path:(0,T.addQueryArgs)("/oembed/1.0/proxy",{url:e})});n.receiveEmbedPreview(e,t)}catch(t){n.receiveEmbedPreview(e,!1)}},At=(e,t,n)=>async r=>{let{dispatch:i}=r;const o={create:"POST",read:"GET",update:"PUT",delete:"DELETE"}[e];if(!o)throw new Error(`'${e}' is not a valid action.`);const a=n?`/wp/v2/${t}/${n}`:`/wp/v2/${t}`;let u,c;try{u=await v()({path:a,method:n?"GET":"OPTIONS",parse:!1})}catch(e){return}c=(0,s.hasIn)(u,["headers","get"])?u.headers.get("allow"):(0,s.get)(u,["headers","Allow"],"");const l=(0,s.compact)([e,t,n]).join("/"),d=(0,s.includes)(c,o);i.receiveUserPermission(l,d)},xt=(e,t,n)=>async r=>{let{dispatch:i}=r;const o=await i(ue(e)),a=(0,s.find)(o,{kind:e,name:t});if(!a)return;const u=a.__unstable_rest_base;await i(At("update",u,n))},Ct=(e,t)=>async n=>{let{dispatch:r,resolveSelect:i}=n;const{rest_base:o}=await i.getPostType(e),s=await v()({path:`/wp/v2/${o}/${t}/autosaves?context=edit`});s&&s.length&&r.receiveAutosaves(t,s)},Lt=(e,t)=>async n=>{let{resolveSelect:r}=n;await r.getAutosaves(e,t)},Ot=e=>async t=>{let n,{dispatch:r,resolveSelect:i}=t;try{n=await window.fetch((0,T.addQueryArgs)(e,{"_wp-find-template":!0})).then((e=>e.json())).then((e=>{let{data:t}=e;return t}))}catch(e){}if(!n)return;const o=await i.getEntityRecord("postType","wp_template",n.id);o&&r.receiveEntityRecords("postType","wp_template",[o],{"find-template":e})};Ot.shouldInvalidate=e=>("RECEIVE_ITEMS"===e.type||"REMOVE_ITEMS"===e.type)&&e.invalidateCache&&"postType"===e.kind&&"wp_template"===e.name;const Pt=()=>async e=>{let{dispatch:t,resolveSelect:n}=e;const r=await n.getEntityRecords("root","theme",{status:"active"}),i=(0,s.get)(r,[0,"_links","wp:user-global-styles",0,"href"]);if(i){const e=await v()({url:i});t.__experimentalReceiveCurrentGlobalStylesId(e.id)}},Dt=()=>async e=>{let{resolveSelect:t,dispatch:n}=e;const r=await t.getCurrentTheme(),i=await v()({path:`/wp/v2/global-styles/themes/${r.stylesheet}`});await n.__experimentalReceiveThemeBaseGlobalStyles(r.stylesheet,i)};function Nt(e,t){const n={...e};let r=n;for(const e of t)r.children={...r.children,[e]:{locks:[],children:{},...r.children[e]}},r=r.children[e];return n}function qt(e,t){let n=e;for(const e of t){const t=n.children[e];if(!t)return null;n=t}return n}function Vt(e,t){let{exclusive:n}=e;return!(!n||!t.length)||!(n||!t.filter((e=>e.exclusive)).length)}const Mt={requests:[],tree:{locks:[],children:{}}};function jt(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Mt,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"ENQUEUE_LOCK_REQUEST":{const{request:n}=t;return{...e,requests:[n,...e.requests]}}case"GRANT_LOCK_REQUEST":{const{lock:n,request:r}=t,{store:i,path:o}=r,s=[i,...o],a=Nt(e.tree,s),u=qt(a,s);return u.locks=[...u.locks,n],{...e,requests:e.requests.filter((e=>e!==r)),tree:a}}case"RELEASE_LOCK":{const{lock:n}=t,r=[n.store,...n.path],i=Nt(e.tree,r),o=qt(i,r);return o.locks=o.locks.filter((e=>e!==n)),{...e,tree:i}}}return e}function Gt(e,t,n,r){let{exclusive:i}=r;const o=[t,...n],s=e.tree;for(const e of function*(e,t){let n=e;yield n;for(const e of t){const t=n.children[e];if(!t)break;yield t,n=t}}(s,o))if(Vt({exclusive:i},e.locks))return!1;const a=qt(s,o);if(!a)return!0;for(const e of function*(e){const t=Object.values(e.children);for(;t.length;){const e=t.pop();yield e,t.push(...Object.values(e.children))}}(a))if(Vt({exclusive:i},e.locks))return!1;return!0}function Ft(){let e=jt(void 0,{type:"@@INIT"});function t(){for(const t of function(e){return e.requests}(e)){const{store:n,path:r,exclusive:i,notifyAcquired:o}=t;if(Gt(e,n,r,{exclusive:i})){const s={store:n,path:r,exclusive:i};e=jt(e,{type:"GRANT_LOCK_REQUEST",lock:s,request:t}),o(s)}}}return{acquire:function(n,r,i){return new Promise((o=>{e=jt(e,{type:"ENQUEUE_LOCK_REQUEST",request:{store:n,path:r,exclusive:i,notifyAcquired:o}}),t()}))},release:function(n){e=jt(e,{type:"RELEASE_LOCK",lock:n}),t()}}}function Bt(){const e=Ft();return{__unstableAcquireStoreLock:function(t,n,r){let{exclusive:i}=r;return()=>e.acquire(t,n,i)},__unstableReleaseStoreLock:function(t){return()=>e.release(t)}}}var $t=window.wp.element,Qt=window.wp.blocks;const Yt=[],Kt={...ie.reduce(((e,t)=>(e[t.kind]||(e[t.kind]={}),e[t.kind][t.name]={context:(0,$t.createContext)()},e)),{}),...oe.reduce(((e,t)=>(e[t.name]={},e)),{})},Ht=(e,t)=>{if(!Kt[e])throw new Error(`Missing entity config for kind: ${e}.`);return Kt[e][t]||(Kt[e][t]={context:(0,$t.createContext)()}),Kt[e][t]};function Wt(e){let{kind:t,type:n,id:r,children:i}=e;const o=Ht(t,n).context.Provider;return(0,$t.createElement)(o,{value:r},i)}function zt(e,t){return(0,$t.useContext)(Ht(e,t).context)}function Xt(e,t,n,r){const i=zt(e,t),s=null!=r?r:i,{value:a,fullValue:u}=(0,o.useSelect)((r=>{const{getEntityRecord:i,getEditedEntityRecord:o}=r(P),a=i(e,t,s),u=o(e,t,s);return a&&u?{value:u[n],fullValue:a[n]}:{}}),[e,t,s,n]),{editEntityRecord:c}=(0,o.useDispatch)(P);return[a,(0,$t.useCallback)((r=>{c(e,t,s,{[n]:r})}),[e,t,s,n]),u]}function Jt(e,t){let{id:n}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const r=zt(e,t),i=null!=n?n:r,{content:s,blocks:a}=(0,o.useSelect)((n=>{const{getEditedEntityRecord:r}=n(P),o=r(e,t,i);return{blocks:o.blocks,content:o.content}}),[e,t,i]),{__unstableCreateUndoLevel:u,editEntityRecord:c}=(0,o.useDispatch)(P);(0,$t.useEffect)((()=>{if(s&&"function"!=typeof s&&!a){const n=(0,Qt.parse)(s);c(e,t,i,{blocks:n},{undoIgnore:!0})}}),[s]);const l=(0,$t.useCallback)(((n,r)=>{const{selection:o}=r,s={blocks:n,selection:o};if(a===s.blocks)return u(e,t,i);s.content=e=>{let{blocks:t=[]}=e;return(0,Qt.__unstableSerializeAndClean)(t)},c(e,t,i,s)}),[e,t,i,a]),d=(0,$t.useCallback)(((n,r)=>{const{selection:o}=r;c(e,t,i,{blocks:n,selection:o})}),[e,t,i]);return[null!=a?a:Yt,d,l]}var Zt=window.wp.htmlEntities;var en=async function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const{isInitialSuggestions:r=!1,type:i,subtype:o,page:s,perPage:a=(r?3:20)}=t,{disablePostFormats:u=!1}=n,c=[];return i&&"post"!==i||c.push(v()({path:(0,T.addQueryArgs)("/wp/v2/search",{search:e,page:s,per_page:a,type:"post",subtype:o})}).then((e=>e.map((e=>({...e,meta:{kind:"post-type",subtype:o}}))))).catch((()=>[]))),i&&"term"!==i||c.push(v()({path:(0,T.addQueryArgs)("/wp/v2/search",{search:e,page:s,per_page:a,type:"term",subtype:o})}).then((e=>e.map((e=>({...e,meta:{kind:"taxonomy",subtype:o}}))))).catch((()=>[]))),u||i&&"post-format"!==i||c.push(v()({path:(0,T.addQueryArgs)("/wp/v2/search",{search:e,page:s,per_page:a,type:"post-format",subtype:o})}).then((e=>e.map((e=>({...e,meta:{kind:"taxonomy",subtype:o}}))))).catch((()=>[]))),Promise.all(c).then((e=>e.reduce(((e,t)=>e.concat(t)),[]).filter((e=>!!e.id)).slice(0,a).map((e=>{var t;return{id:e.id,url:e.url,title:(0,Zt.decodeEntities)(e.title||"")||(0,h.__)("(no title)"),type:e.subtype||e.type,kind:null==e||null===(t=e.meta)||void 0===t?void 0:t.kind}}))))};const tn=new Map;var nn=async function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n="/wp-block-editor/v1/url-details",r={url:(0,T.prependHTTP)(e)};if(!(0,T.isURL)(e))return Promise.reject(`${e} is not a valid URL.`);const i=(0,T.getProtocol)(e);return(0,T.isValidProtocol)(i)&&i.startsWith("http")&&/^https?:\/\/[^\/\s]/i.test(e)?tn.has(e)?tn.get(e):v()({path:(0,T.addQueryArgs)(n,r),...t}).then((t=>(tn.set(e,t),t))):Promise.reject(`${e} does not have a valid protocol. URLs must be "http" based`)};const rn=ie.reduce(((e,t)=>{const{kind:n,name:r}=t;return e[ae(n,r)]=(e,t,i)=>Me(e,n,r,t,i),e[ae(n,r,"get",!0)]=function(e){for(var t=arguments.length,i=new Array(t>1?t-1:0),o=1;o<t;o++)i[o-1]=arguments[o];return Be(e,n,r,...i)},e}),{}),on=ie.reduce(((e,t)=>{const{kind:n,name:r}=t;e[ae(n,r)]=(e,t)=>Rt(n,r,e,t);const i=ae(n,r,"get",!0);return e[i]=function(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];return Tt(n,r,...t)},e[i].shouldInvalidate=function(e){for(var t=arguments.length,i=new Array(t>1?t-1:0),o=1;o<t;o++)i[o-1]=arguments[o];return Tt.shouldInvalidate(e,n,r,...i)},e}),{}),sn=ie.reduce(((e,t)=>{const{kind:n,name:r}=t;return e[ae(n,r,"save")]=e=>W(n,r,e),e[ae(n,r,"delete")]=(e,t)=>$(n,r,e,t),e}),{}),an=(0,o.createReduxStore)(P,{reducer:be,actions:{...e,...sn,...Bt()},selectors:{...t,...rn},resolvers:{...i,...on},__experimentalUseThunks:!0});(0,o.register)(an)}(),(window.wp=window.wp||{}).coreData=r}(); |