diff --git a/files/class-image.php b/files/class-image.php index 1f9262ab64..3b6daa3b37 100644 --- a/files/class-image.php +++ b/files/class-image.php @@ -165,13 +165,31 @@ public function get_mime_type() { /** * Returns the images filesize (in bytes). * - * Since we don't actually create new files for different attachment sizes, - * the filesize on each entry in the attachment sizes array will just be that of the original. - * * @return int */ public function get_filesize() { - return (int) $this->filesize; + $filesize = (int) $this->filesize; + + // We don't actually create new files for different attachment sizes, + // so the filesize on each entry is instead an estimate based on pixel count difference. + if ( $this->is_resized ) { + $original_pixels = $this->original_height * $this->original_width; + $resized_pixels = $this->height * $this->width; + + // Unsure if this is possible, but just in case :) + if ( $original_pixels <= 0 ) { + return 0; + } + + // Example: Original 100mb image w/ 1000 pixels, cropped to 250 pixels in the thumbnail. + // The pixel diff is 25%. So estimated size is 100mb * .25 = 25mb. + $pixel_diff = $resized_pixels / $original_pixels; + $estimated_size = $filesize * $pixel_diff; + + return (int) round( $estimated_size ); + } + + return $filesize; } /** diff --git a/search/search-dev-tools/build/bundle.js b/search/search-dev-tools/build/bundle.js index e9be617568..418d4da365 100644 --- a/search/search-dev-tools/build/bundle.js +++ b/search/search-dev-tools/build/bundle.js @@ -1 +1 @@ -(()=>{function e(r){var o=n[r];if(void 0!==o)return o.exports;var i=n[r]={exports:{}};return t[r].call(i.exports,i,i.exports,e),i.exports}var t={798:(e,t,n)=>{n.p=window.VIPSearchDevTools.__webpack_public_path__},184:(e,t)=>{var n;!function(){"use strict";function r(){for(var e=[],t=0;t1&&void 0!==arguments[1]?arguments[1]:{container:document.body},n="";return"string"==typeof e?n=g(e,t):e instanceof HTMLInputElement&&!["text","search","url","tel","password"].includes(null==e?void 0:e.type)?n=g(e.value,t):(n=v()(e),r("copy")),n},w=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.action,n=void 0===t?"copy":t,r=e.container,i=e.target,a=e.text;if("copy"!==n&&"cut"!==n)throw new Error('Invalid "action" value, use either "copy" or "cut"');if(void 0!==i){if(!i||"object"!==o(i)||1!==i.nodeType)throw new Error('Invalid "target" value, use a valid Element');if("copy"===n&&i.hasAttribute("disabled"))throw new Error('Invalid "target" attribute. Please use "readonly" instead of "disabled" attribute');if("cut"===n&&(i.hasAttribute("readonly")||i.hasAttribute("disabled")))throw new Error('Invalid "target" attribute. You can\'t cut text from elements with "readonly" or "disabled" attributes')}return a?b(a,{container:r}):i?"cut"===n?m(i):b(i,{container:r}):void 0},k=function(e){function t(e,t){var n;return(n=s.call(this)).resolveOptions(t),n.listenClick(e),n}!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&l(e,t)}(t,e);var n,r,o,s=u(t);return n=t,r=[{key:"resolveOptions",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.action="function"==typeof e.action?e.action:this.defaultAction,this.target="function"==typeof e.target?e.target:this.defaultTarget,this.text="function"==typeof e.text?e.text:this.defaultText,this.container="object"===i(e.container)?e.container:document.body}},{key:"listenClick",value:function(e){var t=this;this.listener=h()(e,"click",(function(e){return t.onClick(e)}))}},{key:"onClick",value:function(e){var t=e.delegateTarget||e.currentTarget,n=this.action(t)||"copy",r=w({action:n,container:this.container,target:this.target(t),text:this.text(t)});this.emit(r?"success":"error",{action:n,text:r,trigger:t,clearSelection:function(){t&&t.focus(),window.getSelection().removeAllRanges()}})}},{key:"defaultAction",value:function(e){return f("action",e)}},{key:"defaultTarget",value:function(e){var t=f("target",e);if(t)return document.querySelector(t)}},{key:"defaultText",value:function(e){return f("text",e)}},{key:"destroy",value:function(){this.listener.destroy()}}],o=[{key:"copy",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{container:document.body};return b(e,t)}},{key:"cut",value:function(e){return m(e)}},{key:"isSupported",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:["copy","cut"],t="string"==typeof e?[e]:e,n=!!document.queryCommandSupported;return t.forEach((function(e){n=n&&!!document.queryCommandSupported(e)})),n}}],r&&a(n.prototype,r),o&&a(n,o),t}(p()),S=k},828:function(e){if("undefined"!=typeof Element&&!Element.prototype.matches){var t=Element.prototype;t.matches=t.matchesSelector||t.mozMatchesSelector||t.msMatchesSelector||t.oMatchesSelector||t.webkitMatchesSelector}e.exports=function(e,t){for(;e&&9!==e.nodeType;){if("function"==typeof e.matches&&e.matches(t))return e;e=e.parentNode}}},438:function(e,t,n){function r(e,t,n,r,i){var a=o.apply(this,arguments);return e.addEventListener(n,a,i),{destroy:function(){e.removeEventListener(n,a,i)}}}function o(e,t,n,r){return function(n){n.delegateTarget=i(n.target,t),n.delegateTarget&&r.call(e,n)}}var i=n(828);e.exports=function(e,t,n,o,i){return"function"==typeof e.addEventListener?r.apply(null,arguments):"function"==typeof n?r.bind(null,document).apply(null,arguments):("string"==typeof e&&(e=document.querySelectorAll(e)),Array.prototype.map.call(e,(function(e){return r(e,t,n,o,i)})))}},879:function(e,t){t.node=function(e){return void 0!==e&&e instanceof HTMLElement&&1===e.nodeType},t.nodeList=function(e){var n=Object.prototype.toString.call(e);return void 0!==e&&("[object NodeList]"===n||"[object HTMLCollection]"===n)&&"length"in e&&(0===e.length||t.node(e[0]))},t.string=function(e){return"string"==typeof e||e instanceof String},t.fn=function(e){return"[object Function]"===Object.prototype.toString.call(e)}},370:function(e,t,n){var r=n(879),o=n(438);e.exports=function(e,t,n){if(!e&&!t&&!n)throw new Error("Missing required arguments");if(!r.string(t))throw new TypeError("Second argument must be a String");if(!r.fn(n))throw new TypeError("Third argument must be a Function");if(r.node(e))return function(e,t,n){return e.addEventListener(t,n),{destroy:function(){e.removeEventListener(t,n)}}}(e,t,n);if(r.nodeList(e))return function(e,t,n){return Array.prototype.forEach.call(e,(function(e){e.addEventListener(t,n)})),{destroy:function(){Array.prototype.forEach.call(e,(function(e){e.removeEventListener(t,n)}))}}}(e,t,n);if(r.string(e))return function(e,t,n){return o(document.body,e,t,n)}(e,t,n);throw new TypeError("First argument must be a String, HTMLElement, HTMLCollection, or NodeList")}},817:function(e){e.exports=function(e){var t;if("SELECT"===e.nodeName)e.focus(),t=e.value;else if("INPUT"===e.nodeName||"TEXTAREA"===e.nodeName){var n=e.hasAttribute("readonly");n||e.setAttribute("readonly",""),e.select(),e.setSelectionRange(0,e.value.length),n||e.removeAttribute("readonly"),t=e.value}else{e.hasAttribute("contenteditable")&&e.focus();var r=window.getSelection(),o=document.createRange();o.selectNodeContents(e),r.removeAllRanges(),r.addRange(o),t=r.toString()}return t}},279:function(e){function t(){}t.prototype={on:function(e,t,n){var r=this.e||(this.e={});return(r[e]||(r[e]=[])).push({fn:t,ctx:n}),this},once:function(e,t,n){function r(){o.off(e,r),t.apply(n,arguments)}var o=this;return r._=t,this.on(e,r,n)},emit:function(e){for(var t=[].slice.call(arguments,1),n=((this.e||(this.e={}))[e]||[]).slice(),r=0,o=n.length;r{"use strict";function r(e,t){for(var n in t)e[n]=t[n];return e}function o(e,t){for(var n in e)if("__source"!==n&&!(n in t))return!0;for(var r in t)if("__source"!==r&&e[r]!==t[r])return!0;return!1}function i(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t}function a(e){this.props=e}function l(e,t){function n(e){var n=this.props.ref,r=n==e.ref;return!r&&n&&(n.call?n(null):n.current=null),t?!t(this.props,e)||!r:o(this.props,e)}function r(t){return this.shouldComponentUpdate=n,(0,j.az)(e,t)}return r.displayName="Memo("+(e.displayName||e.name)+")",r.prototype.isReactComponent=!0,r.__f=!0,r}function u(e){function t(t){var n=r({},t);return delete n.ref,e(n,t.ref||null)}return t.$$typeof=T,t.render=t,t.prototype.isReactComponent=t.__f=!0,t.displayName="ForwardRef("+(e.displayName||e.name)+")",t}function s(e,t,n){return e&&(e.__c&&e.__c.__H&&(e.__c.__H.__.forEach((function(e){"function"==typeof e.__c&&e.__c()})),e.__c.__H=null),null!=(e=r({},e)).__c&&(e.__c.__P===n&&(e.__c.__P=t),e.__c=null),e.__k=e.__k&&e.__k.map((function(e){return s(e,t,n)}))),e}function c(e,t,n){return e&&(e.__v=null,e.__k=e.__k&&e.__k.map((function(e){return c(e,t,n)})),e.__c&&e.__c.__P===t&&(e.__e&&n.insertBefore(e.__e,e.__d),e.__c.__e=!0,e.__c.__P=n)),e}function f(){this.__u=0,this.t=null,this.__b=null}function _(e){var t=e.__.__c;return t&&t.__a&&t.__a(e)}function p(e){function t(t){if(n||(n=e()).then((function(e){r=e.default||e}),(function(e){o=e})),o)throw o;if(!r)throw n;return(0,j.az)(r,t)}var n,r,o;return t.displayName="Lazy",t.__f=!0,t}function d(){this.u=null,this.o=null}function h(e){return this.getChildContext=function(){return e.context},e.children}function y(e){var t=this,n=e.i;t.componentWillUnmount=function(){(0,j.sY)(null,t.l),t.l=null,t.i=null},t.i&&t.i!==n&&t.componentWillUnmount(),e.__v?(t.l||(t.i=n,t.l={nodeType:1,parentNode:n,childNodes:[],appendChild:function(e){this.childNodes.push(e),t.i.appendChild(e)},insertBefore:function(e){this.childNodes.push(e),t.i.appendChild(e)},removeChild:function(e){this.childNodes.splice(this.childNodes.indexOf(e)>>>1,1),t.i.removeChild(e)}}),(0,j.sY)((0,j.az)(h,{context:t.context},e.__v),t.l)):t.l&&t.componentWillUnmount()}function v(e,t){var n=(0,j.az)(y,{__v:e,i:t});return n.containerInfo=t,n}function m(e,t,n){return null==t.__k&&(t.textContent=""),(0,j.sY)(e,t),"function"==typeof n&&n(),e?e.__c:null}function g(e,t,n){return(0,j.ZB)(e,t),"function"==typeof n&&n(),e?e.__c:null}function b(){}function w(){return this.cancelBubble}function k(){return this.defaultPrevented}function S(e){return j.az.bind(null,e)}function x(e){return!!e&&e.$$typeof===z}function C(e){return x(e)?j.Tm.apply(null,arguments):e}function E(e){return!!e.__k&&((0,j.sY)(null,e),!0)}function O(e){return e&&(e.base||1===e.nodeType&&e)||null}function P(e){e()}function N(e){return e}function A(){return[!1,P]}function $(e,t){var n=t(),r=(0,L.eJ)({h:{__:n,v:t}}),o=r[0].h,a=r[1];return(0,L.bt)((function(){o.__=n,o.v=t,i(o.__,t())||a({h:o})}),[e,n,t]),(0,L.d4)((function(){return i(o.__,o.v())||a({h:o}),e((function(){i(o.__,o.v())||a({h:o})}))}),[e]),n}n.r(t),n.d(t,{Children:()=>R,Component:()=>j.wA,Fragment:()=>j.HY,PureComponent:()=>a,StrictMode:()=>ee,Suspense:()=>f,SuspenseList:()=>d,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:()=>G,cloneElement:()=>C,createContext:()=>j.kr,createElement:()=>j.az,createFactory:()=>S,createPortal:()=>v,createRef:()=>j.Vf,default:()=>ne,findDOMNode:()=>O,flushSync:()=>X,forwardRef:()=>u,hydrate:()=>g,isValidElement:()=>x,lazy:()=>p,memo:()=>l,render:()=>m,startTransition:()=>P,unmountComponentAtNode:()=>E,unstable_batchedUpdates:()=>Q,useCallback:()=>L.I4,useContext:()=>L.qp,useDebugValue:()=>L.Qb,useDeferredValue:()=>N,useEffect:()=>L.d4,useErrorBoundary:()=>L.cO,useId:()=>L.Me,useImperativeHandle:()=>L.aP,useInsertionEffect:()=>te,useLayoutEffect:()=>L.bt,useMemo:()=>L.Ye,useReducer:()=>L._Y,useRef:()=>L.sO,useState:()=>L.eJ,useSyncExternalStore:()=>$,useTransition:()=>A,version:()=>Z});var j=n(400),L=n(396);(a.prototype=new j.wA).isPureReactComponent=!0,a.prototype.shouldComponentUpdate=function(e,t){return o(this.props,e)||o(this.state,t)};var M=j.YM.__b;j.YM.__b=function(e){e.type&&e.type.__f&&e.ref&&(e.props.ref=e.ref,e.ref=null),M&&M(e)};var T="undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.forward_ref")||3911,I=function(e,t){return null==e?null:(0,j.bR)((0,j.bR)(e).map(t))},R={map:I,forEach:I,count:function(e){return e?(0,j.bR)(e).length:0},only:function(e){var t=(0,j.bR)(e);if(1!==t.length)throw"Children.only";return t[0]},toArray:j.bR},q=j.YM.__e;j.YM.__e=function(e,t,n,r){if(e.then)for(var o,i=t;i=i.__;)if((o=i.__c)&&o.__c)return null==t.__e&&(t.__e=n.__e,t.__k=n.__k),o.__c(e,t);q(e,t,n,r)};var D=j.YM.unmount;j.YM.unmount=function(e){var t=e.__c;t&&t.__R&&t.__R(),t&&!0===e.__h&&(e.type=null),D&&D(e)},(f.prototype=new j.wA).__c=function(e,t){var n=t.__c,r=this;null==r.t&&(r.t=[]),r.t.push(n);var o=_(r.__v),i=!1,a=function(){i||(i=!0,n.__R=null,o?o(l):l())};n.__R=a;var l=function(){if(!--r.__u){if(r.state.__a){var e=r.state.__a;r.__v.__k[0]=c(e,e.__c.__P,e.__c.__O)}var t;for(r.setState({__a:r.__b=null});t=r.t.pop();)t.forceUpdate()}},u=!0===t.__h;r.__u++||u||r.setState({__a:r.__b=r.__v.__k[0]}),e.then(a,a)},f.prototype.componentWillUnmount=function(){this.t=[]},f.prototype.render=function(e,t){if(this.__b){if(this.__v.__k){var n=document.createElement("div"),r=this.__v.__k[0].__c;this.__v.__k[0]=s(this.__b,n,r.__O=r.__P)}this.__b=null}var o=t.__a&&(0,j.az)(j.HY,null,e.fallback);return o&&(o.__h=null),[(0,j.az)(j.HY,null,t.__a?null:e.children),o]};var H=function(e,t,n){if(++n[1]===n[0]&&e.o.delete(t),e.props.revealOrder&&("t"!==e.props.revealOrder[0]||!e.o.size))for(n=e.u;n;){for(;n.length>3;)n.pop()();if(n[1]{"use strict";function r(e,t){for(var n in t)e[n]=t[n];return e}function o(e){var t=e.parentNode;t&&t.removeChild(e)}function i(e,t,n){var r,o,i,l={};for(i in t)"key"==i?r=t[i]:"ref"==i?o=t[i]:l[i]=t[i];if(arguments.length>2&&(l.children=arguments.length>3?M.call(arguments,2):n),"function"==typeof e&&null!=e.defaultProps)for(i in e.defaultProps)void 0===l[i]&&(l[i]=e.defaultProps[i]);return a(e,l,r,o,null)}function a(e,t,n,r,o){var i={type:e,props:t,key:n,ref:r,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:null==o?++I:o};return null==o&&null!=T.vnode&&T.vnode(i),i}function l(){return{current:null}}function u(e){return e.children}function s(e,t,n){"-"===t[0]?e.setProperty(t,null==n?"":n):e[t]=null==n?"":"number"!=typeof n||W.test(t)?n:n+"px"}function c(e,t,n,r,o){var i;e:if("style"===t)if("string"==typeof n)e.style.cssText=n;else{if("string"==typeof r&&(e.style.cssText=r=""),r)for(t in r)n&&t in n||s(e.style,t,"");if(n)for(t in n)r&&n[t]===r[t]||s(e.style,t,n[t])}else if("o"===t[0]&&"n"===t[1])i=t!==(t=t.replace(/Capture$/,"")),t=t.toLowerCase()in e?t.toLowerCase().slice(2):t.slice(2),e.l||(e.l={}),e.l[t+i]=n,n?r||e.addEventListener(t,i?_:f,i):e.removeEventListener(t,i?_:f,i);else if("dangerouslySetInnerHTML"!==t){if(o)t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("width"!==t&&"height"!==t&&"href"!==t&&"list"!==t&&"form"!==t&&"tabIndex"!==t&&"download"!==t&&t in e)try{e[t]=null==n?"":n;break e}catch(e){}"function"==typeof n||(null==n||!1===n&&-1==t.indexOf("-")?e.removeAttribute(t):e.setAttribute(t,n))}}function f(e){R=!0;try{return this.l[e.type+!1](T.event?T.event(e):e)}finally{R=!1}}function _(e){R=!0;try{return this.l[e.type+!0](T.event?T.event(e):e)}finally{R=!1}}function p(e,t){this.props=e,this.context=t}function d(e,t){if(null==t)return e.__?d(e.__,e.__.__k.indexOf(e)+1):null;for(var n;tt&&q.sort((function(e,t){return e.__v.__b-t.__v.__b})));m.__r=0}function g(e,t,n,r,o,i,l,s,c,f){var _,p,h,y,v,m,g,w=r&&r.__k||U,C=w.length;for(n.__k=[],_=0;_0?a(y.type,y.props,y.key,y.ref?y.ref:null,y.__v):y)){if(y.__=n,y.__b=n.__b+1,null===(h=w[_])||h&&y.key==h.key&&y.type===h.type)w[_]=void 0;else for(p=0;p=0;t--)if((n=e.__k[t])&&(r=S(n)))return r;return null}function x(e,t,n,o,i,a,l,s,c){var f,_,d,h,y,v,m,b,w,k,S,x,C,O,P,A=t.type;if(void 0!==t.constructor)return null;null!=n.__h&&(c=n.__h,s=t.__e=n.__e,t.__h=null,a=[s]),(f=T.__b)&&f(t);try{e:if("function"==typeof A){if(b=t.props,w=(f=A.contextType)&&o[f.__c],k=f?w?w.props.value:f.__:o,n.__c?m=(_=t.__c=n.__c).__=_.__E:("prototype"in A&&A.prototype.render?t.__c=_=new A(b,k):(t.__c=_=new p(b,k),_.constructor=A,_.render=N),w&&w.sub(_),_.props=b,_.state||(_.state={}),_.context=k,_.__n=o,d=_.__d=!0,_.__h=[],_._sb=[]),null==_.__s&&(_.__s=_.state),null!=A.getDerivedStateFromProps&&(_.__s==_.state&&(_.__s=r({},_.__s)),r(_.__s,A.getDerivedStateFromProps(b,_.__s))),h=_.props,y=_.state,_.__v=t,d)null==A.getDerivedStateFromProps&&null!=_.componentWillMount&&_.componentWillMount(),null!=_.componentDidMount&&_.__h.push(_.componentDidMount);else{if(null==A.getDerivedStateFromProps&&b!==h&&null!=_.componentWillReceiveProps&&_.componentWillReceiveProps(b,k),!_.__e&&null!=_.shouldComponentUpdate&&!1===_.shouldComponentUpdate(b,_.__s,k)||t.__v===n.__v){for(t.__v!==n.__v&&(_.props=b,_.state=_.__s,_.__d=!1),t.__e=n.__e,t.__k=n.__k,t.__k.forEach((function(e){e&&(e.__=t)})),S=0;S<_._sb.length;S++)_.__h.push(_._sb[S]);_._sb=[],_.__h.length&&l.push(_);break e}null!=_.componentWillUpdate&&_.componentWillUpdate(b,_.__s,k),null!=_.componentDidUpdate&&_.__h.push((function(){_.componentDidUpdate(h,y,v)}))}if(_.context=k,_.props=b,_.__P=e,x=T.__r,C=0,"prototype"in A&&A.prototype.render){for(_.state=_.__s,_.__d=!1,x&&x(t),f=_.render(_.props,_.state,_.context),O=0;O<_._sb.length;O++)_.__h.push(_._sb[O]);_._sb=[]}else do{_.__d=!1,x&&x(t),f=_.render(_.props,_.state,_.context),_.state=_.__s}while(_.__d&&++C<25);_.state=_.__s,null!=_.getChildContext&&(o=r(r({},o),_.getChildContext())),d||null==_.getSnapshotBeforeUpdate||(v=_.getSnapshotBeforeUpdate(h,y)),P=null!=f&&f.type===u&&null==f.key?f.props.children:f,g(e,Array.isArray(P)?P:[P],t,n,o,i,a,l,s,c),_.base=t.__e,t.__h=null,_.__h.length&&l.push(_),m&&(_.__E=_.__=null),_.__e=!1}else null==a&&t.__v===n.__v?(t.__k=n.__k,t.__e=n.__e):t.__e=E(n.__e,t,n,o,i,a,l,c);(f=T.diffed)&&f(t)}catch(e){t.__v=null,(c||null!=a)&&(t.__e=s,t.__h=!!c,a[a.indexOf(s)]=null),T.__e(e,t,n)}}function C(e,t){T.__c&&T.__c(t,e),e.some((function(t){try{e=t.__h,t.__h=[],e.some((function(e){e.call(t)}))}catch(e){T.__e(e,t.__v)}}))}function E(e,t,n,r,i,a,l,u){var s,f,_,p=n.props,h=t.props,y=t.type,v=0;if("svg"===y&&(i=!0),null!=a)for(;v2&&(u.children=arguments.length>3?M.call(arguments,2):n),a(e.type,u,o||e.key,i||e.ref,null)}function L(e,t){var n={__c:t="__cC"+z++,__:e,Consumer:function(e,t){return e.children(t)},Provider:function(e){var n,r;return this.getChildContext||(n=[],(r={})[t]=this,this.getChildContext=function(){return r},this.shouldComponentUpdate=function(e){this.props.value!==e.value&&n.some((function(e){e.__e=!0,v(e)}))},this.sub=function(e){n.push(e);var t=e.componentWillUnmount;e.componentWillUnmount=function(){n.splice(n.indexOf(e),1),t&&t.call(e)}}),e.children}};return n.Provider.__=n.Consumer.contextType=n}n.d(t,{HY:()=>u,Tm:()=>j,Vf:()=>l,YM:()=>T,ZB:()=>$,az:()=>i,bR:()=>w,h:()=>i,kr:()=>L,sY:()=>A,wA:()=>p});var M,T,I,R,q,D,H,z,Y={},U=[],W=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i;M=U.slice,T={__e:function(e,t,n,r){for(var o,i,a;t=t.__;)if((o=t.__c)&&!o.__)try{if((i=o.constructor)&&null!=i.getDerivedStateFromError&&(o.setState(i.getDerivedStateFromError(e)),a=o.__d),null!=o.componentDidCatch&&(o.componentDidCatch(e,r||{}),a=o.__d),a)return o.__E=o}catch(t){e=t}throw e}},I=0,R=!1,p.prototype.setState=function(e,t){var n;n=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=r({},this.state),"function"==typeof e&&(e=e(r({},n),this.props)),e&&r(n,e),null!=e&&this.__v&&(t&&this._sb.push(t),v(this))},p.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),v(this))},p.prototype.render=u,q=[],H="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,m.__r=0,z=0},396:(e,t,n)=>{"use strict";function r(e,t){E.YM.__h&&E.YM.__h(S,e,O||t),O=0;var n=S.__H||(S.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({__V:N}),n.__[e]}function o(e){return O=1,i(w,e)}function i(e,t,n){var o=r(k++,2);if(o.t=e,!o.__c&&(o.__=[n?n(t):w(void 0,t),function(e){var t=o.__N?o.__N[0]:o.__[0],n=o.t(t,e);t!==n&&(o.__N=[n,o.__[1]],o.__c.setState({}))}],o.__c=S,!S.u)){S.u=!0;var i=S.shouldComponentUpdate;S.shouldComponentUpdate=function(e,t,n){if(!o.__c.__H)return!0;var r=o.__c.__H.__.filter((function(e){return e.__c}));if(r.every((function(e){return!e.__N})))return!i||i.call(this,e,t,n);var a=!1;return r.forEach((function(e){if(e.__N){var t=e.__[0];e.__=e.__N,e.__N=void 0,t!==e.__[0]&&(a=!0)}})),!(!a&&o.__c.props===e)&&(!i||i.call(this,e,t,n))}}return o.__N||o.__}function a(e,t){var n=r(k++,3);!E.YM.__s&&b(n.__H,t)&&(n.__=e,n.i=t,S.__H.__h.push(n))}function l(e,t){var n=r(k++,4);!E.YM.__s&&b(n.__H,t)&&(n.__=e,n.i=t,S.__h.push(n))}function u(e){return O=5,c((function(){return{current:e}}),[])}function s(e,t,n){O=6,l((function(){return"function"==typeof e?(e(t()),function(){return e(null)}):e?(e.current=t(),function(){return e.current=null}):void 0}),null==n?n:n.concat(e))}function c(e,t){var n=r(k++,7);return b(n.__H,t)?(n.__V=e(),n.i=t,n.__h=e,n.__V):n.__}function f(e,t){return O=8,c((function(){return e}),t)}function _(e){var t=S.context[e.__c],n=r(k++,9);return n.c=e,t?(null==n.__&&(n.__=!0,t.sub(S)),t.props.value):e.__}function p(e,t){E.YM.useDebugValue&&E.YM.useDebugValue(t?t(e):e)}function d(e){var t=r(k++,10),n=o();return t.__=e,S.componentDidCatch||(S.componentDidCatch=function(e,r){t.__&&t.__(e,r),n[1](e)}),[n[0],function(){n[1](void 0)}]}function h(){var e=r(k++,11);if(!e.__){for(var t=S.__v;null!==t&&!t.__m&&null!==t.__;)t=t.__;var n=t.__m||(t.__m=[0,0]);e.__="P"+n[0]+"-"+n[1]++}return e.__}function y(){for(var e;e=P.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(m),e.__H.__h.forEach(g),e.__H.__h=[]}catch(t){e.__H.__h=[],E.YM.__e(t,e.__v)}}function v(e){var t,n=function(){clearTimeout(r),T&&cancelAnimationFrame(t),setTimeout(e)},r=setTimeout(n,100);T&&(t=requestAnimationFrame(n))}function m(e){var t=S,n=e.__c;"function"==typeof n&&(e.__c=void 0,n()),S=t}function g(e){var t=S;e.__c=e.__(),S=t}function b(e,t){return!e||e.length!==t.length||t.some((function(t,n){return t!==e[n]}))}function w(e,t){return"function"==typeof t?t(e):t}n.d(t,{I4:()=>f,Me:()=>h,Qb:()=>p,Ye:()=>c,_Y:()=>i,aP:()=>s,bt:()=>l,cO:()=>d,d4:()=>a,eJ:()=>o,qp:()=>_,sO:()=>u});var k,S,x,C,E=n(400),O=0,P=[],N=[],A=E.YM.__b,$=E.YM.__r,j=E.YM.diffed,L=E.YM.__c,M=E.YM.unmount;E.YM.__b=function(e){S=null,A&&A(e)},E.YM.__r=function(e){$&&$(e),k=0;var t=(S=e.__c).__H;t&&(x===S?(t.__h=[],S.__h=[],t.__.forEach((function(e){e.__N&&(e.__=e.__N),e.__V=N,e.__N=e.i=void 0}))):(t.__h.forEach(m),t.__h.forEach(g),t.__h=[])),x=S},E.YM.diffed=function(e){j&&j(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(1!==P.push(t)&&C===E.YM.requestAnimationFrame||((C=E.YM.requestAnimationFrame)||v)(y)),t.__H.__.forEach((function(e){e.i&&(e.__H=e.i),e.__V!==N&&(e.__=e.__V),e.i=void 0,e.__V=N}))),x=S=null},E.YM.__c=function(e,t){t.some((function(e){try{e.__h.forEach(m),e.__h=e.__h.filter((function(e){return!e.__||g(e)}))}catch(n){t.some((function(e){e.__h&&(e.__h=[])})),t=[],E.YM.__e(n,e.__v)}})),L&&L(e,t)},E.YM.unmount=function(e){M&&M(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.forEach((function(e){try{m(e)}catch(e){t=e}})),n.__H=void 0,t&&E.YM.__e(t,n.__v))};var T="function"==typeof requestAnimationFrame},325:(e,t,n)=>{var r=function(e){function t(e,t,n,r){this.type=e,this.content=t,this.alias=n,this.length=0|(r||"").length}function n(e,t,n,r){e.lastIndex=t;var o=e.exec(n);if(o&&r&&o[1]){var i=o[1].length;o.index+=i,o[0]=o[0].slice(i)}return o}function r(e,o,l,u,s,c){for(var _ in l)if(l.hasOwnProperty(_)&&l[_]){var p=l[_];p=Array.isArray(p)?p:[p];for(var d=0;d=c.reach);S+=k.value.length,k=k.next){var x=k.value;if(o.length>e.length)return;if(!(x instanceof t)){var C,E=1;if(m){if(!(C=n(w,S,e,v))||C.index>=e.length)break;var O=C.index,P=C.index+C[0].length,N=S;for(N+=k.value.length;O>=N;)N+=(k=k.next).value.length;if(S=N-=k.value.length,k.value instanceof t)continue;for(var A=k;A!==o.tail&&(Nc.reach&&(c.reach=M);var T=k.prev;if(j&&(T=i(o,T,j),S+=j.length),a(o,T,E),k=i(o,T,new t(_,y?f.tokenize($,y):$,g,$)),L&&i(o,k,L),E>1){var I={cause:_+","+d,reach:M};r(e,o,l,k.prev,S,I),c&&I.reach>c.reach&&(c.reach=I.reach)}}}}}}function o(){var e={value:null,prev:null,next:null},t={value:null,prev:e,next:null};e.next=t,this.head=e,this.tail=t,this.length=0}function i(e,t,n){var r=t.next,o={value:n,prev:t,next:r};return t.next=o,r.prev=o,e.length++,o}function a(e,t,n){for(var r=t.next,o=0;o"+o.content+""},!e.document)return e.addEventListener?(f.disableWorkerMessageHandler||e.addEventListener("message",(function(t){var n=JSON.parse(t.data),r=n.language,o=n.immediateClose;e.postMessage(f.highlight(n.code,f.languages[r],r)),o&&e.close()}),!1),f):f;var _=f.util.currentScript();if(_&&(f.filename=_.src,_.hasAttribute("data-manual")&&(f.manual=!0)),!f.manual){var p=document.readyState;"loading"===p||"interactive"===p&&_&&_.defer?document.addEventListener("DOMContentLoaded",l):window.requestAnimationFrame?window.requestAnimationFrame(l):window.setTimeout(l,16)}return f}("undefined"!=typeof window?window:"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope?self:{});e.exports&&(e.exports=r),void 0!==n.g&&(n.g.Prism=r)},277:()=>{Prism.languages.json={property:{pattern:/(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?=\s*:)/,lookbehind:!0,greedy:!0},string:{pattern:/(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?!\s*:)/,lookbehind:!0,greedy:!0},comment:{pattern:/\/\/.*|\/\*[\s\S]*?(?:\*\/|$)/,greedy:!0},number:/-?\b\d+(?:\.\d+)?(?:e[+-]?\d+)?\b/i,punctuation:/[{}[\],]/,operator:/:/,boolean:/\b(?:false|true)\b/,null:{pattern:/\bnull\b/,alias:"keyword"}},Prism.languages.webmanifest=Prism.languages.json},759:()=>{!function(){function e(e){if(0!=(e=e.filter((function(e){var t=function(e){if(!e)return null;return window.getComputedStyle?getComputedStyle(e):e.currentStyle||null}(e)["white-space"];return"pre-wrap"===t||"pre-line"===t}))).length){var t=e.map((function(e){var t=e.querySelector("code"),r=e.querySelector(".line-numbers-rows");if(t&&r){var o=e.querySelector(".line-numbers-sizer"),i=t.textContent.split(n);o||((o=document.createElement("span")).className="line-numbers-sizer",t.appendChild(o)),o.innerHTML="0",o.style.display="block";var a=o.getBoundingClientRect().height;return o.innerHTML="",{element:e,lines:i,lineHeights:[],oneLinerHeight:a,sizer:o}}})).filter(Boolean);t.forEach((function(e){var t=e.sizer,n=e.lines,r=e.lineHeights,o=e.oneLinerHeight;r[n.length-1]=void 0,n.forEach((function(e,n){if(e&&e.length>1){var i=t.appendChild(document.createElement("span"));i.style.display="block",i.textContent=e}else r[n]=o}))})),t.forEach((function(e){for(var t=e.sizer,n=e.lineHeights,r=0,o=0;oi&&(n=i),r.children[n-o]}}},resize:function(t){e([t])},assumeViewportIndependence:!0},o=void 0;window.addEventListener("resize",(function(){r.assumeViewportIndependence&&o===window.innerWidth||(o=window.innerWidth,e(Array.prototype.slice.call(document.querySelectorAll("pre."+t))))})),Prism.hooks.add("complete",(function(r){if(r.code){var o=r.element,i=o.parentNode;if(i&&/pre/i.test(i.nodeName)&&!o.querySelector(".line-numbers-rows")&&Prism.util.isActive(o,t)){o.classList.remove(t),i.classList.add(t);var a,l=r.code.match(n),u=new Array((l?l.length+1:1)+1).join("");(a=document.createElement("span")).setAttribute("aria-hidden","true"),a.className="line-numbers-rows",a.innerHTML=u,i.hasAttribute("data-start")&&(i.style.counterReset="linenumber "+(parseInt(i.getAttribute("data-start"),10)-1)),r.element.appendChild(a),e([i]),Prism.hooks.run("line-numbers",r)}}})),Prism.hooks.add("line-numbers",(function(e){e.plugins=e.plugins||{},e.plugins.lineNumbers=!0}))}}()},460:function(e,t,n){"use strict";var r,o=this&&this.__extends||(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)},function(e,t){function n(){this.constructor=e}if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),i=this&&this.__assign||function(){return i=Object.assign||function(e){for(var t,n=1,r=arguments.length;n-1){t._history.stack=u.slice(0,s+1);var c=t._history.stack.length;if(c>h){var f=c-h;t._history.stack=u.slice(f,c),t._history.offset=Math.max(t._history.offset-f,0)}}var _=Date.now();if(n){var p=t._history.stack[t._history.offset];if(p&&_-p.timestamp<3e3){var d=/[^a-z0-9]([a-z0-9]+)$/i,y=null===(r=t._getLines(p.value,p.selectionStart).pop())||void 0===r?void 0:r.match(d),v=null===(o=t._getLines(e.value,e.selectionStart).pop())||void 0===o?void 0:o.match(d);if((null==y?void 0:y[1])&&(null===(a=null==v?void 0:v[1])||void 0===a?void 0:a.startsWith(y[1])))return void(t._history.stack[t._history.offset]=i(i({},e),{timestamp:_}))}}t._history.stack.push(i(i({},e),{timestamp:_})),t._history.offset++},t._updateInput=function(e){var n=t._input;n&&(n.value=e.value,n.selectionStart=e.selectionStart,n.selectionEnd=e.selectionEnd,t.props.onValueChange(e.value))},t._applyEdits=function(e){var n=t._input,r=t._history.stack[t._history.offset];r&&n&&(t._history.stack[t._history.offset]=i(i({},r),{selectionStart:n.selectionStart,selectionEnd:n.selectionEnd})),t._recordChange(e),t._updateInput(e)},t._undoEdit=function(){var e=t._history,n=e.offset,r=e.stack[n-1];r&&(t._updateInput(r),t._history.offset=Math.max(n-1,0))},t._redoEdit=function(){var e=t._history,n=e.stack,r=e.offset,o=n[r+1];o&&(t._updateInput(o),t._history.offset=Math.min(r+1,n.length-1))},t._handleKeyDown=function(e){var n=t.props,r=n.tabSize,o=n.insertSpaces,i=n.ignoreTabKey,a=n.onKeyDown;if(!a||(a(e),!e.defaultPrevented)){27===e.keyCode&&e.currentTarget.blur();var l=e.currentTarget,u=l.value,s=l.selectionStart,c=l.selectionEnd,h=(o?" ":"\t").repeat(r);if(9===e.keyCode&&!i&&t.state.capture)if(e.preventDefault(),e.shiftKey){var m=(w=t._getLines(u,s)).length-1,g=t._getLines(u,c).length-1,b=u.split("\n").map((function(e,t){return t>=m&&t<=g&&e.startsWith(h)?e.substring(h.length):e})).join("\n");if(u!==b)t._applyEdits({value:b,selectionStart:(null==(x=w[m])?void 0:x.startsWith(h))?s-h.length:s,selectionEnd:c-(u.length-b.length)})}else if(s!==c){var w,k=(w=t._getLines(u,s)).length-1,S=t._getLines(u,c).length-1,x=w[k];t._applyEdits({value:u.split("\n").map((function(e,t){return t>=k&&t<=S?h+e:e})).join("\n"),selectionStart:x&&/\S/.test(x)?s+h.length:s,selectionEnd:c+h.length*(S-k+1)})}else{var C=s+h.length;t._applyEdits({value:u.substring(0,s)+h+u.substring(c),selectionStart:C,selectionEnd:C})}else if(8===e.keyCode){var E=s!==c;if(u.substring(0,s).endsWith(h)&&!E){e.preventDefault();C=s-h.length;t._applyEdits({value:u.substring(0,s-h.length)+u.substring(c),selectionStart:C,selectionEnd:C})}}else if(13===e.keyCode){if(s===c){var O=t._getLines(u,s).pop(),P=null==O?void 0:O.match(/^\s+/);if(null==P?void 0:P[0]){e.preventDefault();var N="\n"+P[0];C=s+N.length;t._applyEdits({value:u.substring(0,s)+N+u.substring(c),selectionStart:C,selectionEnd:C})}}}else if(57===e.keyCode||e.keyCode===_||e.keyCode===p||e.keyCode===d){var A=void 0;57===e.keyCode&&e.shiftKey?A=["(",")"]:e.keyCode===_?A=e.shiftKey?["{","}"]:["[","]"]:e.keyCode===p?A=e.shiftKey?['"','"']:["'","'"]:e.keyCode!==d||e.shiftKey||(A=["`","`"]),s!==c&&A&&(e.preventDefault(),t._applyEdits({value:u.substring(0,s)+A[0]+u.substring(s,c)+A[1]+u.substring(c),selectionStart:s,selectionEnd:c+2}))}else!(v?e.metaKey&&e.keyCode===f:e.ctrlKey&&e.keyCode===f)||e.shiftKey||e.altKey?(v?e.metaKey&&e.keyCode===f&&e.shiftKey:y?e.ctrlKey&&89===e.keyCode:e.ctrlKey&&e.keyCode===f&&e.shiftKey)&&!e.altKey?(e.preventDefault(),t._redoEdit()):77!==e.keyCode||!e.ctrlKey||v&&!e.shiftKey||(e.preventDefault(),t.setState((function(e){return{capture:!e.capture}}))):(e.preventDefault(),t._undoEdit())}},t._handleChange=function(e){var n=e.currentTarget,r=n.value;t._recordChange({value:r,selectionStart:n.selectionStart,selectionEnd:n.selectionEnd},!0),t.props.onValueChange(r)},t._history={stack:[],offset:-1},t._input=null,t}return o(t,e),t.prototype.componentDidMount=function(){this._recordCurrentState()},Object.defineProperty(t.prototype,"session",{get:function(){return{history:this._history}},set:function(e){this._history=e.history},enumerable:!1,configurable:!0}),t.prototype.render=function(){var e=this,t=this.props,n=t.value,r=t.style,o=t.padding,a=t.highlight,l=t.textareaId,u=t.textareaClassName,f=t.autoFocus,_=t.disabled,p=t.form,d=t.maxLength,h=t.minLength,y=t.name,v=t.placeholder,b=t.readOnly,k=t.required,S=t.onClick,x=t.onFocus,C=t.onBlur,E=t.onKeyUp,O=t.preClassName,P=s(t,["value","style","padding","highlight","textareaId","textareaClassName","autoFocus","disabled","form","maxLength","minLength","name","placeholder","readOnly","required","onClick","onFocus","onBlur","onKeyUp","onKeyDown","onValueChange","tabSize","insertSpaces","ignoreTabKey","preClassName"]),N={paddingTop:o,paddingRight:o,paddingBottom:o,paddingLeft:o},A=a(n);return c.createElement("div",i({},P,{style:i(i({},w.container),r)}),c.createElement("textarea",{ref:function(t){return e._input=t},style:i(i(i({},w.editor),w.textarea),N),className:m+(u?" ".concat(u):""),id:l,value:n,onChange:this._handleChange,onKeyDown:this._handleKeyDown,onClick:S,onKeyUp:E,onFocus:x,onBlur:C,disabled:_,form:p,maxLength:d,minLength:h,name:y,placeholder:v,readOnly:b,required:k,autoFocus:f,autoCapitalize:"off",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"data-gramm":!1}),c.createElement("pre",i({className:O,"aria-hidden":"true",style:i(i(i({},w.editor),w.highlight),N)},"string"==typeof A?{dangerouslySetInnerHTML:{__html:A+"
"}}:{children:A})),c.createElement("style",{type:"text/css",dangerouslySetInnerHTML:{__html:g}}))},t.defaultProps={tabSize:2,insertSpaces:!0,ignoreTabKey:!1,padding:0},t}(c.Component);t.default=b;var w={container:{position:"relative",textAlign:"left",boxSizing:"border-box",padding:0,overflow:"hidden"},textarea:{position:"absolute",top:0,left:0,height:"100%",width:"100%",resize:"none",color:"inherit",overflow:"hidden",MozOsxFontSmoothing:"grayscale",WebkitFontSmoothing:"antialiased",WebkitTextFillColor:"transparent"},highlight:{position:"relative",pointerEvents:"none"},editor:{margin:0,border:0,background:"none",boxSizing:"inherit",display:"inherit",fontFamily:"inherit",fontSize:"inherit",fontStyle:"inherit",fontVariantLigatures:"inherit",fontWeight:"inherit",letterSpacing:"inherit",lineHeight:"inherit",tabSize:"inherit",textIndent:"inherit",textRendering:"inherit",textTransform:"inherit",whiteSpace:"pre-wrap",wordBreak:"keep-all",overflowWrap:"break-word"}}}},n={};e.n=t=>{var n=t&&t.__esModule?()=>t.default:()=>t;return e.d(n,{a:n}),n},e.d=(t,n)=>{for(var r in n)e.o(n,r)&&!e.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:n[r]})},e.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),e.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),e.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},e.p="/",(()=>{"use strict";function t(e){return t="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},t(e)}function n(e,n,r){return(n=function(e){var n=function(e,n){if("object"!==t(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var o=r.call(e,n||"default");if("object"!==t(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===n?String:Number)(e)}(e,"string");return"symbol"===t(n)?n:String(n)}(n))in e?Object.defineProperty(e,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[n]=r,e}function r(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,a,l=[],u=!0,s=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;u=!1}else for(;!(u=(r=i.call(n)).done)&&(l.push(r.value),l.length!==t);u=!0);}catch(e){s=!0,o=e}finally{try{if(!u&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(s)throw o}}return l}}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return o(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return o(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function o(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",r=yield fetch(e,{method:"POST",credentials:"same-origin",headers:{"Content-Type":"application/json","X-WP-Nonce":n},body:JSON.stringify(t)});return r.json()})),u.apply(this,arguments)}function s(e){return s="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},s(e)}function c(e,t,n){return(t=function(e){var t=function(e,t){if("object"!==s(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==s(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===s(t)?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function f(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,a,l=[],u=!0,s=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;u=!1}else for(;!(u=(r=i.call(n)).done)&&(l.push(r.value),l.length!==t);u=!0);}catch(e){s=!0,o=e}finally{try{if(!u&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(s)throw o}}return l}}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return _(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return _(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function _(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);ne.length)&&(t=e.length);for(var n=0,r=new Array(t);ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n2?"+ ".concat(O()("other",p-2,!0)):"";return(0,g.h)("div",{className:N()((t={},n(t,A.info_block,!0),n(t,A.info_block_collapsible,l.collapsible||!1),n(t,A.info_block_collapsed,s),t))},(0,g.h)("h5",{className:A.info_label,onClick:f},o),l.collapsible?(0,g.h)($,null,(0,g.h)("div",{className:N()(n({},A.info_block_inner,!0))},_?i.map((function(e){return(0,g.h)("span",{key:e,className:A.info_block_item},e)})):(0,g.h)("span",null,i)),(0,g.h)("span",{className:A.info_block_teaser,onClick:f},_?" ".concat(i.slice(0,2).join(", ")," ").concat(d):"Click to show")):(0,g.h)("span",null,_?i.join(", "):i))},M=e(325),T=(e(759),e(277),e(460)),I=e.n(T),R=e(152),q=e.n(R);const D="collapsible_list__PJS0Z",H="collapsible_list_details__u5Pq3",z="visible__M2eJW";var Y=function(e){var t,n=e.list,r=void 0===n?[]:n,o=e.title,i=void 0===o?"View":o,a=f((0,b.eJ)(!1),2),l=a[0],u=a[1],s=i.toLowerCase();return(0,g.h)("div",{className:N()((t={},c(t,D,!0),c(t,z,l),t))},(0,g.h)("strong",{className:"".concat(s," vip-h4"),onClick:r.length?function(){u(!l)}:null},i," (","".concat(r.length),")"),(0,g.h)("ol",{className:"".concat(H," ").concat(s," vip-collapse-ol")},r.map((function(e,t){return(0,g.h)("li",{key:t},e)}))))};const U="query_wrap__uIeve",W="query_result__k_RWY",V="query_actions__ImK9_",F="query_handle__e0c8G",K="query_collapsed__PGXWS",B="grid_container__esEnb",J="query_src_header__wWAup",G="query_res_header__DMOpO",Z="query_src__MoJsW",Q="query_res__FZmqB",X="query_src_extra__aZwxj",ee="container_editor___Y1qC",te="container_editor_line_number__FU7Ow";var ne=e(400).HY,re=function(e){var t,n,r,o,i=e.request,a=e.url,l=e.query_args,s=e.backtrace,c=void 0===s?[]:s,f=JSON.stringify(e.args.body,null,2),_=JSON.stringify(i.body,null,2),y={editing:!1,query:f,result:_,collapsed:!0},v=h((0,b.eJ)(y),2),m=v[0],w=v[1],k="#query-response-copy-handle",S=(0,b.I4)(function(){var e,t=(e=function*(e){try{var t=yield function(){return u.apply(this,arguments)}(window.VIPSearchDevTools.ajaxurl,{action:window.VIPSearchDevTools.action,url:a,query:e},window.VIPSearchDevTools.nonce);w((function(e){var n;return p({},e,{result:JSON.stringify(null==t||null===(n=t.result)||void 0===n?void 0:n.body,null,2)})}))}catch(e){console.log(e)}},function(){var t=this,n=arguments;return new Promise((function(r,o){function i(e){d(l,r,o,i,a,"next",e)}function a(e){d(l,r,o,i,a,"throw",e)}var l=e.apply(t,n);i(void 0)}))});return function(e){return t.apply(this,arguments)}}(),[a]);(0,b.d4)((function(){var e=new(q())(k);return e.on("success",(function(e){document.querySelector(k).innerHTML="COPIED!",setTimeout((function(){document.querySelector(k).innerHTML="COPY"}),2e3),e.clearSelection()})),function(){return e.destroy()}}),[]),(0,b.d4)((function(){m.query!==y.query&&(m.editing||S(m.query))}),[m.query,m.editing,y.query,S]);var x;return(0,g.h)("div",{className:N()(U,m.collapsed?K:null)},(0,g.h)("div",{className:F,onClick:function(){return w(p({},m,{collapsed:!m.collapsed}))}},(0,g.h)("h3",{className:"vip-h3"},O()("result",(null==i||null===(t=i.body)||void 0===t||null===(n=t.hits)||void 0===n||null===(r=n.hits)||void 0===r?void 0:r.length)||0,!0),(0,g.h)("span",{style:"color: var(--vip-grey-60);"}," that took")," ",(0,g.h)("span",{style:{color:"var(--vip-".concat((x=i.body.took)<200?"green-60":x<500?"red-30":"red-60",")"),fontWeight:"bold"}},x,"ms"),(0,g.h)("small",null," (",(null==i||null===(o=i.response)||void 0===o?void 0:o.code)||"unknown",")"))),(0,g.h)("div",{className:B},(0,g.h)("div",{className:J},(0,g.h)("span",{style:"margin-right: auto;"},"Request"),(0,g.h)("div",{className:X},(0,g.h)(Y,{title:"WP_Query",list:Object.entries(l).map((function(e){var t=h(e,2),n=t[1];return"".concat(t[0],": ").concat(JSON.stringify(n))}))}),(0,g.h)(Y,{title:"Trace",list:c}))),(0,g.h)("div",{className:G},"Response"),(0,g.h)("div",{className:"".concat(Z," query-src-box")},(0,g.h)("div",{className:V},m.editing||m.result!==_?(0,g.h)(ne,null,(0,g.h)("button",{onClick:function(){return w(p({},m,{editing:!1}))},style:"background-color: var(--vip-green-40) !important"},"RUN"),(0,g.h)("button",{onClick:function(){return w(p({},y,{collapsed:!1}))},style:"background-color: var(--vip-blue-10) !important"},"RESET")):"Edit me!"),(0,g.h)(I(),{value:m.query,onValueChange:function(e){return w(p({},m,{query:e,editing:!0}))},highlight:function(e){return(0,M.highlight)(e,M.languages.json,"json").split("\n").map((function(e){return'').concat(e,"")})).join("\n")},padding:0,className:ee,style:{fontSize:"var(--vip-sdt-editor-font-size)",lineHeight:"1.2em"}})),(0,g.h)("div",{className:"".concat(Q," query-result-box")},(0,g.h)("div",{className:W},(0,g.h)("div",{className:V},(0,g.h)("button",{id:"query-response-copy-handle","data-clipboard-target":"#query-response-text"},"COPY")),(0,g.h)("pre",{className:"line-numbers"},(0,g.h)("code",{className:"language-json",id:"query-response-text"},m.result))))))},oe=function(){var e=(0,b.qp)(C).queries;return(0,g.h)("div",null,e.length<1?"No queries to show":e.map((function(e,t){return(0,g.h)(re,p({key:t},e))})))},ie=function(e){var t=(0,b.qp)(C).queries;return(0,g.h)("button",e,"Search: ",O()("query",t.length,!0))};const ae=function(){var e,t=v((0,b.eJ)(!1),2),n=t[0],r=t[1],o=(0,b.I4)((function(){return r(!1)}),[]),i=(0,b.I4)((function(){return r(!n)}),[n]);return(0,g.h)(C.Provider,{value:(null===(e=window)||void 0===e?void 0:e.VIPSearchDevTools)||{status:"disabled",queries:[],information:[]}},(0,g.h)("div",{className:"search-dev-tools__wrapper"},(0,g.h)(ie,{class:S,onClick:i}),(0,w.createPortal)((0,g.h)(x,{isVisible:n,closeOverlay:o,opacity:"100"},(0,g.h)("div",{className:k},(0,g.h)("h4",{className:"vip-h4 main_caption"},"Enterprise Search Dev Tools"),(0,g.h)(j,null),(0,g.h)(oe,null))),document.getElementById("search-dev-tools-portal"))))};var le=function(){return(0,g.sY)((0,g.h)(ae,null),document.querySelector('[data-widget-host="vip-search-dev-tools"]'))};"loading"===document.readyState?document.addEventListener("DOMContentLoaded",le):le()})()})(); \ No newline at end of file +(()=>{function e(r){var o=n[r];if(void 0!==o)return o.exports;var i=n[r]={exports:{}};return t[r].call(i.exports,i,i.exports,e),i.exports}var t={798:(e,t,n)=>{n.p=window.VIPSearchDevTools.__webpack_public_path__},184:(e,t)=>{var n;!function(){"use strict";function r(){for(var e=[],t=0;t1&&void 0!==arguments[1]?arguments[1]:{container:document.body},n="";return"string"==typeof e?n=g(e,t):e instanceof HTMLInputElement&&!["text","search","url","tel","password"].includes(null==e?void 0:e.type)?n=g(e.value,t):(n=y()(e),r("copy")),n},w=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.action,n=void 0===t?"copy":t,r=e.container,i=e.target,a=e.text;if("copy"!==n&&"cut"!==n)throw new Error('Invalid "action" value, use either "copy" or "cut"');if(void 0!==i){if(!i||"object"!==o(i)||1!==i.nodeType)throw new Error('Invalid "target" value, use a valid Element');if("copy"===n&&i.hasAttribute("disabled"))throw new Error('Invalid "target" attribute. Please use "readonly" instead of "disabled" attribute');if("cut"===n&&(i.hasAttribute("readonly")||i.hasAttribute("disabled")))throw new Error('Invalid "target" attribute. You can\'t cut text from elements with "readonly" or "disabled" attributes')}return a?b(a,{container:r}):i?"cut"===n?m(i):b(i,{container:r}):void 0},k=function(e){function t(e,t){var n;return(n=s.call(this)).resolveOptions(t),n.listenClick(e),n}!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&l(e,t)}(t,e);var n,r,o,s=u(t);return n=t,r=[{key:"resolveOptions",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.action="function"==typeof e.action?e.action:this.defaultAction,this.target="function"==typeof e.target?e.target:this.defaultTarget,this.text="function"==typeof e.text?e.text:this.defaultText,this.container="object"===i(e.container)?e.container:document.body}},{key:"listenClick",value:function(e){var t=this;this.listener=h()(e,"click",(function(e){return t.onClick(e)}))}},{key:"onClick",value:function(e){var t=e.delegateTarget||e.currentTarget,n=this.action(t)||"copy",r=w({action:n,container:this.container,target:this.target(t),text:this.text(t)});this.emit(r?"success":"error",{action:n,text:r,trigger:t,clearSelection:function(){t&&t.focus(),window.getSelection().removeAllRanges()}})}},{key:"defaultAction",value:function(e){return f("action",e)}},{key:"defaultTarget",value:function(e){var t=f("target",e);if(t)return document.querySelector(t)}},{key:"defaultText",value:function(e){return f("text",e)}},{key:"destroy",value:function(){this.listener.destroy()}}],o=[{key:"copy",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{container:document.body};return b(e,t)}},{key:"cut",value:function(e){return m(e)}},{key:"isSupported",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:["copy","cut"],t="string"==typeof e?[e]:e,n=!!document.queryCommandSupported;return t.forEach((function(e){n=n&&!!document.queryCommandSupported(e)})),n}}],r&&a(n.prototype,r),o&&a(n,o),t}(p()),S=k},828:function(e){if("undefined"!=typeof Element&&!Element.prototype.matches){var t=Element.prototype;t.matches=t.matchesSelector||t.mozMatchesSelector||t.msMatchesSelector||t.oMatchesSelector||t.webkitMatchesSelector}e.exports=function(e,t){for(;e&&9!==e.nodeType;){if("function"==typeof e.matches&&e.matches(t))return e;e=e.parentNode}}},438:function(e,t,n){function r(e,t,n,r,i){var a=o.apply(this,arguments);return e.addEventListener(n,a,i),{destroy:function(){e.removeEventListener(n,a,i)}}}function o(e,t,n,r){return function(n){n.delegateTarget=i(n.target,t),n.delegateTarget&&r.call(e,n)}}var i=n(828);e.exports=function(e,t,n,o,i){return"function"==typeof e.addEventListener?r.apply(null,arguments):"function"==typeof n?r.bind(null,document).apply(null,arguments):("string"==typeof e&&(e=document.querySelectorAll(e)),Array.prototype.map.call(e,(function(e){return r(e,t,n,o,i)})))}},879:function(e,t){t.node=function(e){return void 0!==e&&e instanceof HTMLElement&&1===e.nodeType},t.nodeList=function(e){var n=Object.prototype.toString.call(e);return void 0!==e&&("[object NodeList]"===n||"[object HTMLCollection]"===n)&&"length"in e&&(0===e.length||t.node(e[0]))},t.string=function(e){return"string"==typeof e||e instanceof String},t.fn=function(e){return"[object Function]"===Object.prototype.toString.call(e)}},370:function(e,t,n){var r=n(879),o=n(438);e.exports=function(e,t,n){if(!e&&!t&&!n)throw new Error("Missing required arguments");if(!r.string(t))throw new TypeError("Second argument must be a String");if(!r.fn(n))throw new TypeError("Third argument must be a Function");if(r.node(e))return function(e,t,n){return e.addEventListener(t,n),{destroy:function(){e.removeEventListener(t,n)}}}(e,t,n);if(r.nodeList(e))return function(e,t,n){return Array.prototype.forEach.call(e,(function(e){e.addEventListener(t,n)})),{destroy:function(){Array.prototype.forEach.call(e,(function(e){e.removeEventListener(t,n)}))}}}(e,t,n);if(r.string(e))return function(e,t,n){return o(document.body,e,t,n)}(e,t,n);throw new TypeError("First argument must be a String, HTMLElement, HTMLCollection, or NodeList")}},817:function(e){e.exports=function(e){var t;if("SELECT"===e.nodeName)e.focus(),t=e.value;else if("INPUT"===e.nodeName||"TEXTAREA"===e.nodeName){var n=e.hasAttribute("readonly");n||e.setAttribute("readonly",""),e.select(),e.setSelectionRange(0,e.value.length),n||e.removeAttribute("readonly"),t=e.value}else{e.hasAttribute("contenteditable")&&e.focus();var r=window.getSelection(),o=document.createRange();o.selectNodeContents(e),r.removeAllRanges(),r.addRange(o),t=r.toString()}return t}},279:function(e){function t(){}t.prototype={on:function(e,t,n){var r=this.e||(this.e={});return(r[e]||(r[e]=[])).push({fn:t,ctx:n}),this},once:function(e,t,n){function r(){o.off(e,r),t.apply(n,arguments)}var o=this;return r._=t,this.on(e,r,n)},emit:function(e){for(var t=[].slice.call(arguments,1),n=((this.e||(this.e={}))[e]||[]).slice(),r=0,o=n.length;r{"use strict";function r(e,t){for(var n in t)e[n]=t[n];return e}function o(e,t){for(var n in e)if("__source"!==n&&!(n in t))return!0;for(var r in t)if("__source"!==r&&e[r]!==t[r])return!0;return!1}function i(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t}function a(e){this.props=e}function l(e,t){function n(e){var n=this.props.ref,r=n==e.ref;return!r&&n&&(n.call?n(null):n.current=null),t?!t(this.props,e)||!r:o(this.props,e)}function r(t){return this.shouldComponentUpdate=n,(0,j.az)(e,t)}return r.displayName="Memo("+(e.displayName||e.name)+")",r.prototype.isReactComponent=!0,r.__f=!0,r}function u(e){function t(t){var n=r({},t);return delete n.ref,e(n,t.ref||null)}return t.$$typeof=T,t.render=t,t.prototype.isReactComponent=t.__f=!0,t.displayName="ForwardRef("+(e.displayName||e.name)+")",t}function s(e,t,n){return e&&(e.__c&&e.__c.__H&&(e.__c.__H.__.forEach((function(e){"function"==typeof e.__c&&e.__c()})),e.__c.__H=null),null!=(e=r({},e)).__c&&(e.__c.__P===n&&(e.__c.__P=t),e.__c=null),e.__k=e.__k&&e.__k.map((function(e){return s(e,t,n)}))),e}function c(e,t,n){return e&&(e.__v=null,e.__k=e.__k&&e.__k.map((function(e){return c(e,t,n)})),e.__c&&e.__c.__P===t&&(e.__e&&n.insertBefore(e.__e,e.__d),e.__c.__e=!0,e.__c.__P=n)),e}function f(){this.__u=0,this.t=null,this.__b=null}function _(e){var t=e.__.__c;return t&&t.__a&&t.__a(e)}function p(e){function t(t){if(n||(n=e()).then((function(e){r=e.default||e}),(function(e){o=e})),o)throw o;if(!r)throw n;return(0,j.az)(r,t)}var n,r,o;return t.displayName="Lazy",t.__f=!0,t}function d(){this.u=null,this.o=null}function h(e){return this.getChildContext=function(){return e.context},e.children}function v(e){var t=this,n=e.i;t.componentWillUnmount=function(){(0,j.sY)(null,t.l),t.l=null,t.i=null},t.i&&t.i!==n&&t.componentWillUnmount(),e.__v?(t.l||(t.i=n,t.l={nodeType:1,parentNode:n,childNodes:[],appendChild:function(e){this.childNodes.push(e),t.i.appendChild(e)},insertBefore:function(e){this.childNodes.push(e),t.i.appendChild(e)},removeChild:function(e){this.childNodes.splice(this.childNodes.indexOf(e)>>>1,1),t.i.removeChild(e)}}),(0,j.sY)((0,j.az)(h,{context:t.context},e.__v),t.l)):t.l&&t.componentWillUnmount()}function y(e,t){var n=(0,j.az)(v,{__v:e,i:t});return n.containerInfo=t,n}function m(e,t,n){return null==t.__k&&(t.textContent=""),(0,j.sY)(e,t),"function"==typeof n&&n(),e?e.__c:null}function g(e,t,n){return(0,j.ZB)(e,t),"function"==typeof n&&n(),e?e.__c:null}function b(){}function w(){return this.cancelBubble}function k(){return this.defaultPrevented}function S(e){return j.az.bind(null,e)}function x(e){return!!e&&e.$$typeof===Y}function C(e){return x(e)?j.Tm.apply(null,arguments):e}function E(e){return!!e.__k&&((0,j.sY)(null,e),!0)}function O(e){return e&&(e.base||1===e.nodeType&&e)||null}function P(e){e()}function N(e){return e}function A(){return[!1,P]}function $(e,t){var n=t(),r=(0,M.eJ)({h:{__:n,v:t}}),o=r[0].h,a=r[1];return(0,M.bt)((function(){o.__=n,o.v=t,i(o.__,t())||a({h:o})}),[e,n,t]),(0,M.d4)((function(){return i(o.__,o.v())||a({h:o}),e((function(){i(o.__,o.v())||a({h:o})}))}),[e]),n}n.r(t),n.d(t,{Children:()=>R,Component:()=>j.wA,Fragment:()=>j.HY,PureComponent:()=>a,StrictMode:()=>te,Suspense:()=>f,SuspenseList:()=>d,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:()=>Z,cloneElement:()=>C,createContext:()=>j.kr,createElement:()=>j.az,createFactory:()=>S,createPortal:()=>y,createRef:()=>j.Vf,default:()=>re,findDOMNode:()=>O,flushSync:()=>ee,forwardRef:()=>u,hydrate:()=>g,isValidElement:()=>x,lazy:()=>p,memo:()=>l,render:()=>m,startTransition:()=>P,unmountComponentAtNode:()=>E,unstable_batchedUpdates:()=>X,useCallback:()=>M.I4,useContext:()=>M.qp,useDebugValue:()=>M.Qb,useDeferredValue:()=>N,useEffect:()=>M.d4,useErrorBoundary:()=>M.cO,useId:()=>M.Me,useImperativeHandle:()=>M.aP,useInsertionEffect:()=>ne,useLayoutEffect:()=>M.bt,useMemo:()=>M.Ye,useReducer:()=>M._Y,useRef:()=>M.sO,useState:()=>M.eJ,useSyncExternalStore:()=>$,useTransition:()=>A,version:()=>Q});var j=n(400),M=n(396);(a.prototype=new j.wA).isPureReactComponent=!0,a.prototype.shouldComponentUpdate=function(e,t){return o(this.props,e)||o(this.state,t)};var L=j.YM.__b;j.YM.__b=function(e){e.type&&e.type.__f&&e.ref&&(e.props.ref=e.ref,e.ref=null),L&&L(e)};var T="undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.forward_ref")||3911,I=function(e,t){return null==e?null:(0,j.bR)((0,j.bR)(e).map(t))},R={map:I,forEach:I,count:function(e){return e?(0,j.bR)(e).length:0},only:function(e){var t=(0,j.bR)(e);if(1!==t.length)throw"Children.only";return t[0]},toArray:j.bR},q=j.YM.__e;j.YM.__e=function(e,t,n,r){if(e.then)for(var o,i=t;i=i.__;)if((o=i.__c)&&o.__c)return null==t.__e&&(t.__e=n.__e,t.__k=n.__k),o.__c(e,t);q(e,t,n,r)};var D=j.YM.unmount;j.YM.unmount=function(e){var t=e.__c;t&&t.__R&&t.__R(),t&&!0===e.__h&&(e.type=null),D&&D(e)},(f.prototype=new j.wA).__c=function(e,t){var n=t.__c,r=this;null==r.t&&(r.t=[]),r.t.push(n);var o=_(r.__v),i=!1,a=function(){i||(i=!0,n.__R=null,o?o(l):l())};n.__R=a;var l=function(){if(!--r.__u){if(r.state.__a){var e=r.state.__a;r.__v.__k[0]=c(e,e.__c.__P,e.__c.__O)}var t;for(r.setState({__a:r.__b=null});t=r.t.pop();)t.forceUpdate()}},u=!0===t.__h;r.__u++||u||r.setState({__a:r.__b=r.__v.__k[0]}),e.then(a,a)},f.prototype.componentWillUnmount=function(){this.t=[]},f.prototype.render=function(e,t){if(this.__b){if(this.__v.__k){var n=document.createElement("div"),r=this.__v.__k[0].__c;this.__v.__k[0]=s(this.__b,n,r.__O=r.__P)}this.__b=null}var o=t.__a&&(0,j.az)(j.HY,null,e.fallback);return o&&(o.__h=null),[(0,j.az)(j.HY,null,t.__a?null:e.children),o]};var H=function(e,t,n){if(++n[1]===n[0]&&e.o.delete(t),e.props.revealOrder&&("t"!==e.props.revealOrder[0]||!e.o.size))for(n=e.u;n;){for(;n.length>3;)n.pop()();if(n[1]{"use strict";function r(e,t){for(var n in t)e[n]=t[n];return e}function o(e){var t=e.parentNode;t&&t.removeChild(e)}function i(e,t,n){var r,o,i,l={};for(i in t)"key"==i?r=t[i]:"ref"==i?o=t[i]:l[i]=t[i];if(arguments.length>2&&(l.children=arguments.length>3?M.call(arguments,2):n),"function"==typeof e&&null!=e.defaultProps)for(i in e.defaultProps)void 0===l[i]&&(l[i]=e.defaultProps[i]);return a(e,l,r,o,null)}function a(e,t,n,r,o){var i={type:e,props:t,key:n,ref:r,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:null==o?++T:o};return null==o&&null!=L.vnode&&L.vnode(i),i}function l(){return{current:null}}function u(e){return e.children}function s(e,t){this.props=e,this.context=t}function c(e,t){if(null==t)return e.__?c(e.__,e.__.__k.indexOf(e)+1):null;for(var n;tt&&I.sort((function(e,t){return e.__v.__b-t.__v.__b})));p.__r=0}function d(e,t,n,r,o,i,l,s,f,_){var p,d,v,g,b,w,k,x=r&&r.__k||Y,C=x.length;for(n.__k=[],p=0;p0?a(g.type,g.props,g.key,g.ref?g.ref:null,g.__v):g)){if(g.__=n,g.__b=n.__b+1,null===(v=x[p])||v&&g.key==v.key&&g.type===v.type)x[p]=void 0;else for(d=0;d=0;t--)if((n=e.__k[t])&&(r=m(n)))return r;return null}function g(e,t,n){"-"===t[0]?e.setProperty(t,null==n?"":n):e[t]=null==n?"":"number"!=typeof n||z.test(t)?n:n+"px"}function b(e,t,n,r,o){var i;e:if("style"===t)if("string"==typeof n)e.style.cssText=n;else{if("string"==typeof r&&(e.style.cssText=r=""),r)for(t in r)n&&t in n||g(e.style,t,"");if(n)for(t in n)r&&n[t]===r[t]||g(e.style,t,n[t])}else if("o"===t[0]&&"n"===t[1])i=t!==(t=t.replace(/Capture$/,"")),t=t.toLowerCase()in e?t.toLowerCase().slice(2):t.slice(2),e.l||(e.l={}),e.l[t+i]=n,n?r||e.addEventListener(t,i?k:w,i):e.removeEventListener(t,i?k:w,i);else if("dangerouslySetInnerHTML"!==t){if(o)t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("width"!==t&&"height"!==t&&"href"!==t&&"list"!==t&&"form"!==t&&"tabIndex"!==t&&"download"!==t&&t in e)try{e[t]=null==n?"":n;break e}catch(e){}"function"==typeof n||(null==n||!1===n&&-1==t.indexOf("-")?e.removeAttribute(t):e.setAttribute(t,n))}}function w(e){return this.l[e.type+!1](L.event?L.event(e):e)}function k(e){return this.l[e.type+!0](L.event?L.event(e):e)}function S(e,t,n,o,i,a,l,c,f){var _,p,h,v,y,m,g,b,w,k,S,x,E,O,N,A=t.type;if(void 0!==t.constructor)return null;null!=n.__h&&(f=n.__h,c=t.__e=n.__e,t.__h=null,a=[c]),(_=L.__b)&&_(t);try{e:if("function"==typeof A){if(b=t.props,w=(_=A.contextType)&&o[_.__c],k=_?w?w.props.value:_.__:o,n.__c?g=(p=t.__c=n.__c).__=p.__E:("prototype"in A&&A.prototype.render?t.__c=p=new A(b,k):(t.__c=p=new s(b,k),p.constructor=A,p.render=P),w&&w.sub(p),p.props=b,p.state||(p.state={}),p.context=k,p.__n=o,h=p.__d=!0,p.__h=[],p._sb=[]),null==p.__s&&(p.__s=p.state),null!=A.getDerivedStateFromProps&&(p.__s==p.state&&(p.__s=r({},p.__s)),r(p.__s,A.getDerivedStateFromProps(b,p.__s))),v=p.props,y=p.state,p.__v=t,h)null==A.getDerivedStateFromProps&&null!=p.componentWillMount&&p.componentWillMount(),null!=p.componentDidMount&&p.__h.push(p.componentDidMount);else{if(null==A.getDerivedStateFromProps&&b!==v&&null!=p.componentWillReceiveProps&&p.componentWillReceiveProps(b,k),!p.__e&&null!=p.shouldComponentUpdate&&!1===p.shouldComponentUpdate(b,p.__s,k)||t.__v===n.__v){for(t.__v!==n.__v&&(p.props=b,p.state=p.__s,p.__d=!1),p.__e=!1,t.__e=n.__e,t.__k=n.__k,t.__k.forEach((function(e){e&&(e.__=t)})),S=0;S2&&(u.children=arguments.length>3?M.call(arguments,2):n),a(e.type,u,o||e.key,i||e.ref,null)}function j(e,t){var n={__c:t="__cC"+D++,__:e,Consumer:function(e,t){return e.children(t)},Provider:function(e){var n,r;return this.getChildContext||(n=[],(r={})[t]=this,this.getChildContext=function(){return r},this.shouldComponentUpdate=function(e){this.props.value!==e.value&&n.some((function(e){e.__e=!0,_(e)}))},this.sub=function(e){n.push(e);var t=e.componentWillUnmount;e.componentWillUnmount=function(){n.splice(n.indexOf(e),1),t&&t.call(e)}}),e.children}};return n.Provider.__=n.Consumer.contextType=n}n.d(t,{HY:()=>u,Tm:()=>$,Vf:()=>l,YM:()=>L,ZB:()=>A,az:()=>i,bR:()=>v,h:()=>i,kr:()=>j,sY:()=>N,wA:()=>s});var M,L,T,I,R,q,D,H={},Y=[],z=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i;M=Y.slice,L={__e:function(e,t,n,r){for(var o,i,a;t=t.__;)if((o=t.__c)&&!o.__)try{if((i=o.constructor)&&null!=i.getDerivedStateFromError&&(o.setState(i.getDerivedStateFromError(e)),a=o.__d),null!=o.componentDidCatch&&(o.componentDidCatch(e,r||{}),a=o.__d),a)return o.__E=o}catch(t){e=t}throw e}},T=0,s.prototype.setState=function(e,t){var n;n=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=r({},this.state),"function"==typeof e&&(e=e(r({},n),this.props)),e&&r(n,e),null!=e&&this.__v&&(t&&this._sb.push(t),_(this))},s.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),_(this))},s.prototype.render=u,I=[],q="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,p.__r=0,D=0},396:(e,t,n)=>{"use strict";function r(e,t){E.YM.__h&&E.YM.__h(S,e,O||t),O=0;var n=S.__H||(S.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({__V:N}),n.__[e]}function o(e){return O=1,i(w,e)}function i(e,t,n){var o=r(k++,2);if(o.t=e,!o.__c&&(o.__=[n?n(t):w(void 0,t),function(e){var t=o.__N?o.__N[0]:o.__[0],n=o.t(t,e);t!==n&&(o.__N=[n,o.__[1]],o.__c.setState({}))}],o.__c=S,!S.u)){S.u=!0;var i=S.shouldComponentUpdate;S.shouldComponentUpdate=function(e,t,n){if(!o.__c.__H)return!0;var r=o.__c.__H.__.filter((function(e){return e.__c}));if(r.every((function(e){return!e.__N})))return!i||i.call(this,e,t,n);var a=!1;return r.forEach((function(e){if(e.__N){var t=e.__[0];e.__=e.__N,e.__N=void 0,t!==e.__[0]&&(a=!0)}})),!(!a&&o.__c.props===e)&&(!i||i.call(this,e,t,n))}}return o.__N||o.__}function a(e,t){var n=r(k++,3);!E.YM.__s&&b(n.__H,t)&&(n.__=e,n.i=t,S.__H.__h.push(n))}function l(e,t){var n=r(k++,4);!E.YM.__s&&b(n.__H,t)&&(n.__=e,n.i=t,S.__h.push(n))}function u(e){return O=5,c((function(){return{current:e}}),[])}function s(e,t,n){O=6,l((function(){return"function"==typeof e?(e(t()),function(){return e(null)}):e?(e.current=t(),function(){return e.current=null}):void 0}),null==n?n:n.concat(e))}function c(e,t){var n=r(k++,7);return b(n.__H,t)?(n.__V=e(),n.i=t,n.__h=e,n.__V):n.__}function f(e,t){return O=8,c((function(){return e}),t)}function _(e){var t=S.context[e.__c],n=r(k++,9);return n.c=e,t?(null==n.__&&(n.__=!0,t.sub(S)),t.props.value):e.__}function p(e,t){E.YM.useDebugValue&&E.YM.useDebugValue(t?t(e):e)}function d(e){var t=r(k++,10),n=o();return t.__=e,S.componentDidCatch||(S.componentDidCatch=function(e,r){t.__&&t.__(e,r),n[1](e)}),[n[0],function(){n[1](void 0)}]}function h(){var e=r(k++,11);if(!e.__){for(var t=S.__v;null!==t&&!t.__m&&null!==t.__;)t=t.__;var n=t.__m||(t.__m=[0,0]);e.__="P"+n[0]+"-"+n[1]++}return e.__}function v(){for(var e;e=P.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(m),e.__H.__h.forEach(g),e.__H.__h=[]}catch(t){e.__H.__h=[],E.YM.__e(t,e.__v)}}function y(e){var t,n=function(){clearTimeout(r),T&&cancelAnimationFrame(t),setTimeout(e)},r=setTimeout(n,100);T&&(t=requestAnimationFrame(n))}function m(e){var t=S,n=e.__c;"function"==typeof n&&(e.__c=void 0,n()),S=t}function g(e){var t=S;e.__c=e.__(),S=t}function b(e,t){return!e||e.length!==t.length||t.some((function(t,n){return t!==e[n]}))}function w(e,t){return"function"==typeof t?t(e):t}n.d(t,{I4:()=>f,Me:()=>h,Qb:()=>p,Ye:()=>c,_Y:()=>i,aP:()=>s,bt:()=>l,cO:()=>d,d4:()=>a,eJ:()=>o,qp:()=>_,sO:()=>u});var k,S,x,C,E=n(400),O=0,P=[],N=[],A=E.YM.__b,$=E.YM.__r,j=E.YM.diffed,M=E.YM.__c,L=E.YM.unmount;E.YM.__b=function(e){S=null,A&&A(e)},E.YM.__r=function(e){$&&$(e),k=0;var t=(S=e.__c).__H;t&&(x===S?(t.__h=[],S.__h=[],t.__.forEach((function(e){e.__N&&(e.__=e.__N),e.__V=N,e.__N=e.i=void 0}))):(t.__h.forEach(m),t.__h.forEach(g),t.__h=[])),x=S},E.YM.diffed=function(e){j&&j(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(1!==P.push(t)&&C===E.YM.requestAnimationFrame||((C=E.YM.requestAnimationFrame)||y)(v)),t.__H.__.forEach((function(e){e.i&&(e.__H=e.i),e.__V!==N&&(e.__=e.__V),e.i=void 0,e.__V=N}))),x=S=null},E.YM.__c=function(e,t){t.some((function(e){try{e.__h.forEach(m),e.__h=e.__h.filter((function(e){return!e.__||g(e)}))}catch(n){t.some((function(e){e.__h&&(e.__h=[])})),t=[],E.YM.__e(n,e.__v)}})),M&&M(e,t)},E.YM.unmount=function(e){L&&L(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.forEach((function(e){try{m(e)}catch(e){t=e}})),n.__H=void 0,t&&E.YM.__e(t,n.__v))};var T="function"==typeof requestAnimationFrame},325:(e,t,n)=>{var r=function(e){function t(e,t,n,r){this.type=e,this.content=t,this.alias=n,this.length=0|(r||"").length}function n(e,t,n,r){e.lastIndex=t;var o=e.exec(n);if(o&&r&&o[1]){var i=o[1].length;o.index+=i,o[0]=o[0].slice(i)}return o}function r(e,o,l,u,s,c){for(var _ in l)if(l.hasOwnProperty(_)&&l[_]){var p=l[_];p=Array.isArray(p)?p:[p];for(var d=0;d=c.reach);S+=k.value.length,k=k.next){var x=k.value;if(o.length>e.length)return;if(!(x instanceof t)){var C,E=1;if(m){if(!(C=n(w,S,e,y))||C.index>=e.length)break;var O=C.index,P=C.index+C[0].length,N=S;for(N+=k.value.length;O>=N;)N+=(k=k.next).value.length;if(S=N-=k.value.length,k.value instanceof t)continue;for(var A=k;A!==o.tail&&(Nc.reach&&(c.reach=L);var T=k.prev;if(j&&(T=i(o,T,j),S+=j.length),a(o,T,E),k=i(o,T,new t(_,v?f.tokenize($,v):$,g,$)),M&&i(o,k,M),E>1){var I={cause:_+","+d,reach:L};r(e,o,l,k.prev,S,I),c&&I.reach>c.reach&&(c.reach=I.reach)}}}}}}function o(){var e={value:null,prev:null,next:null},t={value:null,prev:e,next:null};e.next=t,this.head=e,this.tail=t,this.length=0}function i(e,t,n){var r=t.next,o={value:n,prev:t,next:r};return t.next=o,r.prev=o,e.length++,o}function a(e,t,n){for(var r=t.next,o=0;o"+o.content+""},!e.document)return e.addEventListener?(f.disableWorkerMessageHandler||e.addEventListener("message",(function(t){var n=JSON.parse(t.data),r=n.language,o=n.immediateClose;e.postMessage(f.highlight(n.code,f.languages[r],r)),o&&e.close()}),!1),f):f;var _=f.util.currentScript();if(_&&(f.filename=_.src,_.hasAttribute("data-manual")&&(f.manual=!0)),!f.manual){var p=document.readyState;"loading"===p||"interactive"===p&&_&&_.defer?document.addEventListener("DOMContentLoaded",l):window.requestAnimationFrame?window.requestAnimationFrame(l):window.setTimeout(l,16)}return f}("undefined"!=typeof window?window:"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope?self:{});e.exports&&(e.exports=r),void 0!==n.g&&(n.g.Prism=r)},277:()=>{Prism.languages.json={property:{pattern:/(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?=\s*:)/,lookbehind:!0,greedy:!0},string:{pattern:/(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?!\s*:)/,lookbehind:!0,greedy:!0},comment:{pattern:/\/\/.*|\/\*[\s\S]*?(?:\*\/|$)/,greedy:!0},number:/-?\b\d+(?:\.\d+)?(?:e[+-]?\d+)?\b/i,punctuation:/[{}[\],]/,operator:/:/,boolean:/\b(?:false|true)\b/,null:{pattern:/\bnull\b/,alias:"keyword"}},Prism.languages.webmanifest=Prism.languages.json},759:()=>{!function(){function e(e){if(0!=(e=e.filter((function(e){var t=function(e){if(!e)return null;return window.getComputedStyle?getComputedStyle(e):e.currentStyle||null}(e)["white-space"];return"pre-wrap"===t||"pre-line"===t}))).length){var t=e.map((function(e){var t=e.querySelector("code"),r=e.querySelector(".line-numbers-rows");if(t&&r){var o=e.querySelector(".line-numbers-sizer"),i=t.textContent.split(n);o||((o=document.createElement("span")).className="line-numbers-sizer",t.appendChild(o)),o.innerHTML="0",o.style.display="block";var a=o.getBoundingClientRect().height;return o.innerHTML="",{element:e,lines:i,lineHeights:[],oneLinerHeight:a,sizer:o}}})).filter(Boolean);t.forEach((function(e){var t=e.sizer,n=e.lines,r=e.lineHeights,o=e.oneLinerHeight;r[n.length-1]=void 0,n.forEach((function(e,n){if(e&&e.length>1){var i=t.appendChild(document.createElement("span"));i.style.display="block",i.textContent=e}else r[n]=o}))})),t.forEach((function(e){for(var t=e.sizer,n=e.lineHeights,r=0,o=0;oi&&(n=i),r.children[n-o]}}},resize:function(t){e([t])},assumeViewportIndependence:!0},o=void 0;window.addEventListener("resize",(function(){r.assumeViewportIndependence&&o===window.innerWidth||(o=window.innerWidth,e(Array.prototype.slice.call(document.querySelectorAll("pre."+t))))})),Prism.hooks.add("complete",(function(r){if(r.code){var o=r.element,i=o.parentNode;if(i&&/pre/i.test(i.nodeName)&&!o.querySelector(".line-numbers-rows")&&Prism.util.isActive(o,t)){o.classList.remove(t),i.classList.add(t);var a,l=r.code.match(n),u=new Array((l?l.length+1:1)+1).join("");(a=document.createElement("span")).setAttribute("aria-hidden","true"),a.className="line-numbers-rows",a.innerHTML=u,i.hasAttribute("data-start")&&(i.style.counterReset="linenumber "+(parseInt(i.getAttribute("data-start"),10)-1)),r.element.appendChild(a),e([i]),Prism.hooks.run("line-numbers",r)}}})),Prism.hooks.add("line-numbers",(function(e){e.plugins=e.plugins||{},e.plugins.lineNumbers=!0}))}}()},460:function(e,t,n){"use strict";var r,o=this&&this.__extends||(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)},function(e,t){function n(){this.constructor=e}if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),i=this&&this.__assign||function(){return i=Object.assign||function(e){for(var t,n=1,r=arguments.length;n-1){t._history.stack=u.slice(0,s+1);var c=t._history.stack.length;if(c>h){var f=c-h;t._history.stack=u.slice(f,c),t._history.offset=Math.max(t._history.offset-f,0)}}var _=Date.now();if(n){var p=t._history.stack[t._history.offset];if(p&&_-p.timestamp<3e3){var d=/[^a-z0-9]([a-z0-9]+)$/i,v=null===(r=t._getLines(p.value,p.selectionStart).pop())||void 0===r?void 0:r.match(d),y=null===(o=t._getLines(e.value,e.selectionStart).pop())||void 0===o?void 0:o.match(d);if((null==v?void 0:v[1])&&(null===(a=null==y?void 0:y[1])||void 0===a?void 0:a.startsWith(v[1])))return void(t._history.stack[t._history.offset]=i(i({},e),{timestamp:_}))}}t._history.stack.push(i(i({},e),{timestamp:_})),t._history.offset++},t._updateInput=function(e){var n=t._input;n&&(n.value=e.value,n.selectionStart=e.selectionStart,n.selectionEnd=e.selectionEnd,t.props.onValueChange(e.value))},t._applyEdits=function(e){var n=t._input,r=t._history.stack[t._history.offset];r&&n&&(t._history.stack[t._history.offset]=i(i({},r),{selectionStart:n.selectionStart,selectionEnd:n.selectionEnd})),t._recordChange(e),t._updateInput(e)},t._undoEdit=function(){var e=t._history,n=e.offset,r=e.stack[n-1];r&&(t._updateInput(r),t._history.offset=Math.max(n-1,0))},t._redoEdit=function(){var e=t._history,n=e.stack,r=e.offset,o=n[r+1];o&&(t._updateInput(o),t._history.offset=Math.min(r+1,n.length-1))},t._handleKeyDown=function(e){var n=t.props,r=n.tabSize,o=n.insertSpaces,i=n.ignoreTabKey,a=n.onKeyDown;if(!a||(a(e),!e.defaultPrevented)){27===e.keyCode&&e.currentTarget.blur();var l=e.currentTarget,u=l.value,s=l.selectionStart,c=l.selectionEnd,h=(o?" ":"\t").repeat(r);if(9===e.keyCode&&!i&&t.state.capture)if(e.preventDefault(),e.shiftKey){var m=(w=t._getLines(u,s)).length-1,g=t._getLines(u,c).length-1,b=u.split("\n").map((function(e,t){return t>=m&&t<=g&&e.startsWith(h)?e.substring(h.length):e})).join("\n");if(u!==b)t._applyEdits({value:b,selectionStart:(null==(x=w[m])?void 0:x.startsWith(h))?s-h.length:s,selectionEnd:c-(u.length-b.length)})}else if(s!==c){var w,k=(w=t._getLines(u,s)).length-1,S=t._getLines(u,c).length-1,x=w[k];t._applyEdits({value:u.split("\n").map((function(e,t){return t>=k&&t<=S?h+e:e})).join("\n"),selectionStart:x&&/\S/.test(x)?s+h.length:s,selectionEnd:c+h.length*(S-k+1)})}else{var C=s+h.length;t._applyEdits({value:u.substring(0,s)+h+u.substring(c),selectionStart:C,selectionEnd:C})}else if(8===e.keyCode){var E=s!==c;if(u.substring(0,s).endsWith(h)&&!E){e.preventDefault();C=s-h.length;t._applyEdits({value:u.substring(0,s-h.length)+u.substring(c),selectionStart:C,selectionEnd:C})}}else if(13===e.keyCode){if(s===c){var O=t._getLines(u,s).pop(),P=null==O?void 0:O.match(/^\s+/);if(null==P?void 0:P[0]){e.preventDefault();var N="\n"+P[0];C=s+N.length;t._applyEdits({value:u.substring(0,s)+N+u.substring(c),selectionStart:C,selectionEnd:C})}}}else if(57===e.keyCode||e.keyCode===_||e.keyCode===p||e.keyCode===d){var A=void 0;57===e.keyCode&&e.shiftKey?A=["(",")"]:e.keyCode===_?A=e.shiftKey?["{","}"]:["[","]"]:e.keyCode===p?A=e.shiftKey?['"','"']:["'","'"]:e.keyCode!==d||e.shiftKey||(A=["`","`"]),s!==c&&A&&(e.preventDefault(),t._applyEdits({value:u.substring(0,s)+A[0]+u.substring(s,c)+A[1]+u.substring(c),selectionStart:s,selectionEnd:c+2}))}else!(y?e.metaKey&&e.keyCode===f:e.ctrlKey&&e.keyCode===f)||e.shiftKey||e.altKey?(y?e.metaKey&&e.keyCode===f&&e.shiftKey:v?e.ctrlKey&&89===e.keyCode:e.ctrlKey&&e.keyCode===f&&e.shiftKey)&&!e.altKey?(e.preventDefault(),t._redoEdit()):77!==e.keyCode||!e.ctrlKey||y&&!e.shiftKey||(e.preventDefault(),t.setState((function(e){return{capture:!e.capture}}))):(e.preventDefault(),t._undoEdit())}},t._handleChange=function(e){var n=e.currentTarget,r=n.value;t._recordChange({value:r,selectionStart:n.selectionStart,selectionEnd:n.selectionEnd},!0),t.props.onValueChange(r)},t._history={stack:[],offset:-1},t._input=null,t}return o(t,e),t.prototype.componentDidMount=function(){this._recordCurrentState()},Object.defineProperty(t.prototype,"session",{get:function(){return{history:this._history}},set:function(e){this._history=e.history},enumerable:!1,configurable:!0}),t.prototype.render=function(){var e=this,t=this.props,n=t.value,r=t.style,o=t.padding,a=t.highlight,l=t.textareaId,u=t.textareaClassName,f=t.autoFocus,_=t.disabled,p=t.form,d=t.maxLength,h=t.minLength,v=t.name,y=t.placeholder,b=t.readOnly,k=t.required,S=t.onClick,x=t.onFocus,C=t.onBlur,E=t.onKeyUp,O=t.preClassName,P=s(t,["value","style","padding","highlight","textareaId","textareaClassName","autoFocus","disabled","form","maxLength","minLength","name","placeholder","readOnly","required","onClick","onFocus","onBlur","onKeyUp","onKeyDown","onValueChange","tabSize","insertSpaces","ignoreTabKey","preClassName"]),N={paddingTop:o,paddingRight:o,paddingBottom:o,paddingLeft:o},A=a(n);return c.createElement("div",i({},P,{style:i(i({},w.container),r)}),c.createElement("textarea",{ref:function(t){return e._input=t},style:i(i(i({},w.editor),w.textarea),N),className:m+(u?" ".concat(u):""),id:l,value:n,onChange:this._handleChange,onKeyDown:this._handleKeyDown,onClick:S,onKeyUp:E,onFocus:x,onBlur:C,disabled:_,form:p,maxLength:d,minLength:h,name:v,placeholder:y,readOnly:b,required:k,autoFocus:f,autoCapitalize:"off",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"data-gramm":!1}),c.createElement("pre",i({className:O,"aria-hidden":"true",style:i(i(i({},w.editor),w.highlight),N)},"string"==typeof A?{dangerouslySetInnerHTML:{__html:A+"
"}}:{children:A})),c.createElement("style",{type:"text/css",dangerouslySetInnerHTML:{__html:g}}))},t.defaultProps={tabSize:2,insertSpaces:!0,ignoreTabKey:!1,padding:0},t}(c.Component);t.default=b;var w={container:{position:"relative",textAlign:"left",boxSizing:"border-box",padding:0,overflow:"hidden"},textarea:{position:"absolute",top:0,left:0,height:"100%",width:"100%",resize:"none",color:"inherit",overflow:"hidden",MozOsxFontSmoothing:"grayscale",WebkitFontSmoothing:"antialiased",WebkitTextFillColor:"transparent"},highlight:{position:"relative",pointerEvents:"none"},editor:{margin:0,border:0,background:"none",boxSizing:"inherit",display:"inherit",fontFamily:"inherit",fontSize:"inherit",fontStyle:"inherit",fontVariantLigatures:"inherit",fontWeight:"inherit",letterSpacing:"inherit",lineHeight:"inherit",tabSize:"inherit",textIndent:"inherit",textRendering:"inherit",textTransform:"inherit",whiteSpace:"pre-wrap",wordBreak:"keep-all",overflowWrap:"break-word"}}}},n={};e.n=t=>{var n=t&&t.__esModule?()=>t.default:()=>t;return e.d(n,{a:n}),n},e.d=(t,n)=>{for(var r in n)e.o(n,r)&&!e.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:n[r]})},e.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),e.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),e.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},e.p="/",(()=>{"use strict";function t(e){return t="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},t(e)}function n(e,n,r){return(n=function(e){var n=function(e,n){if("object"!==t(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var o=r.call(e,n||"default");if("object"!==t(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===n?String:Number)(e)}(e,"string");return"symbol"===t(n)?n:String(n)}(n))in e?Object.defineProperty(e,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[n]=r,e}function r(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,a,l=[],u=!0,s=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;u=!1}else for(;!(u=(r=i.call(n)).done)&&(l.push(r.value),l.length!==t);u=!0);}catch(e){s=!0,o=e}finally{try{if(!u&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(s)throw o}}return l}}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return o(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return o(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function o(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",r=yield fetch(e,{method:"POST",credentials:"same-origin",headers:{"Content-Type":"application/json","X-WP-Nonce":n},body:JSON.stringify(t)});return r.json()})),u.apply(this,arguments)}function s(e){return s="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},s(e)}function c(e,t,n){return(t=function(e){var t=function(e,t){if("object"!==s(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==s(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===s(t)?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function f(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,a,l=[],u=!0,s=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;u=!1}else for(;!(u=(r=i.call(n)).done)&&(l.push(r.value),l.length!==t);u=!0);}catch(e){s=!0,o=e}finally{try{if(!u&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(s)throw o}}return l}}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return _(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return _(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function _(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);ne.length)&&(t=e.length);for(var n=0,r=new Array(t);ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n2?"+ ".concat(O()("other",p-2,!0)):"";return(0,g.h)("div",{className:N()((t={},n(t,A.info_block,!0),n(t,A.info_block_collapsible,l.collapsible||!1),n(t,A.info_block_collapsed,s),t))},(0,g.h)("h5",{className:A.info_label,onClick:f},o),l.collapsible?(0,g.h)($,null,(0,g.h)("div",{className:N()(n({},A.info_block_inner,!0))},_?i.map((function(e){return(0,g.h)("span",{key:e,className:A.info_block_item},e)})):(0,g.h)("span",null,i)),(0,g.h)("span",{className:A.info_block_teaser,onClick:f},_?" ".concat(i.slice(0,2).join(", ")," ").concat(d):"Click to show")):(0,g.h)("span",null,_?i.join(", "):i))},L=e(325),T=(e(759),e(277),e(460)),I=e.n(T),R=e(152),q=e.n(R);const D="collapsible_list__PJS0Z",H="collapsible_list_details__u5Pq3",Y="visible__M2eJW";var z=function(e){var t,n=e.list,r=void 0===n?[]:n,o=e.title,i=void 0===o?"View":o,a=f((0,b.eJ)(!1),2),l=a[0],u=a[1],s=i.toLowerCase();return(0,g.h)("div",{className:N()((t={},c(t,D,!0),c(t,Y,l),t))},(0,g.h)("strong",{className:"".concat(s," vip-h4"),onClick:r.length?function(){u(!l)}:null},i," (","".concat(r.length),")"),(0,g.h)("ol",{className:"".concat(H," ").concat(s," vip-collapse-ol")},r.map((function(e,t){return(0,g.h)("li",{key:t},e)}))))};const U="query_wrap__uIeve",W="query_result__k_RWY",V="query_actions__ImK9_",F="query_handle__e0c8G",K="query_collapsed__PGXWS",B="grid_container__esEnb",J="query_src_header__wWAup",G="query_res_header__DMOpO",Z="query_src__MoJsW",Q="query_res__FZmqB",X="query_src_extra__aZwxj",ee="container_editor___Y1qC",te="container_editor_line_number__FU7Ow";var ne=e(400).HY,re=function(e){var t,n,r,o,i=e.request,a=e.url,l=e.query_args,s=e.backtrace,c=void 0===s?[]:s,f=JSON.stringify(e.args.body,null,2),_=JSON.stringify(i.body,null,2),v={editing:!1,query:f,result:_,collapsed:!0},y=h((0,b.eJ)(v),2),m=y[0],w=y[1],k="#query-response-copy-handle",S=(0,b.I4)(function(){var e,t=(e=function*(e){try{var t=yield function(){return u.apply(this,arguments)}(window.VIPSearchDevTools.ajaxurl,{action:window.VIPSearchDevTools.action,url:a,query:e},window.VIPSearchDevTools.nonce);w((function(e){var n;return p({},e,{result:JSON.stringify(null==t||null===(n=t.result)||void 0===n?void 0:n.body,null,2)})}))}catch(e){console.log(e)}},function(){var t=this,n=arguments;return new Promise((function(r,o){function i(e){d(l,r,o,i,a,"next",e)}function a(e){d(l,r,o,i,a,"throw",e)}var l=e.apply(t,n);i(void 0)}))});return function(e){return t.apply(this,arguments)}}(),[a]);(0,b.d4)((function(){var e=new(q())(k);return e.on("success",(function(e){document.querySelector(k).innerHTML="COPIED!",setTimeout((function(){document.querySelector(k).innerHTML="COPY"}),2e3),e.clearSelection()})),function(){return e.destroy()}}),[]),(0,b.d4)((function(){m.query!==v.query&&(m.editing||S(m.query))}),[m.query,m.editing,v.query,S]);var x;return(0,g.h)("div",{className:N()(U,m.collapsed?K:null)},(0,g.h)("div",{className:F,onClick:function(){return w(p({},m,{collapsed:!m.collapsed}))}},(0,g.h)("h3",{className:"vip-h3"},O()("result",(null==i||null===(t=i.body)||void 0===t||null===(n=t.hits)||void 0===n||null===(r=n.hits)||void 0===r?void 0:r.length)||0,!0),(0,g.h)("span",{style:"color: var(--vip-grey-60);"}," that took")," ",(0,g.h)("span",{style:{color:"var(--vip-".concat((x=i.body.took)<200?"green-60":x<500?"red-30":"red-60",")"),fontWeight:"bold"}},x,"ms"),(0,g.h)("small",null," (",(null==i||null===(o=i.response)||void 0===o?void 0:o.code)||"unknown",")"))),(0,g.h)("div",{className:B},(0,g.h)("div",{className:J},(0,g.h)("span",{style:"margin-right: auto;"},"Request"),(0,g.h)("div",{className:X},(0,g.h)(z,{title:"WP_Query",list:Object.entries(l).map((function(e){var t=h(e,2),n=t[1];return"".concat(t[0],": ").concat(JSON.stringify(n))}))}),(0,g.h)(z,{title:"Trace",list:c}))),(0,g.h)("div",{className:G},"Response"),(0,g.h)("div",{className:"".concat(Z," query-src-box")},(0,g.h)("div",{className:V},m.editing||m.result!==_?(0,g.h)(ne,null,(0,g.h)("button",{onClick:function(){return w(p({},m,{editing:!1}))},style:"background-color: var(--vip-green-40) !important"},"RUN"),(0,g.h)("button",{onClick:function(){return w(p({},v,{collapsed:!1}))},style:"background-color: var(--vip-blue-10) !important"},"RESET")):"Edit me!"),(0,g.h)(I(),{value:m.query,onValueChange:function(e){return w(p({},m,{query:e,editing:!0}))},highlight:function(e){return(0,L.highlight)(e,L.languages.json,"json").split("\n").map((function(e){return'').concat(e,"")})).join("\n")},padding:0,className:ee,style:{fontSize:"var(--vip-sdt-editor-font-size)",lineHeight:"1.2em"}})),(0,g.h)("div",{className:"".concat(Q," query-result-box")},(0,g.h)("div",{className:W},(0,g.h)("div",{className:V},(0,g.h)("button",{id:"query-response-copy-handle","data-clipboard-target":"#query-response-text"},"COPY")),(0,g.h)("pre",{className:"line-numbers"},(0,g.h)("code",{className:"language-json",id:"query-response-text"},m.result))))))},oe=function(){var e=(0,b.qp)(C).queries;return(0,g.h)("div",null,e.length<1?"No queries to show":e.map((function(e,t){return(0,g.h)(re,p({key:t},e))})))},ie=function(e){var t=(0,b.qp)(C).queries;return(0,g.h)("button",e,"Search: ",O()("query",t.length,!0))};const ae=function(){var e,t=y((0,b.eJ)(!1),2),n=t[0],r=t[1],o=(0,b.I4)((function(){return r(!1)}),[]),i=(0,b.I4)((function(){return r(!n)}),[n]);return(0,g.h)(C.Provider,{value:(null===(e=window)||void 0===e?void 0:e.VIPSearchDevTools)||{status:"disabled",queries:[],information:[]}},(0,g.h)("div",{className:"search-dev-tools__wrapper"},(0,g.h)(ie,{class:S,onClick:i}),(0,w.createPortal)((0,g.h)(x,{isVisible:n,closeOverlay:o,opacity:"100"},(0,g.h)("div",{className:k},(0,g.h)("h4",{className:"vip-h4 main_caption"},"Enterprise Search Dev Tools"),(0,g.h)(j,null),(0,g.h)(oe,null))),document.getElementById("search-dev-tools-portal"))))};var le=function(){return(0,g.sY)((0,g.h)(ae,null),document.querySelector('[data-widget-host="vip-search-dev-tools"]'))};"loading"===document.readyState?document.addEventListener("DOMContentLoaded",le):le()})()})(); \ No newline at end of file diff --git a/tests/files/test-image-sizes.php b/tests/files/test-image-sizes.php index ed4f2a2555..28226d5062 100644 --- a/tests/files/test-image-sizes.php +++ b/tests/files/test-image-sizes.php @@ -22,13 +22,6 @@ class A8C_Files_ImageSizes_Test extends WP_UnitTestCase { */ public $test_image = VIP_GO_MUPLUGINS_TESTS__DIR__ . '/fixtures/image.jpg'; //@todo: consider using `DIR_TESTDATA . '/images/canola.jpg';` - /** - * The test image's filesize in bytes. - * - * @var int - */ - public $test_image_filesize = 6941712; - /** * The test PDF file. * @@ -227,37 +220,37 @@ public function get_data_for_resize() { 'width' => '150', 'height' => '150', 'crop' => '1', - 'filesize' => $this->test_image_filesize, + 'filesize' => '9267', ], 'medium' => [ 'width' => '300', 'height' => '300', 'crop' => false, - 'filesize' => $this->test_image_filesize, + 'filesize' => '20882', ], 'medium_large' => [ 'width' => '768', 'height' => '0', 'crop' => false, - 'filesize' => $this->test_image_filesize, + 'filesize' => '136652', ], 'large' => [ 'width' => '1024', 'height' => '1024', 'crop' => false, - 'filesize' => $this->test_image_filesize, + 'filesize' => '242936', ], '1536x1536' => [ 'width' => '1536', 'height' => '1536', 'crop' => false, - 'filesize' => $this->test_image_filesize, + 'filesize' => '547239', ], '2048x2048' => [ 'width' => '2048', 'height' => '2048', 'crop' => false, - 'filesize' => $this->test_image_filesize, + 'filesize' => '972588', ], ], ]; @@ -291,7 +284,7 @@ public function test__resize( $data ) { 'width' => intval( $data['width'] ), 'height' => intval( $data['height'] ), 'mime-type' => 'image/jpeg', - 'filesize' => $this->test_image_filesize, + 'filesize' => intval( $data['filesize'] ), ]; $this->assertEquals( $expected_resize, $generate_sizes->invokeArgs( $image_sizes, [ $data ] ) ); } @@ -310,42 +303,42 @@ public function get_expected_sizes_meta() { 'width' => 150, 'height' => 150, 'mime-type' => 'image/jpeg', - 'filesize' => $this->test_image_filesize, + 'filesize' => '9267', ], 'medium' => [ 'file' => 'image.jpg?resize=300,169', 'width' => 300, 'height' => 169, 'mime-type' => 'image/jpeg', - 'filesize' => $this->test_image_filesize, + 'filesize' => '20882', ], 'medium_large' => [ 'file' => 'image.jpg?resize=768,432', 'width' => 768, 'height' => 432, 'mime-type' => 'image/jpeg', - 'filesize' => $this->test_image_filesize, + 'filesize' => '136652', ], 'large' => [ 'file' => 'image.jpg?resize=1024,576', 'width' => 1024, 'height' => 576, 'mime-type' => 'image/jpeg', - 'filesize' => $this->test_image_filesize, + 'filesize' => '242936', ], '1536x1536' => [ 'file' => 'image.jpg?resize=1536,865', 'width' => 1536, 'height' => 865, 'mime-type' => 'image/jpeg', - 'filesize' => $this->test_image_filesize, + 'filesize' => '547239', ], '2048x2048' => [ 'file' => 'image.jpg?resize=2048,1153', 'width' => 2048, 'height' => 1153, 'mime-type' => 'image/jpeg', - 'filesize' => $this->test_image_filesize, + 'filesize' => '972588', ], ], ], diff --git a/tests/files/test-image.php b/tests/files/test-image.php index 549701f7e5..d02d92f98e 100644 --- a/tests/files/test-image.php +++ b/tests/files/test-image.php @@ -16,13 +16,6 @@ class A8C_Files_Image_Test extends WP_UnitTestCase { */ public $test_image = VIP_GO_MUPLUGINS_TESTS__DIR__ . '/fixtures/image.jpg'; //@todo: consider using `DIR_TESTDATA . '/images/canola.jpg';` - /** - * The test image's filesize in bytes. - * - * @var int - */ - public $test_image_filesize = 6941712; - /** * @var Automattic\VIP\Files\VIP_Filesystem */ @@ -159,9 +152,10 @@ public function get_data_for_generate_sizes() { 'crop' => '1', ], [ - 'width' => 150, - 'height' => 150, - 'params' => [ + 'width' => 150, + 'height' => 150, + 'filesize' => 9267, + 'params' => [ 'resize' => '150,150', ], ], @@ -173,9 +167,10 @@ public function get_data_for_generate_sizes() { 'crop' => false, ], [ - 'width' => 300, - 'height' => 169, - 'params' => [ + 'width' => 300, + 'height' => 169, + 'filesize' => 20882, + 'params' => [ 'resize' => '300,169', ], ], @@ -187,9 +182,10 @@ public function get_data_for_generate_sizes() { 'crop' => false, ], [ - 'width' => 768, - 'height' => 432, - 'params' => [ + 'width' => 768, + 'height' => 432, + 'filesize' => 136652, + 'params' => [ 'resize' => '768,432', ], ], @@ -201,9 +197,10 @@ public function get_data_for_generate_sizes() { 'crop' => false, ], [ - 'width' => 1024, - 'height' => 576, - 'params' => [ + 'width' => 1024, + 'height' => 576, + 'filesize' => 242936, + 'params' => [ 'resize' => '1024,576', ], ], @@ -234,6 +231,7 @@ public function test__image_resize( $size, $expected_resize ) { $this->assertTrue( $image->is_resized(), 'Resized image is not marked as resized.' ); $this->assertEquals( $expected_resize['width'], $image->get_width(), 'Resized image does not have expected width.' ); $this->assertEquals( $expected_resize['height'], $image->get_height(), 'Resized image does not have expected height.' ); + $this->assertEquals( $expected_resize['filesize'], $image->get_filesize(), 'Resized image does not have expected estimated filesize.' ); $this->assertEquals( 'image/jpeg', $image->get_mime_type(), 'Resized image does not have appropriate mime type.' ); $this->assertEquals( add_query_arg( $expected_resize['params'], 'image.jpg' ), $image->get_filename(), 'Resized image does not point to appropriate file.' ); } @@ -263,7 +261,7 @@ public function test__get_size( $size, $expected_resize ) { 'width' => $expected_resize['width'], 'height' => $expected_resize['height'], 'mime-type' => 'image/jpeg', - 'filesize' => $this->test_image_filesize, + 'filesize' => $expected_resize['filesize'], ]; $this->assertEquals( $expected_size_array, $new_size_array, 'The size array does not match the expected one.' ); } @@ -292,6 +290,7 @@ public function test__reset_to_original( $size ) { $this->assertFalse( $image->is_resized(), 'Image is not marked as NOT resized.' ); $this->assertEquals( $postmeta['width'], $image->get_width(), 'Width has not been properly reset.' ); $this->assertEquals( $postmeta['height'], $image->get_height(), 'Height has not been properly reset.' ); + $this->assertEquals( $postmeta['filesize'], $image->get_filesize(), 'Filesize has not been properly reset.' ); $this->assertEquals( 'image/jpeg', $image->get_mime_type(), 'Mime-type has not been properly reset' ); $this->assertEquals( 'image.jpg', $image->get_filename(), 'Image after reset does not point to appropriate file.' ); }