PluginProbe
OpenStation: Desktop Windows, Dock & Virtual Desktops for WP Admin / 1.1.10
OpenStation: Desktop Windows, Dock & Virtual Desktops for WP Admin v1.1.10
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 0.8.9 0.8.8 All 35 releases
← All changes | assets/js/widget-notes.min.js +9 -19 1.1.2 → 1.1.10 View file →
@@ -1,15 +1,5 @@
1 -(function(){"use strict";function D(o,...e){return{__wpdHtml:!0,strings:o,values:e}}function me(o){return!!o&&o.__wpdHtml===!0}const be="$$wpd$$",w=/\$\$wpd\$\$(\d+)\$\$/g;function ge(o){let e=o[0];for(let t=1;t<o.length;t++)e+=`${be}${t-1}$$`+o[t];return e}const Z=new WeakMap;function Q(o){const e=Z.get(o);if(e)return e;const t=document.createElement("template");t.innerHTML=ge(o);const n=[],s=(h,d)=>{if(h.nodeType===Node.ELEMENT_NODE){const v=h;for(const f of Array.from(v.attributes)){const b=f.name,p=f.value,g=b[0];if(w.test(p))if(w.lastIndex=0,g==="@"){const u=w.exec(p);w.lastIndex=0,n.push({path:d,kind:"event",name:b.slice(1),valueIndex:u?Number(u[1]):0}),v.removeAttribute(b)}else if(g==="."){const u=w.exec(p);w.lastIndex=0,n.push({path:d,kind:"prop",name:b.slice(1),valueIndex:u?Number(u[1]):0}),v.removeAttribute(b)}else if(g==="?"){const u=w.exec(p);w.lastIndex=0,n.push({path:d,kind:"bool",name:b.slice(1),valueIndex:u?Number(u[1]):0}),v.removeAttribute(b)}else{const u=[],_=[];let x=0,E;for(w.lastIndex=0;(E=w.exec(p))!==null;)u.push(p.slice(x,E.index)),_.push(Number(E[1])),x=E.index+E[0].length;u.push(p.slice(x)),n.push({path:d,kind:"attr",name:b,template:u,valueIndices:_}),v.setAttribute(b,"")}}}const i=Array.from(h.childNodes);let m=0;for(let v=0;v<i.length;v++){const f=i[v],b=v+m;if(f.nodeType===Node.TEXT_NODE){const p=f.textContent||"";if(!w.test(p)){w.lastIndex=0;continue}w.lastIndex=0;const g=f.parentNode;let u=0,_;const x=[],E=[];for(w.lastIndex=0;(_=w.exec(p))!==null;){_.index>u&&x.push(document.createTextNode(p.slice(u,_.index)));const A=document.createTextNode("");x.push(A),E.push({path:[...d,b+x.length-1],kind:"node",valueIndex:Number(_[1])}),u=_.index+_[0].length}u<p.length&&x.push(document.createTextNode(p.slice(u)));for(const A of x)g.insertBefore(A,f);g.removeChild(f),m+=x.length-1,n.push(...E)}else s(f,[...d,b])}};s(t.content,[]);const a={template:t,buildParts:h=>{const d=[];for(const i of n){let m=h;for(const v of i.path)m=m.childNodes[v];i.kind==="node"?d.push({kind:"node",valueIndex:i.valueIndex,child:{anchor:m,state:null}}):i.kind==="attr"?d.push({kind:"attr",element:m,name:i.name,template:i.template,valueIndices:i.valueIndices}):i.kind==="event"?d.push({kind:"event",valueIndex:i.valueIndex,element:m,name:i.name}):i.kind==="prop"?d.push({kind:"prop",valueIndex:i.valueIndex,element:m,name:i.name}):i.kind==="bool"&&d.push({kind:"bool",valueIndex:i.valueIndex,element:m,name:i.name})}return d}};return Z.set(o,a),a}const ee=new WeakMap;function ve(o,e){for(const t of o.nodes)if(t.parentNode!==e)return!1;return!0}function xe(o,e){const t=ee.get(e);if(t&&t.strings===o.strings&&ve(t,e)){z(t.parts,o.values);return}const n=Q(o.strings),s=n.template.content.cloneNode(!0),r=n.buildParts(s),a=Array.from(s.childNodes);for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(s),z(r,o.values),ee.set(e,{strings:o.strings,parts:r,nodes:a})}function z(o,e){for(const t of o)if(t.kind==="node")U(t.child,e[t.valueIndex]);else if(t.kind==="attr"){let n=t.template[0];for(let s=0;s<t.valueIndices.length;s++)n+=te(e[t.valueIndices[s]]),n+=t.template[s+1];n!==t.last&&(t.last=n,n===""?t.element.removeAttribute(t.name):t.element.setAttribute(t.name,n))}else if(t.kind==="event"){const n=e[t.valueIndex];n!==t.current&&(t.current&&t.element.removeEventListener(t.name,t.current),n&&t.element.addEventListener(t.name,n),t.current=n)}else if(t.kind==="prop"){const n=e[t.valueIndex];n!==t.last&&(t.last=n,t.element[t.name]=n)}else if(t.kind==="bool"){const n=!!e[t.valueIndex];n!==t.last&&(t.last=n,n?t.element.setAttribute(t.name,""):t.element.removeAttribute(t.name))}}function U(o,e){if(e==null||e===!1){o.state&&(I(o.state),o.state=null);return}if(Array.isArray(e)){ke(o,e);return}if(me(e)){_e(o,e);return}if(e instanceof Node){we(o,e);return}ye(o,te(e))}function we(o,e){const t=o.state;t?.shape==="node"&&t.node===e||(t&&I(t),M(o,[e]),o.state={shape:"node",node:e})}function ye(o,e){const t=o.state;if(t?.shape==="text"){t.text!==e&&(t.node.textContent=e,t.text=e);return}t&&I(t);const n=document.createTextNode(e);M(o,[n]),o.state={shape:"text",node:n,text:e}}function _e(o,e){const t=o.state;if(t?.shape==="template"&&t.strings===e.strings){z(t.parts,e.values);return}t&&I(t);const n=Q(e.strings),s=n.template.content.cloneNode(!0),r=n.buildParts(s),a=Array.from(s.childNodes);M(o,[s]),z(r,e.values),o.state={shape:"template",strings:e.strings,parts:r,nodes:a}}function ke(o,e){const t=o.state;if(t?.shape==="array"&&t.entries.length===e.length){for(let s=0;s<e.length;s++)U(t.entries[s],e[s]);return}t&&I(t);const n=[];for(const s of e){const r=document.createTextNode("");M(o,[r]);const a={anchor:r,state:null};U(a,s),n.push(a)}o.state={shape:"array",entries:n}}function M(o,e){const t=o.anchor.parentNode;if(t)for(const n of e)t.insertBefore(n,o.anchor)}function I(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&&(I(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&&I(e.state),e.anchor.remove()}function te(o){return o==null||o===!1?"":String(o)}const S=class S 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(ne)}connectedCallback(){this._adoptStyles(),this.requestUpdate()}attributeChangedCallback(e,t,n){if(t===n)return;const s=Ee(e);this._propValues[s]=n,this.requestUpdate()}get classNames(){return Array.from(this.classList)}set classNames(e){if(e==null){this.removeAttribute("class");return}const n=(Array.isArray(e)?e:String(e).split(/\s+/)).map(s=>String(s).trim()).filter(s=>s!=="");this.className=n.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 n=ne(t);Object.defineProperty(this,t,{get:()=>t in this._propValues?this._propValues[t]:this.getAttribute(n),set:s=>{let r;s==null||s===!1?r=null:s===!0?r="":r=String(s),this._propValues[t]=r,r===null?this.removeAttribute(n):this.setAttribute(n,r),this.requestUpdate()},enumerable:!0,configurable:!0})}}_scheduleRender(){this._renderScheduled||!this.isConnected||(this._renderScheduled=!0,queueMicrotask(()=>{this._renderScheduled=!1,this.isConnected&&xe(this.render(),this._renderRoot)}))}_adoptStyles(){const e=this.constructor;if(e.styles.length!==0)if(e.shadow&&this.shadowRoot){const t=e.styles.map(n=>n.sheet).filter(n=>n!==null);if(this.shadowRoot.adoptedStyleSheets=t,t.length!==e.styles.length){for(const n of e.styles)if(!n.sheet){const s=document.createElement("style");s.textContent=n.cssText,this.shadowRoot.appendChild(s)}}}else this._adoptLightStyles(e)}_adoptLightStyles(e){if(!S._lightStylesAdopted.has(e)){S._lightStylesAdopted.add(e);for(const t of e.styles){const n=document.createElement("style");n.dataset.osUi=this.tagName.toLowerCase(),n.textContent=t.cssText,document.head.appendChild(n)}}}};S.props=[],S.styles=[],S.shadow=!0,S._lightStylesAdopted=new WeakSet;let O=S;function oe(o,e){customElements.get(o)||customElements.define(o,e)}function ne(o){return o.replace(/[A-Z]/g,e=>"-"+e.toLowerCase())}function Ee(o){return o.replace(/-([a-z])/g,(e,t)=>t.toUpperCase())}const Ne=(()=>{try{return typeof new CSSStyleSheet().replaceSync=="function"}catch{return!1}})();function y(o,...e){let t=o[0];for(let n=1;n<o.length;n++){const s=e[n-1];if(typeof s=="string"||typeof s=="number")t+=String(s);else if(s&&s.__wpdCss)t+=s.cssText;else throw new TypeError("[os-ui] css`` interpolations must be strings, numbers, or other css`` results. Got: "+typeof s);t+=o[n]}if(Ne){const n=new CSSStyleSheet;return n.replaceSync(t),{__wpdCss:!0,sheet:n,cssText:t}}return{__wpdCss:!0,sheet:null,cssText:t}}function Ce(o){const e=[],t=[];let n=null,s=o.parentElement;for(;s&&!(s===document.body||s===document.documentElement);){const a=s.id||"";if(a.startsWith("wp-window-")){n=a.slice(10);break}if(s.tagName.toLowerCase()==="os-tabpanel"){const h=s.getAttribute("for");h&&t.unshift(h)}s=s.parentElement}n&&e.push(X(n));for(const a of t)e.push("tab-"+X(a));const r=o.getAttribute("label");return r&&e.push(X(r)),e.length===0?"os-unnamed":"os-"+e.filter(a=>a!=="").join("-")}function X(o){return o.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")}function Ae(o){if(o.id)return o.id;const e=Ce(o);return o.id=e,e}const q=y`: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 ) )}`,$e=y` .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%}}`,Se=y` .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%}}`,Ie=y` .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}}`,Re=y` .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}}`,Te=y` .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}}`,Le=y` .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%}}`,Pe=y` .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}}`,se=y` 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}}`,re=y` 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}}`,De=y` @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}}`;y` ${q} ${$e} ${Se} ${Ie} ${Re} ${Te} ${Le} ${Pe} ${se} ${re} ${De} `;const ze=y` ${q} ${re}:host{display:inline-flex;align-items:center;gap:8px;font-size:12px;color:var( --os-ui-fg,#1d2327 );cursor:pointer;-webkit-user-select:none;user-select:none}label{display:inline-flex;align-items:center;gap:8px;cursor:pointer}:host( [ disabled ] ){opacity:0.5;cursor:not-allowed}:host( [ disabled ] ) label,:host( [ disabled ] ) input[ type='checkbox' ]{cursor:not-allowed}`,T=class T extends O{render(){const e=this.label||"",t=this.checked!==null,n=this.disabled!==null;return D`
2 - <label>
3 - <input
4 - type="checkbox"
5 - ?checked=${t}
6 - ?disabled=${n}
7 - @change=${s=>this._onChange(s)}
8 - />
9 - <span class="os-checkbox-label__text">${e}</span>
10 - </label>
11 - `}_onChange(e){if(this.disabled!==null)return;const t=e.target.checked;t?this.setAttribute("checked",""):this.removeAttribute("checked"),this.emit("os-checkbox-change",{checked:t})}};T.props=["label","checked","disabled"],T.styles=[ze],T.help=void 0;let W=T;oe("os-checkbox-label",W);const Me=y` ${q} ${se}:host{display:flex;flex-direction:column;gap:4px;font-size:13px;color:var( --os-ui-fg,#1d2327 );min-width:0}:host( [ hidden ] ){display:none}.os-textarea__label{font-size:12px;color:var( --os-ui-fg-muted,#646970 )}textarea{appearance:none;-webkit-appearance:none;display:block;width:100%;min-width:0;box-sizing:border-box;padding:8px 10px;background:var( --os-window-bg,#fff );border:1px solid var( --os-ui-border,#dcdcde );border-radius:6px;font:inherit;font-size:13px;line-height:1.45;color:var( --os-ui-fg,#1d2327 );resize:vertical}textarea:disabled{opacity:0.55;cursor:not-allowed;background:var( --os-ui-hover,rgba( 0,0,0,0.03 ) )}textarea[ aria-invalid='true' ],textarea[ aria-invalid='true' ]:hover:not(:disabled ){border-color:var( --os-ui-danger,#d63638 )}textarea[ aria-invalid='true' ]:focus,textarea[ aria-invalid='true' ]:focus-visible{border-color:var( --os-ui-danger,#d63638 );box-shadow:0 0 0 1px var( --os-ui-danger,#d63638 ),0 0 0 4px rgba( 214,54,56,0.18 )}:host( [ auto-grow ] ) textarea{resize:none;overflow:hidden}`,L=class L extends O{constructor(){super(...arguments),this._textareaEl=null}connectedCallback(){super.connectedCallback(),Ae(this)}render(){const e=this._attr("label")||"",t=this._attr("value")??"",n=this._attr("placeholder")||"",s=this._boolAttr("disabled"),r=this._boolAttr("readonly"),a=this._attr("aria-label")||e,h=this._attr("name")||"",d=Number(this._attr("rows"))||3,i=this._attr("maxlength"),m=this._attr("minlength"),v=this._boolAttr("invalid"),b=`${this.id||"os-unnamed"}__field`;return D`
1 +(function(){"use strict";function D(o,...e){return{__wpdHtml:!0,strings:o,values:e}}function le(o){return!!o&&o.__wpdHtml===!0}const ce="$$wpd$$",x=/\$\$wpd\$\$(\d+)\$\$/g,de="$$wpd-node$$",ue=/^\$\$wpd-node\$\$(\d+)\$\$$/,he=new Set(["style","script","textarea","title"]);function pe(o){let e="",t=!1,n=null,s=!1,r=null,a="",c=!1;for(let l=0;l<o.length;l++){const i=o[l];e+=i;for(let d=0;d<i.length;d++){const u=i[d];if(s){i.startsWith("-->",d)&&(s=!1,d+=2);continue}if(r!==null){u==="<"&&i[d+1]==="/"&&i.slice(d+2,d+2+r.length).toLowerCase()===r&&(d+=1+r.length,r=null,t=!0,c=!1,a="");continue}if(n!==null){u===n&&(n=null);continue}if(t){u==='"'||u==="'"?(n=u,c=!1):u===">"?(t=!1,c=!1,he.has(a)&&(r=a),a=""):c&&(/[a-zA-Z0-9-]/.test(u)?a+=u.toLowerCase():c=!1);continue}if(i.startsWith("<!--",d)){s=!0,d+=3;continue}const h=i[d+1]??"";u==="<"&&/[a-zA-Z/!]/.test(h)&&(t=!0,a="",c=/[a-zA-Z]/.test(h))}l<o.length-1&&(e+=t||s||r!==null?`${ce}${l}$$`:`<!--${de}${l}$$-->`)}return e}const G=new WeakMap;function Y(o){const e=G.get(o);if(e)return e;const t=document.createElement("template");t.innerHTML=pe(o);const n=[],s=(c,l)=>{if(c.nodeType===Node.ELEMENT_NODE){const u=c;for(const h of Array.from(u.attributes)){const b=h.name,m=h.value,v=b[0];if(x.test(m))if(x.lastIndex=0,v==="@"){const g=x.exec(m);x.lastIndex=0,n.push({path:l,kind:"event",name:b.slice(1),valueIndex:g?Number(g[1]):0}),u.removeAttribute(b)}else if(v==="."){const g=x.exec(m);x.lastIndex=0,n.push({path:l,kind:"prop",name:b.slice(1),valueIndex:g?Number(g[1]):0}),u.removeAttribute(b)}else if(v==="?"){const g=x.exec(m);x.lastIndex=0,n.push({path:l,kind:"bool",name:b.slice(1),valueIndex:g?Number(g[1]):0}),u.removeAttribute(b)}else{const g=[],y=[];let w=0,k;for(x.lastIndex=0;(k=x.exec(m))!==null;)g.push(m.slice(w,k.index)),y.push(Number(k[1])),w=k.index+k[0].length;g.push(m.slice(w)),n.push({path:l,kind:"attr",name:b,template:g,valueIndices:y}),u.setAttribute(b,"")}}}const i=Array.from(c.childNodes);let d=0;for(let u=0;u<i.length;u++){const h=i[u],b=u+d;if(h.nodeType===Node.COMMENT_NODE){const m=ue.exec(h.data);if(m){const v=document.createTextNode("");h.parentNode.replaceChild(v,h),n.push({path:[...l,b],kind:"node",valueIndex:Number(m[1])})}continue}if(h.nodeType===Node.TEXT_NODE){const m=h.textContent||"";if(!x.test(m)){x.lastIndex=0;continue}x.lastIndex=0;const v=h.parentNode;let g=0,y;const w=[],k=[];for(x.lastIndex=0;(y=x.exec(m))!==null;){y.index>g&&w.push(document.createTextNode(m.slice(g,y.index)));const T=document.createTextNode("");w.push(T),k.push({path:[...l,b+w.length-1],kind:"node",valueIndex:Number(y[1])}),g=y.index+y[0].length}g<m.length&&w.push(document.createTextNode(m.slice(g)));for(const T of w)v.insertBefore(T,h);v.removeChild(h),d+=w.length-1,n.push(...k)}else s(h,[...l,b])}};s(t.content,[]);const a={template:t,buildParts:c=>{const l=[];for(const i of n){let d=c;for(const u of i.path)d=d.childNodes[u];i.kind==="node"?l.push({kind:"node",valueIndex:i.valueIndex,child:{anchor:d,state:null}}):i.kind==="attr"?l.push({kind:"attr",element:d,name:i.name,template:i.template,valueIndices:i.valueIndices}):i.kind==="event"?l.push({kind:"event",valueIndex:i.valueIndex,element:d,name:i.name}):i.kind==="prop"?l.push({kind:"prop",valueIndex:i.valueIndex,element:d,name:i.name}):i.kind==="bool"&&l.push({kind:"bool",valueIndex:i.valueIndex,element:d,name:i.name})}return l}};return G.set(o,a),a}const Z=new WeakMap;function fe(o,e){for(const t of o.nodes)if(t.parentNode!==e)return!1;return!0}function me(o,e){const t=Z.get(e);if(t&&t.strings===o.strings&&fe(t,e)){z(t.parts,o.values);return}const n=Y(o.strings),s=n.template.content.cloneNode(!0),r=n.buildParts(s),a=Array.from(s.childNodes);for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(s),z(r,o.values),Z.set(e,{strings:o.strings,parts:r,nodes:a})}function z(o,e){for(const t of o)if(t.kind==="node")M(t.child,e[t.valueIndex]);else if(t.kind==="attr"){let n=t.template[0];for(let s=0;s<t.valueIndices.length;s++)n+=J(e[t.valueIndices[s]]),n+=t.template[s+1];n!==t.last&&(t.last=n,n===""?t.element.removeAttribute(t.name):t.element.setAttribute(t.name,n))}else if(t.kind==="event"){const n=e[t.valueIndex];n!==t.current&&(t.current&&t.element.removeEventListener(t.name,t.current),n&&t.element.addEventListener(t.name,n),t.current=n)}else if(t.kind==="prop"){const n=e[t.valueIndex];n!==t.last&&(t.last=n,t.element[t.name]=n)}else if(t.kind==="bool"){const n=!!e[t.valueIndex];n!==t.last&&(t.last=n,n?t.element.setAttribute(t.name,""):t.element.removeAttribute(t.name))}}function M(o,e){if(e==null||e===!1){o.state&&(A(o.state),o.state=null);return}if(Array.isArray(e)){we(o,e);return}if(le(e)){ve(o,e);return}if(e instanceof Node){ge(o,e);return}be(o,J(e))}function ge(o,e){const t=o.state;t?.shape==="node"&&t.node===e||(t&&A(t),I(o,[e]),o.state={shape:"node",node:e})}function be(o,e){const t=o.state;if(t?.shape==="text"){t.text!==e&&(t.node.textContent=e,t.text=e);return}t&&A(t);const n=document.createTextNode(e);I(o,[n]),o.state={shape:"text",node:n,text:e}}function ve(o,e){const t=o.state;if(t?.shape==="template"&&t.strings===e.strings){z(t.parts,e.values);return}t&&A(t);const n=Y(e.strings),s=n.template.content.cloneNode(!0),r=n.buildParts(s),a=Array.from(s.childNodes);I(o,[s]),z(r,e.values),o.state={shape:"template",strings:e.strings,parts:r,nodes:a}}function we(o,e){const t=o.state;if(t?.shape==="array"){const s=Math.min(t.entries.length,e.length);for(let r=0;r<s;r++)M(t.entries[r],e[r]);if(e.length<t.entries.length){for(let r=e.length;r<t.entries.length;r++){const a=t.entries[r];a.state&&A(a.state),a.anchor.remove()}t.entries.length=e.length}else for(let r=t.entries.length;r<e.length;r++){const a=document.createTextNode("");I(o,[a]);const c={anchor:a,state:null};M(c,e[r]),t.entries.push(c)}return}t&&A(t);const n=[];for(const s of e){const r=document.createTextNode("");I(o,[r]);const a={anchor:r,state:null};M(a,s),n.push(a)}o.state={shape:"array",entries:n}}function I(o,e){const t=o.anchor.parentNode;if(t)for(const n of e)t.insertBefore(n,o.anchor)}function A(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&&(A(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&&A(e.state),e.anchor.remove()}function J(o){return o==null||o===!1?"":String(o)}const $=class $ 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(Q)}connectedCallback(){this._adoptStyles(),this.requestUpdate()}attributeChangedCallback(e,t,n){if(t===n)return;const s=_e(e);this._propValues[s]=n,this.requestUpdate()}get classNames(){return Array.from(this.classList)}set classNames(e){if(e==null){this.removeAttribute("class");return}const n=(Array.isArray(e)?e:String(e).split(/\s+/)).map(s=>String(s).trim()).filter(s=>s!=="");this.className=n.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 n=Q(t);Object.defineProperty(this,t,{get:()=>t in this._propValues?this._propValues[t]:this.getAttribute(n),set:s=>{let r;s==null||s===!1?r=null:s===!0?r="":r=String(s),this._propValues[t]=r,r===null?this.removeAttribute(n):this.setAttribute(n,r),this.requestUpdate()},enumerable:!0,configurable:!0})}}_scheduleRender(){this._renderScheduled||!this.isConnected||(this._renderScheduled=!0,queueMicrotask(()=>{this._renderScheduled=!1,this.isConnected&&me(this.render(),this._renderRoot)}))}_adoptStyles(){const e=this.constructor;if(e.styles.length!==0)if(e.shadow&&this.shadowRoot){const t=e.styles.map(n=>n.sheet).filter(n=>n!==null);if(this.shadowRoot.adoptedStyleSheets=t,t.length!==e.styles.length){for(const n of e.styles)if(!n.sheet){const s=document.createElement("style");s.textContent=n.cssText,this.shadowRoot.appendChild(s)}}}else this._adoptLightStyles(e)}_adoptLightStyles(e){if(!$._lightStylesAdopted.has(e)){$._lightStylesAdopted.add(e);for(const t of e.styles){const n=document.createElement("style");n.dataset.osUi=this.tagName.toLowerCase(),n.textContent=t.cssText,document.head.appendChild(n)}}}};$.props=[],$.styles=[],$.shadow=!0,$._lightStylesAdopted=new WeakSet;let O=$;function xe(o,e){customElements.get(o)||customElements.define(o,e)}function Q(o){return o.replace(/[A-Z]/g,e=>"-"+e.toLowerCase())}function _e(o){return o.replace(/-([a-z])/g,(e,t)=>t.toUpperCase())}const ye=(()=>{try{return typeof new CSSStyleSheet().replaceSync=="function"}catch{return!1}})();function _(o,...e){let t=o[0];for(let n=1;n<o.length;n++){const s=e[n-1];if(typeof s=="string"||typeof s=="number")t+=String(s);else if(s&&s.__wpdCss)t+=s.cssText;else throw new TypeError("[os-ui] css`` interpolations must be strings, numbers, or other css`` results. Got: "+typeof s);t+=o[n]}if(ye){const n=new CSSStyleSheet;return n.replaceSync(t),{__wpdCss:!0,sheet:n,cssText:t}}return{__wpdCss:!0,sheet:null,cssText:t}}function ke(o){const e=[],t=[];let n=null,s=o.parentElement;for(;s&&!(s===document.body||s===document.documentElement);){const a=s.id||"";if(a.startsWith("wp-window-")){n=a.slice(10);break}if(s.tagName.toLowerCase()==="os-tabpanel"){const c=s.getAttribute("for");c&&t.unshift(c)}s=s.parentElement}n&&e.push(H(n));for(const a of t)e.push("tab-"+H(a));const r=o.getAttribute("label");return r&&e.push(H(r)),e.length===0?"os-unnamed":"os-"+e.filter(a=>a!=="").join("-")}function H(o){return o.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")}function Ne(o){if(o.id)return o.id;const e=ke(o);return o.id=e,e}const ee=_`: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 ) )}`,Ee=_` .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%}}`,Ce=_` .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%}}`,Ae=_` .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}}`,$e=_` .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}}`,Se=_` .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}}`,Te=_` .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%}}`,Ie=_` .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}}`,te=_` 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}}`,Re=_` 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}}`,Le=_` @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}}`;_` ${ee} ${Ee} ${Ce} ${Ae} ${$e} ${Se} ${Te} ${Ie} ${te} ${Re} ${Le} `;const ze=_` ${ee} ${te}:host{--_field-size:var( --os-ui-field-font-size,13px );--_field-radius:var( --os-ui-field-radius,6px );display:flex;flex-direction:column;gap:4px;font-size:var( --_field-size );color:var( --os-ui-fg,#1d2327 );min-width:0}:host( [ hidden ] ){display:none}.os-textarea__label{font-size:12px;color:var( --os-ui-fg-muted,#646970 )}textarea{appearance:none;-webkit-appearance:none;display:block;width:100%;min-width:0;box-sizing:border-box;padding:8px 10px;background:var( --os-window-bg,#fff );border:1px solid var( --os-ui-border,#dcdcde );border-radius:var( --_field-radius );font:inherit;font-size:var( --_field-size );line-height:1.45;color:var( --os-ui-fg,#1d2327 );resize:vertical}textarea:disabled{opacity:0.55;cursor:not-allowed;background:var( --os-ui-hover,rgba( 0,0,0,0.03 ) )}textarea[ aria-invalid='true' ],textarea[ aria-invalid='true' ]:hover:not(:disabled ){border-color:var( --os-ui-danger,#d63638 )}textarea[ aria-invalid='true' ]:focus,textarea[ aria-invalid='true' ]:focus-visible{border-color:var( --os-ui-danger,#d63638 );box-shadow:0 0 0 1px var( --os-ui-danger,#d63638 ),0 0 0 4px rgba( 214,54,56,0.18 )}:host( [ auto-grow ] ) textarea{resize:none;overflow:hidden}`,R=class R extends O{constructor(){super(...arguments),this._textareaEl=null}connectedCallback(){super.connectedCallback(),Ne(this)}render(){const e=this._attr("label")||"",t=this._attr("value")??"",n=this._attr("placeholder")||"",s=this._boolAttr("disabled"),r=this._boolAttr("readonly"),a=this._attr("aria-label")||e,c=this._attr("name")||"",l=Number(this._attr("rows"))||3,i=this._attr("maxlength"),d=this._attr("minlength"),u=this._boolAttr("invalid"),b=`${this.id||"os-unnamed"}__field`;return D`
12 2 ${e?D`<label class="os-textarea__label" for=${b}>${e}</label>`:D``}
13 3 <textarea
14 4 id=${b}
15 5 part="textarea"
@@ -16,15 +6,15 @@
16 6 .value=${t}
17 7 placeholder=${n}
18 8 ?disabled=${s}
19 9 ?readonly=${r}
20 - rows=${d}
10 + rows=${l}
21 11 maxlength=${i??""}
22 - minlength=${m??""}
23 - name=${h}
24 - aria-invalid=${v?"true":"false"}
12 + minlength=${d??""}
13 + name=${c}
14 + aria-invalid=${u?"true":"false"}
25 15 aria-label=${a||""}
26 - @input=${p=>this._onInput(p)}
27 - @change=${p=>this._onChange(p)}
28 - @keydown=${p=>this._onKeyDown(p)}
16 + @input=${m=>this._onInput(m)}
17 + @change=${m=>this._onChange(m)}
18 + @keydown=${m=>this._onKeyDown(m)}
29 19 ></textarea>
30 - `}_attr(e){return this.getAttribute(e)}_boolAttr(e){return this.getAttribute(e)!==null}_onInput(e){const t=e.target;this._textareaEl=t,this.setAttribute("value",t.value),this.emit("os-input-change",{value:t.value}),this._boolAttr("auto-grow")&&this._autosize(t)}_onChange(e){const t=e.target;this.emit("os-input-commit",{value:t.value})}_onKeyDown(e){if(this._boolAttr("submit-on-enter")&&e.key==="Enter"&&!e.shiftKey&&!e.altKey&&!e.metaKey&&!e.ctrlKey){e.preventDefault();const t=e.target;this.emit("os-submit",{value:t.value})}}_autosize(e){const t=Number(this._attr("max-rows"))||8,n=window.getComputedStyle(e),s=parseFloat(n.fontSize)||13,r=n.lineHeight,a=r==="normal"?s*1.45:parseFloat(r)||s*1.45,h=parseFloat(n.paddingTop)||0,d=parseFloat(n.paddingBottom)||0,i=a*t+h+d;e.style.height="auto";const m=Math.min(e.scrollHeight,i);e.style.height=`${m}px`}refreshAutosize(){this._textareaEl&&this._boolAttr("auto-grow")&&this._autosize(this._textareaEl)}focusInput(){(this.shadowRoot??this).querySelector("textarea")?.focus()}clear(){this.setAttribute("value","");const t=(this.shadowRoot??this).querySelector("textarea");t&&(t.value="",this._boolAttr("auto-grow")&&this._autosize(t))}};L.props=["label","value","placeholder","disabled","readonly","ariaLabel","name","rows","maxlength","minlength","invalid","autoGrow","maxRows","submitOnEnter"],L.styles=[Me],L.help=void 0;let K=L;oe("os-textarea",K);const Oe="desktop-mode";function He(){return window.wp?.i18n}function k(o,e=Oe){return He()?.__(o,e)??o}const R=["butter","blush","sky","mint","lilac","peach"];function B(o){return R.includes(o)?o:R[0]}function F(o){const e=R.indexOf(B(o));return R[(e+1)%R.length]}function Ue(o){let e=2166136261;for(let n=0;n<o.length;n++)e^=o.charCodeAt(n),e=Math.imul(e,16777619)>>>0;return e>>>1||1}const Xe=56,qe=52;function We(o){return`${o.replace(/\/$/,"")}/assets/images/pushpin.svg`}function Ke(o){const e=document.createElement("img");return e.src=We(o),e.alt="",e.width=Xe,e.height=qe,e.draggable=!1,e.className="os-pinned-note__pin-img",e}const ae="X-WP-Nonce";function Be(o,e){const t=Fe();if(!t)return e;const n=je(o);if(!n||!Ve(n))return e;const s=e?.headers??(typeof Request<"u"&&o instanceof Request?o.headers:void 0),r=new Headers(s??{});return r.has(ae)?e:(r.set(ae,t),{...e??{},headers:r})}function Fe(){if(typeof window>"u")return;const e=window.openStationConfig?.restNonce;return typeof e=="string"&&e.length>0?e:void 0}function je(o){try{const e=typeof window<"u"&&window.location?window.location.href:void 0;return typeof o=="string"?new URL(o,e):o instanceof URL?o:typeof Request<"u"&&o instanceof Request?new URL(o.url,e):null}catch{return null}}function Ve(o){return typeof window>"u"||!window.location||o.origin!==window.location.origin?!1:!!(o.pathname.includes("/wp-json/")||o.searchParams.has("rest_route"))}function Ge(o,e,t={}){const n=window.wp?.os?.fetch;if(typeof n=="function")return n(o,e,t);const s=Be(o,e);return fetch(o,s)}let j=null;function Ye(o){j=o}function Je(){if(!j)throw new Error("[openstation] notes REST client called before installNotesRestDeps().");return j}function Ze(o){const e=window.openStationConfig;return typeof e?.restNonce=="string"&&e.restNonce?e.restNonce:o}class Qe extends Error{constructor(e){super("Note was changed by another session."),this.status=409,this.name="NotesConflictError",this.current=e}}async function et(o,e){const{baseUrl:t,nonce:n}=Je(),s=t,r=new Headers(e.headers??{});r.set("X-WP-Nonce",Ze(n)),e.body&&!r.has("Content-Type")&&r.set("Content-Type","application/json");const a=await Ge(s,{...e,headers:r,credentials:"same-origin"},{source:"desktop-mode/notes"}),h=await a.text();let d=null;if(h)try{d=JSON.parse(h)}catch{d=null}if(!a.ok){if(a.status===409){const m=d?.data?.current;throw new Qe(m??null)}const i=d;throw new Error(`[openstation] notes REST ${a.status}: ${i?.code??""} ${i?.message??""}`.trim())}if(d===null)throw new Error(`[openstation] notes REST ${a.status}: empty or unparseable body.`);return d}function tt(o){return et("",{method:"POST",body:JSON.stringify(o)})}const ot="note-draft",nt="os-note-created",st="desktop-mode/notes";function rt(){return window.openStationConfig??{}}function at(){return window.wp?.os?.dragManager??null}const it=(o,e)=>{let t=!1;const n=rt(),s=!!n.notesUrl;s&&Ye({baseUrl:n.notesUrl,nonce:n.restNonce??""});let r=B(e.storage.get("color")??R[0]),a=e.storage.get("public")??!1,h="";const d=document.createElement("div");d.className="dm-notes-pad";const i=document.createElement("div");i.className="dm-notes-pad__stack";const m=document.createElement("div");m.className="dm-notes-pad__under dm-notes-pad__under--2";const v=document.createElement("div");v.className="dm-notes-pad__under dm-notes-pad__under--1";const f=document.createElement("div");f.className="dm-notes-pad__sheet";const b=document.createElement("div");b.className="dm-notes-pad__peel",b.setAttribute("aria-hidden","true");const p=document.createElement("span");p.className="dm-notes-pad__peel-hint",p.textContent=k("Drag to pin","desktop-mode"),b.appendChild(p);const g=document.createElement("os-textarea");g.className="dm-notes-pad__editor",g.setAttribute("aria-label",k("New note","desktop-mode")),g.setAttribute("placeholder",k("Write a note…","desktop-mode")),g.setAttribute("rows","5"),g.setAttribute("auto-grow",""),g.setAttribute("max-rows","8");const u=document.createElement("button");u.type="button",u.className="dm-notes-pad__corner",f.append(b,g,u),i.append(m,v,f);const _=document.createElement("div");_.className="dm-notes-pad__footer";const x=document.createElement("div");x.className="dm-notes-pad__swatches",x.setAttribute("role","radiogroup"),x.setAttribute("aria-label",k("Paper color","desktop-mode"));const E=new Map;for(const l of R){const c=document.createElement("button");c.type="button",c.className="dm-notes-pad__swatch",c.dataset.noteColor=l,c.setAttribute("role","radio"),c.setAttribute("aria-label",l),c.addEventListener("click",()=>le(l)),E.set(l,c),x.appendChild(c)}const A=document.createElement("os-checkbox-label");A.className="dm-notes-pad__public",A.setAttribute("label",k("Public — visible to other desktop users","desktop-mode")),a&&A.setAttribute("checked",""),A.addEventListener("os-checkbox-change",l=>{a=l.detail.checked,e.storage.set("public",a)});const C=document.createElement("button");C.type="button",C.className="dm-notes-pad__pin-btn",C.textContent=k("Pin to desktop","desktop-mode"),C.title=k("Pin the note without dragging (Ctrl+Enter)","desktop-mode"),_.append(x,A,C),d.append(i,_),o.appendChild(d);function ie(){const l=F(r),c=F(l);f.dataset.noteColor=r,i.dataset.noteColor=r,v.dataset.noteColor=l,m.dataset.noteColor=c,u.dataset.noteColor=l,u.setAttribute("aria-label",`${k("Next paper color","desktop-mode")}: ${l}`);for(const[N,$]of E)$.setAttribute("aria-checked",N===r?"true":"false"),$.classList.toggle("is-selected",N===r)}function le(l){r=B(l),e.storage.set("color",r),ie()}const ce=()=>le(F(r));u.addEventListener("click",ce),ie();const lt=l=>{h=l.detail.value};g.addEventListener("os-input-change",lt);const ct=l=>{const c=l;c.key==="Enter"&&(c.ctrlKey||c.metaKey)&&(c.preventDefault(),pe()),c.stopPropagation()};["keydown","keypress","keyup"].forEach(l=>g.addEventListener(l,c=>{l==="keydown"?ct(c):c.stopPropagation()}));const de=()=>{h="",g.setAttribute("value","")},G=()=>{typeof window.matchMedia=="function"&&window.matchMedia("(prefers-reduced-motion: reduce)").matches||f.animate?.([{transform:"translateX(0)"},{transform:"translateX(-4px)"},{transform:"translateX(4px)"},{transform:"translateX(0)"}],{duration:200,easing:"ease-out"})},dt=()=>{const c=document.createElement("div");c.className="os-pinned-note-ghost",c.dataset.noteColor=r,c.style.width="208px";const N=document.createElement("div");N.className="os-pinned-note-ghost__swing",N.dataset.noteColor=r;const $=208/2,H=10;N.style.transformOrigin=`${$}px ${H}px`;const P=document.createElement("span");P.className="os-pinned-note__pin",P.style.setProperty("--dm-pin-dx","0px"),P.style.setProperty("--dm-pin-rot","0deg"),P.appendChild(Ke(e.pluginUrl));const Y=document.createElement("div");Y.className="os-pinned-note__paper os-pinned-note-ghost__paper";const J=document.createElement("div");return J.className="os-pinned-note__body",J.textContent=h,Y.appendChild(J),N.append(P,Y),c.appendChild(N),{root:c,tipX:$,tipY:H}},ue=l=>{if(t||!s||l.target?.closest("os-textarea, .dm-notes-pad__corner"))return;if(!h.trim()){G();return}const N=at();if(!N)return;l.preventDefault(),f.ownerDocument.defaultView?.getSelection()?.removeAllRanges();const $=dt(),H={text:h,color:r,isPublic:a};N.start({payload:{type:ot,source:f,data:H,ghost:{element:$.root,offsetX:$.tipX,offsetY:$.tipY,hint:{neutral:k("Drop on the desktop to pin","desktop-mode"),accept:k("Pin here","desktop-mode"),reject:k("Can’t pin here","desktop-mode")}}},origin:l,onClickOnly:()=>g.focusInput?.(),onCommit:()=>{de(),he()}})};f.addEventListener("pointerdown",ue);const he=()=>{typeof window.matchMedia=="function"&&window.matchMedia("(prefers-reduced-motion: reduce)").matches||f.animate?.([{transform:"translate(3px, 4px) rotate(1.1deg)",opacity:.9},{transform:"translate(-1px, -2px) rotate(-0.4deg)",offset:.7},{transform:"translate(0, 0) rotate(0deg)",opacity:1}],{duration:260,easing:"cubic-bezier(0.2, 0.7, 0.2, 1)"})};async function pe(){if(!(t||!s)){if(!h.trim()){G(),g.focusInput?.();return}C.disabled=!0;try{const l=Math.floor(Date.now()/1e3)%5,c=await tt({text:h,color:r,x:.55+l*.04,y:.12+l*.05,public:a,seed:Ue(h)});if(t)return;de(),he(),document.dispatchEvent(new CustomEvent(nt,{detail:{note:c}}))}catch(l){console.error("[openstation] note pad: create failed:",l),G();const c=window.wp?.os?.showToast;c?.({message:k("Could not pin the note. Please try again.","desktop-mode"),duration:5e3})}finally{C.disabled=!1}}}const fe=()=>{pe()};return C.addEventListener("click",fe),s||(d.classList.add("dm-notes-pad--unavailable"),g.setAttribute("disabled",""),C.disabled=!0),()=>{t=!0,f.removeEventListener("pointerdown",ue),u.removeEventListener("click",ce),C.removeEventListener("click",fe)}},V=window;V.openStationWidgets=V.openStationWidgets??{},V.openStationWidgets[st]=it})();
20 + `}_attr(e){return this.getAttribute(e)}_boolAttr(e){return this.getAttribute(e)!==null}_onInput(e){const t=e.target;this._textareaEl=t,this.setAttribute("value",t.value),this.emit("os-input-change",{value:t.value}),this._boolAttr("auto-grow")&&this._autosize(t)}_onChange(e){const t=e.target;this.emit("os-input-commit",{value:t.value})}_onKeyDown(e){if(!(!this._boolAttr("submit-on-enter")||e.isComposing||e.keyCode===229)&&e.key==="Enter"&&!e.shiftKey&&!e.altKey&&!e.metaKey&&!e.ctrlKey){e.preventDefault();const t=e.target;this.emit("os-submit",{value:t.value})}}_autosize(e){const t=Number(this._attr("max-rows"))||8,n=window.getComputedStyle(e),s=parseFloat(n.fontSize)||13,r=n.lineHeight,a=r==="normal"?s*1.45:parseFloat(r)||s*1.45,c=parseFloat(n.paddingTop)||0,l=parseFloat(n.paddingBottom)||0,i=(parseFloat(n.borderTopWidth)||0)+(parseFloat(n.borderBottomWidth)||0),d=a*t+c+l+i;e.style.height="auto",e.style.overflowY="hidden";const u=e.value?e.scrollHeight+i:a*(Number(this._attr("rows"))||3)+c+l+i,h=Math.min(u,d);e.style.height=`${Math.ceil(h)}px`,e.style.overflowY=u>Math.ceil(d)?"auto":"hidden"}refreshAutosize(){this._textareaEl&&this._boolAttr("auto-grow")&&this._autosize(this._textareaEl)}focusInput(){(this.shadowRoot??this).querySelector("textarea")?.focus()}clear(){this.setAttribute("value","");const t=(this.shadowRoot??this).querySelector("textarea");t&&(t.value="",this._boolAttr("auto-grow")&&this._autosize(t))}};R.props=["label","value","placeholder","disabled","readonly","ariaLabel","name","rows","maxlength","minlength","invalid","autoGrow","maxRows","submitOnEnter"],R.styles=[ze],R.help=void 0;let U=R;xe("os-textarea",U);const Me="desktop-mode";function Pe(){return window.wp?.i18n}function E(o,e=Me){return Pe()?.__(o,e)??o}const S=["butter","blush","sky","mint","lilac","peach"];function W(o){return S.includes(o)?o:S[0]}function X(o){const e=S.indexOf(W(o));return S[(e+1)%S.length]}function De(o){let e=2166136261;for(let n=0;n<o.length;n++)e^=o.charCodeAt(n),e=Math.imul(e,16777619)>>>0;return e>>>1||1}const Oe=56,He=52;function Ue(o){return`${o.replace(/\/$/,"")}/assets/images/pushpin.svg`}function We(o){const e=document.createElement("img");return e.src=Ue(o),e.alt="",e.width=Oe,e.height=He,e.draggable=!1,e.className="os-pinned-note__pin-img",e}const oe="X-WP-Nonce";function Xe(o,e){const t=qe();if(!t)return e;const n=Ke(o);if(!n||!Fe(n))return e;const s=e?.headers??(typeof Request<"u"&&o instanceof Request?o.headers:void 0),r=new Headers(s??{});return r.has(oe)?e:(r.set(oe,t),{...e??{},headers:r})}function qe(){if(typeof window>"u")return;const e=window.openStationConfig?.restNonce;return typeof e=="string"&&e.length>0?e:void 0}function Ke(o){try{const e=typeof window<"u"&&window.location?window.location.href:void 0;return typeof o=="string"?new URL(o,e):o instanceof URL?o:typeof Request<"u"&&o instanceof Request?new URL(o.url,e):null}catch{return null}}function Fe(o){return typeof window>"u"||!window.location||o.origin!==window.location.origin?!1:!!(o.pathname.includes("/wp-json/")||o.searchParams.has("rest_route"))}function Be(o,e,t={}){const n=window.wp?.os?.fetch;if(typeof n=="function")return n(o,e,t);const s=Xe(o,e);return fetch(o,s)}let q=null;function je(o){q=o}function Ve(){if(!q)throw new Error("[openstation] notes REST client called before installNotesRestDeps().");return q}function Ge(o){const e=window.openStationConfig;return typeof e?.restNonce=="string"&&e.restNonce?e.restNonce:o}class Ye extends Error{constructor(e){super("Note was changed by another session."),this.status=409,this.name="NotesConflictError",this.current=e}}async function Ze(o,e){const{baseUrl:t,nonce:n}=Ve(),s=t,r=new Headers(e.headers??{});r.set("X-WP-Nonce",Ge(n)),e.body&&!r.has("Content-Type")&&r.set("Content-Type","application/json");const a=await Be(s,{...e,headers:r,credentials:"same-origin"},{source:"desktop-mode/notes"}),c=await a.text();let l=null;if(c)try{l=JSON.parse(c)}catch{l=null}if(!a.ok){if(a.status===409){const d=l?.data?.current;throw new Ye(d??null)}const i=l;throw new Error(`[openstation] notes REST ${a.status}: ${i?.code??""} ${i?.message??""}`.trim())}if(l===null)throw new Error(`[openstation] notes REST ${a.status}: empty or unparseable body.`);return l}function Je(o){return Ze("",{method:"POST",body:JSON.stringify(o)})}const Qe="note-draft",et="os-note-created",tt="desktop-mode/notes";function ot(){return window.openStationConfig??{}}function nt(){return window.wp?.os?.dragManager??null}const st=(o,e)=>{let t=!1;const n=ot(),s=!!n.notesUrl;s&&je({baseUrl:n.notesUrl,nonce:n.restNonce??""});let r=W(e.storage.get("color")??S[0]);const a=!1;let c="";const l=document.createElement("div");l.className="dm-notes-pad";const i=document.createElement("div");i.className="dm-notes-pad__stack";const d=document.createElement("div");d.className="dm-notes-pad__under dm-notes-pad__under--2";const u=document.createElement("div");u.className="dm-notes-pad__under dm-notes-pad__under--1";const h=document.createElement("div");h.className="dm-notes-pad__sheet";const b=document.createElement("div");b.className="dm-notes-pad__peel",b.setAttribute("aria-hidden","true");const m=document.createElement("span");m.className="dm-notes-pad__peel-hint",m.textContent=E("Drag to pin","desktop-mode"),b.appendChild(m);const v=document.createElement("os-textarea");v.className="dm-notes-pad__editor",v.setAttribute("aria-label",E("New note","desktop-mode")),v.setAttribute("placeholder",E("Write a note…","desktop-mode")),v.setAttribute("rows","5"),v.setAttribute("auto-grow",""),v.setAttribute("max-rows","8");const g=document.createElement("button");g.type="button",g.className="dm-notes-pad__corner",h.append(b,v,g),i.append(d,u,h);const y=document.createElement("div");y.className="dm-notes-pad__footer";const w=document.createElement("div");w.className="dm-notes-pad__swatches",w.setAttribute("role","radiogroup"),w.setAttribute("aria-label",E("Paper color","desktop-mode"));const k=new Map;for(const f of S){const p=document.createElement("button");p.type="button",p.className="dm-notes-pad__swatch",p.dataset.noteColor=f,p.setAttribute("role","radio"),p.setAttribute("aria-label",f),p.addEventListener("click",()=>ne(f)),k.set(f,p),w.appendChild(p)}y.append(w),l.append(i,y),o.appendChild(l);function T(){const f=X(r),p=X(f);h.dataset.noteColor=r,i.dataset.noteColor=r,u.dataset.noteColor=f,d.dataset.noteColor=p,g.dataset.noteColor=f,g.setAttribute("aria-label",`${E("Next paper color","desktop-mode")}: ${f}`);for(const[N,C]of k)C.setAttribute("aria-checked",N===r?"true":"false"),C.classList.toggle("is-selected",N===r)}function ne(f){r=W(f),e.storage.set("color",r),T()}const se=()=>ne(X(r));g.addEventListener("click",se),T();const rt=f=>{c=f.detail.value};v.addEventListener("os-input-change",rt);const at=f=>{const p=f;p.key==="Enter"&&(p.ctrlKey||p.metaKey)&&(p.preventDefault(),lt()),p.stopPropagation()};["keydown","keypress","keyup"].forEach(f=>v.addEventListener(f,p=>{f==="keydown"?at(p):p.stopPropagation()}));const re=()=>{c="",v.setAttribute("value","")},F=()=>{typeof window.matchMedia=="function"&&window.matchMedia("(prefers-reduced-motion: reduce)").matches||h.animate?.([{transform:"translateX(0)"},{transform:"translateX(-4px)"},{transform:"translateX(4px)"},{transform:"translateX(0)"}],{duration:200,easing:"ease-out"})},it=()=>{const p=document.createElement("div");p.className="os-pinned-note-ghost",p.dataset.noteColor=r,p.style.width="208px";const N=document.createElement("div");N.className="os-pinned-note-ghost__swing",N.dataset.noteColor=r;const C=208/2,P=10;N.style.transformOrigin=`${C}px ${P}px`;const L=document.createElement("span");L.className="os-pinned-note__pin",L.style.setProperty("--dm-pin-dx","0px"),L.style.setProperty("--dm-pin-rot","0deg"),L.appendChild(We(e.pluginUrl));const j=document.createElement("div");j.className="os-pinned-note__paper os-pinned-note-ghost__paper";const V=document.createElement("div");return V.className="os-pinned-note__body",V.textContent=c,j.appendChild(V),N.append(L,j),p.appendChild(N),{root:p,tipX:C,tipY:P}},ae=f=>{if(t||!s||f.target?.closest("os-textarea, .dm-notes-pad__corner"))return;if(!c.trim()){F();return}const N=nt();if(!N)return;f.preventDefault(),h.ownerDocument.defaultView?.getSelection()?.removeAllRanges();const C=it(),P={text:c,color:r,isPublic:a};N.start({payload:{type:Qe,source:h,data:P,ghost:{element:C.root,offsetX:C.tipX,offsetY:C.tipY,hint:{neutral:E("Drop on the desktop to pin","desktop-mode"),accept:E("Pin here","desktop-mode"),reject:E("Can’t pin here","desktop-mode")}}},origin:f,onClickOnly:()=>v.focusInput?.(),onCommit:()=>{re(),ie()}})};h.addEventListener("pointerdown",ae);const ie=()=>{typeof window.matchMedia=="function"&&window.matchMedia("(prefers-reduced-motion: reduce)").matches||h.animate?.([{transform:"translate(3px, 4px) rotate(1.1deg)",opacity:.9},{transform:"translate(-1px, -2px) rotate(-0.4deg)",offset:.7},{transform:"translate(0, 0) rotate(0deg)",opacity:1}],{duration:260,easing:"cubic-bezier(0.2, 0.7, 0.2, 1)"})};let B=!1;async function lt(){if(!(t||!s||B)){if(!c.trim()){F(),v.focusInput?.();return}B=!0;try{const f=Math.floor(Date.now()/1e3)%5,p=await Je({text:c,color:r,x:.55+f*.04,y:.12+f*.05,public:a,seed:De(c)});if(t)return;re(),ie(),document.dispatchEvent(new CustomEvent(et,{detail:{note:p}}))}catch(f){console.error("[openstation] note pad: create failed:",f),F();const p=window.wp?.os?.showToast;p?.({message:E("Could not pin the note. Please try again.","desktop-mode"),duration:5e3})}finally{B=!1}}}return s||(l.classList.add("dm-notes-pad--unavailable"),v.setAttribute("disabled","")),()=>{t=!0,h.removeEventListener("pointerdown",ae),g.removeEventListener("click",se)}},K=window;K.openStationWidgets=K.openStationWidgets??{},K.openStationWidgets[tt]=st})();