PluginProbe
Gutenberg / trunk
Gutenberg vtrunk
24.1.0 24.0.0 23.9.1 23.9.0 23.8.0 23.7.2 23.7.1 23.7.0 23.6.1 23.6.2 23.6.0 23.5.3 23.5.2 23.5.1 23.5.0 23.4.0 23.3.2 23.3.1 23.3.0 23.2.0 23.2.1 23.2.2 23.1.1 23.1.0 23.0.1 All 404 releases
← All changes | build/scripts/dom/index.min.js +4 -1 23.2.1 → trunk View file →
@@ -1,2 +1,5 @@
1 -"use strict";var wp;(wp||={}).dom=(()=>{var Dt=Object.create;var v=Object.defineProperty;var At=Object.getOwnPropertyDescriptor;var vt=Object.getOwnPropertyNames;var Ot=Object.getPrototypeOf,Lt=Object.prototype.hasOwnProperty;var Ht=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),B=(t,e)=>{for(var r in e)v(t,r,{get:e[r],enumerable:!0})},Z=(t,e,r,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of vt(e))!Lt.call(t,n)&&n!==r&&v(t,n,{get:()=>e[n],enumerable:!(o=At(e,n))||o.enumerable});return t};var Ft=(t,e,r)=>(r=t!=null?Dt(Ot(t)):{},Z(e||!t||!t.__esModule?v(r,"default",{value:t,enumerable:!0}):r,t)),Pt=t=>Z(v({},"__esModule",{value:!0}),t);var ut=Ht((Ye,lt)=>{lt.exports=window.wp.deprecated});var Qt={};B(Qt,{__unstableStripHTML:()=>Nt,computeCaretRect:()=>K,documentHasSelection:()=>et,documentHasTextSelection:()=>E,documentHasUncollapsedSelection:()=>tt,focus:()=>Kt,getFilesFromDataTransfer:()=>Jt,getOffsetParent:()=>rt,getPhrasingContentSchema:()=>Et,getRectangleFromRange:()=>h,getScrollContainer:()=>W,insertAfter:()=>y,isEmpty:()=>R,isEntirelySelected:()=>nt,isFormElement:()=>it,isHorizontalEdge:()=>ft,isNumberInput:()=>dt,isPhrasingContent:()=>A,isRTL:()=>T,isSelectionForward:()=>O,isTextContent:()=>Zt,isTextField:()=>C,isVerticalEdge:()=>mt,placeCaretAtHorizontalEdge:()=>pt,placeCaretAtVerticalEdge:()=>gt,remove:()=>g,removeInvalidHTML:()=>Tt,replace:()=>ht,replaceTag:()=>bt,safeHTML:()=>M,unwrap:()=>w,wrap:()=>xt});var z={};B(z,{find:()=>S});function Mt(t){return[t?'[tabindex]:not([tabindex^="-"])':"[tabindex]","a[href]","button:not([disabled])",'input:not([type="hidden"]):not([disabled])',"select:not([disabled])","textarea:not([disabled])",'iframe:not([tabindex^="-"])',"object","embed","summary","area[href]","[contenteditable]:not([contenteditable=false])"].join(",")}function $(t){return t.offsetWidth>0||t.offsetHeight>0||t.getClientRects().length>0}function Vt(t){let e=t.closest("map[name]");if(!e)return!1;let r=t.ownerDocument.querySelector('img[usemap="#'+e.name+'"]');return!!r&&$(r)}function S(t,{sequential:e=!1}={}){let r=t.querySelectorAll(Mt(e));return Array.from(r).filter(o=>{if(!$(o)||o.closest("[inert]"))return!1;let{nodeName:n}=o;return n==="AREA"?Vt(o):!0})}var k={};B(k,{find:()=>jt,findNext:()=>Wt,findPrevious:()=>kt,isTabbableIndex:()=>J});function U(t){let e=t.getAttribute("tabindex");return e===null?0:parseInt(e,10)}function J(t){return U(t)!==-1}function _t(){let t={};return function(r,o){let{nodeName:n,type:i,checked:a,name:s}=o;if(n!=="INPUT"||i!=="radio"||!s)return r.concat(o);let f=t.hasOwnProperty(s);if(!(a||!f))return r;if(f){let d=t[s];r=r.filter(l=>l!==d)}return t[s]=o,r.concat(o)}}function Bt(t,e){return{element:t,index:e}}function zt(t){return t.element}function Ut(t,e){let r=U(t.element),o=U(e.element);return r===o?t.index-e.index:r-o}function j(t){return t.filter(J).map(Bt).sort(Ut).map(zt).reduce(_t(),[])}function jt(t){return j(S(t))}function kt(t){return j(S(t.ownerDocument.body)).reverse().find(e=>t.compareDocumentPosition(e)&t.DOCUMENT_POSITION_PRECEDING)}function Wt(t){return j(S(t.ownerDocument.body)).find(e=>t.compareDocumentPosition(e)&t.DOCUMENT_POSITION_FOLLOWING)}function h(t){if(!t.collapsed){let i=Array.from(t.getClientRects());if(i.length===1)return i[0];let a=i.filter(({width:l})=>l>1);if(a.length===0)return t.getBoundingClientRect();if(a.length===1)return a[0];let{top:s,bottom:f,left:u,right:d}=a[0];for(let{top:l,bottom:c,left:m,right:N}of a)l<s&&(s=l),c>f&&(f=c),m<u&&(u=m),N>d&&(d=N);return new window.DOMRect(u,s,d-u,f-s)}let{startContainer:e}=t,{ownerDocument:r}=e;if(e.nodeName==="BR"){let{parentNode:i}=e;let a=Array.from(i.childNodes).indexOf(e);t=r.createRange(),t.setStart(i,a),t.setEnd(i,a)}let o=t.getClientRects();if(o.length>1)return null;let n=o[0];if(!n||n.height===0){let i=r.createTextNode("\u200B");t=t.cloneRange(),t.insertNode(i),n=t.getClientRects()[0],i.parentNode,i.parentNode.removeChild(i)}return n}function K(t){let e=t.getSelection();let r=e.rangeCount?e.getRangeAt(0):null;return r?h(r):null}function E(t){t.defaultView;let e=t.defaultView.getSelection();let r=e.rangeCount?e.getRangeAt(0):null;return!!r&&!r.collapsed}function b(t){return t?.nodeName==="INPUT"}function C(t){let e=["button","checkbox","hidden","file","radio","image","range","reset","submit","number","email","time"];return b(t)&&t.type&&!e.includes(t.type)||t.nodeName==="TEXTAREA"||t.contentEditable==="true"}function Q(t){if(!b(t)&&!C(t))return!1;try{let{selectionStart:e,selectionEnd:r}=t;return e===null||e!==r}catch{return!0}}function tt(t){return E(t)||!!t.activeElement&&Q(t.activeElement)}function et(t){return!!t.activeElement&&(b(t.activeElement)||C(t.activeElement)||E(t))}function p(t){return t.ownerDocument.defaultView,t.ownerDocument.defaultView.getComputedStyle(t)}function W(t,e="vertical"){if(t){if((e==="vertical"||e==="all")&&t.scrollHeight>t.clientHeight){let{overflowY:r}=p(t);if(/(auto|scroll)/.test(r))return t}if((e==="horizontal"||e==="all")&&t.scrollWidth>t.clientWidth){let{overflowX:r}=p(t);if(/(auto|scroll)/.test(r))return t}return t.ownerDocument===t.parentNode?t:W(t.parentNode,e)}}function rt(t){let e;for(;(e=t.parentNode)&&e.nodeType!==e.ELEMENT_NODE;);return e?p(e).position!=="static"?e:e.offsetParent:null}function x(t){return t.tagName==="INPUT"||t.tagName==="TEXTAREA"}var qt="\uFEFF";function nt(t){if(x(t))return t.selectionStart===0&&t.value.length===t.selectionEnd;if(!t.isContentEditable)return!0;let e=t.textContent||"";if(e===""||e===qt)return!0;let{ownerDocument:r}=t,{defaultView:o}=r;let n=o.getSelection();let i=n.rangeCount?n.getRangeAt(0):null;if(!i)return!0;let{startContainer:a,endContainer:s,startOffset:f,endOffset:u}=i;if(a===t&&s===t&&f===0&&u===t.childNodes.length)return!0;let d=t.lastChild;let l=s.nodeType===s.TEXT_NODE?s.data.length:s.childNodes.length;return ot(a,t,"firstChild")&&ot(s,t,"lastChild")&&f===0&&u===l}function ot(t,e,r){let o=e;do{if(t===o)return!0;for(o=o[r];o&&o.nodeType===o.TEXT_NODE&&o.nodeValue==="";)o=o[r==="lastChild"?"previousSibling":"nextSibling"]}while(o);return!1}function it(t){if(!t)return!1;let{tagName:e}=t;return x(t)||e==="BUTTON"||e==="SELECT"}function T(t){return p(t).direction==="rtl"}function at(t){let e=Array.from(t.getClientRects());if(!e.length)return;let r=Math.min(...e.map(({top:n})=>n));return Math.max(...e.map(({bottom:n})=>n))-r}function O(t){let{anchorNode:e,focusNode:r,anchorOffset:o,focusOffset:n}=t;let i=e.compareDocumentPosition(r);return i&e.DOCUMENT_POSITION_PRECEDING?!1:i&e.DOCUMENT_POSITION_FOLLOWING?!0:i===0?o<=n:!0}function st(t,e,r){if(t.caretPositionFromPoint){let o=t.caretPositionFromPoint(e,r);if(!o)return null;let n=t.createRange();return n.setStart(o.offsetNode,o.offset),n.collapse(!0),n}return t.caretRangeFromPoint?t.caretRangeFromPoint(e,r):null}function L(t,e,r,o){let n=o.style.zIndex,i=o.style.position,a=o.style.borderRadius,{position:s="static"}=p(o);s==="static"&&(o.style.position="relative"),o.style.zIndex="10000",o.style.borderRadius="0";let f=st(t,e,r);return o.style.zIndex=n,o.style.position=i,o.style.borderRadius=a,f}function H(t,e,r){let o=r();return(!o||!o.startContainer||!t.contains(o.startContainer))&&(t.scrollIntoView(e),o=r(),!o||!o.startContainer||!t.contains(o.startContainer))?null:o}function F(t,e,r=!1){if(x(t)&&typeof t.selectionStart=="number")return t.selectionStart!==t.selectionEnd?!1:e?t.selectionStart===0:t.value.length===t.selectionStart;if(!t.isContentEditable)return!0;let{ownerDocument:o}=t,{defaultView:n}=o;let i=n.getSelection();if(!i||!i.rangeCount)return!1;let a=i.getRangeAt(0),s=a.cloneRange(),f=O(i),u=i.isCollapsed;u||s.collapse(!f);let d=h(s),l=h(a);if(!d||!l)return!1;let c=at(a);if(!u&&c&&c>d.height&&f===e)return!1;let m=T(t)?!e:e,N=t.getBoundingClientRect(),yt=m?N.left+1:N.right-1,wt=e?N.top+1:N.bottom-1,q=H(t,e,()=>L(o,yt,wt,t));if(!q)return!1;let _=h(q);if(!_)return!1;let G=e?"top":"bottom",X=m?"left":"right",It=_[G]-l[G],St=_[X]-d[X],Y=Math.abs(It)<=1,Rt=Math.abs(St)<=1;return r?Y:Y&&Rt}function ft(t,e){return F(t,e)}var ct=Ft(ut(),1);function dt(t){return(0,ct.default)("wp.dom.isNumberInput",{since:"6.1",version:"6.5"}),b(t)&&t.type==="number"&&!isNaN(t.valueAsNumber)}function mt(t,e){return F(t,e,!0)}function Gt(t,e,r){let{ownerDocument:o}=t,n=T(t)?!e:e,i=t.getBoundingClientRect();r===void 0?r=e?i.right-1:i.left+1:r<=i.left?r=i.left+1:r>=i.right&&(r=i.right-1);let a=n?i.bottom-1:i.top+1;return L(o,r,a,t)}function P(t,e,r){if(!t)return;if(t.focus(),x(t)){if(typeof t.selectionStart!="number")return;e?(t.selectionStart=t.value.length,t.selectionEnd=t.value.length):(t.selectionStart=0,t.selectionEnd=0);return}if(!t.isContentEditable)return;let o=H(t,e,()=>Gt(t,e,r));if(!o)return;let{ownerDocument:n}=t,{defaultView:i}=n;let a=i.getSelection();a.removeAllRanges(),a.addRange(o)}function pt(t,e){return P(t,e,void 0)}function gt(t,e,r){return P(t,e,r?.left)}function y(t,e){e.parentNode,e.parentNode.insertBefore(t,e.nextSibling)}function g(t){t.parentNode,t.parentNode.removeChild(t)}function ht(t,e){t.parentNode,y(e,t.parentNode),g(t)}function w(t){let e=t.parentNode;for(;t.firstChild;)e.insertBefore(t.firstChild,t);e.removeChild(t)}function bt(t,e){let r=t.ownerDocument.createElement(e);for(;t.firstChild;)r.appendChild(t.firstChild);return t.parentNode,t.parentNode.replaceChild(r,t),r}function xt(t,e){e.parentNode,e.parentNode.insertBefore(t,e),t.appendChild(e)}function M(t){let{body:e}=document.implementation.createHTMLDocument("");e.innerHTML=t;let r=e.getElementsByTagName("*"),o=r.length;for(;o--;){let n=r[o];if(n.tagName==="SCRIPT")g(n);else{let i=n.attributes.length;for(;i--;){let{name:a}=n.attributes[i];a.startsWith("on")&&n.removeAttribute(a)}}}return e.innerHTML}function Nt(t){t=M(t);let e=document.implementation.createHTMLDocument("");return e.body.innerHTML=t,e.body.textContent||""}function R(t){switch(t.nodeType){case t.TEXT_NODE:return/^[ \f\n\r\t\v\u00a0]*$/.test(t.nodeValue||"");case t.ELEMENT_NODE:return t.hasAttributes()?!1:t.hasChildNodes()?Array.from(t.childNodes).every(R):!0;default:return!0}}var D={strong:{},em:{},s:{},del:{},ins:{},a:{attributes:["href","target","rel","id"]},code:{},abbr:{attributes:["title"]},sub:{},sup:{},br:{},small:{},q:{attributes:["cite"]},dfn:{attributes:["title"]},data:{attributes:["value"]},time:{attributes:["datetime"]},var:{},samp:{},kbd:{},i:{},b:{},u:{},mark:{},ruby:{},rt:{},rp:{},bdi:{attributes:["dir"]},bdo:{attributes:["dir"]},wbr:{},"#text":{}},Xt=["#text","br"];Object.keys(D).filter(t=>!Xt.includes(t)).forEach(t=>{let{[t]:e,...r}=D;D[t].children=r});var Yt={audio:{attributes:["src","preload","autoplay","mediagroup","loop","muted"]},canvas:{attributes:["width","height"]},embed:{attributes:["src","type","width","height"]},img:{attributes:["alt","src","srcset","usemap","ismap","width","height"]},object:{attributes:["data","type","name","usemap","form","width","height"]},video:{attributes:["src","poster","preload","playsinline","autoplay","mediagroup","loop","muted","controls","width","height"]},math:{attributes:["display","xmlns"],children:"*"}},V={...D,...Yt};function Et(t){if(t!=="paste")return V;let{u:e,abbr:r,data:o,time:n,wbr:i,bdi:a,bdo:s,...f}={...V,ins:{children:V.ins.children},del:{children:V.del.children}};return f}function A(t){let e=t.nodeName.toLowerCase();return Et().hasOwnProperty(e)||e==="span"}function Zt(t){let e=t.nodeName.toLowerCase();return D.hasOwnProperty(e)||e==="span"}function Ct(t){return!!t&&t.nodeType===t.ELEMENT_NODE}var $t=()=>{};function I(t,e,r,o){Array.from(t).forEach(n=>{let i=n.nodeName.toLowerCase();if(r.hasOwnProperty(i)&&(!r[i].isMatch||r[i].isMatch?.(n))){if(Ct(n)){let{attributes:a=[],classes:s=[],children:f,require:u=[],allowEmpty:d}=r[i];if(f&&!d&&R(n)){g(n);return}if(n.hasAttributes()&&(Array.from(n.attributes).forEach(({name:l})=>{l!=="class"&&!a.includes(l)&&n.removeAttribute(l)}),n.classList&&n.classList.length)){let l=s.map(c=>c==="*"?()=>!0:typeof c=="string"?m=>m===c:c instanceof RegExp?m=>c.test(m):$t);Array.from(n.classList).forEach(c=>{l.some(m=>m(c))||n.classList.remove(c)}),n.classList.length||n.removeAttribute("class")}if(n.hasChildNodes()){if(f==="*")return;if(f)u.length&&!n.querySelector(u.join(","))?(I(n.childNodes,e,r,o),w(n)):n.parentNode&&n.parentNode.nodeName==="BODY"&&A(n)?(I(n.childNodes,e,r,o),Array.from(n.childNodes).some(l=>!A(l))&&w(n)):I(n.childNodes,e,f,o);else for(;n.firstChild;)g(n.firstChild)}}}else I(n.childNodes,e,r,o),o&&!A(n)&&n.nextElementSibling&&y(e.createElement("br"),n),w(n)})}function Tt(t,e,r){let o=document.implementation.createHTMLDocument("");return o.body.innerHTML=t,I(o.body.childNodes,o,e,r),o.body.innerHTML}function Jt(t){let e=Array.from(t.files);return Array.from(t.items).forEach(r=>{let o=r.getAsFile();o&&!e.find(({name:n,type:i,size:a})=>n===o.name&&i===o.type&&a===o.size)&&e.push(o)}),e}var Kt={focusable:z,tabbable:k};return Pt(Qt);})();
1 +(function() {
2 +"use strict";var wp;(wp||={}).dom=(()=>{var At=Object.create;var v=Object.defineProperty;var Ht=Object.getOwnPropertyDescriptor;var Lt=Object.getOwnPropertyNames;var Ft=Object.getPrototypeOf,Pt=Object.prototype.hasOwnProperty;var Mt=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),U=(t,e)=>{for(var r in e)v(t,r,{get:e[r],enumerable:!0})},J=(t,e,r,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of Lt(e))!Pt.call(t,i)&&i!==r&&v(t,i,{get:()=>e[i],enumerable:!(o=Ht(e,i))||o.enumerable});return t};var Vt=(t,e,r)=>(r=t!=null?At(Ft(t)):{},J(e||!t||!t.__esModule?v(r,"default",{value:t,enumerable:!0}):r,t)),_t=t=>J(v({},"__esModule",{value:!0}),t);var dt=Mt(($e,ct)=>{ct.exports=window.wp.deprecated});var ee={};U(ee,{__unstableStripHTML:()=>Nt,computeCaretRect:()=>tt,documentHasSelection:()=>ot,documentHasTextSelection:()=>N,documentHasUncollapsedSelection:()=>rt,focus:()=>te,getFilesFromDataTransfer:()=>Qt,getOffsetParent:()=>it,getPhrasingContentSchema:()=>yt,getRectangleFromRange:()=>p,getScrollContainer:()=>q,insertAfter:()=>w,isEmpty:()=>D,isEntirelySelected:()=>at,isFormElement:()=>st,isHorizontalEdge:()=>ut,isNumberInput:()=>pt,isPhrasingContent:()=>R,isRTL:()=>y,isSelectionForward:()=>A,isTextContent:()=>Jt,isTextField:()=>x,isVerticalEdge:()=>gt,placeCaretAtHorizontalEdge:()=>ht,placeCaretAtVerticalEdge:()=>bt,remove:()=>h,removeInvalidHTML:()=>Rt,replace:()=>Et,replaceTag:()=>Tt,safeHTML:()=>M,unwrap:()=>C,wrap:()=>Ct});var X={};U(X,{find:()=>I});function Bt(t){return[t?'[tabindex]:not([tabindex^="-"])':"[tabindex]","a[href]","button:not([disabled])",'input:not([type="hidden"]):not([disabled])',"select:not([disabled])","textarea:not([disabled])",'iframe:not([tabindex^="-"])',"object","embed","summary","area[href]","[contenteditable]:not([contenteditable=false])"].join(",")}function K(t){if(typeof t.checkVisibility=="function"){if(!t.checkVisibility({visibilityProperty:!0}))return!1}else{let e=t.ownerDocument.defaultView?.getComputedStyle(t).visibility;if(e==="hidden"||e==="collapse")return!1}return t.offsetWidth>0||t.offsetHeight>0||t.getClientRects().length>0}function zt(t){let e=t.closest("map[name]");if(!e)return!1;let r=t.ownerDocument.querySelector('img[usemap="#'+e.name+'"]');return!!r&&!r.closest("[inert]")&&K(r)}function I(t,{sequential:e=!1}={}){let r=t.querySelectorAll(Bt(e));return Array.from(r).filter(o=>{let{nodeName:i}=o;return i==="AREA"?zt(o):o.closest("[inert]")?!1:K(o)})}var j={};U(j,{find:()=>jt,findNext:()=>Gt,findPrevious:()=>qt,isTabbableIndex:()=>Q});function k(t){let e=t.getAttribute("tabindex");return e===null?0:parseInt(e,10)}function Q(t){return k(t)!==-1}function Ut(){let t={};return function(r,o){let{nodeName:i,type:n,checked:a,name:s}=o;if(i!=="INPUT"||n!=="radio"||!s)return r.concat(o);let l=t.hasOwnProperty(s);if(!(a||!l))return r;if(l){let u=t[s];r=r.filter(f=>f!==u)}return t[s]=o,r.concat(o)}}function Xt(t,e){return{element:t,index:e}}function kt(t){return t.element}function Wt(t,e){let r=k(t.element),o=k(e.element);return r===o?t.index-e.index:r-o}function W(t){return t.filter(Q).map(Xt).sort(Wt).map(kt).reduce(Ut(),[])}function jt(t){return W(I(t))}function qt(t){return W(I(t.ownerDocument.body)).reverse().find(e=>t.compareDocumentPosition(e)&t.DOCUMENT_POSITION_PRECEDING)}function Gt(t){return W(I(t.ownerDocument.body)).find(e=>t.compareDocumentPosition(e)&t.DOCUMENT_POSITION_FOLLOWING)}function p(t){if(!t.collapsed){let n=Array.from(t.getClientRects());if(n.length===1)return n[0];let a=n.filter(({width:f})=>f>1);if(a.length===0)return t.getBoundingClientRect();if(a.length===1)return a[0];let{top:s,bottom:l,left:c,right:u}=a[0];for(let{top:f,bottom:d,left:m,right:T}of a)f<s&&(s=f),d>l&&(l=d),m<c&&(c=m),T>u&&(u=T);return new window.DOMRect(c,s,u-c,l-s)}let{startContainer:e,startOffset:r}=t,{ownerDocument:o}=e;if(e.nodeType!==e.TEXT_NODE&&!e.childNodes.length&&e.parentNode)return t=o.createRange(),t.setStartBefore(e),t.collapse(!0),p(t);if(e.nodeType!==e.TEXT_NODE){let n=e.childNodes[r-1];for(;n?.lastChild;)n=n.lastChild;let a=e.childNodes[r];for(;a?.firstChild;)a=a.firstChild;let s;n&&n.nodeType===n.TEXT_NODE&&(s=o.createRange(),s.setStart(n,n.length),s.collapse(!0));let l;if(a&&a.nodeType===a.TEXT_NODE&&(l=o.createRange(),l.setStart(a,0),l.collapse(!0)),s&&l){let c=s.getClientRects()[0],u=l.getClientRects()[0];if(c&&u&&c.bottom<=u.top)return null}if(l)t=l;else if(s)t=s;else return null}let i=t.getClientRects();if(i.length>1)return null;if(i.length===1&&e.nodeType===e.TEXT_NODE&&t.startOffset>0&&t.startOffset<e.length){let n=(l,c)=>{let u=o.createRange();return u.setStart(e,l),u.setEnd(e,c),u.getBoundingClientRect()},a=n(t.startOffset-1,t.startOffset),s=n(t.startOffset,t.startOffset+1);if(a.bottom<=s.top)return null}return i[0]??null}function tt(t){let e=t.getSelection();let r=e.rangeCount?e.getRangeAt(0):null;return r?p(r):null}function N(t){t.defaultView;let e=t.defaultView.getSelection();let r=e.rangeCount?e.getRangeAt(0):null;return!!r&&!r.collapsed}function b(t){return t?.nodeName==="INPUT"}function x(t){let e=["button","checkbox","hidden","file","radio","image","range","reset","submit","number","email","time"];return b(t)&&t.type&&!e.includes(t.type)||t.nodeName==="TEXTAREA"||t.contentEditable==="true"}function et(t){if(!b(t)&&!x(t))return!1;try{let{selectionStart:e,selectionEnd:r}=t;return e===null||e!==r}catch{return!0}}function rt(t){return N(t)||!!t.activeElement&&et(t.activeElement)}function ot(t){return!!t.activeElement&&(b(t.activeElement)||x(t.activeElement)||N(t))}function g(t){return t.ownerDocument.defaultView,t.ownerDocument.defaultView.getComputedStyle(t)}function q(t,e="vertical"){if(t){if((e==="vertical"||e==="all")&&t.scrollHeight>t.clientHeight){let{overflowY:r}=g(t);if(/(auto|scroll)/.test(r))return t}if((e==="horizontal"||e==="all")&&t.scrollWidth>t.clientWidth){let{overflowX:r}=g(t);if(/(auto|scroll)/.test(r))return t}return t.ownerDocument===t.parentNode?t:q(t.parentNode,e)}}function it(t){let e;for(;(e=t.parentNode)&&e.nodeType!==e.ELEMENT_NODE;);return e?g(e).position!=="static"?e:e.offsetParent:null}function E(t){return t.tagName==="INPUT"||t.tagName==="TEXTAREA"}var Yt="\uFEFF";function at(t){if(E(t))return t.selectionStart===0&&t.value.length===t.selectionEnd;if(!t.isContentEditable)return!0;let e=t.textContent||"";if(e===""||e===Yt)return!0;let{ownerDocument:r}=t,{defaultView:o}=r;let i=o.getSelection();let n=i.rangeCount?i.getRangeAt(0):null;if(!n)return!0;let{startContainer:a,endContainer:s,startOffset:l,endOffset:c}=n;if(a===t&&s===t&&l===0&&c===t.childNodes.length)return!0;let u=t.lastChild;let f=s.nodeType===s.TEXT_NODE?s.data.length:s.childNodes.length;return nt(a,t,"firstChild")&&nt(s,t,"lastChild")&&l===0&&c===f}function nt(t,e,r){let o=e;do{if(t===o)return!0;for(o=o[r];o&&o.nodeType===o.TEXT_NODE&&o.nodeValue==="";)o=o[r==="lastChild"?"previousSibling":"nextSibling"]}while(o);return!1}function st(t){if(!t)return!1;let{tagName:e}=t;return E(t)||e==="BUTTON"||e==="SELECT"}function y(t){return g(t).direction==="rtl"}function lt(t){let e=Array.from(t.getClientRects());if(!e.length)return;let r=Math.min(...e.map(({top:i})=>i));return Math.max(...e.map(({bottom:i})=>i))-r}function A(t){let{anchorNode:e,focusNode:r,anchorOffset:o,focusOffset:i}=t;let n=e.compareDocumentPosition(r);return n&e.DOCUMENT_POSITION_PRECEDING?!1:n&e.DOCUMENT_POSITION_FOLLOWING?!0:n===0?o<=i:!0}function ft(t,e,r){if(t.caretPositionFromPoint){let o=t.caretPositionFromPoint(e,r);if(!o)return null;let i=t.createRange();return i.setStart(o.offsetNode,o.offset),i.collapse(!0),i}return t.caretRangeFromPoint?t.caretRangeFromPoint(e,r):null}function H(t,e,r,o){let i=o.style.zIndex,n=o.style.position,a=o.style.borderRadius,{position:s="static"}=g(o);s==="static"&&(o.style.position="relative"),o.style.zIndex="10000",o.style.borderRadius="0";let l=ft(t,e,r);return o.style.zIndex=i,o.style.position=n,o.style.borderRadius=a,l}function L(t,e,r){let o=r();return(!o||!o.startContainer||!t.contains(o.startContainer))&&(t.scrollIntoView(e),o=r(),!o||!o.startContainer||!t.contains(o.startContainer))?null:o}function F(t,e,r=!1){if(E(t)&&typeof t.selectionStart=="number")return t.selectionStart!==t.selectionEnd?!1:e?t.selectionStart===0:t.value.length===t.selectionStart;if(!t.isContentEditable)return!0;let{ownerDocument:o}=t,{defaultView:i}=o;let n=i.getSelection();if(!n||!n.rangeCount)return!1;let a=n.getRangeAt(0),s=a.cloneRange(),l=A(n),c=n.isCollapsed;c||s.collapse(!l);let u=p(s),f=p(a);if(!u||!f)return!1;let d=lt(a);if(!c&&d&&d>u.height&&l===e)return!1;let m=y(t)?!e:e,T=t.getBoundingClientRect(),_=m?T.left+1:T.right-1,B=e?T.top+1:T.bottom-1,St=(B<0||B>i.innerHeight)&&f.top>=0&&f.bottom<=i.innerHeight,It=(_<0||_>i.innerWidth)&&f.left>=0&&f.right<=i.innerWidth;if(St||!r&&It)return!1;let G=L(t,e,()=>H(o,_,B,t));if(!G)return!1;let z=p(G);if(!z)return!1;let Y=e?"top":"bottom",Z=m?"left":"right",Dt=z[Y]-f[Y],Ot=z[Z]-u[Z],$=Math.abs(Dt)<=1,vt=Math.abs(Ot)<=1;return r?$:$&&vt}function ut(t,e){return F(t,e)}var mt=Vt(dt(),1);function pt(t){return(0,mt.default)("wp.dom.isNumberInput",{since:"6.1",version:"6.5"}),b(t)&&t.type==="number"&&!isNaN(t.valueAsNumber)}function gt(t,e){return F(t,e,!0)}function Zt(t,e,r){let{ownerDocument:o}=t,i=y(t)?!e:e,n=t.getBoundingClientRect();r===void 0?r=e?n.right-1:n.left+1:r<=n.left?r=n.left+1:r>=n.right&&(r=n.right-1);let a=i?n.bottom-1:n.top+1;return H(o,r,a,t)}function P(t,e,r){if(!t)return;if(t.focus(),E(t)){if(typeof t.selectionStart!="number")return;e?(t.selectionStart=t.value.length,t.selectionEnd=t.value.length):(t.selectionStart=0,t.selectionEnd=0);return}if(t.contentEditable!=="true")return;let o=L(t,e,()=>Zt(t,e,r));if(!o)return;let{ownerDocument:i}=t,{defaultView:n}=i;let a=n.getSelection();a.removeAllRanges(),a.addRange(o)}function ht(t,e){return P(t,e,void 0)}function bt(t,e,r){return P(t,e,r?.left)}function w(t,e){e.parentNode,e.parentNode.insertBefore(t,e.nextSibling)}function h(t){t.parentNode,t.parentNode.removeChild(t)}function Et(t,e){t.parentNode,w(e,t.parentNode),h(t)}function C(t){let e=t.parentNode;for(;t.firstChild;)e.insertBefore(t.firstChild,t);e.removeChild(t)}function Tt(t,e){let r=t.ownerDocument.createElement(e);for(;t.firstChild;)r.appendChild(t.firstChild);return t.parentNode,t.parentNode.replaceChild(r,t),r}function Ct(t,e){e.parentNode,e.parentNode.insertBefore(t,e),t.appendChild(e)}function M(t){let{body:e}=document.implementation.createHTMLDocument("");e.innerHTML=t;let r=e.getElementsByTagName("*"),o=r.length;for(;o--;){let i=r[o];if(i.tagName==="SCRIPT")h(i);else{let n=i.attributes.length;for(;n--;){let{name:a}=i.attributes[n];a.startsWith("on")&&i.removeAttribute(a)}}}return e.innerHTML}function Nt(t){t=M(t);let e=document.implementation.createHTMLDocument("");return e.body.innerHTML=t,e.body.textContent||""}function D(t){switch(t.nodeType){case t.TEXT_NODE:return/^[ \f\n\r\t\v\u00a0]*$/.test(t.nodeValue||"");case t.ELEMENT_NODE:return t.hasAttributes()?!1:t.hasChildNodes()?Array.from(t.childNodes).every(D):!0;default:return!0}}var O={strong:{},em:{},s:{},del:{},ins:{},a:{attributes:["href","target","rel","id"]},code:{},abbr:{attributes:["title"]},sub:{},sup:{},br:{},small:{},q:{attributes:["cite"]},dfn:{attributes:["title"]},data:{attributes:["value"]},time:{attributes:["datetime"]},var:{},samp:{},kbd:{},i:{},b:{},u:{},mark:{},ruby:{},rt:{},rp:{},bdi:{attributes:["dir"]},bdo:{attributes:["dir"]},wbr:{},"#text":{}},xt={audio:{attributes:["src","preload","autoplay","mediagroup","loop","muted"]},canvas:{attributes:["width","height"]},embed:{attributes:["src","type","width","height"]},img:{attributes:["alt","src","srcset","usemap","ismap","width","height"]},object:{attributes:["data","type","name","usemap","form","width","height"]},video:{attributes:["src","poster","preload","playsinline","autoplay","mediagroup","loop","muted","controls","width","height"]},math:{attributes:["display","xmlns"],children:"*"}},$t=["#text","br","wbr"];Object.keys(O).filter(t=>!$t.includes(t)).forEach(t=>{let{[t]:e,...r}=O;O[t].children={...r,img:xt.img}});var V={...O,...xt};function yt(t){if(t!=="paste")return V;let{u:e,abbr:r,data:o,time:i,wbr:n,bdi:a,bdo:s,...l}={...V,ins:{children:V.ins.children},del:{children:V.del.children}};return l}function R(t){let e=t.nodeName.toLowerCase();return yt().hasOwnProperty(e)||e==="span"}function Jt(t){let e=t.nodeName.toLowerCase();return O.hasOwnProperty(e)||e==="span"}function wt(t){return!!t&&t.nodeType===t.ELEMENT_NODE}var Kt=()=>{};function S(t,e,r,o){Array.from(t).forEach(i=>{let n=i.nodeName.toLowerCase();if(r.hasOwnProperty(n)&&(!r[n].isMatch||r[n].isMatch?.(i))){if(wt(i)){let{attributes:a=[],classes:s=[],children:l,require:c=[],allowEmpty:u}=r[n];if(l&&!u&&D(i)){R(i)&&i.hasChildNodes()?C(i):h(i);return}if(i.hasAttributes()&&(Array.from(i.attributes).forEach(({name:f})=>{f!=="class"&&!a.includes(f)&&i.removeAttribute(f)}),i.classList&&i.classList.length)){let f=s.map(d=>d==="*"?()=>!0:typeof d=="string"?m=>m===d:d instanceof RegExp?m=>d.test(m):Kt);Array.from(i.classList).forEach(d=>{f.some(m=>m(d))||i.classList.remove(d)}),i.classList.length||i.removeAttribute("class")}if(i.hasChildNodes()){if(l==="*")return;if(l)c.length&&!i.querySelector(c.join(","))?(S(i.childNodes,e,r,o),C(i)):i.parentNode&&i.parentNode.nodeName==="BODY"&&R(i)?(S(i.childNodes,e,r,o),Array.from(i.childNodes).some(f=>!R(f))&&C(i)):S(i.childNodes,e,l,o);else for(;i.firstChild;)h(i.firstChild)}}}else S(i.childNodes,e,r,o),o&&!R(i)&&i.nextElementSibling&&w(e.createElement("br"),i),C(i)})}function Rt(t,e,r){let o=document.implementation.createHTMLDocument("");return o.body.innerHTML=t,S(o.body.childNodes,o,e,r),o.body.innerHTML}function Qt(t){let e=Array.from(t.files);return Array.from(t.items).forEach(r=>{let o=r.getAsFile();o&&!e.find(({name:i,type:n,size:a})=>i===o.name&&n===o.type&&a===o.size)&&e.push(o)}),e}var te={focusable:X,tabbable:j};return _t(ee);})();
3 +(window.wp ||= {}).dom = wp.dom;
4 +})();
2 5 //# sourceMappingURL=index.min.js.map