WordPress/wp-includes/js/dist/block-library.min.js

13 lines
354 KiB
JavaScript
Raw Normal View History

this.wp=this.wp||{},this.wp.blockLibrary=function(e){var t={};function n(r){if(t[r])return t[r].exports;var a=t[r]={i:r,l:!1,exports:{}};return e[r].call(a.exports,a,a.exports,n),a.l=!0,a.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var a in e)n.d(r,a,function(t){return e[t]}.bind(null,a));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=310)}({0:function(e,t){!function(){e.exports=this.wp.element}()},1:function(e,t){!function(){e.exports=this.wp.i18n}()},10:function(e,t,n){"use strict";function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}n.d(t,"a",(function(){return r}))},11:function(e,t,n){"use strict";function r(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function a(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),e}n.d(t,"a",(function(){return a}))},117:function(e,t,n){(function(e,r){var a;/*! https://mths.be/punycode v1.3.2 by @mathias */!function(o){t&&t.nodeType,e&&e.nodeType;var c="object"==typeof r&&r;c.global!==c&&c.window!==c&&c.self;var i,l=2147483647,s=36,u=1,b=26,m=38,d=700,h=72,p=128,g="-",f=/^xn--/,v=/[^\x20-\x7E]/,O=/[\x2E\u3002\uFF0E\uFF61]/g,j={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},y=s-u,_=Math.floor,k=String.fromCharCode;function C(e){throw RangeError(j[e])}function w(e,t){for(var n=e.length,r=[];n--;)r[n]=t(e[n]);return r}function E(e,t){var n=e.split("@"),r="";return n.length>1&&(r=n[0]+"@",e=n[1]),r+w((e=e.replace(O,".")).split("."),t).join(".")}function x(e){for(var t,n,r=[],a=0,o=e.length;a<o;)(t=e.charCodeAt(a++))>=55296&&t<=56319&&a<o?56320==(64512&(n=e.charCodeAt(a++)))?r.push(((1023&t)<<10)+(1023&n)+65536):(r.push(t),a--):r.push(t);return r}function S(e){return w(e,(function(e){var t="";return e>65535&&(t+=k((e-=65536)>>>10&1023|55296),e=56320|1023&e),t+=k(e)})).join("")}function T(e,t){return e+22+75*(e<26)-((0!=t)<<5)}function N(e,t,n){var r=0;for(e=n?_(e/d):e>>1,e+=_(e/t);e>y*b>>1;r+=s)e=_(e/y);return _(r+(y+1)*e/(e+m))}function M(e){var t,n,r,a,o,c,i,m,d,f,v,O=[],j=e.length,y=0,k=p,w=h;for((n=e.lastIndexOf(g))<0&&(n=0),r=0;r<n;++r)e.charCodeAt(r)>=128&&C("not-basic"),O.push(e.charCodeAt(r));for(a=n>0?n+1:0;a<j;){for(o=y,c=1,i=s;a>=j&&C("invalid-input"),((m=(v=e.charCodeAt(a++))-48<10?v-22:v-65<26?v-65:v-97<26?v-97:s)>=s||m>_((l-y)/c))&&C("overflow"),y+=m*c,!(m<(d=i<=w?u:i>=w+b?b:i-w));i+=s)c>_(l/(f=s-d))&&C("overflow"),c*=f;w=N(y-o,t=O.length+1,0==o),_(y/t)>l-k&&C("overflow"),k+=_(y/t),y%=t,O.splice(y++,0,k)}return S(O)}function B(e){var t,n,r,a,o,c,i,m,d,f,v,O,j,y,w,E=[];for(O=(e=x(e)).length,t=p,n=0,o=h,c=0;c<O;++c)(v=e[c])<128&&E.push(k(v));for(r=a=E.length,a&&E.push(g);r<O;){for(i=l,c=0;c<O;++c)(v=e[c])>=t&&v<i&&(i=v);for(i-t>_((l-n)/(j=r+1))&&C("overflow"),n+=(i-t)*j,t=i,c=0;c<O;++c)if((v=e[c])<t&&++n>l&&C("overflow"),v==t){for(m=n,d=s;!(m<(f=d<=o?u:d>=o+b?b:d-o));d+=s)w=m-f,y=s-f,E.push(k(T(f+w%y,0))),m=_(w/y);E.push(k(T(m,0))),o=N(n,j,r==a),n=0,++r}++n,++t}return E.join("")}i={version:"1.3.2",ucs2:{decode:x,encode:S},decode:M,encode:B,toASCII:function(e){return E(e,(function(e){return v.test(e)?"xn--"+B(e):e}))},toUnicode:function(e){return E(e,(function(e){return f.test(e)?M(e.slice(4).toLowerCase()):e}))}},void 0===(a=function(){return i}.call(t,n,t,e))||(e.exports=a)}()}).call(this,n(118)(e),n
/*!
Copyright (c) 2017 Jed Watson.
Licensed under the MIT License (MIT), see
http://jedwatson.github.io/classnames
*/!function(){"use strict";var n={}.hasOwnProperty;function a(){for(var e=[],t=0;t<arguments.length;t++){var r=arguments[t];if(r){var o=typeof r;if("string"===o||"number"===o)e.push(r);else if(Array.isArray(r)&&r.length){var c=a.apply(null,r);c&&e.push(c)}else if("object"===o)for(var i in r)n.call(r,i)&&r[i]&&e.push(i)}}return e.join(" ")}e.exports?(a.default=a,e.exports=a):void 0===(r=function(){return a}.apply(t,[]))||(e.exports=r)}()},17:function(e,t,n){"use strict";var r=n(30);function a(e){return function(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t<e.length;t++)n[t]=e[t];return n}}(e)||Object(r.a)(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}n.d(t,"a",(function(){return a}))},18:function(e,t,n){"use strict";function r(){return(r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}n.d(t,"a",(function(){return r}))},19:function(e,t){!function(){e.exports=this.wp.keycodes}()},198:function(e,t,n){
/*! Fast Average Color | © 2019 Denis Seleznev | MIT License | https://github.com/hcodes/fast-average-color/ */
e.exports=function(){"use strict";function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function t(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=[],r=!0,a=!1,o=void 0;try{for(var c,i=e[Symbol.iterator]();!(r=(c=i.next()).done)&&(n.push(c.value),!t||n.length!==t);r=!0);}catch(e){a=!0,o=e}finally{try{r||null==i.return||i.return()}finally{if(a)throw o}}return n}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}return function(){function n(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,n)}var r,a,o;return r=n,(a=[{key:"getColorAsync",value:function(e,t,n){e.complete?t.call(e,this.getColor(e,n),n&&n.data):this._bindImageEvents(e,t,n)}},{key:"getColor",value:function(e,t){t=t||{};var n=this._getDefaultColor(t),r=this._getOriginalSize(e),a=this._prepareSizeAndPosition(r,t),o=null,c=n;if(!(a.srcWidth&&a.srcHeight&&a.destWidth&&a.destHeight))return this._prepareResult(n,new Error("FastAverageColor: Incorrect sizes."));if(!this._ctx&&(this._canvas=this._makeCanvas(),this._ctx=this._canvas.getContext&&this._canvas.getContext("2d"),!this._ctx))return this._prepareResult(n,new Error("FastAverageColor: Canvas Context 2D is not supported in this browser."));this._canvas.width=a.destWidth,this._canvas.height=a.destHeight;try{this._ctx.clearRect(0,0,a.destWidth,a.destHeight),this._ctx.drawImage(e,a.srcLeft,a.srcTop,a.srcWidth,a.srcHeight,0,0,a.destWidth,a.destHeight);var i=this._ctx.getImageData(0,0,a.destWidth,a.destHeight).data;c=this.getColorFromArray4(i,t)}catch(e){o=e}return this._prepareResult(c,o)}},{key:"getColorFromArray4",value:function(e,t){t=t||{};var n=e.length;if(n<4)return this._getDefaultColor(t);var r=n-n%4,a=4*(t.step||1),o="_"+(t.algorithm||"sqrt")+"Algorithm";if("function"!=typeof this[o])throw new Error("FastAverageColor: ".concat(t.algorithm," is unknown algorithm."));return this[o](e,r,a)}},{key:"destroy",value:function(){delete this._canvas,delete this._ctx}},{key:"_getDefaultColor",value:function(e){return this._getOption(e,"defaultColor",[255,255,255,255])}},{key:"_getOption",value:function(e,t,n){return void 0===e[t]?n:e[t]}},{key:"_prepareSizeAndPosition",value:function(e,t){var n,r=this._getOption(t,"left",0),a=this._getOption(t,"top",0),o=this._getOption(t,"width",e.width),c=this._getOption(t,"height",e.height),i=o,l=c;return"precision"===t.mode?{srcLeft:r,srcTop:a,srcWidth:o,srcHeight:c,destWidth:i,destHeight:l}:(o>c?(n=o/c,i=100,l=Math.round(i/n)):(n=c/o,l=100,i=Math.round(l/n)),(i>o||l>c||i<10||l<10)&&(i=o,l=c),{srcLeft:r,srcTop:a,srcWidth:o,srcHeight:c,destWidth:i,destHeight:l})}},{key:"_simpleAlgorithm",value:function(e,t,n){for(var r=0,a=0,o=0,c=0,i=0,l=0;l<t;l+=n){var s=e[l+3];r+=e[l]*s,a+=e[l+1]*s,o+=e[l+2]*s,c+=s,i++}return c?[Math.round(r/c),Math.round(a/c),Math.round(o/c),Math.round(c/i)]:[0,0,0,0]}},{key:"_sqrtAlgorithm",value:function(e,t,n){for(var r=0,a=0,o=0,c=0,i=0,l=0;l<t;l+=n){var s=e[l],u=e[l+1],b=e[l+2],m=e[l+3];r+=s*s*m,a+=u*u*m,o+=b*b*m,c+=m,i++}return c?[Math.round(Math.sqrt(r/c)),Math.round(Math.sqrt(a/c)),Math.round(Math.sqrt(o/c)),Math.round(c/i)]:[0,0,0,0]}},{key:"_dominantAlgorithm",value:function(e,n,r){for(var a={},o=0;o<n;o+=r){var c=e[o],i=e[o+1],l=e[o+2],s=e[o+3],u=Math.round(c/24)+","+Math.round(i/24)+","+Math.round(l/24);a[u]?a[u]=[a[u][0]+c*s,a[u][1]+i*s,a[u][2]+l*s,a[u][3]+s,a[u][4]+1]:a[u]=[c*s,i*s,l*s,s,1]}var b=t(Object.keys(a).map((function(e){return a[e]})).sort((function(e,t){var n=e[4],r=t[4];return n>r?-1:n===r?0:1}))[0],5),m=b[0],d=b[1],h=b[2],p=b[3],g=b[4];return p?[Math.round(m/p),Math.round(d/p),Math.round(h/p),Math.round(p/g)]:[0,0,0,0]}},{key:"_bindImageEvents",value:function(e,t,n){var r=this,a=(n=n||{})&&n.data,o=this._getDefaultColor(n),c=function(){s(),t.call(e,r.getColor(e,n),a)},i=function(){s(),t.call(e,r._prepareResult(o,new Error("Image error")),a)},l=function(){s(),t.call(e,r._prepareResult(o,new Error("Im
/*!
Copyright (c) 2017 Jed Watson.
Licensed under the MIT License (MIT), see
http://jedwatson.github.io/classnames
*/!function(){"use strict";var n=function(){function e(){}function t(e,t){for(var n=t.length,r=0;r<n;++r)a(e,t[r])}e.prototype=Object.create(null);var n={}.hasOwnProperty;var r=/\s+/;function a(e,a){if(a){var o=typeof a;"string"===o?function(e,t){for(var n=t.split(r),a=n.length,o=0;o<a;++o)e[n[o]]=!0}(e,a):Array.isArray(a)?t(e,a):"object"===o?function(e,t){for(var r in t)n.call(t,r)&&(e[r]=!!t[r])}(e,a):"number"===o&&function(e,t){e[t]=!0}(e,a)}}return function(){for(var n=arguments.length,r=Array(n),a=0;a<n;a++)r[a]=arguments[a];var o=new e;t(o,r);var c=[];for(var i in o)o[i]&&c.push(i);return c.join(" ")}}();e.exports?(n.default=n,e.exports=n):void 0===(r=function(){return n}.apply(t,[]))||(e.exports=r)}()},7:function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var r=n(10);function a(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},a=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(a=a.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),a.forEach((function(t){Object(r.a)(e,t,n[t])}))}return e}},79:function(e,t,n){"use strict";var r=n(117),a=n(119);function o(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}t.parse=O,t.resolve=function(e,t){return O(e,!1,!0).resolve(t)},t.resolveObject=function(e,t){return e?O(e,!1,!0).resolveObject(t):t},t.format=function(e){a.isString(e)&&(e=O(e));return e instanceof o?e.format():o.prototype.format.call(e)},t.Url=o;var c=/^([a-z0-9.+-]+:)/i,i=/:[0-9]*$/,l=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,s=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r","\n","\t"]),u=["'"].concat(s),b=["%","/","?",";","#"].concat(u),m=["/","?","#"],d=/^[+a-z0-9A-Z_-]{0,63}$/,h=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,p={javascript:!0,"javascript:":!0},g={javascript:!0,"javascript:":!0},f={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},v=n(120);function O(e,t,n){if(e&&a.isObject(e)&&e instanceof o)return e;var r=new o;return r.parse(e,t,n),r}o.prototype.parse=function(e,t,n){if(!a.isString(e))throw new TypeError("Parameter 'url' must be a string, not "+typeof e);var o=e.indexOf("?"),i=-1!==o&&o<e.indexOf("#")?"?":"#",s=e.split(i);s[0]=s[0].replace(/\\/g,"/");var O=e=s.join(i);if(O=O.trim(),!n&&1===e.split("#").length){var j=l.exec(O);if(j)return this.path=O,this.href=O,this.pathname=j[1],j[2]?(this.search=j[2],this.query=t?v.parse(this.search.substr(1)):this.search.substr(1)):t&&(this.search="",this.query={}),this}var y=c.exec(O);if(y){var _=(y=y[0]).toLowerCase();this.protocol=_,O=O.substr(y.length)}if(n||y||O.match(/^\/\/[^@\/]+@[^@\/]+/)){var k="//"===O.substr(0,2);!k||y&&g[y]||(O=O.substr(2),this.slashes=!0)}if(!g[y]&&(k||y&&!f[y])){for(var C,w,E=-1,x=0;x<m.length;x++){-1!==(S=O.indexOf(m[x]))&&(-1===E||S<E)&&(E=S)}-1!==(w=-1===E?O.lastIndexOf("@"):O.lastIndexOf("@",E))&&(C=O.slice(0,w),O=O.slice(w+1),this.auth=decodeURIComponent(C)),E=-1;for(x=0;x<b.length;x++){var S;-1!==(S=O.indexOf(b[x]))&&(-1===E||S<E)&&(E=S)}-1===E&&(E=O.length),this.host=O.slice(0,E),O=O.slice(E),this.parseHost(),this.hostname=this.hostname||"";var T="["===this.hostname[0]&&"]"===this.hostname[this.hostname.length-1];if(!T)for(var N=this.hostname.split(/\./),M=(x=0,N.length);x<M;x++){var B=N[x];if(B&&!B.match(d)){for(var R="",A=0,L=B.length;A<L;A++)B.charCodeAt(A)>127?R+="x":R+=B[A];if(!R.match(d)){var I=N.slice(0,x),z=N.slice(x+1),P=B.match(h);P&&(I.push(P[1]),z.unshift(P[2])),z.length&&(O="/"+z.join(".")+O),this.hostname=I.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),T||(this.hostname=r.toASCII(this.hostname));var H=this.port?":"+this.port:"",V=this.hostname||"";this.host=V+H,this.href+=this.host,T&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==O[0]&&(O="/"+O))}if(!p[_])for(x=0,M=u.length;x<M;x++){var D=u[x];if(-1!==O.indexOf(D)){var