1 line
3.2 KiB
JavaScript
1 line
3.2 KiB
JavaScript
|
this.wp=this.wp||{},this.wp.viewport=function(t){var e={};function r(n){if(e[n])return e[n].exports;var o=e[n]={i:n,l:!1,exports:{}};return t[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)r.d(n,o,function(e){return t[e]}.bind(null,o));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=376)}({1:function(t,e){!function(){t.exports=this.lodash}()},21:function(t,e,r){"use strict";var n=r(33);function o(t){return function(t){if(Array.isArray(t)){for(var e=0,r=new Array(t.length);e<t.length;e++)r[e]=t[e];return r}}(t)||Object(n.a)(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}r.d(e,"a",function(){return o})},33:function(t,e,r){"use strict";function n(t){if(Symbol.iterator in Object(t)||"[object Arguments]"===Object.prototype.toString.call(t))return Array.from(t)}r.d(e,"a",function(){return n})},376:function(t,e,r){"use strict";r.r(e);var n={};r.r(n),r.d(n,"setIsMatching",function(){return a});var o={};r.r(o),r.d(o,"isViewportMatch",function(){return s});var i=r(1),c=r(5);var u=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1?arguments[1]:void 0;switch(e.type){case"SET_IS_MATCHING":return e.values}return t};function a(t){return{type:"SET_IS_MATCHING",values:t}}var f=r(21);function s(t,e){return!!t[Object(i.takeRight)([">="].concat(Object(f.a)(e.split(" "))),2).join(" ")]}Object(c.registerStore)("core/viewport",{reducer:u,actions:n,selectors:o});var p=r(6),d=function(t){return Object(p.createHigherOrderComponent)(Object(c.withSelect)(function(e){return Object(i.mapValues)(t,function(t){return e("core/viewport").isViewportMatch(t)})}),"withViewportMatch")},l=function(t){return Object(p.createHigherOrderComponent)(Object(p.compose)([d({isViewportMatch:t}),Object(p.ifCondition)(function(t){return t.isViewportMatch})]),"ifViewportMatches")};r.d(e,"ifViewportMatches",function(){return l}),r.d(e,"withViewportMatch",function(){return d});var h={"<":"max-width",">=":"min-width"},b=Object(i.debounce)(function(){var t=Object(i.mapValues)(w,function(t){return t.matches});Object(c.dispatch)("core/viewport").setIsMatching(t)},{leading:!0}),w=Object(i.reduce)({huge:1440,wide:1280,large:960,medium:782,small:600,mobile:480},function(t,e,r){return Object(i.forEach)(h,function(n,o){var i=window.matchMedia("(".concat(n,": ").concat(e,"px)"));i.addListener(b);var c=[o,r].join(" ");t[c]=i}),t},{});window.addEventListener("orientationchange",b),b()},5:function(t,e){!function(){t.exports=this.wp.data}()},6:function(t,e){!function(){t.exports=this.wp.compose}()}});
|