Current File : /home/resuelf/www/wp-content/plugins/gutenberg/build/viewport/index.min.js |
!function(){"use strict";var e={d:function(t,r){for(var n in r)e.o(r,n)&&!e.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:r[n]})},o:function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r:function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};e.r(t),e.d(t,{ifViewportMatches:function(){return p},store:function(){return u},withViewportMatch:function(){return d}});var r={};e.r(r),e.d(r,{setIsMatching:function(){return c}});var n={};e.r(n),e.d(n,{isViewportMatch:function(){return a}});var o=window.wp.compose,i=window.wp.data;function c(e){return{type:"SET_IS_MATCHING",values:e}}function a(e,t){return-1===t.indexOf(" ")&&(t=">= "+t),!!e[t]}const u=(0,i.createReduxStore)("core/viewport",{reducer:function(e={},t){return"SET_IS_MATCHING"===t.type?t.values:e},actions:r,selectors:n});(0,i.register)(u);var s=window.React,d=e=>{const t=Object.entries(e);return(0,o.createHigherOrderComponent)((e=>(0,o.pure)((r=>{const n=Object.fromEntries(t.map((([e,t])=>{let[r,n]=t.split(" ");return void 0===n&&(n=r,r=">="),[e,(0,o.useViewportMatch)(n,r)]})));return(0,s.createElement)(e,{...r,...n})}))),"withViewportMatch")},p=e=>(0,o.createHigherOrderComponent)((0,o.compose)([d({isViewportMatch:e}),(0,o.ifCondition)((e=>e.isViewportMatch))]),"ifViewportMatches");((e,t)=>{const r=(0,o.debounce)((()=>{const e=Object.fromEntries(c.map((([e,t])=>[e,t.matches])));(0,i.dispatch)(u).setIsMatching(e)}),0,{leading:!0}),n=Object.entries(t),c=Object.entries(e).flatMap((([e,t])=>n.map((([n,o])=>{const i=window.matchMedia(`(${o}: ${t}px)`);return i.addEventListener("change",r),[`${n} ${e}`,i]}))));window.addEventListener("orientationchange",r),r(),r.flush()})({huge:1440,wide:1280,large:960,medium:782,small:600,mobile:480},{"<":"max-width",">=":"min-width"}),(window.wp=window.wp||{}).viewport=t}();
//# sourceMappingURL=index.min.js.map