Edit File by line

Deprecated: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in /home/sportsfever/public_html/filemanger/function.php on line 93

Warning: Undefined array key "page_file_edit_line" in /home/sportsfever/public_html/filemanger/edit_text_line.php on line 32
/home/sportsfe.../httpdocs/clone/wp-inclu.../js/dist
File: compose.js
return timerId !== undefined;
[3000] Fix | Delete
}
[3001] Fix | Delete
function debounced(...args) {
[3002] Fix | Delete
const time = Date.now();
[3003] Fix | Delete
const isInvoking = shouldInvoke(time);
[3004] Fix | Delete
lastArgs = args;
[3005] Fix | Delete
lastThis = this;
[3006] Fix | Delete
lastCallTime = time;
[3007] Fix | Delete
if (isInvoking) {
[3008] Fix | Delete
if (!pending()) {
[3009] Fix | Delete
return leadingEdge(lastCallTime);
[3010] Fix | Delete
}
[3011] Fix | Delete
if (maxing) {
[3012] Fix | Delete
// Handle invocations in a tight loop.
[3013] Fix | Delete
startTimer(timerExpired, wait);
[3014] Fix | Delete
return invokeFunc(lastCallTime);
[3015] Fix | Delete
}
[3016] Fix | Delete
}
[3017] Fix | Delete
if (!pending()) {
[3018] Fix | Delete
startTimer(timerExpired, wait);
[3019] Fix | Delete
}
[3020] Fix | Delete
return result;
[3021] Fix | Delete
}
[3022] Fix | Delete
debounced.cancel = cancel;
[3023] Fix | Delete
debounced.flush = flush;
[3024] Fix | Delete
debounced.pending = pending;
[3025] Fix | Delete
return debounced;
[3026] Fix | Delete
};
[3027] Fix | Delete
[3028] Fix | Delete
;// CONCATENATED MODULE: ./node_modules/@wordpress/compose/build-module/utils/throttle/index.js
[3029] Fix | Delete
/**
[3030] Fix | Delete
* Parts of this source were derived and modified from lodash,
[3031] Fix | Delete
* released under the MIT license.
[3032] Fix | Delete
*
[3033] Fix | Delete
* https://github.com/lodash/lodash
[3034] Fix | Delete
*
[3035] Fix | Delete
* Copyright JS Foundation and other contributors <https://js.foundation/>
[3036] Fix | Delete
*
[3037] Fix | Delete
* Based on Underscore.js, copyright Jeremy Ashkenas,
[3038] Fix | Delete
* DocumentCloud and Investigative Reporters & Editors <http://underscorejs.org/>
[3039] Fix | Delete
*
[3040] Fix | Delete
* This software consists of voluntary contributions made by many
[3041] Fix | Delete
* individuals. For exact contribution history, see the revision history
[3042] Fix | Delete
* available at https://github.com/lodash/lodash
[3043] Fix | Delete
*
[3044] Fix | Delete
* The following license applies to all parts of this software except as
[3045] Fix | Delete
* documented below:
[3046] Fix | Delete
*
[3047] Fix | Delete
* ====
[3048] Fix | Delete
*
[3049] Fix | Delete
* Permission is hereby granted, free of charge, to any person obtaining
[3050] Fix | Delete
* a copy of this software and associated documentation files (the
[3051] Fix | Delete
* "Software"), to deal in the Software without restriction, including
[3052] Fix | Delete
* without limitation the rights to use, copy, modify, merge, publish,
[3053] Fix | Delete
* distribute, sublicense, and/or sell copies of the Software, and to
[3054] Fix | Delete
* permit persons to whom the Software is furnished to do so, subject to
[3055] Fix | Delete
* the following conditions:
[3056] Fix | Delete
*
[3057] Fix | Delete
* The above copyright notice and this permission notice shall be
[3058] Fix | Delete
* included in all copies or substantial portions of the Software.
[3059] Fix | Delete
*
[3060] Fix | Delete
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
[3061] Fix | Delete
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
[3062] Fix | Delete
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
[3063] Fix | Delete
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
[3064] Fix | Delete
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
[3065] Fix | Delete
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
[3066] Fix | Delete
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
[3067] Fix | Delete
*/
[3068] Fix | Delete
[3069] Fix | Delete
/**
[3070] Fix | Delete
* Internal dependencies
[3071] Fix | Delete
*/
[3072] Fix | Delete
[3073] Fix | Delete
/**
[3074] Fix | Delete
* A simplified and properly typed version of lodash's `throttle`, that
[3075] Fix | Delete
* always uses timers instead of sometimes using rAF.
[3076] Fix | Delete
*
[3077] Fix | Delete
* Creates a throttled function that only invokes `func` at most once per
[3078] Fix | Delete
* every `wait` milliseconds. The throttled function comes with a `cancel`
[3079] Fix | Delete
* method to cancel delayed `func` invocations and a `flush` method to
[3080] Fix | Delete
* immediately invoke them. Provide `options` to indicate whether `func`
[3081] Fix | Delete
* should be invoked on the leading and/or trailing edge of the `wait`
[3082] Fix | Delete
* timeout. The `func` is invoked with the last arguments provided to the
[3083] Fix | Delete
* throttled function. Subsequent calls to the throttled function return
[3084] Fix | Delete
* the result of the last `func` invocation.
[3085] Fix | Delete
*
[3086] Fix | Delete
* **Note:** If `leading` and `trailing` options are `true`, `func` is
[3087] Fix | Delete
* invoked on the trailing edge of the timeout only if the throttled function
[3088] Fix | Delete
* is invoked more than once during the `wait` timeout.
[3089] Fix | Delete
*
[3090] Fix | Delete
* If `wait` is `0` and `leading` is `false`, `func` invocation is deferred
[3091] Fix | Delete
* until the next tick, similar to `setTimeout` with a timeout of `0`.
[3092] Fix | Delete
*
[3093] Fix | Delete
* @param {Function} func The function to throttle.
[3094] Fix | Delete
* @param {number} wait The number of milliseconds to throttle invocations to.
[3095] Fix | Delete
* @param {Partial< ThrottleOptions >} options The options object.
[3096] Fix | Delete
* @param {boolean} options.leading Specify invoking on the leading edge of the timeout.
[3097] Fix | Delete
* @param {boolean} options.trailing Specify invoking on the trailing edge of the timeout.
[3098] Fix | Delete
* @return Returns the new throttled function.
[3099] Fix | Delete
*/
[3100] Fix | Delete
const throttle = (func, wait, options) => {
[3101] Fix | Delete
let leading = true;
[3102] Fix | Delete
let trailing = true;
[3103] Fix | Delete
if (options) {
[3104] Fix | Delete
leading = 'leading' in options ? !!options.leading : leading;
[3105] Fix | Delete
trailing = 'trailing' in options ? !!options.trailing : trailing;
[3106] Fix | Delete
}
[3107] Fix | Delete
return debounce(func, wait, {
[3108] Fix | Delete
leading,
[3109] Fix | Delete
trailing,
[3110] Fix | Delete
maxWait: wait
[3111] Fix | Delete
});
[3112] Fix | Delete
};
[3113] Fix | Delete
[3114] Fix | Delete
;// CONCATENATED MODULE: ./node_modules/@wordpress/compose/build-module/utils/observable-map/index.js
[3115] Fix | Delete
/**
[3116] Fix | Delete
* A constructor (factory) for `ObservableMap`, a map-like key/value data structure
[3117] Fix | Delete
* where the individual entries are observable: using the `subscribe` method, you can
[3118] Fix | Delete
* subscribe to updates for a particular keys. Each subscriber always observes one
[3119] Fix | Delete
* specific key and is not notified about any unrelated changes (for different keys)
[3120] Fix | Delete
* in the `ObservableMap`.
[3121] Fix | Delete
*
[3122] Fix | Delete
* @template K The type of the keys in the map.
[3123] Fix | Delete
* @template V The type of the values in the map.
[3124] Fix | Delete
* @return A new instance of the `ObservableMap` type.
[3125] Fix | Delete
*/
[3126] Fix | Delete
function observableMap() {
[3127] Fix | Delete
const map = new Map();
[3128] Fix | Delete
const listeners = new Map();
[3129] Fix | Delete
function callListeners(name) {
[3130] Fix | Delete
const list = listeners.get(name);
[3131] Fix | Delete
if (!list) {
[3132] Fix | Delete
return;
[3133] Fix | Delete
}
[3134] Fix | Delete
for (const listener of list) {
[3135] Fix | Delete
listener();
[3136] Fix | Delete
}
[3137] Fix | Delete
}
[3138] Fix | Delete
return {
[3139] Fix | Delete
get(name) {
[3140] Fix | Delete
return map.get(name);
[3141] Fix | Delete
},
[3142] Fix | Delete
set(name, value) {
[3143] Fix | Delete
map.set(name, value);
[3144] Fix | Delete
callListeners(name);
[3145] Fix | Delete
},
[3146] Fix | Delete
delete(name) {
[3147] Fix | Delete
map.delete(name);
[3148] Fix | Delete
callListeners(name);
[3149] Fix | Delete
},
[3150] Fix | Delete
subscribe(name, listener) {
[3151] Fix | Delete
let list = listeners.get(name);
[3152] Fix | Delete
if (!list) {
[3153] Fix | Delete
list = new Set();
[3154] Fix | Delete
listeners.set(name, list);
[3155] Fix | Delete
}
[3156] Fix | Delete
list.add(listener);
[3157] Fix | Delete
return () => {
[3158] Fix | Delete
list.delete(listener);
[3159] Fix | Delete
if (list.size === 0) {
[3160] Fix | Delete
listeners.delete(name);
[3161] Fix | Delete
}
[3162] Fix | Delete
};
[3163] Fix | Delete
}
[3164] Fix | Delete
};
[3165] Fix | Delete
}
[3166] Fix | Delete
[3167] Fix | Delete
;// CONCATENATED MODULE: ./node_modules/@wordpress/compose/build-module/higher-order/pipe.js
[3168] Fix | Delete
/**
[3169] Fix | Delete
* Parts of this source were derived and modified from lodash,
[3170] Fix | Delete
* released under the MIT license.
[3171] Fix | Delete
*
[3172] Fix | Delete
* https://github.com/lodash/lodash
[3173] Fix | Delete
*
[3174] Fix | Delete
* Copyright JS Foundation and other contributors <https://js.foundation/>
[3175] Fix | Delete
*
[3176] Fix | Delete
* Based on Underscore.js, copyright Jeremy Ashkenas,
[3177] Fix | Delete
* DocumentCloud and Investigative Reporters & Editors <http://underscorejs.org/>
[3178] Fix | Delete
*
[3179] Fix | Delete
* This software consists of voluntary contributions made by many
[3180] Fix | Delete
* individuals. For exact contribution history, see the revision history
[3181] Fix | Delete
* available at https://github.com/lodash/lodash
[3182] Fix | Delete
*
[3183] Fix | Delete
* The following license applies to all parts of this software except as
[3184] Fix | Delete
* documented below:
[3185] Fix | Delete
*
[3186] Fix | Delete
* ====
[3187] Fix | Delete
*
[3188] Fix | Delete
* Permission is hereby granted, free of charge, to any person obtaining
[3189] Fix | Delete
* a copy of this software and associated documentation files (the
[3190] Fix | Delete
* "Software"), to deal in the Software without restriction, including
[3191] Fix | Delete
* without limitation the rights to use, copy, modify, merge, publish,
[3192] Fix | Delete
* distribute, sublicense, and/or sell copies of the Software, and to
[3193] Fix | Delete
* permit persons to whom the Software is furnished to do so, subject to
[3194] Fix | Delete
* the following conditions:
[3195] Fix | Delete
*
[3196] Fix | Delete
* The above copyright notice and this permission notice shall be
[3197] Fix | Delete
* included in all copies or substantial portions of the Software.
[3198] Fix | Delete
*
[3199] Fix | Delete
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
[3200] Fix | Delete
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
[3201] Fix | Delete
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
[3202] Fix | Delete
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
[3203] Fix | Delete
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
[3204] Fix | Delete
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
[3205] Fix | Delete
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
[3206] Fix | Delete
*/
[3207] Fix | Delete
[3208] Fix | Delete
/**
[3209] Fix | Delete
* Creates a pipe function.
[3210] Fix | Delete
*
[3211] Fix | Delete
* Allows to choose whether to perform left-to-right or right-to-left composition.
[3212] Fix | Delete
*
[3213] Fix | Delete
* @see https://lodash.com/docs/4#flow
[3214] Fix | Delete
*
[3215] Fix | Delete
* @param {boolean} reverse True if right-to-left, false for left-to-right composition.
[3216] Fix | Delete
*/
[3217] Fix | Delete
const basePipe = (reverse = false) => (...funcs) => (...args) => {
[3218] Fix | Delete
const functions = funcs.flat();
[3219] Fix | Delete
if (reverse) {
[3220] Fix | Delete
functions.reverse();
[3221] Fix | Delete
}
[3222] Fix | Delete
return functions.reduce((prev, func) => [func(...prev)], args)[0];
[3223] Fix | Delete
};
[3224] Fix | Delete
[3225] Fix | Delete
/**
[3226] Fix | Delete
* Composes multiple higher-order components into a single higher-order component. Performs left-to-right function
[3227] Fix | Delete
* composition, where each successive invocation is supplied the return value of the previous.
[3228] Fix | Delete
*
[3229] Fix | Delete
* This is inspired by `lodash`'s `flow` function.
[3230] Fix | Delete
*
[3231] Fix | Delete
* @see https://lodash.com/docs/4#flow
[3232] Fix | Delete
*/
[3233] Fix | Delete
const pipe = basePipe();
[3234] Fix | Delete
[3235] Fix | Delete
/* harmony default export */ const higher_order_pipe = (pipe);
[3236] Fix | Delete
[3237] Fix | Delete
;// CONCATENATED MODULE: ./node_modules/@wordpress/compose/build-module/higher-order/compose.js
[3238] Fix | Delete
/**
[3239] Fix | Delete
* Internal dependencies
[3240] Fix | Delete
*/
[3241] Fix | Delete
[3242] Fix | Delete
[3243] Fix | Delete
/**
[3244] Fix | Delete
* Composes multiple higher-order components into a single higher-order component. Performs right-to-left function
[3245] Fix | Delete
* composition, where each successive invocation is supplied the return value of the previous.
[3246] Fix | Delete
*
[3247] Fix | Delete
* This is inspired by `lodash`'s `flowRight` function.
[3248] Fix | Delete
*
[3249] Fix | Delete
* @see https://lodash.com/docs/4#flow-right
[3250] Fix | Delete
*/
[3251] Fix | Delete
const compose = basePipe(true);
[3252] Fix | Delete
/* harmony default export */ const higher_order_compose = (compose);
[3253] Fix | Delete
[3254] Fix | Delete
;// CONCATENATED MODULE: external "ReactJSXRuntime"
[3255] Fix | Delete
const external_ReactJSXRuntime_namespaceObject = window["ReactJSXRuntime"];
[3256] Fix | Delete
;// CONCATENATED MODULE: ./node_modules/@wordpress/compose/build-module/higher-order/if-condition/index.js
[3257] Fix | Delete
/**
[3258] Fix | Delete
* External dependencies
[3259] Fix | Delete
*/
[3260] Fix | Delete
[3261] Fix | Delete
/**
[3262] Fix | Delete
* Internal dependencies
[3263] Fix | Delete
*/
[3264] Fix | Delete
[3265] Fix | Delete
[3266] Fix | Delete
/**
[3267] Fix | Delete
* Higher-order component creator, creating a new component which renders if
[3268] Fix | Delete
* the given condition is satisfied or with the given optional prop name.
[3269] Fix | Delete
*
[3270] Fix | Delete
* @example
[3271] Fix | Delete
* ```ts
[3272] Fix | Delete
* type Props = { foo: string };
[3273] Fix | Delete
* const Component = ( props: Props ) => <div>{ props.foo }</div>;
[3274] Fix | Delete
* const ConditionalComponent = ifCondition( ( props: Props ) => props.foo.length !== 0 )( Component );
[3275] Fix | Delete
* <ConditionalComponent foo="" />; // => null
[3276] Fix | Delete
* <ConditionalComponent foo="bar" />; // => <div>bar</div>;
[3277] Fix | Delete
* ```
[3278] Fix | Delete
*
[3279] Fix | Delete
* @param predicate Function to test condition.
[3280] Fix | Delete
*
[3281] Fix | Delete
* @return Higher-order component.
[3282] Fix | Delete
*/
[3283] Fix | Delete
[3284] Fix | Delete
function ifCondition(predicate) {
[3285] Fix | Delete
return createHigherOrderComponent(WrappedComponent => props => {
[3286] Fix | Delete
if (!predicate(props)) {
[3287] Fix | Delete
return null;
[3288] Fix | Delete
}
[3289] Fix | Delete
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(WrappedComponent, {
[3290] Fix | Delete
...props
[3291] Fix | Delete
});
[3292] Fix | Delete
}, 'ifCondition');
[3293] Fix | Delete
}
[3294] Fix | Delete
/* harmony default export */ const if_condition = (ifCondition);
[3295] Fix | Delete
[3296] Fix | Delete
// EXTERNAL MODULE: external ["wp","isShallowEqual"]
[3297] Fix | Delete
var external_wp_isShallowEqual_ = __webpack_require__(923);
[3298] Fix | Delete
var external_wp_isShallowEqual_default = /*#__PURE__*/__webpack_require__.n(external_wp_isShallowEqual_);
[3299] Fix | Delete
;// CONCATENATED MODULE: external ["wp","element"]
[3300] Fix | Delete
const external_wp_element_namespaceObject = window["wp"]["element"];
[3301] Fix | Delete
;// CONCATENATED MODULE: ./node_modules/@wordpress/compose/build-module/higher-order/pure/index.js
[3302] Fix | Delete
/**
[3303] Fix | Delete
* External dependencies
[3304] Fix | Delete
*/
[3305] Fix | Delete
[3306] Fix | Delete
/**
[3307] Fix | Delete
* WordPress dependencies
[3308] Fix | Delete
*/
[3309] Fix | Delete
[3310] Fix | Delete
[3311] Fix | Delete
[3312] Fix | Delete
/**
[3313] Fix | Delete
* Internal dependencies
[3314] Fix | Delete
*/
[3315] Fix | Delete
[3316] Fix | Delete
[3317] Fix | Delete
/**
[3318] Fix | Delete
* Given a component returns the enhanced component augmented with a component
[3319] Fix | Delete
* only re-rendering when its props/state change
[3320] Fix | Delete
*
[3321] Fix | Delete
* @deprecated Use `memo` or `PureComponent` instead.
[3322] Fix | Delete
*/
[3323] Fix | Delete
[3324] Fix | Delete
const pure = createHigherOrderComponent(function (WrappedComponent) {
[3325] Fix | Delete
if (WrappedComponent.prototype instanceof external_wp_element_namespaceObject.Component) {
[3326] Fix | Delete
return class extends WrappedComponent {
[3327] Fix | Delete
shouldComponentUpdate(nextProps, nextState) {
[3328] Fix | Delete
return !external_wp_isShallowEqual_default()(nextProps, this.props) || !external_wp_isShallowEqual_default()(nextState, this.state);
[3329] Fix | Delete
}
[3330] Fix | Delete
};
[3331] Fix | Delete
}
[3332] Fix | Delete
return class extends external_wp_element_namespaceObject.Component {
[3333] Fix | Delete
shouldComponentUpdate(nextProps) {
[3334] Fix | Delete
return !external_wp_isShallowEqual_default()(nextProps, this.props);
[3335] Fix | Delete
}
[3336] Fix | Delete
render() {
[3337] Fix | Delete
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(WrappedComponent, {
[3338] Fix | Delete
...this.props
[3339] Fix | Delete
});
[3340] Fix | Delete
}
[3341] Fix | Delete
};
[3342] Fix | Delete
}, 'pure');
[3343] Fix | Delete
/* harmony default export */ const higher_order_pure = (pure);
[3344] Fix | Delete
[3345] Fix | Delete
;// CONCATENATED MODULE: external ["wp","deprecated"]
[3346] Fix | Delete
const external_wp_deprecated_namespaceObject = window["wp"]["deprecated"];
[3347] Fix | Delete
var external_wp_deprecated_default = /*#__PURE__*/__webpack_require__.n(external_wp_deprecated_namespaceObject);
[3348] Fix | Delete
;// CONCATENATED MODULE: ./node_modules/@wordpress/compose/build-module/higher-order/with-global-events/listener.js
[3349] Fix | Delete
/**
[3350] Fix | Delete
* Class responsible for orchestrating event handling on the global window,
[3351] Fix | Delete
* binding a single event to be shared across all handling instances, and
[3352] Fix | Delete
* removing the handler when no instances are listening for the event.
[3353] Fix | Delete
*/
[3354] Fix | Delete
class Listener {
[3355] Fix | Delete
constructor() {
[3356] Fix | Delete
/** @type {any} */
[3357] Fix | Delete
this.listeners = {};
[3358] Fix | Delete
this.handleEvent = this.handleEvent.bind(this);
[3359] Fix | Delete
}
[3360] Fix | Delete
add( /** @type {any} */eventType, /** @type {any} */instance) {
[3361] Fix | Delete
if (!this.listeners[eventType]) {
[3362] Fix | Delete
// Adding first listener for this type, so bind event.
[3363] Fix | Delete
window.addEventListener(eventType, this.handleEvent);
[3364] Fix | Delete
this.listeners[eventType] = [];
[3365] Fix | Delete
}
[3366] Fix | Delete
this.listeners[eventType].push(instance);
[3367] Fix | Delete
}
[3368] Fix | Delete
remove( /** @type {any} */eventType, /** @type {any} */instance) {
[3369] Fix | Delete
if (!this.listeners[eventType]) {
[3370] Fix | Delete
return;
[3371] Fix | Delete
}
[3372] Fix | Delete
this.listeners[eventType] = this.listeners[eventType].filter(( /** @type {any} */listener) => listener !== instance);
[3373] Fix | Delete
if (!this.listeners[eventType].length) {
[3374] Fix | Delete
// Removing last listener for this type, so unbind event.
[3375] Fix | Delete
window.removeEventListener(eventType, this.handleEvent);
[3376] Fix | Delete
delete this.listeners[eventType];
[3377] Fix | Delete
}
[3378] Fix | Delete
}
[3379] Fix | Delete
handleEvent( /** @type {any} */event) {
[3380] Fix | Delete
this.listeners[event.type]?.forEach(( /** @type {any} */instance) => {
[3381] Fix | Delete
instance.handleEvent(event);
[3382] Fix | Delete
});
[3383] Fix | Delete
}
[3384] Fix | Delete
}
[3385] Fix | Delete
/* harmony default export */ const listener = (Listener);
[3386] Fix | Delete
[3387] Fix | Delete
;// CONCATENATED MODULE: ./node_modules/@wordpress/compose/build-module/higher-order/with-global-events/index.js
[3388] Fix | Delete
/**
[3389] Fix | Delete
* WordPress dependencies
[3390] Fix | Delete
*/
[3391] Fix | Delete
[3392] Fix | Delete
[3393] Fix | Delete
[3394] Fix | Delete
/**
[3395] Fix | Delete
* Internal dependencies
[3396] Fix | Delete
*/
[3397] Fix | Delete
[3398] Fix | Delete
[3399] Fix | Delete
[3400] Fix | Delete
/**
[3401] Fix | Delete
* Listener instance responsible for managing document event handling.
[3402] Fix | Delete
*/
[3403] Fix | Delete
[3404] Fix | Delete
const with_global_events_listener = new listener();
[3405] Fix | Delete
[3406] Fix | Delete
/* eslint-disable jsdoc/no-undefined-types */
[3407] Fix | Delete
/**
[3408] Fix | Delete
* Higher-order component creator which, given an object of DOM event types and
[3409] Fix | Delete
* values corresponding to a callback function name on the component, will
[3410] Fix | Delete
* create or update a window event handler to invoke the callback when an event
[3411] Fix | Delete
* occurs. On behalf of the consuming developer, the higher-order component
[3412] Fix | Delete
* manages unbinding when the component unmounts, and binding at most a single
[3413] Fix | Delete
* event handler for the entire application.
[3414] Fix | Delete
*
[3415] Fix | Delete
* @deprecated
[3416] Fix | Delete
*
[3417] Fix | Delete
* @param {Record<keyof GlobalEventHandlersEventMap, string>} eventTypesToHandlers Object with keys of DOM
[3418] Fix | Delete
* event type, the value a
[3419] Fix | Delete
* name of the function on
[3420] Fix | Delete
* the original component's
[3421] Fix | Delete
* instance which handles
[3422] Fix | Delete
* the event.
[3423] Fix | Delete
*
[3424] Fix | Delete
* @return {any} Higher-order component.
[3425] Fix | Delete
*/
[3426] Fix | Delete
function withGlobalEvents(eventTypesToHandlers) {
[3427] Fix | Delete
external_wp_deprecated_default()('wp.compose.withGlobalEvents', {
[3428] Fix | Delete
since: '5.7',
[3429] Fix | Delete
alternative: 'useEffect'
[3430] Fix | Delete
});
[3431] Fix | Delete
[3432] Fix | Delete
// @ts-ignore We don't need to fix the type-related issues because this is deprecated.
[3433] Fix | Delete
return createHigherOrderComponent(WrappedComponent => {
[3434] Fix | Delete
class Wrapper extends external_wp_element_namespaceObject.Component {
[3435] Fix | Delete
constructor( /** @type {any} */props) {
[3436] Fix | Delete
super(props);
[3437] Fix | Delete
this.handleEvent = this.handleEvent.bind(this);
[3438] Fix | Delete
this.handleRef = this.handleRef.bind(this);
[3439] Fix | Delete
}
[3440] Fix | Delete
componentDidMount() {
[3441] Fix | Delete
Object.keys(eventTypesToHandlers).forEach(eventType => {
[3442] Fix | Delete
with_global_events_listener.add(eventType, this);
[3443] Fix | Delete
});
[3444] Fix | Delete
}
[3445] Fix | Delete
componentWillUnmount() {
[3446] Fix | Delete
Object.keys(eventTypesToHandlers).forEach(eventType => {
[3447] Fix | Delete
with_global_events_listener.remove(eventType, this);
[3448] Fix | Delete
});
[3449] Fix | Delete
}
[3450] Fix | Delete
handleEvent( /** @type {any} */event) {
[3451] Fix | Delete
const handler = eventTypesToHandlers[( /** @type {keyof GlobalEventHandlersEventMap} */
[3452] Fix | Delete
event.type
[3453] Fix | Delete
[3454] Fix | Delete
/* eslint-enable jsdoc/no-undefined-types */)];
[3455] Fix | Delete
if (typeof this.wrappedRef[handler] === 'function') {
[3456] Fix | Delete
this.wrappedRef[handler](event);
[3457] Fix | Delete
}
[3458] Fix | Delete
}
[3459] Fix | Delete
handleRef( /** @type {any} */el) {
[3460] Fix | Delete
this.wrappedRef = el;
[3461] Fix | Delete
// Any component using `withGlobalEvents` that is not setting a `ref`
[3462] Fix | Delete
// will cause `this.props.forwardedRef` to be `null`, so we need this
[3463] Fix | Delete
// check.
[3464] Fix | Delete
if (this.props.forwardedRef) {
[3465] Fix | Delete
this.props.forwardedRef(el);
[3466] Fix | Delete
}
[3467] Fix | Delete
}
[3468] Fix | Delete
render() {
[3469] Fix | Delete
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(WrappedComponent, {
[3470] Fix | Delete
...this.props.ownProps,
[3471] Fix | Delete
ref: this.handleRef
[3472] Fix | Delete
});
[3473] Fix | Delete
}
[3474] Fix | Delete
}
[3475] Fix | Delete
return (0,external_wp_element_namespaceObject.forwardRef)((props, ref) => {
[3476] Fix | Delete
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Wrapper, {
[3477] Fix | Delete
ownProps: props,
[3478] Fix | Delete
forwardedRef: ref
[3479] Fix | Delete
});
[3480] Fix | Delete
});
[3481] Fix | Delete
}, 'withGlobalEvents');
[3482] Fix | Delete
}
[3483] Fix | Delete
[3484] Fix | Delete
;// CONCATENATED MODULE: ./node_modules/@wordpress/compose/build-module/hooks/use-instance-id/index.js
[3485] Fix | Delete
/**
[3486] Fix | Delete
* WordPress dependencies
[3487] Fix | Delete
*/
[3488] Fix | Delete
[3489] Fix | Delete
const instanceMap = new WeakMap();
[3490] Fix | Delete
[3491] Fix | Delete
/**
[3492] Fix | Delete
* Creates a new id for a given object.
[3493] Fix | Delete
*
[3494] Fix | Delete
* @param object Object reference to create an id for.
[3495] Fix | Delete
* @return The instance id (index).
[3496] Fix | Delete
*/
[3497] Fix | Delete
function createId(object) {
[3498] Fix | Delete
const instances = instanceMap.get(object) || 0;
[3499] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function