diff --git a/wp-includes/assets/script-modules-packages.min.php b/wp-includes/assets/script-modules-packages.min.php new file mode 100644 index 00000000000..204c67f1be5 --- /dev/null +++ b/wp-includes/assets/script-modules-packages.min.php @@ -0,0 +1 @@ + array('dependencies' => array(), 'version' => '2d6d1fdbcb3fda39c768', 'type' => 'module'), 'interactivity/debug.min.js' => array('dependencies' => array(), 'version' => '1ccc67b05c275e51a8f8', 'type' => 'module'), 'interactivity-router/index.min.js' => array('dependencies' => array('@wordpress/interactivity'), 'version' => '64645ef3cd2d32860d7d', 'type' => 'module'), 'block-library/file/view.min.js' => array('dependencies' => array('@wordpress/interactivity'), 'version' => 'fdc2f6842e015af83140', 'type' => 'module'), 'block-library/image/view.min.js' => array('dependencies' => array('@wordpress/interactivity'), 'version' => 'acfec7b3c0be4a859b31', 'type' => 'module'), 'block-library/navigation/view.min.js' => array('dependencies' => array('@wordpress/interactivity'), 'version' => '8ff192874fc8910a284c', 'type' => 'module'), 'block-library/query/view.min.js' => array('dependencies' => array('@wordpress/interactivity', array('id' => '@wordpress/interactivity-router', 'import' => 'dynamic')), 'version' => 'f4c91c89fa5271f3dad9', 'type' => 'module'), 'block-library/search/view.min.js' => array('dependencies' => array('@wordpress/interactivity'), 'version' => '2a73400a693958f604de', 'type' => 'module')); diff --git a/wp-includes/assets/script-modules-packages.php b/wp-includes/assets/script-modules-packages.php new file mode 100644 index 00000000000..f2bdb51e67e --- /dev/null +++ b/wp-includes/assets/script-modules-packages.php @@ -0,0 +1 @@ + array('dependencies' => array(), 'version' => 'ff86b5988014bd364de8', 'type' => 'module'), 'interactivity/debug.js' => array('dependencies' => array(), 'version' => 'd05372e68bd7a4cb0676', 'type' => 'module'), 'interactivity-router/index.js' => array('dependencies' => array('@wordpress/interactivity'), 'version' => 'd76e562ff4609c2ae7fc', 'type' => 'module'), 'block-library/file/view.js' => array('dependencies' => array('@wordpress/interactivity'), 'version' => 'b0cd471b6fde34702d88', 'type' => 'module'), 'block-library/image/view.js' => array('dependencies' => array('@wordpress/interactivity'), 'version' => 'e1ce544dd878f3a09f70', 'type' => 'module'), 'block-library/navigation/view.js' => array('dependencies' => array('@wordpress/interactivity'), 'version' => '9510985aedc1f8e088f3', 'type' => 'module'), 'block-library/query/view.js' => array('dependencies' => array('@wordpress/interactivity', array('id' => '@wordpress/interactivity-router', 'import' => 'dynamic')), 'version' => '8e6f28f734f3c306b648', 'type' => 'module'), 'block-library/search/view.js' => array('dependencies' => array('@wordpress/interactivity'), 'version' => 'acdb7febda1392ad28de', 'type' => 'module')); diff --git a/wp-includes/default-filters.php b/wp-includes/default-filters.php index dfa8cab48cc..adc843f0c55 100644 --- a/wp-includes/default-filters.php +++ b/wp-includes/default-filters.php @@ -570,6 +570,7 @@ // Script Loader. add_action( 'wp_default_scripts', 'wp_default_scripts' ); add_action( 'wp_default_scripts', 'wp_default_packages' ); +add_action( 'wp_default_scripts', 'wp_default_script_modules' ); add_action( 'wp_enqueue_scripts', 'wp_localize_jquery_ui_datepicker', 1000 ); add_action( 'wp_enqueue_scripts', 'wp_common_block_scripts_and_styles' ); diff --git a/wp-includes/interactivity-api/class-wp-interactivity-api.php b/wp-includes/interactivity-api/class-wp-interactivity-api.php index b552d07938e..1213a5c0974 100644 --- a/wp-includes/interactivity-api/class-wp-interactivity-api.php +++ b/wp-includes/interactivity-api/class-wp-interactivity-api.php @@ -281,33 +281,20 @@ public function get_context( ?string $store_namespace = null ): array { /** * Registers the `@wordpress/interactivity` script modules. * + * @deprecated 6.7.0 Script Modules registration is handled by {@see wp_default_script_modules()}. + * * @since 6.5.0 */ public function register_script_modules() { - $suffix = wp_scripts_get_suffix(); - - wp_register_script_module( - '@wordpress/interactivity', - includes_url( "js/dist/interactivity$suffix.js" ) - ); - - wp_register_script_module( - '@wordpress/interactivity-router', - includes_url( "js/dist/interactivity-router$suffix.js" ), - array( '@wordpress/interactivity' ) - ); + _deprecated_function( __METHOD__, '6.7.0', 'wp_default_script_modules' ); } /** * Adds the necessary hooks for the Interactivity API. * * @since 6.5.0 - * @since 6.7.0 Use the {@see "script_module_data_{$module_id}"} filter to pass client-side data. */ public function add_hooks() { - add_action( 'wp_enqueue_scripts', array( $this, 'register_script_modules' ) ); - add_action( 'admin_enqueue_scripts', array( $this, 'register_script_modules' ) ); - add_filter( 'script_module_data_@wordpress/interactivity', array( $this, 'filter_script_module_interactivity_data' ) ); } diff --git a/wp-includes/js/dist/interactivity-router.asset.php b/wp-includes/js/dist/interactivity-router.asset.php deleted file mode 100644 index 18220f365fe..00000000000 --- a/wp-includes/js/dist/interactivity-router.asset.php +++ /dev/null @@ -1 +0,0 @@ - array(), 'version' => 'd76e562ff4609c2ae7fc'); diff --git a/wp-includes/js/dist/interactivity-router.min.asset.php b/wp-includes/js/dist/interactivity-router.min.asset.php deleted file mode 100644 index 6e6b415b7c2..00000000000 --- a/wp-includes/js/dist/interactivity-router.min.asset.php +++ /dev/null @@ -1 +0,0 @@ - array(), 'version' => '64645ef3cd2d32860d7d'); diff --git a/wp-includes/js/dist/interactivity.min.js b/wp-includes/js/dist/interactivity.min.js deleted file mode 100644 index bcb3e586808..00000000000 --- a/wp-includes/js/dist/interactivity.min.js +++ /dev/null @@ -1,2 +0,0 @@ -/*! This file is auto-generated */ -var 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]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t)},t={};e.d(t,{zj:()=>Yt,SD:()=>nt,V6:()=>rt,$K:()=>ot,vT:()=>Zt,jb:()=>Mn,yT:()=>st,M_:()=>tn,hb:()=>pt,vJ:()=>at,ip:()=>ct,Nf:()=>ft,Kr:()=>ht,li:()=>ue,J0:()=>oe,FH:()=>lt,v4:()=>_t});var n,r,o,i,s,u,_,l,c,a,f,p,h={},d=[],v=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,y=Array.isArray;function g(e,t){for(var n in t)e[n]=t[n];return e}function m(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function w(e,t,r){var o,i,s,u={};for(s in t)"key"==s?o=t[s]:"ref"==s?i=t[s]:u[s]=t[s];if(arguments.length>2&&(u.children=arguments.length>3?n.call(arguments,2):r),"function"==typeof e&&null!=e.defaultProps)for(s in e.defaultProps)void 0===u[s]&&(u[s]=e.defaultProps[s]);return b(e,u,o,i,null)}function b(e,t,n,i,s){var u={type:e,props:t,key:n,ref:i,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:null==s?++o:s,__i:-1,__u:0};return null==s&&null!=r.vnode&&r.vnode(u),u}function x(e){return e.children}function S(e,t){this.props=e,this.context=t}function k(e,t){if(null==t)return e.__?k(e.__,e.__i+1):null;for(var n;tt&&s.sort(l));C.__r=0}function O(e,t,n,r,o,i,s,u,_,l,c){var a,f,p,v,y,g=r&&r.__k||d,m=t.length;for(n.__d=_,T(n,t,g),_=n.__d,a=0;a0?b(o.type,o.props,o.key,o.ref?o.ref:null,o.__v):o).__=e,o.__b=e.__b+1,i=null,-1!==(u=o.__i=M(o,n,s,c))&&(c--,(i=n[u])&&(i.__u|=131072)),null==i||null===i.__v?(-1==u&&a--,"function"!=typeof o.type&&(o.__u|=65536)):u!==s&&(u==s-1?a--:u==s+1?a++:(u>s?a--:a++,o.__u|=65536))):o=e.__k[r]=null;if(c)for(r=0;r(null!=_&&0==(131072&_.__u)?1:0))for(;s>=0||u=0){if((_=t[s])&&0==(131072&_.__u)&&o==_.key&&i===_.type)return s;s--}if(u2&&(_.children=arguments.length>3?n.call(arguments,2):r),b(e.type,_,o||e.key,i||e.ref,null)}n=d.slice,r={__e:function(e,t,n,r){for(var o,i,s;t=t.__;)if((o=t.__c)&&!o.__)try{if((i=o.constructor)&&null!=i.getDerivedStateFromError&&(o.setState(i.getDerivedStateFromError(e)),s=o.__d),null!=o.componentDidCatch&&(o.componentDidCatch(e,r||{}),s=o.__d),s)return o.__E=o}catch(t){e=t}throw e}},o=0,i=function(e){return null!=e&&null==e.constructor},S.prototype.setState=function(e,t){var n;n=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=g({},this.state),"function"==typeof e&&(e=e(g({},n),this.props)),e&&g(n,e),null!=e&&this.__v&&(t&&this._sb.push(t),P(this))},S.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),P(this))},S.prototype.render=x,s=[],_="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,l=function(e,t){return e.__v.__b-t.__v.__b},C.__r=0,c=0,a=H(!1),f=H(!0),p=0;var B,z,J,K,q=0,G=[],Q=r,X=Q.__b,Y=Q.__r,Z=Q.diffed,ee=Q.__c,te=Q.unmount,ne=Q.__;function re(e,t){Q.__h&&Q.__h(z,e,q||t),q=0;var n=z.__H||(z.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({}),n.__[e]}function oe(e){return q=1,function(e,t,n){var r=re(B++,2);if(r.t=e,!r.__c&&(r.__=[n?n(t):ye(void 0,t),function(e){var t=r.__N?r.__N[0]:r.__[0],n=r.t(t,e);t!==n&&(r.__N=[n,r.__[1]],r.__c.setState({}))}],r.__c=z,!z.u)){var o=function(e,t,n){if(!r.__c.__H)return!0;var o=r.__c.__H.__.filter((function(e){return!!e.__c}));if(o.every((function(e){return!e.__N})))return!i||i.call(this,e,t,n);var s=!1;return o.forEach((function(e){if(e.__N){var t=e.__[0];e.__=e.__N,e.__N=void 0,t!==e.__[0]&&(s=!0)}})),!(!s&&r.__c.props===e)&&(!i||i.call(this,e,t,n))};z.u=!0;var i=z.shouldComponentUpdate,s=z.componentWillUpdate;z.componentWillUpdate=function(e,t,n){if(this.__e){var r=i;i=void 0,o(e,t,n),i=r}s&&s.call(this,e,t,n)},z.shouldComponentUpdate=o}return r.__N||r.__}(ye,e)}function ie(e,t){var n=re(B++,3);!Q.__s&&ve(n.__H,t)&&(n.__=e,n.i=t,z.__H.__h.push(n))}function se(e,t){var n=re(B++,4);!Q.__s&&ve(n.__H,t)&&(n.__=e,n.i=t,z.__h.push(n))}function ue(e){return q=5,_e((function(){return{current:e}}),[])}function _e(e,t){var n=re(B++,7);return ve(n.__H,t)&&(n.__=e(),n.__H=t,n.__h=e),n.__}function le(e,t){return q=8,_e((function(){return e}),t)}function ce(e){var t=z.context[e.__c],n=re(B++,9);return n.c=e,t?(null==n.__&&(n.__=!0,t.sub(z)),t.props.value):e.__}function ae(){for(var e;e=G.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(he),e.__H.__h.forEach(de),e.__H.__h=[]}catch(t){e.__H.__h=[],Q.__e(t,e.__v)}}Q.__b=function(e){z=null,X&&X(e)},Q.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),ne&&ne(e,t)},Q.__r=function(e){Y&&Y(e),B=0;var t=(z=e.__c).__H;t&&(J===z?(t.__h=[],z.__h=[],t.__.forEach((function(e){e.__N&&(e.__=e.__N),e.i=e.__N=void 0}))):(t.__h.forEach(he),t.__h.forEach(de),t.__h=[],B=0)),J=z},Q.diffed=function(e){Z&&Z(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(1!==G.push(t)&&K===Q.requestAnimationFrame||((K=Q.requestAnimationFrame)||pe)(ae)),t.__H.__.forEach((function(e){e.i&&(e.__H=e.i),e.i=void 0}))),J=z=null},Q.__c=function(e,t){t.some((function(e){try{e.__h.forEach(he),e.__h=e.__h.filter((function(e){return!e.__||de(e)}))}catch(n){t.some((function(e){e.__h&&(e.__h=[])})),t=[],Q.__e(n,e.__v)}})),ee&&ee(e,t)},Q.unmount=function(e){te&&te(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.forEach((function(e){try{he(e)}catch(e){t=e}})),n.__H=void 0,t&&Q.__e(t,n.__v))};var fe="function"==typeof requestAnimationFrame;function pe(e){var t,n=function(){clearTimeout(r),fe&&cancelAnimationFrame(t),setTimeout(e)},r=setTimeout(n,100);fe&&(t=requestAnimationFrame(n))}function he(e){var t=z,n=e.__c;"function"==typeof n&&(e.__c=void 0,n()),z=t}function de(e){var t=z;e.__c=e.__(),z=t}function ve(e,t){return!e||e.length!==t.length||t.some((function(t,n){return t!==e[n]}))}function ye(e,t){return"function"==typeof t?t(e):t}var ge=Symbol.for("preact-signals");function me(){if(ke>1)ke--;else{for(var e,t=!1;void 0!==Se;){var n=Se;for(Se=void 0,Ee++;void 0!==n;){var r=n.o;if(n.o=void 0,n.f&=-3,!(8&n.f)&&$e(n))try{n.c()}catch(n){t||(e=n,t=!0)}n=r}}if(Ee=0,ke--,t)throw e}}function we(e){if(ke>0)return e();ke++;try{return e()}finally{me()}}var be=void 0;var xe,Se=void 0,ke=0,Ee=0,Pe=0;function Ce(e){if(void 0!==be){var t=e.n;if(void 0===t||t.t!==be)return t={i:0,S:e,p:be.s,n:void 0,t:be,e:void 0,x:void 0,r:t},void 0!==be.s&&(be.s.n=t),be.s=t,e.n=t,32&be.f&&e.S(t),t;if(-1===t.i)return t.i=0,void 0!==t.n&&(t.n.p=t.p,void 0!==t.p&&(t.p.n=t.n),t.p=be.s,t.n=void 0,be.s.n=t,be.s=t),t}}function Oe(e){this.v=e,this.i=0,this.n=void 0,this.t=void 0}function Te(e){return new Oe(e)}function $e(e){for(var t=e.s;void 0!==t;t=t.n)if(t.S.i!==t.i||!t.S.h()||t.S.i!==t.i)return!0;return!1}function Me(e){for(var t=e.s;void 0!==t;t=t.n){var n=t.S.n;if(void 0!==n&&(t.r=n),t.S.n=t,t.i=-1,void 0===t.n){e.s=t;break}}}function Ne(e){for(var t=e.s,n=void 0;void 0!==t;){var r=t.p;-1===t.i?(t.S.U(t),void 0!==r&&(r.n=t.n),void 0!==t.n&&(t.n.p=r)):n=t,t.S.n=t.r,void 0!==t.r&&(t.r=void 0),t=r}e.s=n}function je(e){Oe.call(this,void 0),this.x=e,this.s=void 0,this.g=Pe-1,this.f=4}function He(e){return new je(e)}function Ue(e){var t=e.u;if(e.u=void 0,"function"==typeof t){ke++;var n=be;be=void 0;try{t()}catch(t){throw e.f&=-2,e.f|=8,We(e),t}finally{be=n,me()}}}function We(e){for(var t=e.s;void 0!==t;t=t.n)t.S.U(t);e.x=void 0,e.s=void 0,Ue(e)}function Ae(e){if(be!==this)throw new Error("Out-of-order effect");Ne(this),be=e,this.f&=-2,8&this.f&&We(this),me()}function Le(e){this.x=e,this.u=void 0,this.s=void 0,this.o=void 0,this.f=32}function Fe(e){var t=new Le(e);try{t.c()}catch(e){throw t.d(),e}return t.d.bind(t)}function De(e,t){r[e]=t.bind(null,r[e]||function(){})}function Re(e){xe&&xe(),xe=e&&e.S()}function Ie(e){var t=this,n=e.data,r=function(e){return _e((function(){return Te(e)}),[])}(n);r.value=n;var o=_e((function(){for(var e=t.__v;e=e.__;)if(e.__c){e.__c.__$f|=4;break}return t.__$u.c=function(){var e;i(o.peek())||3!==(null==(e=t.base)?void 0:e.nodeType)?(t.__$f|=1,t.setState({})):t.base.data=o.peek()},He((function(){var e=r.value.value;return 0===e?0:!0===e?"":e||""}))}),[]);return o.value}function Ve(e,t,n,r){var o=t in e&&void 0===e.ownerSVGElement,i=Te(n);return{o:function(e,t){i.value=e,r=t},d:Fe((function(){var n=i.value.value;r[t]!==n&&(r[t]=n,o?e[t]=n:n?e.setAttribute(t,n):e.removeAttribute(t))}))}}Oe.prototype.brand=ge,Oe.prototype.h=function(){return!0},Oe.prototype.S=function(e){this.t!==e&&void 0===e.e&&(e.x=this.t,void 0!==this.t&&(this.t.e=e),this.t=e)},Oe.prototype.U=function(e){if(void 0!==this.t){var t=e.e,n=e.x;void 0!==t&&(t.x=n,e.e=void 0),void 0!==n&&(n.e=t,e.x=void 0),e===this.t&&(this.t=n)}},Oe.prototype.subscribe=function(e){var t=this;return Fe((function(){var n=t.value,r=be;be=void 0;try{e(n)}finally{be=r}}))},Oe.prototype.valueOf=function(){return this.value},Oe.prototype.toString=function(){return this.value+""},Oe.prototype.toJSON=function(){return this.value},Oe.prototype.peek=function(){var e=be;be=void 0;try{return this.value}finally{be=e}},Object.defineProperty(Oe.prototype,"value",{get:function(){var e=Ce(this);return void 0!==e&&(e.i=this.i),this.v},set:function(e){if(e!==this.v){if(Ee>100)throw new Error("Cycle detected");this.v=e,this.i++,Pe++,ke++;try{for(var t=this.t;void 0!==t;t=t.x)t.t.N()}finally{me()}}}}),(je.prototype=new Oe).h=function(){if(this.f&=-3,1&this.f)return!1;if(32==(36&this.f))return!0;if(this.f&=-5,this.g===Pe)return!0;if(this.g=Pe,this.f|=1,this.i>0&&!$e(this))return this.f&=-2,!0;var e=be;try{Me(this),be=this;var t=this.x();(16&this.f||this.v!==t||0===this.i)&&(this.v=t,this.f&=-17,this.i++)}catch(e){this.v=e,this.f|=16,this.i++}return be=e,Ne(this),this.f&=-2,!0},je.prototype.S=function(e){if(void 0===this.t){this.f|=36;for(var t=this.s;void 0!==t;t=t.n)t.S.S(t)}Oe.prototype.S.call(this,e)},je.prototype.U=function(e){if(void 0!==this.t&&(Oe.prototype.U.call(this,e),void 0===this.t)){this.f&=-33;for(var t=this.s;void 0!==t;t=t.n)t.S.U(t)}},je.prototype.N=function(){if(!(2&this.f)){this.f|=6;for(var e=this.t;void 0!==e;e=e.x)e.t.N()}},Object.defineProperty(je.prototype,"value",{get:function(){if(1&this.f)throw new Error("Cycle detected");var e=Ce(this);if(this.h(),void 0!==e&&(e.i=this.i),16&this.f)throw this.v;return this.v}}),Le.prototype.c=function(){var e=this.S();try{if(8&this.f)return;if(void 0===this.x)return;var t=this.x();"function"==typeof t&&(this.u=t)}finally{e()}},Le.prototype.S=function(){if(1&this.f)throw new Error("Cycle detected");this.f|=1,this.f&=-9,Ue(this),Me(this),ke++;var e=be;return be=this,Ae.bind(this,e)},Le.prototype.N=function(){2&this.f||(this.f|=2,this.o=Se,Se=this)},Le.prototype.d=function(){this.f|=8,1&this.f||We(this)},Ie.displayName="_st",Object.defineProperties(Oe.prototype,{constructor:{configurable:!0,value:void 0},type:{configurable:!0,value:Ie},props:{configurable:!0,get:function(){return{data:this}}},__b:{configurable:!0,value:1}}),De("__b",(function(e,t){if("string"==typeof t.type){var n,r=t.props;for(var o in r)if("children"!==o){var i=r[o];i instanceof Oe&&(n||(t.__np=n={}),n[o]=i,r[o]=i.peek())}}e(t)})),De("__r",(function(e,t){Re();var n,r=t.__c;r&&(r.__$f&=-2,void 0===(n=r.__$u)&&(r.__$u=n=function(e){var t;return Fe((function(){t=this})),t.c=function(){r.__$f|=1,r.setState({})},t}())),r,Re(n),e(t)})),De("__e",(function(e,t,n,r){Re(),void 0,e(t,n,r)})),De("diffed",(function(e,t){var n;if(Re(),void 0,"string"==typeof t.type&&(n=t.__e)){var r=t.__np,o=t.props;if(r){var i=n.U;if(i)for(var s in i){var u=i[s];void 0===u||s in r||(u.d(),i[s]=void 0)}else n.U=i={};for(var _ in r){var l=i[_],c=r[_];void 0===l?(l=Ve(n,_,c,o),i[_]=l):l.o(c,o)}}}e(t)})),De("unmount",(function(e,t){if("string"==typeof t.type){var n=t.__e;if(n){var r=n.U;if(r)for(var o in n.U=void 0,r){var i=r[o];i&&i.d()}}}else{var s=t.__c;if(s){var u=s.__$u;u&&(s.__$u=void 0,u.d())}}e(t)})),De("__h",(function(e,t,n,r){(r<3||9===r)&&(t.__$f|=2),e(t,n,r)})),S.prototype.shouldComponentUpdate=function(e,t){var n=this.__$u;if(!(n&&void 0!==n.s||4&this.__$f))return!0;if(3&this.__$f)return!0;for(var r in t)return!0;for(var o in e)if("__source"!==o&&e[o]!==this.props[o])return!0;for(var i in this.props)if(!(i in e))return!0;return!1};const Be=[],ze=()=>Be.slice(-1)[0],Je=e=>{Be.push(e)},Ke=()=>{Be.pop()},qe=[],Ge=()=>qe.slice(-1)[0],Qe=e=>{qe.push(e)},Xe=()=>{qe.pop()},Ye=new WeakMap,Ze=()=>{throw new Error("Please use `data-wp-bind` to modify the attributes of an element.")},et={get(e,t,n){const r=Reflect.get(e,t,n);return r&&"object"==typeof r?tt(r):r},set:Ze,deleteProperty:Ze},tt=e=>(Ye.has(e)||Ye.set(e,new Proxy(e,et)),Ye.get(e)),nt=e=>Ge().context[e||ze()],rt=()=>{const e=Ge();const{ref:t,attributes:n}=e;return Object.freeze({ref:t.current,attributes:tt(n)})},ot=e=>Ge().serverContext[e||ze()],it=e=>new Promise((t=>{const n=()=>{clearTimeout(r),window.cancelAnimationFrame(o),setTimeout((()=>{e(),t()}))},r=setTimeout(n,100),o=window.requestAnimationFrame(n)})),st=()=>new Promise((e=>{setTimeout(e,0)}));function ut(e){ie((()=>{let t=null,n=!1;return t=function(e,t){let n=()=>{};const r=Fe((function(){return n=this.c.bind(this),this.x=e,this.c=t,e()}));return{flush:n,dispose:r}}(e,(async()=>{t&&!n&&(n=!0,await it(t.flush),n=!1)})),t.dispose}),[])}function _t(e){const t=Ge(),n=ze();return"GeneratorFunction"===e?.constructor?.name?async(...r)=>{const o=e(...r);let i,s;for(;;){Je(n),Qe(t);try{s=o.next(i)}finally{Xe(),Ke()}try{i=await s.value}catch(e){Je(n),Qe(t),o.throw(e)}finally{Xe(),Ke()}if(s.done)break}return i}:(...r)=>{Je(n),Qe(t);try{return e(...r)}finally{Ke(),Xe()}}}function lt(e){ut(_t(e))}function ct(e){ie(_t(e),[])}function at(e,t){ie(_t(e),t)}function ft(e,t){se(_t(e),t)}function pt(e,t){return le(_t(e),t)}function ht(e,t){return _e(_t(e),t)}new Set;const dt=e=>{0},vt=e=>Boolean(e&&"object"==typeof e&&e.constructor===Object),yt=new WeakMap,gt=new WeakMap,mt=new WeakMap,wt=new Set([Object,Array]),bt=(e,t,n)=>{if(!kt(t))throw Error("This object cannot be proxified.");if(!yt.has(t)){const r=new Proxy(t,n);yt.set(t,r),gt.set(r,t),mt.set(r,e)}return yt.get(t)},xt=e=>yt.get(e),St=e=>mt.get(e),kt=e=>"object"==typeof e&&null!==e&&(!mt.has(e)&&wt.has(e.constructor)),Et={};class Pt{constructor(e){this.owner=e,this.computedsByScope=new WeakMap}setValue(e){this.update({value:e})}setGetter(e){this.update({get:e})}getComputed(){const e=Ge()||Et;if(this.valueSignal||this.getterSignal||this.update({}),!this.computedsByScope.has(e)){const t=()=>{const e=this.getterSignal?.value;return e?e.call(this.owner):this.valueSignal?.value};Je(St(this.owner)),this.computedsByScope.set(e,He(_t(t))),Ke()}return this.computedsByScope.get(e)}update({get:e,value:t}){this.valueSignal?t===this.valueSignal.peek()&&e===this.getterSignal.peek()||we((()=>{this.valueSignal.value=t,this.getterSignal.value=e})):(this.valueSignal=Te(t),this.getterSignal=Te(e))}}const Ct=new Set(Object.getOwnPropertyNames(Symbol).map((e=>Symbol[e])).filter((e=>"symbol"==typeof e))),Ot=new WeakMap,Tt=(e,t)=>Ot.has(e)&&Ot.get(e).has(t),$t=new WeakSet,Mt=(e,t,n)=>{Ot.has(e)||Ot.set(e,new Map),t="number"==typeof t?`${t}`:t;const r=Ot.get(e);if(!r.has(t)){const o=St(e),i=new Pt(e);if(r.set(t,i),n){const{get:t,value:r}=n;if(t)i.setGetter(t);else{const t=$t.has(e);i.setValue(kt(r)?Ut(o,r,{readOnly:t}):r)}}}return r.get(t)},Nt=new WeakMap;let jt=!1;const Ht={get(e,t,n){if(jt||!e.hasOwnProperty(t)&&t in e||"symbol"==typeof t&&Ct.has(t))return Reflect.get(e,t,n);const r=Object.getOwnPropertyDescriptor(e,t),o=Mt(n,t,r).getComputed().value;if("function"==typeof o){const e=St(n);return(...t)=>{Je(e);try{return o.call(n,...t)}finally{Ke()}}}return o},set(e,t,n,r){if($t.has(r))return!1;Je(St(r));try{return Reflect.set(e,t,n,r)}finally{Ke()}},defineProperty(e,t,n){if($t.has(xt(e)))return!1;const r=!(t in e),o=Reflect.defineProperty(e,t,n);if(o){const o=xt(e),i=Mt(o,t),{get:s,value:u}=n;if(s)i.setGetter(s);else{const e=St(o);i.setValue(kt(u)?Ut(e,u):u)}if(r&&Nt.has(e)&&Nt.get(e).value++,Array.isArray(e)&&Ot.get(o)?.has("length")){Mt(o,"length").setValue(e.length)}}return o},deleteProperty(e,t){if($t.has(xt(e)))return!1;const n=Reflect.deleteProperty(e,t);if(n){Mt(xt(e),t).setValue(void 0),Nt.has(e)&&Nt.get(e).value++}return n},ownKeys:e=>(Nt.has(e)||Nt.set(e,Te(0)),Nt._=Nt.get(e).value,Reflect.ownKeys(e))},Ut=(e,t,n)=>{const r=bt(e,t,Ht);return n?.readOnly&&$t.add(r),r},Wt=(e,t,n=!0)=>{if(vt(e)&&vt(t)){let r=!1;for(const o in t){const i=!(o in e);r=r||i;const s=Object.getOwnPropertyDescriptor(t,o);if("function"==typeof s?.get||"function"==typeof s?.set){if(n||i){Object.defineProperty(e,o,{...s,configurable:!0,enumerable:!0});const t=xt(e);if(s?.get&&t&&Tt(t,o)){Mt(t,o).setGetter(s.get)}}}else if(vt(t[o]))i&&(e[o]={}),Wt(e[o],t[o],n);else if(n||i){Object.defineProperty(e,o,s);const t=xt(e);if(s?.value&&t&&Tt(t,o)){Mt(t,o).setValue(s.value)}}}r&&Nt.has(e)&&Nt.get(e).value++}},At=(e,t,n=!0)=>we((()=>{return Wt((r=e,gt.get(r)||e),t,n);var r})),Lt=new WeakSet,Ft={get:(e,t,n)=>{const r=Reflect.get(e,t),o=St(n);if(void 0===r&&Lt.has(n)){const n={};return Reflect.set(e,t,n),Dt(o,n,!1)}if("function"==typeof r){Je(o);const e=_t(r);return Ke(),e}return vt(r)&&kt(r)?Dt(o,r,!1):r}},Dt=(e,t,n=!0)=>{const r=bt(e,t,Ft);return r&&n&&Lt.add(r),r},Rt=new WeakMap,It=new WeakMap,Vt=new WeakSet,Bt=Reflect.getOwnPropertyDescriptor,zt={get:(e,t)=>{const n=It.get(e),r=e[t];return t in e?r:n[t]},set:(e,t,n)=>{const r=It.get(e);return(t in e||!(t in r)?e:r)[t]=n,!0},ownKeys:e=>[...new Set([...Object.keys(It.get(e)),...Object.keys(e)])],getOwnPropertyDescriptor:(e,t)=>Bt(e,t)||Bt(It.get(e),t)},Jt=(e,t={})=>{if(Vt.has(e))throw Error("This object cannot be proxified.");if(It.set(e,t),!Rt.has(e)){const t=new Proxy(e,zt);Rt.set(e,t),Vt.add(t)}return Rt.get(e)},Kt=new Map,qt=new Map,Gt=new Map,Qt=new Map,Xt=new Map,Yt=e=>Qt.get(e||ze())||{},Zt=e=>{const t=e||ze();return Xt.has(t)||Xt.set(t,Ut(t,{},{readOnly:!0})),Xt.get(t)},en="I acknowledge that using a private store means my plugin will inevitably break on the next store release.";function tn(e,{state:t={},...n}={},{lock:r=!1}={}){if(Kt.has(e)){if(r===en||Gt.has(e)){const t=Gt.get(e);if(!(r===en||!0!==r&&r===t))throw t?Error("Cannot unlock a private store with an invalid lock code"):Error("Cannot lock a public store")}else Gt.set(e,r);const o=qt.get(e);At(o,n),At(o.state,t)}else{r!==en&&Gt.set(e,r);const o={state:Ut(e,vt(t)?t:{}),...n},i=Dt(e,o);qt.set(e,o),Kt.set(e,i)}return Kt.get(e)}const nn=(e=document)=>{var t;const n=null!==(t=e.getElementById("wp-script-module-data-@wordpress/interactivity"))&&void 0!==t?t:e.getElementById("wp-interactivity-data");if(n?.textContent)try{return JSON.parse(n.textContent)}catch{}return{}},rn=e=>{vt(e?.state)&&Object.entries(e.state).forEach((([e,t])=>{const n=tn(e,{},{lock:en});At(n.state,t,!1),At(Zt(e),t)})),vt(e?.config)&&Object.entries(e.config).forEach((([e,t])=>{Qt.set(e,t)}))},on=nn();rn(on);const sn=function(e,t){var n={__c:t="__cC"+p++,__: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.componentWillUnmount=function(){n=null},this.shouldComponentUpdate=function(e){this.props.value!==e.value&&n.some((function(e){e.__e=!0,P(e)}))},this.sub=function(e){n.push(e);var t=e.componentWillUnmount;e.componentWillUnmount=function(){n&&n.splice(n.indexOf(e),1),t&&t.call(e)}}),e.children}};return n.Provider.__=n.Consumer.contextType=n}({client:{},server:{}}),un={},_n={},ln=(e,t,{priority:n=10}={})=>{un[e]=t,_n[e]=n},cn=({scope:e})=>(t,...n)=>{let{value:r,namespace:o}=t;if("string"!=typeof r)throw new Error("The `value` prop should be a string path");const i="!"===r[0]&&!!(r=r.slice(1));Qe(e);const s=((e,t)=>{if(!t)return void dt();let n=Kt.get(t);void 0===n&&(n=tn(t,void 0,{lock:en}));const r={...n,context:Ge().context[t]};try{return e.split(".").reduce(((e,t)=>e[t]),r)}catch(e){}})(r,o),u="function"==typeof s?s(...n):s;return Xe(),i?!u:u},an=({directives:e,priorityLevels:[t,...n],element:r,originalProps:o,previousScope:i})=>{const s=ue({}).current;s.evaluate=le(cn({scope:s}),[]);const{client:u,server:_}=ce(sn);s.context=u,s.serverContext=_,s.ref=i?.ref||ue(null),r=V(r,{ref:s.ref}),s.attributes=r.props;const l=n.length>0?w(an,{directives:e,priorityLevels:n,element:r,originalProps:o,previousScope:s}):r,c={...o,children:l},a={directives:e,props:c,element:r,context:sn,evaluate:s.evaluate};Qe(s);for(const e of t){const t=un[e]?.(a);void 0!==t&&(c.children=t)}return Xe(),c.children},fn=r.vnode;function pn(e){return vt(e)?Object.fromEntries(Object.entries(e).map((([e,t])=>[e,pn(t)]))):Array.isArray(e)?e.map((e=>pn(e))):e}r.vnode=e=>{if(e.props.__directives){const t=e.props,n=t.__directives;n.key&&(e.key=n.key.find((({suffix:e})=>"default"===e)).value),delete t.__directives;const r=(e=>{const t=Object.keys(e).reduce(((e,t)=>{if(un[t]){const n=_n[t];(e[n]=e[n]||[]).push(t)}return e}),{});return Object.entries(t).sort((([e],[t])=>parseInt(e)-parseInt(t))).map((([,e])=>e))})(n);r.length>0&&(e.props={directives:n,priorityLevels:r,originalProps:t,type:e.type,element:w(e.type,t),top:!0},e.type=an)}fn&&fn(e)};const hn=/(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g,dn=/\/\*[^]*?\*\/| +/g,vn=/\n+/g,yn=e=>({directives:t,evaluate:n})=>{t[`on-${e}`].filter((({suffix:e})=>"default"!==e)).forEach((t=>{const r=t.suffix.split("--",1)[0];ct((()=>{const o=e=>n(t,e),i="window"===e?window:document;return i.addEventListener(r,o),()=>i.removeEventListener(r,o)}))}))},gn=e=>({directives:t,evaluate:n})=>{t[`on-async-${e}`].filter((({suffix:e})=>"default"!==e)).forEach((t=>{const r=t.suffix.split("--",1)[0];ct((()=>{const o=async e=>{await st(),n(t,e)},i="window"===e?window:document;return i.addEventListener(r,o,{passive:!0}),()=>i.removeEventListener(r,o)}))}))},mn="wp",wn=`data-${mn}-ignore`,bn=`data-${mn}-interactive`,xn=`data-${mn}-`,Sn=[],kn=new RegExp(`^data-${mn}-([a-z0-9]+(?:-[a-z0-9]+)*)(?:--([a-z0-9_-]+))?$`,"i"),En=/^([\w_\/-]+)::(.+)$/,Pn=new WeakSet;function Cn(e){const t=document.createTreeWalker(e,205);return function e(n){const{nodeType:r}=n;if(3===r)return[n.data];if(4===r){var o;const e=t.nextSibling();return n.replaceWith(new window.Text(null!==(o=n.nodeValue)&&void 0!==o?o:"")),[n.nodeValue,e]}if(8===r||7===r){const e=t.nextSibling();return n.remove(),[null,e]}const i=n,{attributes:s}=i,u=i.localName,_={},l=[],c=[];let a=!1,f=!1;for(let e=0;e{const o=kn.exec(t);if(null===o)return dt(),e;const i=o[1]||"",s=o[2]||"default";var u;return e[i]=e[i]||[],e[i].push({namespace:null!=n?n:null!==(u=Sn[Sn.length-1])&&void 0!==u?u:null,value:r,suffix:s}),e}),{})),"template"===u)_.content=[...i.content.childNodes].map((e=>Cn(e)));else{let n=t.firstChild();if(n){for(;n;){const[r,o]=e(n);r&&l.push(r),n=o||t.nextSibling()}t.parentNode()}}return f&&Sn.pop(),[w(u,_,l)]}(t.currentNode)}const On=new WeakMap,Tn=e=>{if(!e.parentElement)throw Error("The passed region should be an element with a parent.");return On.has(e)||On.set(e,((e,t)=>{const n=(t=[].concat(t))[t.length-1].nextSibling;function r(t,r){e.insertBefore(t,r||n)}return e.__k={nodeType:1,parentNode:e,firstChild:t[0],childNodes:t,insertBefore:r,appendChild:r,removeChild(t){e.removeChild(t)}}})(e.parentElement,e)),On.get(e)},$n=new WeakMap,Mn=e=>{if("I acknowledge that using private APIs means my theme or plugin will inevitably break in the next version of WordPress."===e)return{directivePrefix:mn,getRegionRootFragment:Tn,initialVdom:$n,toVdom:Cn,directive:ln,getNamespace:ze,h:w,cloneElement:V,render:R,proxifyState:Ut,parseServerData:nn,populateServerData:rn,batch:we};throw new Error("Forbidden access.")};ln("context",(({directives:{context:e},props:{children:t},context:n})=>{const{Provider:r}=n,o=e.find((({suffix:e})=>"default"===e)),{client:i,server:s}=ce(n),u=o.namespace,_=ue(Ut(u,{})),l=ue(Ut(u,{},{readOnly:!0}));return w(r,{value:_e((()=>{const e={client:{...i},server:{...s}};if(o){const{namespace:t,value:n}=o;vt(n)||dt(),At(_.current,pn(n),!1),At(l.current,pn(n)),e.client[t]=Jt(_.current,i[t]),e.server[t]=Jt(l.current,s[t])}return e}),[o,i,s])},t)}),{priority:5}),ln("watch",(({directives:{watch:e},evaluate:t})=>{e.forEach((e=>{lt((()=>t(e)))}))})),ln("init",(({directives:{init:e},evaluate:t})=>{e.forEach((e=>{ct((()=>t(e)))}))})),ln("on",(({directives:{on:e},element:t,evaluate:n})=>{const r=new Map;e.filter((({suffix:e})=>"default"!==e)).forEach((e=>{const t=e.suffix.split("--")[0];r.has(t)||r.set(t,new Set),r.get(t).add(e)})),r.forEach(((e,r)=>{const o=t.props[`on${r}`];t.props[`on${r}`]=t=>{e.forEach((e=>{o&&o(t),n(e,t)}))}}))})),ln("on-async",(({directives:{"on-async":e},element:t,evaluate:n})=>{const r=new Map;e.filter((({suffix:e})=>"default"!==e)).forEach((e=>{const t=e.suffix.split("--")[0];r.has(t)||r.set(t,new Set),r.get(t).add(e)})),r.forEach(((e,r)=>{const o=t.props[`on${r}`];t.props[`on${r}`]=t=>{o&&o(t),e.forEach((async e=>{await st(),n(e,t)}))}}))})),ln("on-window",yn("window")),ln("on-document",yn("document")),ln("on-async-window",gn("window")),ln("on-async-document",gn("document")),ln("class",(({directives:{class:e},element:t,evaluate:n})=>{e.filter((({suffix:e})=>"default"!==e)).forEach((e=>{const r=e.suffix,o=n(e),i=t.props.class||"",s=new RegExp(`(^|\\s)${r}(\\s|$)`,"g");o?s.test(i)||(t.props.class=i?`${i} ${r}`:r):t.props.class=i.replace(s," ").trim(),ct((()=>{o?t.ref.current.classList.add(r):t.ref.current.classList.remove(r)}))}))})),ln("style",(({directives:{style:e},element:t,evaluate:n})=>{e.filter((({suffix:e})=>"default"!==e)).forEach((e=>{const r=e.suffix,o=n(e);t.props.style=t.props.style||{},"string"==typeof t.props.style&&(t.props.style=(e=>{const t=[{}];let n,r;for(;n=hn.exec(e.replace(dn,""));)n[4]?t.shift():n[3]?(r=n[3].replace(vn," ").trim(),t.unshift(t[0][r]=t[0][r]||{})):t[0][n[1]]=n[2].replace(vn," ").trim();return t[0]})(t.props.style)),o?t.props.style[r]=o:delete t.props.style[r],ct((()=>{o?t.ref.current.style[r]=o:t.ref.current.style.removeProperty(r)}))}))})),ln("bind",(({directives:{bind:e},element:t,evaluate:n})=>{e.filter((({suffix:e})=>"default"!==e)).forEach((e=>{const r=e.suffix,o=n(e);t.props[r]=o,ct((()=>{const e=t.ref.current;if("style"!==r){if("width"!==r&&"height"!==r&&"href"!==r&&"list"!==r&&"form"!==r&&"tabIndex"!==r&&"download"!==r&&"rowSpan"!==r&&"colSpan"!==r&&"role"!==r&&r in e)try{return void(e[r]=null==o?"":o)}catch(e){}null==o||!1===o&&"-"!==r[4]?e.removeAttribute(r):e.setAttribute(r,o)}else"string"==typeof o&&(e.style.cssText=o)}))}))})),ln("ignore",(({element:{type:e,props:{innerHTML:t,...n}}})=>w(e,{dangerouslySetInnerHTML:{__html:_e((()=>t),[])},...n}))),ln("text",(({directives:{text:e},element:t,evaluate:n})=>{const r=e.find((({suffix:e})=>"default"===e));if(r)try{const e=n(r);t.props.children="object"==typeof e?null:e.toString()}catch(e){t.props.children=null}else t.props.children=null})),ln("run",(({directives:{run:e},evaluate:t})=>{e.forEach((e=>t(e)))})),ln("each",(({directives:{each:e,"each-key":t},context:n,element:r,evaluate:o})=>{if("template"!==r.type)return;const{Provider:i}=n,s=ce(n),[u]=e,{namespace:_,suffix:l}=u;return o(u).map((e=>{const n="default"===l?"item":l.replace(/^-+|-+$/g,"").toLowerCase().replace(/-([a-z])/g,(function(e,t){return t.toUpperCase()})),o=Jt(Ut(_,{}),s.client[_]),u={client:{...s.client,[_]:o},server:{...s.server}};u.client[_][n]=e;const c={...Ge(),context:u.client,serverContext:u.server},a=t?cn({scope:c})(t[0]):e;return w(i,{value:u,key:a},r.props.content)}))}),{priority:20}),ln("each-child",(()=>null),{priority:1}),(async()=>{const e=document.querySelectorAll(`[data-${mn}-interactive]`);for(const t of e)if(!Pn.has(t)){await st();const e=Tn(t),n=Cn(t);$n.set(t,n),await st(),I(n,e)}})();var Nn=t.zj,jn=t.SD,Hn=t.V6,Un=t.$K,Wn=t.vT,An=t.jb,Ln=t.yT,Fn=t.M_,Dn=t.hb,Rn=t.vJ,In=t.ip,Vn=t.Nf,Bn=t.Kr,zn=t.li,Jn=t.J0,Kn=t.FH,qn=t.v4;export{Nn as getConfig,jn as getContext,Hn as getElement,Un as getServerContext,Wn as getServerState,An as privateApis,Ln as splitTask,Fn as store,Dn as useCallback,Rn as useEffect,In as useInit,Vn as useLayoutEffect,Bn as useMemo,zn as useRef,Jn as useState,Kn as useWatch,qn as withScope}; \ No newline at end of file diff --git a/wp-includes/js/dist/script-modules/block-library/file/view.js b/wp-includes/js/dist/script-modules/block-library/file/view.js new file mode 100644 index 00000000000..feb8ec24dd8 --- /dev/null +++ b/wp-includes/js/dist/script-modules/block-library/file/view.js @@ -0,0 +1,97 @@ +import * as __WEBPACK_EXTERNAL_MODULE__wordpress_interactivity_8e89b257__ from "@wordpress/interactivity"; +/******/ // The require scope +/******/ var __webpack_require__ = {}; +/******/ +/************************************************************************/ +/******/ /* webpack/runtime/define property getters */ +/******/ (() => { +/******/ // define getter functions for harmony exports +/******/ __webpack_require__.d = (exports, definition) => { +/******/ for(var key in definition) { +/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) { +/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); +/******/ } +/******/ } +/******/ }; +/******/ })(); +/******/ +/******/ /* webpack/runtime/hasOwnProperty shorthand */ +/******/ (() => { +/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop)) +/******/ })(); +/******/ +/************************************************************************/ +var __webpack_exports__ = {}; + +;// CONCATENATED MODULE: external "@wordpress/interactivity" +var x = (y) => { + var x = {}; __webpack_require__.d(x, y); return x +} +var y = (x) => (() => (x)) +const interactivity_namespaceObject = x({ ["store"]: () => (__WEBPACK_EXTERNAL_MODULE__wordpress_interactivity_8e89b257__.store) }); +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/file/utils/index.js +/** + * Uses a combination of user agent matching and feature detection to determine whether + * the current browser supports rendering PDFs inline. + * + * @return {boolean} Whether or not the browser supports inline PDFs. + */ +const browserSupportsPdfs = () => { + // Most mobile devices include "Mobi" in their UA. + if (window.navigator.userAgent.indexOf('Mobi') > -1) { + return false; + } + + // Android tablets are the noteable exception. + if (window.navigator.userAgent.indexOf('Android') > -1) { + return false; + } + + // iPad pretends to be a Mac. + if (window.navigator.userAgent.indexOf('Macintosh') > -1 && window.navigator.maxTouchPoints && window.navigator.maxTouchPoints > 2) { + return false; + } + + // IE only supports PDFs when there's an ActiveX object available for it. + if (!!(window.ActiveXObject || 'ActiveXObject' in window) && !(createActiveXObject('AcroPDF.PDF') || createActiveXObject('PDF.PdfCtrl'))) { + return false; + } + return true; +}; + +/** + * Helper function for creating ActiveX objects, catching any errors that are thrown + * when it's generated. + * + * @param {string} type The name of the ActiveX object to create. + * @return {window.ActiveXObject|undefined} The generated ActiveXObject, or null if it failed. + */ +const createActiveXObject = type => { + let ax; + try { + ax = new window.ActiveXObject(type); + } catch (e) { + ax = undefined; + } + return ax; +}; + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/file/view.js +/** + * WordPress dependencies + */ + +/** + * Internal dependencies + */ + +(0,interactivity_namespaceObject.store)('core/file', { + state: { + get hasPdfPreview() { + return browserSupportsPdfs(); + } + } +}, { + lock: true +}); + diff --git a/wp-includes/js/dist/script-modules/block-library/file/view.min.js b/wp-includes/js/dist/script-modules/block-library/file/view.min.js new file mode 100644 index 00000000000..35e9cfb7558 --- /dev/null +++ b/wp-includes/js/dist/script-modules/block-library/file/view.min.js @@ -0,0 +1 @@ +import*as e from"@wordpress/interactivity";var t={d:(e,o)=>{for(var r in o)t.o(o,r)&&!t.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:o[r]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t)};const o=(e=>{var o={};return t.d(o,e),o})({store:()=>e.store}),r=e=>{let t;try{t=new window.ActiveXObject(e)}catch(e){t=void 0}return t};(0,o.store)("core/file",{state:{get hasPdfPreview(){return!(window.navigator.userAgent.indexOf("Mobi")>-1||window.navigator.userAgent.indexOf("Android")>-1||window.navigator.userAgent.indexOf("Macintosh")>-1&&window.navigator.maxTouchPoints&&window.navigator.maxTouchPoints>2||(window.ActiveXObject||"ActiveXObject"in window)&&!r("AcroPDF.PDF")&&!r("PDF.PdfCtrl"))}}},{lock:!0}); \ No newline at end of file diff --git a/wp-includes/js/dist/script-modules/block-library/image/view.js b/wp-includes/js/dist/script-modules/block-library/image/view.js new file mode 100644 index 00000000000..4d8ce8b9370 --- /dev/null +++ b/wp-includes/js/dist/script-modules/block-library/image/view.js @@ -0,0 +1,440 @@ +import * as __WEBPACK_EXTERNAL_MODULE__wordpress_interactivity_8e89b257__ from "@wordpress/interactivity"; +/******/ // The require scope +/******/ var __webpack_require__ = {}; +/******/ +/************************************************************************/ +/******/ /* webpack/runtime/define property getters */ +/******/ (() => { +/******/ // define getter functions for harmony exports +/******/ __webpack_require__.d = (exports, definition) => { +/******/ for(var key in definition) { +/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) { +/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); +/******/ } +/******/ } +/******/ }; +/******/ })(); +/******/ +/******/ /* webpack/runtime/hasOwnProperty shorthand */ +/******/ (() => { +/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop)) +/******/ })(); +/******/ +/************************************************************************/ +var __webpack_exports__ = {}; + +;// CONCATENATED MODULE: external "@wordpress/interactivity" +var x = (y) => { + var x = {}; __webpack_require__.d(x, y); return x +} +var y = (x) => (() => (x)) +const interactivity_namespaceObject = x({ ["getContext"]: () => (__WEBPACK_EXTERNAL_MODULE__wordpress_interactivity_8e89b257__.getContext), ["getElement"]: () => (__WEBPACK_EXTERNAL_MODULE__wordpress_interactivity_8e89b257__.getElement), ["store"]: () => (__WEBPACK_EXTERNAL_MODULE__wordpress_interactivity_8e89b257__.store) }); +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/image/view.js +/** + * WordPress dependencies + */ + + +/** + * Tracks whether user is touching screen; used to differentiate behavior for + * touch and mouse input. + * + * @type {boolean} + */ +let isTouching = false; + +/** + * Tracks the last time the screen was touched; used to differentiate behavior + * for touch and mouse input. + * + * @type {number} + */ +let lastTouchTime = 0; +const { + state, + actions, + callbacks +} = (0,interactivity_namespaceObject.store)('core/image', { + state: { + currentImageId: null, + get currentImage() { + return state.metadata[state.currentImageId]; + }, + get overlayOpened() { + return state.currentImageId !== null; + }, + get roleAttribute() { + return state.overlayOpened ? 'dialog' : null; + }, + get ariaModal() { + return state.overlayOpened ? 'true' : null; + }, + get enlargedSrc() { + return state.currentImage.uploadedSrc || 'data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs='; + }, + get figureStyles() { + return state.overlayOpened && `${state.currentImage.figureStyles?.replace(/margin[^;]*;?/g, '')};`; + }, + get imgStyles() { + return state.overlayOpened && `${state.currentImage.imgStyles?.replace(/;$/, '')}; object-fit:cover;`; + }, + get imageButtonRight() { + const { + imageId + } = (0,interactivity_namespaceObject.getContext)(); + return state.metadata[imageId].imageButtonRight; + }, + get imageButtonTop() { + const { + imageId + } = (0,interactivity_namespaceObject.getContext)(); + return state.metadata[imageId].imageButtonTop; + }, + get isContentHidden() { + const ctx = (0,interactivity_namespaceObject.getContext)(); + return state.overlayEnabled && state.currentImageId === ctx.imageId; + }, + get isContentVisible() { + const ctx = (0,interactivity_namespaceObject.getContext)(); + return !state.overlayEnabled && state.currentImageId === ctx.imageId; + } + }, + actions: { + showLightbox() { + const { + imageId + } = (0,interactivity_namespaceObject.getContext)(); + + // Bails out if the image has not loaded yet. + if (!state.metadata[imageId].imageRef?.complete) { + return; + } + + // Stores the positions of the scroll to fix it until the overlay is + // closed. + state.scrollTopReset = document.documentElement.scrollTop; + state.scrollLeftReset = document.documentElement.scrollLeft; + + // Sets the current expanded image in the state and enables the overlay. + state.overlayEnabled = true; + state.currentImageId = imageId; + + // Computes the styles of the overlay for the animation. + callbacks.setOverlayStyles(); + }, + hideLightbox() { + if (state.overlayEnabled) { + // Starts the overlay closing animation. The showClosingAnimation + // class is used to avoid showing it on page load. + state.showClosingAnimation = true; + state.overlayEnabled = false; + + // Waits until the close animation has completed before allowing a + // user to scroll again. The duration of this animation is defined in + // the `styles.scss` file, but in any case we should wait a few + // milliseconds longer than the duration, otherwise a user may scroll + // too soon and cause the animation to look sloppy. + setTimeout(function () { + // Delays before changing the focus. Otherwise the focus ring will + // appear on Firefox before the image has finished animating, which + // looks broken. + state.currentImage.buttonRef.focus({ + preventScroll: true + }); + + // Resets the current image id to mark the overlay as closed. + state.currentImageId = null; + }, 450); + } + }, + handleKeydown(event) { + if (state.overlayEnabled) { + // Focuses the close button when the user presses the tab key. + if (event.key === 'Tab') { + event.preventDefault(); + const { + ref + } = (0,interactivity_namespaceObject.getElement)(); + ref.querySelector('button').focus(); + } + // Closes the lightbox when the user presses the escape key. + if (event.key === 'Escape') { + actions.hideLightbox(); + } + } + }, + handleTouchMove(event) { + // On mobile devices, prevents triggering the scroll event because + // otherwise the page jumps around when it resets the scroll position. + // This also means that closing the lightbox requires that a user + // perform a simple tap. This may be changed in the future if there is a + // better alternative to override or reset the scroll position during + // swipe actions. + if (state.overlayEnabled) { + event.preventDefault(); + } + }, + handleTouchStart() { + isTouching = true; + }, + handleTouchEnd() { + // Waits a few milliseconds before resetting to ensure that pinch to + // zoom works consistently on mobile devices when the lightbox is open. + lastTouchTime = Date.now(); + isTouching = false; + }, + handleScroll() { + // Prevents scrolling behaviors that trigger content shift while the + // lightbox is open. It would be better to accomplish through CSS alone, + // but using overflow: hidden is currently the only way to do so and + // that causes a layout to shift and prevents the zoom animation from + // working in some cases because it's not possible to account for the + // layout shift when doing the animation calculations. Instead, it uses + // JavaScript to prevent and reset the scrolling behavior. + if (state.overlayOpened) { + // Avoids overriding the scroll behavior on mobile devices because + // doing so breaks the pinch to zoom functionality, and users should + // be able to zoom in further on the high-res image. + if (!isTouching && Date.now() - lastTouchTime > 450) { + // It doesn't rely on `event.preventDefault()` to prevent scrolling + // because the scroll event can't be canceled, so it resets the + // position instead. + window.scrollTo(state.scrollLeftReset, state.scrollTopReset); + } + } + } + }, + callbacks: { + setOverlayStyles() { + if (!state.overlayEnabled) { + return; + } + let { + naturalWidth, + naturalHeight, + offsetWidth: originalWidth, + offsetHeight: originalHeight + } = state.currentImage.imageRef; + let { + x: screenPosX, + y: screenPosY + } = state.currentImage.imageRef.getBoundingClientRect(); + + // Natural ratio of the image clicked to open the lightbox. + const naturalRatio = naturalWidth / naturalHeight; + // Original ratio of the image clicked to open the lightbox. + let originalRatio = originalWidth / originalHeight; + + // If it has object-fit: contain, recalculates the original sizes + // and the screen position without the blank spaces. + if (state.currentImage.scaleAttr === 'contain') { + if (naturalRatio > originalRatio) { + const heightWithoutSpace = originalWidth / naturalRatio; + // Recalculates screen position without the top space. + screenPosY += (originalHeight - heightWithoutSpace) / 2; + originalHeight = heightWithoutSpace; + } else { + const widthWithoutSpace = originalHeight * naturalRatio; + // Recalculates screen position without the left space. + screenPosX += (originalWidth - widthWithoutSpace) / 2; + originalWidth = widthWithoutSpace; + } + } + originalRatio = originalWidth / originalHeight; + + // Typically, it uses the image's full-sized dimensions. If those + // dimensions have not been set (i.e. an external image with only one + // size), the image's dimensions in the lightbox are the same + // as those of the image in the content. + let imgMaxWidth = parseFloat(state.currentImage.targetWidth !== 'none' ? state.currentImage.targetWidth : naturalWidth); + let imgMaxHeight = parseFloat(state.currentImage.targetHeight !== 'none' ? state.currentImage.targetHeight : naturalHeight); + + // Ratio of the biggest image stored in the database. + let imgRatio = imgMaxWidth / imgMaxHeight; + let containerMaxWidth = imgMaxWidth; + let containerMaxHeight = imgMaxHeight; + let containerWidth = imgMaxWidth; + let containerHeight = imgMaxHeight; + + // Checks if the target image has a different ratio than the original + // one (thumbnail). Recalculates the width and height. + if (naturalRatio.toFixed(2) !== imgRatio.toFixed(2)) { + if (naturalRatio > imgRatio) { + // If the width is reached before the height, it keeps the maxWidth + // and recalculates the height unless the difference between the + // maxHeight and the reducedHeight is higher than the maxWidth, + // where it keeps the reducedHeight and recalculate the width. + const reducedHeight = imgMaxWidth / naturalRatio; + if (imgMaxHeight - reducedHeight > imgMaxWidth) { + imgMaxHeight = reducedHeight; + imgMaxWidth = reducedHeight * naturalRatio; + } else { + imgMaxHeight = imgMaxWidth / naturalRatio; + } + } else { + // If the height is reached before the width, it keeps the maxHeight + // and recalculate the width unlesss the difference between the + // maxWidth and the reducedWidth is higher than the maxHeight, where + // it keeps the reducedWidth and recalculate the height. + const reducedWidth = imgMaxHeight * naturalRatio; + if (imgMaxWidth - reducedWidth > imgMaxHeight) { + imgMaxWidth = reducedWidth; + imgMaxHeight = reducedWidth / naturalRatio; + } else { + imgMaxWidth = imgMaxHeight * naturalRatio; + } + } + containerWidth = imgMaxWidth; + containerHeight = imgMaxHeight; + imgRatio = imgMaxWidth / imgMaxHeight; + + // Calculates the max size of the container. + if (originalRatio > imgRatio) { + containerMaxWidth = imgMaxWidth; + containerMaxHeight = containerMaxWidth / originalRatio; + } else { + containerMaxHeight = imgMaxHeight; + containerMaxWidth = containerMaxHeight * originalRatio; + } + } + + // If the image has been pixelated on purpose, it keeps that size. + if (originalWidth > containerWidth || originalHeight > containerHeight) { + containerWidth = originalWidth; + containerHeight = originalHeight; + } + + // Calculates the final lightbox image size and the scale factor. + // MaxWidth is either the window container (accounting for padding) or + // the image resolution. + let horizontalPadding = 0; + if (window.innerWidth > 480) { + horizontalPadding = 80; + } else if (window.innerWidth > 1920) { + horizontalPadding = 160; + } + const verticalPadding = 80; + const targetMaxWidth = Math.min(window.innerWidth - horizontalPadding, containerWidth); + const targetMaxHeight = Math.min(window.innerHeight - verticalPadding, containerHeight); + const targetContainerRatio = targetMaxWidth / targetMaxHeight; + if (originalRatio > targetContainerRatio) { + // If targetMaxWidth is reached before targetMaxHeight. + containerWidth = targetMaxWidth; + containerHeight = containerWidth / originalRatio; + } else { + // If targetMaxHeight is reached before targetMaxWidth. + containerHeight = targetMaxHeight; + containerWidth = containerHeight * originalRatio; + } + const containerScale = originalWidth / containerWidth; + const lightboxImgWidth = imgMaxWidth * (containerWidth / containerMaxWidth); + const lightboxImgHeight = imgMaxHeight * (containerHeight / containerMaxHeight); + + // As of this writing, using the calculations above will render the + // lightbox with a small, erroneous whitespace on the left side of the + // image in iOS Safari, perhaps due to an inconsistency in how browsers + // handle absolute positioning and CSS transformation. In any case, + // adding 1 pixel to the container width and height solves the problem, + // though this can be removed if the issue is fixed in the future. + state.overlayStyles = ` + :root { + --wp--lightbox-initial-top-position: ${screenPosY}px; + --wp--lightbox-initial-left-position: ${screenPosX}px; + --wp--lightbox-container-width: ${containerWidth + 1}px; + --wp--lightbox-container-height: ${containerHeight + 1}px; + --wp--lightbox-image-width: ${lightboxImgWidth}px; + --wp--lightbox-image-height: ${lightboxImgHeight}px; + --wp--lightbox-scale: ${containerScale}; + --wp--lightbox-scrollbar-width: ${window.innerWidth - document.documentElement.clientWidth}px; + } + `; + }, + setButtonStyles() { + const { + imageId + } = (0,interactivity_namespaceObject.getContext)(); + const { + ref + } = (0,interactivity_namespaceObject.getElement)(); + state.metadata[imageId].imageRef = ref; + state.metadata[imageId].currentSrc = ref.currentSrc; + const { + naturalWidth, + naturalHeight, + offsetWidth, + offsetHeight + } = ref; + + // If the image isn't loaded yet, it can't calculate where the button + // should be. + if (naturalWidth === 0 || naturalHeight === 0) { + return; + } + const figure = ref.parentElement; + const figureWidth = ref.parentElement.clientWidth; + + // It needs special handling for the height because a caption will cause + // the figure to be taller than the image, which means it needs to + // account for that when calculating the placement of the button in the + // top right corner of the image. + let figureHeight = ref.parentElement.clientHeight; + const caption = figure.querySelector('figcaption'); + if (caption) { + const captionComputedStyle = window.getComputedStyle(caption); + if (!['absolute', 'fixed'].includes(captionComputedStyle.position)) { + figureHeight = figureHeight - caption.offsetHeight - parseFloat(captionComputedStyle.marginTop) - parseFloat(captionComputedStyle.marginBottom); + } + } + const buttonOffsetTop = figureHeight - offsetHeight; + const buttonOffsetRight = figureWidth - offsetWidth; + let imageButtonTop = buttonOffsetTop + 16; + let imageButtonRight = buttonOffsetRight + 16; + + // In the case of an image with object-fit: contain, the size of the + // element can be larger than the image itself, so it needs to + // calculate where to place the button. + if (state.metadata[imageId].scaleAttr === 'contain') { + // Natural ratio of the image. + const naturalRatio = naturalWidth / naturalHeight; + // Offset ratio of the image. + const offsetRatio = offsetWidth / offsetHeight; + if (naturalRatio >= offsetRatio) { + // If it reaches the width first, it keeps the width and compute the + // height. + const referenceHeight = offsetWidth / naturalRatio; + imageButtonTop = (offsetHeight - referenceHeight) / 2 + buttonOffsetTop + 16; + imageButtonRight = buttonOffsetRight + 16; + } else { + // If it reaches the height first, it keeps the height and compute + // the width. + const referenceWidth = offsetHeight * naturalRatio; + imageButtonTop = buttonOffsetTop + 16; + imageButtonRight = (offsetWidth - referenceWidth) / 2 + buttonOffsetRight + 16; + } + } + state.metadata[imageId].imageButtonTop = imageButtonTop; + state.metadata[imageId].imageButtonRight = imageButtonRight; + }, + setOverlayFocus() { + if (state.overlayEnabled) { + // Moves the focus to the dialog when it opens. + const { + ref + } = (0,interactivity_namespaceObject.getElement)(); + ref.focus(); + } + }, + initTriggerButton() { + const { + imageId + } = (0,interactivity_namespaceObject.getContext)(); + const { + ref + } = (0,interactivity_namespaceObject.getElement)(); + state.metadata[imageId].buttonRef = ref; + } + } +}, { + lock: true +}); + diff --git a/wp-includes/js/dist/script-modules/block-library/image/view.min.js b/wp-includes/js/dist/script-modules/block-library/image/view.min.js new file mode 100644 index 00000000000..aa1004f7140 --- /dev/null +++ b/wp-includes/js/dist/script-modules/block-library/image/view.min.js @@ -0,0 +1 @@ +import*as t from"@wordpress/interactivity";var e={d:(t,n)=>{for(var o in n)e.o(n,o)&&!e.o(t,o)&&Object.defineProperty(t,o,{enumerable:!0,get:n[o]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e)};const n=(t=>{var n={};return e.d(n,t),n})({getContext:()=>t.getContext,getElement:()=>t.getElement,store:()=>t.store});let o=!1,a=0;const{state:r,actions:i,callbacks:l}=(0,n.store)("core/image",{state:{currentImageId:null,get currentImage(){return r.metadata[r.currentImageId]},get overlayOpened(){return null!==r.currentImageId},get roleAttribute(){return r.overlayOpened?"dialog":null},get ariaModal(){return r.overlayOpened?"true":null},get enlargedSrc(){return r.currentImage.uploadedSrc||"data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs="},get figureStyles(){return r.overlayOpened&&`${r.currentImage.figureStyles?.replace(/margin[^;]*;?/g,"")};`},get imgStyles(){return r.overlayOpened&&`${r.currentImage.imgStyles?.replace(/;$/,"")}; object-fit:cover;`},get imageButtonRight(){const{imageId:t}=(0,n.getContext)();return r.metadata[t].imageButtonRight},get imageButtonTop(){const{imageId:t}=(0,n.getContext)();return r.metadata[t].imageButtonTop},get isContentHidden(){const t=(0,n.getContext)();return r.overlayEnabled&&r.currentImageId===t.imageId},get isContentVisible(){const t=(0,n.getContext)();return!r.overlayEnabled&&r.currentImageId===t.imageId}},actions:{showLightbox(){const{imageId:t}=(0,n.getContext)();r.metadata[t].imageRef?.complete&&(r.scrollTopReset=document.documentElement.scrollTop,r.scrollLeftReset=document.documentElement.scrollLeft,r.overlayEnabled=!0,r.currentImageId=t,l.setOverlayStyles())},hideLightbox(){r.overlayEnabled&&(r.showClosingAnimation=!0,r.overlayEnabled=!1,setTimeout((function(){r.currentImage.buttonRef.focus({preventScroll:!0}),r.currentImageId=null}),450))},handleKeydown(t){if(r.overlayEnabled){if("Tab"===t.key){t.preventDefault();const{ref:e}=(0,n.getElement)();e.querySelector("button").focus()}"Escape"===t.key&&i.hideLightbox()}},handleTouchMove(t){r.overlayEnabled&&t.preventDefault()},handleTouchStart(){o=!0},handleTouchEnd(){a=Date.now(),o=!1},handleScroll(){r.overlayOpened&&!o&&Date.now()-a>450&&window.scrollTo(r.scrollLeftReset,r.scrollTopReset)}},callbacks:{setOverlayStyles(){if(!r.overlayEnabled)return;let{naturalWidth:t,naturalHeight:e,offsetWidth:n,offsetHeight:o}=r.currentImage.imageRef,{x:a,y:i}=r.currentImage.imageRef.getBoundingClientRect();const l=t/e;let g=n/o;if("contain"===r.currentImage.scaleAttr)if(l>g){const t=n/l;i+=(o-t)/2,o=t}else{const t=o*l;a+=(n-t)/2,n=t}g=n/o;let c=parseFloat("none"!==r.currentImage.targetWidth?r.currentImage.targetWidth:t),s=parseFloat("none"!==r.currentImage.targetHeight?r.currentImage.targetHeight:e),d=c/s,u=c,m=s,h=c,p=s;if(l.toFixed(2)!==d.toFixed(2)){if(l>d){const t=c/l;s-t>c?(s=t,c=t*l):s=c/l}else{const t=s*l;c-t>s?(c=t,s=t/l):c=s*l}h=c,p=s,d=c/s,g>d?(u=c,m=u/g):(m=s,u=m*g)}(n>h||o>p)&&(h=n,p=o);let f=0;window.innerWidth>480?f=80:window.innerWidth>1920&&(f=160);const y=Math.min(window.innerWidth-f,h),b=Math.min(window.innerHeight-80,p);g>y/b?(h=y,p=h/g):(p=b,h=p*g);const w=n/h,I=c*(h/u),x=s*(p/m);r.overlayStyles=`\n\t\t\t\t:root {\n\t\t\t\t\t--wp--lightbox-initial-top-position: ${i}px;\n\t\t\t\t\t--wp--lightbox-initial-left-position: ${a}px;\n\t\t\t\t\t--wp--lightbox-container-width: ${h+1}px;\n\t\t\t\t\t--wp--lightbox-container-height: ${p+1}px;\n\t\t\t\t\t--wp--lightbox-image-width: ${I}px;\n\t\t\t\t\t--wp--lightbox-image-height: ${x}px;\n\t\t\t\t\t--wp--lightbox-scale: ${w};\n\t\t\t\t\t--wp--lightbox-scrollbar-width: ${window.innerWidth-document.documentElement.clientWidth}px;\n\t\t\t\t}\n\t\t\t`},setButtonStyles(){const{imageId:t}=(0,n.getContext)(),{ref:e}=(0,n.getElement)();r.metadata[t].imageRef=e,r.metadata[t].currentSrc=e.currentSrc;const{naturalWidth:o,naturalHeight:a,offsetWidth:i,offsetHeight:l}=e;if(0===o||0===a)return;const g=e.parentElement,c=e.parentElement.clientWidth;let s=e.parentElement.clientHeight;const d=g.querySelector("figcaption");if(d){const t=window.getComputedStyle(d);["absolute","fixed"].includes(t.position)||(s=s-d.offsetHeight-parseFloat(t.marginTop)-parseFloat(t.marginBottom))}const u=s-l,m=c-i;let h=u+16,p=m+16;if("contain"===r.metadata[t].scaleAttr){const t=o/a;if(t>=i/l){h=(l-i/t)/2+u+16,p=m+16}else{h=u+16,p=(i-l*t)/2+m+16}}r.metadata[t].imageButtonTop=h,r.metadata[t].imageButtonRight=p},setOverlayFocus(){if(r.overlayEnabled){const{ref:t}=(0,n.getElement)();t.focus()}},initTriggerButton(){const{imageId:t}=(0,n.getContext)(),{ref:e}=(0,n.getElement)();r.metadata[t].buttonRef=e}}},{lock:!0}); \ No newline at end of file diff --git a/wp-includes/js/dist/script-modules/block-library/navigation/view.js b/wp-includes/js/dist/script-modules/block-library/navigation/view.js new file mode 100644 index 00000000000..5722eb627de --- /dev/null +++ b/wp-includes/js/dist/script-modules/block-library/navigation/view.js @@ -0,0 +1,223 @@ +import * as __WEBPACK_EXTERNAL_MODULE__wordpress_interactivity_8e89b257__ from "@wordpress/interactivity"; +/******/ // The require scope +/******/ var __webpack_require__ = {}; +/******/ +/************************************************************************/ +/******/ /* webpack/runtime/define property getters */ +/******/ (() => { +/******/ // define getter functions for harmony exports +/******/ __webpack_require__.d = (exports, definition) => { +/******/ for(var key in definition) { +/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) { +/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); +/******/ } +/******/ } +/******/ }; +/******/ })(); +/******/ +/******/ /* webpack/runtime/hasOwnProperty shorthand */ +/******/ (() => { +/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop)) +/******/ })(); +/******/ +/************************************************************************/ +var __webpack_exports__ = {}; + +;// CONCATENATED MODULE: external "@wordpress/interactivity" +var x = (y) => { + var x = {}; __webpack_require__.d(x, y); return x +} +var y = (x) => (() => (x)) +const interactivity_namespaceObject = x({ ["getContext"]: () => (__WEBPACK_EXTERNAL_MODULE__wordpress_interactivity_8e89b257__.getContext), ["getElement"]: () => (__WEBPACK_EXTERNAL_MODULE__wordpress_interactivity_8e89b257__.getElement), ["store"]: () => (__WEBPACK_EXTERNAL_MODULE__wordpress_interactivity_8e89b257__.store) }); +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/navigation/view.js +/** + * WordPress dependencies + */ + +const focusableSelectors = ['a[href]', 'input:not([disabled]):not([type="hidden"]):not([aria-hidden])', 'select:not([disabled]):not([aria-hidden])', 'textarea:not([disabled]):not([aria-hidden])', 'button:not([disabled]):not([aria-hidden])', '[contenteditable]', '[tabindex]:not([tabindex^="-"])']; + +// This is a fix for Safari in iOS/iPadOS. Without it, Safari doesn't focus out +// when the user taps in the body. It can be removed once we add an overlay to +// capture the clicks, instead of relying on the focusout event. +document.addEventListener('click', () => {}); +const { + state, + actions +} = (0,interactivity_namespaceObject.store)('core/navigation', { + state: { + get roleAttribute() { + const ctx = (0,interactivity_namespaceObject.getContext)(); + return ctx.type === 'overlay' && state.isMenuOpen ? 'dialog' : null; + }, + get ariaModal() { + const ctx = (0,interactivity_namespaceObject.getContext)(); + return ctx.type === 'overlay' && state.isMenuOpen ? 'true' : null; + }, + get ariaLabel() { + const ctx = (0,interactivity_namespaceObject.getContext)(); + return ctx.type === 'overlay' && state.isMenuOpen ? ctx.ariaLabel : null; + }, + get isMenuOpen() { + // The menu is opened if either `click`, `hover` or `focus` is true. + return Object.values(state.menuOpenedBy).filter(Boolean).length > 0; + }, + get menuOpenedBy() { + const ctx = (0,interactivity_namespaceObject.getContext)(); + return ctx.type === 'overlay' ? ctx.overlayOpenedBy : ctx.submenuOpenedBy; + } + }, + actions: { + openMenuOnHover() { + const { + type, + overlayOpenedBy + } = (0,interactivity_namespaceObject.getContext)(); + if (type === 'submenu' && + // Only open on hover if the overlay is closed. + Object.values(overlayOpenedBy || {}).filter(Boolean).length === 0) { + actions.openMenu('hover'); + } + }, + closeMenuOnHover() { + const { + type, + overlayOpenedBy + } = (0,interactivity_namespaceObject.getContext)(); + if (type === 'submenu' && + // Only close on hover if the overlay is closed. + Object.values(overlayOpenedBy || {}).filter(Boolean).length === 0) { + actions.closeMenu('hover'); + } + }, + openMenuOnClick() { + const ctx = (0,interactivity_namespaceObject.getContext)(); + const { + ref + } = (0,interactivity_namespaceObject.getElement)(); + ctx.previousFocus = ref; + actions.openMenu('click'); + }, + closeMenuOnClick() { + actions.closeMenu('click'); + actions.closeMenu('focus'); + }, + openMenuOnFocus() { + actions.openMenu('focus'); + }, + toggleMenuOnClick() { + const ctx = (0,interactivity_namespaceObject.getContext)(); + const { + ref + } = (0,interactivity_namespaceObject.getElement)(); + // Safari won't send focus to the clicked element, so we need to manually place it: https://bugs.webkit.org/show_bug.cgi?id=22261 + if (window.document.activeElement !== ref) { + ref.focus(); + } + const { + menuOpenedBy + } = state; + if (menuOpenedBy.click || menuOpenedBy.focus) { + actions.closeMenu('click'); + actions.closeMenu('focus'); + } else { + ctx.previousFocus = ref; + actions.openMenu('click'); + } + }, + handleMenuKeydown(event) { + const { + type, + firstFocusableElement, + lastFocusableElement + } = (0,interactivity_namespaceObject.getContext)(); + if (state.menuOpenedBy.click) { + // If Escape close the menu. + if (event?.key === 'Escape') { + actions.closeMenu('click'); + actions.closeMenu('focus'); + return; + } + + // Trap focus if it is an overlay (main menu). + if (type === 'overlay' && event.key === 'Tab') { + // If shift + tab it change the direction. + if (event.shiftKey && window.document.activeElement === firstFocusableElement) { + event.preventDefault(); + lastFocusableElement.focus(); + } else if (!event.shiftKey && window.document.activeElement === lastFocusableElement) { + event.preventDefault(); + firstFocusableElement.focus(); + } + } + } + }, + handleMenuFocusout(event) { + const { + modal, + type + } = (0,interactivity_namespaceObject.getContext)(); + // If focus is outside modal, and in the document, close menu + // event.target === The element losing focus + // event.relatedTarget === The element receiving focus (if any) + // When focusout is outside the document, + // `window.document.activeElement` doesn't change. + + // The event.relatedTarget is null when something outside the navigation menu is clicked. This is only necessary for Safari. + if (event.relatedTarget === null || !modal?.contains(event.relatedTarget) && event.target !== window.document.activeElement && type === 'submenu') { + actions.closeMenu('click'); + actions.closeMenu('focus'); + } + }, + openMenu(menuOpenedOn = 'click') { + const { + type + } = (0,interactivity_namespaceObject.getContext)(); + state.menuOpenedBy[menuOpenedOn] = true; + if (type === 'overlay') { + // Add a `has-modal-open` class to the root. + document.documentElement.classList.add('has-modal-open'); + } + }, + closeMenu(menuClosedOn = 'click') { + const ctx = (0,interactivity_namespaceObject.getContext)(); + state.menuOpenedBy[menuClosedOn] = false; + // Check if the menu is still open or not. + if (!state.isMenuOpen) { + if (ctx.modal?.contains(window.document.activeElement)) { + ctx.previousFocus?.focus(); + } + ctx.modal = null; + ctx.previousFocus = null; + if (ctx.type === 'overlay') { + document.documentElement.classList.remove('has-modal-open'); + } + } + } + }, + callbacks: { + initMenu() { + const ctx = (0,interactivity_namespaceObject.getContext)(); + const { + ref + } = (0,interactivity_namespaceObject.getElement)(); + if (state.isMenuOpen) { + const focusableElements = ref.querySelectorAll(focusableSelectors); + ctx.modal = ref; + ctx.firstFocusableElement = focusableElements[0]; + ctx.lastFocusableElement = focusableElements[focusableElements.length - 1]; + } + }, + focusFirstElement() { + const { + ref + } = (0,interactivity_namespaceObject.getElement)(); + if (state.isMenuOpen) { + const focusableElements = ref.querySelectorAll(focusableSelectors); + focusableElements?.[0]?.focus(); + } + } + } +}, { + lock: true +}); + diff --git a/wp-includes/js/dist/script-modules/block-library/navigation/view.min.js b/wp-includes/js/dist/script-modules/block-library/navigation/view.min.js new file mode 100644 index 00000000000..1de9f7a435b --- /dev/null +++ b/wp-includes/js/dist/script-modules/block-library/navigation/view.min.js @@ -0,0 +1 @@ +import*as e from"@wordpress/interactivity";var t={d:(e,n)=>{for(var o in n)t.o(n,o)&&!t.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:n[o]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t)};const n=(e=>{var n={};return t.d(n,e),n})({getContext:()=>e.getContext,getElement:()=>e.getElement,store:()=>e.store}),o=["a[href]",'input:not([disabled]):not([type="hidden"]):not([aria-hidden])',"select:not([disabled]):not([aria-hidden])","textarea:not([disabled]):not([aria-hidden])","button:not([disabled]):not([aria-hidden])","[contenteditable]",'[tabindex]:not([tabindex^="-"])'];document.addEventListener("click",(()=>{}));const{state:l,actions:c}=(0,n.store)("core/navigation",{state:{get roleAttribute(){return"overlay"===(0,n.getContext)().type&&l.isMenuOpen?"dialog":null},get ariaModal(){return"overlay"===(0,n.getContext)().type&&l.isMenuOpen?"true":null},get ariaLabel(){const e=(0,n.getContext)();return"overlay"===e.type&&l.isMenuOpen?e.ariaLabel:null},get isMenuOpen(){return Object.values(l.menuOpenedBy).filter(Boolean).length>0},get menuOpenedBy(){const e=(0,n.getContext)();return"overlay"===e.type?e.overlayOpenedBy:e.submenuOpenedBy}},actions:{openMenuOnHover(){const{type:e,overlayOpenedBy:t}=(0,n.getContext)();"submenu"===e&&0===Object.values(t||{}).filter(Boolean).length&&c.openMenu("hover")},closeMenuOnHover(){const{type:e,overlayOpenedBy:t}=(0,n.getContext)();"submenu"===e&&0===Object.values(t||{}).filter(Boolean).length&&c.closeMenu("hover")},openMenuOnClick(){const e=(0,n.getContext)(),{ref:t}=(0,n.getElement)();e.previousFocus=t,c.openMenu("click")},closeMenuOnClick(){c.closeMenu("click"),c.closeMenu("focus")},openMenuOnFocus(){c.openMenu("focus")},toggleMenuOnClick(){const e=(0,n.getContext)(),{ref:t}=(0,n.getElement)();window.document.activeElement!==t&&t.focus();const{menuOpenedBy:o}=l;o.click||o.focus?(c.closeMenu("click"),c.closeMenu("focus")):(e.previousFocus=t,c.openMenu("click"))},handleMenuKeydown(e){const{type:t,firstFocusableElement:o,lastFocusableElement:u}=(0,n.getContext)();if(l.menuOpenedBy.click){if("Escape"===e?.key)return c.closeMenu("click"),void c.closeMenu("focus");"overlay"===t&&"Tab"===e.key&&(e.shiftKey&&window.document.activeElement===o?(e.preventDefault(),u.focus()):e.shiftKey||window.document.activeElement!==u||(e.preventDefault(),o.focus()))}},handleMenuFocusout(e){const{modal:t,type:o}=(0,n.getContext)();(null===e.relatedTarget||!t?.contains(e.relatedTarget)&&e.target!==window.document.activeElement&&"submenu"===o)&&(c.closeMenu("click"),c.closeMenu("focus"))},openMenu(e="click"){const{type:t}=(0,n.getContext)();l.menuOpenedBy[e]=!0,"overlay"===t&&document.documentElement.classList.add("has-modal-open")},closeMenu(e="click"){const t=(0,n.getContext)();l.menuOpenedBy[e]=!1,l.isMenuOpen||(t.modal?.contains(window.document.activeElement)&&t.previousFocus?.focus(),t.modal=null,t.previousFocus=null,"overlay"===t.type&&document.documentElement.classList.remove("has-modal-open"))}},callbacks:{initMenu(){const e=(0,n.getContext)(),{ref:t}=(0,n.getElement)();if(l.isMenuOpen){const n=t.querySelectorAll(o);e.modal=t,e.firstFocusableElement=n[0],e.lastFocusableElement=n[n.length-1]}},focusFirstElement(){const{ref:e}=(0,n.getElement)();if(l.isMenuOpen){const t=e.querySelectorAll(o);t?.[0]?.focus()}}}},{lock:!0}); \ No newline at end of file diff --git a/wp-includes/js/dist/script-modules/block-library/query/view.js b/wp-includes/js/dist/script-modules/block-library/query/view.js new file mode 100644 index 00000000000..332942f4e9e --- /dev/null +++ b/wp-includes/js/dist/script-modules/block-library/query/view.js @@ -0,0 +1,135 @@ +import * as __WEBPACK_EXTERNAL_MODULE__wordpress_interactivity_8e89b257__ from "@wordpress/interactivity"; +/******/ var __webpack_modules__ = ({ + +/***/ 438: +/***/ ((module) => { + +module.exports = import("@wordpress/interactivity-router");; + +/***/ }) + +/******/ }); +/************************************************************************/ +/******/ // The module cache +/******/ var __webpack_module_cache__ = {}; +/******/ +/******/ // The require function +/******/ function __webpack_require__(moduleId) { +/******/ // Check if module is in cache +/******/ var cachedModule = __webpack_module_cache__[moduleId]; +/******/ if (cachedModule !== undefined) { +/******/ return cachedModule.exports; +/******/ } +/******/ // Create a new module (and put it into the cache) +/******/ var module = __webpack_module_cache__[moduleId] = { +/******/ // no module.id needed +/******/ // no module.loaded needed +/******/ exports: {} +/******/ }; +/******/ +/******/ // Execute the module function +/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__); +/******/ +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } +/******/ +/************************************************************************/ +/******/ /* webpack/runtime/define property getters */ +/******/ (() => { +/******/ // define getter functions for harmony exports +/******/ __webpack_require__.d = (exports, definition) => { +/******/ for(var key in definition) { +/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) { +/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); +/******/ } +/******/ } +/******/ }; +/******/ })(); +/******/ +/******/ /* webpack/runtime/hasOwnProperty shorthand */ +/******/ (() => { +/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop)) +/******/ })(); +/******/ +/************************************************************************/ +var __webpack_exports__ = {}; +// This entry need to be wrapped in an IIFE because it need to be isolated against other modules in the chunk. +(() => { + +;// CONCATENATED MODULE: external "@wordpress/interactivity" +var x = (y) => { + var x = {}; __webpack_require__.d(x, y); return x +} +var y = (x) => (() => (x)) +const interactivity_namespaceObject = x({ ["getContext"]: () => (__WEBPACK_EXTERNAL_MODULE__wordpress_interactivity_8e89b257__.getContext), ["getElement"]: () => (__WEBPACK_EXTERNAL_MODULE__wordpress_interactivity_8e89b257__.getElement), ["store"]: () => (__WEBPACK_EXTERNAL_MODULE__wordpress_interactivity_8e89b257__.store) }); +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/query/view.js +/** + * WordPress dependencies + */ + +const isValidLink = ref => ref && ref instanceof window.HTMLAnchorElement && ref.href && (!ref.target || ref.target === '_self') && ref.origin === window.location.origin; +const isValidEvent = event => event.button === 0 && +// Left clicks only. +!event.metaKey && +// Open in new tab (Mac). +!event.ctrlKey && +// Open in new tab (Windows). +!event.altKey && +// Download. +!event.shiftKey && !event.defaultPrevented; +(0,interactivity_namespaceObject.store)('core/query', { + actions: { + *navigate(event) { + const ctx = (0,interactivity_namespaceObject.getContext)(); + const { + ref + } = (0,interactivity_namespaceObject.getElement)(); + const queryRef = ref.closest('.wp-block-query[data-wp-router-region]'); + if (isValidLink(ref) && isValidEvent(event)) { + event.preventDefault(); + const { + actions + } = yield Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 438)); + yield actions.navigate(ref.href); + ctx.url = ref.href; + + // Focus the first anchor of the Query block. + const firstAnchor = `.wp-block-post-template a[href]`; + queryRef.querySelector(firstAnchor)?.focus(); + } + }, + *prefetch() { + const { + ref + } = (0,interactivity_namespaceObject.getElement)(); + if (isValidLink(ref)) { + const { + actions + } = yield Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 438)); + yield actions.prefetch(ref.href); + } + } + }, + callbacks: { + *prefetch() { + const { + url + } = (0,interactivity_namespaceObject.getContext)(); + const { + ref + } = (0,interactivity_namespaceObject.getElement)(); + if (url && isValidLink(ref)) { + const { + actions + } = yield Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 438)); + yield actions.prefetch(ref.href); + } + } + } +}, { + lock: true +}); + +})(); + diff --git a/wp-includes/js/dist/script-modules/block-library/query/view.min.js b/wp-includes/js/dist/script-modules/block-library/query/view.min.js new file mode 100644 index 00000000000..b0d3749a408 --- /dev/null +++ b/wp-includes/js/dist/script-modules/block-library/query/view.min.js @@ -0,0 +1 @@ +import*as e from"@wordpress/interactivity";var t={438:e=>{e.exports=import("@wordpress/interactivity-router")}},r={};function o(e){var n=r[e];if(void 0!==n)return n.exports;var i=r[e]={exports:{}};return t[e](i,i.exports,o),i.exports}o.d=(e,t)=>{for(var r in t)o.o(t,r)&&!o.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},o.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{const t=(e=>{var t={};return o.d(t,e),t})({getContext:()=>e.getContext,getElement:()=>e.getElement,store:()=>e.store}),r=e=>e&&e instanceof window.HTMLAnchorElement&&e.href&&(!e.target||"_self"===e.target)&&e.origin===window.location.origin;(0,t.store)("core/query",{actions:{*navigate(e){const n=(0,t.getContext)(),{ref:i}=(0,t.getElement)(),s=i.closest(".wp-block-query[data-wp-router-region]");if(r(i)&&(e=>!(0!==e.button||e.metaKey||e.ctrlKey||e.altKey||e.shiftKey||e.defaultPrevented))(e)){e.preventDefault();const{actions:t}=yield Promise.resolve().then(o.bind(o,438));yield t.navigate(i.href),n.url=i.href;const r=".wp-block-post-template a[href]";s.querySelector(r)?.focus()}},*prefetch(){const{ref:e}=(0,t.getElement)();if(r(e)){const{actions:t}=yield Promise.resolve().then(o.bind(o,438));yield t.prefetch(e.href)}}},callbacks:{*prefetch(){const{url:e}=(0,t.getContext)(),{ref:n}=(0,t.getElement)();if(e&&r(n)){const{actions:e}=yield Promise.resolve().then(o.bind(o,438));yield e.prefetch(n.href)}}}},{lock:!0})})(); \ No newline at end of file diff --git a/wp-includes/js/dist/script-modules/block-library/search/view.js b/wp-includes/js/dist/script-modules/block-library/search/view.js new file mode 100644 index 00000000000..22348474928 --- /dev/null +++ b/wp-includes/js/dist/script-modules/block-library/search/view.js @@ -0,0 +1,112 @@ +import * as __WEBPACK_EXTERNAL_MODULE__wordpress_interactivity_8e89b257__ from "@wordpress/interactivity"; +/******/ // The require scope +/******/ var __webpack_require__ = {}; +/******/ +/************************************************************************/ +/******/ /* webpack/runtime/define property getters */ +/******/ (() => { +/******/ // define getter functions for harmony exports +/******/ __webpack_require__.d = (exports, definition) => { +/******/ for(var key in definition) { +/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) { +/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); +/******/ } +/******/ } +/******/ }; +/******/ })(); +/******/ +/******/ /* webpack/runtime/hasOwnProperty shorthand */ +/******/ (() => { +/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop)) +/******/ })(); +/******/ +/************************************************************************/ +var __webpack_exports__ = {}; + +;// CONCATENATED MODULE: external "@wordpress/interactivity" +var x = (y) => { + var x = {}; __webpack_require__.d(x, y); return x +} +var y = (x) => (() => (x)) +const interactivity_namespaceObject = x({ ["getContext"]: () => (__WEBPACK_EXTERNAL_MODULE__wordpress_interactivity_8e89b257__.getContext), ["getElement"]: () => (__WEBPACK_EXTERNAL_MODULE__wordpress_interactivity_8e89b257__.getElement), ["store"]: () => (__WEBPACK_EXTERNAL_MODULE__wordpress_interactivity_8e89b257__.store) }); +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/search/view.js +/** + * WordPress dependencies + */ + +const { + actions +} = (0,interactivity_namespaceObject.store)('core/search', { + state: { + get ariaLabel() { + const { + isSearchInputVisible, + ariaLabelCollapsed, + ariaLabelExpanded + } = (0,interactivity_namespaceObject.getContext)(); + return isSearchInputVisible ? ariaLabelExpanded : ariaLabelCollapsed; + }, + get ariaControls() { + const { + isSearchInputVisible, + inputId + } = (0,interactivity_namespaceObject.getContext)(); + return isSearchInputVisible ? null : inputId; + }, + get type() { + const { + isSearchInputVisible + } = (0,interactivity_namespaceObject.getContext)(); + return isSearchInputVisible ? 'submit' : 'button'; + }, + get tabindex() { + const { + isSearchInputVisible + } = (0,interactivity_namespaceObject.getContext)(); + return isSearchInputVisible ? '0' : '-1'; + } + }, + actions: { + openSearchInput(event) { + const ctx = (0,interactivity_namespaceObject.getContext)(); + const { + ref + } = (0,interactivity_namespaceObject.getElement)(); + if (!ctx.isSearchInputVisible) { + event.preventDefault(); + ctx.isSearchInputVisible = true; + ref.parentElement.querySelector('input').focus(); + } + }, + closeSearchInput() { + const ctx = (0,interactivity_namespaceObject.getContext)(); + ctx.isSearchInputVisible = false; + }, + handleSearchKeydown(event) { + const { + ref + } = (0,interactivity_namespaceObject.getElement)(); + // If Escape close the menu. + if (event?.key === 'Escape') { + actions.closeSearchInput(); + ref.querySelector('button').focus(); + } + }, + handleSearchFocusout(event) { + const { + ref + } = (0,interactivity_namespaceObject.getElement)(); + // If focus is outside search form, and in the document, close menu + // event.target === The element losing focus + // event.relatedTarget === The element receiving focus (if any) + // When focusout is outside the document, + // `window.document.activeElement` doesn't change. + if (!ref.contains(event.relatedTarget) && event.target !== window.document.activeElement) { + actions.closeSearchInput(); + } + } + } +}, { + lock: true +}); + diff --git a/wp-includes/js/dist/script-modules/block-library/search/view.min.js b/wp-includes/js/dist/script-modules/block-library/search/view.min.js new file mode 100644 index 00000000000..3f154f9aa75 --- /dev/null +++ b/wp-includes/js/dist/script-modules/block-library/search/view.min.js @@ -0,0 +1 @@ +import*as e from"@wordpress/interactivity";var t={d:(e,n)=>{for(var r in n)t.o(n,r)&&!t.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:n[r]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t)};const n=(e=>{var n={};return t.d(n,e),n})({getContext:()=>e.getContext,getElement:()=>e.getElement,store:()=>e.store}),{actions:r}=(0,n.store)("core/search",{state:{get ariaLabel(){const{isSearchInputVisible:e,ariaLabelCollapsed:t,ariaLabelExpanded:r}=(0,n.getContext)();return e?r:t},get ariaControls(){const{isSearchInputVisible:e,inputId:t}=(0,n.getContext)();return e?null:t},get type(){const{isSearchInputVisible:e}=(0,n.getContext)();return e?"submit":"button"},get tabindex(){const{isSearchInputVisible:e}=(0,n.getContext)();return e?"0":"-1"}},actions:{openSearchInput(e){const t=(0,n.getContext)(),{ref:r}=(0,n.getElement)();t.isSearchInputVisible||(e.preventDefault(),t.isSearchInputVisible=!0,r.parentElement.querySelector("input").focus())},closeSearchInput(){(0,n.getContext)().isSearchInputVisible=!1},handleSearchKeydown(e){const{ref:t}=(0,n.getElement)();"Escape"===e?.key&&(r.closeSearchInput(),t.querySelector("button").focus())},handleSearchFocusout(e){const{ref:t}=(0,n.getElement)();t.contains(e.relatedTarget)||e.target===window.document.activeElement||r.closeSearchInput()}}},{lock:!0}); \ No newline at end of file diff --git a/wp-includes/js/dist/interactivity-router.js b/wp-includes/js/dist/script-modules/interactivity-router/index.js similarity index 100% rename from wp-includes/js/dist/interactivity-router.js rename to wp-includes/js/dist/script-modules/interactivity-router/index.js diff --git a/wp-includes/js/dist/interactivity-router.min.js b/wp-includes/js/dist/script-modules/interactivity-router/index.min.js similarity index 98% rename from wp-includes/js/dist/interactivity-router.min.js rename to wp-includes/js/dist/script-modules/interactivity-router/index.min.js index 6500a1379cf..d0febef7386 100644 --- a/wp-includes/js/dist/interactivity-router.min.js +++ b/wp-includes/js/dist/script-modules/interactivity-router/index.min.js @@ -1,2 +1 @@ -/*! This file is auto-generated */ import*as e from"@wordpress/interactivity";var t={d:(e,o)=>{for(var i in o)t.o(o,i)&&!t.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:o[i]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t)},o={};t.d(o,{o:()=>P,w:()=>x});const i=(e=>{var o={};return t.d(o,e),o})({getConfig:()=>e.getConfig,privateApis:()=>e.privateApis,store:()=>e.store});var n;const{directivePrefix:a,getRegionRootFragment:r,initialVdom:s,toVdom:d,render:l,parseServerData:c,populateServerData:g,batch:w}=(0,i.privateApis)("I acknowledge that using private APIs means my theme or plugin will inevitably break in the next version of WordPress."),u=null!==(n=(0,i.getConfig)("core/router").navigationMode)&&void 0!==n?n:"regionBased",h=new Map,m=(new Map,e=>{const t=new URL(e,window.location.href);return t.pathname+t.search}),p=async(e,{vdom:t}={})=>{const o={body:void 0};if("regionBased"===u){const i=`data-${a}-router-region`;e.querySelectorAll(`[${i}]`).forEach((e=>{const n=e.getAttribute(i);o[n]=t?.has(e)?t.get(e):d(e)}))}const i=e.querySelector("title")?.innerText,n=c(e);return{regions:o,head:undefined,title:i,initialData:n}},f=e=>{w((()=>{if("regionBased"===u){g(e.initialData);const t=`data-${a}-router-region`;document.querySelectorAll(`[${t}]`).forEach((o=>{const i=o.getAttribute(t),n=r(o);l(e.regions[i],n)}))}e.title&&(document.title=e.title)}))},v=e=>(window.location.assign(e),new Promise((()=>{})));window.addEventListener("popstate",(async()=>{const e=m(window.location.href),t=h.has(e)&&await h.get(e);t?(f(t),x.url=window.location.href):window.location.reload()})),h.set(m(window.location.href),Promise.resolve(p(document,{vdom:s})));let y="",S=!1;const b={loading:"Loading page, please wait.",loaded:"Page Loaded."},{state:x,actions:P}=(0,i.store)("core/router",{state:{url:window.location.href,navigation:{hasStarted:!1,hasFinished:!1,message:""}},actions:{*navigate(e,t={}){const{clientNavigationDisabled:o}=(0,i.getConfig)();o&&(yield v(e));const n=m(e),{navigation:a}=x,{loadingAnimation:r=!0,screenReaderAnnouncement:s=!0,timeout:d=1e4}=t;y=e,P.prefetch(n,t);const l=new Promise((e=>setTimeout(e,d))),c=setTimeout((()=>{y===e&&(r&&(a.hasStarted=!0,a.hasFinished=!1),s&&A("loading"))}),400),g=yield Promise.race([h.get(n),l]);if(clearTimeout(c),y===e)if(g&&!g.initialData?.config?.["core/router"]?.clientNavigationDisabled){yield f(g),window.history[t.replace?"replaceState":"pushState"]({},"",e),x.url=e,r&&(a.hasStarted=!1,a.hasFinished=!0),s&&A("loaded");const{hash:o}=new URL(e,window.location.href);o&&document.querySelector(o)?.scrollIntoView()}else yield v(e)},prefetch(e,t={}){const{clientNavigationDisabled:o}=(0,i.getConfig)();if(o)return;const n=m(e);!t.force&&h.has(n)||h.set(n,(async(e,{html:t})=>{try{if(!t){const o=await window.fetch(e);if(200!==o.status)return!1;t=await o.text()}const o=(new window.DOMParser).parseFromString(t,"text/html");return p(o)}catch(e){return!1}})(n,{html:t.html}))}}});function A(e){if(!S){S=!0;const e=document.getElementById("wp-script-module-data-@wordpress/interactivity-router")?.textContent;if(e)try{const t=JSON.parse(e);"string"==typeof t?.i18n?.loading&&(b.loading=t.i18n.loading),"string"==typeof t?.i18n?.loaded&&(b.loaded=t.i18n.loaded)}catch{}else x.navigation.texts?.loading&&(b.loading=x.navigation.texts.loading),x.navigation.texts?.loaded&&(b.loaded=x.navigation.texts.loaded)}const t=b[e];x.navigation.message=t+(x.navigation.message===t?" ":"")}var D=o.o,C=o.w;export{D as actions,C as state}; \ No newline at end of file diff --git a/wp-includes/js/dist/script-modules/interactivity/debug.js b/wp-includes/js/dist/script-modules/interactivity/debug.js new file mode 100644 index 00000000000..6d5097f882c --- /dev/null +++ b/wp-includes/js/dist/script-modules/interactivity/debug.js @@ -0,0 +1,2519 @@ +/******/ var __webpack_modules__ = ({ + +/***/ 380: +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + + +// EXPORTS +__webpack_require__.d(__webpack_exports__, { + zj: () => (/* reexport */ getConfig), + SD: () => (/* reexport */ getContext), + V6: () => (/* reexport */ getElement), + $K: () => (/* reexport */ getServerContext), + vT: () => (/* reexport */ getServerState), + jb: () => (/* binding */ privateApis), + yT: () => (/* reexport */ splitTask), + M_: () => (/* reexport */ store), + hb: () => (/* reexport */ useCallback), + vJ: () => (/* reexport */ useEffect), + ip: () => (/* reexport */ useInit), + Nf: () => (/* reexport */ useLayoutEffect), + Kr: () => (/* reexport */ useMemo), + li: () => (/* reexport */ A), + J0: () => (/* reexport */ h), + FH: () => (/* reexport */ useWatch), + v4: () => (/* reexport */ withScope) +}); + +// EXTERNAL MODULE: ./node_modules/preact/dist/preact.module.js +var preact_module = __webpack_require__(622); +;// CONCATENATED MODULE: ./node_modules/preact/hooks/dist/hooks.module.js +var hooks_module_t,r,hooks_module_u,i,hooks_module_o=0,hooks_module_f=[],hooks_module_c=preact_module/* options */.fF,e=hooks_module_c.__b,a=hooks_module_c.__r,v=hooks_module_c.diffed,l=hooks_module_c.__c,m=hooks_module_c.unmount,s=hooks_module_c.__;function d(n,t){hooks_module_c.__h&&hooks_module_c.__h(r,n,hooks_module_o||t),hooks_module_o=0;var u=r.__H||(r.__H={__:[],__h:[]});return n>=u.__.length&&u.__.push({}),u.__[n]}function h(n){return hooks_module_o=1,p(D,n)}function p(n,u,i){var o=d(hooks_module_t++,2);if(o.t=n,!o.__c&&(o.__=[i?i(u):D(void 0,u),function(n){var t=o.__N?o.__N[0]:o.__[0],r=o.t(t,n);t!==r&&(o.__N=[r,o.__[1]],o.__c.setState({}))}],o.__c=r,!r.u)){var f=function(n,t,r){if(!o.__c.__H)return!0;var u=o.__c.__H.__.filter(function(n){return!!n.__c});if(u.every(function(n){return!n.__N}))return!c||c.call(this,n,t,r);var i=!1;return u.forEach(function(n){if(n.__N){var t=n.__[0];n.__=n.__N,n.__N=void 0,t!==n.__[0]&&(i=!0)}}),!(!i&&o.__c.props===n)&&(!c||c.call(this,n,t,r))};r.u=!0;var c=r.shouldComponentUpdate,e=r.componentWillUpdate;r.componentWillUpdate=function(n,t,r){if(this.__e){var u=c;c=void 0,f(n,t,r),c=u}e&&e.call(this,n,t,r)},r.shouldComponentUpdate=f}return o.__N||o.__}function y(n,u){var i=d(hooks_module_t++,3);!hooks_module_c.__s&&C(i.__H,u)&&(i.__=n,i.i=u,r.__H.__h.push(i))}function _(n,u){var i=d(hooks_module_t++,4);!hooks_module_c.__s&&C(i.__H,u)&&(i.__=n,i.i=u,r.__h.push(i))}function A(n){return hooks_module_o=5,T(function(){return{current:n}},[])}function F(n,t,r){hooks_module_o=6,_(function(){return"function"==typeof n?(n(t()),function(){return n(null)}):n?(n.current=t(),function(){return n.current=null}):void 0},null==r?r:r.concat(n))}function T(n,r){var u=d(hooks_module_t++,7);return C(u.__H,r)&&(u.__=n(),u.__H=r,u.__h=n),u.__}function q(n,t){return hooks_module_o=8,T(function(){return n},t)}function x(n){var u=r.context[n.__c],i=d(hooks_module_t++,9);return i.c=n,u?(null==i.__&&(i.__=!0,u.sub(r)),u.props.value):n.__}function P(n,t){hooks_module_c.useDebugValue&&hooks_module_c.useDebugValue(t?t(n):n)}function b(n){var u=d(hooks_module_t++,10),i=h();return u.__=n,r.componentDidCatch||(r.componentDidCatch=function(n,t){u.__&&u.__(n,t),i[1](n)}),[i[0],function(){i[1](void 0)}]}function g(){var n=d(hooks_module_t++,11);if(!n.__){for(var u=r.__v;null!==u&&!u.__m&&null!==u.__;)u=u.__;var i=u.__m||(u.__m=[0,0]);n.__="P"+i[0]+"-"+i[1]++}return n.__}function j(){for(var n;n=hooks_module_f.shift();)if(n.__P&&n.__H)try{n.__H.__h.forEach(z),n.__H.__h.forEach(B),n.__H.__h=[]}catch(t){n.__H.__h=[],hooks_module_c.__e(t,n.__v)}}hooks_module_c.__b=function(n){r=null,e&&e(n)},hooks_module_c.__=function(n,t){n&&t.__k&&t.__k.__m&&(n.__m=t.__k.__m),s&&s(n,t)},hooks_module_c.__r=function(n){a&&a(n),hooks_module_t=0;var i=(r=n.__c).__H;i&&(hooks_module_u===r?(i.__h=[],r.__h=[],i.__.forEach(function(n){n.__N&&(n.__=n.__N),n.i=n.__N=void 0})):(i.__h.forEach(z),i.__h.forEach(B),i.__h=[],hooks_module_t=0)),hooks_module_u=r},hooks_module_c.diffed=function(n){v&&v(n);var t=n.__c;t&&t.__H&&(t.__H.__h.length&&(1!==hooks_module_f.push(t)&&i===hooks_module_c.requestAnimationFrame||((i=hooks_module_c.requestAnimationFrame)||w)(j)),t.__H.__.forEach(function(n){n.i&&(n.__H=n.i),n.i=void 0})),hooks_module_u=r=null},hooks_module_c.__c=function(n,t){t.some(function(n){try{n.__h.forEach(z),n.__h=n.__h.filter(function(n){return!n.__||B(n)})}catch(r){t.some(function(n){n.__h&&(n.__h=[])}),t=[],hooks_module_c.__e(r,n.__v)}}),l&&l(n,t)},hooks_module_c.unmount=function(n){m&&m(n);var t,r=n.__c;r&&r.__H&&(r.__H.__.forEach(function(n){try{z(n)}catch(n){t=n}}),r.__H=void 0,t&&hooks_module_c.__e(t,r.__v))};var k="function"==typeof requestAnimationFrame;function w(n){var t,r=function(){clearTimeout(u),k&&cancelAnimationFrame(t),setTimeout(n)},u=setTimeout(r,100);k&&(t=requestAnimationFrame(r))}function z(n){var t=r,u=n.__c;"function"==typeof u&&(n.__c=void 0,u()),r=t}function B(n){var t=r;n.__c=n.__(),r=t}function C(n,t){return!n||n.length!==t.length||t.some(function(t,r){return t!==n[r]})}function D(n,t){return"function"==typeof t?t(n):t} + +;// CONCATENATED MODULE: ./node_modules/@preact/signals-core/dist/signals-core.module.js +var signals_core_module_i=Symbol.for("preact-signals");function signals_core_module_t(){if(!(signals_core_module_s>1)){var i,t=!1;while(void 0!==signals_core_module_h){var r=signals_core_module_h;signals_core_module_h=void 0;signals_core_module_f++;while(void 0!==r){var o=r.o;r.o=void 0;r.f&=-3;if(!(8&r.f)&&signals_core_module_c(r))try{r.c()}catch(r){if(!t){i=r;t=!0}}r=o}}signals_core_module_f=0;signals_core_module_s--;if(t)throw i}else signals_core_module_s--}function signals_core_module_r(i){if(signals_core_module_s>0)return i();signals_core_module_s++;try{return i()}finally{signals_core_module_t()}}var signals_core_module_o=void 0;function n(i){var t=signals_core_module_o;signals_core_module_o=void 0;try{return i()}finally{signals_core_module_o=t}}var signals_core_module_h=void 0,signals_core_module_s=0,signals_core_module_f=0,signals_core_module_v=0;function signals_core_module_e(i){if(void 0!==signals_core_module_o){var t=i.n;if(void 0===t||t.t!==signals_core_module_o){t={i:0,S:i,p:signals_core_module_o.s,n:void 0,t:signals_core_module_o,e:void 0,x:void 0,r:t};if(void 0!==signals_core_module_o.s)signals_core_module_o.s.n=t;signals_core_module_o.s=t;i.n=t;if(32&signals_core_module_o.f)i.S(t);return t}else if(-1===t.i){t.i=0;if(void 0!==t.n){t.n.p=t.p;if(void 0!==t.p)t.p.n=t.n;t.p=signals_core_module_o.s;t.n=void 0;signals_core_module_o.s.n=t;signals_core_module_o.s=t}return t}}}function signals_core_module_u(i){this.v=i;this.i=0;this.n=void 0;this.t=void 0}signals_core_module_u.prototype.brand=signals_core_module_i;signals_core_module_u.prototype.h=function(){return!0};signals_core_module_u.prototype.S=function(i){if(this.t!==i&&void 0===i.e){i.x=this.t;if(void 0!==this.t)this.t.e=i;this.t=i}};signals_core_module_u.prototype.U=function(i){if(void 0!==this.t){var t=i.e,r=i.x;if(void 0!==t){t.x=r;i.e=void 0}if(void 0!==r){r.e=t;i.x=void 0}if(i===this.t)this.t=r}};signals_core_module_u.prototype.subscribe=function(i){var t=this;return E(function(){var r=t.value,n=signals_core_module_o;signals_core_module_o=void 0;try{i(r)}finally{signals_core_module_o=n}})};signals_core_module_u.prototype.valueOf=function(){return this.value};signals_core_module_u.prototype.toString=function(){return this.value+""};signals_core_module_u.prototype.toJSON=function(){return this.value};signals_core_module_u.prototype.peek=function(){var i=signals_core_module_o;signals_core_module_o=void 0;try{return this.value}finally{signals_core_module_o=i}};Object.defineProperty(signals_core_module_u.prototype,"value",{get:function(){var i=signals_core_module_e(this);if(void 0!==i)i.i=this.i;return this.v},set:function(i){if(i!==this.v){if(signals_core_module_f>100)throw new Error("Cycle detected");this.v=i;this.i++;signals_core_module_v++;signals_core_module_s++;try{for(var r=this.t;void 0!==r;r=r.x)r.t.N()}finally{signals_core_module_t()}}}});function signals_core_module_d(i){return new signals_core_module_u(i)}function signals_core_module_c(i){for(var t=i.s;void 0!==t;t=t.n)if(t.S.i!==t.i||!t.S.h()||t.S.i!==t.i)return!0;return!1}function signals_core_module_a(i){for(var t=i.s;void 0!==t;t=t.n){var r=t.S.n;if(void 0!==r)t.r=r;t.S.n=t;t.i=-1;if(void 0===t.n){i.s=t;break}}}function signals_core_module_l(i){var t=i.s,r=void 0;while(void 0!==t){var o=t.p;if(-1===t.i){t.S.U(t);if(void 0!==o)o.n=t.n;if(void 0!==t.n)t.n.p=o}else r=t;t.S.n=t.r;if(void 0!==t.r)t.r=void 0;t=o}i.s=r}function signals_core_module_y(i){signals_core_module_u.call(this,void 0);this.x=i;this.s=void 0;this.g=signals_core_module_v-1;this.f=4}(signals_core_module_y.prototype=new signals_core_module_u).h=function(){this.f&=-3;if(1&this.f)return!1;if(32==(36&this.f))return!0;this.f&=-5;if(this.g===signals_core_module_v)return!0;this.g=signals_core_module_v;this.f|=1;if(this.i>0&&!signals_core_module_c(this)){this.f&=-2;return!0}var i=signals_core_module_o;try{signals_core_module_a(this);signals_core_module_o=this;var t=this.x();if(16&this.f||this.v!==t||0===this.i){this.v=t;this.f&=-17;this.i++}}catch(i){this.v=i;this.f|=16;this.i++}signals_core_module_o=i;signals_core_module_l(this);this.f&=-2;return!0};signals_core_module_y.prototype.S=function(i){if(void 0===this.t){this.f|=36;for(var t=this.s;void 0!==t;t=t.n)t.S.S(t)}signals_core_module_u.prototype.S.call(this,i)};signals_core_module_y.prototype.U=function(i){if(void 0!==this.t){signals_core_module_u.prototype.U.call(this,i);if(void 0===this.t){this.f&=-33;for(var t=this.s;void 0!==t;t=t.n)t.S.U(t)}}};signals_core_module_y.prototype.N=function(){if(!(2&this.f)){this.f|=6;for(var i=this.t;void 0!==i;i=i.x)i.t.N()}};Object.defineProperty(signals_core_module_y.prototype,"value",{get:function(){if(1&this.f)throw new Error("Cycle detected");var i=signals_core_module_e(this);this.h();if(void 0!==i)i.i=this.i;if(16&this.f)throw this.v;return this.v}});function signals_core_module_w(i){return new signals_core_module_y(i)}function signals_core_module_(i){var r=i.u;i.u=void 0;if("function"==typeof r){signals_core_module_s++;var n=signals_core_module_o;signals_core_module_o=void 0;try{r()}catch(t){i.f&=-2;i.f|=8;signals_core_module_g(i);throw t}finally{signals_core_module_o=n;signals_core_module_t()}}}function signals_core_module_g(i){for(var t=i.s;void 0!==t;t=t.n)t.S.U(t);i.x=void 0;i.s=void 0;signals_core_module_(i)}function signals_core_module_p(i){if(signals_core_module_o!==this)throw new Error("Out-of-order effect");signals_core_module_l(this);signals_core_module_o=i;this.f&=-2;if(8&this.f)signals_core_module_g(this);signals_core_module_t()}function signals_core_module_b(i){this.x=i;this.u=void 0;this.s=void 0;this.o=void 0;this.f=32}signals_core_module_b.prototype.c=function(){var i=this.S();try{if(8&this.f)return;if(void 0===this.x)return;var t=this.x();if("function"==typeof t)this.u=t}finally{i()}};signals_core_module_b.prototype.S=function(){if(1&this.f)throw new Error("Cycle detected");this.f|=1;this.f&=-9;signals_core_module_(this);signals_core_module_a(this);signals_core_module_s++;var i=signals_core_module_o;signals_core_module_o=this;return signals_core_module_p.bind(this,i)};signals_core_module_b.prototype.N=function(){if(!(2&this.f)){this.f|=2;this.o=signals_core_module_h;signals_core_module_h=this}};signals_core_module_b.prototype.d=function(){this.f|=8;if(!(1&this.f))signals_core_module_g(this)};function E(i){var t=new signals_core_module_b(i);try{t.c()}catch(i){t.d();throw i}return t.d.bind(t)} +;// CONCATENATED MODULE: ./node_modules/@preact/signals/dist/signals.module.js +var signals_module_v,signals_module_s;function signals_module_l(n,i){preact_module/* options */.fF[n]=i.bind(null,preact_module/* options */.fF[n]||function(){})}function signals_module_d(n){if(signals_module_s)signals_module_s();signals_module_s=n&&n.S()}function signals_module_p(n){var r=this,f=n.data,o=useSignal(f);o.value=f;var e=T(function(){var n=r.__v;while(n=n.__)if(n.__c){n.__c.__$f|=4;break}r.__$u.c=function(){var n;if(!(0,preact_module/* isValidElement */.zO)(e.peek())&&3===(null==(n=r.base)?void 0:n.nodeType))r.base.data=e.peek();else{r.__$f|=1;r.setState({})}};return signals_core_module_w(function(){var n=o.value.value;return 0===n?0:!0===n?"":n||""})},[]);return e.value}signals_module_p.displayName="_st";Object.defineProperties(signals_core_module_u.prototype,{constructor:{configurable:!0,value:void 0},type:{configurable:!0,value:signals_module_p},props:{configurable:!0,get:function(){return{data:this}}},__b:{configurable:!0,value:1}});signals_module_l("__b",function(n,r){if("string"==typeof r.type){var i,t=r.props;for(var f in t)if("children"!==f){var o=t[f];if(o instanceof signals_core_module_u){if(!i)r.__np=i={};i[f]=o;t[f]=o.peek()}}}n(r)});signals_module_l("__r",function(n,r){signals_module_d();var i,t=r.__c;if(t){t.__$f&=-2;if(void 0===(i=t.__$u))t.__$u=i=function(n){var r;E(function(){r=this});r.c=function(){t.__$f|=1;t.setState({})};return r}()}signals_module_v=t;signals_module_d(i);n(r)});signals_module_l("__e",function(n,r,i,t){signals_module_d();signals_module_v=void 0;n(r,i,t)});signals_module_l("diffed",function(n,r){signals_module_d();signals_module_v=void 0;var i;if("string"==typeof r.type&&(i=r.__e)){var t=r.__np,f=r.props;if(t){var o=i.U;if(o)for(var e in o){var u=o[e];if(void 0!==u&&!(e in t)){u.d();o[e]=void 0}}else i.U=o={};for(var a in t){var c=o[a],s=t[a];if(void 0===c){c=signals_module_(i,a,s,f);o[a]=c}else c.o(s,f)}}}n(r)});function signals_module_(n,r,i,t){var f=r in n&&void 0===n.ownerSVGElement,o=signals_core_module_d(i);return{o:function(n,r){o.value=n;t=r},d:E(function(){var i=o.value.value;if(t[r]!==i){t[r]=i;if(f)n[r]=i;else if(i)n.setAttribute(r,i);else n.removeAttribute(r)}})}}signals_module_l("unmount",function(n,r){if("string"==typeof r.type){var i=r.__e;if(i){var t=i.U;if(t){i.U=void 0;for(var f in t){var o=t[f];if(o)o.d()}}}}else{var e=r.__c;if(e){var u=e.__$u;if(u){e.__$u=void 0;u.d()}}}n(r)});signals_module_l("__h",function(n,r,i,t){if(t<3||9===t)r.__$f|=2;n(r,i,t)});preact_module/* Component */.uA.prototype.shouldComponentUpdate=function(n,r){var i=this.__$u;if(!(i&&void 0!==i.s||4&this.__$f))return!0;if(3&this.__$f)return!0;for(var t in r)return!0;for(var f in n)if("__source"!==f&&n[f]!==this.props[f])return!0;for(var o in this.props)if(!(o in n))return!0;return!1};function useSignal(n){return T(function(){return signals_core_module_d(n)},[])}function useComputed(n){var r=f(n);r.current=n;signals_module_v.__$f|=4;return t(function(){return u(function(){return r.current()})},[])}function useSignalEffect(n){var r=f(n);r.current=n;o(function(){return c(function(){return r.current()})},[])} +;// CONCATENATED MODULE: ./node_modules/@wordpress/interactivity/build-module/namespaces.js +const namespaceStack = []; +const getNamespace = () => namespaceStack.slice(-1)[0]; +const setNamespace = namespace => { + namespaceStack.push(namespace); +}; +const resetNamespace = () => { + namespaceStack.pop(); +}; + +;// CONCATENATED MODULE: ./node_modules/@wordpress/interactivity/build-module/scopes.js +/** + * External dependencies + */ + +/** + * Internal dependencies + */ + +// Store stacks for the current scope and the default namespaces and export APIs +// to interact with them. +const scopeStack = []; +const getScope = () => scopeStack.slice(-1)[0]; +const setScope = scope => { + scopeStack.push(scope); +}; +const resetScope = () => { + scopeStack.pop(); +}; + +// Wrap the element props to prevent modifications. +const immutableMap = new WeakMap(); +const immutableError = () => { + throw new Error('Please use `data-wp-bind` to modify the attributes of an element.'); +}; +const immutableHandlers = { + get(target, key, receiver) { + const value = Reflect.get(target, key, receiver); + return !!value && typeof value === 'object' ? deepImmutable(value) : value; + }, + set: immutableError, + deleteProperty: immutableError +}; +const deepImmutable = target => { + if (!immutableMap.has(target)) { + immutableMap.set(target, new Proxy(target, immutableHandlers)); + } + return immutableMap.get(target); +}; + +/** + * Retrieves the context inherited by the element evaluating a function from the + * store. The returned value depends on the element and the namespace where the + * function calling `getContext()` exists. + * + * @param namespace Store namespace. By default, the namespace where the calling + * function exists is used. + * @return The context content. + */ +const getContext = namespace => { + const scope = getScope(); + if (true) { + if (!scope) { + throw Error('Cannot call `getContext()` when there is no scope. If you are using an async function, please consider using a generator instead. If you are using some sort of async callbacks, like `setTimeout`, please wrap the callback with `withScope(callback)`.'); + } + } + return scope.context[namespace || getNamespace()]; +}; + +/** + * Retrieves a representation of the element where a function from the store + * is being evalutated. Such representation is read-only, and contains a + * reference to the DOM element, its props and a local reactive state. + * + * @return Element representation. + */ +const getElement = () => { + const scope = getScope(); + if (true) { + if (!scope) { + throw Error('Cannot call `getElement()` when there is no scope. If you are using an async function, please consider using a generator instead. If you are using some sort of async callbacks, like `setTimeout`, please wrap the callback with `withScope(callback)`.'); + } + } + const { + ref, + attributes + } = scope; + return Object.freeze({ + ref: ref.current, + attributes: deepImmutable(attributes) + }); +}; + +/** + * Retrieves the part of the inherited context defined and updated from the + * server. + * + * The object returned is read-only, and includes the context defined in PHP + * with `wp_interactivity_data_wp_context()`, including the corresponding + * inherited properties. When `actions.navigate()` is called, this object is + * updated to reflect the changes in the new visited page, without affecting the + * context returned by `getContext()`. Directives can subscribe to those changes + * to update the context if needed. + * + * @example + * ```js + * store('...', { + * callbacks: { + * updateServerContext() { + * const context = getContext(); + * const serverContext = getServerContext(); + * // Override some property with the new value that came from the server. + * context.overridableProp = serverContext.overridableProp; + * }, + * }, + * }); + * ``` + * + * @param namespace Store namespace. By default, the namespace where the calling + * function exists is used. + * @return The server context content. + */ +const getServerContext = namespace => { + const scope = getScope(); + if (true) { + if (!scope) { + throw Error('Cannot call `getServerContext()` when there is no scope. If you are using an async function, please consider using a generator instead. If you are using some sort of async callbacks, like `setTimeout`, please wrap the callback with `withScope(callback)`.'); + } + } + return scope.serverContext[namespace || getNamespace()]; +}; + +;// CONCATENATED MODULE: ./node_modules/@wordpress/interactivity/build-module/utils.js +/** + * External dependencies + */ + + + +/** + * Internal dependencies + */ + + +/** + * Executes a callback function after the next frame is rendered. + * + * @param callback The callback function to be executed. + * @return A promise that resolves after the callback function is executed. + */ +const afterNextFrame = callback => { + return new Promise(resolve => { + const done = () => { + clearTimeout(timeout); + window.cancelAnimationFrame(raf); + setTimeout(() => { + callback(); + resolve(); + }); + }; + const timeout = setTimeout(done, 100); + const raf = window.requestAnimationFrame(done); + }); +}; + +/** + * Returns a promise that resolves after yielding to main. + * + * @return Promise + */ +const splitTask = () => { + return new Promise(resolve => { + // TODO: Use scheduler.yield() when available. + setTimeout(resolve, 0); + }); +}; + +/** + * Creates a Flusher object that can be used to flush computed values and notify listeners. + * + * Using the mangled properties: + * this.c: this._callback + * this.x: this._compute + * https://github.com/preactjs/signals/blob/main/mangle.json + * + * @param compute The function that computes the value to be flushed. + * @param notify The function that notifies listeners when the value is flushed. + * @return The Flusher object with `flush` and `dispose` properties. + */ +function createFlusher(compute, notify) { + let flush = () => undefined; + const dispose = E(function () { + flush = this.c.bind(this); + this.x = compute; + this.c = notify; + return compute(); + }); + return { + flush, + dispose + }; +} + +/** + * Custom hook that executes a callback function whenever a signal is triggered. + * Version of `useSignalEffect` with a `useEffect`-like execution. This hook + * implementation comes from this PR, but we added short-cirtuiting to avoid + * infinite loops: https://github.com/preactjs/signals/pull/290 + * + * @param callback The callback function to be executed. + */ +function utils_useSignalEffect(callback) { + y(() => { + let eff = null; + let isExecuting = false; + const notify = async () => { + if (eff && !isExecuting) { + isExecuting = true; + await afterNextFrame(eff.flush); + isExecuting = false; + } + }; + eff = createFlusher(callback, notify); + return eff.dispose; + }, []); +} + +/** + * Returns the passed function wrapped with the current scope so it is + * accessible whenever the function runs. This is primarily to make the scope + * available inside hook callbacks. + * + * Asyncronous functions should use generators that yield promises instead of awaiting them. + * See the documentation for details: https://developer.wordpress.org/block-editor/reference-guides/packages/packages-interactivity/packages-interactivity-api-reference/#the-store + * + * @param func The passed function. + * @return The wrapped function. + */ + +function withScope(func) { + const scope = getScope(); + const ns = getNamespace(); + if (func?.constructor?.name === 'GeneratorFunction') { + return async (...args) => { + const gen = func(...args); + let value; + let it; + while (true) { + setNamespace(ns); + setScope(scope); + try { + it = gen.next(value); + } finally { + resetScope(); + resetNamespace(); + } + try { + value = await it.value; + } catch (e) { + setNamespace(ns); + setScope(scope); + gen.throw(e); + } finally { + resetScope(); + resetNamespace(); + } + if (it.done) { + break; + } + } + return value; + }; + } + return (...args) => { + setNamespace(ns); + setScope(scope); + try { + return func(...args); + } finally { + resetNamespace(); + resetScope(); + } + }; +} + +/** + * Accepts a function that contains imperative code which runs whenever any of + * the accessed _reactive_ properties (e.g., values from the global state or the + * context) is modified. + * + * This hook makes the element's scope available so functions like + * `getElement()` and `getContext()` can be used inside the passed callback. + * + * @param callback The hook callback. + */ +function useWatch(callback) { + utils_useSignalEffect(withScope(callback)); +} + +/** + * Accepts a function that contains imperative code which runs only after the + * element's first render, mainly useful for intialization logic. + * + * This hook makes the element's scope available so functions like + * `getElement()` and `getContext()` can be used inside the passed callback. + * + * @param callback The hook callback. + */ +function useInit(callback) { + y(withScope(callback), []); +} + +/** + * Accepts a function that contains imperative, possibly effectful code. The + * effects run after browser paint, without blocking it. + * + * This hook is equivalent to Preact's `useEffect` and makes the element's scope + * available so functions like `getElement()` and `getContext()` can be used + * inside the passed callback. + * + * @param callback Imperative function that can return a cleanup + * function. + * @param inputs If present, effect will only activate if the + * values in the list change (using `===`). + */ +function useEffect(callback, inputs) { + y(withScope(callback), inputs); +} + +/** + * Accepts a function that contains imperative, possibly effectful code. Use + * this to read layout from the DOM and synchronously re-render. + * + * This hook is equivalent to Preact's `useLayoutEffect` and makes the element's + * scope available so functions like `getElement()` and `getContext()` can be + * used inside the passed callback. + * + * @param callback Imperative function that can return a cleanup + * function. + * @param inputs If present, effect will only activate if the + * values in the list change (using `===`). + */ +function useLayoutEffect(callback, inputs) { + _(withScope(callback), inputs); +} + +/** + * Returns a memoized version of the callback that only changes if one of the + * inputs has changed (using `===`). + * + * This hook is equivalent to Preact's `useCallback` and makes the element's + * scope available so functions like `getElement()` and `getContext()` can be + * used inside the passed callback. + * + * @param callback Callback function. + * @param inputs If present, the callback will only be updated if the + * values in the list change (using `===`). + * + * @return The callback function. + */ +function useCallback(callback, inputs) { + return q(withScope(callback), inputs); +} + +/** + * Pass a factory function and an array of inputs. `useMemo` will only recompute + * the memoized value when one of the inputs has changed. + * + * This hook is equivalent to Preact's `useMemo` and makes the element's scope + * available so functions like `getElement()` and `getContext()` can be used + * inside the passed factory function. + * + * @param factory Factory function that returns that value for memoization. + * @param inputs If present, the factory will only be run to recompute if + * the values in the list change (using `===`). + * + * @return The memoized value. + */ +function useMemo(factory, inputs) { + return T(withScope(factory), inputs); +} + +/** + * Creates a root fragment by replacing a node or an array of nodes in a parent element. + * For wrapperless hydration. + * See https://gist.github.com/developit/f4c67a2ede71dc2fab7f357f39cff28c + * + * @param parent The parent element where the nodes will be replaced. + * @param replaceNode The node or array of nodes to replace in the parent element. + * @return The created root fragment. + */ +const createRootFragment = (parent, replaceNode) => { + replaceNode = [].concat(replaceNode); + const sibling = replaceNode[replaceNode.length - 1].nextSibling; + function insert(child, root) { + parent.insertBefore(child, root || sibling); + } + return parent.__k = { + nodeType: 1, + parentNode: parent, + firstChild: replaceNode[0], + childNodes: replaceNode, + insertBefore: insert, + appendChild: insert, + removeChild(c) { + parent.removeChild(c); + } + }; +}; + +/** + * Transforms a kebab-case string to camelCase. + * + * @param str The kebab-case string to transform to camelCase. + * @return The transformed camelCase string. + */ +function kebabToCamelCase(str) { + return str.replace(/^-+|-+$/g, '').toLowerCase().replace(/-([a-z])/g, function (_match, group1) { + return group1.toUpperCase(); + }); +} +const logged = new Set(); + +/** + * Shows a warning with `message` if environment is not `production`. + * + * Based on the `@wordpress/warning` package. + * + * @param message Message to show in the warning. + */ +const warn = message => { + if (true) { + if (logged.has(message)) { + return; + } + + // eslint-disable-next-line no-console + console.warn(message); + + // Throwing an error and catching it immediately to improve debugging + // A consumer can use 'pause on caught exceptions' + try { + throw Error(message); + } catch (e) { + // Do nothing. + } + logged.add(message); + } +}; + +/** + * Checks if the passed `candidate` is a plain object with just the `Object` + * prototype. + * + * @param candidate The item to check. + * @return Whether `candidate` is a plain object. + */ +const isPlainObject = candidate => Boolean(candidate && typeof candidate === 'object' && candidate.constructor === Object); + +;// CONCATENATED MODULE: ./node_modules/@wordpress/interactivity/build-module/proxies/registry.js +/** + * Proxies for each object. + */ +const objToProxy = new WeakMap(); +const proxyToObj = new WeakMap(); + +/** + * Namespaces for each created proxy. + */ +const proxyToNs = new WeakMap(); + +/** + * Object types that can be proxied. + */ +const supported = new Set([Object, Array]); + +/** + * Returns a proxy to the passed object with the given handlers, assigning the + * specified namespace to it. If a proxy for the passed object was created + * before, that proxy is returned. + * + * @param namespace The namespace that will be associated to this proxy. + * @param obj The object to proxify. + * @param handlers Handlers that the proxy will use. + * + * @throws Error if the object cannot be proxified. Use {@link shouldProxy} to + * check if a proxy can be created for a specific object. + * + * @return The created proxy. + */ +const createProxy = (namespace, obj, handlers) => { + if (!shouldProxy(obj)) { + throw Error('This object cannot be proxified.'); + } + if (!objToProxy.has(obj)) { + const proxy = new Proxy(obj, handlers); + objToProxy.set(obj, proxy); + proxyToObj.set(proxy, obj); + proxyToNs.set(proxy, namespace); + } + return objToProxy.get(obj); +}; + +/** + * Returns the proxy for the given object. If there is no associated proxy, the + * function returns `undefined`. + * + * @param obj Object from which to know the proxy. + * @return Associated proxy or `undefined`. + */ +const getProxyFromObject = obj => objToProxy.get(obj); + +/** + * Gets the namespace associated with the given proxy. + * + * Proxies have a namespace assigned upon creation. See {@link createProxy}. + * + * @param proxy Proxy. + * @return Namespace. + */ +const getNamespaceFromProxy = proxy => proxyToNs.get(proxy); + +/** + * Checks if a given object can be proxied. + * + * @param candidate Object to know whether it can be proxied. + * @return True if the passed instance can be proxied. + */ +const shouldProxy = candidate => { + if (typeof candidate !== 'object' || candidate === null) { + return false; + } + return !proxyToNs.has(candidate) && supported.has(candidate.constructor); +}; + +/** + * Returns the target object for the passed proxy. If the passed object is not a registered proxy, the + * function returns `undefined`. + * + * @param proxy Proxy from which to know the target. + * @return The target object or `undefined`. + */ +const getObjectFromProxy = proxy => proxyToObj.get(proxy); + +;// CONCATENATED MODULE: ./node_modules/@wordpress/interactivity/build-module/proxies/signals.js +/** + * External dependencies + */ + + +/** + * Internal dependencies + */ + + + + + +/** + * Identifier for property computeds not associated to any scope. + */ +const NO_SCOPE = {}; + +/** + * Structure that manages reactivity for a property in a state object. It uses + * signals to keep track of property value or getter modifications. + */ +class PropSignal { + /** + * Proxy that holds the property this PropSignal is associated with. + */ + + /** + * Relation of computeds by scope. These computeds are read-only signals + * that depend on whether the property is a value or a getter and, + * therefore, can return different values depending on the scope in which + * the getter is accessed. + */ + + /** + * Signal with the value assigned to the related property. + */ + + /** + * Signal with the getter assigned to the related property. + */ + + /** + * Structure that manages reactivity for a property in a state object, using + * signals to keep track of property value or getter modifications. + * + * @param owner Proxy that holds the property this instance is associated + * with. + */ + constructor(owner) { + this.owner = owner; + this.computedsByScope = new WeakMap(); + } + + /** + * Changes the internal value. If a getter was set before, it is set to + * `undefined`. + * + * @param value New value. + */ + setValue(value) { + this.update({ + value + }); + } + + /** + * Changes the internal getter. If a value was set before, it is set to + * `undefined`. + * + * @param getter New getter. + */ + setGetter(getter) { + this.update({ + get: getter + }); + } + + /** + * Returns the computed that holds the result of evaluating the prop in the + * current scope. + * + * These computeds are read-only signals that depend on whether the property + * is a value or a getter and, therefore, can return different values + * depending on the scope in which the getter is accessed. + * + * @return Computed that depends on the scope. + */ + getComputed() { + const scope = getScope() || NO_SCOPE; + if (!this.valueSignal && !this.getterSignal) { + this.update({}); + } + if (!this.computedsByScope.has(scope)) { + const callback = () => { + const getter = this.getterSignal?.value; + return getter ? getter.call(this.owner) : this.valueSignal?.value; + }; + setNamespace(getNamespaceFromProxy(this.owner)); + this.computedsByScope.set(scope, signals_core_module_w(withScope(callback))); + resetNamespace(); + } + return this.computedsByScope.get(scope); + } + + /** + * Update the internal signals for the value and the getter of the + * corresponding prop. + * + * @param param0 + * @param param0.get New getter. + * @param param0.value New value. + */ + update({ + get, + value + }) { + if (!this.valueSignal) { + this.valueSignal = signals_core_module_d(value); + this.getterSignal = signals_core_module_d(get); + } else if (value !== this.valueSignal.peek() || get !== this.getterSignal.peek()) { + signals_core_module_r(() => { + this.valueSignal.value = value; + this.getterSignal.value = get; + }); + } + } +} + +;// CONCATENATED MODULE: ./node_modules/@wordpress/interactivity/build-module/proxies/state.js +/** + * External dependencies + */ + + +/** + * Internal dependencies + */ + + + + + +/** + * Set of built-in symbols. + */ +const wellKnownSymbols = new Set(Object.getOwnPropertyNames(Symbol).map(key => Symbol[key]).filter(value => typeof value === 'symbol')); + +/** + * Relates each proxy with a map of {@link PropSignal} instances, representing + * the proxy's accessed properties. + */ +const proxyToProps = new WeakMap(); + +/** + * Checks wether a {@link PropSignal | `PropSignal`} instance exists for the + * given property in the passed proxy. + * + * @param proxy Proxy of a state object or array. + * @param key The property key. + * @return `true` when it exists; false otherwise. + */ +const hasPropSignal = (proxy, key) => proxyToProps.has(proxy) && proxyToProps.get(proxy).has(key); +const readOnlyProxies = new WeakSet(); + +/** + * Returns the {@link PropSignal | `PropSignal`} instance associated with the + * specified prop in the passed proxy. + * + * The `PropSignal` instance is generated if it doesn't exist yet, using the + * `initial` parameter to initialize the internal signals. + * + * @param proxy Proxy of a state object or array. + * @param key The property key. + * @param initial Initial data for the `PropSignal` instance. + * @return The `PropSignal` instance. + */ +const getPropSignal = (proxy, key, initial) => { + if (!proxyToProps.has(proxy)) { + proxyToProps.set(proxy, new Map()); + } + key = typeof key === 'number' ? `${key}` : key; + const props = proxyToProps.get(proxy); + if (!props.has(key)) { + const ns = getNamespaceFromProxy(proxy); + const prop = new PropSignal(proxy); + props.set(key, prop); + if (initial) { + const { + get, + value + } = initial; + if (get) { + prop.setGetter(get); + } else { + const readOnly = readOnlyProxies.has(proxy); + prop.setValue(shouldProxy(value) ? proxifyState(ns, value, { + readOnly + }) : value); + } + } + } + return props.get(key); +}; + +/** + * Relates each proxied object (i.e., the original object) with a signal that + * tracks changes in the number of properties. + */ +const objToIterable = new WeakMap(); + +/** + * When this flag is `true`, it avoids any signal subscription, overriding state + * props' "reactive" behavior. + */ +let peeking = false; + +/** + * Handlers for reactive objects and arrays in the state. + */ +const stateHandlers = { + get(target, key, receiver) { + /* + * The property should not be reactive for the following cases: + * 1. While using the `peek` function to read the property. + * 2. The property exists but comes from the Object or Array prototypes. + * 3. The property key is a known symbol. + */ + if (peeking || !target.hasOwnProperty(key) && key in target || typeof key === 'symbol' && wellKnownSymbols.has(key)) { + return Reflect.get(target, key, receiver); + } + + // At this point, the property should be reactive. + const desc = Object.getOwnPropertyDescriptor(target, key); + const prop = getPropSignal(receiver, key, desc); + const result = prop.getComputed().value; + + /* + * Check if the property is a synchronous function. If it is, set the + * default namespace. Synchronous functions always run in the proper scope, + * which is set by the Directives component. + */ + if (typeof result === 'function') { + const ns = getNamespaceFromProxy(receiver); + return (...args) => { + setNamespace(ns); + try { + return result.call(receiver, ...args); + } finally { + resetNamespace(); + } + }; + } + return result; + }, + set(target, key, value, receiver) { + if (readOnlyProxies.has(receiver)) { + return false; + } + setNamespace(getNamespaceFromProxy(receiver)); + try { + return Reflect.set(target, key, value, receiver); + } finally { + resetNamespace(); + } + }, + defineProperty(target, key, desc) { + if (readOnlyProxies.has(getProxyFromObject(target))) { + return false; + } + const isNew = !(key in target); + const result = Reflect.defineProperty(target, key, desc); + if (result) { + const receiver = getProxyFromObject(target); + const prop = getPropSignal(receiver, key); + const { + get, + value + } = desc; + if (get) { + prop.setGetter(get); + } else { + const ns = getNamespaceFromProxy(receiver); + prop.setValue(shouldProxy(value) ? proxifyState(ns, value) : value); + } + if (isNew && objToIterable.has(target)) { + objToIterable.get(target).value++; + } + + /* + * Modify the `length` property value only if the related + * `PropSignal` exists, which means that there are subscriptions to + * this property. + */ + if (Array.isArray(target) && proxyToProps.get(receiver)?.has('length')) { + const length = getPropSignal(receiver, 'length'); + length.setValue(target.length); + } + } + return result; + }, + deleteProperty(target, key) { + if (readOnlyProxies.has(getProxyFromObject(target))) { + return false; + } + const result = Reflect.deleteProperty(target, key); + if (result) { + const prop = getPropSignal(getProxyFromObject(target), key); + prop.setValue(undefined); + if (objToIterable.has(target)) { + objToIterable.get(target).value++; + } + } + return result; + }, + ownKeys(target) { + if (!objToIterable.has(target)) { + objToIterable.set(target, signals_core_module_d(0)); + } + /* + *This subscribes to the signal while preventing the minifier from + * deleting this line in production. + */ + objToIterable._ = objToIterable.get(target).value; + return Reflect.ownKeys(target); + } +}; + +/** + * Returns the proxy associated with the given state object, creating it if it + * does not exist. + * + * @param namespace The namespace that will be associated to this proxy. + * @param obj The object to proxify. + * @param options Options. + * @param options.readOnly Read-only. + * + * @throws Error if the object cannot be proxified. Use {@link shouldProxy} to + * check if a proxy can be created for a specific object. + * + * @return The associated proxy. + */ +const proxifyState = (namespace, obj, options) => { + const proxy = createProxy(namespace, obj, stateHandlers); + if (options?.readOnly) { + readOnlyProxies.add(proxy); + } + return proxy; +}; + +/** + * Reads the value of the specified property without subscribing to it. + * + * @param obj The object to read the property from. + * @param key The property key. + * @return The property value. + */ +const peek = (obj, key) => { + peeking = true; + try { + return obj[key]; + } finally { + peeking = false; + } +}; + +/** + * Internal recursive implementation for {@link deepMerge | `deepMerge`}. + * + * @param target The target object. + * @param source The source object containing new values and props. + * @param override Whether existing props should be overwritten or not (`true` + * by default). + */ +const deepMergeRecursive = (target, source, override = true) => { + if (isPlainObject(target) && isPlainObject(source)) { + let hasNewKeys = false; + for (const key in source) { + const isNew = !(key in target); + hasNewKeys = hasNewKeys || isNew; + const desc = Object.getOwnPropertyDescriptor(source, key); + if (typeof desc?.get === 'function' || typeof desc?.set === 'function') { + if (override || isNew) { + Object.defineProperty(target, key, { + ...desc, + configurable: true, + enumerable: true + }); + const proxy = getProxyFromObject(target); + if (desc?.get && proxy && hasPropSignal(proxy, key)) { + const propSignal = getPropSignal(proxy, key); + propSignal.setGetter(desc.get); + } + } + } else if (isPlainObject(source[key])) { + if (isNew) { + target[key] = {}; + } + deepMergeRecursive(target[key], source[key], override); + } else if (override || isNew) { + Object.defineProperty(target, key, desc); + const proxy = getProxyFromObject(target); + if (desc?.value && proxy && hasPropSignal(proxy, key)) { + const propSignal = getPropSignal(proxy, key); + propSignal.setValue(desc.value); + } + } + } + if (hasNewKeys && objToIterable.has(target)) { + objToIterable.get(target).value++; + } + } +}; + +/** + * Recursively update prop values inside the passed `target` and nested plain + * objects, using the values present in `source`. References to plain objects + * are kept, only updating props containing primitives or arrays. Arrays are + * replaced instead of merged or concatenated. + * + * If the `override` parameter is set to `false`, then all values in `target` + * are preserved, and only new properties from `source` are added. + * + * @param target The target object. + * @param source The source object containing new values and props. + * @param override Whether existing props should be overwritten or not (`true` + * by default). + */ +const deepMerge = (target, source, override = true) => signals_core_module_r(() => deepMergeRecursive(getObjectFromProxy(target) || target, source, override)); + +;// CONCATENATED MODULE: ./node_modules/@wordpress/interactivity/build-module/proxies/store.js +/** + * Internal dependencies + */ + +/** + * External dependencies + */ + + + +/** + * Identifies the store proxies handling the root objects of each store. + */ +const storeRoots = new WeakSet(); + +/** + * Handlers for store proxies. + */ +const storeHandlers = { + get: (target, key, receiver) => { + const result = Reflect.get(target, key); + const ns = getNamespaceFromProxy(receiver); + + /* + * Check if the proxy is the store root and no key with that name exist. In + * that case, return an empty object for the requested key. + */ + if (typeof result === 'undefined' && storeRoots.has(receiver)) { + const obj = {}; + Reflect.set(target, key, obj); + return proxifyStore(ns, obj, false); + } + + /* + * Check if the property is a function. If it is, add the store + * namespace to the stack and wrap the function with the current scope. + * The `withScope` util handles both synchronous functions and generator + * functions. + */ + if (typeof result === 'function') { + setNamespace(ns); + const scoped = withScope(result); + resetNamespace(); + return scoped; + } + + // Check if the property is an object. If it is, proxyify it. + if (isPlainObject(result) && shouldProxy(result)) { + return proxifyStore(ns, result, false); + } + return result; + } +}; + +/** + * Returns the proxy associated with the given store object, creating it if it + * does not exist. + * + * @param namespace The namespace that will be associated to this proxy. + * @param obj The object to proxify. + * + * @param isRoot Whether the passed object is the store root object. + * @throws Error if the object cannot be proxified. Use {@link shouldProxy} to + * check if a proxy can be created for a specific object. + * + * @return The associated proxy. + */ +const proxifyStore = (namespace, obj, isRoot = true) => { + const proxy = createProxy(namespace, obj, storeHandlers); + if (proxy && isRoot) { + storeRoots.add(proxy); + } + return proxy; +}; + +;// CONCATENATED MODULE: ./node_modules/@wordpress/interactivity/build-module/proxies/context.js +const contextObjectToProxy = new WeakMap(); +const contextObjectToFallback = new WeakMap(); +const contextProxies = new WeakSet(); +const descriptor = Reflect.getOwnPropertyDescriptor; + +// TODO: Use the proxy registry to avoid multiple proxies on the same object. +const contextHandlers = { + get: (target, key) => { + const fallback = contextObjectToFallback.get(target); + // Always subscribe to prop changes in the current context. + const currentProp = target[key]; + + /* + * Return the value from `target` if it exists, or from `fallback` + * otherwise. This way, in the case the property doesn't exist either in + * `target` or `fallback`, it also subscribes to changes in the parent + * context. + */ + return key in target ? currentProp : fallback[key]; + }, + set: (target, key, value) => { + const fallback = contextObjectToFallback.get(target); + + // If the property exists in the current context, modify it. Otherwise, + // add it to the current context. + const obj = key in target || !(key in fallback) ? target : fallback; + obj[key] = value; + return true; + }, + ownKeys: target => [...new Set([...Object.keys(contextObjectToFallback.get(target)), ...Object.keys(target)])], + getOwnPropertyDescriptor: (target, key) => descriptor(target, key) || descriptor(contextObjectToFallback.get(target), key) +}; + +/** + * Wrap a context object with a proxy to reproduce the context stack. The proxy + * uses the passed `inherited` context as a fallback to look up for properties + * that don't exist in the given context. Also, updated properties are modified + * where they are defined, or added to the main context when they don't exist. + * + * @param current Current context. + * @param inherited Inherited context, used as fallback. + * + * @return The wrapped context object. + */ +const proxifyContext = (current, inherited = {}) => { + if (contextProxies.has(current)) { + throw Error('This object cannot be proxified.'); + } + // Update the fallback object reference when it changes. + contextObjectToFallback.set(current, inherited); + if (!contextObjectToProxy.has(current)) { + const proxy = new Proxy(current, contextHandlers); + contextObjectToProxy.set(current, proxy); + contextProxies.add(proxy); + } + return contextObjectToProxy.get(current); +}; + +;// CONCATENATED MODULE: ./node_modules/@wordpress/interactivity/build-module/proxies/index.js +/** + * Internal dependencies + */ + + + + +;// CONCATENATED MODULE: ./node_modules/@wordpress/interactivity/build-module/store.js +/** + * Internal dependencies + */ + +/** + * External dependencies + */ + + +const stores = new Map(); +const rawStores = new Map(); +const storeLocks = new Map(); +const storeConfigs = new Map(); +const serverStates = new Map(); + +/** + * Get the defined config for the store with the passed namespace. + * + * @param namespace Store's namespace from which to retrieve the config. + * @return Defined config for the given namespace. + */ +const getConfig = namespace => storeConfigs.get(namespace || getNamespace()) || {}; + +/** + * Get the part of the state defined and updated from the server. + * + * The object returned is read-only, and includes the state defined in PHP with + * `wp_interactivity_state()`. When using `actions.navigate()`, this object is + * updated to reflect the changes in its properites, without affecting the state + * returned by `store()`. Directives can subscribe to those changes to update + * the state if needed. + * + * @example + * ```js + * const { state } = store('myStore', { + * callbacks: { + * updateServerState() { + * const serverState = getServerState(); + * // Override some property with the new value that came from the server. + * state.overridableProp = serverState.overridableProp; + * }, + * }, + * }); + * ``` + * + * @param namespace Store's namespace from which to retrieve the server state. + * @return The server state for the given namespace. + */ +const getServerState = namespace => { + const ns = namespace || getNamespace(); + if (!serverStates.has(ns)) { + serverStates.set(ns, proxifyState(ns, {}, { + readOnly: true + })); + } + return serverStates.get(ns); +}; +const universalUnlock = 'I acknowledge that using a private store means my plugin will inevitably break on the next store release.'; + +/** + * Extends the Interactivity API global store adding the passed properties to + * the given namespace. It also returns stable references to the namespace + * content. + * + * These props typically consist of `state`, which is the reactive part of the + * store ― which means that any directive referencing a state property will be + * re-rendered anytime it changes ― and function properties like `actions` and + * `callbacks`, mostly used for event handlers. These props can then be + * referenced by any directive to make the HTML interactive. + * + * @example + * ```js + * const { state } = store( 'counter', { + * state: { + * value: 0, + * get double() { return state.value * 2; }, + * }, + * actions: { + * increment() { + * state.value += 1; + * }, + * }, + * } ); + * ``` + * + * The code from the example above allows blocks to subscribe and interact with + * the store by using directives in the HTML, e.g.: + * + * ```html + *
+ * + *
+ * ``` + * @param namespace The store namespace to interact with. + * @param storePart Properties to add to the store namespace. + * @param options Options for the given namespace. + * + * @return A reference to the namespace content. + */ + +function store(namespace, { + state = {}, + ...block +} = {}, { + lock = false +} = {}) { + if (!stores.has(namespace)) { + // Lock the store if the passed lock is different from the universal + // unlock. Once the lock is set (either false, true, or a given string), + // it cannot change. + if (lock !== universalUnlock) { + storeLocks.set(namespace, lock); + } + const rawStore = { + state: proxifyState(namespace, isPlainObject(state) ? state : {}), + ...block + }; + const proxifiedStore = proxifyStore(namespace, rawStore); + rawStores.set(namespace, rawStore); + stores.set(namespace, proxifiedStore); + } else { + // Lock the store if it wasn't locked yet and the passed lock is + // different from the universal unlock. If no lock is given, the store + // will be public and won't accept any lock from now on. + if (lock !== universalUnlock && !storeLocks.has(namespace)) { + storeLocks.set(namespace, lock); + } else { + const storeLock = storeLocks.get(namespace); + const isLockValid = lock === universalUnlock || lock !== true && lock === storeLock; + if (!isLockValid) { + if (!storeLock) { + throw Error('Cannot lock a public store'); + } else { + throw Error('Cannot unlock a private store with an invalid lock code'); + } + } + } + const target = rawStores.get(namespace); + deepMerge(target, block); + deepMerge(target.state, state); + } + return stores.get(namespace); +} +const parseServerData = (dom = document) => { + var _dom$getElementById; + const jsonDataScriptTag = // Preferred Script Module data passing form + (_dom$getElementById = dom.getElementById('wp-script-module-data-@wordpress/interactivity')) !== null && _dom$getElementById !== void 0 ? _dom$getElementById : + // Legacy form + dom.getElementById('wp-interactivity-data'); + if (jsonDataScriptTag?.textContent) { + try { + return JSON.parse(jsonDataScriptTag.textContent); + } catch {} + } + return {}; +}; +const populateServerData = data => { + if (isPlainObject(data?.state)) { + Object.entries(data.state).forEach(([namespace, state]) => { + const st = store(namespace, {}, { + lock: universalUnlock + }); + deepMerge(st.state, state, false); + deepMerge(getServerState(namespace), state); + }); + } + if (isPlainObject(data?.config)) { + Object.entries(data.config).forEach(([namespace, config]) => { + storeConfigs.set(namespace, config); + }); + } +}; + +// Parse and populate the initial state and config. +const data = parseServerData(); +populateServerData(data); + +;// CONCATENATED MODULE: ./node_modules/@wordpress/interactivity/build-module/hooks.js +// eslint-disable-next-line eslint-comments/disable-enable-pair +/* eslint-disable react-hooks/exhaustive-deps */ + +/** + * External dependencies + */ + + +/** + * Internal dependencies + */ + + + +// Main context. +const context = (0,preact_module/* createContext */.q6)({ + client: {}, + server: {} +}); + +// WordPress Directives. +const directiveCallbacks = {}; +const directivePriorities = {}; + +/** + * Register a new directive type in the Interactivity API runtime. + * + * @example + * ```js + * directive( + * 'alert', // Name without the `data-wp-` prefix. + * ( { directives: { alert }, element, evaluate } ) => { + * const defaultEntry = alert.find( entry => entry.suffix === 'default' ); + * element.props.onclick = () => { alert( evaluate( defaultEntry ) ); } + * } + * ) + * ``` + * + * The previous code registers a custom directive type for displaying an alert + * message whenever an element using it is clicked. The message text is obtained + * from the store under the inherited namespace, using `evaluate`. + * + * When the HTML is processed by the Interactivity API, any element containing + * the `data-wp-alert` directive will have the `onclick` event handler, e.g., + * + * ```html + *
+ * + *
+ * ``` + * Note that, in the previous example, the directive callback gets the path + * value (`state.alert`) from the directive entry with suffix `default`. A + * custom suffix can also be specified by appending `--` to the directive + * attribute, followed by the suffix, like in the following HTML snippet: + * + * ```html + *
+ * + *
+ * ``` + * + * This could be an hypothetical implementation of the custom directive used in + * the snippet above. + * + * @example + * ```js + * directive( + * 'color', // Name without prefix and suffix. + * ( { directives: { color: colors }, ref, evaluate } ) => + * colors.forEach( ( color ) => { + * if ( color.suffix = 'text' ) { + * ref.style.setProperty( + * 'color', + * evaluate( color.text ) + * ); + * } + * if ( color.suffix = 'background' ) { + * ref.style.setProperty( + * 'background-color', + * evaluate( color.background ) + * ); + * } + * } ); + * } + * ) + * ``` + * + * @param name Directive name, without the `data-wp-` prefix. + * @param callback Function that runs the directive logic. + * @param options Options object. + * @param options.priority Option to control the directive execution order. The + * lesser, the highest priority. Default is `10`. + */ +const directive = (name, callback, { + priority = 10 +} = {}) => { + directiveCallbacks[name] = callback; + directivePriorities[name] = priority; +}; + +// Resolve the path to some property of the store object. +const resolve = (path, namespace) => { + if (!namespace) { + warn(`Namespace missing for "${path}". The value for that path won't be resolved.`); + return; + } + let resolvedStore = stores.get(namespace); + if (typeof resolvedStore === 'undefined') { + resolvedStore = store(namespace, undefined, { + lock: universalUnlock + }); + } + const current = { + ...resolvedStore, + context: getScope().context[namespace] + }; + try { + // TODO: Support lazy/dynamically initialized stores + return path.split('.').reduce((acc, key) => acc[key], current); + } catch (e) {} +}; + +// Generate the evaluate function. +const getEvaluate = ({ + scope +}) => (entry, ...args) => { + let { + value: path, + namespace + } = entry; + if (typeof path !== 'string') { + throw new Error('The `value` prop should be a string path'); + } + // If path starts with !, remove it and save a flag. + const hasNegationOperator = path[0] === '!' && !!(path = path.slice(1)); + setScope(scope); + const value = resolve(path, namespace); + const result = typeof value === 'function' ? value(...args) : value; + resetScope(); + return hasNegationOperator ? !result : result; +}; + +// Separate directives by priority. The resulting array contains objects +// of directives grouped by same priority, and sorted in ascending order. +const getPriorityLevels = directives => { + const byPriority = Object.keys(directives).reduce((obj, name) => { + if (directiveCallbacks[name]) { + const priority = directivePriorities[name]; + (obj[priority] = obj[priority] || []).push(name); + } + return obj; + }, {}); + return Object.entries(byPriority).sort(([p1], [p2]) => parseInt(p1) - parseInt(p2)).map(([, arr]) => arr); +}; + +// Component that wraps each priority level of directives of an element. +const Directives = ({ + directives, + priorityLevels: [currentPriorityLevel, ...nextPriorityLevels], + element, + originalProps, + previousScope +}) => { + // Initialize the scope of this element. These scopes are different per each + // level because each level has a different context, but they share the same + // element ref, state and props. + const scope = A({}).current; + scope.evaluate = q(getEvaluate({ + scope + }), []); + const { + client, + server + } = x(context); + scope.context = client; + scope.serverContext = server; + /* eslint-disable react-hooks/rules-of-hooks */ + scope.ref = previousScope?.ref || A(null); + /* eslint-enable react-hooks/rules-of-hooks */ + + // Create a fresh copy of the vnode element and add the props to the scope, + // named as attributes (HTML Attributes). + element = (0,preact_module/* cloneElement */.Ob)(element, { + ref: scope.ref + }); + scope.attributes = element.props; + + // Recursively render the wrapper for the next priority level. + const children = nextPriorityLevels.length > 0 ? (0,preact_module.h)(Directives, { + directives, + priorityLevels: nextPriorityLevels, + element, + originalProps, + previousScope: scope + }) : element; + const props = { + ...originalProps, + children + }; + const directiveArgs = { + directives, + props, + element, + context, + evaluate: scope.evaluate + }; + setScope(scope); + for (const directiveName of currentPriorityLevel) { + const wrapper = directiveCallbacks[directiveName]?.(directiveArgs); + if (wrapper !== undefined) { + props.children = wrapper; + } + } + resetScope(); + return props.children; +}; + +// Preact Options Hook called each time a vnode is created. +const old = preact_module/* options */.fF.vnode; +preact_module/* options */.fF.vnode = vnode => { + if (vnode.props.__directives) { + const props = vnode.props; + const directives = props.__directives; + if (directives.key) { + vnode.key = directives.key.find(({ + suffix + }) => suffix === 'default').value; + } + delete props.__directives; + const priorityLevels = getPriorityLevels(directives); + if (priorityLevels.length > 0) { + vnode.props = { + directives, + priorityLevels, + originalProps: props, + type: vnode.type, + element: (0,preact_module.h)(vnode.type, props), + top: true + }; + vnode.type = Directives; + } + } + if (old) { + old(vnode); + } +}; + +;// CONCATENATED MODULE: ./node_modules/@wordpress/interactivity/build-module/directives.js +// eslint-disable-next-line eslint-comments/disable-enable-pair +/* eslint-disable react-hooks/exhaustive-deps */ + +/** + * External dependencies + */ + + + +/** + * Internal dependencies + */ + + + + + +/** + * Recursively clone the passed object. + * + * @param source Source object. + * @return Cloned object. + */ +function deepClone(source) { + if (isPlainObject(source)) { + return Object.fromEntries(Object.entries(source).map(([key, value]) => [key, deepClone(value)])); + } + if (Array.isArray(source)) { + return source.map(i => deepClone(i)); + } + return source; +} +const newRule = /(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g; +const ruleClean = /\/\*[^]*?\*\/| +/g; +const ruleNewline = /\n+/g; +const empty = ' '; + +/** + * Convert a css style string into a object. + * + * Made by Cristian Bote (@cristianbote) for Goober. + * https://unpkg.com/browse/goober@2.1.13/src/core/astish.js + * + * @param val CSS string. + * @return CSS object. + */ +const cssStringToObject = val => { + const tree = [{}]; + let block, left; + while (block = newRule.exec(val.replace(ruleClean, ''))) { + if (block[4]) { + tree.shift(); + } else if (block[3]) { + left = block[3].replace(ruleNewline, empty).trim(); + tree.unshift(tree[0][left] = tree[0][left] || {}); + } else { + tree[0][block[1]] = block[2].replace(ruleNewline, empty).trim(); + } + } + return tree[0]; +}; + +/** + * Creates a directive that adds an event listener to the global window or + * document object. + * + * @param type 'window' or 'document' + */ +const getGlobalEventDirective = type => { + return ({ + directives, + evaluate + }) => { + directives[`on-${type}`].filter(({ + suffix + }) => suffix !== 'default').forEach(entry => { + const eventName = entry.suffix.split('--', 1)[0]; + useInit(() => { + const cb = event => evaluate(entry, event); + const globalVar = type === 'window' ? window : document; + globalVar.addEventListener(eventName, cb); + return () => globalVar.removeEventListener(eventName, cb); + }); + }); + }; +}; + +/** + * Creates a directive that adds an async event listener to the global window or + * document object. + * + * @param type 'window' or 'document' + */ +const getGlobalAsyncEventDirective = type => { + return ({ + directives, + evaluate + }) => { + directives[`on-async-${type}`].filter(({ + suffix + }) => suffix !== 'default').forEach(entry => { + const eventName = entry.suffix.split('--', 1)[0]; + useInit(() => { + const cb = async event => { + await splitTask(); + evaluate(entry, event); + }; + const globalVar = type === 'window' ? window : document; + globalVar.addEventListener(eventName, cb, { + passive: true + }); + return () => globalVar.removeEventListener(eventName, cb); + }); + }); + }; +}; +/* harmony default export */ const directives = (() => { + // data-wp-context + directive('context', ({ + directives: { + context + }, + props: { + children + }, + context: inheritedContext + }) => { + const { + Provider + } = inheritedContext; + const defaultEntry = context.find(({ + suffix + }) => suffix === 'default'); + const { + client: inheritedClient, + server: inheritedServer + } = x(inheritedContext); + const ns = defaultEntry.namespace; + const client = A(proxifyState(ns, {})); + const server = A(proxifyState(ns, {}, { + readOnly: true + })); + + // No change should be made if `defaultEntry` does not exist. + const contextStack = T(() => { + const result = { + client: { + ...inheritedClient + }, + server: { + ...inheritedServer + } + }; + if (defaultEntry) { + const { + namespace, + value + } = defaultEntry; + // Check that the value is a JSON object. Send a console warning if not. + if (!isPlainObject(value)) { + warn(`The value of data-wp-context in "${namespace}" store must be a valid stringified JSON object.`); + } + deepMerge(client.current, deepClone(value), false); + deepMerge(server.current, deepClone(value)); + result.client[namespace] = proxifyContext(client.current, inheritedClient[namespace]); + result.server[namespace] = proxifyContext(server.current, inheritedServer[namespace]); + } + return result; + }, [defaultEntry, inheritedClient, inheritedServer]); + return (0,preact_module.h)(Provider, { + value: contextStack + }, children); + }, { + priority: 5 + }); + + // data-wp-watch--[name] + directive('watch', ({ + directives: { + watch + }, + evaluate + }) => { + watch.forEach(entry => { + useWatch(() => { + let start; + if (false) {} + const result = evaluate(entry); + if (false) {} + return result; + }); + }); + }); + + // data-wp-init--[name] + directive('init', ({ + directives: { + init + }, + evaluate + }) => { + init.forEach(entry => { + // TODO: Replace with useEffect to prevent unneeded scopes. + useInit(() => { + let start; + if (false) {} + const result = evaluate(entry); + if (false) {} + return result; + }); + }); + }); + + // data-wp-on--[event] + directive('on', ({ + directives: { + on + }, + element, + evaluate + }) => { + const events = new Map(); + on.filter(({ + suffix + }) => suffix !== 'default').forEach(entry => { + const event = entry.suffix.split('--')[0]; + if (!events.has(event)) { + events.set(event, new Set()); + } + events.get(event).add(entry); + }); + events.forEach((entries, eventType) => { + const existingHandler = element.props[`on${eventType}`]; + element.props[`on${eventType}`] = event => { + entries.forEach(entry => { + if (existingHandler) { + existingHandler(event); + } + let start; + if (false) {} + evaluate(entry, event); + if (false) {} + }); + }; + }); + }); + + // data-wp-on-async--[event] + directive('on-async', ({ + directives: { + 'on-async': onAsync + }, + element, + evaluate + }) => { + const events = new Map(); + onAsync.filter(({ + suffix + }) => suffix !== 'default').forEach(entry => { + const event = entry.suffix.split('--')[0]; + if (!events.has(event)) { + events.set(event, new Set()); + } + events.get(event).add(entry); + }); + events.forEach((entries, eventType) => { + const existingHandler = element.props[`on${eventType}`]; + element.props[`on${eventType}`] = event => { + if (existingHandler) { + existingHandler(event); + } + entries.forEach(async entry => { + await splitTask(); + evaluate(entry, event); + }); + }; + }); + }); + + // data-wp-on-window--[event] + directive('on-window', getGlobalEventDirective('window')); + // data-wp-on-document--[event] + directive('on-document', getGlobalEventDirective('document')); + + // data-wp-on-async-window--[event] + directive('on-async-window', getGlobalAsyncEventDirective('window')); + // data-wp-on-async-document--[event] + directive('on-async-document', getGlobalAsyncEventDirective('document')); + + // data-wp-class--[classname] + directive('class', ({ + directives: { + class: classNames + }, + element, + evaluate + }) => { + classNames.filter(({ + suffix + }) => suffix !== 'default').forEach(entry => { + const className = entry.suffix; + const result = evaluate(entry); + const currentClass = element.props.class || ''; + const classFinder = new RegExp(`(^|\\s)${className}(\\s|$)`, 'g'); + if (!result) { + element.props.class = currentClass.replace(classFinder, ' ').trim(); + } else if (!classFinder.test(currentClass)) { + element.props.class = currentClass ? `${currentClass} ${className}` : className; + } + useInit(() => { + /* + * This seems necessary because Preact doesn't change the class + * names on the hydration, so we have to do it manually. It doesn't + * need deps because it only needs to do it the first time. + */ + if (!result) { + element.ref.current.classList.remove(className); + } else { + element.ref.current.classList.add(className); + } + }); + }); + }); + + // data-wp-style--[style-prop] + directive('style', ({ + directives: { + style + }, + element, + evaluate + }) => { + style.filter(({ + suffix + }) => suffix !== 'default').forEach(entry => { + const styleProp = entry.suffix; + const result = evaluate(entry); + element.props.style = element.props.style || {}; + if (typeof element.props.style === 'string') { + element.props.style = cssStringToObject(element.props.style); + } + if (!result) { + delete element.props.style[styleProp]; + } else { + element.props.style[styleProp] = result; + } + useInit(() => { + /* + * This seems necessary because Preact doesn't change the styles on + * the hydration, so we have to do it manually. It doesn't need deps + * because it only needs to do it the first time. + */ + if (!result) { + element.ref.current.style.removeProperty(styleProp); + } else { + element.ref.current.style[styleProp] = result; + } + }); + }); + }); + + // data-wp-bind--[attribute] + directive('bind', ({ + directives: { + bind + }, + element, + evaluate + }) => { + bind.filter(({ + suffix + }) => suffix !== 'default').forEach(entry => { + const attribute = entry.suffix; + const result = evaluate(entry); + element.props[attribute] = result; + + /* + * This is necessary because Preact doesn't change the attributes on the + * hydration, so we have to do it manually. It only needs to do it the + * first time. After that, Preact will handle the changes. + */ + useInit(() => { + const el = element.ref.current; + + /* + * We set the value directly to the corresponding HTMLElement instance + * property excluding the following special cases. We follow Preact's + * logic: https://github.com/preactjs/preact/blob/ea49f7a0f9d1ff2c98c0bdd66aa0cbc583055246/src/diff/props.js#L110-L129 + */ + if (attribute === 'style') { + if (typeof result === 'string') { + el.style.cssText = result; + } + return; + } else if (attribute !== 'width' && attribute !== 'height' && attribute !== 'href' && attribute !== 'list' && attribute !== 'form' && + /* + * The value for `tabindex` follows the parsing rules for an + * integer. If that fails, or if the attribute isn't present, then + * the browsers should "follow platform conventions to determine if + * the element should be considered as a focusable area", + * practically meaning that most elements get a default of `-1` (not + * focusable), but several also get a default of `0` (focusable in + * order after all elements with a positive `tabindex` value). + * + * @see https://html.spec.whatwg.org/#tabindex-value + */ + attribute !== 'tabIndex' && attribute !== 'download' && attribute !== 'rowSpan' && attribute !== 'colSpan' && attribute !== 'role' && attribute in el) { + try { + el[attribute] = result === null || result === undefined ? '' : result; + return; + } catch (err) {} + } + /* + * aria- and data- attributes have no boolean representation. + * A `false` value is different from the attribute not being + * present, so we can't remove it. + * We follow Preact's logic: https://github.com/preactjs/preact/blob/ea49f7a0f9d1ff2c98c0bdd66aa0cbc583055246/src/diff/props.js#L131C24-L136 + */ + if (result !== null && result !== undefined && (result !== false || attribute[4] === '-')) { + el.setAttribute(attribute, result); + } else { + el.removeAttribute(attribute); + } + }); + }); + }); + + // data-wp-ignore + directive('ignore', ({ + element: { + type: Type, + props: { + innerHTML, + ...rest + } + } + }) => { + // Preserve the initial inner HTML. + const cached = T(() => innerHTML, []); + return (0,preact_module.h)(Type, { + dangerouslySetInnerHTML: { + __html: cached + }, + ...rest + }); + }); + + // data-wp-text + directive('text', ({ + directives: { + text + }, + element, + evaluate + }) => { + const entry = text.find(({ + suffix + }) => suffix === 'default'); + if (!entry) { + element.props.children = null; + return; + } + try { + const result = evaluate(entry); + element.props.children = typeof result === 'object' ? null : result.toString(); + } catch (e) { + element.props.children = null; + } + }); + + // data-wp-run + directive('run', ({ + directives: { + run + }, + evaluate + }) => { + run.forEach(entry => evaluate(entry)); + }); + + // data-wp-each--[item] + directive('each', ({ + directives: { + each, + 'each-key': eachKey + }, + context: inheritedContext, + element, + evaluate + }) => { + if (element.type !== 'template') { + return; + } + const { + Provider + } = inheritedContext; + const inheritedValue = x(inheritedContext); + const [entry] = each; + const { + namespace, + suffix + } = entry; + const list = evaluate(entry); + return list.map(item => { + const itemProp = suffix === 'default' ? 'item' : kebabToCamelCase(suffix); + const itemContext = proxifyContext(proxifyState(namespace, {}), inheritedValue.client[namespace]); + const mergedContext = { + client: { + ...inheritedValue.client, + [namespace]: itemContext + }, + server: { + ...inheritedValue.server + } + }; + + // Set the item after proxifying the context. + mergedContext.client[namespace][itemProp] = item; + const scope = { + ...getScope(), + context: mergedContext.client, + serverContext: mergedContext.server + }; + const key = eachKey ? getEvaluate({ + scope + })(eachKey[0]) : item; + return (0,preact_module.h)(Provider, { + value: mergedContext, + key + }, element.props.content); + }); + }, { + priority: 20 + }); + directive('each-child', () => null, { + priority: 1 + }); +}); + +;// CONCATENATED MODULE: ./node_modules/@wordpress/interactivity/build-module/constants.js +const directivePrefix = 'wp'; + +;// CONCATENATED MODULE: ./node_modules/@wordpress/interactivity/build-module/vdom.js +/** + * External dependencies + */ + +/** + * Internal dependencies + */ + + +const ignoreAttr = `data-${directivePrefix}-ignore`; +const islandAttr = `data-${directivePrefix}-interactive`; +const fullPrefix = `data-${directivePrefix}-`; +const namespaces = []; +const currentNamespace = () => { + var _namespaces; + return (_namespaces = namespaces[namespaces.length - 1]) !== null && _namespaces !== void 0 ? _namespaces : null; +}; +const isObject = item => Boolean(item && typeof item === 'object' && item.constructor === Object); + +// Regular expression for directive parsing. +const directiveParser = new RegExp(`^data-${directivePrefix}-` + +// ${p} must be a prefix string, like 'wp'. +// Match alphanumeric characters including hyphen-separated +// segments. It excludes underscore intentionally to prevent confusion. +// E.g., "custom-directive". +'([a-z0-9]+(?:-[a-z0-9]+)*)' + +// (Optional) Match '--' followed by any alphanumeric charachters. It +// excludes underscore intentionally to prevent confusion, but it can +// contain multiple hyphens. E.g., "--custom-prefix--with-more-info". +'(?:--([a-z0-9_-]+))?$', 'i' // Case insensitive. +); + +// Regular expression for reference parsing. It can contain a namespace before +// the reference, separated by `::`, like `some-namespace::state.somePath`. +// Namespaces can contain any alphanumeric characters, hyphens, underscores or +// forward slashes. References don't have any restrictions. +const nsPathRegExp = /^([\w_\/-]+)::(.+)$/; +const hydratedIslands = new WeakSet(); + +/** + * Recursive function that transforms a DOM tree into vDOM. + * + * @param root The root element or node to start traversing on. + * @return The resulting vDOM tree. + */ +function toVdom(root) { + const treeWalker = document.createTreeWalker(root, 205 // TEXT + CDATA_SECTION + COMMENT + PROCESSING_INSTRUCTION + ELEMENT + ); + function walk(node) { + const { + nodeType + } = node; + + // TEXT_NODE (3) + if (nodeType === 3) { + return [node.data]; + } + + // CDATA_SECTION_NODE (4) + if (nodeType === 4) { + var _nodeValue; + const next = treeWalker.nextSibling(); + node.replaceWith(new window.Text((_nodeValue = node.nodeValue) !== null && _nodeValue !== void 0 ? _nodeValue : '')); + return [node.nodeValue, next]; + } + + // COMMENT_NODE (8) || PROCESSING_INSTRUCTION_NODE (7) + if (nodeType === 8 || nodeType === 7) { + const next = treeWalker.nextSibling(); + node.remove(); + return [null, next]; + } + const elementNode = node; + const { + attributes + } = elementNode; + const localName = elementNode.localName; + const props = {}; + const children = []; + const directives = []; + let ignore = false; + let island = false; + for (let i = 0; i < attributes.length; i++) { + const attributeName = attributes[i].name; + const attributeValue = attributes[i].value; + if (attributeName[fullPrefix.length] && attributeName.slice(0, fullPrefix.length) === fullPrefix) { + if (attributeName === ignoreAttr) { + ignore = true; + } else { + var _regexResult$, _regexResult$2; + const regexResult = nsPathRegExp.exec(attributeValue); + const namespace = (_regexResult$ = regexResult?.[1]) !== null && _regexResult$ !== void 0 ? _regexResult$ : null; + let value = (_regexResult$2 = regexResult?.[2]) !== null && _regexResult$2 !== void 0 ? _regexResult$2 : attributeValue; + try { + const parsedValue = JSON.parse(value); + value = isObject(parsedValue) ? parsedValue : value; + } catch {} + if (attributeName === islandAttr) { + island = true; + const islandNamespace = + // eslint-disable-next-line no-nested-ternary + typeof value === 'string' ? value : typeof value?.namespace === 'string' ? value.namespace : null; + namespaces.push(islandNamespace); + } else { + directives.push([attributeName, namespace, value]); + } + } + } else if (attributeName === 'ref') { + continue; + } + props[attributeName] = attributeValue; + } + if (ignore && !island) { + return [(0,preact_module.h)(localName, { + ...props, + innerHTML: elementNode.innerHTML, + __directives: { + ignore: true + } + })]; + } + if (island) { + hydratedIslands.add(elementNode); + } + if (directives.length) { + props.__directives = directives.reduce((obj, [name, ns, value]) => { + const directiveMatch = directiveParser.exec(name); + if (directiveMatch === null) { + warn(`Found malformed directive name: ${name}.`); + return obj; + } + const prefix = directiveMatch[1] || ''; + const suffix = directiveMatch[2] || 'default'; + obj[prefix] = obj[prefix] || []; + obj[prefix].push({ + namespace: ns !== null && ns !== void 0 ? ns : currentNamespace(), + value, + suffix + }); + return obj; + }, {}); + } + + // @ts-expect-error Fixed in upcoming preact release https://github.com/preactjs/preact/pull/4334 + if (localName === 'template') { + props.content = [...elementNode.content.childNodes].map(childNode => toVdom(childNode)); + } else { + let child = treeWalker.firstChild(); + if (child) { + while (child) { + const [vnode, nextChild] = walk(child); + if (vnode) { + children.push(vnode); + } + child = nextChild || treeWalker.nextSibling(); + } + treeWalker.parentNode(); + } + } + + // Restore previous namespace. + if (island) { + namespaces.pop(); + } + return [(0,preact_module.h)(localName, props, children)]; + } + return walk(treeWalker.currentNode); +} + +;// CONCATENATED MODULE: ./node_modules/@wordpress/interactivity/build-module/init.js +/** + * External dependencies + */ + +/** + * Internal dependencies + */ + + + + +// Keep the same root fragment for each interactive region node. +const regionRootFragments = new WeakMap(); +const getRegionRootFragment = region => { + if (!region.parentElement) { + throw Error('The passed region should be an element with a parent.'); + } + if (!regionRootFragments.has(region)) { + regionRootFragments.set(region, createRootFragment(region.parentElement, region)); + } + return regionRootFragments.get(region); +}; + +// Initial vDOM regions associated with its DOM element. +const initialVdom = new WeakMap(); + +// Initialize the router with the initial DOM. +const init = async () => { + const nodes = document.querySelectorAll(`[data-${directivePrefix}-interactive]`); + for (const node of nodes) { + if (!hydratedIslands.has(node)) { + await splitTask(); + const fragment = getRegionRootFragment(node); + const vdom = toVdom(node); + initialVdom.set(node, vdom); + await splitTask(); + (0,preact_module/* hydrate */.Qv)(vdom, fragment); + } + } +}; + +;// CONCATENATED MODULE: ./node_modules/@wordpress/interactivity/build-module/index.js +/** + * External dependencies + */ + + + +/** + * Internal dependencies + */ + + + + + + + + + + + + +const requiredConsent = 'I acknowledge that using private APIs means my theme or plugin will inevitably break in the next version of WordPress.'; +const privateApis = lock => { + if (lock === requiredConsent) { + return { + directivePrefix: directivePrefix, + getRegionRootFragment: getRegionRootFragment, + initialVdom: initialVdom, + toVdom: toVdom, + directive: directive, + getNamespace: getNamespace, + h: preact_module.h, + cloneElement: preact_module/* cloneElement */.Ob, + render: preact_module/* render */.XX, + proxifyState: proxifyState, + parseServerData: parseServerData, + populateServerData: populateServerData, + batch: signals_core_module_r + }; + } + throw new Error('Forbidden access.'); +}; +directives(); +init(); + + +/***/ }), + +/***/ 622: +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ FK: () => (/* binding */ b), +/* harmony export */ Ob: () => (/* binding */ E), +/* harmony export */ Qv: () => (/* binding */ D), +/* harmony export */ XX: () => (/* binding */ B), +/* harmony export */ fF: () => (/* binding */ l), +/* harmony export */ h: () => (/* binding */ _), +/* harmony export */ q6: () => (/* binding */ G), +/* harmony export */ uA: () => (/* binding */ k), +/* harmony export */ zO: () => (/* binding */ t) +/* harmony export */ }); +/* unused harmony exports createElement, createRef, toChildArray */ +var n,l,u,t,i,o,r,f,e,c,s,a,h={},v=[],p=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,y=Array.isArray;function d(n,l){for(var u in l)n[u]=l[u];return n}function w(n){n&&n.parentNode&&n.parentNode.removeChild(n)}function _(l,u,t){var i,o,r,f={};for(r in u)"key"==r?i=u[r]:"ref"==r?o=u[r]:f[r]=u[r];if(arguments.length>2&&(f.children=arguments.length>3?n.call(arguments,2):t),"function"==typeof l&&null!=l.defaultProps)for(r in l.defaultProps)void 0===f[r]&&(f[r]=l.defaultProps[r]);return g(l,f,i,o,null)}function g(n,t,i,o,r){var f={type:n,props:t,key:i,ref:o,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:null==r?++u:r,__i:-1,__u:0};return null==r&&null!=l.vnode&&l.vnode(f),f}function m(){return{current:null}}function b(n){return n.children}function k(n,l){this.props=n,this.context=l}function x(n,l){if(null==l)return n.__?x(n.__,n.__i+1):null;for(var u;lu&&i.sort(f));P.__r=0}function S(n,l,u,t,i,o,r,f,e,c,s){var a,p,y,d,w,_=t&&t.__k||v,g=l.length;for(u.__d=e,$(u,l,_),e=u.__d,a=0;a0?g(i.type,i.props,i.key,i.ref?i.ref:null,i.__v):i).__=n,i.__b=n.__b+1,o=null,-1!==(f=i.__i=L(i,u,r,s))&&(s--,(o=u[f])&&(o.__u|=131072)),null==o||null===o.__v?(-1==f&&a--,"function"!=typeof i.type&&(i.__u|=65536)):f!==r&&(f==r-1?a--:f==r+1?a++:(f>r?a--:a++,i.__u|=65536))):i=n.__k[t]=null;if(s)for(t=0;t(null!=e&&0==(131072&e.__u)?1:0))for(;r>=0||f=0){if((e=l[r])&&0==(131072&e.__u)&&i==e.key&&o===e.type)return r;r--}if(f2&&(e.children=arguments.length>3?n.call(arguments,2):t),g(l.type,e,i||l.key,o||l.ref,null)}function G(n,l){var u={__c:l="__cC"+a++,__:n,Consumer:function(n,l){return n.children(l)},Provider:function(n){var u,t;return this.getChildContext||(u=[],(t={})[l]=this,this.getChildContext=function(){return t},this.componentWillUnmount=function(){u=null},this.shouldComponentUpdate=function(n){this.props.value!==n.value&&u.some(function(n){n.__e=!0,M(n)})},this.sub=function(n){u.push(n);var l=n.componentWillUnmount;n.componentWillUnmount=function(){u&&u.splice(u.indexOf(n),1),l&&l.call(n)}}),n.children}};return u.Provider.__=u.Consumer.contextType=u}n=v.slice,l={__e:function(n,l,u,t){for(var i,o,r;l=l.__;)if((i=l.__c)&&!i.__)try{if((o=i.constructor)&&null!=o.getDerivedStateFromError&&(i.setState(o.getDerivedStateFromError(n)),r=i.__d),null!=i.componentDidCatch&&(i.componentDidCatch(n,t||{}),r=i.__d),r)return i.__E=i}catch(l){n=l}throw n}},u=0,t=function(n){return null!=n&&null==n.constructor},k.prototype.setState=function(n,l){var u;u=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=d({},this.state),"function"==typeof n&&(n=n(d({},u),this.props)),n&&d(u,n),null!=n&&this.__v&&(l&&this._sb.push(l),M(this))},k.prototype.forceUpdate=function(n){this.__v&&(this.__e=!0,n&&this.__h.push(n),M(this))},k.prototype.render=b,i=[],r="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,f=function(n,l){return n.__v.__b-l.__v.__b},P.__r=0,e=0,c=F(!1),s=F(!0),a=0; + + +/***/ }) + +/******/ }); +/************************************************************************/ +/******/ // The module cache +/******/ var __webpack_module_cache__ = {}; +/******/ +/******/ // The require function +/******/ function __webpack_require__(moduleId) { +/******/ // Check if module is in cache +/******/ var cachedModule = __webpack_module_cache__[moduleId]; +/******/ if (cachedModule !== undefined) { +/******/ return cachedModule.exports; +/******/ } +/******/ // Create a new module (and put it into the cache) +/******/ var module = __webpack_module_cache__[moduleId] = { +/******/ // no module.id needed +/******/ // no module.loaded needed +/******/ exports: {} +/******/ }; +/******/ +/******/ // Execute the module function +/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__); +/******/ +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } +/******/ +/************************************************************************/ +/******/ /* webpack/runtime/define property getters */ +/******/ (() => { +/******/ // define getter functions for harmony exports +/******/ __webpack_require__.d = (exports, definition) => { +/******/ for(var key in definition) { +/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) { +/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); +/******/ } +/******/ } +/******/ }; +/******/ })(); +/******/ +/******/ /* webpack/runtime/hasOwnProperty shorthand */ +/******/ (() => { +/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop)) +/******/ })(); +/******/ +/************************************************************************/ +var __webpack_exports__ = {}; +// This entry need to be wrapped in an IIFE because it need to be isolated against other modules in the chunk. +(() => { + +// EXPORTS +__webpack_require__.d(__webpack_exports__, { + zj: () => (/* reexport */ build_module/* getConfig */.zj), + SD: () => (/* reexport */ build_module/* getContext */.SD), + V6: () => (/* reexport */ build_module/* getElement */.V6), + $K: () => (/* reexport */ build_module/* getServerContext */.$K), + vT: () => (/* reexport */ build_module/* getServerState */.vT), + jb: () => (/* reexport */ build_module/* privateApis */.jb), + yT: () => (/* reexport */ build_module/* splitTask */.yT), + M_: () => (/* reexport */ build_module/* store */.M_), + hb: () => (/* reexport */ build_module/* useCallback */.hb), + vJ: () => (/* reexport */ build_module/* useEffect */.vJ), + ip: () => (/* reexport */ build_module/* useInit */.ip), + Nf: () => (/* reexport */ build_module/* useLayoutEffect */.Nf), + Kr: () => (/* reexport */ build_module/* useMemo */.Kr), + li: () => (/* reexport */ build_module/* useRef */.li), + J0: () => (/* reexport */ build_module/* useState */.J0), + FH: () => (/* reexport */ build_module/* useWatch */.FH), + v4: () => (/* reexport */ build_module/* withScope */.v4) +}); + +// EXTERNAL MODULE: ./node_modules/preact/dist/preact.module.js +var preact_module = __webpack_require__(622); +;// CONCATENATED MODULE: ./node_modules/preact/devtools/dist/devtools.module.js +var i;function t(o,e){return n.__a&&n.__a(e),o}null!=(i="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0)&&i.__PREACT_DEVTOOLS__&&i.__PREACT_DEVTOOLS__.attachPreact("10.24.0",preact_module/* options */.fF,{Fragment:preact_module/* Fragment */.FK,Component:preact_module/* Component */.uA}); + +;// CONCATENATED MODULE: ./node_modules/preact/debug/dist/debug.module.js +var o={};function r(){o={}}function a(e){return e.type===preact_module/* Fragment */.FK?"Fragment":"function"==typeof e.type?e.type.displayName||e.type.name:"string"==typeof e.type?e.type:"#text"}var debug_module_i=[],s=[];function c(){return debug_module_i.length>0?debug_module_i[debug_module_i.length-1]:null}var l=!0;function u(e){return"function"==typeof e.type&&e.type!=preact_module/* Fragment */.FK}function f(n){for(var e=[n],t=n;null!=t.__o;)e.push(t.__o),t=t.__o;return e.reduce(function(n,e){n+=" in "+a(e);var t=e.__source;return t?n+=" (at "+t.fileName+":"+t.lineNumber+")":l&&console.warn("Add @babel/plugin-transform-react-jsx-source to get a more detailed component stack. Note that you should not add it to production builds of your App for bundle size reasons."),l=!1,n+"\n"},"")}var d="function"==typeof WeakMap;function p(n){var e=[];return n.__k?(n.__k.forEach(function(n){n&&"function"==typeof n.type?e.push.apply(e,p(n)):n&&"string"==typeof n.type&&e.push(n.type)}),e):e}function h(n){return n?"function"==typeof n.type?null==n.__?null!=n.__e&&null!=n.__e.parentNode?n.__e.parentNode.localName:"":h(n.__):n.type:""}var v=preact_module/* Component */.uA.prototype.setState;function y(n){return"table"===n||"tfoot"===n||"tbody"===n||"thead"===n||"td"===n||"tr"===n||"th"===n}preact_module/* Component */.uA.prototype.setState=function(n,e){return null==this.__v&&null==this.state&&console.warn('Calling "this.setState" inside the constructor of a component is a no-op and might be a bug in your application. Instead, set "this.state = {}" directly.\n\n'+f(c())),v.call(this,n,e)};var m=/^(address|article|aside|blockquote|details|div|dl|fieldset|figcaption|figure|footer|form|h1|h2|h3|h4|h5|h6|header|hgroup|hr|main|menu|nav|ol|p|pre|search|section|table|ul)$/,b=preact_module/* Component */.uA.prototype.forceUpdate;function w(n){var e=n.props,t=a(n),o="";for(var r in e)if(e.hasOwnProperty(r)&&"children"!==r){var i=e[r];"function"==typeof i&&(i="function "+(i.displayName||i.name)+"() {}"),i=Object(i)!==i||i.toString?i+"":Object.prototype.toString.call(i),o+=" "+r+"="+JSON.stringify(i)}var s=e.children;return"<"+t+o+(s&&s.length?">..":" />")}preact_module/* Component */.uA.prototype.forceUpdate=function(n){return null==this.__v?console.warn('Calling "this.forceUpdate" inside the constructor of a component is a no-op and might be a bug in your application.\n\n'+f(c())):null==this.__P&&console.warn('Can\'t call "this.forceUpdate" on an unmounted component. This is a no-op, but it indicates a memory leak in your application. To fix, cancel all subscriptions and asynchronous tasks in the componentWillUnmount method.\n\n'+f(this.__v)),b.call(this,n)},preact_module/* options */.fF.__m=function(n,e){var t=n.type,o=e.map(function(n){return n.localName});console.error("Expected a DOM node of type "+t+" but found "+o.join(", ")+"as available DOM-node(s), this is caused by the SSR'd HTML containing different DOM-nodes compared to the hydrated one.\n\n"+f(n))},function(){!function(){var n=preact_module/* options */.fF.__b,t=preact_module/* options */.fF.diffed,o=preact_module/* options */.fF.__,r=preact_module/* options */.fF.vnode,a=preact_module/* options */.fF.__r;preact_module/* options */.fF.diffed=function(n){u(n)&&s.pop(),debug_module_i.pop(),t&&t(n)},preact_module/* options */.fF.__b=function(e){u(e)&&debug_module_i.push(e),n&&n(e)},preact_module/* options */.fF.__=function(n,e){s=[],o&&o(n,e)},preact_module/* options */.fF.vnode=function(n){n.__o=s.length>0?s[s.length-1]:null,r&&r(n)},preact_module/* options */.fF.__r=function(n){u(n)&&s.push(n),a&&a(n)}}();var n=!1,t=preact_module/* options */.fF.__b,r=preact_module/* options */.fF.diffed,c=preact_module/* options */.fF.vnode,l=preact_module/* options */.fF.__r,v=preact_module/* options */.fF.__e,b=preact_module/* options */.fF.__,g=preact_module/* options */.fF.__h,E=d?{useEffect:new WeakMap,useLayoutEffect:new WeakMap,lazyPropTypes:new WeakMap}:null,k=[];preact_module/* options */.fF.__e=function(n,e,t,o){if(e&&e.__c&&"function"==typeof n.then){var r=n;n=new Error("Missing Suspense. The throwing component was: "+a(e));for(var i=e;i;i=i.__)if(i.__c&&i.__c.__c){n=r;break}if(n instanceof Error)throw n}try{(o=o||{}).componentStack=f(e),v(n,e,t,o),"function"!=typeof n.then&&setTimeout(function(){throw n})}catch(n){throw n}},preact_module/* options */.fF.__=function(n,e){if(!e)throw new Error("Undefined parent passed to render(), this is the second argument.\nCheck if the element is available in the DOM/has the correct id.");var t;switch(e.nodeType){case 1:case 11:case 9:t=!0;break;default:t=!1}if(!t){var o=a(n);throw new Error("Expected a valid HTML node as a second argument to render.\tReceived "+e+" instead: render(<"+o+" />, "+e+");")}b&&b(n,e)},preact_module/* options */.fF.__b=function(e){var r=e.type;if(n=!0,void 0===r)throw new Error("Undefined component passed to createElement()\n\nYou likely forgot to export your component or might have mixed up default and named imports"+w(e)+"\n\n"+f(e));if(null!=r&&"object"==typeof r){if(void 0!==r.__k&&void 0!==r.__e)throw new Error("Invalid type passed to createElement(): "+r+"\n\nDid you accidentally pass a JSX literal as JSX twice?\n\n let My"+a(e)+" = "+w(r)+";\n let vnode = ;\n\nThis usually happens when you export a JSX literal and not the component.\n\n"+f(e));throw new Error("Invalid type passed to createElement(): "+(Array.isArray(r)?"array":r))}if(void 0!==e.ref&&"function"!=typeof e.ref&&"object"!=typeof e.ref&&!("$$typeof"in e))throw new Error('Component\'s "ref" property should be a function, or an object created by createRef(), but got ['+typeof e.ref+"] instead\n"+w(e)+"\n\n"+f(e));if("string"==typeof e.type)for(var i in e.props)if("o"===i[0]&&"n"===i[1]&&"function"!=typeof e.props[i]&&null!=e.props[i])throw new Error("Component's \""+i+'" property should be a function, but got ['+typeof e.props[i]+"] instead\n"+w(e)+"\n\n"+f(e));if("function"==typeof e.type&&e.type.propTypes){if("Lazy"===e.type.displayName&&E&&!E.lazyPropTypes.has(e.type)){var s="PropTypes are not supported on lazy(). Use propTypes on the wrapped component itself. ";try{var c=e.type();E.lazyPropTypes.set(e.type,!0),console.warn(s+"Component wrapped in lazy() is "+a(c))}catch(n){console.warn(s+"We will log the wrapped component's name once it is loaded.")}}var l=e.props;e.type.__f&&delete(l=function(n,e){for(var t in e)n[t]=e[t];return n}({},l)).ref,function(n,e,t,r,a){Object.keys(n).forEach(function(t){var i;try{i=n[t](e,t,r,"prop",null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(n){i=n}i&&!(i.message in o)&&(o[i.message]=!0,console.error("Failed prop type: "+i.message+(a&&"\n"+a()||"")))})}(e.type.propTypes,l,0,a(e),function(){return f(e)})}t&&t(e)};var T,_=0;preact_module/* options */.fF.__r=function(e){l&&l(e),n=!0;var t=e.__c;if(t===T?_++:_=1,_>=25)throw new Error("Too many re-renders. This is limited to prevent an infinite loop which may lock up your browser. The component causing this is: "+a(e));T=t},preact_module/* options */.fF.__h=function(e,t,o){if(!e||!n)throw new Error("Hook can only be invoked from render methods.");g&&g(e,t,o)};var O=function(n,e){return{get:function(){var t="get"+n+e;k&&k.indexOf(t)<0&&(k.push(t),console.warn("getting vnode."+n+" is deprecated, "+e))},set:function(){var t="set"+n+e;k&&k.indexOf(t)<0&&(k.push(t),console.warn("setting vnode."+n+" is not allowed, "+e))}}},I={nodeName:O("nodeName","use vnode.type"),attributes:O("attributes","use vnode.props"),children:O("children","use vnode.props.children")},M=Object.create({},I);preact_module/* options */.fF.vnode=function(n){var e=n.props;if(null!==n.type&&null!=e&&("__source"in e||"__self"in e)){var t=n.props={};for(var o in e){var r=e[o];"__source"===o?n.__source=r:"__self"===o?n.__self=r:t[o]=r}}n.__proto__=M,c&&c(n)},preact_module/* options */.fF.diffed=function(e){var t,o=e.type,i=e.__;if(e.__k&&e.__k.forEach(function(n){if("object"==typeof n&&n&&void 0===n.type){var t=Object.keys(n).join(",");throw new Error("Objects are not valid as a child. Encountered an object with the keys {"+t+"}.\n\n"+f(e))}}),e.__c===T&&(_=0),"string"==typeof o&&(y(o)||"p"===o||"a"===o||"button"===o)){var s=h(i);if(""!==s&&y(o))"table"===o&&"td"!==s&&y(s)?(console.log(s,i.__e),console.error("Improper nesting of table. Your should not have a table-node parent."+w(e)+"\n\n"+f(e))):"thead"!==o&&"tfoot"!==o&&"tbody"!==o||"table"===s?"tr"===o&&"thead"!==s&&"tfoot"!==s&&"tbody"!==s?console.error("Improper nesting of table. Your should have a parent."+w(e)+"\n\n"+f(e)):"td"===o&&"tr"!==s?console.error("Improper nesting of table. Your parent."+w(e)+"\n\n"+f(e)):"th"===o&&"tr"!==s&&console.error("Improper nesting of table. Your ."+w(e)+"\n\n"+f(e)):console.error("Improper nesting of table. Your should have a
should have a
should have a
parent."+w(e)+"\n\n"+f(e));else if("p"===o){var c=p(e).filter(function(n){return m.test(n)});c.length&&console.error("Improper nesting of paragraph. Your

should not have "+c.join(", ")+"as child-elements."+w(e)+"\n\n"+f(e))}else"a"!==o&&"button"!==o||-1!==p(e).indexOf(o)&&console.error("Improper nesting of interactive content. Your <"+o+"> should not have other "+("a"===o?"anchor":"button")+" tags as child-elements."+w(e)+"\n\n"+f(e))}if(n=!1,r&&r(e),null!=e.__k)for(var l=[],u=0;u{n.d(t,{zj:()=>ft,SD:()=>ve,V6:()=>ye,$K:()=>me,vT:()=>pt,jb:()=>Vt,yT:()=>we,M_:()=>dt,hb:()=>Oe,vJ:()=>Ee,ip:()=>Se,Nf:()=>Te,Kr:()=>Fe,li:()=>b,J0:()=>m,FH:()=>xe,v4:()=>ke});var r,o,i,s,a=n(622),u=0,l=[],c=a.fF,_=c.__b,f=c.__r,p=c.diffed,h=c.__c,d=c.unmount,v=c.__;function y(e,t){c.__h&&c.__h(o,e,u||t),u=0;var n=o.__H||(o.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({}),n.__[e]}function m(e){return u=1,function(e,t,n){var i=y(r++,2);if(i.t=e,!i.__c&&(i.__=[n?n(t):N(void 0,t),function(e){var t=i.__N?i.__N[0]:i.__[0],n=i.t(t,e);t!==n&&(i.__N=[n,i.__[1]],i.__c.setState({}))}],i.__c=o,!o.u)){var s=function(e,t,n){if(!i.__c.__H)return!0;var r=i.__c.__H.__.filter((function(e){return!!e.__c}));if(r.every((function(e){return!e.__N})))return!a||a.call(this,e,t,n);var o=!1;return r.forEach((function(e){if(e.__N){var t=e.__[0];e.__=e.__N,e.__N=void 0,t!==e.__[0]&&(o=!0)}})),!(!o&&i.__c.props===e)&&(!a||a.call(this,e,t,n))};o.u=!0;var a=o.shouldComponentUpdate,u=o.componentWillUpdate;o.componentWillUpdate=function(e,t,n){if(this.__e){var r=a;a=void 0,s(e,t,n),a=r}u&&u.call(this,e,t,n)},o.shouldComponentUpdate=s}return i.__N||i.__}(N,e)}function g(e,t){var n=y(r++,3);!c.__s&&C(n.__H,t)&&(n.__=e,n.i=t,o.__H.__h.push(n))}function w(e,t){var n=y(r++,4);!c.__s&&C(n.__H,t)&&(n.__=e,n.i=t,o.__h.push(n))}function b(e){return u=5,k((function(){return{current:e}}),[])}function k(e,t){var n=y(r++,7);return C(n.__H,t)&&(n.__=e(),n.__H=t,n.__h=e),n.__}function x(e,t){return u=8,k((function(){return e}),t)}function S(e){var t=o.context[e.__c],n=y(r++,9);return n.c=e,t?(null==n.__&&(n.__=!0,t.sub(o)),t.props.value):e.__}function E(){for(var e;e=l.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(F),e.__H.__h.forEach(P),e.__H.__h=[]}catch(t){e.__H.__h=[],c.__e(t,e.__v)}}c.__b=function(e){o=null,_&&_(e)},c.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),v&&v(e,t)},c.__r=function(e){f&&f(e),r=0;var t=(o=e.__c).__H;t&&(i===o?(t.__h=[],o.__h=[],t.__.forEach((function(e){e.__N&&(e.__=e.__N),e.i=e.__N=void 0}))):(t.__h.forEach(F),t.__h.forEach(P),t.__h=[],r=0)),i=o},c.diffed=function(e){p&&p(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(1!==l.push(t)&&s===c.requestAnimationFrame||((s=c.requestAnimationFrame)||O)(E)),t.__H.__.forEach((function(e){e.i&&(e.__H=e.i),e.i=void 0}))),i=o=null},c.__c=function(e,t){t.some((function(e){try{e.__h.forEach(F),e.__h=e.__h.filter((function(e){return!e.__||P(e)}))}catch(n){t.some((function(e){e.__h&&(e.__h=[])})),t=[],c.__e(n,e.__v)}})),h&&h(e,t)},c.unmount=function(e){d&&d(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.forEach((function(e){try{F(e)}catch(e){t=e}})),n.__H=void 0,t&&c.__e(t,n.__v))};var T="function"==typeof requestAnimationFrame;function O(e){var t,n=function(){clearTimeout(r),T&&cancelAnimationFrame(t),setTimeout(e)},r=setTimeout(n,100);T&&(t=requestAnimationFrame(n))}function F(e){var t=o,n=e.__c;"function"==typeof n&&(e.__c=void 0,n()),o=t}function P(e){var t=o;e.__c=e.__(),o=t}function C(e,t){return!e||e.length!==t.length||t.some((function(t,n){return t!==e[n]}))}function N(e,t){return"function"==typeof t?t(e):t}var j=Symbol.for("preact-signals");function M(){if(W>1)W--;else{for(var e,t=!1;void 0!==A;){var n=A;for(A=void 0,L++;void 0!==n;){var r=n.o;if(n.o=void 0,n.f&=-3,!(8&n.f)&&V(n))try{n.c()}catch(n){t||(e=n,t=!0)}n=r}}if(L=0,W--,t)throw e}}function H(e){if(W>0)return e();W++;try{return e()}finally{M()}}var $=void 0;var U,A=void 0,W=0,L=0,D=0;function I(e){if(void 0!==$){var t=e.n;if(void 0===t||t.t!==$)return t={i:0,S:e,p:$.s,n:void 0,t:$,e:void 0,x:void 0,r:t},void 0!==$.s&&($.s.n=t),$.s=t,e.n=t,32&$.f&&e.S(t),t;if(-1===t.i)return t.i=0,void 0!==t.n&&(t.n.p=t.p,void 0!==t.p&&(t.p.n=t.n),t.p=$.s,t.n=void 0,$.s.n=t,$.s=t),t}}function R(e){this.v=e,this.i=0,this.n=void 0,this.t=void 0}function z(e){return new R(e)}function V(e){for(var t=e.s;void 0!==t;t=t.n)if(t.S.i!==t.i||!t.S.h()||t.S.i!==t.i)return!0;return!1}function J(e){for(var t=e.s;void 0!==t;t=t.n){var n=t.S.n;if(void 0!==n&&(t.r=n),t.S.n=t,t.i=-1,void 0===t.n){e.s=t;break}}}function K(e){for(var t=e.s,n=void 0;void 0!==t;){var r=t.p;-1===t.i?(t.S.U(t),void 0!==r&&(r.n=t.n),void 0!==t.n&&(t.n.p=r)):n=t,t.S.n=t.r,void 0!==t.r&&(t.r=void 0),t=r}e.s=n}function B(e){R.call(this,void 0),this.x=e,this.s=void 0,this.g=D-1,this.f=4}function q(e){return new B(e)}function Y(e){var t=e.u;if(e.u=void 0,"function"==typeof t){W++;var n=$;$=void 0;try{t()}catch(t){throw e.f&=-2,e.f|=8,X(e),t}finally{$=n,M()}}}function X(e){for(var t=e.s;void 0!==t;t=t.n)t.S.U(t);e.x=void 0,e.s=void 0,Y(e)}function G(e){if($!==this)throw new Error("Out-of-order effect");K(this),$=e,this.f&=-2,8&this.f&&X(this),M()}function Q(e){this.x=e,this.u=void 0,this.s=void 0,this.o=void 0,this.f=32}function Z(e){var t=new Q(e);try{t.c()}catch(e){throw t.d(),e}return t.d.bind(t)}function ee(e,t){a.fF[e]=t.bind(null,a.fF[e]||function(){})}function te(e){U&&U(),U=e&&e.S()}function ne(e){var t=this,n=e.data,r=function(e){return k((function(){return z(e)}),[])}(n);r.value=n;var o=k((function(){for(var e=t.__v;e=e.__;)if(e.__c){e.__c.__$f|=4;break}return t.__$u.c=function(){var e;(0,a.zO)(o.peek())||3!==(null==(e=t.base)?void 0:e.nodeType)?(t.__$f|=1,t.setState({})):t.base.data=o.peek()},q((function(){var e=r.value.value;return 0===e?0:!0===e?"":e||""}))}),[]);return o.value}function re(e,t,n,r){var o=t in e&&void 0===e.ownerSVGElement,i=z(n);return{o:function(e,t){i.value=e,r=t},d:Z((function(){var n=i.value.value;r[t]!==n&&(r[t]=n,o?e[t]=n:n?e.setAttribute(t,n):e.removeAttribute(t))}))}}R.prototype.brand=j,R.prototype.h=function(){return!0},R.prototype.S=function(e){this.t!==e&&void 0===e.e&&(e.x=this.t,void 0!==this.t&&(this.t.e=e),this.t=e)},R.prototype.U=function(e){if(void 0!==this.t){var t=e.e,n=e.x;void 0!==t&&(t.x=n,e.e=void 0),void 0!==n&&(n.e=t,e.x=void 0),e===this.t&&(this.t=n)}},R.prototype.subscribe=function(e){var t=this;return Z((function(){var n=t.value,r=$;$=void 0;try{e(n)}finally{$=r}}))},R.prototype.valueOf=function(){return this.value},R.prototype.toString=function(){return this.value+""},R.prototype.toJSON=function(){return this.value},R.prototype.peek=function(){var e=$;$=void 0;try{return this.value}finally{$=e}},Object.defineProperty(R.prototype,"value",{get:function(){var e=I(this);return void 0!==e&&(e.i=this.i),this.v},set:function(e){if(e!==this.v){if(L>100)throw new Error("Cycle detected");this.v=e,this.i++,D++,W++;try{for(var t=this.t;void 0!==t;t=t.x)t.t.N()}finally{M()}}}}),(B.prototype=new R).h=function(){if(this.f&=-3,1&this.f)return!1;if(32==(36&this.f))return!0;if(this.f&=-5,this.g===D)return!0;if(this.g=D,this.f|=1,this.i>0&&!V(this))return this.f&=-2,!0;var e=$;try{J(this),$=this;var t=this.x();(16&this.f||this.v!==t||0===this.i)&&(this.v=t,this.f&=-17,this.i++)}catch(e){this.v=e,this.f|=16,this.i++}return $=e,K(this),this.f&=-2,!0},B.prototype.S=function(e){if(void 0===this.t){this.f|=36;for(var t=this.s;void 0!==t;t=t.n)t.S.S(t)}R.prototype.S.call(this,e)},B.prototype.U=function(e){if(void 0!==this.t&&(R.prototype.U.call(this,e),void 0===this.t)){this.f&=-33;for(var t=this.s;void 0!==t;t=t.n)t.S.U(t)}},B.prototype.N=function(){if(!(2&this.f)){this.f|=6;for(var e=this.t;void 0!==e;e=e.x)e.t.N()}},Object.defineProperty(B.prototype,"value",{get:function(){if(1&this.f)throw new Error("Cycle detected");var e=I(this);if(this.h(),void 0!==e&&(e.i=this.i),16&this.f)throw this.v;return this.v}}),Q.prototype.c=function(){var e=this.S();try{if(8&this.f)return;if(void 0===this.x)return;var t=this.x();"function"==typeof t&&(this.u=t)}finally{e()}},Q.prototype.S=function(){if(1&this.f)throw new Error("Cycle detected");this.f|=1,this.f&=-9,Y(this),J(this),W++;var e=$;return $=this,G.bind(this,e)},Q.prototype.N=function(){2&this.f||(this.f|=2,this.o=A,A=this)},Q.prototype.d=function(){this.f|=8,1&this.f||X(this)},ne.displayName="_st",Object.defineProperties(R.prototype,{constructor:{configurable:!0,value:void 0},type:{configurable:!0,value:ne},props:{configurable:!0,get:function(){return{data:this}}},__b:{configurable:!0,value:1}}),ee("__b",(function(e,t){if("string"==typeof t.type){var n,r=t.props;for(var o in r)if("children"!==o){var i=r[o];i instanceof R&&(n||(t.__np=n={}),n[o]=i,r[o]=i.peek())}}e(t)})),ee("__r",(function(e,t){te();var n,r=t.__c;r&&(r.__$f&=-2,void 0===(n=r.__$u)&&(r.__$u=n=function(e){var t;return Z((function(){t=this})),t.c=function(){r.__$f|=1,r.setState({})},t}())),r,te(n),e(t)})),ee("__e",(function(e,t,n,r){te(),void 0,e(t,n,r)})),ee("diffed",(function(e,t){var n;if(te(),void 0,"string"==typeof t.type&&(n=t.__e)){var r=t.__np,o=t.props;if(r){var i=n.U;if(i)for(var s in i){var a=i[s];void 0===a||s in r||(a.d(),i[s]=void 0)}else n.U=i={};for(var u in r){var l=i[u],c=r[u];void 0===l?(l=re(n,u,c,o),i[u]=l):l.o(c,o)}}}e(t)})),ee("unmount",(function(e,t){if("string"==typeof t.type){var n=t.__e;if(n){var r=n.U;if(r)for(var o in n.U=void 0,r){var i=r[o];i&&i.d()}}}else{var s=t.__c;if(s){var a=s.__$u;a&&(s.__$u=void 0,a.d())}}e(t)})),ee("__h",(function(e,t,n,r){(r<3||9===r)&&(t.__$f|=2),e(t,n,r)})),a.uA.prototype.shouldComponentUpdate=function(e,t){var n=this.__$u;if(!(n&&void 0!==n.s||4&this.__$f))return!0;if(3&this.__$f)return!0;for(var r in t)return!0;for(var o in e)if("__source"!==o&&e[o]!==this.props[o])return!0;for(var i in this.props)if(!(i in e))return!0;return!1};const oe=[],ie=()=>oe.slice(-1)[0],se=e=>{oe.push(e)},ae=()=>{oe.pop()},ue=[],le=()=>ue.slice(-1)[0],ce=e=>{ue.push(e)},_e=()=>{ue.pop()},fe=new WeakMap,pe=()=>{throw new Error("Please use `data-wp-bind` to modify the attributes of an element.")},he={get(e,t,n){const r=Reflect.get(e,t,n);return r&&"object"==typeof r?de(r):r},set:pe,deleteProperty:pe},de=e=>(fe.has(e)||fe.set(e,new Proxy(e,he)),fe.get(e)),ve=e=>le().context[e||ie()],ye=()=>{const e=le();const{ref:t,attributes:n}=e;return Object.freeze({ref:t.current,attributes:de(n)})},me=e=>le().serverContext[e||ie()],ge=e=>new Promise((t=>{const n=()=>{clearTimeout(r),window.cancelAnimationFrame(o),setTimeout((()=>{e(),t()}))},r=setTimeout(n,100),o=window.requestAnimationFrame(n)})),we=()=>new Promise((e=>{setTimeout(e,0)}));function be(e){g((()=>{let t=null,n=!1;return t=function(e,t){let n=()=>{};const r=Z((function(){return n=this.c.bind(this),this.x=e,this.c=t,e()}));return{flush:n,dispose:r}}(e,(async()=>{t&&!n&&(n=!0,await ge(t.flush),n=!1)})),t.dispose}),[])}function ke(e){const t=le(),n=ie();return"GeneratorFunction"===e?.constructor?.name?async(...r)=>{const o=e(...r);let i,s;for(;;){se(n),ce(t);try{s=o.next(i)}finally{_e(),ae()}try{i=await s.value}catch(e){se(n),ce(t),o.throw(e)}finally{_e(),ae()}if(s.done)break}return i}:(...r)=>{se(n),ce(t);try{return e(...r)}finally{ae(),_e()}}}function xe(e){be(ke(e))}function Se(e){g(ke(e),[])}function Ee(e,t){g(ke(e),t)}function Te(e,t){w(ke(e),t)}function Oe(e,t){return x(ke(e),t)}function Fe(e,t){return k(ke(e),t)}new Set;const Pe=e=>{0},Ce=e=>Boolean(e&&"object"==typeof e&&e.constructor===Object),Ne=new WeakMap,je=new WeakMap,Me=new WeakMap,He=new Set([Object,Array]),$e=(e,t,n)=>{if(!We(t))throw Error("This object cannot be proxified.");if(!Ne.has(t)){const r=new Proxy(t,n);Ne.set(t,r),je.set(r,t),Me.set(r,e)}return Ne.get(t)},Ue=e=>Ne.get(e),Ae=e=>Me.get(e),We=e=>"object"==typeof e&&null!==e&&(!Me.has(e)&&He.has(e.constructor)),Le={};class De{constructor(e){this.owner=e,this.computedsByScope=new WeakMap}setValue(e){this.update({value:e})}setGetter(e){this.update({get:e})}getComputed(){const e=le()||Le;if(this.valueSignal||this.getterSignal||this.update({}),!this.computedsByScope.has(e)){const t=()=>{const e=this.getterSignal?.value;return e?e.call(this.owner):this.valueSignal?.value};se(Ae(this.owner)),this.computedsByScope.set(e,q(ke(t))),ae()}return this.computedsByScope.get(e)}update({get:e,value:t}){this.valueSignal?t===this.valueSignal.peek()&&e===this.getterSignal.peek()||H((()=>{this.valueSignal.value=t,this.getterSignal.value=e})):(this.valueSignal=z(t),this.getterSignal=z(e))}}const Ie=new Set(Object.getOwnPropertyNames(Symbol).map((e=>Symbol[e])).filter((e=>"symbol"==typeof e))),Re=new WeakMap,ze=(e,t)=>Re.has(e)&&Re.get(e).has(t),Ve=new WeakSet,Je=(e,t,n)=>{Re.has(e)||Re.set(e,new Map),t="number"==typeof t?`${t}`:t;const r=Re.get(e);if(!r.has(t)){const o=Ae(e),i=new De(e);if(r.set(t,i),n){const{get:t,value:r}=n;if(t)i.setGetter(t);else{const t=Ve.has(e);i.setValue(We(r)?Ye(o,r,{readOnly:t}):r)}}}return r.get(t)},Ke=new WeakMap;let Be=!1;const qe={get(e,t,n){if(Be||!e.hasOwnProperty(t)&&t in e||"symbol"==typeof t&&Ie.has(t))return Reflect.get(e,t,n);const r=Object.getOwnPropertyDescriptor(e,t),o=Je(n,t,r).getComputed().value;if("function"==typeof o){const e=Ae(n);return(...t)=>{se(e);try{return o.call(n,...t)}finally{ae()}}}return o},set(e,t,n,r){if(Ve.has(r))return!1;se(Ae(r));try{return Reflect.set(e,t,n,r)}finally{ae()}},defineProperty(e,t,n){if(Ve.has(Ue(e)))return!1;const r=!(t in e),o=Reflect.defineProperty(e,t,n);if(o){const o=Ue(e),i=Je(o,t),{get:s,value:a}=n;if(s)i.setGetter(s);else{const e=Ae(o);i.setValue(We(a)?Ye(e,a):a)}if(r&&Ke.has(e)&&Ke.get(e).value++,Array.isArray(e)&&Re.get(o)?.has("length")){Je(o,"length").setValue(e.length)}}return o},deleteProperty(e,t){if(Ve.has(Ue(e)))return!1;const n=Reflect.deleteProperty(e,t);if(n){Je(Ue(e),t).setValue(void 0),Ke.has(e)&&Ke.get(e).value++}return n},ownKeys:e=>(Ke.has(e)||Ke.set(e,z(0)),Ke._=Ke.get(e).value,Reflect.ownKeys(e))},Ye=(e,t,n)=>{const r=$e(e,t,qe);return n?.readOnly&&Ve.add(r),r},Xe=(e,t,n=!0)=>{if(Ce(e)&&Ce(t)){let r=!1;for(const o in t){const i=!(o in e);r=r||i;const s=Object.getOwnPropertyDescriptor(t,o);if("function"==typeof s?.get||"function"==typeof s?.set){if(n||i){Object.defineProperty(e,o,{...s,configurable:!0,enumerable:!0});const t=Ue(e);if(s?.get&&t&&ze(t,o)){Je(t,o).setGetter(s.get)}}}else if(Ce(t[o]))i&&(e[o]={}),Xe(e[o],t[o],n);else if(n||i){Object.defineProperty(e,o,s);const t=Ue(e);if(s?.value&&t&&ze(t,o)){Je(t,o).setValue(s.value)}}}r&&Ke.has(e)&&Ke.get(e).value++}},Ge=(e,t,n=!0)=>H((()=>{return Xe((r=e,je.get(r)||e),t,n);var r})),Qe=new WeakSet,Ze={get:(e,t,n)=>{const r=Reflect.get(e,t),o=Ae(n);if(void 0===r&&Qe.has(n)){const n={};return Reflect.set(e,t,n),et(o,n,!1)}if("function"==typeof r){se(o);const e=ke(r);return ae(),e}return Ce(r)&&We(r)?et(o,r,!1):r}},et=(e,t,n=!0)=>{const r=$e(e,t,Ze);return r&&n&&Qe.add(r),r},tt=new WeakMap,nt=new WeakMap,rt=new WeakSet,ot=Reflect.getOwnPropertyDescriptor,it={get:(e,t)=>{const n=nt.get(e),r=e[t];return t in e?r:n[t]},set:(e,t,n)=>{const r=nt.get(e);return(t in e||!(t in r)?e:r)[t]=n,!0},ownKeys:e=>[...new Set([...Object.keys(nt.get(e)),...Object.keys(e)])],getOwnPropertyDescriptor:(e,t)=>ot(e,t)||ot(nt.get(e),t)},st=(e,t={})=>{if(rt.has(e))throw Error("This object cannot be proxified.");if(nt.set(e,t),!tt.has(e)){const t=new Proxy(e,it);tt.set(e,t),rt.add(t)}return tt.get(e)},at=new Map,ut=new Map,lt=new Map,ct=new Map,_t=new Map,ft=e=>ct.get(e||ie())||{},pt=e=>{const t=e||ie();return _t.has(t)||_t.set(t,Ye(t,{},{readOnly:!0})),_t.get(t)},ht="I acknowledge that using a private store means my plugin will inevitably break on the next store release.";function dt(e,{state:t={},...n}={},{lock:r=!1}={}){if(at.has(e)){if(r===ht||lt.has(e)){const t=lt.get(e);if(!(r===ht||!0!==r&&r===t))throw t?Error("Cannot unlock a private store with an invalid lock code"):Error("Cannot lock a public store")}else lt.set(e,r);const o=ut.get(e);Ge(o,n),Ge(o.state,t)}else{r!==ht&<.set(e,r);const o={state:Ye(e,Ce(t)?t:{}),...n},i=et(e,o);ut.set(e,o),at.set(e,i)}return at.get(e)}const vt=(e=document)=>{var t;const n=null!==(t=e.getElementById("wp-script-module-data-@wordpress/interactivity"))&&void 0!==t?t:e.getElementById("wp-interactivity-data");if(n?.textContent)try{return JSON.parse(n.textContent)}catch{}return{}},yt=e=>{Ce(e?.state)&&Object.entries(e.state).forEach((([e,t])=>{const n=dt(e,{},{lock:ht});Ge(n.state,t,!1),Ge(pt(e),t)})),Ce(e?.config)&&Object.entries(e.config).forEach((([e,t])=>{ct.set(e,t)}))},mt=vt();yt(mt);const gt=(0,a.q6)({client:{},server:{}}),wt={},bt={},kt=(e,t,{priority:n=10}={})=>{wt[e]=t,bt[e]=n},xt=({scope:e})=>(t,...n)=>{let{value:r,namespace:o}=t;if("string"!=typeof r)throw new Error("The `value` prop should be a string path");const i="!"===r[0]&&!!(r=r.slice(1));ce(e);const s=((e,t)=>{if(!t)return void Pe();let n=at.get(t);void 0===n&&(n=dt(t,void 0,{lock:ht}));const r={...n,context:le().context[t]};try{return e.split(".").reduce(((e,t)=>e[t]),r)}catch(e){}})(r,o),a="function"==typeof s?s(...n):s;return _e(),i?!a:a},St=({directives:e,priorityLevels:[t,...n],element:r,originalProps:o,previousScope:i})=>{const s=b({}).current;s.evaluate=x(xt({scope:s}),[]);const{client:u,server:l}=S(gt);s.context=u,s.serverContext=l,s.ref=i?.ref||b(null),r=(0,a.Ob)(r,{ref:s.ref}),s.attributes=r.props;const c=n.length>0?(0,a.h)(St,{directives:e,priorityLevels:n,element:r,originalProps:o,previousScope:s}):r,_={...o,children:c},f={directives:e,props:_,element:r,context:gt,evaluate:s.evaluate};ce(s);for(const e of t){const t=wt[e]?.(f);void 0!==t&&(_.children=t)}return _e(),_.children},Et=a.fF.vnode;function Tt(e){return Ce(e)?Object.fromEntries(Object.entries(e).map((([e,t])=>[e,Tt(t)]))):Array.isArray(e)?e.map((e=>Tt(e))):e}a.fF.vnode=e=>{if(e.props.__directives){const t=e.props,n=t.__directives;n.key&&(e.key=n.key.find((({suffix:e})=>"default"===e)).value),delete t.__directives;const r=(e=>{const t=Object.keys(e).reduce(((e,t)=>{if(wt[t]){const n=bt[t];(e[n]=e[n]||[]).push(t)}return e}),{});return Object.entries(t).sort((([e],[t])=>parseInt(e)-parseInt(t))).map((([,e])=>e))})(n);r.length>0&&(e.props={directives:n,priorityLevels:r,originalProps:t,type:e.type,element:(0,a.h)(e.type,t),top:!0},e.type=St)}Et&&Et(e)};const Ot=/(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g,Ft=/\/\*[^]*?\*\/| +/g,Pt=/\n+/g,Ct=e=>({directives:t,evaluate:n})=>{t[`on-${e}`].filter((({suffix:e})=>"default"!==e)).forEach((t=>{const r=t.suffix.split("--",1)[0];Se((()=>{const o=e=>n(t,e),i="window"===e?window:document;return i.addEventListener(r,o),()=>i.removeEventListener(r,o)}))}))},Nt=e=>({directives:t,evaluate:n})=>{t[`on-async-${e}`].filter((({suffix:e})=>"default"!==e)).forEach((t=>{const r=t.suffix.split("--",1)[0];Se((()=>{const o=async e=>{await we(),n(t,e)},i="window"===e?window:document;return i.addEventListener(r,o,{passive:!0}),()=>i.removeEventListener(r,o)}))}))},jt="wp",Mt=`data-${jt}-ignore`,Ht=`data-${jt}-interactive`,$t=`data-${jt}-`,Ut=[],At=new RegExp(`^data-${jt}-([a-z0-9]+(?:-[a-z0-9]+)*)(?:--([a-z0-9_-]+))?$`,"i"),Wt=/^([\w_\/-]+)::(.+)$/,Lt=new WeakSet;function Dt(e){const t=document.createTreeWalker(e,205);return function e(n){const{nodeType:r}=n;if(3===r)return[n.data];if(4===r){var o;const e=t.nextSibling();return n.replaceWith(new window.Text(null!==(o=n.nodeValue)&&void 0!==o?o:"")),[n.nodeValue,e]}if(8===r||7===r){const e=t.nextSibling();return n.remove(),[null,e]}const i=n,{attributes:s}=i,u=i.localName,l={},c=[],_=[];let f=!1,p=!1;for(let e=0;e{const o=At.exec(t);if(null===o)return Pe(),e;const i=o[1]||"",s=o[2]||"default";var a;return e[i]=e[i]||[],e[i].push({namespace:null!=n?n:null!==(a=Ut[Ut.length-1])&&void 0!==a?a:null,value:r,suffix:s}),e}),{})),"template"===u)l.content=[...i.content.childNodes].map((e=>Dt(e)));else{let n=t.firstChild();if(n){for(;n;){const[r,o]=e(n);r&&c.push(r),n=o||t.nextSibling()}t.parentNode()}}return p&&Ut.pop(),[(0,a.h)(u,l,c)]}(t.currentNode)}const It=new WeakMap,Rt=e=>{if(!e.parentElement)throw Error("The passed region should be an element with a parent.");return It.has(e)||It.set(e,((e,t)=>{const n=(t=[].concat(t))[t.length-1].nextSibling;function r(t,r){e.insertBefore(t,r||n)}return e.__k={nodeType:1,parentNode:e,firstChild:t[0],childNodes:t,insertBefore:r,appendChild:r,removeChild(t){e.removeChild(t)}}})(e.parentElement,e)),It.get(e)},zt=new WeakMap,Vt=e=>{if("I acknowledge that using private APIs means my theme or plugin will inevitably break in the next version of WordPress."===e)return{directivePrefix:jt,getRegionRootFragment:Rt,initialVdom:zt,toVdom:Dt,directive:kt,getNamespace:ie,h:a.h,cloneElement:a.Ob,render:a.XX,proxifyState:Ye,parseServerData:vt,populateServerData:yt,batch:H};throw new Error("Forbidden access.")};kt("context",(({directives:{context:e},props:{children:t},context:n})=>{const{Provider:r}=n,o=e.find((({suffix:e})=>"default"===e)),{client:i,server:s}=S(n),u=o.namespace,l=b(Ye(u,{})),c=b(Ye(u,{},{readOnly:!0})),_=k((()=>{const e={client:{...i},server:{...s}};if(o){const{namespace:t,value:n}=o;Ce(n)||Pe(),Ge(l.current,Tt(n),!1),Ge(c.current,Tt(n)),e.client[t]=st(l.current,i[t]),e.server[t]=st(c.current,s[t])}return e}),[o,i,s]);return(0,a.h)(r,{value:_},t)}),{priority:5}),kt("watch",(({directives:{watch:e},evaluate:t})=>{e.forEach((e=>{xe((()=>t(e)))}))})),kt("init",(({directives:{init:e},evaluate:t})=>{e.forEach((e=>{Se((()=>t(e)))}))})),kt("on",(({directives:{on:e},element:t,evaluate:n})=>{const r=new Map;e.filter((({suffix:e})=>"default"!==e)).forEach((e=>{const t=e.suffix.split("--")[0];r.has(t)||r.set(t,new Set),r.get(t).add(e)})),r.forEach(((e,r)=>{const o=t.props[`on${r}`];t.props[`on${r}`]=t=>{e.forEach((e=>{o&&o(t),n(e,t)}))}}))})),kt("on-async",(({directives:{"on-async":e},element:t,evaluate:n})=>{const r=new Map;e.filter((({suffix:e})=>"default"!==e)).forEach((e=>{const t=e.suffix.split("--")[0];r.has(t)||r.set(t,new Set),r.get(t).add(e)})),r.forEach(((e,r)=>{const o=t.props[`on${r}`];t.props[`on${r}`]=t=>{o&&o(t),e.forEach((async e=>{await we(),n(e,t)}))}}))})),kt("on-window",Ct("window")),kt("on-document",Ct("document")),kt("on-async-window",Nt("window")),kt("on-async-document",Nt("document")),kt("class",(({directives:{class:e},element:t,evaluate:n})=>{e.filter((({suffix:e})=>"default"!==e)).forEach((e=>{const r=e.suffix,o=n(e),i=t.props.class||"",s=new RegExp(`(^|\\s)${r}(\\s|$)`,"g");o?s.test(i)||(t.props.class=i?`${i} ${r}`:r):t.props.class=i.replace(s," ").trim(),Se((()=>{o?t.ref.current.classList.add(r):t.ref.current.classList.remove(r)}))}))})),kt("style",(({directives:{style:e},element:t,evaluate:n})=>{e.filter((({suffix:e})=>"default"!==e)).forEach((e=>{const r=e.suffix,o=n(e);t.props.style=t.props.style||{},"string"==typeof t.props.style&&(t.props.style=(e=>{const t=[{}];let n,r;for(;n=Ot.exec(e.replace(Ft,""));)n[4]?t.shift():n[3]?(r=n[3].replace(Pt," ").trim(),t.unshift(t[0][r]=t[0][r]||{})):t[0][n[1]]=n[2].replace(Pt," ").trim();return t[0]})(t.props.style)),o?t.props.style[r]=o:delete t.props.style[r],Se((()=>{o?t.ref.current.style[r]=o:t.ref.current.style.removeProperty(r)}))}))})),kt("bind",(({directives:{bind:e},element:t,evaluate:n})=>{e.filter((({suffix:e})=>"default"!==e)).forEach((e=>{const r=e.suffix,o=n(e);t.props[r]=o,Se((()=>{const e=t.ref.current;if("style"!==r){if("width"!==r&&"height"!==r&&"href"!==r&&"list"!==r&&"form"!==r&&"tabIndex"!==r&&"download"!==r&&"rowSpan"!==r&&"colSpan"!==r&&"role"!==r&&r in e)try{return void(e[r]=null==o?"":o)}catch(e){}null==o||!1===o&&"-"!==r[4]?e.removeAttribute(r):e.setAttribute(r,o)}else"string"==typeof o&&(e.style.cssText=o)}))}))})),kt("ignore",(({element:{type:e,props:{innerHTML:t,...n}}})=>{const r=k((()=>t),[]);return(0,a.h)(e,{dangerouslySetInnerHTML:{__html:r},...n})})),kt("text",(({directives:{text:e},element:t,evaluate:n})=>{const r=e.find((({suffix:e})=>"default"===e));if(r)try{const e=n(r);t.props.children="object"==typeof e?null:e.toString()}catch(e){t.props.children=null}else t.props.children=null})),kt("run",(({directives:{run:e},evaluate:t})=>{e.forEach((e=>t(e)))})),kt("each",(({directives:{each:e,"each-key":t},context:n,element:r,evaluate:o})=>{if("template"!==r.type)return;const{Provider:i}=n,s=S(n),[u]=e,{namespace:l,suffix:c}=u;return o(u).map((e=>{const n="default"===c?"item":c.replace(/^-+|-+$/g,"").toLowerCase().replace(/-([a-z])/g,(function(e,t){return t.toUpperCase()})),o=st(Ye(l,{}),s.client[l]),u={client:{...s.client,[l]:o},server:{...s.server}};u.client[l][n]=e;const _={...le(),context:u.client,serverContext:u.server},f=t?xt({scope:_})(t[0]):e;return(0,a.h)(i,{value:u,key:f},r.props.content)}))}),{priority:20}),kt("each-child",(()=>null),{priority:1}),(async()=>{const e=document.querySelectorAll(`[data-${jt}-interactive]`);for(const t of e)if(!Lt.has(t)){await we();const e=Rt(t),n=Dt(t);zt.set(t,n),await we(),(0,a.Qv)(n,e)}})()},622:(e,t,n)=>{n.d(t,{FK:()=>x,Ob:()=>V,Qv:()=>z,XX:()=>R,fF:()=>o,h:()=>b,q6:()=>J,uA:()=>S,zO:()=>s});var r,o,i,s,a,u,l,c,_,f,p,h,d={},v=[],y=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,m=Array.isArray;function g(e,t){for(var n in t)e[n]=t[n];return e}function w(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function b(e,t,n){var o,i,s,a={};for(s in t)"key"==s?o=t[s]:"ref"==s?i=t[s]:a[s]=t[s];if(arguments.length>2&&(a.children=arguments.length>3?r.call(arguments,2):n),"function"==typeof e&&null!=e.defaultProps)for(s in e.defaultProps)void 0===a[s]&&(a[s]=e.defaultProps[s]);return k(e,a,o,i,null)}function k(e,t,n,r,s){var a={type:e,props:t,key:n,ref:r,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:null==s?++i:s,__i:-1,__u:0};return null==s&&null!=o.vnode&&o.vnode(a),a}function x(e){return e.children}function S(e,t){this.props=e,this.context=t}function E(e,t){if(null==t)return e.__?E(e.__,e.__i+1):null;for(var n;tt&&a.sort(c));F.__r=0}function P(e,t,n,r,o,i,s,a,u,l,c){var _,f,p,h,y,m=r&&r.__k||v,g=t.length;for(n.__d=u,C(n,t,m),u=n.__d,_=0;_0?k(o.type,o.props,o.key,o.ref?o.ref:null,o.__v):o).__=e,o.__b=e.__b+1,i=null,-1!==(a=o.__i=j(o,n,s,c))&&(c--,(i=n[a])&&(i.__u|=131072)),null==i||null===i.__v?(-1==a&&_--,"function"!=typeof o.type&&(o.__u|=65536)):a!==s&&(a==s-1?_--:a==s+1?_++:(a>s?_--:_++,o.__u|=65536))):o=e.__k[r]=null;if(c)for(r=0;r(null!=u&&0==(131072&u.__u)?1:0))for(;s>=0||a=0){if((u=t[s])&&0==(131072&u.__u)&&o==u.key&&i===u.type)return s;s--}if(a2&&(u.children=arguments.length>3?r.call(arguments,2):n),k(e.type,u,o||e.key,i||e.ref,null)}function J(e,t){var n={__c:t="__cC"+h++,__: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.componentWillUnmount=function(){n=null},this.shouldComponentUpdate=function(e){this.props.value!==e.value&&n.some((function(e){e.__e=!0,O(e)}))},this.sub=function(e){n.push(e);var t=e.componentWillUnmount;e.componentWillUnmount=function(){n&&n.splice(n.indexOf(e),1),t&&t.call(e)}}),e.children}};return n.Provider.__=n.Consumer.contextType=n}r=v.slice,o={__e:function(e,t,n,r){for(var o,i,s;t=t.__;)if((o=t.__c)&&!o.__)try{if((i=o.constructor)&&null!=i.getDerivedStateFromError&&(o.setState(i.getDerivedStateFromError(e)),s=o.__d),null!=o.componentDidCatch&&(o.componentDidCatch(e,r||{}),s=o.__d),s)return o.__E=o}catch(t){e=t}throw e}},i=0,s=function(e){return null!=e&&null==e.constructor},S.prototype.setState=function(e,t){var n;n=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=g({},this.state),"function"==typeof e&&(e=e(g({},n),this.props)),e&&g(n,e),null!=e&&this.__v&&(t&&this._sb.push(t),O(this))},S.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),O(this))},S.prototype.render=x,a=[],l="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,c=function(e,t){return e.__v.__b-t.__v.__b},F.__r=0,_=0,f=$(!1),p=$(!0),h=0}},t={};function n(r){var o=t[r];if(void 0!==o)return o.exports;var i=t[r]={exports:{}};return e[r](i,i.exports,n),i.exports}n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var r={};(()=>{n.d(r,{zj:()=>w.zj,SD:()=>w.SD,V6:()=>w.V6,$K:()=>w.$K,vT:()=>w.vT,jb:()=>w.jb,yT:()=>w.yT,M_:()=>w.M_,hb:()=>w.hb,vJ:()=>w.vJ,ip:()=>w.ip,Nf:()=>w.Nf,Kr:()=>w.Kr,li:()=>w.li,J0:()=>w.J0,FH:()=>w.FH,v4:()=>w.v4});var e,t=n(622);null!=(e="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0)&&e.__PREACT_DEVTOOLS__&&e.__PREACT_DEVTOOLS__.attachPreact("10.24.0",t.fF,{Fragment:t.FK,Component:t.uA});var o={};function i(e){return e.type===t.FK?"Fragment":"function"==typeof e.type?e.type.displayName||e.type.name:"string"==typeof e.type?e.type:"#text"}var s=[],a=[];function u(){return s.length>0?s[s.length-1]:null}var l=!0;function c(e){return"function"==typeof e.type&&e.type!=t.FK}function _(e){for(var t=[e],n=e;null!=n.__o;)t.push(n.__o),n=n.__o;return t.reduce((function(e,t){e+=" in "+i(t);var n=t.__source;return n?e+=" (at "+n.fileName+":"+n.lineNumber+")":l&&console.warn("Add @babel/plugin-transform-react-jsx-source to get a more detailed component stack. Note that you should not add it to production builds of your App for bundle size reasons."),l=!1,e+"\n"}),"")}var f="function"==typeof WeakMap;function p(e){var t=[];return e.__k?(e.__k.forEach((function(e){e&&"function"==typeof e.type?t.push.apply(t,p(e)):e&&"string"==typeof e.type&&t.push(e.type)})),t):t}function h(e){return e?"function"==typeof e.type?null==e.__?null!=e.__e&&null!=e.__e.parentNode?e.__e.parentNode.localName:"":h(e.__):e.type:""}var d=t.uA.prototype.setState;function v(e){return"table"===e||"tfoot"===e||"tbody"===e||"thead"===e||"td"===e||"tr"===e||"th"===e}t.uA.prototype.setState=function(e,t){return null==this.__v&&null==this.state&&console.warn('Calling "this.setState" inside the constructor of a component is a no-op and might be a bug in your application. Instead, set "this.state = {}" directly.\n\n'+_(u())),d.call(this,e,t)};var y=/^(address|article|aside|blockquote|details|div|dl|fieldset|figcaption|figure|footer|form|h1|h2|h3|h4|h5|h6|header|hgroup|hr|main|menu|nav|ol|p|pre|search|section|table|ul)$/,m=t.uA.prototype.forceUpdate;function g(e){var t=e.props,n=i(e),r="";for(var o in t)if(t.hasOwnProperty(o)&&"children"!==o){var s=t[o];"function"==typeof s&&(s="function "+(s.displayName||s.name)+"() {}"),s=Object(s)!==s||s.toString?s+"":Object.prototype.toString.call(s),r+=" "+o+"="+JSON.stringify(s)}var a=t.children;return"<"+n+r+(a&&a.length?">..":" />")}t.uA.prototype.forceUpdate=function(e){return null==this.__v?console.warn('Calling "this.forceUpdate" inside the constructor of a component is a no-op and might be a bug in your application.\n\n'+_(u())):null==this.__P&&console.warn('Can\'t call "this.forceUpdate" on an unmounted component. This is a no-op, but it indicates a memory leak in your application. To fix, cancel all subscriptions and asynchronous tasks in the componentWillUnmount method.\n\n'+_(this.__v)),m.call(this,e)},t.fF.__m=function(e,t){var n=e.type,r=t.map((function(e){return e.localName}));console.error("Expected a DOM node of type "+n+" but found "+r.join(", ")+"as available DOM-node(s), this is caused by the SSR'd HTML containing different DOM-nodes compared to the hydrated one.\n\n"+_(e))},function(){!function(){var e=t.fF.__b,n=t.fF.diffed,r=t.fF.__,o=t.fF.vnode,i=t.fF.__r;t.fF.diffed=function(e){c(e)&&a.pop(),s.pop(),n&&n(e)},t.fF.__b=function(t){c(t)&&s.push(t),e&&e(t)},t.fF.__=function(e,t){a=[],r&&r(e,t)},t.fF.vnode=function(e){e.__o=a.length>0?a[a.length-1]:null,o&&o(e)},t.fF.__r=function(e){c(e)&&a.push(e),i&&i(e)}}();var e=!1,n=t.fF.__b,r=t.fF.diffed,u=t.fF.vnode,l=t.fF.__r,d=t.fF.__e,m=t.fF.__,w=t.fF.__h,b=f?{useEffect:new WeakMap,useLayoutEffect:new WeakMap,lazyPropTypes:new WeakMap}:null,k=[];t.fF.__e=function(e,t,n,r){if(t&&t.__c&&"function"==typeof e.then){var o=e;e=new Error("Missing Suspense. The throwing component was: "+i(t));for(var s=t;s;s=s.__)if(s.__c&&s.__c.__c){e=o;break}if(e instanceof Error)throw e}try{(r=r||{}).componentStack=_(t),d(e,t,n,r),"function"!=typeof e.then&&setTimeout((function(){throw e}))}catch(e){throw e}},t.fF.__=function(e,t){if(!t)throw new Error("Undefined parent passed to render(), this is the second argument.\nCheck if the element is available in the DOM/has the correct id.");var n;switch(t.nodeType){case 1:case 11:case 9:n=!0;break;default:n=!1}if(!n){var r=i(e);throw new Error("Expected a valid HTML node as a second argument to render.\tReceived "+t+" instead: render(<"+r+" />, "+t+");")}m&&m(e,t)},t.fF.__b=function(t){var r=t.type;if(e=!0,void 0===r)throw new Error("Undefined component passed to createElement()\n\nYou likely forgot to export your component or might have mixed up default and named imports"+g(t)+"\n\n"+_(t));if(null!=r&&"object"==typeof r){if(void 0!==r.__k&&void 0!==r.__e)throw new Error("Invalid type passed to createElement(): "+r+"\n\nDid you accidentally pass a JSX literal as JSX twice?\n\n let My"+i(t)+" = "+g(r)+";\n let vnode = ;\n\nThis usually happens when you export a JSX literal and not the component.\n\n"+_(t));throw new Error("Invalid type passed to createElement(): "+(Array.isArray(r)?"array":r))}if(void 0!==t.ref&&"function"!=typeof t.ref&&"object"!=typeof t.ref&&!("$$typeof"in t))throw new Error('Component\'s "ref" property should be a function, or an object created by createRef(), but got ['+typeof t.ref+"] instead\n"+g(t)+"\n\n"+_(t));if("string"==typeof t.type)for(var s in t.props)if("o"===s[0]&&"n"===s[1]&&"function"!=typeof t.props[s]&&null!=t.props[s])throw new Error("Component's \""+s+'" property should be a function, but got ['+typeof t.props[s]+"] instead\n"+g(t)+"\n\n"+_(t));if("function"==typeof t.type&&t.type.propTypes){if("Lazy"===t.type.displayName&&b&&!b.lazyPropTypes.has(t.type)){var a="PropTypes are not supported on lazy(). Use propTypes on the wrapped component itself. ";try{var u=t.type();b.lazyPropTypes.set(t.type,!0),console.warn(a+"Component wrapped in lazy() is "+i(u))}catch(e){console.warn(a+"We will log the wrapped component's name once it is loaded.")}}var l=t.props;t.type.__f&&delete(l=function(e,t){for(var n in t)e[n]=t[n];return e}({},l)).ref,function(e,t,n,r,i){Object.keys(e).forEach((function(n){var s;try{s=e[n](t,n,r,"prop",null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(e){s=e}s&&!(s.message in o)&&(o[s.message]=!0,console.error("Failed prop type: "+s.message+(i&&"\n"+i()||"")))}))}(t.type.propTypes,l,0,i(t),(function(){return _(t)}))}n&&n(t)};var x,S=0;t.fF.__r=function(t){l&&l(t),e=!0;var n=t.__c;if(n===x?S++:S=1,S>=25)throw new Error("Too many re-renders. This is limited to prevent an infinite loop which may lock up your browser. The component causing this is: "+i(t));x=n},t.fF.__h=function(t,n,r){if(!t||!e)throw new Error("Hook can only be invoked from render methods.");w&&w(t,n,r)};var E=function(e,t){return{get:function(){var n="get"+e+t;k&&k.indexOf(n)<0&&(k.push(n),console.warn("getting vnode."+e+" is deprecated, "+t))},set:function(){var n="set"+e+t;k&&k.indexOf(n)<0&&(k.push(n),console.warn("setting vnode."+e+" is not allowed, "+t))}}},T={nodeName:E("nodeName","use vnode.type"),attributes:E("attributes","use vnode.props"),children:E("children","use vnode.props.children")},O=Object.create({},T);t.fF.vnode=function(e){var t=e.props;if(null!==e.type&&null!=t&&("__source"in t||"__self"in t)){var n=e.props={};for(var r in t){var o=t[r];"__source"===r?e.__source=o:"__self"===r?e.__self=o:n[r]=o}}e.__proto__=O,u&&u(e)},t.fF.diffed=function(t){var n,o=t.type,s=t.__;if(t.__k&&t.__k.forEach((function(e){if("object"==typeof e&&e&&void 0===e.type){var n=Object.keys(e).join(",");throw new Error("Objects are not valid as a child. Encountered an object with the keys {"+n+"}.\n\n"+_(t))}})),t.__c===x&&(S=0),"string"==typeof o&&(v(o)||"p"===o||"a"===o||"button"===o)){var a=h(s);if(""!==a&&v(o))"table"===o&&"td"!==a&&v(a)?(console.log(a,s.__e),console.error("Improper nesting of table. Your

should not have a table-node parent."+g(t)+"\n\n"+_(t))):"thead"!==o&&"tfoot"!==o&&"tbody"!==o||"table"===a?"tr"===o&&"thead"!==a&&"tfoot"!==a&&"tbody"!==a?console.error("Improper nesting of table. Your should have a parent."+g(t)+"\n\n"+_(t)):"td"===o&&"tr"!==a?console.error("Improper nesting of table. Your parent."+g(t)+"\n\n"+_(t)):"th"===o&&"tr"!==a&&console.error("Improper nesting of table. Your ."+g(t)+"\n\n"+_(t)):console.error("Improper nesting of table. Your should have a
should have a
should have a
parent."+g(t)+"\n\n"+_(t));else if("p"===o){var u=p(t).filter((function(e){return y.test(e)}));u.length&&console.error("Improper nesting of paragraph. Your

should not have "+u.join(", ")+"as child-elements."+g(t)+"\n\n"+_(t))}else"a"!==o&&"button"!==o||-1!==p(t).indexOf(o)&&console.error("Improper nesting of interactive content. Your <"+o+"> should not have other "+("a"===o?"anchor":"button")+" tags as child-elements."+g(t)+"\n\n"+_(t))}if(e=!1,r&&r(t),null!=t.__k)for(var l=[],c=0;c { + +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ Ob: () => (/* binding */ E), +/* harmony export */ Qv: () => (/* binding */ D), +/* harmony export */ XX: () => (/* binding */ B), +/* harmony export */ fF: () => (/* binding */ l), +/* harmony export */ h: () => (/* binding */ _), +/* harmony export */ q6: () => (/* binding */ G), +/* harmony export */ uA: () => (/* binding */ k), +/* harmony export */ zO: () => (/* binding */ t) +/* harmony export */ }); +/* unused harmony exports Fragment, createElement, createRef, toChildArray */ +var n,l,u,t,i,o,r,f,e,c,s,a,h={},v=[],p=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,y=Array.isArray;function d(n,l){for(var u in l)n[u]=l[u];return n}function w(n){n&&n.parentNode&&n.parentNode.removeChild(n)}function _(l,u,t){var i,o,r,f={};for(r in u)"key"==r?i=u[r]:"ref"==r?o=u[r]:f[r]=u[r];if(arguments.length>2&&(f.children=arguments.length>3?n.call(arguments,2):t),"function"==typeof l&&null!=l.defaultProps)for(r in l.defaultProps)void 0===f[r]&&(f[r]=l.defaultProps[r]);return g(l,f,i,o,null)}function g(n,t,i,o,r){var f={type:n,props:t,key:i,ref:o,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:null==r?++u:r,__i:-1,__u:0};return null==r&&null!=l.vnode&&l.vnode(f),f}function m(){return{current:null}}function b(n){return n.children}function k(n,l){this.props=n,this.context=l}function x(n,l){if(null==l)return n.__?x(n.__,n.__i+1):null;for(var u;lu&&i.sort(f));P.__r=0}function S(n,l,u,t,i,o,r,f,e,c,s){var a,p,y,d,w,_=t&&t.__k||v,g=l.length;for(u.__d=e,$(u,l,_),e=u.__d,a=0;a0?g(i.type,i.props,i.key,i.ref?i.ref:null,i.__v):i).__=n,i.__b=n.__b+1,o=null,-1!==(f=i.__i=L(i,u,r,s))&&(s--,(o=u[f])&&(o.__u|=131072)),null==o||null===o.__v?(-1==f&&a--,"function"!=typeof i.type&&(i.__u|=65536)):f!==r&&(f==r-1?a--:f==r+1?a++:(f>r?a--:a++,i.__u|=65536))):i=n.__k[t]=null;if(s)for(t=0;t(null!=e&&0==(131072&e.__u)?1:0))for(;r>=0||f=0){if((e=l[r])&&0==(131072&e.__u)&&i==e.key&&o===e.type)return r;r--}if(f2&&(e.children=arguments.length>3?n.call(arguments,2):t),g(l.type,e,i||l.key,o||l.ref,null)}function G(n,l){var u={__c:l="__cC"+a++,__:n,Consumer:function(n,l){return n.children(l)},Provider:function(n){var u,t;return this.getChildContext||(u=[],(t={})[l]=this,this.getChildContext=function(){return t},this.componentWillUnmount=function(){u=null},this.shouldComponentUpdate=function(n){this.props.value!==n.value&&u.some(function(n){n.__e=!0,M(n)})},this.sub=function(n){u.push(n);var l=n.componentWillUnmount;n.componentWillUnmount=function(){u&&u.splice(u.indexOf(n),1),l&&l.call(n)}}),n.children}};return u.Provider.__=u.Consumer.contextType=u}n=v.slice,l={__e:function(n,l,u,t){for(var i,o,r;l=l.__;)if((i=l.__c)&&!i.__)try{if((o=i.constructor)&&null!=o.getDerivedStateFromError&&(i.setState(o.getDerivedStateFromError(n)),r=i.__d),null!=i.componentDidCatch&&(i.componentDidCatch(n,t||{}),r=i.__d),r)return i.__E=i}catch(l){n=l}throw n}},u=0,t=function(n){return null!=n&&null==n.constructor},k.prototype.setState=function(n,l){var u;u=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=d({},this.state),"function"==typeof n&&(n=n(d({},u),this.props)),n&&d(u,n),null!=n&&this.__v&&(l&&this._sb.push(l),M(this))},k.prototype.forceUpdate=function(n){this.__v&&(this.__e=!0,n&&this.__h.push(n),M(this))},k.prototype.render=b,i=[],r="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,f=function(n,l){return n.__v.__b-l.__v.__b},P.__r=0,e=0,c=F(!1),s=F(!0),a=0; + + +/***/ }) + +/******/ }); +/************************************************************************/ +/******/ // The module cache +/******/ var __webpack_module_cache__ = {}; +/******/ +/******/ // The require function +/******/ function __webpack_require__(moduleId) { +/******/ // Check if module is in cache +/******/ var cachedModule = __webpack_module_cache__[moduleId]; +/******/ if (cachedModule !== undefined) { +/******/ return cachedModule.exports; +/******/ } +/******/ // Create a new module (and put it into the cache) +/******/ var module = __webpack_module_cache__[moduleId] = { +/******/ // no module.id needed +/******/ // no module.loaded needed +/******/ exports: {} +/******/ }; +/******/ +/******/ // Execute the module function +/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__); +/******/ +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } /******/ /************************************************************************/ /******/ /* webpack/runtime/define property getters */ @@ -21,6 +65,8 @@ /******/ /************************************************************************/ var __webpack_exports__ = {}; +// This entry need to be wrapped in an IIFE because it need to be isolated against other modules in the chunk. +(() => { // EXPORTS __webpack_require__.d(__webpack_exports__, { @@ -29,7 +75,7 @@ __webpack_require__.d(__webpack_exports__, { V6: () => (/* reexport */ getElement), $K: () => (/* reexport */ getServerContext), vT: () => (/* reexport */ getServerState), - jb: () => (/* reexport */ privateApis), + jb: () => (/* binding */ privateApis), yT: () => (/* reexport */ splitTask), M_: () => (/* reexport */ store), hb: () => (/* reexport */ useCallback), @@ -37,28 +83,21 @@ __webpack_require__.d(__webpack_exports__, { ip: () => (/* reexport */ useInit), Nf: () => (/* reexport */ useLayoutEffect), Kr: () => (/* reexport */ useMemo), - li: () => (/* reexport */ hooks_module_A), - J0: () => (/* reexport */ hooks_module_h), + li: () => (/* reexport */ A), + J0: () => (/* reexport */ h), FH: () => (/* reexport */ useWatch), v4: () => (/* reexport */ withScope) }); -;// CONCATENATED MODULE: ./node_modules/preact/dist/preact.module.js -var preact_module_n,preact_module_l,preact_module_u,preact_module_t,i,preact_module_o,r,preact_module_f,e,preact_module_c,s,a,h={},v=[],p=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,y=Array.isArray;function d(n,l){for(var u in l)n[u]=l[u];return n}function w(n){n&&n.parentNode&&n.parentNode.removeChild(n)}function _(l,u,t){var i,o,r,f={};for(r in u)"key"==r?i=u[r]:"ref"==r?o=u[r]:f[r]=u[r];if(arguments.length>2&&(f.children=arguments.length>3?preact_module_n.call(arguments,2):t),"function"==typeof l&&null!=l.defaultProps)for(r in l.defaultProps)void 0===f[r]&&(f[r]=l.defaultProps[r]);return g(l,f,i,o,null)}function g(n,t,i,o,r){var f={type:n,props:t,key:i,ref:o,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:null==r?++preact_module_u:r,__i:-1,__u:0};return null==r&&null!=preact_module_l.vnode&&preact_module_l.vnode(f),f}function m(){return{current:null}}function b(n){return n.children}function k(n,l){this.props=n,this.context=l}function x(n,l){if(null==l)return n.__?x(n.__,n.__i+1):null;for(var u;lu&&i.sort(preact_module_f));P.__r=0}function S(n,l,u,t,i,o,r,f,e,c,s){var a,p,y,d,w,_=t&&t.__k||v,g=l.length;for(u.__d=e,$(u,l,_),e=u.__d,a=0;a0?g(i.type,i.props,i.key,i.ref?i.ref:null,i.__v):i).__=n,i.__b=n.__b+1,o=null,-1!==(f=i.__i=L(i,u,r,s))&&(s--,(o=u[f])&&(o.__u|=131072)),null==o||null===o.__v?(-1==f&&a--,"function"!=typeof i.type&&(i.__u|=65536)):f!==r&&(f==r-1?a--:f==r+1?a++:(f>r?a--:a++,i.__u|=65536))):i=n.__k[t]=null;if(s)for(t=0;t(null!=e&&0==(131072&e.__u)?1:0))for(;r>=0||f=0){if((e=l[r])&&0==(131072&e.__u)&&i==e.key&&o===e.type)return r;r--}if(f2&&(e.children=arguments.length>3?preact_module_n.call(arguments,2):t),g(l.type,e,i||l.key,o||l.ref,null)}function G(n,l){var u={__c:l="__cC"+a++,__:n,Consumer:function(n,l){return n.children(l)},Provider:function(n){var u,t;return this.getChildContext||(u=[],(t={})[l]=this,this.getChildContext=function(){return t},this.componentWillUnmount=function(){u=null},this.shouldComponentUpdate=function(n){this.props.value!==n.value&&u.some(function(n){n.__e=!0,M(n)})},this.sub=function(n){u.push(n);var l=n.componentWillUnmount;n.componentWillUnmount=function(){u&&u.splice(u.indexOf(n),1),l&&l.call(n)}}),n.children}};return u.Provider.__=u.Consumer.contextType=u}preact_module_n=v.slice,preact_module_l={__e:function(n,l,u,t){for(var i,o,r;l=l.__;)if((i=l.__c)&&!i.__)try{if((o=i.constructor)&&null!=o.getDerivedStateFromError&&(i.setState(o.getDerivedStateFromError(n)),r=i.__d),null!=i.componentDidCatch&&(i.componentDidCatch(n,t||{}),r=i.__d),r)return i.__E=i}catch(l){n=l}throw n}},preact_module_u=0,preact_module_t=function(n){return null!=n&&null==n.constructor},k.prototype.setState=function(n,l){var u;u=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=d({},this.state),"function"==typeof n&&(n=n(d({},u),this.props)),n&&d(u,n),null!=n&&this.__v&&(l&&this._sb.push(l),M(this))},k.prototype.forceUpdate=function(n){this.__v&&(this.__e=!0,n&&this.__h.push(n),M(this))},k.prototype.render=b,i=[],r="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,preact_module_f=function(n,l){return n.__v.__b-l.__v.__b},P.__r=0,e=0,preact_module_c=F(!1),s=F(!0),a=0; - -;// CONCATENATED MODULE: ./node_modules/preact/devtools/dist/devtools.module.js -var devtools_module_i;function devtools_module_t(o,e){return n.__a&&n.__a(e),o}null!=(devtools_module_i="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0)&&devtools_module_i.__PREACT_DEVTOOLS__&&devtools_module_i.__PREACT_DEVTOOLS__.attachPreact("10.24.0",preact_module_l,{Fragment:b,Component:k}); - -;// CONCATENATED MODULE: ./node_modules/preact/debug/dist/debug.module.js -var debug_module_o={};function debug_module_r(){debug_module_o={}}function debug_module_a(e){return e.type===b?"Fragment":"function"==typeof e.type?e.type.displayName||e.type.name:"string"==typeof e.type?e.type:"#text"}var debug_module_i=[],debug_module_s=[];function debug_module_c(){return debug_module_i.length>0?debug_module_i[debug_module_i.length-1]:null}var l=!0;function debug_module_u(e){return"function"==typeof e.type&&e.type!=b}function debug_module_f(n){for(var e=[n],t=n;null!=t.__o;)e.push(t.__o),t=t.__o;return e.reduce(function(n,e){n+=" in "+debug_module_a(e);var t=e.__source;return t?n+=" (at "+t.fileName+":"+t.lineNumber+")":l&&console.warn("Add @babel/plugin-transform-react-jsx-source to get a more detailed component stack. Note that you should not add it to production builds of your App for bundle size reasons."),l=!1,n+"\n"},"")}var debug_module_d="function"==typeof WeakMap;function debug_module_p(n){var e=[];return n.__k?(n.__k.forEach(function(n){n&&"function"==typeof n.type?e.push.apply(e,debug_module_p(n)):n&&"string"==typeof n.type&&e.push(n.type)}),e):e}function debug_module_h(n){return n?"function"==typeof n.type?null==n.__?null!=n.__e&&null!=n.__e.parentNode?n.__e.parentNode.localName:"":debug_module_h(n.__):n.type:""}var debug_module_v=k.prototype.setState;function debug_module_y(n){return"table"===n||"tfoot"===n||"tbody"===n||"thead"===n||"td"===n||"tr"===n||"th"===n}k.prototype.setState=function(n,e){return null==this.__v&&null==this.state&&console.warn('Calling "this.setState" inside the constructor of a component is a no-op and might be a bug in your application. Instead, set "this.state = {}" directly.\n\n'+debug_module_f(debug_module_c())),debug_module_v.call(this,n,e)};var debug_module_m=/^(address|article|aside|blockquote|details|div|dl|fieldset|figcaption|figure|footer|form|h1|h2|h3|h4|h5|h6|header|hgroup|hr|main|menu|nav|ol|p|pre|search|section|table|ul)$/,debug_module_b=k.prototype.forceUpdate;function debug_module_w(n){var e=n.props,t=debug_module_a(n),o="";for(var r in e)if(e.hasOwnProperty(r)&&"children"!==r){var i=e[r];"function"==typeof i&&(i="function "+(i.displayName||i.name)+"() {}"),i=Object(i)!==i||i.toString?i+"":Object.prototype.toString.call(i),o+=" "+r+"="+JSON.stringify(i)}var s=e.children;return"<"+t+o+(s&&s.length?">..":" />")}k.prototype.forceUpdate=function(n){return null==this.__v?console.warn('Calling "this.forceUpdate" inside the constructor of a component is a no-op and might be a bug in your application.\n\n'+debug_module_f(debug_module_c())):null==this.__P&&console.warn('Can\'t call "this.forceUpdate" on an unmounted component. This is a no-op, but it indicates a memory leak in your application. To fix, cancel all subscriptions and asynchronous tasks in the componentWillUnmount method.\n\n'+debug_module_f(this.__v)),debug_module_b.call(this,n)},preact_module_l.__m=function(n,e){var t=n.type,o=e.map(function(n){return n.localName});console.error("Expected a DOM node of type "+t+" but found "+o.join(", ")+"as available DOM-node(s), this is caused by the SSR'd HTML containing different DOM-nodes compared to the hydrated one.\n\n"+debug_module_f(n))},function(){!function(){var n=preact_module_l.__b,t=preact_module_l.diffed,o=preact_module_l.__,r=preact_module_l.vnode,a=preact_module_l.__r;preact_module_l.diffed=function(n){debug_module_u(n)&&debug_module_s.pop(),debug_module_i.pop(),t&&t(n)},preact_module_l.__b=function(e){debug_module_u(e)&&debug_module_i.push(e),n&&n(e)},preact_module_l.__=function(n,e){debug_module_s=[],o&&o(n,e)},preact_module_l.vnode=function(n){n.__o=debug_module_s.length>0?debug_module_s[debug_module_s.length-1]:null,r&&r(n)},preact_module_l.__r=function(n){debug_module_u(n)&&debug_module_s.push(n),a&&a(n)}}();var n=!1,t=preact_module_l.__b,r=preact_module_l.diffed,c=preact_module_l.vnode,l=preact_module_l.__r,v=preact_module_l.__e,b=preact_module_l.__,g=preact_module_l.__h,E=debug_module_d?{useEffect:new WeakMap,useLayoutEffect:new WeakMap,lazyPropTypes:new WeakMap}:null,k=[];preact_module_l.__e=function(n,e,t,o){if(e&&e.__c&&"function"==typeof n.then){var r=n;n=new Error("Missing Suspense. The throwing component was: "+debug_module_a(e));for(var i=e;i;i=i.__)if(i.__c&&i.__c.__c){n=r;break}if(n instanceof Error)throw n}try{(o=o||{}).componentStack=debug_module_f(e),v(n,e,t,o),"function"!=typeof n.then&&setTimeout(function(){throw n})}catch(n){throw n}},preact_module_l.__=function(n,e){if(!e)throw new Error("Undefined parent passed to render(), this is the second argument.\nCheck if the element is available in the DOM/has the correct id.");var t;switch(e.nodeType){case 1:case 11:case 9:t=!0;break;default:t=!1}if(!t){var o=debug_module_a(n);throw new Error("Expected a valid HTML node as a second argument to render.\tReceived "+e+" instead: render(<"+o+" />, "+e+");")}b&&b(n,e)},preact_module_l.__b=function(e){var r=e.type;if(n=!0,void 0===r)throw new Error("Undefined component passed to createElement()\n\nYou likely forgot to export your component or might have mixed up default and named imports"+debug_module_w(e)+"\n\n"+debug_module_f(e));if(null!=r&&"object"==typeof r){if(void 0!==r.__k&&void 0!==r.__e)throw new Error("Invalid type passed to createElement(): "+r+"\n\nDid you accidentally pass a JSX literal as JSX twice?\n\n let My"+debug_module_a(e)+" = "+debug_module_w(r)+";\n let vnode = ;\n\nThis usually happens when you export a JSX literal and not the component.\n\n"+debug_module_f(e));throw new Error("Invalid type passed to createElement(): "+(Array.isArray(r)?"array":r))}if(void 0!==e.ref&&"function"!=typeof e.ref&&"object"!=typeof e.ref&&!("$$typeof"in e))throw new Error('Component\'s "ref" property should be a function, or an object created by createRef(), but got ['+typeof e.ref+"] instead\n"+debug_module_w(e)+"\n\n"+debug_module_f(e));if("string"==typeof e.type)for(var i in e.props)if("o"===i[0]&&"n"===i[1]&&"function"!=typeof e.props[i]&&null!=e.props[i])throw new Error("Component's \""+i+'" property should be a function, but got ['+typeof e.props[i]+"] instead\n"+debug_module_w(e)+"\n\n"+debug_module_f(e));if("function"==typeof e.type&&e.type.propTypes){if("Lazy"===e.type.displayName&&E&&!E.lazyPropTypes.has(e.type)){var s="PropTypes are not supported on lazy(). Use propTypes on the wrapped component itself. ";try{var c=e.type();E.lazyPropTypes.set(e.type,!0),console.warn(s+"Component wrapped in lazy() is "+debug_module_a(c))}catch(n){console.warn(s+"We will log the wrapped component's name once it is loaded.")}}var l=e.props;e.type.__f&&delete(l=function(n,e){for(var t in e)n[t]=e[t];return n}({},l)).ref,function(n,e,t,r,a){Object.keys(n).forEach(function(t){var i;try{i=n[t](e,t,r,"prop",null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(n){i=n}i&&!(i.message in debug_module_o)&&(debug_module_o[i.message]=!0,console.error("Failed prop type: "+i.message+(a&&"\n"+a()||"")))})}(e.type.propTypes,l,0,debug_module_a(e),function(){return debug_module_f(e)})}t&&t(e)};var T,_=0;preact_module_l.__r=function(e){l&&l(e),n=!0;var t=e.__c;if(t===T?_++:_=1,_>=25)throw new Error("Too many re-renders. This is limited to prevent an infinite loop which may lock up your browser. The component causing this is: "+debug_module_a(e));T=t},preact_module_l.__h=function(e,t,o){if(!e||!n)throw new Error("Hook can only be invoked from render methods.");g&&g(e,t,o)};var O=function(n,e){return{get:function(){var t="get"+n+e;k&&k.indexOf(t)<0&&(k.push(t),console.warn("getting vnode."+n+" is deprecated, "+e))},set:function(){var t="set"+n+e;k&&k.indexOf(t)<0&&(k.push(t),console.warn("setting vnode."+n+" is not allowed, "+e))}}},I={nodeName:O("nodeName","use vnode.type"),attributes:O("attributes","use vnode.props"),children:O("children","use vnode.props.children")},M=Object.create({},I);preact_module_l.vnode=function(n){var e=n.props;if(null!==n.type&&null!=e&&("__source"in e||"__self"in e)){var t=n.props={};for(var o in e){var r=e[o];"__source"===o?n.__source=r:"__self"===o?n.__self=r:t[o]=r}}n.__proto__=M,c&&c(n)},preact_module_l.diffed=function(e){var t,o=e.type,i=e.__;if(e.__k&&e.__k.forEach(function(n){if("object"==typeof n&&n&&void 0===n.type){var t=Object.keys(n).join(",");throw new Error("Objects are not valid as a child. Encountered an object with the keys {"+t+"}.\n\n"+debug_module_f(e))}}),e.__c===T&&(_=0),"string"==typeof o&&(debug_module_y(o)||"p"===o||"a"===o||"button"===o)){var s=debug_module_h(i);if(""!==s&&debug_module_y(o))"table"===o&&"td"!==s&&debug_module_y(s)?(console.log(s,i.__e),console.error("Improper nesting of table. Your

should not have a table-node parent."+debug_module_w(e)+"\n\n"+debug_module_f(e))):"thead"!==o&&"tfoot"!==o&&"tbody"!==o||"table"===s?"tr"===o&&"thead"!==s&&"tfoot"!==s&&"tbody"!==s?console.error("Improper nesting of table. Your should have a parent."+debug_module_w(e)+"\n\n"+debug_module_f(e)):"td"===o&&"tr"!==s?console.error("Improper nesting of table. Your parent."+debug_module_w(e)+"\n\n"+debug_module_f(e)):"th"===o&&"tr"!==s&&console.error("Improper nesting of table. Your ."+debug_module_w(e)+"\n\n"+debug_module_f(e)):console.error("Improper nesting of table. Your should have a
should have a
should have a
parent."+debug_module_w(e)+"\n\n"+debug_module_f(e));else if("p"===o){var c=debug_module_p(e).filter(function(n){return debug_module_m.test(n)});c.length&&console.error("Improper nesting of paragraph. Your

should not have "+c.join(", ")+"as child-elements."+debug_module_w(e)+"\n\n"+debug_module_f(e))}else"a"!==o&&"button"!==o||-1!==debug_module_p(e).indexOf(o)&&console.error("Improper nesting of interactive content. Your <"+o+"> should not have other "+("a"===o?"anchor":"button")+" tags as child-elements."+debug_module_w(e)+"\n\n"+debug_module_f(e))}if(n=!1,r&&r(e),null!=e.__k)for(var l=[],u=0;u=u.__.length&&u.__.push({}),u.__[n]}function hooks_module_h(n){return hooks_module_o=1,hooks_module_p(hooks_module_D,n)}function hooks_module_p(n,u,i){var o=hooks_module_d(hooks_module_t++,2);if(o.t=n,!o.__c&&(o.__=[i?i(u):hooks_module_D(void 0,u),function(n){var t=o.__N?o.__N[0]:o.__[0],r=o.t(t,n);t!==r&&(o.__N=[r,o.__[1]],o.__c.setState({}))}],o.__c=hooks_module_r,!hooks_module_r.u)){var f=function(n,t,r){if(!o.__c.__H)return!0;var u=o.__c.__H.__.filter(function(n){return!!n.__c});if(u.every(function(n){return!n.__N}))return!c||c.call(this,n,t,r);var i=!1;return u.forEach(function(n){if(n.__N){var t=n.__[0];n.__=n.__N,n.__N=void 0,t!==n.__[0]&&(i=!0)}}),!(!i&&o.__c.props===n)&&(!c||c.call(this,n,t,r))};hooks_module_r.u=!0;var c=hooks_module_r.shouldComponentUpdate,e=hooks_module_r.componentWillUpdate;hooks_module_r.componentWillUpdate=function(n,t,r){if(this.__e){var u=c;c=void 0,f(n,t,r),c=u}e&&e.call(this,n,t,r)},hooks_module_r.shouldComponentUpdate=f}return o.__N||o.__}function hooks_module_y(n,u){var i=hooks_module_d(hooks_module_t++,3);!hooks_module_c.__s&&hooks_module_C(i.__H,u)&&(i.__=n,i.i=u,hooks_module_r.__H.__h.push(i))}function hooks_module_(n,u){var i=hooks_module_d(hooks_module_t++,4);!hooks_module_c.__s&&hooks_module_C(i.__H,u)&&(i.__=n,i.i=u,hooks_module_r.__h.push(i))}function hooks_module_A(n){return hooks_module_o=5,hooks_module_T(function(){return{current:n}},[])}function hooks_module_F(n,t,r){hooks_module_o=6,hooks_module_(function(){return"function"==typeof n?(n(t()),function(){return n(null)}):n?(n.current=t(),function(){return n.current=null}):void 0},null==r?r:r.concat(n))}function hooks_module_T(n,r){var u=hooks_module_d(hooks_module_t++,7);return hooks_module_C(u.__H,r)&&(u.__=n(),u.__H=r,u.__h=n),u.__}function hooks_module_q(n,t){return hooks_module_o=8,hooks_module_T(function(){return n},t)}function hooks_module_x(n){var u=hooks_module_r.context[n.__c],i=hooks_module_d(hooks_module_t++,9);return i.c=n,u?(null==i.__&&(i.__=!0,u.sub(hooks_module_r)),u.props.value):n.__}function hooks_module_P(n,t){hooks_module_c.useDebugValue&&hooks_module_c.useDebugValue(t?t(n):n)}function hooks_module_b(n){var u=hooks_module_d(hooks_module_t++,10),i=hooks_module_h();return u.__=n,hooks_module_r.componentDidCatch||(hooks_module_r.componentDidCatch=function(n,t){u.__&&u.__(n,t),i[1](n)}),[i[0],function(){i[1](void 0)}]}function hooks_module_g(){var n=hooks_module_d(hooks_module_t++,11);if(!n.__){for(var u=hooks_module_r.__v;null!==u&&!u.__m&&null!==u.__;)u=u.__;var i=u.__m||(u.__m=[0,0]);n.__="P"+i[0]+"-"+i[1]++}return n.__}function hooks_module_j(){for(var n;n=hooks_module_f.shift();)if(n.__P&&n.__H)try{n.__H.__h.forEach(hooks_module_z),n.__H.__h.forEach(hooks_module_B),n.__H.__h=[]}catch(t){n.__H.__h=[],hooks_module_c.__e(t,n.__v)}}hooks_module_c.__b=function(n){hooks_module_r=null,hooks_module_e&&hooks_module_e(n)},hooks_module_c.__=function(n,t){n&&t.__k&&t.__k.__m&&(n.__m=t.__k.__m),hooks_module_s&&hooks_module_s(n,t)},hooks_module_c.__r=function(n){hooks_module_a&&hooks_module_a(n),hooks_module_t=0;var i=(hooks_module_r=n.__c).__H;i&&(hooks_module_u===hooks_module_r?(i.__h=[],hooks_module_r.__h=[],i.__.forEach(function(n){n.__N&&(n.__=n.__N),n.i=n.__N=void 0})):(i.__h.forEach(hooks_module_z),i.__h.forEach(hooks_module_B),i.__h=[],hooks_module_t=0)),hooks_module_u=hooks_module_r},hooks_module_c.diffed=function(n){hooks_module_v&&hooks_module_v(n);var t=n.__c;t&&t.__H&&(t.__H.__h.length&&(1!==hooks_module_f.push(t)&&hooks_module_i===hooks_module_c.requestAnimationFrame||((hooks_module_i=hooks_module_c.requestAnimationFrame)||hooks_module_w)(hooks_module_j)),t.__H.__.forEach(function(n){n.i&&(n.__H=n.i),n.i=void 0})),hooks_module_u=hooks_module_r=null},hooks_module_c.__c=function(n,t){t.some(function(n){try{n.__h.forEach(hooks_module_z),n.__h=n.__h.filter(function(n){return!n.__||hooks_module_B(n)})}catch(r){t.some(function(n){n.__h&&(n.__h=[])}),t=[],hooks_module_c.__e(r,n.__v)}}),hooks_module_l&&hooks_module_l(n,t)},hooks_module_c.unmount=function(n){hooks_module_m&&hooks_module_m(n);var t,r=n.__c;r&&r.__H&&(r.__H.__.forEach(function(n){try{hooks_module_z(n)}catch(n){t=n}}),r.__H=void 0,t&&hooks_module_c.__e(t,r.__v))};var hooks_module_k="function"==typeof requestAnimationFrame;function hooks_module_w(n){var t,r=function(){clearTimeout(u),hooks_module_k&&cancelAnimationFrame(t),setTimeout(n)},u=setTimeout(r,100);hooks_module_k&&(t=requestAnimationFrame(r))}function hooks_module_z(n){var t=hooks_module_r,u=n.__c;"function"==typeof u&&(n.__c=void 0,u()),hooks_module_r=t}function hooks_module_B(n){var t=hooks_module_r;n.__c=n.__(),hooks_module_r=t}function hooks_module_C(n,t){return!n||n.length!==t.length||t.some(function(t,r){return t!==n[r]})}function hooks_module_D(n,t){return"function"==typeof t?t(n):t} +var hooks_module_t,r,hooks_module_u,i,hooks_module_o=0,hooks_module_f=[],hooks_module_c=preact_module/* options */.fF,e=hooks_module_c.__b,a=hooks_module_c.__r,v=hooks_module_c.diffed,l=hooks_module_c.__c,m=hooks_module_c.unmount,s=hooks_module_c.__;function d(n,t){hooks_module_c.__h&&hooks_module_c.__h(r,n,hooks_module_o||t),hooks_module_o=0;var u=r.__H||(r.__H={__:[],__h:[]});return n>=u.__.length&&u.__.push({}),u.__[n]}function h(n){return hooks_module_o=1,p(D,n)}function p(n,u,i){var o=d(hooks_module_t++,2);if(o.t=n,!o.__c&&(o.__=[i?i(u):D(void 0,u),function(n){var t=o.__N?o.__N[0]:o.__[0],r=o.t(t,n);t!==r&&(o.__N=[r,o.__[1]],o.__c.setState({}))}],o.__c=r,!r.u)){var f=function(n,t,r){if(!o.__c.__H)return!0;var u=o.__c.__H.__.filter(function(n){return!!n.__c});if(u.every(function(n){return!n.__N}))return!c||c.call(this,n,t,r);var i=!1;return u.forEach(function(n){if(n.__N){var t=n.__[0];n.__=n.__N,n.__N=void 0,t!==n.__[0]&&(i=!0)}}),!(!i&&o.__c.props===n)&&(!c||c.call(this,n,t,r))};r.u=!0;var c=r.shouldComponentUpdate,e=r.componentWillUpdate;r.componentWillUpdate=function(n,t,r){if(this.__e){var u=c;c=void 0,f(n,t,r),c=u}e&&e.call(this,n,t,r)},r.shouldComponentUpdate=f}return o.__N||o.__}function y(n,u){var i=d(hooks_module_t++,3);!hooks_module_c.__s&&C(i.__H,u)&&(i.__=n,i.i=u,r.__H.__h.push(i))}function _(n,u){var i=d(hooks_module_t++,4);!hooks_module_c.__s&&C(i.__H,u)&&(i.__=n,i.i=u,r.__h.push(i))}function A(n){return hooks_module_o=5,T(function(){return{current:n}},[])}function F(n,t,r){hooks_module_o=6,_(function(){return"function"==typeof n?(n(t()),function(){return n(null)}):n?(n.current=t(),function(){return n.current=null}):void 0},null==r?r:r.concat(n))}function T(n,r){var u=d(hooks_module_t++,7);return C(u.__H,r)&&(u.__=n(),u.__H=r,u.__h=n),u.__}function q(n,t){return hooks_module_o=8,T(function(){return n},t)}function x(n){var u=r.context[n.__c],i=d(hooks_module_t++,9);return i.c=n,u?(null==i.__&&(i.__=!0,u.sub(r)),u.props.value):n.__}function P(n,t){hooks_module_c.useDebugValue&&hooks_module_c.useDebugValue(t?t(n):n)}function b(n){var u=d(hooks_module_t++,10),i=h();return u.__=n,r.componentDidCatch||(r.componentDidCatch=function(n,t){u.__&&u.__(n,t),i[1](n)}),[i[0],function(){i[1](void 0)}]}function g(){var n=d(hooks_module_t++,11);if(!n.__){for(var u=r.__v;null!==u&&!u.__m&&null!==u.__;)u=u.__;var i=u.__m||(u.__m=[0,0]);n.__="P"+i[0]+"-"+i[1]++}return n.__}function j(){for(var n;n=hooks_module_f.shift();)if(n.__P&&n.__H)try{n.__H.__h.forEach(z),n.__H.__h.forEach(B),n.__H.__h=[]}catch(t){n.__H.__h=[],hooks_module_c.__e(t,n.__v)}}hooks_module_c.__b=function(n){r=null,e&&e(n)},hooks_module_c.__=function(n,t){n&&t.__k&&t.__k.__m&&(n.__m=t.__k.__m),s&&s(n,t)},hooks_module_c.__r=function(n){a&&a(n),hooks_module_t=0;var i=(r=n.__c).__H;i&&(hooks_module_u===r?(i.__h=[],r.__h=[],i.__.forEach(function(n){n.__N&&(n.__=n.__N),n.i=n.__N=void 0})):(i.__h.forEach(z),i.__h.forEach(B),i.__h=[],hooks_module_t=0)),hooks_module_u=r},hooks_module_c.diffed=function(n){v&&v(n);var t=n.__c;t&&t.__H&&(t.__H.__h.length&&(1!==hooks_module_f.push(t)&&i===hooks_module_c.requestAnimationFrame||((i=hooks_module_c.requestAnimationFrame)||w)(j)),t.__H.__.forEach(function(n){n.i&&(n.__H=n.i),n.i=void 0})),hooks_module_u=r=null},hooks_module_c.__c=function(n,t){t.some(function(n){try{n.__h.forEach(z),n.__h=n.__h.filter(function(n){return!n.__||B(n)})}catch(r){t.some(function(n){n.__h&&(n.__h=[])}),t=[],hooks_module_c.__e(r,n.__v)}}),l&&l(n,t)},hooks_module_c.unmount=function(n){m&&m(n);var t,r=n.__c;r&&r.__H&&(r.__H.__.forEach(function(n){try{z(n)}catch(n){t=n}}),r.__H=void 0,t&&hooks_module_c.__e(t,r.__v))};var k="function"==typeof requestAnimationFrame;function w(n){var t,r=function(){clearTimeout(u),k&&cancelAnimationFrame(t),setTimeout(n)},u=setTimeout(r,100);k&&(t=requestAnimationFrame(r))}function z(n){var t=r,u=n.__c;"function"==typeof u&&(n.__c=void 0,u()),r=t}function B(n){var t=r;n.__c=n.__(),r=t}function C(n,t){return!n||n.length!==t.length||t.some(function(t,r){return t!==n[r]})}function D(n,t){return"function"==typeof t?t(n):t} ;// CONCATENATED MODULE: ./node_modules/@preact/signals-core/dist/signals-core.module.js -var signals_core_module_i=Symbol.for("preact-signals");function signals_core_module_t(){if(!(signals_core_module_s>1)){var i,t=!1;while(void 0!==signals_core_module_h){var r=signals_core_module_h;signals_core_module_h=void 0;signals_core_module_f++;while(void 0!==r){var o=r.o;r.o=void 0;r.f&=-3;if(!(8&r.f)&&signals_core_module_c(r))try{r.c()}catch(r){if(!t){i=r;t=!0}}r=o}}signals_core_module_f=0;signals_core_module_s--;if(t)throw i}else signals_core_module_s--}function signals_core_module_r(i){if(signals_core_module_s>0)return i();signals_core_module_s++;try{return i()}finally{signals_core_module_t()}}var signals_core_module_o=void 0;function signals_core_module_n(i){var t=signals_core_module_o;signals_core_module_o=void 0;try{return i()}finally{signals_core_module_o=t}}var signals_core_module_h=void 0,signals_core_module_s=0,signals_core_module_f=0,signals_core_module_v=0;function signals_core_module_e(i){if(void 0!==signals_core_module_o){var t=i.n;if(void 0===t||t.t!==signals_core_module_o){t={i:0,S:i,p:signals_core_module_o.s,n:void 0,t:signals_core_module_o,e:void 0,x:void 0,r:t};if(void 0!==signals_core_module_o.s)signals_core_module_o.s.n=t;signals_core_module_o.s=t;i.n=t;if(32&signals_core_module_o.f)i.S(t);return t}else if(-1===t.i){t.i=0;if(void 0!==t.n){t.n.p=t.p;if(void 0!==t.p)t.p.n=t.n;t.p=signals_core_module_o.s;t.n=void 0;signals_core_module_o.s.n=t;signals_core_module_o.s=t}return t}}}function signals_core_module_u(i){this.v=i;this.i=0;this.n=void 0;this.t=void 0}signals_core_module_u.prototype.brand=signals_core_module_i;signals_core_module_u.prototype.h=function(){return!0};signals_core_module_u.prototype.S=function(i){if(this.t!==i&&void 0===i.e){i.x=this.t;if(void 0!==this.t)this.t.e=i;this.t=i}};signals_core_module_u.prototype.U=function(i){if(void 0!==this.t){var t=i.e,r=i.x;if(void 0!==t){t.x=r;i.e=void 0}if(void 0!==r){r.e=t;i.x=void 0}if(i===this.t)this.t=r}};signals_core_module_u.prototype.subscribe=function(i){var t=this;return signals_core_module_E(function(){var r=t.value,n=signals_core_module_o;signals_core_module_o=void 0;try{i(r)}finally{signals_core_module_o=n}})};signals_core_module_u.prototype.valueOf=function(){return this.value};signals_core_module_u.prototype.toString=function(){return this.value+""};signals_core_module_u.prototype.toJSON=function(){return this.value};signals_core_module_u.prototype.peek=function(){var i=signals_core_module_o;signals_core_module_o=void 0;try{return this.value}finally{signals_core_module_o=i}};Object.defineProperty(signals_core_module_u.prototype,"value",{get:function(){var i=signals_core_module_e(this);if(void 0!==i)i.i=this.i;return this.v},set:function(i){if(i!==this.v){if(signals_core_module_f>100)throw new Error("Cycle detected");this.v=i;this.i++;signals_core_module_v++;signals_core_module_s++;try{for(var r=this.t;void 0!==r;r=r.x)r.t.N()}finally{signals_core_module_t()}}}});function signals_core_module_d(i){return new signals_core_module_u(i)}function signals_core_module_c(i){for(var t=i.s;void 0!==t;t=t.n)if(t.S.i!==t.i||!t.S.h()||t.S.i!==t.i)return!0;return!1}function signals_core_module_a(i){for(var t=i.s;void 0!==t;t=t.n){var r=t.S.n;if(void 0!==r)t.r=r;t.S.n=t;t.i=-1;if(void 0===t.n){i.s=t;break}}}function signals_core_module_l(i){var t=i.s,r=void 0;while(void 0!==t){var o=t.p;if(-1===t.i){t.S.U(t);if(void 0!==o)o.n=t.n;if(void 0!==t.n)t.n.p=o}else r=t;t.S.n=t.r;if(void 0!==t.r)t.r=void 0;t=o}i.s=r}function signals_core_module_y(i){signals_core_module_u.call(this,void 0);this.x=i;this.s=void 0;this.g=signals_core_module_v-1;this.f=4}(signals_core_module_y.prototype=new signals_core_module_u).h=function(){this.f&=-3;if(1&this.f)return!1;if(32==(36&this.f))return!0;this.f&=-5;if(this.g===signals_core_module_v)return!0;this.g=signals_core_module_v;this.f|=1;if(this.i>0&&!signals_core_module_c(this)){this.f&=-2;return!0}var i=signals_core_module_o;try{signals_core_module_a(this);signals_core_module_o=this;var t=this.x();if(16&this.f||this.v!==t||0===this.i){this.v=t;this.f&=-17;this.i++}}catch(i){this.v=i;this.f|=16;this.i++}signals_core_module_o=i;signals_core_module_l(this);this.f&=-2;return!0};signals_core_module_y.prototype.S=function(i){if(void 0===this.t){this.f|=36;for(var t=this.s;void 0!==t;t=t.n)t.S.S(t)}signals_core_module_u.prototype.S.call(this,i)};signals_core_module_y.prototype.U=function(i){if(void 0!==this.t){signals_core_module_u.prototype.U.call(this,i);if(void 0===this.t){this.f&=-33;for(var t=this.s;void 0!==t;t=t.n)t.S.U(t)}}};signals_core_module_y.prototype.N=function(){if(!(2&this.f)){this.f|=6;for(var i=this.t;void 0!==i;i=i.x)i.t.N()}};Object.defineProperty(signals_core_module_y.prototype,"value",{get:function(){if(1&this.f)throw new Error("Cycle detected");var i=signals_core_module_e(this);this.h();if(void 0!==i)i.i=this.i;if(16&this.f)throw this.v;return this.v}});function signals_core_module_w(i){return new signals_core_module_y(i)}function signals_core_module_(i){var r=i.u;i.u=void 0;if("function"==typeof r){signals_core_module_s++;var n=signals_core_module_o;signals_core_module_o=void 0;try{r()}catch(t){i.f&=-2;i.f|=8;signals_core_module_g(i);throw t}finally{signals_core_module_o=n;signals_core_module_t()}}}function signals_core_module_g(i){for(var t=i.s;void 0!==t;t=t.n)t.S.U(t);i.x=void 0;i.s=void 0;signals_core_module_(i)}function signals_core_module_p(i){if(signals_core_module_o!==this)throw new Error("Out-of-order effect");signals_core_module_l(this);signals_core_module_o=i;this.f&=-2;if(8&this.f)signals_core_module_g(this);signals_core_module_t()}function signals_core_module_b(i){this.x=i;this.u=void 0;this.s=void 0;this.o=void 0;this.f=32}signals_core_module_b.prototype.c=function(){var i=this.S();try{if(8&this.f)return;if(void 0===this.x)return;var t=this.x();if("function"==typeof t)this.u=t}finally{i()}};signals_core_module_b.prototype.S=function(){if(1&this.f)throw new Error("Cycle detected");this.f|=1;this.f&=-9;signals_core_module_(this);signals_core_module_a(this);signals_core_module_s++;var i=signals_core_module_o;signals_core_module_o=this;return signals_core_module_p.bind(this,i)};signals_core_module_b.prototype.N=function(){if(!(2&this.f)){this.f|=2;this.o=signals_core_module_h;signals_core_module_h=this}};signals_core_module_b.prototype.d=function(){this.f|=8;if(!(1&this.f))signals_core_module_g(this)};function signals_core_module_E(i){var t=new signals_core_module_b(i);try{t.c()}catch(i){t.d();throw i}return t.d.bind(t)} +var signals_core_module_i=Symbol.for("preact-signals");function signals_core_module_t(){if(!(signals_core_module_s>1)){var i,t=!1;while(void 0!==signals_core_module_h){var r=signals_core_module_h;signals_core_module_h=void 0;signals_core_module_f++;while(void 0!==r){var o=r.o;r.o=void 0;r.f&=-3;if(!(8&r.f)&&signals_core_module_c(r))try{r.c()}catch(r){if(!t){i=r;t=!0}}r=o}}signals_core_module_f=0;signals_core_module_s--;if(t)throw i}else signals_core_module_s--}function signals_core_module_r(i){if(signals_core_module_s>0)return i();signals_core_module_s++;try{return i()}finally{signals_core_module_t()}}var signals_core_module_o=void 0;function n(i){var t=signals_core_module_o;signals_core_module_o=void 0;try{return i()}finally{signals_core_module_o=t}}var signals_core_module_h=void 0,signals_core_module_s=0,signals_core_module_f=0,signals_core_module_v=0;function signals_core_module_e(i){if(void 0!==signals_core_module_o){var t=i.n;if(void 0===t||t.t!==signals_core_module_o){t={i:0,S:i,p:signals_core_module_o.s,n:void 0,t:signals_core_module_o,e:void 0,x:void 0,r:t};if(void 0!==signals_core_module_o.s)signals_core_module_o.s.n=t;signals_core_module_o.s=t;i.n=t;if(32&signals_core_module_o.f)i.S(t);return t}else if(-1===t.i){t.i=0;if(void 0!==t.n){t.n.p=t.p;if(void 0!==t.p)t.p.n=t.n;t.p=signals_core_module_o.s;t.n=void 0;signals_core_module_o.s.n=t;signals_core_module_o.s=t}return t}}}function signals_core_module_u(i){this.v=i;this.i=0;this.n=void 0;this.t=void 0}signals_core_module_u.prototype.brand=signals_core_module_i;signals_core_module_u.prototype.h=function(){return!0};signals_core_module_u.prototype.S=function(i){if(this.t!==i&&void 0===i.e){i.x=this.t;if(void 0!==this.t)this.t.e=i;this.t=i}};signals_core_module_u.prototype.U=function(i){if(void 0!==this.t){var t=i.e,r=i.x;if(void 0!==t){t.x=r;i.e=void 0}if(void 0!==r){r.e=t;i.x=void 0}if(i===this.t)this.t=r}};signals_core_module_u.prototype.subscribe=function(i){var t=this;return E(function(){var r=t.value,n=signals_core_module_o;signals_core_module_o=void 0;try{i(r)}finally{signals_core_module_o=n}})};signals_core_module_u.prototype.valueOf=function(){return this.value};signals_core_module_u.prototype.toString=function(){return this.value+""};signals_core_module_u.prototype.toJSON=function(){return this.value};signals_core_module_u.prototype.peek=function(){var i=signals_core_module_o;signals_core_module_o=void 0;try{return this.value}finally{signals_core_module_o=i}};Object.defineProperty(signals_core_module_u.prototype,"value",{get:function(){var i=signals_core_module_e(this);if(void 0!==i)i.i=this.i;return this.v},set:function(i){if(i!==this.v){if(signals_core_module_f>100)throw new Error("Cycle detected");this.v=i;this.i++;signals_core_module_v++;signals_core_module_s++;try{for(var r=this.t;void 0!==r;r=r.x)r.t.N()}finally{signals_core_module_t()}}}});function signals_core_module_d(i){return new signals_core_module_u(i)}function signals_core_module_c(i){for(var t=i.s;void 0!==t;t=t.n)if(t.S.i!==t.i||!t.S.h()||t.S.i!==t.i)return!0;return!1}function signals_core_module_a(i){for(var t=i.s;void 0!==t;t=t.n){var r=t.S.n;if(void 0!==r)t.r=r;t.S.n=t;t.i=-1;if(void 0===t.n){i.s=t;break}}}function signals_core_module_l(i){var t=i.s,r=void 0;while(void 0!==t){var o=t.p;if(-1===t.i){t.S.U(t);if(void 0!==o)o.n=t.n;if(void 0!==t.n)t.n.p=o}else r=t;t.S.n=t.r;if(void 0!==t.r)t.r=void 0;t=o}i.s=r}function signals_core_module_y(i){signals_core_module_u.call(this,void 0);this.x=i;this.s=void 0;this.g=signals_core_module_v-1;this.f=4}(signals_core_module_y.prototype=new signals_core_module_u).h=function(){this.f&=-3;if(1&this.f)return!1;if(32==(36&this.f))return!0;this.f&=-5;if(this.g===signals_core_module_v)return!0;this.g=signals_core_module_v;this.f|=1;if(this.i>0&&!signals_core_module_c(this)){this.f&=-2;return!0}var i=signals_core_module_o;try{signals_core_module_a(this);signals_core_module_o=this;var t=this.x();if(16&this.f||this.v!==t||0===this.i){this.v=t;this.f&=-17;this.i++}}catch(i){this.v=i;this.f|=16;this.i++}signals_core_module_o=i;signals_core_module_l(this);this.f&=-2;return!0};signals_core_module_y.prototype.S=function(i){if(void 0===this.t){this.f|=36;for(var t=this.s;void 0!==t;t=t.n)t.S.S(t)}signals_core_module_u.prototype.S.call(this,i)};signals_core_module_y.prototype.U=function(i){if(void 0!==this.t){signals_core_module_u.prototype.U.call(this,i);if(void 0===this.t){this.f&=-33;for(var t=this.s;void 0!==t;t=t.n)t.S.U(t)}}};signals_core_module_y.prototype.N=function(){if(!(2&this.f)){this.f|=6;for(var i=this.t;void 0!==i;i=i.x)i.t.N()}};Object.defineProperty(signals_core_module_y.prototype,"value",{get:function(){if(1&this.f)throw new Error("Cycle detected");var i=signals_core_module_e(this);this.h();if(void 0!==i)i.i=this.i;if(16&this.f)throw this.v;return this.v}});function signals_core_module_w(i){return new signals_core_module_y(i)}function signals_core_module_(i){var r=i.u;i.u=void 0;if("function"==typeof r){signals_core_module_s++;var n=signals_core_module_o;signals_core_module_o=void 0;try{r()}catch(t){i.f&=-2;i.f|=8;signals_core_module_g(i);throw t}finally{signals_core_module_o=n;signals_core_module_t()}}}function signals_core_module_g(i){for(var t=i.s;void 0!==t;t=t.n)t.S.U(t);i.x=void 0;i.s=void 0;signals_core_module_(i)}function signals_core_module_p(i){if(signals_core_module_o!==this)throw new Error("Out-of-order effect");signals_core_module_l(this);signals_core_module_o=i;this.f&=-2;if(8&this.f)signals_core_module_g(this);signals_core_module_t()}function signals_core_module_b(i){this.x=i;this.u=void 0;this.s=void 0;this.o=void 0;this.f=32}signals_core_module_b.prototype.c=function(){var i=this.S();try{if(8&this.f)return;if(void 0===this.x)return;var t=this.x();if("function"==typeof t)this.u=t}finally{i()}};signals_core_module_b.prototype.S=function(){if(1&this.f)throw new Error("Cycle detected");this.f|=1;this.f&=-9;signals_core_module_(this);signals_core_module_a(this);signals_core_module_s++;var i=signals_core_module_o;signals_core_module_o=this;return signals_core_module_p.bind(this,i)};signals_core_module_b.prototype.N=function(){if(!(2&this.f)){this.f|=2;this.o=signals_core_module_h;signals_core_module_h=this}};signals_core_module_b.prototype.d=function(){this.f|=8;if(!(1&this.f))signals_core_module_g(this)};function E(i){var t=new signals_core_module_b(i);try{t.c()}catch(i){t.d();throw i}return t.d.bind(t)} ;// CONCATENATED MODULE: ./node_modules/@preact/signals/dist/signals.module.js -var signals_module_v,signals_module_s;function signals_module_l(n,i){preact_module_l[n]=i.bind(null,preact_module_l[n]||function(){})}function signals_module_d(n){if(signals_module_s)signals_module_s();signals_module_s=n&&n.S()}function signals_module_p(n){var r=this,f=n.data,o=useSignal(f);o.value=f;var e=hooks_module_T(function(){var n=r.__v;while(n=n.__)if(n.__c){n.__c.__$f|=4;break}r.__$u.c=function(){var n;if(!preact_module_t(e.peek())&&3===(null==(n=r.base)?void 0:n.nodeType))r.base.data=e.peek();else{r.__$f|=1;r.setState({})}};return signals_core_module_w(function(){var n=o.value.value;return 0===n?0:!0===n?"":n||""})},[]);return e.value}signals_module_p.displayName="_st";Object.defineProperties(signals_core_module_u.prototype,{constructor:{configurable:!0,value:void 0},type:{configurable:!0,value:signals_module_p},props:{configurable:!0,get:function(){return{data:this}}},__b:{configurable:!0,value:1}});signals_module_l("__b",function(n,r){if("string"==typeof r.type){var i,t=r.props;for(var f in t)if("children"!==f){var o=t[f];if(o instanceof signals_core_module_u){if(!i)r.__np=i={};i[f]=o;t[f]=o.peek()}}}n(r)});signals_module_l("__r",function(n,r){signals_module_d();var i,t=r.__c;if(t){t.__$f&=-2;if(void 0===(i=t.__$u))t.__$u=i=function(n){var r;signals_core_module_E(function(){r=this});r.c=function(){t.__$f|=1;t.setState({})};return r}()}signals_module_v=t;signals_module_d(i);n(r)});signals_module_l("__e",function(n,r,i,t){signals_module_d();signals_module_v=void 0;n(r,i,t)});signals_module_l("diffed",function(n,r){signals_module_d();signals_module_v=void 0;var i;if("string"==typeof r.type&&(i=r.__e)){var t=r.__np,f=r.props;if(t){var o=i.U;if(o)for(var e in o){var u=o[e];if(void 0!==u&&!(e in t)){u.d();o[e]=void 0}}else i.U=o={};for(var a in t){var c=o[a],s=t[a];if(void 0===c){c=signals_module_(i,a,s,f);o[a]=c}else c.o(s,f)}}}n(r)});function signals_module_(n,r,i,t){var f=r in n&&void 0===n.ownerSVGElement,o=signals_core_module_d(i);return{o:function(n,r){o.value=n;t=r},d:signals_core_module_E(function(){var i=o.value.value;if(t[r]!==i){t[r]=i;if(f)n[r]=i;else if(i)n.setAttribute(r,i);else n.removeAttribute(r)}})}}signals_module_l("unmount",function(n,r){if("string"==typeof r.type){var i=r.__e;if(i){var t=i.U;if(t){i.U=void 0;for(var f in t){var o=t[f];if(o)o.d()}}}}else{var e=r.__c;if(e){var u=e.__$u;if(u){e.__$u=void 0;u.d()}}}n(r)});signals_module_l("__h",function(n,r,i,t){if(t<3||9===t)r.__$f|=2;n(r,i,t)});k.prototype.shouldComponentUpdate=function(n,r){var i=this.__$u;if(!(i&&void 0!==i.s||4&this.__$f))return!0;if(3&this.__$f)return!0;for(var t in r)return!0;for(var f in n)if("__source"!==f&&n[f]!==this.props[f])return!0;for(var o in this.props)if(!(o in n))return!0;return!1};function useSignal(n){return hooks_module_T(function(){return signals_core_module_d(n)},[])}function useComputed(n){var r=f(n);r.current=n;signals_module_v.__$f|=4;return t(function(){return u(function(){return r.current()})},[])}function useSignalEffect(n){var r=f(n);r.current=n;o(function(){return c(function(){return r.current()})},[])} +var signals_module_v,signals_module_s;function signals_module_l(n,i){preact_module/* options */.fF[n]=i.bind(null,preact_module/* options */.fF[n]||function(){})}function signals_module_d(n){if(signals_module_s)signals_module_s();signals_module_s=n&&n.S()}function signals_module_p(n){var r=this,f=n.data,o=useSignal(f);o.value=f;var e=T(function(){var n=r.__v;while(n=n.__)if(n.__c){n.__c.__$f|=4;break}r.__$u.c=function(){var n;if(!(0,preact_module/* isValidElement */.zO)(e.peek())&&3===(null==(n=r.base)?void 0:n.nodeType))r.base.data=e.peek();else{r.__$f|=1;r.setState({})}};return signals_core_module_w(function(){var n=o.value.value;return 0===n?0:!0===n?"":n||""})},[]);return e.value}signals_module_p.displayName="_st";Object.defineProperties(signals_core_module_u.prototype,{constructor:{configurable:!0,value:void 0},type:{configurable:!0,value:signals_module_p},props:{configurable:!0,get:function(){return{data:this}}},__b:{configurable:!0,value:1}});signals_module_l("__b",function(n,r){if("string"==typeof r.type){var i,t=r.props;for(var f in t)if("children"!==f){var o=t[f];if(o instanceof signals_core_module_u){if(!i)r.__np=i={};i[f]=o;t[f]=o.peek()}}}n(r)});signals_module_l("__r",function(n,r){signals_module_d();var i,t=r.__c;if(t){t.__$f&=-2;if(void 0===(i=t.__$u))t.__$u=i=function(n){var r;E(function(){r=this});r.c=function(){t.__$f|=1;t.setState({})};return r}()}signals_module_v=t;signals_module_d(i);n(r)});signals_module_l("__e",function(n,r,i,t){signals_module_d();signals_module_v=void 0;n(r,i,t)});signals_module_l("diffed",function(n,r){signals_module_d();signals_module_v=void 0;var i;if("string"==typeof r.type&&(i=r.__e)){var t=r.__np,f=r.props;if(t){var o=i.U;if(o)for(var e in o){var u=o[e];if(void 0!==u&&!(e in t)){u.d();o[e]=void 0}}else i.U=o={};for(var a in t){var c=o[a],s=t[a];if(void 0===c){c=signals_module_(i,a,s,f);o[a]=c}else c.o(s,f)}}}n(r)});function signals_module_(n,r,i,t){var f=r in n&&void 0===n.ownerSVGElement,o=signals_core_module_d(i);return{o:function(n,r){o.value=n;t=r},d:E(function(){var i=o.value.value;if(t[r]!==i){t[r]=i;if(f)n[r]=i;else if(i)n.setAttribute(r,i);else n.removeAttribute(r)}})}}signals_module_l("unmount",function(n,r){if("string"==typeof r.type){var i=r.__e;if(i){var t=i.U;if(t){i.U=void 0;for(var f in t){var o=t[f];if(o)o.d()}}}}else{var e=r.__c;if(e){var u=e.__$u;if(u){e.__$u=void 0;u.d()}}}n(r)});signals_module_l("__h",function(n,r,i,t){if(t<3||9===t)r.__$f|=2;n(r,i,t)});preact_module/* Component */.uA.prototype.shouldComponentUpdate=function(n,r){var i=this.__$u;if(!(i&&void 0!==i.s||4&this.__$f))return!0;if(3&this.__$f)return!0;for(var t in r)return!0;for(var f in n)if("__source"!==f&&n[f]!==this.props[f])return!0;for(var o in this.props)if(!(o in n))return!0;return!1};function useSignal(n){return T(function(){return signals_core_module_d(n)},[])}function useComputed(n){var r=f(n);r.current=n;signals_module_v.__$f|=4;return t(function(){return u(function(){return r.current()})},[])}function useSignalEffect(n){var r=f(n);r.current=n;o(function(){return c(function(){return r.current()})},[])} ;// CONCATENATED MODULE: ./node_modules/@wordpress/interactivity/build-module/namespaces.js const namespaceStack = []; const getNamespace = () => namespaceStack.slice(-1)[0]; @@ -250,7 +289,7 @@ const splitTask = () => { */ function createFlusher(compute, notify) { let flush = () => undefined; - const dispose = signals_core_module_E(function () { + const dispose = E(function () { flush = this.c.bind(this); this.x = compute; this.c = notify; @@ -271,7 +310,7 @@ function createFlusher(compute, notify) { * @param callback The callback function to be executed. */ function utils_useSignalEffect(callback) { - hooks_module_y(() => { + y(() => { let eff = null; let isExecuting = false; const notify = async () => { @@ -368,7 +407,7 @@ function useWatch(callback) { * @param callback The hook callback. */ function useInit(callback) { - hooks_module_y(withScope(callback), []); + y(withScope(callback), []); } /** @@ -385,7 +424,7 @@ function useInit(callback) { * values in the list change (using `===`). */ function useEffect(callback, inputs) { - hooks_module_y(withScope(callback), inputs); + y(withScope(callback), inputs); } /** @@ -402,7 +441,7 @@ function useEffect(callback, inputs) { * values in the list change (using `===`). */ function useLayoutEffect(callback, inputs) { - hooks_module_(withScope(callback), inputs); + _(withScope(callback), inputs); } /** @@ -420,7 +459,7 @@ function useLayoutEffect(callback, inputs) { * @return The callback function. */ function useCallback(callback, inputs) { - return hooks_module_q(withScope(callback), inputs); + return q(withScope(callback), inputs); } /** @@ -438,7 +477,7 @@ function useCallback(callback, inputs) { * @return The memoized value. */ function useMemo(factory, inputs) { - return hooks_module_T(withScope(factory), inputs); + return T(withScope(factory), inputs); } /** @@ -1376,7 +1415,7 @@ populateServerData(data); // Main context. -const context = G({ +const context = (0,preact_module/* createContext */.q6)({ client: {}, server: {} }); @@ -1530,29 +1569,29 @@ const Directives = ({ // Initialize the scope of this element. These scopes are different per each // level because each level has a different context, but they share the same // element ref, state and props. - const scope = hooks_module_A({}).current; - scope.evaluate = hooks_module_q(getEvaluate({ + const scope = A({}).current; + scope.evaluate = q(getEvaluate({ scope }), []); const { client, server - } = hooks_module_x(context); + } = x(context); scope.context = client; scope.serverContext = server; /* eslint-disable react-hooks/rules-of-hooks */ - scope.ref = previousScope?.ref || hooks_module_A(null); + scope.ref = previousScope?.ref || A(null); /* eslint-enable react-hooks/rules-of-hooks */ // Create a fresh copy of the vnode element and add the props to the scope, // named as attributes (HTML Attributes). - element = E(element, { + element = (0,preact_module/* cloneElement */.Ob)(element, { ref: scope.ref }); scope.attributes = element.props; // Recursively render the wrapper for the next priority level. - const children = nextPriorityLevels.length > 0 ? _(Directives, { + const children = nextPriorityLevels.length > 0 ? (0,preact_module.h)(Directives, { directives, priorityLevels: nextPriorityLevels, element, @@ -1582,8 +1621,8 @@ const Directives = ({ }; // Preact Options Hook called each time a vnode is created. -const old = preact_module_l.vnode; -preact_module_l.vnode = vnode => { +const old = preact_module/* options */.fF.vnode; +preact_module/* options */.fF.vnode = vnode => { if (vnode.props.__directives) { const props = vnode.props; const directives = props.__directives; @@ -1600,7 +1639,7 @@ preact_module_l.vnode = vnode => { priorityLevels, originalProps: props, type: vnode.type, - element: _(vnode.type, props), + element: (0,preact_module.h)(vnode.type, props), top: true }; vnode.type = Directives; @@ -1748,15 +1787,15 @@ const getGlobalAsyncEventDirective = type => { const { client: inheritedClient, server: inheritedServer - } = hooks_module_x(inheritedContext); + } = x(inheritedContext); const ns = defaultEntry.namespace; - const client = hooks_module_A(proxifyState(ns, {})); - const server = hooks_module_A(proxifyState(ns, {}, { + const client = A(proxifyState(ns, {})); + const server = A(proxifyState(ns, {}, { readOnly: true })); // No change should be made if `defaultEntry` does not exist. - const contextStack = hooks_module_T(() => { + const contextStack = T(() => { const result = { client: { ...inheritedClient @@ -1781,7 +1820,7 @@ const getGlobalAsyncEventDirective = type => { } return result; }, [defaultEntry, inheritedClient, inheritedServer]); - return _(Provider, { + return (0,preact_module.h)(Provider, { value: contextStack }, children); }, { @@ -2050,8 +2089,8 @@ const getGlobalAsyncEventDirective = type => { } }) => { // Preserve the initial inner HTML. - const cached = hooks_module_T(() => innerHTML, []); - return _(Type, { + const cached = T(() => innerHTML, []); + return (0,preact_module.h)(Type, { dangerouslySetInnerHTML: { __html: cached }, @@ -2108,7 +2147,7 @@ const getGlobalAsyncEventDirective = type => { const { Provider } = inheritedContext; - const inheritedValue = hooks_module_x(inheritedContext); + const inheritedValue = x(inheritedContext); const [entry] = each; const { namespace, @@ -2138,7 +2177,7 @@ const getGlobalAsyncEventDirective = type => { const key = eachKey ? getEvaluate({ scope })(eachKey[0]) : item; - return _(Provider, { + return (0,preact_module.h)(Provider, { value: mergedContext, key }, element.props.content); @@ -2268,7 +2307,7 @@ function toVdom(root) { props[attributeName] = attributeValue; } if (ignore && !island) { - return [_(localName, { + return [(0,preact_module.h)(localName, { ...props, innerHTML: elementNode.innerHTML, __directives: { @@ -2319,7 +2358,7 @@ function toVdom(root) { if (island) { namespaces.pop(); } - return [_(localName, props, children)]; + return [(0,preact_module.h)(localName, props, children)]; } return walk(treeWalker.currentNode); } @@ -2361,7 +2400,7 @@ const init = async () => { const vdom = toVdom(node); initialVdom.set(node, vdom); await splitTask(); - D(vdom, fragment); + (0,preact_module/* hydrate */.Qv)(vdom, fragment); } } }; @@ -2398,9 +2437,9 @@ const privateApis = lock => { toVdom: toVdom, directive: directive, getNamespace: getNamespace, - h: _, - cloneElement: E, - render: B, + h: preact_module.h, + cloneElement: preact_module/* cloneElement */.Ob, + render: preact_module/* render */.XX, proxifyState: proxifyState, parseServerData: parseServerData, populateServerData: populateServerData, @@ -2412,12 +2451,7 @@ const privateApis = lock => { directives(); init(); -;// CONCATENATED MODULE: ./node_modules/@wordpress/interactivity/build-module/debug.js -/** - * External dependencies - */ - - +})(); var __webpack_exports__getConfig = __webpack_exports__.zj; var __webpack_exports__getContext = __webpack_exports__.SD; diff --git a/wp-includes/js/dist/script-modules/interactivity/index.min.js b/wp-includes/js/dist/script-modules/interactivity/index.min.js new file mode 100644 index 00000000000..4991ea14b18 --- /dev/null +++ b/wp-includes/js/dist/script-modules/interactivity/index.min.js @@ -0,0 +1 @@ +var e={622:(e,t,n)=>{n.d(t,{Ob:()=>B,Qv:()=>V,XX:()=>I,fF:()=>o,h:()=>b,q6:()=>z,uA:()=>k,zO:()=>s});var r,o,i,s,u,_,l,c,a,f,p,h,d={},v=[],y=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,g=Array.isArray;function m(e,t){for(var n in t)e[n]=t[n];return e}function w(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function b(e,t,n){var o,i,s,u={};for(s in t)"key"==s?o=t[s]:"ref"==s?i=t[s]:u[s]=t[s];if(arguments.length>2&&(u.children=arguments.length>3?r.call(arguments,2):n),"function"==typeof e&&null!=e.defaultProps)for(s in e.defaultProps)void 0===u[s]&&(u[s]=e.defaultProps[s]);return x(e,u,o,i,null)}function x(e,t,n,r,s){var u={type:e,props:t,key:n,ref:r,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:null==s?++i:s,__i:-1,__u:0};return null==s&&null!=o.vnode&&o.vnode(u),u}function S(e){return e.children}function k(e,t){this.props=e,this.context=t}function E(e,t){if(null==t)return e.__?E(e.__,e.__i+1):null;for(var n;tt&&u.sort(c));O.__r=0}function T(e,t,n,r,o,i,s,u,_,l,c){var a,f,p,h,y,g=r&&r.__k||v,m=t.length;for(n.__d=_,$(n,t,g),_=n.__d,a=0;a0?x(o.type,o.props,o.key,o.ref?o.ref:null,o.__v):o).__=e,o.__b=e.__b+1,i=null,-1!==(u=o.__i=N(o,n,s,c))&&(c--,(i=n[u])&&(i.__u|=131072)),null==i||null===i.__v?(-1==u&&a--,"function"!=typeof o.type&&(o.__u|=65536)):u!==s&&(u==s-1?a--:u==s+1?a++:(u>s?a--:a++,o.__u|=65536))):o=e.__k[r]=null;if(c)for(r=0;r(null!=_&&0==(131072&_.__u)?1:0))for(;s>=0||u=0){if((_=t[s])&&0==(131072&_.__u)&&o==_.key&&i===_.type)return s;s--}if(u2&&(_.children=arguments.length>3?r.call(arguments,2):n),x(e.type,_,o||e.key,i||e.ref,null)}function z(e,t){var n={__c:t="__cC"+h++,__: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.componentWillUnmount=function(){n=null},this.shouldComponentUpdate=function(e){this.props.value!==e.value&&n.some((function(e){e.__e=!0,C(e)}))},this.sub=function(e){n.push(e);var t=e.componentWillUnmount;e.componentWillUnmount=function(){n&&n.splice(n.indexOf(e),1),t&&t.call(e)}}),e.children}};return n.Provider.__=n.Consumer.contextType=n}r=v.slice,o={__e:function(e,t,n,r){for(var o,i,s;t=t.__;)if((o=t.__c)&&!o.__)try{if((i=o.constructor)&&null!=i.getDerivedStateFromError&&(o.setState(i.getDerivedStateFromError(e)),s=o.__d),null!=o.componentDidCatch&&(o.componentDidCatch(e,r||{}),s=o.__d),s)return o.__E=o}catch(t){e=t}throw e}},i=0,s=function(e){return null!=e&&null==e.constructor},k.prototype.setState=function(e,t){var n;n=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=m({},this.state),"function"==typeof e&&(e=e(m({},n),this.props)),e&&m(n,e),null!=e&&this.__v&&(t&&this._sb.push(t),C(this))},k.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),C(this))},k.prototype.render=S,u=[],l="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,c=function(e,t){return e.__v.__b-t.__v.__b},O.__r=0,a=0,f=U(!1),p=U(!0),h=0}},t={};function n(r){var o=t[r];if(void 0!==o)return o.exports;var i=t[r]={exports:{}};return e[r](i,i.exports,n),i.exports}n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var r={};(()=>{n.d(r,{zj:()=>at,SD:()=>de,V6:()=>ve,$K:()=>ye,vT:()=>ft,jb:()=>Vt,yT:()=>me,M_:()=>ht,hb:()=>Pe,vJ:()=>ke,ip:()=>Se,Nf:()=>Ee,Kr:()=>Ce,li:()=>w,J0:()=>y,FH:()=>xe,v4:()=>be});var e,t,o,i,s=n(622),u=0,_=[],l=s.fF,c=l.__b,a=l.__r,f=l.diffed,p=l.__c,h=l.unmount,d=l.__;function v(e,n){l.__h&&l.__h(t,e,u||n),u=0;var r=t.__H||(t.__H={__:[],__h:[]});return e>=r.__.length&&r.__.push({}),r.__[e]}function y(n){return u=1,function(n,r,o){var i=v(e++,2);if(i.t=n,!i.__c&&(i.__=[o?o(r):$(void 0,r),function(e){var t=i.__N?i.__N[0]:i.__[0],n=i.t(t,e);t!==n&&(i.__N=[n,i.__[1]],i.__c.setState({}))}],i.__c=t,!t.u)){var s=function(e,t,n){if(!i.__c.__H)return!0;var r=i.__c.__H.__.filter((function(e){return!!e.__c}));if(r.every((function(e){return!e.__N})))return!u||u.call(this,e,t,n);var o=!1;return r.forEach((function(e){if(e.__N){var t=e.__[0];e.__=e.__N,e.__N=void 0,t!==e.__[0]&&(o=!0)}})),!(!o&&i.__c.props===e)&&(!u||u.call(this,e,t,n))};t.u=!0;var u=t.shouldComponentUpdate,_=t.componentWillUpdate;t.componentWillUpdate=function(e,t,n){if(this.__e){var r=u;u=void 0,s(e,t,n),u=r}_&&_.call(this,e,t,n)},t.shouldComponentUpdate=s}return i.__N||i.__}($,n)}function g(n,r){var o=v(e++,3);!l.__s&&T(o.__H,r)&&(o.__=n,o.i=r,t.__H.__h.push(o))}function m(n,r){var o=v(e++,4);!l.__s&&T(o.__H,r)&&(o.__=n,o.i=r,t.__h.push(o))}function w(e){return u=5,b((function(){return{current:e}}),[])}function b(t,n){var r=v(e++,7);return T(r.__H,n)&&(r.__=t(),r.__H=n,r.__h=t),r.__}function x(e,t){return u=8,b((function(){return e}),t)}function S(n){var r=t.context[n.__c],o=v(e++,9);return o.c=n,r?(null==o.__&&(o.__=!0,r.sub(t)),r.props.value):n.__}function k(){for(var e;e=_.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(C),e.__H.__h.forEach(O),e.__H.__h=[]}catch(t){e.__H.__h=[],l.__e(t,e.__v)}}l.__b=function(e){t=null,c&&c(e)},l.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),d&&d(e,t)},l.__r=function(n){a&&a(n),e=0;var r=(t=n.__c).__H;r&&(o===t?(r.__h=[],t.__h=[],r.__.forEach((function(e){e.__N&&(e.__=e.__N),e.i=e.__N=void 0}))):(r.__h.forEach(C),r.__h.forEach(O),r.__h=[],e=0)),o=t},l.diffed=function(e){f&&f(e);var n=e.__c;n&&n.__H&&(n.__H.__h.length&&(1!==_.push(n)&&i===l.requestAnimationFrame||((i=l.requestAnimationFrame)||P)(k)),n.__H.__.forEach((function(e){e.i&&(e.__H=e.i),e.i=void 0}))),o=t=null},l.__c=function(e,t){t.some((function(e){try{e.__h.forEach(C),e.__h=e.__h.filter((function(e){return!e.__||O(e)}))}catch(n){t.some((function(e){e.__h&&(e.__h=[])})),t=[],l.__e(n,e.__v)}})),p&&p(e,t)},l.unmount=function(e){h&&h(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.forEach((function(e){try{C(e)}catch(e){t=e}})),n.__H=void 0,t&&l.__e(t,n.__v))};var E="function"==typeof requestAnimationFrame;function P(e){var t,n=function(){clearTimeout(r),E&&cancelAnimationFrame(t),setTimeout(e)},r=setTimeout(n,100);E&&(t=requestAnimationFrame(n))}function C(e){var n=t,r=e.__c;"function"==typeof r&&(e.__c=void 0,r()),t=n}function O(e){var n=t;e.__c=e.__(),t=n}function T(e,t){return!e||e.length!==t.length||t.some((function(t,n){return t!==e[n]}))}function $(e,t){return"function"==typeof t?t(e):t}var M=Symbol.for("preact-signals");function N(){if(F>1)F--;else{for(var e,t=!1;void 0!==W;){var n=W;for(W=void 0,A++;void 0!==n;){var r=n.o;if(n.o=void 0,n.f&=-3,!(8&n.f)&&V(n))try{n.c()}catch(n){t||(e=n,t=!0)}n=r}}if(A=0,F--,t)throw e}}function j(e){if(F>0)return e();F++;try{return e()}finally{N()}}var H=void 0;var U,W=void 0,F=0,A=0,L=0;function D(e){if(void 0!==H){var t=e.n;if(void 0===t||t.t!==H)return t={i:0,S:e,p:H.s,n:void 0,t:H,e:void 0,x:void 0,r:t},void 0!==H.s&&(H.s.n=t),H.s=t,e.n=t,32&H.f&&e.S(t),t;if(-1===t.i)return t.i=0,void 0!==t.n&&(t.n.p=t.p,void 0!==t.p&&(t.p.n=t.n),t.p=H.s,t.n=void 0,H.s.n=t,H.s=t),t}}function R(e){this.v=e,this.i=0,this.n=void 0,this.t=void 0}function I(e){return new R(e)}function V(e){for(var t=e.s;void 0!==t;t=t.n)if(t.S.i!==t.i||!t.S.h()||t.S.i!==t.i)return!0;return!1}function B(e){for(var t=e.s;void 0!==t;t=t.n){var n=t.S.n;if(void 0!==n&&(t.r=n),t.S.n=t,t.i=-1,void 0===t.n){e.s=t;break}}}function z(e){for(var t=e.s,n=void 0;void 0!==t;){var r=t.p;-1===t.i?(t.S.U(t),void 0!==r&&(r.n=t.n),void 0!==t.n&&(t.n.p=r)):n=t,t.S.n=t.r,void 0!==t.r&&(t.r=void 0),t=r}e.s=n}function q(e){R.call(this,void 0),this.x=e,this.s=void 0,this.g=L-1,this.f=4}function J(e){return new q(e)}function K(e){var t=e.u;if(e.u=void 0,"function"==typeof t){F++;var n=H;H=void 0;try{t()}catch(t){throw e.f&=-2,e.f|=8,G(e),t}finally{H=n,N()}}}function G(e){for(var t=e.s;void 0!==t;t=t.n)t.S.U(t);e.x=void 0,e.s=void 0,K(e)}function X(e){if(H!==this)throw new Error("Out-of-order effect");z(this),H=e,this.f&=-2,8&this.f&&G(this),N()}function Q(e){this.x=e,this.u=void 0,this.s=void 0,this.o=void 0,this.f=32}function Y(e){var t=new Q(e);try{t.c()}catch(e){throw t.d(),e}return t.d.bind(t)}function Z(e,t){s.fF[e]=t.bind(null,s.fF[e]||function(){})}function ee(e){U&&U(),U=e&&e.S()}function te(e){var t=this,n=e.data,r=function(e){return b((function(){return I(e)}),[])}(n);r.value=n;var o=b((function(){for(var e=t.__v;e=e.__;)if(e.__c){e.__c.__$f|=4;break}return t.__$u.c=function(){var e;(0,s.zO)(o.peek())||3!==(null==(e=t.base)?void 0:e.nodeType)?(t.__$f|=1,t.setState({})):t.base.data=o.peek()},J((function(){var e=r.value.value;return 0===e?0:!0===e?"":e||""}))}),[]);return o.value}function ne(e,t,n,r){var o=t in e&&void 0===e.ownerSVGElement,i=I(n);return{o:function(e,t){i.value=e,r=t},d:Y((function(){var n=i.value.value;r[t]!==n&&(r[t]=n,o?e[t]=n:n?e.setAttribute(t,n):e.removeAttribute(t))}))}}R.prototype.brand=M,R.prototype.h=function(){return!0},R.prototype.S=function(e){this.t!==e&&void 0===e.e&&(e.x=this.t,void 0!==this.t&&(this.t.e=e),this.t=e)},R.prototype.U=function(e){if(void 0!==this.t){var t=e.e,n=e.x;void 0!==t&&(t.x=n,e.e=void 0),void 0!==n&&(n.e=t,e.x=void 0),e===this.t&&(this.t=n)}},R.prototype.subscribe=function(e){var t=this;return Y((function(){var n=t.value,r=H;H=void 0;try{e(n)}finally{H=r}}))},R.prototype.valueOf=function(){return this.value},R.prototype.toString=function(){return this.value+""},R.prototype.toJSON=function(){return this.value},R.prototype.peek=function(){var e=H;H=void 0;try{return this.value}finally{H=e}},Object.defineProperty(R.prototype,"value",{get:function(){var e=D(this);return void 0!==e&&(e.i=this.i),this.v},set:function(e){if(e!==this.v){if(A>100)throw new Error("Cycle detected");this.v=e,this.i++,L++,F++;try{for(var t=this.t;void 0!==t;t=t.x)t.t.N()}finally{N()}}}}),(q.prototype=new R).h=function(){if(this.f&=-3,1&this.f)return!1;if(32==(36&this.f))return!0;if(this.f&=-5,this.g===L)return!0;if(this.g=L,this.f|=1,this.i>0&&!V(this))return this.f&=-2,!0;var e=H;try{B(this),H=this;var t=this.x();(16&this.f||this.v!==t||0===this.i)&&(this.v=t,this.f&=-17,this.i++)}catch(e){this.v=e,this.f|=16,this.i++}return H=e,z(this),this.f&=-2,!0},q.prototype.S=function(e){if(void 0===this.t){this.f|=36;for(var t=this.s;void 0!==t;t=t.n)t.S.S(t)}R.prototype.S.call(this,e)},q.prototype.U=function(e){if(void 0!==this.t&&(R.prototype.U.call(this,e),void 0===this.t)){this.f&=-33;for(var t=this.s;void 0!==t;t=t.n)t.S.U(t)}},q.prototype.N=function(){if(!(2&this.f)){this.f|=6;for(var e=this.t;void 0!==e;e=e.x)e.t.N()}},Object.defineProperty(q.prototype,"value",{get:function(){if(1&this.f)throw new Error("Cycle detected");var e=D(this);if(this.h(),void 0!==e&&(e.i=this.i),16&this.f)throw this.v;return this.v}}),Q.prototype.c=function(){var e=this.S();try{if(8&this.f)return;if(void 0===this.x)return;var t=this.x();"function"==typeof t&&(this.u=t)}finally{e()}},Q.prototype.S=function(){if(1&this.f)throw new Error("Cycle detected");this.f|=1,this.f&=-9,K(this),B(this),F++;var e=H;return H=this,X.bind(this,e)},Q.prototype.N=function(){2&this.f||(this.f|=2,this.o=W,W=this)},Q.prototype.d=function(){this.f|=8,1&this.f||G(this)},te.displayName="_st",Object.defineProperties(R.prototype,{constructor:{configurable:!0,value:void 0},type:{configurable:!0,value:te},props:{configurable:!0,get:function(){return{data:this}}},__b:{configurable:!0,value:1}}),Z("__b",(function(e,t){if("string"==typeof t.type){var n,r=t.props;for(var o in r)if("children"!==o){var i=r[o];i instanceof R&&(n||(t.__np=n={}),n[o]=i,r[o]=i.peek())}}e(t)})),Z("__r",(function(e,t){ee();var n,r=t.__c;r&&(r.__$f&=-2,void 0===(n=r.__$u)&&(r.__$u=n=function(e){var t;return Y((function(){t=this})),t.c=function(){r.__$f|=1,r.setState({})},t}())),r,ee(n),e(t)})),Z("__e",(function(e,t,n,r){ee(),void 0,e(t,n,r)})),Z("diffed",(function(e,t){var n;if(ee(),void 0,"string"==typeof t.type&&(n=t.__e)){var r=t.__np,o=t.props;if(r){var i=n.U;if(i)for(var s in i){var u=i[s];void 0===u||s in r||(u.d(),i[s]=void 0)}else n.U=i={};for(var _ in r){var l=i[_],c=r[_];void 0===l?(l=ne(n,_,c,o),i[_]=l):l.o(c,o)}}}e(t)})),Z("unmount",(function(e,t){if("string"==typeof t.type){var n=t.__e;if(n){var r=n.U;if(r)for(var o in n.U=void 0,r){var i=r[o];i&&i.d()}}}else{var s=t.__c;if(s){var u=s.__$u;u&&(s.__$u=void 0,u.d())}}e(t)})),Z("__h",(function(e,t,n,r){(r<3||9===r)&&(t.__$f|=2),e(t,n,r)})),s.uA.prototype.shouldComponentUpdate=function(e,t){var n=this.__$u;if(!(n&&void 0!==n.s||4&this.__$f))return!0;if(3&this.__$f)return!0;for(var r in t)return!0;for(var o in e)if("__source"!==o&&e[o]!==this.props[o])return!0;for(var i in this.props)if(!(i in e))return!0;return!1};const re=[],oe=()=>re.slice(-1)[0],ie=e=>{re.push(e)},se=()=>{re.pop()},ue=[],_e=()=>ue.slice(-1)[0],le=e=>{ue.push(e)},ce=()=>{ue.pop()},ae=new WeakMap,fe=()=>{throw new Error("Please use `data-wp-bind` to modify the attributes of an element.")},pe={get(e,t,n){const r=Reflect.get(e,t,n);return r&&"object"==typeof r?he(r):r},set:fe,deleteProperty:fe},he=e=>(ae.has(e)||ae.set(e,new Proxy(e,pe)),ae.get(e)),de=e=>_e().context[e||oe()],ve=()=>{const e=_e();const{ref:t,attributes:n}=e;return Object.freeze({ref:t.current,attributes:he(n)})},ye=e=>_e().serverContext[e||oe()],ge=e=>new Promise((t=>{const n=()=>{clearTimeout(r),window.cancelAnimationFrame(o),setTimeout((()=>{e(),t()}))},r=setTimeout(n,100),o=window.requestAnimationFrame(n)})),me=()=>new Promise((e=>{setTimeout(e,0)}));function we(e){g((()=>{let t=null,n=!1;return t=function(e,t){let n=()=>{};const r=Y((function(){return n=this.c.bind(this),this.x=e,this.c=t,e()}));return{flush:n,dispose:r}}(e,(async()=>{t&&!n&&(n=!0,await ge(t.flush),n=!1)})),t.dispose}),[])}function be(e){const t=_e(),n=oe();return"GeneratorFunction"===e?.constructor?.name?async(...r)=>{const o=e(...r);let i,s;for(;;){ie(n),le(t);try{s=o.next(i)}finally{ce(),se()}try{i=await s.value}catch(e){ie(n),le(t),o.throw(e)}finally{ce(),se()}if(s.done)break}return i}:(...r)=>{ie(n),le(t);try{return e(...r)}finally{se(),ce()}}}function xe(e){we(be(e))}function Se(e){g(be(e),[])}function ke(e,t){g(be(e),t)}function Ee(e,t){m(be(e),t)}function Pe(e,t){return x(be(e),t)}function Ce(e,t){return b(be(e),t)}new Set;const Oe=e=>{0},Te=e=>Boolean(e&&"object"==typeof e&&e.constructor===Object),$e=new WeakMap,Me=new WeakMap,Ne=new WeakMap,je=new Set([Object,Array]),He=(e,t,n)=>{if(!Fe(t))throw Error("This object cannot be proxified.");if(!$e.has(t)){const r=new Proxy(t,n);$e.set(t,r),Me.set(r,t),Ne.set(r,e)}return $e.get(t)},Ue=e=>$e.get(e),We=e=>Ne.get(e),Fe=e=>"object"==typeof e&&null!==e&&(!Ne.has(e)&&je.has(e.constructor)),Ae={};class Le{constructor(e){this.owner=e,this.computedsByScope=new WeakMap}setValue(e){this.update({value:e})}setGetter(e){this.update({get:e})}getComputed(){const e=_e()||Ae;if(this.valueSignal||this.getterSignal||this.update({}),!this.computedsByScope.has(e)){const t=()=>{const e=this.getterSignal?.value;return e?e.call(this.owner):this.valueSignal?.value};ie(We(this.owner)),this.computedsByScope.set(e,J(be(t))),se()}return this.computedsByScope.get(e)}update({get:e,value:t}){this.valueSignal?t===this.valueSignal.peek()&&e===this.getterSignal.peek()||j((()=>{this.valueSignal.value=t,this.getterSignal.value=e})):(this.valueSignal=I(t),this.getterSignal=I(e))}}const De=new Set(Object.getOwnPropertyNames(Symbol).map((e=>Symbol[e])).filter((e=>"symbol"==typeof e))),Re=new WeakMap,Ie=(e,t)=>Re.has(e)&&Re.get(e).has(t),Ve=new WeakSet,Be=(e,t,n)=>{Re.has(e)||Re.set(e,new Map),t="number"==typeof t?`${t}`:t;const r=Re.get(e);if(!r.has(t)){const o=We(e),i=new Le(e);if(r.set(t,i),n){const{get:t,value:r}=n;if(t)i.setGetter(t);else{const t=Ve.has(e);i.setValue(Fe(r)?Ke(o,r,{readOnly:t}):r)}}}return r.get(t)},ze=new WeakMap;let qe=!1;const Je={get(e,t,n){if(qe||!e.hasOwnProperty(t)&&t in e||"symbol"==typeof t&&De.has(t))return Reflect.get(e,t,n);const r=Object.getOwnPropertyDescriptor(e,t),o=Be(n,t,r).getComputed().value;if("function"==typeof o){const e=We(n);return(...t)=>{ie(e);try{return o.call(n,...t)}finally{se()}}}return o},set(e,t,n,r){if(Ve.has(r))return!1;ie(We(r));try{return Reflect.set(e,t,n,r)}finally{se()}},defineProperty(e,t,n){if(Ve.has(Ue(e)))return!1;const r=!(t in e),o=Reflect.defineProperty(e,t,n);if(o){const o=Ue(e),i=Be(o,t),{get:s,value:u}=n;if(s)i.setGetter(s);else{const e=We(o);i.setValue(Fe(u)?Ke(e,u):u)}if(r&&ze.has(e)&&ze.get(e).value++,Array.isArray(e)&&Re.get(o)?.has("length")){Be(o,"length").setValue(e.length)}}return o},deleteProperty(e,t){if(Ve.has(Ue(e)))return!1;const n=Reflect.deleteProperty(e,t);if(n){Be(Ue(e),t).setValue(void 0),ze.has(e)&&ze.get(e).value++}return n},ownKeys:e=>(ze.has(e)||ze.set(e,I(0)),ze._=ze.get(e).value,Reflect.ownKeys(e))},Ke=(e,t,n)=>{const r=He(e,t,Je);return n?.readOnly&&Ve.add(r),r},Ge=(e,t,n=!0)=>{if(Te(e)&&Te(t)){let r=!1;for(const o in t){const i=!(o in e);r=r||i;const s=Object.getOwnPropertyDescriptor(t,o);if("function"==typeof s?.get||"function"==typeof s?.set){if(n||i){Object.defineProperty(e,o,{...s,configurable:!0,enumerable:!0});const t=Ue(e);if(s?.get&&t&&Ie(t,o)){Be(t,o).setGetter(s.get)}}}else if(Te(t[o]))i&&(e[o]={}),Ge(e[o],t[o],n);else if(n||i){Object.defineProperty(e,o,s);const t=Ue(e);if(s?.value&&t&&Ie(t,o)){Be(t,o).setValue(s.value)}}}r&&ze.has(e)&&ze.get(e).value++}},Xe=(e,t,n=!0)=>j((()=>{return Ge((r=e,Me.get(r)||e),t,n);var r})),Qe=new WeakSet,Ye={get:(e,t,n)=>{const r=Reflect.get(e,t),o=We(n);if(void 0===r&&Qe.has(n)){const n={};return Reflect.set(e,t,n),Ze(o,n,!1)}if("function"==typeof r){ie(o);const e=be(r);return se(),e}return Te(r)&&Fe(r)?Ze(o,r,!1):r}},Ze=(e,t,n=!0)=>{const r=He(e,t,Ye);return r&&n&&Qe.add(r),r},et=new WeakMap,tt=new WeakMap,nt=new WeakSet,rt=Reflect.getOwnPropertyDescriptor,ot={get:(e,t)=>{const n=tt.get(e),r=e[t];return t in e?r:n[t]},set:(e,t,n)=>{const r=tt.get(e);return(t in e||!(t in r)?e:r)[t]=n,!0},ownKeys:e=>[...new Set([...Object.keys(tt.get(e)),...Object.keys(e)])],getOwnPropertyDescriptor:(e,t)=>rt(e,t)||rt(tt.get(e),t)},it=(e,t={})=>{if(nt.has(e))throw Error("This object cannot be proxified.");if(tt.set(e,t),!et.has(e)){const t=new Proxy(e,ot);et.set(e,t),nt.add(t)}return et.get(e)},st=new Map,ut=new Map,_t=new Map,lt=new Map,ct=new Map,at=e=>lt.get(e||oe())||{},ft=e=>{const t=e||oe();return ct.has(t)||ct.set(t,Ke(t,{},{readOnly:!0})),ct.get(t)},pt="I acknowledge that using a private store means my plugin will inevitably break on the next store release.";function ht(e,{state:t={},...n}={},{lock:r=!1}={}){if(st.has(e)){if(r===pt||_t.has(e)){const t=_t.get(e);if(!(r===pt||!0!==r&&r===t))throw t?Error("Cannot unlock a private store with an invalid lock code"):Error("Cannot lock a public store")}else _t.set(e,r);const o=ut.get(e);Xe(o,n),Xe(o.state,t)}else{r!==pt&&_t.set(e,r);const o={state:Ke(e,Te(t)?t:{}),...n},i=Ze(e,o);ut.set(e,o),st.set(e,i)}return st.get(e)}const dt=(e=document)=>{var t;const n=null!==(t=e.getElementById("wp-script-module-data-@wordpress/interactivity"))&&void 0!==t?t:e.getElementById("wp-interactivity-data");if(n?.textContent)try{return JSON.parse(n.textContent)}catch{}return{}},vt=e=>{Te(e?.state)&&Object.entries(e.state).forEach((([e,t])=>{const n=ht(e,{},{lock:pt});Xe(n.state,t,!1),Xe(ft(e),t)})),Te(e?.config)&&Object.entries(e.config).forEach((([e,t])=>{lt.set(e,t)}))},yt=dt();vt(yt);const gt=(0,s.q6)({client:{},server:{}}),mt={},wt={},bt=(e,t,{priority:n=10}={})=>{mt[e]=t,wt[e]=n},xt=({scope:e})=>(t,...n)=>{let{value:r,namespace:o}=t;if("string"!=typeof r)throw new Error("The `value` prop should be a string path");const i="!"===r[0]&&!!(r=r.slice(1));le(e);const s=((e,t)=>{if(!t)return void Oe();let n=st.get(t);void 0===n&&(n=ht(t,void 0,{lock:pt}));const r={...n,context:_e().context[t]};try{return e.split(".").reduce(((e,t)=>e[t]),r)}catch(e){}})(r,o),u="function"==typeof s?s(...n):s;return ce(),i?!u:u},St=({directives:e,priorityLevels:[t,...n],element:r,originalProps:o,previousScope:i})=>{const u=w({}).current;u.evaluate=x(xt({scope:u}),[]);const{client:_,server:l}=S(gt);u.context=_,u.serverContext=l,u.ref=i?.ref||w(null),r=(0,s.Ob)(r,{ref:u.ref}),u.attributes=r.props;const c=n.length>0?(0,s.h)(St,{directives:e,priorityLevels:n,element:r,originalProps:o,previousScope:u}):r,a={...o,children:c},f={directives:e,props:a,element:r,context:gt,evaluate:u.evaluate};le(u);for(const e of t){const t=mt[e]?.(f);void 0!==t&&(a.children=t)}return ce(),a.children},kt=s.fF.vnode;function Et(e){return Te(e)?Object.fromEntries(Object.entries(e).map((([e,t])=>[e,Et(t)]))):Array.isArray(e)?e.map((e=>Et(e))):e}s.fF.vnode=e=>{if(e.props.__directives){const t=e.props,n=t.__directives;n.key&&(e.key=n.key.find((({suffix:e})=>"default"===e)).value),delete t.__directives;const r=(e=>{const t=Object.keys(e).reduce(((e,t)=>{if(mt[t]){const n=wt[t];(e[n]=e[n]||[]).push(t)}return e}),{});return Object.entries(t).sort((([e],[t])=>parseInt(e)-parseInt(t))).map((([,e])=>e))})(n);r.length>0&&(e.props={directives:n,priorityLevels:r,originalProps:t,type:e.type,element:(0,s.h)(e.type,t),top:!0},e.type=St)}kt&&kt(e)};const Pt=/(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g,Ct=/\/\*[^]*?\*\/| +/g,Ot=/\n+/g,Tt=e=>({directives:t,evaluate:n})=>{t[`on-${e}`].filter((({suffix:e})=>"default"!==e)).forEach((t=>{const r=t.suffix.split("--",1)[0];Se((()=>{const o=e=>n(t,e),i="window"===e?window:document;return i.addEventListener(r,o),()=>i.removeEventListener(r,o)}))}))},$t=e=>({directives:t,evaluate:n})=>{t[`on-async-${e}`].filter((({suffix:e})=>"default"!==e)).forEach((t=>{const r=t.suffix.split("--",1)[0];Se((()=>{const o=async e=>{await me(),n(t,e)},i="window"===e?window:document;return i.addEventListener(r,o,{passive:!0}),()=>i.removeEventListener(r,o)}))}))},Mt="wp",Nt=`data-${Mt}-ignore`,jt=`data-${Mt}-interactive`,Ht=`data-${Mt}-`,Ut=[],Wt=new RegExp(`^data-${Mt}-([a-z0-9]+(?:-[a-z0-9]+)*)(?:--([a-z0-9_-]+))?$`,"i"),Ft=/^([\w_\/-]+)::(.+)$/,At=new WeakSet;function Lt(e){const t=document.createTreeWalker(e,205);return function e(n){const{nodeType:r}=n;if(3===r)return[n.data];if(4===r){var o;const e=t.nextSibling();return n.replaceWith(new window.Text(null!==(o=n.nodeValue)&&void 0!==o?o:"")),[n.nodeValue,e]}if(8===r||7===r){const e=t.nextSibling();return n.remove(),[null,e]}const i=n,{attributes:u}=i,_=i.localName,l={},c=[],a=[];let f=!1,p=!1;for(let e=0;e{const o=Wt.exec(t);if(null===o)return Oe(),e;const i=o[1]||"",s=o[2]||"default";var u;return e[i]=e[i]||[],e[i].push({namespace:null!=n?n:null!==(u=Ut[Ut.length-1])&&void 0!==u?u:null,value:r,suffix:s}),e}),{})),"template"===_)l.content=[...i.content.childNodes].map((e=>Lt(e)));else{let n=t.firstChild();if(n){for(;n;){const[r,o]=e(n);r&&c.push(r),n=o||t.nextSibling()}t.parentNode()}}return p&&Ut.pop(),[(0,s.h)(_,l,c)]}(t.currentNode)}const Dt=new WeakMap,Rt=e=>{if(!e.parentElement)throw Error("The passed region should be an element with a parent.");return Dt.has(e)||Dt.set(e,((e,t)=>{const n=(t=[].concat(t))[t.length-1].nextSibling;function r(t,r){e.insertBefore(t,r||n)}return e.__k={nodeType:1,parentNode:e,firstChild:t[0],childNodes:t,insertBefore:r,appendChild:r,removeChild(t){e.removeChild(t)}}})(e.parentElement,e)),Dt.get(e)},It=new WeakMap,Vt=e=>{if("I acknowledge that using private APIs means my theme or plugin will inevitably break in the next version of WordPress."===e)return{directivePrefix:Mt,getRegionRootFragment:Rt,initialVdom:It,toVdom:Lt,directive:bt,getNamespace:oe,h:s.h,cloneElement:s.Ob,render:s.XX,proxifyState:Ke,parseServerData:dt,populateServerData:vt,batch:j};throw new Error("Forbidden access.")};bt("context",(({directives:{context:e},props:{children:t},context:n})=>{const{Provider:r}=n,o=e.find((({suffix:e})=>"default"===e)),{client:i,server:u}=S(n),_=o.namespace,l=w(Ke(_,{})),c=w(Ke(_,{},{readOnly:!0})),a=b((()=>{const e={client:{...i},server:{...u}};if(o){const{namespace:t,value:n}=o;Te(n)||Oe(),Xe(l.current,Et(n),!1),Xe(c.current,Et(n)),e.client[t]=it(l.current,i[t]),e.server[t]=it(c.current,u[t])}return e}),[o,i,u]);return(0,s.h)(r,{value:a},t)}),{priority:5}),bt("watch",(({directives:{watch:e},evaluate:t})=>{e.forEach((e=>{xe((()=>t(e)))}))})),bt("init",(({directives:{init:e},evaluate:t})=>{e.forEach((e=>{Se((()=>t(e)))}))})),bt("on",(({directives:{on:e},element:t,evaluate:n})=>{const r=new Map;e.filter((({suffix:e})=>"default"!==e)).forEach((e=>{const t=e.suffix.split("--")[0];r.has(t)||r.set(t,new Set),r.get(t).add(e)})),r.forEach(((e,r)=>{const o=t.props[`on${r}`];t.props[`on${r}`]=t=>{e.forEach((e=>{o&&o(t),n(e,t)}))}}))})),bt("on-async",(({directives:{"on-async":e},element:t,evaluate:n})=>{const r=new Map;e.filter((({suffix:e})=>"default"!==e)).forEach((e=>{const t=e.suffix.split("--")[0];r.has(t)||r.set(t,new Set),r.get(t).add(e)})),r.forEach(((e,r)=>{const o=t.props[`on${r}`];t.props[`on${r}`]=t=>{o&&o(t),e.forEach((async e=>{await me(),n(e,t)}))}}))})),bt("on-window",Tt("window")),bt("on-document",Tt("document")),bt("on-async-window",$t("window")),bt("on-async-document",$t("document")),bt("class",(({directives:{class:e},element:t,evaluate:n})=>{e.filter((({suffix:e})=>"default"!==e)).forEach((e=>{const r=e.suffix,o=n(e),i=t.props.class||"",s=new RegExp(`(^|\\s)${r}(\\s|$)`,"g");o?s.test(i)||(t.props.class=i?`${i} ${r}`:r):t.props.class=i.replace(s," ").trim(),Se((()=>{o?t.ref.current.classList.add(r):t.ref.current.classList.remove(r)}))}))})),bt("style",(({directives:{style:e},element:t,evaluate:n})=>{e.filter((({suffix:e})=>"default"!==e)).forEach((e=>{const r=e.suffix,o=n(e);t.props.style=t.props.style||{},"string"==typeof t.props.style&&(t.props.style=(e=>{const t=[{}];let n,r;for(;n=Pt.exec(e.replace(Ct,""));)n[4]?t.shift():n[3]?(r=n[3].replace(Ot," ").trim(),t.unshift(t[0][r]=t[0][r]||{})):t[0][n[1]]=n[2].replace(Ot," ").trim();return t[0]})(t.props.style)),o?t.props.style[r]=o:delete t.props.style[r],Se((()=>{o?t.ref.current.style[r]=o:t.ref.current.style.removeProperty(r)}))}))})),bt("bind",(({directives:{bind:e},element:t,evaluate:n})=>{e.filter((({suffix:e})=>"default"!==e)).forEach((e=>{const r=e.suffix,o=n(e);t.props[r]=o,Se((()=>{const e=t.ref.current;if("style"!==r){if("width"!==r&&"height"!==r&&"href"!==r&&"list"!==r&&"form"!==r&&"tabIndex"!==r&&"download"!==r&&"rowSpan"!==r&&"colSpan"!==r&&"role"!==r&&r in e)try{return void(e[r]=null==o?"":o)}catch(e){}null==o||!1===o&&"-"!==r[4]?e.removeAttribute(r):e.setAttribute(r,o)}else"string"==typeof o&&(e.style.cssText=o)}))}))})),bt("ignore",(({element:{type:e,props:{innerHTML:t,...n}}})=>{const r=b((()=>t),[]);return(0,s.h)(e,{dangerouslySetInnerHTML:{__html:r},...n})})),bt("text",(({directives:{text:e},element:t,evaluate:n})=>{const r=e.find((({suffix:e})=>"default"===e));if(r)try{const e=n(r);t.props.children="object"==typeof e?null:e.toString()}catch(e){t.props.children=null}else t.props.children=null})),bt("run",(({directives:{run:e},evaluate:t})=>{e.forEach((e=>t(e)))})),bt("each",(({directives:{each:e,"each-key":t},context:n,element:r,evaluate:o})=>{if("template"!==r.type)return;const{Provider:i}=n,u=S(n),[_]=e,{namespace:l,suffix:c}=_;return o(_).map((e=>{const n="default"===c?"item":c.replace(/^-+|-+$/g,"").toLowerCase().replace(/-([a-z])/g,(function(e,t){return t.toUpperCase()})),o=it(Ke(l,{}),u.client[l]),_={client:{...u.client,[l]:o},server:{...u.server}};_.client[l][n]=e;const a={..._e(),context:_.client,serverContext:_.server},f=t?xt({scope:a})(t[0]):e;return(0,s.h)(i,{value:_,key:f},r.props.content)}))}),{priority:20}),bt("each-child",(()=>null),{priority:1}),(async()=>{const e=document.querySelectorAll(`[data-${Mt}-interactive]`);for(const t of e)if(!At.has(t)){await me();const e=Rt(t),n=Lt(t);It.set(t,n),await me(),(0,s.Qv)(n,e)}})()})();var o=r.zj,i=r.SD,s=r.V6,u=r.$K,_=r.vT,l=r.jb,c=r.yT,a=r.M_,f=r.hb,p=r.vJ,h=r.ip,d=r.Nf,v=r.Kr,y=r.li,g=r.J0,m=r.FH,w=r.v4;export{o as getConfig,i as getContext,s as getElement,u as getServerContext,_ as getServerState,l as privateApis,c as splitTask,a as store,f as useCallback,p as useEffect,h as useInit,d as useLayoutEffect,v as useMemo,y as useRef,g as useState,m as useWatch,w as withScope}; \ No newline at end of file diff --git a/wp-includes/script-modules.php b/wp-includes/script-modules.php index c873e5d8359..80831f1a54a 100644 --- a/wp-includes/script-modules.php +++ b/wp-includes/script-modules.php @@ -123,3 +123,53 @@ function wp_dequeue_script_module( string $id ) { function wp_deregister_script_module( string $id ) { wp_script_modules()->deregister( $id ); } + +/** + * Registers all the default WordPress Script Modules. + * + * @since 6.7.0 + */ +function wp_default_script_modules() { + $suffix = defined( 'WP_RUN_CORE_TESTS' ) ? '.min' : wp_scripts_get_suffix(); + + /* + * Expects multidimensional array like: + * + * 'interactivity/index.min.js' => array('dependencies' => array(…), 'version' => '…'), + * 'interactivity/debug.min.js' => array('dependencies' => array(…), 'version' => '…'), + * 'interactivity-router/index.min.js' => … + */ + $assets = include ABSPATH . WPINC . "/assets/script-modules-packages{$suffix}.php"; + + foreach ( $assets as $file_name => $script_module_data ) { + /* + * Build the WordPress Script Module ID from the file name. + * Prepend `@wordpress/` and remove extensions and `/index` if present: + * - interactivity/index.min.js => @wordpress/interactivity + * - interactivity/debug.min.js => @wordpress/interactivity/debug + * - block-library/query/view.js => @wordpress/block-library/query/view + */ + $script_module_id = '@wordpress/' . preg_replace( '~(?:/index)?(?:\.min)?\.js$~D', '', $file_name, 1 ); + + switch ( $script_module_id ) { + /* + * Interactivity exposes two entrypoints, "/index" and "/debug". + * "/debug" should replalce "/index" in devlopment. + */ + case '@wordpress/interactivity/debug': + if ( ! SCRIPT_DEBUG ) { + continue 2; + } + $script_module_id = '@wordpress/interactivity'; + break; + case '@wordpress/interactivity': + if ( SCRIPT_DEBUG ) { + continue 2; + } + break; + } + + $path = "/wp-includes/js/dist/script-modules/{$file_name}"; + wp_register_script_module( $script_module_id, $path, $script_module_data['dependencies'], $script_module_data['version'] ); + } +} diff --git a/wp-includes/version.php b/wp-includes/version.php index 2ff56a46c60..d25d85cd917 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -16,7 +16,7 @@ * * @global string $wp_version */ -$wp_version = '6.7-alpha-59082'; +$wp_version = '6.7-alpha-59083'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.