2022-09-20 17:43:29 +02:00
|
|
|
!function(){"use strict";var t={d:function(e,n){for(var r in n)t.o(n,r)&&!t.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:n[r]})},o:function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r:function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};t.r(e),t.d(e,{store:function(){return w}});var n={};t.r(n),t.d(n,{createErrorNotice:function(){return v},createInfoNotice:function(){return g},createNotice:function(){return d},createSuccessNotice:function(){return f},createWarningNotice:function(){return p},removeNotice:function(){return y}});var r={};t.r(r),t.d(r,{getNotices:function(){return E}});var i=window.wp.data;var o=t=>e=>function(){let n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0;const i=r[t];if(void 0===i)return n;const o=e(n[i],r);return o===n[i]?n:{...n,[i]:o}};const c=o("context")((function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1?arguments[1]:void 0;switch(e.type){case"CREATE_NOTICE":return[...t.filter((t=>{let{id:n}=t;return n!==e.notice.id})),e.notice];case"REMOVE_NOTICE":return t.filter((t=>{let{id:n}=t;return n!==e.id}))}return t}));var u=c;const s="global",l="info";let a=0;function d(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:l,e=arguments.length>1?arguments[1]:void 0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const{speak:r=!0,isDismissible:i=!0,context:o=s,id:c=`${o}${++a}`,actions:u=[],type:d="default",__unstableHTML:f,icon:g=null,explicitDismiss:v=!1,onDismiss:p}=n;return e=String(e),{type:"CREATE_NOTICE",context:o,notice:{id:c,status:t,content:e,spokenMessage:r?e:null,__unstableHTML:f,isDismissible:i,actions:u,type:d,icon:g,explicitDismiss:v,onDismiss:p}}}function f(t,e){return d("success",t,e)}function g(t,e){return d("info",t,e)}function v(t,e){return d("error",t,e)}function p(t,e){return d("warning",t,e)}function y(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:s;return{type:"REMOVE_NOTICE",id:t,context:e}}const b=[];function E(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:s;return t[e]||b}const w=(0,i.createReduxStore)("core/notices",{reducer:u,actions:n,selectors:r});(0,i.register)(w),(window.wp=window.wp||{}).notices=e}();
|