2019-10-29 10:59:08 +01:00
|
|
|
this.wp=this.wp||{},this.wp.apiFetch=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=353)}({1:function(t,e){!function(){t.exports=this.wp.i18n}()},10:function(t,e,r){"use strict";function n(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}r.d(e,"a",(function(){return n}))},20:function(t,e,r){t.exports=r(47)},21:function(t,e,r){"use strict";function n(t,e){if(null==t)return{};var r,n,o=function(t,e){if(null==t)return{};var r,n,o={},a=Object.keys(t);for(n=0;n<a.length;n++)r=a[n],e.indexOf(r)>=0||(o[r]=t[r]);return o}(t,e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);for(n=0;n<a.length;n++)r=a[n],e.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(t,r)&&(o[r]=t[r])}return o}r.d(e,"a",(function(){return n}))},26:function(t,e){!function(){t.exports=this.wp.url}()},353:function(t,e,r){"use strict";r.r(e);var n=r(7),o=r(21);var a=function(t){function e(t,r){var o=t.headers,a=void 0===o?{}:o;for(var i in a)if("x-wp-nonce"===i.toLowerCase())return r(t);return r(Object(n.a)({},t,{headers:Object(n.a)({},a,{"X-WP-Nonce":e.nonce})}))}return e.nonce=t,e},i=function(t,e){var r,o,a=t.path;return"string"==typeof t.namespace&&"string"==typeof t.endpoint&&(r=t.namespace.replace(/^\/|\/$/g,""),a=(o=t.endpoint.replace(/^\//,""))?r+"/"+o:r),delete t.namespace,delete t.endpoint,e(Object(n.a)({},t,{path:a}))},c=function(t){return function(e,r){return i(e,(function(e){var o,a=e.url,i=e.path;return"string"==typeof i&&(o=t,-1!==t.indexOf("?")&&(i=i.replace("?","&")),i=i.replace(/^\//,""),"string"==typeof o&&-1!==o.indexOf("?")&&(i=i.replace("?","&")),a=o+i),r(Object(n.a)({},e,{url:a}))}))}},u=function(t){return function(e,r){var n=e.parse,o=void 0===n||n;if("string"==typeof e.path){var a=e.method||"GET",i=function(t){var e=t.split("?"),r=e[1],n=e[0];return r?n+"?"+r.split("&").map((function(t){return t.split("=")})).sort((function(t,e){return t[0].localeCompare(e[0])})).map((function(t){return t.join("=")})).join("&"):n}(e.path);if(o&&"GET"===a&&t[i])return Promise.resolve(t[i].body);if("OPTIONS"===a&&t[a]&&t[a][i])return Promise.resolve(t[a][i])}return r(e)}},s=r(20),f=r.n(s),l=r(43),h=r(26),p=function(t,e){var r=t.path,a=t.url,i=Object(o.a)(t,["path","url"]);return Object(n.a)({},i,{url:a&&Object(h.addQueryArgs)(a,e),path:r&&Object(h.addQueryArgs)(r,e)})},d=function(t){return t.json?t.json():Promise.reject(t)},v=function(t){return function(t){if(!t)return{};var e=t.match(/<([^>]+)>; rel="next"/);return e?{next:e[1]}:{}}(t.headers.get("link")).next},y=function(t){var e=t.path&&-1!==t.path.indexOf("per_page=-1"),r=t.url&&-1!==t.url.indexOf("per_page=-1");return e||r},g=function(){var t=Object(l.a)(f.a.mark((function t(e,r){var o,a,i,c,u,s;return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!1!==e.parse){t.next=2;break}return t.abrupt("return",r(e));case 2:if(y(e)){t.next=4;break}return t.abrupt("return",r(e));case 4:return t.next=6,r(Object(n.a)({},p(e,{per_page:100}),{parse:!1}));case 6:return o=t.sent,t.next=9,d(o);case 9:if(a=t.sent,Array.isArray(a)){t.next=12;break}return t.abrupt("return",a);case 12:if(i=v(o)){t.next=15;break}return t.abrupt("return",a);case 15:c=[].concat(a);case 16:i
|