dev-process-kit 0.0.14 → 0.0.16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (31) hide show
  1. package/README.md +1 -1
  2. package/dist/chunks/{shared-Dc_FGuLM.js → shared-56aw61Mt.js} +1 -1
  3. package/dist/chunks/{shared-CGPv8MQ7.js → shared-6yS1zZwk.js} +1 -1
  4. package/dist/chunks/{shared-NnvpqsPp.js → shared-B0kk4Png.js} +1 -1
  5. package/dist/chunks/{shared-DjOBIYHF.js → shared-BMyu-cIr.js} +1 -1
  6. package/dist/chunks/{shared-C2gu-y4m.js → shared-BYBLt-RG.js} +2 -13
  7. package/dist/chunks/{shared-BESRsbtm.js → shared-BqyO8tFt.js} +1 -1
  8. package/dist/chunks/{shared-rZQ5j0Kh.js → shared-C1OgX-P6.js} +216 -133
  9. package/dist/chunks/{shared-CmBhMY6X.js → shared-CHPc3-vO.js} +1 -1
  10. package/dist/chunks/shared-CYcKSitA.js +2560 -0
  11. package/dist/chunks/{shared-BFTEmZvI.js → shared-DFT6VIi_.js} +1 -1
  12. package/dist/chunks/{shared-DUEkF1z7.js → shared-DLpKWOi6.js} +1 -1
  13. package/dist/chunks/shared-DewUyNUX.js +2245 -0
  14. package/dist/chunks/{shared-CE1P_7xs.js → shared-DlMlDHZ3.js} +1 -1
  15. package/dist/chunks/shared-sTu0Wlge.js +1 -0
  16. package/dist/chunks/{shared-DD-fi15c.js → shared-wOFcYu2a.js} +1 -1
  17. package/dist/components.js +1 -1
  18. package/dist/index.js +1 -1
  19. package/dist/templates/delegation-poker.js +1 -1
  20. package/dist/templates/event-storming.js +1 -1
  21. package/dist/templates/example-mapping.js +1 -1
  22. package/dist/templates/grill.js +1 -1
  23. package/dist/templates/plain.js +1 -1
  24. package/dist/templates/prototype.js +1 -1
  25. package/dist/templates/slides.js +1 -1
  26. package/dist/templates/task-board.js +1 -1
  27. package/dist/templates/usm.js +1 -1
  28. package/dist/templates/whiteboard.js +1 -1
  29. package/package.json +1 -1
  30. package/dist/chunks/shared-CTK76mc_.js +0 -2457
  31. package/dist/chunks/shared-wtt8CCP_.js +0 -2073
@@ -1,10 +1,10 @@
1
- const kt=globalThis,rn=kt.ShadowRoot&&(kt.ShadyCSS===void 0||kt.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,on=Symbol(),As=new WeakMap;let Cs=class{constructor(e,n,s){if(this._$cssResult$=!0,s!==on)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=n}get styleSheet(){let e=this.o;const n=this.t;if(rn&&e===void 0){const s=n!==void 0&&n.length===1;s&&(e=As.get(n)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),s&&As.set(n,e))}return e}toString(){return this.cssText}};const Ts=t=>new Cs(typeof t=="string"?t:t+"",void 0,on),de=(t,...e)=>{const n=t.length===1?t[0]:e.reduce((s,i,r)=>s+(o=>{if(o._$cssResult$===!0)return o.cssText;if(typeof o=="number")return o;throw Error("Value passed to 'css' function must be a 'css' function result: "+o+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(i)+t[r+1],t[0]);return new Cs(n,t,on)},Po=(t,e)=>{if(rn)t.adoptedStyleSheets=e.map(n=>n instanceof CSSStyleSheet?n:n.styleSheet);else for(const n of e){const s=document.createElement("style"),i=kt.litNonce;i!==void 0&&s.setAttribute("nonce",i),s.textContent=n.cssText,t.appendChild(s)}},Es=rn?t=>t:t=>t instanceof CSSStyleSheet?(e=>{let n="";for(const s of e.cssRules)n+=s.cssText;return Ts(n)})(t):t,{is:zo,defineProperty:Mo,getOwnPropertyDescriptor:Io,getOwnPropertyNames:No,getOwnPropertySymbols:Do,getPrototypeOf:jo}=Object,bt=globalThis,Rs=bt.trustedTypes,qo=Rs?Rs.emptyScript:"",Bo=bt.reactiveElementPolyfillSupport,Ge=(t,e)=>t,an={toAttribute(t,e){switch(e){case Boolean:t=t?qo:null;break;case Object:case Array:t=t==null?t:JSON.stringify(t)}return t},fromAttribute(t,e){let n=t;switch(e){case Boolean:n=t!==null;break;case Number:n=t===null?null:Number(t);break;case Object:case Array:try{n=JSON.parse(t)}catch{n=null}}return n}},_s=(t,e)=>!zo(t,e),Ls={attribute:!0,type:String,converter:an,reflect:!1,useDefault:!1,hasChanged:_s};Symbol.metadata??=Symbol("metadata"),bt.litPropertyMetadata??=new WeakMap;let Ne=class extends HTMLElement{static addInitializer(e){this._$Ei(),(this.l??=[]).push(e)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(e,n=Ls){if(n.state&&(n.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(e)&&((n=Object.create(n)).wrapped=!0),this.elementProperties.set(e,n),!n.noAccessor){const s=Symbol(),i=this.getPropertyDescriptor(e,s,n);i!==void 0&&Mo(this.prototype,e,i)}}static getPropertyDescriptor(e,n,s){const{get:i,set:r}=Io(this.prototype,e)??{get(){return this[n]},set(o){this[n]=o}};return{get:i,set(o){const a=i?.call(this);r?.call(this,o),this.requestUpdate(e,a,s)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??Ls}static _$Ei(){if(this.hasOwnProperty(Ge("elementProperties")))return;const e=jo(this);e.finalize(),e.l!==void 0&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(Ge("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(Ge("properties"))){const n=this.properties,s=[...No(n),...Do(n)];for(const i of s)this.createProperty(i,n[i])}const e=this[Symbol.metadata];if(e!==null){const n=litPropertyMetadata.get(e);if(n!==void 0)for(const[s,i]of n)this.elementProperties.set(s,i)}this._$Eh=new Map;for(const[n,s]of this.elementProperties){const i=this._$Eu(n,s);i!==void 0&&this._$Eh.set(i,n)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){const n=[];if(Array.isArray(e)){const s=new Set(e.flat(1/0).reverse());for(const i of s)n.unshift(Es(i))}else e!==void 0&&n.push(Es(e));return n}static _$Eu(e,n){const s=n.attribute;return s===!1?void 0:typeof s=="string"?s:typeof e=="string"?e.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise(e=>this.enableUpdating=e),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(e=>e(this))}addController(e){(this._$EO??=new Set).add(e),this.renderRoot!==void 0&&this.isConnected&&e.hostConnected?.()}removeController(e){this._$EO?.delete(e)}_$E_(){const e=new Map,n=this.constructor.elementProperties;for(const s of n.keys())this.hasOwnProperty(s)&&(e.set(s,this[s]),delete this[s]);e.size>0&&(this._$Ep=e)}createRenderRoot(){const e=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return Po(e,this.constructor.elementStyles),e}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach(e=>e.hostConnected?.())}enableUpdating(e){}disconnectedCallback(){this._$EO?.forEach(e=>e.hostDisconnected?.())}attributeChangedCallback(e,n,s){this._$AK(e,s)}_$ET(e,n){const s=this.constructor.elementProperties.get(e),i=this.constructor._$Eu(e,s);if(i!==void 0&&s.reflect===!0){const r=(s.converter?.toAttribute!==void 0?s.converter:an).toAttribute(n,s.type);this._$Em=e,r==null?this.removeAttribute(i):this.setAttribute(i,r),this._$Em=null}}_$AK(e,n){const s=this.constructor,i=s._$Eh.get(e);if(i!==void 0&&this._$Em!==i){const r=s.getPropertyOptions(i),o=typeof r.converter=="function"?{fromAttribute:r.converter}:r.converter?.fromAttribute!==void 0?r.converter:an;this._$Em=i;const a=o.fromAttribute(n,r.type);this[i]=a??this._$Ej?.get(i)??a,this._$Em=null}}requestUpdate(e,n,s,i=!1,r){if(e!==void 0){const o=this.constructor;if(i===!1&&(r=this[e]),s??=o.getPropertyOptions(e),!((s.hasChanged??_s)(r,n)||s.useDefault&&s.reflect&&r===this._$Ej?.get(e)&&!this.hasAttribute(o._$Eu(e,s))))return;this.C(e,n,s)}this.isUpdatePending===!1&&(this._$ES=this._$EP())}C(e,n,{useDefault:s,reflect:i,wrapped:r},o){s&&!(this._$Ej??=new Map).has(e)&&(this._$Ej.set(e,o??n??this[e]),r!==!0||o!==void 0)||(this._$AL.has(e)||(this.hasUpdated||s||(n=void 0),this._$AL.set(e,n)),i===!0&&this._$Em!==e&&(this._$Eq??=new Set).add(e))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(n){Promise.reject(n)}const e=this.scheduleUpdate();return e!=null&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(const[i,r]of this._$Ep)this[i]=r;this._$Ep=void 0}const s=this.constructor.elementProperties;if(s.size>0)for(const[i,r]of s){const{wrapped:o}=r,a=this[i];o!==!0||this._$AL.has(i)||a===void 0||this.C(i,void 0,r,a)}}let e=!1;const n=this._$AL;try{e=this.shouldUpdate(n),e?(this.willUpdate(n),this._$EO?.forEach(s=>s.hostUpdate?.()),this.update(n)):this._$EM()}catch(s){throw e=!1,this._$EM(),s}e&&this._$AE(n)}willUpdate(e){}_$AE(e){this._$EO?.forEach(n=>n.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(e){return!0}update(e){this._$Eq&&=this._$Eq.forEach(n=>this._$ET(n,this[n])),this._$EM()}updated(e){}firstUpdated(e){}};Ne.elementStyles=[],Ne.shadowRootOptions={mode:"open"},Ne[Ge("elementProperties")]=new Map,Ne[Ge("finalized")]=new Map,Bo?.({ReactiveElement:Ne}),(bt.reactiveElementVersions??=[]).push("2.1.2");const ln=globalThis,Os=t=>t,xt=ln.trustedTypes,Ps=xt?xt.createPolicy("lit-html",{createHTML:t=>t}):void 0,zs="$lit$",pe=`lit$${Math.random().toFixed(9).slice(2)}$`,Ms="?"+pe,Uo=`<${Ms}>`,ye=document,Ye=()=>ye.createComment(""),Je=t=>t===null||typeof t!="object"&&typeof t!="function",cn=Array.isArray,Ho=t=>cn(t)||typeof t?.[Symbol.iterator]=="function",dn=`[
2
- \f\r]`,Xe=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,Is=/-->/g,Ns=/>/g,we=RegExp(`>|${dn}(?:([^\\s"'>=/]+)(${dn}*=${dn}*(?:[^
3
- \f\r"'\`<>=]|("|')|))|$)`,"g"),Ds=/'/g,js=/"/g,qs=/^(?:script|style|textarea|title)$/i,Bs=t=>(e,...n)=>({_$litType$:t,strings:e,values:n}),b=Bs(1),Fo=Bs(2),H=Symbol.for("lit-noChange"),m=Symbol.for("lit-nothing"),Us=new WeakMap,$e=ye.createTreeWalker(ye,129);function Hs(t,e){if(!cn(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return Ps!==void 0?Ps.createHTML(e):e}const Wo=(t,e)=>{const n=t.length-1,s=[];let i,r=e===2?"<svg>":e===3?"<math>":"",o=Xe;for(let a=0;a<n;a++){const l=t[a];let c,p,d=-1,h=0;for(;h<l.length&&(o.lastIndex=h,p=o.exec(l),p!==null);)h=o.lastIndex,o===Xe?p[1]==="!--"?o=Is:p[1]!==void 0?o=Ns:p[2]!==void 0?(qs.test(p[2])&&(i=RegExp("</"+p[2],"g")),o=we):p[3]!==void 0&&(o=we):o===we?p[0]===">"?(o=i??Xe,d=-1):p[1]===void 0?d=-2:(d=o.lastIndex-p[2].length,c=p[1],o=p[3]===void 0?we:p[3]==='"'?js:Ds):o===js||o===Ds?o=we:o===Is||o===Ns?o=Xe:(o=we,i=void 0);const u=o===we&&t[a+1].startsWith("/>")?" ":"";r+=o===Xe?l+Uo:d>=0?(s.push(c),l.slice(0,d)+zs+l.slice(d)+pe+u):l+pe+(d===-2?a:u)}return[Hs(t,r+(t[n]||"<?>")+(e===2?"</svg>":e===3?"</math>":"")),s]};let pn=class _o{constructor({strings:e,_$litType$:n},s){let i;this.parts=[];let r=0,o=0;const a=e.length-1,l=this.parts,[c,p]=Wo(e,n);if(this.el=_o.createElement(c,s),$e.currentNode=this.el.content,n===2||n===3){const d=this.el.content.firstChild;d.replaceWith(...d.childNodes)}for(;(i=$e.nextNode())!==null&&l.length<a;){if(i.nodeType===1){if(i.hasAttributes())for(const d of i.getAttributeNames())if(d.endsWith(zs)){const h=p[o++],u=i.getAttribute(d).split(pe),f=/([.?@])?(.*)/.exec(h);l.push({type:1,index:r,name:f[2],strings:u,ctor:f[1]==="."?Ko:f[1]==="?"?Zo:f[1]==="@"?Go:yt}),i.removeAttribute(d)}else d.startsWith(pe)&&(l.push({type:6,index:r}),i.removeAttribute(d));if(qs.test(i.tagName)){const d=i.textContent.split(pe),h=d.length-1;if(h>0){i.textContent=xt?xt.emptyScript:"";for(let u=0;u<h;u++)i.append(d[u],Ye()),$e.nextNode(),l.push({type:2,index:++r});i.append(d[h],Ye())}}}else if(i.nodeType===8)if(i.data===Ms)l.push({type:2,index:r});else{let d=-1;for(;(d=i.data.indexOf(pe,d+1))!==-1;)l.push({type:7,index:r}),d+=pe.length-1}r++}}static createElement(e,n){const s=ye.createElement("template");return s.innerHTML=e,s}};function De(t,e,n=t,s){if(e===H)return e;let i=s!==void 0?n._$Co?.[s]:n._$Cl;const r=Je(e)?void 0:e._$litDirective$;return i?.constructor!==r&&(i?._$AO?.(!1),r===void 0?i=void 0:(i=new r(t),i._$AT(t,n,s)),s!==void 0?(n._$Co??=[])[s]=i:n._$Cl=i),i!==void 0&&(e=De(t,i._$AS(t,e.values),i,s)),e}let Vo=class{constructor(e,n){this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=n}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(e){const{el:{content:n},parts:s}=this._$AD,i=(e?.creationScope??ye).importNode(n,!0);$e.currentNode=i;let r=$e.nextNode(),o=0,a=0,l=s[0];for(;l!==void 0;){if(o===l.index){let c;l.type===2?c=new vt(r,r.nextSibling,this,e):l.type===1?c=new l.ctor(r,l.name,l.strings,this,e):l.type===6&&(c=new Yo(r,this,e)),this._$AV.push(c),l=s[++a]}o!==l?.index&&(r=$e.nextNode(),o++)}return $e.currentNode=ye,i}p(e){let n=0;for(const s of this._$AV)s!==void 0&&(s.strings!==void 0?(s._$AI(e,s,n),n+=s.strings.length-2):s._$AI(e[n])),n++}},vt=class Lo{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(e,n,s,i){this.type=2,this._$AH=m,this._$AN=void 0,this._$AA=e,this._$AB=n,this._$AM=s,this.options=i,this._$Cv=i?.isConnected??!0}get parentNode(){let e=this._$AA.parentNode;const n=this._$AM;return n!==void 0&&e?.nodeType===11&&(e=n.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,n=this){e=De(this,e,n),Je(e)?e===m||e==null||e===""?(this._$AH!==m&&this._$AR(),this._$AH=m):e!==this._$AH&&e!==H&&this._(e):e._$litType$!==void 0?this.$(e):e.nodeType!==void 0?this.T(e):Ho(e)?this.k(e):this._(e)}O(e){return this._$AA.parentNode.insertBefore(e,this._$AB)}T(e){this._$AH!==e&&(this._$AR(),this._$AH=this.O(e))}_(e){this._$AH!==m&&Je(this._$AH)?this._$AA.nextSibling.data=e:this.T(ye.createTextNode(e)),this._$AH=e}$(e){const{values:n,_$litType$:s}=e,i=typeof s=="number"?this._$AC(e):(s.el===void 0&&(s.el=pn.createElement(Hs(s.h,s.h[0]),this.options)),s);if(this._$AH?._$AD===i)this._$AH.p(n);else{const r=new Vo(i,this),o=r.u(this.options);r.p(n),this.T(o),this._$AH=r}}_$AC(e){let n=Us.get(e.strings);return n===void 0&&Us.set(e.strings,n=new pn(e)),n}k(e){cn(this._$AH)||(this._$AH=[],this._$AR());const n=this._$AH;let s,i=0;for(const r of e)i===n.length?n.push(s=new Lo(this.O(Ye()),this.O(Ye()),this,this.options)):s=n[i],s._$AI(r),i++;i<n.length&&(this._$AR(s&&s._$AB.nextSibling,i),n.length=i)}_$AR(e=this._$AA.nextSibling,n){for(this._$AP?.(!1,!0,n);e!==this._$AB;){const s=Os(e).nextSibling;Os(e).remove(),e=s}}setConnected(e){this._$AM===void 0&&(this._$Cv=e,this._$AP?.(e))}};class yt{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,n,s,i,r){this.type=1,this._$AH=m,this._$AN=void 0,this.element=e,this.name=n,this._$AM=i,this.options=r,s.length>2||s[0]!==""||s[1]!==""?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=m}_$AI(e,n=this,s,i){const r=this.strings;let o=!1;if(r===void 0)e=De(this,e,n,0),o=!Je(e)||e!==this._$AH&&e!==H,o&&(this._$AH=e);else{const a=e;let l,c;for(e=r[0],l=0;l<r.length-1;l++)c=De(this,a[s+l],n,l),c===H&&(c=this._$AH[l]),o||=!Je(c)||c!==this._$AH[l],c===m?e=m:e!==m&&(e+=(c??"")+r[l+1]),this._$AH[l]=c}o&&!i&&this.j(e)}j(e){e===m?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}}let Ko=class extends yt{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===m?void 0:e}},Zo=class extends yt{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==m)}},Go=class extends yt{constructor(e,n,s,i,r){super(e,n,s,i,r),this.type=5}_$AI(e,n=this){if((e=De(this,e,n,0)??m)===H)return;const s=this._$AH,i=e===m&&s!==m||e.capture!==s.capture||e.once!==s.once||e.passive!==s.passive,r=e!==m&&(s===m||i);i&&this.element.removeEventListener(this.name,this,s),r&&this.element.addEventListener(this.name,this,e),this._$AH=e}handleEvent(e){typeof this._$AH=="function"?this._$AH.call(this.options?.host??this.element,e):this._$AH.handleEvent(e)}};class Yo{constructor(e,n,s){this.element=e,this.type=6,this._$AN=void 0,this._$AM=n,this.options=s}get _$AU(){return this._$AM._$AU}_$AI(e){De(this,e)}}const Jo={I:vt},Xo=ln.litHtmlPolyfillSupport;Xo?.(pn,vt),(ln.litHtmlVersions??=[]).push("3.3.3");const Qo=(t,e,n)=>{const s=n?.renderBefore??e;let i=s._$litPart$;if(i===void 0){const r=n?.renderBefore??null;s._$litPart$=i=new vt(e.insertBefore(Ye(),r),r,void 0,n??{})}return i._$AI(t),i},hn=globalThis;let he=class extends Ne{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){const e=super.createRenderRoot();return this.renderOptions.renderBefore??=e.firstChild,e}update(e){const n=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=Qo(n,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return H}};he._$litElement$=!0,he.finalized=!0,hn.litElementHydrateSupport?.({LitElement:he});const ea=hn.litElementPolyfillSupport;ea?.({LitElement:he}),(hn.litElementVersions??=[]).push("4.2.2");const ue={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4},Qe=t=>(...e)=>({_$litDirective$:t,values:e});let wt=class{constructor(e){}get _$AU(){return this._$AM._$AU}_$AT(e,n,s){this._$Ct=e,this._$AM=n,this._$Ci=s}_$AS(e,n){return this.update(e,n)}update(e,n){return this.render(...n)}};const{I:ta}=Jo,Fs=t=>t,na=t=>t.strings===void 0,Ws=()=>document.createComment(""),et=(t,e,n)=>{const s=t._$AA.parentNode,i=e===void 0?t._$AB:e._$AA;if(n===void 0){const r=s.insertBefore(Ws(),i),o=s.insertBefore(Ws(),i);n=new ta(r,o,t,t.options)}else{const r=n._$AB.nextSibling,o=n._$AM,a=o!==t;if(a){let l;n._$AQ?.(t),n._$AM=t,n._$AP!==void 0&&(l=t._$AU)!==o._$AU&&n._$AP(l)}if(r!==i||a){let l=n._$AA;for(;l!==r;){const c=Fs(l).nextSibling;Fs(s).insertBefore(l,i),l=c}}}return n},Se=(t,e,n=t)=>(t._$AI(e,n),t),sa={},un=(t,e=sa)=>t._$AH=e,ia=t=>t._$AH,fn=t=>{t._$AR(),t._$AA.remove()},gn=Qe(class extends wt{constructor(t){if(super(t),t.type!==ue.PROPERTY&&t.type!==ue.ATTRIBUTE&&t.type!==ue.BOOLEAN_ATTRIBUTE)throw Error("The `live` directive is not allowed on child or event bindings");if(!na(t))throw Error("`live` bindings can only contain a single expression")}render(t){return t}update(t,[e]){if(e===H||e===m)return e;const n=t.element,s=t.name;if(t.type===ue.PROPERTY){if(e===n[s])return H}else if(t.type===ue.BOOLEAN_ATTRIBUTE){if(!!e===n.hasAttribute(s))return H}else if(t.type===ue.ATTRIBUTE&&n.getAttribute(s)===e+"")return H;return un(t),e}});class $t extends wt{constructor(e){if(super(e),this.it=m,e.type!==ue.CHILD)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(e){if(e===m||e==null)return this._t=void 0,this.it=e;if(e===H)return e;if(typeof e!="string")throw Error(this.constructor.directiveName+"() called with a non-string value");if(e===this.it)return this._t;this.it=e;const n=[e];return n.raw=n,this._t={_$litType$:this.constructor.resultType,strings:n,values:[]}}}$t.directiveName="unsafeHTML",$t.resultType=1;const Vs=Qe($t),St=t=>{let e=t;for(;e!==null;){if(e instanceof Element){const n=e.getAttribute("lang");if(n!==null)return n}e=e instanceof ShadowRoot?e.host:e.parentNode}return null},mn=["en","ja"],Ks="en",Zs=t=>mn.some(e=>e===t),At=t=>{const e=(t??"").split("-")[0]?.toLowerCase()??"";return Zs(e)?e:Ks},Gs=t=>At(St(t)),kn="dpk-locale-change",Ys=t=>typeof t=="string"&&Zs(t)?t:null,ra=t=>t.preference??t.authored,oa=(t,e)=>t===e?null:t,Ct=t=>e=>e==="ja"?t.ja:t.en;class bn{#e;#n;#s=Ks;constructor(e,n=()=>{}){this.#e=e,this.#n=n,e.addController(this)}get locale(){return this.#s}hostConnected(){this.#s=Gs(this.#e),document.addEventListener(kn,this.#r)}hostDisconnected(){document.removeEventListener(kn,this.#r)}#r=()=>{const e=Gs(this.#e);e!==this.#s&&(this.#s=e,this.#n(),this.#e.requestUpdate())}}const aa={paper:["#f6f7f9","#0e1014"],"paper-raised":["#ffffff","#171a20"],"paper-sunken":["#eff1f4","#0a0b0e"],"paper-inset":["#e7eaef","#22262e"],ink:["#11141b","#eceef3"],"ink-soft":["#464e5f","#a9b0bd"],"ink-faint":["#788195","#737b8b"],rule:["rgba(17, 24, 39, 0.08)","rgba(226, 232, 244, 0.08)"],"rule-strong":["rgba(17, 24, 39, 0.13)","rgba(226, 232, 244, 0.14)"],"rule-hover":["rgba(17, 24, 39, 0.24)","rgba(226, 232, 244, 0.26)"],accent:["#e04e1f","#f26a3d"],"accent-strong":["#c63f12","#dc5226"],"accent-bright":["#f0652f","#ff8a5e"],"accent-soft":["rgba(224, 78, 31, 0.08)","rgba(242, 106, 61, 0.14)"],"accent-ink":["#ffffff","#ffffff"],blue:["#3563d9","#7aa2f7"],"blue-strong":["#2a4fb3","#5b86e8"],"blue-soft":["rgba(53, 99, 217, 0.09)","rgba(122, 162, 247, 0.15)"],green:["#15894a","#4cc787"],"green-soft":["rgba(21, 137, 74, 0.09)","rgba(76, 199, 135, 0.14)"],amber:["#b27406","#e9ae45"],"amber-soft":["rgba(178, 116, 6, 0.1)","rgba(233, 174, 69, 0.15)"],violet:["#7549d6","#ab90f5"],"violet-soft":["rgba(117, 73, 214, 0.09)","rgba(171, 144, 245, 0.15)"],danger:["#c11d38","#f5707f"],"danger-soft":["rgba(214, 53, 80, 0.09)","rgba(245, 112, 127, 0.14)"],shade:["rgb(17, 24, 39)","rgb(0, 0, 0)"],"shade-1":["rgba(17, 24, 39, 0.06)","rgba(0, 0, 0, 0.32)"],"shade-2":["rgba(17, 24, 39, 0.08)","rgba(0, 0, 0, 0.38)"],"shade-3":["rgba(17, 24, 39, 0.13)","rgba(0, 0, 0, 0.5)"],highlight:["rgba(255, 255, 255, 0.9)","rgba(255, 255, 255, 0.05)"]},Js=t=>Ts(Object.entries(aa).map(([e,[n,s]])=>`--dpk-${e}: ${t(n,s)};`).join(`
4
- `)),Tt=de`
1
+ const xt=globalThis,on=xt.ShadowRoot&&(xt.ShadyCSS===void 0||xt.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,an=Symbol(),Es=new WeakMap;let Rs=class{constructor(e,n,s){if(this._$cssResult$=!0,s!==an)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=n}get styleSheet(){let e=this.o;const n=this.t;if(on&&e===void 0){const s=n!==void 0&&n.length===1;s&&(e=Es.get(n)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),s&&Es.set(n,e))}return e}toString(){return this.cssText}};const _s=t=>new Rs(typeof t=="string"?t:t+"",void 0,an),de=(t,...e)=>{const n=t.length===1?t[0]:e.reduce((s,i,r)=>s+(o=>{if(o._$cssResult$===!0)return o.cssText;if(typeof o=="number")return o;throw Error("Value passed to 'css' function must be a 'css' function result: "+o+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(i)+t[r+1],t[0]);return new Rs(n,t,an)},jo=(t,e)=>{if(on)t.adoptedStyleSheets=e.map(n=>n instanceof CSSStyleSheet?n:n.styleSheet);else for(const n of e){const s=document.createElement("style"),i=xt.litNonce;i!==void 0&&s.setAttribute("nonce",i),s.textContent=n.cssText,t.appendChild(s)}},Ls=on?t=>t:t=>t instanceof CSSStyleSheet?(e=>{let n="";for(const s of e.cssRules)n+=s.cssText;return _s(n)})(t):t,{is:qo,defineProperty:Bo,getOwnPropertyDescriptor:Uo,getOwnPropertyNames:Ho,getOwnPropertySymbols:Fo,getPrototypeOf:Wo}=Object,yt=globalThis,Os=yt.trustedTypes,Vo=Os?Os.emptyScript:"",Ko=yt.reactiveElementPolyfillSupport,Ye=(t,e)=>t,ln={toAttribute(t,e){switch(e){case Boolean:t=t?Vo:null;break;case Object:case Array:t=t==null?t:JSON.stringify(t)}return t},fromAttribute(t,e){let n=t;switch(e){case Boolean:n=t!==null;break;case Number:n=t===null?null:Number(t);break;case Object:case Array:try{n=JSON.parse(t)}catch{n=null}}return n}},Ps=(t,e)=>!qo(t,e),zs={attribute:!0,type:String,converter:ln,reflect:!1,useDefault:!1,hasChanged:Ps};Symbol.metadata??=Symbol("metadata"),yt.litPropertyMetadata??=new WeakMap;let Ne=class extends HTMLElement{static addInitializer(e){this._$Ei(),(this.l??=[]).push(e)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(e,n=zs){if(n.state&&(n.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(e)&&((n=Object.create(n)).wrapped=!0),this.elementProperties.set(e,n),!n.noAccessor){const s=Symbol(),i=this.getPropertyDescriptor(e,s,n);i!==void 0&&Bo(this.prototype,e,i)}}static getPropertyDescriptor(e,n,s){const{get:i,set:r}=Uo(this.prototype,e)??{get(){return this[n]},set(o){this[n]=o}};return{get:i,set(o){const a=i?.call(this);r?.call(this,o),this.requestUpdate(e,a,s)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??zs}static _$Ei(){if(this.hasOwnProperty(Ye("elementProperties")))return;const e=Wo(this);e.finalize(),e.l!==void 0&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(Ye("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(Ye("properties"))){const n=this.properties,s=[...Ho(n),...Fo(n)];for(const i of s)this.createProperty(i,n[i])}const e=this[Symbol.metadata];if(e!==null){const n=litPropertyMetadata.get(e);if(n!==void 0)for(const[s,i]of n)this.elementProperties.set(s,i)}this._$Eh=new Map;for(const[n,s]of this.elementProperties){const i=this._$Eu(n,s);i!==void 0&&this._$Eh.set(i,n)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){const n=[];if(Array.isArray(e)){const s=new Set(e.flat(1/0).reverse());for(const i of s)n.unshift(Ls(i))}else e!==void 0&&n.push(Ls(e));return n}static _$Eu(e,n){const s=n.attribute;return s===!1?void 0:typeof s=="string"?s:typeof e=="string"?e.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise(e=>this.enableUpdating=e),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(e=>e(this))}addController(e){(this._$EO??=new Set).add(e),this.renderRoot!==void 0&&this.isConnected&&e.hostConnected?.()}removeController(e){this._$EO?.delete(e)}_$E_(){const e=new Map,n=this.constructor.elementProperties;for(const s of n.keys())this.hasOwnProperty(s)&&(e.set(s,this[s]),delete this[s]);e.size>0&&(this._$Ep=e)}createRenderRoot(){const e=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return jo(e,this.constructor.elementStyles),e}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach(e=>e.hostConnected?.())}enableUpdating(e){}disconnectedCallback(){this._$EO?.forEach(e=>e.hostDisconnected?.())}attributeChangedCallback(e,n,s){this._$AK(e,s)}_$ET(e,n){const s=this.constructor.elementProperties.get(e),i=this.constructor._$Eu(e,s);if(i!==void 0&&s.reflect===!0){const r=(s.converter?.toAttribute!==void 0?s.converter:ln).toAttribute(n,s.type);this._$Em=e,r==null?this.removeAttribute(i):this.setAttribute(i,r),this._$Em=null}}_$AK(e,n){const s=this.constructor,i=s._$Eh.get(e);if(i!==void 0&&this._$Em!==i){const r=s.getPropertyOptions(i),o=typeof r.converter=="function"?{fromAttribute:r.converter}:r.converter?.fromAttribute!==void 0?r.converter:ln;this._$Em=i;const a=o.fromAttribute(n,r.type);this[i]=a??this._$Ej?.get(i)??a,this._$Em=null}}requestUpdate(e,n,s,i=!1,r){if(e!==void 0){const o=this.constructor;if(i===!1&&(r=this[e]),s??=o.getPropertyOptions(e),!((s.hasChanged??Ps)(r,n)||s.useDefault&&s.reflect&&r===this._$Ej?.get(e)&&!this.hasAttribute(o._$Eu(e,s))))return;this.C(e,n,s)}this.isUpdatePending===!1&&(this._$ES=this._$EP())}C(e,n,{useDefault:s,reflect:i,wrapped:r},o){s&&!(this._$Ej??=new Map).has(e)&&(this._$Ej.set(e,o??n??this[e]),r!==!0||o!==void 0)||(this._$AL.has(e)||(this.hasUpdated||s||(n=void 0),this._$AL.set(e,n)),i===!0&&this._$Em!==e&&(this._$Eq??=new Set).add(e))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(n){Promise.reject(n)}const e=this.scheduleUpdate();return e!=null&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(const[i,r]of this._$Ep)this[i]=r;this._$Ep=void 0}const s=this.constructor.elementProperties;if(s.size>0)for(const[i,r]of s){const{wrapped:o}=r,a=this[i];o!==!0||this._$AL.has(i)||a===void 0||this.C(i,void 0,r,a)}}let e=!1;const n=this._$AL;try{e=this.shouldUpdate(n),e?(this.willUpdate(n),this._$EO?.forEach(s=>s.hostUpdate?.()),this.update(n)):this._$EM()}catch(s){throw e=!1,this._$EM(),s}e&&this._$AE(n)}willUpdate(e){}_$AE(e){this._$EO?.forEach(n=>n.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(e){return!0}update(e){this._$Eq&&=this._$Eq.forEach(n=>this._$ET(n,this[n])),this._$EM()}updated(e){}firstUpdated(e){}};Ne.elementStyles=[],Ne.shadowRootOptions={mode:"open"},Ne[Ye("elementProperties")]=new Map,Ne[Ye("finalized")]=new Map,Ko?.({ReactiveElement:Ne}),(yt.reactiveElementVersions??=[]).push("2.1.2");const cn=globalThis,Ms=t=>t,wt=cn.trustedTypes,Is=wt?wt.createPolicy("lit-html",{createHTML:t=>t}):void 0,Ns="$lit$",pe=`lit$${Math.random().toFixed(9).slice(2)}$`,Ds="?"+pe,Go=`<${Ds}>`,we=document,Je=()=>we.createComment(""),Xe=t=>t===null||typeof t!="object"&&typeof t!="function",dn=Array.isArray,Zo=t=>dn(t)||typeof t?.[Symbol.iterator]=="function",pn=`[
2
+ \f\r]`,Qe=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,js=/-->/g,qs=/>/g,$e=RegExp(`>|${pn}(?:([^\\s"'>=/]+)(${pn}*=${pn}*(?:[^
3
+ \f\r"'\`<>=]|("|')|))|$)`,"g"),Bs=/'/g,Us=/"/g,Hs=/^(?:script|style|textarea|title)$/i,Fs=t=>(e,...n)=>({_$litType$:t,strings:e,values:n}),b=Fs(1),Yo=Fs(2),H=Symbol.for("lit-noChange"),g=Symbol.for("lit-nothing"),Ws=new WeakMap,Se=we.createTreeWalker(we,129);function Vs(t,e){if(!dn(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return Is!==void 0?Is.createHTML(e):e}const Jo=(t,e)=>{const n=t.length-1,s=[];let i,r=e===2?"<svg>":e===3?"<math>":"",o=Qe;for(let a=0;a<n;a++){const l=t[a];let c,p,d=-1,h=0;for(;h<l.length&&(o.lastIndex=h,p=o.exec(l),p!==null);)h=o.lastIndex,o===Qe?p[1]==="!--"?o=js:p[1]!==void 0?o=qs:p[2]!==void 0?(Hs.test(p[2])&&(i=RegExp("</"+p[2],"g")),o=$e):p[3]!==void 0&&(o=$e):o===$e?p[0]===">"?(o=i??Qe,d=-1):p[1]===void 0?d=-2:(d=o.lastIndex-p[2].length,c=p[1],o=p[3]===void 0?$e:p[3]==='"'?Us:Bs):o===Us||o===Bs?o=$e:o===js||o===qs?o=Qe:(o=$e,i=void 0);const u=o===$e&&t[a+1].startsWith("/>")?" ":"";r+=o===Qe?l+Go:d>=0?(s.push(c),l.slice(0,d)+Ns+l.slice(d)+pe+u):l+pe+(d===-2?a:u)}return[Vs(t,r+(t[n]||"<?>")+(e===2?"</svg>":e===3?"</math>":"")),s]};let hn=class Io{constructor({strings:e,_$litType$:n},s){let i;this.parts=[];let r=0,o=0;const a=e.length-1,l=this.parts,[c,p]=Jo(e,n);if(this.el=Io.createElement(c,s),Se.currentNode=this.el.content,n===2||n===3){const d=this.el.content.firstChild;d.replaceWith(...d.childNodes)}for(;(i=Se.nextNode())!==null&&l.length<a;){if(i.nodeType===1){if(i.hasAttributes())for(const d of i.getAttributeNames())if(d.endsWith(Ns)){const h=p[o++],u=i.getAttribute(d).split(pe),f=/([.?@])?(.*)/.exec(h);l.push({type:1,index:r,name:f[2],strings:u,ctor:f[1]==="."?Qo:f[1]==="?"?ea:f[1]==="@"?ta:St}),i.removeAttribute(d)}else d.startsWith(pe)&&(l.push({type:6,index:r}),i.removeAttribute(d));if(Hs.test(i.tagName)){const d=i.textContent.split(pe),h=d.length-1;if(h>0){i.textContent=wt?wt.emptyScript:"";for(let u=0;u<h;u++)i.append(d[u],Je()),Se.nextNode(),l.push({type:2,index:++r});i.append(d[h],Je())}}}else if(i.nodeType===8)if(i.data===Ds)l.push({type:2,index:r});else{let d=-1;for(;(d=i.data.indexOf(pe,d+1))!==-1;)l.push({type:7,index:r}),d+=pe.length-1}r++}}static createElement(e,n){const s=we.createElement("template");return s.innerHTML=e,s}};function De(t,e,n=t,s){if(e===H)return e;let i=s!==void 0?n._$Co?.[s]:n._$Cl;const r=Xe(e)?void 0:e._$litDirective$;return i?.constructor!==r&&(i?._$AO?.(!1),r===void 0?i=void 0:(i=new r(t),i._$AT(t,n,s)),s!==void 0?(n._$Co??=[])[s]=i:n._$Cl=i),i!==void 0&&(e=De(t,i._$AS(t,e.values),i,s)),e}let Xo=class{constructor(e,n){this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=n}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(e){const{el:{content:n},parts:s}=this._$AD,i=(e?.creationScope??we).importNode(n,!0);Se.currentNode=i;let r=Se.nextNode(),o=0,a=0,l=s[0];for(;l!==void 0;){if(o===l.index){let c;l.type===2?c=new $t(r,r.nextSibling,this,e):l.type===1?c=new l.ctor(r,l.name,l.strings,this,e):l.type===6&&(c=new na(r,this,e)),this._$AV.push(c),l=s[++a]}o!==l?.index&&(r=Se.nextNode(),o++)}return Se.currentNode=we,i}p(e){let n=0;for(const s of this._$AV)s!==void 0&&(s.strings!==void 0?(s._$AI(e,s,n),n+=s.strings.length-2):s._$AI(e[n])),n++}},$t=class No{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(e,n,s,i){this.type=2,this._$AH=g,this._$AN=void 0,this._$AA=e,this._$AB=n,this._$AM=s,this.options=i,this._$Cv=i?.isConnected??!0}get parentNode(){let e=this._$AA.parentNode;const n=this._$AM;return n!==void 0&&e?.nodeType===11&&(e=n.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,n=this){e=De(this,e,n),Xe(e)?e===g||e==null||e===""?(this._$AH!==g&&this._$AR(),this._$AH=g):e!==this._$AH&&e!==H&&this._(e):e._$litType$!==void 0?this.$(e):e.nodeType!==void 0?this.T(e):Zo(e)?this.k(e):this._(e)}O(e){return this._$AA.parentNode.insertBefore(e,this._$AB)}T(e){this._$AH!==e&&(this._$AR(),this._$AH=this.O(e))}_(e){this._$AH!==g&&Xe(this._$AH)?this._$AA.nextSibling.data=e:this.T(we.createTextNode(e)),this._$AH=e}$(e){const{values:n,_$litType$:s}=e,i=typeof s=="number"?this._$AC(e):(s.el===void 0&&(s.el=hn.createElement(Vs(s.h,s.h[0]),this.options)),s);if(this._$AH?._$AD===i)this._$AH.p(n);else{const r=new Xo(i,this),o=r.u(this.options);r.p(n),this.T(o),this._$AH=r}}_$AC(e){let n=Ws.get(e.strings);return n===void 0&&Ws.set(e.strings,n=new hn(e)),n}k(e){dn(this._$AH)||(this._$AH=[],this._$AR());const n=this._$AH;let s,i=0;for(const r of e)i===n.length?n.push(s=new No(this.O(Je()),this.O(Je()),this,this.options)):s=n[i],s._$AI(r),i++;i<n.length&&(this._$AR(s&&s._$AB.nextSibling,i),n.length=i)}_$AR(e=this._$AA.nextSibling,n){for(this._$AP?.(!1,!0,n);e!==this._$AB;){const s=Ms(e).nextSibling;Ms(e).remove(),e=s}}setConnected(e){this._$AM===void 0&&(this._$Cv=e,this._$AP?.(e))}};class St{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,n,s,i,r){this.type=1,this._$AH=g,this._$AN=void 0,this.element=e,this.name=n,this._$AM=i,this.options=r,s.length>2||s[0]!==""||s[1]!==""?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=g}_$AI(e,n=this,s,i){const r=this.strings;let o=!1;if(r===void 0)e=De(this,e,n,0),o=!Xe(e)||e!==this._$AH&&e!==H,o&&(this._$AH=e);else{const a=e;let l,c;for(e=r[0],l=0;l<r.length-1;l++)c=De(this,a[s+l],n,l),c===H&&(c=this._$AH[l]),o||=!Xe(c)||c!==this._$AH[l],c===g?e=g:e!==g&&(e+=(c??"")+r[l+1]),this._$AH[l]=c}o&&!i&&this.j(e)}j(e){e===g?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}}let Qo=class extends St{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===g?void 0:e}},ea=class extends St{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==g)}},ta=class extends St{constructor(e,n,s,i,r){super(e,n,s,i,r),this.type=5}_$AI(e,n=this){if((e=De(this,e,n,0)??g)===H)return;const s=this._$AH,i=e===g&&s!==g||e.capture!==s.capture||e.once!==s.once||e.passive!==s.passive,r=e!==g&&(s===g||i);i&&this.element.removeEventListener(this.name,this,s),r&&this.element.addEventListener(this.name,this,e),this._$AH=e}handleEvent(e){typeof this._$AH=="function"?this._$AH.call(this.options?.host??this.element,e):this._$AH.handleEvent(e)}};class na{constructor(e,n,s){this.element=e,this.type=6,this._$AN=void 0,this._$AM=n,this.options=s}get _$AU(){return this._$AM._$AU}_$AI(e){De(this,e)}}const sa={I:$t},ia=cn.litHtmlPolyfillSupport;ia?.(hn,$t),(cn.litHtmlVersions??=[]).push("3.3.3");const ra=(t,e,n)=>{const s=n?.renderBefore??e;let i=s._$litPart$;if(i===void 0){const r=n?.renderBefore??null;s._$litPart$=i=new $t(e.insertBefore(Je(),r),r,void 0,n??{})}return i._$AI(t),i},un=globalThis;let he=class extends Ne{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){const e=super.createRenderRoot();return this.renderOptions.renderBefore??=e.firstChild,e}update(e){const n=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=ra(n,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return H}};he._$litElement$=!0,he.finalized=!0,un.litElementHydrateSupport?.({LitElement:he});const oa=un.litElementPolyfillSupport;oa?.({LitElement:he}),(un.litElementVersions??=[]).push("4.2.2");const ue={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4},et=t=>(...e)=>({_$litDirective$:t,values:e});let At=class{constructor(e){}get _$AU(){return this._$AM._$AU}_$AT(e,n,s){this._$Ct=e,this._$AM=n,this._$Ci=s}_$AS(e,n){return this.update(e,n)}update(e,n){return this.render(...n)}};const{I:aa}=sa,Ks=t=>t,la=t=>t.strings===void 0,Gs=()=>document.createComment(""),tt=(t,e,n)=>{const s=t._$AA.parentNode,i=e===void 0?t._$AB:e._$AA;if(n===void 0){const r=s.insertBefore(Gs(),i),o=s.insertBefore(Gs(),i);n=new aa(r,o,t,t.options)}else{const r=n._$AB.nextSibling,o=n._$AM,a=o!==t;if(a){let l;n._$AQ?.(t),n._$AM=t,n._$AP!==void 0&&(l=t._$AU)!==o._$AU&&n._$AP(l)}if(r!==i||a){let l=n._$AA;for(;l!==r;){const c=Ks(l).nextSibling;Ks(s).insertBefore(l,i),l=c}}}return n},Ae=(t,e,n=t)=>(t._$AI(e,n),t),ca={},fn=(t,e=ca)=>t._$AH=e,da=t=>t._$AH,gn=t=>{t._$AR(),t._$AA.remove()},mn=et(class extends At{constructor(t){if(super(t),t.type!==ue.PROPERTY&&t.type!==ue.ATTRIBUTE&&t.type!==ue.BOOLEAN_ATTRIBUTE)throw Error("The `live` directive is not allowed on child or event bindings");if(!la(t))throw Error("`live` bindings can only contain a single expression")}render(t){return t}update(t,[e]){if(e===H||e===g)return e;const n=t.element,s=t.name;if(t.type===ue.PROPERTY){if(e===n[s])return H}else if(t.type===ue.BOOLEAN_ATTRIBUTE){if(!!e===n.hasAttribute(s))return H}else if(t.type===ue.ATTRIBUTE&&n.getAttribute(s)===e+"")return H;return fn(t),e}});class Ct extends At{constructor(e){if(super(e),this.it=g,e.type!==ue.CHILD)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(e){if(e===g||e==null)return this._t=void 0,this.it=e;if(e===H)return e;if(typeof e!="string")throw Error(this.constructor.directiveName+"() called with a non-string value");if(e===this.it)return this._t;this.it=e;const n=[e];return n.raw=n,this._t={_$litType$:this.constructor.resultType,strings:n,values:[]}}}Ct.directiveName="unsafeHTML",Ct.resultType=1;const Zs=et(Ct),Tt=t=>{let e=t;for(;e!==null;){if(e instanceof Element){const n=e.getAttribute("lang");if(n!==null)return n}e=e instanceof ShadowRoot?e.host:e.parentNode}return null},kn=["en","ja"],Ys="en",Js=t=>kn.some(e=>e===t),Et=t=>{const e=(t??"").split("-")[0]?.toLowerCase()??"";return Js(e)?e:Ys},Xs=t=>Et(Tt(t)),bn="dpk-locale-change",Qs=t=>typeof t=="string"&&Js(t)?t:null,pa=t=>t.preference??t.authored,ha=(t,e)=>t===e?null:t,Rt=t=>e=>e==="ja"?t.ja:t.en;class vn{#e;#n;#s=Ys;constructor(e,n=()=>{}){this.#e=e,this.#n=n,e.addController(this)}get locale(){return this.#s}hostConnected(){this.#s=Xs(this.#e),document.addEventListener(bn,this.#r)}hostDisconnected(){document.removeEventListener(bn,this.#r)}#r=()=>{const e=Xs(this.#e);e!==this.#s&&(this.#s=e,this.#n(),this.#e.requestUpdate())}}const ua={paper:["#f6f7f9","#0e1014"],"paper-raised":["#ffffff","#171a20"],"paper-sunken":["#eff1f4","#0a0b0e"],"paper-inset":["#e7eaef","#22262e"],ink:["#11141b","#eceef3"],"ink-soft":["#464e5f","#a9b0bd"],"ink-faint":["#788195","#737b8b"],rule:["rgba(17, 24, 39, 0.08)","rgba(226, 232, 244, 0.08)"],"rule-strong":["rgba(17, 24, 39, 0.13)","rgba(226, 232, 244, 0.14)"],"rule-hover":["rgba(17, 24, 39, 0.24)","rgba(226, 232, 244, 0.26)"],accent:["#e04e1f","#f26a3d"],"accent-strong":["#c63f12","#dc5226"],"accent-bright":["#f0652f","#ff8a5e"],"accent-soft":["rgba(224, 78, 31, 0.08)","rgba(242, 106, 61, 0.14)"],"accent-ink":["#ffffff","#ffffff"],blue:["#3563d9","#7aa2f7"],"blue-strong":["#2a4fb3","#5b86e8"],"blue-soft":["rgba(53, 99, 217, 0.09)","rgba(122, 162, 247, 0.15)"],green:["#15894a","#4cc787"],"green-soft":["rgba(21, 137, 74, 0.09)","rgba(76, 199, 135, 0.14)"],amber:["#b27406","#e9ae45"],"amber-soft":["rgba(178, 116, 6, 0.1)","rgba(233, 174, 69, 0.15)"],violet:["#7549d6","#ab90f5"],"violet-soft":["rgba(117, 73, 214, 0.09)","rgba(171, 144, 245, 0.15)"],danger:["#c11d38","#f5707f"],"danger-soft":["rgba(214, 53, 80, 0.09)","rgba(245, 112, 127, 0.14)"],shade:["rgb(17, 24, 39)","rgb(0, 0, 0)"],"shade-1":["rgba(17, 24, 39, 0.06)","rgba(0, 0, 0, 0.32)"],"shade-2":["rgba(17, 24, 39, 0.08)","rgba(0, 0, 0, 0.38)"],"shade-3":["rgba(17, 24, 39, 0.13)","rgba(0, 0, 0, 0.5)"],highlight:["rgba(255, 255, 255, 0.9)","rgba(255, 255, 255, 0.05)"]},ei=t=>_s(Object.entries(ua).map(([e,[n,s]])=>`--dpk-${e}: ${t(n,s)};`).join(`
4
+ `)),_t=de`
5
5
  :host {
6
6
  /* Browsers without light-dark() stay light. */
7
- ${Js(t=>t)}
7
+ ${ei(t=>t)}
8
8
  --dpk-display: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
9
9
  --dpk-body: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
10
10
  --dpk-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, 'Liberation Mono', monospace;
@@ -42,7 +42,7 @@ const kt=globalThis,rn=kt.ShadowRoot&&(kt.ShadyCSS===void 0||kt.ShadyCSS.nativeS
42
42
 
43
43
  @supports (color: light-dark(#000, #fff)) {
44
44
  :host {
45
- ${Js((t,e)=>`light-dark(${t}, ${e})`)}
45
+ ${ei((t,e)=>`light-dark(${t}, ${e})`)}
46
46
  }
47
47
  }
48
48
 
@@ -328,7 +328,7 @@ const kt=globalThis,rn=kt.ShadowRoot&&(kt.ShadyCSS===void 0||kt.ShadyCSS.nativeS
328
328
  min-height: 64px;
329
329
  line-height: 1.55;
330
330
  }
331
- `,la=de`
331
+ `,fa=de`
332
332
  .comment-pop {
333
333
  box-sizing: border-box;
334
334
  overflow: auto;
@@ -383,7 +383,7 @@ const kt=globalThis,rn=kt.ShadowRoot&&(kt.ShadyCSS===void 0||kt.ShadyCSS.nativeS
383
383
  align-items: center;
384
384
  justify-content: flex-end;
385
385
  }
386
- `,Xs=de`
386
+ `,ti=de`
387
387
  .dpk-prose {
388
388
  overflow-wrap: anywhere;
389
389
  }
@@ -489,12 +489,12 @@ const kt=globalThis,rn=kt.ShadowRoot&&(kt.ShadyCSS===void 0||kt.ShadyCSS.nativeS
489
489
  .dpk-prose img {
490
490
  max-width: 100%;
491
491
  }
492
- `,je=(t,e)=>t instanceof e?t:null;function vn(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var Ae=vn();function Qs(t){Ae=t}var Ce={exec:()=>null};function qe(t){let e=[];return n=>{let s=Math.max(0,Math.min(3,n-1)),i=e[s];return i||(i=t(s),e[s]=i),i}}function y(t,e=""){let n=typeof t=="string"?t:t.source,s={replace:(i,r)=>{let o=typeof r=="string"?r:r.source;return o=o.replace(P.caret,"$1"),n=n.replace(i,o),s},getRegex:()=>new RegExp(n,e)};return s}var ca=((t="")=>{try{return!!new RegExp("(?<=1)(?<!1)"+t)}catch{return!1}})(),P={codeRemoveIndent:/^(?: {0,3}\t| {1,4})/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,endingSpaceTabChar:/[ \t]$/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,leadingSpaceTab:/^[ \t]+/,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,numericCharacterReference:/&#(?:(\d{1,7})|[Xx]([A-Fa-f0-9]{1,6}));/g,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:t=>new RegExp(`^( {0,3}${t})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:qe(t=>new RegExp(`^ {0,${t}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`)),hrRegex:qe(t=>new RegExp(`^ {0,${t}}((?:-[ ]*){3,}|(?:_[ ]*){3,}|(?:\\*[ ]*){3,})(?:\\n+|$)`)),fencesBeginRegex:qe(t=>new RegExp(`^ {0,${t}}(?:\`\`\`|~~~)`)),headingBeginRegex:qe(t=>new RegExp(`^ {0,${t}}#`)),htmlBeginRegex:qe(t=>new RegExp(`^ {0,${t}}(?:</?(?:${nt})(?: +|$|/?>)|<(?:script|pre|style|textarea|!--))`,"i")),blockquoteBeginRegex:qe(t=>new RegExp(`^ {0,${t}}>`))},da=/^(?:[ \t]*(?:\n|$))+/,pa=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,ha=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,tt=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,ua=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,yn=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,ei=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |fences|blockquote|heading|hr|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,ti=y(ei).replace(/bull/g,yn).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}(?:\s|$)/).replace(/hr/g,/ {0,3}(?:(?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),fa=y(ei).replace(/bull/g,yn).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}(?:\s|$)/).replace(/hr/g,/ {0,3}(?:(?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),wn=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table|[ \t]+\n)[^\n]+)*)/,ga=/^[^\n]+/,$n=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,ma=y(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",$n).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),ka=y(/^(bull)([ \t][^\n]*?)?(?:\n|$)/).replace(/bull/g,yn).getRegex(),nt="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",Sn=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,ba=y("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n*|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>[^\\n]*\\n*|$)|<![A-Z][\\s\\S]*?(?:>[^\\n]*\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>[^\\n]*\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][a-z0-9-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][a-z0-9-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",Sn).replace("tag",nt).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),ni=t=>y(wn).replace("hr",tt).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace("list",t).replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",nt).getRegex(),xa=ni(/ {0,3}(?:[*+-]|1[.)])[ \t]+[^ \t\n]/),va=ni(/ {0,3}(?:[*+-]|\d{1,9}[.)])(?:[ \t]|\n|$)/),ya=y(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",va).getRegex(),An={blockquote:ya,code:pa,def:ma,fences:ha,heading:ua,hr:tt,html:ba,lheading:ti,list:ka,newline:da,paragraph:xa,table:Ce,text:ga},si=y("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",tt).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",nt).getRegex(),wa={...An,lheading:fa,table:si,paragraph:y(wn).replace("hr",tt).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",si).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]+[^ \\t\\n]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",nt).getRegex()},$a={...An,html:y(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",Sn).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:Ce,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:y(wn).replace("hr",tt).replace("heading",` *#{1,6} *[^
493
- ]`).replace("lheading",ti).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},Sa=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,Aa=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,ii=/^( {2,}|\\)\n(?!\s*$)[ \t]*/,Ca=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,te=/[\p{P}\p{S}]/u,Be=/[\s\p{P}\p{S}]/u,st=/[^\s\p{P}\p{S}]/u,Ta=y(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,Be).getRegex(),Ea=/[\p{Pi}\p{Ps}"']/u,ri=/(?!~)[\p{P}\p{S}]/u,Ra=/(?!~)[\s\p{P}\p{S}]/u,_a=/(?:[^\s\p{P}\p{S}]|~)/u,La=y(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",ca?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),oi=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,Oa=y(oi,"u").replace(/punct/g,te).getRegex(),Pa=y(oi,"u").replace(/punct/g,ri).getRegex(),za=/^(?:\*+(?:((?!\*)(?!openQuote)punct)|([^\s*]))?)|^_+(?:((?!_)(?!openQuote)punct)|([^\s_]))?/,Ma=y(za,"u").replace(/openQuote/g,Ea).replace(/punct/g,te).getRegex(),ai="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",Ia=y(ai,"gu").replace(/notPunctSpace/g,st).replace(/punctSpace/g,Be).replace(/punct/g,te).getRegex(),Na=y(ai,"gu").replace(/notPunctSpace/g,_a).replace(/punctSpace/g,Ra).replace(/punct/g,ri).getRegex(),Da="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)[\\s](\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|(?:(?!\\*)punct|notPunctSpace)(\\*+)(?!\\*)(?=notPunctSpace)",ja=y(Da,"gu").replace(/notPunctSpace/g,st).replace(/punctSpace/g,Be).replace(/punct/g,te).getRegex(),qa=y("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,st).replace(/punctSpace/g,Be).replace(/punct/g,te).getRegex(),Ba="^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)[\\s](_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)|(?:(?!_)punct|notPunctSpace)(_+)(?!_)(?=notPunctSpace)",Ua=y(Ba,"gu").replace(/notPunctSpace/g,st).replace(/punctSpace/g,Be).replace(/punct/g,te).getRegex(),Ha=y(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,te).getRegex(),Fa="^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)",Wa=y(Fa,"gu").replace(/notPunctSpace/g,st).replace(/punctSpace/g,Be).replace(/punct/g,te).getRegex(),Va=y(/\\(punct)/,"gu").replace(/punct/g,te).getRegex(),Ka=y(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),Za=y(Sn).replace("(?:-->|$)","-->").getRegex(),Ga=y("^comment|^</[a-zA-Z][a-zA-Z0-9-]*\\s*>|^<[a-zA-Z][a-zA-Z0-9-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",Za).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),li=/\[(?:\\[\s\S]|[^\[\]\\])*\]/,Et=y(/(?:\[(?:brackets|\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/).replace("brackets",li).getRegex(),Ya=y(/^!?\[(label)\]\([ \t\n]*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?[ \t\n]*\)/).replace("label",Et).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]+|(?=\))/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),Ja=y(/^!?\[(label)\]\[(ref)\]/).replace("label",Et).replace("ref",$n).getRegex(),Xa=y(/^!?\[(ref)\](?:\[\])?/).replace("ref",$n).getRegex(),ci=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\]){1,999}/,Qa=y(/(?:[^\[\]\\`]*(?:\[(?:brackets|\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\]))){0,999}?[^\[\]\\`]*?/).replace("brackets",li).getRegex(),el=y("reflink|nolink(?!\\()","g").replace("reflink",y(/^!?\[(label)\]\[(ref)\]/).replace("label",Qa).replace("ref",ci).getRegex()).replace("nolink",y(/^!?\[(ref)\](?:\[\])?/).replace("ref",ci).getRegex()).getRegex(),di=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,tl=/[A-Za-z0-9._+-]+@[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![\w-])/,nl=y(/(?:mailto:email|xmpp:email(?:\/[A-Za-z0-9@.]+)?)/).replace(/email/g,tl).getRegex(),Cn={_backpedal:Ce,anyPunctuation:Va,autolink:Ka,blockSkip:La,br:ii,code:Aa,del:Ce,delLDelim:Ce,delRDelim:Ce,emStrongLDelim:Oa,emStrongRDelimAst:Ia,emStrongRDelimUnd:qa,escape:Sa,link:Ya,nolink:Xa,punctuation:Ta,reflink:Ja,reflinkSearch:el,tag:Ga,text:Ca,url:Ce},sl={...Cn,emStrongLDelim:Ma,emStrongRDelimAst:ja,emStrongRDelimUnd:Ua,link:y(/^!?\[(label)\]\((.*?)\)/).replace("label",Et).getRegex(),reflink:y(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Et).getRegex()},Tn={...Cn,emStrongRDelimAst:Na,emStrongLDelim:Pa,delLDelim:Ha,delRDelim:Wa,url:y(/^emailProtocol|^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("emailProtocol",nl).replace("protocol",di).replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![\w-])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:y(/^(?:[^a-zA-Z0-9](?=emailProtocol)|(`+|~+|[^`~])(?:(?=[`~])|(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9](?=emailProtocol)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@))))/).replace("protocol",di).replace(/emailProtocol/g,/(?:mailto|xmpp):/).getRegex()},il={...Tn,br:y(ii).replace("{2,}","*").getRegex(),text:y(Tn.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},Rt={normal:An,gfm:wa,pedantic:$a},it={normal:Cn,gfm:Tn,breaks:il,pedantic:sl},rl={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},pi=t=>rl[t];function q(t,e){if(e){if(P.escapeTest.test(t))return t.replace(P.escapeReplace,pi)}else if(P.escapeTestNoEncode.test(t))return t.replace(P.escapeReplaceNoEncode,pi);return t}function ol(t){return t.replace(P.numericCharacterReference,(e,n,s)=>{let i=n===void 0?Number.parseInt(s,16):Number.parseInt(n,10);return i===0||i>1114111||i>=55296&&i<=57343?"\uFFFD":String.fromCodePoint(i)})}function hi(t){try{t=encodeURI(t).replace(P.percentDecode,"%")}catch{return null}return t}function ui(t,e){let n=t.replace(P.findPipe,(r,o,a)=>{let l=!1,c=o;for(;--c>=0&&a[c]==="\\";)l=!l;return l?"|":" |"}),s=n.split(P.splitPipe),i=0;if(s[0].trim()||s.shift(),s.length>0&&!s.at(-1)?.trim()&&s.pop(),e)if(s.length>e)s.splice(e);else for(;s.length<e;)s.push("");for(;i<s.length;i++)s[i]=s[i].trim().replace(P.slashPipe,"|");return s}function fe(t,e,n){let s=t.length;if(s===0)return"";let i=0;for(;i<s&&t.charAt(s-i-1)===e;)i++;return t.slice(0,s-i)}function fi(t){let e=t.split(`
492
+ `,je=(t,e)=>t instanceof e?t:null;function yn(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var Ce=yn();function ni(t){Ce=t}var Te={exec:()=>null};function qe(t){let e=[];return n=>{let s=Math.max(0,Math.min(3,n-1)),i=e[s];return i||(i=t(s),e[s]=i),i}}function y(t,e=""){let n=typeof t=="string"?t:t.source,s={replace:(i,r)=>{let o=typeof r=="string"?r:r.source;return o=o.replace(P.caret,"$1"),n=n.replace(i,o),s},getRegex:()=>new RegExp(n,e)};return s}var ga=((t="")=>{try{return!!new RegExp("(?<=1)(?<!1)"+t)}catch{return!1}})(),P={codeRemoveIndent:/^(?: {0,3}\t| {1,4})/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,endingSpaceTabChar:/[ \t]$/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,leadingSpaceTab:/^[ \t]+/,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,numericCharacterReference:/&#(?:(\d{1,7})|[Xx]([A-Fa-f0-9]{1,6}));/g,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:t=>new RegExp(`^( {0,3}${t})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:qe(t=>new RegExp(`^ {0,${t}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`)),hrRegex:qe(t=>new RegExp(`^ {0,${t}}((?:-[ ]*){3,}|(?:_[ ]*){3,}|(?:\\*[ ]*){3,})(?:\\n+|$)`)),fencesBeginRegex:qe(t=>new RegExp(`^ {0,${t}}(?:\`\`\`|~~~)`)),headingBeginRegex:qe(t=>new RegExp(`^ {0,${t}}#`)),htmlBeginRegex:qe(t=>new RegExp(`^ {0,${t}}(?:</?(?:${st})(?: +|$|/?>)|<(?:script|pre|style|textarea|!--))`,"i")),blockquoteBeginRegex:qe(t=>new RegExp(`^ {0,${t}}>`))},ma=/^(?:[ \t]*(?:\n|$))+/,ka=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,ba=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,nt=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,va=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,wn=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,si=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |fences|blockquote|heading|hr|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,ii=y(si).replace(/bull/g,wn).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}(?:\s|$)/).replace(/hr/g,/ {0,3}(?:(?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),xa=y(si).replace(/bull/g,wn).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}(?:\s|$)/).replace(/hr/g,/ {0,3}(?:(?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),$n=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table|[ \t]+\n)[^\n]+)*)/,ya=/^[^\n]+/,Sn=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,wa=y(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",Sn).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),$a=y(/^(bull)([ \t][^\n]*?)?(?:\n|$)/).replace(/bull/g,wn).getRegex(),st="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",An=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,Sa=y("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n*|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>[^\\n]*\\n*|$)|<![A-Z][\\s\\S]*?(?:>[^\\n]*\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>[^\\n]*\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][a-z0-9-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][a-z0-9-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",An).replace("tag",st).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),ri=t=>y($n).replace("hr",nt).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace("list",t).replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",st).getRegex(),Aa=ri(/ {0,3}(?:[*+-]|1[.)])[ \t]+[^ \t\n]/),Ca=ri(/ {0,3}(?:[*+-]|\d{1,9}[.)])(?:[ \t]|\n|$)/),Ta=y(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",Ca).getRegex(),Cn={blockquote:Ta,code:ka,def:wa,fences:ba,heading:va,hr:nt,html:Sa,lheading:ii,list:$a,newline:ma,paragraph:Aa,table:Te,text:ya},oi=y("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",nt).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",st).getRegex(),Ea={...Cn,lheading:xa,table:oi,paragraph:y($n).replace("hr",nt).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",oi).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]+[^ \\t\\n]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",st).getRegex()},Ra={...Cn,html:y(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",An).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:Te,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:y($n).replace("hr",nt).replace("heading",` *#{1,6} *[^
493
+ ]`).replace("lheading",ii).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},_a=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,La=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,ai=/^( {2,}|\\)\n(?!\s*$)[ \t]*/,Oa=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,ne=/[\p{P}\p{S}]/u,Be=/[\s\p{P}\p{S}]/u,it=/[^\s\p{P}\p{S}]/u,Pa=y(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,Be).getRegex(),za=/[\p{Pi}\p{Ps}"']/u,li=/(?!~)[\p{P}\p{S}]/u,Ma=/(?!~)[\s\p{P}\p{S}]/u,Ia=/(?:[^\s\p{P}\p{S}]|~)/u,Na=y(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",ga?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),ci=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,Da=y(ci,"u").replace(/punct/g,ne).getRegex(),ja=y(ci,"u").replace(/punct/g,li).getRegex(),qa=/^(?:\*+(?:((?!\*)(?!openQuote)punct)|([^\s*]))?)|^_+(?:((?!_)(?!openQuote)punct)|([^\s_]))?/,Ba=y(qa,"u").replace(/openQuote/g,za).replace(/punct/g,ne).getRegex(),di="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",Ua=y(di,"gu").replace(/notPunctSpace/g,it).replace(/punctSpace/g,Be).replace(/punct/g,ne).getRegex(),Ha=y(di,"gu").replace(/notPunctSpace/g,Ia).replace(/punctSpace/g,Ma).replace(/punct/g,li).getRegex(),Fa="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)[\\s](\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|(?:(?!\\*)punct|notPunctSpace)(\\*+)(?!\\*)(?=notPunctSpace)",Wa=y(Fa,"gu").replace(/notPunctSpace/g,it).replace(/punctSpace/g,Be).replace(/punct/g,ne).getRegex(),Va=y("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,it).replace(/punctSpace/g,Be).replace(/punct/g,ne).getRegex(),Ka="^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)[\\s](_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)|(?:(?!_)punct|notPunctSpace)(_+)(?!_)(?=notPunctSpace)",Ga=y(Ka,"gu").replace(/notPunctSpace/g,it).replace(/punctSpace/g,Be).replace(/punct/g,ne).getRegex(),Za=y(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,ne).getRegex(),Ya="^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)",Ja=y(Ya,"gu").replace(/notPunctSpace/g,it).replace(/punctSpace/g,Be).replace(/punct/g,ne).getRegex(),Xa=y(/\\(punct)/,"gu").replace(/punct/g,ne).getRegex(),Qa=y(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),el=y(An).replace("(?:-->|$)","-->").getRegex(),tl=y("^comment|^</[a-zA-Z][a-zA-Z0-9-]*\\s*>|^<[a-zA-Z][a-zA-Z0-9-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",el).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),pi=/\[(?:\\[\s\S]|[^\[\]\\])*\]/,Lt=y(/(?:\[(?:brackets|\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/).replace("brackets",pi).getRegex(),nl=y(/^!?\[(label)\]\([ \t\n]*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?[ \t\n]*\)/).replace("label",Lt).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]+|(?=\))/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),sl=y(/^!?\[(label)\]\[(ref)\]/).replace("label",Lt).replace("ref",Sn).getRegex(),il=y(/^!?\[(ref)\](?:\[\])?/).replace("ref",Sn).getRegex(),hi=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\]){1,999}/,rl=y(/(?:[^\[\]\\`]*(?:\[(?:brackets|\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\]))){0,999}?[^\[\]\\`]*?/).replace("brackets",pi).getRegex(),ol=y("reflink|nolink(?!\\()","g").replace("reflink",y(/^!?\[(label)\]\[(ref)\]/).replace("label",rl).replace("ref",hi).getRegex()).replace("nolink",y(/^!?\[(ref)\](?:\[\])?/).replace("ref",hi).getRegex()).getRegex(),ui=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,al=/[A-Za-z0-9._+-]+@[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![\w-])/,ll=y(/(?:mailto:email|xmpp:email(?:\/[A-Za-z0-9@.]+)?)/).replace(/email/g,al).getRegex(),Tn={_backpedal:Te,anyPunctuation:Xa,autolink:Qa,blockSkip:Na,br:ai,code:La,del:Te,delLDelim:Te,delRDelim:Te,emStrongLDelim:Da,emStrongRDelimAst:Ua,emStrongRDelimUnd:Va,escape:_a,link:nl,nolink:il,punctuation:Pa,reflink:sl,reflinkSearch:ol,tag:tl,text:Oa,url:Te},cl={...Tn,emStrongLDelim:Ba,emStrongRDelimAst:Wa,emStrongRDelimUnd:Ga,link:y(/^!?\[(label)\]\((.*?)\)/).replace("label",Lt).getRegex(),reflink:y(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Lt).getRegex()},En={...Tn,emStrongRDelimAst:Ha,emStrongLDelim:ja,delLDelim:Za,delRDelim:Ja,url:y(/^emailProtocol|^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("emailProtocol",ll).replace("protocol",ui).replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![\w-])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:y(/^(?:[^a-zA-Z0-9](?=emailProtocol)|(`+|~+|[^`~])(?:(?=[`~])|(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9](?=emailProtocol)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@))))/).replace("protocol",ui).replace(/emailProtocol/g,/(?:mailto|xmpp):/).getRegex()},dl={...En,br:y(ai).replace("{2,}","*").getRegex(),text:y(En.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},Ot={normal:Cn,gfm:Ea,pedantic:Ra},rt={normal:Tn,gfm:En,breaks:dl,pedantic:cl},pl={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},fi=t=>pl[t];function q(t,e){if(e){if(P.escapeTest.test(t))return t.replace(P.escapeReplace,fi)}else if(P.escapeTestNoEncode.test(t))return t.replace(P.escapeReplaceNoEncode,fi);return t}function hl(t){return t.replace(P.numericCharacterReference,(e,n,s)=>{let i=n===void 0?Number.parseInt(s,16):Number.parseInt(n,10);return i===0||i>1114111||i>=55296&&i<=57343?"\uFFFD":String.fromCodePoint(i)})}function gi(t){try{t=encodeURI(t).replace(P.percentDecode,"%")}catch{return null}return t}function mi(t,e){let n=t.replace(P.findPipe,(r,o,a)=>{let l=!1,c=o;for(;--c>=0&&a[c]==="\\";)l=!l;return l?"|":" |"}),s=n.split(P.splitPipe),i=0;if(s[0].trim()||s.shift(),s.length>0&&!s.at(-1)?.trim()&&s.pop(),e)if(s.length>e)s.splice(e);else for(;s.length<e;)s.push("");for(;i<s.length;i++)s[i]=s[i].trim().replace(P.slashPipe,"|");return s}function fe(t,e,n){let s=t.length;if(s===0)return"";let i=0;for(;i<s&&t.charAt(s-i-1)===e;)i++;return t.slice(0,s-i)}function ki(t){let e=t.split(`
494
494
  `),n=e.length-1;for(;n>=0&&P.blankLine.test(e[n]);)n--;return e.length-n<=2?t:e.slice(0,n+1).join(`
495
- `)}function _t(t){return t.trim().toLowerCase().toUpperCase().toLowerCase()}function gi(t,e){if(t.indexOf(e[0])===-1&&t.indexOf(e[1])===-1)return-1;let n=0;for(let s=0;s<t.length;s++)if(t[s]==="\\")s++;else if(t[s]===e[0])n++;else if(t[s]===e[1]&&(n--,n<0))return s;return n>0?-2:-1}function mi(t,e=0){let n=e,s="";for(let i of t)if(i===" "){let r=4-n%4;s+=" ".repeat(r),n+=r}else s+=i,n++;return s}function ki(t,e,n,s,i){let r=e.href,o=e.title||null,a=t[1].replace(i.other.outputLinkReplace,"$1"),l=t[0].charAt(0)==="!";s.state.inLink=!0;let c=s.state.linkEmitted,p=s.state.inRawBlock;s.state.linkEmitted=!1;let d=s.inlineTokens(a),h=s.state.linkEmitted;if(s.state.linkEmitted=c,s.state.inLink=!1,!l){if(h){s.state.inRawBlock=p;return}s.state.linkEmitted=!0}return{type:l?"image":"link",raw:n,href:r,title:o,text:a,tokens:d}}function al(t,e,n){let s=t.match(n.other.indentCodeCompensation);if(s===null)return e;let i=s[1];return e.split(`
495
+ `)}function Pt(t){return t.trim().toLowerCase().toUpperCase().toLowerCase()}function bi(t,e){if(t.indexOf(e[0])===-1&&t.indexOf(e[1])===-1)return-1;let n=0;for(let s=0;s<t.length;s++)if(t[s]==="\\")s++;else if(t[s]===e[0])n++;else if(t[s]===e[1]&&(n--,n<0))return s;return n>0?-2:-1}function vi(t,e=0){let n=e,s="";for(let i of t)if(i===" "){let r=4-n%4;s+=" ".repeat(r),n+=r}else s+=i,n++;return s}function xi(t,e,n,s,i){let r=e.href,o=e.title||null,a=t[1].replace(i.other.outputLinkReplace,"$1"),l=t[0].charAt(0)==="!";s.state.inLink=!0;let c=s.state.linkEmitted,p=s.state.inRawBlock;s.state.linkEmitted=!1;let d=s.inlineTokens(a),h=s.state.linkEmitted;if(s.state.linkEmitted=c,s.state.inLink=!1,!l){if(h){s.state.inRawBlock=p;return}s.state.linkEmitted=!0}return{type:l?"image":"link",raw:n,href:r,title:o,text:a,tokens:d}}function ul(t,e,n){let s=t.match(n.other.indentCodeCompensation);if(s===null)return e;let i=s[1];return e.split(`
496
496
  `).map(r=>{let o=r.match(n.other.beginningSpace);if(o===null)return r;let[a]=o;return r.slice(Math.min(a.length,i.length))}).join(`
497
- `)}function bi(t,e,n,s){if(!e.includes("<"))return!1;for(let i=0;i<e.length;i++){if(e[i]==="\\"){i++;continue}if(e[i]==="`"){let a=s.inline.code.exec(e.slice(i));if(a){i+=a[0].length-1;continue}}if(e[i]!=="<")continue;let r=t.slice(n+i),o=s.inline.tag.exec(r)||s.inline.autolink.exec(r);if(o){if(o[0].length>e.length-i)return!0;i+=o[0].length-1}}return!1}var Lt=class{options;rules;lexer;constructor(t){this.options=t||Ae}space(t){let e=this.rules.block.newline.exec(t);if(e&&e[0].length>0)return{type:"space",raw:e[0]}}code(t){let e=this.rules.block.code.exec(t);if(e){let n=this.options.pedantic?e[0]:fi(e[0]),s=n.replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:n,codeBlockStyle:"indented",text:s}}}fences(t){let e=this.rules.block.fences.exec(t);if(e){let n=e[0],s=al(n,e[3]||"",this.rules);return{type:"code",raw:n,lang:e[2]?e[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):e[2],text:s}}}heading(t){let e=this.rules.block.heading.exec(t);if(e){let n=e[2].trim();if(this.rules.other.endingHash.test(n)){let s=fe(n,"#");(this.options.pedantic||!s||this.rules.other.endingSpaceTabChar.test(s))&&(n=s.trim())}return{type:"heading",raw:fe(e[0],`
497
+ `)}function yi(t,e,n,s){if(!e.includes("<"))return!1;for(let i=0;i<e.length;i++){if(e[i]==="\\"){i++;continue}if(e[i]==="`"){let a=s.inline.code.exec(e.slice(i));if(a){i+=a[0].length-1;continue}}if(e[i]!=="<")continue;let r=t.slice(n+i),o=s.inline.tag.exec(r)||s.inline.autolink.exec(r);if(o){if(o[0].length>e.length-i)return!0;i+=o[0].length-1}}return!1}var zt=class{options;rules;lexer;constructor(t){this.options=t||Ce}space(t){let e=this.rules.block.newline.exec(t);if(e&&e[0].length>0)return{type:"space",raw:e[0]}}code(t){let e=this.rules.block.code.exec(t);if(e){let n=this.options.pedantic?e[0]:ki(e[0]),s=n.replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:n,codeBlockStyle:"indented",text:s}}}fences(t){let e=this.rules.block.fences.exec(t);if(e){let n=e[0],s=ul(n,e[3]||"",this.rules);return{type:"code",raw:n,lang:e[2]?e[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):e[2],text:s}}}heading(t){let e=this.rules.block.heading.exec(t);if(e){let n=e[2].trim();if(this.rules.other.endingHash.test(n)){let s=fe(n,"#");(this.options.pedantic||!s||this.rules.other.endingSpaceTabChar.test(s))&&(n=s.trim())}return{type:"heading",raw:fe(e[0],`
498
498
  `),depth:e[1].length,text:n,tokens:this.lexer.inline(n)}}}hr(t){let e=this.rules.block.hr.exec(t);if(e)return{type:"hr",raw:fe(e[0],`
499
499
  `)}}blockquote(t){let e=this.rules.block.blockquote.exec(t);if(e){let n=fe(e[0],`
500
500
  `).split(`
@@ -504,25 +504,25 @@ const kt=globalThis,rn=kt.ShadowRoot&&(kt.ShadyCSS===void 0||kt.ShadyCSS.nativeS
504
504
  ${c}`:c,i=i?`${i}
505
505
  ${p}`:p;let d=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(p,r,!0),this.lexer.state.top=d,n.length===0)break;let h=r.at(-1);if(h?.type==="code")break;if(h?.type==="blockquote"){let u=h,f=n.join(`
506
506
  `),k=u.raw+`
507
- `+f.replace(this.rules.other.blockquoteSetextReplace2,""),g=this.blockquote(k);r[r.length-1]=g;let v=k.substring(g.raw.length).replace(/^\n/,""),$=v?v.split(`
507
+ `+f.replace(this.rules.other.blockquoteSetextReplace2,""),m=this.blockquote(k);r[r.length-1]=m;let x=k.substring(m.raw.length).replace(/^\n/,""),$=x?x.split(`
508
508
  `).length:0,A=$?n.slice(0,-$):n;A.length>0&&(s=`${s}
509
509
  ${A.join(`
510
- `)}`),i=i.substring(0,i.length-u.text.length)+g.text;break}else if(h?.type==="list"){let u=h,f=u.raw+`
510
+ `)}`),i=i.substring(0,i.length-u.text.length)+m.text;break}else if(h?.type==="list"){let u=h,f=u.raw+`
511
511
  `+n.join(`
512
512
  `),k=this.list(f);r[r.length-1]=k,s=s.substring(0,s.length-h.raw.length)+k.raw,i=i.substring(0,i.length-u.raw.length)+k.raw,n=f.substring(r.at(-1).raw.length).split(`
513
513
  `);continue}}return{type:"blockquote",raw:s,tokens:r,text:i}}}list(t){let e=this.rules.block.list.exec(t);if(e){let n=e[1].trim(),s=n.length>1,i={type:"list",raw:"",ordered:s,start:s?+n.slice(0,-1):"",loose:!1,items:[]};n=s?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=s?n:"[*+-]");let r=this.rules.other.listItemRegex(n),o=!1;for(;t;){let l=!1,c="",p="";if(!(e=r.exec(t))||this.rules.block.hr.test(t))break;c=e[0],t=t.substring(c.length);let d=e[2].split(`
514
- `,1)[0],h=e[1].length,u=this.options.pedantic?mi(d,h):d.replace(this.rules.other.leadingSpaceTab,v=>mi(v,h)),f=t.split(`
515
- `,1)[0],k=!u.trim(),g=0;if(this.options.pedantic?(g=2,p=u.trimStart()):k?g=h+1:(g=u.search(this.rules.other.nonSpaceChar),g=g>4?1:g,p=u.slice(g),g+=h),k&&this.rules.other.blankLine.test(f)&&(c+=f+`
516
- `,t=t.substring(f.length+1),l=!0),!l){let v=this.rules.other.nextBulletRegex(g),$=this.rules.other.hrRegex(g),A=this.rules.other.fencesBeginRegex(g),E=this.rules.other.headingBeginRegex(g),I=this.rules.other.htmlBeginRegex(g),O=this.rules.other.blockquoteBeginRegex(g);for(;t;){let U=t.split(`
517
- `,1)[0],M;if(f=U,this.options.pedantic?(f=f.replace(this.rules.other.listReplaceNesting," "),M=f):M=f.replace(this.rules.other.leadingSpaceTab,ee=>ee.replace(this.rules.other.tabCharGlobal," ")),A.test(f)||E.test(f)||I.test(f)||O.test(f)||v.test(f)||$.test(f))break;if(M.search(this.rules.other.nonSpaceChar)>=g||!f.trim())p+=`
518
- `+M.slice(g);else{if(k||u.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||A.test(u)||E.test(u)||$.test(u))break;p+=`
514
+ `,1)[0],h=e[1].length,u=this.options.pedantic?vi(d,h):d.replace(this.rules.other.leadingSpaceTab,x=>vi(x,h)),f=t.split(`
515
+ `,1)[0],k=!u.trim(),m=0;if(this.options.pedantic?(m=2,p=u.trimStart()):k?m=h+1:(m=u.search(this.rules.other.nonSpaceChar),m=m>4?1:m,p=u.slice(m),m+=h),k&&this.rules.other.blankLine.test(f)&&(c+=f+`
516
+ `,t=t.substring(f.length+1),l=!0),!l){let x=this.rules.other.nextBulletRegex(m),$=this.rules.other.hrRegex(m),A=this.rules.other.fencesBeginRegex(m),E=this.rules.other.headingBeginRegex(m),I=this.rules.other.htmlBeginRegex(m),O=this.rules.other.blockquoteBeginRegex(m);for(;t;){let U=t.split(`
517
+ `,1)[0],M;if(f=U,this.options.pedantic?(f=f.replace(this.rules.other.listReplaceNesting," "),M=f):M=f.replace(this.rules.other.leadingSpaceTab,te=>te.replace(this.rules.other.tabCharGlobal," ")),A.test(f)||E.test(f)||I.test(f)||O.test(f)||x.test(f)||$.test(f))break;if(M.search(this.rules.other.nonSpaceChar)>=m||!f.trim())p+=`
518
+ `+M.slice(m);else{if(k||u.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||A.test(u)||E.test(u)||$.test(u))break;p+=`
519
519
  `+f}k=!f.trim(),c+=U+`
520
- `,t=t.substring(U.length+1),u=M.slice(g)}}i.loose||(o?i.loose=!0:this.rules.other.doubleBlankLine.test(c)&&(o=!0)),i.items.push({type:"list_item",raw:c,task:!!this.options.gfm&&this.rules.other.listIsTask.test(p),loose:!1,text:p,tokens:[]}),i.raw+=c}let a=i.items.at(-1);if(a)a.raw=a.raw.trimEnd(),a.text=a.text.trimEnd();else return;i.raw=i.raw.trimEnd();for(let l of i.items)if(this.lexer.state.top=!1,l.tokens=this.lexer.blockTokens(l.text,[]),!i.loose){let c=l.tokens.filter(d=>d.type==="space"),p=c.length>0&&c.some(d=>this.rules.other.anyLine.test(d.raw));i.loose=p}for(let l of i.items){let c=l.tokens[0];if(l.task&&(c?.type==="text"||c?.type==="paragraph")){l.text=l.text.replace(this.rules.other.listReplaceTask,""),c.raw=c.raw.replace(this.rules.other.listReplaceTask,""),c.text=c.text.replace(this.rules.other.listReplaceTask,"");for(let d=this.lexer.inlineQueue.length-1;d>=0;d--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[d].src)){this.lexer.inlineQueue[d].src=this.lexer.inlineQueue[d].src.replace(this.rules.other.listReplaceTask,"");break}let p=this.rules.other.listTaskCheckbox.exec(l.raw);if(p){let d={type:"checkbox",raw:p[0]+" ",checked:p[0]!=="[ ]"};l.checked=d.checked,i.loose?l.tokens[0]&&["paragraph","text"].includes(l.tokens[0].type)&&"tokens"in l.tokens[0]&&l.tokens[0].tokens?(l.tokens[0].raw=d.raw+l.tokens[0].raw,l.tokens[0].text=d.raw+l.tokens[0].text,l.tokens[0].tokens.unshift(d)):l.tokens.unshift({type:"paragraph",raw:d.raw,text:d.raw,tokens:[d]}):l.tokens.unshift(d)}}else l.task&&(l.task=!1)}if(i.loose)for(let l of i.items){l.loose=!0;for(let c of l.tokens)c.type==="text"&&(c.type="paragraph")}return i}}html(t){let e=this.rules.block.html.exec(t);if(e){let n=fi(e[0]);return{type:"html",block:!0,raw:n,pre:e[1]==="pre"||e[1]==="script"||e[1]==="style",text:n}}}def(t){let e=this.rules.block.def.exec(t);if(e){if(!this.rules.other.startAngleBracket.test(e[2])&&gi(e[2],"()")!==-1)return;let n=_t(e[1]).replace(this.rules.other.multipleSpaceGlobal," "),s=e[2]?e[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",i=e[3]?e[3].substring(1,e[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):e[3];return{type:"def",tag:n,raw:fe(e[0],`
521
- `),href:s,title:i}}}table(t){let e=this.rules.block.table.exec(t);if(!e||!this.rules.other.tableDelimiter.test(e[2]))return;let n=ui(e[1]),s=e[2].replace(this.rules.other.tableAlignChars,"").split("|"),i=e[3]?.trim()?e[3].replace(this.rules.other.tableRowBlankLine,"").split(`
520
+ `,t=t.substring(U.length+1),u=M.slice(m)}}i.loose||(o?i.loose=!0:this.rules.other.doubleBlankLine.test(c)&&(o=!0)),i.items.push({type:"list_item",raw:c,task:!!this.options.gfm&&this.rules.other.listIsTask.test(p),loose:!1,text:p,tokens:[]}),i.raw+=c}let a=i.items.at(-1);if(a)a.raw=a.raw.trimEnd(),a.text=a.text.trimEnd();else return;i.raw=i.raw.trimEnd();for(let l of i.items)if(this.lexer.state.top=!1,l.tokens=this.lexer.blockTokens(l.text,[]),!i.loose){let c=l.tokens.filter(d=>d.type==="space"),p=c.length>0&&c.some(d=>this.rules.other.anyLine.test(d.raw));i.loose=p}for(let l of i.items){let c=l.tokens[0];if(l.task&&(c?.type==="text"||c?.type==="paragraph")){l.text=l.text.replace(this.rules.other.listReplaceTask,""),c.raw=c.raw.replace(this.rules.other.listReplaceTask,""),c.text=c.text.replace(this.rules.other.listReplaceTask,"");for(let d=this.lexer.inlineQueue.length-1;d>=0;d--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[d].src)){this.lexer.inlineQueue[d].src=this.lexer.inlineQueue[d].src.replace(this.rules.other.listReplaceTask,"");break}let p=this.rules.other.listTaskCheckbox.exec(l.raw);if(p){let d={type:"checkbox",raw:p[0]+" ",checked:p[0]!=="[ ]"};l.checked=d.checked,i.loose?l.tokens[0]&&["paragraph","text"].includes(l.tokens[0].type)&&"tokens"in l.tokens[0]&&l.tokens[0].tokens?(l.tokens[0].raw=d.raw+l.tokens[0].raw,l.tokens[0].text=d.raw+l.tokens[0].text,l.tokens[0].tokens.unshift(d)):l.tokens.unshift({type:"paragraph",raw:d.raw,text:d.raw,tokens:[d]}):l.tokens.unshift(d)}}else l.task&&(l.task=!1)}if(i.loose)for(let l of i.items){l.loose=!0;for(let c of l.tokens)c.type==="text"&&(c.type="paragraph")}return i}}html(t){let e=this.rules.block.html.exec(t);if(e){let n=ki(e[0]);return{type:"html",block:!0,raw:n,pre:e[1]==="pre"||e[1]==="script"||e[1]==="style",text:n}}}def(t){let e=this.rules.block.def.exec(t);if(e){if(!this.rules.other.startAngleBracket.test(e[2])&&bi(e[2],"()")!==-1)return;let n=Pt(e[1]).replace(this.rules.other.multipleSpaceGlobal," "),s=e[2]?e[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",i=e[3]?e[3].substring(1,e[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):e[3];return{type:"def",tag:n,raw:fe(e[0],`
521
+ `),href:s,title:i}}}table(t){let e=this.rules.block.table.exec(t);if(!e||!this.rules.other.tableDelimiter.test(e[2]))return;let n=mi(e[1]),s=e[2].replace(this.rules.other.tableAlignChars,"").split("|"),i=e[3]?.trim()?e[3].replace(this.rules.other.tableRowBlankLine,"").split(`
522
522
  `):[],r={type:"table",raw:fe(e[0],`
523
- `),header:[],align:[],rows:[]};if(n.length===s.length){for(let o of s)this.rules.other.tableAlignRight.test(o)?r.align.push("right"):this.rules.other.tableAlignCenter.test(o)?r.align.push("center"):this.rules.other.tableAlignLeft.test(o)?r.align.push("left"):r.align.push(null);for(let o=0;o<n.length;o++)r.header.push({text:n[o],tokens:this.lexer.inline(n[o]),header:!0,align:r.align[o]});for(let o of i)r.rows.push(ui(o,r.header.length).map((a,l)=>({text:a,tokens:this.lexer.inline(a),header:!1,align:r.align[l]})));return r}}lheading(t){let e=this.rules.block.lheading.exec(t);if(e){let n=e[1].trim();return{type:"heading",raw:fe(e[0],`
523
+ `),header:[],align:[],rows:[]};if(n.length===s.length){for(let o of s)this.rules.other.tableAlignRight.test(o)?r.align.push("right"):this.rules.other.tableAlignCenter.test(o)?r.align.push("center"):this.rules.other.tableAlignLeft.test(o)?r.align.push("left"):r.align.push(null);for(let o=0;o<n.length;o++)r.header.push({text:n[o],tokens:this.lexer.inline(n[o]),header:!0,align:r.align[o]});for(let o of i)r.rows.push(mi(o,r.header.length).map((a,l)=>({text:a,tokens:this.lexer.inline(a),header:!1,align:r.align[l]})));return r}}lheading(t){let e=this.rules.block.lheading.exec(t);if(e){let n=e[1].trim();return{type:"heading",raw:fe(e[0],`
524
524
  `),depth:e[2].charAt(0)==="="?1:2,text:n,tokens:this.lexer.inline(n)}}}paragraph(t){let e=this.rules.block.paragraph.exec(t);if(e){let n=e[1].charAt(e[1].length-1)===`
525
- `?e[1].slice(0,-1):e[1];return{type:"paragraph",raw:e[0],text:n,tokens:this.lexer.inline(n)}}}text(t){let e=this.rules.block.text.exec(t);if(e)return{type:"text",raw:e[0],text:e[0],tokens:this.lexer.inline(e[0])}}escape(t){let e=this.rules.inline.escape.exec(t);if(e)return{type:"escape",raw:e[0],text:e[1]}}tag(t){let e=this.rules.inline.tag.exec(t);if(e)return!this.lexer.state.inLink&&this.rules.other.startATag.test(e[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(e[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(e[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(e[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:e[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:e[0]}}link(t){if(this.lexer.state.linkParenPossible===!1)return;let e=this.rules.inline.link.exec(t);if(e){let n=e[0].charAt(0)==="!"?2:1;if(!this.options.pedantic&&bi(t,e[1],n,this.rules))return;let s=e[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(s)){if(!this.rules.other.endAngleBracket.test(s))return;let o=fe(s.slice(0,-1),"\\");if((s.length-o.length)%2===0)return}else{let o=gi(e[2],"()");if(o===-2)return;if(o>-1){let a=(e[0].indexOf("!")===0?5:4)+e[1].length+o;e[2]=e[2].substring(0,o),e[0]=e[0].substring(0,a).trim(),e[3]=""}}let i=e[2],r="";if(this.options.pedantic){let o=this.rules.other.pedanticHrefTitle.exec(i);o&&(i=o[1],r=o[3])}else r=e[3]?e[3].slice(1,-1):"";return i=i.trim(),this.rules.other.startAngleBracket.test(i)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(s)?i=i.slice(1):i=i.slice(1,-1)),ki(e,{href:i&&i.replace(this.rules.inline.anyPunctuation,"$1"),title:r&&r.replace(this.rules.inline.anyPunctuation,"$1")},e[0],this.lexer,this.rules)}}reflink(t,e){let n;if((n=this.rules.inline.reflink.exec(t))||(n=this.rules.inline.nolink.exec(t))){let s=n[0].charAt(0)==="!"?2:1;if(!this.options.pedantic&&bi(t,n[1],s,this.rules))return;let i=(n[2]||n[1]).replace(this.rules.other.multipleSpaceGlobal," "),r=e[_t(i)];if(!r){let o=n[0].charAt(0);return{type:"text",raw:o,text:o}}return ki(n,r,n[0],this.lexer,this.rules)}}emStrong(t,e,n=""){let s=this.rules.inline.emStrongLDelim.exec(t);if(!(!s||!s[1]&&!s[2]&&!s[3]&&!s[4]||s[4]&&n.match(this.rules.other.unicodeAlphaNumeric))&&(!(s[1]||s[3])||!n||this.rules.inline.punctuation.exec(n))){let i=[...s[0]].length-1,r,o,a=i,l=0,c=s[0][0],p=n===c,d=c==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(d.lastIndex=0,e=e.slice(-1*t.length+i);(s=d.exec(e))!==null;){if(r=s[1]||s[2]||s[3]||s[4]||s[5]||s[6],!r)continue;if(o=[...r].length,s[3]||s[4]){a+=o;continue}else if(s[5]||s[6]){if(i%3&&!((i+o)%3)){l+=o;continue}if(p)break}if(a-=o,a>0)continue;o=Math.min(o,o+a+l);let h=[...s[0]][0].length,u=t.slice(0,i+s.index+h+o);if(Math.min(i,o)%2){let k=u.slice(1,-1);return{type:"em",raw:u,text:k,tokens:this.lexer.inlineTokens(k)}}let f=u.slice(2,-2);return{type:"strong",raw:u,text:f,tokens:this.lexer.inlineTokens(f)}}}}codespan(t){let e=this.rules.inline.code.exec(t);if(e){let n=e[2].replace(this.rules.other.newLineCharGlobal," "),s=this.rules.other.nonSpaceChar.test(n),i=this.rules.other.startingSpaceChar.test(n)&&this.rules.other.endingSpaceChar.test(n);return s&&i&&(n=n.substring(1,n.length-1)),{type:"codespan",raw:e[0],text:n}}}br(t){let e=this.rules.inline.br.exec(t);if(e)return{type:"br",raw:e[0]}}del(t,e,n=""){let s=this.rules.inline.delLDelim.exec(t);if(s&&(!s[1]||!n||this.rules.inline.punctuation.exec(n))){let i=[...s[0]].length-1,r,o,a=i,l=this.rules.inline.delRDelim;for(l.lastIndex=0,e=e.slice(-1*t.length+i);(s=l.exec(e))!==null;){if(r=s[1]||s[2]||s[3]||s[4]||s[5]||s[6],!r||(o=[...r].length,o!==i))continue;if(s[3]||s[4]){a+=o;continue}if(a-=o,a>0)continue;o=Math.min(o,o+a);let c=[...s[0]][0].length,p=t.slice(0,i+s.index+c+o),d=p.slice(i,-i);return{type:"del",raw:p,text:d,tokens:this.lexer.inlineTokens(d)}}}}autolink(t){let e=this.rules.inline.autolink.exec(t);if(e){let n,s;return e[2]==="@"?(n=e[1],s="mailto:"+n):(n=e[1],s=n),{type:"link",raw:e[0],text:n,href:s,autolink:!0,tokens:[{type:"text",raw:n,text:n}]}}}url(t){let e;if(e=this.rules.inline.url.exec(t)){let n,s;if(e[2]==="@")n=e[0],s="mailto:"+n;else{let i;do i=e[0],e[0]=this.rules.inline._backpedal.exec(e[0])?.[0]??"";while(i!==e[0]);n=e[0],e[1]==="www."?s="http://"+e[0]:s=e[0]}return{type:"link",raw:e[0],text:n,href:s,autolink:!0,tokens:[{type:"text",raw:n,text:n}]}}}inlineText(t){let e=this.rules.inline.text.exec(t);if(e){let n=this.lexer.state.inRawBlock;return{type:"text",raw:e[0],text:n?e[0]:ol(e[0]),escaped:n}}}},V=class vs{tokens;options;state;inlineQueue;tokenizer;constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||Ae,this.options.tokenizer=this.options.tokenizer||new Lt,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,linkEmitted:!1,linkParenPossible:!0,top:!0};let n={other:P,block:Rt.normal,inline:it.normal};this.options.pedantic?(n.block=Rt.pedantic,n.inline=it.pedantic):this.options.gfm&&(n.block=Rt.gfm,this.options.breaks?n.inline=it.breaks:n.inline=it.gfm),this.tokenizer.rules=n}static get rules(){return{block:Rt,inline:it}}static lex(e,n){return new vs(n).lex(e)}static lexInline(e,n){return new vs(n).inlineTokens(e)}lex(e){e=e.replace(P.carriageReturn,`
525
+ `?e[1].slice(0,-1):e[1];return{type:"paragraph",raw:e[0],text:n,tokens:this.lexer.inline(n)}}}text(t){let e=this.rules.block.text.exec(t);if(e)return{type:"text",raw:e[0],text:e[0],tokens:this.lexer.inline(e[0])}}escape(t){let e=this.rules.inline.escape.exec(t);if(e)return{type:"escape",raw:e[0],text:e[1]}}tag(t){let e=this.rules.inline.tag.exec(t);if(e)return!this.lexer.state.inLink&&this.rules.other.startATag.test(e[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(e[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(e[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(e[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:e[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:e[0]}}link(t){if(this.lexer.state.linkParenPossible===!1)return;let e=this.rules.inline.link.exec(t);if(e){let n=e[0].charAt(0)==="!"?2:1;if(!this.options.pedantic&&yi(t,e[1],n,this.rules))return;let s=e[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(s)){if(!this.rules.other.endAngleBracket.test(s))return;let o=fe(s.slice(0,-1),"\\");if((s.length-o.length)%2===0)return}else{let o=bi(e[2],"()");if(o===-2)return;if(o>-1){let a=(e[0].indexOf("!")===0?5:4)+e[1].length+o;e[2]=e[2].substring(0,o),e[0]=e[0].substring(0,a).trim(),e[3]=""}}let i=e[2],r="";if(this.options.pedantic){let o=this.rules.other.pedanticHrefTitle.exec(i);o&&(i=o[1],r=o[3])}else r=e[3]?e[3].slice(1,-1):"";return i=i.trim(),this.rules.other.startAngleBracket.test(i)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(s)?i=i.slice(1):i=i.slice(1,-1)),xi(e,{href:i&&i.replace(this.rules.inline.anyPunctuation,"$1"),title:r&&r.replace(this.rules.inline.anyPunctuation,"$1")},e[0],this.lexer,this.rules)}}reflink(t,e){let n;if((n=this.rules.inline.reflink.exec(t))||(n=this.rules.inline.nolink.exec(t))){let s=n[0].charAt(0)==="!"?2:1;if(!this.options.pedantic&&yi(t,n[1],s,this.rules))return;let i=(n[2]||n[1]).replace(this.rules.other.multipleSpaceGlobal," "),r=e[Pt(i)];if(!r){let o=n[0].charAt(0);return{type:"text",raw:o,text:o}}return xi(n,r,n[0],this.lexer,this.rules)}}emStrong(t,e,n=""){let s=this.rules.inline.emStrongLDelim.exec(t);if(!(!s||!s[1]&&!s[2]&&!s[3]&&!s[4]||s[4]&&n.match(this.rules.other.unicodeAlphaNumeric))&&(!(s[1]||s[3])||!n||this.rules.inline.punctuation.exec(n))){let i=[...s[0]].length-1,r,o,a=i,l=0,c=s[0][0],p=n===c,d=c==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(d.lastIndex=0,e=e.slice(-1*t.length+i);(s=d.exec(e))!==null;){if(r=s[1]||s[2]||s[3]||s[4]||s[5]||s[6],!r)continue;if(o=[...r].length,s[3]||s[4]){a+=o;continue}else if(s[5]||s[6]){if(i%3&&!((i+o)%3)){l+=o;continue}if(p)break}if(a-=o,a>0)continue;o=Math.min(o,o+a+l);let h=[...s[0]][0].length,u=t.slice(0,i+s.index+h+o);if(Math.min(i,o)%2){let k=u.slice(1,-1);return{type:"em",raw:u,text:k,tokens:this.lexer.inlineTokens(k)}}let f=u.slice(2,-2);return{type:"strong",raw:u,text:f,tokens:this.lexer.inlineTokens(f)}}}}codespan(t){let e=this.rules.inline.code.exec(t);if(e){let n=e[2].replace(this.rules.other.newLineCharGlobal," "),s=this.rules.other.nonSpaceChar.test(n),i=this.rules.other.startingSpaceChar.test(n)&&this.rules.other.endingSpaceChar.test(n);return s&&i&&(n=n.substring(1,n.length-1)),{type:"codespan",raw:e[0],text:n}}}br(t){let e=this.rules.inline.br.exec(t);if(e)return{type:"br",raw:e[0]}}del(t,e,n=""){let s=this.rules.inline.delLDelim.exec(t);if(s&&(!s[1]||!n||this.rules.inline.punctuation.exec(n))){let i=[...s[0]].length-1,r,o,a=i,l=this.rules.inline.delRDelim;for(l.lastIndex=0,e=e.slice(-1*t.length+i);(s=l.exec(e))!==null;){if(r=s[1]||s[2]||s[3]||s[4]||s[5]||s[6],!r||(o=[...r].length,o!==i))continue;if(s[3]||s[4]){a+=o;continue}if(a-=o,a>0)continue;o=Math.min(o,o+a);let c=[...s[0]][0].length,p=t.slice(0,i+s.index+c+o),d=p.slice(i,-i);return{type:"del",raw:p,text:d,tokens:this.lexer.inlineTokens(d)}}}}autolink(t){let e=this.rules.inline.autolink.exec(t);if(e){let n,s;return e[2]==="@"?(n=e[1],s="mailto:"+n):(n=e[1],s=n),{type:"link",raw:e[0],text:n,href:s,autolink:!0,tokens:[{type:"text",raw:n,text:n}]}}}url(t){let e;if(e=this.rules.inline.url.exec(t)){let n,s;if(e[2]==="@")n=e[0],s="mailto:"+n;else{let i;do i=e[0],e[0]=this.rules.inline._backpedal.exec(e[0])?.[0]??"";while(i!==e[0]);n=e[0],e[1]==="www."?s="http://"+e[0]:s=e[0]}return{type:"link",raw:e[0],text:n,href:s,autolink:!0,tokens:[{type:"text",raw:n,text:n}]}}}inlineText(t){let e=this.rules.inline.text.exec(t);if(e){let n=this.lexer.state.inRawBlock;return{type:"text",raw:e[0],text:n?e[0]:hl(e[0]),escaped:n}}}},K=class $s{tokens;options;state;inlineQueue;tokenizer;constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||Ce,this.options.tokenizer=this.options.tokenizer||new zt,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,linkEmitted:!1,linkParenPossible:!0,top:!0};let n={other:P,block:Ot.normal,inline:rt.normal};this.options.pedantic?(n.block=Ot.pedantic,n.inline=rt.pedantic):this.options.gfm&&(n.block=Ot.gfm,this.options.breaks?n.inline=rt.breaks:n.inline=rt.gfm),this.tokenizer.rules=n}static get rules(){return{block:Ot,inline:rt}}static lex(e,n){return new $s(n).lex(e)}static lexInline(e,n){return new $s(n).inlineTokens(e)}lex(e){e=e.replace(P.carriageReturn,`
526
526
  `),this.blockTokens(e,this.tokens);for(let n=0;n<this.inlineQueue.length;n++){let s=this.inlineQueue[n];this.inlineTokens(s.src,s.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,n=[],s=!1){this.tokenizer.lexer=this,this.options.pedantic&&(e=e.replace(P.tabCharGlobal," ").replace(P.spaceLine,""));let i=1/0;for(;e;){if(e.length<i)i=e.length;else{this.infiniteLoopError(e.charCodeAt(0));break}let r;if(this.options.extensions?.block?.some(a=>(r=a.call({lexer:this},e,n))?(e=e.substring(r.raw.length),n.push(r),!0):!1))continue;if(r=this.tokenizer.space(e)){e=e.substring(r.raw.length);let a=n.at(-1);r.raw.length===1&&a!==void 0?a.raw+=`
527
527
  `:n.push(r);continue}if(r=this.tokenizer.code(e)){e=e.substring(r.raw.length);let a=n.at(-1);a?.type==="paragraph"||a?.type==="text"?(a.raw+=(a.raw.endsWith(`
528
528
  `)?"":`
@@ -536,7 +536,7 @@ ${A.join(`
536
536
  `+r.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=a.text):n.push(r),s=o.length!==e.length,e=e.substring(r.raw.length);continue}if(r=this.tokenizer.text(e)){e=e.substring(r.raw.length);let a=n.at(-1);a?.type==="text"?(a.raw+=(a.raw.endsWith(`
537
537
  `)?"":`
538
538
  `)+r.raw,a.text+=`
539
- `+r.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=a.text):n.push(r);continue}if(e){this.infiniteLoopError(e.charCodeAt(0));break}}return this.state.top=!0,n}inline(e,n=[]){return this.inlineQueue.push({src:e,tokens:n}),n}linkInText(e){if(!e.includes("["))return!1;let n=this.tokenizer.rules.inline.link;for(let s of e.matchAll(this.tokenizer.rules.inline.blockSkip))if(n.test(s[0])&&e.charAt(s.index-1)!=="!")return!0;for(let s of e.matchAll(this.tokenizer.rules.inline.reflinkSearch)){let i=s[0],r=i.lastIndexOf("[");if(!(i.charAt(0)==="!"||!Object.hasOwn(this.tokens.links,_t(i.slice(r+1,-1))))&&!(r>1&&this.linkInText(i.slice(1,r-1))))return!0}return!1}inlineTokens(e,n=[]){this.tokenizer.lexer=this;let s=this.state.linkParenPossible;this.state.linkParenPossible=s&&e.includes(")");try{return this.#e(e,n)}finally{this.state.linkParenPossible=s}}#e(e,n){let s=e;if(this.tokens.links&&e.includes("[")){let a=this.tokenizer.rules.inline.reflinkSearch,l=c=>{let p=c.lastIndexOf("[");if(!Object.hasOwn(this.tokens.links,_t(c.slice(p+1,-1))))return c;if(p>1&&c.charAt(0)!=="!"){let d=c.slice(1,p-1);if(this.linkInText(d))return"["+d.replace(a,l)+"]["+"a".repeat(c.length-p-2)+"]"}return"["+"a".repeat(c.length-2)+"]"};s=s.replace(a,l)}s=s.replace(this.tokenizer.rules.inline.anyPunctuation,a=>"+".repeat(a.length)),s=s.replace(this.tokenizer.rules.inline.blockSkip,(a,l,c)=>{let p=c?c.length:0;return a.slice(0,p)+"["+"a".repeat(a.length-p-2)+"]"}),s=this.options.hooks?.emStrongMask?.call({lexer:this},s)??s;let i=!1,r="",o=1/0;for(;e;){if(e.length<o)o=e.length;else{this.infiniteLoopError(e.charCodeAt(0));break}i||(r=""),i=!1;let a;if(this.options.extensions?.inline?.some(c=>(a=c.call({lexer:this},e,n))?(e=e.substring(a.raw.length),n.push(a),!0):!1))continue;if(a=this.tokenizer.escape(e)){e=e.substring(a.raw.length),n.push(a);continue}if(a=this.tokenizer.tag(e)){e=e.substring(a.raw.length),n.push(a);continue}if(a=this.tokenizer.link(e)){e=e.substring(a.raw.length),n.push(a);continue}if(a=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(a.raw.length);let c=n.at(-1);a.type==="text"&&c?.type==="text"?(c.raw+=a.raw,c.text+=a.text):n.push(a);continue}if(a=this.tokenizer.emStrong(e,s,r)){e=e.substring(a.raw.length),n.push(a);continue}if(a=this.tokenizer.codespan(e)){e=e.substring(a.raw.length),n.push(a);continue}if(a=this.tokenizer.br(e)){e=e.substring(a.raw.length),n.push(a);continue}if(a=this.tokenizer.del(e,s,r)){e=e.substring(a.raw.length),n.push(a);continue}if(a=this.tokenizer.autolink(e)){e=e.substring(a.raw.length),n.push(a);continue}if(!this.state.inLink&&(a=this.tokenizer.url(e))){e=e.substring(a.raw.length),n.push(a);continue}let l=e;if(this.options.extensions?.startInline){let c=1/0,p=e.slice(1),d;this.options.extensions.startInline.forEach(h=>{d=h.call({lexer:this},p),typeof d=="number"&&d>=0&&(c=Math.min(c,d))}),c<1/0&&c>=0&&(l=e.substring(0,c+1))}if(a=this.tokenizer.inlineText(l)){e=e.substring(a.raw.length),a.raw.slice(-1)!=="_"&&(r=a.raw.slice(-1)),i=!0;let c=n.at(-1);c?.type==="text"?(c.raw+=a.raw,c.text+=a.text):n.push(a);continue}if(e){this.infiniteLoopError(e.charCodeAt(0));break}}return n}infiniteLoopError(e){let n="Infinite loop on byte: "+e;if(this.options.silent)console.error(n);else throw new Error(n)}},Ot=class{options;parser;constructor(t){this.options=t||Ae}space(t){return""}code({text:t,lang:e,escaped:n}){let s=(e||"").match(P.notSpaceStart)?.[0],i=t?t.replace(P.endingNewline,"")+`
539
+ `+r.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=a.text):n.push(r);continue}if(e){this.infiniteLoopError(e.charCodeAt(0));break}}return this.state.top=!0,n}inline(e,n=[]){return this.inlineQueue.push({src:e,tokens:n}),n}linkInText(e){if(!e.includes("["))return!1;let n=this.tokenizer.rules.inline.link;for(let s of e.matchAll(this.tokenizer.rules.inline.blockSkip))if(n.test(s[0])&&e.charAt(s.index-1)!=="!")return!0;for(let s of e.matchAll(this.tokenizer.rules.inline.reflinkSearch)){let i=s[0],r=i.lastIndexOf("[");if(!(i.charAt(0)==="!"||!Object.hasOwn(this.tokens.links,Pt(i.slice(r+1,-1))))&&!(r>1&&this.linkInText(i.slice(1,r-1))))return!0}return!1}inlineTokens(e,n=[]){this.tokenizer.lexer=this;let s=this.state.linkParenPossible;this.state.linkParenPossible=s&&e.includes(")");try{return this.#e(e,n)}finally{this.state.linkParenPossible=s}}#e(e,n){let s=e;if(this.tokens.links&&e.includes("[")){let a=this.tokenizer.rules.inline.reflinkSearch,l=c=>{let p=c.lastIndexOf("[");if(!Object.hasOwn(this.tokens.links,Pt(c.slice(p+1,-1))))return c;if(p>1&&c.charAt(0)!=="!"){let d=c.slice(1,p-1);if(this.linkInText(d))return"["+d.replace(a,l)+"]["+"a".repeat(c.length-p-2)+"]"}return"["+"a".repeat(c.length-2)+"]"};s=s.replace(a,l)}s=s.replace(this.tokenizer.rules.inline.anyPunctuation,a=>"+".repeat(a.length)),s=s.replace(this.tokenizer.rules.inline.blockSkip,(a,l,c)=>{let p=c?c.length:0;return a.slice(0,p)+"["+"a".repeat(a.length-p-2)+"]"}),s=this.options.hooks?.emStrongMask?.call({lexer:this},s)??s;let i=!1,r="",o=1/0;for(;e;){if(e.length<o)o=e.length;else{this.infiniteLoopError(e.charCodeAt(0));break}i||(r=""),i=!1;let a;if(this.options.extensions?.inline?.some(c=>(a=c.call({lexer:this},e,n))?(e=e.substring(a.raw.length),n.push(a),!0):!1))continue;if(a=this.tokenizer.escape(e)){e=e.substring(a.raw.length),n.push(a);continue}if(a=this.tokenizer.tag(e)){e=e.substring(a.raw.length),n.push(a);continue}if(a=this.tokenizer.link(e)){e=e.substring(a.raw.length),n.push(a);continue}if(a=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(a.raw.length);let c=n.at(-1);a.type==="text"&&c?.type==="text"?(c.raw+=a.raw,c.text+=a.text):n.push(a);continue}if(a=this.tokenizer.emStrong(e,s,r)){e=e.substring(a.raw.length),n.push(a);continue}if(a=this.tokenizer.codespan(e)){e=e.substring(a.raw.length),n.push(a);continue}if(a=this.tokenizer.br(e)){e=e.substring(a.raw.length),n.push(a);continue}if(a=this.tokenizer.del(e,s,r)){e=e.substring(a.raw.length),n.push(a);continue}if(a=this.tokenizer.autolink(e)){e=e.substring(a.raw.length),n.push(a);continue}if(!this.state.inLink&&(a=this.tokenizer.url(e))){e=e.substring(a.raw.length),n.push(a);continue}let l=e;if(this.options.extensions?.startInline){let c=1/0,p=e.slice(1),d;this.options.extensions.startInline.forEach(h=>{d=h.call({lexer:this},p),typeof d=="number"&&d>=0&&(c=Math.min(c,d))}),c<1/0&&c>=0&&(l=e.substring(0,c+1))}if(a=this.tokenizer.inlineText(l)){e=e.substring(a.raw.length),a.raw.slice(-1)!=="_"&&(r=a.raw.slice(-1)),i=!0;let c=n.at(-1);c?.type==="text"?(c.raw+=a.raw,c.text+=a.text):n.push(a);continue}if(e){this.infiniteLoopError(e.charCodeAt(0));break}}return n}infiniteLoopError(e){let n="Infinite loop on byte: "+e;if(this.options.silent)console.error(n);else throw new Error(n)}},Mt=class{options;parser;constructor(t){this.options=t||Ce}space(t){return""}code({text:t,lang:e,escaped:n}){let s=(e||"").match(P.notSpaceStart)?.[0],i=t?t.replace(P.endingNewline,"")+`
540
540
  `:"";return s?'<pre><code class="language-'+q(s)+'">'+(n?i:q(i,!0))+`</code></pre>
541
541
  `:"<pre><code>"+(n?i:q(i,!0))+`</code></pre>
542
542
  `}blockquote({tokens:t}){return`<blockquote>
@@ -554,8 +554,8 @@ ${this.parser.parse(t)}</blockquote>
554
554
  `}tablerow({text:t}){return`<tr>
555
555
  ${t}</tr>
556
556
  `}tablecell(t){let e=this.parser.parseInline(t.tokens),n=t.header?"th":"td";return(t.align?`<${n} align="${t.align}">`:`<${n}>`)+e+`</${n}>
557
- `}strong({tokens:t}){return`<strong>${this.parser.parseInline(t)}</strong>`}em({tokens:t}){return`<em>${this.parser.parseInline(t)}</em>`}codespan({text:t}){return`<code>${q(t,!0)}</code>`}br(t){return"<br>"}del({tokens:t}){return`<del>${this.parser.parseInline(t)}</del>`}link({href:t,title:e,text:n,tokens:s,autolink:i}){let r=i?q(n,!0):this.parser.parseInline(s),o=hi(t);if(o===null)return r;t=q(o,i);let a='<a href="'+t+'"';return e&&(a+=' title="'+q(e)+'"'),a+=">"+r+"</a>",a}image({href:t,title:e,text:n,tokens:s}){s&&(n=this.parser.parseInline(s,this.parser.textRenderer));let i=hi(t);if(i===null)return q(n);t=i;let r=`<img src="${q(t)}" alt="${q(n)}"`;return e&&(r+=` title="${q(e)}"`),r+=">",r}text(t){return"tokens"in t&&t.tokens?this.parser.parseInline(t.tokens):"escaped"in t&&t.escaped?t.text:q(t.text)}},En=class{strong({text:t}){return t}em({text:t}){return t}codespan({text:t}){return t}del({text:t}){return t}html({text:t}){return t}text({text:t}){return t}link({text:t}){return""+t}image({text:t}){return""+t}br(){return""}checkbox({raw:t}){return t}},K=class ys{options;renderer;textRenderer;constructor(e){this.options=e||Ae,this.options.renderer=this.options.renderer||new Ot,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new En}static parse(e,n){return new ys(n).parse(e)}static parseInline(e,n){return new ys(n).parseInline(e)}parse(e){this.renderer.parser=this;let n="";for(let s=0;s<e.length;s++){let i=e[s];if(this.options.extensions?.renderers?.[i.type]){let o=i,a=this.options.extensions.renderers[o.type].call({parser:this},o);if(a!==!1||!["space","hr","heading","code","table","blockquote","list","checkbox","html","def","paragraph","text"].includes(o.type)){n+=a||"";continue}}let r=i;switch(r.type){case"space":{n+=this.renderer.space(r);break}case"hr":{n+=this.renderer.hr(r);break}case"heading":{n+=this.renderer.heading(r);break}case"code":{n+=this.renderer.code(r);break}case"table":{n+=this.renderer.table(r);break}case"blockquote":{n+=this.renderer.blockquote(r);break}case"list":{n+=this.renderer.list(r);break}case"checkbox":{n+=this.renderer.checkbox(r);break}case"html":{n+=this.renderer.html(r);break}case"def":{n+=this.renderer.def(r);break}case"paragraph":{n+=this.renderer.paragraph(r);break}case"text":{n+=this.renderer.text(r);break}default:{let o='Token with "'+r.type+'" type was not found.';if(this.options.silent)return console.error(o),"";throw new Error(o)}}}return n}parseInline(e,n=this.renderer){this.renderer.parser=this;let s="";for(let i=0;i<e.length;i++){let r=e[i];if(this.options.extensions?.renderers?.[r.type]){let a=this.options.extensions.renderers[r.type].call({parser:this},r);if(a!==!1||!["escape","html","link","image","checkbox","strong","em","codespan","br","del","text"].includes(r.type)){s+=a||"";continue}}let o=r;switch(o.type){case"escape":{s+=n.text(o);break}case"html":{s+=n.html(o);break}case"link":{s+=n.link(o);break}case"image":{s+=n.image(o);break}case"checkbox":{s+=n.checkbox(o);break}case"strong":{s+=n.strong(o);break}case"em":{s+=n.em(o);break}case"codespan":{s+=n.codespan(o);break}case"br":{s+=n.br(o);break}case"del":{s+=n.del(o);break}case"text":{s+=n.text(o);break}default:{let a='Token with "'+o.type+'" type was not found.';if(this.options.silent)return console.error(a),"";throw new Error(a)}}}return s}},rt=class{options;block;constructor(t){this.options=t||Ae}static passThroughHooks=new Set(["preprocess","postprocess","processAllTokens","emStrongMask"]);static passThroughHooksRespectAsync=new Set(["preprocess","postprocess","processAllTokens"]);preprocess(t){return t}postprocess(t){return t}processAllTokens(t){return t}emStrongMask(t){return t}provideLexer(t=this.block){return t?V.lex:V.lexInline}provideParser(t=this.block){return t?K.parse:K.parseInline}},xi=class{defaults=vn();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=K;Renderer=Ot;TextRenderer=En;Lexer=V;Tokenizer=Lt;Hooks=rt;constructor(...t){this.use(...t)}walkTokens(t,e){let n=[];for(let s of t)switch(n=n.concat(e.call(this,s)),s.type){case"table":{let i=s;for(let r of i.header)n=n.concat(this.walkTokens(r.tokens,e));for(let r of i.rows)for(let o of r)n=n.concat(this.walkTokens(o.tokens,e));break}case"list":{let i=s;n=n.concat(this.walkTokens(i.items,e));break}default:{let i=s;this.defaults.extensions?.childTokens?.[i.type]?this.defaults.extensions.childTokens[i.type].forEach(r=>{let o=i[r].flat(1/0);n=n.concat(this.walkTokens(o,e))}):i.tokens&&(n=n.concat(this.walkTokens(i.tokens,e)))}}return n}use(...t){let e=this.defaults.extensions||{renderers:{},childTokens:{}};return t.forEach(n=>{let s={...n};if(s.async=this.defaults.async||s.async||!1,n.extensions&&(n.extensions.forEach(i=>{if(!i.name)throw new Error("extension name required");if("renderer"in i){let r=e.renderers[i.name];r?e.renderers[i.name]=function(...o){let a=i.renderer.apply(this,o);return a===!1&&(a=r.apply(this,o)),a}:e.renderers[i.name]=i.renderer}if("tokenizer"in i){if(!i.level||i.level!=="block"&&i.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let r=e[i.level];r?r.unshift(i.tokenizer):e[i.level]=[i.tokenizer],i.start&&(i.level==="block"?e.startBlock?e.startBlock.push(i.start):e.startBlock=[i.start]:i.level==="inline"&&(e.startInline?e.startInline.push(i.start):e.startInline=[i.start]))}"childTokens"in i&&i.childTokens&&(e.childTokens[i.name]=i.childTokens)}),s.extensions=e),n.renderer){let i=this.defaults.renderer||new Ot(this.defaults);for(let r in n.renderer){if(!(r in i))throw new Error(`renderer '${r}' does not exist`);if(["options","parser"].includes(r))continue;let o=r,a=n.renderer[o],l=i[o];i[o]=(...c)=>{let p=a.apply(i,c);return p===!1&&(p=l.apply(i,c)),p||""}}s.renderer=i}if(n.tokenizer){let i=this.defaults.tokenizer||new Lt(this.defaults);for(let r in n.tokenizer){if(!(r in i))throw new Error(`tokenizer '${r}' does not exist`);if(["options","rules","lexer"].includes(r))continue;let o=r,a=n.tokenizer[o],l=i[o];i[o]=(...c)=>{let p=a.apply(i,c);return p===!1&&(p=l.apply(i,c)),p}}s.tokenizer=i}if(n.hooks){let i=this.defaults.hooks||new rt;for(let r in n.hooks){if(!(r in i))throw new Error(`hook '${r}' does not exist`);if(["options","block"].includes(r))continue;let o=r,a=n.hooks[o],l=i[o];rt.passThroughHooks.has(r)?i[o]=c=>{if(this.defaults.async&&rt.passThroughHooksRespectAsync.has(r))return(async()=>{let d=await a.call(i,c);return l.call(i,d)})();let p=a.call(i,c);return l.call(i,p)}:i[o]=(...c)=>{if(this.defaults.async)return(async()=>{let d=await a.apply(i,c);return d===!1&&(d=await l.apply(i,c)),d})();let p=a.apply(i,c);return p===!1&&(p=l.apply(i,c)),p}}s.hooks=i}if(n.walkTokens){let i=this.defaults.walkTokens,r=n.walkTokens;s.walkTokens=function(o){let a=[];return a.push(r.call(this,o)),i&&(a=a.concat(i.call(this,o))),a}}this.defaults={...this.defaults,...s}}),this}setOptions(t){return this.defaults={...this.defaults,...t},this}lexer(t,e){return V.lex(t,e??this.defaults)}parser(t,e){return K.parse(t,e??this.defaults)}parseMarkdown(t){return(e,n)=>{let s={...n},i={...this.defaults,...s},r=this.onError(!!i.silent,!!i.async);if(this.defaults.async===!0&&s.async===!1)return r(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof e>"u"||e===null)return r(new Error("marked(): input parameter is undefined or null"));if(typeof e!="string")return r(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(e)+", string expected"));if(i.hooks&&(i.hooks.options=i,i.hooks.block=t),i.async)return(async()=>{let o=i.hooks?await i.hooks.preprocess(e):e,a=await(i.hooks?await i.hooks.provideLexer(t):t?V.lex:V.lexInline)(o,i),l=i.hooks?await i.hooks.processAllTokens(a):a;i.walkTokens&&await Promise.all(this.walkTokens(l,i.walkTokens));let c=await(i.hooks?await i.hooks.provideParser(t):t?K.parse:K.parseInline)(l,i);return i.hooks?await i.hooks.postprocess(c):c})().catch(r);try{i.hooks&&(e=i.hooks.preprocess(e));let o=(i.hooks?i.hooks.provideLexer(t):t?V.lex:V.lexInline)(e,i);i.hooks&&(o=i.hooks.processAllTokens(o)),i.walkTokens&&this.walkTokens(o,i.walkTokens);let a=(i.hooks?i.hooks.provideParser(t):t?K.parse:K.parseInline)(o,i);return i.hooks&&(a=i.hooks.postprocess(a)),a}catch(o){return r(o)}}}onError(t,e){return n=>{if(n.message+=`
558
- Please report this to https://github.com/markedjs/marked.`,t){let s="<p>An error occurred:</p><pre>"+q(n.message+"",!0)+"</pre>";return e?Promise.resolve(s):s}if(e)return Promise.reject(n);throw n}}},Te=new xi;function C(t,e){return Te.parse(t,e)}C.options=C.setOptions=function(t){return Te.setOptions(t),C.defaults=Te.defaults,Qs(C.defaults),C},C.getDefaults=vn,C.defaults=Ae;function ll(...t){return Te.use(...t),C.defaults=Te.defaults,Qs(C.defaults),C}C.use=ll,C.walkTokens=function(t,e){return Te.walkTokens(t,e)},C.parseInline=Te.parseInline,C.Parser=K,C.parser=K.parse,C.Renderer=Ot,C.TextRenderer=En,C.Lexer=V,C.lexer=V.lex,C.Tokenizer=Lt,C.Hooks=rt,C.parse=C,C.options,C.setOptions,C.walkTokens,C.parseInline,K.parse,V.lex;const cl={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},Ee=t=>t.replace(/[&<>"']/g,e=>cl[e]??e),dl=new Set(["http","https","mailto"]),vi=t=>{const e=t.replace(/[\u0000- \u007f]/g,""),n=/^([a-z][a-z0-9+.-]*):/i.exec(e)?.[1];return n===void 0||dl.has(n.toLowerCase())},pl=t=>/^https?:/i.test(t.trim()),hl=new xi({gfm:!0,breaks:!0,renderer:{html({text:t}){return Ee(t)},link({href:t,title:e,tokens:n}){const s=this.parser.parseInline(n);if(!vi(t))return s;const i=e?` title="${Ee(e)}"`:"",r=pl(t)?' target="_blank" rel="noopener noreferrer"':"";return`<a href="${Ee(t)}"${i}${r}>${s}</a>`},image({href:t,title:e,text:n}){if(!vi(t))return Ee(n);const s=e?` title="${Ee(e)}"`:"";return`<img src="${Ee(t)}" alt="${Ee(n)}"${s}>`}}}),yi=t=>hl.parse(t,{async:!1}),ul=Ct({en:{clickToEdit:"Click to edit",unset:"Not set",edit:"Edit"},ja:{clickToEdit:"\u30AF\u30EA\u30C3\u30AF\u3057\u3066\u7DE8\u96C6",unset:"\u672A\u8A2D\u5B9A",edit:"\u7DE8\u96C6"}});class wi extends he{static{this.styles=[Tt,Xs,de`
557
+ `}strong({tokens:t}){return`<strong>${this.parser.parseInline(t)}</strong>`}em({tokens:t}){return`<em>${this.parser.parseInline(t)}</em>`}codespan({text:t}){return`<code>${q(t,!0)}</code>`}br(t){return"<br>"}del({tokens:t}){return`<del>${this.parser.parseInline(t)}</del>`}link({href:t,title:e,text:n,tokens:s,autolink:i}){let r=i?q(n,!0):this.parser.parseInline(s),o=gi(t);if(o===null)return r;t=q(o,i);let a='<a href="'+t+'"';return e&&(a+=' title="'+q(e)+'"'),a+=">"+r+"</a>",a}image({href:t,title:e,text:n,tokens:s}){s&&(n=this.parser.parseInline(s,this.parser.textRenderer));let i=gi(t);if(i===null)return q(n);t=i;let r=`<img src="${q(t)}" alt="${q(n)}"`;return e&&(r+=` title="${q(e)}"`),r+=">",r}text(t){return"tokens"in t&&t.tokens?this.parser.parseInline(t.tokens):"escaped"in t&&t.escaped?t.text:q(t.text)}},Rn=class{strong({text:t}){return t}em({text:t}){return t}codespan({text:t}){return t}del({text:t}){return t}html({text:t}){return t}text({text:t}){return t}link({text:t}){return""+t}image({text:t}){return""+t}br(){return""}checkbox({raw:t}){return t}},G=class Ss{options;renderer;textRenderer;constructor(e){this.options=e||Ce,this.options.renderer=this.options.renderer||new Mt,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new Rn}static parse(e,n){return new Ss(n).parse(e)}static parseInline(e,n){return new Ss(n).parseInline(e)}parse(e){this.renderer.parser=this;let n="";for(let s=0;s<e.length;s++){let i=e[s];if(this.options.extensions?.renderers?.[i.type]){let o=i,a=this.options.extensions.renderers[o.type].call({parser:this},o);if(a!==!1||!["space","hr","heading","code","table","blockquote","list","checkbox","html","def","paragraph","text"].includes(o.type)){n+=a||"";continue}}let r=i;switch(r.type){case"space":{n+=this.renderer.space(r);break}case"hr":{n+=this.renderer.hr(r);break}case"heading":{n+=this.renderer.heading(r);break}case"code":{n+=this.renderer.code(r);break}case"table":{n+=this.renderer.table(r);break}case"blockquote":{n+=this.renderer.blockquote(r);break}case"list":{n+=this.renderer.list(r);break}case"checkbox":{n+=this.renderer.checkbox(r);break}case"html":{n+=this.renderer.html(r);break}case"def":{n+=this.renderer.def(r);break}case"paragraph":{n+=this.renderer.paragraph(r);break}case"text":{n+=this.renderer.text(r);break}default:{let o='Token with "'+r.type+'" type was not found.';if(this.options.silent)return console.error(o),"";throw new Error(o)}}}return n}parseInline(e,n=this.renderer){this.renderer.parser=this;let s="";for(let i=0;i<e.length;i++){let r=e[i];if(this.options.extensions?.renderers?.[r.type]){let a=this.options.extensions.renderers[r.type].call({parser:this},r);if(a!==!1||!["escape","html","link","image","checkbox","strong","em","codespan","br","del","text"].includes(r.type)){s+=a||"";continue}}let o=r;switch(o.type){case"escape":{s+=n.text(o);break}case"html":{s+=n.html(o);break}case"link":{s+=n.link(o);break}case"image":{s+=n.image(o);break}case"checkbox":{s+=n.checkbox(o);break}case"strong":{s+=n.strong(o);break}case"em":{s+=n.em(o);break}case"codespan":{s+=n.codespan(o);break}case"br":{s+=n.br(o);break}case"del":{s+=n.del(o);break}case"text":{s+=n.text(o);break}default:{let a='Token with "'+o.type+'" type was not found.';if(this.options.silent)return console.error(a),"";throw new Error(a)}}}return s}},ot=class{options;block;constructor(t){this.options=t||Ce}static passThroughHooks=new Set(["preprocess","postprocess","processAllTokens","emStrongMask"]);static passThroughHooksRespectAsync=new Set(["preprocess","postprocess","processAllTokens"]);preprocess(t){return t}postprocess(t){return t}processAllTokens(t){return t}emStrongMask(t){return t}provideLexer(t=this.block){return t?K.lex:K.lexInline}provideParser(t=this.block){return t?G.parse:G.parseInline}},wi=class{defaults=yn();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=G;Renderer=Mt;TextRenderer=Rn;Lexer=K;Tokenizer=zt;Hooks=ot;constructor(...t){this.use(...t)}walkTokens(t,e){let n=[];for(let s of t)switch(n=n.concat(e.call(this,s)),s.type){case"table":{let i=s;for(let r of i.header)n=n.concat(this.walkTokens(r.tokens,e));for(let r of i.rows)for(let o of r)n=n.concat(this.walkTokens(o.tokens,e));break}case"list":{let i=s;n=n.concat(this.walkTokens(i.items,e));break}default:{let i=s;this.defaults.extensions?.childTokens?.[i.type]?this.defaults.extensions.childTokens[i.type].forEach(r=>{let o=i[r].flat(1/0);n=n.concat(this.walkTokens(o,e))}):i.tokens&&(n=n.concat(this.walkTokens(i.tokens,e)))}}return n}use(...t){let e=this.defaults.extensions||{renderers:{},childTokens:{}};return t.forEach(n=>{let s={...n};if(s.async=this.defaults.async||s.async||!1,n.extensions&&(n.extensions.forEach(i=>{if(!i.name)throw new Error("extension name required");if("renderer"in i){let r=e.renderers[i.name];r?e.renderers[i.name]=function(...o){let a=i.renderer.apply(this,o);return a===!1&&(a=r.apply(this,o)),a}:e.renderers[i.name]=i.renderer}if("tokenizer"in i){if(!i.level||i.level!=="block"&&i.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let r=e[i.level];r?r.unshift(i.tokenizer):e[i.level]=[i.tokenizer],i.start&&(i.level==="block"?e.startBlock?e.startBlock.push(i.start):e.startBlock=[i.start]:i.level==="inline"&&(e.startInline?e.startInline.push(i.start):e.startInline=[i.start]))}"childTokens"in i&&i.childTokens&&(e.childTokens[i.name]=i.childTokens)}),s.extensions=e),n.renderer){let i=this.defaults.renderer||new Mt(this.defaults);for(let r in n.renderer){if(!(r in i))throw new Error(`renderer '${r}' does not exist`);if(["options","parser"].includes(r))continue;let o=r,a=n.renderer[o],l=i[o];i[o]=(...c)=>{let p=a.apply(i,c);return p===!1&&(p=l.apply(i,c)),p||""}}s.renderer=i}if(n.tokenizer){let i=this.defaults.tokenizer||new zt(this.defaults);for(let r in n.tokenizer){if(!(r in i))throw new Error(`tokenizer '${r}' does not exist`);if(["options","rules","lexer"].includes(r))continue;let o=r,a=n.tokenizer[o],l=i[o];i[o]=(...c)=>{let p=a.apply(i,c);return p===!1&&(p=l.apply(i,c)),p}}s.tokenizer=i}if(n.hooks){let i=this.defaults.hooks||new ot;for(let r in n.hooks){if(!(r in i))throw new Error(`hook '${r}' does not exist`);if(["options","block"].includes(r))continue;let o=r,a=n.hooks[o],l=i[o];ot.passThroughHooks.has(r)?i[o]=c=>{if(this.defaults.async&&ot.passThroughHooksRespectAsync.has(r))return(async()=>{let d=await a.call(i,c);return l.call(i,d)})();let p=a.call(i,c);return l.call(i,p)}:i[o]=(...c)=>{if(this.defaults.async)return(async()=>{let d=await a.apply(i,c);return d===!1&&(d=await l.apply(i,c)),d})();let p=a.apply(i,c);return p===!1&&(p=l.apply(i,c)),p}}s.hooks=i}if(n.walkTokens){let i=this.defaults.walkTokens,r=n.walkTokens;s.walkTokens=function(o){let a=[];return a.push(r.call(this,o)),i&&(a=a.concat(i.call(this,o))),a}}this.defaults={...this.defaults,...s}}),this}setOptions(t){return this.defaults={...this.defaults,...t},this}lexer(t,e){return K.lex(t,e??this.defaults)}parser(t,e){return G.parse(t,e??this.defaults)}parseMarkdown(t){return(e,n)=>{let s={...n},i={...this.defaults,...s},r=this.onError(!!i.silent,!!i.async);if(this.defaults.async===!0&&s.async===!1)return r(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof e>"u"||e===null)return r(new Error("marked(): input parameter is undefined or null"));if(typeof e!="string")return r(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(e)+", string expected"));if(i.hooks&&(i.hooks.options=i,i.hooks.block=t),i.async)return(async()=>{let o=i.hooks?await i.hooks.preprocess(e):e,a=await(i.hooks?await i.hooks.provideLexer(t):t?K.lex:K.lexInline)(o,i),l=i.hooks?await i.hooks.processAllTokens(a):a;i.walkTokens&&await Promise.all(this.walkTokens(l,i.walkTokens));let c=await(i.hooks?await i.hooks.provideParser(t):t?G.parse:G.parseInline)(l,i);return i.hooks?await i.hooks.postprocess(c):c})().catch(r);try{i.hooks&&(e=i.hooks.preprocess(e));let o=(i.hooks?i.hooks.provideLexer(t):t?K.lex:K.lexInline)(e,i);i.hooks&&(o=i.hooks.processAllTokens(o)),i.walkTokens&&this.walkTokens(o,i.walkTokens);let a=(i.hooks?i.hooks.provideParser(t):t?G.parse:G.parseInline)(o,i);return i.hooks&&(a=i.hooks.postprocess(a)),a}catch(o){return r(o)}}}onError(t,e){return n=>{if(n.message+=`
558
+ Please report this to https://github.com/markedjs/marked.`,t){let s="<p>An error occurred:</p><pre>"+q(n.message+"",!0)+"</pre>";return e?Promise.resolve(s):s}if(e)return Promise.reject(n);throw n}}},Ee=new wi;function T(t,e){return Ee.parse(t,e)}T.options=T.setOptions=function(t){return Ee.setOptions(t),T.defaults=Ee.defaults,ni(T.defaults),T},T.getDefaults=yn,T.defaults=Ce;function fl(...t){return Ee.use(...t),T.defaults=Ee.defaults,ni(T.defaults),T}T.use=fl,T.walkTokens=function(t,e){return Ee.walkTokens(t,e)},T.parseInline=Ee.parseInline,T.Parser=G,T.parser=G.parse,T.Renderer=Mt,T.TextRenderer=Rn,T.Lexer=K,T.lexer=K.lex,T.Tokenizer=zt,T.Hooks=ot,T.parse=T,T.options,T.setOptions,T.walkTokens,T.parseInline,G.parse,K.lex;const gl={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},Re=t=>t.replace(/[&<>"']/g,e=>gl[e]??e),ml=new Set(["http","https","mailto"]),$i=t=>{const e=t.replace(/[\u0000- \u007f]/g,""),n=/^([a-z][a-z0-9+.-]*):/i.exec(e)?.[1];return n===void 0||ml.has(n.toLowerCase())},kl=t=>/^https?:/i.test(t.trim()),bl=new wi({gfm:!0,breaks:!0,renderer:{html({text:t}){return Re(t)},link({href:t,title:e,tokens:n}){const s=this.parser.parseInline(n);if(!$i(t))return s;const i=e?` title="${Re(e)}"`:"",r=kl(t)?' target="_blank" rel="noopener noreferrer"':"";return`<a href="${Re(t)}"${i}${r}>${s}</a>`},image({href:t,title:e,text:n}){if(!$i(t))return Re(n);const s=e?` title="${Re(e)}"`:"";return`<img src="${Re(t)}" alt="${Re(n)}"${s}>`}}}),Si=t=>bl.parse(t,{async:!1}),vl=Rt({en:{clickToEdit:"Click to edit",unset:"Not set",edit:"Edit"},ja:{clickToEdit:"\u30AF\u30EA\u30C3\u30AF\u3057\u3066\u7DE8\u96C6",unset:"\u672A\u8A2D\u5B9A",edit:"\u7DE8\u96C6"}});class Ai extends he{static{this.styles=[_t,ti,de`
559
559
  /* One atomic box in both states, so the text can be edited where it sits:
560
560
  while editing, the text stays (hidden) underneath and keeps sizing the
561
561
  box, and the field lies over it. Starting an edit moves nothing; the
@@ -685,7 +685,7 @@ Please report this to https://github.com/markedjs/marked.`,t){let s="<p>An error
685
685
  background: transparent;
686
686
  box-shadow: none;
687
687
  }
688
- `]}static{this.properties={value:{type:String},placeholder:{type:String},multiline:{type:Boolean},wrap:{type:Boolean,reflect:!0},truncate:{type:Boolean,reflect:!0},seamless:{type:Boolean,reflect:!0},markdown:{type:Boolean},label:{type:String},editing:{state:!0}}}#e="";#n=0;#s=new bn(this);connectedCallback(){super.connectedCallback(),this.#n+=1}constructor(){super(),this.value="",this.placeholder="",this.multiline=!1,this.wrap=!1,this.truncate=!1,this.seamless=!1,this.markdown=!1,this.label="",this.editing=!1,this.#e=""}startEditing(){this.#e=this.value,this.editing=!0}willUpdate(e){e.has("value")&&!this.editing&&(this.#e=this.value)}updated(){if(!this.editing)return;const e=this.renderRoot.querySelector(".field"),n=this.renderRoot,s=n instanceof ShadowRoot?n.activeElement:document.activeElement;e&&s!==e&&(e.focus(),e.setSelectionRange(0,e.value.length,"backward"),e.scrollLeft=0,e.scrollTop=0)}render(){const e=ul(this.#s.locale),n=this.placeholder||e.unset,{editing:s}=this,i=s?this.#e:this.value,r=i===""?n:s&&i.endsWith(`
688
+ `]}static{this.properties={value:{type:String},placeholder:{type:String},multiline:{type:Boolean},wrap:{type:Boolean,reflect:!0},truncate:{type:Boolean,reflect:!0},seamless:{type:Boolean,reflect:!0},markdown:{type:Boolean},label:{type:String},editing:{state:!0}}}#e="";#n=0;#s=new vn(this);connectedCallback(){super.connectedCallback(),this.#n+=1}constructor(){super(),this.value="",this.placeholder="",this.multiline=!1,this.wrap=!1,this.truncate=!1,this.seamless=!1,this.markdown=!1,this.label="",this.editing=!1,this.#e=""}startEditing(){this.#e=this.value,this.editing=!0}willUpdate(e){e.has("value")&&!this.editing&&(this.#e=this.value)}updated(){if(!this.editing)return;const e=this.renderRoot.querySelector(".field"),n=this.renderRoot,s=n instanceof ShadowRoot?n.activeElement:document.activeElement;e&&s!==e&&(e.focus(),e.setSelectionRange(0,e.value.length,"backward"),e.scrollLeft=0,e.scrollTop=0)}render(){const e=vl(this.#s.locale),n=this.placeholder||e.unset,{editing:s}=this,i=s?this.#e:this.value,r=i===""?n:s&&i.endsWith(`
689
689
  `)?`${i}\u200B`:i;return this.markdown&&!s&&i!==""?b`<span class="box"
690
690
  ><div
691
691
  class="view dpk-prose"
@@ -696,51 +696,51 @@ Please report this to https://github.com/markedjs/marked.`,t){let s="<p>An error
696
696
  @click=${this.#t}
697
697
  @keydown=${this.#i}
698
698
  >
699
- ${Vs(yi(i))}
699
+ ${Zs(Si(i))}
700
700
  </div></span
701
701
  >`:b`<span class="box"
702
702
  ><span
703
703
  class="view"
704
704
  data-empty=${String(i==="")}
705
- aria-hidden=${s?"true":m}
706
- role=${s?m:"button"}
707
- tabindex=${s?m:"0"}
708
- title=${s?m:this.truncate&&i!==""?i:e.clickToEdit}
705
+ aria-hidden=${s?"true":g}
706
+ role=${s?g:"button"}
707
+ tabindex=${s?g:"0"}
708
+ title=${s?g:this.truncate&&i!==""?i:e.clickToEdit}
709
709
  @click=${this.#t}
710
710
  @keydown=${this.#i}
711
711
  >${r}</span
712
- >${s?this.#r(this.label||this.placeholder||e.edit,n):m}</span
712
+ >${s?this.#r(this.label||this.placeholder||e.edit,n):g}</span
713
713
  >`}#r(e,n){return this.multiline||this.wrap?b`<textarea
714
714
  class="field"
715
715
  rows="1"
716
- .value=${gn(this.#e)}
716
+ .value=${mn(this.#e)}
717
717
  placeholder=${n}
718
718
  aria-label=${e}
719
719
  @input=${this.#o}
720
- @keydown=${this.#a}
721
- @blur=${this.#l}
720
+ @keydown=${this.#l}
721
+ @blur=${this.#a}
722
722
  ></textarea>`:b`<input
723
723
  class="field"
724
- .value=${gn(this.#e)}
724
+ .value=${mn(this.#e)}
725
725
  placeholder=${n}
726
726
  aria-label=${e}
727
727
  @input=${this.#o}
728
- @keydown=${this.#a}
729
- @blur=${this.#l}
730
- />`}#t=e=>{e.composedPath().some(n=>n instanceof HTMLAnchorElement)||(e.stopPropagation(),!this.editing&&(this.#e=this.value,this.editing=!0))};#i=e=>{e.isComposing||this.editing||e.target instanceof HTMLAnchorElement||(e.key==="Enter"||e.key===" ")&&(e.preventDefault(),this.editing=!0)};#o=e=>{const n=je(e.target,HTMLInputElement)??je(e.target,HTMLTextAreaElement);n!==null&&(this.#e=n.value,this.requestUpdate())};#a=e=>{if(!e.isComposing){if(e.key==="Escape"){e.preventDefault(),this.#e=this.value,this.editing=!1;return}e.key==="Enter"&&(!this.multiline||this.wrap||e.metaKey||e.ctrlKey)&&(e.preventDefault(),this.#p())}};#l=e=>{const n=e.currentTarget;if(!(n instanceof HTMLInputElement||n instanceof HTMLTextAreaElement))return;const s=this.#n,{selectionStart:i,selectionEnd:r}=n;queueMicrotask(()=>{!this.isConnected||!this.editing||(s!==this.#n?(n.focus(),n.setSelectionRange(i,r)):this.#p())})};#p=()=>{if(!this.editing)return;this.editing=!1;const n=(this.wrap?this.#e.replace(/\r?\n/g," "):this.#e).trim();n!==this.value&&this.dispatchEvent(new CustomEvent("dpk-commit",{detail:{value:n},bubbles:!0,composed:!0}))}}const fl=()=>{customElements.get("dpk-component-inline-edit")||customElements.define("dpk-component-inline-edit",wi)},gl={lang:void 0,message:void 0,abortEarly:void 0,abortPipeEarly:void 0};function Rn(t){return gl}let ml;function kl(t){return ml?.get(t)}let bl;function xl(t){return bl?.get(t)}let vl;function yl(t,e){return vl?.get(t)?.get(e)}function Ue(t){const e=typeof t;return e==="string"?`"${t}"`:e==="number"||e==="bigint"||e==="boolean"?`${t}`:e==="object"||e==="function"?(t&&Object.getPrototypeOf(t)?.constructor?.name)??"null":e}function R(t,e,n,s,i){const r=i&&"input"in i?i.input:n.value,o=i?.expected??t.expects??null,a=i?.received??Ue(r),l={kind:t.kind,type:t.type,input:r,expected:o,received:a,message:`Invalid ${e}: ${o?`Expected ${o} but r`:"R"}eceived ${a}`,requirement:t.requirement,path:i?.path,issues:i?.issues,lang:s.lang,abortEarly:s.abortEarly,abortPipeEarly:s.abortPipeEarly},c=t.kind==="schema",p=i?.message??t.message??yl(t.reference,l.lang)??(c?xl(l.lang):null)??s.message??kl(l.lang);p!==void 0&&(l.message=typeof p=="function"?p(l):p),c&&(n.typed=!1),n.issues?n.issues.push(l):n.issues=[l]}function wl(t,e){return t===e||Number.isNaN(t)&&Number.isNaN(e)}function $l(t,e){return Object.prototype.hasOwnProperty.call(t,e)&&e!=="__proto__"&&e!=="prototype"&&e!=="constructor"}function _n(t,e){const n=[...new Set(t)];return n.length>1?`(${n.join(` ${e} `)})`:n[0]??"never"}function z(t){return t["~standard"]={version:1,vendor:"valibot",validate:e=>t["~run"]({value:e},Rn())},t}function Sl(t){if(t.path){let e="";for(const n of t.path)if(typeof n.key=="string"||typeof n.key=="number")e?e+=`.${n.key}`:e+=n.key;else return null;return e}return null}var Al=class extends Error{constructor(t){super(t[0].message),this.name="ValiError",this.issues=t}};function $i(t,e){return{kind:"validation",type:"check",reference:$i,async:!1,expects:null,requirement:t,message:e,"~run"(n,s){return n.typed&&!this.requirement(n.value)&&R(this,"input",n,s),n}}}function Si(t){return{kind:"validation",type:"finite",reference:Si,async:!1,expects:null,requirement:Number.isFinite,message:t,"~run"(e,n){return e.typed&&!this.requirement(e.value)&&R(this,"finite",e,n),e}}}function Ai(t,e){const n=Ue(t);return{kind:"validation",type:"includes",reference:Ai,async:!1,expects:n,requirement:t,message:e,"~run"(s,i){return s.typed&&!s.value.includes(this.requirement)&&R(this,"content",s,i,{received:`!${n}`}),s}}}function Ci(t){return{kind:"validation",type:"integer",reference:Ci,async:!1,expects:null,requirement:Number.isInteger,message:t,"~run"(e,n){return e.typed&&!this.requirement(e.value)&&R(this,"integer",e,n),e}}}function S(t,e){return{kind:"validation",type:"min_length",reference:S,async:!1,expects:`>=${t}`,requirement:t,message:e,"~run"(n,s){return n.typed&&n.value.length<this.requirement&&R(this,"length",n,s,{received:`${n.value.length}`}),n}}}function Ti(t,e){return{kind:"validation",type:"min_value",reference:Ti,async:!1,expects:`>=${t instanceof Date?t.toJSON():Ue(t)}`,requirement:t,message:e,"~run"(n,s){return n.typed&&!(n.value>=this.requirement)&&R(this,"value",n,s,{received:n.value instanceof Date?n.value.toJSON():Ue(n.value)}),n}}}function ge(t,e){return{kind:"validation",type:"regex",reference:ge,async:!1,expects:`${t}`,requirement:t,message:e,"~run"(n,s){return n.typed&&!this.requirement.test(n.value)&&R(this,"format",n,s),n}}}function Ln(){return{kind:"transformation",type:"trim",reference:Ln,async:!1,"~run"(t){return t.value=t.value.trim(),t}}}function Ei(t){return{kind:"validation",type:"url",reference:Ei,async:!1,expects:null,requirement(e){try{return URL.canParse?URL.canParse(e):(new URL(e),!0)}catch{return!1}},message:t,"~run"(e,n){return e.typed&&!this.requirement(e.value)&&R(this,"URL",e,n),e}}}const Ri={abortEarly:!0};function _i(t,e,n){return typeof t.fallback=="function"?t.fallback(e,n):t.fallback}function Pt(t,e,n){return typeof t.default=="function"?t.default(e,n):t.default}function Cl(t,e){return!t["~run"]({value:e},Ri).issues}function G(t,e){return z({kind:"schema",type:"array",reference:G,expects:"Array",async:!1,item:t,message:e,"~run"(n,s){const i=n.value;if(Array.isArray(i)){n.typed=!0,n.value=[];for(let r=0;r<i.length;r++){const o=i[r],a=this.item["~run"]({value:o},s);if(a.issues){const l={type:"array",origin:"value",input:i,key:r,value:o};for(const c of a.issues)c.path?c.path.unshift(l):c.path=[l],n.issues?.push(c);if(n.issues||(n.issues=a.issues),s.abortEarly){n.typed=!1;break}}a.typed||(n.typed=!1),n.value.push(a.value)}}else R(this,"type",n,s);return n}})}function Li(t){return z({kind:"schema",type:"boolean",reference:Li,expects:"boolean",async:!1,message:t,"~run"(e,n){return typeof e.value=="boolean"?e.typed=!0:R(this,"type",e,n),e}})}function B(t,e){return z({kind:"schema",type:"exact_optional",reference:B,expects:t.expects,async:!1,wrapped:t,default:e,"~run"(n,s){return this.wrapped["~run"](n,s)}})}function Oi(t){return z({kind:"schema",type:"lazy",reference:Oi,expects:"unknown",async:!1,getter:t,"~run"(e,n){return this.getter(e.value)["~run"](e,n)}})}function Re(t,e){return z({kind:"schema",type:"literal",reference:Re,expects:Ue(t),async:!1,literal:t,message:e,"~run"(n,s){return wl(n.value,this.literal)?n.typed=!0:R(this,"type",n,s),n}})}function Pi(t,e){return z({kind:"schema",type:"nullable",reference:Pi,expects:`(${t.expects} | null)`,async:!1,wrapped:t,default:e,"~run"(n,s){return n.value===null&&(this.default!==void 0&&(n.value=Pt(this,n,s)),n.value===null)?(n.typed=!0,n):this.wrapped["~run"](n,s)}})}function zi(t){return z({kind:"schema",type:"number",reference:zi,expects:"number",async:!1,message:t,"~run"(e,n){return typeof e.value=="number"&&!isNaN(e.value)?e.typed=!0:R(this,"type",e,n),e}})}function L(t,e){return z({kind:"schema",type:"object",reference:L,expects:"Object",async:!1,entries:t,message:e,"~run"(n,s){const i=n.value;if(i&&typeof i=="object"){n.typed=!0,n.value={};for(const r in this.entries){const o=this.entries[r];if(r in i||(o.type==="exact_optional"||o.type==="optional"||o.type==="nullish")&&o.default!==void 0){const a=r in i?i[r]:Pt(o),l=o["~run"]({value:a},s);if(l.issues){const c={type:"object",origin:"value",input:i,key:r,value:a};for(const p of l.issues)p.path?p.path.unshift(c):p.path=[c],n.issues?.push(p);if(n.issues||(n.issues=l.issues),s.abortEarly){n.typed=!1;break}}l.typed||(n.typed=!1),n.value[r]=l.value}else if(o.fallback!==void 0)n.value[r]=_i(o);else if(o.type!=="exact_optional"&&o.type!=="optional"&&o.type!=="nullish"&&(R(this,"key",n,s,{input:void 0,expected:`"${r}"`,path:[{type:"object",origin:"key",input:i,key:r,value:i[r]}]}),s.abortEarly))break}}else R(this,"type",n,s);return n}})}function ne(t,e){return z({kind:"schema",type:"optional",reference:ne,expects:`(${t.expects} | undefined)`,async:!1,wrapped:t,default:e,"~run"(n,s){return n.value===void 0&&(this.default!==void 0&&(n.value=Pt(this,n,s)),n.value===void 0)?(n.typed=!0,n):this.wrapped["~run"](n,s)}})}function zt(t,e){return z({kind:"schema",type:"picklist",reference:zt,expects:_n(t.map(Ue),"|"),async:!1,options:t,message:e,"~run"(n,s){return this.options.includes(n.value)?n.typed=!0:R(this,"type",n,s),n}})}function Mt(t,e,n){return z({kind:"schema",type:"record",reference:Mt,expects:"Object",async:!1,key:t,value:e,message:n,"~run"(s,i){const r=s.value;if(r&&typeof r=="object"){s.typed=!0,s.value={};for(const o in r)if($l(r,o)){const a=r[o],l=this.key["~run"]({value:o},i);if(l.issues){const p={type:"object",origin:"key",input:r,key:o,value:a};for(const d of l.issues)d.path=[p],s.issues?.push(d);if(s.issues||(s.issues=l.issues),i.abortEarly){s.typed=!1;break}}const c=this.value["~run"]({value:a},i);if(c.issues){const p={type:"object",origin:"value",input:r,key:o,value:a};for(const d of c.issues)d.path?d.path.unshift(p):d.path=[p],s.issues?.push(d);if(s.issues||(s.issues=c.issues),i.abortEarly){s.typed=!1;break}}(!l.typed||!c.typed)&&(s.typed=!1),l.typed&&(s.value[l.value]=c.value)}}else R(this,"type",s,i);return s}})}function se(t,e){return z({kind:"schema",type:"strict_object",reference:se,expects:"Object",async:!1,entries:t,message:e,"~run"(n,s){const i=n.value;if(i&&typeof i=="object"){n.typed=!0,n.value={};for(const r in this.entries){const o=this.entries[r];if(r in i||(o.type==="exact_optional"||o.type==="optional"||o.type==="nullish")&&o.default!==void 0){const a=r in i?i[r]:Pt(o),l=o["~run"]({value:a},s);if(l.issues){const c={type:"object",origin:"value",input:i,key:r,value:a};for(const p of l.issues)p.path?p.path.unshift(c):p.path=[c],n.issues?.push(p);if(n.issues||(n.issues=l.issues),s.abortEarly){n.typed=!1;break}}l.typed||(n.typed=!1),n.value[r]=l.value}else if(o.fallback!==void 0)n.value[r]=_i(o);else if(o.type!=="exact_optional"&&o.type!=="optional"&&o.type!=="nullish"&&(R(this,"key",n,s,{input:void 0,expected:`"${r}"`,path:[{type:"object",origin:"key",input:i,key:r,value:i[r]}]}),s.abortEarly))break}if(!n.issues||!s.abortEarly){for(const r in i)if(!Object.prototype.hasOwnProperty.call(this.entries,r)){R(this,"key",n,s,{input:r,expected:"never",path:[{type:"object",origin:"key",input:i,key:r,value:i[r]}]});break}}}else R(this,"type",n,s);return n}})}function x(t){return z({kind:"schema",type:"string",reference:x,expects:"string",async:!1,message:t,"~run"(e,n){return typeof e.value=="string"?e.typed=!0:R(this,"type",e,n),e}})}function Mi(t){let e;if(t)for(const n of t)if(e)for(const s of n.issues)e.push(s);else e=n.issues;return e}function On(t,e){return z({kind:"schema",type:"union",reference:On,expects:_n(t.map(n=>n.expects),"|"),async:!1,options:t,message:e,"~run"(n,s){let i,r,o;for(const a of this.options){const l=a["~run"]({value:n.value},s);if(l.typed)if(l.issues)r?r.push(l):r=[l];else{i=l;break}else o?o.push(l):o=[l]}if(i)return i;if(r){if(r.length===1)return r[0];R(this,"type",n,s,{issues:Mi(r)}),n.typed=!0}else{if(o?.length===1)return o[0];R(this,"type",n,s,{issues:Mi(o)})}return n}})}function me(){return z({kind:"schema",type:"unknown",reference:me,expects:"unknown",async:!1,"~run"(t){return t.typed=!0,t}})}function Ii(t,e,n){return z({kind:"schema",type:"variant",reference:Ii,expects:"Object",async:!1,key:t,options:e,message:n,"~run"(s,i){const r=s.value;if(r&&typeof r=="object"){let o,a=0,l=this.key,c=[];const p=(d,h)=>{for(const u of d.options){if(u.type==="variant")p(u,new Set(h).add(u.key));else{let f=!0,k=0;for(const g of h){const v=u.entries[g];if(g in r?v["~run"]({typed:!1,value:r[g]},Ri).issues:v.type!=="exact_optional"&&v.type!=="optional"&&v.type!=="nullish"){f=!1,l!==g&&(a<k||a===k&&g in r&&!(l in r))&&(a=k,l=g,c=[]),l===g&&c.push(u.entries[g].expects);break}k++}if(f){const g=u["~run"]({value:r},i);(!o||!o.typed&&g.typed)&&(o=g)}}if(o&&!o.issues)break}};if(p(this,new Set([this.key])),o)return o;R(this,"type",s,i,{input:r[l],expected:_n(c,"|"),path:[{type:"object",origin:"value",input:r,key:l,value:r[l]}]})}else R(this,"type",s,i);return s}})}function Pn(t,e,n){const s=t["~run"]({value:e},Rn());if(s.issues)throw new Al(s.issues);return s.value}function w(...t){return z({...t[0],pipe:t,"~run"(e,n){for(const s of t)if(s.kind!=="metadata"){if(e.issues&&(s.kind==="schema"||s.kind==="transformation")){e.typed=!1;break}(!e.issues||!n.abortEarly&&!n.abortPipeEarly)&&(e=s["~run"](e,n))}return e}})}function T(t,e,n){const s=t["~run"]({value:e},Rn());return{typed:s.typed,success:!s.issues,output:s.value,issues:s.issues}}function Tl(t){let e="";for(const n of t){e&&(e+=`
731
- `),e+=`\xD7 ${n.message}`;const s=Sl(n);s&&(e+=`
732
- \u2192 at ${s}`)}return e}const It=L({type:w(x(),S(1)),id:w(x(),S(1))}),El=w(x(),S(1),ge(/^[A-Za-z0-9_-]+$/,'ids may only contain letters, digits, "_" and "-" (a "." builds a path)')),Rl=(t,e)=>{if(e===1)return t.includes(".")?null:[t];const n=t.split(".");return n.length===e&&n.every(s=>s.length>0)?n:null},_e=L({id:w(x(),S(1)),type:w(x(),S(1)),target:It,payload:me(),note:B(x()),createdAt:w(x(),S(1))}),_l=(t,e,n,s={})=>{const i=L({id:w(x(),S(1)),type:Re(t),target:It,payload:n,note:B(x()),createdAt:w(x(),S(1))}),r=o=>{const a=T(_e,o);if(!a.success||a.output.type!==t)return null;const l=T(n,o.payload);return l.success?{id:a.output.id,type:t,target:a.output.target,payload:l.output,...a.output.note===void 0?{}:{note:a.output.note},createdAt:a.output.createdAt}:null};return{schema:i,mode:s.mode??"patch",targetType:e,actionType:t,payloadSchema:n,parse:r,...s.dedupeKey?{dedupeKey:s.dedupeKey}:{}}},Ll=(t,e)=>{const n=Nt(t,e.type);if(n===void 0)return null;const s=n.parse(e);return s===null?null:s},Ol=(t,e)=>{const n=T(t.payloadSchema,e.payload);if(!n.success)throw new Error(`invalid payload for action "${e.type}"`);return n.output},Nt=(t,e)=>Object.hasOwn(t,e)?t[e]:void 0,Pl=t=>{throw new Error(`unhandled action: ${JSON.stringify(t)}`)},zl=L({id:w(x(),S(1))}),Ml=t=>{const e=T(zl,t.payload);return`${t.type}|${e.success?e.output.id:JSON.stringify(t.payload)}`},N=t=>`${t.type}:${t.id}`,ot=t=>{const e=t.indexOf(":");return e<=0?{type:"unknown",id:t}:{type:t.slice(0,e),id:t.slice(e+1)}},zn=(t,e)=>typeof t=="string"?ot(t.includes(":")?t:`${e}:${t}`):{type:t.type,id:t.id},Il=(t,e)=>t.type===e.type&&t.id===e.id,Ni=t=>{const e=t.normalize("NFKD").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"").slice(0,40);return e.length>0?e:"item"},Nl=(t,e)=>{const n=Ni(t),s=new Set(e);if(!s.has(n))return n;for(let i=2;i<1e3;i+=1){const r=`${n}-${i}`;if(!s.has(r))return r}return`${n}-${Math.random().toString(36).slice(2,8)}`},Di=()=>{const t=globalThis.crypto;return t?.randomUUID?t.randomUUID():`a-${Date.now().toString(36)}-${Math.random().toString(36).slice(2,10)}`},D="comment",Le=t=>{const[e]=t;return{path:e?.path?.map(n=>String(n.key)).join(".")??"",message:e?.message??"invalid action"}},ji=L({type:w(x(),S(1)),target:On([w(x(),S(1)),It]),payload:ne(me()),note:B(x()),id:B(w(x(),S(1))),createdAt:B(w(x(),S(1)))}),Dl=(t,e)=>{const n=T(ji,t);if(!n.success)return{ok:!1,issue:Le(n.issues)};const s=n.output,i=zn(s.target,e.targetType),r={id:s.id??Di(),type:s.type,target:i,payload:s.payload??{},...s.note===void 0?{}:{note:s.note},createdAt:s.createdAt??new Date().toISOString()},o=T(e.schema,r);if(!o.success)return{ok:!1,issue:Le(o.issues)};const a=T(_e,o.output);return a.success?{ok:!0,action:a.output}:{ok:!1,issue:Le(a.issues)}},Mn=(t,e)=>e.dedupeKey?e.dedupeKey(t):e.mode!=="patch"?null:`${t.type}|${N(t.target)}`,In=(t,e,n)=>{const s=Mn(e,n);if(s===null)return[...t,e];const i=t.at(-1);return!i||Mn(i,n)!==s||!jl(i,e)?[...t,e]:[...t.slice(0,-1),e]},jl=(t,e)=>Il(t.target,e.target),Nn=t=>JSON.stringify(t.map(e=>({id:e.id,type:e.type,target:e.target,payload:e.payload,...e.note===void 0?{}:{note:e.note},createdAt:e.createdAt})),null,2),qi=L({id:w(x(),S(1)),type:Re(D),target:L({type:w(x(),S(1)),id:w(x(),S(1))}),payload:L({body:w(x(),S(1))}),note:B(x()),createdAt:w(x(),S(1))}),Dn={schema:qi,mode:"append",targetType:"page"},ql=L({body:x()}),at=t=>{const e=T(ql,t.payload);return e.success?e.output.body:""},jn="element",Bi=w(x(),ge(/^[A-Z][A-Z0-9_]*$/,"component action types are CONSTANT_CASE")),Ui=Mt(x(),me()),Bl=L({type:Re(jn),id:w(x(),ge(/^[^/]+\/.+/,"component references start with a provider id"))}),Ul=L({id:w(x(),S(1)),type:Bi,target:Bl,payload:Ui,note:B(x()),createdAt:w(x(),S(1))}),Hl={schema:Ul,mode:"sequence",targetType:jn},Fl=se({type:Bi,target:w(x(),ge(/^element:[^/]+\/.+/)),payload:ne(Ui,{})}),Hi=se({id:w(x(),S(1)),title:w(x(),S(1)),summary:B(x()),tone:B(zt(["create","update","delete","move","meta"])),stale:B(zt(["unsupported-action-type","target-missing","constraint-violated"]))}),qn=t=>{if(t.type!==jn)return null;const e=t.id.indexOf("/");if(e<=0)return null;try{return decodeURIComponent(t.id.slice(0,e))}catch{return null}},Y=t=>t.type!==D&&qn(t.target)!==null,Wl=(t,e)=>t.filter(n=>Y(n)&&qn(n.target)===e),Fi=(t,e)=>{const n=new Map(t.flatMap(s=>Y(s)?[[s.id,qn(s.target)]]:[]));return new Map(e.flatMap(s=>s.results.flatMap(i=>n.get(i.id)===s.id?[[i.id,i]]:[])))},Bn=Object.freeze({}),Dt=t=>{const e=t.startsWith("#")?t.slice(1):t;if(e.length===0)return Bn;const n=new URLSearchParams(e.startsWith("?")?e.slice(1):e),s={};for(const[i,r]of n)i.length>0&&r.length>0&&(s[i]=r);return s},He=t=>{const e=new URLSearchParams;for(const s of Object.keys(t).sort((i,r)=>i<r?-1:i>r?1:0)){const i=t[s];i!=null&&i!==""&&e.set(s,i)}const n=e.toString();return n.length===0?"":`#${n}`},Un=(t,e,n=[])=>{const s={...t},i=Object.keys(e).map(r=>n.indexOf(r)).filter(r=>r>=0);if(i.length>0)for(const r of n.slice(Math.min(...i)+1))Object.hasOwn(e,r)||delete s[r];for(const[r,o]of Object.entries(e))o==null||o===""?delete s[r]:s[r]=o;return s},Vl=(t,e="json")=>`\`\`\`${e}
728
+ @keydown=${this.#l}
729
+ @blur=${this.#a}
730
+ />`}#t=e=>{e.composedPath().some(n=>n instanceof HTMLAnchorElement)||(e.stopPropagation(),!this.editing&&(this.#e=this.value,this.editing=!0))};#i=e=>{e.isComposing||this.editing||e.target instanceof HTMLAnchorElement||(e.key==="Enter"||e.key===" ")&&(e.preventDefault(),this.editing=!0)};#o=e=>{const n=je(e.target,HTMLInputElement)??je(e.target,HTMLTextAreaElement);n!==null&&(this.#e=n.value,this.requestUpdate())};#l=e=>{if(!e.isComposing){if(e.key==="Escape"){e.preventDefault(),this.#e=this.value,this.editing=!1;return}e.key==="Enter"&&(!this.multiline||this.wrap||e.metaKey||e.ctrlKey)&&(e.preventDefault(),this.#c())}};#a=e=>{const n=e.currentTarget;if(!(n instanceof HTMLInputElement||n instanceof HTMLTextAreaElement))return;const s=this.#n,{selectionStart:i,selectionEnd:r}=n;queueMicrotask(()=>{!this.isConnected||!this.editing||(s!==this.#n?(n.focus(),n.setSelectionRange(i,r)):this.#c())})};#c=()=>{if(!this.editing)return;this.editing=!1;const n=(this.wrap?this.#e.replace(/\r?\n/g," "):this.#e).trim();n!==this.value&&this.dispatchEvent(new CustomEvent("dpk-commit",{detail:{value:n},bubbles:!0,composed:!0}))}}const xl=()=>{customElements.get("dpk-component-inline-edit")||customElements.define("dpk-component-inline-edit",Ai)},yl={lang:void 0,message:void 0,abortEarly:void 0,abortPipeEarly:void 0};function _n(t){return yl}let wl;function $l(t){return wl?.get(t)}let Sl;function Al(t){return Sl?.get(t)}let Cl;function Tl(t,e){return Cl?.get(t)?.get(e)}function Ue(t){const e=typeof t;return e==="string"?`"${t}"`:e==="number"||e==="bigint"||e==="boolean"?`${t}`:e==="object"||e==="function"?(t&&Object.getPrototypeOf(t)?.constructor?.name)??"null":e}function R(t,e,n,s,i){const r=i&&"input"in i?i.input:n.value,o=i?.expected??t.expects??null,a=i?.received??Ue(r),l={kind:t.kind,type:t.type,input:r,expected:o,received:a,message:`Invalid ${e}: ${o?`Expected ${o} but r`:"R"}eceived ${a}`,requirement:t.requirement,path:i?.path,issues:i?.issues,lang:s.lang,abortEarly:s.abortEarly,abortPipeEarly:s.abortPipeEarly},c=t.kind==="schema",p=i?.message??t.message??Tl(t.reference,l.lang)??(c?Al(l.lang):null)??s.message??$l(l.lang);p!==void 0&&(l.message=typeof p=="function"?p(l):p),c&&(n.typed=!1),n.issues?n.issues.push(l):n.issues=[l]}function El(t,e){return t===e||Number.isNaN(t)&&Number.isNaN(e)}function Rl(t,e){return Object.prototype.hasOwnProperty.call(t,e)&&e!=="__proto__"&&e!=="prototype"&&e!=="constructor"}function Ln(t,e){const n=[...new Set(t)];return n.length>1?`(${n.join(` ${e} `)})`:n[0]??"never"}function z(t){return t["~standard"]={version:1,vendor:"valibot",validate:e=>t["~run"]({value:e},_n())},t}function _l(t){if(t.path){let e="";for(const n of t.path)if(typeof n.key=="string"||typeof n.key=="number")e?e+=`.${n.key}`:e+=n.key;else return null;return e}return null}var Ll=class extends Error{constructor(t){super(t[0].message),this.name="ValiError",this.issues=t}};function Ci(t,e){return{kind:"validation",type:"check",reference:Ci,async:!1,expects:null,requirement:t,message:e,"~run"(n,s){return n.typed&&!this.requirement(n.value)&&R(this,"input",n,s),n}}}function Ti(t){return{kind:"validation",type:"finite",reference:Ti,async:!1,expects:null,requirement:Number.isFinite,message:t,"~run"(e,n){return e.typed&&!this.requirement(e.value)&&R(this,"finite",e,n),e}}}function Ei(t,e){const n=Ue(t);return{kind:"validation",type:"includes",reference:Ei,async:!1,expects:n,requirement:t,message:e,"~run"(s,i){return s.typed&&!s.value.includes(this.requirement)&&R(this,"content",s,i,{received:`!${n}`}),s}}}function Ri(t){return{kind:"validation",type:"integer",reference:Ri,async:!1,expects:null,requirement:Number.isInteger,message:t,"~run"(e,n){return e.typed&&!this.requirement(e.value)&&R(this,"integer",e,n),e}}}function S(t,e){return{kind:"validation",type:"min_length",reference:S,async:!1,expects:`>=${t}`,requirement:t,message:e,"~run"(n,s){return n.typed&&n.value.length<this.requirement&&R(this,"length",n,s,{received:`${n.value.length}`}),n}}}function _i(t,e){return{kind:"validation",type:"min_value",reference:_i,async:!1,expects:`>=${t instanceof Date?t.toJSON():Ue(t)}`,requirement:t,message:e,"~run"(n,s){return n.typed&&!(n.value>=this.requirement)&&R(this,"value",n,s,{received:n.value instanceof Date?n.value.toJSON():Ue(n.value)}),n}}}function ge(t,e){return{kind:"validation",type:"regex",reference:ge,async:!1,expects:`${t}`,requirement:t,message:e,"~run"(n,s){return n.typed&&!this.requirement.test(n.value)&&R(this,"format",n,s),n}}}function On(){return{kind:"transformation",type:"trim",reference:On,async:!1,"~run"(t){return t.value=t.value.trim(),t}}}function Li(t){return{kind:"validation",type:"url",reference:Li,async:!1,expects:null,requirement(e){try{return URL.canParse?URL.canParse(e):(new URL(e),!0)}catch{return!1}},message:t,"~run"(e,n){return e.typed&&!this.requirement(e.value)&&R(this,"URL",e,n),e}}}const Oi={abortEarly:!0};function Pi(t,e,n){return typeof t.fallback=="function"?t.fallback(e,n):t.fallback}function It(t,e,n){return typeof t.default=="function"?t.default(e,n):t.default}function Ol(t,e){return!t["~run"]({value:e},Oi).issues}function F(t,e){return z({kind:"schema",type:"array",reference:F,expects:"Array",async:!1,item:t,message:e,"~run"(n,s){const i=n.value;if(Array.isArray(i)){n.typed=!0,n.value=[];for(let r=0;r<i.length;r++){const o=i[r],a=this.item["~run"]({value:o},s);if(a.issues){const l={type:"array",origin:"value",input:i,key:r,value:o};for(const c of a.issues)c.path?c.path.unshift(l):c.path=[l],n.issues?.push(c);if(n.issues||(n.issues=a.issues),s.abortEarly){n.typed=!1;break}}a.typed||(n.typed=!1),n.value.push(a.value)}}else R(this,"type",n,s);return n}})}function zi(t){return z({kind:"schema",type:"boolean",reference:zi,expects:"boolean",async:!1,message:t,"~run"(e,n){return typeof e.value=="boolean"?e.typed=!0:R(this,"type",e,n),e}})}function B(t,e){return z({kind:"schema",type:"exact_optional",reference:B,expects:t.expects,async:!1,wrapped:t,default:e,"~run"(n,s){return this.wrapped["~run"](n,s)}})}function Mi(t){return z({kind:"schema",type:"lazy",reference:Mi,expects:"unknown",async:!1,getter:t,"~run"(e,n){return this.getter(e.value)["~run"](e,n)}})}function me(t,e){return z({kind:"schema",type:"literal",reference:me,expects:Ue(t),async:!1,literal:t,message:e,"~run"(n,s){return El(n.value,this.literal)?n.typed=!0:R(this,"type",n,s),n}})}function Ii(t,e){return z({kind:"schema",type:"nullable",reference:Ii,expects:`(${t.expects} | null)`,async:!1,wrapped:t,default:e,"~run"(n,s){return n.value===null&&(this.default!==void 0&&(n.value=It(this,n,s)),n.value===null)?(n.typed=!0,n):this.wrapped["~run"](n,s)}})}function Ni(t){return z({kind:"schema",type:"number",reference:Ni,expects:"number",async:!1,message:t,"~run"(e,n){return typeof e.value=="number"&&!isNaN(e.value)?e.typed=!0:R(this,"type",e,n),e}})}function L(t,e){return z({kind:"schema",type:"object",reference:L,expects:"Object",async:!1,entries:t,message:e,"~run"(n,s){const i=n.value;if(i&&typeof i=="object"){n.typed=!0,n.value={};for(const r in this.entries){const o=this.entries[r];if(r in i||(o.type==="exact_optional"||o.type==="optional"||o.type==="nullish")&&o.default!==void 0){const a=r in i?i[r]:It(o),l=o["~run"]({value:a},s);if(l.issues){const c={type:"object",origin:"value",input:i,key:r,value:a};for(const p of l.issues)p.path?p.path.unshift(c):p.path=[c],n.issues?.push(p);if(n.issues||(n.issues=l.issues),s.abortEarly){n.typed=!1;break}}l.typed||(n.typed=!1),n.value[r]=l.value}else if(o.fallback!==void 0)n.value[r]=Pi(o);else if(o.type!=="exact_optional"&&o.type!=="optional"&&o.type!=="nullish"&&(R(this,"key",n,s,{input:void 0,expected:`"${r}"`,path:[{type:"object",origin:"key",input:i,key:r,value:i[r]}]}),s.abortEarly))break}}else R(this,"type",n,s);return n}})}function se(t,e){return z({kind:"schema",type:"optional",reference:se,expects:`(${t.expects} | undefined)`,async:!1,wrapped:t,default:e,"~run"(n,s){return n.value===void 0&&(this.default!==void 0&&(n.value=It(this,n,s)),n.value===void 0)?(n.typed=!0,n):this.wrapped["~run"](n,s)}})}function Nt(t,e){return z({kind:"schema",type:"picklist",reference:Nt,expects:Ln(t.map(Ue),"|"),async:!1,options:t,message:e,"~run"(n,s){return this.options.includes(n.value)?n.typed=!0:R(this,"type",n,s),n}})}function He(t,e,n){return z({kind:"schema",type:"record",reference:He,expects:"Object",async:!1,key:t,value:e,message:n,"~run"(s,i){const r=s.value;if(r&&typeof r=="object"){s.typed=!0,s.value={};for(const o in r)if(Rl(r,o)){const a=r[o],l=this.key["~run"]({value:o},i);if(l.issues){const p={type:"object",origin:"key",input:r,key:o,value:a};for(const d of l.issues)d.path=[p],s.issues?.push(d);if(s.issues||(s.issues=l.issues),i.abortEarly){s.typed=!1;break}}const c=this.value["~run"]({value:a},i);if(c.issues){const p={type:"object",origin:"value",input:r,key:o,value:a};for(const d of c.issues)d.path?d.path.unshift(p):d.path=[p],s.issues?.push(d);if(s.issues||(s.issues=c.issues),i.abortEarly){s.typed=!1;break}}(!l.typed||!c.typed)&&(s.typed=!1),l.typed&&(s.value[l.value]=c.value)}}else R(this,"type",s,i);return s}})}function Z(t,e){return z({kind:"schema",type:"strict_object",reference:Z,expects:"Object",async:!1,entries:t,message:e,"~run"(n,s){const i=n.value;if(i&&typeof i=="object"){n.typed=!0,n.value={};for(const r in this.entries){const o=this.entries[r];if(r in i||(o.type==="exact_optional"||o.type==="optional"||o.type==="nullish")&&o.default!==void 0){const a=r in i?i[r]:It(o),l=o["~run"]({value:a},s);if(l.issues){const c={type:"object",origin:"value",input:i,key:r,value:a};for(const p of l.issues)p.path?p.path.unshift(c):p.path=[c],n.issues?.push(p);if(n.issues||(n.issues=l.issues),s.abortEarly){n.typed=!1;break}}l.typed||(n.typed=!1),n.value[r]=l.value}else if(o.fallback!==void 0)n.value[r]=Pi(o);else if(o.type!=="exact_optional"&&o.type!=="optional"&&o.type!=="nullish"&&(R(this,"key",n,s,{input:void 0,expected:`"${r}"`,path:[{type:"object",origin:"key",input:i,key:r,value:i[r]}]}),s.abortEarly))break}if(!n.issues||!s.abortEarly){for(const r in i)if(!Object.prototype.hasOwnProperty.call(this.entries,r)){R(this,"key",n,s,{input:r,expected:"never",path:[{type:"object",origin:"key",input:i,key:r,value:i[r]}]});break}}}else R(this,"type",n,s);return n}})}function v(t){return z({kind:"schema",type:"string",reference:v,expects:"string",async:!1,message:t,"~run"(e,n){return typeof e.value=="string"?e.typed=!0:R(this,"type",e,n),e}})}function Di(t){let e;if(t)for(const n of t)if(e)for(const s of n.issues)e.push(s);else e=n.issues;return e}function Pn(t,e){return z({kind:"schema",type:"union",reference:Pn,expects:Ln(t.map(n=>n.expects),"|"),async:!1,options:t,message:e,"~run"(n,s){let i,r,o;for(const a of this.options){const l=a["~run"]({value:n.value},s);if(l.typed)if(l.issues)r?r.push(l):r=[l];else{i=l;break}else o?o.push(l):o=[l]}if(i)return i;if(r){if(r.length===1)return r[0];R(this,"type",n,s,{issues:Di(r)}),n.typed=!0}else{if(o?.length===1)return o[0];R(this,"type",n,s,{issues:Di(o)})}return n}})}function ke(){return z({kind:"schema",type:"unknown",reference:ke,expects:"unknown",async:!1,"~run"(t){return t.typed=!0,t}})}function ji(t,e,n){return z({kind:"schema",type:"variant",reference:ji,expects:"Object",async:!1,key:t,options:e,message:n,"~run"(s,i){const r=s.value;if(r&&typeof r=="object"){let o,a=0,l=this.key,c=[];const p=(d,h)=>{for(const u of d.options){if(u.type==="variant")p(u,new Set(h).add(u.key));else{let f=!0,k=0;for(const m of h){const x=u.entries[m];if(m in r?x["~run"]({typed:!1,value:r[m]},Oi).issues:x.type!=="exact_optional"&&x.type!=="optional"&&x.type!=="nullish"){f=!1,l!==m&&(a<k||a===k&&m in r&&!(l in r))&&(a=k,l=m,c=[]),l===m&&c.push(u.entries[m].expects);break}k++}if(f){const m=u["~run"]({value:r},i);(!o||!o.typed&&m.typed)&&(o=m)}}if(o&&!o.issues)break}};if(p(this,new Set([this.key])),o)return o;R(this,"type",s,i,{input:r[l],expected:Ln(c,"|"),path:[{type:"object",origin:"value",input:r,key:l,value:r[l]}]})}else R(this,"type",s,i);return s}})}function zn(t,e,n){const s=t["~run"]({value:e},_n());if(s.issues)throw new Ll(s.issues);return s.value}function w(...t){return z({...t[0],pipe:t,"~run"(e,n){for(const s of t)if(s.kind!=="metadata"){if(e.issues&&(s.kind==="schema"||s.kind==="transformation")){e.typed=!1;break}(!e.issues||!n.abortEarly&&!n.abortPipeEarly)&&(e=s["~run"](e,n))}return e}})}function C(t,e,n){const s=t["~run"]({value:e},_n());return{typed:s.typed,success:!s.issues,output:s.value,issues:s.issues}}function Pl(t){let e="";for(const n of t){e&&(e+=`
731
+ `),e+=`\xD7 ${n.message}`;const s=_l(n);s&&(e+=`
732
+ \u2192 at ${s}`)}return e}const Dt=L({type:w(v(),S(1)),id:w(v(),S(1))}),zl=w(v(),S(1),ge(/^[A-Za-z0-9_-]+$/,'ids may only contain letters, digits, "_" and "-" (a "." builds a path)')),Ml=(t,e)=>{if(e===1)return t.includes(".")?null:[t];const n=t.split(".");return n.length===e&&n.every(s=>s.length>0)?n:null},_e=L({id:w(v(),S(1)),type:w(v(),S(1)),target:Dt,payload:ke(),note:B(v()),createdAt:w(v(),S(1))}),Il=(t,e,n,s={})=>{const i=L({id:w(v(),S(1)),type:me(t),target:Dt,payload:n,note:B(v()),createdAt:w(v(),S(1))}),r=o=>{const a=C(_e,o);if(!a.success||a.output.type!==t)return null;const l=C(n,o.payload);return l.success?{id:a.output.id,type:t,target:a.output.target,payload:l.output,...a.output.note===void 0?{}:{note:a.output.note},createdAt:a.output.createdAt}:null};return{schema:i,mode:s.mode??"patch",targetType:e,actionType:t,payloadSchema:n,parse:r,...s.dedupeKey?{dedupeKey:s.dedupeKey}:{}}},Nl=(t,e)=>{const n=jt(t,e.type);if(n===void 0)return null;const s=n.parse(e);return s===null?null:s},Dl=(t,e)=>{const n=C(t.payloadSchema,e.payload);if(!n.success)throw new Error(`invalid payload for action "${e.type}"`);return n.output},jt=(t,e)=>Object.hasOwn(t,e)?t[e]:void 0,jl=t=>{throw new Error(`unhandled action: ${JSON.stringify(t)}`)},ql=L({id:w(v(),S(1))}),Bl=t=>{const e=C(ql,t.payload);return`${t.type}|${e.success?e.output.id:JSON.stringify(t.payload)}`},N=t=>`${t.type}:${t.id}`,at=t=>{const e=t.indexOf(":");return e<=0?{type:"unknown",id:t}:{type:t.slice(0,e),id:t.slice(e+1)}},Mn=(t,e)=>typeof t=="string"?at(t.includes(":")?t:`${e}:${t}`):{type:t.type,id:t.id},Ul=(t,e)=>t.type===e.type&&t.id===e.id,qi=t=>{const e=t.normalize("NFKD").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"").slice(0,40);return e.length>0?e:"item"},Hl=(t,e)=>{const n=qi(t),s=new Set(e);if(!s.has(n))return n;for(let i=2;i<1e3;i+=1){const r=`${n}-${i}`;if(!s.has(r))return r}return`${n}-${Math.random().toString(36).slice(2,8)}`},Bi=()=>{const t=globalThis.crypto;return t?.randomUUID?t.randomUUID():`a-${Date.now().toString(36)}-${Math.random().toString(36).slice(2,10)}`},D="comment",Le=t=>{const[e]=t;return{path:e?.path?.map(n=>String(n.key)).join(".")??"",message:e?.message??"invalid action"}},Ui=L({type:w(v(),S(1)),target:Pn([w(v(),S(1)),Dt]),payload:se(ke()),note:B(v()),id:B(w(v(),S(1))),createdAt:B(w(v(),S(1)))}),Fl=(t,e)=>{const n=C(Ui,t);if(!n.success)return{ok:!1,issue:Le(n.issues)};const s=n.output,i=Mn(s.target,e.targetType),r={id:s.id??Bi(),type:s.type,target:i,payload:s.payload??{},...s.note===void 0?{}:{note:s.note},createdAt:s.createdAt??new Date().toISOString()},o=C(e.schema,r);if(!o.success)return{ok:!1,issue:Le(o.issues)};const a=C(_e,o.output);return a.success?{ok:!0,action:a.output}:{ok:!1,issue:Le(a.issues)}},In=(t,e)=>e.dedupeKey?e.dedupeKey(t):e.mode!=="patch"?null:`${t.type}|${N(t.target)}`,Nn=(t,e,n)=>{const s=In(e,n);if(s===null)return[...t,e];const i=t.at(-1);return!i||In(i,n)!==s||!Wl(i,e)?[...t,e]:[...t.slice(0,-1),e]},Wl=(t,e)=>Ul(t.target,e.target),Dn=t=>JSON.stringify(t.map(e=>({id:e.id,type:e.type,target:e.target,payload:e.payload,...e.note===void 0?{}:{note:e.note},createdAt:e.createdAt})),null,2),Hi=L({id:w(v(),S(1)),type:me(D),target:L({type:w(v(),S(1)),id:w(v(),S(1))}),payload:L({body:w(v(),S(1))}),note:B(v()),createdAt:w(v(),S(1))}),jn={schema:Hi,mode:"append",targetType:"page"},Vl=L({body:v()}),lt=t=>{const e=C(Vl,t.payload);return e.success?e.output.body:""},qn="element",Fi=w(v(),ge(/^[A-Z][A-Z0-9_]*$/,"component action types are CONSTANT_CASE")),Wi=He(v(),ke()),Kl=L({type:me(qn),id:w(v(),ge(/^[^/]+\/.+/,"component references start with a provider id"))}),Gl=L({id:w(v(),S(1)),type:Fi,target:Kl,payload:Wi,note:B(v()),createdAt:w(v(),S(1))}),Zl={schema:Gl,mode:"sequence",targetType:qn},Yl=Z({type:Fi,target:w(v(),ge(/^element:[^/]+\/.+/)),payload:se(Wi,{})}),Vi=Z({id:w(v(),S(1)),title:w(v(),S(1)),summary:B(v()),tone:B(Nt(["create","update","delete","move","meta"])),stale:B(Nt(["unsupported-action-type","target-missing","constraint-violated"]))}),Bn=t=>{if(t.type!==qn)return null;const e=t.id.indexOf("/");if(e<=0)return null;try{return decodeURIComponent(t.id.slice(0,e))}catch{return null}},J=t=>t.type!==D&&Bn(t.target)!==null,Jl=(t,e)=>t.filter(n=>J(n)&&Bn(n.target)===e),Ki=(t,e)=>{const n=new Map(t.flatMap(s=>J(s)?[[s.id,Bn(s.target)]]:[]));return new Map(e.flatMap(s=>s.results.flatMap(i=>n.get(i.id)===s.id?[[i.id,i]]:[])))},Un=Object.freeze({}),qt=t=>{const e=t.startsWith("#")?t.slice(1):t;if(e.length===0)return Un;const n=new URLSearchParams(e.startsWith("?")?e.slice(1):e),s={};for(const[i,r]of n)i.length>0&&r.length>0&&(s[i]=r);return s},Fe=t=>{const e=new URLSearchParams;for(const s of Object.keys(t).sort((i,r)=>i<r?-1:i>r?1:0)){const i=t[s];i!=null&&i!==""&&e.set(s,i)}const n=e.toString();return n.length===0?"":`#${n}`},Hn=(t,e,n=[])=>{const s={...t},i=Object.keys(e).map(r=>n.indexOf(r)).filter(r=>r>=0);if(i.length>0)for(const r of n.slice(Math.min(...i)+1))Object.hasOwn(e,r)||delete s[r];for(const[r,o]of Object.entries(e))o==null||o===""?delete s[r]:s[r]=o;return s},Xl=(t,e="json")=>`\`\`\`${e}
733
733
  ${t}
734
- \`\`\``,Kl=t=>JSON.stringify({type:t.type,target:t.target,payload:t.payload,...t.note===void 0?{}:{note:t.note}},null,2),Hn=(t,e,n)=>{const{actions:s,state:i}=t,r=new Set(t.stale.map(p=>p.action.id)),o=s.filter(p=>!r.has(p.id)),a=o.filter(p=>p.type===D),l=o.filter(p=>p.type!==D),c=[];if(c.push(`# Review draft \u2014 ${e.label}`),c.push(""),c.push(`- template: \`${e.name}\``),c.push(`- framework: \`dev-process-kit@${n}\``),c.push(`- navigation: \`${He(t.navigation)||"(none)"}\``),c.push(`- pending: ${l.length} change(s), ${a.length} comment(s)`),t.stale.length>0&&c.push(`- stale (not applicable to the current base): ${t.stale.length}`),c.push(""),c.push("## How to apply"),c.push(""),c.push("These are patches against the base HTML, not a command log. Apply the requested end state to the meaning model, keep the stable ids of surviving concepts, and keep the base JSON free of any draft envelope."),l.some(Y)&&(c.push(""),c.push("Changes targeting `element:<id>/\u2026` belong to the component with that `id` (for example a diagram): apply them to that component's own JSON, following its documented action vocabulary.")),c.push(""),a.length>0){c.push(`## Comments (${a.length})`),c.push("");for(const[p,d]of a.entries()){const h=e.describe(d,i,t.base);c.push(`${p+1}. **${h.targetLabel}** \u2014 \`${N(d.target)}\``),c.push(` > ${at(d).replace(/\n/g,`
734
+ \`\`\``,Ql=t=>JSON.stringify({type:t.type,target:t.target,payload:t.payload,...t.note===void 0?{}:{note:t.note}},null,2),Fn=(t,e,n)=>{const{actions:s,state:i}=t,r=new Set(t.stale.map(p=>p.action.id)),o=s.filter(p=>!r.has(p.id)),a=o.filter(p=>p.type===D),l=o.filter(p=>p.type!==D),c=[];if(c.push(`# Review draft \u2014 ${e.label}`),c.push(""),c.push(`- template: \`${e.name}\``),c.push(`- framework: \`dev-process-kit@${n}\``),c.push(`- navigation: \`${Fe(t.navigation)||"(none)"}\``),c.push(`- pending: ${l.length} change(s), ${a.length} comment(s)`),t.stale.length>0&&c.push(`- stale (not applicable to the current base): ${t.stale.length}`),c.push(""),c.push("## How to apply"),c.push(""),c.push("These are patches against the base HTML, not a command log. Apply the requested end state to the meaning model, keep the stable ids of surviving concepts, and keep the base JSON free of any draft envelope."),l.some(J)&&(c.push(""),c.push("Changes targeting `element:<id>/\u2026` belong to the component with that `id` (for example a diagram): apply them to that component's own JSON, following its documented action vocabulary.")),c.push(""),a.length>0){c.push(`## Comments (${a.length})`),c.push("");for(const[p,d]of a.entries()){const h=e.describe(d,i,t.base);c.push(`${p+1}. **${h.targetLabel}** \u2014 \`${N(d.target)}\``),c.push(` > ${lt(d).replace(/\n/g,`
735
735
  > `)}`)}c.push("")}if(l.length>0){c.push(`## Requested changes (${l.length})`),c.push("");for(const[p,d]of l.entries()){const h=e.describe(d,i,t.base),u=h.summary?` \u2014 ${h.summary}`:"";c.push(`${p+1}. **${h.title}**${u}`),c.push(` target: \`${N(d.target)}\` (${d.target.type})`),c.push(` \`\`\`json
736
- ${Kl(d).replace(/\n/g,`
736
+ ${Ql(d).replace(/\n/g,`
737
737
  `)}
738
- \`\`\``)}c.push("")}if(l.length===0&&a.length===0&&(c.push("_No pending draft actions._"),c.push("")),t.stale.length>0){c.push(`## Not applicable to the current base (${t.stale.length})`),c.push(""),c.push("These actions were made against an earlier base and no longer fit it. Do not apply them; mention them if they still matter. The reader can remove them from the review rail."),c.push("");for(const[p,{action:d,reason:h}]of t.stale.entries()){const u=e.describe(d,i,t.base),f=d.type===D?at(d):u.title;c.push(`${p+1}. \`${d.type}\` on \`${N(d.target)}\` (${h}) \u2014 ${f}`)}c.push("")}return c.push("## Canonical draft (JSON)"),c.push(""),c.push(Vl(Nn(s))),c.push(""),c.join(`
739
- `)},J="0.0.14",Fn=async t=>{try{if(navigator.clipboard?.writeText)return await navigator.clipboard.writeText(t),!0}catch{}const e=document.activeElement,n=document.createElement("textarea");try{return n.value=t,n.setAttribute("readonly",""),n.style.position="fixed",n.style.opacity="0",document.body.append(n),n.select(),document.execCommand("copy")}catch{return!1}finally{n.remove(),e instanceof HTMLElement&&e.focus()}},Wi=Ct({en:{heading:"Review notes",rejected:"Action rejected.",commentLabel:"Review comment",commentPlaceholder:"What should change, or what you noticed (passed to the agent as an instruction)",detach:"Detach",attachTo:t=>`Attach to this ${t}`,addNote:"Add note",empty:"No draft actions yet.",emptyHint:"Comments and structural patches both land here, and survive reload via LocalStorage.",sendToClaude:"Send to Claude",copy:"Copy changes & comments",copyTitle:"Copy the review to paste it to the agent",clear:"Clear",deleteAction:"Delete this draft action",editComment:"Edit this comment",editLabel:"Edit the comment",saveEdit:"Save",cancelEdit:"Cancel",editHint:"Ctrl/Cmd + Enter to save, Esc to cancel",wholePage:"Whole page",comment:"Comment",sent:"Sent to Claude \u2713",copied:"Copied \u2713",copyFailed:"Could not copy"},ja:{heading:"\u30EC\u30D3\u30E5\u30FC\u30CE\u30FC\u30C8",rejected:"action \u3092\u53D7\u3051\u4ED8\u3051\u3089\u308C\u307E\u305B\u3093\u3067\u3057\u305F\u3002",commentLabel:"\u30EC\u30D3\u30E5\u30FC\u30B3\u30E1\u30F3\u30C8",commentPlaceholder:"\u5909\u66F4\u3057\u305F\u3044\u3053\u3068 / \u6C17\u3065\u304D\u3092\u66F8\u304F\uFF08Agent \u3078\u306E\u6307\u793A\u3068\u3057\u3066\u6E21\u308B\uFF09",detach:"\u7D10\u3065\u3051\u3092\u89E3\u9664",attachTo:t=>`\u3053\u306E ${t} \u306B\u7D10\u3065\u3051\u308B`,addNote:"\u30CE\u30FC\u30C8\u3092\u8FFD\u52A0",empty:"draft action \u306F\u307E\u3060\u3042\u308A\u307E\u305B\u3093\u3002",emptyHint:"\u30B3\u30E1\u30F3\u30C8\u3082\u69CB\u9020\u306E\u5909\u66F4\u3082\u3053\u3053\u306B\u96C6\u307E\u308A\u3001LocalStorage \u306B\u6B8B\u308B\u306E\u3067\u30EA\u30ED\u30FC\u30C9\u3057\u3066\u3082\u6D88\u3048\u307E\u305B\u3093\u3002",sendToClaude:"Claude \u306B\u9001\u308B",copy:"\u5909\u66F4\u30FB\u30B3\u30E1\u30F3\u30C8\u3092\u30B3\u30D4\u30FC",copyTitle:"Review \u3092\u30B3\u30D4\u30FC\u3057\u3066 Agent \u306B\u8CBC\u308A\u4ED8\u3051\u308B",clear:"\u30AF\u30EA\u30A2",deleteAction:"\u3053\u306E draft action \u3092\u524A\u9664",editComment:"\u3053\u306E\u30B3\u30E1\u30F3\u30C8\u3092\u7DE8\u96C6",editLabel:"\u30B3\u30E1\u30F3\u30C8\u3092\u7DE8\u96C6",saveEdit:"\u4FDD\u5B58",cancelEdit:"\u30AD\u30E3\u30F3\u30BB\u30EB",editHint:"Ctrl/Cmd + Enter \u3067\u4FDD\u5B58\u3001Esc \u3067\u30AD\u30E3\u30F3\u30BB\u30EB",wholePage:"\u30DA\u30FC\u30B8\u5168\u4F53",comment:"\u30B3\u30E1\u30F3\u30C8",sent:"Claude \u306B\u9001\u308A\u307E\u3057\u305F \u2713",copied:"\u30B3\u30D4\u30FC\u3057\u307E\u3057\u305F \u2713",copyFailed:"\u30B3\u30D4\u30FC\u3067\u304D\u307E\u305B\u3093\u3067\u3057\u305F"}}),Zl=()=>({body:"",editing:null,attachment:{kind:"page"},copy:{kind:"idle"},copyRequest:0,send:{kind:"idle"},sendRequest:0}),Vi=t=>t.kind==="explicit"?{kind:t.resume}:t,Ki=(t,e)=>{switch(e.kind){case"input":return{...t,body:e.body};case"attach":return{...t,attachment:{kind:e.current?"current":"page"}};case"clear-target":return{...t,attachment:Vi(t.attachment)};case"edit-start":return{...t,editing:{id:e.id,body:e.body}};case"edit-input":return t.editing?{...t,editing:{...t.editing,body:e.body}}:t;case"edit-cancel":case"edited":return{...t,editing:null};case"target-requested":return{...t,attachment:{kind:"explicit",ref:e.ref,resume:t.attachment.kind==="explicit"?t.attachment.resume:t.attachment.kind}};case"submitted":return{...t,body:"",attachment:Vi(t.attachment),copy:{kind:"idle"},copyRequest:t.copyRequest+1,send:{kind:"idle"},sendRequest:t.sendRequest+1};case"copy-started":return{...t,copy:{kind:"pending"},copyRequest:t.copyRequest+1,send:{kind:"idle"},sendRequest:t.sendRequest+1};case"copy-finished":return e.request!==t.copyRequest||t.copy.kind!=="pending"?t:{...t,copy:{kind:e.ok?"copied":"failed"}};case"send-started":return{...t,send:{kind:"pending"},sendRequest:t.sendRequest+1,copy:{kind:"idle"},copyRequest:t.copyRequest+1};case"send-finished":return e.request!==t.sendRequest||t.send.kind!=="pending"?t:{...t,send:e.outcome.ok?{kind:"sent"}:{kind:"failed",reason:e.outcome.reason}}}},Gl=(t,e)=>{const n=t.body.trim();return n===""?null:{target:e,body:n}},Yl=t=>{if(!t.editing)return null;const e=t.editing.body.trim();return e===""?null:{id:t.editing.id,body:e}},Jl={en:"English",ja:"\u65E5\u672C\u8A9E"},F=Ct({en:{review:"Review",reviewToggle:"Review / comments",useLightTheme:"Switch to light theme",useDarkTheme:"Switch to dark theme",language:"Language",versionLabel:"dev-process-kit version (reloads the page)",versionPinned:"Pinned by the page",versionLatest:t=>`${t} (latest)`,resizeSidebar:"Resize sidebar",resizeSidebarHint:"Drag to resize. Double-click to reset",collapseSidebar:"Collapse sidebar",expandSidebar:"Expand sidebar",baseDataError:"Could not read the base data (showing an empty page)",memo:"Memo",draftCount:(t,e)=>`${t} ${t===1?"change":"changes"} \xB7 ${e} ${e===1?"note":"notes"}`,handoffTooLarge:"The review is too long to send. Copy it and paste it instead",handoffConsent:"Commenting needs your permission. Allow it, then send again",handoffForbidden:"This page cannot send to Claude. Copy the review and paste it instead",handoffClaudeUnavailable:"Could not reach the Claude session. Copy the review and paste it instead",handoffRateLimited:"Too many sends in a row. Wait a moment, then send again",handoffStorage:"Could not save the review. Copy it and paste it instead",handoffError:"Could not send. Copy the review and paste it instead",handoffLabel:"Hand the review to the agent",handoffSend:"Send to Claude",handoffSending:"Sending\u2026",handoffSent:"Sent to Claude \u2713",handoffCopy:"Copy changes & comments",handoffCopyTitle:"Copy the review to paste it to the agent",handoffCopied:"Copied \u2713",handoffCopyFailed:"Could not copy",changes:"Updates",changesUnread:t=>`Updates (${t} new)`,changesTitle:"Changed in this version",changesNew:"New",changesShow:"Show",changesDismiss:"Dismiss",changesWaiting:t=>`${t} more`,changesSeeAll:"See all",changesError:"Could not read the change log"},ja:{review:"\u30EC\u30D3\u30E5\u30FC",reviewToggle:"\u30EC\u30D3\u30E5\u30FC / \u30B3\u30E1\u30F3\u30C8",useLightTheme:"\u30E9\u30A4\u30C8\u30C6\u30FC\u30DE\u306B\u3059\u308B",useDarkTheme:"\u30C0\u30FC\u30AF\u30C6\u30FC\u30DE\u306B\u3059\u308B",language:"\u8A00\u8A9E",versionLabel:"dev-process-kit \u306E\u30D0\u30FC\u30B8\u30E7\u30F3\uFF08\u30DA\u30FC\u30B8\u3092\u518D\u8AAD\u307F\u8FBC\u307F\u3057\u307E\u3059\uFF09",versionPinned:"\u30DA\u30FC\u30B8\u6307\u5B9A\u306E\u30D0\u30FC\u30B8\u30E7\u30F3",versionLatest:t=>`${t}\uFF08\u6700\u65B0\uFF09`,resizeSidebar:"\u30B5\u30A4\u30C9\u30D0\u30FC\u306E\u5E45\u3092\u5909\u66F4",resizeSidebarHint:"\u30C9\u30E9\u30C3\u30B0\u3067\u5E45\u3092\u5909\u66F4\u3002\u30C0\u30D6\u30EB\u30AF\u30EA\u30C3\u30AF\u3067\u5143\u306B\u623B\u3059",collapseSidebar:"\u30B5\u30A4\u30C9\u30D0\u30FC\u3092\u6298\u308A\u305F\u305F\u3080",expandSidebar:"\u30B5\u30A4\u30C9\u30D0\u30FC\u3092\u958B\u304F",baseDataError:"base data \u3092\u8AAD\u307F\u8FBC\u3081\u307E\u305B\u3093\u3067\u3057\u305F\uFF08\u7A7A\u306E\u30DA\u30FC\u30B8\u3068\u3057\u3066\u8868\u793A\u4E2D\uFF09",memo:"\u30E1\u30E2",draftCount:(t,e)=>`\u5909\u66F4 ${t} \xB7 \u30B3\u30E1\u30F3\u30C8 ${e}`,handoffTooLarge:"Review \u304C\u9577\u3059\u304E\u3066\u9001\u308C\u307E\u305B\u3093\u3002\u30B3\u30D4\u30FC\u3057\u3066\u6E21\u3057\u3066\u304F\u3060\u3055\u3044",handoffConsent:"\u30B3\u30E1\u30F3\u30C8\u306E\u8A31\u53EF\u304C\u5FC5\u8981\u3067\u3059\u3002\u8A31\u53EF\u3057\u3066\u304B\u3089\u3082\u3046\u4E00\u5EA6\u9001\u3063\u3066\u304F\u3060\u3055\u3044",handoffForbidden:"\u3053\u306E\u30DA\u30FC\u30B8\u304B\u3089\u306F\u9001\u308C\u307E\u305B\u3093\u3002\u30B3\u30D4\u30FC\u3057\u3066\u6E21\u3057\u3066\u304F\u3060\u3055\u3044",handoffClaudeUnavailable:"Claude \u306E\u30BB\u30C3\u30B7\u30E7\u30F3\u306B\u5C4A\u304D\u307E\u305B\u3093\u3067\u3057\u305F\u3002\u30B3\u30D4\u30FC\u3057\u3066\u6E21\u3057\u3066\u304F\u3060\u3055\u3044",handoffRateLimited:"\u9001\u4FE1\u304C\u7D9A\u3044\u3066\u3044\u307E\u3059\u3002\u5C11\u3057\u5F85\u3063\u3066\u304B\u3089\u9001\u3063\u3066\u304F\u3060\u3055\u3044",handoffStorage:"Review \u3092\u4FDD\u5B58\u3067\u304D\u307E\u305B\u3093\u3067\u3057\u305F\u3002\u30B3\u30D4\u30FC\u3057\u3066\u6E21\u3057\u3066\u304F\u3060\u3055\u3044",handoffError:"\u9001\u308C\u307E\u305B\u3093\u3067\u3057\u305F\u3002\u30B3\u30D4\u30FC\u3057\u3066\u6E21\u3057\u3066\u304F\u3060\u3055\u3044",handoffLabel:"Review \u3092 Agent \u306B\u6E21\u3059",handoffSend:"Claude \u306B\u9001\u308B",handoffSending:"\u9001\u4FE1\u4E2D\u2026",handoffSent:"Claude \u306B\u9001\u308A\u307E\u3057\u305F \u2713",handoffCopy:"\u5909\u66F4\u30FB\u30B3\u30E1\u30F3\u30C8\u3092\u30B3\u30D4\u30FC",handoffCopyTitle:"Review \u3092\u30B3\u30D4\u30FC\u3057\u3066 Agent \u306B\u8CBC\u308A\u4ED8\u3051\u308B",handoffCopied:"\u30B3\u30D4\u30FC\u3057\u307E\u3057\u305F \u2713",handoffCopyFailed:"\u30B3\u30D4\u30FC\u3067\u304D\u307E\u305B\u3093\u3067\u3057\u305F",changes:"\u66F4\u65B0\u306E\u304A\u77E5\u3089\u305B",changesUnread:t=>`\u66F4\u65B0\u306E\u304A\u77E5\u3089\u305B\uFF08\u65B0\u7740 ${t} \u4EF6\uFF09`,changesTitle:"\u3053\u306E\u7248\u3067\u306E\u5909\u66F4",changesNew:"\u65B0\u7740",changesShow:"\u898B\u308B",changesDismiss:"\u9589\u3058\u308B",changesWaiting:t=>`\u307B\u304B ${t} \u4EF6`,changesSeeAll:"\u3059\u3079\u3066\u898B\u308B",changesError:"\u5909\u66F4\u306E\u4E00\u89A7\u3092\u8AAD\u307F\u8FBC\u3081\u307E\u305B\u3093\u3067\u3057\u305F"}}),Xl=4096,Ql="reviews",Zi="Review from the page (dev-process-kit). Apply it to the base data and republish this artifact. Then answer with ArtifactComments `reply` in this thread: the reader sees only this thread, and the page never shows anything written to the database.",ec=t=>new TextEncoder().encode(t).length,tc=t=>t.replace(/[\u0000-\u0008\u000B-\u001F\u007F]/g,""),nc=t=>{const e=`${Zi}
738
+ \`\`\``)}c.push("")}if(l.length===0&&a.length===0&&(c.push("_No pending draft actions._"),c.push("")),t.stale.length>0){c.push(`## Not applicable to the current base (${t.stale.length})`),c.push(""),c.push("These actions were made against an earlier base and no longer fit it. Do not apply them; mention them if they still matter. The reader can remove them from the review rail."),c.push("");for(const[p,{action:d,reason:h}]of t.stale.entries()){const u=e.describe(d,i,t.base),f=d.type===D?lt(d):u.title;c.push(`${p+1}. \`${d.type}\` on \`${N(d.target)}\` (${h}) \u2014 ${f}`)}c.push("")}return c.push("## Canonical draft (JSON)"),c.push(""),c.push(Xl(Dn(s))),c.push(""),c.join(`
739
+ `)},X="0.0.16",Wn=async t=>{try{if(navigator.clipboard?.writeText)return await navigator.clipboard.writeText(t),!0}catch{}const e=document.activeElement,n=document.createElement("textarea");try{return n.value=t,n.setAttribute("readonly",""),n.style.position="fixed",n.style.opacity="0",document.body.append(n),n.select(),document.execCommand("copy")}catch{return!1}finally{n.remove(),e instanceof HTMLElement&&e.focus()}},Gi=Rt({en:{heading:"Review notes",rejected:"Action rejected.",commentLabel:"Review comment",commentPlaceholder:"What should change, or what you noticed (passed to the agent as an instruction)",detach:"Detach",attachTo:t=>`Attach to this ${t}`,addNote:"Add note",empty:"No draft actions yet.",emptyHint:"Comments and structural patches both land here, and survive reload via LocalStorage.",sendToClaude:"Send to Claude",copy:"Copy changes & comments",copyTitle:"Copy the review to paste it to the agent",clear:"Clear",deleteAction:"Delete this draft action",editComment:"Edit this comment",editLabel:"Edit the comment",saveEdit:"Save",cancelEdit:"Cancel",editHint:"Ctrl/Cmd + Enter to save, Esc to cancel",wholePage:"Whole page",comment:"Comment",sent:"Sent to Claude \u2713",copied:"Copied \u2713",copyFailed:"Could not copy"},ja:{heading:"\u30EC\u30D3\u30E5\u30FC\u30CE\u30FC\u30C8",rejected:"action \u3092\u53D7\u3051\u4ED8\u3051\u3089\u308C\u307E\u305B\u3093\u3067\u3057\u305F\u3002",commentLabel:"\u30EC\u30D3\u30E5\u30FC\u30B3\u30E1\u30F3\u30C8",commentPlaceholder:"\u5909\u66F4\u3057\u305F\u3044\u3053\u3068 / \u6C17\u3065\u304D\u3092\u66F8\u304F\uFF08Agent \u3078\u306E\u6307\u793A\u3068\u3057\u3066\u6E21\u308B\uFF09",detach:"\u7D10\u3065\u3051\u3092\u89E3\u9664",attachTo:t=>`\u3053\u306E ${t} \u306B\u7D10\u3065\u3051\u308B`,addNote:"\u30CE\u30FC\u30C8\u3092\u8FFD\u52A0",empty:"draft action \u306F\u307E\u3060\u3042\u308A\u307E\u305B\u3093\u3002",emptyHint:"\u30B3\u30E1\u30F3\u30C8\u3082\u69CB\u9020\u306E\u5909\u66F4\u3082\u3053\u3053\u306B\u96C6\u307E\u308A\u3001LocalStorage \u306B\u6B8B\u308B\u306E\u3067\u30EA\u30ED\u30FC\u30C9\u3057\u3066\u3082\u6D88\u3048\u307E\u305B\u3093\u3002",sendToClaude:"Claude \u306B\u9001\u308B",copy:"\u5909\u66F4\u30FB\u30B3\u30E1\u30F3\u30C8\u3092\u30B3\u30D4\u30FC",copyTitle:"Review \u3092\u30B3\u30D4\u30FC\u3057\u3066 Agent \u306B\u8CBC\u308A\u4ED8\u3051\u308B",clear:"\u30AF\u30EA\u30A2",deleteAction:"\u3053\u306E draft action \u3092\u524A\u9664",editComment:"\u3053\u306E\u30B3\u30E1\u30F3\u30C8\u3092\u7DE8\u96C6",editLabel:"\u30B3\u30E1\u30F3\u30C8\u3092\u7DE8\u96C6",saveEdit:"\u4FDD\u5B58",cancelEdit:"\u30AD\u30E3\u30F3\u30BB\u30EB",editHint:"Ctrl/Cmd + Enter \u3067\u4FDD\u5B58\u3001Esc \u3067\u30AD\u30E3\u30F3\u30BB\u30EB",wholePage:"\u30DA\u30FC\u30B8\u5168\u4F53",comment:"\u30B3\u30E1\u30F3\u30C8",sent:"Claude \u306B\u9001\u308A\u307E\u3057\u305F \u2713",copied:"\u30B3\u30D4\u30FC\u3057\u307E\u3057\u305F \u2713",copyFailed:"\u30B3\u30D4\u30FC\u3067\u304D\u307E\u305B\u3093\u3067\u3057\u305F"}}),ec=()=>({body:"",editing:null,attachment:{kind:"page"},copy:{kind:"idle"},copyRequest:0,send:{kind:"idle"},sendRequest:0}),Zi=t=>t.kind==="explicit"?{kind:t.resume}:t,Yi=(t,e)=>{switch(e.kind){case"input":return{...t,body:e.body};case"attach":return{...t,attachment:{kind:e.current?"current":"page"}};case"clear-target":return{...t,attachment:Zi(t.attachment)};case"edit-start":return{...t,editing:{id:e.id,body:e.body}};case"edit-input":return t.editing?{...t,editing:{...t.editing,body:e.body}}:t;case"edit-cancel":case"edited":return{...t,editing:null};case"target-requested":return{...t,attachment:{kind:"explicit",ref:e.ref,resume:t.attachment.kind==="explicit"?t.attachment.resume:t.attachment.kind}};case"submitted":return{...t,body:"",attachment:Zi(t.attachment),copy:{kind:"idle"},copyRequest:t.copyRequest+1,send:{kind:"idle"},sendRequest:t.sendRequest+1};case"copy-started":return{...t,copy:{kind:"pending"},copyRequest:t.copyRequest+1,send:{kind:"idle"},sendRequest:t.sendRequest+1};case"copy-finished":return e.request!==t.copyRequest||t.copy.kind!=="pending"?t:{...t,copy:{kind:e.ok?"copied":"failed"}};case"send-started":return{...t,send:{kind:"pending"},sendRequest:t.sendRequest+1,copy:{kind:"idle"},copyRequest:t.copyRequest+1};case"send-finished":return e.request!==t.sendRequest||t.send.kind!=="pending"?t:{...t,send:e.outcome.ok?{kind:"sent"}:{kind:"failed",reason:e.outcome.reason}}}},tc=(t,e)=>{const n=t.body.trim();return n===""?null:{target:e,body:n}},nc=t=>{if(!t.editing)return null;const e=t.editing.body.trim();return e===""?null:{id:t.editing.id,body:e}},sc={en:"English",ja:"\u65E5\u672C\u8A9E"},W=Rt({en:{review:"Review",reviewToggle:"Review / comments",useLightTheme:"Switch to light theme",useDarkTheme:"Switch to dark theme",language:"Language",versionLabel:"dev-process-kit version (reloads the page)",versionPinned:"Pinned by the page",versionLatest:t=>`${t} (latest)`,resizeSidebar:"Resize sidebar",resizeSidebarHint:"Drag to resize. Double-click to reset",collapseSidebar:"Collapse sidebar",expandSidebar:"Expand sidebar",baseDataError:"Could not read the base data (showing an empty page)",memo:"Memo",draftCount:(t,e)=>`${t} ${t===1?"change":"changes"} \xB7 ${e} ${e===1?"note":"notes"}`,handoffTooLarge:"The review is too long to send. Copy it and paste it instead",handoffConsent:"Commenting needs your permission. Allow it, then send again",handoffForbidden:"This page cannot send to Claude. Copy the review and paste it instead",handoffClaudeUnavailable:"Could not reach the Claude session. Copy the review and paste it instead",handoffRateLimited:"Too many sends in a row. Wait a moment, then send again",handoffStorage:"Could not save the review. Copy it and paste it instead",handoffError:"Could not send. Copy the review and paste it instead",handoffLabel:"Hand the review to the agent",handoffSend:"Send to Claude",handoffSending:"Sending\u2026",handoffSent:"Sent to Claude \u2713",handoffCopy:"Copy changes & comments",handoffCopyTitle:"Copy the review to paste it to the agent",handoffCopied:"Copied \u2713",handoffCopyFailed:"Could not copy",changes:"Updates",changesUnread:t=>`Updates (${t} new)`,changesTitle:"Changes by version",changesCurrent:"This version",changesReadAll:"Mark all as read",changesNew:"New",changesShow:"Show",changesDismiss:"Dismiss",changesWaiting:t=>`${t} more`,changesSeeAll:"See all",changesError:"Could not read the change log"},ja:{review:"\u30EC\u30D3\u30E5\u30FC",reviewToggle:"\u30EC\u30D3\u30E5\u30FC / \u30B3\u30E1\u30F3\u30C8",useLightTheme:"\u30E9\u30A4\u30C8\u30C6\u30FC\u30DE\u306B\u3059\u308B",useDarkTheme:"\u30C0\u30FC\u30AF\u30C6\u30FC\u30DE\u306B\u3059\u308B",language:"\u8A00\u8A9E",versionLabel:"dev-process-kit \u306E\u30D0\u30FC\u30B8\u30E7\u30F3\uFF08\u30DA\u30FC\u30B8\u3092\u518D\u8AAD\u307F\u8FBC\u307F\u3057\u307E\u3059\uFF09",versionPinned:"\u30DA\u30FC\u30B8\u6307\u5B9A\u306E\u30D0\u30FC\u30B8\u30E7\u30F3",versionLatest:t=>`${t}\uFF08\u6700\u65B0\uFF09`,resizeSidebar:"\u30B5\u30A4\u30C9\u30D0\u30FC\u306E\u5E45\u3092\u5909\u66F4",resizeSidebarHint:"\u30C9\u30E9\u30C3\u30B0\u3067\u5E45\u3092\u5909\u66F4\u3002\u30C0\u30D6\u30EB\u30AF\u30EA\u30C3\u30AF\u3067\u5143\u306B\u623B\u3059",collapseSidebar:"\u30B5\u30A4\u30C9\u30D0\u30FC\u3092\u6298\u308A\u305F\u305F\u3080",expandSidebar:"\u30B5\u30A4\u30C9\u30D0\u30FC\u3092\u958B\u304F",baseDataError:"base data \u3092\u8AAD\u307F\u8FBC\u3081\u307E\u305B\u3093\u3067\u3057\u305F\uFF08\u7A7A\u306E\u30DA\u30FC\u30B8\u3068\u3057\u3066\u8868\u793A\u4E2D\uFF09",memo:"\u30E1\u30E2",draftCount:(t,e)=>`\u5909\u66F4 ${t} \xB7 \u30B3\u30E1\u30F3\u30C8 ${e}`,handoffTooLarge:"Review \u304C\u9577\u3059\u304E\u3066\u9001\u308C\u307E\u305B\u3093\u3002\u30B3\u30D4\u30FC\u3057\u3066\u6E21\u3057\u3066\u304F\u3060\u3055\u3044",handoffConsent:"\u30B3\u30E1\u30F3\u30C8\u306E\u8A31\u53EF\u304C\u5FC5\u8981\u3067\u3059\u3002\u8A31\u53EF\u3057\u3066\u304B\u3089\u3082\u3046\u4E00\u5EA6\u9001\u3063\u3066\u304F\u3060\u3055\u3044",handoffForbidden:"\u3053\u306E\u30DA\u30FC\u30B8\u304B\u3089\u306F\u9001\u308C\u307E\u305B\u3093\u3002\u30B3\u30D4\u30FC\u3057\u3066\u6E21\u3057\u3066\u304F\u3060\u3055\u3044",handoffClaudeUnavailable:"Claude \u306E\u30BB\u30C3\u30B7\u30E7\u30F3\u306B\u5C4A\u304D\u307E\u305B\u3093\u3067\u3057\u305F\u3002\u30B3\u30D4\u30FC\u3057\u3066\u6E21\u3057\u3066\u304F\u3060\u3055\u3044",handoffRateLimited:"\u9001\u4FE1\u304C\u7D9A\u3044\u3066\u3044\u307E\u3059\u3002\u5C11\u3057\u5F85\u3063\u3066\u304B\u3089\u9001\u3063\u3066\u304F\u3060\u3055\u3044",handoffStorage:"Review \u3092\u4FDD\u5B58\u3067\u304D\u307E\u305B\u3093\u3067\u3057\u305F\u3002\u30B3\u30D4\u30FC\u3057\u3066\u6E21\u3057\u3066\u304F\u3060\u3055\u3044",handoffError:"\u9001\u308C\u307E\u305B\u3093\u3067\u3057\u305F\u3002\u30B3\u30D4\u30FC\u3057\u3066\u6E21\u3057\u3066\u304F\u3060\u3055\u3044",handoffLabel:"Review \u3092 Agent \u306B\u6E21\u3059",handoffSend:"Claude \u306B\u9001\u308B",handoffSending:"\u9001\u4FE1\u4E2D\u2026",handoffSent:"Claude \u306B\u9001\u308A\u307E\u3057\u305F \u2713",handoffCopy:"\u5909\u66F4\u30FB\u30B3\u30E1\u30F3\u30C8\u3092\u30B3\u30D4\u30FC",handoffCopyTitle:"Review \u3092\u30B3\u30D4\u30FC\u3057\u3066 Agent \u306B\u8CBC\u308A\u4ED8\u3051\u308B",handoffCopied:"\u30B3\u30D4\u30FC\u3057\u307E\u3057\u305F \u2713",handoffCopyFailed:"\u30B3\u30D4\u30FC\u3067\u304D\u307E\u305B\u3093\u3067\u3057\u305F",changes:"\u66F4\u65B0\u306E\u304A\u77E5\u3089\u305B",changesUnread:t=>`\u66F4\u65B0\u306E\u304A\u77E5\u3089\u305B\uFF08\u65B0\u7740 ${t} \u4EF6\uFF09`,changesTitle:"\u7248\u3054\u3068\u306E\u5909\u66F4",changesCurrent:"\u3053\u306E\u7248",changesReadAll:"\u3059\u3079\u3066\u65E2\u8AAD\u306B\u3059\u308B",changesNew:"\u65B0\u7740",changesShow:"\u898B\u308B",changesDismiss:"\u9589\u3058\u308B",changesWaiting:t=>`\u307B\u304B ${t} \u4EF6`,changesSeeAll:"\u3059\u3079\u3066\u898B\u308B",changesError:"\u5909\u66F4\u306E\u4E00\u89A7\u3092\u8AAD\u307F\u8FBC\u3081\u307E\u305B\u3093\u3067\u3057\u305F"}}),ic=4096,rc="reviews",Ji="Review from the page (dev-process-kit). Apply it to the base data and republish this artifact. Then answer with ArtifactComments `reply` in this thread: the reader sees only this thread, and the page never shows anything written to the database.",oc=t=>new TextEncoder().encode(t).length,ac=t=>t.replace(/[\u0000-\u0008\u000B-\u001F\u007F]/g,""),lc=t=>{const e=`${Ji}
740
740
 
741
- ${tc(t)}`;return ec(e)<=Xl?e:null},sc=t=>`${Zi}
741
+ ${ac(t)}`;return oc(e)<=ic?e:null},cc=t=>`${Ji}
742
742
 
743
- The brief is too long for a comment, so it is stored in this artifact's database: read the document \`${t}\` (\`brief\` is the review, \`draft\` the raw draft JSON).`,ic={consent_required:"consent",forbidden:"forbidden",not_granted:"forbidden",capability_disabled:"forbidden",capability_removed:"forbidden",claude_unavailable:"claude_unavailable",rate_limited:"rate_limited"},rc=t=>{const e=typeof t=="object"&&t!==null&&"code"in t?t.code:void 0;return(typeof e=="string"?ic[e]:void 0)??"error"},oc={too_large:"handoffTooLarge",consent:"handoffConsent",forbidden:"handoffForbidden",claude_unavailable:"handoffClaudeUnavailable",rate_limited:"handoffRateLimited",storage:"handoffStorage",error:"handoffError"},Wn=(t,e)=>F(e)[oc[t]],Gi=t=>t.group?`${t.group} \xB7 ${t.label}`:t.label,Yi=(t,e)=>{const{definition:n,state:s,navigation:i,derivation:r}=t,o=Wi(t.locale),a=n.currentTarget?.(s,i)??null,l=e.attachment,c=l.kind==="explicit"?n.commentTargets(s,i).find(h=>h.value===l.ref):null,p=l.kind==="explicit"?{ref:l.ref,label:c?Gi(c):l.ref}:l.kind==="current"&&a?{ref:a.value,label:Gi(a)}:{ref:`page:${n.name}`,label:o.wholePage},d=new Map(r.stale.map(h=>[h.action.id,h.reason]));return{body:e.body,target:p,attachment:l.kind==="explicit"?{kind:"explicit"}:a?{kind:"checkbox",checked:l.kind==="current",group:a.group??""}:{kind:"none"},canSubmit:e.body.trim().length>0,items:r.actions.map(h=>{const u=n.describe(h,s,r.base),f=h.type==="comment";return{id:h.id,title:f?o.comment:u.title,targetLabel:u.targetLabel,tone:f?"comment":u.tone,text:{kind:f?"comment":"summary",body:f?at(h):u.summary??""},code:f?null:n.serialize(h),stale:d.get(h.id)??null,edit:!f||t.editable!==!0?{kind:"none"}:e.editing?.id===h.id?{kind:"editing",body:e.editing.body,canSave:e.editing.body.trim().length>0}:{kind:"available"}}}),issues:t.issues.map(h=>`${h.path?`${h.path}: `:""}${h.message}`),send:t.sendable!==!0?"hidden":r.actions.length===0||e.send.kind==="pending"?"disabled":"ready",flash:e.send.kind==="sent"?o.sent:e.send.kind==="failed"?Wn(e.send.reason,t.locale):e.copy.kind==="copied"?o.copied:e.copy.kind==="failed"?o.copyFailed:""}},ac=[Tt,xn,de`
743
+ The brief is too long for a comment, so it is stored in this artifact's database: read the document \`${t}\` (\`brief\` is the review, \`draft\` the raw draft JSON).`,dc={consent_required:"consent",forbidden:"forbidden",not_granted:"forbidden",capability_disabled:"forbidden",capability_removed:"forbidden",claude_unavailable:"claude_unavailable",rate_limited:"rate_limited"},pc=t=>{const e=typeof t=="object"&&t!==null&&"code"in t?t.code:void 0;return(typeof e=="string"?dc[e]:void 0)??"error"},hc={too_large:"handoffTooLarge",consent:"handoffConsent",forbidden:"handoffForbidden",claude_unavailable:"handoffClaudeUnavailable",rate_limited:"handoffRateLimited",storage:"handoffStorage",error:"handoffError"},Vn=(t,e)=>W(e)[hc[t]],Xi=t=>t.group?`${t.group} \xB7 ${t.label}`:t.label,Qi=(t,e)=>{const{definition:n,state:s,navigation:i,derivation:r}=t,o=Gi(t.locale),a=n.currentTarget?.(s,i)??null,l=e.attachment,c=l.kind==="explicit"?n.commentTargets(s,i).find(h=>h.value===l.ref):null,p=l.kind==="explicit"?{ref:l.ref,label:c?Xi(c):l.ref}:l.kind==="current"&&a?{ref:a.value,label:Xi(a)}:{ref:`page:${n.name}`,label:o.wholePage},d=new Map(r.stale.map(h=>[h.action.id,h.reason]));return{body:e.body,target:p,attachment:l.kind==="explicit"?{kind:"explicit"}:a?{kind:"checkbox",checked:l.kind==="current",group:a.group??""}:{kind:"none"},canSubmit:e.body.trim().length>0,items:r.actions.map(h=>{const u=n.describe(h,s,r.base),f=h.type==="comment";return{id:h.id,title:f?o.comment:u.title,targetLabel:u.targetLabel,tone:f?"comment":u.tone,text:{kind:f?"comment":"summary",body:f?lt(h):u.summary??""},code:f?null:n.serialize(h),stale:d.get(h.id)??null,edit:!f||t.editable!==!0?{kind:"none"}:e.editing?.id===h.id?{kind:"editing",body:e.editing.body,canSave:e.editing.body.trim().length>0}:{kind:"available"}}}),issues:t.issues.map(h=>`${h.path?`${h.path}: `:""}${h.message}`),send:t.sendable!==!0?"hidden":r.actions.length===0||e.send.kind==="pending"?"disabled":"ready",flash:e.send.kind==="sent"?o.sent:e.send.kind==="failed"?Vn(e.send.reason,t.locale):e.copy.kind==="copied"?o.copied:e.copy.kind==="failed"?o.copyFailed:""}},uc=[_t,xn,de`
744
744
  :host {
745
745
  display: flex;
746
746
  flex-direction: column;
@@ -1129,7 +1129,7 @@ The brief is too long for a comment, so it is stored in this artifact's database
1129
1129
  letter-spacing: 0.04em;
1130
1130
  color: var(--dpk-green);
1131
1131
  }
1132
- `],Ji=(t,e,n)=>{const s=new Map;for(let i=e;i<=n;i++)s.set(t[i],i);return s},jt=Qe(class extends wt{constructor(t){if(super(t),t.type!==ue.CHILD)throw Error("repeat() can only be used in text expressions")}dt(t,e,n){let s;n===void 0?n=e:e!==void 0&&(s=e);const i=[],r=[];let o=0;for(const a of t)i[o]=s?s(a,o):o,r[o]=n(a,o),o++;return{values:r,keys:i}}render(t,e,n){return this.dt(t,e,n).values}update(t,[e,n,s]){const i=ia(t),{values:r,keys:o}=this.dt(e,n,s);if(!Array.isArray(i))return this.ut=o,r;const a=this.ut??=[],l=[];let c,p,d=0,h=i.length-1,u=0,f=r.length-1;for(;d<=h&&u<=f;)if(i[d]===null)d++;else if(i[h]===null)h--;else if(a[d]===o[u])l[u]=Se(i[d],r[u]),d++,u++;else if(a[h]===o[f])l[f]=Se(i[h],r[f]),h--,f--;else if(a[d]===o[f])l[f]=Se(i[d],r[f]),et(t,l[f+1],i[d]),d++,f--;else if(a[h]===o[u])l[u]=Se(i[h],r[u]),et(t,i[d],i[h]),h--,u++;else if(c===void 0&&(c=Ji(o,u,f),p=Ji(a,d,h)),c.has(a[d]))if(c.has(a[h])){const k=p.get(o[u]),g=k!==void 0?i[k]:null;if(g===null){const v=et(t,i[d]);Se(v,r[u]),l[u]=v}else l[u]=Se(g,r[u]),et(t,i[d],g),i[k]=null;u++}else fn(i[h]),h--;else fn(i[d]),d++;for(;u<=f;){const k=et(t,l[f+1]);Se(k,r[u]),l[u++]=k}for(;d<=h;){const k=i[d++];k!==null&&fn(k)}return this.ut=o,un(t,l),H}});class Vn extends $t{}Vn.directiveName="unsafeSVG",Vn.resultType=2;const lc=Qe(Vn),Xi=[["path",{d:"M12 5v14"}],["path",{d:"m19 12-7 7-7-7"}]],Qi=[["path",{d:"m12 19-7-7 7-7"}],["path",{d:"M19 12H5"}]],er=[["path",{d:"M5 12h14"}],["path",{d:"m12 5 7 7-7 7"}]],tr=[["path",{d:"m5 12 7-7 7 7"}],["path",{d:"M12 19V5"}]],cc=[["path",{d:"M10.268 21a2 2 0 0 0 3.464 0"}],["path",{d:"M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326"}]],dc=[["path",{d:"M20 6 9 17l-5-5"}]],pc=[["path",{d:"m6 9 6 6 6-6"}]],hc=[["path",{d:"m15 18-6-6 6-6"}]],uc=[["path",{d:"m9 18 6-6-6-6"}]],fc=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2"}]],gc=[["circle",{cx:"9",cy:"12",r:"1"}],["circle",{cx:"9",cy:"5",r:"1"}],["circle",{cx:"9",cy:"19",r:"1"}],["circle",{cx:"15",cy:"12",r:"1"}],["circle",{cx:"15",cy:"5",r:"1"}],["circle",{cx:"15",cy:"19",r:"1"}]],mc=[["path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"}],["path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"}]],kc=[["path",{d:"M15 3h6v6"}],["path",{d:"m21 3-7 7"}],["path",{d:"m3 21 7-7"}],["path",{d:"M9 21H3v-6"}]],bc=[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z"}]],xc=[["path",{d:"m14 10 7-7"}],["path",{d:"M20 10h-6V4"}],["path",{d:"m3 21 7-7"}],["path",{d:"M4 14h6v6"}]],vc=[["path",{d:"M5 12h14"}]],yc=[["path",{d:"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401"}]],wc=[["path",{d:"M12 2v20"}],["path",{d:"m15 19-3 3-3-3"}],["path",{d:"m19 9 3 3-3 3"}],["path",{d:"M2 12h20"}],["path",{d:"m5 9-3 3 3 3"}],["path",{d:"m9 5 3-3 3 3"}]],$c=[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z"}],["path",{d:"m15 5 4 4"}]],Sc=[["path",{d:"M5 12h14"}],["path",{d:"M12 5v14"}]],Ac=[["circle",{cx:"12",cy:"12",r:"4"}],["path",{d:"M12 2v2"}],["path",{d:"M12 20v2"}],["path",{d:"m4.93 4.93 1.41 1.41"}],["path",{d:"m17.66 17.66 1.41 1.41"}],["path",{d:"M2 12h2"}],["path",{d:"M20 12h2"}],["path",{d:"m6.34 17.66-1.41 1.41"}],["path",{d:"m19.07 4.93-1.41 1.41"}]],Cc=[["path",{d:"M10 11v6"}],["path",{d:"M14 11v6"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6"}],["path",{d:"M3 6h18"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"}]],Tc=[["path",{d:"M18 6 6 18"}],["path",{d:"m6 6 12 12"}]],Ec=t=>t.replaceAll("&","&amp;").replaceAll('"',"&quot;"),Rc=t=>t.map(([e,n])=>`<${e}${Object.entries(n).map(([s,i])=>` ${s}="${Ec(String(i))}"`).join("")}></${e}>`).join(""),_=t=>{const e=Rc(t);return()=>b`<svg
1132
+ `],er=(t,e,n)=>{const s=new Map;for(let i=e;i<=n;i++)s.set(t[i],i);return s},ct=et(class extends At{constructor(t){if(super(t),t.type!==ue.CHILD)throw Error("repeat() can only be used in text expressions")}dt(t,e,n){let s;n===void 0?n=e:e!==void 0&&(s=e);const i=[],r=[];let o=0;for(const a of t)i[o]=s?s(a,o):o,r[o]=n(a,o),o++;return{values:r,keys:i}}render(t,e,n){return this.dt(t,e,n).values}update(t,[e,n,s]){const i=da(t),{values:r,keys:o}=this.dt(e,n,s);if(!Array.isArray(i))return this.ut=o,r;const a=this.ut??=[],l=[];let c,p,d=0,h=i.length-1,u=0,f=r.length-1;for(;d<=h&&u<=f;)if(i[d]===null)d++;else if(i[h]===null)h--;else if(a[d]===o[u])l[u]=Ae(i[d],r[u]),d++,u++;else if(a[h]===o[f])l[f]=Ae(i[h],r[f]),h--,f--;else if(a[d]===o[f])l[f]=Ae(i[d],r[f]),tt(t,l[f+1],i[d]),d++,f--;else if(a[h]===o[u])l[u]=Ae(i[h],r[u]),tt(t,i[d],i[h]),h--,u++;else if(c===void 0&&(c=er(o,u,f),p=er(a,d,h)),c.has(a[d]))if(c.has(a[h])){const k=p.get(o[u]),m=k!==void 0?i[k]:null;if(m===null){const x=tt(t,i[d]);Ae(x,r[u]),l[u]=x}else l[u]=Ae(m,r[u]),tt(t,i[d],m),i[k]=null;u++}else gn(i[h]),h--;else gn(i[d]),d++;for(;u<=f;){const k=tt(t,l[f+1]);Ae(k,r[u]),l[u++]=k}for(;d<=h;){const k=i[d++];k!==null&&gn(k)}return this.ut=o,fn(t,l),H}});class Kn extends Ct{}Kn.directiveName="unsafeSVG",Kn.resultType=2;const fc=et(Kn),tr=[["path",{d:"M12 5v14"}],["path",{d:"m19 12-7 7-7-7"}]],nr=[["path",{d:"m12 19-7-7 7-7"}],["path",{d:"M19 12H5"}]],sr=[["path",{d:"M5 12h14"}],["path",{d:"m12 5 7 7-7 7"}]],ir=[["path",{d:"m5 12 7-7 7 7"}],["path",{d:"M12 19V5"}]],gc=[["path",{d:"M10.268 21a2 2 0 0 0 3.464 0"}],["path",{d:"M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326"}]],mc=[["path",{d:"M20 6 9 17l-5-5"}]],rr=[["path",{d:"m6 9 6 6 6-6"}]],kc=[["path",{d:"m15 18-6-6 6-6"}]],bc=[["path",{d:"m9 18 6-6-6-6"}]],vc=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2"}]],xc=[["circle",{cx:"9",cy:"12",r:"1"}],["circle",{cx:"9",cy:"5",r:"1"}],["circle",{cx:"9",cy:"19",r:"1"}],["circle",{cx:"15",cy:"12",r:"1"}],["circle",{cx:"15",cy:"5",r:"1"}],["circle",{cx:"15",cy:"19",r:"1"}]],yc=[["path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"}],["path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"}]],wc=[["path",{d:"M15 3h6v6"}],["path",{d:"m21 3-7 7"}],["path",{d:"m3 21 7-7"}],["path",{d:"M9 21H3v-6"}]],$c=[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z"}]],Sc=[["path",{d:"m14 10 7-7"}],["path",{d:"M20 10h-6V4"}],["path",{d:"m3 21 7-7"}],["path",{d:"M4 14h6v6"}]],Ac=[["path",{d:"M5 12h14"}]],Cc=[["path",{d:"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401"}]],Tc=[["path",{d:"M12 2v20"}],["path",{d:"m15 19-3 3-3-3"}],["path",{d:"m19 9 3 3-3 3"}],["path",{d:"M2 12h20"}],["path",{d:"m5 9-3 3 3 3"}],["path",{d:"m9 5 3-3 3 3"}]],Ec=[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z"}],["path",{d:"m15 5 4 4"}]],Rc=[["path",{d:"M5 12h14"}],["path",{d:"M12 5v14"}]],_c=[["circle",{cx:"12",cy:"12",r:"4"}],["path",{d:"M12 2v2"}],["path",{d:"M12 20v2"}],["path",{d:"m4.93 4.93 1.41 1.41"}],["path",{d:"m17.66 17.66 1.41 1.41"}],["path",{d:"M2 12h2"}],["path",{d:"M20 12h2"}],["path",{d:"m6.34 17.66-1.41 1.41"}],["path",{d:"m19.07 4.93-1.41 1.41"}]],Lc=[["path",{d:"M10 11v6"}],["path",{d:"M14 11v6"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6"}],["path",{d:"M3 6h18"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"}]],Oc=[["path",{d:"M18 6 6 18"}],["path",{d:"m6 6 12 12"}]],Pc=t=>t.replaceAll("&","&amp;").replaceAll('"',"&quot;"),zc=t=>t.map(([e,n])=>`<${e}${Object.entries(n).map(([s,i])=>` ${s}="${Pc(String(i))}"`).join("")}></${e}>`).join(""),_=t=>{const e=zc(t);return()=>b`<svg
1133
1133
  viewBox="0 0 24 24"
1134
1134
  fill="none"
1135
1135
  stroke="currentColor"
@@ -1139,15 +1139,15 @@ The brief is too long for a comment, so it is stored in this artifact's database
1139
1139
  aria-hidden="true"
1140
1140
  focusable="false"
1141
1141
  >
1142
- ${lc(e)}
1143
- </svg>`},qt=_(Tc),nr=_(Cc),Kn=_($c),Zn=_(bc),sr=_(mc),_c=_(fc),Lc=_(dc),ir=_(Sc),Oc=_(vc),Pc=_(gc),rr=_(wc),zc=_(tr),Mc=_(Xi);_(Qi),_(er);const or=_(hc),Gn=_(uc),Ic=_(pc),Nc=_(kc),Dc=_(xc),jc=_(Ac),qc=_(yc),ar=_(cc),Bc=t=>{switch(t){case"comment":return Zn();case"create":return ir();case"update":return Kn();case"delete":return nr();case"move":return rr();default:return sr()}},Uc=(t,e,n,s=!1)=>b`
1144
- ${s?m:b`<header><h2>${t.heading}</h2></header>`}
1142
+ ${fc(e)}
1143
+ </svg>`},Bt=_(Oc),or=_(Lc),Gn=_(Ec),Zn=_($c),ar=_(yc),Mc=_(vc),Ic=_(mc),lr=_(Rc),Nc=_(Ac),Dc=_(xc),cr=_(Tc),jc=_(ir),qc=_(tr);_(nr),_(sr);const dr=_(kc),Yn=_(bc),Bc=_(rr),Uc=_(wc),Hc=_(Sc),Fc=_(_c),Wc=_(Cc),pr=_(gc),Vc=t=>{switch(t){case"comment":return Zn();case"create":return lr();case"update":return Gn();case"delete":return or();case"move":return cr();default:return ar()}},Kc=(t,e,n,s=!1)=>b`
1144
+ ${s?g:b`<header><h2>${t.heading}</h2></header>`}
1145
1145
  ${e.issues.length>0?b`<div class="issues" role="alert">
1146
1146
  <strong>${t.rejected}</strong>
1147
1147
  <ul>
1148
1148
  ${e.issues.map(i=>b`<li>${i}</li>`)}
1149
1149
  </ul>
1150
- </div>`:m}
1150
+ </div>`:g}
1151
1151
  <div class="composer">
1152
1152
  <textarea
1153
1153
  class="dpk-textarea"
@@ -1159,7 +1159,7 @@ The brief is too long for a comment, so it is stored in this artifact's database
1159
1159
  ></textarea>
1160
1160
  ${e.attachment.kind==="explicit"?b`<div class="row">
1161
1161
  <button class="chip" type="button" aria-label=${t.detach} @click=${()=>n({kind:"clear-target"})}>
1162
- ${e.target.label} ${qt()}
1162
+ ${e.target.label} ${Bt()}
1163
1163
  </button>
1164
1164
  </div>`:e.attachment.kind==="checkbox"?b`<div class="row">
1165
1165
  <label class="attach">
@@ -1170,7 +1170,7 @@ The brief is too long for a comment, so it is stored in this artifact's database
1170
1170
  />
1171
1171
  <span>${t.attachTo(e.attachment.group)}</span>
1172
1172
  </label>
1173
- </div>`:m}
1173
+ </div>`:g}
1174
1174
  <div class="row">
1175
1175
  <span class="target-line">→ ${e.target.label}</span>
1176
1176
  <button
@@ -1190,10 +1190,10 @@ The brief is too long for a comment, so it is stored in this artifact's database
1190
1190
  <p>${t.empty}</p>
1191
1191
  <p class="empty-hint">${t.emptyHint}</p>
1192
1192
  </div>
1193
- </li>`:jt(e.items,i=>i.id,i=>Hc(t,i,n))}
1193
+ </li>`:ct(e.items,i=>i.id,i=>Gc(t,i,n))}
1194
1194
  </ul>
1195
1195
  <footer>
1196
- ${s||e.send==="hidden"?m:b`<button
1196
+ ${s||e.send==="hidden"?g:b`<button
1197
1197
  class="dpk-btn dpk-btn--accent"
1198
1198
  type="button"
1199
1199
  ?disabled=${e.send==="disabled"}
@@ -1202,7 +1202,7 @@ The brief is too long for a comment, so it is stored in this artifact's database
1202
1202
  ${t.sendToClaude}
1203
1203
  </button>`}
1204
1204
  <div class="footer-actions">
1205
- ${s?m:b`<button
1205
+ ${s?g:b`<button
1206
1206
  class=${e.send==="hidden"?"dpk-btn dpk-btn--accent":"dpk-btn"}
1207
1207
  type="button"
1208
1208
  title=${t.copyTitle}
@@ -1220,14 +1220,14 @@ The brief is too long for a comment, so it is stored in this artifact's database
1220
1220
  ${t.clear}
1221
1221
  </button>
1222
1222
  </div>
1223
- ${e.flash?b`<span class="flash" role="status">${e.flash}</span>`:m}
1223
+ ${e.flash?b`<span class="flash" role="status">${e.flash}</span>`:g}
1224
1224
  </footer>
1225
- `,Hc=(t,e,n)=>b`
1225
+ `,Gc=(t,e,n)=>b`
1226
1226
  <li class="item" data-tone=${e.tone} data-stale=${String(e.stale!==null)} data-id=${e.id}>
1227
1227
  <div class="item-head">
1228
- <span class="item-icon">${Bc(e.tone)}</span>
1228
+ <span class="item-icon">${Vc(e.tone)}</span>
1229
1229
  <span class="item-title">${e.title}</span>
1230
- ${e.stale?b`<span class="stale-badge">${e.stale}</span>`:m}
1230
+ ${e.stale?b`<span class="stale-badge">${e.stale}</span>`:g}
1231
1231
  ${e.edit.kind==="available"?b`<button
1232
1232
  class="dpk-icon-btn item-edit"
1233
1233
  type="button"
@@ -1235,22 +1235,22 @@ The brief is too long for a comment, so it is stored in this artifact's database
1235
1235
  title=${t.editComment}
1236
1236
  @click=${()=>n({kind:"edit-start",id:e.id,body:e.text.body})}
1237
1237
  >
1238
- ${Kn()}
1239
- </button>`:m}
1238
+ ${Gn()}
1239
+ </button>`:g}
1240
1240
  <button
1241
1241
  class="dpk-icon-btn"
1242
1242
  type="button"
1243
1243
  aria-label=${t.deleteAction}
1244
1244
  @click=${()=>n({kind:"delete",id:e.id})}
1245
1245
  >
1246
- ${qt()}
1246
+ ${Bt()}
1247
1247
  </button>
1248
1248
  </div>
1249
1249
  <div class="item-target">${e.targetLabel}</div>
1250
- ${e.edit.kind==="editing"?Fc(t,e.edit,n):e.text.kind==="comment"?b`<p class="item-body">${e.text.body}</p>`:e.text.body?b`<div class="item-summary">${e.text.body}</div>`:m}
1251
- ${e.code===null?m:b`<code class="item-code">${e.code}</code>`}
1250
+ ${e.edit.kind==="editing"?Zc(t,e.edit,n):e.text.kind==="comment"?b`<p class="item-body">${e.text.body}</p>`:e.text.body?b`<div class="item-summary">${e.text.body}</div>`:g}
1251
+ ${e.code===null?g:b`<code class="item-code">${e.code}</code>`}
1252
1252
  </li>
1253
- `,Fc=(t,e,n)=>b`
1253
+ `,Zc=(t,e,n)=>b`
1254
1254
  <div class="item-editor">
1255
1255
  <textarea
1256
1256
  class="dpk-textarea"
@@ -1274,8 +1274,8 @@ The brief is too long for a comment, so it is stored in this artifact's database
1274
1274
  </button>
1275
1275
  </div>
1276
1276
  </div>
1277
- `;class lr extends he{static{this.styles=ac}static{this.properties={definition:{attribute:!1},state:{attribute:!1},navigation:{attribute:!1},derivation:{attribute:!1},issues:{attribute:!1},pendingTarget:{attribute:!1},onDelete:{attribute:!1},onClear:{attribute:!1},onComment:{attribute:!1},onEditComment:{attribute:!1},exportBrief:{attribute:!1},sendToClaude:{attribute:!1},embedded:{type:Boolean}}}#e=Zl();#n=null;#s=new bn(this);constructor(){super(),this.embedded=!1,this.definition=null,this.state=void 0,this.navigation={},this.derivation=null,this.issues=[],this.pendingTarget=null}willUpdate(e){e.has("pendingTarget")&&this.pendingTarget&&(this.#e=Ki(this.#e,{kind:"target-requested",ref:this.pendingTarget}))}updated(e){e.has("pendingTarget")&&this.pendingTarget&&this.isConnected&&this.renderRoot.querySelector("textarea")?.focus();const n=this.#n;n&&(this.#n=null,[...this.renderRoot.querySelectorAll(".item")].find(i=>i.dataset.id===n.id)?.querySelector(n.kind==="editor"?".item-editor textarea":".item-edit")?.focus())}#r(){return!this.definition||!this.derivation?null:{definition:this.definition,state:this.state,navigation:this.navigation,derivation:this.derivation,issues:this.issues,sendable:this.sendToClaude!==void 0,editable:this.onEditComment!==void 0,locale:this.#s.locale}}render(){const e=this.#r();return e?Uc(Wi(this.#s.locale),Yi(e,this.#e),this.#i,this.embedded):m}#t(e){this.#e=Ki(this.#e,e),this.requestUpdate()}#i=e=>{switch(e.kind){case"delete":this.onDelete?.(e.id);return;case"clear":this.onClear?.();return;case"copy":this.#a();return;case"send":this.#o();return;case"edit-start":this.#n={kind:"editor",id:e.id},this.#t(e);return;case"edit-cancel":{const n=this.#e.editing;n&&(this.#n={kind:"edit-button",id:n.id}),this.#t(e);return}case"edit-save":{const n=Yl(this.#e);if(!n||!this.onEditComment||!this.onEditComment(n.id,n.body).ok)return;this.#n={kind:"edit-button",id:n.id},this.#t({kind:"edited"});return}case"submit":{const n=this.#r();if(!n||!this.onComment)return;const s=Gl(this.#e,Yi(n,this.#e).target.ref);if(!s||!this.onComment(s.target,s.body).ok)return;this.#t({kind:"submitted"});return}default:this.#t(e)}};async#o(){const e=this.sendToClaude;if(!e||this.#e.send.kind==="pending")return;this.#t({kind:"send-started"});const n=this.#e.sendRequest,s=await e().catch(()=>({ok:!1,reason:"error"}));this.isConnected&&this.#t({kind:"send-finished",request:n,outcome:s})}async#a(){const e=this.#r();if(!e)return;this.#t({kind:"copy-started"});const n=this.#e.copyRequest;try{const s=this.exportBrief?.()??Hn({...e.derivation,navigation:e.navigation,issues:e.issues},e.definition,J),i=await Fn(s);this.isConnected&&this.#t({kind:"copy-finished",request:n,ok:i})}catch{this.isConnected&&this.#t({kind:"copy-finished",request:n,ok:!1})}}}const Wc=()=>{customElements.get("dpk-component-comment-panel")||customElements.define("dpk-component-comment-panel",lr)},Fe=Math.min,ie=Math.max,Bt=Math.round,Ut=Math.floor,re=t=>({x:t,y:t}),Vc={left:"right",right:"left",bottom:"top",top:"bottom"};function Kc(t,e,n){return ie(t,Fe(e,n))}function lt(t,e){return typeof t=="function"?t(e):t}function Oe(t){return t.split("-")[0]}function ct(t){return t.split("-")[1]}function cr(t){return t==="x"?"y":"x"}function dr(t){return t==="y"?"height":"width"}function oe(t){const e=t[0];return e==="t"||e==="b"?"y":"x"}function pr(t){return cr(oe(t))}function Zc(t,e,n){n===void 0&&(n=!1);const s=ct(t),i=pr(t),r=dr(i);let o=i==="x"?s===(n?"end":"start")?"right":"left":s==="start"?"bottom":"top";return e.reference[r]>e.floating[r]&&(o=Ht(o)),[o,Ht(o)]}function Gc(t){const e=Ht(t);return[Yn(t),e,Yn(e)]}function Yn(t){return t.includes("start")?t.replace("start","end"):t.replace("end","start")}const hr=["left","right"],ur=["right","left"],Yc=["top","bottom"],Jc=["bottom","top"];function Xc(t,e,n){switch(t){case"top":case"bottom":return n?e?ur:hr:e?hr:ur;case"left":case"right":return e?Yc:Jc;default:return[]}}function Qc(t,e,n,s){const i=ct(t);let r=Xc(Oe(t),n==="start",s);return i&&(r=r.map(o=>o+"-"+i),e&&(r=r.concat(r.map(Yn)))),r}function Ht(t){const e=Oe(t);return Vc[e]+t.slice(e.length)}function ed(t){var e,n,s,i;return{top:(e=t.top)!=null?e:0,right:(n=t.right)!=null?n:0,bottom:(s=t.bottom)!=null?s:0,left:(i=t.left)!=null?i:0}}function td(t){return typeof t!="number"?ed(t):{top:t,right:t,bottom:t,left:t}}function Ft(t){const{x:e,y:n,width:s,height:i}=t;return{width:s,height:i,top:n,left:e,right:e+s,bottom:n+i,x:e,y:n}}function fr(t,e,n){let{reference:s,floating:i}=t;const r=oe(e),o=pr(e),a=dr(o),l=Oe(e),c=r==="y",p=s.x+s.width/2-i.width/2,d=s.y+s.height/2-i.height/2,h=s[a]/2-i[a]/2;let u;switch(l){case"top":u={x:p,y:s.y-i.height};break;case"bottom":u={x:p,y:s.y+s.height};break;case"right":u={x:s.x+s.width,y:d};break;case"left":u={x:s.x-i.width,y:d};break;default:u={x:s.x,y:s.y}}const f=ct(e);return f&&(u[o]+=h*(f==="end"?1:-1)*(n&&c?-1:1)),u}async function nd(t,e){var n;e===void 0&&(e={});const{x:s,y:i,platform:r,rects:o,elements:a,strategy:l}=t,{boundary:c="clippingAncestors",rootBoundary:p="viewport",elementContext:d="floating",altBoundary:h=!1,padding:u=0}=lt(e,t),f=td(u),g=a[h?d==="floating"?"reference":"floating":d],v=Ft(await r.getClippingRect({element:(n=await(r.isElement==null?void 0:r.isElement(g)))==null||n?g:g.contextElement||await(r.getDocumentElement==null?void 0:r.getDocumentElement(a.floating)),boundary:c,rootBoundary:p,strategy:l})),$=d==="floating"?{x:s,y:i,width:o.floating.width,height:o.floating.height}:o.reference,A=await(r.getOffsetParent==null?void 0:r.getOffsetParent(a.floating)),E=await(r.isElement==null?void 0:r.isElement(A))&&await(r.getScale==null?void 0:r.getScale(A))||{x:1,y:1},I=Ft(r.convertOffsetParentRelativeRectToViewportRelativeRect?await r.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:$,offsetParent:A,strategy:l}):$);return{top:(v.top-I.top+f.top)/E.y,bottom:(I.bottom-v.bottom+f.bottom)/E.y,left:(v.left-I.left+f.left)/E.x,right:(I.right-v.right+f.right)/E.x}}const sd=50,id=async(t,e,n)=>{const{placement:s="bottom",strategy:i="absolute",middleware:r=[],platform:o}=n,a=o.detectOverflow?o:{...o,detectOverflow:nd},l=await(o.isRTL==null?void 0:o.isRTL(e));let c=await o.getElementRects({reference:t,floating:e,strategy:i}),{x:p,y:d}=fr(c,s,l),h=s,u=0;const f={};for(let k=0;k<r.length;k++){const g=r[k];if(!g)continue;const{name:v,fn:$}=g,{x:A,y:E,data:I,reset:O}=await $({x:p,y:d,initialPlacement:s,placement:h,strategy:i,middlewareData:f,rects:c,platform:a,elements:{reference:t,floating:e}});p=A??p,d=E??d,f[v]={...f[v],...I},O&&u<sd&&(u++,typeof O=="object"&&(O.placement&&(h=O.placement),O.rects&&(c=O.rects===!0?await o.getElementRects({reference:t,floating:e,strategy:i}):O.rects),{x:p,y:d}=fr(c,h,l)),k=-1)}return{x:p,y:d,placement:h,strategy:i,middlewareData:f}},rd=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var n,s;const{placement:i,middlewareData:r,rects:o,initialPlacement:a,platform:l,elements:c}=e,{mainAxis:p=!0,crossAxis:d=!0,fallbackPlacements:h,fallbackStrategy:u="bestFit",fallbackAxisSideDirection:f="none",flipAlignment:k=!0,...g}=lt(t,e);if((n=r.arrow)!=null&&n.alignmentOffset)return{};const v=Oe(i),$=oe(a),A=Oe(a)===a,E=await(l.isRTL==null?void 0:l.isRTL(c.floating)),I=h||(A||!k?[Ht(a)]:Gc(a)),O=f!=="none";!h&&O&&I.push(...Qc(a,k,f,E));const U=[a,...I],M=await l.detectOverflow(e,g),ee=[];let Z=((s=r.flip)==null?void 0:s.overflows)||[];if(p&&ee.push(M[v]),d){const xe=Zc(i,o,E);ee.push(M[xe[0]],M[xe[1]])}if(Z=[...Z,{placement:i,overflows:ee}],!ee.every(xe=>xe<=0)){var ws,$s;const xe=(((ws=r.flip)==null?void 0:ws.index)||0)+1,sn=U[xe];if(sn&&(!(d==="alignment"?$!==oe(sn):!1)||Z.every(W=>oe(W.placement)===$?W.overflows[0]>0:!0)))return{data:{index:xe,overflows:Z},reset:{placement:sn}};let Ze=($s=Z.filter(ve=>ve.overflows[0]<=0).sort((ve,W)=>ve.overflows[1]-W.overflows[1])[0])==null?void 0:$s.placement;if(!Ze)switch(u){case"bestFit":{var Ss;const ve=(Ss=Z.filter(W=>{if(O){const ce=oe(W.placement);return ce===$||ce==="y"}return!0}).map(W=>[W.placement,W.overflows.filter(ce=>ce>0).reduce((ce,Oo)=>ce+Oo,0)]).sort((W,ce)=>W[1]-ce[1])[0])==null?void 0:Ss[0];ve&&(Ze=ve);break}case"initialPlacement":Ze=a;break}if(i!==Ze)return{reset:{placement:Ze}}}return{}}}},od=new Set(["left","top"]);async function ad(t,e){const{placement:n,platform:s,elements:i}=t,r=await(s.isRTL==null?void 0:s.isRTL(i.floating)),o=Oe(n),a=ct(n),l=oe(n)==="y",c=od.has(o)?-1:1,p=r&&l?-1:1,d=lt(e,t);let{mainAxis:h,crossAxis:u,alignmentAxis:f}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return a&&typeof f=="number"&&(u=a==="end"?f*-1:f),l?{x:u*p,y:h*c}:{x:h*c,y:u*p}}const ld=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var n,s;const{x:i,y:r,placement:o,middlewareData:a}=e,l=await ad(e,t);return o===((n=a.offset)==null?void 0:n.placement)&&(s=a.arrow)!=null&&s.alignmentOffset?{}:{x:i+l.x,y:r+l.y,data:{...l,placement:o}}}}},cd=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:s,placement:i,platform:r}=e,{mainAxis:o=!0,crossAxis:a=!1,limiter:l={fn:$=>{let{x:A,y:E}=$;return{x:A,y:E}}},...c}=lt(t,e),p={x:n,y:s},d=await r.detectOverflow(e,c),h=oe(i),u=cr(h);let f=p[u],k=p[h];const g=($,A)=>Kc(A+d[$==="y"?"top":"left"],A,A-d[$==="y"?"bottom":"right"]);o&&(f=g(u,f)),a&&(k=g(h,k));const v=l.fn({...e,[u]:f,[h]:k});return{...v,data:{x:v.x-n,y:v.y-s,enabled:{[u]:o,[h]:a}}}}}},dd=function(t){return t===void 0&&(t={}),{name:"size",options:t,async fn(e){const{placement:n,rects:s,platform:i,elements:r}=e,{apply:o=()=>{},...a}=lt(t,e),l=await i.detectOverflow(e,a),c=Oe(n),p=ct(n),d=oe(n)==="y",{width:h,height:u}=s.floating;let f,k;c==="top"||c==="bottom"?(f=c,k=p===(await(i.isRTL==null?void 0:i.isRTL(r.floating))?"start":"end")?"left":"right"):(k=c,f=p==="end"?"top":"bottom");const g=u-l.top-l.bottom,v=h-l.left-l.right,$=Fe(u-l[f],g),A=Fe(h-l[k],v),E=e.middlewareData.shift,I=!E;let O=$,U=A;E!=null&&E.enabled.x&&(U=v),E!=null&&E.enabled.y&&(O=g),I&&!p&&(d?U=h-2*ie(l.left,l.right):O=u-2*ie(l.top,l.bottom)),await o({...e,availableWidth:U,availableHeight:O});const M=await i.getDimensions(r.floating);return h!==M.width||u!==M.height?{reset:{rects:!0}}:{}}}};function Wt(){return typeof window<"u"}function We(t){return gr(t)?(t.nodeName||"").toLowerCase():"#document"}function j(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function ae(t){var e;return(e=(gr(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function gr(t){return Wt()?t instanceof Node||t instanceof j(t).Node:!1}function X(t){return Wt()?t instanceof Element||t instanceof j(t).Element:!1}function ke(t){return Wt()?t instanceof HTMLElement||t instanceof j(t).HTMLElement:!1}function mr(t){return!Wt()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof j(t).ShadowRoot}function Vt(t){const{overflow:e,overflowX:n,overflowY:s,display:i}=Q(t);return/auto|scroll|overlay|hidden|clip/.test(e+s+n)&&i!=="inline"&&i!=="contents"}function pd(t){return/^(table|td|th)$/.test(We(t))}function Kt(t){try{if(t.matches(":popover-open"))return!0}catch{}try{return t.matches(":modal")}catch{return!1}}const hd=/transform|translate|scale|rotate|perspective|filter/,ud=/paint|layout|strict|content/,Pe=t=>!!t&&t!=="none";let Jn;function Xn(t){const e=X(t)?Q(t):t;return Pe(e.transform)||Pe(e.translate)||Pe(e.scale)||Pe(e.rotate)||Pe(e.perspective)||!Qn()&&(Pe(e.backdropFilter)||Pe(e.filter))||hd.test(e.willChange||"")||ud.test(e.contain||"")}function fd(t){let e=ze(t);for(;ke(e)&&!dt(e);){if(Xn(e))return e;if(Kt(e))return null;e=ze(e)}return null}function Qn(){return Jn==null&&(Jn=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),Jn}function dt(t){return/^(html|body|#document)$/.test(We(t))}function Q(t){return j(t).getComputedStyle(t)}function Zt(t){return X(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function ze(t){if(We(t)==="html")return t;const e=t.assignedSlot||t.parentNode||mr(t)&&t.host||ae(t);return mr(e)?e.host:e}function kr(t){const e=ze(t);return dt(e)?(t.ownerDocument||t).body:ke(e)&&Vt(e)?e:kr(e)}function pt(t,e,n){var s;e===void 0&&(e=[]),n===void 0&&(n=!0);const i=kr(t),r=i===((s=t.ownerDocument)==null?void 0:s.body),o=j(i);if(r){const a=es(o);return e.concat(o,o.visualViewport||[],Vt(i)?i:[],a&&n?pt(a):[])}else return e.concat(i,pt(i,[],n))}function es(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function br(t){const e=Q(t);let n=parseFloat(e.width)||0,s=parseFloat(e.height)||0;const i=ke(t),r=i?t.offsetWidth:n,o=i?t.offsetHeight:s,a=Bt(n)!==r||Bt(s)!==o;return a&&(n=r,s=o),{width:n,height:s,$:a}}function ts(t){return X(t)?t:t.contextElement}function Ve(t){const e=ts(t);if(!ke(e))return re(1);const n=e.getBoundingClientRect(),{width:s,height:i,$:r}=br(e);let o=(r?Bt(n.width):n.width)/s,a=(r?Bt(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!a||!Number.isFinite(a))&&(a=1),{x:o,y:a}}const gd=re(0);function xr(t){const e=j(t);return!Qn()||!e.visualViewport?gd:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function md(t,e,n){return e===void 0&&(e=!1),!!n&&e&&n===j(t)}function Me(t,e,n,s){e===void 0&&(e=!1),n===void 0&&(n=!1);const i=t.getBoundingClientRect(),r=ts(t);let o=re(1);e&&(s?X(s)&&(o=Ve(s)):o=Ve(t));const a=md(r,n,s)?xr(r):re(0);let l=(i.left+a.x)/o.x,c=(i.top+a.y)/o.y,p=i.width/o.x,d=i.height/o.y;if(r&&s){const h=j(r),u=X(s)?j(s):s;let f=h,k=es(f);for(;k&&u!==f;){const g=Ve(k),v=k.getBoundingClientRect(),$=Q(k),A=v.left+(k.clientLeft+parseFloat($.paddingLeft))*g.x,E=v.top+(k.clientTop+parseFloat($.paddingTop))*g.y;l*=g.x,c*=g.y,p*=g.x,d*=g.y,l+=A,c+=E,f=j(k),k=es(f)}}return Ft({width:p,height:d,x:l,y:c})}function Gt(t,e){const n=Zt(t).scrollLeft;return e?e.left+n:Me(ae(t)).left+n}function vr(t,e){const n=t.getBoundingClientRect(),s=n.left+e.scrollLeft-Gt(t,n),i=n.top+e.scrollTop;return{x:s,y:i}}function kd(t){let{elements:e,rect:n,offsetParent:s,strategy:i}=t;const r=i==="fixed",o=ae(s),a=e?Kt(e.floating):!1;if(s===o||a&&r)return n;let l={scrollLeft:0,scrollTop:0},c=re(1);const p=re(0),d=ke(s);if((d||!r)&&((We(s)!=="body"||Vt(o))&&(l=Zt(s)),d)){const u=Me(s);c=Ve(s),p.x=u.x+s.clientLeft,p.y=u.y+s.clientTop}const h=o&&!d&&!r?vr(o,l):re(0);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-l.scrollLeft*c.x+p.x+h.x,y:n.y*c.y-l.scrollTop*c.y+p.y+h.y}}function bd(t){return t.getClientRects?Array.from(t.getClientRects()):[]}function xd(t){const e=Zt(t),n=t.ownerDocument.body,s=ie(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),i=ie(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight);let r=-e.scrollLeft+Gt(t);const o=-e.scrollTop;return Q(n).direction==="rtl"&&(r+=ie(t.clientWidth,n.clientWidth)-s),{width:s,height:i,x:r,y:o}}const vd=25;function yd(t,e,n){n===void 0&&(n="viewport");const s=n==="layoutViewport",i=j(t),r=ae(t),o=i.visualViewport;let a=r.clientWidth,l=r.clientHeight,c=0,p=0;if(o){const h=!Qn()||e==="fixed";s?h||(c=-o.offsetLeft,p=-o.offsetTop):(a=o.width,l=o.height,h&&(c=o.offsetLeft,p=o.offsetTop))}if(Gt(r)<=0){const h=r.ownerDocument,u=h.body,f=getComputedStyle(u),k=h.compatMode==="CSS1Compat"&&parseFloat(f.marginLeft)+parseFloat(f.marginRight)||0,g=Math.abs(r.clientWidth-u.clientWidth-k),v=getComputedStyle(r).scrollbarGutter==="stable both-edges"?g/2:g;v<=vd&&(a-=v)}return{width:a,height:l,x:c,y:p}}function wd(t,e){const n=Me(t,!0,e==="fixed"),s=n.top+t.clientTop,i=n.left+t.clientLeft,r=Ve(t),o=t.clientWidth*r.x,a=t.clientHeight*r.y,l=i*r.x,c=s*r.y;return{width:o,height:a,x:l,y:c}}function yr(t,e,n){let s;if(e==="viewport"||e==="layoutViewport")s=yd(t,n,e);else if(e==="document")s=xd(ae(t));else if(X(e))s=wd(e,n);else{const i=xr(t);s={x:e.x-i.x,y:e.y-i.y,width:e.width,height:e.height}}return Ft(s)}function $d(t,e){const n=e.get(t);if(n)return n;let s=pt(t,[],!1).filter(a=>X(a)&&We(a)!=="body"),i=null;const r=Q(t).position==="fixed";let o=r?ze(t):t;for(;X(o)&&!dt(o);){const a=Q(o),l=Xn(o),c=i?i.position:r?"fixed":"";!l&&(c==="fixed"||c==="absolute"&&a.position==="static")?s=s.filter(d=>d!==o):i=a,o=ze(o)}return e.set(t,s),s}function Sd(t){let{element:e,boundary:n,rootBoundary:s,strategy:i}=t;const o=[...n==="clippingAncestors"?Kt(e)?[]:$d(e,this._c):[].concat(n),s],a=yr(e,o[0],i);let l=a.top,c=a.right,p=a.bottom,d=a.left;for(let h=1;h<o.length;h++){const u=yr(e,o[h],i);l=ie(u.top,l),c=Fe(u.right,c),p=Fe(u.bottom,p),d=ie(u.left,d)}return{width:c-d,height:p-l,x:d,y:l}}function Ad(t){const{width:e,height:n}=br(t);return{width:e,height:n}}function Cd(t,e,n){const s=ke(e),i=ae(e),r=n==="fixed",o=Me(t,!0,r,e);let a={scrollLeft:0,scrollTop:0};const l=re(0);if((s||!r)&&((We(e)!=="body"||Vt(i))&&(a=Zt(e)),s)){const h=Me(e,!0,r,e);l.x=h.x+e.clientLeft,l.y=h.y+e.clientTop}!s&&i&&(l.x=Gt(i));const c=i&&!s&&!r?vr(i,a):re(0),p=o.left+a.scrollLeft-l.x-c.x,d=o.top+a.scrollTop-l.y-c.y;return{x:p,y:d,width:o.width,height:o.height}}function ns(t){return Q(t).position==="static"}function wr(t,e){if(!ke(t)||Q(t).position==="fixed")return null;if(e)return e(t);let n=t.offsetParent;return ae(t)===n&&(n=n.ownerDocument.body),n}function $r(t,e){const n=j(t);if(Kt(t))return n;if(!ke(t)){let i=ze(t);for(;i&&!dt(i);){if(X(i)&&!ns(i))return i;i=ze(i)}return n}let s=wr(t,e);for(;s&&pd(s)&&ns(s);)s=wr(s,e);return s&&dt(s)&&ns(s)&&!Xn(s)?n:s||fd(t)||n}const Td=async function(t){const e=this.getOffsetParent||$r,n=this.getDimensions,s=await n(t.floating);return{reference:Cd(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:s.width,height:s.height}}};function Ed(t){return Q(t).direction==="rtl"}const Rd={convertOffsetParentRelativeRectToViewportRelativeRect:kd,getDocumentElement:ae,getClippingRect:Sd,getOffsetParent:$r,getElementRects:Td,getClientRects:bd,getDimensions:Ad,getScale:Ve,isElement:X,isRTL:Ed};function Sr(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function _d(t,e,n){let s=null,i;const r=ae(t);function o(){var p;clearTimeout(i),(p=s)==null||p.disconnect(),s=null}function a(p,d){p===void 0&&(p=!1),d===void 0&&(d=1),o();const h=t.getBoundingClientRect(),{left:u,top:f,width:k,height:g}=h;if(p||e(),!k||!g)return;const v=Ut(f),$=Ut(r.clientWidth-(u+k)),A=Ut(r.clientHeight-(f+g)),E=Ut(u),O={rootMargin:-v+"px "+-$+"px "+-A+"px "+-E+"px",threshold:ie(0,Fe(1,d))||1};let U=!0;function M(ee){const Z=ee[0].intersectionRatio;if(!Sr(h,t.getBoundingClientRect()))return a();if(Z!==d){if(!U)return a();Z?a(!1,Z):i=setTimeout(()=>{a(!1,1e-7)},1e3)}U=!1}try{s=new IntersectionObserver(M,{...O,root:r.ownerDocument})}catch{s=new IntersectionObserver(M,O)}s.observe(t)}const l=j(t),c=()=>a(n);return l.addEventListener("resize",c),a(!0),()=>{l.removeEventListener("resize",c),o()}}function Ld(t,e,n,s){s===void 0&&(s={});const{ancestorScroll:i=!0,ancestorResize:r=!0,elementResize:o=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:l=!1}=s,c=ts(t),p=i||r?[...c?pt(c):[],...e?pt(e):[]]:[];p.forEach(v=>{i&&v.addEventListener("scroll",n),r&&v.addEventListener("resize",n)});const d=c&&a?_d(c,n,r):null;let h=-1,u=null;o&&(u=new ResizeObserver(v=>{let[$]=v;$&&$.target===c&&u&&e&&(u.unobserve(e),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var A;(A=u)==null||A.observe(e)})),n()}),c&&!l&&u.observe(c),e&&u.observe(e));let f,k=l?Me(t):null;l&&g();function g(){const v=Me(t);k&&!Sr(k,v)&&n(),k=v,f=requestAnimationFrame(g)}return n(),()=>{var v;p.forEach($=>{i&&$.removeEventListener("scroll",n),r&&$.removeEventListener("resize",n)}),d?.(),(v=u)==null||v.disconnect(),u=null,l&&cancelAnimationFrame(f)}}const Od=ld,Pd=cd,zd=rd,Md=dd,Id=(t,e,n)=>{const s=new Map,i=n??{},r={...Rd,...i.platform,_c:s};return id(t,e,{...i,platform:r})},Nd=(t,e)=>({top:e,bottom:e,right:t}),Dd=(t,e,n,s={})=>{if(typeof t.showPopover!="function")return()=>{};try{t.showPopover()}catch{return()=>{}}let i=!0,r=0;const o=e instanceof Element?e:{getBoundingClientRect:()=>({x:e.right,y:e.top,left:e.right,right:e.right,top:e.top,bottom:e.bottom,width:0,height:e.bottom-e.top})};t.style.width=`${n.width}px`,t.style.maxHeight=`${n.height}px`;const l=Ld(o,t,()=>{const c=++r;Id(o,t,{strategy:"fixed",placement:s.placement??"bottom-end",middleware:[Od(8),zd({padding:8,fallbackAxisSideDirection:"end"}),Pd({padding:8}),Md({padding:8,apply:({availableWidth:p,availableHeight:d})=>{!i||c!==r||(t.style.width=`${Math.max(0,Math.min(n.width,p))}px`,t.style.maxHeight=`${Math.max(0,Math.min(n.height,d))}px`)}})]}).then(({x:p,y:d})=>{!i||c!==r||!t.isConnected||(t.style.left=`${p}px`,t.style.top=`${d}px`)}).catch(()=>{})},{animationFrame:s.trackTransform??!1,elementResize:typeof ResizeObserver<"u",layoutShift:typeof IntersectionObserver<"u"});return()=>{i=!1,l()}},jd=t=>{if(!(!t||typeof t.hidePopover!="function"))try{t.hidePopover()}catch{}};class Ar{#e;#n=new Map;constructor(e){this.#e=e,e.addController(this)}hostConnected(){this.#e.requestUpdate()}hostUpdated(){for(const[e,n]of this.#n)e.isConnected||(n(),this.#n.delete(e))}hostDisconnected(){for(const e of this.#n.values())e();this.#n.clear()}open(e,n,s,i){this.#n.get(e)?.(),this.#n.set(e,Dd(e,n,s,i))}}const Cr=(t,e,n)=>{typeof window>"u"||Object.assign(window,{devProcessKit:{version:t,templates:e,versionParam:n}})},ht="dpk-version",Tr="version",qd=/^\d+\.\d+\.\d+(?:-[0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*)?$/,Yt=t=>qd.test(t),Bd="https://cdn.jsdelivr.net/npm/dev-process-kit@",Er="https://data.jsdelivr.com/v1/packages/npm/dev-process-kit",ss=t=>{const e=new URLSearchParams(t),n=e.get(ht)??e.get(Tr);return n!==null&&Yt(n)?n:null},Ud=(t,e)=>{const n=ss(t);return n===null||n===e?null:n},Hd=(t,e)=>{if(!Yt(t))throw new Error(`not an exact version: ${t}`);if(!/^[a-z0-9-]+(?:\/[a-z0-9-]+)*\.js$/.test(e))throw new Error(`not an entry path: ${e}`);return`${Bd}${t}/dist/${e}`},Fd=(t,e)=>{const n=new URL(t);return n.searchParams.delete(Tr),e===null?n.searchParams.delete(ht):n.searchParams.set(ht,e),n.href},Wd=L({tags:ne(Mt(x(),me()),{}),versions:G(L({version:x()}))}),Vd=t=>{const e=Pn(Wd,t),n=e.tags.latest;return{latest:typeof n=="string"&&Yt(n)?n:null,versions:e.versions.map(s=>s.version).filter(Yt)}},Rr=t=>{const e=t.published?.versions??[],n=e.includes(t.current)?e:[t.current,...e],s=t.published?.latest??null;return{value:t.current,options:[...t.requested?[{value:"",label:t.text.pinned}]:[],...n.map(i=>({value:i,label:i===s&&i!==t.current?t.text.latest(i):i}))]}};let Jt;const _r=()=>(Jt??=fetch(Er).then(async t=>{if(!t.ok)throw new Error(`${Er} answered ${t.status}`);return Vd(await t.json())}),Jt.catch(()=>{Jt=void 0}),Jt),Lr=t=>{location.assign(Fd(location.href,t))},Kd=t=>import(t),Zd=({entry:t,templates:e,register:n,importModule:s=Kd})=>{const i=()=>{n(),Cr(J,e,ht)},r=typeof location>"u"?null:Ud(location.search,J);if(r===null){i();return}s(Hd(r,t)).then(()=>{Gd()||Jd(r)},o=>{console.error(`dev-process-kit@${r} could not be loaded; running ${J}`,o),i()})},Gd=()=>{const t=Reflect.get(window,"devProcessKit");return typeof t=="object"&&t!==null&&"versionParam"in t},is="dpk-version-fallback",Yd=`
1278
- .${is} {
1277
+ `;class hr extends he{static{this.styles=uc}static{this.properties={definition:{attribute:!1},state:{attribute:!1},navigation:{attribute:!1},derivation:{attribute:!1},issues:{attribute:!1},pendingTarget:{attribute:!1},onDelete:{attribute:!1},onClear:{attribute:!1},onComment:{attribute:!1},onEditComment:{attribute:!1},exportBrief:{attribute:!1},sendToClaude:{attribute:!1},embedded:{type:Boolean}}}#e=ec();#n=null;#s=new vn(this);constructor(){super(),this.embedded=!1,this.definition=null,this.state=void 0,this.navigation={},this.derivation=null,this.issues=[],this.pendingTarget=null}willUpdate(e){e.has("pendingTarget")&&this.pendingTarget&&(this.#e=Yi(this.#e,{kind:"target-requested",ref:this.pendingTarget}))}updated(e){e.has("pendingTarget")&&this.pendingTarget&&this.isConnected&&this.renderRoot.querySelector("textarea")?.focus();const n=this.#n;n&&(this.#n=null,[...this.renderRoot.querySelectorAll(".item")].find(i=>i.dataset.id===n.id)?.querySelector(n.kind==="editor"?".item-editor textarea":".item-edit")?.focus())}#r(){return!this.definition||!this.derivation?null:{definition:this.definition,state:this.state,navigation:this.navigation,derivation:this.derivation,issues:this.issues,sendable:this.sendToClaude!==void 0,editable:this.onEditComment!==void 0,locale:this.#s.locale}}render(){const e=this.#r();return e?Kc(Gi(this.#s.locale),Qi(e,this.#e),this.#i,this.embedded):g}#t(e){this.#e=Yi(this.#e,e),this.requestUpdate()}#i=e=>{switch(e.kind){case"delete":this.onDelete?.(e.id);return;case"clear":this.onClear?.();return;case"copy":this.#l();return;case"send":this.#o();return;case"edit-start":this.#n={kind:"editor",id:e.id},this.#t(e);return;case"edit-cancel":{const n=this.#e.editing;n&&(this.#n={kind:"edit-button",id:n.id}),this.#t(e);return}case"edit-save":{const n=nc(this.#e);if(!n||!this.onEditComment||!this.onEditComment(n.id,n.body).ok)return;this.#n={kind:"edit-button",id:n.id},this.#t({kind:"edited"});return}case"submit":{const n=this.#r();if(!n||!this.onComment)return;const s=tc(this.#e,Qi(n,this.#e).target.ref);if(!s||!this.onComment(s.target,s.body).ok)return;this.#t({kind:"submitted"});return}default:this.#t(e)}};async#o(){const e=this.sendToClaude;if(!e||this.#e.send.kind==="pending")return;this.#t({kind:"send-started"});const n=this.#e.sendRequest,s=await e().catch(()=>({ok:!1,reason:"error"}));this.isConnected&&this.#t({kind:"send-finished",request:n,outcome:s})}async#l(){const e=this.#r();if(!e)return;this.#t({kind:"copy-started"});const n=this.#e.copyRequest;try{const s=this.exportBrief?.()??Fn({...e.derivation,navigation:e.navigation,issues:e.issues},e.definition,X),i=await Wn(s);this.isConnected&&this.#t({kind:"copy-finished",request:n,ok:i})}catch{this.isConnected&&this.#t({kind:"copy-finished",request:n,ok:!1})}}}const Yc=()=>{customElements.get("dpk-component-comment-panel")||customElements.define("dpk-component-comment-panel",hr)},We=Math.min,ie=Math.max,Ut=Math.round,Ht=Math.floor,re=t=>({x:t,y:t}),Jc={left:"right",right:"left",bottom:"top",top:"bottom"};function Xc(t,e,n){return ie(t,We(e,n))}function dt(t,e){return typeof t=="function"?t(e):t}function Oe(t){return t.split("-")[0]}function pt(t){return t.split("-")[1]}function ur(t){return t==="x"?"y":"x"}function fr(t){return t==="y"?"height":"width"}function oe(t){const e=t[0];return e==="t"||e==="b"?"y":"x"}function gr(t){return ur(oe(t))}function Qc(t,e,n){n===void 0&&(n=!1);const s=pt(t),i=gr(t),r=fr(i);let o=i==="x"?s===(n?"end":"start")?"right":"left":s==="start"?"bottom":"top";return e.reference[r]>e.floating[r]&&(o=Ft(o)),[o,Ft(o)]}function ed(t){const e=Ft(t);return[Jn(t),e,Jn(e)]}function Jn(t){return t.includes("start")?t.replace("start","end"):t.replace("end","start")}const mr=["left","right"],kr=["right","left"],td=["top","bottom"],nd=["bottom","top"];function sd(t,e,n){switch(t){case"top":case"bottom":return n?e?kr:mr:e?mr:kr;case"left":case"right":return e?td:nd;default:return[]}}function id(t,e,n,s){const i=pt(t);let r=sd(Oe(t),n==="start",s);return i&&(r=r.map(o=>o+"-"+i),e&&(r=r.concat(r.map(Jn)))),r}function Ft(t){const e=Oe(t);return Jc[e]+t.slice(e.length)}function rd(t){var e,n,s,i;return{top:(e=t.top)!=null?e:0,right:(n=t.right)!=null?n:0,bottom:(s=t.bottom)!=null?s:0,left:(i=t.left)!=null?i:0}}function od(t){return typeof t!="number"?rd(t):{top:t,right:t,bottom:t,left:t}}function Wt(t){const{x:e,y:n,width:s,height:i}=t;return{width:s,height:i,top:n,left:e,right:e+s,bottom:n+i,x:e,y:n}}function br(t,e,n){let{reference:s,floating:i}=t;const r=oe(e),o=gr(e),a=fr(o),l=Oe(e),c=r==="y",p=s.x+s.width/2-i.width/2,d=s.y+s.height/2-i.height/2,h=s[a]/2-i[a]/2;let u;switch(l){case"top":u={x:p,y:s.y-i.height};break;case"bottom":u={x:p,y:s.y+s.height};break;case"right":u={x:s.x+s.width,y:d};break;case"left":u={x:s.x-i.width,y:d};break;default:u={x:s.x,y:s.y}}const f=pt(e);return f&&(u[o]+=h*(f==="end"?1:-1)*(n&&c?-1:1)),u}async function ad(t,e){var n;e===void 0&&(e={});const{x:s,y:i,platform:r,rects:o,elements:a,strategy:l}=t,{boundary:c="clippingAncestors",rootBoundary:p="viewport",elementContext:d="floating",altBoundary:h=!1,padding:u=0}=dt(e,t),f=od(u),m=a[h?d==="floating"?"reference":"floating":d],x=Wt(await r.getClippingRect({element:(n=await(r.isElement==null?void 0:r.isElement(m)))==null||n?m:m.contextElement||await(r.getDocumentElement==null?void 0:r.getDocumentElement(a.floating)),boundary:c,rootBoundary:p,strategy:l})),$=d==="floating"?{x:s,y:i,width:o.floating.width,height:o.floating.height}:o.reference,A=await(r.getOffsetParent==null?void 0:r.getOffsetParent(a.floating)),E=await(r.isElement==null?void 0:r.isElement(A))&&await(r.getScale==null?void 0:r.getScale(A))||{x:1,y:1},I=Wt(r.convertOffsetParentRelativeRectToViewportRelativeRect?await r.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:$,offsetParent:A,strategy:l}):$);return{top:(x.top-I.top+f.top)/E.y,bottom:(I.bottom-x.bottom+f.bottom)/E.y,left:(x.left-I.left+f.left)/E.x,right:(I.right-x.right+f.right)/E.x}}const ld=50,cd=async(t,e,n)=>{const{placement:s="bottom",strategy:i="absolute",middleware:r=[],platform:o}=n,a=o.detectOverflow?o:{...o,detectOverflow:ad},l=await(o.isRTL==null?void 0:o.isRTL(e));let c=await o.getElementRects({reference:t,floating:e,strategy:i}),{x:p,y:d}=br(c,s,l),h=s,u=0;const f={};for(let k=0;k<r.length;k++){const m=r[k];if(!m)continue;const{name:x,fn:$}=m,{x:A,y:E,data:I,reset:O}=await $({x:p,y:d,initialPlacement:s,placement:h,strategy:i,middlewareData:f,rects:c,platform:a,elements:{reference:t,floating:e}});p=A??p,d=E??d,f[x]={...f[x],...I},O&&u<ld&&(u++,typeof O=="object"&&(O.placement&&(h=O.placement),O.rects&&(c=O.rects===!0?await o.getElementRects({reference:t,floating:e,strategy:i}):O.rects),{x:p,y:d}=br(c,h,l)),k=-1)}return{x:p,y:d,placement:h,strategy:i,middlewareData:f}},dd=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var n,s;const{placement:i,middlewareData:r,rects:o,initialPlacement:a,platform:l,elements:c}=e,{mainAxis:p=!0,crossAxis:d=!0,fallbackPlacements:h,fallbackStrategy:u="bestFit",fallbackAxisSideDirection:f="none",flipAlignment:k=!0,...m}=dt(t,e);if((n=r.arrow)!=null&&n.alignmentOffset)return{};const x=Oe(i),$=oe(a),A=Oe(a)===a,E=await(l.isRTL==null?void 0:l.isRTL(c.floating)),I=h||(A||!k?[Ft(a)]:ed(a)),O=f!=="none";!h&&O&&I.push(...id(a,k,f,E));const U=[a,...I],M=await l.detectOverflow(e,m),te=[];let Y=((s=r.flip)==null?void 0:s.overflows)||[];if(p&&te.push(M[x]),d){const xe=Qc(i,o,E);te.push(M[xe[0]],M[xe[1]])}if(Y=[...Y,{placement:i,overflows:te}],!te.every(xe=>xe<=0)){var As,Cs;const xe=(((As=r.flip)==null?void 0:As.index)||0)+1,rn=U[xe];if(rn&&(!(d==="alignment"?$!==oe(rn):!1)||Y.every(V=>oe(V.placement)===$?V.overflows[0]>0:!0)))return{data:{index:xe,overflows:Y},reset:{placement:rn}};let Ze=(Cs=Y.filter(ye=>ye.overflows[0]<=0).sort((ye,V)=>ye.overflows[1]-V.overflows[1])[0])==null?void 0:Cs.placement;if(!Ze)switch(u){case"bestFit":{var Ts;const ye=(Ts=Y.filter(V=>{if(O){const ce=oe(V.placement);return ce===$||ce==="y"}return!0}).map(V=>[V.placement,V.overflows.filter(ce=>ce>0).reduce((ce,Do)=>ce+Do,0)]).sort((V,ce)=>V[1]-ce[1])[0])==null?void 0:Ts[0];ye&&(Ze=ye);break}case"initialPlacement":Ze=a;break}if(i!==Ze)return{reset:{placement:Ze}}}return{}}}},pd=new Set(["left","top"]);async function hd(t,e){const{placement:n,platform:s,elements:i}=t,r=await(s.isRTL==null?void 0:s.isRTL(i.floating)),o=Oe(n),a=pt(n),l=oe(n)==="y",c=pd.has(o)?-1:1,p=r&&l?-1:1,d=dt(e,t);let{mainAxis:h,crossAxis:u,alignmentAxis:f}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return a&&typeof f=="number"&&(u=a==="end"?f*-1:f),l?{x:u*p,y:h*c}:{x:h*c,y:u*p}}const ud=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var n,s;const{x:i,y:r,placement:o,middlewareData:a}=e,l=await hd(e,t);return o===((n=a.offset)==null?void 0:n.placement)&&(s=a.arrow)!=null&&s.alignmentOffset?{}:{x:i+l.x,y:r+l.y,data:{...l,placement:o}}}}},fd=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:s,placement:i,platform:r}=e,{mainAxis:o=!0,crossAxis:a=!1,limiter:l={fn:$=>{let{x:A,y:E}=$;return{x:A,y:E}}},...c}=dt(t,e),p={x:n,y:s},d=await r.detectOverflow(e,c),h=oe(i),u=ur(h);let f=p[u],k=p[h];const m=($,A)=>Xc(A+d[$==="y"?"top":"left"],A,A-d[$==="y"?"bottom":"right"]);o&&(f=m(u,f)),a&&(k=m(h,k));const x=l.fn({...e,[u]:f,[h]:k});return{...x,data:{x:x.x-n,y:x.y-s,enabled:{[u]:o,[h]:a}}}}}},gd=function(t){return t===void 0&&(t={}),{name:"size",options:t,async fn(e){const{placement:n,rects:s,platform:i,elements:r}=e,{apply:o=()=>{},...a}=dt(t,e),l=await i.detectOverflow(e,a),c=Oe(n),p=pt(n),d=oe(n)==="y",{width:h,height:u}=s.floating;let f,k;c==="top"||c==="bottom"?(f=c,k=p===(await(i.isRTL==null?void 0:i.isRTL(r.floating))?"start":"end")?"left":"right"):(k=c,f=p==="end"?"top":"bottom");const m=u-l.top-l.bottom,x=h-l.left-l.right,$=We(u-l[f],m),A=We(h-l[k],x),E=e.middlewareData.shift,I=!E;let O=$,U=A;E!=null&&E.enabled.x&&(U=x),E!=null&&E.enabled.y&&(O=m),I&&!p&&(d?U=h-2*ie(l.left,l.right):O=u-2*ie(l.top,l.bottom)),await o({...e,availableWidth:U,availableHeight:O});const M=await i.getDimensions(r.floating);return h!==M.width||u!==M.height?{reset:{rects:!0}}:{}}}};function Vt(){return typeof window<"u"}function Ve(t){return vr(t)?(t.nodeName||"").toLowerCase():"#document"}function j(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function ae(t){var e;return(e=(vr(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function vr(t){return Vt()?t instanceof Node||t instanceof j(t).Node:!1}function Q(t){return Vt()?t instanceof Element||t instanceof j(t).Element:!1}function be(t){return Vt()?t instanceof HTMLElement||t instanceof j(t).HTMLElement:!1}function xr(t){return!Vt()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof j(t).ShadowRoot}function Kt(t){const{overflow:e,overflowX:n,overflowY:s,display:i}=ee(t);return/auto|scroll|overlay|hidden|clip/.test(e+s+n)&&i!=="inline"&&i!=="contents"}function md(t){return/^(table|td|th)$/.test(Ve(t))}function Gt(t){try{if(t.matches(":popover-open"))return!0}catch{}try{return t.matches(":modal")}catch{return!1}}const kd=/transform|translate|scale|rotate|perspective|filter/,bd=/paint|layout|strict|content/,Pe=t=>!!t&&t!=="none";let Xn;function Qn(t){const e=Q(t)?ee(t):t;return Pe(e.transform)||Pe(e.translate)||Pe(e.scale)||Pe(e.rotate)||Pe(e.perspective)||!es()&&(Pe(e.backdropFilter)||Pe(e.filter))||kd.test(e.willChange||"")||bd.test(e.contain||"")}function vd(t){let e=ze(t);for(;be(e)&&!ht(e);){if(Qn(e))return e;if(Gt(e))return null;e=ze(e)}return null}function es(){return Xn==null&&(Xn=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),Xn}function ht(t){return/^(html|body|#document)$/.test(Ve(t))}function ee(t){return j(t).getComputedStyle(t)}function Zt(t){return Q(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function ze(t){if(Ve(t)==="html")return t;const e=t.assignedSlot||t.parentNode||xr(t)&&t.host||ae(t);return xr(e)?e.host:e}function yr(t){const e=ze(t);return ht(e)?(t.ownerDocument||t).body:be(e)&&Kt(e)?e:yr(e)}function ut(t,e,n){var s;e===void 0&&(e=[]),n===void 0&&(n=!0);const i=yr(t),r=i===((s=t.ownerDocument)==null?void 0:s.body),o=j(i);if(r){const a=ts(o);return e.concat(o,o.visualViewport||[],Kt(i)?i:[],a&&n?ut(a):[])}else return e.concat(i,ut(i,[],n))}function ts(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function wr(t){const e=ee(t);let n=parseFloat(e.width)||0,s=parseFloat(e.height)||0;const i=be(t),r=i?t.offsetWidth:n,o=i?t.offsetHeight:s,a=Ut(n)!==r||Ut(s)!==o;return a&&(n=r,s=o),{width:n,height:s,$:a}}function ns(t){return Q(t)?t:t.contextElement}function Ke(t){const e=ns(t);if(!be(e))return re(1);const n=e.getBoundingClientRect(),{width:s,height:i,$:r}=wr(e);let o=(r?Ut(n.width):n.width)/s,a=(r?Ut(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!a||!Number.isFinite(a))&&(a=1),{x:o,y:a}}const xd=re(0);function $r(t){const e=j(t);return!es()||!e.visualViewport?xd:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function yd(t,e,n){return e===void 0&&(e=!1),!!n&&e&&n===j(t)}function Me(t,e,n,s){e===void 0&&(e=!1),n===void 0&&(n=!1);const i=t.getBoundingClientRect(),r=ns(t);let o=re(1);e&&(s?Q(s)&&(o=Ke(s)):o=Ke(t));const a=yd(r,n,s)?$r(r):re(0);let l=(i.left+a.x)/o.x,c=(i.top+a.y)/o.y,p=i.width/o.x,d=i.height/o.y;if(r&&s){const h=j(r),u=Q(s)?j(s):s;let f=h,k=ts(f);for(;k&&u!==f;){const m=Ke(k),x=k.getBoundingClientRect(),$=ee(k),A=x.left+(k.clientLeft+parseFloat($.paddingLeft))*m.x,E=x.top+(k.clientTop+parseFloat($.paddingTop))*m.y;l*=m.x,c*=m.y,p*=m.x,d*=m.y,l+=A,c+=E,f=j(k),k=ts(f)}}return Wt({width:p,height:d,x:l,y:c})}function Yt(t,e){const n=Zt(t).scrollLeft;return e?e.left+n:Me(ae(t)).left+n}function Sr(t,e){const n=t.getBoundingClientRect(),s=n.left+e.scrollLeft-Yt(t,n),i=n.top+e.scrollTop;return{x:s,y:i}}function wd(t){let{elements:e,rect:n,offsetParent:s,strategy:i}=t;const r=i==="fixed",o=ae(s),a=e?Gt(e.floating):!1;if(s===o||a&&r)return n;let l={scrollLeft:0,scrollTop:0},c=re(1);const p=re(0),d=be(s);if((d||!r)&&((Ve(s)!=="body"||Kt(o))&&(l=Zt(s)),d)){const u=Me(s);c=Ke(s),p.x=u.x+s.clientLeft,p.y=u.y+s.clientTop}const h=o&&!d&&!r?Sr(o,l):re(0);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-l.scrollLeft*c.x+p.x+h.x,y:n.y*c.y-l.scrollTop*c.y+p.y+h.y}}function $d(t){return t.getClientRects?Array.from(t.getClientRects()):[]}function Sd(t){const e=Zt(t),n=t.ownerDocument.body,s=ie(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),i=ie(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight);let r=-e.scrollLeft+Yt(t);const o=-e.scrollTop;return ee(n).direction==="rtl"&&(r+=ie(t.clientWidth,n.clientWidth)-s),{width:s,height:i,x:r,y:o}}const Ad=25;function Cd(t,e,n){n===void 0&&(n="viewport");const s=n==="layoutViewport",i=j(t),r=ae(t),o=i.visualViewport;let a=r.clientWidth,l=r.clientHeight,c=0,p=0;if(o){const h=!es()||e==="fixed";s?h||(c=-o.offsetLeft,p=-o.offsetTop):(a=o.width,l=o.height,h&&(c=o.offsetLeft,p=o.offsetTop))}if(Yt(r)<=0){const h=r.ownerDocument,u=h.body,f=getComputedStyle(u),k=h.compatMode==="CSS1Compat"&&parseFloat(f.marginLeft)+parseFloat(f.marginRight)||0,m=Math.abs(r.clientWidth-u.clientWidth-k),x=getComputedStyle(r).scrollbarGutter==="stable both-edges"?m/2:m;x<=Ad&&(a-=x)}return{width:a,height:l,x:c,y:p}}function Td(t,e){const n=Me(t,!0,e==="fixed"),s=n.top+t.clientTop,i=n.left+t.clientLeft,r=Ke(t),o=t.clientWidth*r.x,a=t.clientHeight*r.y,l=i*r.x,c=s*r.y;return{width:o,height:a,x:l,y:c}}function Ar(t,e,n){let s;if(e==="viewport"||e==="layoutViewport")s=Cd(t,n,e);else if(e==="document")s=Sd(ae(t));else if(Q(e))s=Td(e,n);else{const i=$r(t);s={x:e.x-i.x,y:e.y-i.y,width:e.width,height:e.height}}return Wt(s)}function Ed(t,e){const n=e.get(t);if(n)return n;let s=ut(t,[],!1).filter(a=>Q(a)&&Ve(a)!=="body"),i=null;const r=ee(t).position==="fixed";let o=r?ze(t):t;for(;Q(o)&&!ht(o);){const a=ee(o),l=Qn(o),c=i?i.position:r?"fixed":"";!l&&(c==="fixed"||c==="absolute"&&a.position==="static")?s=s.filter(d=>d!==o):i=a,o=ze(o)}return e.set(t,s),s}function Rd(t){let{element:e,boundary:n,rootBoundary:s,strategy:i}=t;const o=[...n==="clippingAncestors"?Gt(e)?[]:Ed(e,this._c):[].concat(n),s],a=Ar(e,o[0],i);let l=a.top,c=a.right,p=a.bottom,d=a.left;for(let h=1;h<o.length;h++){const u=Ar(e,o[h],i);l=ie(u.top,l),c=We(u.right,c),p=We(u.bottom,p),d=ie(u.left,d)}return{width:c-d,height:p-l,x:d,y:l}}function _d(t){const{width:e,height:n}=wr(t);return{width:e,height:n}}function Ld(t,e,n){const s=be(e),i=ae(e),r=n==="fixed",o=Me(t,!0,r,e);let a={scrollLeft:0,scrollTop:0};const l=re(0);if((s||!r)&&((Ve(e)!=="body"||Kt(i))&&(a=Zt(e)),s)){const h=Me(e,!0,r,e);l.x=h.x+e.clientLeft,l.y=h.y+e.clientTop}!s&&i&&(l.x=Yt(i));const c=i&&!s&&!r?Sr(i,a):re(0),p=o.left+a.scrollLeft-l.x-c.x,d=o.top+a.scrollTop-l.y-c.y;return{x:p,y:d,width:o.width,height:o.height}}function ss(t){return ee(t).position==="static"}function Cr(t,e){if(!be(t)||ee(t).position==="fixed")return null;if(e)return e(t);let n=t.offsetParent;return ae(t)===n&&(n=n.ownerDocument.body),n}function Tr(t,e){const n=j(t);if(Gt(t))return n;if(!be(t)){let i=ze(t);for(;i&&!ht(i);){if(Q(i)&&!ss(i))return i;i=ze(i)}return n}let s=Cr(t,e);for(;s&&md(s)&&ss(s);)s=Cr(s,e);return s&&ht(s)&&ss(s)&&!Qn(s)?n:s||vd(t)||n}const Od=async function(t){const e=this.getOffsetParent||Tr,n=this.getDimensions,s=await n(t.floating);return{reference:Ld(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:s.width,height:s.height}}};function Pd(t){return ee(t).direction==="rtl"}const zd={convertOffsetParentRelativeRectToViewportRelativeRect:wd,getDocumentElement:ae,getClippingRect:Rd,getOffsetParent:Tr,getElementRects:Od,getClientRects:$d,getDimensions:_d,getScale:Ke,isElement:Q,isRTL:Pd};function Er(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function Md(t,e,n){let s=null,i;const r=ae(t);function o(){var p;clearTimeout(i),(p=s)==null||p.disconnect(),s=null}function a(p,d){p===void 0&&(p=!1),d===void 0&&(d=1),o();const h=t.getBoundingClientRect(),{left:u,top:f,width:k,height:m}=h;if(p||e(),!k||!m)return;const x=Ht(f),$=Ht(r.clientWidth-(u+k)),A=Ht(r.clientHeight-(f+m)),E=Ht(u),O={rootMargin:-x+"px "+-$+"px "+-A+"px "+-E+"px",threshold:ie(0,We(1,d))||1};let U=!0;function M(te){const Y=te[0].intersectionRatio;if(!Er(h,t.getBoundingClientRect()))return a();if(Y!==d){if(!U)return a();Y?a(!1,Y):i=setTimeout(()=>{a(!1,1e-7)},1e3)}U=!1}try{s=new IntersectionObserver(M,{...O,root:r.ownerDocument})}catch{s=new IntersectionObserver(M,O)}s.observe(t)}const l=j(t),c=()=>a(n);return l.addEventListener("resize",c),a(!0),()=>{l.removeEventListener("resize",c),o()}}function Id(t,e,n,s){s===void 0&&(s={});const{ancestorScroll:i=!0,ancestorResize:r=!0,elementResize:o=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:l=!1}=s,c=ns(t),p=i||r?[...c?ut(c):[],...e?ut(e):[]]:[];p.forEach(x=>{i&&x.addEventListener("scroll",n),r&&x.addEventListener("resize",n)});const d=c&&a?Md(c,n,r):null;let h=-1,u=null;o&&(u=new ResizeObserver(x=>{let[$]=x;$&&$.target===c&&u&&e&&(u.unobserve(e),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var A;(A=u)==null||A.observe(e)})),n()}),c&&!l&&u.observe(c),e&&u.observe(e));let f,k=l?Me(t):null;l&&m();function m(){const x=Me(t);k&&!Er(k,x)&&n(),k=x,f=requestAnimationFrame(m)}return n(),()=>{var x;p.forEach($=>{i&&$.removeEventListener("scroll",n),r&&$.removeEventListener("resize",n)}),d?.(),(x=u)==null||x.disconnect(),u=null,l&&cancelAnimationFrame(f)}}const Nd=ud,Dd=fd,jd=dd,qd=gd,Bd=(t,e,n)=>{const s=new Map,i=n??{},r={...zd,...i.platform,_c:s};return cd(t,e,{...i,platform:r})},Ud=(t,e)=>({top:e,bottom:e,right:t}),Hd=(t,e,n,s={})=>{if(typeof t.showPopover!="function")return()=>{};try{t.showPopover()}catch{return()=>{}}let i=!0,r=0;const o=e instanceof Element?e:{getBoundingClientRect:()=>({x:e.right,y:e.top,left:e.right,right:e.right,top:e.top,bottom:e.bottom,width:0,height:e.bottom-e.top})};t.style.width=`${n.width}px`,t.style.maxHeight=`${n.height}px`;const l=Id(o,t,()=>{const c=++r;Bd(o,t,{strategy:"fixed",placement:s.placement??"bottom-end",middleware:[Nd(8),jd({padding:8,fallbackAxisSideDirection:"end"}),Dd({padding:8}),qd({padding:8,apply:({availableWidth:p,availableHeight:d})=>{!i||c!==r||(t.style.width=`${Math.max(0,Math.min(n.width,p))}px`,t.style.maxHeight=`${Math.max(0,Math.min(n.height,d))}px`)}})]}).then(({x:p,y:d})=>{!i||c!==r||!t.isConnected||(t.style.left=`${p}px`,t.style.top=`${d}px`)}).catch(()=>{})},{animationFrame:s.trackTransform??!1,elementResize:typeof ResizeObserver<"u",layoutShift:typeof IntersectionObserver<"u"});return()=>{i=!1,l()}},Fd=t=>{if(!(!t||typeof t.hidePopover!="function"))try{t.hidePopover()}catch{}};class Rr{#e;#n=new Map;constructor(e){this.#e=e,e.addController(this)}hostConnected(){this.#e.requestUpdate()}hostUpdated(){for(const[e,n]of this.#n)e.isConnected||(n(),this.#n.delete(e))}hostDisconnected(){for(const e of this.#n.values())e();this.#n.clear()}open(e,n,s,i){this.#n.get(e)?.(),this.#n.set(e,Hd(e,n,s,i))}}const _r=(t,e,n)=>{typeof window>"u"||Object.assign(window,{devProcessKit:{version:t,templates:e,versionParam:n}})},ft="dpk-version",Lr="version",Wd=/^\d+\.\d+\.\d+(?:-[0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*)?$/,Jt=t=>Wd.test(t),Vd="https://cdn.jsdelivr.net/npm/dev-process-kit@",Or="https://data.jsdelivr.com/v1/packages/npm/dev-process-kit",is=t=>{const e=new URLSearchParams(t),n=e.get(ft)??e.get(Lr);return n!==null&&Jt(n)?n:null},Kd=(t,e)=>{const n=is(t);return n===null||n===e?null:n},Gd=(t,e)=>{if(!Jt(t))throw new Error(`not an exact version: ${t}`);if(!/^[a-z0-9-]+(?:\/[a-z0-9-]+)*\.js$/.test(e))throw new Error(`not an entry path: ${e}`);return`${Vd}${t}/dist/${e}`},Zd=(t,e)=>{const n=new URL(t);return n.searchParams.delete(Lr),e===null?n.searchParams.delete(ft):n.searchParams.set(ft,e),n.href},Yd=L({tags:se(He(v(),ke()),{}),versions:F(L({version:v()}))}),Jd=t=>{const e=zn(Yd,t),n=e.tags.latest;return{latest:typeof n=="string"&&Jt(n)?n:null,versions:e.versions.map(s=>s.version).filter(Jt)}},Pr=t=>{const e=t.published?.versions??[],n=e.includes(t.current)?e:[t.current,...e],s=t.published?.latest??null;return{value:t.current,options:[...t.requested?[{value:"",label:t.text.pinned}]:[],...n.map(i=>({value:i,label:i===s&&i!==t.current?t.text.latest(i):i}))]}};let Xt;const zr=()=>(Xt??=fetch(Or).then(async t=>{if(!t.ok)throw new Error(`${Or} answered ${t.status}`);return Jd(await t.json())}),Xt.catch(()=>{Xt=void 0}),Xt),Mr=t=>{location.assign(Zd(location.href,t))},Xd=t=>import(t),Qd=({entry:t,templates:e,register:n,importModule:s=Xd})=>{const i=()=>{n(),_r(X,e,ft)},r=typeof location>"u"?null:Kd(location.search,X);if(r===null){i();return}s(Gd(r,t)).then(()=>{ep()||np(r)},o=>{console.error(`dev-process-kit@${r} could not be loaded; running ${X}`,o),i()})},ep=()=>{const t=Reflect.get(window,"devProcessKit");return typeof t=="object"&&t!==null&&"versionParam"in t},rs="dpk-version-fallback",tp=`
1278
+ .${rs} {
1279
1279
  flex: none;
1280
1280
  height: 24px;
1281
1281
  margin-left: auto;
@@ -1293,29 +1293,50 @@ The brief is too long for a comment, so it is stored in this artifact's database
1293
1293
  letter-spacing: 0.02em;
1294
1294
  cursor: pointer;
1295
1295
  }
1296
- `,Jd=t=>{const e=[...document.body.querySelectorAll("*")].filter(n=>n.localName.startsWith("dpk-template-")&&!n.querySelector(`:scope > .${is}`));if(e.length!==0){document.head.append(Object.assign(document.createElement("style"),{textContent:Yd}));for(const n of e)n.append(Xd(n,t))}},Xd=(t,e)=>{const n=F(At(St(t))),s=document.createElement("select");s.className=is,s.slot="header",s.setAttribute("aria-label",n.versionLabel),s.title=n.versionLabel;const i=o=>{const a=Rr({current:e,requested:ss(location.search)!==null,published:o,text:{pinned:n.versionPinned,latest:n.versionLatest}});s.replaceChildren(...a.options.map(l=>Object.assign(document.createElement("option"),{value:l.value,textContent:l.label}))),s.value=a.value},r=()=>{_r().then(i,o=>console.warn(o))};return s.addEventListener("pointerenter",r,{once:!0}),s.addEventListener("focus",r,{once:!0}),s.addEventListener("change",()=>Lr(s.value===""?null:s.value)),i(null),s},Qd=L({value:x()}),ep=t=>e=>{if(!(e instanceof CustomEvent))return;const n=T(Qd,e.detail);n.success&&t(n.output.value)},rs=t=>e=>{const n=je(e.target,HTMLSelectElement);n!==null&&t(n.value)},tp=t=>e=>{const n=je(e.target,HTMLInputElement);n!==null&&t(n.checked)},Or="data-dpk-changes",np=/^[^:\s]+:\S+$/,sp=se({id:ne(w(x(),S(1))),title:w(x(),S(1)),body:ne(x()),target:ne(w(x(),ge(np,'target must be written "type:id"'))),navigate:ne(w(x(),Ai("=",'navigate must be written "key=value"')))}),ip=se({revision:w(x(),S(1)),changes:G(sp)}),rp=t=>{const e=T(ip,t);if(!e.success)return{ok:!1,error:Tl(e.issues)};const n=e.output.changes.map((i,r)=>({key:i.id??String(r),title:i.title,body:i.body??null,target:i.target??null,navigate:i.navigate??null}));return new Set(n.map(i=>i.key)).size!==n.length?{ok:!1,error:"change ids must be unique"}:{ok:!0,log:{revision:e.output.revision,entries:n}}},op=se({v:Re(1),revision:x(),seen:G(x())}),Pr=t=>{const e=T(op,t);return e.success?e.output:null},os={open:!1,fresh:new Set},zr=t=>e=>!t.seen.has(e.key),ap=(t,e)=>{const n=new Set(t.entries.map(i=>i.key)),s=new Set(e?.revision===t.revision?e.seen.filter(i=>n.has(i)):[]);return{seen:s,toasts:t.entries.filter(i=>!s.has(i.key)).map(i=>i.key),list:os}},Mr=(t,e)=>new Set([...t.seen,...e]),lp=(t,e,n)=>{switch(n.kind){case"open-list":{const s=new Set(t.entries.filter(zr(e)).map(i=>i.key));return{seen:Mr(e,s),toasts:[],list:{open:!0,fresh:s}}}case"close-list":return{...e,list:os};case"close-toast":return{...e,toasts:e.toasts.filter(s=>s!==n.key)};case"jump":return{seen:Mr(e,[n.key]),toasts:e.toasts.filter(s=>s!==n.key),list:os}}},cp=(t,e)=>t.entries.filter(zr(e)).length,dp=(t,e)=>({v:1,revision:t.revision,seen:t.entries.filter(n=>e.seen.has(n.key)).map(n=>n.key)}),pp=(t,e)=>t.target===null&&t.navigate===null?null:{navigate:t.navigate!==null?Dt(t.navigate):t.target!==null?e(ot(t.target)):null,target:t.target},Ir=3,hp=t=>e=>({key:e.key,title:e.title,body:e.body,jumpable:e.target!==null||e.navigate!==null,fresh:t.list.fresh.has(e.key)}),up=(t,e)=>{const n=t.entries.map(hp(e)),s=new Map(n.map(r=>[r.key,r])),i=e.toasts.flatMap(r=>{const o=s.get(r);return o?[o]:[]});return{unread:cp(t,e),open:e.list.open,cards:n,toasts:i.slice(0,Ir),waiting:Math.max(0,i.length-Ir)}},ut=t=>t==="light"||t==="dark"?t:null,Nr=t=>t.authored??t.environment,Dr=t=>t.preference??Nr(t),fp=t=>{const e=Dr(t)==="dark"?"light":"dark";return e===Nr(t)?null:e},jr=G(se({value:w(x(),ge(/^element:.+/)),label:w(x(),S(1)),group:B(x())})),gp=L({targets:jr,providers:G(L({id:w(x(),S(1)),results:G(Hi)}))}),mp=se({target:w(x(),ge(/^element:.+/)),body:w(x(),Ln(),S(1))}),qr=t=>t.group?`${t.group} \xB7 ${t.label}`:t.label,Br=(t,e,n)=>{const s=new Map(e.map(i=>[i.value,i]));return{...t,hasTarget:(i,r)=>t.hasTarget(i,r)||s.has(N(r)),commentTargets:(i,r)=>{const o=t.commentTargets(i,r),a=new Set(o.map(l=>l.value));return[...o,...e.filter(l=>!a.has(l.value))]},describe:(i,r,o)=>{if(Y(i)){const c=n.get(i.id),p=s.get(N(i.target));return{title:c?.title??i.type,...c?.summary===void 0?{}:{summary:c.summary},tone:c?.tone??"update",targetLabel:p?qr(p):i.target.id}}const a=t.describe(i,r,o),l=i.type==="comment"&&!t.hasTarget(r,i.target)?s.get(N(i.target)):void 0;return l===void 0?a:{...a,targetLabel:qr(l)}},serialize:i=>Y(i)?`${i.type} ${N(i.target)} ${JSON.stringify(i.payload)}`:t.serialize(i)}},Ur=typeof globalThis=="object"&&globalThis||typeof window=="object"&&window||typeof self=="object"&&self||typeof global=="object"&&global||(function(){return this})();function Hr(t){return typeof Ur.Buffer<"u"&&Ur.Buffer.isBuffer(t)}function Fr(t){if(!t||typeof t!="object")return!1;const e=Object.getPrototypeOf(t);return e===null||e===Object.prototype||Object.getPrototypeOf(e)===null?Object.prototype.toString.call(t)==="[object Object]":!1}function Wr(t){return Object.getOwnPropertySymbols(t).filter(e=>Object.prototype.propertyIsEnumerable.call(t,e))}function Vr(t){return t==null?t===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(t)}const kp="[object RegExp]",bp="[object String]",xp="[object Number]",vp="[object Boolean]",yp="[object Symbol]",wp="[object Date]",$p="[object Map]",Sp="[object Set]",Ap="[object Array]",Cp="[object Function]",Tp="[object ArrayBuffer]",as="[object Object]",Ep="[object Error]",Rp="[object DataView]",_p="[object Uint8Array]",Lp="[object Uint8ClampedArray]",Op="[object Uint16Array]",Pp="[object Uint32Array]",zp="[object BigUint64Array]",Mp="[object Int8Array]",Ip="[object Int16Array]",Np="[object Int32Array]",Dp="[object BigInt64Array]",jp="[object Float32Array]",qp="[object Float64Array]";function Bp(t,e){return t===e||Number.isNaN(t)&&Number.isNaN(e)}function Up(t,e,n){return ft(t,e,void 0,void 0,void 0,void 0,n)}function ft(t,e,n,s,i,r,o){const a=o(t,e,n,s,i,r);if(a!==void 0)return a;if(typeof t==typeof e)switch(typeof t){case"bigint":case"string":case"boolean":case"symbol":case"undefined":return t===e;case"number":return t===e||Object.is(t,e);case"function":return t===e;case"object":return gt(t,e,r,o)}return gt(t,e,r,o)}function gt(t,e,n,s){if(Object.is(t,e))return!0;let i=Vr(t),r=Vr(e);if(i==="[object Arguments]"&&(i=as),r==="[object Arguments]"&&(r=as),i!==r)return!1;switch(i){case bp:return t.toString()===e.toString();case xp:return Bp(t.valueOf(),e.valueOf());case vp:case wp:case yp:return Object.is(t.valueOf(),e.valueOf());case kp:return t.source===e.source&&t.flags===e.flags;case Cp:return t===e}n=n??new Map;const o=n.get(t),a=n.get(e);if(o!=null&&a!=null)return o===e;n.set(t,e),n.set(e,t);try{switch(i){case $p:if(t.size!==e.size)return!1;for(const[l,c]of t.entries())if(!e.has(l)||!ft(c,e.get(l),l,t,e,n,s))return!1;return!0;case Sp:{if(t.size!==e.size)return!1;const l=Array.from(t.values()),c=Array.from(e.values());for(let p=0;p<l.length;p++){const d=l[p],h=c.findIndex(u=>ft(d,u,void 0,t,e,n,s));if(h===-1)return!1;c.splice(h,1)}return!0}case Ap:case _p:case Lp:case Op:case Pp:case zp:case Mp:case Ip:case Np:case Dp:case jp:case qp:if(Hr(t)!==Hr(e)||t.length!==e.length)return!1;for(let l=0;l<t.length;l++)if(!ft(t[l],e[l],l,t,e,n,s))return!1;return!0;case Tp:return t.byteLength!==e.byteLength?!1:gt(new Uint8Array(t),new Uint8Array(e),n,s);case Rp:return t.byteLength!==e.byteLength||t.byteOffset!==e.byteOffset?!1:gt(new Uint8Array(t),new Uint8Array(e),n,s);case Ep:return t.name===e.name&&t.message===e.message;case as:{if(!(gt(t.constructor,e.constructor,n,s)||Fr(t)&&Fr(e)))return!1;const l=[...Object.keys(t),...Wr(t)],c=[...Object.keys(e),...Wr(e)];if(l.length!==c.length)return!1;for(let p=0;p<l.length;p++){const d=l[p],h=t[d];if(!Object.hasOwn(e,d))return!1;const u=e[d];if(!ft(h,u,d,t,e,n,s))return!1}return!0}default:return!1}}finally{n.delete(t),n.delete(e)}}function Hp(){}function Xt(t,e){return Up(t,e,Hp)}const Kr="page",Zr=t=>N(t),Gr=(t,e,n,s=new Map)=>{let i=e;const r=[],o=[],a=[],l=[],c=new Map;for(const d of n){if(d.type===D)continue;if(Y(d)){const f=s.get(d.id);f===void 0||f.stale!==void 0?o.push({action:d,reason:f?.stale??"target-missing"}):r.push(d);continue}const h=Nt(t.actions,d.type);if(!h){o.push({action:d,reason:"unsupported-action-type"});continue}const u=t.apply(i,d);if(u===null){o.push({action:d,reason:t.hasTarget(i,d.target)?"constraint-violated":"target-missing"});continue}if(h.mode!=="append"&&ls(t,i,u)){a.push(d);continue}i=u,r.push(d)}for(const d of n){if(d.type!==D)continue;if(d.target.type!==Kr&&!t.hasTarget(i,d.target)){o.push({action:d,reason:"target-missing"});continue}l.push(d);const h=Zr(d.target);c.set(h,[...c.get(h)??[],d])}const p=new Map(n.map((d,h)=>[d.id,h]));return o.sort((d,h)=>(p.get(d.action.id)??0)-(p.get(h.action.id)??0)),{base:e,state:i,actions:n,applied:r,stale:o,obsolete:a,comments:l,commentsByTarget:c}},ls=(t,e,n)=>e===n?!0:t.canonicalState===void 0?Xt(e,n):Xt(t.canonicalState(e),t.canonicalState(n)),Yr=t=>{const e=new Set(t.obsolete.map(n=>n.id));return t.actions.filter(n=>!e.has(n.id))},Fp=(t,e,n,s)=>{let i=e;const r=s??Jr(i).map(o=>o.id);for(const o of[...r].reverse())i=Wp(t,i,n,o,s!==void 0)??i;return i},Jr=t=>t.applied.filter(e=>!Y(e)),Wp=(t,e,n,s,i)=>{const r=Jr(e),o=r.findIndex(h=>h.id===s),a=r[o];if(a===void 0)return null;const l=r.slice(0,o),c=[...i?Vp(t,e.base,r,o):[],...Kp(t,l,a)],p=new Set,d=c.filter(h=>{const u=h.join(" ");return p.has(u)?!1:(p.add(u),!0)}).sort((h,u)=>u.length-h.length);for(const h of d){const u=Zp(t,e,n,h);if(u!==null)return u}return null},Vp=(t,e,n,s)=>{const i=[];let r=e;for(const o of n.slice(0,s+1))i.push(r),r=t.apply(r,o)??r;return i.flatMap((o,a)=>ls(t,o,r)?[n.slice(a,s+1).map(l=>l.id)]:[])},Kp=(t,e,n)=>{const s=Xr(n),i=e.filter(l=>Xr(l).some(c=>s.includes(c))),r=Qr(t,n),o=i.filter(l=>Qr(t,l)===r),a=l=>l.map((c,p)=>[...l.slice(p).map(d=>d.id),n.id]);return[...a(i),...a(o),...i.map(l=>[l.id,n.id]),...i.map(l=>[l.id])]},Xr=t=>{const e=t.target.type===Kr?[]:t.target.id.split("."),n=typeof t.payload=="object"&&t.payload!==null?Object.values(t.payload).filter(s=>typeof s=="string"&&s!==""):[];return[...e,...n]},Qr=(t,e)=>Nt(t.actions,e.type)?.mode,Zp=(t,e,n,s)=>{const i=new Set(e.stale.map(o=>o.action.id)),r=new Set(s);for(;;){const o=n(e.actions.filter(l=>!r.has(l.id))),a=o.stale.filter(l=>!i.has(l.action.id)).map(l=>l.action);if(a.length===0)return ls(t,o.state,e.state)?o:null;if(a.some(l=>l.type===D||Y(l)))return null;for(const l of a)r.add(l.id)}},Gp=L({v:Re(1),template:w(x(),S(1)),actions:G(me())});class cs{constructor(e){this.storage=e}load(e,n){try{const s=this.storage.getItem(e);if(s===null)return[];const i=T(Gp,JSON.parse(s));return!i.success||i.output.template!==n?[]:i.output.actions.flatMap(r=>{const o=T(_e,r);return o.success?[o.output]:[]})}catch{return[]}}save(e,n,s){const i={v:1,template:n,actions:s};try{this.storage.setItem(e,JSON.stringify(i))}catch{}}clear(e){try{this.storage.removeItem(e)}catch{}}}class ds{constructor(){this.store=new Map}load(e,n){return new cs({getItem:s=>this.store.get(s)??null,setItem:(s,i)=>{this.store.set(s,i)},removeItem:s=>{this.store.delete(s)}}).load(e,n)}save(e,n,s){this.store.set(e,JSON.stringify({v:1,template:n,actions:s}))}clear(e){this.store.delete(e)}}const ps=()=>{try{if(typeof localStorage<"u")return new cs(localStorage)}catch{}return new ds},Qt=t=>`dev-process-kit:draft:${typeof location>"u"?"local":`${location.pathname}${location.search}`}:${t}`,Yp=G(me());class eo{#e;#n;#s={targets:[],providers:[]};#r=new Map;#t;#i;#o;#a;#l;#p=new Set;#c=[];#m=0;constructor(e){this.#e=e.definition,this.#n=Br(e.definition,[],this.#r),this.#t=e.base,this.#l=e.storageKey??Qt(e.definition.name),this.#a=e.storage===void 0?ps():e.storage;const n=e.initialActions??this.#a?.load(this.#l,this.definition.name)??[];this.#i=no(this.definition,n),this.#o=this.#f(this.#i),this.#d()&&this.#y()}get definition(){return this.#n}setComponentSnapshot(e){const n=Pn(gp,e);if(!Xt(n,this.#s)){this.#s=n,this.#k(),this.#o=this.#f(this.#i);for(const s of this.#p)s()}}setTemplate(e){this.#e=e,this.#k(),this.#o=this.#f(this.#i);for(const n of this.#p)n()}#k(){this.#r=Fi(this.#i,this.#s.providers),this.#n=Br(this.#e,this.#s.targets,this.#r)}#f(e){return Gr(this.definition,this.#t,e,Fi(e,this.#s.providers))}get base(){return this.#t}get actions(){return this.#i}get derivation(){return this.#o}get lastIssues(){return this.#c}get prunedCount(){return this.#m}descriptorFor(e,n){return to(this.definition,e,n)}dispatch(e){const n=this.#x(e,this.#o.state);if(!n.ok)return this.#h([n.issue]);const s=this.descriptorFor(n.action.type,n.action.target);return s?(this.#g(In(this.#i,n.action,s),[n.action.id]),{ok:!0,id:n.action.id}):this.#h([{path:"type",message:"unknown action type"}])}dispatchBatch(e){const n=T(Yp,e);if(!n.success)return this.#h([Le(n.issues)]);const s=n.output;if(s.length===0)return{ok:!0,ids:[]};let i=this.#i,r=this.#o.state;const o=[];for(const a of s){const l=this.#x(a,r);if(!l.ok)return this.#h([l.issue]);const c=l.action,p=this.descriptorFor(c.type,c.target);if(!p)return this.#h([{path:"type",message:"unknown action type"}]);if((c.type==="comment"||Y(c)?c.target.type==="page"||this.definition.hasTarget(r,c.target)?r:null:this.definition.apply(r,c))===null)return this.#h([{path:"target",message:"batch action is not applicable"}]);i=In(i,c,p),r=this.#f(i).state,o.push(c.id)}return this.#g(i,o),{ok:!0,ids:o}}#x(e,n){const s=T(ji,e);if(!s.success)return{ok:!1,issue:Le(s.issues)};const i=this.descriptorFor(s.output.type,typeof s.output.target=="string"?zn(s.output.target,"page"):s.output.target);if(!i)return{ok:!1,issue:{path:"type",message:`unknown action type "${s.output.type}"`}};const r=Dl(s.output,i);if(!r.ok)return r;const o=this.definition.canonicalTarget?.(n,r.action.target)??r.action.target;return{ok:!0,action:{...r.action,target:o}}}#h(e){return this.#c=e,{ok:!1,issues:e}}editComment(e,n){const s=this.#i.find(a=>a.id===e);if(s?.type!==D)return this.#h([{path:"id",message:`no comment "${e}" in the draft`}]);if(at(s)===n)return{ok:!0,id:e};const i=T(Dn.schema,{...s,payload:{body:n}});if(!i.success)return this.#h([Le(i.issues)]);const r=T(_e,i.output);if(!r.success)return this.#h([Le(r.issues)]);const o=r.output;return this.#g(this.#i.map(a=>a===s?o:a),[]),{ok:!0,id:e}}removeAction(e){const n=this.#i.filter(s=>s.id!==e);n.length!==this.#i.length&&this.#g(n)}clearActions(){this.#i.length>0&&this.#g([])}replaceActions(e){this.#g(no(this.definition,e))}setBase(e){this.#t=e,this.#g(this.#i)}subscribe(e){return this.#p.add(e),()=>{this.#p.delete(e)}}exportDraft(e){return{template:this.definition.name,frameworkVersion:e,exportedAt:new Date().toISOString(),actions:this.#i}}#g(e,n){this.#c=[],this.#i=e,this.#k(),this.#o=this.#f(this.#i),this.#d(n),this.#y();for(const s of this.#p)s()}#d(e){const n=this.#u(),s=Fp(this.definition,this.#o,i=>this.#f(i),e);return s===this.#o?n:(this.#m+=this.#i.length-s.actions.length,this.#i=[...s.actions],this.#k(),this.#o=this.#f(this.#i),this.#u(),!0)}#u(){return this.#o.obsolete.length===0?!1:(this.#m+=this.#o.obsolete.length,this.#i=Yr(this.#o),this.#k(),this.#o=this.#f(this.#i),!0)}#y(){this.#a?.save(this.#l,this.definition.name,this.#i)}}const to=(t,e,n)=>e==="comment"?Dn:n!==void 0&&Y({type:e,target:n})?Hl:Nt(t.actions,e),no=(t,e)=>e.flatMap(n=>{const s=T(_e,n);if(!s.success)return[];const i=s.output,r=to(t,i.type,i.target);if(!r)return[];const o=T(r.schema,i);if(!o.success)return[];const a=T(_e,o.output);return a.success?[a.output]:[]}),Jp=()=>({status:{kind:"idle"},request:0}),Xp=(t,e)=>{switch(e.kind){case"copy-started":return{status:{kind:"copying"},request:t.request+1};case"send-started":return{status:{kind:"sending"},request:t.request+1};case"copy-finished":return e.request!==t.request||t.status.kind!=="copying"?t:{...t,status:{kind:e.ok?"copied":"copy-failed"}};case"send-finished":return e.request!==t.request||t.status.kind!=="sending"?t:{...t,status:e.outcome.ok?{kind:"sent"}:{kind:"send-failed",reason:e.outcome.reason}};case"settled":return e.request===t.request?{...t,status:{kind:"idle"}}:t}},Qp=(t,e)=>{if(t.actions===0||t.railOpen)return null;const n=F(t.locale),s=e.status;return{send:t.sendable?{label:s.kind==="sending"?n.handoffSending:s.kind==="sent"?n.handoffSent:n.handoffSend,disabled:s.kind==="sending"}:null,copy:s.kind==="copied"?{label:n.handoffCopied,status:"copied"}:s.kind==="copy-failed"?{label:n.handoffCopyFailed,status:"failed"}:{label:n.handoffCopy,status:"idle"},note:s.kind==="send-failed"?Wn(s.reason,t.locale):null}},so=t=>{const e=t.derivation();return{base:e.base,state:e.state,navigation:t.navigation(),actions:t.controller().actions,comments:e.comments,stale:e.stale,issues:t.issues()}},eh=t=>{const e=t.derivation();return{state:e.state,base:e.base,navigation:t.navigation(),actions:t.controller().actions,comments:e.comments,stale:e.stale,commentCount:n=>{const s=typeof n=="string"?n:N(n);return e.commentsByTarget.get(s)?.length??0},dispatch:n=>t.dispatch(n),dispatchBatch:n=>t.dispatchBatch(n),navigate:(n,s)=>t.navigate(n,s),hashFor:n=>t.hashFor(n),requestComment:n=>t.requestComment(n)}},th=(t,e)=>{const n=()=>so(t);return{version:J,template:t.definition.name,host:e,ready:t.ready,get base(){return t.controller().base},get state(){return t.derivation().state},get navigation(){return t.navigation()},get actions(){return t.controller().actions},get comments(){return t.derivation().comments},get stale(){return t.derivation().stale},get issues(){return t.issues()},dispatch:s=>t.dispatch(s),dispatchBatch:s=>t.dispatchBatch(s),comment:(s,i)=>t.dispatch({type:D,target:s,payload:{body:i}}),editComment:(s,i)=>t.editComment(s,i),removeAction:s=>t.removeAction(s),clearActions:()=>t.clearActions(),importDraft:s=>t.controller().replaceActions(s),navigate:(s,i)=>t.navigate(s,i),hashFor:s=>t.hashFor(s),snapshot:n,exportDraft:()=>t.controller().exportDraft(J),exportBrief:()=>Hn(n(),t.controller().definition,J),subscribe:s=>t.subscribe(s)}},hs=(t,e)=>({read(n){try{const s=t.getItem(n);return s===null?null:e(JSON.parse(s))}catch{return null}},write(n,s){try{return t.setItem(n,JSON.stringify(s)),!0}catch{return!1}},remove(n){try{t.removeItem(n)}catch{}}}),le=t=>{const e=new Map;return hs({getItem:n=>e.get(n)??null,setItem:(n,s)=>{e.set(n,s)},removeItem:n=>{e.delete(n)}},t)},Ke=t=>{try{if(typeof localStorage<"u")return hs(localStorage,t)}catch{}return le(t)},nh=t=>{try{if(typeof sessionStorage<"u")return hs(sessionStorage,t)}catch{}return le(t)},sh=8e3,ih=t=>t.localName==="script"&&t.getAttribute("type")==="application/json"&&t.hasAttribute(Or);class rh{#e;#n;#s=null;#r=null;#t=null;#i=null;#o=null;#a=new Map;#l=new Set;constructor(e,n){this.#e=e,this.#n=n,e.addController(this)}get view(){return this.#s&&this.#t?up(this.#s,this.#t):null}get revision(){return this.#s?.revision??""}get error(){return this.#r}hostConnected(){!this.#c()&&!this.#m()&&this.#f(),document.addEventListener("pointerdown",this.#d,!0),document.addEventListener("keydown",this.#u)}hostUpdate(){!this.#c()&&this.#m()&&this.#x()}hostDisconnected(){this.#x(),document.removeEventListener("pointerdown",this.#d,!0),document.removeEventListener("keydown",this.#u);for(const e of this.#a.values())e.handle!==null&&clearTimeout(e.handle);this.#a.clear()}send(e){if(!this.#s||!this.#t)return;const n=this.#t;this.#t=lp(this.#s,n,e),this.#t.seen.size!==n.seen.size&&this.#i?.write(this.#p(),dp(this.#s,this.#t)),this.#h(),this.#e.requestUpdate()}toggleList(){this.send({kind:this.#t?.list.open?"close-list":"open-list"})}show(e){const n=this.#s?.entries.find(s=>s.key===e);n&&(this.send({kind:"jump",key:e}),this.#n.show(n))}pause(e){const n=this.#l.size>0;if(this.#l.add(e),n)return;const s=Date.now();for(const i of this.#a.values())i.handle!==null&&clearTimeout(i.handle),i.handle=null,i.remaining=Math.max(0,i.deadline-s)}resume(e){if(!(!this.#l.delete(e)||this.#l.size>0))for(const[n,s]of this.#a)this.#g(n,s)}#p(){return`${this.#n.storageKey()}:seen-changes`}#c(){return this.#s!==null||this.#r!==null}#m(){const e=[...this.#e.children].find(ih);if(!e)return!1;let n;try{n=JSON.parse(e.textContent??"")}catch(i){return this.#k(i instanceof Error?i.message:String(i))}const s=rp(n);return s.ok?(this.#s=s.log,this.#i=this.#n.persist()?Ke(Pr):le(Pr),this.#t=ap(s.log,this.#i.read(this.#p())),this.#h(),this.#e.requestUpdate(),!0):this.#k(s.error)}#k(e){return console.error("[dev-process-kit] invalid change log:",e),this.#r=e,this.#e.requestUpdate(),!0}#f(){this.#o=new MutationObserver(()=>{(this.#c()||this.#m())&&this.#x()}),this.#o.observe(this.#e,{childList:!0})}#x(){this.#o?.disconnect(),this.#o=null}#h(){const e=new Set(this.view?.toasts.map(n=>n.key)??[]);for(const[n,s]of this.#a)e.has(n)||(s.handle!==null&&clearTimeout(s.handle),this.#a.delete(n));for(const n of e){if(this.#a.has(n))continue;const s={handle:null,deadline:0,remaining:sh};this.#a.set(n,s),this.#l.size===0&&this.#g(n,s)}}#g(e,n){n.deadline=Date.now()+n.remaining,n.handle=setTimeout(()=>{n.handle=null,this.send({kind:"close-toast",key:e})},n.remaining)}#d=e=>{!this.#t?.list.open||this.#n.inside(e.composedPath())||this.send({kind:"close-list"})};#u=e=>{e.key!=="Escape"||!this.#t?.list.open||this.send({kind:"close-list"})}}const en="dpk-changes",oh=(t,e,n)=>{const s=t.unread>0?e.changesUnread(t.unread):e.changes;return b`<button
1296
+ `,np=t=>{const e=[...document.body.querySelectorAll("*")].filter(n=>n.localName.startsWith("dpk-template-")&&!n.querySelector(`:scope > .${rs}`));if(e.length!==0){document.head.append(Object.assign(document.createElement("style"),{textContent:tp}));for(const n of e)n.append(sp(n,t))}},sp=(t,e)=>{const n=W(Et(Tt(t))),s=document.createElement("select");s.className=rs,s.slot="header",s.setAttribute("aria-label",n.versionLabel),s.title=n.versionLabel;const i=o=>{const a=Pr({current:e,requested:is(location.search)!==null,published:o,text:{pinned:n.versionPinned,latest:n.versionLatest}});s.replaceChildren(...a.options.map(l=>Object.assign(document.createElement("option"),{value:l.value,textContent:l.label}))),s.value=a.value},r=()=>{zr().then(i,o=>console.warn(o))};return s.addEventListener("pointerenter",r,{once:!0}),s.addEventListener("focus",r,{once:!0}),s.addEventListener("change",()=>Mr(s.value===""?null:s.value)),i(null),s},ip=L({value:v()}),rp=t=>e=>{if(!(e instanceof CustomEvent))return;const n=C(ip,e.detail);n.success&&t(n.output.value)},os=t=>e=>{const n=je(e.target,HTMLSelectElement);n!==null&&t(n.value)},op=t=>e=>{const n=je(e.target,HTMLInputElement);n!==null&&t(n.checked)},Ir="data-dpk-changes",ap=/^[^:\s]+:\S+$/,lp=Z({id:se(w(v(),S(1))),title:w(v(),S(1)),body:se(v()),target:se(w(v(),ge(ap,'target must be written "type:id"'))),navigate:se(w(v(),Ei("=",'navigate must be written "key=value"')))}),cp=F(lp),dp=w(v(),S(1)),Nr=Z({revision:dp,changes:cp}),pp=Z({revisions:w(F(Nr),S(1,"list at least one version"))}),hp=(t,e)=>JSON.stringify([t,e]),gt=t=>[...t.earlier,t.latest],up=t=>{const e=t.changes.map((s,i)=>{const r=s.id??String(i);return{key:hp(t.revision,r),id:r,revision:t.revision,title:s.title,body:s.body??null,target:s.target??null,navigate:s.navigate??null}});return new Set(e.map(s=>s.id)).size!==e.length?`change ids must be unique within version "${t.revision}"`:{revision:t.revision,entries:e}},fp=t=>{const e=typeof t=="object"&&t!==null&&"revisions"in t,n=C(e?pp:Nr,t);if(!n.success)return{ok:!1,error:Pl(n.issues)};const s=n.output,i="revisions"in s?s.revisions:[s],r=[];for(const a of i){if(r.some(c=>c.revision===a.revision))return{ok:!1,error:`version "${a.revision}" is listed twice`};const l=up(a);if(typeof l=="string")return{ok:!1,error:l};r.push(l)}const o=r.pop();return o?{ok:!0,log:{earlier:r,latest:o}}:{ok:!1,error:"list at least one version"}},gp=Z({v:me(1),revision:v(),seen:F(v())}),mp=Z({v:me(2),since:v(),seen:He(v(),F(v()))}),Dr=t=>{const e=C(mp,t);if(e.success)return e.output;const n=C(gp,t);return n.success?{v:2,since:n.output.revision,seen:{[n.output.revision]:n.output.seen}}:null},as={open:!1,fresh:new Set},jr=t=>e=>t.told.has(e.revision)&&!t.seen.has(e.key),ls=(t,e)=>gt(t).flatMap(n=>n.entries.filter(jr(e))),qr=t=>t.target!==null||t.navigate!==null,kp=(t,e)=>{const n=gt(t),s=e===null?-1:n.findIndex(o=>o.revision===e.since),i=e===null?[t.latest]:n.slice(Math.max(0,s)),r=new Set(i.flatMap(o=>{const a=new Set(e?.seen[o.revision]??[]);return o.entries.filter(l=>a.has(l.id)).map(l=>l.key)}));return{told:new Set(i.map(o=>o.revision)),seen:r,toasts:t.latest.entries.filter(o=>!r.has(o.key)).map(o=>o.key),list:as}},cs=(t,e)=>new Set([...t.seen,...e]),bp=(t,e,n)=>{switch(n.kind){case"open-list":{const s=ls(t,e),i=new Set(s.map(o=>o.key)),r=s.filter(o=>!qr(o)).map(o=>o.key);return{...e,seen:cs(e,r),toasts:[],list:{open:!0,fresh:i}}}case"close-list":return{...e,list:as};case"close-toast":return{...e,toasts:e.toasts.filter(s=>s!==n.key)};case"jump":return{...e,seen:cs(e,[n.key]),toasts:e.toasts.filter(s=>s!==n.key),list:as};case"read-all":return{...e,seen:cs(e,ls(t,e).map(s=>s.key)),toasts:[],list:{open:e.list.open,fresh:new Set}}}},vp=(t,e)=>ls(t,e).length,xp=(t,e)=>{const n=gt(t),s=n.findIndex(o=>e.told.has(o.revision)&&o.entries.some(jr(e))),i=s===-1?n.length-1:s,r=n.slice(i).flatMap(o=>{const a=o.entries.filter(l=>e.seen.has(l.key)).map(l=>l.id);return a.length>0?[[o.revision,a]]:[]});return{v:2,since:n[i]?.revision??t.latest.revision,seen:Object.fromEntries(r)}},yp=(t,e)=>t.target===null&&t.navigate===null?null:{navigate:t.navigate!==null?qt(t.navigate):t.target!==null?e(at(t.target)):null,target:t.target},Br=3,wp=t=>e=>({key:e.key,id:e.id,revision:e.revision,title:e.title,body:e.body,jumpable:qr(e),fresh:t.list.fresh.has(e.key)}),$p=(t,e)=>{const n=gt(t).map(r=>({revision:r.revision,latest:r===t.latest,cards:r.entries.map(wp(e))})).reverse(),s=new Map(n.flatMap(r=>r.cards.map(o=>[o.key,o]))),i=e.toasts.flatMap(r=>{const o=s.get(r);return o?[o]:[]});return{unread:vp(t,e),open:e.list.open,groups:n,toasts:i.slice(0,Br),waiting:Math.max(0,i.length-Br)}},mt=t=>t==="light"||t==="dark"?t:null,Ur=t=>t.authored??t.environment,Hr=t=>t.preference??Ur(t),Sp=t=>{const e=Hr(t)==="dark"?"light":"dark";return e===Ur(t)?null:e},Fr=F(Z({value:w(v(),ge(/^element:.+/)),label:w(v(),S(1)),group:B(v())})),Ap=L({targets:Fr,providers:F(L({id:w(v(),S(1)),results:F(Vi)}))}),Cp=Z({target:w(v(),ge(/^element:.+/)),body:w(v(),On(),S(1))}),Wr=t=>t.group?`${t.group} \xB7 ${t.label}`:t.label,Vr=(t,e,n)=>{const s=new Map(e.map(i=>[i.value,i]));return{...t,hasTarget:(i,r)=>t.hasTarget(i,r)||s.has(N(r)),commentTargets:(i,r)=>{const o=t.commentTargets(i,r),a=new Set(o.map(l=>l.value));return[...o,...e.filter(l=>!a.has(l.value))]},describe:(i,r,o)=>{if(J(i)){const c=n.get(i.id),p=s.get(N(i.target));return{title:c?.title??i.type,...c?.summary===void 0?{}:{summary:c.summary},tone:c?.tone??"update",targetLabel:p?Wr(p):i.target.id}}const a=t.describe(i,r,o),l=i.type==="comment"&&!t.hasTarget(r,i.target)?s.get(N(i.target)):void 0;return l===void 0?a:{...a,targetLabel:Wr(l)}},serialize:i=>J(i)?`${i.type} ${N(i.target)} ${JSON.stringify(i.payload)}`:t.serialize(i)}},Kr=typeof globalThis=="object"&&globalThis||typeof window=="object"&&window||typeof self=="object"&&self||typeof global=="object"&&global||(function(){return this})();function Gr(t){return typeof Kr.Buffer<"u"&&Kr.Buffer.isBuffer(t)}function Zr(t){if(!t||typeof t!="object")return!1;const e=Object.getPrototypeOf(t);return e===null||e===Object.prototype||Object.getPrototypeOf(e)===null?Object.prototype.toString.call(t)==="[object Object]":!1}function Yr(t){return Object.getOwnPropertySymbols(t).filter(e=>Object.prototype.propertyIsEnumerable.call(t,e))}function Jr(t){return t==null?t===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(t)}const Tp="[object RegExp]",Ep="[object String]",Rp="[object Number]",_p="[object Boolean]",Lp="[object Symbol]",Op="[object Date]",Pp="[object Map]",zp="[object Set]",Mp="[object Array]",Ip="[object Function]",Np="[object ArrayBuffer]",ds="[object Object]",Dp="[object Error]",jp="[object DataView]",qp="[object Uint8Array]",Bp="[object Uint8ClampedArray]",Up="[object Uint16Array]",Hp="[object Uint32Array]",Fp="[object BigUint64Array]",Wp="[object Int8Array]",Vp="[object Int16Array]",Kp="[object Int32Array]",Gp="[object BigInt64Array]",Zp="[object Float32Array]",Yp="[object Float64Array]";function Jp(t,e){return t===e||Number.isNaN(t)&&Number.isNaN(e)}function Xp(t,e,n){return kt(t,e,void 0,void 0,void 0,void 0,n)}function kt(t,e,n,s,i,r,o){const a=o(t,e,n,s,i,r);if(a!==void 0)return a;if(typeof t==typeof e)switch(typeof t){case"bigint":case"string":case"boolean":case"symbol":case"undefined":return t===e;case"number":return t===e||Object.is(t,e);case"function":return t===e;case"object":return bt(t,e,r,o)}return bt(t,e,r,o)}function bt(t,e,n,s){if(Object.is(t,e))return!0;let i=Jr(t),r=Jr(e);if(i==="[object Arguments]"&&(i=ds),r==="[object Arguments]"&&(r=ds),i!==r)return!1;switch(i){case Ep:return t.toString()===e.toString();case Rp:return Jp(t.valueOf(),e.valueOf());case _p:case Op:case Lp:return Object.is(t.valueOf(),e.valueOf());case Tp:return t.source===e.source&&t.flags===e.flags;case Ip:return t===e}n=n??new Map;const o=n.get(t),a=n.get(e);if(o!=null&&a!=null)return o===e;n.set(t,e),n.set(e,t);try{switch(i){case Pp:if(t.size!==e.size)return!1;for(const[l,c]of t.entries())if(!e.has(l)||!kt(c,e.get(l),l,t,e,n,s))return!1;return!0;case zp:{if(t.size!==e.size)return!1;const l=Array.from(t.values()),c=Array.from(e.values());for(let p=0;p<l.length;p++){const d=l[p],h=c.findIndex(u=>kt(d,u,void 0,t,e,n,s));if(h===-1)return!1;c.splice(h,1)}return!0}case Mp:case qp:case Bp:case Up:case Hp:case Fp:case Wp:case Vp:case Kp:case Gp:case Zp:case Yp:if(Gr(t)!==Gr(e)||t.length!==e.length)return!1;for(let l=0;l<t.length;l++)if(!kt(t[l],e[l],l,t,e,n,s))return!1;return!0;case Np:return t.byteLength!==e.byteLength?!1:bt(new Uint8Array(t),new Uint8Array(e),n,s);case jp:return t.byteLength!==e.byteLength||t.byteOffset!==e.byteOffset?!1:bt(new Uint8Array(t),new Uint8Array(e),n,s);case Dp:return t.name===e.name&&t.message===e.message;case ds:{if(!(bt(t.constructor,e.constructor,n,s)||Zr(t)&&Zr(e)))return!1;const l=[...Object.keys(t),...Yr(t)],c=[...Object.keys(e),...Yr(e)];if(l.length!==c.length)return!1;for(let p=0;p<l.length;p++){const d=l[p],h=t[d];if(!Object.hasOwn(e,d))return!1;const u=e[d];if(!kt(h,u,d,t,e,n,s))return!1}return!0}default:return!1}}finally{n.delete(t),n.delete(e)}}function Qp(){}function Qt(t,e){return Xp(t,e,Qp)}const Xr="page",Qr=t=>N(t),eo=(t,e,n,s=new Map)=>{let i=e;const r=[],o=[],a=[],l=[],c=new Map;for(const d of n){if(d.type===D)continue;if(J(d)){const f=s.get(d.id);f===void 0||f.stale!==void 0?o.push({action:d,reason:f?.stale??"target-missing"}):r.push(d);continue}const h=jt(t.actions,d.type);if(!h){o.push({action:d,reason:"unsupported-action-type"});continue}const u=t.apply(i,d);if(u===null){o.push({action:d,reason:t.hasTarget(i,d.target)?"constraint-violated":"target-missing"});continue}if(h.mode!=="append"&&ps(t,i,u)){a.push(d);continue}i=u,r.push(d)}for(const d of n){if(d.type!==D)continue;if(d.target.type!==Xr&&!t.hasTarget(i,d.target)){o.push({action:d,reason:"target-missing"});continue}l.push(d);const h=Qr(d.target);c.set(h,[...c.get(h)??[],d])}const p=new Map(n.map((d,h)=>[d.id,h]));return o.sort((d,h)=>(p.get(d.action.id)??0)-(p.get(h.action.id)??0)),{base:e,state:i,actions:n,applied:r,stale:o,obsolete:a,comments:l,commentsByTarget:c}},ps=(t,e,n)=>e===n?!0:t.canonicalState===void 0?Qt(e,n):Qt(t.canonicalState(e),t.canonicalState(n)),to=t=>{const e=new Set(t.obsolete.map(n=>n.id));return t.actions.filter(n=>!e.has(n.id))},eh=(t,e,n,s)=>{let i=e;const r=s??no(i).map(o=>o.id);for(const o of[...r].reverse())i=th(t,i,n,o,s!==void 0)??i;return i},no=t=>t.applied.filter(e=>!J(e)),th=(t,e,n,s,i)=>{const r=no(e),o=r.findIndex(h=>h.id===s),a=r[o];if(a===void 0)return null;const l=r.slice(0,o),c=[...i?nh(t,e.base,r,o):[],...sh(t,l,a)],p=new Set,d=c.filter(h=>{const u=h.join(" ");return p.has(u)?!1:(p.add(u),!0)}).sort((h,u)=>u.length-h.length);for(const h of d){const u=ih(t,e,n,h);if(u!==null)return u}return null},nh=(t,e,n,s)=>{const i=[];let r=e;for(const o of n.slice(0,s+1))i.push(r),r=t.apply(r,o)??r;return i.flatMap((o,a)=>ps(t,o,r)?[n.slice(a,s+1).map(l=>l.id)]:[])},sh=(t,e,n)=>{const s=so(n),i=e.filter(l=>so(l).some(c=>s.includes(c))),r=io(t,n),o=i.filter(l=>io(t,l)===r),a=l=>l.map((c,p)=>[...l.slice(p).map(d=>d.id),n.id]);return[...a(i),...a(o),...i.map(l=>[l.id,n.id]),...i.map(l=>[l.id])]},so=t=>{const e=t.target.type===Xr?[]:t.target.id.split("."),n=typeof t.payload=="object"&&t.payload!==null?Object.values(t.payload).filter(s=>typeof s=="string"&&s!==""):[];return[...e,...n]},io=(t,e)=>jt(t.actions,e.type)?.mode,ih=(t,e,n,s)=>{const i=new Set(e.stale.map(o=>o.action.id)),r=new Set(s);for(;;){const o=n(e.actions.filter(l=>!r.has(l.id))),a=o.stale.filter(l=>!i.has(l.action.id)).map(l=>l.action);if(a.length===0)return ps(t,o.state,e.state)?o:null;if(a.some(l=>l.type===D||J(l)))return null;for(const l of a)r.add(l.id)}},rh=L({v:me(1),template:w(v(),S(1)),actions:F(ke())});class hs{constructor(e){this.storage=e}load(e,n){try{const s=this.storage.getItem(e);if(s===null)return[];const i=C(rh,JSON.parse(s));return!i.success||i.output.template!==n?[]:i.output.actions.flatMap(r=>{const o=C(_e,r);return o.success?[o.output]:[]})}catch{return[]}}save(e,n,s){const i={v:1,template:n,actions:s};try{this.storage.setItem(e,JSON.stringify(i))}catch{}}clear(e){try{this.storage.removeItem(e)}catch{}}}class us{constructor(){this.store=new Map}load(e,n){return new hs({getItem:s=>this.store.get(s)??null,setItem:(s,i)=>{this.store.set(s,i)},removeItem:s=>{this.store.delete(s)}}).load(e,n)}save(e,n,s){this.store.set(e,JSON.stringify({v:1,template:n,actions:s}))}clear(e){this.store.delete(e)}}const fs=()=>{try{if(typeof localStorage<"u")return new hs(localStorage)}catch{}return new us},en=t=>`dev-process-kit:draft:${typeof location>"u"?"local":`${location.pathname}${location.search}`}:${t}`,oh=F(ke());class ro{#e;#n;#s={targets:[],providers:[]};#r=new Map;#t;#i;#o;#l;#a;#c=new Set;#p=[];#m=0;constructor(e){this.#e=e.definition,this.#n=Vr(e.definition,[],this.#r),this.#t=e.base,this.#a=e.storageKey??en(e.definition.name),this.#l=e.storage===void 0?fs():e.storage;const n=e.initialActions??this.#l?.load(this.#a,this.definition.name)??[];this.#i=ao(this.definition,n),this.#o=this.#h(this.#i),this.#d()&&this.#b()}get definition(){return this.#n}setComponentSnapshot(e){const n=zn(Ap,e);if(!Qt(n,this.#s)){this.#s=n,this.#k(),this.#o=this.#h(this.#i);for(const s of this.#c)s()}}setTemplate(e){this.#e=e,this.#k(),this.#o=this.#h(this.#i);for(const n of this.#c)n()}#k(){this.#r=Ki(this.#i,this.#s.providers),this.#n=Vr(this.#e,this.#s.targets,this.#r)}#h(e){return eo(this.definition,this.#t,e,Ki(e,this.#s.providers))}get base(){return this.#t}get actions(){return this.#i}get derivation(){return this.#o}get lastIssues(){return this.#p}get prunedCount(){return this.#m}descriptorFor(e,n){return oo(this.definition,e,n)}dispatch(e){const n=this.#x(e,this.#o.state);if(!n.ok)return this.#g([n.issue]);const s=this.descriptorFor(n.action.type,n.action.target);return s?(this.#u(Nn(this.#i,n.action,s),[n.action.id]),{ok:!0,id:n.action.id}):this.#g([{path:"type",message:"unknown action type"}])}dispatchBatch(e){const n=C(oh,e);if(!n.success)return this.#g([Le(n.issues)]);const s=n.output;if(s.length===0)return{ok:!0,ids:[]};let i=this.#i,r=this.#o.state;const o=[];for(const a of s){const l=this.#x(a,r);if(!l.ok)return this.#g([l.issue]);const c=l.action,p=this.descriptorFor(c.type,c.target);if(!p)return this.#g([{path:"type",message:"unknown action type"}]);if((c.type==="comment"||J(c)?c.target.type==="page"||this.definition.hasTarget(r,c.target)?r:null:this.definition.apply(r,c))===null)return this.#g([{path:"target",message:"batch action is not applicable"}]);i=Nn(i,c,p),r=this.#h(i).state,o.push(c.id)}return this.#u(i,o),{ok:!0,ids:o}}#x(e,n){const s=C(Ui,e);if(!s.success)return{ok:!1,issue:Le(s.issues)};const i=this.descriptorFor(s.output.type,typeof s.output.target=="string"?Mn(s.output.target,"page"):s.output.target);if(!i)return{ok:!1,issue:{path:"type",message:`unknown action type "${s.output.type}"`}};const r=Fl(s.output,i);if(!r.ok)return r;const o=this.definition.canonicalTarget?.(n,r.action.target)??r.action.target;return{ok:!0,action:{...r.action,target:o}}}#g(e){return this.#p=e,{ok:!1,issues:e}}editComment(e,n){const s=this.#i.find(a=>a.id===e);if(s?.type!==D)return this.#g([{path:"id",message:`no comment "${e}" in the draft`}]);if(lt(s)===n)return{ok:!0,id:e};const i=C(jn.schema,{...s,payload:{body:n}});if(!i.success)return this.#g([Le(i.issues)]);const r=C(_e,i.output);if(!r.success)return this.#g([Le(r.issues)]);const o=r.output;return this.#u(this.#i.map(a=>a===s?o:a),[]),{ok:!0,id:e}}removeAction(e){const n=this.#i.filter(s=>s.id!==e);n.length!==this.#i.length&&this.#u(n)}clearActions(){this.#i.length>0&&this.#u([])}replaceActions(e){this.#u(ao(this.definition,e))}setBase(e){this.#t=e,this.#u(this.#i)}subscribe(e){return this.#c.add(e),()=>{this.#c.delete(e)}}exportDraft(e){return{template:this.definition.name,frameworkVersion:e,exportedAt:new Date().toISOString(),actions:this.#i}}#u(e,n){this.#p=[],this.#i=e,this.#k(),this.#o=this.#h(this.#i),this.#d(n),this.#b();for(const s of this.#c)s()}#d(e){const n=this.#f(),s=eh(this.definition,this.#o,i=>this.#h(i),e);return s===this.#o?n:(this.#m+=this.#i.length-s.actions.length,this.#i=[...s.actions],this.#k(),this.#o=this.#h(this.#i),this.#f(),!0)}#f(){return this.#o.obsolete.length===0?!1:(this.#m+=this.#o.obsolete.length,this.#i=to(this.#o),this.#k(),this.#o=this.#h(this.#i),!0)}#b(){this.#l?.save(this.#a,this.definition.name,this.#i)}}const oo=(t,e,n)=>e==="comment"?jn:n!==void 0&&J({type:e,target:n})?Zl:jt(t.actions,e),ao=(t,e)=>e.flatMap(n=>{const s=C(_e,n);if(!s.success)return[];const i=s.output,r=oo(t,i.type,i.target);if(!r)return[];const o=C(r.schema,i);if(!o.success)return[];const a=C(_e,o.output);return a.success?[a.output]:[]}),ah=()=>({status:{kind:"idle"},request:0}),lh=(t,e)=>{switch(e.kind){case"copy-started":return{status:{kind:"copying"},request:t.request+1};case"send-started":return{status:{kind:"sending"},request:t.request+1};case"copy-finished":return e.request!==t.request||t.status.kind!=="copying"?t:{...t,status:{kind:e.ok?"copied":"copy-failed"}};case"send-finished":return e.request!==t.request||t.status.kind!=="sending"?t:{...t,status:e.outcome.ok?{kind:"sent"}:{kind:"send-failed",reason:e.outcome.reason}};case"settled":return e.request===t.request?{...t,status:{kind:"idle"}}:t}},ch=(t,e)=>{if(t.actions===0||t.railOpen)return null;const n=W(t.locale),s=e.status;return{send:t.sendable?{label:s.kind==="sending"?n.handoffSending:s.kind==="sent"?n.handoffSent:n.handoffSend,disabled:s.kind==="sending"}:null,copy:s.kind==="copied"?{label:n.handoffCopied,status:"copied"}:s.kind==="copy-failed"?{label:n.handoffCopyFailed,status:"failed"}:{label:n.handoffCopy,status:"idle"},note:s.kind==="send-failed"?Vn(s.reason,t.locale):null}},lo=t=>{const e=t.derivation();return{base:e.base,state:e.state,navigation:t.navigation(),actions:t.controller().actions,comments:e.comments,stale:e.stale,issues:t.issues()}},dh=t=>{const e=t.derivation();return{state:e.state,base:e.base,navigation:t.navigation(),actions:t.controller().actions,comments:e.comments,stale:e.stale,commentCount:n=>{const s=typeof n=="string"?n:N(n);return e.commentsByTarget.get(s)?.length??0},dispatch:n=>t.dispatch(n),dispatchBatch:n=>t.dispatchBatch(n),navigate:(n,s)=>t.navigate(n,s),hashFor:n=>t.hashFor(n),requestComment:n=>t.requestComment(n)}},ph=(t,e)=>{const n=()=>lo(t);return{version:X,template:t.definition.name,host:e,ready:t.ready,get base(){return t.controller().base},get state(){return t.derivation().state},get navigation(){return t.navigation()},get actions(){return t.controller().actions},get comments(){return t.derivation().comments},get stale(){return t.derivation().stale},get issues(){return t.issues()},dispatch:s=>t.dispatch(s),dispatchBatch:s=>t.dispatchBatch(s),comment:(s,i)=>t.dispatch({type:D,target:s,payload:{body:i}}),editComment:(s,i)=>t.editComment(s,i),removeAction:s=>t.removeAction(s),clearActions:()=>t.clearActions(),importDraft:s=>t.controller().replaceActions(s),navigate:(s,i)=>t.navigate(s,i),hashFor:s=>t.hashFor(s),snapshot:n,exportDraft:()=>t.controller().exportDraft(X),exportBrief:()=>Fn(n(),t.controller().definition,X),subscribe:s=>t.subscribe(s)}},gs=(t,e)=>({read(n){try{const s=t.getItem(n);return s===null?null:e(JSON.parse(s))}catch{return null}},write(n,s){try{return t.setItem(n,JSON.stringify(s)),!0}catch{return!1}},remove(n){try{t.removeItem(n)}catch{}}}),le=t=>{const e=new Map;return gs({getItem:n=>e.get(n)??null,setItem:(n,s)=>{e.set(n,s)},removeItem:n=>{e.delete(n)}},t)},Ge=t=>{try{if(typeof localStorage<"u")return gs(localStorage,t)}catch{}return le(t)},hh=t=>{try{if(typeof sessionStorage<"u")return gs(sessionStorage,t)}catch{}return le(t)},uh=8e3,fh=t=>t.localName==="script"&&t.getAttribute("type")==="application/json"&&t.hasAttribute(Ir);class gh{#e;#n;#s=null;#r=null;#t=null;#i=null;#o="";#l=null;#a=new Map;#c=new Set;constructor(e,n){this.#e=e,this.#n=n,e.addController(this)}get view(){return this.#s&&this.#t?$p(this.#s,this.#t):null}get error(){return this.#r}hostConnected(){!this.#m()&&!this.#k()&&this.#g(),document.addEventListener("pointerdown",this.#b,!0),document.addEventListener("keydown",this.#w)}hostUpdate(){!this.#m()&&this.#k()&&this.#u()}hostDisconnected(){this.#u(),document.removeEventListener("pointerdown",this.#b,!0),document.removeEventListener("keydown",this.#w);for(const e of this.#a.values())e.handle!==null&&clearTimeout(e.handle);this.#a.clear()}send(e){!this.#s||!this.#t||(this.#t=bp(this.#s,this.#t,e),this.#h(),this.#d(),this.#e.requestUpdate())}toggleList(){this.send({kind:this.#t?.list.open?"close-list":"open-list"})}show(e){const n=this.#s?gt(this.#s).flatMap(s=>s.entries).find(s=>s.key===e):void 0;n&&(this.send({kind:"jump",key:e}),this.#n.show(n))}pause(e){const n=this.#c.size>0;if(this.#c.add(e),n)return;const s=Date.now();for(const i of this.#a.values())i.handle!==null&&clearTimeout(i.handle),i.handle=null,i.remaining=Math.max(0,i.deadline-s)}resume(e){if(!(!this.#c.delete(e)||this.#c.size>0))for(const[n,s]of this.#a)this.#f(n,s)}#p(){return`${this.#n.storageKey()}:seen-changes`}#m(){return this.#s!==null||this.#r!==null}#k(){const e=[...this.#e.children].find(fh);if(!e)return!1;let n;try{n=JSON.parse(e.textContent??"")}catch(i){return this.#x(i instanceof Error?i.message:String(i))}const s=fp(n);return s.ok?(this.#s=s.log,this.#i=this.#n.persist()?Ge(Dr):le(Dr),this.#t=kp(s.log,this.#i.read(this.#p())),this.#h(),this.#d(),this.#e.requestUpdate(),!0):this.#x(s.error)}#h(){if(!this.#s||!this.#t)return;const e=xp(this.#s,this.#t),n=JSON.stringify(e);n!==this.#o&&(this.#o=n,this.#i?.write(this.#p(),e))}#x(e){return console.error("[dev-process-kit] invalid change log:",e),this.#r=e,this.#e.requestUpdate(),!0}#g(){this.#l=new MutationObserver(()=>{(this.#m()||this.#k())&&this.#u()}),this.#l.observe(this.#e,{childList:!0})}#u(){this.#l?.disconnect(),this.#l=null}#d(){const e=new Set(this.view?.toasts.map(n=>n.key)??[]);for(const[n,s]of this.#a)e.has(n)||(s.handle!==null&&clearTimeout(s.handle),this.#a.delete(n));for(const n of e){if(this.#a.has(n))continue;const s={handle:null,deadline:0,remaining:uh};this.#a.set(n,s),this.#c.size===0&&this.#f(n,s)}}#f(e,n){n.deadline=Date.now()+n.remaining,n.handle=setTimeout(()=>{n.handle=null,this.send({kind:"close-toast",key:e})},n.remaining)}#b=e=>{!this.#t?.list.open||this.#n.inside(e.composedPath())||this.send({kind:"close-list"})};#w=e=>{e.key!=="Escape"||!this.#t?.list.open||this.send({kind:"close-list"})}}const tn="dpk-changes",mh=(t,e,n)=>{const s=t.unread>0?e.changesUnread(t.unread):e.changes;return b`<button
1297
1297
  class="dpk-bell"
1298
1298
  type="button"
1299
- aria-controls=${en}
1299
+ aria-controls=${tn}
1300
1300
  aria-expanded=${t.open?"true":"false"}
1301
1301
  aria-label=${s}
1302
1302
  title=${s}
1303
1303
  @click=${n.toggleList}
1304
1304
  >
1305
- ${ar()} ${t.unread>0?b`<span class="dpk-bell-badge" aria-hidden="true">${t.unread}</span>`:m}
1306
- </button>`},io=(t,e,n)=>t.jumpable?b`<button class="dpk-btn dpk-btn--accent dpk-notice-show" type="button" @click=${()=>n.show(t.key)}>
1305
+ ${pr()} ${t.unread>0?b`<span class="dpk-bell-badge" aria-hidden="true">${t.unread}</span>`:g}
1306
+ </button>`},co=(t,e,n)=>t.jumpable?b`<button class="dpk-btn dpk-btn--accent dpk-notice-show" type="button" @click=${()=>n.show(t.key)}>
1307
1307
  ${e.changesShow}
1308
- </button>`:m,ah=(t,e,n,s)=>t.open?b`<div id=${en} class="dpk-changes" popover="manual" role="dialog" aria-label=${n.changesTitle}>
1309
- <p class="dpk-changes-head"><strong>${n.changesTitle}</strong> <span>${e}</span></p>
1308
+ </button>`:g,po=(t,e,n,s)=>s==="list"||t.unread>0?b`<button
1309
+ class=${s==="list"?"dpk-btn dpk-changes-read-all":"dpk-toast-more dpk-changes-read-all"}
1310
+ type="button"
1311
+ aria-disabled=${t.unread>0?"false":"true"}
1312
+ @click=${n.readAll}
1313
+ >
1314
+ ${e.changesReadAll}
1315
+ </button>`:g,kh=(t,e,n)=>b`<section class="dpk-changes-group" data-revision=${t.revision}>
1316
+ <h3 class="dpk-changes-revision">
1317
+ <span>${t.revision}</span>
1318
+ ${t.latest?b`<span class="dpk-changes-current">${e.changesCurrent}</span>`:g}
1319
+ </h3>
1310
1320
  <ol class="dpk-changes-list">
1311
- ${jt(t.cards,i=>i.key,i=>b`<li class="dpk-change" data-key=${i.key} ?data-fresh=${i.fresh}>
1321
+ ${ct(t.cards,s=>s.key,s=>b`<li
1322
+ class="dpk-change"
1323
+ data-key=${s.id}
1324
+ data-revision=${s.revision}
1325
+ ?data-fresh=${s.fresh}
1326
+ >
1312
1327
  <p class="dpk-change-title">
1313
- ${i.fresh?b`<span class="dpk-change-new">${n.changesNew}</span>`:m} ${i.title}
1328
+ ${s.fresh?b`<span class="dpk-change-new">${e.changesNew}</span>`:g} ${s.title}
1314
1329
  </p>
1315
- ${i.body===null?m:b`<p class="dpk-change-body">${i.body}</p>`} ${io(i,n,s)}
1330
+ ${s.body===null?g:b`<p class="dpk-change-body">${s.body}</p>`} ${co(s,e,n)}
1316
1331
  </li>`)}
1317
1332
  </ol>
1318
- </div>`:m,lh=(t,e,n)=>b`<section
1333
+ </section>`,bh=(t,e,n)=>t.open?b`<div id=${tn} class="dpk-changes" popover="manual" role="dialog" aria-label=${e.changesTitle}>
1334
+ <div class="dpk-changes-head">
1335
+ <h2 class="dpk-changes-title">${e.changesTitle}</h2>
1336
+ ${po(t,e,n,"list")}
1337
+ </div>
1338
+ ${ct(t.groups,s=>s.revision,s=>kh(s,e,n))}
1339
+ </div>`:g,vh=(t,e,n)=>b`<section
1319
1340
  class="dpk-toasts"
1320
1341
  aria-live="polite"
1321
1342
  aria-label=${e.changes}
@@ -1324,13 +1345,13 @@ The brief is too long for a comment, so it is stored in this artifact's database
1324
1345
  @focusin=${()=>n.pause("focus")}
1325
1346
  @focusout=${()=>n.resume("focus")}
1326
1347
  >
1327
- ${jt(t.toasts,s=>s.key,s=>b`<div class="dpk-toast" data-key=${s.key}>
1328
- <span class="dpk-toast-icon" aria-hidden="true">${ar()}</span>
1348
+ ${ct(t.toasts,s=>s.key,s=>b`<div class="dpk-toast" data-key=${s.id}>
1349
+ <span class="dpk-toast-icon" aria-hidden="true">${pr()}</span>
1329
1350
  <div class="dpk-toast-text">
1330
1351
  <p class="dpk-change-title">${s.title}</p>
1331
- ${s.body===null?m:b`<p class="dpk-change-body">${s.body}</p>`}
1352
+ ${s.body===null?g:b`<p class="dpk-change-body">${s.body}</p>`}
1332
1353
  </div>
1333
- ${io(s,e,n)}
1354
+ ${co(s,e,n)}
1334
1355
  <button
1335
1356
  class="dpk-toast-close"
1336
1357
  type="button"
@@ -1338,13 +1359,16 @@ The brief is too long for a comment, so it is stored in this artifact's database
1338
1359
  title=${e.changesDismiss}
1339
1360
  @click=${()=>n.dismiss(s.key)}
1340
1361
  >
1341
- ${qt()}
1362
+ ${Bt()}
1342
1363
  </button>
1343
1364
  </div>`)}
1344
- ${t.waiting>0?b`<button class="dpk-toast-more" type="button" @click=${n.openList}>
1345
- ${e.changesWaiting(t.waiting)} · ${e.changesSeeAll}
1346
- </button>`:m}
1347
- </section>`,us=(t,e)=>typeof t=="object"&&t!==null&&e.every(n=>typeof Reflect.get(t,n)=="function"),ch=t=>us(t,["use"]),dh=t=>us(t,["anchorFor","canSendToClaude","sendToClaude"]),ph=t=>us(t,["collection"]),ro=async(t,e)=>{try{return await t.use(e)}catch{return null}},hh=(t,e)=>({async canSend(){try{return await t.canSendToClaude()==="available"}catch{return!1}},async send({brief:n,draft:s,anchor:i}){let r=nc(n);if(r===null){if(e===null)return{ok:!1,reason:"too_large"};try{const o=e.collection(Ql).doc();await o.set({brief:n,draft:s,createdAt:new Date().toISOString()}),r=sc(o.path)}catch{return{ok:!1,reason:"storage"}}}try{return await t.sendToClaude({anchor:await t.anchorFor(i),text:r}),{ok:!0}}catch(o){return{ok:!1,reason:rc(o)}}}}),uh=async t=>{if(!ch(t))return null;const[e,n]=await Promise.all([ro(t,"comments"),ro(t,"db")]);return dh(e)?hh(e,ph(n)?n:null):null},fh=()=>Reflect.get(globalThis,"claude");class gh{#e;#n;#s=null;#r=!1;constructor(e,n=fh){this.#e=e,this.#n=n,e.addController(this)}get available(){return this.#r}hostConnected(){this.#s??=uh(this.#n()),this.#t(),window.addEventListener("focus",this.#t)}hostDisconnected(){window.removeEventListener("focus",this.#t)}async send(e){const n=await this.#s;if(!n)return{ok:!1,reason:"forbidden"};const s=await n.send(e);return this.#t(),s}#t=async()=>{const e=await this.#s,n=e?await e.canSend():!1;n!==this.#r&&(this.#r=n,this.#e.requestUpdate())}}const fs="dev-process-kit:color-scheme",mh="(prefers-color-scheme: dark)",oo=()=>typeof matchMedia=="function"?matchMedia(mh):null,ao=()=>ut(document.documentElement.dataset.theme)??(oo()?.matches===!0?"dark":"light");class kh{#e;#n;#s=null;#r=null;#t="light";#i=null;#o=null;constructor(e,n){this.#e=e,this.#n=n,e.addController(this)}hostConnected(){this.#s===null&&(this.#s=this.#n()?Ke(ut):le(ut),this.#r=this.#s.read(fs)),this.#t=ao(),this.#i=oo(),this.#i?.addEventListener("change",this.#l),this.#o=new MutationObserver(this.#l),this.#o.observe(document.documentElement,{attributes:!0,attributeFilter:["data-theme"]})}hostDisconnected(){this.#i?.removeEventListener("change",this.#l),this.#i=null,this.#o?.disconnect(),this.#o=null}resolve(e){return Dr(this.#a(e))}toggle(e){this.#r=fp(this.#a(e)),this.#r===null?this.#s?.remove(fs):this.#s?.write(fs,this.#r),this.#e.requestUpdate()}#a(e){return{preference:this.#r,authored:e,environment:this.#t}}#l=()=>{const e=ao();e!==this.#t&&(this.#t=e,this.#e.requestUpdate())}}const bh=(t,e)=>{const n=[],s=i=>{(i===t||i instanceof ShadowRoot)&&e?.(i);for(const r of i.children)r.hasAttribute("data-template")||(("commentTargets"in r||"elementActions"in r)&&n.push(r),s(r),r.shadowRoot&&s(r.shadowRoot))};return s(t),n},lo=(t,e)=>{const n=new Map;for(const s of t)n.set(e(s),(n.get(e(s))??0)+1);return t.filter(s=>n.get(e(s))===1)},co=t=>lo(t.filter(e=>"elementActions"in e&&e.id.length>0),e=>e.id),po=(t,e)=>{for(const n of co(t)){const s=Wl(e,n.id),i=Reflect.get(n,"elementActions");Array.isArray(i)&&i.length===s.length&&s.every((o,a)=>{const l=i[a];return typeof l=="object"&&l!==null&&"id"in l&&l.id===o.id})||Reflect.set(n,"elementActions",s)}},xh=t=>{const e=Reflect.get(t,"elementActionResults");return Array.isArray(e)?e.flatMap(n=>{const s=T(Hi,n);return s.success?[s.output]:[]}):[]},vh=t=>{const e=[];for(const n of t){if(!("commentTargets"in n))continue;const s=T(jr,n.commentTargets);s.success&&e.push(...s.output)}return{targets:lo(e,n=>n.value),providers:co(t).map(n=>({id:n.id,results:xh(n)}))}},yh=2400;class wh{#e=Jp();#n=null;#s;constructor(e){this.#s=e,e.addController(this)}get state(){return this.#e}hostDisconnected(){this.#i()}async copy(e){this.#r({kind:"copy-started"});const n=this.#e.request,s=await Fn(e()).catch(()=>!1);this.#r({kind:"copy-finished",request:n,ok:s}),this.#t(n)}async send(e){if(this.#e.status.kind==="sending")return;this.#r({kind:"send-started"});const n=this.#e.request,s=await e().catch(()=>({ok:!1,reason:"error"}));this.#r({kind:"send-finished",request:n,outcome:s}),s.ok&&this.#t(n)}#r(e){(e.kind==="copy-started"||e.kind==="send-started")&&this.#i(),this.#e=Xp(this.#e,e),this.#s.requestUpdate()}#t(e){e===this.#e.request&&(this.#i(),this.#n=setTimeout(()=>{this.#n=null,this.#r({kind:"settled",request:e})},yh))}#i(){this.#n!==null&&clearTimeout(this.#n),this.#n=null}}const gs="dev-process-kit:locale";class $h{#e;#n;#s;#r=null;#t=null;#i;#o;constructor(e,n,s){this.#e=e,this.#n=n,this.#s=s,e.addController(this)}get authored(){if(this.#i===void 0)return At(St(this.#e));const e=this.#e.parentNode;return At(this.#i??(e===null?null:St(e)))}get locale(){return this.#o??this.#a()}#a(){return ra({preference:this.#t,authored:this.authored})}hostConnected(){this.#r===null&&(this.#r=this.#n()?Ke(Ys):le(Ys),this.#t=this.#r.read(gs)),this.#i??=this.#e.getAttribute("lang"),this.#l()}pick(e){this.#t=oa(e,this.authored),this.#t===null?this.#r?.remove(gs):this.#r?.write(gs,this.#t),this.#l(),this.#e.requestUpdate()}#l(){const e=this.#t??this.#i??null;e===null?this.#e.removeAttribute("lang"):this.#e.getAttribute("lang")!==e&&this.#e.setAttribute("lang",e);const n=this.#a();if(n===this.#o)return;const s=this.#o===void 0;this.#o=n,this.#s(),(!s||this.#t!==null)&&document.dispatchEvent(new Event(kn))}}const Sh="(max-width: 760px)",Ah=()=>typeof matchMedia=="function"?matchMedia(Sh):null;class Ch{#e;#n=null;#s=!1;constructor(e){this.#e=e,e.addController(this)}hostConnected(){this.#n=Ah(),this.#s=this.#n?.matches===!0,this.#n?.addEventListener("change",this.#r)}hostDisconnected(){this.#n?.removeEventListener("change",this.#r),this.#n=null}get narrow(){return this.#s}#r=e=>{this.#s=e.matches,this.#e.requestUpdate()}}const ho=()=>Dt(typeof location>"u"?"":location.hash),Th=(t,e)=>{if(typeof history>"u")return;const n=`${location.pathname}${location.search}${He(t)}`;`${location.pathname}${location.search}${location.hash}`!==n&&(e?history.replaceState(null,"",n):history.pushState(null,"",n))};class Eh{#e;#n=null;#s=0;constructor(e){this.#e=e}get orphans(){return this.#s}route(){const e=this.#e.renderRoot,n=je(e.querySelector('slot[name="preview"]'),HTMLSlotElement);if(n===null)return;this.#n!==n&&(this.#n=n,n.addEventListener("slotchange",this.#r));const s=new Set(Array.from(e.querySelectorAll("slot")).map(r=>r.getAttribute("name")??"")),i=n.assignedElements();for(const r of i){const o=r.getAttribute("data-preview-id");if(!o)continue;const a=`preview:${o}`;r.getAttribute("slot")!==a&&s.has(a)&&r.setAttribute("slot",a)}i.length!==this.#s&&(this.#s=i.length,queueMicrotask(()=>this.#e.requestUpdate()))}#r=()=>{queueMicrotask(()=>this.route())}}const uo=(t,e)=>{const n=[],s=i=>{for(const r of i.querySelectorAll("*"))r.matches(e)&&n.push(r),r.shadowRoot&&s(r.shadowRoot)};return s(t),t instanceof Element&&t.shadowRoot&&s(t.shadowRoot),n},Rh=(t,e)=>{const n=[];let s=t;for(;s;){const i=s instanceof Element&&s.assignedSlot?s.assignedSlot:s.parentNode;if(s=i instanceof ShadowRoot?i.host:i,!(s instanceof Element)||s===e)break;n.push(s)}return n},fo=(t,e,n)=>n.top<e.top?t+n.top-e.top:n.bottom<=e.bottom?t:t+Math.min(n.bottom-e.bottom,n.top-e.top),go=(t,e,n)=>{const s=Math.min(n,e/4);return{top:t+s,bottom:t+e-s}},mo=(t,e,n=0)=>{const s=t.getBoundingClientRect();t.scrollTop=fo(t.scrollTop,go(s.top+t.clientTop,t.clientHeight,n),e.getBoundingClientRect())},ko=(t,e,n=0)=>{const s=t.getBoundingClientRect(),i=e.getBoundingClientRect();t.scrollLeft=fo(t.scrollLeft,go(s.left+t.clientLeft,t.clientWidth,n),{top:i.left,bottom:i.right})},bo="data-dpk-target",_h=2800,xo=48,Lh=t=>t.getClientRects().length>0,vo=(t,e)=>{const n=uo(t,`[${bo}]`).filter(r=>(r.getAttribute(bo)??"").split(/\s+/).includes(e)),s=uo(t,"[data-dpk-comment]").filter(r=>r.getAttribute("data-dpk-comment")===e),i=[...n,...s];return i.find(Lh)??i[0]??null},yo=(t,e)=>{const n=getComputedStyle(t),s=e==="y"?n.overflowY:n.overflowX;return s!=="auto"&&s!=="scroll"?!1:e==="y"?t.scrollHeight>t.clientHeight:t.scrollWidth>t.clientWidth},Oh=(t,e)=>{for(const n of Rh(e,t))yo(n,"y")&&mo(n,e,xo),yo(n,"x")&&ko(n,e,xo)},wo="color-mix(in srgb, var(--dpk-accent) 45%, transparent)",Ie={outline:"2px solid var(--dpk-accent)",outlineOffset:"3px"},$o={outline:"2px solid transparent",outlineOffset:"3px"},Ph=t=>t?[{...Ie},{...Ie,offset:.85},{...$o}]:[{...Ie,boxShadow:`0 0 0 0 ${wo}`},{...Ie,boxShadow:"0 0 0 14px transparent",offset:.3},{...Ie,boxShadow:`0 0 0 0 ${wo}`,offset:.31},{...Ie,boxShadow:"0 0 0 14px transparent",offset:.6},{...Ie,offset:.85},{...$o}],mt={filter:"drop-shadow(0 0 3px var(--dpk-accent)) drop-shadow(0 0 3px var(--dpk-accent))"},tn={filter:"drop-shadow(0 0 3px transparent) drop-shadow(0 0 3px transparent)"},zh=t=>t?[{...mt},{...mt,offset:.85},{...tn}]:[{...mt},{...tn,offset:.3},{...mt,offset:.31},{...tn,offset:.6},{...mt,offset:.61},{...tn}],Mh=t=>{if(typeof t.animate!="function")return;const e=typeof matchMedia=="function"&&matchMedia("(prefers-reduced-motion: reduce)").matches,n=t instanceof SVGElement&&!(t instanceof SVGSVGElement);t.animate(n?zh(e):Ph(e),{duration:_h,easing:"ease-out"})},be={min:180,max:560,step:16,largeStep:64},Ih={side:"left",defaultWidth:260},nn=t=>Math.round(Math.min(be.max,Math.max(be.min,t))),So=t=>typeof t=="number"&&Number.isFinite(t)?nn(t):null,ms=(t,e)=>t==="left"?e:-e,Nh=(t,e)=>nn(t.startWidth+ms(t.side,e-t.startX)),Dh=(t,e,{key:n,shiftKey:s})=>{const i=s?be.largeStep:be.step;switch(n){case"ArrowLeft":return nn(t+ms(e,-i));case"ArrowRight":return nn(t+ms(e,i));case"Home":return be.min;case"End":return be.max;default:return null}},Ao=t=>typeof t=="boolean"?t:null,jh=t=>t==="left"?"right":"left",qh=(t,e)=>e?{action:"expand",points:jh(t)}:{action:"collapse",points:t},Bh=t=>`dev-process-kit:sidebar-collapsed:${t}`;class Uh{#e;#n;#s=null;#r="";#t=!1;#i=!1;constructor(e,n){this.#e=e,this.#n=n,e.addController(this)}hostConnected(){this.#s===null&&(this.#s=this.#n.persist()?Ke(Ao):le(Ao),this.#r=Bh(this.#n.template()),this.#t=this.#s.read(this.#r)??!1)}get collapsed(){return this.#t}get drawerOpen(){return this.#i}toggleDrawer(){this.#i=!this.#i,this.#e.requestUpdate()}closeDrawer(){this.#i&&(this.#i=!1,this.#e.requestUpdate())}toggle(){this.#t=!this.#t,this.#t?this.#s?.write(this.#r,!0):this.#s?.remove(this.#r),this.#e.requestUpdate()}}const Hh=t=>`dev-process-kit:sidebar-width:${t}`,ks={kind:"idle"};class Fh{constructor(e,n){this.#s=null,this.#r="",this.#t=null,this.#i=ks,this.handlers={pointerdown:s=>{s.button===0&&(s.preventDefault(),s.currentTarget instanceof Element&&s.currentTarget.setPointerCapture(s.pointerId),this.#i={kind:"dragging",pointerId:s.pointerId,side:this.#n.layout().side,startX:s.clientX,startWidth:this.width},this.#e.requestUpdate())},pointermove:s=>{const i=this.#i;i.kind!=="dragging"||i.pointerId!==s.pointerId||this.#a(Nh(i,s.clientX))},pointerup:s=>this.#o(s),pointercancel:s=>this.#o(s),keydown:s=>{const i=Dh(this.width,this.#n.layout().side,s);i!==null&&(s.preventDefault(),this.#a(i),this.#l())},dblclick:()=>{this.#a(this.#n.layout().defaultWidth),this.#l()}},this.#e=e,this.#n=n,e.addController(this)}#e;#n;#s;#r;#t;#i;hostConnected(){this.#s===null&&(this.#s=this.#n.persist()?Ke(So):le(So),this.#r=Hh(this.#n.template()),this.#t=this.#s.read(this.#r))}hostDisconnected(){this.#i=ks}get width(){return this.#t??this.#n.layout().defaultWidth}get dragging(){return this.#i.kind==="dragging"}#o(e){const n=this.#i;n.kind!=="dragging"||n.pointerId!==e.pointerId||(this.#i=ks,this.#l(),this.#e.requestUpdate())}#a(e){const n=e===this.#n.layout().defaultWidth?null:e;n!==this.#t&&(this.#t=n,this.#e.requestUpdate())}#l(){this.#t===null?this.#s?.remove(this.#r):this.#s?.write(this.#r,this.#t)}}const Wh=[Tt,xn,de`
1365
+ ${t.toasts.length+t.waiting>1?b`<div class="dpk-toast-actions">
1366
+ ${t.waiting>0?b`<button class="dpk-toast-more" type="button" @click=${n.openList}>
1367
+ ${e.changesWaiting(t.waiting)} · ${e.changesSeeAll}
1368
+ </button>`:g}
1369
+ ${po(t,e,n,"toasts")}
1370
+ </div>`:g}
1371
+ </section>`,ms=(t,e)=>typeof t=="object"&&t!==null&&e.every(n=>typeof Reflect.get(t,n)=="function"),xh=t=>ms(t,["use"]),yh=t=>ms(t,["anchorFor","canSendToClaude","sendToClaude"]),wh=t=>ms(t,["collection"]),ho=async(t,e)=>{try{return await t.use(e)}catch{return null}},$h=(t,e)=>({async canSend(){try{return await t.canSendToClaude()==="available"}catch{return!1}},async send({brief:n,draft:s,anchor:i}){let r=lc(n);if(r===null){if(e===null)return{ok:!1,reason:"too_large"};try{const o=e.collection(rc).doc();await o.set({brief:n,draft:s,createdAt:new Date().toISOString()}),r=cc(o.path)}catch{return{ok:!1,reason:"storage"}}}try{return await t.sendToClaude({anchor:await t.anchorFor(i),text:r}),{ok:!0}}catch(o){return{ok:!1,reason:pc(o)}}}}),Sh=async t=>{if(!xh(t))return null;const[e,n]=await Promise.all([ho(t,"comments"),ho(t,"db")]);return yh(e)?$h(e,wh(n)?n:null):null},Ah=()=>Reflect.get(globalThis,"claude");class Ch{#e;#n;#s=null;#r=!1;constructor(e,n=Ah){this.#e=e,this.#n=n,e.addController(this)}get available(){return this.#r}hostConnected(){this.#s??=Sh(this.#n()),this.#t(),window.addEventListener("focus",this.#t)}hostDisconnected(){window.removeEventListener("focus",this.#t)}async send(e){const n=await this.#s;if(!n)return{ok:!1,reason:"forbidden"};const s=await n.send(e);return this.#t(),s}#t=async()=>{const e=await this.#s,n=e?await e.canSend():!1;n!==this.#r&&(this.#r=n,this.#e.requestUpdate())}}const ks="dev-process-kit:color-scheme",Th="(prefers-color-scheme: dark)",uo=()=>typeof matchMedia=="function"?matchMedia(Th):null,fo=()=>mt(document.documentElement.dataset.theme)??(uo()?.matches===!0?"dark":"light");class Eh{#e;#n;#s=null;#r=null;#t="light";#i=null;#o=null;constructor(e,n){this.#e=e,this.#n=n,e.addController(this)}hostConnected(){this.#s===null&&(this.#s=this.#n()?Ge(mt):le(mt),this.#r=this.#s.read(ks)),this.#t=fo(),this.#i=uo(),this.#i?.addEventListener("change",this.#a),this.#o=new MutationObserver(this.#a),this.#o.observe(document.documentElement,{attributes:!0,attributeFilter:["data-theme"]})}hostDisconnected(){this.#i?.removeEventListener("change",this.#a),this.#i=null,this.#o?.disconnect(),this.#o=null}resolve(e){return Hr(this.#l(e))}toggle(e){this.#r=Sp(this.#l(e)),this.#r===null?this.#s?.remove(ks):this.#s?.write(ks,this.#r),this.#e.requestUpdate()}#l(e){return{preference:this.#r,authored:e,environment:this.#t}}#a=()=>{const e=fo();e!==this.#t&&(this.#t=e,this.#e.requestUpdate())}}const Rh=(t,e)=>{const n=[],s=i=>{(i===t||i instanceof ShadowRoot)&&e?.(i);for(const r of i.children)r.hasAttribute("data-template")||(("commentTargets"in r||"elementActions"in r)&&n.push(r),s(r),r.shadowRoot&&s(r.shadowRoot))};return s(t),n},go=(t,e)=>{const n=new Map;for(const s of t)n.set(e(s),(n.get(e(s))??0)+1);return t.filter(s=>n.get(e(s))===1)},mo=t=>go(t.filter(e=>"elementActions"in e&&e.id.length>0),e=>e.id),ko=(t,e)=>{for(const n of mo(t)){const s=Jl(e,n.id),i=Reflect.get(n,"elementActions");Array.isArray(i)&&i.length===s.length&&s.every((o,a)=>{const l=i[a];return typeof l=="object"&&l!==null&&"id"in l&&l.id===o.id})||Reflect.set(n,"elementActions",s)}},_h=t=>{const e=Reflect.get(t,"elementActionResults");return Array.isArray(e)?e.flatMap(n=>{const s=C(Vi,n);return s.success?[s.output]:[]}):[]},Lh=t=>{const e=[];for(const n of t){if(!("commentTargets"in n))continue;const s=C(Fr,n.commentTargets);s.success&&e.push(...s.output)}return{targets:go(e,n=>n.value),providers:mo(t).map(n=>({id:n.id,results:_h(n)}))}},Oh=2400;class Ph{#e=ah();#n=null;#s;constructor(e){this.#s=e,e.addController(this)}get state(){return this.#e}hostDisconnected(){this.#i()}async copy(e){this.#r({kind:"copy-started"});const n=this.#e.request,s=await Wn(e()).catch(()=>!1);this.#r({kind:"copy-finished",request:n,ok:s}),this.#t(n)}async send(e){if(this.#e.status.kind==="sending")return;this.#r({kind:"send-started"});const n=this.#e.request,s=await e().catch(()=>({ok:!1,reason:"error"}));this.#r({kind:"send-finished",request:n,outcome:s}),s.ok&&this.#t(n)}#r(e){(e.kind==="copy-started"||e.kind==="send-started")&&this.#i(),this.#e=lh(this.#e,e),this.#s.requestUpdate()}#t(e){e===this.#e.request&&(this.#i(),this.#n=setTimeout(()=>{this.#n=null,this.#r({kind:"settled",request:e})},Oh))}#i(){this.#n!==null&&clearTimeout(this.#n),this.#n=null}}const bs="dev-process-kit:locale";class zh{#e;#n;#s;#r=null;#t=null;#i;#o;constructor(e,n,s){this.#e=e,this.#n=n,this.#s=s,e.addController(this)}get authored(){if(this.#i===void 0)return Et(Tt(this.#e));const e=this.#e.parentNode;return Et(this.#i??(e===null?null:Tt(e)))}get locale(){return this.#o??this.#l()}#l(){return pa({preference:this.#t,authored:this.authored})}hostConnected(){this.#r===null&&(this.#r=this.#n()?Ge(Qs):le(Qs),this.#t=this.#r.read(bs)),this.#i??=this.#e.getAttribute("lang"),this.#a()}pick(e){this.#t=ha(e,this.authored),this.#t===null?this.#r?.remove(bs):this.#r?.write(bs,this.#t),this.#a(),this.#e.requestUpdate()}#a(){const e=this.#t??this.#i??null;e===null?this.#e.removeAttribute("lang"):this.#e.getAttribute("lang")!==e&&this.#e.setAttribute("lang",e);const n=this.#l();if(n===this.#o)return;const s=this.#o===void 0;this.#o=n,this.#s(),(!s||this.#t!==null)&&document.dispatchEvent(new Event(bn))}}const Mh="(max-width: 760px)",Ih=()=>typeof matchMedia=="function"?matchMedia(Mh):null;class Nh{#e;#n=null;#s=!1;constructor(e){this.#e=e,e.addController(this)}hostConnected(){this.#n=Ih(),this.#s=this.#n?.matches===!0,this.#n?.addEventListener("change",this.#r)}hostDisconnected(){this.#n?.removeEventListener("change",this.#r),this.#n=null}get narrow(){return this.#s}#r=e=>{this.#s=e.matches,this.#e.requestUpdate()}}const bo=()=>qt(typeof location>"u"?"":location.hash),Dh=(t,e)=>{if(typeof history>"u")return;const n=`${location.pathname}${location.search}${Fe(t)}`;`${location.pathname}${location.search}${location.hash}`!==n&&(e?history.replaceState(null,"",n):history.pushState(null,"",n))};class jh{#e;#n=null;#s=0;constructor(e){this.#e=e}get orphans(){return this.#s}route(){const e=this.#e.renderRoot,n=je(e.querySelector('slot[name="preview"]'),HTMLSlotElement);if(n===null)return;this.#n!==n&&(this.#n=n,n.addEventListener("slotchange",this.#r));const s=new Set(Array.from(e.querySelectorAll("slot")).map(r=>r.getAttribute("name")??"")),i=n.assignedElements();for(const r of i){const o=r.getAttribute("data-preview-id");if(!o)continue;const a=`preview:${o}`;r.getAttribute("slot")!==a&&s.has(a)&&r.setAttribute("slot",a)}i.length!==this.#s&&(this.#s=i.length,queueMicrotask(()=>this.#e.requestUpdate()))}#r=()=>{queueMicrotask(()=>this.route())}}const vo=(t,e)=>{const n=[],s=i=>{for(const r of i.querySelectorAll("*"))r.matches(e)&&n.push(r),r.shadowRoot&&s(r.shadowRoot)};return s(t),t instanceof Element&&t.shadowRoot&&s(t.shadowRoot),n},qh=(t,e)=>{const n=[];let s=t;for(;s;){const i=s instanceof Element&&s.assignedSlot?s.assignedSlot:s.parentNode;if(s=i instanceof ShadowRoot?i.host:i,!(s instanceof Element)||s===e)break;n.push(s)}return n},xo=(t,e,n)=>n.top<e.top?t+n.top-e.top:n.bottom<=e.bottom?t:t+Math.min(n.bottom-e.bottom,n.top-e.top),yo=(t,e,n)=>{const s=Math.min(n,e/4);return{top:t+s,bottom:t+e-s}},wo=(t,e,n=0)=>{const s=t.getBoundingClientRect();t.scrollTop=xo(t.scrollTop,yo(s.top+t.clientTop,t.clientHeight,n),e.getBoundingClientRect())},$o=(t,e,n=0)=>{const s=t.getBoundingClientRect(),i=e.getBoundingClientRect();t.scrollLeft=xo(t.scrollLeft,yo(s.left+t.clientLeft,t.clientWidth,n),{top:i.left,bottom:i.right})},So="data-dpk-target",Bh=2800,Ao=48,Uh=t=>t.getClientRects().length>0,Co=(t,e)=>{const n=vo(t,`[${So}]`).filter(r=>(r.getAttribute(So)??"").split(/\s+/).includes(e)),s=vo(t,"[data-dpk-comment]").filter(r=>r.getAttribute("data-dpk-comment")===e),i=[...n,...s];return i.find(Uh)??i[0]??null},To=(t,e)=>{const n=getComputedStyle(t),s=e==="y"?n.overflowY:n.overflowX;return s!=="auto"&&s!=="scroll"?!1:e==="y"?t.scrollHeight>t.clientHeight:t.scrollWidth>t.clientWidth},Hh=(t,e)=>{for(const n of qh(e,t))To(n,"y")&&wo(n,e,Ao),To(n,"x")&&$o(n,e,Ao)},Eo="color-mix(in srgb, var(--dpk-accent) 45%, transparent)",Ie={outline:"2px solid var(--dpk-accent)",outlineOffset:"3px"},Ro={outline:"2px solid transparent",outlineOffset:"3px"},Fh=t=>t?[{...Ie},{...Ie,offset:.85},{...Ro}]:[{...Ie,boxShadow:`0 0 0 0 ${Eo}`},{...Ie,boxShadow:"0 0 0 14px transparent",offset:.3},{...Ie,boxShadow:`0 0 0 0 ${Eo}`,offset:.31},{...Ie,boxShadow:"0 0 0 14px transparent",offset:.6},{...Ie,offset:.85},{...Ro}],vt={filter:"drop-shadow(0 0 3px var(--dpk-accent)) drop-shadow(0 0 3px var(--dpk-accent))"},nn={filter:"drop-shadow(0 0 3px transparent) drop-shadow(0 0 3px transparent)"},Wh=t=>t?[{...vt},{...vt,offset:.85},{...nn}]:[{...vt},{...nn,offset:.3},{...vt,offset:.31},{...nn,offset:.6},{...vt,offset:.61},{...nn}],Vh=t=>{if(typeof t.animate!="function")return;const e=typeof matchMedia=="function"&&matchMedia("(prefers-reduced-motion: reduce)").matches,n=t instanceof SVGElement&&!(t instanceof SVGSVGElement);t.animate(n?Wh(e):Fh(e),{duration:Bh,easing:"ease-out"})},ve={min:180,max:560,step:16,largeStep:64},Kh={side:"left",defaultWidth:260},sn=t=>Math.round(Math.min(ve.max,Math.max(ve.min,t))),_o=t=>typeof t=="number"&&Number.isFinite(t)?sn(t):null,vs=(t,e)=>t==="left"?e:-e,Gh=(t,e)=>sn(t.startWidth+vs(t.side,e-t.startX)),Zh=(t,e,{key:n,shiftKey:s})=>{const i=s?ve.largeStep:ve.step;switch(n){case"ArrowLeft":return sn(t+vs(e,-i));case"ArrowRight":return sn(t+vs(e,i));case"Home":return ve.min;case"End":return ve.max;default:return null}},Lo=t=>typeof t=="boolean"?t:null,Yh=t=>t==="left"?"right":"left",Jh=(t,e)=>e?{action:"expand",points:Yh(t)}:{action:"collapse",points:t},Xh=t=>`dev-process-kit:sidebar-collapsed:${t}`;class Qh{#e;#n;#s=null;#r="";#t=!1;#i=!1;constructor(e,n){this.#e=e,this.#n=n,e.addController(this)}hostConnected(){this.#s===null&&(this.#s=this.#n.persist()?Ge(Lo):le(Lo),this.#r=Xh(this.#n.template()),this.#t=this.#s.read(this.#r)??!1)}get collapsed(){return this.#t}get drawerOpen(){return this.#i}toggleDrawer(){this.#i=!this.#i,this.#e.requestUpdate()}closeDrawer(){this.#i&&(this.#i=!1,this.#e.requestUpdate())}toggle(){this.#t=!this.#t,this.#t?this.#s?.write(this.#r,!0):this.#s?.remove(this.#r),this.#e.requestUpdate()}}const eu=t=>`dev-process-kit:sidebar-width:${t}`,xs={kind:"idle"};class tu{constructor(e,n){this.#s=null,this.#r="",this.#t=null,this.#i=xs,this.handlers={pointerdown:s=>{s.button===0&&(s.preventDefault(),s.currentTarget instanceof Element&&s.currentTarget.setPointerCapture(s.pointerId),this.#i={kind:"dragging",pointerId:s.pointerId,side:this.#n.layout().side,startX:s.clientX,startWidth:this.width},this.#e.requestUpdate())},pointermove:s=>{const i=this.#i;i.kind!=="dragging"||i.pointerId!==s.pointerId||this.#l(Gh(i,s.clientX))},pointerup:s=>this.#o(s),pointercancel:s=>this.#o(s),keydown:s=>{const i=Zh(this.width,this.#n.layout().side,s);i!==null&&(s.preventDefault(),this.#l(i),this.#a())},dblclick:()=>{this.#l(this.#n.layout().defaultWidth),this.#a()}},this.#e=e,this.#n=n,e.addController(this)}#e;#n;#s;#r;#t;#i;hostConnected(){this.#s===null&&(this.#s=this.#n.persist()?Ge(_o):le(_o),this.#r=eu(this.#n.template()),this.#t=this.#s.read(this.#r))}hostDisconnected(){this.#i=xs}get width(){return this.#t??this.#n.layout().defaultWidth}get dragging(){return this.#i.kind==="dragging"}#o(e){const n=this.#i;n.kind!=="dragging"||n.pointerId!==e.pointerId||(this.#i=xs,this.#a(),this.#e.requestUpdate())}#l(e){const n=e===this.#n.layout().defaultWidth?null:e;n!==this.#t&&(this.#t=n,this.#e.requestUpdate())}#a(){this.#t===null?this.#s?.remove(this.#r):this.#s?.write(this.#r,this.#t)}}const nu=[_t,xn,de`
1348
1372
  :host {
1349
1373
  display: block;
1350
1374
  min-height: 100%;
@@ -1365,6 +1389,15 @@ The brief is too long for a comment, so it is stored in this artifact's database
1365
1389
  grid-template-rows: auto minmax(0, 1fr) auto;
1366
1390
  min-height: 100%;
1367
1391
  max-height: 100%;
1392
+ /*
1393
+ * The fallback when the page gives the host no height: the viewport, less
1394
+ * the safe-area insets a Claude Artifact pads its root by. Without it the
1395
+ * shell grows with its content, leaving the page's own ground below a
1396
+ * short page and scrolling the header and the memo away on a long one.
1397
+ * A host with a height still wins: the min/max-height above pin the shell
1398
+ * to it.
1399
+ */
1400
+ height: calc(100dvh - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px));
1368
1401
  }
1369
1402
 
1370
1403
  /* ------------------------------------------------------------- header */
@@ -1704,15 +1737,58 @@ The brief is too long for a comment, so it is stored in this artifact's database
1704
1737
  margin: 0 2px 10px;
1705
1738
  }
1706
1739
 
1707
- .dpk-changes-head span {
1708
- overflow: hidden;
1740
+ .dpk-changes-head {
1741
+ align-items: center;
1742
+ }
1743
+
1744
+ .dpk-changes-title {
1745
+ margin: 0;
1746
+ font-size: inherit;
1747
+ font-weight: 650;
1748
+ }
1749
+
1750
+ .dpk-changes-read-all.dpk-btn {
1751
+ flex: none;
1752
+ font-size: 11.5px;
1753
+ }
1754
+
1755
+ .dpk-changes-read-all[aria-disabled='true'] {
1756
+ opacity: 0.5;
1757
+ cursor: default;
1758
+ pointer-events: none;
1759
+ }
1760
+
1761
+ .dpk-changes-group + .dpk-changes-group {
1762
+ margin-top: 14px;
1763
+ }
1764
+
1765
+ .dpk-changes-revision {
1766
+ display: flex;
1767
+ align-items: center;
1768
+ gap: 6px;
1769
+ margin: 0 2px 6px;
1709
1770
  color: var(--dpk-ink-faint);
1710
1771
  font-family: var(--dpk-mono);
1711
1772
  font-size: 11px;
1773
+ font-weight: 500;
1774
+ }
1775
+
1776
+ .dpk-changes-revision span:first-child {
1777
+ overflow: hidden;
1712
1778
  text-overflow: ellipsis;
1713
1779
  white-space: nowrap;
1714
1780
  }
1715
1781
 
1782
+ .dpk-changes-current {
1783
+ flex: none;
1784
+ padding: 1px 6px;
1785
+ border: 1px solid var(--dpk-rule-strong);
1786
+ border-radius: 999px;
1787
+ color: var(--dpk-ink-soft);
1788
+ font-family: var(--dpk-body);
1789
+ font-size: 10px;
1790
+ }
1791
+
1716
1792
  .dpk-changes-list {
1717
1793
  display: grid;
1718
1794
  gap: 6px;
@@ -1848,6 +1924,13 @@ The brief is too long for a comment, so it is stored in this artifact's database
1848
1924
  box-shadow: var(--dpk-focus);
1849
1925
  }
1850
1926
 
1927
+ .dpk-toast-actions {
1928
+ display: flex;
1929
+ flex-wrap: wrap;
1930
+ justify-content: end;
1931
+ gap: 6px;
1932
+ }
1933
+
1851
1934
  .dpk-toast-more {
1852
1935
  padding: 4px 10px;
1853
1936
  border: 1px solid var(--dpk-rule-strong);
@@ -2506,18 +2589,18 @@ The brief is too long for a comment, so it is stored in this artifact's database
2506
2589
  order: 1;
2507
2590
  }
2508
2591
  }
2509
- `],Vh=30,Kh=Mt(x(),L({base:x(),value:x()})),Co=t=>{const e=T(Kh,t);return e.success?e.output:null},Zh=t=>t.key===void 0?JSON.stringify(["field",t.hosts,t.name,t.base]):JSON.stringify(["key",t.key,t.name]),Gh=(t,e,n)=>{const{[e]:s,...i}=t;if(n.value===n.base)return i;const r=Object.entries({...i,[e]:n});return Object.fromEntries(r.slice(Math.max(0,r.length-Vh)))},Yh=(t,e)=>{if(!(e in t))return t;const{[e]:n,...s}=t;return s},Jh=(t,e,n)=>{const s=t[e];return s===void 0||s.base!==n||s.value===n?null:s.value},Xh=new Set(["text","search","url","email","tel"]),To=t=>t instanceof HTMLTextAreaElement||t instanceof HTMLInputElement&&Xh.has(t.type)?t:null,Qh=(t,e)=>{const n=[];let s=e.getRootNode();for(;s instanceof ShadowRoot;){if(s.host===t)return n;n.unshift(s.host.localName),s=s.host.getRootNode()}return null},eu=t=>{let e=t;for(;e!==null;){const n=e.getAttribute("data-dpk-text-key");if(n!==null&&n!=="")return n;const s=e.getRootNode();e=e.parentElement??(s instanceof ShadowRoot?s.host:null)}},tu=t=>t.getAttribute("aria-label")??(t.placeholder||t.name||t.localName),bs=t=>typeof t=="string"?[t]:Array.isArray(t)?t.flatMap(bs):typeof t=="object"&&t!==null?Object.values(t).flatMap(bs):[],Eo=t=>t.replace(/\s+/g," ").trim();class nu{#e;#n;#s=null;#r="";#t=new WeakMap;#i=new Set;constructor(e,n){this.#e=e,this.#n=n,e.addController(this)}hostConnected(){this.#s===null&&(this.#s=this.#n.persist()?nh(Co):le(Co),this.#r=this.#n.storageKey()),this.#e.addEventListener("focusin",this.#o),this.#e.addEventListener("input",this.#a)}hostDisconnected(){this.#e.removeEventListener("focusin",this.#o),this.#e.removeEventListener("input",this.#a)}settle(e){const n=new Set(e.flatMap(bs).map(Eo));for(const s of this.#i){if(!n.has(Eo(s.value)))continue;this.#i.delete(s);const i=this.#t.get(s);i!==void 0&&this.#p(Yh(this.#l(),i.id))}}#o=e=>{const n=To(e.composedPath()[0]);if(n===null||this.#i.has(n))return;const s=Qh(this.#e,n);if(s===null)return;const i=eu(n),r=n.value,o=Zh({...i===void 0?{}:{key:i},hosts:s,name:tu(n),base:r});this.#t.set(n,{id:o,base:r});const a=Jh(this.#l(),o,r);a!==null&&queueMicrotask(()=>{if(n.value===r){n.value=a;try{n.setSelectionRange(a.length,a.length)}catch{}this.#i.add(n),n.dispatchEvent(new Event("input",{bubbles:!0,composed:!0}))}})};#a=e=>{const n=To(e.composedPath()[0]),s=n===null?void 0:this.#t.get(n);if(!(n===null||s===void 0)){for(const i of this.#i)i.isConnected||this.#i.delete(i);this.#i.add(n),this.#p(Gh(this.#l(),s.id,{base:s.base,value:n.value}))}};#l(){return this.#s?.read(this.#r)??{}}#p(e){Object.keys(e).length===0?this.#s?.remove(this.#r):this.#s?.write(this.#r,e)}}class su{#e;#n;#s;#r=null;#t=!1;constructor(e,n={}){this.#e=e,this.#n=n.fetchVersions??_r,this.#s=n.switchTo??Lr,e.addController(this)}hostConnected(){}load(){this.#t||this.#r!==null||(this.#t=!0,this.#n().then(e=>{this.#r=e,this.#t=!1,this.#e.requestUpdate()},e=>{this.#t=!1,console.warn("dev-process-kit: could not list the published versions",e)}))}pick(e){e!==J&&this.#s(e===""?null:e)}render(e){const n=F(e),s=Rr({current:J,requested:ss(location.search)!==null,published:this.#r,text:{pinned:n.versionPinned,latest:n.versionLatest}}),i=()=>this.load();return b`<span class="dpk-version"
2592
+ `],su=30,iu=He(v(),L({base:v(),value:v()})),Oo=t=>{const e=C(iu,t);return e.success?e.output:null},ru=t=>t.key===void 0?JSON.stringify(["field",t.hosts,t.name,t.base]):JSON.stringify(["key",t.key,t.name]),ou=(t,e,n)=>{const{[e]:s,...i}=t;if(n.value===n.base)return i;const r=Object.entries({...i,[e]:n});return Object.fromEntries(r.slice(Math.max(0,r.length-su)))},au=(t,e)=>{if(!(e in t))return t;const{[e]:n,...s}=t;return s},lu=(t,e,n)=>{const s=t[e];return s===void 0||s.base!==n||s.value===n?null:s.value},cu=new Set(["text","search","url","email","tel"]),Po=t=>t instanceof HTMLTextAreaElement||t instanceof HTMLInputElement&&cu.has(t.type)?t:null,du=(t,e)=>{const n=[];let s=e.getRootNode();for(;s instanceof ShadowRoot;){if(s.host===t)return n;n.unshift(s.host.localName),s=s.host.getRootNode()}return null},pu=t=>{let e=t;for(;e!==null;){const n=e.getAttribute("data-dpk-text-key");if(n!==null&&n!=="")return n;const s=e.getRootNode();e=e.parentElement??(s instanceof ShadowRoot?s.host:null)}},hu=t=>t.getAttribute("aria-label")??(t.placeholder||t.name||t.localName),ys=t=>typeof t=="string"?[t]:Array.isArray(t)?t.flatMap(ys):typeof t=="object"&&t!==null?Object.values(t).flatMap(ys):[],zo=t=>t.replace(/\s+/g," ").trim();class uu{#e;#n;#s=null;#r="";#t=new WeakMap;#i=new Set;constructor(e,n){this.#e=e,this.#n=n,e.addController(this)}hostConnected(){this.#s===null&&(this.#s=this.#n.persist()?hh(Oo):le(Oo),this.#r=this.#n.storageKey()),this.#e.addEventListener("focusin",this.#o),this.#e.addEventListener("input",this.#l)}hostDisconnected(){this.#e.removeEventListener("focusin",this.#o),this.#e.removeEventListener("input",this.#l)}settle(e){const n=new Set(e.flatMap(ys).map(zo));for(const s of this.#i){if(!n.has(zo(s.value)))continue;this.#i.delete(s);const i=this.#t.get(s);i!==void 0&&this.#c(au(this.#a(),i.id))}}#o=e=>{const n=Po(e.composedPath()[0]);if(n===null||this.#i.has(n))return;const s=du(this.#e,n);if(s===null)return;const i=pu(n),r=n.value,o=ru({...i===void 0?{}:{key:i},hosts:s,name:hu(n),base:r});this.#t.set(n,{id:o,base:r});const a=lu(this.#a(),o,r);a!==null&&queueMicrotask(()=>{if(n.value===r){n.value=a;try{n.setSelectionRange(a.length,a.length)}catch{}this.#i.add(n),n.dispatchEvent(new Event("input",{bubbles:!0,composed:!0}))}})};#l=e=>{const n=Po(e.composedPath()[0]),s=n===null?void 0:this.#t.get(n);if(!(n===null||s===void 0)){for(const i of this.#i)i.isConnected||this.#i.delete(i);this.#i.add(n),this.#c(ou(this.#a(),s.id,{base:s.base,value:n.value}))}};#a(){return this.#s?.read(this.#r)??{}}#c(e){Object.keys(e).length===0?this.#s?.remove(this.#r):this.#s?.write(this.#r,e)}}class fu{#e;#n;#s;#r=null;#t=!1;constructor(e,n={}){this.#e=e,this.#n=n.fetchVersions??zr,this.#s=n.switchTo??Mr,e.addController(this)}hostConnected(){}load(){this.#t||this.#r!==null||(this.#t=!0,this.#n().then(e=>{this.#r=e,this.#t=!1,this.#e.requestUpdate()},e=>{this.#t=!1,console.warn("dev-process-kit: could not list the published versions",e)}))}pick(e){e!==X&&this.#s(e===""?null:e)}render(e){const n=W(e),s=Pr({current:X,requested:is(location.search)!==null,published:this.#r,text:{pinned:n.versionPinned,latest:n.versionLatest}}),i=()=>this.load();return b`<span class="dpk-version"
2510
2593
  >dev-process-kit@<select
2511
2594
  class="dpk-version-select"
2512
2595
  aria-label=${n.versionLabel}
2513
2596
  title=${n.versionLabel}
2514
2597
  @pointerenter=${i}
2515
2598
  @focus=${i}
2516
- @change=${rs(r=>this.pick(r))}
2599
+ @change=${os(r=>this.pick(r))}
2517
2600
  >
2518
2601
  ${s.options.map(r=>b`<option value=${r.value} ?selected=${r.value===s.value}>${r.label}</option>`)}
2519
2602
  </select></span
2520
- >`}}const xs=`script[type="application/json"]:not([${Or}])`,iu=30,Ro={width:360,height:480},ru=t=>{try{return t.matches(":popover-open")}catch{return!1}},ou=()=>new Promise(t=>requestAnimationFrame(()=>t()));class au extends he{static{this.styles=Wh}static{this.properties={storageKey:{type:String,attribute:"storage-key"},storage:{type:String},notes:{type:String},theme:{type:String},notesOpen:{state:!0}}}#e=!1;#n=new Eh(this);#s=new kh(this,()=>this.storage!=="off"&&this.storage!=="memory");#r=new gh(this);#t=new wh(this);#i=new Fh(this,{persist:()=>this.storage!=="off"&&this.storage!=="memory",template:()=>this.definition.name,layout:()=>this.sidebarLayout});#o=new Uh(this,{persist:()=>this.storage!=="off"&&this.storage!=="memory",template:()=>this.definition.name});#a=new Ch(this);#l=new nu(this,{persist:()=>this.storage!=="off"&&this.storage!=="memory",storageKey:()=>`${this.storageKey??Qt(this.definition.name)}:unsent-text`});#p=null;#c=new rh(this,{persist:()=>this.storage!=="off"&&this.storage!=="memory",storageKey:()=>this.storageKey??Qt(this.definition.name),inside:e=>e.some(n=>n instanceof Element&&(n.id===en||n.classList.contains("dpk-bell"))),show:e=>{this.#Z(e)}});#m={toggleList:()=>this.#c.toggleList(),openList:()=>this.#c.send({kind:"open-list"}),show:e=>this.#c.show(e),dismiss:e=>this.#c.send({kind:"close-toast",key:e}),pause:e=>this.#c.pause(e),resume:e=>this.#c.resume(e)};#k=new Ar(this);#f=!1;#x=new su(this);#h=new $h(this,()=>this.storage!=="off"&&this.storage!=="memory",()=>this.#d?.setTemplate(this.definition));#g;#d;#u=Bn;#y=null;#E=new Set;#S=null;#L;#w;#A;#C=[];#O;#F=new Promise(e=>{this.#O=e});#P;get locale(){return this.#h.locale}get definition(){const e=this.locale;return this.#g?.locale!==e&&(this.#g={locale:e,value:this.definitionFor(e)}),this.#g.value}connectedCallback(){super.connectedCallback(),this.dataset.template=this.definition.name,this.#e||(this.#e=!0,this.notesOpen=this.notes==="on"||this.notes==="open"),this.#z(),window.addEventListener("hashchange",this.#j),this.addEventListener("click",this.#H),this.addEventListener("dpk-comment-targets-change",this.#b),this.addEventListener("dpk-comment-request",this.#q),this.addEventListener("dpk-comment-submit",this.#B),this.addEventListener("dpk-element-action",this.#U),this.#A??=new MutationObserver(this.#b),this.#b()}disconnectedCallback(){super.disconnectedCallback(),window.removeEventListener("hashchange",this.#j),this.removeEventListener("click",this.#H),this.#w?.disconnect(),this.#A?.disconnect(),this.removeEventListener("dpk-comment-targets-change",this.#b),this.removeEventListener("dpk-comment-request",this.#q),this.removeEventListener("dpk-comment-submit",this.#B),this.removeEventListener("dpk-element-action",this.#U)}#z(e=0){if(this.#d){this.#M();return}if(this.childNodes.length===0&&e<2){queueMicrotask(()=>this.#z(e+1));return}this.#ne()}#M(){this.#L||(this.#L=this.#d?.subscribe(()=>this.#oe()))}willUpdate(){this.dataset.theme=this.#s.resolve(ut(this.theme))}updated(){this.#le(),this.#ae(),this.#K(),this.#f&&(this.#f=!1,this.renderRoot.querySelector(".dpk-sidebar-toggle")?.focus())}get api(){return this.#P??=this.#te(),this.#P}get controller(){if(!this.#d)throw new Error(`<${this.tagName.toLowerCase()}> is not initialized yet`);return this.#d}get derivation(){return this.controller.derivation}get navigation(){return this.#u}dispatch(e){const n=this.controller.dispatch(e);return n.ok&&this.#l.settle([e.payload,e.note]),n.ok||(this.requestUpdate(),this.dispatchEvent(new CustomEvent("dpk-error",{detail:{issues:n.issues},bubbles:!0,composed:!0})),this.#v()),n}dispatchBatch(e){const n=this.controller.dispatchBatch(e);return n.ok&&this.#l.settle(e.flatMap(s=>[s.payload,s.note])),n.ok||(this.requestUpdate(),this.dispatchEvent(new CustomEvent("dpk-error",{detail:{issues:n.issues},bubbles:!0,composed:!0})),this.#v()),n}editComment(e,n){const s=this.controller.editComment(e,n);return s.ok&&this.#l.settle([n]),s.ok||(this.requestUpdate(),this.dispatchEvent(new CustomEvent("dpk-error",{detail:{issues:s.issues},bubbles:!0,composed:!0})),this.#v()),s}removeAction(e){this.controller.removeAction(e)}clearActions(){this.controller.clearActions()}navigate(e,n={}){const s=He(this.#$());this.#u=Un(this.#u,e,this.definition.navigationHierarchy),this.#T(n.replace??!1);const i=He(this.#$());this.requestUpdate(),s!==i&&(this.#v(),this.dispatchEvent(new CustomEvent("dpk-navigate",{detail:{navigation:this.#u},bubbles:!0,composed:!0})))}hashFor(e){const n=this.#$();return He(this.definition.resolveNavigation(this.derivation.state,Un(n,e,this.definition.navigationHierarchy)))}requestComment(e){this.#y=typeof e=="string"?e:N(e),this.notesOpen=!0,this.requestUpdate()}get integratedReview(){return!1}get canSendToClaude(){return this.#r.available}sendToClaude(){return this.#r.send({brief:this.api.exportBrief(),draft:Nn(this.derivation.actions),anchor:this})}renderReviewPanel(e){return b`<dpk-component-comment-panel
2603
+ >`}}const ws=`script[type="application/json"]:not([${Ir}])`,gu=30,Mo={width:360,height:480},mu=t=>{try{return t.matches(":popover-open")}catch{return!1}},ku=()=>new Promise(t=>requestAnimationFrame(()=>t()));class bu extends he{static{this.styles=nu}static{this.properties={storageKey:{type:String,attribute:"storage-key"},storage:{type:String},notes:{type:String},theme:{type:String},notesOpen:{state:!0}}}#e=!1;#n=new jh(this);#s=new Eh(this,()=>this.storage!=="off"&&this.storage!=="memory");#r=new Ch(this);#t=new Ph(this);#i=new tu(this,{persist:()=>this.storage!=="off"&&this.storage!=="memory",template:()=>this.definition.name,layout:()=>this.sidebarLayout});#o=new Qh(this,{persist:()=>this.storage!=="off"&&this.storage!=="memory",template:()=>this.definition.name});#l=new Nh(this);#a=new uu(this,{persist:()=>this.storage!=="off"&&this.storage!=="memory",storageKey:()=>`${this.storageKey??en(this.definition.name)}:unsent-text`});#c=null;#p=new gh(this,{persist:()=>this.storage!=="off"&&this.storage!=="memory",storageKey:()=>this.storageKey??en(this.definition.name),inside:e=>e.some(n=>n instanceof Element&&(n.id===tn||n.classList.contains("dpk-bell"))),show:e=>{this.#G(e)}});#m={toggleList:()=>this.#p.toggleList(),openList:()=>this.#p.send({kind:"open-list"}),show:e=>this.#p.show(e),dismiss:e=>this.#p.send({kind:"close-toast",key:e}),readAll:()=>this.#p.send({kind:"read-all"}),pause:e=>this.#p.pause(e),resume:e=>this.#p.resume(e)};#k=new Rr(this);#h=!1;#x=new fu(this);#g=new zh(this,()=>this.storage!=="off"&&this.storage!=="memory",()=>this.#d?.setTemplate(this.definition));#u;#d;#f=Un;#b=null;#w=new Set;#A=null;#L;#$;#C;#T=[];#O;#F=new Promise(e=>{this.#O=e});#P;get locale(){return this.#g.locale}get definition(){const e=this.locale;return this.#u?.locale!==e&&(this.#u={locale:e,value:this.definitionFor(e)}),this.#u.value}connectedCallback(){super.connectedCallback(),this.dataset.template=this.definition.name,this.#e||(this.#e=!0,this.notesOpen=this.notes==="on"||this.notes==="open"),this.#z(),window.addEventListener("hashchange",this.#j),this.addEventListener("click",this.#H),this.addEventListener("dpk-comment-targets-change",this.#v),this.addEventListener("dpk-comment-request",this.#q),this.addEventListener("dpk-comment-submit",this.#B),this.addEventListener("dpk-element-action",this.#U),this.#C??=new MutationObserver(this.#v),this.#v()}disconnectedCallback(){super.disconnectedCallback(),window.removeEventListener("hashchange",this.#j),this.removeEventListener("click",this.#H),this.#$?.disconnect(),this.#C?.disconnect(),this.removeEventListener("dpk-comment-targets-change",this.#v),this.removeEventListener("dpk-comment-request",this.#q),this.removeEventListener("dpk-comment-submit",this.#B),this.removeEventListener("dpk-element-action",this.#U)}#z(e=0){if(this.#d){this.#M();return}if(this.childNodes.length===0&&e<2){queueMicrotask(()=>this.#z(e+1));return}this.#ne()}#M(){this.#L||(this.#L=this.#d?.subscribe(()=>this.#oe()))}willUpdate(){this.dataset.theme=this.#s.resolve(mt(this.theme))}updated(){this.#le(),this.#ae(),this.#K(),this.#h&&(this.#h=!1,this.renderRoot.querySelector(".dpk-sidebar-toggle")?.focus())}get api(){return this.#P??=this.#te(),this.#P}get controller(){if(!this.#d)throw new Error(`<${this.tagName.toLowerCase()}> is not initialized yet`);return this.#d}get derivation(){return this.controller.derivation}get navigation(){return this.#f}dispatch(e){const n=this.controller.dispatch(e);return n.ok&&this.#a.settle([e.payload,e.note]),n.ok||(this.requestUpdate(),this.dispatchEvent(new CustomEvent("dpk-error",{detail:{issues:n.issues},bubbles:!0,composed:!0})),this.#y()),n}dispatchBatch(e){const n=this.controller.dispatchBatch(e);return n.ok&&this.#a.settle(e.flatMap(s=>[s.payload,s.note])),n.ok||(this.requestUpdate(),this.dispatchEvent(new CustomEvent("dpk-error",{detail:{issues:n.issues},bubbles:!0,composed:!0})),this.#y()),n}editComment(e,n){const s=this.controller.editComment(e,n);return s.ok&&this.#a.settle([n]),s.ok||(this.requestUpdate(),this.dispatchEvent(new CustomEvent("dpk-error",{detail:{issues:s.issues},bubbles:!0,composed:!0})),this.#y()),s}removeAction(e){this.controller.removeAction(e)}clearActions(){this.controller.clearActions()}navigate(e,n={}){const s=Fe(this.#S());this.#f=Hn(this.#f,e,this.definition.navigationHierarchy),this.#E(n.replace??!1);const i=Fe(this.#S());this.requestUpdate(),s!==i&&(this.#y(),this.dispatchEvent(new CustomEvent("dpk-navigate",{detail:{navigation:this.#f},bubbles:!0,composed:!0})))}hashFor(e){const n=this.#S();return Fe(this.definition.resolveNavigation(this.derivation.state,Hn(n,e,this.definition.navigationHierarchy)))}requestComment(e){this.#b=typeof e=="string"?e:N(e),this.notesOpen=!0,this.requestUpdate()}get integratedReview(){return!1}get canSendToClaude(){return this.#r.available}sendToClaude(){return this.#r.send({brief:this.api.exportBrief(),draft:Dn(this.derivation.actions),anchor:this})}renderReviewPanel(e){return b`<dpk-component-comment-panel
2521
2604
  .definition=${this.controller.definition}
2522
2605
  .state=${e.state}
2523
2606
  .navigation=${e.navigation}
@@ -2525,13 +2608,13 @@ The brief is too long for a comment, so it is stored in this artifact's database
2525
2608
  .issues=${this.controller.lastIssues}
2526
2609
  .exportBrief=${()=>this.api.exportBrief()}
2527
2610
  .sendToClaude=${this.canSendToClaude?()=>this.sendToClaude():void 0}
2528
- .pendingTarget=${this.#y}
2611
+ .pendingTarget=${this.#b}
2529
2612
  .embedded=${this.integratedReview}
2530
2613
  .onDelete=${n=>this.removeAction(n)}
2531
2614
  .onEditComment=${(n,s)=>this.editComment(n,s)}
2532
2615
  .onClear=${()=>this.clearActions()}
2533
- .onComment=${(n,s)=>{const i=this.dispatch({type:D,target:n,payload:{body:s}});return i.ok&&(this.#y=null),i}}
2534
- ></dpk-component-comment-panel>`}renderChrome(e,n){const s=e.actions.length,i=e.actions.filter(u=>u.type===D).length,r=s-i,o=F(this.locale),a=n.sidebarHidden===!0||!n.sidebar&&!this.hasSidebarContent(),l=this.sidebarLayout.side,c=this.#X,p=!a&&this.#R&&(c?!this.#o.drawerOpen:this.#o.collapsed),d=a?m:this.#Q(p,c),h=this.definition.title(e.state);return b`
2616
+ .onComment=${(n,s)=>{const i=this.dispatch({type:D,target:n,payload:{body:s}});return i.ok&&(this.#b=null),i}}
2617
+ ></dpk-component-comment-panel>`}renderChrome(e,n){const s=e.actions.length,i=e.actions.filter(u=>u.type===D).length,r=s-i,o=W(this.locale),a=n.sidebarHidden===!0||!n.sidebar&&!this.hasSidebarContent(),l=this.sidebarLayout.side,c=this.#X,p=!a&&this.#R&&(c?!this.#o.drawerOpen:this.#o.collapsed),d=a?g:this.#Q(p,c),h=this.definition.title(e.state);return b`
2535
2618
  <div class="dpk-shell" ?data-resizing=${this.#i.dragging}>
2536
2619
  <header class="dpk-header">
2537
2620
  <span class="dpk-brand" aria-hidden="true"></span>
@@ -2540,7 +2623,7 @@ The brief is too long for a comment, so it is stored in this artifact's database
2540
2623
  <h1 title=${h}>${h}</h1>
2541
2624
  </div>
2542
2625
  <div class="dpk-header-slot">
2543
- ${n.header??m}
2626
+ ${n.header??g}
2544
2627
  <slot name="header"></slot>
2545
2628
  </div>
2546
2629
  <div class="dpk-header-meta">
@@ -2555,29 +2638,29 @@ The brief is too long for a comment, so it is stored in this artifact's database
2555
2638
  </div>
2556
2639
  </header>
2557
2640
  <div class="dpk-body" data-sidebar-side=${l} ?data-sidebar-drawer=${c}>
2558
- ${l==="right"?d:m}
2641
+ ${l==="right"?d:g}
2559
2642
  <aside
2560
2643
  id="dpk-sidebar"
2561
2644
  class="dpk-sidebar"
2562
2645
  ?hidden=${a||p}
2563
2646
  style=${`--dpk-sidebar-width: ${this.#i.width}px`}
2564
2647
  >
2565
- ${n.sidebar??m}
2648
+ ${n.sidebar??g}
2566
2649
  <slot name="sidebar"></slot>
2567
2650
  </aside>
2568
- ${l==="left"?d:m}
2569
- ${c&&!p&&!a?b`<div class="dpk-sidebar-scrim" @click=${()=>this.#o.closeDrawer()}></div>`:m}
2651
+ ${l==="left"?d:g}
2652
+ ${c&&!p&&!a?b`<div class="dpk-sidebar-scrim" @click=${()=>this.#o.closeDrawer()}></div>`:g}
2570
2653
  <main class="dpk-main">
2571
2654
  <div class="dpk-main-body">
2572
- ${this.#S?b`<div class="dpk-banner" role="alert">
2655
+ ${this.#A?b`<div class="dpk-banner" role="alert">
2573
2656
  <strong>${o.baseDataError}</strong>
2574
- <code>${this.#S}</code>
2575
- </div>`:m}
2576
- ${this.#c.error===null?m:b`<div class="dpk-banner" role="alert">
2657
+ <code>${this.#A}</code>
2658
+ </div>`:g}
2659
+ ${this.#p.error===null?g:b`<div class="dpk-banner" role="alert">
2577
2660
  <strong>${o.changesError}</strong>
2578
- <code>${this.#c.error}</code>
2661
+ <code>${this.#p.error}</code>
2579
2662
  </div>`}
2580
- ${n.main??m}
2663
+ ${n.main??g}
2581
2664
  <slot name="main"></slot>
2582
2665
  <section class="dpk-orphans" ?hidden=${this.#n.orphans===0}>
2583
2666
  <p class="dpk-label">previews without metadata</p>
@@ -2586,18 +2669,18 @@ The brief is too long for a comment, so it is stored in this artifact's database
2586
2669
  </div>
2587
2670
  <div class="dpk-memo" ?hidden=${!this.hasMemoContent()}>
2588
2671
  <details class="dpk-memo-fold">
2589
- <summary class="dpk-memo-bar">${Gn()} ${o.memo}</summary>
2672
+ <summary class="dpk-memo-bar">${Yn()} ${o.memo}</summary>
2590
2673
  <div class="dpk-memo-body"><slot name="memo"></slot></div>
2591
2674
  </details>
2592
2675
  </div>
2593
2676
  </main>
2594
- ${this.integratedReview?m:b`<aside class="dpk-notes" ?hidden=${!this.notesOpen}>${this.renderReviewPanel(e)}</aside>`}
2677
+ ${this.integratedReview?g:b`<aside class="dpk-notes" ?hidden=${!this.notesOpen}>${this.renderReviewPanel(e)}</aside>`}
2595
2678
  </div>
2596
2679
  ${n.footer||this.hasFooterContent()?b`<footer class="dpk-footer">
2597
- ${n.footer??m}
2680
+ ${n.footer??g}
2598
2681
  <slot name="footer"></slot>
2599
- </footer>`:m}
2600
- ${this.integratedReview?m:b`<button
2682
+ </footer>`:g}
2683
+ ${this.integratedReview?g:b`<button
2601
2684
  class="dpk-fab"
2602
2685
  type="button"
2603
2686
  aria-expanded=${this.notesOpen?"true":"false"}
@@ -2611,13 +2694,13 @@ The brief is too long for a comment, so it is stored in this artifact's database
2611
2694
  >
2612
2695
  ${o.review}
2613
2696
  </span>
2614
- ${s>0?b`<span class="dpk-fab-badge">${s}</span>`:m}
2697
+ ${s>0?b`<span class="dpk-fab-badge">${s}</span>`:g}
2615
2698
  </button>`}
2616
- ${this.integratedReview?m:this.#G(s)} ${this.#V()}
2699
+ ${this.integratedReview?g:this.#Z(s)} ${this.#V()}
2617
2700
  </div>
2618
- `}#W(){const e=this.#c.view;if(!e)return m;const n=F(this.locale);return b`${oh(e,n,this.#m)}
2619
- ${ah(e,this.#c.revision,n,this.#m)}`}#V(){const e=this.#c.view;return e?lh(e,F(this.locale),this.#m):m}#K(){const e=this.renderRoot.querySelector(`#${en}`),n=this.renderRoot.querySelector(".dpk-bell");!e||!n||ru(e)||this.#k.open(e,n,{width:Ro.width,height:Math.min(Ro.height,window.innerHeight-96)})}async#Z(e){const n={};this.#p=n;const s=this.derivation.state,i=e.target===null?null:this.definition.canonicalTarget?.(s,ot(e.target))??ot(e.target),r=pp({...e,target:i&&N(i)},a=>this.definition.navigationFor?this.definition.navigationFor(s,a):null);if(!r||(r.navigate&&this.navigate(r.navigate),i===null))return;this.showTarget(i);const o=N(i);for(let a=0;a<iu;a+=1){if(await this.updateComplete,await ou(),this.#p!==n)return;const l=vo(this,o);if(!(l===null||l.getClientRects().length===0)){Oh(this,l),Mh(l);return}}}showTarget(e){}#G(e){const n=Qp({actions:e,railOpen:this.notesOpen,sendable:this.canSendToClaude,locale:this.locale},this.#t.state);if(!n)return m;const s=F(this.locale);return b`<div class="dpk-dock" role="group" aria-label=${s.handoffLabel}>
2620
- ${n.note?b`<p class="dpk-dock-note" role="alert">${n.note}</p>`:m}
2701
+ `}#W(){const e=this.#p.view;if(!e)return g;const n=W(this.locale);return b`${mh(e,n,this.#m)}
2702
+ ${bh(e,n,this.#m)}`}#V(){const e=this.#p.view;return e?vh(e,W(this.locale),this.#m):g}#K(){const e=this.renderRoot.querySelector(`#${tn}`),n=this.renderRoot.querySelector(".dpk-bell");!e||!n||mu(e)||this.#k.open(e,n,{width:Mo.width,height:Math.min(Mo.height,window.innerHeight-96)})}async#G(e){const n={};this.#c=n;const s=this.derivation.state,i=e.target===null?null:this.definition.canonicalTarget?.(s,at(e.target))??at(e.target),r=yp({...e,target:i&&N(i)},a=>this.definition.navigationFor?this.definition.navigationFor(s,a):null);if(!r||(r.navigate&&this.navigate(r.navigate),i===null))return;this.showTarget(i);const o=N(i);for(let a=0;a<gu;a+=1){if(await this.updateComplete,await ku(),this.#c!==n)return;const l=Co(this,o);if(!(l===null||l.getClientRects().length===0)){Hh(this,l),Vh(l);return}}}showTarget(e){}#Z(e){const n=ch({actions:e,railOpen:this.notesOpen,sendable:this.canSendToClaude,locale:this.locale},this.#t.state);if(!n)return g;const s=W(this.locale);return b`<div class="dpk-dock" role="group" aria-label=${s.handoffLabel}>
2703
+ ${n.note?b`<p class="dpk-dock-note" role="alert">${n.note}</p>`:g}
2621
2704
  <div class="dpk-dock-actions">
2622
2705
  ${n.send?b`<button
2623
2706
  class="dpk-btn dpk-btn--accent"
@@ -2626,7 +2709,7 @@ The brief is too long for a comment, so it is stored in this artifact's database
2626
2709
  @click=${()=>{this.#t.send(()=>this.sendToClaude())}}
2627
2710
  >
2628
2711
  ${n.send.label}
2629
- </button>`:m}
2712
+ </button>`:g}
2630
2713
  <button
2631
2714
  class=${n.send?"dpk-btn":"dpk-btn dpk-btn--accent"}
2632
2715
  type="button"
@@ -2637,41 +2720,41 @@ The brief is too long for a comment, so it is stored in this artifact's database
2637
2720
  ${n.copy.label}
2638
2721
  </button>
2639
2722
  </div>
2640
- </div>`}#Y(){const e=this.locale,n=F(e).language;return b`<select
2723
+ </div>`}#Y(){const e=this.locale,n=W(e).language;return b`<select
2641
2724
  class="dpk-lang-select"
2642
2725
  aria-label=${n}
2643
2726
  title=${n}
2644
- @change=${rs(s=>{const i=mn.find(r=>r===s);i!==void 0&&this.#h.pick(i)})}
2727
+ @change=${os(s=>{const i=kn.find(r=>r===s);i!==void 0&&this.#g.pick(i)})}
2645
2728
  >
2646
- ${mn.map(s=>b`<option value=${s} lang=${s} ?selected=${s===e}>
2647
- ${Jl[s]}
2729
+ ${kn.map(s=>b`<option value=${s} lang=${s} ?selected=${s===e}>
2730
+ ${sc[s]}
2648
2731
  </option>`)}
2649
- </select>`}#J(){const e=this.dataset.theme==="dark",n=F(this.locale),s=e?n.useLightTheme:n.useDarkTheme;return b`<button
2732
+ </select>`}#J(){const e=this.dataset.theme==="dark",n=W(this.locale),s=e?n.useLightTheme:n.useDarkTheme;return b`<button
2650
2733
  class="dpk-theme-toggle"
2651
2734
  type="button"
2652
2735
  aria-label=${s}
2653
2736
  title=${s}
2654
- @click=${()=>this.#s.toggle(ut(this.theme))}
2737
+ @click=${()=>this.#s.toggle(mt(this.theme))}
2655
2738
  >
2656
- ${e?jc():qc()}
2657
- </button>`}get#R(){return this.sidebarLayout.collapsible!==!1}get#X(){return this.#a.narrow&&this.#R&&this.sidebarLayout.narrow!=="stack"}#Q(e,n){const s=this.#R?this.#ee(e,n):m;return e||n?b`<div class="dpk-sidebar-strip">${s}</div>`:this.sidebarLayout.side==="left"?b`${this.#I()}${s}`:b`${s}${this.#I()}`}#ee(e,n){const s=F(this.locale),i=qh(this.sidebarLayout.side,e),r=i.action==="collapse"?s.collapseSidebar:s.expandSidebar;return b`<button
2739
+ ${e?Fc():Wc()}
2740
+ </button>`}get#R(){return this.sidebarLayout.collapsible!==!1}get#X(){return this.#l.narrow&&this.#R&&this.sidebarLayout.narrow!=="stack"}#Q(e,n){const s=this.#R?this.#ee(e,n):g;return e||n?b`<div class="dpk-sidebar-strip">${s}</div>`:this.sidebarLayout.side==="left"?b`${this.#I()}${s}`:b`${s}${this.#I()}`}#ee(e,n){const s=W(this.locale),i=Jh(this.sidebarLayout.side,e),r=i.action==="collapse"?s.collapseSidebar:s.expandSidebar;return b`<button
2658
2741
  class="dpk-sidebar-toggle"
2659
2742
  type="button"
2660
2743
  aria-controls="dpk-sidebar"
2661
2744
  aria-expanded=${e?"false":"true"}
2662
2745
  aria-label=${r}
2663
2746
  title=${r}
2664
- @click=${()=>{this.#f=!0,n?this.#o.toggleDrawer():this.#o.toggle()}}
2747
+ @click=${()=>{this.#h=!0,n?this.#o.toggleDrawer():this.#o.toggle()}}
2665
2748
  >
2666
- ${i.points==="left"?or():Gn()}
2667
- </button>`}#I(){const e=F(this.locale),n=this.#i.handlers;return b`<div
2749
+ ${i.points==="left"?dr():Yn()}
2750
+ </button>`}#I(){const e=W(this.locale),n=this.#i.handlers;return b`<div
2668
2751
  class="dpk-sidebar-resizer"
2669
2752
  role="separator"
2670
2753
  tabindex="0"
2671
2754
  aria-orientation="vertical"
2672
2755
  aria-label=${e.resizeSidebar}
2673
- aria-valuemin=${be.min}
2674
- aria-valuemax=${be.max}
2756
+ aria-valuemin=${ve.min}
2757
+ aria-valuemax=${ve.max}
2675
2758
  aria-valuenow=${this.#i.width}
2676
2759
  title=${e.resizeSidebarHint}
2677
2760
  @pointerdown=${n.pointerdown}
@@ -2680,4 +2763,4 @@ The brief is too long for a comment, so it is stored in this artifact's database
2680
2763
  @pointercancel=${n.pointercancel}
2681
2764
  @keydown=${n.keydown}
2682
2765
  @dblclick=${n.dblclick}
2683
- ></div>`}render(){if(!this.#d)return m;const e=this.#D();return this.renderChrome(e,this.renderRegions(e))}get sidebarLayout(){return Ih}hasSidebarContent(){return this.querySelector('[slot="sidebar"]')!==null}hasMemoContent(){return this.querySelector('[slot="memo"]')!==null}hasFooterContent(){return this.querySelector('[slot="footer"]')!==null}context(){return this.#D()}#_(){return{definition:this.definition,controller:()=>this.controller,derivation:()=>this.derivation,ready:this.#F,navigation:()=>this.#$(),issues:()=>this.controller.lastIssues,dispatch:e=>this.dispatch(e),dispatchBatch:e=>this.dispatchBatch(e),subscribe:e=>(this.#E.add(e),()=>{this.#E.delete(e)}),editComment:(e,n)=>this.editComment(e,n),removeAction:e=>this.removeAction(e),clearActions:()=>this.clearActions(),navigate:(e,n)=>this.navigate(e,n),hashFor:e=>this.hashFor(e),requestComment:e=>this.requestComment(e)}}#te(){return th(this.#_(),this)}#N(){return so(this.#_())}#D(){return eh(this.#_())}#$(){return this.definition.resolveNavigation(this.derivation.state,this.#u)}#ne(){const e=this.#ie();this.#u=ho();const n=this.storageKey;this.#d=new eo({definition:this.definition,base:e,storage:this.#se(),...typeof n=="string"?{storageKey:n}:{}}),this.#M(),this.#b(),this.#T(!0),this.#O?.(),this.#re(),this.requestUpdate()}#se(){return this.storage==="off"?null:this.storage==="memory"?new ds:ps()}#ie(){const e=this.querySelector(xs);if(!e?.textContent||e.textContent.trim().length===0)return console.warn(`[dev-process-kit] <${this.tagName.toLowerCase()}> has no base JSON; starting from an empty state.`),this.#S='no <script type="application/json"> child found',this.definition.emptyBase();try{return this.definition.parseBase(JSON.parse(e.textContent))}catch(n){return console.error("[dev-process-kit] invalid base data:",n),this.#S=n instanceof Error?n.message:String(n),this.definition.emptyBase()}}#re(){this.querySelector(xs)||(this.#w=new MutationObserver(()=>{const e=this.querySelector(xs);if(e){this.#w?.disconnect(),this.#w=void 0;try{this.controller.setBase(this.definition.parseBase(JSON.parse(e.textContent??"null")))}catch(n){console.error("[dev-process-kit] invalid base data:",n)}}}),this.#w.observe(this,{childList:!0,subtree:!0}))}#v(){const e=this.#N();for(const n of this.#E)n(e)}#oe(){if(!this.isConnected){this.requestUpdate(),this.#v();return}this.#T(!0),po(this.#C,this.controller.actions),queueMicrotask(this.#b),this.requestUpdate(),this.#v(),this.dispatchEvent(new CustomEvent("dpk-change",{detail:this.#N(),bubbles:!0,composed:!0}))}#T(e){const n=this.#$();this.#u=n,Th(n,e)}#j=()=>{this.#u=ho(),this.#T(!0),this.requestUpdate(),this.#v(),this.dispatchEvent(new CustomEvent("dpk-navigate",{detail:{navigation:this.#u},bubbles:!0,composed:!0}))};#b=()=>{this.#A?.disconnect(),this.#C=bh(this,e=>{this.isConnected&&this.#A?.observe(e,{childList:!0,subtree:!0})}),this.#d&&(po(this.#C,this.#d.actions),this.#d.setComponentSnapshot(vh(this.#C)))};#q=e=>{if(e.stopPropagation(),!(e instanceof CustomEvent)||!this.#d)return;const n=e.detail;typeof n!="object"||n===null||!("target"in n)||typeof n.target!="string"||(this.#b(),!this.controller.definition.commentTargets(this.derivation.state,this.navigation).some(i=>i.value===n.target))||this.requestComment(n.target)};#B=e=>{if(e.stopPropagation(),!(e instanceof CustomEvent)||!e.cancelable||!this.#d)return;const n=T(mp,e.detail);if(!n.success)return;this.#b();const{target:s,body:i}=n.output;if(!this.controller.definition.commentTargets(this.derivation.state,this.navigation).some(a=>a.value===s))return;this.dispatch({type:D,target:s,payload:{body:i}}).ok&&e.preventDefault()};#U=e=>{if(e.stopPropagation(),!(e instanceof CustomEvent)||!e.cancelable||!this.#d)return;const n=T(Fl,e.detail);if(!n.success)return;this.#b();const{type:s,target:i,payload:r}=n.output;if(!this.controller.definition.commentTargets(this.derivation.state,this.navigation).some(l=>l.value===i))return;this.dispatch({type:s,target:i,payload:r}).ok&&e.preventDefault()};#H=e=>{for(const n of e.composedPath()){if(!(n instanceof Element))continue;if(n===this||n.hasAttribute("data-template"))break;const s=n.getAttribute("data-dpk-navigate");if(s!==null){e.preventDefault(),this.navigate(Dt(s.includes("=")?s:`step=${s}`));return}const i=n.getAttribute("data-dpk-comment");if(i!==null){e.preventDefault(),this.requestComment(i);return}}};#ae(){const e=this.renderRoot.querySelector(".dpk-shell"),n=this.renderRoot.querySelector(".dpk-dock-actions");e&&(n?e.style.setProperty("--dpk-dock-space",`${n.offsetWidth+8}px`):e.style.removeProperty("--dpk-dock-space"))}#le(){this.#n.route()}}export{ht as $,Zn as A,Pc as B,D as C,lr as D,Bn as E,J as F,sr as G,rr as H,Kn as I,ir as J,nr as K,Yr as L,ds as M,Dt as N,ot as O,Ll as P,Un as Q,Ol as R,Nn as S,au as T,Ni as U,N as V,cs as W,It as X,zn as Y,Tt as Z,Cr as _,Dn as a,un as a$,Ct as a0,la as a1,de as a2,m as a3,b as a4,jt as a5,Oc as a6,Fo as a7,he as a8,Ar as a9,El as aA,B as aB,Ke as aC,le as aD,ep as aE,rs as aF,tp as aG,Xt as aH,je as aI,Nd as aJ,vo as aK,Wn as aL,Fn as aM,mo as aN,$i as aO,Rl as aP,Cl as aQ,Vs as aR,yi as aS,_ as aT,Qi as aU,er as aV,gn as aW,Xs as aX,jd as aY,Qe as aZ,wt as a_,bn as aa,Nc as ab,Dc as ac,Pn as ad,se as ae,ne as af,G as ag,x as ah,zt as ai,w as aj,S as ak,zi as al,Ii as am,me as an,Re as ao,Li as ap,Gn as aq,Ic as ar,On as as,T as at,L as au,Oi as av,Ln as aw,Ti as ax,Ci as ay,Pi as az,wi as b,or as b0,Lc as b1,_c as b2,Ei as b3,ko as b4,Si as b5,Xi as b6,tr as b7,eo as c,In as d,Pl as e,Hn as f,qi as g,at as h,Zr as i,xn as j,Di as k,Nl as l,Mn as m,ps as n,Qt as o,_l as p,Wc as q,fl as r,Zd as s,Gr as t,_e as u,Ml as v,He as w,Mc as x,zc as y,qt as z};
2766
+ ></div>`}render(){if(!this.#d)return g;const e=this.#D();return this.renderChrome(e,this.renderRegions(e))}get sidebarLayout(){return Kh}hasSidebarContent(){return this.querySelector('[slot="sidebar"]')!==null}hasMemoContent(){return this.querySelector('[slot="memo"]')!==null}hasFooterContent(){return this.querySelector('[slot="footer"]')!==null}context(){return this.#D()}#_(){return{definition:this.definition,controller:()=>this.controller,derivation:()=>this.derivation,ready:this.#F,navigation:()=>this.#S(),issues:()=>this.controller.lastIssues,dispatch:e=>this.dispatch(e),dispatchBatch:e=>this.dispatchBatch(e),subscribe:e=>(this.#w.add(e),()=>{this.#w.delete(e)}),editComment:(e,n)=>this.editComment(e,n),removeAction:e=>this.removeAction(e),clearActions:()=>this.clearActions(),navigate:(e,n)=>this.navigate(e,n),hashFor:e=>this.hashFor(e),requestComment:e=>this.requestComment(e)}}#te(){return ph(this.#_(),this)}#N(){return lo(this.#_())}#D(){return dh(this.#_())}#S(){return this.definition.resolveNavigation(this.derivation.state,this.#f)}#ne(){const e=this.#ie();this.#f=bo();const n=this.storageKey;this.#d=new ro({definition:this.definition,base:e,storage:this.#se(),...typeof n=="string"?{storageKey:n}:{}}),this.#M(),this.#v(),this.#E(!0),this.#O?.(),this.#re(),this.requestUpdate()}#se(){return this.storage==="off"?null:this.storage==="memory"?new us:fs()}#ie(){const e=this.querySelector(ws);if(!e?.textContent||e.textContent.trim().length===0)return console.warn(`[dev-process-kit] <${this.tagName.toLowerCase()}> has no base JSON; starting from an empty state.`),this.#A='no <script type="application/json"> child found',this.definition.emptyBase();try{return this.definition.parseBase(JSON.parse(e.textContent))}catch(n){return console.error("[dev-process-kit] invalid base data:",n),this.#A=n instanceof Error?n.message:String(n),this.definition.emptyBase()}}#re(){this.querySelector(ws)||(this.#$=new MutationObserver(()=>{const e=this.querySelector(ws);if(e){this.#$?.disconnect(),this.#$=void 0;try{this.controller.setBase(this.definition.parseBase(JSON.parse(e.textContent??"null")))}catch(n){console.error("[dev-process-kit] invalid base data:",n)}}}),this.#$.observe(this,{childList:!0,subtree:!0}))}#y(){const e=this.#N();for(const n of this.#w)n(e)}#oe(){if(!this.isConnected){this.requestUpdate(),this.#y();return}this.#E(!0),ko(this.#T,this.controller.actions),queueMicrotask(this.#v),this.requestUpdate(),this.#y(),this.dispatchEvent(new CustomEvent("dpk-change",{detail:this.#N(),bubbles:!0,composed:!0}))}#E(e){const n=this.#S();this.#f=n,Dh(n,e)}#j=()=>{this.#f=bo(),this.#E(!0),this.requestUpdate(),this.#y(),this.dispatchEvent(new CustomEvent("dpk-navigate",{detail:{navigation:this.#f},bubbles:!0,composed:!0}))};#v=()=>{this.#C?.disconnect(),this.#T=Rh(this,e=>{this.isConnected&&this.#C?.observe(e,{childList:!0,subtree:!0})}),this.#d&&(ko(this.#T,this.#d.actions),this.#d.setComponentSnapshot(Lh(this.#T)))};#q=e=>{if(e.stopPropagation(),!(e instanceof CustomEvent)||!this.#d)return;const n=e.detail;typeof n!="object"||n===null||!("target"in n)||typeof n.target!="string"||(this.#v(),!this.controller.definition.commentTargets(this.derivation.state,this.navigation).some(i=>i.value===n.target))||this.requestComment(n.target)};#B=e=>{if(e.stopPropagation(),!(e instanceof CustomEvent)||!e.cancelable||!this.#d)return;const n=C(Cp,e.detail);if(!n.success)return;this.#v();const{target:s,body:i}=n.output;if(!this.controller.definition.commentTargets(this.derivation.state,this.navigation).some(a=>a.value===s))return;this.dispatch({type:D,target:s,payload:{body:i}}).ok&&e.preventDefault()};#U=e=>{if(e.stopPropagation(),!(e instanceof CustomEvent)||!e.cancelable||!this.#d)return;const n=C(Yl,e.detail);if(!n.success)return;this.#v();const{type:s,target:i,payload:r}=n.output;if(!this.controller.definition.commentTargets(this.derivation.state,this.navigation).some(l=>l.value===i))return;this.dispatch({type:s,target:i,payload:r}).ok&&e.preventDefault()};#H=e=>{for(const n of e.composedPath()){if(!(n instanceof Element))continue;if(n===this||n.hasAttribute("data-template"))break;const s=n.getAttribute("data-dpk-navigate");if(s!==null){e.preventDefault(),this.navigate(qt(s.includes("=")?s:`step=${s}`));return}const i=n.getAttribute("data-dpk-comment");if(i!==null){e.preventDefault(),this.requestComment(i);return}}};#ae(){const e=this.renderRoot.querySelector(".dpk-shell"),n=this.renderRoot.querySelector(".dpk-dock-actions");e&&(n?e.style.setProperty("--dpk-dock-space",`${n.offsetWidth+8}px`):e.style.removeProperty("--dpk-dock-space"))}#le(){this.#n.route()}}export{ft as $,Zn as A,Dc as B,D as C,hr as D,Un as E,X as F,ar as G,cr as H,Gn as I,lr as J,or as K,to as L,us as M,qt as N,at as O,Nl as P,Hn as Q,Dl as R,Dn as S,bu as T,qi as U,N as V,hs as W,Dt as X,Mn as Y,_t as Z,_r as _,jn as a,et as a$,Rt as a0,fa as a1,de as a2,g as a3,b as a4,ct as a5,Nc as a6,Yo as a7,he as a8,Rr as a9,zl as aA,B as aB,Ge as aC,le as aD,rp as aE,os as aF,op as aG,Qt as aH,je as aI,Ud as aJ,Co as aK,Vn as aL,Wn as aM,wo as aN,Ci as aO,Ml as aP,Ol as aQ,He as aR,Zs as aS,Si as aT,_ as aU,rr as aV,nr as aW,sr as aX,mn as aY,ti as aZ,Fd as a_,vn as aa,Uc as ab,Hc as ac,zn as ad,Z as ae,se as af,F as ag,v as ah,Nt as ai,w as aj,S as ak,Ni as al,ji as am,ke as an,me as ao,zi as ap,Yn as aq,Bc as ar,Pn as as,C as at,L as au,Mi as av,On as aw,_i as ax,Ri as ay,Ii as az,Ai as b,At as b0,fn as b1,dr as b2,Ic as b3,Mc as b4,Li as b5,$o as b6,Ti as b7,tr as b8,ir as b9,ro as c,Nn as d,jl as e,Fn as f,Hi as g,lt as h,Qr as i,xn as j,Bi as k,Hl as l,In as m,fs as n,en as o,Il as p,Yc as q,xl as r,Qd as s,eo as t,_e as u,Bl as v,Fe as w,qc as x,jc as y,Bt as z};