PluginProbe
OpenStation: Desktop Windows, Dock & Virtual Desktops for WP Admin / 1.1.12
OpenStation: Desktop Windows, Dock & Virtual Desktops for WP Admin v1.1.12
1.1.13 1.1.12 1.1.11 1.1.10 1.1.9 1.1.8 1.1.7 1.1.6 1.1.5 1.1.4 1.1.3 1.1.2 1.1.1 1.1.0 1.0.1 1.0.0 0.9.8 0.9.7 0.9.6 0.9.4 0.9.5 0.9.3 0.9.2 0.9.1 0.9.0 All 37 releases
← All changes | assets/js/apps/pages.min.js +145 -143 1.1.8 → 1.1.12 View file →
@@ -1,17 +1,17 @@
1 -var openStationApp_pages=function(Oe){"use strict";const mt="desktop-mode";function De(){return window.wp?.i18n}function u(o,e=mt){return De()?.__(o,e)??o}function qe(o,e,t,s=mt){return De()?._n(o,e,t,s)??(t===1?o:e)}function O(o,...e){const t=De()?.sprintf;if(t)return t(o,...e);let s=0;return o.replace(/%(?:(\d+)\$)?[sd]/g,(i,a)=>{const n=a?Number.parseInt(a,10)-1:s++;return String(e[n]??"")})}function b(o,...e){return{__wpdHtml:!0,strings:o,values:e}}function fs(o){return!!o&&o.__wpdHtml===!0}const gs="$$wpd$$",D=/\$\$wpd\$\$(\d+)\$\$/g,ms="$$wpd-node$$",bs=/^\$\$wpd-node\$\$(\d+)\$\$$/,_s=new Set(["style","script","textarea","title"]);function vs(o){let e="",t=!1,s=null,i=!1,a=null,n="",r=!1;for(let l=0;l<o.length;l++){const c=o[l];e+=c;for(let d=0;d<c.length;d++){const p=c[d];if(i){c.startsWith("-->",d)&&(i=!1,d+=2);continue}if(a!==null){p==="<"&&c[d+1]==="/"&&c.slice(d+2,d+2+a.length).toLowerCase()===a&&(d+=1+a.length,a=null,t=!0,r=!1,n="");continue}if(s!==null){p===s&&(s=null);continue}if(t){p==='"'||p==="'"?(s=p,r=!1):p===">"?(t=!1,r=!1,_s.has(n)&&(a=n),n=""):r&&(/[a-zA-Z0-9-]/.test(p)?n+=p.toLowerCase():r=!1);continue}if(c.startsWith("<!--",d)){i=!0,d+=3;continue}const h=c[d+1]??"";p==="<"&&/[a-zA-Z/!]/.test(h)&&(t=!0,n="",r=/[a-zA-Z]/.test(h))}l<o.length-1&&(e+=t||i||a!==null?`${gs}${l}$$`:`<!--${ms}${l}$$-->`)}return e}const bt=new WeakMap;function _t(o){const e=bt.get(o);if(e)return e;const t=document.createElement("template");t.innerHTML=vs(o);const s=[],i=(r,l)=>{if(r.nodeType===Node.ELEMENT_NODE){const p=r;for(const h of Array.from(p.attributes)){const _=h.name,g=h.value,m=_[0];if(D.test(g))if(D.lastIndex=0,m==="@"){const f=D.exec(g);D.lastIndex=0,s.push({path:l,kind:"event",name:_.slice(1),valueIndex:f?Number(f[1]):0}),p.removeAttribute(_)}else if(m==="."){const f=D.exec(g);D.lastIndex=0,s.push({path:l,kind:"prop",name:_.slice(1),valueIndex:f?Number(f[1]):0}),p.removeAttribute(_)}else if(m==="?"){const f=D.exec(g);D.lastIndex=0,s.push({path:l,kind:"bool",name:_.slice(1),valueIndex:f?Number(f[1]):0}),p.removeAttribute(_)}else{const f=[],v=[];let x=0,C;for(D.lastIndex=0;(C=D.exec(g))!==null;)f.push(g.slice(x,C.index)),v.push(Number(C[1])),x=C.index+C[0].length;f.push(g.slice(x)),s.push({path:l,kind:"attr",name:_,template:f,valueIndices:v}),p.setAttribute(_,"")}}}const c=Array.from(r.childNodes);let d=0;for(let p=0;p<c.length;p++){const h=c[p],_=p+d;if(h.nodeType===Node.COMMENT_NODE){const g=bs.exec(h.data);if(g){const m=document.createTextNode("");h.parentNode.replaceChild(m,h),s.push({path:[...l,_],kind:"node",valueIndex:Number(g[1])})}continue}if(h.nodeType===Node.TEXT_NODE){const g=h.textContent||"";if(!D.test(g)){D.lastIndex=0;continue}D.lastIndex=0;const m=h.parentNode;let f=0,v;const x=[],C=[];for(D.lastIndex=0;(v=D.exec(g))!==null;){v.index>f&&x.push(document.createTextNode(g.slice(f,v.index)));const R=document.createTextNode("");x.push(R),C.push({path:[...l,_+x.length-1],kind:"node",valueIndex:Number(v[1])}),f=v.index+v[0].length}f<g.length&&x.push(document.createTextNode(g.slice(f)));for(const R of x)m.insertBefore(R,h);m.removeChild(h),d+=x.length-1,s.push(...C)}else i(h,[...l,_])}};i(t.content,[]);const n={template:t,buildParts:r=>{const l=[];for(const c of s){let d=r;for(const p of c.path)d=d.childNodes[p];c.kind==="node"?l.push({kind:"node",valueIndex:c.valueIndex,child:{anchor:d,state:null}}):c.kind==="attr"?l.push({kind:"attr",element:d,name:c.name,template:c.template,valueIndices:c.valueIndices}):c.kind==="event"?l.push({kind:"event",valueIndex:c.valueIndex,element:d,name:c.name}):c.kind==="prop"?l.push({kind:"prop",valueIndex:c.valueIndex,element:d,name:c.name}):c.kind==="bool"&&l.push({kind:"bool",valueIndex:c.valueIndex,element:d,name:c.name})}return l}};return bt.set(o,n),n}const vt=new WeakMap;function xs(o,e){for(const t of o.nodes)if(t.parentNode!==e)return!1;return!0}function G(o,e){const t=vt.get(e);if(t&&t.strings===o.strings&&xs(t,e)){Ae(t.parts,o.values);return}const s=_t(o.strings),i=s.template.content.cloneNode(!0),a=s.buildParts(i),n=Array.from(i.childNodes);for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(i),Ae(a,o.values),vt.set(e,{strings:o.strings,parts:a,nodes:n})}function Ae(o,e){for(const t of o)if(t.kind==="node")ze(t.child,e[t.valueIndex]);else if(t.kind==="attr"){let s=t.template[0];for(let i=0;i<t.valueIndices.length;i++)s+=xt(e[t.valueIndices[i]]),s+=t.template[i+1];s!==t.last&&(t.last=s,s===""?t.element.removeAttribute(t.name):t.element.setAttribute(t.name,s))}else if(t.kind==="event"){const s=e[t.valueIndex];s!==t.current&&(t.current&&t.element.removeEventListener(t.name,t.current),s&&t.element.addEventListener(t.name,s),t.current=s)}else if(t.kind==="prop"){const s=e[t.valueIndex];s!==t.last&&(t.last=s,t.element[t.name]=s)}else if(t.kind==="bool"){const s=!!e[t.valueIndex];s!==t.last&&(t.last=s,s?t.element.setAttribute(t.name,""):t.element.removeAttribute(t.name))}}function ze(o,e){if(e==null||e===!1){o.state&&(se(o.state),o.state=null);return}if(Array.isArray(e)){$s(o,e);return}if(fs(e)){ws(o,e);return}if(e instanceof Node){ys(o,e);return}ks(o,xt(e))}function ys(o,e){const t=o.state;t?.shape==="node"&&t.node===e||(t&&se(t),pe(o,[e]),o.state={shape:"node",node:e})}function ks(o,e){const t=o.state;if(t?.shape==="text"){t.text!==e&&(t.node.textContent=e,t.text=e);return}t&&se(t);const s=document.createTextNode(e);pe(o,[s]),o.state={shape:"text",node:s,text:e}}function ws(o,e){const t=o.state;if(t?.shape==="template"&&t.strings===e.strings){Ae(t.parts,e.values);return}t&&se(t);const s=_t(e.strings),i=s.template.content.cloneNode(!0),a=s.buildParts(i),n=Array.from(i.childNodes);pe(o,[i]),Ae(a,e.values),o.state={shape:"template",strings:e.strings,parts:a,nodes:n}}function $s(o,e){const t=o.state;if(t?.shape==="array"){const i=Math.min(t.entries.length,e.length);for(let a=0;a<i;a++)ze(t.entries[a],e[a]);if(e.length<t.entries.length){for(let a=e.length;a<t.entries.length;a++){const n=t.entries[a];n.state&&se(n.state),n.anchor.remove()}t.entries.length=e.length}else for(let a=t.entries.length;a<e.length;a++){const n=document.createTextNode("");pe(o,[n]);const r={anchor:n,state:null};ze(r,e[a]),t.entries.push(r)}return}t&&se(t);const s=[];for(const i of e){const a=document.createTextNode("");pe(o,[a]);const n={anchor:a,state:null};ze(n,i),s.push(n)}o.state={shape:"array",entries:s}}function pe(o,e){const t=o.anchor.parentNode;if(t)for(const s of e)t.insertBefore(s,o.anchor)}function se(o){if(o.shape==="text"){o.node.remove();return}if(o.shape==="template"){for(const e of o.parts)e.kind==="node"&&e.child.state&&(se(e.child.state),e.child.state=null);for(const e of o.nodes)e.parentNode&&e.parentNode.removeChild(e);return}if(o.shape==="node"){o.node.parentNode&&o.node.parentNode.removeChild(o.node);return}for(const e of o.entries)e.state&&se(e.state),e.anchor.remove()}function xt(o){return o==null||o===!1?"":String(o)}async function yt(o){if(o==="")return!1;const e=globalThis.navigator?.clipboard;if(e?.writeText)try{return await e.writeText(o),!0}catch{}return Cs(o)}function Cs(o){const e=globalThis.document;if(!e?.body||typeof e.execCommand!="function")return!1;const t=e.createElement("textarea");t.value=o,t.setAttribute("readonly",""),t.setAttribute("aria-hidden","true"),t.style.position="fixed",t.style.insetInlineStart="-9999px",t.style.opacity="0",e.body.appendChild(t);const s=e.activeElement;t.select();let i=!1;try{i=e.execCommand("copy")}catch{i=!1}return t.remove(),s?.focus?.(),i}const Ss="data-os-mode";function He(o=typeof document<"u"?document.documentElement:null){return!!o&&o.getAttribute(Ss)==="mobile"}function As(o){return o.phone??He()?b`<os-select
1 +var openStationApp_pages=function(De){"use strict";const vt="desktop-mode";function He(){return window.wp?.i18n}function u(s,e=vt){return He()?.__(s,e)??s}function Fe(s,e,t,o=vt){return He()?._n(s,e,t,o)??(t===1?s:e)}function H(s,...e){const t=He()?.sprintf;if(t)return t(s,...e);let o=0;return s.replace(/%(?:(\d+)\$)?[sd]/g,(i,a)=>{const n=a?Number.parseInt(a,10)-1:o++;return String(e[n]??"")})}function b(s,...e){return{__wpdHtml:!0,strings:s,values:e}}function ws(s){return!!s&&s.__wpdHtml===!0}const $s="$$wpd$$",F=/\$\$wpd\$\$(\d+)\$\$/g,Cs="$$wpd-node$$",Ss=/^\$\$wpd-node\$\$(\d+)\$\$$/,As=new Set(["style","script","textarea","title"]);function Es(s){let e="",t=!1,o=null,i=!1,a=null,n="",r=!1;for(let l=0;l<s.length;l++){const c=s[l];e+=c;for(let d=0;d<c.length;d++){const p=c[d];if(i){c.startsWith("-->",d)&&(i=!1,d+=2);continue}if(a!==null){p==="<"&&c[d+1]==="/"&&c.slice(d+2,d+2+a.length).toLowerCase()===a&&(d+=1+a.length,a=null,t=!0,r=!1,n="");continue}if(o!==null){p===o&&(o=null);continue}if(t){p==='"'||p==="'"?(o=p,r=!1):p===">"?(t=!1,r=!1,As.has(n)&&(a=n),n=""):r&&(/[a-zA-Z0-9-]/.test(p)?n+=p.toLowerCase():r=!1);continue}if(c.startsWith("<!--",d)){i=!0,d+=3;continue}const g=c[d+1]??"";p==="<"&&/[a-zA-Z/!]/.test(g)&&(t=!0,n="",r=/[a-zA-Z]/.test(g))}l<s.length-1&&(e+=t||i||a!==null?`${$s}${l}$$`:`<!--${Cs}${l}$$-->`)}return e}const xt=new WeakMap;function yt(s){const e=xt.get(s);if(e)return e;const t=document.createElement("template");t.innerHTML=Es(s);const o=[],i=(r,l)=>{if(r.nodeType===Node.ELEMENT_NODE){const p=r;for(const g of Array.from(p.attributes)){const v=g.name,_=g.value,x=v[0];if(F.test(_))if(F.lastIndex=0,x==="@"){const h=F.exec(_);F.lastIndex=0,o.push({path:l,kind:"event",name:v.slice(1),valueIndex:h?Number(h[1]):0}),p.removeAttribute(v)}else if(x==="."){const h=F.exec(_);F.lastIndex=0,o.push({path:l,kind:"prop",name:v.slice(1),valueIndex:h?Number(h[1]):0}),p.removeAttribute(v)}else if(x==="?"){const h=F.exec(_);F.lastIndex=0,o.push({path:l,kind:"bool",name:v.slice(1),valueIndex:h?Number(h[1]):0}),p.removeAttribute(v)}else{const h=[],f=[];let m=0,y;for(F.lastIndex=0;(y=F.exec(_))!==null;)h.push(_.slice(m,y.index)),f.push(Number(y[1])),m=y.index+y[0].length;h.push(_.slice(m)),o.push({path:l,kind:"attr",name:v,template:h,valueIndices:f}),p.setAttribute(v,"")}}}const c=Array.from(r.childNodes);let d=0;for(let p=0;p<c.length;p++){const g=c[p],v=p+d;if(g.nodeType===Node.COMMENT_NODE){const _=Ss.exec(g.data);if(_){const x=document.createTextNode("");g.parentNode.replaceChild(x,g),o.push({path:[...l,v],kind:"node",valueIndex:Number(_[1])})}continue}if(g.nodeType===Node.TEXT_NODE){const _=g.textContent||"";if(!F.test(_)){F.lastIndex=0;continue}F.lastIndex=0;const x=g.parentNode;let h=0,f;const m=[],y=[];for(F.lastIndex=0;(f=F.exec(_))!==null;){f.index>h&&m.push(document.createTextNode(_.slice(h,f.index)));const w=document.createTextNode("");m.push(w),y.push({path:[...l,v+m.length-1],kind:"node",valueIndex:Number(f[1])}),h=f.index+f[0].length}h<_.length&&m.push(document.createTextNode(_.slice(h)));for(const w of m)x.insertBefore(w,g);x.removeChild(g),d+=m.length-1,o.push(...y)}else i(g,[...l,v])}};i(t.content,[]);const n={template:t,buildParts:r=>{const l=[];for(const c of o){let d=r;for(const p of c.path)d=d.childNodes[p];c.kind==="node"?l.push({kind:"node",valueIndex:c.valueIndex,child:{anchor:d,state:null}}):c.kind==="attr"?l.push({kind:"attr",element:d,name:c.name,template:c.template,valueIndices:c.valueIndices}):c.kind==="event"?l.push({kind:"event",valueIndex:c.valueIndex,element:d,name:c.name}):c.kind==="prop"?l.push({kind:"prop",valueIndex:c.valueIndex,element:d,name:c.name}):c.kind==="bool"&&l.push({kind:"bool",valueIndex:c.valueIndex,element:d,name:c.name})}return l}};return xt.set(s,n),n}const kt=new WeakMap;function zs(s,e){for(const t of s.nodes)if(t.parentNode!==e)return!1;return!0}function Z(s,e){const t=kt.get(e);if(t&&t.strings===s.strings&&zs(t,e)){Ae(t.parts,s.values);return}const o=yt(s.strings),i=o.template.content.cloneNode(!0),a=o.buildParts(i),n=Array.from(i.childNodes);for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(i),Ae(a,s.values),kt.set(e,{strings:s.strings,parts:a,nodes:n})}function Ae(s,e){for(const t of s)if(t.kind==="node")Ee(t.child,e[t.valueIndex]);else if(t.kind==="attr"){let o=t.template[0];for(let i=0;i<t.valueIndices.length;i++)o+=wt(e[t.valueIndices[i]]),o+=t.template[i+1];o!==t.last&&(t.last=o,o===""?t.element.removeAttribute(t.name):t.element.setAttribute(t.name,o))}else if(t.kind==="event"){const o=e[t.valueIndex];o!==t.current&&(t.current&&t.element.removeEventListener(t.name,t.current),o&&t.element.addEventListener(t.name,o),t.current=o)}else if(t.kind==="prop"){const o=e[t.valueIndex];o!==t.last&&(t.last=o,t.element[t.name]=o)}else if(t.kind==="bool"){const o=!!e[t.valueIndex];o!==t.last&&(t.last=o,o?t.element.setAttribute(t.name,""):t.element.removeAttribute(t.name))}}function Ee(s,e){if(e==null||e===!1){s.state&&(se(s.state),s.state=null);return}if(Array.isArray(e)){Ls(s,e);return}if(ws(e)){Ms(s,e);return}if(e instanceof Node){Ts(s,e);return}Ps(s,wt(e))}function Ts(s,e){const t=s.state;t?.shape==="node"&&t.node===e||(t&&se(t),ue(s,[e]),s.state={shape:"node",node:e})}function Ps(s,e){const t=s.state;if(t?.shape==="text"){t.text!==e&&(t.node.textContent=e,t.text=e);return}t&&se(t);const o=document.createTextNode(e);ue(s,[o]),s.state={shape:"text",node:o,text:e}}function Ms(s,e){const t=s.state;if(t?.shape==="template"&&t.strings===e.strings){Ae(t.parts,e.values);return}t&&se(t);const o=yt(e.strings),i=o.template.content.cloneNode(!0),a=o.buildParts(i),n=Array.from(i.childNodes);ue(s,[i]),Ae(a,e.values),s.state={shape:"template",strings:e.strings,parts:a,nodes:n}}function Ls(s,e){const t=s.state;if(t?.shape==="array"){const i=Math.min(t.entries.length,e.length);for(let a=0;a<i;a++)Ee(t.entries[a],e[a]);if(e.length<t.entries.length){for(let a=e.length;a<t.entries.length;a++){const n=t.entries[a];n.state&&se(n.state),n.anchor.remove()}t.entries.length=e.length}else for(let a=t.entries.length;a<e.length;a++){const n=document.createTextNode("");ue(s,[n]);const r={anchor:n,state:null};Ee(r,e[a]),t.entries.push(r)}return}t&&se(t);const o=[];for(const i of e){const a=document.createTextNode("");ue(s,[a]);const n={anchor:a,state:null};Ee(n,i),o.push(n)}s.state={shape:"array",entries:o}}function ue(s,e){const t=s.anchor.parentNode;if(t)for(const o of e)t.insertBefore(o,s.anchor)}function se(s){if(s.shape==="text"){s.node.remove();return}if(s.shape==="template"){for(const e of s.parts)e.kind==="node"&&e.child.state&&(se(e.child.state),e.child.state=null);for(const e of s.nodes)e.parentNode&&e.parentNode.removeChild(e);return}if(s.shape==="node"){s.node.parentNode&&s.node.parentNode.removeChild(s.node);return}for(const e of s.entries)e.state&&se(e.state),e.anchor.remove()}function wt(s){return s==null||s===!1?"":String(s)}async function $t(s){if(s==="")return!1;const e=globalThis.navigator?.clipboard;if(e?.writeText)try{return await e.writeText(s),!0}catch{}return Rs(s)}function Rs(s){const e=globalThis.document;if(!e?.body||typeof e.execCommand!="function")return!1;const t=e.createElement("textarea");t.value=s,t.setAttribute("readonly",""),t.setAttribute("aria-hidden","true"),t.style.position="fixed",t.style.insetInlineStart="-9999px",t.style.opacity="0",e.body.appendChild(t);const o=e.activeElement;t.select();let i=!1;try{i=e.execCommand("copy")}catch{i=!1}return t.remove(),o?.focus?.(),i}const Is="data-os-mode";function Ue(s=typeof document<"u"?document.documentElement:null){return!!s&&s.getAttribute(Is)==="mobile"}function Ns(s){return s.phone??Ue()?b`<os-select
2 2 class="os-app-list__status"
3 - os-bind=${o.bind}
4 - os-action=${o.action}
5 - .value=${o.value}
6 - aria-label=${o.label}
7 - >${o.segments.map(t=>b`<os-option .value=${t.value}>${t.label}</os-option>`)}</os-select>`:b`<os-segmented
3 + os-bind=${s.bind}
4 + os-action=${s.action}
5 + .value=${s.value}
6 + aria-label=${s.label}
7 + >${s.segments.map(t=>b`<os-option .value=${t.value}>${t.label}</os-option>`)}</os-select>`:b`<os-segmented
8 8 class="os-app-list__status"
9 - os-bind=${o.bind}
10 - os-action=${o.action}
11 - value=${o.value}
12 - label=${o.label}
13 - >${o.segments.map(t=>b`<os-segment value=${t.value}>${t.label}</os-segment>`)}</os-segmented>`}function zs(o,e){const s=o.closest(".os-window")?.querySelector(".os-window__menu-panel")??null;if(!s||e.items.length===0)return null;const i=`${e.prefix}:`,a="data-os-app-menu-section";s.querySelectorAll(`[${a}="${e.prefix}"]`).forEach(d=>d.remove());const n=document.createElement("div");n.className="os-app__menu-section",n.setAttribute("role","presentation"),n.setAttribute(a,e.prefix),n.textContent=e.section,s.appendChild(n);const r=new Map;for(const d of e.items){const p=document.createElement("os-menu-item");p.setAttribute("role","menuitemcheckbox"),p.setAttribute("value",i+d.key),p.setAttribute(a,e.prefix),p.classList.add("os-window__menu-item","os-app__menu-item"),p.textContent=d.label||d.key,s.appendChild(p),r.set(d.key,p)}const l=()=>{for(const[d,p]of r)e.isChecked(d)?p.setAttribute("checked",""):p.removeAttribute("checked")};l();const c=d=>{const p=d.detail?.value;if(typeof p!="string"||!p.startsWith(i))return;const h=p.slice(i.length);r.has(h)&&(e.onToggle(h),l())};return s.addEventListener("os-menu-item-click",c),{refresh:l,dispose:()=>{s.removeEventListener("os-menu-item-click",c),n.remove();for(const d of r.values())d.remove();r.clear()}}}function Es(o,e=null){const t=e??(typeof document<"u"?document.documentElement:null);if(!!t&&He(t)){o.hasAttribute("stacked")||o.setAttribute("stacked","");const a=o.getAttribute("sticky-columns");return a!==null&&(o.setAttribute("data-os-sticky-columns",a),o.removeAttribute("sticky-columns")),!0}o.hasAttribute("stacked")&&o.removeAttribute("stacked");const i=o.getAttribute("data-os-sticky-columns");return i!==null&&(o.setAttribute("sticky-columns",i),o.removeAttribute("data-os-sticky-columns")),!1}function kt(o){return Array.from(o.selection??[],String)}function Ts(){let o=null,e=!1,t=null,s=null;return{invalidateColumns(){o=null},invalidateData(){s=null},sync(i){const a={phone:!1,columnsChanged:!1,dataChanged:!1,selectionChanged:!1},n=i.table;if(!n)return a;const r=i.rowId??(c=>c.id),l=Es(n);if(a.phone=l,l!==o&&(o=l,n.columns=i.columns(l),a.columnsChanged=!0),e||(e=!0,i.wire?.(n)),i.listKey!==t&&(t=i.listKey,kt(n).length>0&&(n.clearSelection(),a.selectionChanged=!0,i.onSelection?.([]))),i.fingerprint!==s){s=i.fingerprint,n.data=i.rows,a.dataChanged=!0;const c=new Set(i.rows.map(h=>String(r(h)))),d=kt(n),p=d.filter(h=>c.has(h));p.length!==d.length&&(n.selection=p,a.selectionChanged=!0,i.onSelection?.(p))}return a}}}function Ps(o,e){const t=e.local??{},s={id:o,hasLocal:n=>Object.prototype.hasOwnProperty.call(t,n),runLocal:(n,r,l,c)=>{const d=t[n];if(!d)return r;const p={...r},h=d(p,l,c);return h===void 0?p:h},render:n=>{G(e.view(n),n.root),e.updated?.(n)},mounted:n=>e.mounted?.(n)},{placeholder:i}=e;i&&(s.placeholder=n=>i(n));const a=window;return(a.openStationApps??(a.openStationApps={}))[o]=s,s}const Fe=new Map;async function Ls(o){if(!o)return null;let e;try{e=new URL(o,window.location.href)}catch{return o}if(!/gravatar\.com$/i.test(e.hostname))return o;e.searchParams.delete("d"),e.searchParams.delete("s");const t=e.toString(),s=Fe.get(t);if(s!==void 0)return s instanceof Promise,s;const i=new URL(o,window.location.href);i.searchParams.set("d","blank");const a=new Promise(n=>{const r=new Image;r.crossOrigin="anonymous",r.onload=()=>{try{const l=document.createElement("canvas");l.width=1,l.height=1;const c=l.getContext("2d",{willReadFrequently:!0});if(!c){n(o);return}c.drawImage(r,0,0,1,1);const d=c.getImageData(0,0,1,1).data;n(d[3]===0?null:o)}catch{n(o)}},r.onerror=()=>n(null),r.src=i.toString()}).then(n=>(Fe.set(t,n),n));return Fe.set(t,a),a}function Ms(o){return o?.["48"]??o?.["96"]??o?.["24"]??""}function Rs(o,e){e&&Ls(e).then(t=>{o.isConnected&&(t?o.setAttribute("src",t):o.removeAttribute("src"))})}function ue(o){const e=document.createElement("textarea");return e.innerHTML=o,e.value}const ne=class ne extends HTMLElement{constructor(){super(),this._renderScheduled=!1,this._propValues={},this.constructor.shadow?(this.attachShadow({mode:"open"}),this._renderRoot=this.shadowRoot):this._renderRoot=this,this._installPropAccessors()}static get observedAttributes(){return this.props.map(wt)}connectedCallback(){this._adoptStyles(),this.requestUpdate()}attributeChangedCallback(e,t,s){if(t===s)return;const i=Is(e);this._propValues[i]=s,this.requestUpdate()}get classNames(){return Array.from(this.classList)}set classNames(e){if(e==null){this.removeAttribute("class");return}const s=(Array.isArray(e)?e:String(e).split(/\s+/)).map(i=>String(i).trim()).filter(i=>i!=="");this.className=s.join(" ")}requestUpdate(){this._scheduleRender()}emit(e,t){return this.dispatchEvent(new CustomEvent(e,{detail:t,bubbles:!0,composed:!0}))}_installPropAccessors(){const e=this.constructor;for(const t of e.props){if(Object.getOwnPropertyDescriptor(this,t))continue;const s=wt(t);Object.defineProperty(this,t,{get:()=>t in this._propValues?this._propValues[t]:this.getAttribute(s),set:i=>{let a;i==null||i===!1?a=null:i===!0?a="":a=String(i),this._propValues[t]=a,a===null?this.removeAttribute(s):this.setAttribute(s,a),this.requestUpdate()},enumerable:!0,configurable:!0})}}_scheduleRender(){this._renderScheduled||!this.isConnected||(this._renderScheduled=!0,queueMicrotask(()=>{this._renderScheduled=!1,this.isConnected&&G(this.render(),this._renderRoot)}))}_adoptStyles(){const e=this.constructor;if(e.styles.length!==0)if(e.shadow&&this.shadowRoot){const t=e.styles.map(s=>s.sheet).filter(s=>s!==null);if(this.shadowRoot.adoptedStyleSheets=t,t.length!==e.styles.length){for(const s of e.styles)if(!s.sheet){const i=document.createElement("style");i.textContent=s.cssText,this.shadowRoot.appendChild(i)}}}else this._adoptLightStyles(e)}_adoptLightStyles(e){if(!ne._lightStylesAdopted.has(e)){ne._lightStylesAdopted.add(e);for(const t of e.styles){const s=document.createElement("style");s.dataset.osUi=this.tagName.toLowerCase(),s.textContent=t.cssText,document.head.appendChild(s)}}}};ne.props=[],ne.styles=[],ne.shadow=!0,ne._lightStylesAdopted=new WeakSet;let q=ne;function U(o,e){customElements.get(o)||customElements.define(o,e)}function wt(o){return o.replace(/[A-Z]/g,e=>"-"+e.toLowerCase())}function Is(o){return o.replace(/-([a-z])/g,(e,t)=>t.toUpperCase())}const Ns=(()=>{try{return typeof new CSSStyleSheet().replaceSync=="function"}catch{return!1}})();function P(o,...e){let t=o[0];for(let s=1;s<o.length;s++){const i=e[s-1];if(typeof i=="string"||typeof i=="number")t+=String(i);else if(i&&i.__wpdCss)t+=i.cssText;else throw new TypeError("[os-ui] css`` interpolations must be strings, numbers, or other css`` results. Got: "+typeof i);t+=o[s]}if(Ns){const s=new CSSStyleSheet;return s.replaceSync(t),{__wpdCss:!0,sheet:s,cssText:t}}return{__wpdCss:!0,sheet:null,cssText:t}}function Os(o){const e=[],t=[];let s=null,i=o.parentElement;for(;i&&!(i===document.body||i===document.documentElement);){const n=i.id||"";if(n.startsWith("wp-window-")){s=n.slice(10);break}if(i.tagName.toLowerCase()==="os-tabpanel"){const r=i.getAttribute("for");r&&t.unshift(r)}i=i.parentElement}s&&e.push(Ue(s));for(const n of t)e.push("tab-"+Ue(n));const a=o.getAttribute("label");return a&&e.push(Ue(a)),e.length===0?"os-unnamed":"os-"+e.filter(n=>n!=="").join("-")}function Ue(o){return o.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")}function $t(o){if(o.id)return o.id;const e=Os(o);return o.id=e,e}function Ds(o){if(!o)return 214;let e=5381;for(let t=0;t<o.length;t++)e=Math.imul(e,33)+o.charCodeAt(t);return(e%360+360)%360}const qs=P`:host{display:inline-flex;position:relative;width:var( --os-ui-avatar-size,32px );height:var( --os-ui-avatar-size,32px );flex:0 0 auto;vertical-align:middle;line-height:0;perspective:calc( var( --os-ui-avatar-size,32px ) * 8 );--os-ui-avatar-tilt-x:0deg;--os-ui-avatar-tilt-y:0deg;--os-ui-avatar-hover:0;--os-ui-avatar-glare-x:50%;--os-ui-avatar-glare-y:50%}:host( [ hidden ] ){display:none}.os-avatar__tile{position:relative;width:100%;height:100%;border-radius:50%;overflow:hidden;background:var( --os-window-bg,#f0f0f1 );color:var( --os-ui-fg-on-accent,#fff );display:flex;align-items:center;justify-content:center;font-weight:700;font-size:calc( var( --os-ui-avatar-size,32px ) * 0.48 );line-height:1;letter-spacing:0;font-feature-settings:'tnum' 1;user-select:none;transform-style:preserve-3d;transform:rotateX( var( --os-ui-avatar-tilt-x ) ) rotateY( var( --os-ui-avatar-tilt-y ) ) scale( calc( 1 + var( --os-ui-avatar-hover ) * 0.07 ) );transition:transform 220ms cubic-bezier( 0.2,0.8,0.2,1 ),box-shadow 220ms cubic-bezier( 0.2,0.8,0.2,1 );box-shadow:inset 0 0 0 1px rgba( 255,255,255,calc( 0.18 + 0.22 * var( --os-ui-avatar-hover ) ) ),inset 0 0 0 calc( 1px + var( --os-ui-avatar-hover ) * 1px ) rgba( 0,0,0,calc( 0.08 + 0.04 * var( --os-ui-avatar-hover ) ) ),0 calc( 1px + var( --os-ui-avatar-hover ) * 8px ) calc( 6px + var( --os-ui-avatar-hover ) * 18px ) rgba( 0,0,0,calc( 0.08 + 0.18 * var( --os-ui-avatar-hover ) ) )}.os-avatar__tile::after{content:'';position:absolute;inset:0;border-radius:50%;background:radial-gradient( circle at var( --os-ui-avatar-glare-x ) var( --os-ui-avatar-glare-y ),var( --os-ui-scrim,rgba( 255,255,255,0.55 ) ) 0%,var( --os-ui-hover,rgba( 255,255,255,0 ) ) 55% );opacity:var( --os-ui-avatar-hover );mix-blend-mode:overlay;pointer-events:none;transition:opacity 220ms cubic-bezier( 0.2,0.8,0.2,1 )}.os-avatar__tile::before{content:'';position:absolute;inset:calc( var( --os-ui-avatar-hover ) * -3px );border-radius:50%;background:radial-gradient( circle at var( --os-ui-avatar-glare-x ) var( --os-ui-avatar-glare-y ),color-mix( in srgb,var( --os-ui-avatar-halo,rgb( 99,102,241 ) ) calc( 35% * var( --os-ui-avatar-hover ) ),transparent ) 0%,transparent 70% );filter:blur( 4px );pointer-events:none;z-index:-1;transition:inset 220ms cubic-bezier( 0.2,0.8,0.2,1 ),background 220ms}.os-avatar__tile img{width:calc( 100% + 2px );height:calc( 100% + 2px );margin:-1px;object-fit:cover;display:block;transform:translateZ( 1px )}.os-avatar__dot{position:absolute;bottom:0;inset-inline-end:0;width:calc( var( --os-ui-avatar-size,32px ) * 0.32 );height:calc( var( --os-ui-avatar-size,32px ) * 0.32 );min-width:8px;min-height:8px;border-radius:50%;box-sizing:border-box;border:2px solid var( --os-ui-avatar-dot-ring,var( --os-window-bg,#fff ) );background:var( --os-ui-avatar-dot-color,transparent );z-index:2}.os-avatar__dot--online{background:var( --os-ui-success-fg,#00a32a )}.os-avatar__dot--online::after{content:'';position:absolute;inset:-2px;border-radius:50%;border:1px solid var( --os-ui-success-fg,#00a32a );animation:os-avatar-presence 6s var( --os-ui-ease-out,cubic-bezier( 0.22,0.9,0.28,1 ) ) infinite;pointer-events:none}@keyframes os-avatar-presence{0%{opacity:0.6;transform:scale( 1 )}20%{opacity:0;transform:scale( 2.2 )}100%{opacity:0;transform:scale( 2.2 )}}.os-avatar__dot--inactive{background:var( --os-ui-warning-fg,#dba617 )}.os-avatar__dot--offline{background:var( --os-ui-fg-muted,#8c8f94 )}@media ( prefers-reduced-motion:reduce ){.os-avatar__dot--online::after{animation:none;opacity:0.6}.os-avatar__tile{transform:none;transition:box-shadow 200ms}.os-avatar__tile::after,.os-avatar__tile::before{display:none}}`,Ct={xs:20,sm:24,md:40,lg:64,xl:96},St=new Set(["online","inactive","offline"]),me=class me extends q{constructor(){super(...arguments),this._presenceHandler=null,this._imgFailed=!1,this._onPointerMove=null,this._onPointerEnter=null,this._onPointerLeave=null,this._tiltRaf=0,this._pendingTiltX="0deg",this._pendingTiltY="0deg",this._pendingGlareX="50%",this._pendingGlareY="50%"}connectedCallback(){super.connectedCallback(),this._maybeAttachPresenceListener(),this._attachHoverEffect()}disconnectedCallback(){this._presenceHandler&&(document.removeEventListener("os-presence-changed",this._presenceHandler),this._presenceHandler=null),this._detachHoverEffect()}attributeChangedCallback(e,t,s){super.attributeChangedCallback(e,t,s),e==="src"&&(this._imgFailed=!1),(e==="user-id"||e==="presence")&&this._maybeAttachPresenceListener()}render(){const e=this._attr("src"),t=this._attr("name")||"",s=this._attr("alt"),i=s!==null?s:t,a=this._attr("size"),n=this._resolveSize(a),r=this._presenceForRender(),l=this._attr("clickable")!==null;this.style.setProperty("--os-ui-avatar-size",`${n}px`);const c=e&&!this._imgFailed?"":this._initialsBg(t),d=e&&!this._imgFailed?b`<img
9 + os-bind=${s.bind}
10 + os-action=${s.action}
11 + value=${s.value}
12 + label=${s.label}
13 + >${s.segments.map(t=>b`<os-segment value=${t.value}>${t.label}</os-segment>`)}</os-segmented>`}function Os(s,e){const o=s.closest(".os-window")?.querySelector(".os-window__menu-panel")??null;if(!o||e.items.length===0)return null;const i=`${e.prefix}:`,a="data-os-app-menu-section";o.querySelectorAll(`[${a}="${e.prefix}"]`).forEach(d=>d.remove());const n=document.createElement("div");n.className="os-app__menu-section",n.setAttribute("role","presentation"),n.setAttribute(a,e.prefix),n.textContent=e.section,o.appendChild(n);const r=new Map;for(const d of e.items){const p=document.createElement("os-menu-item");p.setAttribute("role","menuitemcheckbox"),p.setAttribute("value",i+d.key),p.setAttribute(a,e.prefix),p.classList.add("os-window__menu-item","os-app__menu-item"),p.textContent=d.label||d.key,o.appendChild(p),r.set(d.key,p)}const l=()=>{for(const[d,p]of r)e.isChecked(d)?p.setAttribute("checked",""):p.removeAttribute("checked")};l();const c=d=>{const p=d.detail?.value;if(typeof p!="string"||!p.startsWith(i))return;const g=p.slice(i.length);r.has(g)&&(e.onToggle(g),l())};return o.addEventListener("os-menu-item-click",c),{refresh:l,dispose:()=>{o.removeEventListener("os-menu-item-click",c),n.remove();for(const d of r.values())d.remove();r.clear()}}}function qs(s,e=null){const t=e??(typeof document<"u"?document.documentElement:null);if(!!t&&Ue(t)){s.hasAttribute("stacked")||s.setAttribute("stacked","");const a=s.getAttribute("sticky-columns");return a!==null&&(s.setAttribute("data-os-sticky-columns",a),s.removeAttribute("sticky-columns")),!0}s.hasAttribute("stacked")&&s.removeAttribute("stacked");const i=s.getAttribute("data-os-sticky-columns");return i!==null&&(s.setAttribute("sticky-columns",i),s.removeAttribute("data-os-sticky-columns")),!1}function Ct(s){return Array.from(s.selection??[],String)}function Ds(){let s=null,e=!1,t=null,o=null;return{invalidateColumns(){s=null},invalidateData(){o=null},sync(i){const a={phone:!1,columnsChanged:!1,dataChanged:!1,selectionChanged:!1},n=i.table;if(!n)return a;const r=i.rowId??(c=>c.id),l=qs(n);if(a.phone=l,l!==s&&(s=l,n.columns=i.columns(l),a.columnsChanged=!0),e||(e=!0,i.wire?.(n)),i.listKey!==t&&(t=i.listKey,Ct(n).length>0&&(n.clearSelection(),a.selectionChanged=!0,i.onSelection?.([]))),i.fingerprint!==o){o=i.fingerprint,n.data=i.rows,a.dataChanged=!0;const c=new Set(i.rows.map(g=>String(r(g)))),d=Ct(n),p=d.filter(g=>c.has(g));p.length!==d.length&&(n.selection=p,a.selectionChanged=!0,i.onSelection?.(p))}return a}}}function Hs(s,e){const t=e.local??{},o={id:s,hasLocal:n=>Object.prototype.hasOwnProperty.call(t,n),runLocal:(n,r,l,c)=>{const d=t[n];if(!d)return r;const p={...r},g=d(p,l,c);return g===void 0?p:g},render:n=>{Z(e.view(n),n.root),e.updated?.(n)},mounted:n=>e.mounted?.(n)},{placeholder:i}=e;i&&(o.placeholder=n=>i(n));const a=window;return(a.openStationApps??(a.openStationApps={}))[s]=o,o}const Fs=250,St=window.location.origin;let At=0;function Us(s,{timeoutMs:e=Fs}={}){const t=s?.contentWindow;if(!t)return Promise.resolve(!1);At+=1;const o=`os-unsaved-guard-${Date.now()}-${At}`;return new Promise(i=>{let a=null,n=!1;const r=c=>{n||(n=!0,window.removeEventListener("message",l),a!==null&&window.clearTimeout(a),i(c))},l=c=>{if(c.origin!==St)return;const d=c?.data;!d||typeof d!="object"||d.type!=="os-bridge-beforeunload-response"||d.requestId!==o||r(d.prevent===!0)};window.addEventListener("message",l),a=window.setTimeout(()=>r(!1),e);try{t.postMessage({type:"os-bridge-beforeunload-query",requestId:o},St)}catch{r(!1)}})}class Vs extends Error{constructor(e,t){super(e||t.serverMessage||`HTTP ${t.status}`),this.name="RestError",this.status=t.status,this.code=t.code,this.data=t.data,this.serverMessage=t.serverMessage??""}}function Et(s){return s instanceof Vs}const Ws="rest_cookie_invalid_nonce",zt=()=>u("Could not reach the site. Check your connection and try again.","desktop-mode");function Tt(s){return typeof navigator<"u"&&navigator.onLine===!1?!0:s instanceof TypeError}function js(s){return Et(s)?s.code===Ws||s.status===401?"session":s.status>=200&&s.status<300?"unreadable":s.status===404?"gone":s.status>=500?"server":s.status>=400?"refused":"unknown":Tt(s)?"offline":"unknown"}function Ks(s){return Et(s)?s.serverMessage:Tt(s)?zt():s instanceof Error?s.message:""}function Bs(s,e){const{fallback:t,lead:o}=e,i=js(s),a=i==="offline"||i==="unreadable"?"warning":"error";let n="",r=!0;switch(i){case"offline":n=zt();break;case"session":n=u("Your session has expired. Reload the page and try again.","desktop-mode");break;case"unreadable":n=u("The site sent an unreadable reply. Reload the page to check whether the change went through.","desktop-mode");break;case"gone":case"refused":case"server":{const c=s;c.serverMessage?n=c.serverMessage:i==="gone"?(n=u("It no longer exists. Reload the page to catch up.","desktop-mode"),r=!1):i==="server"?(n=H(u("The server answered with error %d.","desktop-mode"),c.status),r=!1):(n=H(u("The server refused the request (HTTP %d).","desktop-mode"),c.status),r=!1);break}case"unknown":default:n=Ks(s);break}let l;return o?l=n?`${o}: ${n}`:t:n?r?l=n:l=`${t} ${n}`:l=t,{message:l,reason:n,kind:i,type:a}}function Gs(s,e,t){if(!s)return;const{duration:o,...i}=t,a=Bs(e,i),n={message:a.message,type:a.type};o&&(n.duration=o),s(n)}const Ve=new Map;async function Zs(s){if(!s)return null;let e;try{e=new URL(s,window.location.href)}catch{return s}if(!/gravatar\.com$/i.test(e.hostname))return s;e.searchParams.delete("d"),e.searchParams.delete("s");const t=e.toString(),o=Ve.get(t);if(o!==void 0)return o instanceof Promise,o;const i=new URL(s,window.location.href);i.searchParams.set("d","blank");const a=new Promise(n=>{const r=new Image;r.crossOrigin="anonymous",r.onload=()=>{try{const l=document.createElement("canvas");l.width=1,l.height=1;const c=l.getContext("2d",{willReadFrequently:!0});if(!c){n(s);return}c.drawImage(r,0,0,1,1);const d=c.getImageData(0,0,1,1).data;n(d[3]===0?null:s)}catch{n(s)}},r.onerror=()=>n(null),r.src=i.toString()}).then(n=>(Ve.set(t,n),n));return Ve.set(t,a),a}function Xs(s){return s?.["48"]??s?.["96"]??s?.["24"]??""}function Ys(s,e){e&&Zs(e).then(t=>{s.isConnected&&(t?s.setAttribute("src",t):s.removeAttribute("src"))})}function ae(s){const e=document.createElement("textarea");return e.innerHTML=s,e.value}const ne=class ne extends HTMLElement{constructor(){super(),this._renderScheduled=!1,this._propValues={},this.constructor.shadow?(this.attachShadow({mode:"open"}),this._renderRoot=this.shadowRoot):this._renderRoot=this,this._installPropAccessors()}static get observedAttributes(){return this.props.map(Pt)}connectedCallback(){this._adoptStyles(),this.requestUpdate()}attributeChangedCallback(e,t,o){if(t===o)return;const i=Js(e);this._propValues[i]=o,this.requestUpdate()}get classNames(){return Array.from(this.classList)}set classNames(e){if(e==null){this.removeAttribute("class");return}const o=(Array.isArray(e)?e:String(e).split(/\s+/)).map(i=>String(i).trim()).filter(i=>i!=="");this.className=o.join(" ")}requestUpdate(){this._scheduleRender()}emit(e,t){return this.dispatchEvent(new CustomEvent(e,{detail:t,bubbles:!0,composed:!0}))}_installPropAccessors(){const e=this.constructor;for(const t of e.props){if(Object.getOwnPropertyDescriptor(this,t))continue;const o=Pt(t);Object.defineProperty(this,t,{get:()=>t in this._propValues?this._propValues[t]:this.getAttribute(o),set:i=>{let a;i==null||i===!1?a=null:i===!0?a="":a=String(i),this._propValues[t]=a,a===null?this.removeAttribute(o):this.setAttribute(o,a),this.requestUpdate()},enumerable:!0,configurable:!0})}}_scheduleRender(){this._renderScheduled||!this.isConnected||(this._renderScheduled=!0,queueMicrotask(()=>{this._renderScheduled=!1,this.isConnected&&Z(this.render(),this._renderRoot)}))}_adoptStyles(){const e=this.constructor;if(e.styles.length!==0)if(e.shadow&&this.shadowRoot){const t=e.styles.map(o=>o.sheet).filter(o=>o!==null);if(this.shadowRoot.adoptedStyleSheets=t,t.length!==e.styles.length){for(const o of e.styles)if(!o.sheet){const i=document.createElement("style");i.textContent=o.cssText,this.shadowRoot.appendChild(i)}}}else this._adoptLightStyles(e)}_adoptLightStyles(e){if(!ne._lightStylesAdopted.has(e)){ne._lightStylesAdopted.add(e);for(const t of e.styles){const o=document.createElement("style");o.dataset.osUi=this.tagName.toLowerCase(),o.textContent=t.cssText,document.head.appendChild(o)}}}};ne.props=[],ne.styles=[],ne.shadow=!0,ne._lightStylesAdopted=new WeakSet;let U=ne;function W(s,e){customElements.get(s)||customElements.define(s,e)}function Pt(s){return s.replace(/[A-Z]/g,e=>"-"+e.toLowerCase())}function Js(s){return s.replace(/-([a-z])/g,(e,t)=>t.toUpperCase())}const Qs=(()=>{try{return typeof new CSSStyleSheet().replaceSync=="function"}catch{return!1}})();function R(s,...e){let t=s[0];for(let o=1;o<s.length;o++){const i=e[o-1];if(typeof i=="string"||typeof i=="number")t+=String(i);else if(i&&i.__wpdCss)t+=i.cssText;else throw new TypeError("[os-ui] css`` interpolations must be strings, numbers, or other css`` results. Got: "+typeof i);t+=s[o]}if(Qs){const o=new CSSStyleSheet;return o.replaceSync(t),{__wpdCss:!0,sheet:o,cssText:t}}return{__wpdCss:!0,sheet:null,cssText:t}}function eo(s){const e=[],t=[];let o=null,i=s.parentElement;for(;i&&!(i===document.body||i===document.documentElement);){const n=i.id||"";if(n.startsWith("wp-window-")){o=n.slice(10);break}if(i.tagName.toLowerCase()==="os-tabpanel"){const r=i.getAttribute("for");r&&t.unshift(r)}i=i.parentElement}o&&e.push(We(o));for(const n of t)e.push("tab-"+We(n));const a=s.getAttribute("label");return a&&e.push(We(a)),e.length===0?"os-unnamed":"os-"+e.filter(n=>n!=="").join("-")}function We(s){return s.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")}function Mt(s){if(s.id)return s.id;const e=eo(s);return s.id=e,e}function to(s){if(!s)return 214;let e=5381;for(let t=0;t<s.length;t++)e=Math.imul(e,33)+s.charCodeAt(t);return(e%360+360)%360}const so=R`:host{display:inline-flex;position:relative;width:var( --os-ui-avatar-size,32px );height:var( --os-ui-avatar-size,32px );flex:0 0 auto;vertical-align:middle;line-height:0;perspective:calc( var( --os-ui-avatar-size,32px ) * 8 );--os-ui-avatar-tilt-x:0deg;--os-ui-avatar-tilt-y:0deg;--os-ui-avatar-hover:0;--os-ui-avatar-glare-x:50%;--os-ui-avatar-glare-y:50%}:host( [ hidden ] ){display:none}.os-avatar__tile{position:relative;width:100%;height:100%;border-radius:50%;overflow:hidden;background:var( --os-window-bg,#f0f0f1 );color:var( --os-ui-fg-on-accent,#fff );display:flex;align-items:center;justify-content:center;font-weight:700;font-size:calc( var( --os-ui-avatar-size,32px ) * 0.48 );line-height:1;letter-spacing:0;font-feature-settings:'tnum' 1;user-select:none;transform-style:preserve-3d;transform:rotateX( var( --os-ui-avatar-tilt-x ) ) rotateY( var( --os-ui-avatar-tilt-y ) ) scale( calc( 1 + var( --os-ui-avatar-hover ) * 0.07 ) );transition:transform 220ms cubic-bezier( 0.2,0.8,0.2,1 ),box-shadow 220ms cubic-bezier( 0.2,0.8,0.2,1 );box-shadow:inset 0 0 0 1px rgba( 255,255,255,calc( 0.18 + 0.22 * var( --os-ui-avatar-hover ) ) ),inset 0 0 0 calc( 1px + var( --os-ui-avatar-hover ) * 1px ) rgba( 0,0,0,calc( 0.08 + 0.04 * var( --os-ui-avatar-hover ) ) ),0 calc( 1px + var( --os-ui-avatar-hover ) * 8px ) calc( 6px + var( --os-ui-avatar-hover ) * 18px ) rgba( 0,0,0,calc( 0.08 + 0.18 * var( --os-ui-avatar-hover ) ) )}.os-avatar__tile::after{content:'';position:absolute;inset:0;border-radius:50%;background:radial-gradient( circle at var( --os-ui-avatar-glare-x ) var( --os-ui-avatar-glare-y ),var( --os-ui-scrim,rgba( 255,255,255,0.55 ) ) 0%,var( --os-ui-hover,rgba( 255,255,255,0 ) ) 55% );opacity:var( --os-ui-avatar-hover );mix-blend-mode:overlay;pointer-events:none;transition:opacity 220ms cubic-bezier( 0.2,0.8,0.2,1 )}.os-avatar__tile::before{content:'';position:absolute;inset:calc( var( --os-ui-avatar-hover ) * -3px );border-radius:50%;background:radial-gradient( circle at var( --os-ui-avatar-glare-x ) var( --os-ui-avatar-glare-y ),color-mix( in srgb,var( --os-ui-avatar-halo,rgb( 99,102,241 ) ) calc( 35% * var( --os-ui-avatar-hover ) ),transparent ) 0%,transparent 70% );filter:blur( 4px );pointer-events:none;z-index:-1;transition:inset 220ms cubic-bezier( 0.2,0.8,0.2,1 ),background 220ms}.os-avatar__tile img{width:calc( 100% + 2px );height:calc( 100% + 2px );margin:-1px;object-fit:cover;display:block;transform:translateZ( 1px )}.os-avatar__dot{position:absolute;bottom:0;inset-inline-end:0;width:calc( var( --os-ui-avatar-size,32px ) * 0.32 );height:calc( var( --os-ui-avatar-size,32px ) * 0.32 );min-width:8px;min-height:8px;border-radius:50%;box-sizing:border-box;border:2px solid var( --os-ui-avatar-dot-ring,var( --os-window-bg,#fff ) );background:var( --os-ui-avatar-dot-color,transparent );z-index:2}.os-avatar__dot--online{background:var( --os-ui-success-fg,#00a32a )}.os-avatar__dot--online::after{content:'';position:absolute;inset:-2px;border-radius:50%;border:1px solid var( --os-ui-success-fg,#00a32a );animation:os-avatar-presence 6s var( --os-ui-ease-out,cubic-bezier( 0.22,0.9,0.28,1 ) ) infinite;pointer-events:none}@keyframes os-avatar-presence{0%{opacity:0.6;transform:scale( 1 )}20%{opacity:0;transform:scale( 2.2 )}100%{opacity:0;transform:scale( 2.2 )}}.os-avatar__dot--inactive{background:var( --os-ui-warning-fg,#dba617 )}.os-avatar__dot--offline{background:var( --os-ui-fg-muted,#8c8f94 )}@media ( prefers-reduced-motion:reduce ){.os-avatar__dot--online::after{animation:none;opacity:0.6}.os-avatar__tile{transform:none;transition:box-shadow 200ms}.os-avatar__tile::after,.os-avatar__tile::before{display:none}}`,Lt={xs:20,sm:24,md:40,lg:64,xl:96},Rt=new Set(["online","inactive","offline"]),me=class me extends U{constructor(){super(...arguments),this._presenceHandler=null,this._imgFailed=!1,this._onPointerMove=null,this._onPointerEnter=null,this._onPointerLeave=null,this._tiltRaf=0,this._pendingTiltX="0deg",this._pendingTiltY="0deg",this._pendingGlareX="50%",this._pendingGlareY="50%"}connectedCallback(){super.connectedCallback(),this._maybeAttachPresenceListener(),this._attachHoverEffect()}disconnectedCallback(){this._presenceHandler&&(document.removeEventListener("os-presence-changed",this._presenceHandler),this._presenceHandler=null),this._detachHoverEffect()}attributeChangedCallback(e,t,o){super.attributeChangedCallback(e,t,o),e==="src"&&(this._imgFailed=!1),(e==="user-id"||e==="presence")&&this._maybeAttachPresenceListener()}render(){const e=this._attr("src"),t=this._attr("name")||"",o=this._attr("alt"),i=o!==null?o:t,a=this._attr("size"),n=this._resolveSize(a),r=this._presenceForRender(),l=this._attr("clickable")!==null;this.style.setProperty("--os-ui-avatar-size",`${n}px`);const c=e&&!this._imgFailed?"":this._initialsBg(t),d=e&&!this._imgFailed?b`<img
14 14 src=${e}
15 15 alt=${i}
16 16 @error=${()=>this._onImgError()}
17 17 loading="lazy"
@@ -23,9 +23,9 @@
23 23 type="button"
24 24 class="os-avatar__tile"
25 25 aria-label=${i||"User"}
26 26 style=${c?`background:${c};`:""}
27 - @click=${h=>this._onClick(h)}
27 + @click=${g=>this._onClick(g)}
28 28 >${d}</button>
29 29 ${p}
30 30 `:b`
31 31 <div
@@ -34,11 +34,11 @@
34 34 aria-label=${i||"User"}
35 35 style=${c?`background:${c};`:""}
36 36 >${d}</div>
37 37 ${p}
38 - `}_attr(e){return this.getAttribute(e)}_resolveSize(e){if(!e)return 32;if(e in Ct)return Ct[e];const t=Number(e);return Number.isFinite(t)&&t>0?t:32}_initials(e){const t=e.trim();return t?Array.from(t)[0]?.toUpperCase()??"?":"?"}_initialsBg(e){const t=Ds(e);return`linear-gradient(135deg, hsl(${t} 62% 55%), hsl(${(t+24)%360} 58% 42%))`}_presenceForRender(){const e=this._attr("presence");return e&&St.has(e)?e:null}_presenceLabel(e){switch(e){case"online":return"Online";case"inactive":return"Inactive";case"offline":return"Offline"}}_onImgError(){this._imgFailed=!0,this.requestUpdate()}_onClick(e){const t=this._attr("user-id"),s={userId:t!==null&&Number(t)||null,originalEvent:e};this.emit("os-avatar-click",s)}_attachHoverEffect(){typeof window<"u"&&window.matchMedia?.("(prefers-reduced-motion: reduce)").matches||(this._onPointerEnter=()=>{this.style.setProperty("--os-ui-avatar-hover","1")},this._onPointerLeave=()=>{this.style.setProperty("--os-ui-avatar-hover","0"),this._pendingTiltX="0deg",this._pendingTiltY="0deg",this._pendingGlareX="50%",this._pendingGlareY="50%",this._flushTilt()},this._onPointerMove=t=>{const s=this.getBoundingClientRect();if(s.width===0||s.height===0)return;const i=(t.clientX-s.left)/s.width-.5,a=(t.clientY-s.top)/s.height-.5,n=14;this._pendingTiltY=`${(i*n).toFixed(2)}deg`,this._pendingTiltX=`${(-a*n).toFixed(2)}deg`;const r=Math.max(0,Math.min(100,(i+.5)*100)),l=Math.max(0,Math.min(100,(a+.5)*100));this._pendingGlareX=`${r.toFixed(1)}%`,this._pendingGlareY=`${l.toFixed(1)}%`,this._tiltRaf||(this._tiltRaf=requestAnimationFrame(()=>this._flushTilt()))},this.addEventListener("pointerenter",this._onPointerEnter),this.addEventListener("pointerleave",this._onPointerLeave),this.addEventListener("pointermove",this._onPointerMove))}_flushTilt(){this._tiltRaf=0,this.style.setProperty("--os-ui-avatar-tilt-x",this._pendingTiltX),this.style.setProperty("--os-ui-avatar-tilt-y",this._pendingTiltY),this.style.setProperty("--os-ui-avatar-glare-x",this._pendingGlareX),this.style.setProperty("--os-ui-avatar-glare-y",this._pendingGlareY)}_detachHoverEffect(){this._onPointerMove&&(this.removeEventListener("pointermove",this._onPointerMove),this._onPointerMove=null),this._onPointerEnter&&(this.removeEventListener("pointerenter",this._onPointerEnter),this._onPointerEnter=null),this._onPointerLeave&&(this.removeEventListener("pointerleave",this._onPointerLeave),this._onPointerLeave=null),this._tiltRaf&&(cancelAnimationFrame(this._tiltRaf),this._tiltRaf=0)}_maybeAttachPresenceListener(){const e=this._attr("user-id"),t=this._attr("presence"),s=!!e&&!t;s&&!this._presenceHandler?(this._presenceHandler=i=>{const a=i.detail;a&&String(a.userId)===String(e)&&a.newStatus&&St.has(a.newStatus)&&this.setAttribute("presence",a.newStatus)},document.addEventListener("os-presence-changed",this._presenceHandler)):!s&&this._presenceHandler&&(document.removeEventListener("os-presence-changed",this._presenceHandler),this._presenceHandler=null)}};me.props=["src","alt","name","size","presence","userId","clickable"],me.styles=[qs],me.help=void 0;let Ve=me;U("os-avatar",Ve);const Hs=P`:host{display:inline;color:inherit;font:inherit}`,Ee=new Set;let he=null;const Fs=3e4;function Us(){he===null&&(he=window.setInterval(()=>{for(const o of Ee)o.tick()},Fs))}function Vs(){he!==null&&Ee.size===0&&(window.clearInterval(he),he=null)}function Ws(o){if(!o)return null;const e=t=>{const s=new Date(t);return Number.isNaN(s.getTime())?null:s};return js(o)?e(o):e(o.replace(" ","T")+"Z")}function js(o){const e=Math.max(o.indexOf("T"),o.indexOf(" ")),t=e===-1?"":o.slice(e+1);return/(?:[Zz]|[+-]\d{2}:?\d{2})$/.test(t)}let We=null,je=null;function At(){return typeof navigator<"u"&&navigator.language||"en"}function Ks(){return We||(We=new Intl.RelativeTimeFormat(At(),{numeric:"auto"})),We}function zt(){return je||(je=new Intl.RelativeTimeFormat(At(),{numeric:"always",style:"narrow"})),je}function Bs(o,e){const t=Ks(),s=o.getTime()-e,i=Math.round(s/1e3),a=Math.abs;return a(i)<45?t.format(0,"second"):Et(t,i)}function Et(o,e){const t=Math.abs,s=Math.round(e/60);if(t(s)<45)return o.format(s,"minute");const i=Math.round(s/60);if(t(i)<22)return o.format(i,"hour");const a=Math.round(i/24);if(t(a)<26)return o.format(a,"day");const n=Math.round(a/30);if(t(n)<11)return o.format(n,"month");const r=Math.round(a/365);return o.format(r,"year")}function Gs(o,e){const t=Math.round((o.getTime()-e)/1e3),s=Math.abs;return s(t)<45?zt().format(0,"second"):s(t)>604800?o.toLocaleDateString(void 0,{month:"short",day:"numeric"}):Et(zt(),t)}const be=class be extends q{connectedCallback(){super.connectedCallback(),Ee.add(this),Us()}disconnectedCallback(){Ee.delete(this),Vs()}tick(){this.requestUpdate()}render(){const e=this.datetime,t=Ws(e);if(!t)return b`<span>${e??""}</span>`;const s=Date.now(),i=this.hasAttribute("compact")?Gs(t,s):Bs(t,s),a=t.toLocaleString();return b`<time datetime=${t.toISOString()} title=${a}
38 + `}_attr(e){return this.getAttribute(e)}_resolveSize(e){if(!e)return 32;if(e in Lt)return Lt[e];const t=Number(e);return Number.isFinite(t)&&t>0?t:32}_initials(e){const t=e.trim();return t?Array.from(t)[0]?.toUpperCase()??"?":"?"}_initialsBg(e){const t=to(e);return`linear-gradient(135deg, hsl(${t} 62% 55%), hsl(${(t+24)%360} 58% 42%))`}_presenceForRender(){const e=this._attr("presence");return e&&Rt.has(e)?e:null}_presenceLabel(e){switch(e){case"online":return"Online";case"inactive":return"Inactive";case"offline":return"Offline"}}_onImgError(){this._imgFailed=!0,this.requestUpdate()}_onClick(e){const t=this._attr("user-id"),o={userId:t!==null&&Number(t)||null,originalEvent:e};this.emit("os-avatar-click",o)}_attachHoverEffect(){typeof window<"u"&&window.matchMedia?.("(prefers-reduced-motion: reduce)").matches||(this._onPointerEnter=()=>{this.style.setProperty("--os-ui-avatar-hover","1")},this._onPointerLeave=()=>{this.style.setProperty("--os-ui-avatar-hover","0"),this._pendingTiltX="0deg",this._pendingTiltY="0deg",this._pendingGlareX="50%",this._pendingGlareY="50%",this._flushTilt()},this._onPointerMove=t=>{const o=this.getBoundingClientRect();if(o.width===0||o.height===0)return;const i=(t.clientX-o.left)/o.width-.5,a=(t.clientY-o.top)/o.height-.5,n=14;this._pendingTiltY=`${(i*n).toFixed(2)}deg`,this._pendingTiltX=`${(-a*n).toFixed(2)}deg`;const r=Math.max(0,Math.min(100,(i+.5)*100)),l=Math.max(0,Math.min(100,(a+.5)*100));this._pendingGlareX=`${r.toFixed(1)}%`,this._pendingGlareY=`${l.toFixed(1)}%`,this._tiltRaf||(this._tiltRaf=requestAnimationFrame(()=>this._flushTilt()))},this.addEventListener("pointerenter",this._onPointerEnter),this.addEventListener("pointerleave",this._onPointerLeave),this.addEventListener("pointermove",this._onPointerMove))}_flushTilt(){this._tiltRaf=0,this.style.setProperty("--os-ui-avatar-tilt-x",this._pendingTiltX),this.style.setProperty("--os-ui-avatar-tilt-y",this._pendingTiltY),this.style.setProperty("--os-ui-avatar-glare-x",this._pendingGlareX),this.style.setProperty("--os-ui-avatar-glare-y",this._pendingGlareY)}_detachHoverEffect(){this._onPointerMove&&(this.removeEventListener("pointermove",this._onPointerMove),this._onPointerMove=null),this._onPointerEnter&&(this.removeEventListener("pointerenter",this._onPointerEnter),this._onPointerEnter=null),this._onPointerLeave&&(this.removeEventListener("pointerleave",this._onPointerLeave),this._onPointerLeave=null),this._tiltRaf&&(cancelAnimationFrame(this._tiltRaf),this._tiltRaf=0)}_maybeAttachPresenceListener(){const e=this._attr("user-id"),t=this._attr("presence"),o=!!e&&!t;o&&!this._presenceHandler?(this._presenceHandler=i=>{const a=i.detail;a&&String(a.userId)===String(e)&&a.newStatus&&Rt.has(a.newStatus)&&this.setAttribute("presence",a.newStatus)},document.addEventListener("os-presence-changed",this._presenceHandler)):!o&&this._presenceHandler&&(document.removeEventListener("os-presence-changed",this._presenceHandler),this._presenceHandler=null)}};me.props=["src","alt","name","size","presence","userId","clickable"],me.styles=[so],me.help=void 0;let je=me;W("os-avatar",je);const oo=R`:host{display:inline;color:inherit;font:inherit}`,ze=new Set;let he=null;const io=3e4;function no(){he===null&&(he=window.setInterval(()=>{for(const s of ze)s.tick()},io))}function ao(){he!==null&&ze.size===0&&(window.clearInterval(he),he=null)}function ro(s){if(!s)return null;const e=t=>{const o=new Date(t);return Number.isNaN(o.getTime())?null:o};return lo(s)?e(s):e(s.replace(" ","T")+"Z")}function lo(s){const e=Math.max(s.indexOf("T"),s.indexOf(" ")),t=e===-1?"":s.slice(e+1);return/(?:[Zz]|[+-]\d{2}:?\d{2})$/.test(t)}let Ke=null,Be=null;function It(){return typeof navigator<"u"&&navigator.language||"en"}function co(){return Ke||(Ke=new Intl.RelativeTimeFormat(It(),{numeric:"auto"})),Ke}function Nt(){return Be||(Be=new Intl.RelativeTimeFormat(It(),{numeric:"always",style:"narrow"})),Be}function po(s,e){const t=co(),o=s.getTime()-e,i=Math.round(o/1e3),a=Math.abs;return a(i)<45?t.format(0,"second"):Ot(t,i)}function Ot(s,e){const t=Math.abs,o=Math.round(e/60);if(t(o)<45)return s.format(o,"minute");const i=Math.round(o/60);if(t(i)<22)return s.format(i,"hour");const a=Math.round(i/24);if(t(a)<26)return s.format(a,"day");const n=Math.round(a/30);if(t(n)<11)return s.format(n,"month");const r=Math.round(a/365);return s.format(r,"year")}function uo(s,e){const t=Math.round((s.getTime()-e)/1e3),o=Math.abs;return o(t)<45?Nt().format(0,"second"):o(t)>604800?s.toLocaleDateString(void 0,{month:"short",day:"numeric"}):Ot(Nt(),t)}const be=class be extends U{connectedCallback(){super.connectedCallback(),ze.add(this),no()}disconnectedCallback(){ze.delete(this),ao()}tick(){this.requestUpdate()}render(){const e=this.datetime,t=ro(e);if(!t)return b`<span>${e??""}</span>`;const o=Date.now(),i=this.hasAttribute("compact")?uo(t,o):po(t,o),a=t.toLocaleString();return b`<time datetime=${t.toISOString()} title=${a}
39 39 >${i}</time
40 - >`}};be.props=["datetime","compact"],be.styles=[Hs],be.help=void 0;let Ke=be;U("os-relative-time",Ke);function Z(o,e,t,s){const i=`${e}|${t}`,a=o.get(i);if(a)return a;const n=s();return o.set(i,n),n}const Be={publish:u("Published"),future:u("Scheduled"),draft:u("Draft"),pending:u("Pending"),private:u("Private"),trash:u("Trash")};function Zs(o){switch(o){case"publish":return{bg:"var(--os-ui-surface-raised, #e6f4ea)",fg:"var(--os-ui-success-fg, #1d6f42)"};case"draft":return{bg:"var(--os-ui-surface-raised, #fdecea)",fg:"var(--os-ui-danger, #a02622)"};case"pending":return{bg:"var(--os-ui-warning-bg, #fef7e0)",fg:"var(--os-ui-warning-fg, #8a6d00)"};case"private":return{bg:"var(--os-ui-info-bg, #e8f0fe)",fg:"var(--os-ui-info-fg, #1a52a8)"};case"future":return{bg:"var(--os-ui-surface-raised, #ede7f6)",fg:"var(--os-ui-accent, #5b3aa0)"};default:return{bg:"var(--os-ui-surface-raised, #f1f1f2)",fg:"var(--os-ui-fg-muted, #50575e)"}}}function Te(o,e){const t=o.editPostUrlBase??"",s=t.includes("?")?"&":"?";return`${t}${s}post=${e}&action=edit`}function Ge(o){const e=o._embedded?.author?.[0];return e?{id:e.id,name:e.name,avatar:Ms(e.avatar_urls)||void 0}:{id:o.author,name:u("Unknown")}}function Xs(o,e){for(const t of o._embedded?.["wp:term"]??[])if(t.length>0&&t[0].taxonomy===e)return t.map(s=>({id:s.id,name:s.name}));return[]}function Ze(o){const e=o._embedded?.["wp:featuredmedia"]?.[0];if(!e)return null;const t=e.media_details?.sizes??{};return{url:t.thumbnail?.source_url??t.medium?.source_url??e.source_url,alt:e.alt_text??""}}function re(o){return ue(o.title.rendered)}function Pe(o,e,t={}){const s=document.createElement("span");s.style.cssText=["display:inline-flex","align-items:center","gap:4px","padding:2px 8px","border-radius:10px","font-size:11px","font-weight:600",t.uppercase?"text-transform:uppercase;letter-spacing:0.04em":"",`background:${e.bg}`,`color:${e.fg}`,"white-space:nowrap","flex-shrink:0"].filter(Boolean).join(";"),t.icon&&s.appendChild(t.icon);const i=document.createElement("span");return i.textContent=o,s.appendChild(i),t.title&&(s.title=t.title),s}function Tt(o,e=13){const t=document.createElement("span");return t.className=`dashicons ${o}`,t.setAttribute("aria-hidden","true"),t.style.cssText=`font-size:${e}px;width:${e}px;height:${e}px;line-height:1;`,t}function Ys(){const o=document.createElement("span");return o.setAttribute("aria-hidden","true"),o.style.cssText="font-family:dashicons;font-size:14px;line-height:1;display:inline-block;speak:none;-webkit-font-smoothing:antialiased",o.textContent="",o}function Pt(o){o.addEventListener("mouseenter",()=>{o.style.textDecoration="underline"}),o.addEventListener("mouseleave",()=>{o.style.textDecoration="none"})}function Js(o,e){const t=document.createElement("span");t.style.cssText="display:flex;flex-direction:column;gap:4px;min-width:0;";const s=document.createElement("span");s.style.cssText="display:flex;align-items:center;gap:8px;min-width:0;";const i=document.createElement("a");i.href=Te(e.extra,o.id),i.setAttribute("data-noclick","");const a=re(o)||u("(no title)");i.textContent=a,i.title=a,i.style.cssText="font-weight:600;color:inherit;text-decoration:none;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:340px;",Pt(i),i.addEventListener("click",l=>{l.preventDefault(),l.stopPropagation(),e.openUrl(i.href,a,"dashicons-admin-post")}),s.appendChild(i);const n=o.openstation_lock??null;n&&s.appendChild(Pe(n.userName,{fg:"var(--os-ui-danger, #b32d2e)",bg:"var(--os-ui-surface-raised, rgba(179, 45, 46, 0.1))"},{icon:Ys(),title:O(u("%s is currently editing"),n.userName)}));const r=e.extra.mode==="pages";if(r&&typeof e.extra.frontPageId=="number"&&e.extra.frontPageId===o.id&&s.appendChild(Pe(u("Front page"),{fg:"var(--os-ui-info-fg, #0a4b78)",bg:"var(--os-ui-info-bg, rgba(34,113,177,0.12))"},{icon:Tt("dashicons-admin-home")})),r&&typeof e.extra.postsPageId=="number"&&e.extra.postsPageId===o.id&&s.appendChild(Pe(u("Posts page"),{fg:"var(--os-ui-accent, #5b3aa0)",bg:"var(--os-ui-surface-raised, rgba(91,58,160,0.12))"},{icon:Tt("dashicons-admin-post")})),o.status&&o.status!=="publish"&&s.appendChild(Pe(Be[o.status]??o.status,Zs(o.status),{uppercase:!0})),r&&typeof o.link=="string"&&o.link&&o.status==="publish"){const l=document.createElement("a");l.href=o.link,l.target="_blank",l.rel="noreferrer noopener",l.textContent=u("View"),l.title=o.link,l.setAttribute("data-noclick",""),l.style.cssText="font-size:11px;color:var(--wp-admin-theme-color, #2271b1);text-decoration:none;flex-shrink:0;",l.addEventListener("click",c=>c.stopPropagation()),Pt(l),s.appendChild(l)}return t.appendChild(s),t}function Qs(o){const e=Ge(o),t=document.createElement("span");t.style.cssText="display:inline-flex;align-items:center;gap:8px;min-width:0;";const s=document.createElement("os-avatar");s.setAttribute("size","24"),e.name&&s.setAttribute("name",e.name),e.id>0&&s.setAttribute("user-id",String(e.id)),e.avatar&&Rs(s,e.avatar),t.appendChild(s);const i=document.createElement("span");return i.textContent=e.name,i.style.cssText="overflow:hidden;text-overflow:ellipsis;white-space:nowrap;",t.appendChild(i),t}function eo(o){const e=document.createElement("span");e.style.cssText="display:flex;flex-direction:column;line-height:1.2;";const t=document.createElement("os-relative-time");if(t.setAttribute("datetime",o.date_gmt||o.date),e.appendChild(t),o.modified_gmt&&o.modified_gmt!==o.date_gmt){const s=document.createElement("span");s.textContent=u("modified"),s.style.cssText="font-size:11px;color:var(--os-ui-fg-muted, #646970);",e.appendChild(s)}return e}function to(o){const e=document.createElement("div");e.style.cssText="display:flex;gap:16px;padding:12px 16px;background:var(--os-ui-surface-sunken, #fafafa);align-items:flex-start;";const t=Ze(o);if(t){const r=document.createElement("img");r.src=t.url,r.alt=t.alt,r.loading="lazy",r.style.cssText="width:96px;height:96px;border-radius:6px;object-fit:cover;flex-shrink:0;",e.appendChild(r)}const s=document.createElement("div");s.style.cssText="flex:1;min-width:0;display:flex;flex-direction:column;gap:6px;";const i=document.createElement("div");i.style.cssText="font-size:13px;color:var(--os-ui-fg-muted, #646970);text-transform:uppercase;letter-spacing:0.04em;",i.textContent=u("Excerpt"),s.appendChild(i);const a=document.createElement("div");a.style.cssText="color:var(--os-ui-fg, #1d2327);line-height:1.5;";const n=o.excerpt?.rendered??"";return n?a.textContent=ue(n.replace(/<[^>]+>/g,"").trim())||u("(no excerpt)"):(a.textContent=u("(no excerpt)"),a.style.color="var(--os-ui-fg-muted, #a7aaad)"),s.appendChild(a),e.appendChild(s),e}const Lt={close:{a:'fill="currentColor"',b:'<path d="m13.06 12 6.47-6.47-1.06-1.06L12 10.94 5.53 4.47 4.47 5.53 10.94 12l-6.47 6.47 1.06 1.06L12 13.06l6.47 6.47 1.06-1.06L13.06 12Z" />'},check:{a:'fill="currentColor"',b:'<path d="M16.5 7.5 10 13.9l-2.5-2.4-1 1 3.5 3.6 7.5-7.6z" />'},"chevron-right":{a:'fill="currentColor"',b:'<path d="M10.6 6L9.4 7l4.6 5-4.6 5 1.2 1 5.4-6z" />'},"arrow-up-right":{a:'fill="currentColor"',b:'<path d="M10 6H18V14H16.5V8.5L7 18L6 17L15.5 7.5H10V6Z" />'},plus:{a:'fill="currentColor"',b:'<path d="M11 12.5V17.5H12.5V12.5H17.5V11H12.5V6H11V11H6V12.5H11Z" />'},search:{a:'fill="currentColor"',b:'<path d="M13 5c-3.3 0-6 2.7-6 6 0 1.4.5 2.7 1.3 3.7l-3.8 3.8 1.1 1.1 3.8-3.8c1 .8 2.3 1.3 3.7 1.3 3.3 0 6-2.7 6-6S16.3 5 13 5zm0 10.5c-2.5 0-4.5-2-4.5-4.5s2-4.5 4.5-4.5 4.5 2 4.5 4.5-2 4.5-4.5 4.5z" />'},pin:{a:'fill="currentColor"',b:'<path d="m21.5 9.1-6.6-6.6-4.2 5.6c-1.2-.1-2.4.1-3.6.7-.1 0-.1.1-.2.1-.5.3-.9.6-1.2.9l3.7 3.7-5.7 5.7v1.1h1.1l5.7-5.7 3.7 3.7c.4-.4.7-.8.9-1.2.1-.1.1-.2.2-.3.6-1.1.8-2.4.6-3.6l5.6-4.1zm-7.3 3.5.1.9c.1.9 0 1.8-.4 2.6l-6-6c.8-.4 1.7-.5 2.6-.4l.9.1L15 4.9 19.1 9l-4.9 3.6z" />'},trash:{a:'fill="currentColor"',b:'<path fill-rule="evenodd" clip-rule="evenodd" d="M12 5.5A2.25 2.25 0 0 0 9.878 7h4.244A2.251 2.251 0 0 0 12 5.5ZM12 4a3.751 3.751 0 0 0-3.675 3H5v1.5h1.27l.818 8.997a2.75 2.75 0 0 0 2.739 2.501h4.347a2.75 2.75 0 0 0 2.738-2.5L17.73 8.5H19V7h-3.325A3.751 3.751 0 0 0 12 4Zm4.224 4.5H7.776l.806 8.861a1.25 1.25 0 0 0 1.245 1.137h4.347a1.25 1.25 0 0 0 1.245-1.137l.805-8.861Z" />'},download:{a:'fill="currentColor"',b:'<path d="M18 11.3l-1-1.1-4 4V3h-1.5v11.3L7 10.2l-1 1.1 6.2 5.8 5.8-5.8zm.5 3.7v3.5h-13V15H4v5h16v-5h-1.5z" />'},settings:{a:'fill="currentColor"',b:'<path d="m19 7.5h-7.628c-.3089-.87389-1.1423-1.5-2.122-1.5-.97966 0-1.81309.62611-2.12197 1.5h-2.12803v1.5h2.12803c.30888.87389 1.14231 1.5 2.12197 1.5.9797 0 1.8131-.62611 2.122-1.5h7.628z" /><path d="m19 15h-2.128c-.3089-.8739-1.1423-1.5-2.122-1.5s-1.8131.6261-2.122 1.5h-7.628v1.5h7.628c.3089.8739 1.1423 1.5 2.122 1.5s1.8131-.6261 2.122-1.5h2.128z" />'},info:{a:'fill="currentColor"',b:'<path fill-rule="evenodd" clip-rule="evenodd" d="M5.5 12a6.5 6.5 0 1 0 13 0 6.5 6.5 0 0 0-13 0ZM12 4a8 8 0 1 0 0 16 8 8 0 0 0 0-16Zm.75 4v1.5h-1.5V8h1.5Zm0 8v-5h-1.5v5h1.5Z" />'},bell:{a:'fill="currentColor"',b:'<path fill-rule="evenodd" clip-rule="evenodd" d="M17 11.5c0 1.353.17 2.368.976 3 .266.209.602.376 1.024.5v1H5v-1c.422-.124.757-.291 1.024-.5.806-.632.976-1.647.976-3V9c0-2.8 2.2-5 5-5s5 2.2 5 5v2.5ZM15.5 9v2.5c0 .93.066 1.98.515 2.897l.053.103H7.932a4.018 4.018 0 0 0 .053-.103c.449-.917.515-1.967.515-2.897V9c0-1.972 1.528-3.5 3.5-3.5s3.5 1.528 3.5 3.5Zm-5.492 9.008c0-.176.023-.346.065-.508h3.854A1.996 1.996 0 0 1 12 20c-1.1 0-1.992-.892-1.992-1.992Z" />'},more:{a:'fill="currentColor"',b:'<path d="M11 13h2v-2h-2v2zm-6 0h2v-2H5v2zm12-2v2h2v-2h-2z" />'},maximize:{a:'fill="currentColor"',b:'<path d="M6 4a2 2 0 0 0-2 2v3h1.5V6a.5.5 0 0 1 .5-.5h3V4H6Zm3 14.5H6a.5.5 0 0 1-.5-.5v-3H4v3a2 2 0 0 0 2 2h3v-1.5Zm6 1.5v-1.5h3a.5.5 0 0 0 .5-.5v-3H20v3a2 2 0 0 1-2 2h-3Zm3-16a2 2 0 0 1 2 2v3h-1.5V6a.5.5 0 0 0-.5-.5h-3V4h3Z" />'},edit:{a:'fill="currentColor"',b:'<path d="m19 7-3-3-8.5 8.5-1 4 4-1L19 7Zm-7 11.5H5V20h7v-1.5Z" />'},color:{a:'fill="currentColor"',b:'<path d="M17.2 10.9c-.5-1-1.2-2.1-2.1-3.2-.6-.9-1.3-1.7-2.1-2.6L12 4l-1 1.1c-.6.9-1.3 1.7-2 2.6-.8 1.2-1.5 2.3-2 3.2-.6 1.2-1 2.2-1 3 0 3.4 2.7 6.1 6.1 6.1s6.1-2.7 6.1-6.1c0-.8-.3-1.8-1-3zm-5.1 7.6c-2.5 0-4.6-2.1-4.6-4.6 0-.3.1-1 .8-2.3.5-.9 1.1-1.9 2-3.1.7-.9 1.3-1.7 1.8-2.3.7.8 1.3 1.6 1.8 2.3.8 1.1 1.5 2.2 2 3.1.7 1.3.8 2 .8 2.3 0 2.5-2.1 4.6-4.6 4.6z" />'},wallpaper:{a:'fill="currentColor"',b:'<path d="M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zM5 4.5h14c.3 0 .5.2.5.5v8.4l-3-2.9c-.3-.3-.8-.3-1 0L11.9 14 9 12c-.3-.2-.6-.2-.8 0l-3.6 2.6V5c-.1-.3.1-.5.4-.5zm14 15H5c-.3 0-.5-.2-.5-.5v-2.4l4.1-3 3 1.9c.3.2.7.2.9-.1L16 12l3.5 3.4V19c0 .3-.2.5-.5.5z" />'},warning:{a:'fill="currentColor"',b:'<path fill-rule="evenodd" clip-rule="evenodd" d="M5.5 12a6.5 6.5 0 1 0 13 0 6.5 6.5 0 0 0-13 0ZM12 4a8 8 0 1 0 0 16 8 8 0 0 0 0-16Zm-.75 12v-1.5h1.5V16h-1.5Zm0-8v5h1.5V8h-1.5Z" />'},minimize:{a:'fill="currentColor"',b:'<path d="M5 11.25h14v1.5H5z" />'},window:{a:'fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"',b:'<rect x="4.125" y="5.4375" width="15.75" height="13.125" rx="1.75"/><path d="M4.125 9.8125h15.75"/><circle cx="7.275" cy="7.625" r="0.7438" fill="currentColor" stroke="none"/>'},windows:{a:'fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"',b:'<rect x="3.6875" y="8.5" width="11.375" height="10.0625" rx="1.75"/><path d="M3.6875 12h11.375"/><path d="M8.5 8.5V7.1875a1.75 1.75 0 0 1 1.75-1.75h7.875A1.75 1.75 0 0 1 19.875 7.1875v7a1.75 1.75 0 0 1-1.75 1.75h-3.0625"/>'},dock:{a:'fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"',b:'<rect x="3.25" y="8.5" width="17.5" height="7" rx="3.5"/><circle cx="7.625" cy="12" r="1.0062" fill="currentColor" stroke="none"/><circle cx="12" cy="12" r="1.0062" fill="currentColor" stroke="none"/><circle cx="16.375" cy="12" r="1.0062" fill="currentColor" stroke="none"/>'},spaces:{a:'fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"',b:'<rect x="3.6875" y="5.4375" width="7.4375" height="7.875" rx="1.75"/><rect x="12.875" y="5.4375" width="7.4375" height="7.875" rx="1.75"/><circle cx="9.375" cy="17.6875" r="0.7875" fill="currentColor" stroke="none"/><circle cx="12" cy="17.6875" r="0.7875" fill="currentColor" stroke="none"/><circle cx="14.625" cy="17.6875" r="0.7875" fill="currentColor" stroke="none"/>'},copilot:{a:'fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"',b:'<path d="M10 2.5Q10.9 8.5 17.5 10Q10.9 11.5 10 17.5Q9.1 11.5 2.5 10Q9.1 8.5 10 2.5Z" fill="currentColor" stroke="none"/><path d="M17.9 14Q18.35 17.1 21.5 17.6Q18.35 18.1 17.9 21.2Q17.45 18.1 14.3 17.6Q17.45 17.1 17.9 14Z" fill="currentColor" stroke="none"/>'},snap:{a:'fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"',b:'<rect x="3.6875" y="5.4375" width="16.625" height="13.125" rx="1.75"/><path d="M12 5.4375v13.125"/><path d="M12 12h8.3125"/>'},command:{a:'fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"',b:'<path d="M14.625 6.75v10.5a2.625 2.625 0 1 0 2.625-2.625H6.75a2.625 2.625 0 1 0 2.625 2.625V6.75a2.625 2.625 0 1 0-2.625 2.625h10.5a2.625 2.625 0 1 0-2.625-2.625"/>'},apps:{a:'fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"',b:'<rect x="4.125" y="4.125" width="6.5625" height="6.5625" rx="1.75"/><rect x="13.3125" y="4.125" width="6.5625" height="6.5625" rx="1.75"/><rect x="4.125" y="13.3125" width="6.5625" height="6.5625" rx="1.75"/><rect x="13.3125" y="13.3125" width="6.5625" height="6.5625" rx="1.75"/>'},widgets:{a:'fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"',b:'<rect x="3.6875" y="3.6875" width="9.625" height="9.625" rx="1.75"/><rect x="15.0625" y="3.6875" width="5.25" height="5.25" rx="1.75"/><rect x="15.0625" y="10.6875" width="5.25" height="9.625" rx="1.75"/><rect x="3.6875" y="15.0625" width="9.625" height="5.25" rx="1.75"/>'},user:{a:'fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"',b:'<circle cx="12" cy="8.9375" r="3.5"/><path d="M5.4375 19.4375a6.5625 6.5625 0 0 1 13.125 0"/>'},lock:{a:'fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"',b:'<rect x="5.4375" y="10.6875" width="13.125" height="8.75" rx="1.75"/><path d="M8.5 10.6875V8.0625a3.5 3.5 0 0 1 7 0v2.625"/>'}};function Mt(o){return o.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")}function so(o){return Object.prototype.hasOwnProperty.call(Lt,o)?Lt[o]:null}function oo(o,e={}){const t=so(o);if(!t)return"";const{size:s=24,className:i,title:a,rotate:n}=e,r=['xmlns="http://www.w3.org/2000/svg"','viewBox="0 0 24 24"'];s!=null&&r.push(`width="${s}"`,`height="${s}"`),r.push(t.a),i&&r.push(`class="${Mt(i)}"`),a?r.push('role="img"',`aria-label="${Mt(a)}"`):r.push('aria-hidden="true"','focusable="false"');const l=n?`<g transform="rotate(${n} 12 12)">${t.b}</g>`:t.b;return`<svg ${r.join(" ")}>${l}</svg>`}function X(o,e={}){const t=oo(o,e),s=document.createElement("div");s.innerHTML=t;const i=s.firstElementChild;return i instanceof SVGSVGElement?i:document.createElementNS("http://www.w3.org/2000/svg","svg")}const io=P`:host{display:flex;width:100%;min-width:0;max-width:100%;align-items:stretch}.os-cat{display:flex;flex-direction:column;align-items:stretch;gap:4px;padding:var( --os-ui-cat-padding,2px );min-height:24px;max-width:100%;width:100%}.os-cat__chips{display:inline-flex;flex-wrap:wrap;align-items:center;gap:var( --os-ui-cat-gap,4px );min-width:0}.os-cat__chains{display:flex;flex-wrap:wrap;gap:4px;min-width:0}.os-cat__viz-host{display:flex;align-items:center;gap:4px;min-width:0;flex:1 1 auto;max-width:100%;min-height:28px;cursor:pointer;position:relative}.os-cat__viz-svg{display:block;width:100%;max-width:100%;min-width:0;overflow:visible;flex:1 1 auto}.os-cat__viz-svg .os-cat-edge{fill:none;stroke:var( --os-ui-cat-edge-color,currentColor );stroke-width:1.25;stroke-linecap:round;opacity:0.55;transition:stroke-width 0.18s ease,opacity 0.18s ease}.os-cat__viz-svg .os-cat-edge[ data-active='true' ]{stroke-width:2;opacity:1}.os-cat__viz-svg .os-cat-node{cursor:pointer;transition:r 0.2s cubic-bezier( 0.34,1.56,0.64,1 ),fill 0.18s ease,stroke-width 0.18s ease,filter 0.18s ease}.os-cat__viz-svg .os-cat-node[ data-selected='true' ]{filter:drop-shadow( 0 0 6px var( --os-ui-cat-node-glow,rgba( 0,0,0,0.18 ) ) )}.os-cat__viz-svg .os-cat-node:hover,.os-cat__viz-svg .os-cat-node:focus-visible{filter:drop-shadow( 0 0 8px var( --os-ui-cat-node-glow,rgba( 0,0,0,0.3 ) ) );outline:none}.os-cat__viz-svg .os-cat-label{font-family:var( --os-ui-font,system-ui,sans-serif );font-size:10.5px;fill:var( --os-ui-cat-label-fg,var( --os-ui-fg,#1d2327 ) );font-weight:500;pointer-events:none;user-select:none}.os-cat__viz-svg .os-cat-label[ data-selected='false' ]{fill:var( --os-ui-cat-label-muted,var( --os-ui-fg-muted,#8c8f94 ) );font-weight:400;font-style:italic}.os-cat__trigger{appearance:none;display:inline-flex;align-items:center;gap:4px;padding:1px 8px;min-height:22px;font:inherit;font-size:11px;font-weight:500;line-height:1;color:var( --os-ui-cat-trigger-fg,var( --os-ui-fg-muted,#50575e ) );background:transparent;border:1px dashed var( --os-ui-cat-trigger-border,var( --os-ui-border,#c3c4c7 ) );border-radius:999px;cursor:pointer;transition:background-color 0.12s ease,color 0.12s ease,border-color 0.12s ease}.os-cat__trigger:hover:not(:disabled ){background:var( --os-ui-hover,rgba( 0,0,0,0.04 ) );color:var( --os-ui-cat-trigger-fg-hover,var( --os-ui-fg,#1d2327 ) );border-color:var( --os-ui-cat-trigger-border-hover,var( --os-ui-border-strong,#8c8f94 ) )}.os-cat__trigger:focus-visible{outline:none;border-style:solid;box-shadow:0 0 0 2px var( --wp-admin-theme-color,#2271b1 )}.os-cat__trigger svg{display:block}.os-cat__uncategorized{display:inline-flex;align-items:center;gap:4px;padding:1px 10px;min-height:22px;font-size:11px;font-weight:500;line-height:1.6;color:var( --os-ui-cat-uncat-fg,var( --os-ui-fg-muted,#8c8f94 ) );background:transparent;border:1px dashed var( --os-ui-cat-uncat-border,var( --os-ui-border,#c3c4c7 ) );border-radius:999px;font-style:italic}.os-cat__popover{position:fixed;top:0;left:0;min-width:280px;max-width:360px;max-height:360px;display:flex;flex-direction:column;background:var( --os-ui-cat-pop-bg,var( --os-ui-surface,#fff ) );color:var( --os-ui-cat-pop-fg,var( --os-ui-fg,#1d2327 ) );border:1px solid var( --os-ui-cat-pop-border,var( --os-ui-border,#c3c4c7 ) );border-radius:8px;box-shadow:0 6px 16px rgba( 0,0,0,0.08 ),0 1px 2px rgba( 0,0,0,0.06 );z-index:1000}.os-cat__editor{position:relative;display:inline-flex;align-items:center}.os-cat__search{appearance:none;font:inherit;font-size:13px;padding:8px 12px;border:0;border-bottom:1px solid var( --os-ui-cat-pop-divider,var( --os-ui-border,#f0f0f1 ) );background:transparent;color:inherit;outline:none}.os-cat__search:focus{border-bottom-color:var( --wp-admin-theme-color,#2271b1 )}.os-cat__tree{flex:1 1 auto;min-height:0;overflow-y:auto;padding:4px 0}.os-cat__row-block{display:contents}.os-cat__row{display:flex;align-items:center;gap:6px;padding:4px 8px 4px var( --os-ui-cat-row-indent,12px );cursor:pointer;user-select:none;font-size:13px;line-height:1.4;position:relative}.os-cat__row:hover,.os-cat__row[ data-focused='true' ]{background:var( --os-ui-hover,rgba( 0,0,0,0.04 ) )}.os-cat__row[ data-selected='true' ]{color:var( --wp-admin-theme-color,#2271b1 );font-weight:600}.os-cat__row::before{content:'';position:absolute;left:0;top:0;bottom:0;width:var( --os-ui-cat-guide-width,0px );border-left:1px dotted var( --os-ui-cat-guide-color,var( --os-ui-border,rgba( 0,0,0,0.08 ) ) )}.os-cat__expander{display:inline-flex;align-items:center;justify-content:center;width:14px;height:14px;border:0;background:transparent;color:inherit;cursor:pointer;flex-shrink:0;opacity:0.65}.os-cat__expander:hover{opacity:1}.os-cat__expander svg{display:block;transition:transform 0.12s ease}.os-cat__row[ data-expanded='true' ] .os-cat__expander svg{transform:rotate( 90deg )}.os-cat__expander--placeholder{visibility:hidden}.os-cat__create-row{display:flex;align-items:center;padding:2px 8px 2px var( --os-ui-cat-row-indent,28px );position:relative}.os-cat__create-row::before{content:'';position:absolute;left:0;top:0;bottom:0;width:var( --os-ui-cat-guide-width,0px );border-left:1px dotted var( --os-ui-cat-guide-color,var( --os-ui-border,rgba( 0,0,0,0.08 ) ) )}.os-cat__create-wrap{display:inline-flex;align-items:center;flex:1 1 auto;min-width:0;gap:4px;padding:1px 1px 1px 0;border:1px solid transparent;border-radius:6px;background:transparent;transition:border-color 0.12s ease,background-color 0.12s ease,box-shadow 0.12s ease}.os-cat__create-wrap:hover{border-color:var( --os-ui-border,rgba( 0,0,0,0.12 ) );background:var( --os-ui-cat-pop-bg,var( --os-ui-surface,#fff ) )}.os-cat__create-wrap:focus-within{border-color:var( --wp-admin-theme-color,#2271b1 );background:var( --os-ui-cat-pop-bg,var( --os-ui-surface,#fff ) );box-shadow:0 0 0 2px color-mix( in srgb,var( --wp-admin-theme-color,#2271b1 ) 15%,transparent )}.os-cat__create-input{flex:1 1 auto;min-width:0;appearance:none;font:inherit;font-size:var( --os-ui-field-font-size-compact,12px );padding:3px 6px;border:0;background:transparent;color:inherit;outline:none}.os-cat__create-input::placeholder{color:var( --os-ui-cat-pop-muted,var( --os-ui-fg-muted,#8c8f94 ) );font-style:italic;opacity:1}.os-cat__create-submit{appearance:none;display:inline-flex;align-items:center;justify-content:center;width:20px;height:20px;flex-shrink:0;padding:0;border:0;border-radius:4px;background:transparent;color:var( --os-ui-cat-pop-muted,var( --os-ui-fg-muted,#8c8f94 ) );cursor:pointer;transition:background-color 0.12s ease,color 0.12s ease}.os-cat__create-wrap:focus-within .os-cat__create-submit:not( [ disabled ] ){background:var( --wp-admin-theme-color,#2271b1 );color:var( --os-ui-fg-on-accent,#fff )}.os-cat__create-submit:hover:not( [ disabled ] ){filter:brightness( 1.05 )}.os-cat__create-submit[ disabled ]{cursor:default;opacity:0.5}.os-cat__create-submit svg{display:block}.os-cat__create-spinner{display:inline-block;width:12px;height:12px;margin:0 4px;border-radius:50%;border:2px solid var( --wp-admin-theme-color,#2271b1 );border-top-color:transparent;animation:os-cat-spin 0.8s linear infinite;flex-shrink:0}.os-cat__check{display:inline-flex;align-items:center;justify-content:center;width:14px;height:14px;flex-shrink:0;border:1.5px solid var( --os-ui-cat-check-border,var( --os-ui-border,#8c8f94 ) );border-radius:3px;color:transparent;transition:background-color 0.12s ease,border-color 0.12s ease,color 0.12s ease}.os-cat__row[ data-selected='true' ] .os-cat__check{background:var( --wp-admin-theme-color,#2271b1 );border-color:var( --wp-admin-theme-color,#2271b1 );color:var( --os-ui-fg-on-accent,#fff )}.os-cat__check svg{display:block;width:14px;height:14px}.os-cat__label{min-width:0;flex:1 1 auto;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.os-cat__delete{display:inline-flex;align-items:center;justify-content:center;flex:0 0 auto;width:18px;height:18px;border:0;border-radius:50%;padding:0;background:transparent;color:var( --os-ui-cat-delete-color,var( --os-ui-danger,#d63638 ) );cursor:pointer;opacity:0;transition:opacity 0.12s ease,background-color 0.12s ease}.os-cat__row:hover .os-cat__delete,.os-cat__row[ data-focused='true' ] .os-cat__delete,.os-cat__delete:focus-visible{opacity:1}.os-cat__delete:hover,.os-cat__delete:focus-visible{background:var( --os-ui-badge-danger-bg,rgba( 214,54,56,0.12 ) )}.os-cat__delete svg{display:block;width:14px;height:14px}.os-cat__match{background:var( --os-ui-search-highlight-bg,rgba( 252,211,77,0.45 ) );border-radius:2px;padding:0 1px}.os-cat__empty,.os-cat__loading{padding:12px;font-size:12px;color:var( --os-ui-cat-pop-muted,var( --os-ui-fg-muted,#646970 ) );text-align:center}.os-cat__loading-spinner{display:inline-block;width:12px;height:12px;border-radius:50%;border:2px solid currentColor;border-top-color:transparent;animation:os-cat-spin 0.8s linear infinite;margin-inline-end:8px;vertical-align:middle}@keyframes os-cat-spin{to{transform:rotate( 360deg )}}.os-cat__footer{padding:8px 12px;font-size:11px;color:var( --os-ui-cat-pop-muted,var( --os-ui-fg-muted,#646970 ) );border-top:1px solid var( --os-ui-cat-pop-divider,var( --os-ui-border,#f0f0f1 ) );border-radius:10px;background:var( --os-ui-cat-pop-footer-bg,var( --os-ui-surface,#fafafb ) );display:flex;align-items:center;gap:6px;line-height:1.4}.os-cat__footer .dashicons{font-size:14px;width:14px;height:14px;flex-shrink:0}:host( [ disabled ] ) .os-cat{opacity:0.6;pointer-events:none}`,fe=P`:host{--_holo-fill:var( --os-ui-holo-fill,${"linear-gradient( 124deg, #afa2e8 0%, #f5a8ea 46%, #8ee9f7 100% )"} );--_holo-ink:var( --os-ui-holo-ink,#0c0b0f );--_holo-sheen:var( --os-ui-holo-sheen,linear-gradient( 124deg,rgba( 159,214,255,0.1 ) 0%,rgba( 236,155,255,0.12 ) 34%,rgba( 242,82,252,0.1 ) 58%,rgba( 147,240,198,0.09 ) 100% ) );--_holo-edge:var( --os-ui-holo-edge,linear-gradient( 124deg,rgba( 154,242,255,0.7 ) 0%,rgba( 236,155,255,0.85 ) 38%,rgba( 242,82,252,0.7 ) 62%,rgba( 159,152,255,0.6 ) 100% ) );--_holo-edge-quiet:var( --os-ui-holo-edge-quiet,linear-gradient( 124deg,rgba( 154,242,255,0.22 ) 0%,rgba( 236,155,255,0.28 ) 38%,rgba( 242,82,252,0.22 ) 62%,rgba( 159,152,255,0.2 ) 100% ) );--_holo-glow:var( --os-ui-holo-glow,0 0 0 1px rgba( 242,82,252,0.28 ),0 2px 10px rgba( 242,82,252,0.22 ) );--_holo-glow-strong:var( --os-ui-holo-glow-strong,0 0 0 1px rgba( 242,82,252,0.42 ),0 4px 18px rgba( 242,82,252,0.38 ),0 1px 3px rgba( 12,11,15,0.6 ) );--_holo-track:var( --os-ui-holo-track,rgba( 255,251,255,0.16 ) );--_holo-track-edge:var( --os-ui-holo-track-edge,#8c8f94 );--_holo-ring-color:var( --os-ui-accent-dim,#2271b1 );--_holo-focus:var( --os-ui-focus-ring,0 0 0 2px rgba( 12,11,15,0.9 ),0 0 0 4px #f252fc,0 0 12px 2px rgba( 242,82,252,0.45 ) );--_holo-focus-field:var( --os-ui-focus-ring-field,0 0 0 1px #f252fc,0 0 0 4px rgba( 242,82,252,0.18 ) );--_holo-t:var( --os-ui-holo-transition,220ms );--_holo-t-fast:var( --os-ui-motion-fast,140ms );--_holo-t-slow:var( --os-ui-motion-slow,340ms );--_holo-t-ambient:var( --os-ui-motion-ambient,12s );--_holo-spring:var( --os-ui-ease-spring,cubic-bezier( 0.32,1.5,0.55,1 ) );--_holo-ease:var( --os-ui-ease-out,cubic-bezier( 0.22,0.9,0.28,1 ) );--_holo-loop:var( --os-ui-ease-loop,cubic-bezier( 0.45,0,0.55,1 ) )}`,no=P` .os-holo-fill{background-color:transparent;background-image:var( --_holo-fill );background-size:220% 220%;background-position:22% 28%;background-repeat:no-repeat;color:var( --_holo-ink );transition:background-position var( --_holo-t ) ease,box-shadow var( --_holo-t ) ease,filter var( --_holo-t ) ease}.os-holo-fill:hover{background-position:74% 66%}.os-holo-fill:active{background-position:88% 82%;filter:brightness( 0.94 )}@media ( prefers-reduced-motion:reduce ){.os-holo-fill{transition-duration:1ms}.os-holo-fill:hover,.os-holo-fill:active{background-position:22% 28%}}`,ao=P` .os-holo-sheen{position:relative;isolation:isolate}.os-holo-sheen::before{content:'';position:absolute;inset:0;z-index:-1;border-radius:inherit;background-image:var( --_holo-sheen );background-size:200% 200%;background-position:20% 30%;opacity:0;pointer-events:none;transition:opacity var( --_holo-t ) ease,background-position var( --_holo-t ) ease}.os-holo-sheen:hover::before,.os-holo-sheen:focus-visible::before{opacity:1;background-position:76% 68%}@media ( prefers-reduced-motion:reduce ){.os-holo-sheen::before{transition-duration:1ms}.os-holo-sheen:hover::before,.os-holo-sheen:focus-visible::before{background-position:20% 30%}}`,ro=P` .os-holo-edge{position:relative}.os-holo-edge::after{content:'';position:absolute;inset:0;border-radius:inherit;padding:1px;background-image:var( --_holo-edge-quiet );opacity:0;pointer-events:none;-webkit-mask:linear-gradient( #000 0 0 ) content-box,linear-gradient( #000 0 0 );-webkit-mask-composite:xor;mask:linear-gradient( #000 0 0 ) content-box,linear-gradient( #000 0 0 );mask-composite:exclude;transition:opacity var( --_holo-t ) ease}.os-holo-edge:hover::after,.os-holo-edge:focus-visible::after{background-image:var( --_holo-edge );opacity:1}.os-holo-edge.is-lit::after{background-image:var( --_holo-edge );opacity:1}@media ( prefers-reduced-motion:reduce ){.os-holo-edge::after{transition-duration:1ms}}`,lo=P` .os-holo-glint{position:absolute;inset:0;border-radius:inherit;overflow:hidden;pointer-events:none}.os-holo-glint::before{content:'';position:absolute;top:-60%;bottom:-60%;width:45%;inset-inline-start:-60%;background:linear-gradient( 90deg,transparent 0%,rgba( 255,251,255,0.14 ) 45%,rgba( 255,251,255,0.22 ) 50%,rgba( 255,251,255,0.14 ) 55%,transparent 100% );transform:rotate( 18deg ) translateX( 0 );opacity:0}:hover>.os-holo-glint::before,:focus-visible>.os-holo-glint::before,:host(:hover )>.os-holo-glint::before,:host(:focus-visible )>.os-holo-glint::before{animation:os-holo-glint var( --_holo-t-slow ) var( --_holo-ease )}@keyframes os-holo-glint{0%{opacity:0;transform:rotate( 18deg ) translateX( 0 )}15%{opacity:1}85%{opacity:1}100%{opacity:0;transform:rotate( 18deg ) translateX( 240vw )}}@media ( prefers-reduced-motion:reduce ){:hover>.os-holo-glint::before,:focus-visible>.os-holo-glint::before,:host(:hover )>.os-holo-glint::before,:host(:focus-visible )>.os-holo-glint::before{animation:none}}`,co=P` .os-holo-ring{position:absolute;inset:0;border-radius:inherit;box-shadow:0 0 0 0 var( --_holo-ring-color );opacity:0;pointer-events:none}:active:not(:disabled )>.os-holo-ring,:host(:active:not( [ disabled ] ) )>.os-holo-ring{animation:os-holo-ring var( --_holo-t-slow ) var( --_holo-ease )}@keyframes os-holo-ring{0%{opacity:0.45;box-shadow:0 0 0 0 var( --_holo-ring-color )}100%{opacity:0;box-shadow:0 0 0 10px transparent}}@media ( prefers-reduced-motion:reduce ){:active:not(:disabled )>.os-holo-ring,:host(:active:not( [ disabled ] ) )>.os-holo-ring{animation:none}}`,po=P` .os-holo-shimmer{background-image:var( --_holo-fill );background-size:300% 300%;background-repeat:no-repeat;animation:os-holo-shimmer 2.4s var( --_holo-loop ) infinite}@keyframes os-holo-shimmer{0%{background-position:0% 50%}100%{background-position:100% 50%}}@media ( prefers-reduced-motion:reduce ){.os-holo-shimmer{animation:none;background-position:30% 50%}}`,uo=P` .os-holo-enter{animation:os-holo-enter var( --_holo-t ) var( --_holo-spring )}@keyframes os-holo-enter{from{opacity:0;transform:scale( 0.96 )}}@media ( prefers-reduced-motion:reduce ){.os-holo-enter{animation:none}}`,ho=P` input:where(:not( [ type='checkbox' ] ):not( [ type='radio' ] ) ),select,textarea{transition:background-color var( --_holo-t ) ease,border-color var( --_holo-t ) ease,box-shadow var( --_holo-t ) ease}input:where(:not( [ type='checkbox' ] ):not( [ type='radio' ] ) ):hover:not(:disabled ),select:hover:not(:disabled ),textarea:hover:not(:disabled ){border-color:var( --os-ui-border-strong,#8c8f94 )}input:where(:not( [ type='checkbox' ] ):not( [ type='radio' ] ) ):focus,input:where(:not( [ type='checkbox' ] ):not( [ type='radio' ] ) ):focus-visible,select:focus,select:focus-visible,textarea:focus,textarea:focus-visible{outline:none;border-color:var( --os-ui-accent,#2271b1 );box-shadow:var( --_holo-focus-field )}input::placeholder,textarea::placeholder{color:var( --os-ui-fg-faint,#8c8f94 );opacity:1}input::selection,textarea::selection{background:var( --os-ui-selection-bg,rgba( 159,152,255,0.6 ) );color:var( --os-ui-selection-fg,#fffbff )}@media ( prefers-reduced-motion:reduce ){input:where(:not( [ type='checkbox' ] ):not( [ type='radio' ] ) ),select,textarea{transition-duration:1ms}}`,Xe=P` input[ type='checkbox' ],input[ type='radio' ]{appearance:none;-webkit-appearance:none;position:relative;flex:0 0 auto;box-sizing:border-box;width:16px;height:16px;margin:0;padding:0;border:1px solid var( --_holo-track-edge );border-radius:4px;background-color:var( --_holo-track );background-image:none;background-repeat:no-repeat;cursor:inherit;transition:background-color var( --_holo-t ) ease,border-color var( --_holo-t ) ease,box-shadow var( --_holo-t ) ease}input[ type='radio' ]{border-radius:50%}input[ type='checkbox' ]:hover:not(:disabled ),input[ type='radio' ]:hover:not(:disabled ){border-color:var( --os-ui-accent,#2271b1 )}input[ type='checkbox' ]:focus-visible,input[ type='radio' ]:focus-visible{outline:none;box-shadow:var( --_holo-focus )}input[ type='checkbox' ]:checked,input[ type='checkbox' ]:indeterminate,input[ type='radio' ]:checked{border-color:transparent;background-color:var( --os-ui-accent,#2271b1 )}input[ type='checkbox' ]:checked:focus-visible,input[ type='radio' ]:checked:focus-visible{box-shadow:var( --_holo-focus )}input[ type='checkbox' ]:checked::after{content:'';position:absolute;inset-inline-start:50%;top:46%;width:3.5px;height:7.5px;border:solid var( --os-ui-fg-on-accent,#fff );border-width:0 2px 2px 0;transform:translate( -50%,-50% ) rotate( 45deg );animation:os-holo-tick 180ms cubic-bezier( 0.3,1.4,0.6,1 )}input[ type='checkbox' ]:indeterminate::after{content:'';position:absolute;inset-inline-start:50%;top:50%;width:8px;height:2px;border:0;border-radius:1px;background:var( --os-ui-fg-on-accent,#fff );transform:translate( -50%,-50% )}input[ type='radio' ]:checked::after{content:'';position:absolute;inset-inline-start:50%;top:50%;width:6px;height:6px;border-radius:50%;background:var( --os-ui-fg-on-accent,#fff );transform:translate( -50%,-50% );animation:os-holo-tick 180ms cubic-bezier( 0.3,1.4,0.6,1 )}input[ type='checkbox' ]:disabled,input[ type='radio' ]:disabled{cursor:not-allowed}@keyframes os-holo-tick{from{opacity:0;transform:translate( -50%,-50% ) rotate( 45deg ) scale( 0.4 )}}@media ( prefers-reduced-motion:reduce ){input[ type='checkbox' ]:checked::after,input[ type='radio' ]:checked::after{animation:none}}`,fo=P` @keyframes os-holo-drift{0%{background-position:16% 26%}50%{background-position:84% 74%}100%{background-position:16% 26%}}.os-holo-alive{animation:os-holo-drift var( --_holo-t-ambient ) var( --_holo-loop ) infinite}@media ( prefers-reduced-motion:reduce ){.os-holo-alive{animation:none}}`;P` ${fe} ${no} ${ao} ${ro} ${lo} ${co} ${po} ${uo} ${ho} ${Xe} ${fo} `;const go=P` ${fe}:host{display:inline-flex;max-width:100%;vertical-align:middle}:host( [ hidden ] ){display:none}.os-chip{display:inline-flex;align-items:center;gap:var( --os-ui-chip-gap,4px );padding:var( --os-ui-chip-padding,2px 8px );border-radius:var( --os-ui-chip-radius,999px );font-size:var( --os-ui-chip-font-size,12px );line-height:var( --os-ui-chip-line-height,1.6 );font-weight:var( --os-ui-chip-font-weight,500 );background:var( --os-ui-chip-bg,var( --os-ui-surface,#f0f0f1 ) );color:var( --os-ui-chip-fg,var( --os-ui-fg,#1d2327 ) );border:var( --os-ui-chip-border,1px solid transparent );max-width:100%;box-sizing:border-box;transition:background-color 0.12s ease,color 0.12s ease,border-color 0.12s ease,transform 0.12s ease,opacity 0.12s ease}:host( [ tone='accent' ] ) .os-chip{background:var( --os-ui-chip-bg,color-mix( in srgb,var( --wp-admin-theme-color,#2271b1 ) 14%,transparent ) );color:var( --os-ui-chip-fg,var( --wp-admin-theme-color,#2271b1 ) )}:host( [ tone='positive' ] ) .os-chip{background:var( --os-ui-chip-bg,rgba( 30,132,73,0.14 ) );color:var( --os-ui-chip-fg,var( --os-ui-success-fg,#1d6f42 ) )}:host( [ tone='warning' ] ) .os-chip{background:var( --os-ui-chip-bg,rgba( 217,119,6,0.18 ) );color:var( --os-ui-chip-fg,var( --os-ui-warning-fg,#8a4a06 ) )}:host( [ tone='danger' ] ) .os-chip{background:var( --os-ui-chip-bg,rgba( 214,54,56,0.14 ) );color:var( --os-ui-chip-fg,var( --os-ui-danger-hover,#a02622 ) )}:host( [ pending ] ) .os-chip{opacity:0.65;animation:os-chip-pulse 1.2s ease-in-out infinite}@keyframes os-chip-pulse{0%,100%{opacity:0.55}50%{opacity:0.95}}.os-chip__label{max-width:var( --os-ui-chip-label-max,220px );overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.os-chip__icon{display:inline-flex;align-items:center;flex-shrink:0}.os-chip__icon::slotted( * ){display:inline-flex}.os-chip__dismiss{appearance:none;display:inline-flex;align-items:center;justify-content:center;flex-shrink:0;width:16px;height:16px;margin-inline-start:2px;padding:0;border:0;border-radius:50%;background:transparent;color:inherit;cursor:pointer;opacity:0.55;transition:opacity 0.12s ease,background-color 0.12s ease}.os-chip__dismiss:hover,.os-chip__dismiss:focus-visible{opacity:1;background:var( --os-ui-hover,rgba( 0,0,0,0.12 ) );outline:none}.os-chip__dismiss:focus-visible{box-shadow:var( --_holo-focus )}.os-chip__dismiss[ disabled ]{opacity:0.35;cursor:not-allowed}.os-chip__dismiss svg{display:block;width:14px;height:14px}:host( [ disabled ] ) .os-chip{opacity:0.55;cursor:not-allowed}:host( [ size='compact' ] ) .os-chip{padding:var( --os-ui-chip-padding,1px 6px );font-size:var( --os-ui-chip-font-size,11px )}:host( [ selected ] ) .os-chip{position:relative;background:var( --os-ui-chip-bg,var( --os-ui-accent-soft,rgba( 34,113,177,0.14 ) ) );color:var( --os-ui-chip-fg,var( --os-ui-fg,#1d2327 ) )}:host( [ selected ] ) .os-chip::after{content:'';position:absolute;inset:0;border-radius:inherit;padding:1px;background-image:var( --_holo-edge );pointer-events:none;-webkit-mask:linear-gradient( #000 0 0 ) content-box,linear-gradient( #000 0 0 );-webkit-mask-composite:xor;mask:linear-gradient( #000 0 0 ) content-box,linear-gradient( #000 0 0 );mask-composite:exclude}`,_e=class _e extends q{constructor(){super(...arguments),this._onHostKeyDown=e=>{if(this.dismissible!==null&&(e.key==="Backspace"||e.key==="Delete")){if(e.preventDefault(),this.disabled!==null)return;const i=this.label??"";this.emit("os-chip-dismiss",{label:i})}}}connectedCallback(){super.connectedCallback(),this.addEventListener("keydown",this._onHostKeyDown)}disconnectedCallback(){this.removeEventListener("keydown",this._onHostKeyDown)}render(){const e=this.label??"",t=this.dismissible!==null,s=this.disabled!==null;return b`
40 + >`}};be.props=["datetime","compact"],be.styles=[oo],be.help=void 0;let Ge=be;W("os-relative-time",Ge);function X(s,e,t,o){const i=`${e}|${t}`,a=s.get(i);if(a)return a;const n=o();return s.set(i,n),n}const Ze={publish:u("Published"),future:u("Scheduled"),draft:u("Draft"),pending:u("Pending"),private:u("Private"),trash:u("Trash")};function ho(s){switch(s){case"publish":return{bg:"var(--os-ui-surface-raised, #e6f4ea)",fg:"var(--os-ui-success-fg, #1d6f42)"};case"draft":return{bg:"var(--os-ui-surface-raised, #fdecea)",fg:"var(--os-ui-danger, #a02622)"};case"pending":return{bg:"var(--os-ui-warning-bg, #fef7e0)",fg:"var(--os-ui-warning-fg, #8a6d00)"};case"private":return{bg:"var(--os-ui-info-bg, #e8f0fe)",fg:"var(--os-ui-info-fg, #1a52a8)"};case"future":return{bg:"var(--os-ui-surface-raised, #ede7f6)",fg:"var(--os-ui-accent, #5b3aa0)"};default:return{bg:"var(--os-ui-surface-raised, #f1f1f2)",fg:"var(--os-ui-fg-muted, #50575e)"}}}function Te(s,e){const t=s.editPostUrlBase??"",o=t.includes("?")?"&":"?";return`${t}${o}post=${e}&action=edit`}function Xe(s){const e=s._embedded?.author?.[0];return e?{id:e.id,name:ae(e.name??""),avatar:Xs(e.avatar_urls)||void 0}:{id:s.author,name:u("Unknown")}}function fo(s,e){for(const t of s._embedded?.["wp:term"]??[])if(t.length>0&&t[0].taxonomy===e)return t.map(o=>({id:o.id,name:o.name}));return[]}function Ye(s){const e=s._embedded?.["wp:featuredmedia"]?.[0];if(!e)return null;const t=e.media_details?.sizes??{};return{url:t.thumbnail?.source_url??t.medium?.source_url??e.source_url,alt:e.alt_text??""}}function le(s){return ae(s.title.rendered)}function Pe(s,e,t={}){const o=document.createElement("span");o.style.cssText=["display:inline-flex","align-items:center","gap:4px","padding:2px 8px","border-radius:10px","font-size:11px","font-weight:600",t.uppercase?"text-transform:uppercase;letter-spacing:0.04em":"",`background:${e.bg}`,`color:${e.fg}`,"white-space:nowrap","flex-shrink:0"].filter(Boolean).join(";"),t.icon&&o.appendChild(t.icon);const i=document.createElement("span");return i.textContent=s,o.appendChild(i),t.title&&(o.title=t.title),o}function qt(s,e=13){const t=document.createElement("span");return t.className=`dashicons ${s}`,t.setAttribute("aria-hidden","true"),t.style.cssText=`font-size:${e}px;width:${e}px;height:${e}px;line-height:1;`,t}function go(){const s=document.createElement("span");return s.setAttribute("aria-hidden","true"),s.style.cssText="font-family:dashicons;font-size:14px;line-height:1;display:inline-block;speak:none;-webkit-font-smoothing:antialiased",s.textContent="",s}function Dt(s){s.addEventListener("mouseenter",()=>{s.style.textDecoration="underline"}),s.addEventListener("mouseleave",()=>{s.style.textDecoration="none"})}function mo(s,e){const t=document.createElement("span");t.style.cssText="display:flex;flex-direction:column;gap:4px;min-width:0;";const o=document.createElement("span");o.style.cssText="display:flex;align-items:center;gap:8px;min-width:0;";const i=document.createElement("a");i.href=Te(e.extra,s.id),i.setAttribute("data-noclick","");const a=le(s)||u("(no title)");i.textContent=a,i.title=a,i.style.cssText="font-weight:600;color:inherit;text-decoration:none;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:340px;",Dt(i),i.addEventListener("click",l=>{l.preventDefault(),l.stopPropagation(),e.openUrl(i.href,a,"dashicons-admin-post")}),o.appendChild(i);const n=s.openstation_lock??null;n&&o.appendChild(Pe(n.userName,{fg:"var(--os-ui-danger, #b32d2e)",bg:"var(--os-ui-surface-raised, rgba(179, 45, 46, 0.1))"},{icon:go(),title:H(u("%s is currently editing"),n.userName)}));const r=e.extra.mode==="pages";if(r&&typeof e.extra.frontPageId=="number"&&e.extra.frontPageId===s.id&&o.appendChild(Pe(u("Front page"),{fg:"var(--os-ui-info-fg, #0a4b78)",bg:"var(--os-ui-info-bg, rgba(34,113,177,0.12))"},{icon:qt("dashicons-admin-home")})),r&&typeof e.extra.postsPageId=="number"&&e.extra.postsPageId===s.id&&o.appendChild(Pe(u("Posts page"),{fg:"var(--os-ui-accent, #5b3aa0)",bg:"var(--os-ui-surface-raised, rgba(91,58,160,0.12))"},{icon:qt("dashicons-admin-post")})),s.status&&s.status!=="publish"&&o.appendChild(Pe(Ze[s.status]??s.status,ho(s.status),{uppercase:!0})),r&&typeof s.link=="string"&&s.link&&s.status==="publish"){const l=document.createElement("a");l.href=s.link,l.target="_blank",l.rel="noreferrer noopener",l.textContent=u("View"),l.title=s.link,l.setAttribute("data-noclick",""),l.style.cssText="font-size:11px;color:var(--wp-admin-theme-color, #2271b1);text-decoration:none;flex-shrink:0;",l.addEventListener("click",c=>c.stopPropagation()),Dt(l),o.appendChild(l)}return t.appendChild(o),t}function bo(s){const e=Xe(s),t=document.createElement("span");t.style.cssText="display:inline-flex;align-items:center;gap:8px;min-width:0;";const o=document.createElement("os-avatar");o.setAttribute("size","24"),e.name&&o.setAttribute("name",e.name),e.id>0&&o.setAttribute("user-id",String(e.id)),e.avatar&&Ys(o,e.avatar),t.appendChild(o);const i=document.createElement("span");return i.textContent=e.name,i.style.cssText="overflow:hidden;text-overflow:ellipsis;white-space:nowrap;",t.appendChild(i),t}function _o(s){const e=document.createElement("span");e.style.cssText="display:flex;flex-direction:column;line-height:1.2;";const t=document.createElement("os-relative-time");if(t.setAttribute("datetime",s.date_gmt||s.date),e.appendChild(t),s.modified_gmt&&s.modified_gmt!==s.date_gmt){const o=document.createElement("span");o.textContent=u("modified"),o.style.cssText="font-size:11px;color:var(--os-ui-fg-muted, #646970);",e.appendChild(o)}return e}function vo(s){const e=document.createElement("div");e.style.cssText="display:flex;gap:16px;padding:12px 16px;background:var(--os-ui-surface-sunken, #fafafa);align-items:flex-start;";const t=Ye(s);if(t){const r=document.createElement("img");r.src=t.url,r.alt=t.alt,r.loading="lazy",r.style.cssText="width:96px;height:96px;border-radius:6px;object-fit:cover;flex-shrink:0;",e.appendChild(r)}const o=document.createElement("div");o.style.cssText="flex:1;min-width:0;display:flex;flex-direction:column;gap:6px;";const i=document.createElement("div");i.style.cssText="font-size:13px;color:var(--os-ui-fg-muted, #646970);text-transform:uppercase;letter-spacing:0.04em;",i.textContent=u("Excerpt"),o.appendChild(i);const a=document.createElement("div");a.style.cssText="color:var(--os-ui-fg, #1d2327);line-height:1.5;";const n=s.excerpt?.rendered??"";return n?a.textContent=ae(n.replace(/<[^>]+>/g,"").trim())||u("(no excerpt)"):(a.textContent=u("(no excerpt)"),a.style.color="var(--os-ui-fg-muted, #a7aaad)"),o.appendChild(a),e.appendChild(o),e}const Ht={close:{a:'fill="currentColor"',b:'<path d="m13.06 12 6.47-6.47-1.06-1.06L12 10.94 5.53 4.47 4.47 5.53 10.94 12l-6.47 6.47 1.06 1.06L12 13.06l6.47 6.47 1.06-1.06L13.06 12Z" />'},check:{a:'fill="currentColor"',b:'<path d="M16.5 7.5 10 13.9l-2.5-2.4-1 1 3.5 3.6 7.5-7.6z" />'},"chevron-right":{a:'fill="currentColor"',b:'<path d="M10.6 6L9.4 7l4.6 5-4.6 5 1.2 1 5.4-6z" />'},"arrow-up-right":{a:'fill="currentColor"',b:'<path d="M10 6H18V14H16.5V8.5L7 18L6 17L15.5 7.5H10V6Z" />'},plus:{a:'fill="currentColor"',b:'<path d="M11 12.5V17.5H12.5V12.5H17.5V11H12.5V6H11V11H6V12.5H11Z" />'},search:{a:'fill="currentColor"',b:'<path d="M13 5c-3.3 0-6 2.7-6 6 0 1.4.5 2.7 1.3 3.7l-3.8 3.8 1.1 1.1 3.8-3.8c1 .8 2.3 1.3 3.7 1.3 3.3 0 6-2.7 6-6S16.3 5 13 5zm0 10.5c-2.5 0-4.5-2-4.5-4.5s2-4.5 4.5-4.5 4.5 2 4.5 4.5-2 4.5-4.5 4.5z" />'},pin:{a:'fill="currentColor"',b:'<path d="m21.5 9.1-6.6-6.6-4.2 5.6c-1.2-.1-2.4.1-3.6.7-.1 0-.1.1-.2.1-.5.3-.9.6-1.2.9l3.7 3.7-5.7 5.7v1.1h1.1l5.7-5.7 3.7 3.7c.4-.4.7-.8.9-1.2.1-.1.1-.2.2-.3.6-1.1.8-2.4.6-3.6l5.6-4.1zm-7.3 3.5.1.9c.1.9 0 1.8-.4 2.6l-6-6c.8-.4 1.7-.5 2.6-.4l.9.1L15 4.9 19.1 9l-4.9 3.6z" />'},trash:{a:'fill="currentColor"',b:'<path fill-rule="evenodd" clip-rule="evenodd" d="M12 5.5A2.25 2.25 0 0 0 9.878 7h4.244A2.251 2.251 0 0 0 12 5.5ZM12 4a3.751 3.751 0 0 0-3.675 3H5v1.5h1.27l.818 8.997a2.75 2.75 0 0 0 2.739 2.501h4.347a2.75 2.75 0 0 0 2.738-2.5L17.73 8.5H19V7h-3.325A3.751 3.751 0 0 0 12 4Zm4.224 4.5H7.776l.806 8.861a1.25 1.25 0 0 0 1.245 1.137h4.347a1.25 1.25 0 0 0 1.245-1.137l.805-8.861Z" />'},download:{a:'fill="currentColor"',b:'<path d="M18 11.3l-1-1.1-4 4V3h-1.5v11.3L7 10.2l-1 1.1 6.2 5.8 5.8-5.8zm.5 3.7v3.5h-13V15H4v5h16v-5h-1.5z" />'},settings:{a:'fill="currentColor"',b:'<path d="m19 7.5h-7.628c-.3089-.87389-1.1423-1.5-2.122-1.5-.97966 0-1.81309.62611-2.12197 1.5h-2.12803v1.5h2.12803c.30888.87389 1.14231 1.5 2.12197 1.5.9797 0 1.8131-.62611 2.122-1.5h7.628z" /><path d="m19 15h-2.128c-.3089-.8739-1.1423-1.5-2.122-1.5s-1.8131.6261-2.122 1.5h-7.628v1.5h7.628c.3089.8739 1.1423 1.5 2.122 1.5s1.8131-.6261 2.122-1.5h2.128z" />'},info:{a:'fill="currentColor"',b:'<path fill-rule="evenodd" clip-rule="evenodd" d="M5.5 12a6.5 6.5 0 1 0 13 0 6.5 6.5 0 0 0-13 0ZM12 4a8 8 0 1 0 0 16 8 8 0 0 0 0-16Zm.75 4v1.5h-1.5V8h1.5Zm0 8v-5h-1.5v5h1.5Z" />'},bell:{a:'fill="currentColor"',b:'<path fill-rule="evenodd" clip-rule="evenodd" d="M17 11.5c0 1.353.17 2.368.976 3 .266.209.602.376 1.024.5v1H5v-1c.422-.124.757-.291 1.024-.5.806-.632.976-1.647.976-3V9c0-2.8 2.2-5 5-5s5 2.2 5 5v2.5ZM15.5 9v2.5c0 .93.066 1.98.515 2.897l.053.103H7.932a4.018 4.018 0 0 0 .053-.103c.449-.917.515-1.967.515-2.897V9c0-1.972 1.528-3.5 3.5-3.5s3.5 1.528 3.5 3.5Zm-5.492 9.008c0-.176.023-.346.065-.508h3.854A1.996 1.996 0 0 1 12 20c-1.1 0-1.992-.892-1.992-1.992Z" />'},more:{a:'fill="currentColor"',b:'<path d="M11 13h2v-2h-2v2zm-6 0h2v-2H5v2zm12-2v2h2v-2h-2z" />'},maximize:{a:'fill="currentColor"',b:'<path d="M6 4a2 2 0 0 0-2 2v3h1.5V6a.5.5 0 0 1 .5-.5h3V4H6Zm3 14.5H6a.5.5 0 0 1-.5-.5v-3H4v3a2 2 0 0 0 2 2h3v-1.5Zm6 1.5v-1.5h3a.5.5 0 0 0 .5-.5v-3H20v3a2 2 0 0 1-2 2h-3Zm3-16a2 2 0 0 1 2 2v3h-1.5V6a.5.5 0 0 0-.5-.5h-3V4h3Z" />'},edit:{a:'fill="currentColor"',b:'<path d="m19 7-3-3-8.5 8.5-1 4 4-1L19 7Zm-7 11.5H5V20h7v-1.5Z" />'},color:{a:'fill="currentColor"',b:'<path d="M17.2 10.9c-.5-1-1.2-2.1-2.1-3.2-.6-.9-1.3-1.7-2.1-2.6L12 4l-1 1.1c-.6.9-1.3 1.7-2 2.6-.8 1.2-1.5 2.3-2 3.2-.6 1.2-1 2.2-1 3 0 3.4 2.7 6.1 6.1 6.1s6.1-2.7 6.1-6.1c0-.8-.3-1.8-1-3zm-5.1 7.6c-2.5 0-4.6-2.1-4.6-4.6 0-.3.1-1 .8-2.3.5-.9 1.1-1.9 2-3.1.7-.9 1.3-1.7 1.8-2.3.7.8 1.3 1.6 1.8 2.3.8 1.1 1.5 2.2 2 3.1.7 1.3.8 2 .8 2.3 0 2.5-2.1 4.6-4.6 4.6z" />'},wallpaper:{a:'fill="currentColor"',b:'<path d="M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zM5 4.5h14c.3 0 .5.2.5.5v8.4l-3-2.9c-.3-.3-.8-.3-1 0L11.9 14 9 12c-.3-.2-.6-.2-.8 0l-3.6 2.6V5c-.1-.3.1-.5.4-.5zm14 15H5c-.3 0-.5-.2-.5-.5v-2.4l4.1-3 3 1.9c.3.2.7.2.9-.1L16 12l3.5 3.4V19c0 .3-.2.5-.5.5z" />'},warning:{a:'fill="currentColor"',b:'<path fill-rule="evenodd" clip-rule="evenodd" d="M5.5 12a6.5 6.5 0 1 0 13 0 6.5 6.5 0 0 0-13 0ZM12 4a8 8 0 1 0 0 16 8 8 0 0 0 0-16Zm-.75 12v-1.5h1.5V16h-1.5Zm0-8v5h1.5V8h-1.5Z" />'},minimize:{a:'fill="currentColor"',b:'<path d="M5 11.25h14v1.5H5z" />'},window:{a:'fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"',b:'<rect x="4.125" y="5.4375" width="15.75" height="13.125" rx="1.75"/><path d="M4.125 9.8125h15.75"/><circle cx="7.275" cy="7.625" r="0.7438" fill="currentColor" stroke="none"/>'},windows:{a:'fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"',b:'<rect x="3.6875" y="8.5" width="11.375" height="10.0625" rx="1.75"/><path d="M3.6875 12h11.375"/><path d="M8.5 8.5V7.1875a1.75 1.75 0 0 1 1.75-1.75h7.875A1.75 1.75 0 0 1 19.875 7.1875v7a1.75 1.75 0 0 1-1.75 1.75h-3.0625"/>'},dock:{a:'fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"',b:'<rect x="3.25" y="8.5" width="17.5" height="7" rx="3.5"/><circle cx="7.625" cy="12" r="1.0062" fill="currentColor" stroke="none"/><circle cx="12" cy="12" r="1.0062" fill="currentColor" stroke="none"/><circle cx="16.375" cy="12" r="1.0062" fill="currentColor" stroke="none"/>'},spaces:{a:'fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"',b:'<rect x="3.6875" y="5.4375" width="7.4375" height="7.875" rx="1.75"/><rect x="12.875" y="5.4375" width="7.4375" height="7.875" rx="1.75"/><circle cx="9.375" cy="17.6875" r="0.7875" fill="currentColor" stroke="none"/><circle cx="12" cy="17.6875" r="0.7875" fill="currentColor" stroke="none"/><circle cx="14.625" cy="17.6875" r="0.7875" fill="currentColor" stroke="none"/>'},copilot:{a:'fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"',b:'<path d="M10 2.5Q10.9 8.5 17.5 10Q10.9 11.5 10 17.5Q9.1 11.5 2.5 10Q9.1 8.5 10 2.5Z" fill="currentColor" stroke="none"/><path d="M17.9 14Q18.35 17.1 21.5 17.6Q18.35 18.1 17.9 21.2Q17.45 18.1 14.3 17.6Q17.45 17.1 17.9 14Z" fill="currentColor" stroke="none"/>'},snap:{a:'fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"',b:'<rect x="3.6875" y="5.4375" width="16.625" height="13.125" rx="1.75"/><path d="M12 5.4375v13.125"/><path d="M12 12h8.3125"/>'},command:{a:'fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"',b:'<path d="M14.625 6.75v10.5a2.625 2.625 0 1 0 2.625-2.625H6.75a2.625 2.625 0 1 0 2.625 2.625V6.75a2.625 2.625 0 1 0-2.625 2.625h10.5a2.625 2.625 0 1 0-2.625-2.625"/>'},apps:{a:'fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"',b:'<rect x="4.125" y="4.125" width="6.5625" height="6.5625" rx="1.75"/><rect x="13.3125" y="4.125" width="6.5625" height="6.5625" rx="1.75"/><rect x="4.125" y="13.3125" width="6.5625" height="6.5625" rx="1.75"/><rect x="13.3125" y="13.3125" width="6.5625" height="6.5625" rx="1.75"/>'},widgets:{a:'fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"',b:'<rect x="3.6875" y="3.6875" width="9.625" height="9.625" rx="1.75"/><rect x="15.0625" y="3.6875" width="5.25" height="5.25" rx="1.75"/><rect x="15.0625" y="10.6875" width="5.25" height="9.625" rx="1.75"/><rect x="3.6875" y="15.0625" width="9.625" height="5.25" rx="1.75"/>'},user:{a:'fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"',b:'<circle cx="12" cy="8.9375" r="3.5"/><path d="M5.4375 19.4375a6.5625 6.5625 0 0 1 13.125 0"/>'},lock:{a:'fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"',b:'<rect x="5.4375" y="10.6875" width="13.125" height="8.75" rx="1.75"/><path d="M8.5 10.6875V8.0625a3.5 3.5 0 0 1 7 0v2.625"/>'}};function Ft(s){return s.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")}function xo(s){return Object.prototype.hasOwnProperty.call(Ht,s)?Ht[s]:null}function yo(s,e={}){const t=xo(s);if(!t)return"";const{size:o=24,className:i,title:a,rotate:n}=e,r=['xmlns="http://www.w3.org/2000/svg"','viewBox="0 0 24 24"'];o!=null&&r.push(`width="${o}"`,`height="${o}"`),r.push(t.a),i&&r.push(`class="${Ft(i)}"`),a?r.push('role="img"',`aria-label="${Ft(a)}"`):r.push('aria-hidden="true"','focusable="false"');const l=n?`<g transform="rotate(${n} 12 12)">${t.b}</g>`:t.b;return`<svg ${r.join(" ")}>${l}</svg>`}function Y(s,e={}){const t=yo(s,e),o=document.createElement("div");o.innerHTML=t;const i=o.firstElementChild;return i instanceof SVGSVGElement?i:document.createElementNS("http://www.w3.org/2000/svg","svg")}const ko=R`:host{display:flex;width:100%;min-width:0;max-width:100%;align-items:stretch}.os-cat{display:flex;flex-direction:column;align-items:stretch;gap:4px;padding:var( --os-ui-cat-padding,2px );min-height:24px;max-width:100%;width:100%}.os-cat__chips{display:inline-flex;flex-wrap:wrap;align-items:center;gap:var( --os-ui-cat-gap,4px );min-width:0}.os-cat__chains{display:flex;flex-wrap:wrap;gap:4px;min-width:0}.os-cat__viz-host{display:flex;align-items:center;gap:4px;min-width:0;flex:1 1 auto;max-width:100%;min-height:28px;cursor:pointer;position:relative}.os-cat__viz-svg{display:block;width:100%;max-width:100%;min-width:0;overflow:visible;flex:1 1 auto}.os-cat__viz-svg .os-cat-edge{fill:none;stroke:var( --os-ui-cat-edge-color,currentColor );stroke-width:1.25;stroke-linecap:round;opacity:0.55;transition:stroke-width 0.18s ease,opacity 0.18s ease}.os-cat__viz-svg .os-cat-edge[ data-active='true' ]{stroke-width:2;opacity:1}.os-cat__viz-svg .os-cat-node{cursor:pointer;transition:r 0.2s cubic-bezier( 0.34,1.56,0.64,1 ),fill 0.18s ease,stroke-width 0.18s ease,filter 0.18s ease}.os-cat__viz-svg .os-cat-node[ data-selected='true' ]{filter:drop-shadow( 0 0 6px var( --os-ui-cat-node-glow,rgba( 0,0,0,0.18 ) ) )}.os-cat__viz-svg .os-cat-node:hover,.os-cat__viz-svg .os-cat-node:focus-visible{filter:drop-shadow( 0 0 8px var( --os-ui-cat-node-glow,rgba( 0,0,0,0.3 ) ) );outline:none}.os-cat__viz-svg .os-cat-label{font-family:var( --os-ui-font,system-ui,sans-serif );font-size:10.5px;fill:var( --os-ui-cat-label-fg,var( --os-ui-fg,#1d2327 ) );font-weight:500;pointer-events:none;user-select:none}.os-cat__viz-svg .os-cat-label[ data-selected='false' ]{fill:var( --os-ui-cat-label-muted,var( --os-ui-fg-muted,#8c8f94 ) );font-weight:400;font-style:italic}.os-cat__trigger{appearance:none;display:inline-flex;align-items:center;gap:4px;padding:1px 8px;min-height:22px;font:inherit;font-size:11px;font-weight:500;line-height:1;color:var( --os-ui-cat-trigger-fg,var( --os-ui-fg-muted,#50575e ) );background:transparent;border:1px dashed var( --os-ui-cat-trigger-border,var( --os-ui-border,#c3c4c7 ) );border-radius:999px;cursor:pointer;transition:background-color 0.12s ease,color 0.12s ease,border-color 0.12s ease}.os-cat__trigger:hover:not(:disabled ){background:var( --os-ui-hover,rgba( 0,0,0,0.04 ) );color:var( --os-ui-cat-trigger-fg-hover,var( --os-ui-fg,#1d2327 ) );border-color:var( --os-ui-cat-trigger-border-hover,var( --os-ui-border-strong,#8c8f94 ) )}.os-cat__trigger:focus-visible{outline:none;border-style:solid;box-shadow:0 0 0 2px var( --wp-admin-theme-color,#2271b1 )}.os-cat__trigger svg{display:block}.os-cat__uncategorized{display:inline-flex;align-items:center;gap:4px;padding:1px 10px;min-height:22px;font-size:11px;font-weight:500;line-height:1.6;color:var( --os-ui-cat-uncat-fg,var( --os-ui-fg-muted,#8c8f94 ) );background:transparent;border:1px dashed var( --os-ui-cat-uncat-border,var( --os-ui-border,#c3c4c7 ) );border-radius:999px;font-style:italic}.os-cat__popover{position:fixed;top:0;left:0;min-width:280px;max-width:360px;max-height:360px;display:flex;flex-direction:column;background:var( --os-ui-cat-pop-bg,var( --os-ui-surface,#fff ) );color:var( --os-ui-cat-pop-fg,var( --os-ui-fg,#1d2327 ) );border:1px solid var( --os-ui-cat-pop-border,var( --os-ui-border,#c3c4c7 ) );border-radius:8px;box-shadow:0 6px 16px rgba( 0,0,0,0.08 ),0 1px 2px rgba( 0,0,0,0.06 );z-index:1000}.os-cat__editor{position:relative;display:inline-flex;align-items:center}.os-cat__search{appearance:none;font:inherit;font-size:13px;padding:8px 12px;border:0;border-bottom:1px solid var( --os-ui-cat-pop-divider,var( --os-ui-border,#f0f0f1 ) );background:transparent;color:inherit;outline:none}.os-cat__search:focus{border-bottom-color:var( --wp-admin-theme-color,#2271b1 )}.os-cat__tree{flex:1 1 auto;min-height:0;overflow-y:auto;padding:4px 0}.os-cat__row-block{display:contents}.os-cat__row{display:flex;align-items:center;gap:6px;padding:4px 8px 4px var( --os-ui-cat-row-indent,12px );cursor:pointer;user-select:none;font-size:13px;line-height:1.4;position:relative}.os-cat__row:hover,.os-cat__row[ data-focused='true' ]{background:var( --os-ui-hover,rgba( 0,0,0,0.04 ) )}.os-cat__row[ data-selected='true' ]{color:var( --wp-admin-theme-color,#2271b1 );font-weight:600}.os-cat__row::before{content:'';position:absolute;left:0;top:0;bottom:0;width:var( --os-ui-cat-guide-width,0px );border-left:1px dotted var( --os-ui-cat-guide-color,var( --os-ui-border,rgba( 0,0,0,0.08 ) ) )}.os-cat__expander{display:inline-flex;align-items:center;justify-content:center;width:14px;height:14px;border:0;background:transparent;color:inherit;cursor:pointer;flex-shrink:0;opacity:0.65}.os-cat__expander:hover{opacity:1}.os-cat__expander svg{display:block;transition:transform 0.12s ease}.os-cat__row[ data-expanded='true' ] .os-cat__expander svg{transform:rotate( 90deg )}.os-cat__expander--placeholder{visibility:hidden}.os-cat__create-row{display:flex;align-items:center;padding:2px 8px 2px var( --os-ui-cat-row-indent,28px );position:relative}.os-cat__create-row::before{content:'';position:absolute;left:0;top:0;bottom:0;width:var( --os-ui-cat-guide-width,0px );border-left:1px dotted var( --os-ui-cat-guide-color,var( --os-ui-border,rgba( 0,0,0,0.08 ) ) )}.os-cat__create-wrap{display:inline-flex;align-items:center;flex:1 1 auto;min-width:0;gap:4px;padding:1px 1px 1px 0;border:1px solid transparent;border-radius:6px;background:transparent;transition:border-color 0.12s ease,background-color 0.12s ease,box-shadow 0.12s ease}.os-cat__create-wrap:hover{border-color:var( --os-ui-border,rgba( 0,0,0,0.12 ) );background:var( --os-ui-cat-pop-bg,var( --os-ui-surface,#fff ) )}.os-cat__create-wrap:focus-within{border-color:var( --wp-admin-theme-color,#2271b1 );background:var( --os-ui-cat-pop-bg,var( --os-ui-surface,#fff ) );box-shadow:0 0 0 2px color-mix( in srgb,var( --wp-admin-theme-color,#2271b1 ) 15%,transparent )}.os-cat__create-input{flex:1 1 auto;min-width:0;appearance:none;font:inherit;font-size:var( --os-ui-field-font-size-compact,12px );padding:3px 6px;border:0;background:transparent;color:inherit;outline:none}.os-cat__create-input::placeholder{color:var( --os-ui-cat-pop-muted,var( --os-ui-fg-muted,#8c8f94 ) );font-style:italic;opacity:1}.os-cat__create-submit{appearance:none;display:inline-flex;align-items:center;justify-content:center;width:20px;height:20px;flex-shrink:0;padding:0;border:0;border-radius:4px;background:transparent;color:var( --os-ui-cat-pop-muted,var( --os-ui-fg-muted,#8c8f94 ) );cursor:pointer;transition:background-color 0.12s ease,color 0.12s ease}.os-cat__create-wrap:focus-within .os-cat__create-submit:not( [ disabled ] ){background:var( --wp-admin-theme-color,#2271b1 );color:var( --os-ui-accent-ink,var( --os-ui-fg-on-accent,#fff ) )}.os-cat__create-submit:hover:not( [ disabled ] ){filter:brightness( 1.05 )}.os-cat__create-submit[ disabled ]{cursor:default;opacity:0.5}.os-cat__create-submit svg{display:block}.os-cat__create-spinner{display:inline-block;width:12px;height:12px;margin:0 4px;border-radius:50%;border:2px solid var( --wp-admin-theme-color,#2271b1 );border-top-color:transparent;animation:os-cat-spin 0.8s linear infinite;flex-shrink:0}.os-cat__check{display:inline-flex;align-items:center;justify-content:center;width:14px;height:14px;flex-shrink:0;border:1.5px solid var( --os-ui-cat-check-border,var( --os-ui-border,#8c8f94 ) );border-radius:3px;color:transparent;transition:background-color 0.12s ease,border-color 0.12s ease,color 0.12s ease}.os-cat__row[ data-selected='true' ] .os-cat__check{background:var( --wp-admin-theme-color,#2271b1 );border-color:var( --wp-admin-theme-color,#2271b1 );color:var( --os-ui-accent-ink,var( --os-ui-fg-on-accent,#fff ) )}.os-cat__check svg{display:block;width:14px;height:14px}.os-cat__label{min-width:0;flex:1 1 auto;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.os-cat__delete{display:inline-flex;align-items:center;justify-content:center;flex:0 0 auto;width:18px;height:18px;border:0;border-radius:50%;padding:0;background:transparent;color:var( --os-ui-cat-delete-color,var( --os-ui-danger,#d63638 ) );cursor:pointer;opacity:0;transition:opacity 0.12s ease,background-color 0.12s ease}.os-cat__row:hover .os-cat__delete,.os-cat__row[ data-focused='true' ] .os-cat__delete,.os-cat__delete:focus-visible{opacity:1}.os-cat__delete:hover,.os-cat__delete:focus-visible{background:var( --os-ui-badge-danger-bg,rgba( 214,54,56,0.12 ) )}.os-cat__delete svg{display:block;width:14px;height:14px}.os-cat__match{background:var( --os-ui-search-highlight-bg,rgba( 252,211,77,0.45 ) );border-radius:2px;padding:0 1px}.os-cat__empty,.os-cat__loading{padding:12px;font-size:12px;color:var( --os-ui-cat-pop-muted,var( --os-ui-fg-muted,#646970 ) );text-align:center}.os-cat__loading-spinner{display:inline-block;width:12px;height:12px;border-radius:50%;border:2px solid currentColor;border-top-color:transparent;animation:os-cat-spin 0.8s linear infinite;margin-inline-end:8px;vertical-align:middle}@keyframes os-cat-spin{to{transform:rotate( 360deg )}}.os-cat__footer{padding:8px 12px;font-size:11px;color:var( --os-ui-cat-pop-muted,var( --os-ui-fg-muted,#646970 ) );border-top:1px solid var( --os-ui-cat-pop-divider,var( --os-ui-border,#f0f0f1 ) );border-radius:10px;background:var( --os-ui-cat-pop-footer-bg,var( --os-ui-surface,#fafafb ) );display:flex;align-items:center;gap:6px;line-height:1.4}.os-cat__footer .dashicons{font-size:14px;width:14px;height:14px;flex-shrink:0}:host( [ disabled ] ) .os-cat{opacity:0.6;pointer-events:none}`,fe=R`:host{--_holo-fill:var( --os-ui-holo-fill,${"linear-gradient( 124deg, #afa2e8 0%, #f5a8ea 46%, #8ee9f7 100% )"} );--_holo-ink:var( --os-ui-holo-ink,#0c0b0f );--_holo-sheen:var( --os-ui-holo-sheen,linear-gradient( 124deg,rgba( 159,214,255,0.1 ) 0%,rgba( 236,155,255,0.12 ) 34%,rgba( 242,82,252,0.1 ) 58%,rgba( 147,240,198,0.09 ) 100% ) );--_holo-edge:var( --os-ui-holo-edge,linear-gradient( 124deg,rgba( 154,242,255,0.7 ) 0%,rgba( 236,155,255,0.85 ) 38%,rgba( 242,82,252,0.7 ) 62%,rgba( 159,152,255,0.6 ) 100% ) );--_holo-edge-quiet:var( --os-ui-holo-edge-quiet,linear-gradient( 124deg,rgba( 154,242,255,0.22 ) 0%,rgba( 236,155,255,0.28 ) 38%,rgba( 242,82,252,0.22 ) 62%,rgba( 159,152,255,0.2 ) 100% ) );--_holo-glow:var( --os-ui-holo-glow,0 0 0 1px rgba( 242,82,252,0.28 ),0 2px 10px rgba( 242,82,252,0.22 ) );--_holo-glow-strong:var( --os-ui-holo-glow-strong,0 0 0 1px rgba( 242,82,252,0.42 ),0 4px 18px rgba( 242,82,252,0.38 ),0 1px 3px rgba( 12,11,15,0.6 ) );--_holo-track:var( --os-ui-holo-track,rgba( 255,251,255,0.16 ) );--_holo-track-edge:var( --os-ui-holo-track-edge,#8c8f94 );--_holo-ring-color:var( --os-ui-accent-dim,#2271b1 );--_holo-focus:var( --os-ui-focus-ring,0 0 0 2px rgba( 12,11,15,0.9 ),0 0 0 4px #f252fc,0 0 12px 2px rgba( 242,82,252,0.45 ) );--_holo-focus-field:var( --os-ui-focus-ring-field,0 0 0 1px #f252fc,0 0 0 4px rgba( 242,82,252,0.18 ) );--_holo-t:var( --os-ui-holo-transition,220ms );--_holo-t-fast:var( --os-ui-motion-fast,140ms );--_holo-t-slow:var( --os-ui-motion-slow,340ms );--_holo-t-ambient:var( --os-ui-motion-ambient,12s );--_holo-spring:var( --os-ui-ease-spring,cubic-bezier( 0.32,1.5,0.55,1 ) );--_holo-ease:var( --os-ui-ease-out,cubic-bezier( 0.22,0.9,0.28,1 ) );--_holo-loop:var( --os-ui-ease-loop,cubic-bezier( 0.45,0,0.55,1 ) )}`,wo=R` .os-holo-fill{background-color:transparent;background-image:var( --_holo-fill );background-size:220% 220%;background-position:22% 28%;background-repeat:no-repeat;color:var( --_holo-ink );transition:background-position var( --_holo-t ) ease,box-shadow var( --_holo-t ) ease,filter var( --_holo-t ) ease}.os-holo-fill:hover{background-position:74% 66%}.os-holo-fill:active{background-position:88% 82%;filter:brightness( 0.94 )}@media ( prefers-reduced-motion:reduce ){.os-holo-fill{transition-duration:1ms}.os-holo-fill:hover,.os-holo-fill:active{background-position:22% 28%}}`,$o=R` .os-holo-sheen{position:relative;isolation:isolate}.os-holo-sheen::before{content:'';position:absolute;inset:0;z-index:-1;border-radius:inherit;background-image:var( --_holo-sheen );background-size:200% 200%;background-position:20% 30%;opacity:0;pointer-events:none;transition:opacity var( --_holo-t ) ease,background-position var( --_holo-t ) ease}.os-holo-sheen:hover::before,.os-holo-sheen:focus-visible::before{opacity:1;background-position:76% 68%}@media ( prefers-reduced-motion:reduce ){.os-holo-sheen::before{transition-duration:1ms}.os-holo-sheen:hover::before,.os-holo-sheen:focus-visible::before{background-position:20% 30%}}`,Co=R` .os-holo-edge{position:relative}.os-holo-edge::after{content:'';position:absolute;inset:0;border-radius:inherit;padding:1px;background-image:var( --_holo-edge-quiet );opacity:0;pointer-events:none;-webkit-mask:linear-gradient( #000 0 0 ) content-box,linear-gradient( #000 0 0 );-webkit-mask-composite:xor;mask:linear-gradient( #000 0 0 ) content-box,linear-gradient( #000 0 0 );mask-composite:exclude;transition:opacity var( --_holo-t ) ease}.os-holo-edge:hover::after,.os-holo-edge:focus-visible::after{background-image:var( --_holo-edge );opacity:1}.os-holo-edge.is-lit::after{background-image:var( --_holo-edge );opacity:1}@media ( prefers-reduced-motion:reduce ){.os-holo-edge::after{transition-duration:1ms}}`,So=R` .os-holo-glint{position:absolute;inset:0;border-radius:inherit;overflow:hidden;pointer-events:none}.os-holo-glint::before{content:'';position:absolute;top:-60%;bottom:-60%;width:45%;inset-inline-start:-60%;background:linear-gradient( 90deg,transparent 0%,rgba( 255,251,255,0.14 ) 45%,rgba( 255,251,255,0.22 ) 50%,rgba( 255,251,255,0.14 ) 55%,transparent 100% );transform:rotate( 18deg ) translateX( 0 );opacity:0}:hover>.os-holo-glint::before,:focus-visible>.os-holo-glint::before,:host(:hover )>.os-holo-glint::before,:host(:focus-visible )>.os-holo-glint::before{animation:os-holo-glint var( --_holo-t-slow ) var( --_holo-ease )}@keyframes os-holo-glint{0%{opacity:0;transform:rotate( 18deg ) translateX( 0 )}15%{opacity:1}85%{opacity:1}100%{opacity:0;transform:rotate( 18deg ) translateX( 240vw )}}@media ( prefers-reduced-motion:reduce ){:hover>.os-holo-glint::before,:focus-visible>.os-holo-glint::before,:host(:hover )>.os-holo-glint::before,:host(:focus-visible )>.os-holo-glint::before{animation:none}}`,Ao=R` .os-holo-ring{position:absolute;inset:0;border-radius:inherit;box-shadow:0 0 0 0 var( --_holo-ring-color );opacity:0;pointer-events:none}:active:not(:disabled )>.os-holo-ring,:host(:active:not( [ disabled ] ) )>.os-holo-ring{animation:os-holo-ring var( --_holo-t-slow ) var( --_holo-ease )}@keyframes os-holo-ring{0%{opacity:0.45;box-shadow:0 0 0 0 var( --_holo-ring-color )}100%{opacity:0;box-shadow:0 0 0 10px transparent}}@media ( prefers-reduced-motion:reduce ){:active:not(:disabled )>.os-holo-ring,:host(:active:not( [ disabled ] ) )>.os-holo-ring{animation:none}}`,Eo=R` .os-holo-shimmer{background-image:var( --_holo-fill );background-size:300% 300%;background-repeat:no-repeat;animation:os-holo-shimmer 2.4s var( --_holo-loop ) infinite}@keyframes os-holo-shimmer{0%{background-position:0% 50%}100%{background-position:100% 50%}}@media ( prefers-reduced-motion:reduce ){.os-holo-shimmer{animation:none;background-position:30% 50%}}`,zo=R` .os-holo-enter{animation:os-holo-enter var( --_holo-t ) var( --_holo-spring )}@keyframes os-holo-enter{from{opacity:0;transform:scale( 0.96 )}}@media ( prefers-reduced-motion:reduce ){.os-holo-enter{animation:none}}`,To=R` input:where(:not( [ type='checkbox' ] ):not( [ type='radio' ] ) ),select,textarea{transition:background-color var( --_holo-t ) ease,border-color var( --_holo-t ) ease,box-shadow var( --_holo-t ) ease}input:where(:not( [ type='checkbox' ] ):not( [ type='radio' ] ) ):hover:not(:disabled ),select:hover:not(:disabled ),textarea:hover:not(:disabled ){border-color:var( --os-ui-border-strong,#8c8f94 )}input:where(:not( [ type='checkbox' ] ):not( [ type='radio' ] ) ):focus,input:where(:not( [ type='checkbox' ] ):not( [ type='radio' ] ) ):focus-visible,select:focus,select:focus-visible,textarea:focus,textarea:focus-visible{outline:none;border-color:var( --os-ui-accent,#2271b1 );box-shadow:var( --_holo-focus-field )}input::placeholder,textarea::placeholder{color:var( --os-ui-fg-faint,#8c8f94 );opacity:1}input::selection,textarea::selection{background:var( --os-ui-selection-bg,rgba( 159,152,255,0.6 ) );color:var( --os-ui-selection-fg,#fffbff )}@media ( prefers-reduced-motion:reduce ){input:where(:not( [ type='checkbox' ] ):not( [ type='radio' ] ) ),select,textarea{transition-duration:1ms}}`,Je=R` input[ type='checkbox' ],input[ type='radio' ]{appearance:none;-webkit-appearance:none;position:relative;flex:0 0 auto;box-sizing:border-box;width:16px;height:16px;margin:0;padding:0;border:1px solid var( --_holo-track-edge );border-radius:4px;background-color:var( --_holo-track );background-image:none;background-repeat:no-repeat;cursor:inherit;transition:background-color var( --_holo-t ) ease,border-color var( --_holo-t ) ease,box-shadow var( --_holo-t ) ease}input[ type='radio' ]{border-radius:50%}input[ type='checkbox' ]:hover:not(:disabled ),input[ type='radio' ]:hover:not(:disabled ){border-color:var( --os-ui-accent,#2271b1 )}input[ type='checkbox' ]:focus-visible,input[ type='radio' ]:focus-visible{outline:none;box-shadow:var( --_holo-focus )}input[ type='checkbox' ]:checked,input[ type='checkbox' ]:indeterminate,input[ type='radio' ]:checked{border-color:transparent;background-color:var( --os-ui-accent,#2271b1 )}input[ type='checkbox' ]:checked:focus-visible,input[ type='radio' ]:checked:focus-visible{box-shadow:var( --_holo-focus )}input[ type='checkbox' ]:checked::after{content:'';position:absolute;inset-inline-start:50%;top:46%;width:3.5px;height:7.5px;border:solid var( --os-ui-accent-ink,var( --os-ui-fg-on-accent,#fff ) );border-width:0 2px 2px 0;transform:translate( -50%,-50% ) rotate( 45deg );animation:os-holo-tick 180ms cubic-bezier( 0.3,1.4,0.6,1 )}input[ type='checkbox' ]:indeterminate::after{content:'';position:absolute;inset-inline-start:50%;top:50%;width:8px;height:2px;border:0;border-radius:1px;background:var( --os-ui-accent-ink,var( --os-ui-fg-on-accent,#fff ) );transform:translate( -50%,-50% )}input[ type='radio' ]:checked::after{content:'';position:absolute;inset-inline-start:50%;top:50%;width:6px;height:6px;border-radius:50%;background:var( --os-ui-accent-ink,var( --os-ui-fg-on-accent,#fff ) );transform:translate( -50%,-50% );animation:os-holo-tick 180ms cubic-bezier( 0.3,1.4,0.6,1 )}input[ type='checkbox' ]:disabled,input[ type='radio' ]:disabled{cursor:not-allowed}@keyframes os-holo-tick{from{opacity:0;transform:translate( -50%,-50% ) rotate( 45deg ) scale( 0.4 )}}@media ( prefers-reduced-motion:reduce ){input[ type='checkbox' ]:checked::after,input[ type='radio' ]:checked::after{animation:none}}`,Po=R` @keyframes os-holo-drift{0%{background-position:16% 26%}50%{background-position:84% 74%}100%{background-position:16% 26%}}.os-holo-alive{animation:os-holo-drift var( --_holo-t-ambient ) var( --_holo-loop ) infinite}@media ( prefers-reduced-motion:reduce ){.os-holo-alive{animation:none}}`;R` ${fe} ${wo} ${$o} ${Co} ${So} ${Ao} ${Eo} ${zo} ${To} ${Je} ${Po} `;const Mo=R` ${fe}:host{display:inline-flex;max-width:100%;vertical-align:middle}:host( [ hidden ] ){display:none}.os-chip{display:inline-flex;align-items:center;gap:var( --os-ui-chip-gap,4px );padding:var( --os-ui-chip-padding,2px 8px );border-radius:var( --os-ui-chip-radius,999px );font-size:var( --os-ui-chip-font-size,12px );line-height:var( --os-ui-chip-line-height,1.6 );font-weight:var( --os-ui-chip-font-weight,500 );background:var( --os-ui-chip-bg,var( --os-ui-surface,#f0f0f1 ) );color:var( --os-ui-chip-fg,var( --os-ui-fg,#1d2327 ) );border:var( --os-ui-chip-border,1px solid transparent );max-width:100%;box-sizing:border-box;transition:background-color 0.12s ease,color 0.12s ease,border-color 0.12s ease,transform 0.12s ease,opacity 0.12s ease}:host( [ tone='accent' ] ) .os-chip{background:var( --os-ui-chip-bg,color-mix( in srgb,var( --wp-admin-theme-color,#2271b1 ) 14%,transparent ) );color:var( --os-ui-chip-fg,var( --wp-admin-theme-color,#2271b1 ) )}:host( [ tone='positive' ] ) .os-chip{background:var( --os-ui-chip-bg,rgba( 30,132,73,0.14 ) );color:var( --os-ui-chip-fg,var( --os-ui-success-fg,#1d6f42 ) )}:host( [ tone='warning' ] ) .os-chip{background:var( --os-ui-chip-bg,rgba( 217,119,6,0.18 ) );color:var( --os-ui-chip-fg,var( --os-ui-warning-fg,#8a4a06 ) )}:host( [ tone='danger' ] ) .os-chip{background:var( --os-ui-chip-bg,rgba( 214,54,56,0.14 ) );color:var( --os-ui-chip-fg,var( --os-ui-danger-hover,#a02622 ) )}:host( [ pending ] ) .os-chip{opacity:0.65;animation:os-chip-pulse 1.2s ease-in-out infinite}@keyframes os-chip-pulse{0%,100%{opacity:0.55}50%{opacity:0.95}}.os-chip__label{max-width:var( --os-ui-chip-label-max,220px );overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.os-chip__icon{display:inline-flex;align-items:center;flex-shrink:0}.os-chip__icon::slotted( * ){display:inline-flex}.os-chip__dismiss{appearance:none;display:inline-flex;align-items:center;justify-content:center;flex-shrink:0;width:16px;height:16px;margin-inline-start:2px;padding:0;border:0;border-radius:50%;background:transparent;color:inherit;cursor:pointer;opacity:0.55;transition:opacity 0.12s ease,background-color 0.12s ease}.os-chip__dismiss:hover,.os-chip__dismiss:focus-visible{opacity:1;background:var( --os-ui-hover,rgba( 0,0,0,0.12 ) );outline:none}.os-chip__dismiss:focus-visible{box-shadow:var( --_holo-focus )}.os-chip__dismiss[ disabled ]{opacity:0.35;cursor:not-allowed}.os-chip__dismiss svg{display:block;width:14px;height:14px}:host( [ disabled ] ) .os-chip{opacity:0.55;cursor:not-allowed}:host( [ size='compact' ] ) .os-chip{padding:var( --os-ui-chip-padding,1px 6px );font-size:var( --os-ui-chip-font-size,11px )}:host( [ selected ] ) .os-chip{position:relative;background:var( --os-ui-chip-bg,var( --os-ui-accent-soft,rgba( 34,113,177,0.14 ) ) );color:var( --os-ui-chip-fg,var( --os-ui-fg,#1d2327 ) )}:host( [ selected ] ) .os-chip::after{content:'';position:absolute;inset:0;border-radius:inherit;padding:1px;background-image:var( --_holo-edge );pointer-events:none;-webkit-mask:linear-gradient( #000 0 0 ) content-box,linear-gradient( #000 0 0 );-webkit-mask-composite:xor;mask:linear-gradient( #000 0 0 ) content-box,linear-gradient( #000 0 0 );mask-composite:exclude}`,_e=class _e extends U{constructor(){super(...arguments),this._onHostKeyDown=e=>{if(this.dismissible!==null&&(e.key==="Backspace"||e.key==="Delete")){if(e.preventDefault(),this.disabled!==null)return;const i=this.label??"";this.emit("os-chip-dismiss",{label:i})}}}connectedCallback(){super.connectedCallback(),this.addEventListener("keydown",this._onHostKeyDown)}disconnectedCallback(){this.removeEventListener("keydown",this._onHostKeyDown)}render(){const e=this.label??"",t=this.dismissible!==null,o=this.disabled!==null;return b`
41 41 <span part="chip" class="os-chip">
42 42 <span class="os-chip__icon">
43 43 <slot name="icon"></slot>
44 44 </span>
@@ -50,45 +50,45 @@
50 50 part="dismiss"
51 51 class="os-chip__dismiss"
52 52 type="button"
53 53 aria-label=${`Remove ${e||"chip"}`}
54 - ?disabled=${s}
54 + ?disabled=${o}
55 55 @click=${i=>this._onDismiss(i)}
56 56 >
57 - ${X("close",{size:null})}
57 + ${Y("close",{size:null})}
58 58 </button>
59 59 `:b``}
60 60 </span>
61 - `}_onDismiss(e){if(e.stopPropagation(),this.disabled!==null)return;const s=this.label??"";this.emit("os-chip-dismiss",{label:s})}};_e.props=["label","tone","size","dismissible","disabled","pending","selected"],_e.styles=[go],_e.help=void 0;let Ye=_e;U("os-chip",Ye);const j="10px",mo=P`:host{display:inline-flex;max-width:100%;align-items:center;min-width:0;font-family:var( --os-ui-font,system-ui,sans-serif );font-size:12px;line-height:1;font-weight:500}.os-crumb-chain{display:inline-flex;flex-wrap:nowrap;align-items:stretch;max-width:100%;min-width:0;min-height:22px;border-radius:999px;overflow:hidden;filter:drop-shadow( 0 1px 1px rgba( 0,0,0,0.06 ) )}.os-crumb{display:inline-flex;align-items:center;justify-content:center;gap:5px;min-height:22px;padding:2px 12px;background:var( --os-ui-crumb-bg,var( --os-ui-surface,#c3c4c7 ) );color:var( --os-ui-crumb-fg,var( --os-ui-fg,#1d2327 ) );text-align:center;min-width:0;max-width:100%;flex-shrink:1;font-size:12px;font-weight:500;letter-spacing:0.01em;white-space:nowrap;cursor:grab;transition:filter 0.15s ease,transform 0.15s ease,background-color 0.12s ease}.os-crumb:active{cursor:grabbing}.os-crumb:hover{filter:brightness( 1.06 )}.os-crumb__remove{cursor:pointer}.os-crumb--first{padding-inline-end:22px;clip-path:polygon( 0 0,calc( 100% - ${j} ) 0,100% 50%,calc( 100% - ${j} ) 100%,0 100% )}.os-crumb--middle{padding-inline:22px;margin-inline-start:calc( -1 * ${j} );clip-path:polygon( ${j} 0,calc( 100% - ${j} ) 0,100% 50%,calc( 100% - ${j} ) 100%,${j} 100%,0 50% )}.os-crumb--last{padding-inline-start:22px;padding-inline-end:14px;margin-inline-start:calc( -1 * ${j} );clip-path:polygon( ${j} 0,100% 0,100% 100%,${j} 100%,0 50% )}.os-crumb--solo{padding:2px 12px;border-radius:999px}.os-crumb__label{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;line-height:1.4}.os-crumb__remove{appearance:none;display:inline-flex;align-items:center;justify-content:center;width:14px;height:14px;flex-shrink:0;padding:0;border:0;border-radius:50%;background:transparent;color:inherit;cursor:pointer;opacity:0.65;transition:opacity 0.12s ease,background-color 0.12s ease,transform 0.12s ease}.os-crumb__remove:hover,.os-crumb__remove:focus-visible{opacity:1;background:var( --os-ui-scrim,rgba( 0,0,0,0.22 ) );outline:none;transform:scale( 1.1 )}.os-crumb__remove svg{display:block;width:100%;height:100%}.os-crumb-chain:hover{filter:drop-shadow( 0 2px 3px rgba( 0,0,0,0.12 ) )}:host( [ disabled ] ) .os-crumb-chain{opacity:0.55;pointer-events:none}`,ve=class ve extends q{constructor(){super(...arguments),this._segments=[]}get segments(){return this._segments}set segments(e){this._segments=Array.isArray(e)?e.slice():[],this.requestUpdate()}render(){const e=this.removable!==null,t=this._segments;return t.length===0?b``:b`
61 + `}_onDismiss(e){if(e.stopPropagation(),this.disabled!==null)return;const o=this.label??"";this.emit("os-chip-dismiss",{label:o})}};_e.props=["label","tone","size","dismissible","disabled","pending","selected"],_e.styles=[Mo],_e.help=void 0;let Qe=_e;W("os-chip",Qe);const K="10px",Lo=R`:host{display:inline-flex;max-width:100%;align-items:center;min-width:0;font-family:var( --os-ui-font,system-ui,sans-serif );font-size:12px;line-height:1;font-weight:500}.os-crumb-chain{display:inline-flex;flex-wrap:nowrap;align-items:stretch;max-width:100%;min-width:0;min-height:22px;border-radius:999px;overflow:hidden;filter:drop-shadow( 0 1px 1px rgba( 0,0,0,0.06 ) )}.os-crumb{display:inline-flex;align-items:center;justify-content:center;gap:5px;min-height:22px;padding:2px 12px;background:var( --os-ui-crumb-bg,var( --os-ui-surface,#c3c4c7 ) );color:var( --os-ui-crumb-fg,var( --os-ui-fg,#1d2327 ) );text-align:center;min-width:0;max-width:100%;flex-shrink:1;font-size:12px;font-weight:500;letter-spacing:0.01em;white-space:nowrap;cursor:grab;transition:filter 0.15s ease,transform 0.15s ease,background-color 0.12s ease}.os-crumb:active{cursor:grabbing}.os-crumb:hover{filter:brightness( 1.06 )}.os-crumb__remove{cursor:pointer}.os-crumb--first{padding-inline-end:22px;clip-path:polygon( 0 0,calc( 100% - ${K} ) 0,100% 50%,calc( 100% - ${K} ) 100%,0 100% )}.os-crumb--middle{padding-inline:22px;margin-inline-start:calc( -1 * ${K} );clip-path:polygon( ${K} 0,calc( 100% - ${K} ) 0,100% 50%,calc( 100% - ${K} ) 100%,${K} 100%,0 50% )}.os-crumb--last{padding-inline-start:22px;padding-inline-end:14px;margin-inline-start:calc( -1 * ${K} );clip-path:polygon( ${K} 0,100% 0,100% 100%,${K} 100%,0 50% )}.os-crumb--solo{padding:2px 12px;border-radius:999px}.os-crumb__label{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;line-height:1.4}.os-crumb__remove{appearance:none;display:inline-flex;align-items:center;justify-content:center;width:14px;height:14px;flex-shrink:0;padding:0;border:0;border-radius:50%;background:transparent;color:inherit;cursor:pointer;opacity:0.65;transition:opacity 0.12s ease,background-color 0.12s ease,transform 0.12s ease}.os-crumb__remove:hover,.os-crumb__remove:focus-visible{opacity:1;background:var( --os-ui-scrim,rgba( 0,0,0,0.22 ) );outline:none;transform:scale( 1.1 )}.os-crumb__remove svg{display:block;width:100%;height:100%}.os-crumb-chain:hover{filter:drop-shadow( 0 2px 3px rgba( 0,0,0,0.12 ) )}:host( [ disabled ] ) .os-crumb-chain{opacity:0.55;pointer-events:none}`,ve=class ve extends U{constructor(){super(...arguments),this._segments=[]}get segments(){return this._segments}set segments(e){this._segments=Array.isArray(e)?e.slice():[],this.requestUpdate()}render(){const e=this.removable!==null,t=this._segments;return t.length===0?b``:b`
62 62 <div class="os-crumb-chain" role="group">
63 - ${t.map((s,i)=>{const a=Nt(i,t.length),n=s.color,r=n?`--os-ui-crumb-bg: ${n}; --os-ui-crumb-fg: ${Ot(n)};`:"";return b`
63 + ${t.map((o,i)=>{const a=Wt(i,t.length),n=o.color,r=n?`--os-ui-crumb-bg: ${n}; --os-ui-crumb-fg: ${jt(n)};`:"";return b`
64 64 <span
65 65 class=${`os-crumb os-crumb--${a}`}
66 66 style=${r}
67 - title=${s.name}
67 + title=${o.name}
68 68 draggable="true"
69 - @click=${l=>this._onSegmentClick(l,i,s)}
70 - @dragstart=${l=>this._onSegmentDragStart(l,i,s)}
69 + @click=${l=>this._onSegmentClick(l,i,o)}
70 + @dragstart=${l=>this._onSegmentDragStart(l,i,o)}
71 71 >
72 - <span class="os-crumb__label">${s.name}</span>
72 + <span class="os-crumb__label">${o.name}</span>
73 73 ${e?b`
74 74 <button
75 75 type="button"
76 76 class="os-crumb__remove"
77 - aria-label=${`Remove ${s.name}`}
77 + aria-label=${`Remove ${o.name}`}
78 78 draggable="false"
79 - @click=${l=>this._onRemove(l,i,s)}
80 - >${xo()}</button>
79 + @click=${l=>this._onRemove(l,i,o)}
80 + >${Oo()}</button>
81 81 `:b``}
82 82 </span>
83 83 `})}
84 84 </div>
85 - `}_onSegmentDragStart(e,t,s){if(e.target?.closest(".os-crumb__remove")){e.preventDefault();return}const a=this._segments.slice(t);if(e.dataTransfer){const n=_o(a);document.body.appendChild(n);const r=e.currentTarget?.getBoundingClientRect(),l=r?Math.min(30,r.width/2):16,c=r?Math.min(16,r.height/2):12;e.dataTransfer.setDragImage(n,l,c),requestAnimationFrame(()=>n.remove())}this.emit("os-chain-segment-dragstart",{index:t,id:s.id,segment:s,segments:a,dragEvent:e})}_onSegmentClick(e,t,s){e.target?.closest(".os-crumb__remove")||this.emit("os-chain-segment-click",{index:t,id:s.id,segment:s})}_onRemove(e,t,s){e.stopPropagation(),this.emit("os-chain-remove",{index:t,id:s.id,segment:s})}};ve.props=["removable","disabled"],ve.styles=[mo],ve.help=void 0;let Je=ve;U("os-crumb-chain",Je);const bo=10;function _o(o){const e=document.createElement("div");e.style.cssText=["display: inline-flex","align-items: stretch","border-radius: 999px","overflow: hidden","filter: drop-shadow( 0 1px 2px rgba( 0, 0, 0, 0.18 ) )",'font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif',"font-size: 12px","line-height: 1","font-weight: 500","position: fixed","top: -10000px","left: -10000px","pointer-events: none","z-index: 2147483647"].join("; ");const t=o.length,s=vo();return o.forEach((i,a)=>{const n=document.createElement("span"),r=i.color??s.bg,l=i.color?Ot(i.color):s.fg,c=Nt(a,t),d=["display: inline-flex","align-items: center","justify-content: center","min-height: 22px",`background: ${r}`,`color: ${l}`,"white-space: nowrap","box-sizing: border-box","letter-spacing: 0.01em"],p=bo;c==="solo"?d.push("padding: 2px 12px","border-radius: 999px"):c==="first"?d.push("padding: 2px 22px 2px 12px",`clip-path: polygon( 0 0, calc( 100% - ${p}px ) 0, 100% 50%, calc( 100% - ${p}px ) 100%, 0 100% )`):c==="middle"?d.push("padding: 2px 22px",`margin-inline-start: -${p}px`,`clip-path: polygon( ${p}px 0, calc( 100% - ${p}px ) 0, 100% 50%, calc( 100% - ${p}px ) 100%, ${p}px 100%, 0 50% )`):d.push("padding: 2px 14px 2px 22px",`margin-inline-start: -${p}px`,`clip-path: polygon( ${p}px 0, 100% 0, 100% 100%, ${p}px 100%, 0 50% )`),n.style.cssText=d.join("; "),n.textContent=i.name,e.appendChild(n)}),e}const Rt="rgba( 0, 0, 0, 0.08 )",It="#1d2327";function vo(){if(typeof document>"u"||!document.body)return{bg:Rt,fg:It};const o=getComputedStyle(document.body);return{bg:o.getPropertyValue("--os-ui-crumb-bg").trim()||Rt,fg:o.getPropertyValue("--os-ui-crumb-fg").trim()||It}}function Nt(o,e){return e===1?"solo":o===0?"first":o===e-1?"last":"middle"}let ge=null;function Ot(o){ge||(ge=document.createElement("canvas"),ge.width=1,ge.height=1);const e=ge.getContext("2d",{willReadFrequently:!0});if(!e)return"#1d2327";try{e.clearRect(0,0,1,1),e.fillStyle=o,e.fillRect(0,0,1,1);const t=e.getImageData(0,0,1,1).data,s=t[3]/255,i=t[0]*s+255*(1-s),a=t[1]*s+255*(1-s),n=t[2]*s+255*(1-s),r=c=>{const d=c/255;return d<=.03928?d/12.92:Math.pow((d+.055)/1.055,2.4)};return .2126*r(i)+.7152*r(a)+.0722*r(n)>.55?"#1d2327":"#fff"}catch{return"#1d2327"}}function xo(){return X("close",{size:null})}const Dt="uncategorized",yo=1;function Le(o){return o.id===yo?!0:(o.name||"").toLowerCase()===Dt}const xe=class xe extends q{constructor(){super(...arguments),this._items=[],this._value=[],this._query="",this._collapsed=new Set,this._focusedRow=-1,this._creatingValues=new Map,this._creatingPending=new Set,this._onCellClick=e=>{if(e.target?.closest(".os-cat-node")||this.isOpen)return;const s=this.disabled!==null,i=this.readonly!==null;s||i||this.openPicker()},this._onDocPointerDown=e=>{!this.isOpen||e.composedPath().includes(this)||this.closePicker()},this._onLayoutChange=()=>{this.isOpen&&this.closePicker()},this._onDocKeydown=e=>{this.isOpen&&e.key==="Escape"&&(e.preventDefault(),this.closePicker())}}get items(){return this._items}set items(e){this._items=Array.isArray(e)?e.slice():[],this.requestUpdate()}get value(){return this._value}set value(e){this._value=Array.isArray(e)?e.slice():[],this.requestUpdate()}get isOpen(){return this.open!==null}openPicker(){this.isOpen||(this.open="",this._query="",this._focusedRow=0,this.emit("os-categories-open",{}),queueMicrotask(()=>{this._positionPopover(),this._searchInput?.focus()}))}closePicker(){this.isOpen&&(this.open=null,this._query="",this._focusedRow=-1,this.emit("os-categories-close",{}),this.requestUpdate())}connectedCallback(){super.connectedCallback(),document.addEventListener("pointerdown",this._onDocPointerDown,!0),document.addEventListener("keydown",this._onDocKeydown,!0),window.addEventListener("resize",this._onLayoutChange,{passive:!0}),window.addEventListener("scroll",this._onLayoutChange,{passive:!0,capture:!0})}disconnectedCallback(){document.removeEventListener("pointerdown",this._onDocPointerDown,!0),document.removeEventListener("keydown",this._onDocKeydown,!0),window.removeEventListener("resize",this._onLayoutChange),window.removeEventListener("scroll",this._onLayoutChange,{capture:!0})}get _searchInput(){return this.shadowRoot?.querySelector(".os-cat__search")??null}render(){const e=this.isOpen,t=this.disabled!==null,s=this.readonly!==null,i=this.loading!==null,a=this["add-label"]||"Categorize",n=this.placeholder||"Search categories…",r=Math.max(0,parseInt(this["max-visible"]||"2",10)||2);return b`
85 + `}_onSegmentDragStart(e,t,o){if(e.target?.closest(".os-crumb__remove")){e.preventDefault();return}const a=this._segments.slice(t);if(e.dataTransfer){const n=Io(a);document.body.appendChild(n);const r=e.currentTarget?.getBoundingClientRect(),l=r?Math.min(30,r.width/2):16,c=r?Math.min(16,r.height/2):12;e.dataTransfer.setDragImage(n,l,c),requestAnimationFrame(()=>n.remove())}this.emit("os-chain-segment-dragstart",{index:t,id:o.id,segment:o,segments:a,dragEvent:e})}_onSegmentClick(e,t,o){e.target?.closest(".os-crumb__remove")||this.emit("os-chain-segment-click",{index:t,id:o.id,segment:o})}_onRemove(e,t,o){e.stopPropagation(),this.emit("os-chain-remove",{index:t,id:o.id,segment:o})}};ve.props=["removable","disabled"],ve.styles=[Lo],ve.help=void 0;let et=ve;W("os-crumb-chain",et);const Ro=10;function Io(s){const e=document.createElement("div");e.style.cssText=["display: inline-flex","align-items: stretch","border-radius: 999px","overflow: hidden","filter: drop-shadow( 0 1px 2px rgba( 0, 0, 0, 0.18 ) )",'font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif',"font-size: 12px","line-height: 1","font-weight: 500","position: fixed","top: -10000px","left: -10000px","pointer-events: none","z-index: 2147483647"].join("; ");const t=s.length,o=No();return s.forEach((i,a)=>{const n=document.createElement("span"),r=i.color??o.bg,l=i.color?jt(i.color):o.fg,c=Wt(a,t),d=["display: inline-flex","align-items: center","justify-content: center","min-height: 22px",`background: ${r}`,`color: ${l}`,"white-space: nowrap","box-sizing: border-box","letter-spacing: 0.01em"],p=Ro;c==="solo"?d.push("padding: 2px 12px","border-radius: 999px"):c==="first"?d.push("padding: 2px 22px 2px 12px",`clip-path: polygon( 0 0, calc( 100% - ${p}px ) 0, 100% 50%, calc( 100% - ${p}px ) 100%, 0 100% )`):c==="middle"?d.push("padding: 2px 22px",`margin-inline-start: -${p}px`,`clip-path: polygon( ${p}px 0, calc( 100% - ${p}px ) 0, 100% 50%, calc( 100% - ${p}px ) 100%, ${p}px 100%, 0 50% )`):d.push("padding: 2px 14px 2px 22px",`margin-inline-start: -${p}px`,`clip-path: polygon( ${p}px 0, 100% 0, 100% 100%, ${p}px 100%, 0 50% )`),n.style.cssText=d.join("; "),n.textContent=i.name,e.appendChild(n)}),e}const Ut="rgba( 0, 0, 0, 0.08 )",Vt="#1d2327";function No(){if(typeof document>"u"||!document.body)return{bg:Ut,fg:Vt};const s=getComputedStyle(document.body);return{bg:s.getPropertyValue("--os-ui-crumb-bg").trim()||Ut,fg:s.getPropertyValue("--os-ui-crumb-fg").trim()||Vt}}function Wt(s,e){return e===1?"solo":s===0?"first":s===e-1?"last":"middle"}let ge=null;function jt(s){ge||(ge=document.createElement("canvas"),ge.width=1,ge.height=1);const e=ge.getContext("2d",{willReadFrequently:!0});if(!e)return"#1d2327";try{e.clearRect(0,0,1,1),e.fillStyle=s,e.fillRect(0,0,1,1);const t=e.getImageData(0,0,1,1).data,o=t[3]/255,i=t[0]*o+255*(1-o),a=t[1]*o+255*(1-o),n=t[2]*o+255*(1-o),r=c=>{const d=c/255;return d<=.03928?d/12.92:Math.pow((d+.055)/1.055,2.4)};return .2126*r(i)+.7152*r(a)+.0722*r(n)>.55?"#1d2327":"#fff"}catch{return"#1d2327"}}function Oo(){return Y("close",{size:null})}const Kt="uncategorized",qo=1;function Me(s){return s.id===qo?!0:(s.name||"").toLowerCase()===Kt}const xe=class xe extends U{constructor(){super(...arguments),this._items=[],this._value=[],this._query="",this._collapsed=new Set,this._focusedRow=-1,this._creatingValues=new Map,this._creatingPending=new Set,this._onCellClick=e=>{if(e.target?.closest(".os-cat-node")||this.isOpen)return;const o=this.disabled!==null,i=this.readonly!==null;o||i||this.openPicker()},this._onDocPointerDown=e=>{!this.isOpen||e.composedPath().includes(this)||this.closePicker()},this._onLayoutChange=()=>{this.isOpen&&this.closePicker()},this._onDocKeydown=e=>{this.isOpen&&e.key==="Escape"&&(e.preventDefault(),this.closePicker())}}get items(){return this._items}set items(e){this._items=Array.isArray(e)?e.slice():[],this.requestUpdate()}get value(){return this._value}set value(e){this._value=Array.isArray(e)?e.slice():[],this.requestUpdate()}get isOpen(){return this.open!==null}openPicker(){this.isOpen||(this.open="",this._query="",this._focusedRow=0,this.emit("os-categories-open",{}),queueMicrotask(()=>{this._positionPopover(),this._searchInput?.focus()}))}closePicker(){this.isOpen&&(this.open=null,this._query="",this._focusedRow=-1,this.emit("os-categories-close",{}),this.requestUpdate())}connectedCallback(){super.connectedCallback(),document.addEventListener("pointerdown",this._onDocPointerDown,!0),document.addEventListener("keydown",this._onDocKeydown,!0),window.addEventListener("resize",this._onLayoutChange,{passive:!0}),window.addEventListener("scroll",this._onLayoutChange,{passive:!0,capture:!0})}disconnectedCallback(){document.removeEventListener("pointerdown",this._onDocPointerDown,!0),document.removeEventListener("keydown",this._onDocKeydown,!0),window.removeEventListener("resize",this._onLayoutChange),window.removeEventListener("scroll",this._onLayoutChange,{capture:!0})}get _searchInput(){return this.shadowRoot?.querySelector(".os-cat__search")??null}render(){const e=this.isOpen,t=this.disabled!==null,o=this.readonly!==null,i=this.loading!==null,a=this["add-label"]||"Categorize",n=this.placeholder||"Search categories…",r=Math.max(0,parseInt(this["max-visible"]||"2",10)||2);return b`
86 86 <span class="os-cat" role="group">
87 - ${this._renderChipRow(r,s,t,a)}
87 + ${this._renderChipRow(r,o,t,a)}
88 88 ${e?this._renderPopover(n,i):b``}
89 89 </span>
90 - `}_renderChipRow(e,t,s,i){const a=this._selectedItemsInOrder();if(a.length===0)return b`
90 + `}_renderChipRow(e,t,o,i){const a=this._selectedItemsInOrder();if(a.length===0)return b`
91 91 <span class="os-cat__chips" role="list">
92 92 <span
93 93 class="os-cat__uncategorized"
94 94 title=${'Posts with no category appear as "Uncategorized" in WordPress.'}
@@ -100,11 +100,11 @@
100 100 class="os-cat__chains"
101 101 role="list"
102 102 @click=${this._onCellClick}
103 103 >
104 - ${n.map(r=>this._renderChain(r,t,s))}
104 + ${n.map(r=>this._renderChain(r,t,o))}
105 105 </div>
106 - `}_buildChains(e){const t=new Map;for(const r of this._items)t.set(r.id,r);const s=new Set(e.map(r=>r.id)),i=r=>{for(const l of s){if(l===r)continue;let c=t.get(l),d=16;for(;c&&d-- >0;){if(c.parent===r)return!0;if(!c.parent)break;c=t.get(c.parent)}}return!1},a=e.filter(r=>!i(r.id)),n=[];for(const r of a){const l=[];let c=r,d=16;for(;c&&d-- >0&&((c===r||s.has(c.id))&&l.unshift(c),!!c.parent);)c=t.get(c.parent);const p=l.map(h=>({id:h.id,name:h.name}));n.push({id:r.id,segments:p})}return n}_renderChain(e,t,s){const i=!t&&!s,a=r=>{r.stopPropagation();const l=r.detail,c=typeof l?.index=="number"?l.index:e.segments.length-1,d=new Set;for(const h of e.segments.slice(c))typeof h.id=="number"&&d.add(h.id);const p=this._value.filter(h=>!d.has(h));p.length!==this._value.length&&this.emit("os-categories-change",{value:p})},n=document.createElement("os-crumb-chain");return n.segments=e.segments,i&&n.setAttribute("removable",""),n.addEventListener("os-chain-remove",a),b`<div role="listitem">${n}</div>`}_renderPopover(e,t){const s=this._buildTree(),i=this._filterTree(s,this._query),a=this._flattenForDisplay(i);return this._focusedRow>=a.length&&(this._focusedRow=a.length>0?a.length-1:-1),b`
106 + `}_buildChains(e){const t=new Map;for(const r of this._items)t.set(r.id,r);const o=new Set(e.map(r=>r.id)),i=r=>{for(const l of o){if(l===r)continue;let c=t.get(l),d=16;for(;c&&d-- >0;){if(c.parent===r)return!0;if(!c.parent)break;c=t.get(c.parent)}}return!1},a=e.filter(r=>!i(r.id)),n=[];for(const r of a){const l=[];let c=r,d=16;for(;c&&d-- >0&&((c===r||o.has(c.id))&&l.unshift(c),!!c.parent);)c=t.get(c.parent);const p=l.map(g=>({id:g.id,name:g.name}));n.push({id:r.id,segments:p})}return n}_renderChain(e,t,o){const i=!t&&!o,a=r=>{r.stopPropagation();const l=r.detail,c=typeof l?.index=="number"?l.index:e.segments.length-1,d=new Set;for(const g of e.segments.slice(c))typeof g.id=="number"&&d.add(g.id);const p=this._value.filter(g=>!d.has(g));p.length!==this._value.length&&this.emit("os-categories-change",{value:p})},n=document.createElement("os-crumb-chain");return n.segments=e.segments,i&&n.setAttribute("removable",""),n.addEventListener("os-chain-remove",a),b`<div role="listitem">${n}</div>`}_renderPopover(e,t){const o=this._buildTree(),i=this._filterTree(o,this._query),a=this._flattenForDisplay(i);return this._focusedRow>=a.length&&(this._focusedRow=a.length>0?a.length-1:-1),b`
107 107 <div class="os-cat__popover" role="dialog" aria-label="Choose categories">
108 108 <input
109 109 class="os-cat__search"
110 110 type="text"
@@ -134,9 +134,9 @@
134 134 `:t.length===0?b`
135 135 <div class="os-cat__empty">
136 136 ${this._items.length===0?"No categories yet — create one in WordPress to assign.":"No matches."}
137 137 </div>
138 - `:t.map((s,i)=>this._renderRow(s,i,t.length))}_renderRow(e,t,s){const{node:i,hasChildren:a}=e,n=this._value.includes(i.item.id),r=!this._collapsed.has(i.item.id),l=12+i.depth*16,c=i.depth>0?i.depth*16:0,d=t===this._focusedRow;return b`
138 + `:t.map((o,i)=>this._renderRow(o,i,t.length))}_renderRow(e,t,o){const{node:i,hasChildren:a}=e,n=this._value.includes(i.item.id),r=!this._collapsed.has(i.item.id),l=12+i.depth*16,c=i.depth>0?i.depth*16:0,d=t===this._focusedRow;return b`
139 139 <div class="os-cat__row-block">
140 140 <div
141 141 class="os-cat__row"
142 142 role="option"
@@ -153,25 +153,25 @@
153 153 type="button"
154 154 class="os-cat__expander"
155 155 aria-label=${r?"Collapse":"Expand"}
156 156 @click=${p=>{p.stopPropagation(),this._toggleExpand(i.item.id)}}
157 - >${qt()}</button>`:b`<span class="os-cat__expander os-cat__expander--placeholder" aria-hidden="true">${qt()}</span>`}
158 - <span class="os-cat__check" aria-hidden="true">${wo()}</span>
157 + >${Bt()}</button>`:b`<span class="os-cat__expander os-cat__expander--placeholder" aria-hidden="true">${Bt()}</span>`}
158 + <span class="os-cat__check" aria-hidden="true">${Ho()}</span>
159 159 <span class="os-cat__label">${this._highlight(i.item.name,this._query)}</span>
160 - ${Le(i.item)?b``:b`<button
160 + ${Me(i.item)?b``:b`<button
161 161 type="button"
162 162 class="os-cat__delete"
163 163 aria-label=${`Delete ${i.item.name}`}
164 164 title=${`Delete ${i.item.name}`}
165 165 @click=${p=>this._onDeleteClick(p,i.item)}
166 - >${$o()}</button>`}
166 + >${Fo()}</button>`}
167 167 </div>
168 - ${r&&!Le(i.item)?this._renderCreateRow(i.item.id,12+(i.depth+1)*16,(i.depth+1)*16,i.item.name):b``}
168 + ${r&&!Me(i.item)?this._renderCreateRow(i.item.id,12+(i.depth+1)*16,(i.depth+1)*16,i.item.name):b``}
169 169 </div>
170 - `}_renderCreateRow(e,t,s,i){const a=this._creatingValues.get(e)??"",n=this._creatingPending.has(e),r=e===0?"Add new category…":`Add child of "${i}"…`;return b`
170 + `}_renderCreateRow(e,t,o,i){const a=this._creatingValues.get(e)??"",n=this._creatingPending.has(e),r=e===0?"Add new category…":`Add child of "${i}"…`;return b`
171 171 <div
172 172 class="os-cat__create-row"
173 - style=${`--os-ui-cat-row-indent: ${t}px; --os-ui-cat-guide-width: ${s}px;`}
173 + style=${`--os-ui-cat-row-indent: ${t}px; --os-ui-cat-guide-width: ${o}px;`}
174 174 @click=${l=>l.stopPropagation()}
175 175 >
176 176 <div class="os-cat__create-wrap">
177 177 <input
@@ -191,14 +191,14 @@
191 191 class="os-cat__create-submit"
192 192 aria-label=${e===0?"Create category":`Create child of ${i}`}
193 193 ?disabled=${a.trim().length===0}
194 194 @click=${l=>{l.stopPropagation(),this._submitCreate(e)}}
195 - >${ko()}</button>`}
195 + >${Do()}</button>`}
196 196 </div>
197 197 </div>
198 - `}_onCreateInput(e,t){const s=e.target.value;s===""?this._creatingValues.delete(t):this._creatingValues.set(t,s),this.requestUpdate()}_onCreateKeydown(e,t){if(e.key==="Escape"){e.preventDefault(),this._creatingValues.delete(t),this.requestUpdate();return}e.key==="Enter"&&(e.preventDefault(),this._submitCreate(t))}_submitCreate(e){const t=(this._creatingValues.get(e)??"").trim();!t||this._creatingPending.has(e)||(this._creatingPending.add(e),this.requestUpdate(),this.emit("os-categories-create",{name:t,parent:e}))}endCreating(e=0){this._creatingPending.delete(e),this._creatingValues.delete(e),this.requestUpdate()}failCreating(e=0,t){this._creatingPending.delete(e),this.requestUpdate()}_buildTree(){const e=new Map;for(const a of this._items)e.set(a.id,{item:a,children:[],depth:0});const t=[];for(const a of e.values()){const n=a.item.parent;n&&e.has(n)?e.get(n).children.push(a):t.push(a)}const s=(a,n)=>{a.depth=n;for(const r of a.children)s(r,n+1)};for(const a of t)s(a,0);const i=a=>{a.sort((n,r)=>{const l=Le(n.item),c=Le(r.item);return l!==c?l?-1:1:n.item.name.localeCompare(r.item.name)});for(const n of a)i(n.children)};return i(t),t}_filterTree(e,t){const s=t.trim().toLowerCase();if(!s)return e;const i=a=>{if(a.item.name.toLowerCase().includes(s))return{item:a.item,children:a.children.slice(),depth:a.depth};const r=a.children.map(i).filter(l=>l!==null);return r.length>0?{item:a.item,children:r,depth:a.depth}:null};return e.map(i).filter(a=>a!==null)}_flattenForDisplay(e){const t=[],s=this._query.trim()!=="",i=a=>{for(const n of a)t.push({node:n,visible:!0,hasChildren:n.children.length>0}),!(this._collapsed.has(n.item.id)&&!s)&&n.children.length>0&&i(n.children)};return i(e),t}_selectedItemsInOrder(){const e=new Map;for(const i of this._items)e.set(i.id,i);const t=[],s=[];for(const i of this._value){const a=e.get(i);a&&(a.name.toLowerCase()===Dt||a.id===1?s.push(a):t.push(a))}return t.length>0?t:s.length>0?[]:t}_highlight(e,t){const s=t.trim();if(!s)return e;const i=e.toLowerCase(),a=s.toLowerCase(),n=i.indexOf(a);return n===-1?e:b`${e.slice(0,n)}<span class="os-cat__match"
199 - >${e.slice(n,n+s.length)}</span
200 - >${e.slice(n+s.length)}`}_toggleSelection(e){const t=this._value.includes(e)?this._value.filter(s=>s!==e):[...this._value,e];this.emit("os-categories-change",{value:t})}_onDeleteClick(e,t){e.stopPropagation(),e.preventDefault(),this.emit("os-categories-delete",{id:t.id,name:t.name})}_toggleExpand(e){this._collapsed.has(e)?this._collapsed.delete(e):this._collapsed.add(e),this.requestUpdate()}_onSearchInput(e){this._query=e.target.value,this._focusedRow=0,this.requestUpdate()}_onSearchKeydown(e,t){switch(e.key){case"ArrowDown":{if(t.length===0)return;e.preventDefault(),this._focusedRow=this._focusedRow+1>=t.length?0:this._focusedRow+1,this.requestUpdate(),this._scrollFocusedIntoView();return}case"ArrowUp":{if(t.length===0)return;e.preventDefault(),this._focusedRow=this._focusedRow<=0?t.length-1:this._focusedRow-1,this.requestUpdate(),this._scrollFocusedIntoView();return}case"ArrowRight":{if(this._focusedRow<0||this._focusedRow>=t.length)return;const s=t[this._focusedRow];s.hasChildren&&this._collapsed.has(s.node.item.id)&&(e.preventDefault(),this._toggleExpand(s.node.item.id));return}case"ArrowLeft":{if(this._focusedRow<0||this._focusedRow>=t.length)return;const s=t[this._focusedRow];s.hasChildren&&!this._collapsed.has(s.node.item.id)&&(e.preventDefault(),this._toggleExpand(s.node.item.id));return}case"Enter":case" ":{if(this._focusedRow<0||this._focusedRow>=t.length)return;e.preventDefault();const s=t[this._focusedRow];this._toggleSelection(s.node.item.id);return}case"Escape":e.preventDefault(),this.closePicker()}}_scrollFocusedIntoView(){queueMicrotask(()=>{const e=this.shadowRoot?.querySelector(".os-cat__tree");if(!e)return;const t=e.querySelector('.os-cat__row[data-focused="true"]');if(!t)return;const s=t.getBoundingClientRect(),i=e.getBoundingClientRect();s.top<i.top?t.scrollIntoView({block:"nearest"}):s.bottom>i.bottom&&t.scrollIntoView({block:"nearest"})})}_positionPopover(){const e=this.shadowRoot?.querySelector(".os-cat__popover");if(!e)return;const t=this.getBoundingClientRect(),s=e.getBoundingClientRect(),i=window.innerWidth,a=window.innerHeight,n=8;let r=t.bottom+4;const l=r+s.height+n>a,c=t.top-4-s.height>=n;l&&c?r=t.top-4-s.height:l&&(r=Math.max(n,a-s.height-n));let d=t.left;d+s.width+n>i&&(d=t.right-s.width),d=Math.max(n,Math.min(d,i-s.width-n)),e.style.top=`${r}px`,e.style.left=`${d}px`}};xe.props=["placeholder","add-label","disabled","readonly","open","loading","max-visible"],xe.styles=[io],xe.help=void 0;let Qe=xe;U("os-category-picker",Qe);function qt(){return X("chevron-right",{size:14})}function ko(){return X("plus",{size:16})}function wo(){return X("check",{size:null})}function $o(){return X("close",{size:null})}function Co(o){return o.categories.tree||(o.categories.tree=o.client.fetchAllCategories().then(e=>e.map(t=>({id:t.id,name:t.name,parent:t.parent})))),o.categories.tree}function Ht(o){o.categories.tree=null}function So(o){Co(o).then(e=>{for(const t of o.categories.pickers)t.isConnected?t.items=e:o.categories.pickers.delete(t)}).catch(()=>{})}function Ft(o,e){o.parentTitles.clear();for(const t of e)o.parentTitles.set(t.id,re(t))}function Ao(o,e){const t=document.createElement("span"),s=typeof o.parent=="number"?o.parent:0;if(s===0)return t.textContent="—",t.setAttribute("aria-label",u("Top-level page")),t;const i=e.parentTitles.get(s);return t.textContent=i?`↳ ${i}`:O(u("↳ #%d"),s),t}function zo(o,e){const t=document.createElement("span"),s=typeof o.template=="string"?o.template:"",i=e.extra.pageTemplates??{};return t.textContent=i[s]??(s===""?u("Default template"):s),s!==""&&(t.title=s),t}function Eo(o,e){const t=document.createElement("button");t.type="button";const s=typeof o.slug=="string"?o.slug:"";return t.textContent=s||"—",t.disabled=s==="",t.title=s?u("Click to copy slug"):"",Object.assign(t.style,{appearance:"none",background:"transparent",border:"none",padding:"2px 6px",font:"inherit",color:"inherit",cursor:s?"copy":"default",textAlign:"left",fontFamily:'ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace',fontSize:"12px",borderRadius:"4px",maxWidth:"100%",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}),t.addEventListener("click",i=>{i.stopPropagation(),s&&yt(s).then(a=>{if(!a){e.toast(u("Couldn’t copy the slug."),null);return}t.textContent=u("Copied!"),t.style.color="var(--wp-admin-theme-color, #2271b1)",setTimeout(()=>{t.textContent=s,t.style.color=""},1200)})}),t}function To(o){const e=document.createElement("span");Object.assign(e.style,{display:"inline-flex",alignItems:"center",gap:"6px",fontVariantNumeric:"tabular-nums"});const t=typeof o.openstation_comment_count=="number"?o.openstation_comment_count:null;if(t===null)return e.textContent="—",e.style.color="var(--os-ui-fg-muted, #8c8f94)",e;const s=document.createElement("span");s.className="dashicons dashicons-admin-comments",s.setAttribute("aria-hidden","true"),Object.assign(s.style,{fontSize:"16px",width:"16px",height:"16px",color:t>0?"var(--wp-admin-theme-color, #2271b1)":"var(--os-ui-fg-muted, #8c8f94)"});const i=document.createElement("span");return i.textContent=String(t),t===0&&(i.style.color="var(--os-ui-fg-muted, #8c8f94)"),e.appendChild(s),e.appendChild(i),e.setAttribute("aria-label",O(qe("%d comment","%d comments",t),t)),e}const Po=P` ${fe} ${Xe}:host{display:block;--_bg:var( --os-ui-table-bg,var( --os-ui-surface,#fff ) );--_border:var( --os-ui-table-border,var( --os-ui-border,rgba( 0,0,0,0.08 ) ) );--_column-border:var( --os-ui-table-column-border,var( --os-ui-border-strong,rgba( 0,0,0,0.14 ) ) );--_header-bg:var( --os-ui-table-header-bg,var( --os-ui-surface-elevated,#f6f7f7 ) );--_row-hover:var( --os-ui-table-row-hover,var( --os-ui-hover,rgba( 0,0,0,0.04 ) ) );--_stripe:var( --os-ui-table-stripe,var( --os-ui-surface-subtle,rgba( 0,0,0,0.03 ) ) );--_cell-padding:var( --os-ui-table-cell-padding,8px 12px );--_font-size:var( --os-ui-table-font-size,13px );--_max-height:var( --os-ui-table-max-height,none );font-size:var( --_font-size );color:inherit}:host( [ hidden ] ){display:none}.scroll{position:relative;overflow:auto;max-height:var( --_max-height );border:1px solid var( --_border );border-radius:4px;background:var( --_bg )}table{width:100%;border-collapse:separate;border-spacing:0;background:var( --_bg )}thead th{text-align:start;font-weight:600;background-color:var( --_header-bg );background-image:var( --os-ui-table-header-bg-image,none );background-repeat:var( --os-ui-table-header-bg-image-repeat,repeat );background-size:var( --os-ui-table-header-bg-image-size,auto );background-position:var( --os-ui-table-header-bg-image-position,center );padding:var( --_cell-padding );border-bottom:1px solid var( --_border );white-space:nowrap}tbody td{padding:var( --_cell-padding );border-bottom:1px solid var( --_border );background-color:var( --_bg );vertical-align:middle}tbody tr:last-child td{border-bottom:0}:host( [ striped ] ) tbody tr:nth-child( odd ) td{background-image:linear-gradient( var( --_stripe ),var( --_stripe ) )}:host( [ hover ] ) tbody tr:hover td{background-image:linear-gradient( var( --_row-hover ),var( --_row-hover ) )}:host( [ hover ][ striped ] ) tbody tr:nth-child( odd ):hover td{background-image:linear-gradient( var( --_row-hover ),var( --_row-hover ) ),linear-gradient( var( --_stripe ),var( --_stripe ) )}:host( [ compact ] ){--os-ui-table-cell-padding:4px 8px;--os-ui-table-font-size:12px}:host( [ bordered ] ) thead th,:host( [ bordered ] ) tbody td{border-inline-end:1px solid var( --_column-border )}:host( [ bordered ] ) thead th:last-child,:host( [ bordered ] ) tbody td:last-child{border-inline-end:0}th.is-sticky,td.is-sticky{position:sticky;z-index:10}tbody td.is-sticky{background-color:var( --_bg )}thead th.is-sticky{background-color:var( --_header-bg );background-image:var( --os-ui-table-header-bg-image,none );background-repeat:var( --os-ui-table-header-bg-image-repeat,repeat );background-size:var( --os-ui-table-header-bg-image-size,auto );background-position:var( --os-ui-table-header-bg-image-position,center );z-index:30}:host( [ sticky-header ] ) thead th{position:sticky;top:0;z-index:20}:host( [ sticky-header ] ) thead tr.filter-row th{top:var( --os-ui-table-header-height,33px );z-index:20}:host( [ sticky-header ] ) thead th.is-sticky{z-index:40}:host( [ sticky-header ] ) thead tr.filter-row th.is-sticky{z-index:40}th.is-sticky-edge,td.is-sticky-edge{border-inline-end:var( --os-ui-table-sticky-edge,2px solid var( --_border ) )}.align-center{text-align:center}.align-end{text-align:end}.filter-row th{padding:4px 8px;background-color:var( --_header-bg );background-image:var( --os-ui-table-header-bg-image,none );background-repeat:var( --os-ui-table-header-bg-image-repeat,repeat );background-size:var( --os-ui-table-header-bg-image-size,auto );background-position:var( --os-ui-table-header-bg-image-position,center );border-bottom:1px solid var( --_border );font-weight:400}.filter-input,.filter-select{width:100%;min-width:60px;box-sizing:border-box;padding:4px 6px;font:inherit;color:inherit;background-color:var( --_bg );border:1px solid var( --_border );border-radius:3px}.filter-input:focus,.filter-select:focus{outline:none;border-color:var( --os-ui-accent,#2271b1 );box-shadow:var( --_holo-focus-field )}.expander{display:inline-flex;align-items:center;justify-content:center;width:20px;height:20px;padding:0;border:0;background:transparent;color:inherit;cursor:pointer;border-radius:3px;font-size:11px;line-height:1}.expander:hover{background:var( --os-ui-hover,rgba( 0,0,0,0.06 ) )}td.col-expander,th.col-expander{width:36px;min-width:36px;padding-left:0;padding-right:0;text-align:center}tr.subtable td{padding:0;background-color:var( --_bg );background-image:linear-gradient( var( --_stripe ),var( --_stripe ) );border-bottom:1px solid var( --_border )}tr.subtable .subtable-inner{padding:8px 12px 8px 32px}tr.empty td{padding:24px;text-align:center;color:var( --os-ui-text-muted,var( --os-ui-fg-muted,rgba( 0,0,0,0.55 ) ) );font-style:italic}thead th.is-sortable{cursor:pointer;user-select:none}thead th.is-sortable:hover{background-image:linear-gradient( var( --_row-hover ),var( --_row-hover ) )}thead th.is-sortable:focus-visible{outline:none;box-shadow:inset 0 0 0 2px var( --os-ui-accent,#2271b1 )}.sort-indicator{font-size:10px;color:var( --os-ui-text-muted,var( --os-ui-fg-muted,rgba( 0,0,0,0.55 ) ) );margin-inline-start:2px}thead th.sort-asc .sort-indicator,thead th.sort-desc .sort-indicator{color:var( --wp-admin-theme-color,#2271b1 )}td.col-select,th.col-select{width:40px;min-width:40px;padding-left:0;padding-right:0;text-align:center}.select-all-checkbox,.select-row-checkbox{cursor:pointer;margin:0}tbody tr.is-selected td{background-color:color-mix( in srgb,var( --wp-admin-theme-color,#2271b1 ) 10%,var( --_bg ) );background-image:none}tbody tr.is-selected:hover td{background-color:color-mix( in srgb,var( --wp-admin-theme-color,#2271b1 ) 16%,var( --_bg ) )}tbody tr.is-selected td:first-child{box-shadow:inset 3px 0 0 0 var( --os-ui-accent,#2271b1 )}tbody:dir( rtl ) tr.is-selected td:first-child{box-shadow:inset -3px 0 0 0 var( --os-ui-accent,#2271b1 )}:host( [ stacked ] ) .scroll{border:0;border-radius:0}:host( [ stacked ] ) table,:host( [ stacked ] ) tbody{display:block;width:100%}:host( [ stacked ] ) colgroup,:host( [ stacked ] ) thead{display:none}:host( [ stacked ] ) tbody tr{display:flex;align-items:flex-start;gap:12px;padding:12px 14px;border-bottom:1px solid var( --_border );background-color:var( --_bg )}:host( [ stacked ] ) tbody tr:last-child{border-bottom:0}:host( [ stacked ] ) tbody td{display:block;padding:0;border:0;background-color:transparent;background-image:none;box-shadow:none;min-width:0;width:auto;vertical-align:baseline}:host( [ stacked ] ) tbody tr.is-selected td,:host( [ stacked ] ) tbody tr.is-selected:hover td,:host( [ stacked ][ striped ] ) tbody tr:nth-child( odd ) td,:host( [ stacked ][ hover ] ) tbody tr:hover td,:host( [ stacked ][ hover ][ striped ] ) tbody tr:nth-child( odd ):hover td,:host( [ stacked ][ bordered ] ) tbody td{padding:0;border:0;background-color:transparent;background-image:none;box-shadow:none}:host( [ stacked ][ hover ] ) tbody tr:hover{background-image:linear-gradient( var( --_row-hover ),var( --_row-hover ) )}:host( [ stacked ] ) tbody tr.is-selected,:host( [ stacked ] ) tbody tr.is-selected:hover{background-color:color-mix( in srgb,var( --wp-admin-theme-color,#2271b1 ) 10%,var( --_bg ) );background-image:none;box-shadow:inset 3px 0 0 0 var( --os-ui-accent,#2271b1 )}:host( [ stacked ] ) tbody:dir( rtl ) tr.is-selected{box-shadow:inset -3px 0 0 0 var( --os-ui-accent,#2271b1 )}:host( [ stacked ] ) tbody td.col-select,:host( [ stacked ] ) tbody td.col-expander{flex:0 0 auto;display:flex;align-items:center;justify-content:center;min-width:0}:host( [ stacked ] ) tbody td.col-select{width:44px;height:44px;margin:-11px 0 -11px -11px;cursor:pointer}:host( [ stacked ] ) .select-row-checkbox{width:22px;height:22px}:host( [ stacked ] ) tbody td.col-expander{width:28px;height:22px;margin-inline-start:-4px}:host( [ stacked ] ) tbody td.stack-body{flex:1 1 auto;display:flex;flex-direction:column;gap:4px;min-width:0}.stack-cell{display:flex;align-items:baseline;gap:6px;min-width:0;line-height:1.4}.stack-title{font-size:15px;font-weight:600;line-height:1.35}.stack-meta{font-size:13px}.stack-label{flex:0 0 auto;font-size:12px;color:var( --os-ui-text-muted,var( --os-ui-fg-muted,rgba( 0,0,0,0.55 ) ) )}.stack-label::after{content:'·';margin-inline-start:6px}.stack-value{flex:1 1 auto;min-width:0;display:flex;align-items:center;flex-wrap:wrap;gap:6px}.stack-actions{margin-block-start:6px}.stack-actions .stack-value{gap:8px}.stack-actions .stack-value>*{justify-content:flex-start;max-width:100%}:host( [ stacked ] ) tr.subtable,:host( [ stacked ] ) tr.empty{display:block;padding:0}:host( [ stacked ] ) tr.subtable td{background-image:linear-gradient( var( --_stripe ),var( --_stripe ) )}:host( [ stacked ] ) tr.subtable .subtable-inner{padding:8px 14px 12px}:host( [ stacked ] ) tr.empty td{padding:24px}:host( [ stacked ] ) tr.skeleton{display:block;padding:14px;border-bottom:1px solid var( --_border )}:host( [ stacked ] ) tr.skeleton td.stack-body{gap:8px}:host( [ stacked ] ) tr.skeleton .skeleton-bar:first-child{height:15px}tbody tr.skeleton td{padding:var( --_cell-padding )}.skeleton-bar{display:block;height:12px;border-radius:3px;background:linear-gradient( 90deg,var( --os-ui-table-skeleton-color,var( --os-ui-hover,rgba( 0,0,0,0.06 ) ) ) 0%,var( --os-ui-table-skeleton-highlight,var( --os-ui-hover,rgba( 0,0,0,0.14 ) ) ) 50%,var( --os-ui-table-skeleton-color,var( --os-ui-hover,rgba( 0,0,0,0.06 ) ) ) 100% );background-size:200% 100%;animation:os-table-skeleton-pulse 1.4s ease-in-out infinite}@keyframes os-table-skeleton-pulse{0%{background-position:200% 50%}100%{background-position:-200% 50%}}@media ( prefers-reduced-motion:reduce ){.skeleton-bar{animation:none}}`,le="__wpd_expander__",ce="__wpd_select__",ye=class ye extends q{constructor(){super(...arguments),this._data=[],this._columns=[],this._filters={},this._expanded=new Set,this._subTable=null,this._sort=null,this._selection=new Set,this._getRowId=(e,t)=>t,this._filterCache=new Map,this._paintScheduled=!1,this._stacked=!1,this._stickyHeaderWarned=!1,this._stickyRaceWarned=!1,this._resizeObserver=null,this._stickyMicroScheduled=!1,this._stickyRafHandle=null,this._loadingDesyncWarned=!1,this._lastStickyIndex=-1}get data(){return this._data}set data(e){this._data=Array.isArray(e)?e.slice():[],this._expanded.clear(),this._schedulePaint()}get columns(){return this._columns}set columns(e){this._columns=Array.isArray(e)?e.slice():[];const t=new Set(this._columns.map(s=>s.key));for(const s of Object.keys(this._filters))t.has(s)||delete this._filters[s];for(const s of Array.from(this._filterCache.keys()))t.has(s)||this._filterCache.delete(s);this._sort&&!t.has(this._sort.key)&&(this._sort=null),this._schedulePaint()}get filters(){return{...this._filters}}set filters(e){this._filters=e?{...e}:{},this._schedulePaint()}get sort(){return this._sort?{...this._sort}:null}set sort(e){this._sort=e?{...e}:null,this._schedulePaint()}get selection(){return new Set(this._selection)}set selection(e){this._selection=new Set(e??[]),this._schedulePaint()}get selectedRows(){const e=[];return this._data.forEach((t,s)=>{this._selection.has(this._getRowId(t,s))&&e.push(t)}),e}get visibleRows(){return this._filteredRows().map(e=>e.row)}get getRowId(){return this._getRowId}set getRowId(e){this._getRowId=typeof e=="function"?e:(t,s)=>s,this._schedulePaint()}get subTable(){return this._subTable}set subTable(e){this._subTable=typeof e=="function"?e:null,this._expanded.clear(),this._schedulePaint()}get expanded(){return new Set(this._expanded)}set expanded(e){this._expanded=new Set(e??[]),this._schedulePaint()}expand(e){e<0||e>=this._data.length||this._expanded.has(e)||(this._expanded.add(e),this.emit("os-table-expand-change",{row:this._data[e],index:e,expanded:!0}),this._schedulePaint())}collapse(e){this._expanded.has(e)&&(this._expanded.delete(e),this.emit("os-table-expand-change",{row:this._data[e],index:e,expanded:!1}),this._schedulePaint())}expandAll(){if(!this._subTable)return;let e=!1;for(let t=0;t<this._data.length;t++)this._subTable(this._data[t],t)&&(this._expanded.has(t)||(this._expanded.add(t),e=!0));e&&this._schedulePaint()}collapseAll(){this._expanded.size!==0&&(this._expanded.clear(),this._schedulePaint())}isExpanded(e){return this._expanded.has(e)}clearFilters(){Object.keys(this._filters).length!==0&&(this._filters={},this.emit("os-table-filter-change",{filters:{}}),this._schedulePaint())}clearSort(){this._sort!==null&&(this._sort=null,this.emit("os-table-sort-change",{sort:null}),this._schedulePaint())}select(e){if(this._selection.has(e))return;const t=this._readSelectable(),s=t==="single"?Array.from(this._selection):[];t==="single"&&this._selection.clear(),this._selection.add(e),this._emitSelectionChange(),this._syncSelectionDom([e,...s])}deselect(e){this._selection.delete(e)&&(this._emitSelectionChange(),this._syncSelectionDom([e]))}selectAll(){if(this._readSelectable()==="multi"){for(const{row:e,index:t}of this._filteredRows())this._selection.add(this._getRowId(e,t));this._emitSelectionChange(),this._syncSelectionDom("all")}}clearSelection(){this._selection.size!==0&&(this._selection.clear(),this._emitSelectionChange(),this._syncSelectionDom("all"))}_syncSelectionDom(e){const t=this.shadowRoot;if(!t)return;const s=t.querySelector("tbody");if(!s)return;let i=null;if(e!=="all"){i=new Set;for(const r of e)i.add(String(r))}const a=s.querySelectorAll("tr[data-row-id]");for(const r of a){const l=r.dataset.rowId;if(l===void 0||i&&!i.has(l))continue;const c=Number(r.dataset.rowIndex);if(!Number.isFinite(c))continue;const d=this._data[c];if(d===void 0)continue;const p=this._getRowId(d,c),h=this._selection.has(p);r.classList.toggle("is-selected",h);const _=r.querySelector("input.select-row-checkbox");_&&_.checked!==h&&(_.checked=h)}const n=t.querySelector("thead .select-all-checkbox");if(n){const{total:r,selected:l}=this._visibleSelectionStats();n.checked=r>0&&l===r,n.indeterminate=l>0&&l<r}}scrollToRow(e){const t=this.shadowRoot;if(!t)return;const i=t.querySelectorAll("tbody tr:not(.subtable):not(.empty):not(.skeleton)")[e];i&&i.scrollIntoView({block:"nearest",inline:"nearest"})}connectedCallback(){super.connectedCallback(),this._schedulePaint()}disconnectedCallback(){this._resizeObserver?.disconnect(),this._resizeObserver=null,this._stickyRafHandle!==null&&typeof cancelAnimationFrame<"u"&&(cancelAnimationFrame(this._stickyRafHandle),this._stickyRafHandle=null)}recomputeLayout(){this._applyStickyOffsets(),this._measureHeaderHeight()}render(){return b`
198 + `}_onCreateInput(e,t){const o=e.target.value;o===""?this._creatingValues.delete(t):this._creatingValues.set(t,o),this.requestUpdate()}_onCreateKeydown(e,t){if(e.key==="Escape"){e.preventDefault(),this._creatingValues.delete(t),this.requestUpdate();return}e.key==="Enter"&&(e.preventDefault(),this._submitCreate(t))}_submitCreate(e){const t=(this._creatingValues.get(e)??"").trim();!t||this._creatingPending.has(e)||(this._creatingPending.add(e),this.requestUpdate(),this.emit("os-categories-create",{name:t,parent:e}))}endCreating(e=0){this._creatingPending.delete(e),this._creatingValues.delete(e),this.requestUpdate()}failCreating(e=0,t){this._creatingPending.delete(e),this.requestUpdate()}_buildTree(){const e=new Map;for(const a of this._items)e.set(a.id,{item:a,children:[],depth:0});const t=[];for(const a of e.values()){const n=a.item.parent;n&&e.has(n)?e.get(n).children.push(a):t.push(a)}const o=(a,n)=>{a.depth=n;for(const r of a.children)o(r,n+1)};for(const a of t)o(a,0);const i=a=>{a.sort((n,r)=>{const l=Me(n.item),c=Me(r.item);return l!==c?l?-1:1:n.item.name.localeCompare(r.item.name)});for(const n of a)i(n.children)};return i(t),t}_filterTree(e,t){const o=t.trim().toLowerCase();if(!o)return e;const i=a=>{if(a.item.name.toLowerCase().includes(o))return{item:a.item,children:a.children.slice(),depth:a.depth};const r=a.children.map(i).filter(l=>l!==null);return r.length>0?{item:a.item,children:r,depth:a.depth}:null};return e.map(i).filter(a=>a!==null)}_flattenForDisplay(e){const t=[],o=this._query.trim()!=="",i=a=>{for(const n of a)t.push({node:n,visible:!0,hasChildren:n.children.length>0}),!(this._collapsed.has(n.item.id)&&!o)&&n.children.length>0&&i(n.children)};return i(e),t}_selectedItemsInOrder(){const e=new Map;for(const i of this._items)e.set(i.id,i);const t=[],o=[];for(const i of this._value){const a=e.get(i);a&&(a.name.toLowerCase()===Kt||a.id===1?o.push(a):t.push(a))}return t.length>0?t:o.length>0?[]:t}_highlight(e,t){const o=t.trim();if(!o)return e;const i=e.toLowerCase(),a=o.toLowerCase(),n=i.indexOf(a);return n===-1?e:b`${e.slice(0,n)}<span class="os-cat__match"
199 + >${e.slice(n,n+o.length)}</span
200 + >${e.slice(n+o.length)}`}_toggleSelection(e){const t=this._value.includes(e)?this._value.filter(o=>o!==e):[...this._value,e];this.emit("os-categories-change",{value:t})}_onDeleteClick(e,t){e.stopPropagation(),e.preventDefault(),this.emit("os-categories-delete",{id:t.id,name:t.name})}_toggleExpand(e){this._collapsed.has(e)?this._collapsed.delete(e):this._collapsed.add(e),this.requestUpdate()}_onSearchInput(e){this._query=e.target.value,this._focusedRow=0,this.requestUpdate()}_onSearchKeydown(e,t){switch(e.key){case"ArrowDown":{if(t.length===0)return;e.preventDefault(),this._focusedRow=this._focusedRow+1>=t.length?0:this._focusedRow+1,this.requestUpdate(),this._scrollFocusedIntoView();return}case"ArrowUp":{if(t.length===0)return;e.preventDefault(),this._focusedRow=this._focusedRow<=0?t.length-1:this._focusedRow-1,this.requestUpdate(),this._scrollFocusedIntoView();return}case"ArrowRight":{if(this._focusedRow<0||this._focusedRow>=t.length)return;const o=t[this._focusedRow];o.hasChildren&&this._collapsed.has(o.node.item.id)&&(e.preventDefault(),this._toggleExpand(o.node.item.id));return}case"ArrowLeft":{if(this._focusedRow<0||this._focusedRow>=t.length)return;const o=t[this._focusedRow];o.hasChildren&&!this._collapsed.has(o.node.item.id)&&(e.preventDefault(),this._toggleExpand(o.node.item.id));return}case"Enter":case" ":{if(this._focusedRow<0||this._focusedRow>=t.length)return;e.preventDefault();const o=t[this._focusedRow];this._toggleSelection(o.node.item.id);return}case"Escape":e.preventDefault(),this.closePicker()}}_scrollFocusedIntoView(){queueMicrotask(()=>{const e=this.shadowRoot?.querySelector(".os-cat__tree");if(!e)return;const t=e.querySelector('.os-cat__row[data-focused="true"]');if(!t)return;const o=t.getBoundingClientRect(),i=e.getBoundingClientRect();o.top<i.top?t.scrollIntoView({block:"nearest"}):o.bottom>i.bottom&&t.scrollIntoView({block:"nearest"})})}_positionPopover(){const e=this.shadowRoot?.querySelector(".os-cat__popover");if(!e)return;const t=this.getBoundingClientRect(),o=e.getBoundingClientRect(),i=window.innerWidth,a=window.innerHeight,n=8;let r=t.bottom+4;const l=r+o.height+n>a,c=t.top-4-o.height>=n;l&&c?r=t.top-4-o.height:l&&(r=Math.max(n,a-o.height-n));let d=t.left;d+o.width+n>i&&(d=t.right-o.width),d=Math.max(n,Math.min(d,i-o.width-n)),e.style.top=`${r}px`,e.style.left=`${d}px`}};xe.props=["placeholder","add-label","disabled","readonly","open","loading","max-visible"],xe.styles=[ko],xe.help=void 0;let tt=xe;W("os-category-picker",tt);function Bt(){return Y("chevron-right",{size:14})}function Do(){return Y("plus",{size:16})}function Ho(){return Y("check",{size:null})}function Fo(){return Y("close",{size:null})}function Uo(s){return s.categories.tree||(s.categories.tree=s.client.fetchAllCategories().then(e=>e.map(t=>({id:t.id,name:t.name,parent:t.parent})))),s.categories.tree}function Gt(s){s.categories.tree=null}function Vo(s){Uo(s).then(e=>{for(const t of s.categories.pickers)t.isConnected?t.items=e:s.categories.pickers.delete(t)}).catch(()=>{})}function Zt(s,e){s.parentTitles.clear();for(const t of e)s.parentTitles.set(t.id,le(t))}function Wo(s,e){const t=document.createElement("span"),o=typeof s.parent=="number"?s.parent:0;if(o===0)return t.textContent="—",t.setAttribute("aria-label",u("Top-level page")),t;const i=e.parentTitles.get(o);return t.textContent=i?`↳ ${i}`:H(u("↳ #%d"),o),t}function jo(s,e){const t=document.createElement("span"),o=typeof s.template=="string"?s.template:"",i=e.extra.pageTemplates??{};return t.textContent=i[o]??(o===""?u("Default template"):o),o!==""&&(t.title=o),t}function Ko(s,e){const t=document.createElement("button");t.type="button";const o=typeof s.slug=="string"?s.slug:"";return t.textContent=o||"—",t.disabled=o==="",t.title=o?u("Click to copy slug"):"",Object.assign(t.style,{appearance:"none",background:"transparent",border:"none",padding:"2px 6px",font:"inherit",color:"inherit",cursor:o?"copy":"default",textAlign:"left",fontFamily:'ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace',fontSize:"12px",borderRadius:"4px",maxWidth:"100%",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}),t.addEventListener("click",i=>{i.stopPropagation(),o&&$t(o).then(a=>{if(!a){e.toast(u("Couldn’t copy the slug."),null);return}t.textContent=u("Copied!"),t.style.color="var(--wp-admin-theme-color, #2271b1)",setTimeout(()=>{t.textContent=o,t.style.color=""},1200)})}),t}function Bo(s){const e=document.createElement("span");Object.assign(e.style,{display:"inline-flex",alignItems:"center",gap:"6px",fontVariantNumeric:"tabular-nums"});const t=typeof s.openstation_comment_count=="number"?s.openstation_comment_count:null;if(t===null)return e.textContent="—",e.style.color="var(--os-ui-fg-muted, #8c8f94)",e;const o=document.createElement("span");o.className="dashicons dashicons-admin-comments",o.setAttribute("aria-hidden","true"),Object.assign(o.style,{fontSize:"16px",width:"16px",height:"16px",color:t>0?"var(--wp-admin-theme-color, #2271b1)":"var(--os-ui-fg-muted, #8c8f94)"});const i=document.createElement("span");return i.textContent=String(t),t===0&&(i.style.color="var(--os-ui-fg-muted, #8c8f94)"),e.appendChild(o),e.appendChild(i),e.setAttribute("aria-label",H(Fe("%d comment","%d comments",t),t)),e}const Go=R` ${fe} ${Je}:host{display:block;--_bg:var( --os-ui-table-bg,var( --os-ui-surface,#fff ) );--_border:var( --os-ui-table-border,var( --os-ui-border,rgba( 0,0,0,0.08 ) ) );--_column-border:var( --os-ui-table-column-border,var( --os-ui-border-strong,rgba( 0,0,0,0.14 ) ) );--_header-bg:var( --os-ui-table-header-bg,var( --os-ui-surface-elevated,#f6f7f7 ) );--_row-hover:var( --os-ui-table-row-hover,var( --os-ui-hover,rgba( 0,0,0,0.04 ) ) );--_stripe:var( --os-ui-table-stripe,var( --os-ui-surface-subtle,rgba( 0,0,0,0.03 ) ) );--_cell-padding:var( --os-ui-table-cell-padding,8px 12px );--_font-size:var( --os-ui-table-font-size,13px );--_max-height:var( --os-ui-table-max-height,none );font-size:var( --_font-size );color:inherit}:host( [ hidden ] ){display:none}.scroll{position:relative;overflow:auto;max-height:var( --_max-height );border:1px solid var( --_border );border-radius:4px;background:var( --_bg )}table{width:100%;border-collapse:separate;border-spacing:0;background:var( --_bg )}thead th{text-align:start;font-weight:600;background-color:var( --_header-bg );background-image:var( --os-ui-table-header-bg-image,none );background-repeat:var( --os-ui-table-header-bg-image-repeat,repeat );background-size:var( --os-ui-table-header-bg-image-size,auto );background-position:var( --os-ui-table-header-bg-image-position,center );padding:var( --_cell-padding );border-bottom:1px solid var( --_border );white-space:nowrap}tbody td{padding:var( --_cell-padding );border-bottom:1px solid var( --_border );background-color:var( --_bg );vertical-align:middle}tbody tr:last-child td{border-bottom:0}:host( [ striped ] ) tbody tr:nth-child( odd ) td{background-image:linear-gradient( var( --_stripe ),var( --_stripe ) )}:host( [ hover ] ) tbody tr:hover td{background-image:linear-gradient( var( --_row-hover ),var( --_row-hover ) )}:host( [ hover ][ striped ] ) tbody tr:nth-child( odd ):hover td{background-image:linear-gradient( var( --_row-hover ),var( --_row-hover ) ),linear-gradient( var( --_stripe ),var( --_stripe ) )}:host( [ compact ] ){--os-ui-table-cell-padding:4px 8px;--os-ui-table-font-size:12px}:host( [ bordered ] ) thead th,:host( [ bordered ] ) tbody td{border-inline-end:1px solid var( --_column-border )}:host( [ bordered ] ) thead th:last-child,:host( [ bordered ] ) tbody td:last-child{border-inline-end:0}th.is-sticky,td.is-sticky{position:sticky;z-index:10}tbody td.is-sticky{background-color:var( --_bg )}thead th.is-sticky{background-color:var( --_header-bg );background-image:var( --os-ui-table-header-bg-image,none );background-repeat:var( --os-ui-table-header-bg-image-repeat,repeat );background-size:var( --os-ui-table-header-bg-image-size,auto );background-position:var( --os-ui-table-header-bg-image-position,center );z-index:30}:host( [ sticky-header ] ) thead th{position:sticky;top:0;z-index:20}:host( [ sticky-header ] ) thead tr.filter-row th{top:var( --os-ui-table-header-height,33px );z-index:20}:host( [ sticky-header ] ) thead th.is-sticky{z-index:40}:host( [ sticky-header ] ) thead tr.filter-row th.is-sticky{z-index:40}th.is-sticky-edge,td.is-sticky-edge{border-inline-end:var( --os-ui-table-sticky-edge,2px solid var( --_border ) )}.align-center{text-align:center}.align-end{text-align:end}.filter-row th{padding:4px 8px;background-color:var( --_header-bg );background-image:var( --os-ui-table-header-bg-image,none );background-repeat:var( --os-ui-table-header-bg-image-repeat,repeat );background-size:var( --os-ui-table-header-bg-image-size,auto );background-position:var( --os-ui-table-header-bg-image-position,center );border-bottom:1px solid var( --_border );font-weight:400}.filter-input,.filter-select{width:100%;min-width:60px;box-sizing:border-box;padding:4px 6px;font:inherit;color:inherit;background-color:var( --_bg );border:1px solid var( --_border );border-radius:3px}.filter-input:focus,.filter-select:focus{outline:none;border-color:var( --os-ui-accent,#2271b1 );box-shadow:var( --_holo-focus-field )}.expander{display:inline-flex;align-items:center;justify-content:center;width:20px;height:20px;padding:0;border:0;background:transparent;color:inherit;cursor:pointer;border-radius:3px;font-size:11px;line-height:1}.expander:hover{background:var( --os-ui-hover,rgba( 0,0,0,0.06 ) )}td.col-expander,th.col-expander{width:36px;min-width:36px;padding-left:0;padding-right:0;text-align:center}tr.subtable td{padding:0;background-color:var( --_bg );background-image:linear-gradient( var( --_stripe ),var( --_stripe ) );border-bottom:1px solid var( --_border )}tr.subtable .subtable-inner{padding:8px 12px 8px 32px}tr.empty td{padding:24px;text-align:center;color:var( --os-ui-text-muted,var( --os-ui-fg-muted,rgba( 0,0,0,0.55 ) ) );font-style:italic}thead th.is-sortable{cursor:pointer;user-select:none}thead th.is-sortable:hover{background-image:linear-gradient( var( --_row-hover ),var( --_row-hover ) )}thead th.is-sortable:focus-visible{outline:none;box-shadow:inset 0 0 0 2px var( --os-ui-accent,#2271b1 )}.sort-indicator{font-size:10px;color:var( --os-ui-text-muted,var( --os-ui-fg-muted,rgba( 0,0,0,0.55 ) ) );margin-inline-start:2px}thead th.sort-asc .sort-indicator,thead th.sort-desc .sort-indicator{color:var( --wp-admin-theme-color,#2271b1 )}td.col-select,th.col-select{width:40px;min-width:40px;padding-left:0;padding-right:0;text-align:center}.select-all-checkbox,.select-row-checkbox{cursor:pointer;margin:0}tbody tr.is-selected td{background-color:color-mix( in srgb,var( --wp-admin-theme-color,#2271b1 ) 10%,var( --_bg ) );background-image:none}tbody tr.is-selected:hover td{background-color:color-mix( in srgb,var( --wp-admin-theme-color,#2271b1 ) 16%,var( --_bg ) )}tbody tr.is-selected td:first-child{box-shadow:inset 3px 0 0 0 var( --os-ui-accent,#2271b1 )}tbody:dir( rtl ) tr.is-selected td:first-child{box-shadow:inset -3px 0 0 0 var( --os-ui-accent,#2271b1 )}:host( [ stacked ] ) .scroll{border:0;border-radius:0}:host( [ stacked ] ) table,:host( [ stacked ] ) tbody{display:block;width:100%}:host( [ stacked ] ) colgroup,:host( [ stacked ] ) thead{display:none}:host( [ stacked ] ) tbody tr{display:flex;align-items:flex-start;gap:12px;padding:12px 14px;border-bottom:1px solid var( --_border );background-color:var( --_bg )}:host( [ stacked ] ) tbody tr:last-child{border-bottom:0}:host( [ stacked ] ) tbody td{display:block;padding:0;border:0;background-color:transparent;background-image:none;box-shadow:none;min-width:0;width:auto;vertical-align:baseline}:host( [ stacked ] ) tbody tr.is-selected td,:host( [ stacked ] ) tbody tr.is-selected:hover td,:host( [ stacked ][ striped ] ) tbody tr:nth-child( odd ) td,:host( [ stacked ][ hover ] ) tbody tr:hover td,:host( [ stacked ][ hover ][ striped ] ) tbody tr:nth-child( odd ):hover td,:host( [ stacked ][ bordered ] ) tbody td{padding:0;border:0;background-color:transparent;background-image:none;box-shadow:none}:host( [ stacked ][ hover ] ) tbody tr:hover{background-image:linear-gradient( var( --_row-hover ),var( --_row-hover ) )}:host( [ stacked ] ) tbody tr.is-selected,:host( [ stacked ] ) tbody tr.is-selected:hover{background-color:color-mix( in srgb,var( --wp-admin-theme-color,#2271b1 ) 10%,var( --_bg ) );background-image:none;box-shadow:inset 3px 0 0 0 var( --os-ui-accent,#2271b1 )}:host( [ stacked ] ) tbody:dir( rtl ) tr.is-selected{box-shadow:inset -3px 0 0 0 var( --os-ui-accent,#2271b1 )}:host( [ stacked ] ) tbody td.col-select,:host( [ stacked ] ) tbody td.col-expander{flex:0 0 auto;display:flex;align-items:center;justify-content:center;min-width:0}:host( [ stacked ] ) tbody td.col-select{width:44px;height:44px;margin:-11px 0 -11px -11px;cursor:pointer}:host( [ stacked ] ) .select-row-checkbox{width:22px;height:22px}:host( [ stacked ] ) tbody td.col-expander{width:28px;height:22px;margin-inline-start:-4px}:host( [ stacked ] ) tbody td.stack-body{flex:1 1 auto;display:flex;flex-direction:column;gap:4px;min-width:0}.stack-cell{display:flex;align-items:baseline;gap:6px;min-width:0;line-height:1.4}.stack-title{font-size:15px;font-weight:600;line-height:1.35}.stack-meta{font-size:13px}.stack-label{flex:0 0 auto;font-size:12px;color:var( --os-ui-text-muted,var( --os-ui-fg-muted,rgba( 0,0,0,0.55 ) ) )}.stack-label::after{content:'·';margin-inline-start:6px}.stack-value{flex:1 1 auto;min-width:0;display:flex;align-items:center;flex-wrap:wrap;gap:6px}.stack-actions{margin-block-start:6px}.stack-actions .stack-value{gap:8px}.stack-actions .stack-value>*{justify-content:flex-start;max-width:100%}:host( [ stacked ] ) tr.subtable,:host( [ stacked ] ) tr.empty{display:block;padding:0}:host( [ stacked ] ) tr.subtable td{background-image:linear-gradient( var( --_stripe ),var( --_stripe ) )}:host( [ stacked ] ) tr.subtable .subtable-inner{padding:8px 14px 12px}:host( [ stacked ] ) tr.empty td{padding:24px}:host( [ stacked ] ) tr.skeleton{display:block;padding:14px;border-bottom:1px solid var( --_border )}:host( [ stacked ] ) tr.skeleton td.stack-body{gap:8px}:host( [ stacked ] ) tr.skeleton .skeleton-bar:first-child{height:15px}tbody tr.skeleton td{padding:var( --_cell-padding )}.skeleton-bar{display:block;height:12px;border-radius:3px;background:linear-gradient( 90deg,var( --os-ui-table-skeleton-color,var( --os-ui-hover,rgba( 0,0,0,0.06 ) ) ) 0%,var( --os-ui-table-skeleton-highlight,var( --os-ui-hover,rgba( 0,0,0,0.14 ) ) ) 50%,var( --os-ui-table-skeleton-color,var( --os-ui-hover,rgba( 0,0,0,0.06 ) ) ) 100% );background-size:200% 100%;animation:os-table-skeleton-pulse 1.4s ease-in-out infinite}@keyframes os-table-skeleton-pulse{0%{background-position:200% 50%}100%{background-position:-200% 50%}}@media ( prefers-reduced-motion:reduce ){.skeleton-bar{animation:none}}`,ce="__wpd_expander__",de="__wpd_select__",ye=class ye extends U{constructor(){super(...arguments),this._data=[],this._columns=[],this._filters={},this._expanded=new Set,this._subTable=null,this._sort=null,this._selection=new Set,this._getRowId=(e,t)=>t,this._filterCache=new Map,this._paintScheduled=!1,this._stacked=!1,this._stickyHeaderWarned=!1,this._stickyRaceWarned=!1,this._resizeObserver=null,this._stickyMicroScheduled=!1,this._stickyRafHandle=null,this._loadingDesyncWarned=!1,this._lastStickyIndex=-1}get data(){return this._data}set data(e){this._data=Array.isArray(e)?e.slice():[],this._expanded.clear(),this._schedulePaint()}get columns(){return this._columns}set columns(e){this._columns=Array.isArray(e)?e.slice():[];const t=new Set(this._columns.map(o=>o.key));for(const o of Object.keys(this._filters))t.has(o)||delete this._filters[o];for(const o of Array.from(this._filterCache.keys()))t.has(o)||this._filterCache.delete(o);this._sort&&!t.has(this._sort.key)&&(this._sort=null),this._schedulePaint()}get filters(){return{...this._filters}}set filters(e){this._filters=e?{...e}:{},this._schedulePaint()}get sort(){return this._sort?{...this._sort}:null}set sort(e){this._sort=e?{...e}:null,this._schedulePaint()}get selection(){return new Set(this._selection)}set selection(e){this._selection=new Set(e??[]),this._schedulePaint()}get selectedRows(){const e=[];return this._data.forEach((t,o)=>{this._selection.has(this._getRowId(t,o))&&e.push(t)}),e}get visibleRows(){return this._filteredRows().map(e=>e.row)}get getRowId(){return this._getRowId}set getRowId(e){this._getRowId=typeof e=="function"?e:(t,o)=>o,this._schedulePaint()}get subTable(){return this._subTable}set subTable(e){this._subTable=typeof e=="function"?e:null,this._expanded.clear(),this._schedulePaint()}get expanded(){return new Set(this._expanded)}set expanded(e){this._expanded=new Set(e??[]),this._schedulePaint()}expand(e){e<0||e>=this._data.length||this._expanded.has(e)||(this._expanded.add(e),this.emit("os-table-expand-change",{row:this._data[e],index:e,expanded:!0}),this._schedulePaint())}collapse(e){this._expanded.has(e)&&(this._expanded.delete(e),this.emit("os-table-expand-change",{row:this._data[e],index:e,expanded:!1}),this._schedulePaint())}expandAll(){if(!this._subTable)return;let e=!1;for(let t=0;t<this._data.length;t++)this._subTable(this._data[t],t)&&(this._expanded.has(t)||(this._expanded.add(t),e=!0));e&&this._schedulePaint()}collapseAll(){this._expanded.size!==0&&(this._expanded.clear(),this._schedulePaint())}isExpanded(e){return this._expanded.has(e)}clearFilters(){Object.keys(this._filters).length!==0&&(this._filters={},this.emit("os-table-filter-change",{filters:{}}),this._schedulePaint())}clearSort(){this._sort!==null&&(this._sort=null,this.emit("os-table-sort-change",{sort:null}),this._schedulePaint())}select(e){if(this._selection.has(e))return;const t=this._readSelectable(),o=t==="single"?Array.from(this._selection):[];t==="single"&&this._selection.clear(),this._selection.add(e),this._emitSelectionChange(),this._syncSelectionDom([e,...o])}deselect(e){this._selection.delete(e)&&(this._emitSelectionChange(),this._syncSelectionDom([e]))}selectAll(){if(this._readSelectable()==="multi"){for(const{row:e,index:t}of this._filteredRows())this._selection.add(this._getRowId(e,t));this._emitSelectionChange(),this._syncSelectionDom("all")}}clearSelection(){this._selection.size!==0&&(this._selection.clear(),this._emitSelectionChange(),this._syncSelectionDom("all"))}_syncSelectionDom(e){const t=this.shadowRoot;if(!t)return;const o=t.querySelector("tbody");if(!o)return;let i=null;if(e!=="all"){i=new Set;for(const r of e)i.add(String(r))}const a=o.querySelectorAll("tr[data-row-id]");for(const r of a){const l=r.dataset.rowId;if(l===void 0||i&&!i.has(l))continue;const c=Number(r.dataset.rowIndex);if(!Number.isFinite(c))continue;const d=this._data[c];if(d===void 0)continue;const p=this._getRowId(d,c),g=this._selection.has(p);r.classList.toggle("is-selected",g);const v=r.querySelector("input.select-row-checkbox");v&&v.checked!==g&&(v.checked=g)}const n=t.querySelector("thead .select-all-checkbox");if(n){const{total:r,selected:l}=this._visibleSelectionStats();n.checked=r>0&&l===r,n.indeterminate=l>0&&l<r}}scrollToRow(e){const t=this.shadowRoot;if(!t)return;const i=t.querySelectorAll("tbody tr:not(.subtable):not(.empty):not(.skeleton)")[e];i&&i.scrollIntoView({block:"nearest",inline:"nearest"})}connectedCallback(){super.connectedCallback(),this._schedulePaint()}disconnectedCallback(){this._resizeObserver?.disconnect(),this._resizeObserver=null,this._stickyRafHandle!==null&&typeof cancelAnimationFrame<"u"&&(cancelAnimationFrame(this._stickyRafHandle),this._stickyRafHandle=null)}recomputeLayout(){this._applyStickyOffsets(),this._measureHeaderHeight()}render(){return b`
201 201 <div class="scroll" part="scroll">
202 202 <table part="table">
203 203 <colgroup></colgroup>
204 204 <thead></thead>
@@ -204,32 +204,32 @@
204 204 <thead></thead>
205 205 <tbody></tbody>
206 206 </table>
207 207 </div>
208 - `}requestUpdate(){super.requestUpdate(),this._schedulePaint()}_schedulePaint(){this._paintScheduled||!this.isConnected||(this._paintScheduled=!0,queueMicrotask(()=>{this._paintScheduled=!1,this.isConnected&&this._paint()}))}_paint(){const e=this.shadowRoot;if(!e)return;e.querySelector("tbody")||G(this.render(),e);const t=e.querySelector("colgroup"),s=e.querySelector("thead"),i=e.querySelector("tbody");if(!t||!s||!i)return;const a=this._effectiveColumns();this._stacked=this.hasAttribute("stacked");const n=this._readStickyColumns();this._lastStickyIndex=this._computeLastStickyIndex(a,n),this._paintColgroup(t,a),this._paintHead(s,a,n),this._paintBody(i,a,n),this._applyStickyOffsets(),this._measureHeaderHeight(),this._scheduleStickyOffsets(),this._maybeWarnStickyHeader(),this._maybeWarnLoadingDesync(i),this._ensureResizeObserver()}_maybeWarnLoadingDesync(e){this._loadingDesyncWarned||this.hasAttribute("loading")&&(e.querySelector("tr.skeleton")||(this._loadingDesyncWarned=!0,console.warn("[os-table] `loading` attribute is set but no skeleton rows rendered. Either attributeChangedCallback didn't route through requestUpdate (framework regression), or `loading` was set after the most recent paint and no follow-up trigger ran. Toggling `data` will force a paint as a workaround.")))}_scheduleStickyOffsets(){this._stickyMicroScheduled||(this._stickyMicroScheduled=!0,queueMicrotask(()=>{this._stickyMicroScheduled=!1,this.isConnected&&this._applyStickyOffsets()})),this._stickyRafHandle===null&&typeof requestAnimationFrame<"u"&&(this._stickyRafHandle=requestAnimationFrame(()=>{this._stickyRafHandle=null,this.isConnected&&(this._applyStickyOffsets(),this._measureHeaderHeight())}))}_ensureResizeObserver(){if(this._resizeObserver||typeof ResizeObserver>"u")return;const e=this.shadowRoot?.querySelector(".scroll");e&&(this._resizeObserver=new ResizeObserver(()=>{this.isConnected&&(this._applyStickyOffsets(),this._measureHeaderHeight(),this._stickyHeaderWarned=!1,this._maybeWarnStickyHeader())}),this._resizeObserver.observe(e),this._resizeObserver.observe(this))}_paintColgroup(e,t){const s=[];for(const i of t){const a=document.createElement("col");i.width&&(a.style.width=i.width),s.push(a)}e.replaceChildren(...s)}_paintHead(e,t,s){const i=document.createElement("tr");i.setAttribute("part","header-row");for(let l=0;l<t.length;l++)i.appendChild(this._buildHeaderCell(t[l],l,s));const a=e.querySelector(':scope > tr[part="header-row"]');a?e.replaceChild(i,a):e.insertBefore(i,e.firstChild);const n=t.some(l=>l.filter||Array.isArray(l.filterOptions)||typeof l.filterRender=="function");let r=e.querySelector(":scope > tr.filter-row");if(n){const l=[];for(let p=0;p<t.length;p++)l.push(this._buildFilterCell(t[p],p,s));r||(r=document.createElement("tr"),r.classList.add("filter-row"),r.setAttribute("part","filter-row"),e.appendChild(r));const c=Array.from(r.children);let d=c.length===l.length;if(d){for(let p=0;p<l.length;p++)if(c[p]!==l[p]){d=!1;break}}if(!d){const p=new Set(l);for(const h of l)r.appendChild(h);for(const h of Array.from(r.children))p.has(h)||r.removeChild(h)}}else r&&r.remove()}_buildHeaderCell(e,t,s){const i=document.createElement("th");if(i.setAttribute("scope","col"),i.dataset.key=e.key,this._applyCellClasses(i,e,t,s),e.minWidth&&(i.style.minWidth=e.minWidth),e.key===ce){if(this._readSelectable()==="multi"){const n=document.createElement("input");n.type="checkbox",n.className="select-all-checkbox",n.setAttribute("data-noclick",""),n.setAttribute("aria-label","Select all rows");const{total:r,selected:l}=this._visibleSelectionStats();n.checked=r>0&&l===r,n.indeterminate=l>0&&l<r,n.addEventListener("change",()=>{n.checked?this.selectAll():this.clearSelection()}),i.appendChild(n)}return i}if(i.textContent=e.label??(e.key===le?"":e.key),e.sortable){i.classList.add("is-sortable");const a=this._sort?.key===e.key,n=document.createElement("span");n.className="sort-indicator";let r="";a&&(r=this._sort.direction==="asc"?" ▲":" ▼"),n.textContent=r,i.appendChild(n),a&&i.classList.add(this._sort.direction==="asc"?"sort-asc":"sort-desc"),i.addEventListener("click",()=>this._cycleSort(e.key))}return i}_buildFilterCell(e,t,s){const i=this._filterCache.get(e.key),a=Array.isArray(e.filterOptions),n=typeof e.filterRender=="function";let r;if(!e.filter&&!a&&!n||e.key===le||e.key===ce?r="none":n?r="custom":e.filter==="select"||a?r="select":r="text",i&&i.kind===r){if(i.th.className="",this._applyCellClasses(i.th,e,t,s),r==="select"){const p=i.control,h=this._resolveFilterOptions(e),_=h.map(g=>g.value).join("|");_!==i.optionsKey?(this._populateSelect(p,h,this._filters[e.key]??""),i.optionsKey=_):p.value=this._filters[e.key]??""}else if(r==="text"){const p=i.control,h=this._filters[e.key]??"";p.value!==h&&p.ownerDocument.activeElement!==p&&(p.value=h)}else r==="custom"&&e.filterRender&&e.filterRender(i.th,{value:this._filters[e.key]??"",setValue:p=>this._onFilterChange(e.key,p),col:e});return i.th}const l=document.createElement("th");if(this._applyCellClasses(l,e,t,s),r==="none")return this._filterCache.set(e.key,{th:l,control:null,optionsKey:"",kind:"none"}),l;if(r==="custom"&&e.filterRender)return e.filterRender(l,{value:this._filters[e.key]??"",setValue:p=>this._onFilterChange(e.key,p),col:e}),this._filterCache.set(e.key,{th:l,control:null,optionsKey:"",kind:"custom"}),l;let c,d="";if(r==="select"){const p=document.createElement("select");p.classList.add("filter-select"),p.setAttribute("data-noclick",""),p.setAttribute("aria-label",`Filter ${e.label??e.key}`);const h=this._resolveFilterOptions(e);this._populateSelect(p,h,this._filters[e.key]??""),d=h.map(_=>_.value).join("|"),p.addEventListener("change",()=>{this._onFilterChange(e.key,p.value)}),c=p}else{const p=document.createElement("input");p.type="search",p.classList.add("filter-input"),p.setAttribute("data-noclick",""),p.setAttribute("placeholder","Filter…"),p.setAttribute("aria-label",`Filter ${e.label??e.key}`),p.value=this._filters[e.key]??"",p.addEventListener("input",()=>{this._onFilterChange(e.key,p.value)}),c=p}return l.appendChild(c),this._filterCache.set(e.key,{th:l,control:c,optionsKey:d,kind:r}),l}_populateSelect(e,t,s){e.replaceChildren();const i=document.createElement("option");i.value="",i.textContent="All",e.appendChild(i);for(const a of t){const n=document.createElement("option");n.value=a.value,n.textContent=a.label,a.value===s&&(n.selected=!0),e.appendChild(n)}e.value=s}_resolveFilterOptions(e){return Array.isArray(e.filterOptions)?e.filterOptions:this._uniqueValues(e.key).map(t=>({value:t,label:t}))}_paintBody(e,t,s){if(e.replaceChildren(),this.hasAttribute("loading")){const a=this._readLoadingRows();for(let n=0;n<a;n++)e.appendChild(this._buildSkeletonRow(t,n));return}const i=this._sortedRows(this._filteredRows());if(i.length===0){e.appendChild(this._buildEmptyRow(t.length));return}for(const{row:a,index:n}of i)if(e.appendChild(this._stacked?this._buildStackedRow(a,n,t):this._buildBodyRow(a,n,t,s)),this._expanded.has(n)&&this._subTable){const r=this._subTable(a,n);r&&e.appendChild(this._buildSubTableRow(r,t.length))}}_buildEmptyRow(e){const t=document.createElement("tr");t.classList.add("empty");const s=document.createElement("td");s.colSpan=e;const i=document.createElement("slot");return i.name="empty",i.textContent=this.getAttribute("empty")||"No data",s.appendChild(i),t.appendChild(s),t}_buildSkeletonRow(e,t){const s=document.createElement("tr");if(s.classList.add("skeleton"),s.setAttribute("aria-hidden","true"),this._stacked){s.classList.add("stack-row");const i=document.createElement("td");i.className="stack-body",i.colSpan=Math.max(1,e.length);for(const a of[55+t*7%25,30+t*11%15]){const n=document.createElement("span");n.className="skeleton-bar",n.style.width=`${a}%`,i.appendChild(n)}return s.appendChild(i),s}for(const i of e){const a=document.createElement("td"),n=document.createElement("span");n.className="skeleton-bar";const r=50+(t*7+s.children.length*13)%40;n.style.width=`${r}%`,a.appendChild(n),s.appendChild(a)}return s}_buildBodyRow(e,t,s,i){const a=document.createElement("tr");a.setAttribute("part","row"),a.dataset.rowIndex=String(t);const n=this._getRowId(e,t);a.dataset.rowId=String(n),this._selection.has(n)&&a.classList.add("is-selected"),a.addEventListener("click",r=>{this._onRowClick(e,t,r)});for(let r=0;r<s.length;r++)a.appendChild(this._buildBodyCell(s[r],r,e,t,i));return a}_buildStackedRow(e,t,s){const i=document.createElement("tr");i.setAttribute("part","row"),i.classList.add("stack-row"),i.dataset.rowIndex=String(t);const a=this._getRowId(e,t);i.dataset.rowId=String(a),this._selection.has(a)&&i.classList.add("is-selected"),i.addEventListener("click",c=>{this._onRowClick(e,t,c)});const n=document.createElement("td");n.className="stack-body";let r=0,l=0;for(let c=0;c<s.length;c++){const d=s[c];if(d.key===ce||d.key===le){i.appendChild(this._buildBodyCell(d,c,e,t,0));continue}l++;const p=Lo(d,r++);if(p==="hidden")continue;const h=document.createElement("div");if(h.className=`stack-cell stack-${p}`,h.dataset.key=d.key,p==="meta"&&d.label){const m=document.createElement("span");m.className="stack-label",m.textContent=d.label,h.appendChild(m)}const _=document.createElement("span");_.className="stack-value";const g=e[d.key];d.render?this._mountCellContent(_,d.render(g,e,t)):g!=null&&(_.textContent=String(g)),h.appendChild(_),n.appendChild(h)}return n.colSpan=Math.max(1,l),i.appendChild(n),i}_buildBodyCell(e,t,s,i,a){const n=document.createElement("td");if(this._applyCellClasses(n,e,t,a),e.minWidth&&(n.style.minWidth=e.minWidth),e.key===ce){const l=this._getRowId(s,i),c=document.createElement("input");return c.type="checkbox",c.className="select-row-checkbox",c.setAttribute("data-noclick",""),c.setAttribute("aria-label","Select row"),c.checked=this._selection.has(l),c.addEventListener("change",()=>{c.checked?this.select(l):this.deselect(l)}),n.appendChild(c),this._stacked&&(n.setAttribute("data-noclick",""),n.addEventListener("click",d=>{d.target===n&&(c.checked=!c.checked,c.dispatchEvent(new Event("change")))})),n}if(e.key===le){if(!(this._subTable?!!this._subTable(s,i):!1))return n;const c=this._expanded.has(i),d=document.createElement("button");return d.type="button",d.className="expander",d.setAttribute("data-noclick",""),d.setAttribute("aria-expanded",c?"true":"false"),d.setAttribute("aria-label",c?"Collapse row":"Expand row"),d.textContent=c?"▾":"▸",d.addEventListener("click",p=>{this._toggleRow(i,s,p)}),n.appendChild(d),n}const r=s[e.key];if(e.render){const l=e.render(r,s,i);this._mountCellContent(n,l)}else r!=null&&(n.textContent=String(r));return n}_buildSubTableRow(e,t){const s=document.createElement("tr");s.classList.add("subtable"),s.setAttribute("part","subtable-row");const i=document.createElement("td");i.colSpan=t;const a=document.createElement("div");if(a.classList.add("subtable-inner"),e instanceof Node)a.appendChild(e);else if(Ut(e))G(e,a);else{const n=document.createElement("os-table");n.columns=e.columns,n.data=e.data,e.subTable&&(n.subTable=e.subTable),a.appendChild(n)}return i.appendChild(a),s.appendChild(i),s}_mountCellContent(e,t){if(typeof t=="string"){e.textContent=t;return}if(t instanceof Node){e.appendChild(t);return}Ut(t)&&G(t,e)}_onFilterChange(e,t){t===""?delete this._filters[e]:this._filters[e]=t,this.emit("os-table-filter-change",{filters:{...this._filters}});const i=this.shadowRoot?.querySelector("tbody");if(i){const a=this._effectiveColumns(),n=this._readStickyColumns();this._lastStickyIndex=this._computeLastStickyIndex(a,n),this._paintBody(i,a,n),this._applyStickyOffsets()}}_onRowClick(e,t,s){const i=s.composedPath?.()??[];for(const a of i){if(a instanceof Element&&a.hasAttribute("data-noclick"))return;if(a===this)break}this.emit("os-table-row-click",{row:e,index:t,originalEvent:s})}_toggleRow(e,t,s){s.stopPropagation();const i=this._expanded.has(e);i?this._expanded.delete(e):this._expanded.add(e),this.emit("os-table-expand-change",{row:t,index:e,expanded:!i}),this._schedulePaint()}_cycleSort(e){!this._sort||this._sort.key!==e?this._sort={key:e,direction:"asc"}:this._sort.direction==="asc"?this._sort={key:e,direction:"desc"}:this._sort=null,this.emit("os-table-sort-change",{sort:this._sort?{...this._sort}:null}),this._schedulePaint()}_emitSelectionChange(){this.emit("os-table-selection-change",{selection:Array.from(this._selection),rows:this.selectedRows})}_filteredRows(){const e=[],t=Object.keys(this._filters).filter(s=>this._filters[s]!=="");for(let s=0;s<this._data.length;s++){const i=this._data[s];let a=!0;for(const n of t){const r=this._columns.find(p=>p.key===n);if(r&&typeof r.filterRender=="function")continue;const l=this._filters[n]??"",c=i[n],d=c==null?"":String(c);if(r?.filter==="select"){if(d!==l){a=!1;break}}else if(!d.toLowerCase().includes(l.toLowerCase())){a=!1;break}}a&&e.push({row:i,index:s})}return e}_sortedRows(e){if(!this._sort)return e;const t=this._columns.find(a=>a.key===this._sort.key);if(!t)return e;const s=this._sort.direction==="desc"?-1:1,i=e.slice();return i.sort((a,n)=>{const r=t.sortValue?t.sortValue(a.row,a.row[t.key]):a.row[t.key],l=t.sortValue?t.sortValue(n.row,n.row[t.key]):n.row[t.key];return Mo(r,l)*s}),i}_uniqueValues(e){const t=new Set;for(const s of this._data){const i=s[e];i!=null&&t.add(String(i))}return Array.from(t).sort()}_visibleSelectionStats(){let e=0,t=0;for(const{row:s,index:i}of this._filteredRows())e++,this._selection.has(this._getRowId(s,i))&&t++;return{total:e,selected:t}}_readStickyColumns(){const e=parseInt(this.getAttribute("sticky-columns")||"0",10);return Number.isFinite(e)&&e>0?e:0}_readLoadingRows(){const e=parseInt(this.getAttribute("loading-rows")||"5",10);return Number.isFinite(e)&&e>0?Math.min(e,100):5}_readSelectable(){const e=this.getAttribute("selectable");return e==="single"?"single":e==="multi"||e===""?"multi":null}_isStickyIndex(e,t,s){return this._stacked||s.sticky===!1?!1:s.sticky===!0?!0:e<t}_computeLastStickyIndex(e,t){let s=-1;for(let i=0;i<e.length;i++)this._isStickyIndex(i,t,e[i])&&(s=i);return s}_applyCellClasses(e,t,s,i){t.key===le&&e.classList.add("col-expander"),t.key===ce&&e.classList.add("col-select"),t.align==="center"&&e.classList.add("align-center"),t.align==="end"&&e.classList.add("align-end"),this._isStickyIndex(s,i,t)&&(e.classList.add("is-sticky"),s===this._lastStickyIndex&&e.classList.add("is-sticky-edge"))}_effectiveColumns(){const e=[];return this._readSelectable()&&e.push({key:ce,label:"",width:"40px",align:"center"}),this._subTable&&e.push({key:le,label:"",width:"36px",align:"center"}),e.push(...this._columns),e}_applyStickyOffsets(){const e=this.shadowRoot;if(!e)return;const t=e.querySelector("thead tr");if(!t)return;const s=Array.from(t.children),i=[];let a=0;for(let r=0;r<s.length;r++)i[r]=a,s[r].classList.contains("is-sticky")&&(a+=s[r].offsetWidth);e.querySelectorAll("thead tr, tbody tr:not(.subtable):not(.empty):not(.skeleton)").forEach(r=>{const l=Array.from(r.children);for(let c=0;c<l.length;c++)l[c].classList.contains("is-sticky")&&(l[c].style.insetInlineStart=`${i[c]}px`)}),this._maybeWarnStickyOffsetRace(s,i)}_maybeWarnStickyOffsetRace(e,t){if(this._stickyRaceWarned)return;const s=this._readStickyColumns();if(s<2)return;const i=Math.min(s-1,e.length-1);if(i<=0||t[i]!==0||this.offsetWidth===0)return;this._stickyRaceWarned=!0;const a=e[0]?.offsetWidth??0;console.warn(`[os-table] sticky-columns: column ${i} resolved to inset-inline-start: 0px while the host is visible. ths[0].offsetWidth was ${a}px at measurement time. Likely a layout race — call recomputeLayout() after the panel finishes its mount/transition, or wrap the assignment of \`data\` in a requestAnimationFrame.`)}_measureHeaderHeight(){const e=this.shadowRoot;if(!e)return;const t=e.querySelector("thead tr");if(!t)return;const s=t.offsetHeight;s>0&&this.style.setProperty("--os-ui-table-header-height",`${s}px`)}_maybeWarnStickyHeader(){if(this._stickyHeaderWarned||!this.hasAttribute("sticky-header")||this.hasAttribute("loading")||this._data.length<8)return;const e=this.shadowRoot?.querySelector(".scroll");e&&e.offsetWidth!==0&&e.scrollHeight<=e.clientHeight+1&&(this._stickyHeaderWarned=!0,console.warn("[os-table] sticky-header is set but the table has no scroll container. Set --os-ui-table-max-height on the host (or wrap it in a scrolling parent) so the header has something to stick to."))}};ye.props=["stickyColumns","stickyHeader","striped","hover","compact","bordered","empty","loading","loadingRows","selectable","stacked"],ye.styles=[Po],ye.help=void 0;let et=ye;function Ut(o){return!!o&&o.__wpdHtml===!0}function Lo(o,e){return o.stack?o.stack:e===0?"title":o.label?"meta":"actions"}function Mo(o,e){if(o===e)return 0;if(o==null)return-1;if(e==null)return 1;if(typeof o=="number"&&typeof e=="number")return o-e;if(o instanceof Date&&e instanceof Date)return o.getTime()-e.getTime();const t=Number(o),s=Number(e);return Number.isFinite(t)&&Number.isFinite(s)?t-s:String(o).localeCompare(String(e))}U("os-table",et);const Ro=P` ${fe}:host{display:flex;flex-direction:column;gap:8px;font-size:13px;color:var( --os-ui-fg,#1d2327 );min-width:0}:host( [ hidden ] ){display:none}.os-select__label{font-size:13px;line-height:1.5;color:var( --os-ui-fg-muted,#646970 )}.os-select__trigger{appearance:none;display:flex;align-items:center;gap:8px;width:100%;min-width:0;padding:8px 12px;background:var( --os-ui-hover,rgba( 0,0,0,0.05 ) );border:1px solid transparent;border-radius:8px;font:inherit;font-size:13px;line-height:1.5;color:var( --os-ui-fg,#1d2327 );text-align:start;cursor:pointer;transition:background-color var( --_holo-t ) ease,border-color var( --_holo-t ) ease,box-shadow var( --_holo-t ) ease}.os-select__trigger:hover:not(:disabled ){background:var( --os-ui-hover,rgba( 0,0,0,0.08 ) );border-color:var( --os-ui-border-strong,#8c8f94 )}.os-select__trigger:focus,.os-select__trigger:focus-visible{outline:none;border-color:var( --os-ui-accent,#2271b1 );box-shadow:var( --_holo-focus-field )}.os-select__trigger:disabled{opacity:0.5;cursor:not-allowed}:host( [ plain ] ){display:inline-flex;flex-direction:row;align-items:center}:host( [ plain ] ) .os-select__label{display:none}:host( [ plain ] ) .os-select__trigger{width:auto;padding:4px 6px;background:transparent;border-color:transparent;border-radius:6px}:host( [ plain ] ) .os-select__trigger:hover:not(:disabled ){background:var( --os-ui-hover,rgba( 0,0,0,0.05 ) );border-color:transparent}:host( [ plain ] ) .os-select__trigger:focus,:host( [ plain ] ) .os-select__trigger:focus-visible{border-color:var( --os-ui-accent,#2271b1 )}:host( [ plain ] ) .os-select__value{flex:0 1 auto}.os-select__value{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.os-select__value--placeholder{color:var( --os-ui-fg-muted,#646970 )}.os-select__chevron{flex:0 0 auto;pointer-events:none;color:var( --os-ui-fg-muted,#646970 )}.os-select__trigger:hover .os-select__chevron{color:var( --os-ui-fg,#1d2327 )}.os-select__trigger:focus .os-select__chevron,.os-select__trigger:focus-visible .os-select__chevron{color:var( --os-ui-accent,#2271b1 )}.os-select__popup{position:fixed;inset:auto;margin:0;max-height:min( 320px,60vh );overflow-y:auto;padding:4px;background:var( --os-ui-surface,#fff );border:1px solid var( --os-ui-border,#dcdcde );border-radius:8px;box-shadow:0 12px 32px rgba( 0,0,0,0.45 );color:var( --os-ui-fg,#1d2327 )}.os-select__popup:not( [ data-open ] ){display:none}.os-select__popup:popover-open{display:block}.os-select__popup[ data-open ]{position:absolute;top:calc( 100% + 4px );left:0;min-width:100%;z-index:1000}:host{position:relative}.os-select__option{display:flex;align-items:center;gap:8px;padding:7px 10px;border-radius:6px;font-size:13px;line-height:1.5;cursor:pointer;white-space:nowrap}.os-select__check{flex:0 0 auto;visibility:hidden}.os-select__option[ aria-selected='true' ] .os-select__check{visibility:visible}.os-select__option[ data-active ],.os-select__option:hover{background:var( --os-ui-accent,#2271b1 );color:var( --os-ui-fg-on-accent,#fff )}.os-select__option[ aria-disabled='true' ]{opacity:0.5;cursor:not-allowed}.os-select__option[ aria-disabled='true' ]:hover{background:transparent;color:inherit}@media ( prefers-reduced-motion:reduce ){.os-select__trigger{transition-duration:1ms}}`,Io=P`:host{display:none}`,ke=class ke extends q{render(){return b``}};ke.props=["value","disabled"],ke.styles=[Io],ke.help=void 0;let tt=ke;U("os-option",tt);const we=class we extends q{constructor(){super(...arguments),this._optionObserver=null,this._open=!1,this._activeIndex=-1,this._typed="",this._dismissedAt=0,this._typedTimer=null,this._onWindowScroll=e=>{const t=e.target,s=this._popup();s&&t instanceof Node&&(t===s||s.contains(t))||this._hide()},this._onWindowResize=()=>this._hide()}set items(e){const t=this.querySelectorAll(":scope > os-option");for(const a of Array.from(t))a.remove();for(const a of e){const n=document.createElement("os-option");n.setAttribute("value",a.value),n.textContent=a.label,this.appendChild(n)}const s=this.value;!(s!==null&&e.some(a=>a.value===s))&&e.length>0&&(this.value=e[0].value),this.requestUpdate()}connectedCallback(){super.connectedCallback(),$t(this),this._optionObserver=new MutationObserver(()=>this.requestUpdate()),this._optionObserver.observe(this,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["value","disabled"],characterData:!0})}disconnectedCallback(){this._optionObserver?.disconnect(),this._optionObserver=null,this._teardownDismiss(),this._open=!1,this._typedTimer&&(clearTimeout(this._typedTimer),this._typedTimer=null)}render(){const e=this.label||"",t=this.value,s=this.placeholder||"",i=this.disabled!==null;e&&this.setAttribute("aria-label",e);const a=this.getAttribute("aria-label")||"",n=e||a||s,r=this._readOptions(),l=r.find(g=>g.value===t),c=l?l.label:s,d=this.id||"os-unnamed",p=`${d}__listbox`,h=`${d}__trigger`,_=this._open&&this._activeIndex>=0?`${d}__opt-${this._activeIndex}`:"";return b`
208 + `}requestUpdate(){super.requestUpdate(),this._schedulePaint()}_schedulePaint(){this._paintScheduled||!this.isConnected||(this._paintScheduled=!0,queueMicrotask(()=>{this._paintScheduled=!1,this.isConnected&&this._paint()}))}_paint(){const e=this.shadowRoot;if(!e)return;e.querySelector("tbody")||Z(this.render(),e);const t=e.querySelector("colgroup"),o=e.querySelector("thead"),i=e.querySelector("tbody");if(!t||!o||!i)return;const a=this._effectiveColumns();this._stacked=this.hasAttribute("stacked");const n=this._readStickyColumns();this._lastStickyIndex=this._computeLastStickyIndex(a,n),this._paintColgroup(t,a),this._paintHead(o,a,n),this._paintBody(i,a,n),this._applyStickyOffsets(),this._measureHeaderHeight(),this._scheduleStickyOffsets(),this._maybeWarnStickyHeader(),this._maybeWarnLoadingDesync(i),this._ensureResizeObserver()}_maybeWarnLoadingDesync(e){this._loadingDesyncWarned||this.hasAttribute("loading")&&(e.querySelector("tr.skeleton")||(this._loadingDesyncWarned=!0,console.warn("[os-table] `loading` attribute is set but no skeleton rows rendered. Either attributeChangedCallback didn't route through requestUpdate (framework regression), or `loading` was set after the most recent paint and no follow-up trigger ran. Toggling `data` will force a paint as a workaround.")))}_scheduleStickyOffsets(){this._stickyMicroScheduled||(this._stickyMicroScheduled=!0,queueMicrotask(()=>{this._stickyMicroScheduled=!1,this.isConnected&&this._applyStickyOffsets()})),this._stickyRafHandle===null&&typeof requestAnimationFrame<"u"&&(this._stickyRafHandle=requestAnimationFrame(()=>{this._stickyRafHandle=null,this.isConnected&&(this._applyStickyOffsets(),this._measureHeaderHeight())}))}_ensureResizeObserver(){if(this._resizeObserver||typeof ResizeObserver>"u")return;const e=this.shadowRoot?.querySelector(".scroll");e&&(this._resizeObserver=new ResizeObserver(()=>{this.isConnected&&(this._applyStickyOffsets(),this._measureHeaderHeight(),this._stickyHeaderWarned=!1,this._maybeWarnStickyHeader())}),this._resizeObserver.observe(e),this._resizeObserver.observe(this))}_paintColgroup(e,t){const o=[];for(const i of t){const a=document.createElement("col");i.width&&(a.style.width=i.width),o.push(a)}e.replaceChildren(...o)}_paintHead(e,t,o){const i=document.createElement("tr");i.setAttribute("part","header-row");for(let l=0;l<t.length;l++)i.appendChild(this._buildHeaderCell(t[l],l,o));const a=e.querySelector(':scope > tr[part="header-row"]');a?e.replaceChild(i,a):e.insertBefore(i,e.firstChild);const n=t.some(l=>l.filter||Array.isArray(l.filterOptions)||typeof l.filterRender=="function");let r=e.querySelector(":scope > tr.filter-row");if(n){const l=[];for(let p=0;p<t.length;p++)l.push(this._buildFilterCell(t[p],p,o));r||(r=document.createElement("tr"),r.classList.add("filter-row"),r.setAttribute("part","filter-row"),e.appendChild(r));const c=Array.from(r.children);let d=c.length===l.length;if(d){for(let p=0;p<l.length;p++)if(c[p]!==l[p]){d=!1;break}}if(!d){const p=new Set(l);for(const g of l)r.appendChild(g);for(const g of Array.from(r.children))p.has(g)||r.removeChild(g)}}else r&&r.remove()}_buildHeaderCell(e,t,o){const i=document.createElement("th");if(i.setAttribute("scope","col"),i.dataset.key=e.key,this._applyCellClasses(i,e,t,o),e.minWidth&&(i.style.minWidth=e.minWidth),e.key===de){if(this._readSelectable()==="multi"){const n=document.createElement("input");n.type="checkbox",n.className="select-all-checkbox",n.setAttribute("data-noclick",""),n.setAttribute("aria-label","Select all rows");const{total:r,selected:l}=this._visibleSelectionStats();n.checked=r>0&&l===r,n.indeterminate=l>0&&l<r,n.addEventListener("change",()=>{n.checked?this.selectAll():this.clearSelection()}),i.appendChild(n)}return i}if(i.textContent=e.label??(e.key===ce?"":e.key),e.sortable){i.classList.add("is-sortable");const a=this._sort?.key===e.key,n=document.createElement("span");n.className="sort-indicator";let r="";a&&(r=this._sort.direction==="asc"?" ▲":" ▼"),n.textContent=r,i.appendChild(n),a&&i.classList.add(this._sort.direction==="asc"?"sort-asc":"sort-desc"),i.addEventListener("click",()=>this._cycleSort(e.key))}return i}_buildFilterCell(e,t,o){const i=this._filterCache.get(e.key),a=Array.isArray(e.filterOptions),n=typeof e.filterRender=="function";let r;if(!e.filter&&!a&&!n||e.key===ce||e.key===de?r="none":n?r="custom":e.filter==="select"||a?r="select":r="text",i&&i.kind===r){if(i.th.className="",this._applyCellClasses(i.th,e,t,o),r==="select"){const p=i.control,g=this._resolveFilterOptions(e),v=g.map(_=>_.value).join("|");v!==i.optionsKey?(this._populateSelect(p,g,this._filters[e.key]??""),i.optionsKey=v):p.value=this._filters[e.key]??""}else if(r==="text"){const p=i.control,g=this._filters[e.key]??"";p.value!==g&&p.ownerDocument.activeElement!==p&&(p.value=g)}else r==="custom"&&e.filterRender&&e.filterRender(i.th,{value:this._filters[e.key]??"",setValue:p=>this._onFilterChange(e.key,p),col:e});return i.th}const l=document.createElement("th");if(this._applyCellClasses(l,e,t,o),r==="none")return this._filterCache.set(e.key,{th:l,control:null,optionsKey:"",kind:"none"}),l;if(r==="custom"&&e.filterRender)return e.filterRender(l,{value:this._filters[e.key]??"",setValue:p=>this._onFilterChange(e.key,p),col:e}),this._filterCache.set(e.key,{th:l,control:null,optionsKey:"",kind:"custom"}),l;let c,d="";if(r==="select"){const p=document.createElement("select");p.classList.add("filter-select"),p.setAttribute("data-noclick",""),p.setAttribute("aria-label",`Filter ${e.label??e.key}`);const g=this._resolveFilterOptions(e);this._populateSelect(p,g,this._filters[e.key]??""),d=g.map(v=>v.value).join("|"),p.addEventListener("change",()=>{this._onFilterChange(e.key,p.value)}),c=p}else{const p=document.createElement("input");p.type="search",p.classList.add("filter-input"),p.setAttribute("data-noclick",""),p.setAttribute("placeholder","Filter…"),p.setAttribute("aria-label",`Filter ${e.label??e.key}`),p.value=this._filters[e.key]??"",p.addEventListener("input",()=>{this._onFilterChange(e.key,p.value)}),c=p}return l.appendChild(c),this._filterCache.set(e.key,{th:l,control:c,optionsKey:d,kind:r}),l}_populateSelect(e,t,o){e.replaceChildren();const i=document.createElement("option");i.value="",i.textContent="All",e.appendChild(i);for(const a of t){const n=document.createElement("option");n.value=a.value,n.textContent=a.label,a.value===o&&(n.selected=!0),e.appendChild(n)}e.value=o}_resolveFilterOptions(e){return Array.isArray(e.filterOptions)?e.filterOptions:this._uniqueValues(e.key).map(t=>({value:t,label:t}))}_paintBody(e,t,o){if(e.replaceChildren(),this.hasAttribute("loading")){const a=this._readLoadingRows();for(let n=0;n<a;n++)e.appendChild(this._buildSkeletonRow(t,n));return}const i=this._sortedRows(this._filteredRows());if(i.length===0){e.appendChild(this._buildEmptyRow(t.length));return}for(const{row:a,index:n}of i)if(e.appendChild(this._stacked?this._buildStackedRow(a,n,t):this._buildBodyRow(a,n,t,o)),this._expanded.has(n)&&this._subTable){const r=this._subTable(a,n);r&&e.appendChild(this._buildSubTableRow(r,t.length))}}_buildEmptyRow(e){const t=document.createElement("tr");t.classList.add("empty");const o=document.createElement("td");o.colSpan=e;const i=document.createElement("slot");return i.name="empty",i.textContent=this.getAttribute("empty")||"No data",o.appendChild(i),t.appendChild(o),t}_buildSkeletonRow(e,t){const o=document.createElement("tr");if(o.classList.add("skeleton"),o.setAttribute("aria-hidden","true"),this._stacked){o.classList.add("stack-row");const i=document.createElement("td");i.className="stack-body",i.colSpan=Math.max(1,e.length);for(const a of[55+t*7%25,30+t*11%15]){const n=document.createElement("span");n.className="skeleton-bar",n.style.width=`${a}%`,i.appendChild(n)}return o.appendChild(i),o}for(const i of e){const a=document.createElement("td"),n=document.createElement("span");n.className="skeleton-bar";const r=50+(t*7+o.children.length*13)%40;n.style.width=`${r}%`,a.appendChild(n),o.appendChild(a)}return o}_buildBodyRow(e,t,o,i){const a=document.createElement("tr");a.setAttribute("part","row"),a.dataset.rowIndex=String(t);const n=this._getRowId(e,t);a.dataset.rowId=String(n),this._selection.has(n)&&a.classList.add("is-selected"),a.addEventListener("click",r=>{this._onRowClick(e,t,r)});for(let r=0;r<o.length;r++)a.appendChild(this._buildBodyCell(o[r],r,e,t,i));return a}_buildStackedRow(e,t,o){const i=document.createElement("tr");i.setAttribute("part","row"),i.classList.add("stack-row"),i.dataset.rowIndex=String(t);const a=this._getRowId(e,t);i.dataset.rowId=String(a),this._selection.has(a)&&i.classList.add("is-selected"),i.addEventListener("click",c=>{this._onRowClick(e,t,c)});const n=document.createElement("td");n.className="stack-body";let r=0,l=0;for(let c=0;c<o.length;c++){const d=o[c];if(d.key===de||d.key===ce){i.appendChild(this._buildBodyCell(d,c,e,t,0));continue}l++;const p=Zo(d,r++);if(p==="hidden")continue;const g=document.createElement("div");if(g.className=`stack-cell stack-${p}`,g.dataset.key=d.key,p==="meta"&&d.label){const h=document.createElement("span");h.className="stack-label",h.textContent=d.label,g.appendChild(h)}const v=document.createElement("span");v.className="stack-value";const _=e[d.key],x=Le(_);d.render?this._mountCellContent(v,d.render(_,e,t)):x!==null?v.appendChild(this._slotFor(x)):_!=null&&(v.textContent=String(_)),g.appendChild(v),n.appendChild(g)}return n.colSpan=Math.max(1,l),i.appendChild(n),i}_buildBodyCell(e,t,o,i,a){const n=document.createElement("td");if(this._applyCellClasses(n,e,t,a),e.minWidth&&(n.style.minWidth=e.minWidth),e.key===de){const c=this._getRowId(o,i),d=document.createElement("input");return d.type="checkbox",d.className="select-row-checkbox",d.setAttribute("data-noclick",""),d.setAttribute("aria-label","Select row"),d.checked=this._selection.has(c),d.addEventListener("change",()=>{d.checked?this.select(c):this.deselect(c)}),n.appendChild(d),this._stacked&&(n.setAttribute("data-noclick",""),n.addEventListener("click",p=>{p.target===n&&(d.checked=!d.checked,d.dispatchEvent(new Event("change")))})),n}if(e.key===ce){if(!(this._subTable?!!this._subTable(o,i):!1))return n;const d=this._expanded.has(i),p=document.createElement("button");return p.type="button",p.className="expander",p.setAttribute("data-noclick",""),p.setAttribute("aria-expanded",d?"true":"false"),p.setAttribute("aria-label",d?"Collapse row":"Expand row"),p.textContent=d?"▾":"▸",p.addEventListener("click",g=>{this._toggleRow(i,o,g)}),n.appendChild(p),n}const r=o[e.key],l=Le(r);if(e.render){const c=e.render(r,o,i);this._mountCellContent(n,c)}else l!==null?n.appendChild(this._slotFor(l)):r!=null&&(n.textContent=String(r));return n}_slotFor(e){const t=document.createElement("slot");return t.name=e,t}_buildSubTableRow(e,t){const o=document.createElement("tr");o.classList.add("subtable"),o.setAttribute("part","subtable-row");const i=document.createElement("td");i.colSpan=t;const a=document.createElement("div");if(a.classList.add("subtable-inner"),e instanceof Node)a.appendChild(e);else if(Xt(e))Z(e,a);else{const n=document.createElement("os-table");n.columns=e.columns,n.data=e.data,e.subTable&&(n.subTable=e.subTable),a.appendChild(n)}return i.appendChild(a),o.appendChild(i),o}_mountCellContent(e,t){if(typeof t=="string"){e.textContent=t;return}if(t instanceof Node){e.appendChild(t);return}Xt(t)&&Z(t,e)}_onFilterChange(e,t){t===""?delete this._filters[e]:this._filters[e]=t,this.emit("os-table-filter-change",{filters:{...this._filters}});const i=this.shadowRoot?.querySelector("tbody");if(i){const a=this._effectiveColumns(),n=this._readStickyColumns();this._lastStickyIndex=this._computeLastStickyIndex(a,n),this._paintBody(i,a,n),this._applyStickyOffsets()}}_onRowClick(e,t,o){const i=o.composedPath?.()??[];for(const a of i){if(a instanceof Element&&a.hasAttribute("data-noclick"))return;if(a===this)break}this.emit("os-table-row-click",{row:e,index:t,originalEvent:o})}_toggleRow(e,t,o){o.stopPropagation();const i=this._expanded.has(e);i?this._expanded.delete(e):this._expanded.add(e),this.emit("os-table-expand-change",{row:t,index:e,expanded:!i}),this._schedulePaint()}_cycleSort(e){!this._sort||this._sort.key!==e?this._sort={key:e,direction:"asc"}:this._sort.direction==="asc"?this._sort={key:e,direction:"desc"}:this._sort=null,this.emit("os-table-sort-change",{sort:this._sort?{...this._sort}:null}),this._schedulePaint()}_emitSelectionChange(){this.emit("os-table-selection-change",{selection:Array.from(this._selection),rows:this.selectedRows})}_filteredRows(){const e=[],t=Object.keys(this._filters).filter(o=>this._filters[o]!=="");for(let o=0;o<this._data.length;o++){const i=this._data[o];let a=!0;for(const n of t){const r=this._columns.find(p=>p.key===n);if(r&&typeof r.filterRender=="function")continue;const l=this._filters[n]??"",c=i[n],d=ot(c);if(r?.filter==="select"){if(d!==l){a=!1;break}}else if(!d.toLowerCase().includes(l.toLowerCase())){a=!1;break}}a&&e.push({row:i,index:o})}return e}_sortedRows(e){if(!this._sort)return e;const t=this._columns.find(a=>a.key===this._sort.key);if(!t)return e;const o=this._sort.direction==="desc"?-1:1,i=e.slice();return i.sort((a,n)=>{const r=a.row[t.key],l=n.row[t.key],c=t.sortValue?t.sortValue(a.row,r):Yt(r),d=t.sortValue?t.sortValue(n.row,l):Yt(l);return Xo(c,d)*o}),i}_uniqueValues(e){const t=new Set;for(const o of this._data){const i=o[e];i!=null&&t.add(ot(i))}return Array.from(t).sort()}_visibleSelectionStats(){let e=0,t=0;for(const{row:o,index:i}of this._filteredRows())e++,this._selection.has(this._getRowId(o,i))&&t++;return{total:e,selected:t}}_readStickyColumns(){const e=parseInt(this.getAttribute("sticky-columns")||"0",10);return Number.isFinite(e)&&e>0?e:0}_readLoadingRows(){const e=parseInt(this.getAttribute("loading-rows")||"5",10);return Number.isFinite(e)&&e>0?Math.min(e,100):5}_readSelectable(){const e=this.getAttribute("selectable");return e==="single"?"single":e==="multi"||e===""?"multi":null}_isStickyIndex(e,t,o){return this._stacked||o.sticky===!1?!1:o.sticky===!0?!0:e<t}_computeLastStickyIndex(e,t){let o=-1;for(let i=0;i<e.length;i++)this._isStickyIndex(i,t,e[i])&&(o=i);return o}_applyCellClasses(e,t,o,i){t.key===ce&&e.classList.add("col-expander"),t.key===de&&e.classList.add("col-select"),t.align==="center"&&e.classList.add("align-center"),t.align==="end"&&e.classList.add("align-end"),this._isStickyIndex(o,i,t)&&(e.classList.add("is-sticky"),o===this._lastStickyIndex&&e.classList.add("is-sticky-edge"))}_effectiveColumns(){const e=[];return this._readSelectable()&&e.push({key:de,label:"",width:"40px",align:"center"}),this._subTable&&e.push({key:ce,label:"",width:"36px",align:"center"}),e.push(...this._columns),e}_applyStickyOffsets(){const e=this.shadowRoot;if(!e)return;const t=e.querySelector("thead tr");if(!t)return;const o=Array.from(t.children),i=[];let a=0;for(let r=0;r<o.length;r++)i[r]=a,o[r].classList.contains("is-sticky")&&(a+=o[r].offsetWidth);e.querySelectorAll("thead tr, tbody tr:not(.subtable):not(.empty):not(.skeleton)").forEach(r=>{const l=Array.from(r.children);for(let c=0;c<l.length;c++)l[c].classList.contains("is-sticky")&&(l[c].style.insetInlineStart=`${i[c]}px`)}),this._maybeWarnStickyOffsetRace(o,i)}_maybeWarnStickyOffsetRace(e,t){if(this._stickyRaceWarned)return;const o=this._readStickyColumns();if(o<2)return;const i=Math.min(o-1,e.length-1);if(i<=0||t[i]!==0||this.offsetWidth===0)return;this._stickyRaceWarned=!0;const a=e[0]?.offsetWidth??0;console.warn(`[os-table] sticky-columns: column ${i} resolved to inset-inline-start: 0px while the host is visible. ths[0].offsetWidth was ${a}px at measurement time. Likely a layout race — call recomputeLayout() after the panel finishes its mount/transition, or wrap the assignment of \`data\` in a requestAnimationFrame.`)}_measureHeaderHeight(){const e=this.shadowRoot;if(!e)return;const t=e.querySelector("thead tr");if(!t)return;const o=t.offsetHeight;o>0&&this.style.setProperty("--os-ui-table-header-height",`${o}px`)}_maybeWarnStickyHeader(){if(this._stickyHeaderWarned||!this.hasAttribute("sticky-header")||this.hasAttribute("loading")||this._data.length<8)return;const e=this.shadowRoot?.querySelector(".scroll");e&&e.offsetWidth!==0&&e.scrollHeight<=e.clientHeight+1&&(this._stickyHeaderWarned=!0,console.warn("[os-table] sticky-header is set but the table has no scroll container. Set --os-ui-table-max-height on the host (or wrap it in a scrolling parent) so the header has something to stick to."))}};ye.props=["stickyColumns","stickyHeader","striped","hover","compact","bordered","empty","loading","loadingRows","selectable","stacked"],ye.styles=[Go],ye.help=void 0;let st=ye;function Xt(s){return!!s&&s.__wpdHtml===!0}function Zo(s,e){return s.stack?s.stack:e===0?"title":s.label?"meta":"actions"}function Le(s){return s&&typeof s=="object"&&typeof s.slot=="string"?s.slot:null}function ot(s){if(s==null)return"";if(Le(s)!==null){const e=s.text;return e==null?"":String(e)}return String(s)}function Yt(s){return Le(s)!==null?ot(s):s}function Xo(s,e){if(s===e)return 0;if(s==null)return-1;if(e==null)return 1;if(typeof s=="number"&&typeof e=="number")return s-e;if(s instanceof Date&&e instanceof Date)return s.getTime()-e.getTime();const t=Number(s),o=Number(e);return Number.isFinite(t)&&Number.isFinite(o)?t-o:String(s).localeCompare(String(e))}W("os-table",st);const Yo=R` ${fe}:host{display:flex;flex-direction:column;gap:8px;font-size:13px;color:var( --os-ui-fg,#1d2327 );min-width:0}:host( [ hidden ] ){display:none}.os-select__label{font-size:13px;line-height:1.5;color:var( --os-ui-fg-muted,#646970 )}.os-select__trigger{appearance:none;display:flex;align-items:center;gap:8px;width:100%;min-width:0;padding:8px 12px;background:var( --os-ui-hover,rgba( 0,0,0,0.05 ) );border:1px solid transparent;border-radius:8px;font:inherit;font-size:13px;line-height:1.5;color:var( --os-ui-fg,#1d2327 );text-align:start;cursor:pointer;transition:background-color var( --_holo-t ) ease,border-color var( --_holo-t ) ease,box-shadow var( --_holo-t ) ease}.os-select__trigger:hover:not(:disabled ){background:var( --os-ui-hover,rgba( 0,0,0,0.08 ) );border-color:var( --os-ui-border-strong,#8c8f94 )}.os-select__trigger:focus,.os-select__trigger:focus-visible{outline:none;border-color:var( --os-ui-accent,#2271b1 );box-shadow:var( --_holo-focus-field )}.os-select__trigger:disabled{opacity:0.5;cursor:not-allowed}:host( [ plain ] ){display:inline-flex;flex-direction:row;align-items:center}:host( [ plain ] ) .os-select__label{display:none}:host( [ plain ] ) .os-select__trigger{width:auto;padding:4px 6px;background:transparent;border-color:transparent;border-radius:6px}:host( [ plain ] ) .os-select__trigger:hover:not(:disabled ){background:var( --os-ui-hover,rgba( 0,0,0,0.05 ) );border-color:transparent}:host( [ plain ] ) .os-select__trigger:focus,:host( [ plain ] ) .os-select__trigger:focus-visible{border-color:var( --os-ui-accent,#2271b1 )}:host( [ plain ] ) .os-select__value{flex:0 1 auto}.os-select__value{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.os-select__value--placeholder{color:var( --os-ui-fg-muted,#646970 )}.os-select__chevron{flex:0 0 auto;pointer-events:none;color:var( --os-ui-fg-muted,#646970 )}.os-select__trigger:hover .os-select__chevron{color:var( --os-ui-fg,#1d2327 )}.os-select__trigger:focus .os-select__chevron,.os-select__trigger:focus-visible .os-select__chevron{color:var( --os-ui-accent,#2271b1 )}.os-select__popup{position:fixed;inset:auto;margin:0;max-height:min( 320px,60vh );overflow-y:auto;padding:4px;background:var( --os-ui-surface,#fff );border:1px solid var( --os-ui-border,#dcdcde );border-radius:8px;box-shadow:0 12px 32px rgba( 0,0,0,0.45 );color:var( --os-ui-fg,#1d2327 )}.os-select__popup:not( [ data-open ] ){display:none}.os-select__popup:popover-open{display:block}.os-select__popup[ data-open ]{position:absolute;top:calc( 100% + 4px );left:0;min-width:100%;z-index:1000}:host{position:relative}.os-select__option{display:flex;align-items:center;gap:8px;padding:7px 10px;border-radius:6px;font-size:13px;line-height:1.5;cursor:pointer;white-space:nowrap}.os-select__check{flex:0 0 auto;visibility:hidden}.os-select__option[ aria-selected='true' ] .os-select__check{visibility:visible}.os-select__option[ data-active ],.os-select__option:hover{background:var( --os-ui-accent,#2271b1 );color:var( --os-ui-accent-ink,var( --os-ui-fg-on-accent,#fff ) )}.os-select__option[ aria-disabled='true' ]{opacity:0.5;cursor:not-allowed}.os-select__option[ aria-disabled='true' ]:hover{background:transparent;color:inherit}@media ( prefers-reduced-motion:reduce ){.os-select__trigger{transition-duration:1ms}}`,Jo=R`:host{display:none}`,ke=class ke extends U{render(){return b``}};ke.props=["value","disabled"],ke.styles=[Jo],ke.help=void 0;let it=ke;W("os-option",it);const we=class we extends U{constructor(){super(...arguments),this._optionObserver=null,this._open=!1,this._activeIndex=-1,this._typed="",this._dismissedAt=0,this._typedTimer=null,this._onWindowScroll=e=>{const t=e.target,o=this._popup();o&&t instanceof Node&&(t===o||o.contains(t))||this._hide()},this._onWindowResize=()=>this._hide()}set items(e){const t=this.querySelectorAll(":scope > os-option");for(const a of Array.from(t))a.remove();for(const a of e){const n=document.createElement("os-option");n.setAttribute("value",a.value),n.textContent=a.label,this.appendChild(n)}const o=this.value;!(o!==null&&e.some(a=>a.value===o))&&e.length>0&&(this.value=e[0].value),this.requestUpdate()}connectedCallback(){super.connectedCallback(),Mt(this),this._optionObserver=new MutationObserver(()=>this.requestUpdate()),this._optionObserver.observe(this,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["value","disabled"],characterData:!0})}disconnectedCallback(){this._optionObserver?.disconnect(),this._optionObserver=null,this._teardownDismiss(),this._open=!1,this._typedTimer&&(clearTimeout(this._typedTimer),this._typedTimer=null)}render(){const e=this.label||"",t=this.value,o=this.placeholder||"",i=this.disabled!==null;e&&this.setAttribute("aria-label",e);const a=this.getAttribute("aria-label")||"",n=e||a||o,r=this._readOptions(),l=r.find(_=>_.value===t),c=l?l.label:o,d=this.id||"os-unnamed",p=`${d}__listbox`,g=`${d}__trigger`,v=this._open&&this._activeIndex>=0?`${d}__opt-${this._activeIndex}`:"";return b`
209 209 ${e?b`<label
210 210 class="os-select__label"
211 - for=${h}
211 + for=${g}
212 212 >${e}</label>`:b``}
213 213 <button
214 214 type="button"
215 215 class="os-select__trigger"
216 - id=${h}
216 + id=${g}
217 217 role="combobox"
218 218 aria-haspopup="listbox"
219 219 aria-expanded=${this._open?"true":"false"}
220 220 aria-controls=${p}
221 221 aria-label=${n}
222 - aria-activedescendant=${_}
222 + aria-activedescendant=${v}
223 223 ?disabled=${i}
224 224 @click=${()=>this._toggle()}
225 - @keydown=${g=>this._onTriggerKeydown(g)}
225 + @keydown=${_=>this._onTriggerKeydown(_)}
226 226 >
227 227 <span
228 228 class="os-select__value${l?"":" os-select__value--placeholder"}"
229 229 >${c}</span
230 230 >
231 - ${X("chevron-right",{size:16,rotate:90,className:"os-select__chevron"})}
231 + ${Y("chevron-right",{size:16,rotate:90,className:"os-select__chevron"})}
232 232 </button>
233 233 <div
234 234 class="os-select__popup"
235 235 id=${p}
@@ -235,36 +235,36 @@
235 235 id=${p}
236 236 role="listbox"
237 237 popover="auto"
238 238 aria-label=${n}
239 - @toggle=${g=>this._onPopoverToggle(g)}
239 + @toggle=${_=>this._onPopoverToggle(_)}
240 240 >
241 - ${r.map((g,m)=>b`
241 + ${r.map((_,x)=>b`
242 242 <div
243 243 class="os-select__option"
244 - id=${`${d}__opt-${m}`}
244 + id=${`${d}__opt-${x}`}
245 245 role="option"
246 - data-value=${g.value}
247 - aria-selected=${g.value===t?"true":"false"}
248 - aria-disabled=${g.disabled?"true":"false"}
249 - ?data-active=${this._open&&m===this._activeIndex}
250 - @click=${()=>this._onOptionClick(g)}
251 - @pointermove=${()=>this._setActive(m)}
246 + data-value=${_.value}
247 + aria-selected=${_.value===t?"true":"false"}
248 + aria-disabled=${_.disabled?"true":"false"}
249 + ?data-active=${this._open&&x===this._activeIndex}
250 + @click=${()=>this._onOptionClick(_)}
251 + @pointermove=${()=>this._setActive(x)}
252 252 >
253 - ${X("check",{size:16,className:"os-select__check"})}
253 + ${Y("check",{size:16,className:"os-select__check"})}
254 254 <span class="os-select__option-label"
255 - >${g.label}</span
255 + >${_.label}</span
256 256 >
257 257 </div>
258 258 `)}
259 259 </div>
260 - `}_readOptions(){const e=[],t=this.querySelectorAll(":scope > os-option");for(const s of Array.from(t)){const i=s.getAttribute("value");i!==null&&e.push({value:i,label:(s.textContent||i).trim(),disabled:s.hasAttribute("disabled")})}return e}_popup(){return this.shadowRoot?.querySelector(".os-select__popup")??null}_trigger(){return this.shadowRoot?.querySelector(".os-select__trigger")??null}_toggle(){if(this._open){this._hide();return}performance.now()-this._dismissedAt<250||this._show()}_show(){const e=this._popup(),t=this._trigger();if(!e||!t||this._open)return;this._open=!0;const s=this._readOptions(),i=this.value,a=s.findIndex(r=>r.value===i&&!r.disabled);this._activeIndex=a>=0?a:s.findIndex(r=>!r.disabled);const n=t.getBoundingClientRect();e.style.minWidth=`${n.width}px`,typeof e.showPopover=="function"?(e.style.left=`${n.left}px`,e.style.top=`${n.bottom+4}px`,e.showPopover(),n.bottom+4+e.offsetHeight>window.innerHeight-8&&(e.style.top=`${Math.max(8,n.top-4-e.offsetHeight)}px`)):e.setAttribute("data-open",""),window.addEventListener("scroll",this._onWindowScroll,{capture:!0,passive:!0}),window.addEventListener("resize",this._onWindowResize),this.requestUpdate(),this._scrollActiveIntoView()}_hide(){if(!this._open)return;this._open=!1;const e=this._popup();if(e){if(typeof e.hidePopover=="function")try{e.hidePopover()}catch{}e.removeAttribute("data-open")}this._teardownDismiss(),this.requestUpdate()}_teardownDismiss(){window.removeEventListener("scroll",this._onWindowScroll,{capture:!0}),window.removeEventListener("resize",this._onWindowResize)}_onPopoverToggle(e){e.newState==="closed"&&this._open&&(this._dismissedAt=performance.now(),this._open=!1,this._teardownDismiss(),this.requestUpdate())}_onOptionClick(e){e.disabled||this._commit(e.value)}_commit(e){this._hide(),this.value=e,this.emit("os-pick",{value:e})}_setActive(e){if(e===this._activeIndex)return;const t=this._readOptions();!t[e]||t[e].disabled||(this._activeIndex=e,this.requestUpdate())}_moveActive(e){const t=this._readOptions();let s=this._activeIndex;for(let i=0;i<t.length&&(s=Math.min(Math.max(s+e,0),t.length-1),!(!t[s]?.disabled||s===0||s===t.length-1));i++);s!==this._activeIndex&&t[s]&&!t[s].disabled&&(this._activeIndex=s,this.requestUpdate(),this._scrollActiveIntoView())}_scrollActiveIntoView(){queueMicrotask(()=>{this.shadowRoot?.querySelector(".os-select__option[data-active]")?.scrollIntoView?.({block:"nearest"})})}_typeAhead(e){this._typedTimer&&clearTimeout(this._typedTimer),this._typed+=e.toLowerCase(),this._typedTimer=setTimeout(()=>{this._typed=""},500);const s=this._readOptions().findIndex(i=>!i.disabled&&i.label.toLowerCase().startsWith(this._typed));s>=0&&(this._activeIndex=s,this.requestUpdate(),this._scrollActiveIntoView())}_onTriggerKeydown(e){const t=this._readOptions();if(t.length!==0){if(!this._open){if(["ArrowDown","ArrowUp","Enter"," ","Home","End"].includes(e.key)){if(e.preventDefault(),this._show(),e.key==="Home"&&(this._activeIndex=t.findIndex(s=>!s.disabled)),e.key==="End"){for(let s=t.length-1;s>=0;s--)if(!t[s].disabled){this._activeIndex=s;break}}this.requestUpdate()}else e.key.length===1&&e.key.trim()!==""&&(this._show(),this._typeAhead(e.key));return}switch(e.key){case"ArrowDown":e.preventDefault(),this._moveActive(1);break;case"ArrowUp":e.preventDefault(),this._moveActive(-1);break;case"Home":e.preventDefault(),this._activeIndex=t.findIndex(s=>!s.disabled),this.requestUpdate(),this._scrollActiveIntoView();break;case"End":e.preventDefault();for(let s=t.length-1;s>=0;s--)if(!t[s].disabled){this._activeIndex=s,this.requestUpdate(),this._scrollActiveIntoView();break}break;case"Enter":case" ":{e.preventDefault();const s=t[this._activeIndex];s&&!s.disabled&&this._commit(s.value);break}case"Tab":{const s=t[this._activeIndex];s&&!s.disabled?this._commit(s.value):this._hide();break}case"Escape":e.preventDefault(),this._hide();break;default:e.key.length===1&&e.key.trim()!==""&&this._typeAhead(e.key)}}}};we.props=["value","label","placeholder","disabled","name"],we.styles=[Ro],we.help={title:"Select",summary:"Dropdown picker: a combobox trigger plus a custom top-layer listbox, so the popup wears the station instead of the operating system. Mirrors the <os-segmented> contract (set value, listen for os-pick).",status:"stable",props:[{name:"value",type:"string",description:"Currently selected option value."},{name:"label",type:"string",description:"Visible label rendered above the trigger and used as the accessible name."},{name:"placeholder",type:"string",description:"Trigger text shown when no value is set."},{name:"disabled",type:"boolean attribute",description:"Disables the trigger and dims the chrome."},{name:"plain",type:"boolean attribute",description:"Drops the field chrome and shrinks to the value, for a picker that is a list row’s trailing control rather than a field of its own. The container already draws the box; use with no `label`."},{name:"name",type:"string",description:"Accepted for compatibility. Shadow-DOM controls never participated in light-DOM form submission, so nothing is lost by the native select being gone; read `value` off the host instead."}],slots:[{name:"(default)",description:'<os-option value="…"> children.'}],events:[{name:"os-pick",description:"Fires when the user picks a new option.",detail:"{ value: string }"}],cssProps:[{name:"--os-ui-fg",description:"Label + value colour."},{name:"--os-ui-fg-muted",description:"Placeholder + chevron colour."},{name:"--os-ui-accent",description:"Active option row + selected check."}],example:b`
260 + `}_readOptions(){const e=[],t=this.querySelectorAll(":scope > os-option");for(const o of Array.from(t)){const i=o.getAttribute("value");i!==null&&e.push({value:i,label:(o.textContent||i).trim(),disabled:o.hasAttribute("disabled")})}return e}_popup(){return this.shadowRoot?.querySelector(".os-select__popup")??null}_trigger(){return this.shadowRoot?.querySelector(".os-select__trigger")??null}_toggle(){if(this._open){this._hide();return}performance.now()-this._dismissedAt<250||this._show()}_show(){const e=this._popup(),t=this._trigger();if(!e||!t||this._open)return;this._open=!0;const o=this._readOptions(),i=this.value,a=o.findIndex(r=>r.value===i&&!r.disabled);this._activeIndex=a>=0?a:o.findIndex(r=>!r.disabled);const n=t.getBoundingClientRect();e.style.minWidth=`${n.width}px`,typeof e.showPopover=="function"?(e.style.left=`${n.left}px`,e.style.top=`${n.bottom+4}px`,e.showPopover(),n.bottom+4+e.offsetHeight>window.innerHeight-8&&(e.style.top=`${Math.max(8,n.top-4-e.offsetHeight)}px`)):e.setAttribute("data-open",""),window.addEventListener("scroll",this._onWindowScroll,{capture:!0,passive:!0}),window.addEventListener("resize",this._onWindowResize),this.requestUpdate(),this._scrollActiveIntoView()}_hide(){if(!this._open)return;this._open=!1;const e=this._popup();if(e){if(typeof e.hidePopover=="function")try{e.hidePopover()}catch{}e.removeAttribute("data-open")}this._teardownDismiss(),this.requestUpdate()}_teardownDismiss(){window.removeEventListener("scroll",this._onWindowScroll,{capture:!0}),window.removeEventListener("resize",this._onWindowResize)}_onPopoverToggle(e){e.newState==="closed"&&this._open&&(this._dismissedAt=performance.now(),this._open=!1,this._teardownDismiss(),this.requestUpdate())}_onOptionClick(e){e.disabled||this._commit(e.value)}_commit(e){this._hide(),this.value=e,this.emit("os-pick",{value:e})}_setActive(e){if(e===this._activeIndex)return;const t=this._readOptions();!t[e]||t[e].disabled||(this._activeIndex=e,this.requestUpdate())}_moveActive(e){const t=this._readOptions();let o=this._activeIndex;for(let i=0;i<t.length&&(o=Math.min(Math.max(o+e,0),t.length-1),!(!t[o]?.disabled||o===0||o===t.length-1));i++);o!==this._activeIndex&&t[o]&&!t[o].disabled&&(this._activeIndex=o,this.requestUpdate(),this._scrollActiveIntoView())}_scrollActiveIntoView(){queueMicrotask(()=>{this.shadowRoot?.querySelector(".os-select__option[data-active]")?.scrollIntoView?.({block:"nearest"})})}_typeAhead(e){this._typedTimer&&clearTimeout(this._typedTimer),this._typed+=e.toLowerCase(),this._typedTimer=setTimeout(()=>{this._typed=""},500);const o=this._readOptions().findIndex(i=>!i.disabled&&i.label.toLowerCase().startsWith(this._typed));o>=0&&(this._activeIndex=o,this.requestUpdate(),this._scrollActiveIntoView())}_onTriggerKeydown(e){const t=this._readOptions();if(t.length!==0){if(!this._open){if(["ArrowDown","ArrowUp","Enter"," ","Home","End"].includes(e.key)){if(e.preventDefault(),this._show(),e.key==="Home"&&(this._activeIndex=t.findIndex(o=>!o.disabled)),e.key==="End"){for(let o=t.length-1;o>=0;o--)if(!t[o].disabled){this._activeIndex=o;break}}this.requestUpdate()}else e.key.length===1&&e.key.trim()!==""&&(this._show(),this._typeAhead(e.key));return}switch(e.key){case"ArrowDown":e.preventDefault(),this._moveActive(1);break;case"ArrowUp":e.preventDefault(),this._moveActive(-1);break;case"Home":e.preventDefault(),this._activeIndex=t.findIndex(o=>!o.disabled),this.requestUpdate(),this._scrollActiveIntoView();break;case"End":e.preventDefault();for(let o=t.length-1;o>=0;o--)if(!t[o].disabled){this._activeIndex=o,this.requestUpdate(),this._scrollActiveIntoView();break}break;case"Enter":case" ":{e.preventDefault();const o=t[this._activeIndex];o&&!o.disabled&&this._commit(o.value);break}case"Tab":{const o=t[this._activeIndex];o&&!o.disabled?this._commit(o.value):this._hide();break}case"Escape":e.preventDefault(),this._hide();break;default:e.key.length===1&&e.key.trim()!==""&&this._typeAhead(e.key)}}}};we.props=["value","label","placeholder","disabled","name"],we.styles=[Yo],we.help={title:"Select",summary:"Dropdown picker: a combobox trigger plus a custom top-layer listbox, so the popup wears the station instead of the operating system. Mirrors the <os-segmented> contract (set value, listen for os-pick).",status:"stable",props:[{name:"value",type:"string",description:"Currently selected option value."},{name:"label",type:"string",description:"Visible label rendered above the trigger and used as the accessible name."},{name:"placeholder",type:"string",description:"Trigger text shown when no value is set."},{name:"disabled",type:"boolean attribute",description:"Disables the trigger and dims the chrome."},{name:"plain",type:"boolean attribute",description:"Drops the field chrome and shrinks to the value, for a picker that is a list row’s trailing control rather than a field of its own. The container already draws the box; use with no `label`."},{name:"name",type:"string",description:"Accepted for compatibility. Shadow-DOM controls never participated in light-DOM form submission, so nothing is lost by the native select being gone; read `value` off the host instead."}],slots:[{name:"(default)",description:'<os-option value="…"> children.'}],events:[{name:"os-pick",description:"Fires when the user picks a new option.",detail:"{ value: string }"}],cssProps:[{name:"--os-ui-fg",description:"Label + value colour."},{name:"--os-ui-fg-muted",description:"Placeholder + chevron colour."},{name:"--os-ui-accent",description:"Active option row + selected check."}],example:b`
261 261 <os-select value="eur" label="Currency">
262 262 <os-option value="eur">Euro</os-option>
263 263 <os-option value="usd">US Dollar</os-option>
264 264 <os-option value="jpy">Japanese Yen</os-option>
265 265 </os-select>
266 - `};let st=we;U("os-select",st);const No=P`
266 + `};let nt=we;W("os-select",nt);const Qo=R`
267 267 :host {
268 268 display: flex;
269 269 flex-direction: column;
270 270 gap: 4px;
@@ -347,9 +347,9 @@
347 347
348 348 :host( [ open ] ) .os-multiselect__chevron {
349 349 transform: rotate( 180deg );
350 350 }
351 -`;function Oo(){const o="os-multiselect-popover-styles";if(document.getElementById(o))return;const e=document.createElement("style");e.id=o,e.textContent=`
351 +`;function ei(){const s="os-multiselect-popover-styles";if(document.getElementById(s))return;const e=document.createElement("style");e.id=s,e.textContent=`
352 352 .os-multiselect__popover {
353 353 position: fixed;
354 354 z-index: 100000;
355 355 max-height: 320px;
@@ -449,9 +449,9 @@
449 449
450 450 @keyframes os-multiselect-spin {
451 451 to { transform: rotate( 360deg ); }
452 452 }
453 -`,document.head.appendChild(e)}typeof document<"u"&&Oo();const $e=class $e extends q{constructor(){super(...arguments),this._optionObserver=null,this._popover=null,this._teardownOpen=null,this._hasMore=!1,this._loadingMore=!1}set items(e){const t=this.querySelectorAll(":scope > os-option");for(const a of Array.from(t))a.remove();for(const a of e){const n=document.createElement("os-option");n.setAttribute("value",a.value),n.textContent=a.label,this.appendChild(n)}this._loadingMore=!1;const s=new Set(e.map(a=>a.value)),i=this._readValues().filter(a=>s.has(a));this._writeValueAttribute(i),this.requestUpdate(),this._refreshPopover()}get values(){return this._readValues()}set values(e){const t=Array.isArray(e)?e.map(s=>String(s)).filter(s=>s!==""):[];this._writeValueAttribute(t),this.requestUpdate(),this._refreshPopover()}get hasMore(){return this._hasMore}set hasMore(e){this._hasMore=!!e,this._refreshPopover()}get loadingMore(){return this._loadingMore}set loadingMore(e){this._loadingMore=!!e,this._refreshPopover()}appendItems(e){if(this._loadingMore=!1,!e||e.length===0){this._refreshPopover();return}const t=new Set(Array.from(this.querySelectorAll(":scope > os-option")).map(s=>s.getAttribute("value")));for(const s of e){if(t.has(s.value))continue;const i=document.createElement("os-option");i.setAttribute("value",s.value),i.textContent=s.label,this.appendChild(i)}this.requestUpdate(),this._refreshPopover()}connectedCallback(){super.connectedCallback(),$t(this),this._optionObserver=new MutationObserver(()=>{this.requestUpdate(),this._refreshPopover()}),this._optionObserver.observe(this,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["value","disabled"],characterData:!0})}disconnectedCallback(){this._optionObserver?.disconnect(),this._optionObserver=null,this._closePopover()}render(){const e=this.label||"",t=this.placeholder||"All",s=this.disabled!==null;e?this.setAttribute("aria-label",e):this.removeAttribute("aria-label");const i=e||t,a=this._summarize(t),n=this._readValues().length>0,l=`${this.id||"os-unnamed"}__trigger`;return b`
453 +`,document.head.appendChild(e)}typeof document<"u"&&ei();const $e=class $e extends U{constructor(){super(...arguments),this._optionObserver=null,this._popover=null,this._teardownOpen=null,this._hasMore=!1,this._loadingMore=!1}set items(e){const t=this.querySelectorAll(":scope > os-option");for(const a of Array.from(t))a.remove();for(const a of e){const n=document.createElement("os-option");n.setAttribute("value",a.value),n.textContent=a.label,this.appendChild(n)}this._loadingMore=!1;const o=new Set(e.map(a=>a.value)),i=this._readValues().filter(a=>o.has(a));this._writeValueAttribute(i),this.requestUpdate(),this._refreshPopover()}get values(){return this._readValues()}set values(e){const t=Array.isArray(e)?e.map(o=>String(o)).filter(o=>o!==""):[];this._writeValueAttribute(t),this.requestUpdate(),this._refreshPopover()}get hasMore(){return this._hasMore}set hasMore(e){this._hasMore=!!e,this._refreshPopover()}get loadingMore(){return this._loadingMore}set loadingMore(e){this._loadingMore=!!e,this._refreshPopover()}appendItems(e){if(this._loadingMore=!1,!e||e.length===0){this._refreshPopover();return}const t=new Set(Array.from(this.querySelectorAll(":scope > os-option")).map(o=>o.getAttribute("value")));for(const o of e){if(t.has(o.value))continue;const i=document.createElement("os-option");i.setAttribute("value",o.value),i.textContent=o.label,this.appendChild(i)}this.requestUpdate(),this._refreshPopover()}connectedCallback(){super.connectedCallback(),Mt(this),this._optionObserver=new MutationObserver(()=>{this.requestUpdate(),this._refreshPopover()}),this._optionObserver.observe(this,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["value","disabled"],characterData:!0})}disconnectedCallback(){this._optionObserver?.disconnect(),this._optionObserver=null,this._closePopover()}render(){const e=this.label||"",t=this.placeholder||"All",o=this.disabled!==null;e?this.setAttribute("aria-label",e):this.removeAttribute("aria-label");const i=e||t,a=this._summarize(t),n=this._readValues().length>0,l=`${this.id||"os-unnamed"}__trigger`;return b`
454 454 ${e?b`<label
455 455 class="os-multiselect__label"
456 456 for=${l}
457 457 >${e}</label>`:b``}
@@ -461,16 +461,16 @@
461 461 class="os-multiselect__trigger"
462 462 aria-haspopup="listbox"
463 463 aria-expanded=${this._isOpen()?"true":"false"}
464 464 aria-label=${i}
465 - ?disabled=${s}
465 + ?disabled=${o}
466 466 data-active=${n?"true":"false"}
467 467 @click=${c=>this._onTriggerClick(c)}
468 468 >
469 469 <span class="os-multiselect__summary">${a}</span>
470 - ${X("chevron-right",{size:16,rotate:90,className:"os-multiselect__chevron"})}
470 + ${Y("chevron-right",{size:16,rotate:90,className:"os-multiselect__chevron"})}
471 471 </button>
472 - `}_readOptions(){const e=[],t=this.querySelectorAll(":scope > os-option");for(const s of Array.from(t)){const i=s.getAttribute("value");i!==null&&e.push({value:i,label:(s.textContent||i).trim(),disabled:s.hasAttribute("disabled")})}return e}_readValues(){return(this.value??"").split(",").map(t=>t.trim()).filter(t=>t!=="")}_writeValueAttribute(e){const t=e.join(",");this.value=t}_summarize(e){const t=this._readValues();if(t.length===0)return e;const s=this._readOptions(),i=new Map(s.map(a=>[a.value,a.label]));return t.length===1?i.get(t[0])??t[0]:`${t.length} selected`}_isOpen(){return this.open!==null}_onTriggerClick(e){e.stopPropagation(),e.preventDefault(),this.disabled===null&&(this._popover?this._closePopover():this._openPopover())}_openPopover(){if(this._popover)return;const e=document.createElement("div");e.className="os-multiselect__popover",e.setAttribute("role","listbox"),e.setAttribute("aria-multiselectable","true"),e.style.setProperty("--wp-admin-theme-color",getComputedStyle(this).getPropertyValue("--wp-admin-theme-color")||"#2271b1"),document.body.appendChild(e),this._popover=e,this._refreshPopover(),this._placePopover();const t=n=>{const r=n.target;if(!r)return;const l=this.shadowRoot?.querySelector(".os-multiselect__trigger");e.contains(r)||l&&l.contains(r)||this._closePopover()},s=n=>{n.key==="Escape"&&(n.stopPropagation(),this._closePopover(),this.shadowRoot?.querySelector(".os-multiselect__trigger")?.focus())},i=()=>this._placePopover(),a=()=>{if(!this._hasMore||this._loadingMore)return;const n=e.scrollHeight,r=e.clientHeight,l=e.scrollTop;n-(l+r)<64&&this.emit("os-multiselect-load-more",{})};setTimeout(()=>{document.addEventListener("pointerdown",t,!0)},0),document.addEventListener("keydown",s,!0),window.addEventListener("resize",i),window.addEventListener("scroll",i,!0),e.addEventListener("scroll",a),this._teardownOpen=()=>{document.removeEventListener("pointerdown",t,!0),document.removeEventListener("keydown",s,!0),window.removeEventListener("resize",i),window.removeEventListener("scroll",i,!0),e.removeEventListener("scroll",a)},this.setAttribute("open",""),this.requestUpdate(),this.emit("os-multiselect-open",{})}_closePopover(){this._teardownOpen&&(this._teardownOpen(),this._teardownOpen=null),this._popover&&(this._popover.remove(),this._popover=null,this.removeAttribute("open"),this.requestUpdate(),this.emit("os-multiselect-close",{}))}_refreshPopover(){const e=this._popover;if(!e)return;const t=this._readOptions(),s=new Set(this._readValues());if(e.replaceChildren(),t.length===0){const i=document.createElement("div");i.className="os-multiselect__empty",i.textContent="No options",e.appendChild(i);return}if(s.size>0){const i=document.createElement("button");i.type="button",i.className="os-multiselect__clear",i.textContent="Clear",i.addEventListener("click",a=>{a.preventDefault(),a.stopPropagation(),this._writeValueAttribute([]),this.requestUpdate(),this._refreshPopover(),this._emitPick()}),e.appendChild(i)}for(const i of t){const a=document.createElement("label");a.className="os-multiselect__option",a.setAttribute("role","option"),a.setAttribute("aria-selected",s.has(i.value)?"true":"false"),i.disabled&&(a.setAttribute("aria-disabled","true"),a.dataset.disabled="true");const n=document.createElement("input");n.type="checkbox",n.checked=s.has(i.value),n.disabled=i.disabled,n.addEventListener("change",()=>{const l=new Set(this._readValues());n.checked?l.add(i.value):l.delete(i.value);const c=t.map(d=>d.value).filter(d=>l.has(d));this._writeValueAttribute(c),a.setAttribute("aria-selected",n.checked?"true":"false"),this.requestUpdate(),this._refreshPopover(),this._emitPick()});const r=document.createElement("span");r.textContent=i.label,a.appendChild(n),a.appendChild(r),e.appendChild(a)}if(this._loadingMore){const i=document.createElement("div");i.className="os-multiselect__loading";const a=document.createElement("span");a.className="os-multiselect__spinner",a.setAttribute("aria-hidden","true");const n=document.createElement("span");n.textContent="Loading…",i.appendChild(a),i.appendChild(n),e.appendChild(i)}}_placePopover(){const e=this._popover,t=this.shadowRoot?.querySelector(".os-multiselect__trigger");if(!e||!t)return;const s=t.getBoundingClientRect(),i=window.innerWidth,a=window.innerHeight,n=Math.max(s.width,200);e.style.minWidth=`${n}px`;let r=s.left;r+n>i-8&&(r=Math.max(8,i-n-8)),e.style.left=`${r}px`,e.style.top=`${s.bottom+4}px`;const l=e.offsetHeight||200;s.bottom+4+l>a-8&&(e.style.top=`${Math.max(8,s.top-l-4)}px`)}_emitPick(){const e=this._readValues();this.emit("os-pick",{value:e.join(","),values:e})}};$e.props=["value","label","placeholder","disabled","name","open"],$e.styles=[No],$e.help=void 0;let ot=$e;U("os-multiselect",ot);const Do="openstation.postsWindow.columns",qo="openstation.postsWindow.statusSegments",Ho="openstation.postsWindow.bulkActions",Fo="openstation.postsWindow.toolbarTrailing",Uo="openstation.postsWindow.opened",Vo="openstation.postsWindow.dataLoaded",it="[openstation:desktop-mode-posts]",Vt=new Set(["title"]),Wo=new Set(["title","author","parent","date"]);function nt(){try{const o=window.wp?.os;if(o&&typeof o.getOsSettings=="function"){const e=o.getOsSettings();if(Array.isArray(e.nativePostsHiddenColumns))return new Set(e.nativePostsHiddenColumns)}}catch{}return new Set}const Wt={authors:[],tags:[]};function jt(o,e,t,s){const i="osPostsFilterMounted",a=o,n=t.map(c=>({value:String(c.id),label:c.name})),r=n.map(c=>`${c.value}:${c.label}`).join("|");if(a[i]){const c=a[i];c.listSig!==r&&(c.picker.items=n,c.listSig=r),c.picker.getAttribute("value")!==e.value&&c.picker.setAttribute("value",e.value),c.picker.hasMore=!!s.hasMore;return}const l=document.createElement("os-multiselect");if(l.setAttribute("placeholder",s.label),l.setAttribute("aria-label",s.ariaLabel),l.setAttribute("data-noclick",""),l.setAttribute("value",e.value),s.dataKey&&l.setAttribute("data-key",s.dataKey),o.appendChild(l),l.items=n,l.hasMore=!!s.hasMore,l.addEventListener("os-pick",c=>{const d=c.detail?.value??"";e.value=d,e.setValue(d)}),s.onLoadMore){const c=s.onLoadMore;l.addEventListener("os-multiselect-load-more",()=>{l.loadingMore=!0,c()})}a[i]={picker:l,listSig:r}}function jo(o,e,t){const s={key:"title",label:u("Title"),sortable:!0,sticky:!0,render:(c,d)=>Z(e,d.id,"title",()=>Js(d,o))},i={key:"author",label:u("Author"),sortable:!0,width:"180px",filterRender:(c,d)=>jt(c,d,t.authors,{label:u("All authors"),ariaLabel:u("Filter by author")}),render:(c,d)=>Z(e,d.id,"author",()=>Qs(d))},a={key:"date",label:u("Date"),sortable:!0,width:"170px",sortValue:c=>Date.parse(c.date_gmt+"Z")||0,render:(c,d)=>Z(e,d.id,"date",()=>eo(d))};if(o.extra.mode==="pages")return[s,i,{key:"parent",label:u("Parent"),width:"200px",render:(c,d)=>Z(e,d.id,"parent",()=>Ao(d,o))},{key:"template",label:u("Template"),width:"180px",render:(c,d)=>Z(e,d.id,"template",()=>zo(d,o))},{key:"slug",label:u("Slug"),width:"200px",render:(c,d)=>Z(e,d.id,"slug",()=>Eo(d,o))},{key:"comments",label:u("Comments"),width:"110px",sortValue:c=>typeof c.openstation_comment_count=="number"?c.openstation_comment_count:0,render:(c,d)=>Z(e,d.id,"comments",()=>To(d))},a];const n=[s,i],{categories:r,tags:l}=o.cells;return r&&n.push({key:"categories",label:u("Categories"),width:"260px",render:(c,d)=>Z(e,d.id,"categories",()=>r(d,o))}),l&&n.push({key:"tags",label:u("Tags"),minWidth:"360px",filterRender:(c,d)=>jt(c,d,t.tags.map(p=>({id:p.id,name:p.name})),{label:u("All tags"),ariaLabel:u("Filter by tag"),dataKey:"tags",hasMore:!!t.tagsHasMore,onLoadMore:t.loadMoreTags}),render:(c,d)=>Z(e,d.id,"tags",()=>l(d,o))}),n.push(a),n}function Kt(o,e,t=Wt){const s=jo(o,e,t),i=window.wp?.hooks;return i&&typeof i.applyFilters=="function"?i.applyFilters(Do,s):s}function Ko(o){return Kt(o,new Map).filter(e=>!Vt.has(e.key)).map(e=>({key:e.key,label:e.label||e.key}))}function Bt(o,e,t=Wt,s=!1,i=nt()){const a=Kt(o,e,t),n=i.size===0?a:a.filter(r=>Vt.has(r.key)||!i.has(r.key));return s?n.filter(r=>Wo.has(r.key)):n}function Bo(){return[{value:"",label:u("All")},{value:"publish",label:u("Published")},{value:"draft",label:u("Drafts")},{value:"pending",label:u("Pending")},{value:"future",label:u("Scheduled")},{value:"trash",label:u("Trash")}]}function Go(){const o=window.wp?.hooks,e=Bo();if(!o||typeof o.applyFilters!="function")return e;try{const t=o.applyFilters(qo,e);return Array.isArray(t)&&t.length>0?t:e}catch(t){return console.error(`${it} status-segments filter threw; falling back to defaults:`,t),e}}function Zo(o,e){return[{id:"trash",label:u("Move to trash"),icon:"dashicons-trash",variant:"danger",confirm:t=>O(o==="pages"?qe("Move %d page to the trash?","Move %d pages to the trash?",t):qe("Move %d post to the trash?","Move %d posts to the trash?",t),t),run:async(t,s)=>{const i=s.table.data??[],a=t.filter(n=>{const r=i.find(l=>l.id===n);return r&&r.status!=="trash"});return a.length>0&&await e(a),s.table.clearSelection(),!1}}]}function Xo(o){const e=window.wp?.hooks;if(!e||typeof e.applyFilters!="function")return o;try{const t=e.applyFilters(Ho,o);return Array.isArray(t)?t:o}catch(t){return console.error(`${it} bulk-actions filter threw; falling back to defaults:`,t),o}}function Yo(o){const e=window.wp?.hooks;if(!e||typeof e.applyFilters!="function")return[];try{const t=e.applyFilters(Fo,[],o);return Array.isArray(t)?t.filter(s=>s instanceof HTMLElement):[]}catch(t){return console.error(`${it} toolbar-trailing filter threw; ignoring:`,t),[]}}function Jo(o,e="date"){switch(o){case"title":case"author":case"date":case"modified":return o;case"comments":return"comment_count";default:return e}}function Qo(o){return o==="comment_count"?"comments":o}function Me(o,e,t){const s=window.wp?.os;s&&typeof s.broadcast=="function"&&s.broadcast("os.term.changed",{source:"posts-window",taxonomy:o,action:e,id:t})}function oe(o){const e=new URLSearchParams;for(const[s,i]of Object.entries(o))i!==void 0&&i!==""&&e.set(s,String(i));const t=e.toString();return t?`?${t}`:""}function ei(o){const e=async(n,r={})=>{const l=await o(n,{...r,headers:{...r.body?{"Content-Type":"application/json"}:{},...r.headers??{}}});if(!l.ok){let d=`${l.status} ${l.statusText}`;try{const p=await l.json();p&&typeof p.message=="string"&&(d=p.message)}catch{}throw new Error(d)}return{data:r.expectJson===!1?null:await l.json(),headers:l.headers}},t=async(n,r)=>{const l={per_page:20,_fields:"id,name,slug,count",orderby:"count",order:"desc"};n&&(l.search=n,l.orderby="name",l.order="asc");const{data:c}=await e(`wp/v2/tags${oe(l)}`,{method:"GET",signal:r});return Array.isArray(c)?c:[]},s=async n=>{const{data:r}=await e(`wp/v2/categories${oe({per_page:100,_fields:"id,name,slug,parent",orderby:"name",order:"asc"})}`,{method:"GET",signal:n});return Array.isArray(r)?r:[]},i=(n,r=0)=>{const l=n.openstation_count;return{id:n.id??r,name:n.name??"",slug:n.slug??"",parent:n.parent??0,count:typeof l=="number"?l:n.count??0,description:n.description??"",isDefault:n.openstation_is_default===!0}},a=async(n,r={})=>{const{data:l,headers:c}=await e(`wp/v2/${n}${oe({per_page:r.perPage??50,page:r.page??1,_fields:"id,name,slug,parent,count,description,openstation_is_default",orderby:r.orderby??"name",order:r.order??"asc",search:r.search,parent:typeof r.parent=="number"&&r.parent>=0?r.parent:void 0})}`,{method:"GET"});return{items:Array.isArray(l)?l.map(d=>i(d)):[],total:parseInt(c.get("X-WP-Total")??"0",10)||0,totalPages:parseInt(c.get("X-WP-TotalPages")??"0",10)||0}};return{searchTags:t,fetchAllCategories:s,async createTag(n){try{const{data:r}=await e("wp/v2/tags",{method:"POST",body:JSON.stringify({name:n})});return Me("post_tag","created",r.id),r}catch(r){const l=r instanceof Error?r.message:String(r);if(/term[\s_]?exists/i.test(l)){const c=(await t(n)).find(d=>d.name.toLowerCase()===n.toLowerCase());if(c)return c}throw r}},async updatePostTags(n,r){const{data:l}=await e(`wp/v2/posts/${n}`,{method:"POST",body:JSON.stringify({tags:r})});return l},async fetchAuthorOptions(n){try{const{data:r}=await e(`wp/v2/users${oe({per_page:100,who:"authors",_fields:"id,name",orderby:"name",order:"asc"})}`,{method:"GET",signal:n});return Array.isArray(r)?r:[]}catch{return[]}},async fetchTagOptions(n=1,r=50,l){try{const{data:c,headers:d}=await e(`wp/v2/tags${oe({per_page:Math.max(1,r),page:Math.max(1,n),_fields:"id,name,count",orderby:"count",order:"desc"})}`,{method:"GET",signal:l});return{items:Array.isArray(c)?c:[],totalPages:parseInt(d.get("X-WP-TotalPages")??"0",10)||0}}catch{return{items:[],totalPages:0}}},async createCategory(n,r=0,l={}){const c={name:n,parent:r};l.slug&&(c.slug=l.slug),l.description&&(c.description=l.description);try{const{data:d}=await e("wp/v2/categories",{method:"POST",body:JSON.stringify(c)});return Me("category","created",d.id),d}catch(d){const p=d instanceof Error?d.message:String(d);if(/term[\s_]?exists/i.test(p)){const h=(await s()).find(_=>_.name.toLowerCase()===n.toLowerCase()&&_.parent===r);if(h)return h}throw d}},async updatePostCategories(n,r){const{data:l}=await e(`wp/v2/posts/${n}`,{method:"POST",body:JSON.stringify({categories:r})});return l},fetchTerms:a,async fetchAllTerms(n){const r=[];let l=1;for(;l<=5;){const c=await a(n,{page:l,perPage:100});if(r.push(...c.items),l>=c.totalPages)break;l++}return r},async fetchTagCooccurrence(n="tags",r=8){const{data:l}=await e(`desktop-mode/v1/tag-cooccurrence${oe({taxonomy:n==="tags"?"post_tag":"category",limit:r})}`,{method:"GET"}),c=new Map,d=l&&typeof l=="object"&&!Array.isArray(l)?l.pairs:void 0;if(!d)return c;for(const[p,h]of Object.entries(d)){const _=parseInt(p,10);if(!Number.isFinite(_)||_<=0)continue;const g=[];for(const m of h){const f=Number(m?.id),v=Number(m?.shared);Number.isFinite(f)&&f>0&&Number.isFinite(v)&&v>0&&g.push({id:f,shared:v})}g.length>0&&c.set(_,g)}return c},async updateTerm(n,r,l){const{data:c}=await e(`wp/v2/${n}/${r}`,{method:"POST",body:JSON.stringify(l)});return Me(n==="categories"?"category":"post_tag","updated",r),i(c,r)},async deleteTerm(n,r){await e(`wp/v2/${n}/${r}?force=true`,{method:"DELETE"}),Me(n==="categories"?"category":"post_tag","deleted",r)},async fetchTermPosts(n,r,l,c){const{data:d,headers:p}=await e(`wp/v2/posts${oe({[n]:r,per_page:c,page:l,status:"any",_fields:"id,title,status"})}`,{method:"GET"}),h=parseInt(p.get("X-WP-Total")??"",10);return{items:(Array.isArray(d)?d:[]).map(_=>({id:_.id,title:_.title?.rendered||`#${_.id}`})),totalPages:Math.max(1,parseInt(p.get("X-WP-TotalPages")??"1",10)||1),total:Number.isFinite(h)?h:-1}},async fetchTermCounts(n,r){const{data:l}=await e(`desktop-mode/v1/term-counts${oe({taxonomy:n,ids:r.join(",")})}`,{method:"GET"});return l&&typeof l=="object"?l:{}}}}const ti="[openstation:desktop-mode-posts]",H=o=>o.root.querySelector("[data-os-posts-table]");function si(o){return{page:o.page,perPage:o.perPage,search:o.search||void 0,status:o.status||void 0,orderby:o.orderby,order:o.order,author:o.author.length>0?o.author:void 0,tag:o.tag.length>0?o.tag:void 0}}function at(o,e){if(!e.postsCtx){const t={body:o.root,get table(){return H(o)},refresh:()=>o.dispatch("refresh").then(()=>{}),getSelectedIds:()=>Array.from(H(o)?.selection??[]).map(s=>Number(s)),getSelectedRows:()=>{const s=new Set(t.getSelectedIds());return(H(o)?.data??[]).filter(i=>s.has(i.id))},getCurrentParams:()=>si(o.state)};e.postsCtx=t}return e.postsCtx}async function oi(o,e,t){const s=t.getSelectedIds();if(s.length===0)return;const{confirm:i}=e;if(i){const a=typeof i=="function"?i(s.length):O(i,s.length);if(!await(o.host.confirm?.({message:a,danger:!0})??Promise.resolve(!1)))return}try{if(await e.run(s,t)===!1)return}catch(a){console.error(`${ti} bulk action "${e.id}" failed`,a)}t.table.clearSelection(),await t.refresh()}function ii(o){const e={items:o.list.items,total:o.list.total,totalPages:o.list.pages,page:o.list.page},t=window.wp?.hooks;t&&typeof t.doAction=="function"&&t.doAction(Vo,e),document.dispatchEvent(new CustomEvent("os-posts-window-data-loaded",{detail:e}))}class ni{constructor(){this.items=[],this.pending=!1,this.error=!1,this.key="",this.lastData=null,this.page=0,this.pages=0,this.expected=0,this.disposed=!1,this.ctx=null,this.observer=null,this.sentinel=null,this.generation=0}queryKey(e){return JSON.stringify([e.search,e.status,e.orderby,e.order,e.author,e.tag,e.perPage])}reconcile(e){this.ctx=e;const{state:t,data:s}=e,i=this.queryKey(t);if(i!==this.key&&(this.generation++,this.expected=0,this.key=i,this.items=[],this.page=0,this.pages=0,this.lastData=null,this.error=!1),!e.loading&&s&&s!==this.lastData&&s.list.page===t.page&&(!s.query||this.queryKey(s.query)===i))if(this.lastData=s,s.list.error)this.error=!0;else{if(s.list.page>1&&this.page===0&&s.list.page!==this.expected&&!s.list.replace)return{...e,data:{...s,list:{...s.list,items:this.items}}};const a=s.list.page===1||s.list.replace?s.list.items:[...this.items,...s.list.items];this.items=Array.from(new Map(a.map(n=>[n.id,n])).values()),this.page=s.list.page,this.pages=s.list.pages,this.error=!1}return s?{...e,data:{...s,list:{...s.list,items:this.items}}}:e}get hasMore(){return this.page>0&&this.page<this.pages}async more(){const e=this.ctx;if(!e||this.disposed||this.pending||e.loading||!this.hasMore)return;const t=this.generation;this.pending=!0,this.error=!1,this.expected=this.page+1,e.repaint();try{const s=await e.dispatch("page",{page:this.expected});t===this.generation&&(!s||e.data?.list.error)&&(this.error=!0)}catch{t===this.generation&&(this.error=!0)}finally{this.pending=!1,this.expected=0,this.sentinel=null,this.disposed||e.repaint()}}tail(){let e=this.items.length?u("You’re all caught up."):"";return this.pending?e=u("Loading more…"):this.hasMore&&(e=b`<os-button variant="ghost" @click=${()=>void this.more()}>${this.error?u("Could not load more. Retry"):u("Load more")}</os-button>`),b`<div class="os-posts-desk__continuation" data-content-feed-end role="status">${e}</div>`}observe(e){const t=e.querySelector(".os-posts-desk__feed [data-content-feed-end]");t!==this.sentinel&&(this.observer?.disconnect(),this.sentinel=t,!(!t||typeof IntersectionObserver>"u")&&(this.observer=new IntersectionObserver(s=>{s.some(i=>i.isIntersecting)&&!this.error&&this.more()},{root:e.querySelector(".os-posts-desk__feed"),rootMargin:"0px 0px 240px 0px"}),this.observer.observe(t)))}dispose(){this.disposed=!0,this.observer?.disconnect()}}function ai(o){const e=new DOMParser().parseFromString(o,"text/html");e.querySelectorAll("script, style").forEach(i=>i.remove()),e.querySelectorAll("p, div, li, h1, h2, h3, h4, h5, h6, br").forEach(i=>i.append(e.createTextNode(" ")));const t=e.body.textContent||"",s=Intl.Segmenter;return s?Array.from(new s(void 0,{granularity:"word"}).segment(t)).filter(i=>i.isWordLike).length:(t.match(/[\p{L}\p{N}]+/gu)||[]).length}async function ri(o,e,t,s){const i={},a=async(l,c,d,p)=>{try{const h=await o(c,{...d,signal:s},{silent:!0});if(!h.ok)return i[l]=h.status===429||h.status>=500?"retry":"unavailable",null;const _=await p(h);return _===null&&(i[l]="unavailable"),_}catch{return i[l]="retry",null}},[n,r]=await Promise.all([a("words",`wp/v2/${e}/${t}?context=edit&_fields=content`,{},async l=>{const c=await l.json();return typeof c.content?.rendered=="string"&&!c.content.protected?ai(c.content.rendered):null}),a("comments",`wp/v2/comments?post=${t}&status=approve&per_page=1`,{method:"HEAD"},async l=>{const c=l.headers.get("X-WP-Total");return c!==null&&/^\d+$/.test(c)?Number(c):null})]);return Object.keys(i).length?{words:n,comments:r,errors:i}:{words:n,comments:r}}function li(o,e,t){const s=new AbortController,i=new Map,a=new Set,n=new Map,r=new Map,l=new Set,c=new WeakMap;let d=0;const p=()=>{for(const m of o.querySelectorAll("[data-content-metrics]")){const f=i.get(m.dataset.contentMetrics||"");if(!f)continue;for(const C of["words","comments"]){const R=m.querySelector(`[data-metric="${C}"]`);R?.setAttribute("value",f[C]===null?"—":f[C].toLocaleString());let y=f.errors?.[C]?u("This count is unavailable or access is restricted."):"";f.errors?.[C]==="retry"&&(y=u("Could not load this count.")),R?.setAttribute("title",y)}const v=m.dataset.contentMetrics||"";let x=m.querySelector("[data-retry-metrics]");Object.values(f.errors||{}).includes("retry")&&(r.get(v)||0)>=3?x||(x=document.createElement("os-button"),x.setAttribute("variant","ghost"),x.setAttribute("data-retry-metrics",""),x.textContent=u("Retry counts"),x.addEventListener("click",()=>{r.delete(v),i.delete(v),x?.remove(),h(v,Number(m.dataset.postId)),_()}),m.append(x)):x?.remove()}},h=(m,f)=>{!a.has(m)&&!s.signal.aborted&&(a.add(m),n.set(m,f))},_=()=>{if(!s.signal.aborted)for(;d<2&&n.size;){const[m,f]=n.entries().next().value;n.delete(m),d++,r.set(m,(r.get(m)||0)+1),ri(e,t,f,s.signal).then(v=>{if(!s.signal.aborted&&(i.set(m,v),p(),Object.values(v.errors||{}).includes("retry")&&r.get(m)<3)){const x=setTimeout(()=>{l.delete(x),h(m,f),_()},500*r.get(m));l.add(x)}}).finally(()=>{a.delete(m),d--,_()})}},g=typeof IntersectionObserver>"u"?null:new IntersectionObserver(m=>{for(const f of m){if(!f.isIntersecting)continue;const v=f.target,x=v.dataset.contentMetrics||"";i.has(x)||h(x,Number(v.dataset.postId)),g?.unobserve(v)}_()},{root:o.querySelector(".os-posts-desk__feed"),rootMargin:"80px"});return{sync:()=>{p(),o.querySelectorAll("[data-content-metrics]").forEach(m=>{const f=m.getAttribute("data-content-metrics")||"";c.get(m)!==f&&(c.set(m,f),g?.observe(m))})},dispose:()=>{s.abort(),g?.disconnect(),l.forEach(clearTimeout),l.clear(),n.clear(),i.clear()}}}const Gt=P` .desktop-mode-posts .os-app-list__toolbar-right.os-app-list__bulk--footer{flex:0 0 auto;align-content:start;gap:8px;padding:8px 12px}.os-posts-desk__continuation{grid-column:1 / -1;padding:14px 8px;text-align:center;font-size:11px;color:var( --os-ui-fg-muted,#646970 )}.os-posts-desk__filter-toggle{display:none}.os-posts-desk__metrics{display:flex;gap:22px;margin-block:18px 0;--os-ui-stat-padding:0;--os-ui-stat-border:transparent;--os-ui-stat-value-size:24px;--os-ui-stat-value-color:var( --os-ui-fg,#1d2327 )}.os-posts-desk__metrics os-stat{min-inline-size:62px}.desktop-mode-posts:not(.desktop-mode-pages) .os-posts-desk__story{position:relative;border-radius:3px 12px 12px 3px;padding-inline-start:34px;background-image:repeating-linear-gradient(transparent 0 27px,var( --os-ui-surface-subtle,#f0f0f1 ) 27px 28px);background-position:0 10px}.desktop-mode-posts:not(.desktop-mode-pages) .os-posts-desk__story::before{content:'';position:absolute;inset-block:0;inset-inline-start:22px;border-inline-start:1px solid var( --os-ui-accent-dim,#c3c4c7 );opacity:.3}.desktop-mode-pages .os-posts-desk__story{position:relative;border-radius:3px 22px 3px 3px;box-shadow:3px 4px 0 -1px var( --os-ui-surface,#fff ),3px 4px 0 0 var( --os-ui-border,#dcdcde )}.desktop-mode-pages .os-posts-desk__story::after{content:'';position:absolute;inset-block-start:0;inset-inline-end:0;inline-size:16px;block-size:16px;border-end-start-radius:3px;border-inline-start:1px solid var( --os-ui-border,#dcdcde );border-block-end:1px solid var( --os-ui-border,#dcdcde );background:var( --os-ui-surface-sunken,#f6f7f7 );pointer-events:none}.desktop-mode-pages .os-posts-desk__select{margin-inline-end:6px}.os-pages-atlas-host{flex:1;min-block-size:0;display:flex;position:relative}@container content-desk (max-width:600px){.os-posts-desk__hero{padding:8px 12px;min-block-size:36px;gap:8px}.os-posts-desk__hero h2{font-size:17px;margin:0;letter-spacing:-.03em}.os-posts-desk__hero p,.os-posts-desk__eyebrow{display:none}.desktop-mode-posts .os-app-list__toolbar{display:none}.desktop-mode-posts[data-desk-options="true"] .os-app-list__toolbar{display:flex;padding:6px 12px}.os-posts-desk__tools{padding:6px 12px;gap:8px}.os-posts-desk__tools .os-app-list__search{flex:1;min-inline-size:0}.os-posts-desk__filter-toggle{display:block;flex:0 0 auto}.os-posts-desk__tools:not(.is-expanded)>os-select,.os-posts-desk__tools:not(.is-expanded)>os-checkbox{display:none}.os-posts-desk__tools.is-expanded>os-checkbox{flex-basis:100%}.os-posts-desk__feed,.desktop-mode-pages .os-posts-desk__feed{display:block;padding:8px 12px 14px}.os-posts-desk__story,.desktop-mode-pages .os-posts-desk__story,.os-posts-desk__story.is-current{padding:9px 12px;margin-block-end:9px}.desktop-mode-posts:not(.desktop-mode-pages) .os-posts-desk__story{padding-inline-start:24px}.desktop-mode-posts:not(.desktop-mode-pages) .os-posts-desk__story::before{inset-inline-start:14px}.os-posts-desk__story-top{margin-block-end:3px;min-block-size:18px}.os-posts-desk__story-content,.desktop-mode-pages .os-posts-desk__story-content{flex-direction:row;gap:10px}.os-posts-desk__page-mark,.os-posts-desk__kicker{display:none}.os-posts-desk__story h3,.desktop-mode-pages .os-posts-desk__story h3{font-size:18px;margin-block-end:2px;line-height:1.2}.os-posts-desk__thumbnail{inline-size:46px;block-size:46px}.os-posts-desk__excerpt{-webkit-line-clamp:1;line-clamp:1;font-size:11px;line-height:1.4}.desktop-mode-pages .os-posts-desk__excerpt{display:none}.os-posts-desk__metrics{gap:14px;margin-block-start:7px;--os-ui-stat-value-size:14px}.os-posts-desk__metrics os-stat{min-inline-size:0;flex-direction:row;align-items:baseline}.os-posts-desk__metrics os-stat::part(value),.os-posts-desk__metrics os-stat::part(label){display:inline}.os-posts-desk__metrics os-stat::part(label){font-size:9px;margin-inline-start:4px;letter-spacing:0;text-transform:none}.os-posts-desk__story-foot{margin-block-start:4px;gap:4px;flex-wrap:nowrap}.desktop-mode-pages .os-posts-desk__story-foot>.os-posts-desk__byline,.os-posts-desk__story-foot>.os-posts-desk__byline{flex:1;margin:0;font-size:10px;min-inline-size:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.os-posts-desk__story-foot os-button{--os-ui-button-padding:5px 9px;font-size:11px}.desktop-mode-posts .os-app-list__pager{padding:6px 12px;gap:4px;flex-wrap:nowrap}.desktop-mode-posts .os-app-list__pager-meta{font-size:10px;flex:1}.desktop-mode-posts .os-app-list__pager-perpage{display:none}.desktop-mode-posts .os-app-list__pager-nav{flex:0 0 auto}.desktop-mode-posts .os-app-list__pager-nav os-button{font-size:10px}}`,Zt=P` .desktop-mode-posts{container:content-desk / inline-size;color:var( --os-ui-fg,#1d2327 );background:var( --os-ui-surface-sunken,#f6f7f7 )}.desktop-mode-posts [hidden]{display:none !important}.os-posts-desk__hero{display:flex;align-items:center;justify-content:space-between;gap:20px;padding:24px 26px 20px;background:var( --os-ui-surface,#fff )}.os-posts-desk__eyebrow,.os-posts-desk__inspector-head{font-size:10px;font-weight:600;letter-spacing:0.14em;color:var( --os-ui-fg-muted,#646970 )}.os-posts-desk__hero h2{margin:7px 0;font-size:clamp( 24px,3.4cqi,38px );font-weight:500;letter-spacing:-0.045em;line-height:1.1;color:inherit}.os-posts-desk__hero p{margin:0;font-size:12px;color:var( --os-ui-fg-muted,#646970 )}.os-posts-desk__hero>os-button{flex-shrink:0}.desktop-mode-posts .os-app-list__toolbar{padding:12px 24px;background:var( --os-ui-surface,#fff );flex-wrap:wrap}.desktop-mode-posts .os-app-list__toolbar-left{flex-wrap:wrap;min-inline-size:0}.desktop-mode-posts .os-app-list__search{min-inline-size:150px;flex:1 1 190px}.os-posts-desk__tools{display:flex;align-items:center;gap:10px;padding:9px 24px;border-block-end:1px solid var( --os-ui-border,#dcdcde );background:var( --os-ui-surface,#fff );flex-shrink:0}.os-posts-desk__tools>os-checkbox{margin-inline-end:auto;font-size:11px}.os-posts-desk__tools os-select{inline-size:155px}.os-posts-desk__workspace{display:flex;flex:1;min-block-size:0;min-inline-size:0;overflow:hidden}.os-posts-desk__feed{flex:1;min-inline-size:0;overflow:auto;overscroll-behavior:contain;scrollbar-gutter:stable;padding:20px 24px 32px}.os-posts-desk__story{padding:20px;border:1px solid var( --os-ui-border,#dcdcde );border-radius:12px;background:var( --os-ui-surface,#fff );margin-block-end:12px;min-inline-size:0;transition:border-color 140ms ease,box-shadow 140ms ease}.os-posts-desk__story:hover{border-color:var( --os-ui-accent-dim,#2271b1 )}.os-posts-desk__story.is-current{border-inline-start:3px solid var( --os-ui-accent,#2271b1 );padding-inline-start:18px}.os-posts-desk__story-top{display:flex;align-items:center;gap:8px;margin-block-end:13px;min-block-size:22px}.os-posts-desk__id{margin-inline-start:auto;flex:0 0 auto;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;font-size:11px;font-variant-numeric:tabular-nums;--os-ui-button-padding:3px 5px}.os-posts-desk__id::part(button){color:var( --os-ui-fg-muted,#646970 );gap:5px;min-block-size:24px}.os-posts-desk__id .dashicons{font-size:12px;inline-size:12px;block-size:12px}.os-posts-desk__id + .os-posts-desk__select{margin-inline-start:0}.os-posts-desk__select{margin-inline-start:auto;flex:0 0 20px;inline-size:20px;block-size:20px}.os-posts-desk__status,.os-posts-desk__role{display:inline-flex;align-items:center;gap:6px;font-size:10px;font-weight:600;line-height:1.6;color:var( --os-ui-fg-muted,#646970 )}.os-posts-desk__status::before{content:"";inline-size:6px;block-size:6px;border-radius:50%;background:currentColor}.os-posts-desk__status[data-status="publish"]{color:var( --os-ui-success-fg,#008a20 )}.os-posts-desk__status[data-status="draft"],.os-posts-desk__status[data-status="pending"]{color:var( --os-ui-warning,#996800 )}.os-posts-desk__status[data-status="future"],.os-posts-desk__role{color:var( --os-ui-accent,#2271b1 )}.os-posts-desk__role{border-inline-start:1px solid var( --os-ui-border,#dcdcde );padding-inline-start:8px}.os-posts-desk__story-content{display:flex;gap:18px;align-items:flex-start}.os-posts-desk__story-copy{min-inline-size:0;flex:1}.os-posts-desk__thumbnail{inline-size:104px;block-size:104px;object-fit:cover;border-radius:7px;flex:0 0 auto}.os-posts-desk__kicker{font-size:10px;letter-spacing:0.06em;color:var( --os-ui-fg-muted,#646970 );margin-block-end:5px;overflow-wrap:anywhere}.os-posts-desk__story h3{font-family:Georgia,"Times New Roman",serif;font-size:23px;font-weight:400;line-height:1.18;letter-spacing:-0.025em;margin:0 0 8px;color:inherit;overflow-wrap:anywhere}.os-posts-desk__story h3 a{color:inherit;text-decoration:none}.os-posts-desk__story h3 a:hover{text-decoration:underline;text-underline-offset:3px}.os-posts-desk__excerpt{font-size:12px;line-height:1.65;margin:0;color:var( --os-ui-fg-muted,#646970 );display:-webkit-box;-webkit-line-clamp:2;line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;overflow-wrap:anywhere}.os-posts-desk__story-foot{display:flex;align-items:center;flex-wrap:wrap;gap:6px;margin-block-start:16px}.os-posts-desk__byline{font-size:11px;line-height:1.5;color:var( --os-ui-fg-muted,#646970 );margin-inline-end:auto;overflow-wrap:anywhere}.os-posts-desk__story-foot>.os-posts-desk__byline{flex:1 1 100px}.os-posts-desk__lock{font-size:11px;color:var( --os-ui-warning,#996800 )}.os-posts-desk__inspector{flex:0 0 330px;max-inline-size:40%;min-inline-size:0;display:flex;flex-direction:column;border-inline-start:1px solid var( --os-ui-border,#dcdcde );background:var( --os-ui-surface,#fff )}.os-posts-desk__inspector-head{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:12px 18px;border-block-end:1px solid var( --os-ui-border,#dcdcde )}.os-posts-desk__inspector-head os-button{letter-spacing:normal}.os-posts-desk__inspector-scroll{flex:1;min-block-size:0;overflow:auto;padding:20px;overscroll-behavior:contain}.os-posts-desk__cover{inline-size:100%;max-block-size:180px;object-fit:cover;border-radius:8px;margin-block-end:20px}.os-posts-desk__inspector h2{font-family:Georgia,"Times New Roman",serif;font-size:27px;font-weight:400;line-height:1.2;letter-spacing:-0.03em;margin:10px 0;color:inherit;overflow-wrap:anywhere}.os-posts-desk__preview{font-size:13px;line-height:1.8;color:var( --os-ui-fg-muted,#646970 );overflow-wrap:anywhere}.os-posts-desk__dates{padding-block:16px;border-block:1px solid var( --os-ui-border,#dcdcde );font-size:11px}.os-posts-desk__dates>div{display:flex;justify-content:space-between;gap:10px;margin-block:4px}.os-posts-desk__dates dt{color:var( --os-ui-fg-muted,#646970 )}.os-posts-desk__dates dd{margin:0}.os-posts-desk__fields section{padding-block:8px;font-size:12px;overflow-wrap:anywhere}.os-posts-desk__fields h3{font-size:11px;font-weight:600;margin:0 0 8px;color:var( --os-ui-fg-muted,#646970 )}.os-posts-desk__inspector-actions{display:flex;align-items:center;flex-wrap:wrap;gap:12px;padding:16px 20px;border-block-start:1px solid var( --os-ui-border,#dcdcde );font-size:11px}.os-posts-desk__inspector-actions a{color:var( --os-ui-accent,#2271b1 )}.os-posts-desk__empty{padding:48px 20px;text-align:center;color:var( --os-ui-fg-muted,#646970 )}.os-posts-desk__empty>.dashicons{font-size:40px;inline-size:40px;block-size:40px}.desktop-mode-posts .os-app-list__bulk--footer{padding:10px 24px}.desktop-mode-posts .os-app-list__bulk--footer .os-app-list__count,.desktop-mode-posts .os-app-list__bulk--footer .os-app-list__bulk-actions{flex:0 1 auto}.desktop-mode-pages .os-posts-desk__feed{display:grid;grid-template-columns:repeat( auto-fill,minmax( 230px,1fr ) );align-content:start;gap:16px}.desktop-mode-pages .os-posts-desk__story{margin:0;display:flex;flex-direction:column}.desktop-mode-pages .os-posts-desk__story-content{flex-direction:column;flex:1}.desktop-mode-pages .os-posts-desk__story h3,.desktop-mode-pages .os-posts-desk__inspector h2{font-family:inherit;font-weight:600;font-size:21px}.os-posts-desk__page-mark{border:1px solid var( --os-ui-border,#dcdcde );border-radius:5px;inline-size:42px;block-size:50px;padding:8px;color:var( --os-ui-accent,#2271b1 );background:var( --os-ui-surface-sunken,#f6f7f7 )}.os-posts-desk__page-mark i{display:block;block-size:2px;margin-block-start:4px;background:var( --os-ui-border,#dcdcde )}.os-posts-desk__page-mark i:last-child{inline-size:60%}@container content-desk (max-width:850px){.os-posts-desk__inspector{display:none}.os-posts-desk__inspector.is-open{display:flex;flex:1;max-inline-size:none;border-inline-start:0}.os-posts-desk__workspace.has-detail .os-posts-desk__feed{display:none}.os-posts-desk__hero{padding:20px}}@container content-desk (max-width:540px){.os-posts-desk__hero{padding:16px;gap:12px}.os-posts-desk__hero p,.os-posts-desk__eyebrow{display:none}.os-posts-desk__hero h2{font-size:23px}.desktop-mode-posts .os-app-list__toolbar,.os-posts-desk__tools{padding:8px 12px}.os-posts-desk__tools{flex-wrap:wrap}.os-posts-desk__tools>os-checkbox{flex-basis:100%}.os-posts-desk__tools os-select{flex:1;inline-size:130px}.os-posts-desk__feed{padding:12px}.os-posts-desk__story{padding:16px}.os-posts-desk__story.is-current{padding-inline-start:14px}.os-posts-desk__thumbnail{inline-size:64px;block-size:64px}.os-posts-desk__story h3{font-size:21px}}@media (prefers-reduced-motion:reduce){.os-posts-desk__story{transition:none}}.os-posts-desk__tools .os-app-list__search{flex:1 1 170px;min-inline-size:130px}.os-posts-desk__tools>os-checkbox{flex-shrink:0}@container content-desk (max-width:700px){.os-posts-desk__tools{flex-wrap:wrap}.os-posts-desk__tools .os-app-list__search{flex-basis:calc( 100% - 145px )}.os-posts-desk__tools>os-checkbox{flex-basis:auto}.os-posts-desk__tools os-select{flex:1 1 130px;min-inline-size:130px}}.desktop-mode-pages .os-posts-desk__story-foot>.os-posts-desk__byline{flex-basis:100%;margin-block-end:4px}html[data-os-mode="mobile"] .desktop-mode-posts .os-app-list__toolbar-left{flex:1 1 140px}html[data-os-mode="mobile"] .desktop-mode-posts .os-app-list__toolbar-trailing{flex:0 0 auto}`,ci=P` ${fe} ${Xe}:host{display:inline-flex;align-items:center;gap:6px;font-size:13px;color:var( --os-ui-fg,#1d2327 );cursor:pointer}:host( [ disabled ] ){cursor:not-allowed;opacity:0.55}:host( [ block ] ){display:flex;cursor:default}:host( [ block ] ) label{cursor:pointer}:host( [ block ][ disabled ] ) label{cursor:not-allowed}label{display:inline-flex;align-items:center;gap:6px;cursor:inherit}.os-checkbox__label{line-height:1.3}.os-checkbox__label:empty{display:none}`,Ce=class Ce extends q{render(){const e=this.checked!==null,t=this.disabled!==null,s=this.label||"",i=this.value;return b`
472 + `}_readOptions(){const e=[],t=this.querySelectorAll(":scope > os-option");for(const o of Array.from(t)){const i=o.getAttribute("value");i!==null&&e.push({value:i,label:(o.textContent||i).trim(),disabled:o.hasAttribute("disabled")})}return e}_readValues(){return(this.value??"").split(",").map(t=>t.trim()).filter(t=>t!=="")}_writeValueAttribute(e){const t=e.join(",");this.value=t}_summarize(e){const t=this._readValues();if(t.length===0)return e;const o=this._readOptions(),i=new Map(o.map(a=>[a.value,a.label]));return t.length===1?i.get(t[0])??t[0]:`${t.length} selected`}_isOpen(){return this.open!==null}_onTriggerClick(e){e.stopPropagation(),e.preventDefault(),this.disabled===null&&(this._popover?this._closePopover():this._openPopover())}_openPopover(){if(this._popover)return;const e=document.createElement("div");e.className="os-multiselect__popover",e.setAttribute("role","listbox"),e.setAttribute("aria-multiselectable","true"),e.style.setProperty("--wp-admin-theme-color",getComputedStyle(this).getPropertyValue("--wp-admin-theme-color")||"#2271b1"),document.body.appendChild(e),this._popover=e,this._refreshPopover(),this._placePopover();const t=n=>{const r=n.target;if(!r)return;const l=this.shadowRoot?.querySelector(".os-multiselect__trigger");e.contains(r)||l&&l.contains(r)||this._closePopover()},o=n=>{n.key==="Escape"&&(n.stopPropagation(),this._closePopover(),this.shadowRoot?.querySelector(".os-multiselect__trigger")?.focus())},i=()=>this._placePopover(),a=()=>{if(!this._hasMore||this._loadingMore)return;const n=e.scrollHeight,r=e.clientHeight,l=e.scrollTop;n-(l+r)<64&&this.emit("os-multiselect-load-more",{})};setTimeout(()=>{document.addEventListener("pointerdown",t,!0)},0),document.addEventListener("keydown",o,!0),window.addEventListener("resize",i),window.addEventListener("scroll",i,!0),e.addEventListener("scroll",a),this._teardownOpen=()=>{document.removeEventListener("pointerdown",t,!0),document.removeEventListener("keydown",o,!0),window.removeEventListener("resize",i),window.removeEventListener("scroll",i,!0),e.removeEventListener("scroll",a)},this.setAttribute("open",""),this.requestUpdate(),this.emit("os-multiselect-open",{})}_closePopover(){this._teardownOpen&&(this._teardownOpen(),this._teardownOpen=null),this._popover&&(this._popover.remove(),this._popover=null,this.removeAttribute("open"),this.requestUpdate(),this.emit("os-multiselect-close",{}))}_refreshPopover(){const e=this._popover;if(!e)return;const t=this._readOptions(),o=new Set(this._readValues());if(e.replaceChildren(),t.length===0){const i=document.createElement("div");i.className="os-multiselect__empty",i.textContent="No options",e.appendChild(i);return}if(o.size>0){const i=document.createElement("button");i.type="button",i.className="os-multiselect__clear",i.textContent="Clear",i.addEventListener("click",a=>{a.preventDefault(),a.stopPropagation(),this._writeValueAttribute([]),this.requestUpdate(),this._refreshPopover(),this._emitPick()}),e.appendChild(i)}for(const i of t){const a=document.createElement("label");a.className="os-multiselect__option",a.setAttribute("role","option"),a.setAttribute("aria-selected",o.has(i.value)?"true":"false"),i.disabled&&(a.setAttribute("aria-disabled","true"),a.dataset.disabled="true");const n=document.createElement("input");n.type="checkbox",n.checked=o.has(i.value),n.disabled=i.disabled,n.addEventListener("change",()=>{const l=new Set(this._readValues());n.checked?l.add(i.value):l.delete(i.value);const c=t.map(d=>d.value).filter(d=>l.has(d));this._writeValueAttribute(c),a.setAttribute("aria-selected",n.checked?"true":"false"),this.requestUpdate(),this._refreshPopover(),this._emitPick()});const r=document.createElement("span");r.textContent=i.label,a.appendChild(n),a.appendChild(r),e.appendChild(a)}if(this._loadingMore){const i=document.createElement("div");i.className="os-multiselect__loading";const a=document.createElement("span");a.className="os-multiselect__spinner",a.setAttribute("aria-hidden","true");const n=document.createElement("span");n.textContent="Loading…",i.appendChild(a),i.appendChild(n),e.appendChild(i)}}_placePopover(){const e=this._popover,t=this.shadowRoot?.querySelector(".os-multiselect__trigger");if(!e||!t)return;const o=t.getBoundingClientRect(),i=window.innerWidth,a=window.innerHeight,n=Math.max(o.width,200);e.style.minWidth=`${n}px`;let r=o.left;r+n>i-8&&(r=Math.max(8,i-n-8)),e.style.left=`${r}px`,e.style.top=`${o.bottom+4}px`;const l=e.offsetHeight||200;o.bottom+4+l>a-8&&(e.style.top=`${Math.max(8,o.top-l-4)}px`)}_emitPick(){const e=this._readValues();this.emit("os-pick",{value:e.join(","),values:e})}};$e.props=["value","label","placeholder","disabled","name","open"],$e.styles=[Qo],$e.help=void 0;let at=$e;W("os-multiselect",at);const ti="openstation.postsWindow.columns",si="openstation.postsWindow.statusSegments",oi="openstation.postsWindow.bulkActions",ii="openstation.postsWindow.toolbarTrailing",ni="openstation.postsWindow.opened",ai="openstation.postsWindow.dataLoaded",rt="[openstation:desktop-mode-posts]",Jt=new Set(["title"]),ri=new Set(["title","author","parent","date"]);function Qt(s){try{const e=window.wp?.os;if(e&&typeof e.getOsSettings=="function"){const o=e.getOsSettings()[s];if(Array.isArray(o))return new Set(o.filter(i=>typeof i=="string"))}}catch{}return new Set}const lt={authors:[],tags:[]};function es(s,e,t,o){const i="osPostsFilterMounted",a=s,n=t.map(c=>({value:String(c.id),label:c.name})),r=n.map(c=>`${c.value}:${c.label}`).join("|");if(a[i]){const c=a[i];c.listSig!==r&&(c.picker.items=n,c.listSig=r),c.picker.getAttribute("value")!==e.value&&c.picker.setAttribute("value",e.value),c.picker.hasMore=!!o.hasMore;return}const l=document.createElement("os-multiselect");if(l.setAttribute("placeholder",o.label),l.setAttribute("aria-label",o.ariaLabel),l.setAttribute("data-noclick",""),l.setAttribute("value",e.value),o.dataKey&&l.setAttribute("data-key",o.dataKey),s.appendChild(l),l.items=n,l.hasMore=!!o.hasMore,l.addEventListener("os-pick",c=>{const d=c.detail?.value??"";e.value=d,e.setValue(d)}),o.onLoadMore){const c=o.onLoadMore;l.addEventListener("os-multiselect-load-more",()=>{l.loadingMore=!0,c()})}a[i]={picker:l,listSig:r}}function ts(s,e,t){const o={key:"title",label:u("Title"),sortable:!0,sticky:!0,render:(c,d)=>X(e,d.id,"title",()=>mo(d,s))},i={key:"author",label:u("Author"),sortable:!0,width:"180px",filterRender:(c,d)=>es(c,d,t.authors,{label:u("All authors"),ariaLabel:u("Filter by author")}),render:(c,d)=>X(e,d.id,"author",()=>bo(d))},a={key:"date",label:u("Date"),sortable:!0,width:"170px",sortValue:c=>Date.parse(c.date_gmt+"Z")||0,render:(c,d)=>X(e,d.id,"date",()=>_o(d))};if(s.extra.mode==="pages")return[o,i,{key:"parent",label:u("Parent"),width:"200px",render:(c,d)=>X(e,d.id,"parent",()=>Wo(d,s))},{key:"template",label:u("Template"),width:"180px",render:(c,d)=>X(e,d.id,"template",()=>jo(d,s))},{key:"slug",label:u("Slug"),width:"200px",render:(c,d)=>X(e,d.id,"slug",()=>Ko(d,s))},{key:"comments",label:u("Comments"),width:"110px",sortValue:c=>typeof c.openstation_comment_count=="number"?c.openstation_comment_count:0,render:(c,d)=>X(e,d.id,"comments",()=>Bo(d))},a];const n=[o,i],{categories:r,tags:l}=s.cells;return r&&n.push({key:"categories",label:u("Categories"),width:"260px",render:(c,d)=>X(e,d.id,"categories",()=>r(d,s))}),l&&n.push({key:"tags",label:u("Tags"),minWidth:"360px",filterRender:(c,d)=>es(c,d,t.tags.map(p=>({id:p.id,name:p.name})),{label:u("All tags"),ariaLabel:u("Filter by tag"),dataKey:"tags",hasMore:!!t.tagsHasMore,onLoadMore:t.loadMoreTags}),render:(c,d)=>X(e,d.id,"tags",()=>l(d,s))}),n.push(a),n}function ss(s,e,t=lt){const o=ts(s,e,t),i=window.wp?.hooks;return i&&typeof i.applyFilters=="function"?i.applyFilters(ti,o):o}function li(s,e=lt,t=new Set){const o=new Set(ts(s,new Map,e).map(i=>i.key));return ct(s,new Map,e,!1,t).filter(i=>!o.has(i.key))}function ci(s){return ss(s,new Map).filter(e=>!Jt.has(e.key)).map(e=>({key:e.key,label:e.label||e.key}))}function ct(s,e,t=lt,o=!1,i=new Set){const a=ss(s,e,t),n=i.size===0?a:a.filter(r=>Jt.has(r.key)||!i.has(r.key));return o?n.filter(r=>ri.has(r.key)):n}function di(){return[{value:"",label:u("All")},{value:"publish",label:u("Published")},{value:"draft",label:u("Drafts")},{value:"pending",label:u("Pending")},{value:"future",label:u("Scheduled")},{value:"trash",label:u("Trash")}]}function pi(){const s=window.wp?.hooks,e=di();if(!s||typeof s.applyFilters!="function")return e;try{const t=s.applyFilters(si,e);return Array.isArray(t)&&t.length>0?t:e}catch(t){return console.error(`${rt} status-segments filter threw; falling back to defaults:`,t),e}}function ui(s,e){return[{id:"trash",label:u("Move to trash"),icon:"dashicons-trash",variant:"danger",confirm:t=>H(s==="pages"?Fe("Move %d page to the trash?","Move %d pages to the trash?",t):Fe("Move %d post to the trash?","Move %d posts to the trash?",t),t),run:async(t,o)=>{const i=o.table.data??[],a=t.filter(n=>{const r=i.find(l=>l.id===n);return r&&r.status!=="trash"});return a.length>0&&await e(a),o.table.clearSelection(),!1}}]}function hi(s){const e=window.wp?.hooks;if(!e||typeof e.applyFilters!="function")return s;try{const t=e.applyFilters(oi,s);return Array.isArray(t)?t:s}catch(t){return console.error(`${rt} bulk-actions filter threw; falling back to defaults:`,t),s}}function fi(s){const e=window.wp?.hooks;if(!e||typeof e.applyFilters!="function")return[];try{const t=e.applyFilters(ii,[],s);return Array.isArray(t)?t.filter(o=>o instanceof HTMLElement):[]}catch(t){return console.error(`${rt} toolbar-trailing filter threw; ignoring:`,t),[]}}function gi(s,e="date"){switch(s){case"title":case"author":case"date":case"modified":return s;case"comments":return"comment_count";default:return e}}function mi(s){return s==="comment_count"?"comments":s}function Re(s,e,t){const o=window.wp?.os;o&&typeof o.broadcast=="function"&&o.broadcast("os.term.changed",{source:"posts-window",taxonomy:s,action:e,id:t})}function oe(s){const e=new URLSearchParams;for(const[o,i]of Object.entries(s))i!==void 0&&i!==""&&e.set(o,String(i));const t=e.toString();return t?`?${t}`:""}function bi(s){const e=async(n,r={})=>{const l=await s(n,{...r,headers:{...r.body?{"Content-Type":"application/json"}:{},...r.headers??{}}});if(!l.ok){let d=`${l.status} ${l.statusText}`;try{const p=await l.json();p&&typeof p.message=="string"&&(d=p.message)}catch{}throw new Error(d)}return{data:r.expectJson===!1?null:await l.json(),headers:l.headers}},t=async(n,r)=>{const l={per_page:20,_fields:"id,name,slug,count",orderby:"count",order:"desc"};n&&(l.search=n,l.orderby="name",l.order="asc");const{data:c}=await e(`wp/v2/tags${oe(l)}`,{method:"GET",signal:r});return Array.isArray(c)?c:[]},o=async n=>{const{data:r}=await e(`wp/v2/categories${oe({per_page:100,_fields:"id,name,slug,parent",orderby:"name",order:"asc"})}`,{method:"GET",signal:n});return Array.isArray(r)?r:[]},i=(n,r=0)=>{const l=n.openstation_count;return{id:n.id??r,name:n.name??"",slug:n.slug??"",parent:n.parent??0,count:typeof l=="number"?l:n.count??0,description:n.description??"",isDefault:n.openstation_is_default===!0}},a=async(n,r={})=>{const{data:l,headers:c}=await e(`wp/v2/${n}${oe({per_page:r.perPage??50,page:r.page??1,_fields:"id,name,slug,parent,count,description,openstation_is_default",orderby:r.orderby??"name",order:r.order??"asc",search:r.search,parent:typeof r.parent=="number"&&r.parent>=0?r.parent:void 0})}`,{method:"GET"});return{items:Array.isArray(l)?l.map(d=>i(d)):[],total:parseInt(c.get("X-WP-Total")??"0",10)||0,totalPages:parseInt(c.get("X-WP-TotalPages")??"0",10)||0}};return{searchTags:t,fetchAllCategories:o,async createTag(n){try{const{data:r}=await e("wp/v2/tags",{method:"POST",body:JSON.stringify({name:n})});return Re("post_tag","created",r.id),r}catch(r){const l=r instanceof Error?r.message:String(r);if(/term[\s_]?exists/i.test(l)){const c=(await t(n)).find(d=>d.name.toLowerCase()===n.toLowerCase());if(c)return c}throw r}},async updatePostTags(n,r){const{data:l}=await e(`wp/v2/posts/${n}`,{method:"POST",body:JSON.stringify({tags:r})});return l},async fetchAuthorOptions(n){try{const{data:r}=await e(`wp/v2/users${oe({per_page:100,who:"authors",_fields:"id,name",orderby:"name",order:"asc"})}`,{method:"GET",signal:n});return Array.isArray(r)?r.map(l=>({...l,name:ae(l.name)})):[]}catch{return[]}},async fetchTagOptions(n=1,r=50,l){try{const{data:c,headers:d}=await e(`wp/v2/tags${oe({per_page:Math.max(1,r),page:Math.max(1,n),_fields:"id,name,count",orderby:"count",order:"desc"})}`,{method:"GET",signal:l});return{items:Array.isArray(c)?c:[],totalPages:parseInt(d.get("X-WP-TotalPages")??"0",10)||0}}catch{return{items:[],totalPages:0}}},async createCategory(n,r=0,l={}){const c={name:n,parent:r};l.slug&&(c.slug=l.slug),l.description&&(c.description=l.description);try{const{data:d}=await e("wp/v2/categories",{method:"POST",body:JSON.stringify(c)});return Re("category","created",d.id),d}catch(d){const p=d instanceof Error?d.message:String(d);if(/term[\s_]?exists/i.test(p)){const g=(await o()).find(v=>v.name.toLowerCase()===n.toLowerCase()&&v.parent===r);if(g)return g}throw d}},async updatePostCategories(n,r){const{data:l}=await e(`wp/v2/posts/${n}`,{method:"POST",body:JSON.stringify({categories:r})});return l},fetchTerms:a,async fetchAllTerms(n){const r=[];let l=1;for(;l<=5;){const c=await a(n,{page:l,perPage:100});if(r.push(...c.items),l>=c.totalPages)break;l++}return r},async fetchTagCooccurrence(n="tags",r=8){const{data:l}=await e(`desktop-mode/v1/tag-cooccurrence${oe({taxonomy:n==="tags"?"post_tag":"category",limit:r})}`,{method:"GET"}),c=new Map,d=l&&typeof l=="object"&&!Array.isArray(l)?l.pairs:void 0;if(!d)return c;for(const[p,g]of Object.entries(d)){const v=parseInt(p,10);if(!Number.isFinite(v)||v<=0)continue;const _=[];for(const x of g){const h=Number(x?.id),f=Number(x?.shared);Number.isFinite(h)&&h>0&&Number.isFinite(f)&&f>0&&_.push({id:h,shared:f})}_.length>0&&c.set(v,_)}return c},async updateTerm(n,r,l){const{data:c}=await e(`wp/v2/${n}/${r}`,{method:"POST",body:JSON.stringify(l)});return Re(n==="categories"?"category":"post_tag","updated",r),i(c,r)},async deleteTerm(n,r){await e(`wp/v2/${n}/${r}?force=true`,{method:"DELETE"}),Re(n==="categories"?"category":"post_tag","deleted",r)},async fetchTermPosts(n,r,l,c){const{data:d,headers:p}=await e(`wp/v2/posts${oe({[n]:r,per_page:c,page:l,status:"any",_fields:"id,title,status"})}`,{method:"GET"}),g=parseInt(p.get("X-WP-Total")??"",10);return{items:(Array.isArray(d)?d:[]).map(v=>({id:v.id,title:v.title?.rendered||`#${v.id}`})),totalPages:Math.max(1,parseInt(p.get("X-WP-TotalPages")??"1",10)||1),total:Number.isFinite(g)?g:-1}},async fetchTermCounts(n,r){const{data:l}=await e(`desktop-mode/v1/term-counts${oe({taxonomy:n,ids:r.join(",")})}`,{method:"GET"});return l&&typeof l=="object"?l:{}}}}const _i="[openstation:desktop-mode-posts]",V=s=>s.root.querySelector("[data-os-posts-table]");function vi(s){return{page:s.page,perPage:s.perPage,search:s.search||void 0,status:s.status||void 0,orderby:s.orderby,order:s.order,author:s.author.length>0?s.author:void 0,tag:s.tag.length>0?s.tag:void 0}}function dt(s,e){if(!e.postsCtx){const t={body:s.root,get table(){return V(s)},refresh:()=>s.dispatch("refresh").then(()=>{}),getSelectedIds:()=>Array.from(V(s)?.selection??[]).map(o=>Number(o)),getSelectedRows:()=>{const o=new Set(t.getSelectedIds());return(V(s)?.data??[]).filter(i=>o.has(i.id))},getCurrentParams:()=>vi(s.state)};e.postsCtx=t}return e.postsCtx}async function xi(s,e,t){const o=t.getSelectedIds();if(o.length===0)return;const{confirm:i}=e;if(i){const a=typeof i=="function"?i(o.length):H(i,o.length);if(!await(s.host.confirm?.({message:a,danger:!0})??Promise.resolve(!1)))return}try{if(await e.run(o,t)===!1)return}catch(a){console.error(`${_i} bulk action "${e.id}" failed`,a)}t.table.clearSelection(),await t.refresh()}function yi(s){const e={items:s.list.items,total:s.list.total,totalPages:s.list.pages,page:s.list.page},t=window.wp?.hooks;t&&typeof t.doAction=="function"&&t.doAction(ai,e),document.dispatchEvent(new CustomEvent("os-posts-window-data-loaded",{detail:e}))}class ki{constructor(){this.items=[],this.pending=!1,this.error=!1,this.key="",this.lastData=null,this.page=0,this.pages=0,this.expected=0,this.disposed=!1,this.ctx=null,this.observer=null,this.sentinel=null,this.generation=0}queryKey(e){return JSON.stringify([e.search,e.status,e.orderby,e.order,e.author,e.tag,e.perPage])}reconcile(e){this.ctx=e;const{state:t,data:o}=e,i=this.queryKey(t);if(i!==this.key&&(this.generation++,this.expected=0,this.key=i,this.items=[],this.page=0,this.pages=0,this.lastData=null,this.error=!1),!e.loading&&o&&o!==this.lastData&&o.list.page===t.page&&(!o.query||this.queryKey(o.query)===i))if(this.lastData=o,o.list.error)this.error=!0;else{if(o.list.page>1&&this.page===0&&o.list.page!==this.expected&&!o.list.replace)return{...e,data:{...o,list:{...o.list,items:this.items}}};const a=o.list.page===1||o.list.replace?o.list.items:[...this.items,...o.list.items];this.items=Array.from(new Map(a.map(n=>[n.id,n])).values()),this.page=o.list.page,this.pages=o.list.pages,this.error=!1}return o?{...e,data:{...o,list:{...o.list,items:this.items}}}:e}get hasMore(){return this.page>0&&this.page<this.pages}async more(){const e=this.ctx;if(!e||this.disposed||this.pending||e.loading||!this.hasMore)return;const t=this.generation;this.pending=!0,this.error=!1,this.expected=this.page+1,e.repaint();try{const o=await e.dispatch("page",{page:this.expected});t===this.generation&&(!o||e.data?.list.error)&&(this.error=!0)}catch{t===this.generation&&(this.error=!0)}finally{this.pending=!1,this.expected=0,this.sentinel=null,this.disposed||e.repaint()}}tail(){let e=this.items.length?u("You’re all caught up."):"";return this.pending?e=u("Loading more…"):this.hasMore&&(e=b`<os-button variant="ghost" @click=${()=>void this.more()}>${this.error?u("Could not load more. Retry"):u("Load more")}</os-button>`),b`<div class="os-posts-desk__continuation" data-content-feed-end role="status">${e}</div>`}observe(e){const t=e.querySelector(".os-posts-desk__feed [data-content-feed-end]");t!==this.sentinel&&(this.observer?.disconnect(),this.sentinel=t,!(!t||typeof IntersectionObserver>"u")&&(this.observer=new IntersectionObserver(o=>{o.some(i=>i.isIntersecting)&&!this.error&&this.more()},{root:e.querySelector(".os-posts-desk__feed"),rootMargin:"0px 0px 240px 0px"}),this.observer.observe(t)))}dispose(){this.disposed=!0,this.observer?.disconnect()}}function wi(s){const e=new DOMParser().parseFromString(s,"text/html");e.querySelectorAll("script, style").forEach(i=>i.remove()),e.querySelectorAll("p, div, li, h1, h2, h3, h4, h5, h6, br").forEach(i=>i.append(e.createTextNode(" ")));const t=e.body.textContent||"",o=Intl.Segmenter;return o?Array.from(new o(void 0,{granularity:"word"}).segment(t)).filter(i=>i.isWordLike).length:(t.match(/[\p{L}\p{N}]+/gu)||[]).length}async function $i(s,e,t,o){const i={},a=async(l,c,d,p)=>{try{const g=await s(c,{...d,signal:o},{silent:!0});if(!g.ok)return i[l]=g.status===429||g.status>=500?"retry":"unavailable",null;const v=await p(g);return v===null&&(i[l]="unavailable"),v}catch{return i[l]="retry",null}},[n,r]=await Promise.all([a("words",`wp/v2/${e}/${t}?context=edit&_fields=content`,{},async l=>{const c=await l.json();return typeof c.content?.rendered=="string"&&!c.content.protected?wi(c.content.rendered):null}),a("comments",`wp/v2/comments?post=${t}&status=approve&per_page=1`,{method:"HEAD"},async l=>{const c=l.headers.get("X-WP-Total");return c!==null&&/^\d+$/.test(c)?Number(c):null})]);return Object.keys(i).length?{words:n,comments:r,errors:i}:{words:n,comments:r}}function Ci(s,e,t){const o=new AbortController,i=new Map,a=new Set,n=new Map,r=new Map,l=new Set,c=new WeakMap;let d=0;const p=()=>{for(const x of s.querySelectorAll("[data-content-metrics]")){const h=i.get(x.dataset.contentMetrics||"");if(!h)continue;for(const y of["words","comments"]){const w=x.querySelector(`[data-metric="${y}"]`);w?.setAttribute("value",h[y]===null?"—":h[y].toLocaleString());let k=h.errors?.[y]?u("This count is unavailable or access is restricted."):"";h.errors?.[y]==="retry"&&(k=u("Could not load this count.")),w?.setAttribute("title",k)}const f=x.dataset.contentMetrics||"";let m=x.querySelector("[data-retry-metrics]");Object.values(h.errors||{}).includes("retry")&&(r.get(f)||0)>=3?m||(m=document.createElement("os-button"),m.setAttribute("variant","ghost"),m.setAttribute("data-retry-metrics",""),m.textContent=u("Retry counts"),m.addEventListener("click",()=>{r.delete(f),i.delete(f),m?.remove(),g(f,Number(x.dataset.postId)),v()}),x.append(m)):m?.remove()}},g=(x,h)=>{!a.has(x)&&!o.signal.aborted&&(a.add(x),n.set(x,h))},v=()=>{if(!o.signal.aborted)for(;d<2&&n.size;){const[x,h]=n.entries().next().value;n.delete(x),d++,r.set(x,(r.get(x)||0)+1),$i(e,t,h,o.signal).then(f=>{if(!o.signal.aborted&&(i.set(x,f),p(),Object.values(f.errors||{}).includes("retry")&&r.get(x)<3)){const m=setTimeout(()=>{l.delete(m),g(x,h),v()},500*r.get(x));l.add(m)}}).finally(()=>{a.delete(x),d--,v()})}},_=typeof IntersectionObserver>"u"?null:new IntersectionObserver(x=>{for(const h of x){if(!h.isIntersecting)continue;const f=h.target,m=f.dataset.contentMetrics||"";i.has(m)||g(m,Number(f.dataset.postId)),_?.unobserve(f)}v()},{root:s.querySelector(".os-posts-desk__feed"),rootMargin:"80px"});return{sync:()=>{p(),s.querySelectorAll("[data-content-metrics]").forEach(x=>{const h=x.getAttribute("data-content-metrics")||"";c.get(x)!==h&&(c.set(x,h),_?.observe(x))})},dispose:()=>{o.abort(),_?.disconnect(),l.forEach(clearTimeout),l.clear(),n.clear(),i.clear()}}}const os=R` .desktop-mode-posts .os-app-list__toolbar-right.os-app-list__bulk--footer{flex:0 0 auto;align-content:start;gap:8px;padding:8px 12px}.os-posts-desk__continuation{grid-column:1 / -1;padding:14px 8px;text-align:center;font-size:11px;color:var( --os-ui-fg-muted,#646970 )}.os-posts-desk__filter-toggle{display:none}.os-posts-desk__metrics{display:flex;gap:22px;margin-block:18px 0;--os-ui-stat-padding:0;--os-ui-stat-border:transparent;--os-ui-stat-value-size:24px;--os-ui-stat-value-color:var( --os-ui-fg,#1d2327 )}.os-posts-desk__metrics os-stat{min-inline-size:62px}.desktop-mode-posts:not(.desktop-mode-pages) .os-posts-desk__story{position:relative;border-radius:3px 12px 12px 3px;padding-inline-start:34px;background-image:repeating-linear-gradient(transparent 0 27px,var( --os-ui-surface-subtle,#f0f0f1 ) 27px 28px);background-position:0 10px}.desktop-mode-posts:not(.desktop-mode-pages) .os-posts-desk__story::before{content:'';position:absolute;inset-block:0;inset-inline-start:22px;border-inline-start:1px solid var( --os-ui-accent-dim,#c3c4c7 );opacity:.3}.desktop-mode-pages .os-posts-desk__story{position:relative;border-radius:3px 22px 3px 3px;box-shadow:3px 4px 0 -1px var( --os-ui-surface,#fff ),3px 4px 0 0 var( --os-ui-border,#dcdcde )}.desktop-mode-pages .os-posts-desk__story::after{content:'';position:absolute;inset-block-start:0;inset-inline-end:0;inline-size:16px;block-size:16px;border-end-start-radius:3px;border-inline-start:1px solid var( --os-ui-border,#dcdcde );border-block-end:1px solid var( --os-ui-border,#dcdcde );background:var( --os-ui-surface-sunken,#f6f7f7 );pointer-events:none}.desktop-mode-pages .os-posts-desk__select{margin-inline-end:6px}.os-pages-atlas-host{flex:1;min-block-size:0;display:flex;position:relative}@container content-desk (max-width:600px){.os-posts-desk__hero{padding:8px 12px;min-block-size:36px;gap:8px}.os-posts-desk__hero h2{font-size:17px;margin:0;letter-spacing:-.03em}.os-posts-desk__hero p,.os-posts-desk__eyebrow{display:none}.desktop-mode-posts .os-app-list__toolbar{display:none}.desktop-mode-posts[data-desk-options="true"] .os-app-list__toolbar{display:flex;padding:6px 12px}.os-posts-desk__tools{padding:6px 12px;gap:8px}.os-posts-desk__tools .os-app-list__search{flex:1;min-inline-size:0}.os-posts-desk__filter-toggle{display:block;flex:0 0 auto}.os-posts-desk__tools:not(.is-expanded)>os-select,.os-posts-desk__tools:not(.is-expanded)>os-checkbox{display:none}.os-posts-desk__tools.is-expanded>os-checkbox{flex-basis:100%}.os-posts-desk__feed,.desktop-mode-pages .os-posts-desk__feed{display:block;padding:8px 12px 14px}.os-posts-desk__story,.desktop-mode-pages .os-posts-desk__story,.os-posts-desk__story.is-current{padding:9px 12px;margin-block-end:9px}.desktop-mode-posts:not(.desktop-mode-pages) .os-posts-desk__story{padding-inline-start:24px}.desktop-mode-posts:not(.desktop-mode-pages) .os-posts-desk__story::before{inset-inline-start:14px}.os-posts-desk__story-top{margin-block-end:3px;min-block-size:18px}.os-posts-desk__story-content,.desktop-mode-pages .os-posts-desk__story-content{flex-direction:row;gap:10px}.os-posts-desk__page-mark,.os-posts-desk__kicker{display:none}.os-posts-desk__story h3,.desktop-mode-pages .os-posts-desk__story h3{font-size:18px;margin-block-end:2px;line-height:1.2}.os-posts-desk__thumbnail{inline-size:46px;block-size:46px}.os-posts-desk__excerpt{-webkit-line-clamp:1;line-clamp:1;font-size:11px;line-height:1.4}.desktop-mode-pages .os-posts-desk__excerpt{display:none}.os-posts-desk__metrics{gap:14px;margin-block-start:7px;--os-ui-stat-value-size:14px}.os-posts-desk__metrics os-stat{min-inline-size:0;flex-direction:row;align-items:baseline}.os-posts-desk__metrics os-stat::part(value),.os-posts-desk__metrics os-stat::part(label){display:inline}.os-posts-desk__metrics os-stat::part(label){font-size:9px;margin-inline-start:4px;letter-spacing:0;text-transform:none}.os-posts-desk__story-foot{margin-block-start:4px;gap:4px;flex-wrap:nowrap}.desktop-mode-pages .os-posts-desk__story-foot>.os-posts-desk__byline,.os-posts-desk__story-foot>.os-posts-desk__byline{flex:1;margin:0;font-size:10px;min-inline-size:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.os-posts-desk__story-foot os-button{--os-ui-button-padding:5px 9px;font-size:11px}.desktop-mode-posts .os-app-list__pager{padding:6px 12px;gap:4px;flex-wrap:nowrap}.desktop-mode-posts .os-app-list__pager-meta{font-size:10px;flex:1}.desktop-mode-posts .os-app-list__pager-perpage{display:none}.desktop-mode-posts .os-app-list__pager-nav{flex:0 0 auto}.desktop-mode-posts .os-app-list__pager-nav os-button{font-size:10px}}`,is=R` .desktop-mode-posts{container:content-desk / inline-size;color:var( --os-ui-fg,#1d2327 );background:var( --os-ui-surface-sunken,#f6f7f7 )}.desktop-mode-posts [hidden]{display:none !important}.os-posts-desk__hero{display:flex;align-items:center;justify-content:space-between;gap:20px;padding:24px 26px 20px;background:var( --os-ui-surface,#fff )}.os-posts-desk__eyebrow,.os-posts-desk__inspector-head{font-size:10px;font-weight:600;letter-spacing:0.14em;color:var( --os-ui-fg-muted,#646970 )}.os-posts-desk__hero h2{margin:7px 0;font-size:clamp( 24px,3.4cqi,38px );font-weight:500;letter-spacing:-0.045em;line-height:1.1;color:inherit}.os-posts-desk__hero p{margin:0;font-size:12px;color:var( --os-ui-fg-muted,#646970 )}.os-posts-desk__hero>os-button{flex-shrink:0}.desktop-mode-posts .os-app-list__toolbar{padding:12px 24px;background:var( --os-ui-surface,#fff );flex-wrap:wrap}.desktop-mode-posts .os-app-list__toolbar-left{flex-wrap:wrap;min-inline-size:0}.desktop-mode-posts .os-app-list__search{min-inline-size:150px;flex:1 1 190px}.os-posts-desk__tools{display:flex;align-items:center;gap:10px;padding:9px 24px;border-block-end:1px solid var( --os-ui-border,#dcdcde );background:var( --os-ui-surface,#fff );flex-shrink:0}.os-posts-desk__tools>os-checkbox{margin-inline-end:auto;font-size:11px}.os-posts-desk__tools os-select{inline-size:155px}.os-posts-desk__workspace{display:flex;flex:1;min-block-size:0;min-inline-size:0;overflow:hidden}.os-posts-desk__feed{flex:1;min-inline-size:0;overflow:auto;overscroll-behavior:contain;scrollbar-gutter:stable;padding:20px 24px 32px}.os-posts-desk__story{padding:20px;border:1px solid var( --os-ui-border,#dcdcde );border-radius:12px;background:var( --os-ui-surface,#fff );margin-block-end:12px;min-inline-size:0;transition:border-color 140ms ease,box-shadow 140ms ease}.os-posts-desk__story:hover{border-color:var( --os-ui-accent-dim,#2271b1 )}.os-posts-desk__story.is-current{border-inline-start:3px solid var( --os-ui-accent,#2271b1 );padding-inline-start:18px}.os-posts-desk__story-top{display:flex;align-items:center;gap:8px;margin-block-end:13px;min-block-size:22px}.os-posts-desk__id{margin-inline-start:auto;flex:0 0 auto;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;font-size:11px;font-variant-numeric:tabular-nums;--os-ui-button-padding:3px 5px}.os-posts-desk__id::part(button){color:var( --os-ui-fg-muted,#646970 );gap:5px;min-block-size:24px}.os-posts-desk__id .dashicons{font-size:12px;inline-size:12px;block-size:12px}.os-posts-desk__id + .os-posts-desk__select{margin-inline-start:0}.os-posts-desk__select{margin-inline-start:auto;flex:0 0 20px;inline-size:20px;block-size:20px}.os-posts-desk__status,.os-posts-desk__role{display:inline-flex;align-items:center;gap:6px;font-size:10px;font-weight:600;line-height:1.6;color:var( --os-ui-fg-muted,#646970 )}.os-posts-desk__status::before{content:"";inline-size:6px;block-size:6px;border-radius:50%;background:currentColor}.os-posts-desk__status[data-status="publish"]{color:var( --os-ui-success-fg,#008a20 )}.os-posts-desk__status[data-status="draft"],.os-posts-desk__status[data-status="pending"]{color:var( --os-ui-warning,#996800 )}.os-posts-desk__status[data-status="future"],.os-posts-desk__role{color:var( --os-ui-accent,#2271b1 )}.os-posts-desk__role{border-inline-start:1px solid var( --os-ui-border,#dcdcde );padding-inline-start:8px}.os-posts-desk__story-content{display:flex;gap:18px;align-items:flex-start}.os-posts-desk__story-copy{min-inline-size:0;flex:1}.os-posts-desk__thumbnail{inline-size:104px;block-size:104px;object-fit:cover;border-radius:7px;flex:0 0 auto}.os-posts-desk__kicker{font-size:10px;letter-spacing:0.06em;color:var( --os-ui-fg-muted,#646970 );margin-block-end:5px;overflow-wrap:anywhere}.os-posts-desk__story h3{font-family:Georgia,"Times New Roman",serif;font-size:23px;font-weight:400;line-height:1.18;letter-spacing:-0.025em;margin:0 0 8px;color:inherit;overflow-wrap:anywhere}.os-posts-desk__story h3 a{color:inherit;text-decoration:none}.os-posts-desk__story h3 a:hover{text-decoration:underline;text-underline-offset:3px}.os-posts-desk__excerpt{font-size:12px;line-height:1.65;margin:0;color:var( --os-ui-fg-muted,#646970 );display:-webkit-box;-webkit-line-clamp:2;line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;overflow-wrap:anywhere}.os-posts-desk__story-foot{display:flex;align-items:center;flex-wrap:wrap;gap:6px;margin-block-start:16px}.os-posts-desk__byline{font-size:11px;line-height:1.5;color:var( --os-ui-fg-muted,#646970 );margin-inline-end:auto;overflow-wrap:anywhere}.os-posts-desk__story-foot>.os-posts-desk__byline{flex:1 1 100px}.os-posts-desk__plugin-stat{display:flex;flex-direction:column;gap:4px;min-width:0}.os-posts-desk__plugin-stat-value{display:flex;align-items:center;min-height:22px}.os-posts-desk__plugin-stat-label{font-size:10px;line-height:1.2;letter-spacing:0.06em;text-transform:uppercase;color:var( --os-ui-fg-muted,#646970 )}.os-posts-desk__lock{font-size:11px;color:var( --os-ui-warning,#996800 )}.os-posts-desk__inspector{flex:0 0 330px;max-inline-size:40%;min-inline-size:0;display:flex;flex-direction:column;border-inline-start:1px solid var( --os-ui-border,#dcdcde );background:var( --os-ui-surface,#fff )}.os-posts-desk__inspector-head{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:12px 18px;border-block-end:1px solid var( --os-ui-border,#dcdcde )}.os-posts-desk__inspector-head os-button{letter-spacing:normal}.os-posts-desk__inspector-scroll{flex:1;min-block-size:0;overflow:auto;padding:20px;overscroll-behavior:contain}.os-posts-desk__cover{inline-size:100%;max-block-size:180px;object-fit:cover;border-radius:8px;margin-block-end:20px}.os-posts-desk__inspector h2{font-family:Georgia,"Times New Roman",serif;font-size:27px;font-weight:400;line-height:1.2;letter-spacing:-0.03em;margin:10px 0;color:inherit;overflow-wrap:anywhere}.os-posts-desk__preview{font-size:13px;line-height:1.8;color:var( --os-ui-fg-muted,#646970 );overflow-wrap:anywhere}.os-posts-desk__dates{padding-block:16px;border-block:1px solid var( --os-ui-border,#dcdcde );--os-ui-facts-font-size:11px;--os-ui-facts-row-gap:4px;--os-ui-facts-column-gap:10px}.os-posts-desk__fields section{padding-block:8px;font-size:12px;overflow-wrap:anywhere}.os-posts-desk__fields h3{font-size:11px;font-weight:600;margin:0 0 8px;color:var( --os-ui-fg-muted,#646970 )}.os-posts-desk__inspector-actions{display:flex;align-items:center;flex-wrap:wrap;gap:12px;padding:16px 20px;border-block-start:1px solid var( --os-ui-border,#dcdcde );font-size:11px}.os-posts-desk__inspector-actions a{color:var( --os-ui-accent,#2271b1 )}.os-posts-desk__empty{padding:48px 20px;text-align:center;color:var( --os-ui-fg-muted,#646970 )}.os-posts-desk__empty>.dashicons{font-size:40px;inline-size:40px;block-size:40px}.desktop-mode-posts .os-app-list__bulk--footer{padding:10px 24px}.desktop-mode-posts .os-app-list__bulk--footer .os-app-list__count,.desktop-mode-posts .os-app-list__bulk--footer .os-app-list__bulk-actions{flex:0 1 auto}.desktop-mode-pages .os-posts-desk__feed{display:grid;grid-template-columns:repeat( auto-fill,minmax( 230px,1fr ) );align-content:start;gap:16px}.desktop-mode-pages .os-posts-desk__story{margin:0;display:flex;flex-direction:column}.desktop-mode-pages .os-posts-desk__story-content{flex-direction:column;flex:1}.desktop-mode-pages .os-posts-desk__story h3,.desktop-mode-pages .os-posts-desk__inspector h2{font-family:inherit;font-weight:600;font-size:21px}.os-posts-desk__page-mark{border:1px solid var( --os-ui-border,#dcdcde );border-radius:5px;inline-size:42px;block-size:50px;padding:8px;color:var( --os-ui-accent,#2271b1 );background:var( --os-ui-surface-sunken,#f6f7f7 )}.os-posts-desk__page-mark i{display:block;block-size:2px;margin-block-start:4px;background:var( --os-ui-border,#dcdcde )}.os-posts-desk__page-mark i:last-child{inline-size:60%}@container content-desk (max-width:850px){.os-posts-desk__inspector{display:none}.os-posts-desk__inspector.is-open{display:flex;flex:1;max-inline-size:none;border-inline-start:0}.os-posts-desk__workspace.has-detail .os-posts-desk__feed{display:none}.os-posts-desk__hero{padding:20px}}@container content-desk (max-width:540px){.os-posts-desk__hero{padding:16px;gap:12px}.os-posts-desk__hero p,.os-posts-desk__eyebrow{display:none}.os-posts-desk__hero h2{font-size:23px}.desktop-mode-posts .os-app-list__toolbar,.os-posts-desk__tools{padding:8px 12px}.os-posts-desk__tools{flex-wrap:wrap}.os-posts-desk__tools>os-checkbox{flex-basis:100%}.os-posts-desk__tools os-select{flex:1;inline-size:130px}.os-posts-desk__feed{padding:12px}.os-posts-desk__story{padding:16px}.os-posts-desk__story.is-current{padding-inline-start:14px}.os-posts-desk__thumbnail{inline-size:64px;block-size:64px}.os-posts-desk__story h3{font-size:21px}}@media (prefers-reduced-motion:reduce){.os-posts-desk__story{transition:none}}.os-posts-desk__tools .os-app-list__search{flex:1 1 170px;min-inline-size:130px}.os-posts-desk__tools>os-checkbox{flex-shrink:0}@container content-desk (max-width:700px){.os-posts-desk__tools{flex-wrap:wrap}.os-posts-desk__tools .os-app-list__search{flex-basis:calc( 100% - 145px )}.os-posts-desk__tools>os-checkbox{flex-basis:auto}.os-posts-desk__tools os-select{flex:1 1 130px;min-inline-size:130px}}.desktop-mode-pages .os-posts-desk__story-foot>.os-posts-desk__byline{flex-basis:100%;margin-block-end:4px}html[data-os-mode="mobile"] .desktop-mode-posts .os-app-list__toolbar-left{flex:1 1 140px}html[data-os-mode="mobile"] .desktop-mode-posts .os-app-list__toolbar-trailing{flex:0 0 auto}`,Si=R` ${fe} ${Je}:host{display:inline-flex;align-items:center;gap:6px;font-size:13px;color:var( --os-ui-fg,#1d2327 );cursor:pointer}:host( [ disabled ] ){cursor:not-allowed;opacity:0.55}:host( [ block ] ){display:flex;cursor:default}:host( [ block ] ) label{cursor:pointer}:host( [ block ][ disabled ] ) label{cursor:not-allowed}label{display:inline-flex;align-items:center;gap:6px;cursor:inherit}.os-checkbox__label{line-height:1.3}.os-checkbox__label:empty{display:none}`,Ce=class Ce extends U{render(){const e=this.checked!==null,t=this.disabled!==null,o=this.label||"",i=this.value;return b`
473 473 <label>
474 474 <input
475 475 type="checkbox"
476 476 .checked=${e}
@@ -477,11 +477,11 @@
477 477 ?disabled=${t}
478 478 .value=${i??""}
479 479 @change=${a=>this._onChange(a)}
480 480 />
481 - <span class="os-checkbox__label">${s}</span>
481 + <span class="os-checkbox__label">${o}</span>
482 482 </label>
483 - `}_onChange(e){const s=e.target.checked;s?this.setAttribute("checked",""):this.removeAttribute("checked"),this.emit("os-checkbox-change",{checked:s,value:this.value})}};Ce.props=["checked","value","label","disabled"],Ce.styles=[ci],Ce.help=void 0;let rt=Ce;U("os-checkbox",rt);const di=P`:host{--_border:var( --os-ui-stat-border,var( --os-ui-border,#dcdcde ) );--_bg:var( --os-ui-stat-bg,transparent );--_value-color:var( --os-ui-stat-value-color,var( --wp-admin-theme-color,#2271b1 ) );--_value-size:var( --os-ui-stat-value-size,20px );--_label-color:var( --os-ui-stat-label-color,var( --os-ui-fg-muted,#646970 ) );display:flex;flex-direction:column;gap:2px;padding:var( --os-ui-stat-padding,10px 12px );border:1px solid var( --_border );border-radius:var( --os-ui-stat-radius,8px );background:var( --_bg );min-inline-size:0}:host( [ hidden ] ){display:none}.value{font-size:var( --_value-size );font-weight:700;line-height:1.1;color:var( --_value-color );font-variant-numeric:tabular-nums}.label{display:inline-flex;align-items:center;gap:6px;font-size:11px;letter-spacing:0.05em;text-transform:uppercase;color:var( --_label-color )}.caption{font-size:11px;color:var( --_label-color )}.swatch{display:inline-block;inline-size:10px;block-size:10px;border-radius:3px;flex:none;background:var( --os-app-tone,var( --os-ui-fg-muted,#646970 ) )}`,Se=class Se extends q{render(){const e=this,t=e.caption||"";return b`
483 + `}_onChange(e){const o=e.target.checked;o?this.setAttribute("checked",""):this.removeAttribute("checked"),this.emit("os-checkbox-change",{checked:o,value:this.value})}};Ce.props=["checked","value","label","disabled"],Ce.styles=[Si],Ce.help=void 0;let pt=Ce;W("os-checkbox",pt);const Ai=R`:host{--_border:var( --os-ui-stat-border,var( --os-ui-border,#dcdcde ) );--_bg:var( --os-ui-stat-bg,transparent );--_value-color:var( --os-ui-stat-value-color,var( --wp-admin-theme-color,#2271b1 ) );--_value-size:var( --os-ui-stat-value-size,20px );--_label-color:var( --os-ui-stat-label-color,var( --os-ui-fg-muted,#646970 ) );display:flex;flex-direction:column;gap:2px;padding:var( --os-ui-stat-padding,10px 12px );border:1px solid var( --_border );border-radius:var( --os-ui-stat-radius,8px );background:var( --_bg );min-inline-size:0}:host( [ hidden ] ){display:none}.value{font-size:var( --_value-size );font-weight:700;line-height:1.1;color:var( --_value-color );font-variant-numeric:tabular-nums}.label{display:inline-flex;align-items:center;gap:6px;font-size:11px;letter-spacing:0.05em;text-transform:uppercase;color:var( --_label-color )}.caption{font-size:11px;color:var( --_label-color )}.swatch{display:inline-block;inline-size:10px;block-size:10px;border-radius:3px;flex:none;background:var( --os-app-tone,var( --os-ui-fg-muted,#646970 ) )}`,Se=class Se extends U{render(){const e=this,t=e.caption||"";return b`
484 484 <span class="value" part="value">${e.value||""}</span>
485 485 <span class="label" part="label">
486 486 ${this.hasAttribute("swatch")?b`<i class="swatch" aria-hidden="true"></i>`:""}
487 487 ${e.label||""}
@@ -486,16 +486,16 @@
486 486 ${this.hasAttribute("swatch")?b`<i class="swatch" aria-hidden="true"></i>`:""}
487 487 ${e.label||""}
488 488 </span>
489 489 ${t?b`<span class="caption" part="caption">${t}</span>`:""}
490 - `}};Se.props=["value","label","caption","swatch"],Se.styles=[di],Se.help=void 0;let lt=Se;U("os-stat",lt);const pi=()=>({view:"desk",filters:!1,peek:!1,focused:null,inspectorKey:"",fields:[]});function Xt(o){return ue((o.excerpt?.rendered??"").replace(/<[^>]*>/g," ")).replace(/\s+/g," ").trim()}function ui(o,e){if(!o.parent)return u("Top-level page");const t=e.find(s=>s.id===o.parent);return t?re(t):O(u("Parent page #%d"),o.parent)}function ct(o,e){o.host.openUrl?.(Te(o.extra,e.id),re(e)||u("(no title)"),o.extra.mode==="pages"?"dashicons-admin-page":"dashicons-admin-post")}function Yt(o){return b`<span class="os-posts-desk__status" data-status=${o.status}>${Be[o.status]??o.status}</span>`}function hi(o,e){return o.extra.frontPageId===e.id?u("Front page"):o.extra.postsPageId===e.id?u("Posts page"):""}function Jt(o,e){queueMicrotask(()=>o.querySelector(e)?.shadowRoot?.querySelector("button")?.focus())}function fi(o,e){const t=o.extra.mode==="pages",s=o.data?.list.items??[],i=H(o)?.selection??new Set,a=s.length>0&&s.every(l=>i.has(l.id)),n=l=>{e.view=l.detail.value==="table"?"table":"desk",o.repaint()},r=l=>{const[c,d]=String(l.detail.value).split(":");o.dispatch("sort",{orderby:c,order:d})};return b`<div class="os-posts-desk__tools ${e.filters?"is-expanded":""}">
491 - <os-text-field id=${`${o.windowId}-content-search`} class="os-app-list__search" data-os-posts-search
490 + `}};Se.props=["value","label","caption","swatch"],Se.styles=[Ai],Se.help=void 0;let ut=Se;W("os-stat",ut);const Ei=()=>({view:"desk",filters:!1,peek:!1,focused:null,inspectorKey:"",fields:[]});function ns(s){return ae((s.excerpt?.rendered??"").replace(/<[^>]*>/g," ")).replace(/\s+/g," ").trim()}function zi(s,e){if(!s.parent)return u("Top-level page");const t=e.find(o=>o.id===s.parent);return t?le(t):H(u("Parent page #%d"),s.parent)}function ht(s,e){s.host.openUrl?.(Te(s.extra,e.id),le(e)||u("(no title)"),s.extra.mode==="pages"?"dashicons-admin-page":"dashicons-admin-post")}function as(s){return b`<span class="os-posts-desk__status" data-status=${s.status}>${Ze[s.status]??s.status}</span>`}function Ti(s,e){return s.extra.frontPageId===e.id?u("Front page"):s.extra.postsPageId===e.id?u("Posts page"):""}function rs(s,e){queueMicrotask(()=>s.querySelector(e)?.shadowRoot?.querySelector("button")?.focus())}function Pi(s,e){const t=s.extra.mode==="pages",o=s.data?.list.items??[],i=V(s)?.selection??new Set,a=o.length>0&&o.every(l=>i.has(l.id)),n=l=>{e.view=l.detail.value==="table"?"table":"desk",s.repaint()},r=l=>{const[c,d]=String(l.detail.value).split(":");s.dispatch("sort",{orderby:c,order:d})};return b`<div class="os-posts-desk__tools ${e.filters?"is-expanded":""}">
491 + <os-text-field id=${`${s.windowId}-content-search`} class="os-app-list__search" data-os-posts-search
492 492 aria-label=${u(t?"Search pages":"Search posts")} os-bind="search" os-action="filter" os-debounce="250"
493 - value=${o.state.search} placeholder=${u(t?"Search pages…":"Search posts…")}></os-text-field>
494 - <os-button class="os-posts-desk__filter-toggle" variant="secondary" aria-expanded=${String(e.filters)} @click=${()=>{e.filters=!e.filters,o.repaint()}}>${u("Options")}</os-button>
493 + value=${s.state.search} placeholder=${u(t?"Search pages…":"Search posts…")}></os-text-field>
494 + <os-button class="os-posts-desk__filter-toggle" variant="secondary" aria-expanded=${String(e.filters)} @click=${()=>{e.filters=!e.filters,s.repaint()}}>${u("Options")}</os-button>
495 495 <os-checkbox label=${u("Select loaded")} ?checked=${a}
496 - @os-checkbox-change=${()=>{a?H(o)?.clearSelection():H(o)?.selectAll()}}></os-checkbox>
497 - <os-select aria-label=${u("Sort content")} value=${`${o.state.orderby}:${o.state.order}`} @os-pick=${r}>
496 + @os-checkbox-change=${()=>{a?V(s)?.clearSelection():V(s)?.selectAll()}}></os-checkbox>
497 + <os-select aria-label=${u("Sort content")} value=${`${s.state.orderby}:${s.state.order}`} @os-pick=${r}>
498 498 ${t?b`<os-option value="menu_order:asc">${u("Page order")}</os-option>`:""}
499 499 <os-option value="date:desc">${u("Newest first")}</os-option>
500 500 <os-option value="date:asc">${u("Oldest first")}</os-option>
501 501 <os-option value="modified:desc">${u("Recently edited")}</os-option>
@@ -510,89 +510,90 @@
510 510 <os-select aria-label=${u("Content view")} value=${e.view} @os-pick=${n} data-os-posts-view>
511 511 <os-option value="desk">${u(t?"Page directory":"Writing desk")}</os-option>
512 512 <os-option value="table">${u("Details table")}</os-option>
513 513 </os-select>
514 - </div>`}function gi(o,e){const t=o.extra.mode==="pages",s=O(u(t?"Copy page ID %d":"Copy post ID %d"),e.id);return b`<os-button variant="ghost" class="os-posts-desk__id" title=${s} @click=${async i=>{i.stopPropagation();const n=await yt(String(e.id))?O(u(t?"Copied page ID #%d.":"Copied post ID #%d."),e.id):u("Couldn’t copy the ID. Please try again.");o.host.toast?.({message:n})}}><span class="screen-reader-text">${s}</span><span aria-hidden="true">#${e.id}</span><span class="dashicons dashicons-admin-page" aria-hidden="true"></span></os-button>`}function mi(o,e,t,s){const i=o.extra.mode==="pages",a=re(t)||u("(no title)"),n=Ze(t),r=Xs(t,"category")[0]?.name,l=hi(o,t),c=i?ui(t,o.data?.list.items??[]):ue(r||u("Story"));let d="";i?d=b`<div class="os-posts-desk__page-mark" aria-hidden="true"><span class="dashicons ${l?"dashicons-admin-home":"dashicons-admin-page"}"></span><i></i><i></i><i></i></div>`:n&&(d=b`<img class="os-posts-desk__thumbnail" src=${n.url} alt="" loading="lazy" @error=${h=>h.target.hidden=!0}>`);const p=()=>{e.focused=t.id,e.peek=!0,o.repaint(),Jt(o.root,"[data-os-posts-inspect-close]")};return b`<article class="os-posts-desk__story ${s===t.id?"is-current":""}" data-story-id=${t.id}>
514 + </div>`}function Mi(s,e){const t=s.extra.mode==="pages",o=H(u(t?"Copy page ID %d":"Copy post ID %d"),e.id);return b`<os-button variant="ghost" class="os-posts-desk__id" title=${o} @click=${async i=>{i.stopPropagation();const n=await $t(String(e.id))?H(u(t?"Copied page ID #%d.":"Copied post ID #%d."),e.id):u("Couldn’t copy the ID. Please try again.");s.host.toast?.({message:n})}}><span class="screen-reader-text">${o}</span><span aria-hidden="true">#${e.id}</span><span class="dashicons dashicons-admin-page" aria-hidden="true"></span></os-button>`}function Li(s,e){const t=e[s.key];let o="";return s.render?o=s.render(t,e,0):t!=null&&(o=String(t)),o==null||o===""||o instanceof Element&&!o.childNodes.length&&!o.textContent?"":b`<div class="os-posts-desk__plugin-stat" data-column=${s.key}><span class="os-posts-desk__plugin-stat-value">${o}</span><span class="os-posts-desk__plugin-stat-label">${s.label||s.key}</span></div>`}function Ri(s,e,t,o,i=[]){const a=s.extra.mode==="pages",n=le(t)||u("(no title)"),r=Ye(t),l=fo(t,"category")[0]?.name,c=Ti(s,t),d=a?zi(t,s.data?.list.items??[]):ae(l||u("Story"));let p="";a?p=b`<div class="os-posts-desk__page-mark" aria-hidden="true"><span class="dashicons ${c?"dashicons-admin-home":"dashicons-admin-page"}"></span><i></i><i></i><i></i></div>`:r&&(p=b`<img class="os-posts-desk__thumbnail" src=${r.url} alt="" loading="lazy" @error=${v=>v.target.hidden=!0}>`);const g=()=>{e.focused=t.id,e.peek=!0,s.repaint(),rs(s.root,"[data-os-posts-inspect-close]")};return b`<article class="os-posts-desk__story ${o===t.id?"is-current":""}" data-story-id=${t.id}>
515 515 <div class="os-posts-desk__story-top">
516 - ${Yt(t)}
517 - ${l?b`<span class="os-posts-desk__role">${l}</span>`:""}
518 - ${gi(o,t)}
519 - <os-checkbox aria-label=${O(u("Select %s"),a)}
520 - class="os-posts-desk__select" ?checked=${H(o)?.selection.has(t.id)??!1}
521 - @os-checkbox-change=${h=>{h.detail.checked?H(o)?.select(t.id):H(o)?.deselect(t.id)}}></os-checkbox>
516 + ${as(t)}
517 + ${c?b`<span class="os-posts-desk__role">${c}</span>`:""}
518 + ${Mi(s,t)}
519 + <os-checkbox aria-label=${H(u("Select %s"),n)}
520 + class="os-posts-desk__select" ?checked=${V(s)?.selection.has(t.id)??!1}
521 + @os-checkbox-change=${v=>{v.detail.checked?V(s)?.select(t.id):V(s)?.deselect(t.id)}}></os-checkbox>
522 522 </div>
523 523 <div class="os-posts-desk__story-content">
524 - ${d}
524 + ${p}
525 525 <div class="os-posts-desk__story-copy">
526 - <div class="os-posts-desk__kicker">${c}</div>
527 - <h3><a href=${Te(o.extra,t.id)} @click=${h=>{h.preventDefault(),ct(o,t)}}>${a}</a></h3>
528 - <p class="os-posts-desk__excerpt">${i?`/${t.slug||""}`:Xt(t)||u("Every story starts somewhere. Open the editor to keep writing.")}</p>
526 + <div class="os-posts-desk__kicker">${d}</div>
527 + <h3><a href=${Te(s.extra,t.id)} @click=${v=>{v.preventDefault(),ht(s,t)}}>${n}</a></h3>
528 + <p class="os-posts-desk__excerpt">${a?`/${t.slug||""}`:ns(t)||u("Every story starts somewhere. Open the editor to keep writing.")}</p>
529 529 </div>
530 530 </div>
531 531 <div class="os-posts-desk__metrics" data-content-metrics=${`${t.id}:${t.modified_gmt}`} data-post-id=${t.id}>
532 532 <os-stat data-metric="words" value="—" label=${u("Words")} title=${u("Words in the complete page or post body")}></os-stat>
533 533 <os-stat data-metric="comments" value=${typeof t.openstation_comment_count=="number"?String(t.openstation_comment_count):"—"} label=${u("Comments")} title=${u("Approved comments")}></os-stat>
534 - ${i?"":b`<os-stat value=${String(t.tags?.length??0)} label=${u("Tags")}></os-stat>`}
534 + ${a?"":b`<os-stat value=${String(t.tags?.length??0)} label=${u("Tags")}></os-stat>`}
535 + ${i.map(v=>Li(v,t))}
535 536 </div>
536 - ${t.openstation_lock?b`<p class="os-posts-desk__lock"><span class="dashicons dashicons-lock" aria-hidden="true"></span>${O(u("%s is editing"),t.openstation_lock.userName)}</p>`:""}
537 + ${t.openstation_lock?b`<p class="os-posts-desk__lock"><span class="dashicons dashicons-lock" aria-hidden="true"></span>${H(u("%s is editing"),t.openstation_lock.userName)}</p>`:""}
537 538 <footer class="os-posts-desk__story-foot">
538 - <span class="os-posts-desk__byline">${Ge(t).name}<span aria-hidden="true"> · </span><os-relative-time datetime=${t.modified_gmt||t.date_gmt}></os-relative-time></span>
539 - <os-button variant="ghost" @click=${()=>ct(o,t)}>${u("Edit")}<span aria-hidden="true"> ↗</span></os-button>
540 - <os-button variant="secondary" data-inspect-id=${t.id} @click=${p}>${u("Details")}</os-button>
539 + <span class="os-posts-desk__byline">${Xe(t).name}<span aria-hidden="true"> · </span><os-relative-time datetime=${t.modified_gmt||t.date_gmt}></os-relative-time></span>
540 + <os-button variant="ghost" @click=${()=>ht(s,t)}>${u("Edit")}<span aria-hidden="true"> ↗</span></os-button>
541 + <os-button variant="secondary" data-inspect-id=${t.id} @click=${g}>${u("Details")}</os-button>
541 542 </footer>
542 - </article>`}function bi(o,e,t,s,i,a){if(!a||!e.peek||e.focused===null)return"";const n=JSON.stringify([a,Array.from(i)]);if(n!==e.inspectorKey){e.inspectorKey=n,e.fields=Bt(t,new Map,s,!1,i).filter(c=>!["title","author","date"].includes(c.key)).map(c=>({key:c.key,label:c.label||c.key,node:c.render?c.render(a[c.key],a,0):String(a[c.key]??"—")}));for(const c of t.categories.pickers)c.isConnected||t.categories.pickers.delete(c)}const r=Ze(a),l=()=>{const c=e.focused??a.id;e.focused=null,e.peek=!1,o.repaint(),Jt(o.root,`[data-inspect-id="${c}"]`)};return b`<aside class="os-posts-desk__inspector ${e.focused!==null?"is-open":""}" aria-label=${u("Content details")}
543 + </article>`}function Ii(s,e,t,o,i,a){if(!a||!e.peek||e.focused===null)return"";const n=JSON.stringify([a,Array.from(i)]);if(n!==e.inspectorKey){e.inspectorKey=n,e.fields=ct(t,new Map,o,!1,i).filter(c=>!["title","author","date"].includes(c.key)).map(c=>({key:c.key,label:c.label||c.key,node:c.render?c.render(a[c.key],a,0):String(a[c.key]??"—")}));for(const c of t.categories.pickers)c.isConnected||t.categories.pickers.delete(c)}const r=Ye(a),l=()=>{const c=e.focused??a.id;e.focused=null,e.peek=!1,s.repaint(),rs(s.root,`[data-inspect-id="${c}"]`)};return b`<aside class="os-posts-desk__inspector ${e.focused!==null?"is-open":""}" aria-label=${u("Content details")}
543 544 @keydown=${c=>{c.key==="Escape"&&(c.stopPropagation(),l())}}>
544 - <header class="os-posts-desk__inspector-head"><span>${o.extra.mode==="pages"?u("PAGE DETAILS"):u("STORY DETAILS")}</span><os-button variant="ghost" data-os-posts-inspect-close @click=${l}>${u("Close details")}</os-button></header>
545 + <header class="os-posts-desk__inspector-head"><span>${s.extra.mode==="pages"?u("PAGE DETAILS"):u("STORY DETAILS")}</span><os-button variant="ghost" data-os-posts-inspect-close @click=${l}>${u("Close details")}</os-button></header>
545 546 <div class="os-posts-desk__inspector-scroll">
546 547 ${r?b`<img class="os-posts-desk__cover" src=${r.url} alt=${r.alt} @error=${c=>c.target.hidden=!0}>`:""}
547 - ${Yt(a)}
548 - <h2>${re(a)||u("(no title)")}</h2>
549 - <p class="os-posts-desk__byline">${Ge(a).name}</p>
550 - ${a.openstation_lock?b`<os-notice tone="warning">${O(u("%s is currently editing"),a.openstation_lock.userName)}</os-notice>`:""}
551 - <p class="os-posts-desk__preview">${Xt(a)||u("No excerpt yet.")}</p>
552 - <dl class="os-posts-desk__dates"><div><dt>${a.status==="future"?u("Scheduled for"):u("Date")}</dt><dd><os-relative-time datetime=${a.date_gmt||a.date}></os-relative-time></dd></div><div><dt>${u("Last edited")}</dt><dd><os-relative-time datetime=${a.modified_gmt||a.modified}></os-relative-time></dd></div></dl>
548 + ${as(a)}
549 + <h2>${le(a)||u("(no title)")}</h2>
550 + <p class="os-posts-desk__byline">${Xe(a).name}</p>
551 + ${a.openstation_lock?b`<os-notice tone="warning">${H(u("%s is currently editing"),a.openstation_lock.userName)}</os-notice>`:""}
552 + <p class="os-posts-desk__preview">${ns(a)||u("No excerpt yet.")}</p>
553 + <os-facts layout="between" class="os-posts-desk__dates"><os-fact label=${a.status==="future"?u("Scheduled for"):u("Date")}><os-relative-time datetime=${a.date_gmt||a.date}></os-relative-time></os-fact><os-fact label=${u("Last edited")}><os-relative-time datetime=${a.modified_gmt||a.modified}></os-relative-time></os-fact></os-facts>
553 554 <div class="os-posts-desk__fields">${e.fields.map(c=>b`<section data-detail-field=${c.key}><h3>${c.label}</h3>${c.node}</section>`)}</div>
554 555 </div>
555 - <footer class="os-posts-desk__inspector-actions"><os-button variant="primary" @click=${()=>ct(o,a)}>${u("Open editor")}<span aria-hidden="true"> ↗</span></os-button>
556 + <footer class="os-posts-desk__inspector-actions"><os-button variant="primary" @click=${()=>ht(s,a)}>${u("Open editor")}<span aria-hidden="true"> ↗</span></os-button>
556 557 ${a.link&&a.status==="publish"?b`<a href=${a.link} target="_blank" rel="noopener noreferrer">${u("View on site")} ↗</a>`:""}
557 558 </footer>
558 - </aside>`}function _i(o,e,t,s,i,a){const n=o.extra.mode==="pages"?u("No pages found."):u("No posts found."),r=o.data?.list.items??[],l=r.find(c=>c.id===e.focused)??r[0];return b`<div class="os-posts-desk__workspace ${e.focused!==null&&l?"has-detail":""}" ?hidden=${e.view!=="desk"}>
559 - <div class="os-posts-desk__feed" aria-label=${o.extra.mode==="pages"?u("Page directory"):u("Stories")}>
560 - ${r.length?r.map(c=>mi(o,e,c,e.peek?l?.id:void 0)):b`<div class="os-posts-desk__empty"><span class="dashicons dashicons-welcome-write-blog" aria-hidden="true"></span><h3>${o.loading?u("Opening your workspace…"):n}</h3><p>${o.loading?u("Your content will appear here."):u("Try a different search or change the status filter.")}</p></div>`}
559 + </aside>`}function Ni(s,e,t,o,i,a){const n=s.extra.mode==="pages"?u("No pages found."):u("No posts found."),r=s.data?.list.items??[],l=r.find(d=>d.id===e.focused)??r[0],c=r.length?li(t,o,i):[];return b`<div class="os-posts-desk__workspace ${e.focused!==null&&l?"has-detail":""}" ?hidden=${e.view!=="desk"}>
560 + <div class="os-posts-desk__feed" aria-label=${s.extra.mode==="pages"?u("Page directory"):u("Stories")}>
561 + ${r.length?r.map(d=>Ri(s,e,d,e.peek?l?.id:void 0,c)):b`<div class="os-posts-desk__empty"><span class="dashicons dashicons-welcome-write-blog" aria-hidden="true"></span><h3>${s.loading?u("Opening your workspace…"):n}</h3><p>${s.loading?u("Your content will appear here."):u("Try a different search or change the status filter.")}</p></div>`}
561 562 ${a??""}
562 563 </div>
563 - ${e.peek?bi(o,e,t,s,i,l):""}
564 - </div>`}function vi(o){queueMicrotask(()=>{for(const t of o.querySelectorAll(".os-posts-desk__select, [data-os-posts-search]"))t.shadowRoot?.querySelector("input")?.setAttribute("aria-label",t.getAttribute("aria-label")||"");const e=o.querySelector(".os-posts-desk__filter-toggle");e?.shadowRoot?.querySelector("button")?.setAttribute("aria-expanded",e.getAttribute("aria-expanded")||"false")})}const xi="[openstation:desktop-mode-posts]",yi=50,dt=()=>({desk:pi(),feed:new ni,client:null,env:null,cellCache:new Map,table:Ts(),filterData:{authors:[],tags:[]},columnsKey:"",hidden:null,selected:0,bulkActions:null,extras:null,postsCtx:null,tab:"posts",canvases:{categories:null,tags:null},canvasPending:new Set,menu:null,disposed:!1,tagPage:0,tagTotalPages:1,tagFetching:!1}),Qt=o=>o.mode==="pages"?"pages":"posts";function ki(o){return o.map(e=>`${e.id}:${e.status}:${e.modified_gmt}`).join("|")}function Re(o,e){return e.client||(e.client=ei(o.fetch)),e.client}function de(o){return o.hidden||(o.hidden=nt()),o.hidden}function es(o,e,t){let s="";t instanceof Error?s=t.message:t!=null&&(s=String(t)),o.host.toast?.({message:`${e} ${s}`.trim(),duration:6e3})}function pt(o,e,t){return e.env||(e.env={extra:o.extra,client:Re(o,e),cells:t,openUrl:(s,i,a)=>o.host.openUrl?.(s,i,a),confirm:s=>o.host.confirm?.(s)??Promise.resolve(!1),toast:(s,i)=>es(o,s,i),announce:(s,i)=>o.host.announce?.("post",s,i),parentTitles:new Map,categories:{tree:null,pickers:new Set}}),e.env}function wi(o,e){return{client:Re(o,e),extra:o.extra,openUrl:(t,s,i)=>o.host.openUrl?.(t,s,i),toast:(t,s)=>es(o,t,s),leaveFullscreen:()=>{const t=window.wp?.os?.windowManager?.getById?.(o.windowId);t?.isFullscreen?.()&&t.toggleFullscreen?.()}}}async function ts(o,e){if(!(e.tagFetching||e.tagPage>=e.tagTotalPages)){e.tagFetching=!0;try{const t=e.tagPage+1,s=await Re(o,e).fetchTagOptions(t,yi);e.tagPage=t,e.tagTotalPages=Math.max(e.tagTotalPages,s.totalPages||t);const i=new Set(e.filterData.tags.map(a=>a.id));for(const a of s.items)i.has(a.id)||(e.filterData.tags.push(a),i.add(a.id));e.filterData.tagsHasMore=e.tagPage<e.tagTotalPages,o.repaint()}finally{e.tagFetching=!1}}}const $i=o=>`${o.authors.map(e=>e.id).join(",")}|${o.tags.map(e=>e.id).join(",")}|${o.tagsHasMore?1:0}`,ss=o=>o.split(",").map(e=>parseInt(e.trim(),10)).filter(e=>Number.isFinite(e)&&e>0),os=(o,e)=>o.length===e.length&&o.every((t,s)=>t===e[s]);function Ci(o,e,t){const s=o.extra;t.getRowId=a=>a.id,t.subTable=a=>to(a);const i=Qo(o.state.orderby);t.sort=t.columns.some(a=>a.key===i)?{key:i,direction:o.state.order}:null,t.addEventListener("os-table-selection-change",()=>{e.selected=t.selection?.size??0,o.repaint()}),t.addEventListener("os-table-sort-change",a=>{const n=a.detail?.sort,r=s.defaultOrderby??"date";o.dispatch("sort",n?{orderby:Jo(n.key,r),order:n.direction}:{orderby:r,order:s.defaultOrder??"desc"})}),t.addEventListener("os-table-filter-change",a=>{const n=a.detail?.filters??{},r=ss(n.author??""),l=ss(n.tags??"");os(r,o.state.author)&&os(l,o.state.tag)||(o.local("set-column-filters",{author:r,tag:l}),o.dispatch("filter"))})}function Si(o,e={}){const t=e.terms,s=e.cells??{},i=(r,l,c)=>{if(!t||l.canvases[c]||l.canvasPending.has(c))return;const d=r.root.querySelector(c==="categories"?"[data-os-posts-cats-host]":"[data-os-posts-tags-host]");d&&(l.canvasPending.add(c),t[c](d,wi(r,l)).then(p=>{if(l.disposed){p();return}l.canvases[c]=p}).catch(p=>{console.error(`${xi} ${c} canvas failed`,p)}).finally(()=>l.canvasPending.delete(c)))},a=(r,l,c,d)=>(l.bulkActions||(l.bulkActions=Xo(Zo(c,p=>r.dispatch("trash",{ids:p})))),b`
565 - <div class="os-app-list__toolbar-right ${"os-app-list__bulk--footer"}" data-os-posts-bulk ?hidden=${l.selected===0}>
566 - <span class="os-app-list__count" data-os-posts-count>${O(u("%d selected"),l.selected)}</span>
567 - <os-button variant="ghost" @click=${()=>H(r)?.clearSelection()}>${u("Clear selection")}</os-button>
568 - <span class="os-app-list__bulk-actions" data-os-posts-bulk-actions>${l.bulkActions.map(p=>b`<os-button
569 - variant=${p.variant??"secondary"}
570 - data-os-posts-bulk-action=${p.id}
571 - @click=${()=>void oi(r,p,at(r,l))}
572 - >${p.icon?b`<span class="dashicons ${p.icon}" aria-hidden="true"></span>`:""} ${p.label}</os-button>`)}</span>
564 + ${e.peek?Ii(s,e,t,o,i,l):""}
565 + </div>`}function Oi(s){queueMicrotask(()=>{for(const t of s.querySelectorAll(".os-posts-desk__select, [data-os-posts-search]"))t.shadowRoot?.querySelector("input")?.setAttribute("aria-label",t.getAttribute("aria-label")||"");const e=s.querySelector(".os-posts-desk__filter-toggle");e?.shadowRoot?.querySelector("button")?.setAttribute("aria-expanded",e.getAttribute("aria-expanded")||"false")})}const qi="[openstation:desktop-mode-posts]",Di=50,Ie=()=>({desk:Ei(),feed:new ki,client:null,env:null,cellCache:new Map,table:Ds(),filterData:{authors:[],tags:[]},columnsKey:"",hidden:null,selected:0,bulkActions:null,extras:null,postsCtx:null,tab:"posts",serverTab:"posts",editor:null,canvases:{categories:null,tags:null},canvasPending:new Set,menu:null,disposed:!1,tagPage:0,tagTotalPages:1,tagFetching:!1}),ls=s=>s.mode==="pages"?"pages":"posts";function Hi(s){return s.map(e=>`${e.id}:${e.status}:${e.modified_gmt}`).join("|")}function Ne(s,e){return e.client||(e.client=bi(s.fetch)),e.client}function pe(s,e){return s.hidden||(s.hidden=Qt(e)),s.hidden}function cs(s,e,t){const o=e.replace(/:\s*$/,"");Gs(s.host.toast,t,o===e?{fallback:e,duration:6e3}:{lead:o,fallback:`${o}.`,duration:6e3})}function ft(s,e,t){return e.env||(e.env={extra:s.extra,client:Ne(s,e),cells:t,openUrl:(o,i,a)=>s.host.openUrl?.(o,i,a),confirm:o=>s.host.confirm?.(o)??Promise.resolve(!1),toast:(o,i)=>cs(s,o,i),announce:(o,i)=>s.host.announce?.("post",o,i),parentTitles:new Map,categories:{tree:null,pickers:new Set}}),e.env}function Fi(s,e){return{client:Ne(s,e),extra:s.extra,openUrl:(t,o,i)=>s.host.openUrl?.(t,o,i),toast:(t,o)=>cs(s,t,o),leaveFullscreen:()=>{const t=window.wp?.os?.windowManager?.getById?.(s.windowId);t?.isFullscreen?.()&&t.toggleFullscreen?.()}}}async function ds(s,e){if(!(e.tagFetching||e.tagPage>=e.tagTotalPages)){e.tagFetching=!0;try{const t=e.tagPage+1,o=await Ne(s,e).fetchTagOptions(t,Di);e.tagPage=t,e.tagTotalPages=Math.max(e.tagTotalPages,o.totalPages||t);const i=new Set(e.filterData.tags.map(a=>a.id));for(const a of o.items)i.has(a.id)||(e.filterData.tags.push(a),i.add(a.id));e.filterData.tagsHasMore=e.tagPage<e.tagTotalPages,s.repaint()}finally{e.tagFetching=!1}}}const Ui=s=>`${s.authors.map(e=>e.id).join(",")}|${s.tags.map(e=>e.id).join(",")}|${s.tagsHasMore?1:0}`,ps=s=>s.split(",").map(e=>parseInt(e.trim(),10)).filter(e=>Number.isFinite(e)&&e>0),us=(s,e)=>s.length===e.length&&s.every((t,o)=>t===e[o]);function Vi(s,e,t){const o=s.extra;t.getRowId=a=>a.id,t.subTable=a=>vo(a);const i=mi(s.state.orderby);t.sort=t.columns.some(a=>a.key===i)?{key:i,direction:s.state.order}:null,t.addEventListener("os-table-selection-change",()=>{e.selected=t.selection?.size??0,s.repaint()}),t.addEventListener("os-table-sort-change",a=>{const n=a.detail?.sort,r=o.defaultOrderby??"date";s.dispatch("sort",n?{orderby:gi(n.key,r),order:n.direction}:{orderby:r,order:o.defaultOrder??"desc"})}),t.addEventListener("os-table-filter-change",a=>{const n=a.detail?.filters??{},r=ps(n.author??""),l=ps(n.tags??"");us(r,s.state.author)&&us(l,s.state.tag)||(s.local("set-column-filters",{author:r,tag:l}),s.dispatch("filter"))})}function Wi(s,e={}){const t=e.terms,o=e.cells??{},i="nativePagesHiddenColumns",a=(h,f,m)=>{if(!t||f.canvases[m]||f.canvasPending.has(m))return;const y=h.root.querySelector(m==="categories"?"[data-os-posts-cats-host]":"[data-os-posts-tags-host]");y&&(f.canvasPending.add(m),t[m](y,Fi(h,f)).then(w=>{if(f.disposed){w();return}f.canvases[m]=w}).catch(w=>{console.error(`${qi} ${m} canvas failed`,w)}).finally(()=>f.canvasPending.delete(m)))},n=(h,f,m,y)=>(f.bulkActions||(f.bulkActions=hi(ui(m,w=>h.dispatch("trash",{ids:w})))),b`
566 + <div class="os-app-list__toolbar-right ${"os-app-list__bulk--footer"}" data-os-posts-bulk ?hidden=${f.selected===0}>
567 + <span class="os-app-list__count" data-os-posts-count>${H(u("%d selected"),f.selected)}</span>
568 + <os-button variant="ghost" @click=${()=>V(h)?.clearSelection()}>${u("Clear selection")}</os-button>
569 + <span class="os-app-list__bulk-actions" data-os-posts-bulk-actions>${f.bulkActions.map(w=>b`<os-button
570 + variant=${w.variant??"secondary"}
571 + data-os-posts-bulk-action=${w.id}
572 + @click=${()=>void xi(h,w,dt(h,f))}
573 + >${w.icon?b`<span class="dashicons ${w.icon}" aria-hidden="true"></span>`:""} ${w.label}</os-button>`)}</span>
573 574 </div>
574 - `),n=(r,l,c,d)=>{const p=l.feed.reconcile(r),{state:h,data:_}=p,g=_?.list,m=c==="pages",f=r.extra,v=pt(r,l,s);Ft(v,g?.items??[]);const x=()=>r.host.openUrl?.(f.newPostUrl??"",u(m?"Add New Page":"Add New Post"),m?"dashicons-admin-page":"dashicons-admin-post");return l.extras||(l.extras=Yo(at(r,l))),b`
575 + `),r=h=>Us(h.root.querySelector("[data-os-posts-editor] iframe")),l=(h,f)=>{f.editor&&r(h).then(m=>{m||f.disposed||!f.editor||(f.editor(),f.editor=null)})},c=(h,f)=>{const m="os.native-window.before-close",y=window.wp?.hooks;if(!y?.addFilter||!y.removeFilter)return()=>{};const w=`desktop-mode/posts/close-guard/${h.windowId}`;let k=!1;return y.addFilter(m,w,(...C)=>{const $=C[0];return C[1]?.windowId!==h.windowId||!f.editor||k?$:(k=!0,(async()=>{const N=!await r(h)||await h.host.confirm?.({title:u("Leave without saving?"),message:u("This post has changes that have not been saved. Closing the window discards them."),confirmLabel:u("Discard and close"),danger:!0})===!0;k=!1,N&&(f.editor?.(),f.editor=null,window.wp?.os?.windowManager?.getById(h.windowId)?.close())})(),!1)}),()=>y.removeFilter?.(m,w)},d=(h,f)=>{if(f.editor)return;const m=h.root.querySelector("[data-os-posts-editor]"),y=h.extra.newPostUrl??"";m&&y&&(f.editor=window.wp?.os?.embedAdminPage?.(m,y)??null)},p=(h,f,m)=>{const y=h.root.querySelector("os-tabs");if(!y){const w=m==="pages";h.host.openUrl?.(h.extra.newPostUrl??"",u(w?"Add Page":"Add Post"),w?"dashicons-admin-page":"dashicons-admin-post");return}y.value="new",v(h,f,"new")},g=h=>h.extra.menuTabs??[],v=(h,f,m)=>{if(f.tab==="new"&&m!=="new"&&l(h,f),f.tab=m,m==="new"){d(h,f);return}if(m==="atlas"&&!f.atlas&&e.atlas){const y=h.root.querySelector("[data-os-pages-atlas]");y&&(f.atlas=e.atlas(y,h));return}(m==="categories"||m==="tags")&&a(h,f,m)},_=(h,f)=>{const m=String(h.state.tab??"")||"posts";if(m===f.serverTab||(f.serverTab=m,m===f.tab))return;const y=h.root.querySelector("os-tabs");y&&(y.value=m),v(h,f,m)},x=(h,f,m,y)=>{const w=f.feed.reconcile(h),{state:k,data:C}=w,$=C?.list,P=m==="pages",z=ft(h,f,o);Zt(z,$?.items??[]);const N=()=>p(h,f,m);return f.extras||(f.extras=fi(dt(h,f))),b`
575 576 <header class="os-posts-desk__hero">
576 - <div><span class="os-posts-desk__eyebrow">${u(m?"THE SHAPE OF YOUR SITE":"YOUR EDITORIAL SPACE")}</span><h2>${u(m?"A place for every page.":"Stories in motion.")}</h2><p>${u(m?"Find a page. See where it belongs. Make it yours.":"From first thought to published story. Keep the words moving.")}</p></div>
577 - <os-button variant="holo" data-os-posts-new @click=${x}><span class="dashicons dashicons-plus" aria-hidden="true"></span>${u(m?"New page":"Write a post")}</os-button>
577 + <div><span class="os-posts-desk__eyebrow">${u(P?"THE SHAPE OF YOUR SITE":"YOUR EDITORIAL SPACE")}</span><h2>${u(P?"A place for every page.":"Stories in motion.")}</h2><p>${u(P?"Find a page. See where it belongs. Make it yours.":"From first thought to published story. Keep the words moving.")}</p></div>
578 + <os-button variant="holo" data-os-posts-new @click=${N}><span class="dashicons dashicons-plus" aria-hidden="true"></span>${u(P?"New page":"Write a post")}</os-button>
578 579 </header>
579 580 <header class="os-app-list__toolbar" data-os-posts-toolbar>
580 581 <div class="os-app-list__toolbar-left">
581 - ${As({segments:Go(),value:h.status,bind:"status",action:"filter",label:u("Filter by status"),phone:d})}
582 + ${Ns({segments:pi(),value:k.status,bind:"status",action:"filter",label:u("Filter by status"),phone:y})}
582 583 </div>
583 584
584 585 <div class="os-app-list__toolbar-trailing">
585 - <span data-os-posts-toolbar-extras>${l.extras}</span>
586 + <span data-os-posts-toolbar-extras>${f.extras}</span>
586 587 <os-button variant="ghost" os-action="refresh" data-os-posts-refresh title=${u("Refresh")}>
587 588 <span class="dashicons dashicons-update" aria-hidden="true"></span>${u("Refresh")}
588 589 </os-button>
589 590 </div>
590 591 </header>
591 - ${g?.error?b`<os-notice tone="danger">${g.error}</os-notice>`:""}
592 - ${fi(p,l.desk)}
593 - ${_i(p,l.desk,v,l.filterData,de(l),l.feed.tail())}
594 - <div class="os-app-list__body" data-os-posts-body ?hidden=${l.desk.view!=="table"}>
592 + ${$?.error?b`<os-notice tone="danger">${$.error}</os-notice>`:""}
593 + ${Pi(w,f.desk)}
594 + ${Ni(w,f.desk,z,f.filterData,pe(f,i),f.feed.tail())}
595 + <div class="os-app-list__body" data-os-posts-body ?hidden=${f.desk.view!=="table"}>
595 596 <os-table
596 597 data-os-posts-table
597 598 os-preserve
598 599 selectable="multi"
@@ -602,10 +603,10 @@
602 603 striped
603 604 bordered
604 605 >
605 606 <div slot="empty" class="os-app-list__empty">
606 - <span class="dashicons ${m?"dashicons-admin-page":"dashicons-admin-post"}" aria-hidden="true"></span>
607 - <p>${u(m?"No pages found.":"No posts found.")}</p>
607 + <span class="dashicons ${P?"dashicons-admin-page":"dashicons-admin-post"}" aria-hidden="true"></span>
608 + <p>${u(P?"No pages found.":"No posts found.")}</p>
608 609 <p class="os-app-list__empty-hint">
609 610 ${u("Try a different search or change the status filter.")}
610 611 </p>
611 612 </div>
@@ -610,19 +611,20 @@
610 611 </p>
611 612 </div>
612 613 </os-table>
613 614 </div>
614 - ${l.desk.view==="table"?l.feed.tail():""}
615 - ${a(r,l,c)}
616 - `};return Ps(o,{local:{"set-column-filters":(r,l)=>{r.author=Array.isArray(l.author)?l.author:[],r.tag=Array.isArray(l.tag)?l.tag:[]}},placeholder:r=>({list:{items:[],total:0,pages:0,page:r.page,perPage:r.perPage,error:"",code:""}}),view:r=>{const l=r.ui(dt),c=Qt(r.extra),d=He(),p=n(r,l,c,d),h=`os-app-list desktop-mode-posts${c==="pages"?" desktop-mode-pages":""}`;if(!t&&!e.atlas)return b`<div class=${h} data-os-posts-root data-desk-options=${String(l.desk.filters)}><style>${Zt.cssText}${Gt.cssText}</style>
617 - <div class="os-app-list__panel">${p}</div>
618 - </div>`;const _=g=>{const m=g.detail?.value??"posts";if(l.tab=m,m==="atlas"&&!l.atlas&&e.atlas){const f=r.root.querySelector("[data-os-pages-atlas]");f&&(l.atlas=e.atlas(f,r))}(m==="categories"||m==="tags")&&i(r,l,m)};return b`<div class=${h} data-os-posts-root data-desk-options=${String(l.desk.filters)}><style>${Zt.cssText}${Gt.cssText}</style>
619 - <os-tabs value=${l.tab} class="os-app-list__tabs" @os-tab-change=${_}>
620 - <os-tab value="posts">${u(c==="pages"?"All pages":"All posts")}</os-tab>
621 - ${e.atlas?b`<os-tab value="atlas">${u("Page atlas")}</os-tab>`:""}
622 - ${t?b`<os-tab value="categories">${u("Categories")}</os-tab><os-tab value="tags">${u("Tags")}</os-tab>`:""}
615 + ${f.desk.view==="table"?f.feed.tail():""}
616 + ${n(h,f,m)}
617 + `};return Hs(s,{local:{"set-column-filters":(h,f)=>{h.author=Array.isArray(f.author)?f.author:[],h.tag=Array.isArray(f.tag)?f.tag:[]}},placeholder:h=>({list:{items:[],total:0,pages:0,page:h.page,perPage:h.perPage,error:"",code:""}}),view:h=>{const f=h.ui(Ie),m=ls(h.extra),y=Ue(),w=x(h,f,m,y),k=`os-app-list desktop-mode-posts${m==="pages"?" desktop-mode-pages":""}`;if(!t&&!e.atlas)return b`<div class=${k} data-os-posts-root data-desk-options=${String(f.desk.filters)}><style>${is.cssText}${os.cssText}</style>
618 + <div class="os-app-list__panel">${w}</div>
619 + </div>`;const C=$=>{const P=$.detail?.value??"posts";v(h,f,P)};return b`<div class=${k} data-os-posts-root data-desk-options=${String(f.desk.filters)}><style>${is.cssText}${os.cssText}</style>
620 + <os-tabs value=${f.tab} class="os-app-list__tabs" @os-tab-change=${C}>
621 + ${g(h).map($=>b`<os-tab value=${$.id}>${$.label}</os-tab>`)}
623 622 </os-tabs>
624 - <os-tabpanel for="posts" class="os-app-list__panel">${p}</os-tabpanel>
623 + <os-tabpanel for="posts" class="os-app-list__panel">${w}</os-tabpanel>
624 + <os-tabpanel for="new" class="os-app-list__panel">
625 + <div data-os-posts-editor class="os-posts__embed-host" os-preserve></div>
626 + </os-tabpanel>
625 627 ${e.atlas?b`<os-tabpanel for="atlas" class="os-app-list__panel"><div data-os-pages-atlas class="os-pages-atlas-host" os-preserve></div></os-tabpanel>`:""}
626 628 ${t?b`<os-tabpanel for="categories" class="os-app-list__panel">
627 629 <div data-os-posts-cats-host class="os-posts__terms-host" os-preserve></div>
628 630 </os-tabpanel>
@@ -628,27 +630,27 @@
628 630 </os-tabpanel>
629 631 <os-tabpanel for="tags" class="os-app-list__panel">
630 632 <div data-os-posts-tags-host class="os-posts__terms-host" os-preserve></div>
631 633 </os-tabpanel>`:""}
632 - </div>`},mounted:r=>{const l=r.ui(dt),c=[];l.stats=li(r.root,r.fetch,Qt(r.extra)),l.stats.sync(),c.push(()=>l.stats?.dispose());const d=pt(r,l,s),p=new MutationObserver(()=>{H(r)?.toggleAttribute("loading",r.root.getAttribute("aria-busy")==="true")});p.observe(r.root,{attributes:!0,attributeFilter:["aria-busy"]}),c.push(()=>p.disconnect()),Re(r,l).fetchAuthorOptions().then(f=>{l.filterData.authors=f,r.repaint()}),l.filterData.loadMoreTags=()=>void ts(r,l),ts(r,l),l.menu=zs(r.root,{section:u("Show columns"),prefix:o,items:Ko(d),isChecked:f=>!de(l).has(f),onToggle:f=>{const v=de(l);v.has(f)?v.delete(f):v.add(f);const x=window.wp?.os;x&&typeof x.updateOsSettings=="function"&&x.updateOsSettings({nativePostsHiddenColumns:Array.from(v).sort()},{windowId:r.windowId}),r.repaint()}}),c.push(()=>l.menu?.dispose());const h=window.wp?.os;if(h&&typeof h.subscribeOsSettings=="function"){let f=Array.from(de(l)).sort().join(",");c.push(h.subscribeOsSettings(()=>{const v=nt(),x=Array.from(v).sort().join(",");x!==f&&(f=x,l.hidden=v,r.repaint(),l.menu?.refresh())}))}h&&typeof h.subscribe=="function"&&c.push(h.subscribe("os.term.changed",f=>{f?.taxonomy==="category"&&(Ht(d),So(d))}));const _=()=>r.repaint();document.addEventListener("os-mode-changed",_),c.push(()=>document.removeEventListener("os-mode-changed",_));const g=at(r,l),m=window.wp?.hooks;return m&&typeof m.doAction=="function"&&m.doAction(Uo,g),document.dispatchEvent(new CustomEvent("os-posts-window-opened",{detail:g})),()=>{l.disposed=!0;for(const f of c)f();l.feed.dispose(),l.atlas?.(),l.canvases.categories?.(),l.canvases.tags?.(),l.canvases={categories:null,tags:null},Ht(d)}},updated:r=>{vi(r.root);const l=H(r);if(!l)return;r.loading&&l.setAttribute("loading","");const c=r.ui(dt);c.stats?.sync(),c.feed.observe(r.root);const{state:d,data:p}=r,h=pt(r,c,s),_=`${Array.from(de(c)).sort().join(",")}|${$i(c.filterData)}`;_!==c.columnsKey&&(c.columnsKey=_,c.cellCache.clear(),c.table.invalidateColumns());const g=c.feed.items;c.table.sync({table:l,rows:g,listKey:[d.perPage,d.search,d.status,d.orderby,d.order,d.author.join(","),d.tag.join(",")].join("|"),fingerprint:ki(g),columns:f=>(c.cellCache.clear(),Bt(h,c.cellCache,c.filterData,f,de(c))),wire:()=>Ci(r,c,l),onSelection:f=>{c.selected=f.length}}).dataChanged&&(g.some(f=>f.id===c.desk.focused)||(c.desk.focused=null),queueMicrotask(()=>{c.disposed||r.repaint()}),c.cellCache.clear(),Ft(h,g),p&&ii(p))}})}const ut=480,is=368;function Ai(o,e,t){var _;const s=new Map(o.map(g=>[g.id,g])),i=new Map(o.map(g=>[g.id,new Set]));for(const g of e)i.get(g.from)?.add(g.to),i.get(g.to)?.add(g.from);const a=new Set,n=[];for(const g of o){if(a.has(g.id))continue;const m=[g.id];a.add(g.id);for(let f=0;f<m.length;f++)for(const v of i.get(m[f])||[])s.has(v)&&!a.has(v)&&(a.add(v),m.push(v));n.push(m)}n.sort((g,m)=>m.length-g.length||g[0]-m[0]);const r=new Map;let l=0,c=1;for(const g of n.filter(m=>m.length>1)){const m=g.includes(t||0)?t:[...g].sort((y,z)=>(i.get(z)?.size||0)-(i.get(y)?.size||0)||y-z)[0],f=new Map([[m,0]]),v=[m];for(let y=0;y<v.length;y++)for(const z of i.get(v[y])||[])!f.has(z)&&s.has(z)&&(f.set(z,f.get(v[y])+1),v.push(z));const x=[];for(const y of v)(x[_=f.get(y)]??(x[_]=[])).push(y);for(let y=0;y<6;y++){const z=x.map((A,F)=>F);y%2&&z.reverse();for(const A of z){const F=x[A+(y%2?1:-1)];if(!F)continue;const Q=new Map(F.map((S,I)=>[S,I])),V=S=>{const I=Array.from(i.get(S)||[]).filter(ee=>Q.has(ee)).map(ee=>Q.get(ee));return I.length?I.reduce((ee,ft)=>ee+ft,0)/I.length:0};x[A].sort((S,I)=>V(S)-V(I)||S-I)}}const C=Math.min(6,Math.max(...x.map(y=>y.length)));let R=0;for(const y of x)y.forEach((z,A)=>r.set(z,{x:(R+Math.floor(A/C))*ut,y:(l+A%C+Math.floor((C-Math.min(C,y.length))/2))*is})),R+=Math.ceil(y.length/C);l+=C+1,c=Math.max(c,R)}const d=n.filter(g=>g.length===1).flat(),p=Math.max(c+(d.length?1:0),Math.ceil(Math.sqrt(o.length*1.2)),1);let h=0;for(const g of d){for(;Math.floor(h/p)<Math.max(0,l-1)&&h%p<c;)h++;r.set(g,{x:h%p*ut,y:Math.floor(h/p)*is}),h++}return[...o].sort((g,m)=>+(m.id===t)-+(g.id===t)).map(g=>({page:g,...r.get(g.id)}))}function zi(o,e,t=0){const s=(t%7-3)*7,i=e.x>=o.x,a={x:o.x+(i?Y:0),y:o.y+ie/2+s},n=o.x===e.x,r={x:e.x+(i&&!n?0:Y),y:e.y+ie/2+s},l=o.x+(i?Y+90+s:-90+s),c=e.x+(i&&!n?-90+s:Y+90+s);let d;if(n)d=[a,{x:l,y:a.y},{x:l,y:r.y},r];else if(o.y===e.y&&Math.abs(o.x-e.x)===ut)d=[a,r];else{const p=o.y+(e.y<o.y?-55:ie+55)+s;d=[a,{x:l,y:a.y},{x:l,y:p},{x:c,y:p},{x:c,y:r.y},r]}return d.filter((p,h)=>!h||p.x!==d[h-1].x||p.y!==d[h-1].y)}const Y=300,ie=258,Ei=1440,Ti=900,J=o=>ue(o.title.rendered)||u("(no title)");function Ie(o,e=location.origin){try{const t=new URL(o.link,e);return t.origin!==e||!/^https?:$/.test(t.protocol)||/\/wp-admin(?:\/|$)|\/wp-login\.php/.test(t.pathname)?null:(t.hash="",["publish","private"].includes(o.status)||t.searchParams.set("preview","true"),t.href)}catch{return null}}function ns(o){const e=o.searchParams.get("page_id")||o.searchParams.get("p");return e?`${o.origin}/#${e}`:`${o.origin}${o.pathname.replace(/\/+$/,"")}`}function as(o){const e=new Map(o.map(i=>[i.id,i])),t=new Map;for(const i of o)try{t.set(ns(new URL(i.link)),i.id)}catch{}const s=new Map;for(const i of o){if(i.parent&&i.parent!==i.id&&e.has(i.parent)&&s.set(`parent:${i.parent}:${i.id}`,{from:i.parent,to:i.id,kind:"parent"}),!i.content?.rendered||i.content.protected)continue;const a=new DOMParser().parseFromString(i.content.rendered,"text/html");for(const n of a.querySelectorAll("a[href]"))try{const r=new URL(i.link),l=new URL(n.getAttribute("href"),r);if(l.origin!==r.origin)continue;const c=Number(l.searchParams.get("page_id")||l.searchParams.get("p")),d=c&&e.has(c)?c:t.get(ns(l));d&&d!==i.id&&s.set(`link:${i.id}:${d}`,{from:i.id,to:d,kind:"link"})}catch{}}return Array.from(s.values())}async function Pi(o,e){const t=[];let s=0,i=1;for(let n=1;n<=Math.min(i,5);n++){const r=new URLSearchParams({context:"edit",status:"publish,future,draft,pending,private",per_page:"100",page:String(n),orderby:"menu_order",order:"asc",_fields:"id,parent,title,link,slug,status,content"}),l=await o(`wp/v2/pages?${r}`,{signal:e});if(!l.ok)throw new Error(u("Pages could not be loaded. Try refreshing the atlas."));const c=await l.json();if(!Array.isArray(c))throw new Error(u("The page response was invalid."));t.push(...c),i=Math.max(1,Number(l.headers.get("X-WP-TotalPages"))||1),s=Number(l.headers.get("X-WP-Total"))||t.length}const a=Array.from(new Map(t.map(n=>[n.id,n])).values());return{pages:a,edges:as(a),total:s}}function Li(o,e,t=as(o)){return Ai(o,t,e)}function ae(o){const e=K(o,"--os-ui-surface","#ffffff",16777215);return{surface:e,raised:K(o,"--os-ui-surface-elevated","#ffffff",e),fg:K(o,"--os-ui-fg","#1d2327",e),muted:K(o,"--os-ui-fg-muted","#50575e",e),faint:K(o,"--os-ui-fg-faint","#b0b3b8",e),border:K(o,"--os-ui-border","#dcdcde",e),accent:K(o,"--os-ui-accent","#2271b1",e)}}function K(o,e,t,s=16777215){const i=document.createElement("span");i.hidden=!0,i.style.color=`var(${e}, ${t})`,o.append(i);const a=getComputedStyle(i).color;i.remove();const n=a.match(/[\d.]+/g)?.map(Number);if(!n||n.length<3)return parseInt(t.slice(1),16);const r=n[3]??1,l=a.startsWith("color(srgb");return[16,8,0].reduce((c,d,p)=>{const h=n[p]*(l?255:1),_=Math.floor(s/2**d)%256;return c+Math.round(h*r+_*(1-r))*2**d},0)}function Mi(o,e,t){let s=JSON.stringify([ae(o),t?.()]);const i=()=>{const n=JSON.stringify([ae(o),t?.()]);n!==s&&(s=n,e())},a=new MutationObserver(i);for(let n=o;n;n=n.parentElement)a.observe(n,{attributes:!0,attributeFilter:["style","class"]});return document.addEventListener("os-desktop-theme-changed",i),()=>{a.disconnect(),document.removeEventListener("os-desktop-theme-changed",i)}}function Ri(o,e,t,s){if(s<.4)return[];const i=new Set(o),a=e.filter(n=>i.has(n));return s<.5?a.slice(0,6):[...new Set([...t!==null&&i.has(t)?[t]:[],...a,...o])].slice(0,6)}async function Ii(o,e){const t=window.wp?.os;if(!t||typeof t.loadModules!="function")return o.textContent=`${e} ${u("Shell modules API missing.")}`,null;try{await t.loadModules(["pixijs"])}catch{return o.textContent=e,null}const s=window.PIXI;return s||(o.textContent=e),s??null}async function Ni(o,e,t){const s=new o.Application;await s.init({resizeTo:e,backgroundAlpha:0,antialias:!0,autoDensity:!0,resolution:Math.min(window.devicePixelRatio||1,2)}),e.appendChild(s.canvas),s.canvas.classList.add(t);const i=new o.Container;return i.x=e.clientWidth/2,i.y=e.clientHeight/2,s.stage.addChild(i),s.stage.eventMode="static",s.stage.hitArea=new o.Rectangle(0,0,e.clientWidth,e.clientHeight),{app:s,world:i}}function rs(o,e,t){try{o.ticker?.stop()}catch{}try{o.destroy({removeView:!0},{children:!0})}catch{}e.replaceChildren(),e.classList.remove(...t)}function ls(o){return Math.hypot(o.b.x-o.a.x,o.b.y-o.a.y)}function cs(o){return{x:(o.a.x+o.b.x)/2,y:(o.a.y+o.b.y)/2}}function Oi(o,e,t,s){const i=ls(e),a=ls(t),n=i>0&&a>0?a/i:1,r=Math.max(s.min,Math.min(s.max,o.scale*n)),l=cs(e),c=cs(t),d=(l.x-o.x)/o.scale,p=(l.y-o.y)/o.scale;return{scale:r,x:c.x-d*r,y:c.y-p*r}}function Di(o,e){const t=o.ownerDocument.defaultView,s=new AbortController,i=new Map,a=o.style.touchAction;o.style.touchAction="none";let n=!1,r=0;const l=p=>{const h=o.getBoundingClientRect();return{x:p.clientX-h.left,y:p.clientY-h.top}},c={capture:!0,passive:!1,signal:s.signal};t.addEventListener("pointerdown",p=>{p.pointerType!=="touch"||!p.composedPath().includes(o)||(i.set(p.pointerId,l(p)),i.size>=2&&(p.preventDefault(),n||(n=!0,e.start())))},c),t.addEventListener("pointermove",p=>{if(!i.has(p.pointerId))return;if(!n){i.set(p.pointerId,l(p));return}const[h,_]=i.values();if(i.set(p.pointerId,l(p)),p.preventDefault(),_){const[g,m]=i.values();e.write(Oi(e.read(),{a:h,b:_},{a:g,b:m},e.bounds))}},c);const d=p=>{i.delete(p.pointerId)&&n&&(p.preventDefault(),i.size||(n=!1,r=performance.now()+300,e.end()))};return t.addEventListener("pointerup",d,c),t.addEventListener("pointercancel",d,c),t.addEventListener("lostpointercapture",d,c),t.addEventListener("click",p=>{p.detail>0&&(n||performance.now()<r)&&p.composedPath().includes(o)&&(p.preventDefault(),p.stopImmediatePropagation())},c),{active:()=>n,dispose:()=>{s.abort(),i.clear(),n&&e.end(),n=!1,o.style.touchAction=a}}}function ht(o,e,t,s){const i=Math.min(1.8,Math.max(.08,e)),a=i/o.zoom;o.x=t-(t-o.x)*a,o.y=s-(s-o.y)*a,o.zoom=i}function qi(o,e,t){const s=new Map,i=new AbortController,{signal:a}=i,n=Di(o,{read:()=>({x:e.x,y:e.y,scale:e.zoom}),write:c=>{e.x=c.x,e.y=c.y,e.zoom=c.scale,t()},bounds:{min:.08,max:1.8},start:()=>{s.clear(),o.classList.add("is-panning")},end:()=>o.classList.remove("is-panning")}),r=c=>{const d=o.getBoundingClientRect();return{x:c.clientX-d.left,y:c.clientY-d.top}};o.addEventListener("pointerdown",c=>{n.active()||c.button!==0||c.target.closest("os-button, a")||(s.set(c.pointerId,r(c)),o.setPointerCapture(c.pointerId),o.classList.add("is-panning"))},{signal:a}),o.addEventListener("pointermove",c=>{const d=s.get(c.pointerId);if(n.active()||!d)return;const p=r(c);s.set(c.pointerId,p),e.x+=p.x-d.x,e.y+=p.y-d.y,t()},{signal:a});const l=c=>{s.delete(c.pointerId),s.size||o.classList.remove("is-panning")};return o.addEventListener("pointerup",l,{signal:a}),o.addEventListener("pointercancel",l,{signal:a}),o.addEventListener("lostpointercapture",l,{signal:a}),o.addEventListener("wheel",c=>{c.preventDefault();const d=o.getBoundingClientRect();ht(e,e.zoom*Math.exp(-c.deltaY*.0015),c.clientX-d.left,c.clientY-d.top),t()},{signal:a,passive:!1}),o.addEventListener("keydown",c=>{if(c.target!==o)return;const d=70;if(c.key==="ArrowLeft")e.x+=d;else if(c.key==="ArrowRight")e.x-=d;else if(c.key==="ArrowUp")e.y+=d;else if(c.key==="ArrowDown")e.y-=d;else if(c.key==="+"||c.key==="="||c.key==="-")ht(e,e.zoom*(c.key==="-"?.8:1.25),o.clientWidth/2,o.clientHeight/2);else return;c.preventDefault(),t()},{signal:a}),()=>{i.abort(),n.dispose(),s.clear(),o.classList.remove("is-panning")}}async function Hi(o,e,t,s,i,a){const n=document.createElement("div"),r=await Ii(n,u("The connection renderer is unavailable."));if(a.aborted)return null;if(!r)throw new Error(n.textContent||u("PixiJS could not load."));const{app:l,world:c}=await Ni(r,o,"os-page-atlas__canvas");if(a.aborted)return rs(l,o,[]),null;l.ticker?.stop();const d=new r.Graphics;c.addChild(d);const p=document.createElement("div");p.className="os-page-atlas__world",o.append(p);const h=Li(e.pages,t,e.edges),_=new Map(h.map(k=>[k.page.id,k])),g=new Map,m=new Map,f={x:30,y:30,zoom:.8};let v=null,x="all",C="",R=!1,y=0,z=0,A=ae(o).accent,F=K(o,"--os-ui-info-fg","#72aee6",ae(o).surface);for(const k of h){const w=document.createElement("article");w.className="os-page-atlas__sheet",w.dataset.pageId=String(k.page.id),w.style.left=`${k.x}px`,w.style.top=`${k.y}px`,G(b`<header class="os-page-atlas__sheet-head"><span aria-hidden="true">${k.page.id===t?"⌂":"▤"}</span><os-button variant="ghost" title=${J(k.page)} @click=${()=>s(k.page.id)}>${J(k.page)}</os-button></header>
634 + </div>`},mounted:h=>{const f=h.ui(Ie),m=[];f.stats=Ci(h.root,h.fetch,ls(h.extra)),f.stats.sync(),m.push(()=>f.stats?.dispose());const y=ft(h,f,o),w=new MutationObserver(()=>{V(h)?.toggleAttribute("loading",h.root.getAttribute("aria-busy")==="true")});w.observe(h.root,{attributes:!0,attributeFilter:["aria-busy"]}),m.push(()=>w.disconnect()),Ne(h,f).fetchAuthorOptions().then(z=>{f.filterData.authors=z,h.repaint()}),f.filterData.loadMoreTags=()=>void ds(h,f),ds(h,f),f.menu=Os(h.root,{section:u("Show columns"),prefix:s,items:ci(y),isChecked:z=>!pe(f,i).has(z),onToggle:z=>{const N=pe(f,i);N.has(z)?N.delete(z):N.add(z);const E=window.wp?.os;E&&typeof E.updateOsSettings=="function"&&E.updateOsSettings({[i]:Array.from(N).sort()},{windowId:h.windowId}),h.repaint()}}),m.push(()=>f.menu?.dispose());const k=window.wp?.os;if(k&&typeof k.subscribeOsSettings=="function"){let z=Array.from(pe(f,i)).sort().join(",");m.push(k.subscribeOsSettings(()=>{const N=Qt(i),E=Array.from(N).sort().join(",");E!==z&&(z=E,f.hidden=N,h.repaint(),f.menu?.refresh())}))}k&&typeof k.subscribe=="function"&&m.push(k.subscribe("os.term.changed",z=>{z?.taxonomy==="category"&&(Gt(y),Vo(y))}));const C=()=>h.repaint();document.addEventListener("os-mode-changed",C),m.push(()=>document.removeEventListener("os-mode-changed",C)),m.push(c(h,f));const $=dt(h,f),P=window.wp?.hooks;return P&&typeof P.doAction=="function"&&P.doAction(ni,$),document.dispatchEvent(new CustomEvent("os-posts-window-opened",{detail:$})),()=>{f.disposed=!0;for(const z of m)z();f.feed.dispose(),f.atlas?.(),f.editor?.(),f.editor=null,f.canvases.categories?.(),f.canvases.tags?.(),f.canvases={categories:null,tags:null},Gt(y)}},updated:h=>{Oi(h.root),_(h,h.ui(Ie));const f=V(h);if(!f)return;h.loading&&f.setAttribute("loading","");const m=h.ui(Ie);m.stats?.sync(),m.feed.observe(h.root);const{state:y,data:w}=h,k=ft(h,m,o),C=`${Array.from(pe(m,i)).sort().join(",")}|${Ui(m.filterData)}`;C!==m.columnsKey&&(m.columnsKey=C,m.cellCache.clear(),m.table.invalidateColumns());const $=m.feed.items;m.table.sync({table:f,rows:$,listKey:[y.perPage,y.search,y.status,y.orderby,y.order,y.author.join(","),y.tag.join(",")].join("|"),fingerprint:Hi($),columns:z=>(m.cellCache.clear(),ct(k,m.cellCache,m.filterData,z,pe(m,i))),wire:()=>Vi(h,m,f),onSelection:z=>{m.selected=z.length}}).dataChanged&&($.some(z=>z.id===m.desk.focused)||(m.desk.focused=null),queueMicrotask(()=>{m.disposed||h.repaint()}),m.cellCache.clear(),Zt(k,$),w&&yi(w))}})}const gt=480,hs=368;function ji(s,e,t){var v;const o=new Map(s.map(_=>[_.id,_])),i=new Map(s.map(_=>[_.id,new Set]));for(const _ of e)i.get(_.from)?.add(_.to),i.get(_.to)?.add(_.from);const a=new Set,n=[];for(const _ of s){if(a.has(_.id))continue;const x=[_.id];a.add(_.id);for(let h=0;h<x.length;h++)for(const f of i.get(x[h])||[])o.has(f)&&!a.has(f)&&(a.add(f),x.push(f));n.push(x)}n.sort((_,x)=>x.length-_.length||_[0]-x[0]);const r=new Map;let l=0,c=1;for(const _ of n.filter(x=>x.length>1)){const x=_.includes(t||0)?t:[..._].sort((k,C)=>(i.get(C)?.size||0)-(i.get(k)?.size||0)||k-C)[0],h=new Map([[x,0]]),f=[x];for(let k=0;k<f.length;k++)for(const C of i.get(f[k])||[])!h.has(C)&&o.has(C)&&(h.set(C,h.get(f[k])+1),f.push(C));const m=[];for(const k of f)(m[v=h.get(k)]??(m[v]=[])).push(k);for(let k=0;k<6;k++){const C=m.map(($,P)=>P);k%2&&C.reverse();for(const $ of C){const P=m[$+(k%2?1:-1)];if(!P)continue;const z=new Map(P.map((E,q)=>[E,q])),N=E=>{const q=Array.from(i.get(E)||[]).filter(ee=>z.has(ee)).map(ee=>z.get(ee));return q.length?q.reduce((ee,bt)=>ee+bt,0)/q.length:0};m[$].sort((E,q)=>N(E)-N(q)||E-q)}}const y=Math.min(6,Math.max(...m.map(k=>k.length)));let w=0;for(const k of m)k.forEach((C,$)=>r.set(C,{x:(w+Math.floor($/y))*gt,y:(l+$%y+Math.floor((y-Math.min(y,k.length))/2))*hs})),w+=Math.ceil(k.length/y);l+=y+1,c=Math.max(c,w)}const d=n.filter(_=>_.length===1).flat(),p=Math.max(c+(d.length?1:0),Math.ceil(Math.sqrt(s.length*1.2)),1);let g=0;for(const _ of d){for(;Math.floor(g/p)<Math.max(0,l-1)&&g%p<c;)g++;r.set(_,{x:g%p*gt,y:Math.floor(g/p)*hs}),g++}return[...s].sort((_,x)=>+(x.id===t)-+(_.id===t)).map(_=>({page:_,...r.get(_.id)}))}function Ki(s,e,t=0){const o=(t%7-3)*7,i=e.x>=s.x,a={x:s.x+(i?J:0),y:s.y+ie/2+o},n=s.x===e.x,r={x:e.x+(i&&!n?0:J),y:e.y+ie/2+o},l=s.x+(i?J+90+o:-90+o),c=e.x+(i&&!n?-90+o:J+90+o);let d;if(n)d=[a,{x:l,y:a.y},{x:l,y:r.y},r];else if(s.y===e.y&&Math.abs(s.x-e.x)===gt)d=[a,r];else{const p=s.y+(e.y<s.y?-55:ie+55)+o;d=[a,{x:l,y:a.y},{x:l,y:p},{x:c,y:p},{x:c,y:r.y},r]}return d.filter((p,g)=>!g||p.x!==d[g-1].x||p.y!==d[g-1].y)}const J=300,ie=258,Bi=1440,Gi=900,Q=s=>ae(s.title.rendered)||u("(no title)");function Oe(s,e=location.origin){try{const t=new URL(s.link,e);return t.origin!==e||!/^https?:$/.test(t.protocol)||/\/wp-admin(?:\/|$)|\/wp-login\.php/.test(t.pathname)?null:(t.hash="",["publish","private"].includes(s.status)||t.searchParams.set("preview","true"),t.href)}catch{return null}}function fs(s){const e=s.searchParams.get("page_id")||s.searchParams.get("p");return e?`${s.origin}/#${e}`:`${s.origin}${s.pathname.replace(/\/+$/,"")}`}function gs(s){const e=new Map(s.map(i=>[i.id,i])),t=new Map;for(const i of s)try{t.set(fs(new URL(i.link)),i.id)}catch{}const o=new Map;for(const i of s){if(i.parent&&i.parent!==i.id&&e.has(i.parent)&&o.set(`parent:${i.parent}:${i.id}`,{from:i.parent,to:i.id,kind:"parent"}),!i.content?.rendered||i.content.protected)continue;const a=new DOMParser().parseFromString(i.content.rendered,"text/html");for(const n of a.querySelectorAll("a[href]"))try{const r=new URL(i.link),l=new URL(n.getAttribute("href"),r);if(l.origin!==r.origin)continue;const c=Number(l.searchParams.get("page_id")||l.searchParams.get("p")),d=c&&e.has(c)?c:t.get(fs(l));d&&d!==i.id&&o.set(`link:${i.id}:${d}`,{from:i.id,to:d,kind:"link"})}catch{}}return Array.from(o.values())}async function Zi(s,e){const t=[];let o=0,i=1;for(let n=1;n<=Math.min(i,5);n++){const r=new URLSearchParams({context:"edit",status:"publish,future,draft,pending,private",per_page:"100",page:String(n),orderby:"menu_order",order:"asc",_fields:"id,parent,title,link,slug,status,content"}),l=await s(`wp/v2/pages?${r}`,{signal:e});if(!l.ok)throw new Error(u("Pages could not be loaded. Try refreshing the atlas."));const c=await l.json();if(!Array.isArray(c))throw new Error(u("The page response was invalid."));t.push(...c),i=Math.max(1,Number(l.headers.get("X-WP-TotalPages"))||1),o=Number(l.headers.get("X-WP-Total"))||t.length}const a=Array.from(new Map(t.map(n=>[n.id,n])).values());return{pages:a,edges:gs(a),total:o}}function Xi(s,e,t=gs(s)){return ji(s,t,e)}function re(s){const e=B(s,"--os-ui-surface","#ffffff",16777215);return{surface:e,raised:B(s,"--os-ui-surface-elevated","#ffffff",e),fg:B(s,"--os-ui-fg","#1d2327",e),muted:B(s,"--os-ui-fg-muted","#50575e",e),faint:B(s,"--os-ui-fg-faint","#b0b3b8",e),border:B(s,"--os-ui-border","#dcdcde",e),accent:B(s,"--os-ui-accent","#2271b1",e)}}function B(s,e,t,o=16777215){const i=document.createElement("span");i.hidden=!0,i.style.color=`var(${e}, ${t})`,s.append(i);const a=getComputedStyle(i).color;i.remove();const n=a.match(/[\d.]+/g)?.map(Number);if(!n||n.length<3)return parseInt(t.slice(1),16);const r=n[3]??1,l=a.startsWith("color(srgb");return[16,8,0].reduce((c,d,p)=>{const g=n[p]*(l?255:1),v=Math.floor(o/2**d)%256;return c+Math.round(g*r+v*(1-r))*2**d},0)}function Yi(s,e,t){let o=JSON.stringify([re(s),t?.()]);const i=()=>{const n=JSON.stringify([re(s),t?.()]);n!==o&&(o=n,e())},a=new MutationObserver(i);for(let n=s;n;n=n.parentElement)a.observe(n,{attributes:!0,attributeFilter:["style","class"]});return document.addEventListener("os-desktop-theme-changed",i),()=>{a.disconnect(),document.removeEventListener("os-desktop-theme-changed",i)}}function Ji(s,e,t,o){if(o<.4)return[];const i=new Set(s),a=e.filter(n=>i.has(n));return o<.5?a.slice(0,6):[...new Set([...t!==null&&i.has(t)?[t]:[],...a,...s])].slice(0,6)}async function Qi(s,e){const t=window.wp?.os;if(!t||typeof t.loadModules!="function")return s.textContent=`${e} ${u("Shell modules API missing.")}`,null;try{await t.loadModules(["pixijs"])}catch{return s.textContent=e,null}const o=window.PIXI;return o||(s.textContent=e),o??null}async function en(s,e,t){const o=new s.Application;await o.init({resizeTo:e,backgroundAlpha:0,antialias:!0,autoDensity:!0,resolution:Math.min(window.devicePixelRatio||1,2)}),e.appendChild(o.canvas),o.canvas.classList.add(t);const i=new s.Container;return i.x=e.clientWidth/2,i.y=e.clientHeight/2,o.stage.addChild(i),o.stage.eventMode="static",o.stage.hitArea=new s.Rectangle(0,0,e.clientWidth,e.clientHeight),{app:o,world:i}}function ms(s,e,t){try{s.ticker?.stop()}catch{}try{s.destroy({removeView:!0},{children:!0})}catch{}e.replaceChildren(),e.classList.remove(...t)}function bs(s){return Math.hypot(s.b.x-s.a.x,s.b.y-s.a.y)}function _s(s){return{x:(s.a.x+s.b.x)/2,y:(s.a.y+s.b.y)/2}}function tn(s,e,t,o){const i=bs(e),a=bs(t),n=i>0&&a>0?a/i:1,r=Math.max(o.min,Math.min(o.max,s.scale*n)),l=_s(e),c=_s(t),d=(l.x-s.x)/s.scale,p=(l.y-s.y)/s.scale;return{scale:r,x:c.x-d*r,y:c.y-p*r}}function sn(s,e){const t=s.ownerDocument.defaultView,o=new AbortController,i=new Map,a=s.style.touchAction;s.style.touchAction="none";let n=!1,r=0;const l=p=>{const g=s.getBoundingClientRect();return{x:p.clientX-g.left,y:p.clientY-g.top}},c={capture:!0,passive:!1,signal:o.signal};t.addEventListener("pointerdown",p=>{p.pointerType!=="touch"||!p.composedPath().includes(s)||(i.set(p.pointerId,l(p)),i.size>=2&&(p.preventDefault(),n||(n=!0,e.start())))},c),t.addEventListener("pointermove",p=>{if(!i.has(p.pointerId))return;if(!n){i.set(p.pointerId,l(p));return}const[g,v]=i.values();if(i.set(p.pointerId,l(p)),p.preventDefault(),v){const[_,x]=i.values();e.write(tn(e.read(),{a:g,b:v},{a:_,b:x},e.bounds))}},c);const d=p=>{i.delete(p.pointerId)&&n&&(p.preventDefault(),i.size||(n=!1,r=performance.now()+300,e.end()))};return t.addEventListener("pointerup",d,c),t.addEventListener("pointercancel",d,c),t.addEventListener("lostpointercapture",d,c),t.addEventListener("click",p=>{p.detail>0&&(n||performance.now()<r)&&p.composedPath().includes(s)&&(p.preventDefault(),p.stopImmediatePropagation())},c),{active:()=>n,dispose:()=>{o.abort(),i.clear(),n&&e.end(),n=!1,s.style.touchAction=a}}}function mt(s,e,t,o){const i=Math.min(1.8,Math.max(.08,e)),a=i/s.zoom;s.x=t-(t-s.x)*a,s.y=o-(o-s.y)*a,s.zoom=i}function on(s,e,t){const o=new Map,i=new AbortController,{signal:a}=i,n=sn(s,{read:()=>({x:e.x,y:e.y,scale:e.zoom}),write:c=>{e.x=c.x,e.y=c.y,e.zoom=c.scale,t()},bounds:{min:.08,max:1.8},start:()=>{o.clear(),s.classList.add("is-panning")},end:()=>s.classList.remove("is-panning")}),r=c=>{const d=s.getBoundingClientRect();return{x:c.clientX-d.left,y:c.clientY-d.top}};s.addEventListener("pointerdown",c=>{n.active()||c.button!==0||c.target.closest("os-button, a")||(o.set(c.pointerId,r(c)),s.setPointerCapture(c.pointerId),s.classList.add("is-panning"))},{signal:a}),s.addEventListener("pointermove",c=>{const d=o.get(c.pointerId);if(n.active()||!d)return;const p=r(c);o.set(c.pointerId,p),e.x+=p.x-d.x,e.y+=p.y-d.y,t()},{signal:a});const l=c=>{o.delete(c.pointerId),o.size||s.classList.remove("is-panning")};return s.addEventListener("pointerup",l,{signal:a}),s.addEventListener("pointercancel",l,{signal:a}),s.addEventListener("lostpointercapture",l,{signal:a}),s.addEventListener("wheel",c=>{c.preventDefault();const d=s.getBoundingClientRect();mt(e,e.zoom*Math.exp(-c.deltaY*.0015),c.clientX-d.left,c.clientY-d.top),t()},{signal:a,passive:!1}),s.addEventListener("keydown",c=>{if(c.target!==s)return;const d=70;if(c.key==="ArrowLeft")e.x+=d;else if(c.key==="ArrowRight")e.x-=d;else if(c.key==="ArrowUp")e.y+=d;else if(c.key==="ArrowDown")e.y-=d;else if(c.key==="+"||c.key==="="||c.key==="-")mt(e,e.zoom*(c.key==="-"?.8:1.25),s.clientWidth/2,s.clientHeight/2);else return;c.preventDefault(),t()},{signal:a}),()=>{i.abort(),n.dispose(),o.clear(),s.classList.remove("is-panning")}}async function nn(s,e,t,o,i,a){const n=document.createElement("div"),r=await Qi(n,u("The connection renderer is unavailable."));if(a.aborted)return null;if(!r)throw new Error(n.textContent||u("PixiJS could not load."));const{app:l,world:c}=await en(r,s,"os-page-atlas__canvas");if(a.aborted)return ms(l,s,[]),null;l.ticker?.stop();const d=new r.Graphics;c.addChild(d);const p=document.createElement("div");p.className="os-page-atlas__world",s.append(p);const g=Xi(e.pages,t,e.edges),v=new Map(g.map(S=>[S.page.id,S])),_=new Map,x=new Map,h={x:30,y:30,zoom:.8};let f=null,m="all",y="",w=!1,k=0,C=0,$=re(s).accent,P=B(s,"--os-ui-info-fg","#72aee6",re(s).surface);for(const S of g){const A=document.createElement("article");A.className="os-page-atlas__sheet",A.dataset.pageId=String(S.page.id),A.style.left=`${S.x}px`,A.style.top=`${S.y}px`,Z(b`<header class="os-page-atlas__sheet-head"><span aria-hidden="true">${S.page.id===t?"⌂":"▤"}</span><os-button variant="ghost" title=${Q(S.page)} @click=${()=>o(S.page.id)}>${Q(S.page)}</os-button></header>
633 635 <div class="os-page-atlas__viewport"><div class="os-page-atlas__placeholder">${u("Zoom closer for a live preview")}</div></div>
634 - <footer class="os-page-atlas__sheet-foot"><span>/${k.page.slug}</span><span>${Be[k.page.status]||k.page.status}</span></footer>`,w),p.append(w),g.set(k.page.id,w)}const Q=(k,w,E,W,$)=>{k.moveTo(w[0].x,w[0].y);for(let N=1;N<w.length-1;N++){const T=w[N-1],L=w[N],te=w[N+1],B=Math.hypot(L.x-T.x,L.y-T.y),gt=Math.hypot(te.x-L.x,te.y-L.y),Ne=Math.min(14,B/2,gt/2),us={x:L.x+(T.x-L.x)/B*Ne,y:L.y+(T.y-L.y)/B*Ne},hs={x:L.x+(te.x-L.x)/gt*Ne,y:L.y+(te.y-L.y)/gt*Ne};k.lineTo(us.x,us.y).bezierCurveTo(L.x,L.y,L.x,L.y,hs.x,hs.y)}const M=w[w.length-1];k.lineTo(M.x,M.y).stroke({color:E,width:W,alpha:$})},V=()=>{d.clear();const k=new Set;for(const[w,E]of e.edges.entries()){if(x!=="all"&&E.kind!==x)continue;const W=_.get(E.from),$=_.get(E.to);if(!W||!$)continue;const M=v===null||E.from===v||E.to===v;M&&(k.add(E.from),k.add(E.to));const N=E.kind==="parent"?A:F,T=zi(W,$,w);Q(d,T,N,M?10:4,M?.07:.025),Q(d,T,N,M?2:1,M?.7:.14);const L=T[T.length-1],te=T[T.length-2],B=Math.sign(L.x-te.x)||1;d.moveTo(L.x-B*9,L.y-5).lineTo(L.x,L.y).lineTo(L.x-B*9,L.y+5).stroke({color:N,width:2,alpha:M?.9:.16}),d.circle(T[0].x,T[0].y,3).fill({color:N,alpha:M?.9:.16})}for(const w of h){const E=g.get(w.page.id);E.classList.toggle("is-selected",w.page.id===v),E.classList.toggle("is-muted",C?!`${J(w.page)} ${w.page.slug}`.toLocaleLowerCase().includes(C):v!==null&&w.page.id!==v&&!k.has(w.page.id))}},S=()=>{if(R)return;const k=o.clientWidth,w=o.clientHeight,E=k&&w?h.filter($=>f.x+($.x+Y)*f.zoom>0&&f.y+($.y+ie)*f.zoom>0&&f.x+$.x*f.zoom<k&&f.y+$.y*f.zoom<w).sort(($,M)=>$.page.id===v?-1:M.page.id===v?1:Math.hypot(f.x+$.x*f.zoom-k/2,f.y+$.y*f.zoom-w/2)-Math.hypot(f.x+M.x*f.zoom-k/2,f.y+M.y*f.zoom-w/2)):[],W=new Set(Ri(E.filter($=>Ie($.page)).map($=>$.page.id),[...m.keys()],v,f.zoom));for(const[$,M]of g){const N=M.querySelector(".os-page-atlas__placeholder");N.textContent=f.zoom<.5?u("Zoom closer for a live preview"):u("Select this page for a live preview"),Ie(_.get($).page)||(N.textContent=u("Open the editor to preview this page."))}for(const[$,M]of m)W.has($)||(M.remove(),m.delete($));for(const $ of E){if(!W.has($.page.id)||m.has($.page.id))continue;const M=g.get($.page.id).querySelector(".os-page-atlas__viewport"),N=Ie($.page);if(!N)continue;const T=document.createElement("iframe");T.title=`${u("Page preview")}: ${J($.page)}`,T.width=String(Ei),T.height=String(Ti),T.tabIndex=-1,T.setAttribute("aria-hidden","true"),T.setAttribute("inert",""),T.setAttribute("sandbox","allow-scripts allow-same-origin"),T.src=N,M.append(T),m.set($.page.id,T)}},I=()=>{R||(c.x=f.x,c.y=f.y,c.scale.set(f.zoom),p.style.transform=`translate(${f.x}px, ${f.y}px) scale(${f.zoom})`,l.render(),i(f.zoom),clearTimeout(y),y=window.setTimeout(S,160))},ee=()=>{if(!o.clientWidth||!o.clientHeight)return;const k=Math.max(Y,...h.map(E=>E.x+Y)),w=Math.max(ie,...h.map(E=>E.y+ie));f.zoom=Math.max(.08,Math.min(1,(o.clientWidth-70)/k,(o.clientHeight-70)/w)),f.x=(o.clientWidth-k*f.zoom)/2,f.y=(o.clientHeight-w*f.zoom)/2,I()},ft=k=>{const w=_.get(k);if(!w)return;v=k,V();const E={...f},W=Math.min(1.1,(o.clientWidth-80)/Y,(o.clientHeight-80)/ie),$={zoom:Math.max(.35,W),x:o.clientWidth/2-(w.x+Y/2)*W,y:o.clientHeight/2-(w.y+ie/2)*W};cancelAnimationFrame(z);const M=window.matchMedia("(prefers-reduced-motion: reduce)").matches,N=performance.now(),T=L=>{if(R)return;const te=M?1:Math.min(1,(L-N)/330),B=1-Math.pow(1-te,3);f.x=E.x+($.x-E.x)*B,f.y=E.y+($.y-E.y)*B,f.zoom=E.zoom+($.zoom-E.zoom)*B,I(),te<1&&(z=requestAnimationFrame(T))};z=requestAnimationFrame(T)},Wi=Mi(o,()=>{A=ae(o).accent,F=K(o,"--os-ui-info-fg","#72aee6",ae(o).surface),V(),l.render()},()=>K(o,"--os-ui-info-fg","#72aee6",ae(o).surface)),ji=qi(o,f,I);let ds=!1;const ps=new ResizeObserver(()=>{R||(o.clientWidth&&o.clientHeight?(l.renderer.resize(o.clientWidth,o.clientHeight),ds?I():(ee(),ds=!0)):S())});return ps.observe(o),V(),ee(),{focus:ft,fit:()=>{cancelAnimationFrame(z),v=null,V(),ee()},filter:(k,w)=>{x=k,C=w.toLocaleLowerCase().trim(),V(),I()},zoom:k=>{cancelAnimationFrame(z),ht(f,f.zoom*k,o.clientWidth/2,o.clientHeight/2),I()},dispose:()=>{R=!0,Wi(),clearTimeout(y),cancelAnimationFrame(z),ji(),ps.disconnect(),m.forEach(k=>k.remove()),rs(l,o,[])}}}const Fi=P` .os-page-atlas{display:flex;flex-direction:column;flex:1;min-inline-size:0;min-block-size:0;color:var( --os-ui-fg,#1d2327 );background:var( --os-ui-surface,#fff );container:page-atlas / inline-size}.os-page-atlas__head{display:flex;align-items:center;justify-content:space-between;gap:18px;padding:20px 24px 16px}.os-page-atlas__head h2{font-size:29px;font-weight:500;line-height:1.1;letter-spacing:-.045em;margin:0 0 6px;color:inherit}.os-page-atlas__head p{font-size:11px;margin:0;color:var( --os-ui-fg-muted,#646970 )}.os-page-atlas__totals{display:flex;gap:18px;--os-ui-stat-padding:0;--os-ui-stat-border:transparent;--os-ui-stat-value-color:var( --os-ui-fg,#1d2327 );--os-ui-stat-value-size:26px}.os-page-atlas__tools{display:flex;flex-wrap:wrap;align-items:center;gap:8px;padding:8px 24px;border-block:1px solid var( --os-ui-border,#dcdcde )}.os-page-atlas__tools os-text-field{flex:1;min-inline-size:130px}.os-page-atlas__tools os-select{inline-size:152px}.os-page-atlas__main{display:flex;flex:1;min-block-size:0;position:relative;overflow:hidden}.os-page-atlas__stage{position:relative;flex:1;min-inline-size:0;min-block-size:0;overflow:hidden;touch-action:none;cursor:grab;background-color:var( --os-ui-surface-sunken,#f6f7f7 );background-image:radial-gradient(circle,var( --os-ui-border,#dcdcde ) .7px,transparent .9px);background-size:22px 22px;isolation:isolate}.os-page-atlas__surface{position:absolute;inset:0;overflow:hidden;touch-action:none}.os-page-atlas__surface:focus-visible{outline:2px solid var( --os-ui-accent,#2271b1 );outline-offset:-3px}.os-page-atlas__surface.is-panning{cursor:grabbing;user-select:none}.os-page-atlas__canvas{position:absolute;inset:0;pointer-events:none;z-index:0}.os-page-atlas__world{position:absolute;inset:0 auto auto 0;transform-origin:0 0;z-index:1}.os-page-atlas__sheet{position:absolute;box-sizing:border-box;inline-size:300px;block-size:258px;border:1px solid var( --os-ui-border,#dcdcde );border-radius:8px;background:var( --os-ui-surface,#fff );box-shadow:0 12px 25px -16px var( --os-ui-fg-muted,#646970 ),4px 5px 0 -1px var( --os-ui-surface,#fff ),4px 5px 0 0 var( --os-ui-border,#dcdcde )}.os-page-atlas__sheet.is-selected{outline:2px solid var( --os-ui-accent,#2271b1 );outline-offset:4px}.os-page-atlas__sheet.is-muted{opacity:.36}.os-page-atlas__sheet-head{display:flex;align-items:center;gap:7px;padding:6px 9px;block-size:30px}.os-page-atlas__sheet-head>span{color:var( --os-ui-accent,#2271b1 );font-size:13px}.os-page-atlas__sheet-head os-button{flex:1;min-inline-size:0;text-align:start;--os-ui-button-padding:3px 0}.os-page-atlas__sheet-head os-button::part(button){display:block;inline-size:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;text-align:start}.os-page-atlas__viewport{position:relative;inline-size:288px;block-size:180px;margin-inline:5px;overflow:hidden;border-radius:3px;background:var( --os-ui-surface-sunken,#f6f7f7 );pointer-events:none}.os-page-atlas__viewport iframe{position:absolute;inset:0 auto auto 0;display:block;width:1440px !important;height:900px !important;max-width:none !important;max-height:none !important;border:0;transform:scale(.2);transform-origin:0 0;pointer-events:none}.os-page-atlas__placeholder{position:absolute;inset:0;display:grid;place-content:center;text-align:center;padding:20px;font-size:12px;color:var( --os-ui-fg-muted,#646970 );background-image:repeating-linear-gradient(transparent 0 21px,var( --os-ui-border-subtle,#f0f0f1 ) 21px 22px)}.os-page-atlas__sheet-foot{display:flex;justify-content:space-between;gap:6px;padding:8px 10px;font-size:10px;color:var( --os-ui-fg-muted,#646970 )}.os-page-atlas__sheet-foot span:first-child{max-inline-size:210px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.os-page-atlas__directory{flex:0 0 215px;min-inline-size:0;padding:14px;border-inline-start:1px solid var( --os-ui-border,#dcdcde );display:flex;flex-direction:column;gap:12px}.os-page-atlas__directory h3{margin:0;font-size:11px;font-weight:600;letter-spacing:.1em;text-transform:uppercase;color:var( --os-ui-fg-muted,#646970 )}.os-page-atlas__list{overflow:auto;flex:1;min-block-size:0;display:flex;flex-direction:column;gap:5px}.os-page-atlas__list os-button{display:block;text-align:start;--os-ui-button-padding:8px 10px}.os-page-atlas__list os-button::part(button){inline-size:100%;justify-content:space-between;text-align:start}.os-page-atlas__list os-button span{font-variant-numeric:tabular-nums;font-size:10px;color:var( --os-ui-fg-muted,#646970 )}.os-page-atlas__list os-button[aria-pressed="true"]{outline:1px solid var( --os-ui-accent,#2271b1 );border-radius:7px}.os-page-atlas__selection{font-size:12px;border-block-start:1px solid var( --os-ui-border,#dcdcde );padding-block-start:10px}.os-page-atlas__selection strong{display:block;margin-block-end:6px;overflow-wrap:anywhere}.os-page-atlas__selection p{font-size:11px;color:var( --os-ui-fg-muted,#646970 );line-height:1.6}.os-page-atlas__selection os-button{margin-block:4px}.os-page-atlas__legend{display:flex;align-items:center;gap:14px;padding:9px 20px;font-size:10px;color:var( --os-ui-fg-muted,#646970 );border-block-start:1px solid var( --os-ui-border,#dcdcde );flex-wrap:wrap}.os-page-atlas__legend span{display:inline-flex;align-items:center;gap:6px}.os-page-atlas__legend i{inline-size:20px;border-block-start:2px solid var( --os-ui-accent,#2271b1 )}.os-page-atlas__legend .is-link{border-color:var( --os-ui-info,#72aee6 )}.os-page-atlas__legend small{margin-inline-start:auto;font-size:inherit}.os-page-atlas__zoom{position:absolute;inset-block-end:14px;inset-inline-start:14px;z-index:3;display:flex;align-items:center;gap:3px;padding:4px;border:1px solid var( --os-ui-border,#dcdcde );border-radius:9px;background:var( --os-ui-surface,#fff )}.os-page-atlas__zoom output{min-inline-size:42px;font-size:10px;text-align:center}.os-page-atlas__message{padding:20px;font-size:12px;color:var( --os-ui-fg-muted,#646970 )}.os-page-atlas__refresh .dashicons{inline-size:16px;block-size:16px;font-size:16px}.os-page-atlas__browse{display:none}@container page-atlas (max-width:720px){.os-page-atlas__head{padding:12px;gap:10px}.os-page-atlas__head h2{font-size:21px}.os-page-atlas__head p{display:none}.os-page-atlas__totals{gap:12px;--os-ui-stat-value-size:19px}.os-page-atlas__totals os-stat::part(label){font-size:8px}.os-page-atlas__tools{padding:6px 12px;gap:6px}.os-page-atlas__tools os-text-field{min-inline-size:85px}.os-page-atlas__refresh{--os-ui-button-padding:6px}.os-page-atlas__refresh-label{position:absolute;inline-size:1px;block-size:1px;overflow:hidden;clip-path:inset(50%)}.os-page-atlas__tools os-select{inline-size:108px}.os-page-atlas__browse{display:block}.os-page-atlas__directory{display:none}.os-page-atlas.is-browsing .os-page-atlas__directory{display:flex;flex:1;border:0}.os-page-atlas.is-browsing .os-page-atlas__stage,.os-page-atlas.is-browsing .os-page-atlas__zoom{display:none}.os-page-atlas__legend{padding:7px 12px;gap:8px}.os-page-atlas__legend small{display:none}}`;function Ui(o,e){let t=!1,s=new AbortController,i=null,a={pages:[],edges:[],total:0},n=null,r="",l="all";const c=()=>{h.classList.toggle("is-browsing")},d=y=>{n=y,h.classList.remove("is-browsing"),C(),requestAnimationFrame(()=>{t||i?.focus(y)})},p=()=>{i?.filter(l,r),C()};G(b`<style>${Fi.cssText}</style><section class="os-page-atlas" aria-label=${u("Page atlas")}>
636 + <footer class="os-page-atlas__sheet-foot"><span>/${S.page.slug}</span><span>${Ze[S.page.status]||S.page.status}</span></footer>`,A),p.append(A),_.set(S.page.id,A)}const z=(S,A,M,j,T)=>{S.moveTo(A[0].x,A[0].y);for(let D=1;D<A.length-1;D++){const L=A[D-1],I=A[D],te=A[D+1],G=Math.hypot(I.x-L.x,I.y-L.y),_t=Math.hypot(te.x-I.x,te.y-I.y),qe=Math.min(14,G/2,_t/2),ys={x:I.x+(L.x-I.x)/G*qe,y:I.y+(L.y-I.y)/G*qe},ks={x:I.x+(te.x-I.x)/_t*qe,y:I.y+(te.y-I.y)/_t*qe};S.lineTo(ys.x,ys.y).bezierCurveTo(I.x,I.y,I.x,I.y,ks.x,ks.y)}const O=A[A.length-1];S.lineTo(O.x,O.y).stroke({color:M,width:j,alpha:T})},N=()=>{d.clear();const S=new Set;for(const[A,M]of e.edges.entries()){if(m!=="all"&&M.kind!==m)continue;const j=v.get(M.from),T=v.get(M.to);if(!j||!T)continue;const O=f===null||M.from===f||M.to===f;O&&(S.add(M.from),S.add(M.to));const D=M.kind==="parent"?$:P,L=Ki(j,T,A);z(d,L,D,O?10:4,O?.07:.025),z(d,L,D,O?2:1,O?.7:.14);const I=L[L.length-1],te=L[L.length-2],G=Math.sign(I.x-te.x)||1;d.moveTo(I.x-G*9,I.y-5).lineTo(I.x,I.y).lineTo(I.x-G*9,I.y+5).stroke({color:D,width:2,alpha:O?.9:.16}),d.circle(L[0].x,L[0].y,3).fill({color:D,alpha:O?.9:.16})}for(const A of g){const M=_.get(A.page.id);M.classList.toggle("is-selected",A.page.id===f),M.classList.toggle("is-muted",y?!`${Q(A.page)} ${A.page.slug}`.toLocaleLowerCase().includes(y):f!==null&&A.page.id!==f&&!S.has(A.page.id))}},E=()=>{if(w)return;const S=s.clientWidth,A=s.clientHeight,M=S&&A?g.filter(T=>h.x+(T.x+J)*h.zoom>0&&h.y+(T.y+ie)*h.zoom>0&&h.x+T.x*h.zoom<S&&h.y+T.y*h.zoom<A).sort((T,O)=>T.page.id===f?-1:O.page.id===f?1:Math.hypot(h.x+T.x*h.zoom-S/2,h.y+T.y*h.zoom-A/2)-Math.hypot(h.x+O.x*h.zoom-S/2,h.y+O.y*h.zoom-A/2)):[],j=new Set(Ji(M.filter(T=>Oe(T.page)).map(T=>T.page.id),[...x.keys()],f,h.zoom));for(const[T,O]of _){const D=O.querySelector(".os-page-atlas__placeholder");D.textContent=h.zoom<.5?u("Zoom closer for a live preview"):u("Select this page for a live preview"),Oe(v.get(T).page)||(D.textContent=u("Open the editor to preview this page."))}for(const[T,O]of x)j.has(T)||(O.remove(),x.delete(T));for(const T of M){if(!j.has(T.page.id)||x.has(T.page.id))continue;const O=_.get(T.page.id).querySelector(".os-page-atlas__viewport"),D=Oe(T.page);if(!D)continue;const L=document.createElement("iframe");L.title=`${u("Page preview")}: ${Q(T.page)}`,L.width=String(Bi),L.height=String(Gi),L.tabIndex=-1,L.setAttribute("aria-hidden","true"),L.setAttribute("inert",""),L.setAttribute("sandbox","allow-scripts allow-same-origin"),L.src=D,O.append(L),x.set(T.page.id,L)}},q=()=>{w||(c.x=h.x,c.y=h.y,c.scale.set(h.zoom),p.style.transform=`translate(${h.x}px, ${h.y}px) scale(${h.zoom})`,l.render(),i(h.zoom),clearTimeout(k),k=window.setTimeout(E,160))},ee=()=>{if(!s.clientWidth||!s.clientHeight)return;const S=Math.max(J,...g.map(M=>M.x+J)),A=Math.max(ie,...g.map(M=>M.y+ie));h.zoom=Math.max(.08,Math.min(1,(s.clientWidth-70)/S,(s.clientHeight-70)/A)),h.x=(s.clientWidth-S*h.zoom)/2,h.y=(s.clientHeight-A*h.zoom)/2,q()},bt=S=>{const A=v.get(S);if(!A)return;f=S,N();const M={...h},j=Math.min(1.1,(s.clientWidth-80)/J,(s.clientHeight-80)/ie),T={zoom:Math.max(.35,j),x:s.clientWidth/2-(A.x+J/2)*j,y:s.clientHeight/2-(A.y+ie/2)*j};cancelAnimationFrame(C);const O=window.matchMedia("(prefers-reduced-motion: reduce)").matches,D=performance.now(),L=I=>{if(w)return;const te=O?1:Math.min(1,(I-D)/330),G=1-Math.pow(1-te,3);h.x=M.x+(T.x-M.x)*G,h.y=M.y+(T.y-M.y)*G,h.zoom=M.zoom+(T.zoom-M.zoom)*G,q(),te<1&&(C=requestAnimationFrame(L))};C=requestAnimationFrame(L)},cn=Yi(s,()=>{$=re(s).accent,P=B(s,"--os-ui-info-fg","#72aee6",re(s).surface),N(),l.render()},()=>B(s,"--os-ui-info-fg","#72aee6",re(s).surface)),dn=on(s,h,q);let vs=!1;const xs=new ResizeObserver(()=>{w||(s.clientWidth&&s.clientHeight?(l.renderer.resize(s.clientWidth,s.clientHeight),vs?q():(ee(),vs=!0)):E())});return xs.observe(s),N(),ee(),{focus:bt,fit:()=>{cancelAnimationFrame(C),f=null,N(),ee()},filter:(S,A)=>{m=S,y=A.toLocaleLowerCase().trim(),N(),q()},zoom:S=>{cancelAnimationFrame(C),mt(h,h.zoom*S,s.clientWidth/2,s.clientHeight/2),q()},dispose:()=>{w=!0,cn(),clearTimeout(k),cancelAnimationFrame(C),dn(),xs.disconnect(),x.forEach(S=>S.remove()),ms(l,s,[])}}}const an=R` .os-page-atlas{display:flex;flex-direction:column;flex:1;min-inline-size:0;min-block-size:0;color:var( --os-ui-fg,#1d2327 );background:var( --os-ui-surface,#fff );container:page-atlas / inline-size}.os-page-atlas__head{display:flex;align-items:center;justify-content:space-between;gap:18px;padding:20px 24px 16px}.os-page-atlas__head h2{font-size:29px;font-weight:500;line-height:1.1;letter-spacing:-.045em;margin:0 0 6px;color:inherit}.os-page-atlas__head p{font-size:11px;margin:0;color:var( --os-ui-fg-muted,#646970 )}.os-page-atlas__totals{display:flex;gap:18px;--os-ui-stat-padding:0;--os-ui-stat-border:transparent;--os-ui-stat-value-color:var( --os-ui-fg,#1d2327 );--os-ui-stat-value-size:26px}.os-page-atlas__tools{display:flex;flex-wrap:wrap;align-items:center;gap:8px;padding:8px 24px;border-block:1px solid var( --os-ui-border,#dcdcde )}.os-page-atlas__tools os-text-field{flex:1;min-inline-size:130px}.os-page-atlas__tools os-select{inline-size:152px}.os-page-atlas__main{display:flex;flex:1;min-block-size:0;position:relative;overflow:hidden}.os-page-atlas__stage{position:relative;flex:1;min-inline-size:0;min-block-size:0;overflow:hidden;touch-action:none;cursor:grab;background-color:var( --os-ui-surface-sunken,#f6f7f7 );background-image:radial-gradient(circle,var( --os-ui-border,#dcdcde ) .7px,transparent .9px);background-size:22px 22px;isolation:isolate}.os-page-atlas__surface{position:absolute;inset:0;overflow:hidden;touch-action:none}.os-page-atlas__surface:focus-visible{outline:2px solid var( --os-ui-accent,#2271b1 );outline-offset:-3px}.os-page-atlas__surface.is-panning{cursor:grabbing;user-select:none}.os-page-atlas__canvas{position:absolute;inset:0;pointer-events:none;z-index:0}.os-page-atlas__world{position:absolute;inset:0 auto auto 0;transform-origin:0 0;z-index:1}.os-page-atlas__sheet{position:absolute;box-sizing:border-box;inline-size:300px;block-size:258px;border:1px solid var( --os-ui-border,#dcdcde );border-radius:8px;background:var( --os-ui-surface,#fff );box-shadow:0 12px 25px -16px var( --os-ui-fg-muted,#646970 ),4px 5px 0 -1px var( --os-ui-surface,#fff ),4px 5px 0 0 var( --os-ui-border,#dcdcde )}.os-page-atlas__sheet.is-selected{outline:2px solid var( --os-ui-accent,#2271b1 );outline-offset:4px}.os-page-atlas__sheet.is-muted{opacity:.36}.os-page-atlas__sheet-head{display:flex;align-items:center;gap:7px;padding:6px 9px;block-size:30px}.os-page-atlas__sheet-head>span{color:var( --os-ui-accent,#2271b1 );font-size:13px}.os-page-atlas__sheet-head os-button{flex:1;min-inline-size:0;text-align:start;--os-ui-button-padding:3px 0}.os-page-atlas__sheet-head os-button::part(button){display:block;inline-size:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;text-align:start}.os-page-atlas__viewport{position:relative;inline-size:288px;block-size:180px;margin-inline:5px;overflow:hidden;border-radius:3px;background:var( --os-ui-surface-sunken,#f6f7f7 );pointer-events:none}.os-page-atlas__viewport iframe{position:absolute;inset:0 auto auto 0;display:block;width:1440px !important;height:900px !important;max-width:none !important;max-height:none !important;border:0;transform:scale(.2);transform-origin:0 0;pointer-events:none}.os-page-atlas__placeholder{position:absolute;inset:0;display:grid;place-content:center;text-align:center;padding:20px;font-size:12px;color:var( --os-ui-fg-muted,#646970 );background-image:repeating-linear-gradient(transparent 0 21px,var( --os-ui-border-subtle,#f0f0f1 ) 21px 22px)}.os-page-atlas__sheet-foot{display:flex;justify-content:space-between;gap:6px;padding:8px 10px;font-size:10px;color:var( --os-ui-fg-muted,#646970 )}.os-page-atlas__sheet-foot span:first-child{max-inline-size:210px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.os-page-atlas__directory{flex:0 0 215px;min-inline-size:0;padding:14px;border-inline-start:1px solid var( --os-ui-border,#dcdcde );display:flex;flex-direction:column;gap:12px}.os-page-atlas__directory h3{margin:0;font-size:11px;font-weight:600;letter-spacing:.1em;text-transform:uppercase;color:var( --os-ui-fg-muted,#646970 )}.os-page-atlas__list{overflow:auto;flex:1;min-block-size:0;display:flex;flex-direction:column;gap:5px}.os-page-atlas__list os-button{display:block;text-align:start;--os-ui-button-padding:8px 10px}.os-page-atlas__list os-button::part(button){inline-size:100%;justify-content:space-between;text-align:start}.os-page-atlas__list os-button span{font-variant-numeric:tabular-nums;font-size:10px;color:var( --os-ui-fg-muted,#646970 )}.os-page-atlas__list os-button[aria-pressed="true"]{outline:1px solid var( --os-ui-accent,#2271b1 );border-radius:7px}.os-page-atlas__selection{font-size:12px;border-block-start:1px solid var( --os-ui-border,#dcdcde );padding-block-start:10px}.os-page-atlas__selection strong{display:block;margin-block-end:6px;overflow-wrap:anywhere}.os-page-atlas__selection p{font-size:11px;color:var( --os-ui-fg-muted,#646970 );line-height:1.6}.os-page-atlas__selection os-button{margin-block:4px}.os-page-atlas__legend{display:flex;align-items:center;gap:14px;padding:9px 20px;font-size:10px;color:var( --os-ui-fg-muted,#646970 );border-block-start:1px solid var( --os-ui-border,#dcdcde );flex-wrap:wrap}.os-page-atlas__legend span{display:inline-flex;align-items:center;gap:6px}.os-page-atlas__legend i{inline-size:20px;border-block-start:2px solid var( --os-ui-accent,#2271b1 )}.os-page-atlas__legend .is-link{border-color:var( --os-ui-info,#72aee6 )}.os-page-atlas__legend small{margin-inline-start:auto;font-size:inherit}.os-page-atlas__zoom{position:absolute;inset-block-end:14px;inset-inline-start:14px;z-index:3;display:flex;align-items:center;gap:3px;padding:4px;border:1px solid var( --os-ui-border,#dcdcde );border-radius:9px;background:var( --os-ui-surface,#fff )}.os-page-atlas__zoom output{min-inline-size:42px;font-size:10px;text-align:center}.os-page-atlas__message{padding:20px;font-size:12px;color:var( --os-ui-fg-muted,#646970 )}.os-page-atlas__refresh .dashicons{inline-size:16px;block-size:16px;font-size:16px}.os-page-atlas__browse{display:none}@container page-atlas (max-width:720px){.os-page-atlas__head{padding:12px;gap:10px}.os-page-atlas__head h2{font-size:21px}.os-page-atlas__head p{display:none}.os-page-atlas__totals{gap:12px;--os-ui-stat-value-size:19px}.os-page-atlas__totals os-stat::part(label){font-size:8px}.os-page-atlas__tools{padding:6px 12px;gap:6px}.os-page-atlas__tools os-text-field{min-inline-size:85px}.os-page-atlas__refresh{--os-ui-button-padding:6px}.os-page-atlas__refresh-label{position:absolute;inline-size:1px;block-size:1px;overflow:hidden;clip-path:inset(50%)}.os-page-atlas__tools os-select{inline-size:108px}.os-page-atlas__browse{display:block}.os-page-atlas__directory{display:none}.os-page-atlas.is-browsing .os-page-atlas__directory{display:flex;flex:1;border:0}.os-page-atlas.is-browsing .os-page-atlas__stage,.os-page-atlas.is-browsing .os-page-atlas__zoom{display:none}.os-page-atlas__legend{padding:7px 12px;gap:8px}.os-page-atlas__legend small{display:none}}`;function rn(s,e){let t=!1,o=new AbortController,i=null,a={pages:[],edges:[],total:0},n=null,r="",l="all";const c=()=>{g.classList.toggle("is-browsing")},d=k=>{n=k,g.classList.remove("is-browsing"),y(),requestAnimationFrame(()=>{t||i?.focus(k)})},p=()=>{i?.filter(l,r),y()};Z(b`<style>${an.cssText}</style><section class="os-page-atlas" aria-label=${u("Page atlas")}>
635 637 <header class="os-page-atlas__head"><div><h2>${u("Your site, unfolded.")}</h2><p>${u("Real pages. Real connections. A different perspective.")}</p></div>
636 638 <div class="os-page-atlas__totals"><os-stat data-atlas-total value="—" label=${u("Pages")}></os-stat><os-stat data-atlas-connections value="—" label=${u("Connections")}></os-stat></div></header>
637 639 <div class="os-page-atlas__tools">
638 - <os-text-field id=${`${e.windowId}-atlas-search`} aria-label=${u("Find a page in the atlas")} placeholder=${u("Find a page…")} @os-input-change=${y=>{r=String(y.detail.value),p()}}></os-text-field>
639 - <os-select aria-label=${u("Connection type")} value="all" @os-pick=${y=>{l=String(y.detail.value),p()}}>
640 + <os-text-field id=${`${e.windowId}-atlas-search`} aria-label=${u("Find a page in the atlas")} placeholder=${u("Find a page…")} @os-input-change=${k=>{r=String(k.detail.value),p()}}></os-text-field>
641 + <os-select aria-label=${u("Connection type")} value="all" @os-pick=${k=>{l=String(k.detail.value),p()}}>
640 642 <os-option value="all">${u("All connections")}</os-option><os-option value="parent">${u("Page structure")}</os-option><os-option value="link">${u("Content links")}</os-option>
641 643 </os-select><os-button class="os-page-atlas__browse" variant="secondary" @click=${c}>${u("Browse")}</os-button>
642 - <os-button class="os-page-atlas__refresh" variant="ghost" title=${u("Refresh")} @click=${()=>void R()}><span class="dashicons dashicons-update" aria-hidden="true"></span><span class="os-page-atlas__refresh-label">${u("Refresh")}</span></os-button>
644 + <os-button class="os-page-atlas__refresh" variant="ghost" title=${u("Refresh")} @click=${()=>void w()}><span class="dashicons dashicons-update" aria-hidden="true"></span><span class="os-page-atlas__refresh-label">${u("Refresh")}</span></os-button>
643 645 </div>
644 646 <div class="os-page-atlas__main">
645 647 <div class="os-page-atlas__stage" aria-label=${u("Page map. Drag to pan, scroll or pinch to zoom. Use arrow keys to pan and plus or minus to zoom. Browse the page directory to select a page.")}></div>
646 - <div class="os-page-atlas__zoom"><os-button variant="ghost" title=${u("Zoom out")} @click=${()=>i?.zoom(.8)}>−</os-button><output aria-label=${u("Map zoom")}>100%</output><os-button variant="ghost" title=${u("Zoom in")} @click=${()=>i?.zoom(1.25)}>+</os-button><os-button variant="secondary" @click=${()=>{n=null,C(),i?.fit()}}>${u("Fit all")}</os-button></div>
648 + <div class="os-page-atlas__zoom"><os-button variant="ghost" title=${u("Zoom out")} @click=${()=>i?.zoom(.8)}>−</os-button><output aria-label=${u("Map zoom")}>100%</output><os-button variant="ghost" title=${u("Zoom in")} @click=${()=>i?.zoom(1.25)}>+</os-button><os-button variant="secondary" @click=${()=>{n=null,y(),i?.fit()}}>${u("Fit all")}</os-button></div>
647 649 <aside class="os-page-atlas__directory" aria-label=${u("Pages in the atlas")}><h3>${u("Explore your pages")}</h3><div class="os-page-atlas__list"></div><div class="os-page-atlas__selection" aria-live="polite"></div></aside>
648 650 </div>
649 651 <footer class="os-page-atlas__legend"><span><i></i>${u("Parent → child")}</span><span><i class="is-link"></i>${u("Links to")}</span><small>${u("1440 × 900 previews · drag to explore")}</small></footer>
650 652 <div class="os-page-atlas__message" role="status" hidden></div>
651 - </section>`,o);const h=o.querySelector(".os-page-atlas"),_=h.querySelector(".os-page-atlas__stage"),g=h.querySelector(".os-page-atlas__list"),m=h.querySelector(".os-page-atlas__selection"),f=h.querySelector(".os-page-atlas__message"),v=h.querySelector("os-text-field");queueMicrotask(()=>v?.shadowRoot?.querySelector("input")?.setAttribute("aria-label",u("Find a page in the atlas")));const x=()=>a.edges.filter(y=>l==="all"||y.kind===l),C=()=>{const y=r.toLocaleLowerCase().trim(),z=a.pages.filter(S=>`${J(S)} ${S.slug}`.toLocaleLowerCase().includes(y));G(b`${z.length?z.map(S=>b`<os-button variant="ghost" aria-pressed=${String(n===S.id)} @click=${()=>d(S.id)}>${J(S)}<span title=${u("Connections")}>${x().filter(I=>I.from===S.id||I.to===S.id).length}</span></os-button>`):b`<p>${u("No matching pages.")}</p>`}`,g);const A=a.pages.find(S=>S.id===n),F=A?a.edges.filter(S=>S.to===A.id&&S.kind==="link").length:0,Q=A?a.edges.filter(S=>S.from===A.id&&S.kind==="link").length:0,V=A&&Ie(A);G(A?b`<strong>${J(A)}</strong><p>${O(u("%1$d incoming · %2$d outgoing content links"),F,Q)}</p>
652 - <os-button variant="primary" @click=${()=>e.host.openUrl?.(Te(e.extra,A.id),J(A),"dashicons-admin-page")}>${u("Open editor")} ↗</os-button>
653 - ${V?b`<os-button variant="ghost" @click=${()=>e.host.openUrl?.(V,J(A),"dashicons-visibility")}>${u("Open preview")} ↗</os-button>`:""}
654 - <p>${u("Connections come from page parents and links in page bodies. Menus are not included.")}</p>`:b`<strong>${u("Follow a thread.")}</strong><p>${u("Choose a page to bring it closer and trace its connections. Pages with no connections remain visible.")}</p>`,m),queueMicrotask(()=>g.querySelectorAll("os-button").forEach(S=>S.shadowRoot?.querySelector("button")?.setAttribute("aria-pressed",S.getAttribute("aria-pressed")||"false")))},R=async()=>{s.abort(),s=new AbortController;const y=s.signal;i?.dispose(),i=null,n=null,_.textContent="",f.hidden=!1,f.textContent=u("Unfolding your pages…"),h.setAttribute("aria-busy","true");try{const z=await Pi(e.fetch,y);if(y.aborted||t)return;if(a=z,h.querySelector("[data-atlas-total]")?.setAttribute("value",String(a.pages.length)),h.querySelector("[data-atlas-connections]")?.setAttribute("value",String(a.edges.length)),C(),!a.pages.length){f.textContent=u("No pages yet. Create your first page to start the atlas.");return}const A=document.createElement("div");A.className="os-page-atlas__surface",A.tabIndex=0,A.setAttribute("role","region"),A.setAttribute("aria-label",_.getAttribute("aria-label")||u("Page map")),_.append(A);const F=await Hi(A,a,typeof e.extra.frontPageId=="number"?e.extra.frontPageId:void 0,d,Q=>{h.querySelector("output").textContent=`${Math.round(Q*100)}%`},y);if(t||y.aborted){F?.dispose();return}i=F,i?.filter(l,r),f.hidden=a.total<=a.pages.length,f.textContent=O(u("Showing %1$d of %2$d pages. Connections outside this set are not shown."),a.pages.length,a.total)}catch(z){if(y.aborted||t)return;f.hidden=!1,f.textContent=z instanceof Error?z.message:u("The atlas could not load. Try Refresh.")}finally{!y.aborted&&!t&&h.removeAttribute("aria-busy")}};return R(),()=>{t=!0,s.abort(),i?.dispose(),o.replaceChildren()}}const Vi=Si("desktop-mode-pages",{atlas:Ui});return Oe.default=Vi,Object.defineProperties(Oe,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}}),Oe}({});
653 + </section>`,s);const g=s.querySelector(".os-page-atlas"),v=g.querySelector(".os-page-atlas__stage"),_=g.querySelector(".os-page-atlas__list"),x=g.querySelector(".os-page-atlas__selection"),h=g.querySelector(".os-page-atlas__message"),f=g.querySelector("os-text-field");queueMicrotask(()=>f?.shadowRoot?.querySelector("input")?.setAttribute("aria-label",u("Find a page in the atlas")));const m=()=>a.edges.filter(k=>l==="all"||k.kind===l),y=()=>{const k=r.toLocaleLowerCase().trim(),C=a.pages.filter(E=>`${Q(E)} ${E.slug}`.toLocaleLowerCase().includes(k));Z(b`${C.length?C.map(E=>b`<os-button variant="ghost" aria-pressed=${String(n===E.id)} @click=${()=>d(E.id)}>${Q(E)}<span title=${u("Connections")}>${m().filter(q=>q.from===E.id||q.to===E.id).length}</span></os-button>`):b`<p>${u("No matching pages.")}</p>`}`,_);const $=a.pages.find(E=>E.id===n),P=$?a.edges.filter(E=>E.to===$.id&&E.kind==="link").length:0,z=$?a.edges.filter(E=>E.from===$.id&&E.kind==="link").length:0,N=$&&Oe($);Z($?b`<strong>${Q($)}</strong><p>${H(u("%1$d incoming · %2$d outgoing content links"),P,z)}</p>
654 + <os-button variant="primary" @click=${()=>e.host.openUrl?.(Te(e.extra,$.id),Q($),"dashicons-admin-page")}>${u("Open editor")} ↗</os-button>
655 + ${N?b`<os-button variant="ghost" @click=${()=>e.host.openUrl?.(N,Q($),"dashicons-visibility")}>${u("Open preview")} ↗</os-button>`:""}
656 + <p>${u("Connections come from page parents and links in page bodies. Menus are not included.")}</p>`:b`<strong>${u("Follow a thread.")}</strong><p>${u("Choose a page to bring it closer and trace its connections. Pages with no connections remain visible.")}</p>`,x),queueMicrotask(()=>_.querySelectorAll("os-button").forEach(E=>E.shadowRoot?.querySelector("button")?.setAttribute("aria-pressed",E.getAttribute("aria-pressed")||"false")))},w=async()=>{o.abort(),o=new AbortController;const k=o.signal;i?.dispose(),i=null,n=null,v.textContent="",h.hidden=!1,h.textContent=u("Unfolding your pages…"),g.setAttribute("aria-busy","true");try{const C=await Zi(e.fetch,k);if(k.aborted||t)return;if(a=C,g.querySelector("[data-atlas-total]")?.setAttribute("value",String(a.pages.length)),g.querySelector("[data-atlas-connections]")?.setAttribute("value",String(a.edges.length)),y(),!a.pages.length){h.textContent=u("No pages yet. Create your first page to start the atlas.");return}const $=document.createElement("div");$.className="os-page-atlas__surface",$.tabIndex=0,$.setAttribute("role","region"),$.setAttribute("aria-label",v.getAttribute("aria-label")||u("Page map")),v.append($);const P=await nn($,a,typeof e.extra.frontPageId=="number"?e.extra.frontPageId:void 0,d,z=>{g.querySelector("output").textContent=`${Math.round(z*100)}%`},k);if(t||k.aborted){P?.dispose();return}i=P,i?.filter(l,r),h.hidden=a.total<=a.pages.length,h.textContent=H(u("Showing %1$d of %2$d pages. Connections outside this set are not shown."),a.pages.length,a.total)}catch(C){if(k.aborted||t)return;h.hidden=!1,h.textContent=C instanceof Error?C.message:u("The atlas could not load. Try Refresh.")}finally{!k.aborted&&!t&&g.removeAttribute("aria-busy")}};return w(),()=>{t=!0,o.abort(),i?.dispose(),s.replaceChildren()}}const ln=Wi("desktop-mode-pages",{atlas:rn});return De.default=ln,Object.defineProperties(De,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}}),De}({});