laipower/wp-content/plugins/gp-premium/dist/block-elements.js

3 lines
183 KiB
JavaScript
Raw Normal View History

!function(){var e={184:function(e,t){var n;!function(){"use strict";var a={}.hasOwnProperty;function o(){for(var e=[],t=0;t<arguments.length;t++){var n=arguments[t];if(n){var r=typeof n;if("string"===r||"number"===r)e.push(n);else if(Array.isArray(n)){if(n.length){var i=o.apply(null,n);i&&e.push(i)}}else if("object"===r){if(n.toString!==Object.prototype.toString&&!n.toString.toString().includes("[native code]")){e.push(n.toString());continue}for(var l in n)a.call(n,l)&&n[l]&&e.push(l)}}}return e.join(" ")}e.exports?(o.default=o,e.exports=o):void 0===(n=function(){return o}.apply(t,[]))||(e.exports=n)}()},70:function(e){e.exports=function(e){var t={};function n(a){if(t[a])return t[a].exports;var o=t[a]={i:a,l:!1,exports:{}};return e[a].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,a){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:a})},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 a=Object.create(null);if(n.r(a),Object.defineProperty(a,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(a,o,function(t){return e[t]}.bind(null,o));return a},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=0)}([function(e,t,n){function a(e){return(a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function o(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}var r=n(1),i=n(7),l=i.get,c=(i.deepValue,i.isArray),p=function(){function e(t,n){var a=n.location,o=void 0===a?0:a,r=n.distance,i=void 0===r?100:r,c=n.threshold,p=void 0===c?.6:c,s=n.maxPatternLength,d=void 0===s?32:s,g=n.caseSensitive,u=void 0!==g&&g,m=n.tokenSeparator,b=void 0===m?/ +/g:m,h=n.findAllMatches,f=void 0!==h&&h,y=n.minMatchCharLength,x=void 0===y?1:y,v=n.id,_=void 0===v?null:v,k=n.keys,w=void 0===k?[]:k,T=n.shouldSort,C=void 0===T||T,D=n.getFn,S=void 0===D?l:D,I=n.sortFn,R=void 0===I?function(e,t){return e.score-t.score}:I,L=n.tokenize,B=void 0!==L&&L,E=n.matchAllTokens,P=void 0!==E&&E,O=n.includeMatches,M=void 0!==O&&O,z=n.includeScore,q=void 0!==z&&z,j=n.verbose,A=void 0!==j&&j;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.options={location:o,distance:i,threshold:p,maxPatternLength:d,isCaseSensitive:u,tokenSeparator:b,findAllMatches:f,minMatchCharLength:x,id:_,keys:w,includeMatches:M,includeScore:q,shouldSort:C,getFn:S,sortFn:R,verbose:A,tokenize:B,matchAllTokens:P},this.setCollection(t),this._processKeys(w)}var t,n;return t=e,(n=[{key:"setCollection",value:function(e){return this.list=e,e}},{key:"_processKeys",value:function(e){if(this._keyWeights={},this._keyNames=[],e.length&&"string"==typeof e[0])for(var t=0,n=e.length;t<n;t+=1){var a=e[t];this._keyWeights[a]=1,this._keyNames.push(a)}else{for(var o=null,r=null,i=0,l=0,c=e.length;l<c;l+=1){var p=e[l];if(!p.hasOwnProperty("name"))throw new Error('Missing "name" property in key object');var s=p.name;if(this._keyNames.push(s),!p.hasOwnProperty("weight"))throw new Error('Missing "weight" property in key object');var d=p.weight;if(d<0||d>1)throw new Error('"weight" property in key must bein the range of [0, 1)');r=null==r?d:Math.max(r,d),o=null==o?d:Math.min(o,d),this._keyWeights[s]=d,i+=d}if(i>1)throw new Error("Total of weights cannot exceed 1")}}},{key:"search",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{limit:!1};this._log('---------\nSearch pattern: "'.concat(e,'"'));var n=this._prepareSearchers(e),a=n.tokenSearchers,o=n.fullSea
/* translators: Unit type (px, em, %) */,{text:(0,r.sprintf)((0,r.__)("%s Units","gp-premium"),n),key:e},(0,t.createElement)(l.Button,{key:e,className:"components-generatepress-control-button__units--"+e,isSmall:!0,isPrimary:a===e,"aria-pressed":a===e
/* translators: %s: values associated with CSS syntax, 'Pixel', 'Em', 'Percentage' */,"aria-label":(0,r.sprintf)((0,r.__)("%s Units","gp-premium"),n),onClick:function(){return o(e)}},e))})))))}}]),i}(t.Component),K=n(196),Y=n.n(K);function $(e,t){const{key:n,options:a}=t,o=a.length-1;let r="ArrowDown"===n?e+1:e-1;r<0?r=o:r>o&&(r=0);const i=a[r];return i&&i.disabled?$(r,{key:n,options:a}):r}function Z(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function Q(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Z(Object(n),!0).forEach((function(t){X(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Z(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function X(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ee(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function te(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ne(e,t){return Array.isArray(e)?e.map((e=>t.find((t=>t.value===e)))):t.find((t=>t.value===e))||null}function ae(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function oe(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ae(Object(n),!0).forEach((function(t){re(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ae(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function re(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}let ie=null;try{ie=n(70)}catch(e){}function le(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function ce(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?le(Object(n),!0).forEach((function(t){pe(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):le(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function pe(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function se({value:e=null,disabled:t=!1,multiple:n=!1,search:a=!1,fuse:o=!1,options:r,onChange:i=(()=>{}),getOptions:l=null,allowEmpty:c=!0,closeOnSelect:p=!0,closable:s=!0}){const d=(0,K.useRef)(null),g=(0,K.useMemo)((()=>function(e){if(!Array.isArray(e))return[];const t=[];return e.forEach(((e,n)=>{if("type"in e&&"group"===e.type){const a=e.name.replace(/\s+/g,"-").toLowerCase()+"-"+n;e.items.forEach((n=>{t.push(Q(Q({},n),{},{groupId:a,groupName:e.name,_id:""+n.value}))}))}else t.push(Q(Q({},e),{},{_id:""+e.value,index:n}))})),t}(r)),[r]),[u,m]=(0,K.useState)({flat:[],addedOptions:[],value:e,search:"",focus:!1,searching:!1,highlighted:-1,changed:!1}),{flat:b,addedOptions:h,value:f,search:y,focus:x,searching:v,highlighted:_}=u,k=(0,K.useMemo)((()=>{let e=ne(f,[...g,...h]);return e||c||n||([e]=g),e}),[f,g,h,c,n]),w=(0,K.useMemo)((()=>function(e){const t=[];return e.forEach(((e,n)=>{if("groupId"in e){const a=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ee(Object(n),!0).forEach((function(t){te(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.definePro