You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

3 lines
13 KiB

!function(t){var e={};function n(r){if(e[r])return e[r].exports;var o=e[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)n.d(r,o,function(e){return t[e]}.bind(null,o));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=11)}([function(t,e){!function(){t.exports=this.wp.element}()},function(t,e,n){"use strict";function r(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function o(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{},o=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(o=o.concat(Object.getOwnPropertySymbols(n).filter((function(t){return Object.getOwnPropertyDescriptor(n,t).enumerable})))),o.forEach((function(e){r(t,e,n[e])}))}return t}n.d(e,"a",(function(){return o}))},function(t,e,n){var r;!function(){"use strict";var o={not_string:/[^s]/,not_bool:/[^t]/,not_type:/[^T]/,not_primitive:/[^v]/,number:/[diefg]/,numeric_arg:/[bcdiefguxX]/,json:/[j]/,not_json:/[^j]/,text:/^[^\x25]+/,modulo:/^\x25{2}/,placeholder:/^\x25(?:([1-9]\d*)\$|\(([^)]+)\))?(\+)?(0|'[^$])?(-)?(\d+)?(?:\.(\d+))?([b-gijostTuvxX])/,key:/^([a-z_][a-z_\d]*)/i,key_access:/^\.([a-z_][a-z_\d]*)/i,index_access:/^\[(\d+)\]/,sign:/^[+-]/};function i(t){return function(t,e){var n,r,u,s,c,a,l,f,p,d=1,h=t.length,y="";for(r=0;r<h;r++)if("string"==typeof t[r])y+=t[r];else if("object"==typeof t[r]){if((s=t[r]).keys)for(n=e[d],u=0;u<s.keys.length;u++){if(null==n)throw new Error(i('[sprintf] Cannot access property "%s" of undefined value "%s"',s.keys[u],s.keys[u-1]));n=n[s.keys[u]]}else n=s.param_no?e[s.param_no]:e[d++];if(o.not_type.test(s.type)&&o.not_primitive.test(s.type)&&n instanceof Function&&(n=n()),o.numeric_arg.test(s.type)&&"number"!=typeof n&&isNaN(n))throw new TypeError(i("[sprintf] expecting number but found %T",n));switch(o.number.test(s.type)&&(f=n>=0),s.type){case"b":n=parseInt(n,10).toString(2);break;case"c":n=String.fromCharCode(parseInt(n,10));break;case"d":case"i":n=parseInt(n,10);break;case"j":n=JSON.stringify(n,null,s.width?parseInt(s.width):0);break;case"e":n=s.precision?parseFloat(n).toExponential(s.precision):parseFloat(n).toExponential();break;case"f":n=s.precision?parseFloat(n).toFixed(s.precision):parseFloat(n);break;case"g":n=s.precision?String(Number(n.toPrecision(s.precision))):parseFloat(n);break;case"o":n=(parseInt(n,10)>>>0).toString(8);break;case"s":n=String(n),n=s.precision?n.substring(0,s.precision):n;break;case"t":n=String(!!n),n=s.precision?n.substring(0,s.precision):n;break;case"T":n=Object.prototype.toString.call(n).slice(8,-1).toLowerCase(),n=s.precision?n.substring(0,s.precision):n;break;case"u":n=parseInt(n,10)>>>0;break;case"v":n=n.valueOf(),n=s.precision?n.substring(0,s.precision):n;break;case"x":n=(parseInt(n,10)>>>0).toString(16);break;case"X":n=(parseInt(n,10)>>>0).toString(16).toUpperCase()}o.json.test(s.type)?y+=n:(!o.number.test(s.type)||f&&!s.sign?p="":(p=f?"+":"-",n=n.toString().replace(o.sign,"")),a=s.pad_char?"0"===s.pad_char?"0":s.pad_char.charAt(1):" ",l=s.width-(p+n).length,c=s.width&&l>0?a.repeat(l):"",y+=s.align?p+n+c:"0"===a?p+c+n:c+p+n)}return y}(function(t){if(s[t])return s[t];var e,n=t,r=[],i=0;for(;n;){if(null!==(e=o.text.exec(n)))r.push(e[0]);else if(null!==(e=o.modulo.exec(n)))r.push("%");else{if(null===(e=o.placeholder.exec(n)))throw new SyntaxError("[sprintf] unexpected placeholder");if(e[2]){i|=1;var u=[],c=e[2],a=[];if(null===(a=o.key.exec(c)))throw new SyntaxError("[sprintf] failed to parse named argument key");for(u.push(a[1]);""!==(c=c.substring(a[0].length));)if(null!==(a=o.key_access.exec(c)))u.push(a[1]);else{if(null===(a=o.index_access.exec(c)))throw new SyntaxError("[sprintf] failed to parse named argument key");u.push(a[1])}e[2]=u}else i|=2;if(3===i)throw new Error("[sprintf] mixing positional and named placeholders is not (yet) supported");r.push({placeholder:e[0],param_no:e[1],keys:e[2],sign:e[3],pad_char:e[4],align:e[5],width:e[6],precision:e[7],type:e[8]})}n=n.substring(e[0].length)}return s[t]=r}(t),arguments)}function u(t,e){return i.apply(null,[t].concat(e||[]))}var s=Object.create(null);e.sprintf=i,e.vsprintf=u,"undefined"!=typeof window&&(window.sprintf=i,window.vsprintf=u,void 0===(r=function(){return{sprintf:i,vsprintf:u}}.call(e,n,e,t))||(t.exports=r))}()},function(t,e,n){"use strict";n.r(e);var r,o,i,u,s=n(1);r={"(":9,"!":8,"*":7,"/":7,"%":7,"+":6,"-":6,"<":5,"<=":5,">":5,">=":5,"==":4,"!=":4,"&&":3,"||":2,"?":1,"?:":1},o=["(","?"],i={")":["("],":":["?","?:"]},u=/<=|>=|==|!=|&&|\|\||\?:|\(|!|\*|\/|%|\+|-|<|>|\?|\)|:/;var c={"!":function(t){return!t},"*":function(t,e){return t*e},"/":function(t,e){return t/e},"%":function(t,e){return t%e},"+":function(t,e){return t+e},"-":function(t,e){return t-e},"<":function(t,e){return t<e},"<=":function(t,e){return t<=e},">":function(t,e){return t>e},">=":function(t,e){return t>=e},"==":function(t,e){return t===e},"!=":function(t,e){return t!==e},"&&":function(t,e){return t&&e},"||":function(t,e){return t||e},"?:":function(t,e,n){if(t)throw e;return n}};function a(t){var e=function(t){for(var e,n,s,c,a=[],l=[];e=t.match(u);){for(n=e[0],(s=t.substr(0,e.index).trim())&&a.push(s);c=l.pop();){if(i[n]){if(i[n][0]===c){n=i[n][1]||n;break}}else if(o.indexOf(c)>=0||r[c]<r[n]){l.push(c);break}a.push(c)}i[n]||l.push(n),t=t.substr(e.index+n.length)}return(t=t.trim())&&a.push(t),a.concat(l.reverse())}(t);return function(t){return function(t,e){var n,r,o,i,u,s,a=[];for(n=0;n<t.length;n++){if(u=t[n],i=c[u]){for(r=i.length,o=Array(r);r--;)o[r]=a.pop();try{s=i.apply(null,o)}catch(t){return t}}else s=e.hasOwnProperty(u)?e[u]:+u;a.push(s)}return a[0]}(e,t)}}var l={contextDelimiter:"",onMissingKey:null};function f(t,e){var n;for(n in this.data=t,this.pluralForms={},e=e||{},this.options={},l)this.options[n]=e[n]||l[n]}f.prototype.getPluralForm=function(t,e){var n,r,o,i,u=this.pluralForms[t];return u||("function"!=typeof(o=(n=this.data[t][""])["Plural-Forms"]||n["plural-forms"]||n.plural_forms)&&(r=function(t){var e,n,r;for(e=t.split(";"),n=0;n<e.length;n++)if(0===(r=e[n].trim()).indexOf("plural="))return r.substr(7)}(n["Plural-Forms"]||n["plural-forms"]||n.plural_forms),i=a(r),o=function(t){return+i({n:t})}),u=this.pluralForms[t]=o),u(e)},f.prototype.dcnpgettext=function(t,e,n,r,o){var i,u,s;return i=void 0===o?0:this.getPluralForm(t,o),u=n,e&&(u=e+this.options.contextDelimiter+n),(s=this.data[t][u])&&s[i]?s[i]:(this.options.onMissingKey&&this.options.onMissingKey(n,t),0===i?n:r)};var p=n(4),d=n.n(p),h=n(2),y=n.n(h);n.d(e,"setLocaleData",(function(){return m})),n.d(e,"__",(function(){return x})),n.d(e,"_x",(function(){return O})),n.d(e,"_n",(function(){return j})),n.d(e,"_nx",(function(){return _})),n.d(e,"sprintf",(function(){return S}));var b={"":{plural_forms:function(t){return 1===t?0:1}}},v=d()(console.error),g=new f({});function m(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"default";g.data[e]=Object(s.a)({},b,g.data[e],t),g.data[e][""]=Object(s.a)({},b[""],g.data[e][""])}function w(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default",e=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0,r=arguments.length>3?arguments[3]:void 0,o=arguments.length>4?arguments[4]:void 0;return g.data[t]||m(void 0,t),g.dcnpgettext(t,e,n,r,o)}function x(t,e){return w(e,void 0,t)}function O(t,e,n){return w(n,e,t)}function j(t,e,n,r){return w(r,void 0,t,e,n)}function _(t,e,n,r,o){return w(o,r,t,e,n)}function S(t){try{for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];return y.a.sprintf.apply(y.a,[t].concat(n))}catch(e){return v("sprintf error: \n\n"+e.toString()),t}}},function(t,e,n){t.exports=function(t,e){var n,r,o,i=0;function u(){var e,u,s=r,c=arguments.length;t:for(;s;){if(s.args.length===arguments.length){for(u=0;u<c;u++)if(s.args[u]!==arguments[u]){s=s.next;continue t}return s!==r&&(s===o&&(o=s.prev),s.prev.next=s.next,s.next&&(s.next.prev=s.prev),s.next=r,s.prev=null,r.prev=s,r=s),s.val}s=s.next}for(e=new Array(c),u=0;u<c;u++)e[u]=arguments[u];return s={args:e,val:t.apply(null,e)},r?(r.prev=s,s.next=r):o=s,i===n?(o=o.prev).next=null:i++,r=s,s.val}return e&&e.maxSize&&(n=e.maxSize),u.clear=function(){r=null,o=null,i=0},u}},function(t,e){!function(){t.exports=this.wp.components}()},function(t,e){!function(){t.exports=this.lodash}()},function(t,e){!function(){t.exports=this.wp.data}()},function(t,e){!function(){t.exports=this.wp.apiFetch}()},function(t,e){!function(){t.exports=this.wp.url}()},,function(t,e,n){"use strict";n.r(e);var r={};function o(){return(o=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t}).apply(this,arguments)}n.r(r),n.d(r,"default",(function(){return j}));var i=n(1);function u(t,e){if(null==t)return{};var n,r,o=function(t,e){if(null==t)return{};var n,r,o={},i=Object.keys(t);for(r=0;r<i.length;r++)n=i[r],e.indexOf(n)>=0||(o[n]=t[n]);return o}(t,e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(r=0;r<i.length;r++)n=i[r],e.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(t,n)&&(o[n]=t[n])}return o}var s=n(0),c=n(7);function a(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function l(t){return(l="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function f(t){return(f="function"==typeof Symbol&&"symbol"===l(Symbol.iterator)?function(t){return l(t)}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":l(t)})(t)}function p(t,e){return!e||"object"!==f(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function d(t){return(d=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function h(t,e){return(h=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}var y=n(6),b=n(3),v=n(8),g=n.n(v),m=n(9),w=n(5);var x=function(t){function e(t){var n;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(n=p(this,d(e).call(this,t))).state={response:null},n}var n,r,o;return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&h(t,e)}(e,t),n=e,(r=[{key:"componentDidMount",value:function(){this.isStillMounted=!0,this.fetch(this.props),this.fetch=Object(y.debounce)(this.fetch,500)}},{key:"componentWillUnmount",value:function(){this.isStillMounted=!1}},{key:"componentDidUpdate",value:function(t){Object(y.isEqual)(t,this.props)||this.fetch(this.props)}},{key:"fetch",value:function(t){var e=this;if(this.isStillMounted){null!==this.state.response&&this.setState({response:null});var n=t.block,r=t.attributes,o=void 0===r?null:r,u=t.urlQueryArgs,s=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return Object(m.addQueryArgs)("/wp/v2/block-renderer/".concat(t),Object(i.a)({context:"edit"},null!==e?{attributes:e}:{},n))}(n,o,void 0===u?{}:u),c=this.currentFetchRequest=g()({path:s}).then((function(t){e.isStillMounted&&c===e.currentFetchRequest&&t&&e.setState({response:t.rendered})})).catch((function(t){e.isStillMounted&&c===e.currentFetchRequest&&e.setState({response:{error:!0,errorMsg:t.message}})}));return c}}},{key:"render",value:function(){var t=this.state.response,e=this.props.className;if(""===t)return Object(s.createElement)(w.Placeholder,{className:e},Object(b.__)("Block rendered as empty."));if(!t)return Object(s.createElement)(w.Placeholder,{className:e},Object(s.createElement)(w.Spinner,null));if(t.error){
// translators: %s: error message describing the problem
var n=Object(b.sprintf)(Object(b.__)("Error loading block: %s"),t.errorMsg);return Object(s.createElement)(w.Placeholder,{className:e},n)}return Object(s.createElement)(s.RawHTML,{key:"html",className:e},t)}}])&&a(n.prototype,r),o&&a(n,o),e}(s.Component),O={},j=Object(c.withSelect)((function(t){var e=t("core/editor");if(e){var n=e.getCurrentPostId();if(n)return{currentPostId:n}}return O}))((function(t){var e=t.urlQueryArgs,n=void 0===e?O:e,r=t.currentPostId,c=u(t,["urlQueryArgs","currentPostId"]),a=Object(s.useMemo)((function(){return r?Object(i.a)({post_id:r},n):n}),[r,n]);return Object(s.createElement)(x,o({urlQueryArgs:a},c))}));window.wp=window.wp||{},window.wp.serverSideRender=r}]);