WordPress/wp-includes/js/dist/viewport.min.js

2 lines
5.5 KiB
JavaScript

/*! This file is auto-generated */
this.wp=this.wp||{},this.wp.viewport=function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s="./node_modules/@wordpress/viewport/build-module/index.js")}({"./node_modules/@babel/runtime/helpers/esm/arrayLikeToArray.js":function(e,t,r){"use strict";function n(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}r.d(t,"a",(function(){return n}))},"./node_modules/@babel/runtime/helpers/esm/arrayWithHoles.js":function(e,t,r){"use strict";function n(e){if(Array.isArray(e))return e}r.d(t,"a",(function(){return n}))},"./node_modules/@babel/runtime/helpers/esm/extends.js":function(e,t,r){"use strict";function n(){return(n=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}r.d(t,"a",(function(){return n}))},"./node_modules/@babel/runtime/helpers/esm/nonIterableRest.js":function(e,t,r){"use strict";function n(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}r.d(t,"a",(function(){return n}))},"./node_modules/@babel/runtime/helpers/esm/slicedToArray.js":function(e,t,r){"use strict";r.d(t,"a",(function(){return u}));var n=r("./node_modules/@babel/runtime/helpers/esm/arrayWithHoles.js");var o=r("./node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js"),i=r("./node_modules/@babel/runtime/helpers/esm/nonIterableRest.js");function u(e,t){return Object(n.a)(e)||function(e,t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e)){var r=[],n=!0,o=!1,i=void 0;try{for(var u,s=e[Symbol.iterator]();!(n=(u=s.next()).done)&&(r.push(u.value),!t||r.length!==t);n=!0);}catch(e){o=!0,i=e}finally{try{n||null==s.return||s.return()}finally{if(o)throw i}}return r}}(e,t)||Object(o.a)(e,t)||Object(i.a)()}},"./node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js":function(e,t,r){"use strict";r.d(t,"a",(function(){return o}));var n=r("./node_modules/@babel/runtime/helpers/esm/arrayLikeToArray.js");function o(e,t){if(e){if("string"==typeof e)return Object(n.a)(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Object(n.a)(e,t):void 0}}},"./node_modules/@wordpress/viewport/build-module/index.js":function(e,t,r){"use strict";r.r(t),r.d(t,"store",(function(){return l})),r.d(t,"ifViewportMatches",(function(){return j})),r.d(t,"withViewportMatch",(function(){return h}));var n={};r.r(n),r.d(n,"setIsMatching",(function(){return a}));var o={};r.r(o),r.d(o,"isViewportMatch",(function(){return c}));var i=r("lodash"),u=r("@wordpress/data");var s=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"SET_IS_MATCHING":return t.values}return e};function a(e){return{type:"SET_IS_MATCHING",values:e}}function c(e,t){return-1===t.indexOf(" ")&&(t=">= "+t),!!e[t]}var l=Object(u.createReduxStore)("core/viewport",{reducer:s,actions:n,selectors:o});Object(u.register)(l);var d=function(e,t){var r=Object(i.debounce)((function(){var e=Object(i.mapValues)(n,(function(e){return e.matches}));Object(u.dispatch)(l).setIsMatching(e)}),{leading:!0}),n=Object(i.reduce)(e,(function(e,n,o){return Object(i.forEach)(t,(function(t,i){var u=window.matchMedia("(".concat(t,": ").concat(n,"px)"));u.addListener(r);var s=[i,o].join(" ");e[s]=u})),e}),{});window.addEventListener("orientationchange",r),r(),r.flush()},f=r("@wordpress/compose"),p=r("./node_modules/@babel/runtime/helpers/esm/extends.js"),b=r("./node_modules/@babel/runtime/helpers/esm/slicedToArray.js"),m=r("@wordpress/element"),h=function(e){return Object(f.createHigherOrderComponent)((function(t){return Object(f.pure)((function(r){var n=Object(i.mapValues)(e,(function(e){var t=e.split(" "),r=Object(b.a)(t,2),n=r[0],o=r[1];return void 0===o&&(o=n,n=">="),Object(f.useViewportMatch)(o,n)}));return Object(m.createElement)(t,Object(p.a)({},r,n))}))}),"withViewportMatch")},j=function(e){return Object(f.createHigherOrderComponent)(Object(f.compose)([h({isViewportMatch:e}),Object(f.ifCondition)((function(e){return e.isViewportMatch}))]),"ifViewportMatches")};d({huge:1440,wide:1280,large:960,medium:782,small:600,mobile:480},{"<":"max-width",">=":"min-width"})},"@wordpress/compose":function(e,t){e.exports=window.wp.compose},"@wordpress/data":function(e,t){e.exports=window.wp.data},"@wordpress/element":function(e,t){e.exports=window.wp.element},lodash:function(e,t){e.exports=window.lodash}});