(()=>{"use strict";var e={d:(i,n)=>{for(var t in n)e.o(n,t)&&!e.o(i,t)&&Object.defineProperty(i,t,{enumerable:!0,get:n[t]})},o:(e,i)=>Object.prototype.hasOwnProperty.call(e,i),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},i={};e.r(i),e.d(i,{SkeletonBar:()=>m,SkeletonBusyRegion:()=>w,SkeletonButton:()=>p,SkeletonCard:()=>k,SkeletonPill:()=>h,SkeletonProvider:()=>l,SkeletonShimmer:()=>v,SkeletonTableRow:()=>S,SkeletonValue:()=>c,skeletonBarClassName:()=>d,skeletonValueClassName:()=>u,useSkeleton:()=>o,useSkeletonSection:()=>r});const n=window.wp.element,t=window.ReactJSXRuntime,a={isLoading:!1,variant:"initial"},s=(0,n.createContext)(null),l=({isLoading:e,variant:i="initial",loadingKeys:n,className:a,children:l})=>{const o={isLoading:e,variant:i,loadingKeys:n},r=a?`pum-skeleton ${a}`:"pum-skeleton";return(0,t.jsx)(s.Provider,{value:o,children:(0,t.jsx)("div",{className:r,"data-skeleton-variant":i,"aria-hidden":!e||void 0,children:l})})},o=()=>(0,n.useContext)(s)??a,r=e=>{const{isLoading:i,loadingKeys:n}=o();return!(!i||void 0!==n&&e in n&&!0!==n[e])},d=(e,i)=>{const n=["pum-skeleton__bar"];return"pill"===e&&n.push("pum-skeleton__bar--pill"),"button"===e&&n.push("pum-skeleton__bar--button"),i&&n.push(i),n.join(" ")},m=({width:e,height:i=14,modifier:n,className:a})=>(0,t.jsx)("span",{className:d(n,a),style:{width:e,height:i},"aria-hidden":"true"}),u="pum-skeleton-value",c=({width:e="3em",height:i=14,className:n})=>{const a=n?`${u} ${n}`:u;return(0,t.jsx)("span",{className:a,style:{width:e,height:i},"aria-hidden":"true"})},h=e=>(0,t.jsx)(m,{...e,modifier:"pill"}),p=e=>(0,t.jsx)(m,{...e,modifier:"button"}),k=({className:e,minHeight:i})=>(0,t.jsx)("div",{className:e?`pum-skeleton__card ${e}`:"pum-skeleton__card",style:void 0!==i?{minHeight:i}:void 0,"aria-hidden":"true"}),v=({className:e,children:i})=>(0,t.jsx)("div",{className:e?`pum-skeleton__shimmer ${e}`:"pum-skeleton__shimmer",children:i}),g=window.wp.components,w=({className:e,ariaLabel:i,children:n,showSpinner:a=!0})=>(0,t.jsxs)("div",{className:e,"aria-busy":"true","aria-live":"polite","aria-label":i,children:[n,a&&(0,t.jsx)("div",{className:"pum-skeleton__spinner",children:(0,t.jsx)(g.Spinner,{})})]}),S=({cells:e})=>(0,t.jsx)("tr",{children:e.map(e=>(0,t.jsx)("td",{children:e.content??(0,t.jsx)(m,{width:e.width??"55%",height:e.height??14})},e.key))});(window.popupMaker=window.popupMaker||{}).skeleton=i})();