dev-process-kit 0.0.14 → 0.0.15

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 (28) hide show
  1. package/README.md +1 -1
  2. package/dist/chunks/{shared-Dc_FGuLM.js → shared-BJvnqK51.js} +1 -1
  3. package/dist/chunks/{shared-BFTEmZvI.js → shared-BS9TMOvt.js} +1 -1
  4. package/dist/chunks/{shared-CTK76mc_.js → shared-BYoX4LxS.js} +14 -26
  5. package/dist/chunks/{shared-DUEkF1z7.js → shared-B_nvELQt.js} +1 -1
  6. package/dist/chunks/{shared-C2gu-y4m.js → shared-Bp3FCPZj.js} +2 -13
  7. package/dist/chunks/{shared-CGPv8MQ7.js → shared-BtEAASxQ.js} +1 -1
  8. package/dist/chunks/{shared-rZQ5j0Kh.js → shared-CBRj9Yll.js} +52 -43
  9. package/dist/chunks/{shared-DjOBIYHF.js → shared-CLabLKYD.js} +1 -1
  10. package/dist/chunks/{shared-wtt8CCP_.js → shared-CRpGBd1Z.js} +1 -1
  11. package/dist/chunks/{shared-NnvpqsPp.js → shared-CVI7znpk.js} +1 -1
  12. package/dist/chunks/{shared-BESRsbtm.js → shared-CeM-gXAw.js} +1 -1
  13. package/dist/chunks/{shared-CmBhMY6X.js → shared-D0PnnUir.js} +1 -1
  14. package/dist/chunks/{shared-DD-fi15c.js → shared-DsUcMhpJ.js} +1 -1
  15. package/dist/chunks/{shared-CE1P_7xs.js → shared-m1HXI5YR.js} +1 -1
  16. package/dist/components.js +1 -1
  17. package/dist/index.js +1 -1
  18. package/dist/templates/delegation-poker.js +1 -1
  19. package/dist/templates/event-storming.js +1 -1
  20. package/dist/templates/example-mapping.js +1 -1
  21. package/dist/templates/grill.js +1 -1
  22. package/dist/templates/plain.js +1 -1
  23. package/dist/templates/prototype.js +1 -1
  24. package/dist/templates/slides.js +1 -1
  25. package/dist/templates/task-board.js +1 -1
  26. package/dist/templates/usm.js +1 -1
  27. package/dist/templates/whiteboard.js +1 -1
  28. package/package.json +1 -1
@@ -1,6 +1,6 @@
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=`[
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)},zo=(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:Mo,defineProperty:Io,getOwnPropertyDescriptor:No,getOwnPropertyNames:Do,getOwnPropertySymbols:jo,getPrototypeOf:qo}=Object,bt=globalThis,Rs=bt.trustedTypes,Bo=Rs?Rs.emptyScript:"",Uo=bt.reactiveElementPolyfillSupport,Ge=(t,e)=>t,an={toAttribute(t,e){switch(e){case Boolean:t=t?Bo: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)=>!Mo(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&&Io(this.prototype,e,i)}}static getPropertyDescriptor(e,n,s){const{get:i,set:r}=No(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=qo(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=[...Do(n),...jo(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 zo(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,Uo?.({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,Ho=`<${Ms}>`,ye=document,Ye=()=>ye.createComment(""),Je=t=>t===null||typeof t!="object"&&typeof t!="function",cn=Array.isArray,Fo=t=>cn(t)||typeof t?.[Symbol.iterator]=="function",dn=`[
2
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(`
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),Wo=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 Vo=(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+Ho: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 Lo{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]=Vo(e,n);if(this.el=Lo.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]==="."?Zo:f[1]==="?"?Go:f[1]==="@"?Yo: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 Ko=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 Jo(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 Oo{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):Fo(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 Ko(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 Oo(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 Zo=class extends yt{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===m?void 0:e}},Go=class extends yt{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==m)}},Yo=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 Jo{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 Xo={I:vt},Qo=ln.litHtmlPolyfillSupport;Qo?.(pn,vt),(ln.litHtmlVersions??=[]).push("3.3.3");const ea=(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=ea(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 ta=hn.litElementPolyfillSupport;ta?.({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:na}=Xo,Fs=t=>t,sa=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 na(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),ia={},un=(t,e=ia)=>t._$AH=e,ra=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(!sa(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,oa=t=>t.preference??t.authored,aa=(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 la={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(la).map(([e,[n,s]])=>`--dpk-${e}: ${t(n,s)};`).join(`
4
4
  `)),Tt=de`
5
5
  :host {
6
6
  /* Browsers without light-dark() stay light. */
@@ -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
+ `,ca=de`
332
332
  .comment-pop {
333
333
  box-sizing: border-box;
334
334
  overflow: auto;
@@ -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 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 da=((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}}>`))},pa=/^(?:[ \t]*(?:\n|$))+/,ha=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,ua=/^ {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+|$)/,fa=/^ {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(),ga=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]+)*)/,ma=/^[^\n]+/,$n=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,ka=y(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",$n).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),ba=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]*?(?:-->|$))/,xa=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(),va=ni(/ {0,3}(?:[*+-]|1[.)])[ \t]+[^ \t\n]/),ya=ni(/ {0,3}(?:[*+-]|\d{1,9}[.)])(?:[ \t]|\n|$)/),wa=y(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",ya).getRegex(),An={blockquote:wa,code:ha,def:ka,fences:ua,heading:fa,hr:tt,html:xa,lheading:ti,list:ba,newline:pa,paragraph:va,table:Ce,text:ma},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(),$a={...An,lheading:ga,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()},Sa={...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()},Aa=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,Ca=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,ii=/^( {2,}|\\)\n(?!\s*$)[ \t]*/,Ta=/^(`+|[^`])(?:(?= {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,Ea=y(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,Be).getRegex(),Ra=/[\p{Pi}\p{Ps}"']/u,ri=/(?!~)[\p{P}\p{S}]/u,_a=/(?!~)[\s\p{P}\p{S}]/u,La=/(?:[^\s\p{P}\p{S}]|~)/u,Oa=y(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",da?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),oi=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,Pa=y(oi,"u").replace(/punct/g,te).getRegex(),za=y(oi,"u").replace(/punct/g,ri).getRegex(),Ma=/^(?:\*+(?:((?!\*)(?!openQuote)punct)|([^\s*]))?)|^_+(?:((?!_)(?!openQuote)punct)|([^\s_]))?/,Ia=y(Ma,"u").replace(/openQuote/g,Ra).replace(/punct/g,te).getRegex(),ai="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",Na=y(ai,"gu").replace(/notPunctSpace/g,st).replace(/punctSpace/g,Be).replace(/punct/g,te).getRegex(),Da=y(ai,"gu").replace(/notPunctSpace/g,La).replace(/punctSpace/g,_a).replace(/punct/g,ri).getRegex(),ja="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)[\\s](\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|(?:(?!\\*)punct|notPunctSpace)(\\*+)(?!\\*)(?=notPunctSpace)",qa=y(ja,"gu").replace(/notPunctSpace/g,st).replace(/punctSpace/g,Be).replace(/punct/g,te).getRegex(),Ba=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(),Ua="^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)[\\s](_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)|(?:(?!_)punct|notPunctSpace)(_+)(?!_)(?=notPunctSpace)",Ha=y(Ua,"gu").replace(/notPunctSpace/g,st).replace(/punctSpace/g,Be).replace(/punct/g,te).getRegex(),Fa=y(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,te).getRegex(),Wa="^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)",Va=y(Wa,"gu").replace(/notPunctSpace/g,st).replace(/punctSpace/g,Be).replace(/punct/g,te).getRegex(),Ka=y(/\\(punct)/,"gu").replace(/punct/g,te).getRegex(),Za=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(),Ga=y(Sn).replace("(?:-->|$)","-->").getRegex(),Ya=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",Ga).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(),Ja=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(),Xa=y(/^!?\[(label)\]\[(ref)\]/).replace("label",Et).replace("ref",$n).getRegex(),Qa=y(/^!?\[(ref)\](?:\[\])?/).replace("ref",$n).getRegex(),ci=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\]){1,999}/,el=y(/(?:[^\[\]\\`]*(?:\[(?:brackets|\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\]))){0,999}?[^\[\]\\`]*?/).replace("brackets",li).getRegex(),tl=y("reflink|nolink(?!\\()","g").replace("reflink",y(/^!?\[(label)\]\[(ref)\]/).replace("label",el).replace("ref",ci).getRegex()).replace("nolink",y(/^!?\[(ref)\](?:\[\])?/).replace("ref",ci).getRegex()).getRegex(),di=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,nl=/[A-Za-z0-9._+-]+@[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![\w-])/,sl=y(/(?:mailto:email|xmpp:email(?:\/[A-Za-z0-9@.]+)?)/).replace(/email/g,nl).getRegex(),Cn={_backpedal:Ce,anyPunctuation:Ka,autolink:Za,blockSkip:Oa,br:ii,code:Ca,del:Ce,delLDelim:Ce,delRDelim:Ce,emStrongLDelim:Pa,emStrongRDelimAst:Na,emStrongRDelimUnd:Ba,escape:Aa,link:Ja,nolink:Qa,punctuation:Ea,reflink:Xa,reflinkSearch:tl,tag:Ya,text:Ta,url:Ce},il={...Cn,emStrongLDelim:Ia,emStrongRDelimAst:qa,emStrongRDelimUnd:Ha,link:y(/^!?\[(label)\]\((.*?)\)/).replace("label",Et).getRegex(),reflink:y(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Et).getRegex()},Tn={...Cn,emStrongRDelimAst:Da,emStrongLDelim:za,delLDelim:Fa,delRDelim:Va,url:y(/^emailProtocol|^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("emailProtocol",sl).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()},rl={...Tn,br:y(ii).replace("{2,}","*").getRegex(),text:y(Tn.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},Rt={normal:An,gfm:$a,pedantic:Sa},it={normal:Cn,gfm:Tn,breaks:rl,pedantic:il},ol={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},pi=t=>ol[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 al(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(`
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 _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 ll(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 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=ll(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(`
@@ -522,7 +522,7 @@ ${A.join(`
522
522
  `):[],r={type:"table",raw:fe(e[0],`
523
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],`
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&&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]:al(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,`
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
  `)?"":`
@@ -555,7 +555,7 @@ ${this.parser.parse(t)}</blockquote>
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
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`
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 cl(...t){return Te.use(...t),C.defaults=Te.defaults,Qs(C.defaults),C}C.use=cl,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 dl={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},Ee=t=>t.replace(/[&<>"']/g,e=>dl[e]??e),pl=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||pl.has(n.toLowerCase())},hl=t=>/^https?:/i.test(t.trim()),ul=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=hl(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=>ul.parse(t,{async:!1}),fl=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`
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 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=fl(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"
@@ -727,20 +727,20 @@ Please report this to https://github.com/markedjs/marked.`,t){let s="<p>An error
727
727
  @input=${this.#o}
728
728
  @keydown=${this.#a}
729
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}
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 gl=()=>{customElements.get("dpk-component-inline-edit")||customElements.define("dpk-component-inline-edit",wi)},ml={lang:void 0,message:void 0,abortEarly:void 0,abortPipeEarly:void 0};function Rn(t){return ml}let kl;function bl(t){return kl?.get(t)}let xl;function vl(t){return xl?.get(t)}let yl;function wl(t,e){return yl?.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??wl(t.reference,l.lang)??(c?vl(l.lang):null)??s.message??bl(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 $l(t,e){return t===e||Number.isNaN(t)&&Number.isNaN(e)}function Sl(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 Al(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 Cl=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 Tl(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 $l(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(Sl(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 Cl(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 El(t){let e="";for(const n of t){e&&(e+=`
731
+ `),e+=`\xD7 ${n.message}`;const s=Al(n);s&&(e+=`
732
+ \u2192 at ${s}`)}return e}const It=L({type:w(x(),S(1)),id:w(x(),S(1))}),Rl=w(x(),S(1),ge(/^[A-Za-z0-9_-]+$/,'ids may only contain letters, digits, "_" and "-" (a "." builds a path)')),_l=(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))}),Ll=(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}:{}}},Ol=(t,e)=>{const n=Nt(t,e.type);if(n===void 0)return null;const s=n.parse(e);return s===null?null:s},Pl=(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,zl=t=>{throw new Error(`unhandled action: ${JSON.stringify(t)}`)},Ml=L({id:w(x(),S(1))}),Il=t=>{const e=T(Ml,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},Nl=(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"},Dl=(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)))}),jl=(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||!ql(i,e)?[...t,e]:[...t.slice(0,-1),e]},ql=(t,e)=>Nl(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"},Bl=L({body:x()}),at=t=>{const e=T(Bl,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()),Ul=L({type:Re(jn),id:w(x(),ge(/^[^/]+\/.+/,"component references start with a provider id"))}),Hl=L({id:w(x(),S(1)),type:Bi,target:Ul,payload:Ui,note:B(x()),createdAt:w(x(),S(1))}),Fl={schema:Hl,mode:"sequence",targetType:jn},Wl=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,Vl=(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},Kl=(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
+ \`\`\``,Zl=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,`
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
+ ${Zl(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?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(Kl(Nn(s))),c.push(""),c.join(`
739
+ `)},J="0.0.15",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"}}),Gl=()=>({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}}}},Yl=(t,e)=>{const n=t.body.trim();return n===""?null:{target:e,body:n}},Jl=t=>{if(!t.editing)return null;const e=t.editing.body.trim();return e===""?null:{id:t.editing.id,body:e}},Xl={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"}}),Ql=4096,ec="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.",tc=t=>new TextEncoder().encode(t).length,nc=t=>t.replace(/[\u0000-\u0008\u000B-\u001F\u007F]/g,""),sc=t=>{const e=`${Zi}
740
740
 
741
- ${tc(t)}`;return ec(e)<=Xl?e:null},sc=t=>`${Zi}
741
+ ${nc(t)}`;return tc(e)<=Ql?e:null},ic=t=>`${Zi}
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).`,rc={consent_required:"consent",forbidden:"forbidden",not_granted:"forbidden",capability_disabled:"forbidden",capability_removed:"forbidden",claude_unavailable:"claude_unavailable",rate_limited:"rate_limited"},oc=t=>{const e=typeof t=="object"&&t!==null&&"code"in t?t.code:void 0;return(typeof e=="string"?rc[e]:void 0)??"error"},ac={too_large:"handoffTooLarge",consent:"handoffConsent",forbidden:"handoffForbidden",claude_unavailable:"handoffClaudeUnavailable",rate_limited:"handoffRateLimited",storage:"handoffStorage",error:"handoffError"},Wn=(t,e)=>F(e)[ac[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:""}},lc=[Tt,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
+ `],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=ra(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 cc=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"}]],dc=[["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"}]],pc=[["path",{d:"M20 6 9 17l-5-5"}]],hc=[["path",{d:"m6 9 6 6 6-6"}]],uc=[["path",{d:"m15 18-6-6 6-6"}]],fc=[["path",{d:"m9 18 6-6-6-6"}]],gc=[["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"}]],mc=[["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"}]],kc=[["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"}]],bc=[["path",{d:"M15 3h6v6"}],["path",{d:"m21 3-7 7"}],["path",{d:"m3 21 7-7"}],["path",{d:"M9 21H3v-6"}]],xc=[["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"}]],vc=[["path",{d:"m14 10 7-7"}],["path",{d:"M20 10h-6V4"}],["path",{d:"m3 21 7-7"}],["path",{d:"M4 14h6v6"}]],yc=[["path",{d:"M5 12h14"}]],wc=[["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"}]],$c=[["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"}]],Sc=[["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"}]],Ac=[["path",{d:"M5 12h14"}],["path",{d:"M12 5v14"}]],Cc=[["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"}]],Tc=[["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"}]],Ec=[["path",{d:"M18 6 6 18"}],["path",{d:"m6 6 12 12"}]],Rc=t=>t.replaceAll("&","&amp;").replaceAll('"',"&quot;"),_c=t=>t.map(([e,n])=>`<${e}${Object.entries(n).map(([s,i])=>` ${s}="${Rc(String(i))}"`).join("")}></${e}>`).join(""),_=t=>{const e=_c(t);return()=>b`<svg
1133
1133
  viewBox="0 0 24 24"
1134
1134
  fill="none"
1135
1135
  stroke="currentColor"
@@ -1139,8 +1139,8 @@ 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`
1142
+ ${cc(e)}
1143
+ </svg>`},qt=_(Ec),nr=_(Tc),Kn=_(Sc),Zn=_(xc),sr=_(kc),Lc=_(gc),Oc=_(pc),ir=_(Ac),Pc=_(yc),zc=_(mc),rr=_($c),Mc=_(tr),Ic=_(Xi);_(Qi),_(er);const or=_(uc),Gn=_(fc),Nc=_(hc),Dc=_(bc),jc=_(vc),qc=_(Cc),Bc=_(wc),ar=_(dc),Uc=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()}},Hc=(t,e,n,s=!1)=>b`
1144
1144
  ${s?m: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>
@@ -1190,7 +1190,7 @@ 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>`:jt(e.items,i=>i.id,i=>Fc(t,i,n))}
1194
1194
  </ul>
1195
1195
  <footer>
1196
1196
  ${s||e.send==="hidden"?m:b`<button
@@ -1222,10 +1222,10 @@ The brief is too long for a comment, so it is stored in this artifact's database
1222
1222
  </div>
1223
1223
  ${e.flash?b`<span class="flash" role="status">${e.flash}</span>`:m}
1224
1224
  </footer>
1225
- `,Hc=(t,e,n)=>b`
1225
+ `,Fc=(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">${Uc(e.tone)}</span>
1229
1229
  <span class="item-title">${e.title}</span>
1230
1230
  ${e.stale?b`<span class="stale-badge">${e.stale}</span>`:m}
1231
1231
  ${e.edit.kind==="available"?b`<button
@@ -1247,10 +1247,10 @@ The brief is too long for a comment, so it is stored in this artifact's database
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}
1250
+ ${e.edit.kind==="editing"?Wc(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
1251
  ${e.code===null?m:b`<code class="item-code">${e.code}</code>`}
1252
1252
  </li>
1253
- `,Fc=(t,e,n)=>b`
1253
+ `,Wc=(t,e,n)=>b`
1254
1254
  <div class="item-editor">
1255
1255
  <textarea
1256
1256
  class="dpk-textarea"
@@ -1274,7 +1274,7 @@ 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=`
1277
+ `;class lr extends he{static{this.styles=lc}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=Gl();#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?Hc(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=Jl(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=Yl(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 Vc=()=>{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}),Kc={left:"right",right:"left",bottom:"top",top:"bottom"};function Zc(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 Gc(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 Yc(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"],Jc=["top","bottom"],Xc=["bottom","top"];function Qc(t,e,n){switch(t){case"top":case"bottom":return n?e?ur:hr:e?hr:ur;case"left":case"right":return e?Jc:Xc;default:return[]}}function ed(t,e,n,s){const i=ct(t);let r=Qc(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 Kc[e]+t.slice(e.length)}function td(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 nd(t){return typeof t!="number"?td(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 sd(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=nd(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 id=50,rd=async(t,e,n)=>{const{placement:s="bottom",strategy:i="absolute",middleware:r=[],platform:o}=n,a=o.detectOverflow?o:{...o,detectOverflow:sd},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<id&&(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}},od=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)]:Yc(a)),O=f!=="none";!h&&O&&I.push(...ed(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=Gc(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,Po)=>ce+Po,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{}}}},ad=new Set(["left","top"]);async function ld(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=ad.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 cd=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 ld(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}}}}},dd=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)=>Zc(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}}}}}},pd=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 hd(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 ud=/transform|translate|scale|rotate|perspective|filter/,fd=/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))||ud.test(e.willChange||"")||fd.test(e.contain||"")}function gd(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 md=re(0);function xr(t){const e=j(t);return!Qn()||!e.visualViewport?md:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function kd(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=kd(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 bd(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 xd(t){return t.getClientRects?Array.from(t.getClientRects()):[]}function vd(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 yd=25;function wd(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<=yd&&(a-=v)}return{width:a,height:l,x:c,y:p}}function $d(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=wd(t,n,e);else if(e==="document")s=vd(ae(t));else if(X(e))s=$d(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 Sd(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 Ad(t){let{element:e,boundary:n,rootBoundary:s,strategy:i}=t;const o=[...n==="clippingAncestors"?Kt(e)?[]:Sd(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 Cd(t){const{width:e,height:n}=br(t);return{width:e,height:n}}function Td(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&&hd(s)&&ns(s);)s=wr(s,e);return s&&dt(s)&&ns(s)&&!Xn(s)?n:s||gd(t)||n}const Ed=async function(t){const e=this.getOffsetParent||$r,n=this.getDimensions,s=await n(t.floating);return{reference:Td(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:s.width,height:s.height}}};function Rd(t){return Q(t).direction==="rtl"}const _d={convertOffsetParentRelativeRectToViewportRelativeRect:bd,getDocumentElement:ae,getClippingRect:Ad,getOffsetParent:$r,getElementRects:Ed,getClientRects:xd,getDimensions:Cd,getScale:Ve,isElement:X,isRTL:Rd};function Sr(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function Ld(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 Od(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?Ld(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 Pd=cd,zd=dd,Md=od,Id=pd,Nd=(t,e,n)=>{const s=new Map,i=n??{},r={..._d,...i.platform,_c:s};return rd(t,e,{...i,platform:r})},Dd=(t,e)=>({top:e,bottom:e,right:t}),jd=(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=Od(o,t,()=>{const c=++r;Nd(o,t,{strategy:"fixed",placement:s.placement??"bottom-end",middleware:[Pd(8),Md({padding:8,fallbackAxisSideDirection:"end"}),zd({padding:8}),Id({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()}},qd=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,jd(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",Bd=/^\d+\.\d+\.\d+(?:-[0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*)?$/,Yt=t=>Bd.test(t),Ud="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},Hd=(t,e)=>{const n=ss(t);return n===null||n===e?null:n},Fd=(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`${Ud}${t}/dist/${e}`},Wd=(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},Vd=L({tags:ne(Mt(x(),me()),{}),versions:G(L({version:x()}))}),Kd=t=>{const e=Pn(Vd,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 Kd(await t.json())}),Jt.catch(()=>{Jt=void 0}),Jt),Lr=t=>{location.assign(Wd(location.href,t))},Zd=t=>import(t),Gd=({entry:t,templates:e,register:n,importModule:s=Zd})=>{const i=()=>{n(),Cr(J,e,ht)},r=typeof location>"u"?null:Hd(location.search,J);if(r===null){i();return}s(Fd(r,t)).then(()=>{Yd()||Xd(r)},o=>{console.error(`dev-process-kit@${r} could not be loaded; running ${J}`,o),i()})},Yd=()=>{const t=Reflect.get(window,"devProcessKit");return typeof t=="object"&&t!==null&&"versionParam"in t},is="dpk-version-fallback",Jd=`
1278
1278
  .${is} {
1279
1279
  flex: none;
1280
1280
  height: 24px;
@@ -1293,7 +1293,7 @@ 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
+ `,Xd=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:Jd}));for(const n of e)n.append(Qd(n,t))}},Qd=(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},ep=L({value:x()}),tp=t=>e=>{if(!(e instanceof CustomEvent))return;const n=T(ep,e.detail);n.success&&t(n.output.value)},rs=t=>e=>{const n=je(e.target,HTMLSelectElement);n!==null&&t(n.value)},np=t=>e=>{const n=je(e.target,HTMLInputElement);n!==null&&t(n.checked)},Or="data-dpk-changes",sp=/^[^:\s]+:\S+$/,ip=se({id:ne(w(x(),S(1))),title:w(x(),S(1)),body:ne(x()),target:ne(w(x(),ge(sp,'target must be written "type:id"'))),navigate:ne(w(x(),Ai("=",'navigate must be written "key=value"')))}),rp=se({revision:w(x(),S(1)),changes:G(ip)}),op=t=>{const e=T(rp,t);if(!e.success)return{ok:!1,error:El(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}}},ap=se({v:Re(1),revision:x(),seen:G(x())}),Pr=t=>{const e=T(ap,t);return e.success?e.output:null},os={open:!1,fresh:new Set},zr=t=>e=>!t.seen.has(e.key),Mr=t=>t.target!==null||t.navigate!==null,lp=(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}},Ir=(t,e)=>new Set([...t.seen,...e]),cp=(t,e,n)=>{switch(n.kind){case"open-list":{const s=t.entries.filter(zr(e)),i=new Set(s.map(o=>o.key)),r=s.filter(o=>!Mr(o)).map(o=>o.key);return{seen:Ir(e,r),toasts:[],list:{open:!0,fresh:i}}}case"close-list":return{...e,list:os};case"close-toast":return{...e,toasts:e.toasts.filter(s=>s!==n.key)};case"jump":return{seen:Ir(e,[n.key]),toasts:e.toasts.filter(s=>s!==n.key),list:os}}},dp=(t,e)=>t.entries.filter(zr(e)).length,pp=(t,e)=>({v:1,revision:t.revision,seen:t.entries.filter(n=>e.seen.has(n.key)).map(n=>n.key)}),hp=(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},Nr=3,up=t=>e=>({key:e.key,title:e.title,body:e.body,jumpable:Mr(e),fresh:t.list.fresh.has(e.key)}),fp=(t,e)=>{const n=t.entries.map(up(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:dp(t,e),open:e.list.open,cards:n,toasts:i.slice(0,Nr),waiting:Math.max(0,i.length-Nr)}},ut=t=>t==="light"||t==="dark"?t:null,Dr=t=>t.authored??t.environment,jr=t=>t.preference??Dr(t),gp=t=>{const e=jr(t)==="dark"?"light":"dark";return e===Dr(t)?null:e},qr=G(se({value:w(x(),ge(/^element:.+/)),label:w(x(),S(1)),group:B(x())})),mp=L({targets:qr,providers:G(L({id:w(x(),S(1)),results:G(Hi)}))}),kp=se({target:w(x(),ge(/^element:.+/)),body:w(x(),Ln(),S(1))}),Br=t=>t.group?`${t.group} \xB7 ${t.label}`:t.label,Ur=(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?Br(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:Br(l)}},serialize:i=>Y(i)?`${i.type} ${N(i.target)} ${JSON.stringify(i.payload)}`:t.serialize(i)}},Hr=typeof globalThis=="object"&&globalThis||typeof window=="object"&&window||typeof self=="object"&&self||typeof global=="object"&&global||(function(){return this})();function Fr(t){return typeof Hr.Buffer<"u"&&Hr.Buffer.isBuffer(t)}function Wr(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 Vr(t){return Object.getOwnPropertySymbols(t).filter(e=>Object.prototype.propertyIsEnumerable.call(t,e))}function Kr(t){return t==null?t===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(t)}const bp="[object RegExp]",xp="[object String]",vp="[object Number]",yp="[object Boolean]",wp="[object Symbol]",$p="[object Date]",Sp="[object Map]",Ap="[object Set]",Cp="[object Array]",Tp="[object Function]",Ep="[object ArrayBuffer]",as="[object Object]",Rp="[object Error]",_p="[object DataView]",Lp="[object Uint8Array]",Op="[object Uint8ClampedArray]",Pp="[object Uint16Array]",zp="[object Uint32Array]",Mp="[object BigUint64Array]",Ip="[object Int8Array]",Np="[object Int16Array]",Dp="[object Int32Array]",jp="[object BigInt64Array]",qp="[object Float32Array]",Bp="[object Float64Array]";function Up(t,e){return t===e||Number.isNaN(t)&&Number.isNaN(e)}function Hp(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=Kr(t),r=Kr(e);if(i==="[object Arguments]"&&(i=as),r==="[object Arguments]"&&(r=as),i!==r)return!1;switch(i){case xp:return t.toString()===e.toString();case vp:return Up(t.valueOf(),e.valueOf());case yp:case $p:case wp:return Object.is(t.valueOf(),e.valueOf());case bp:return t.source===e.source&&t.flags===e.flags;case Tp: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 Sp: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 Ap:{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 Cp:case Lp:case Op:case Pp:case zp:case Mp:case Ip:case Np:case Dp:case jp:case qp:case Bp:if(Fr(t)!==Fr(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 Ep:return t.byteLength!==e.byteLength?!1:gt(new Uint8Array(t),new Uint8Array(e),n,s);case _p:return t.byteLength!==e.byteLength||t.byteOffset!==e.byteOffset?!1:gt(new Uint8Array(t),new Uint8Array(e),n,s);case Rp:return t.name===e.name&&t.message===e.message;case as:{if(!(gt(t.constructor,e.constructor,n,s)||Wr(t)&&Wr(e)))return!1;const l=[...Object.keys(t),...Vr(t)],c=[...Object.keys(e),...Vr(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 Fp(){}function Xt(t,e){return Hp(t,e,Fp)}const Zr="page",Gr=t=>N(t),Yr=(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!==Zr&&!t.hasTarget(i,d.target)){o.push({action:d,reason:"target-missing"});continue}l.push(d);const h=Gr(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)),Jr=t=>{const e=new Set(t.obsolete.map(n=>n.id));return t.actions.filter(n=>!e.has(n.id))},Wp=(t,e,n,s)=>{let i=e;const r=s??Xr(i).map(o=>o.id);for(const o of[...r].reverse())i=Vp(t,i,n,o,s!==void 0)??i;return i},Xr=t=>t.applied.filter(e=>!Y(e)),Vp=(t,e,n,s,i)=>{const r=Xr(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?Kp(t,e.base,r,o):[],...Zp(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=Gp(t,e,n,h);if(u!==null)return u}return null},Kp=(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)]:[])},Zp=(t,e,n)=>{const s=Qr(n),i=e.filter(l=>Qr(l).some(c=>s.includes(c))),r=eo(t,n),o=i.filter(l=>eo(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])]},Qr=t=>{const e=t.target.type===Zr?[]: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]},eo=(t,e)=>Nt(t.actions,e.type)?.mode,Gp=(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)}},Yp=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(Yp,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}`,Jp=G(me());class to{#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=Ur(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=so(this.definition,n),this.#o=this.#f(this.#i),this.#d()&&this.#y()}get definition(){return this.#n}setComponentSnapshot(e){const n=Pn(mp,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=Ur(this.#e,this.#s.targets,this.#r)}#f(e){return Yr(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 no(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(Jp,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=jl(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(so(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=Wp(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=Jr(this.#o),this.#k(),this.#o=this.#f(this.#i),!0)}#y(){this.#a?.save(this.#l,this.definition.name,this.#i)}}const no=(t,e,n)=>e==="comment"?Dn:n!==void 0&&Y({type:e,target:n})?Fl:Nt(t.actions,e),so=(t,e)=>e.flatMap(n=>{const s=T(_e,n);if(!s.success)return[];const i=s.output,r=no(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]:[]}),Xp=()=>({status:{kind:"idle"},request:0}),Qp=(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}},eh=(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}},io=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()}},th=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)}},nh=(t,e)=>{const n=()=>io(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)},sh=t=>{try{if(typeof sessionStorage<"u")return hs(sessionStorage,t)}catch{}return le(t)},ih=8e3,rh=t=>t.localName==="script"&&t.getAttribute("type")==="application/json"&&t.hasAttribute(Or);class oh{#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?fp(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=cp(this.#s,n,e),this.#t.seen.size!==n.seen.size&&this.#i?.write(this.#p(),pp(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(rh);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=op(n);return s.ok?(this.#s=s.log,this.#i=this.#n.persist()?Ke(Pr):le(Pr),this.#t=lp(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:ih};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",ah=(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
1299
  aria-controls=${en}
@@ -1303,19 +1303,19 @@ The brief is too long for a comment, so it is stored in this artifact's database
1303
1303
  @click=${n.toggleList}
1304
1304
  >
1305
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)}>
1306
+ </button>`},ro=(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}>
1308
+ </button>`:m,lh=(t,e,n,s)=>t.open?b`<div id=${en} class="dpk-changes" popover="manual" role="dialog" aria-label=${n.changesTitle}>
1309
1309
  <p class="dpk-changes-head"><strong>${n.changesTitle}</strong> <span>${e}</span></p>
1310
1310
  <ol class="dpk-changes-list">
1311
1311
  ${jt(t.cards,i=>i.key,i=>b`<li class="dpk-change" data-key=${i.key} ?data-fresh=${i.fresh}>
1312
1312
  <p class="dpk-change-title">
1313
1313
  ${i.fresh?b`<span class="dpk-change-new">${n.changesNew}</span>`:m} ${i.title}
1314
1314
  </p>
1315
- ${i.body===null?m:b`<p class="dpk-change-body">${i.body}</p>`} ${io(i,n,s)}
1315
+ ${i.body===null?m:b`<p class="dpk-change-body">${i.body}</p>`} ${ro(i,n,s)}
1316
1316
  </li>`)}
1317
1317
  </ol>
1318
- </div>`:m,lh=(t,e,n)=>b`<section
1318
+ </div>`:m,ch=(t,e,n)=>b`<section
1319
1319
  class="dpk-toasts"
1320
1320
  aria-live="polite"
1321
1321
  aria-label=${e.changes}
@@ -1330,7 +1330,7 @@ The brief is too long for a comment, so it is stored in this artifact's database
1330
1330
  <p class="dpk-change-title">${s.title}</p>
1331
1331
  ${s.body===null?m:b`<p class="dpk-change-body">${s.body}</p>`}
1332
1332
  </div>
1333
- ${io(s,e,n)}
1333
+ ${ro(s,e,n)}
1334
1334
  <button
1335
1335
  class="dpk-toast-close"
1336
1336
  type="button"
@@ -1344,7 +1344,7 @@ The brief is too long for a comment, so it is stored in this artifact's database
1344
1344
  ${t.waiting>0?b`<button class="dpk-toast-more" type="button" @click=${n.openList}>
1345
1345
  ${e.changesWaiting(t.waiting)} · ${e.changesSeeAll}
1346
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`
1347
+ </section>`,us=(t,e)=>typeof t=="object"&&t!==null&&e.every(n=>typeof Reflect.get(t,n)=="function"),dh=t=>us(t,["use"]),ph=t=>us(t,["anchorFor","canSendToClaude","sendToClaude"]),hh=t=>us(t,["collection"]),oo=async(t,e)=>{try{return await t.use(e)}catch{return null}},uh=(t,e)=>({async canSend(){try{return await t.canSendToClaude()==="available"}catch{return!1}},async send({brief:n,draft:s,anchor:i}){let r=sc(n);if(r===null){if(e===null)return{ok:!1,reason:"too_large"};try{const o=e.collection(ec).doc();await o.set({brief:n,draft:s,createdAt:new Date().toISOString()}),r=ic(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:oc(o)}}}}),fh=async t=>{if(!dh(t))return null;const[e,n]=await Promise.all([oo(t,"comments"),oo(t,"db")]);return ph(e)?uh(e,hh(n)?n:null):null},gh=()=>Reflect.get(globalThis,"claude");class mh{#e;#n;#s=null;#r=!1;constructor(e,n=gh){this.#e=e,this.#n=n,e.addController(this)}get available(){return this.#r}hostConnected(){this.#s??=fh(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",kh="(prefers-color-scheme: dark)",ao=()=>typeof matchMedia=="function"?matchMedia(kh):null,lo=()=>ut(document.documentElement.dataset.theme)??(ao()?.matches===!0?"dark":"light");class bh{#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=lo(),this.#i=ao(),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 jr(this.#a(e))}toggle(e){this.#r=gp(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=lo();e!==this.#t&&(this.#t=e,this.#e.requestUpdate())}}const xh=(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},co=(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)},po=t=>co(t.filter(e=>"elementActions"in e&&e.id.length>0),e=>e.id),ho=(t,e)=>{for(const n of po(t)){const s=Vl(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)}},vh=t=>{const e=Reflect.get(t,"elementActionResults");return Array.isArray(e)?e.flatMap(n=>{const s=T(Hi,n);return s.success?[s.output]:[]}):[]},yh=t=>{const e=[];for(const n of t){if(!("commentTargets"in n))continue;const s=T(qr,n.commentTargets);s.success&&e.push(...s.output)}return{targets:co(e,n=>n.value),providers:po(t).map(n=>({id:n.id,results:vh(n)}))}},wh=2400;class $h{#e=Xp();#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=Qp(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})},wh))}#i(){this.#n!==null&&clearTimeout(this.#n),this.#n=null}}const gs="dev-process-kit:locale";class Sh{#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 oa({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=aa(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 Ah="(max-width: 760px)",Ch=()=>typeof matchMedia=="function"?matchMedia(Ah):null;class Th{#e;#n=null;#s=!1;constructor(e){this.#e=e,e.addController(this)}hostConnected(){this.#n=Ch(),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 uo=()=>Dt(typeof location>"u"?"":location.hash),Eh=(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 Rh{#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 fo=(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},_h=(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},go=(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),mo=(t,e,n)=>{const s=Math.min(n,e/4);return{top:t+s,bottom:t+e-s}},ko=(t,e,n=0)=>{const s=t.getBoundingClientRect();t.scrollTop=go(t.scrollTop,mo(s.top+t.clientTop,t.clientHeight,n),e.getBoundingClientRect())},bo=(t,e,n=0)=>{const s=t.getBoundingClientRect(),i=e.getBoundingClientRect();t.scrollLeft=go(t.scrollLeft,mo(s.left+t.clientLeft,t.clientWidth,n),{top:i.left,bottom:i.right})},xo="data-dpk-target",Lh=2800,vo=48,Oh=t=>t.getClientRects().length>0,yo=(t,e)=>{const n=fo(t,`[${xo}]`).filter(r=>(r.getAttribute(xo)??"").split(/\s+/).includes(e)),s=fo(t,"[data-dpk-comment]").filter(r=>r.getAttribute("data-dpk-comment")===e),i=[...n,...s];return i.find(Oh)??i[0]??null},wo=(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},Ph=(t,e)=>{for(const n of _h(e,t))wo(n,"y")&&ko(n,e,vo),wo(n,"x")&&bo(n,e,vo)},$o="color-mix(in srgb, var(--dpk-accent) 45%, transparent)",Ie={outline:"2px solid var(--dpk-accent)",outlineOffset:"3px"},So={outline:"2px solid transparent",outlineOffset:"3px"},zh=t=>t?[{...Ie},{...Ie,offset:.85},{...So}]:[{...Ie,boxShadow:`0 0 0 0 ${$o}`},{...Ie,boxShadow:"0 0 0 14px transparent",offset:.3},{...Ie,boxShadow:`0 0 0 0 ${$o}`,offset:.31},{...Ie,boxShadow:"0 0 0 14px transparent",offset:.6},{...Ie,offset:.85},{...So}],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)"},Mh=t=>t?[{...mt},{...mt,offset:.85},{...tn}]:[{...mt},{...tn,offset:.3},{...mt,offset:.31},{...tn,offset:.6},{...mt,offset:.61},{...tn}],Ih=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?Mh(e):zh(e),{duration:Lh,easing:"ease-out"})},be={min:180,max:560,step:16,largeStep:64},Nh={side:"left",defaultWidth:260},nn=t=>Math.round(Math.min(be.max,Math.max(be.min,t))),Ao=t=>typeof t=="number"&&Number.isFinite(t)?nn(t):null,ms=(t,e)=>t==="left"?e:-e,Dh=(t,e)=>nn(t.startWidth+ms(t.side,e-t.startX)),jh=(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}},Co=t=>typeof t=="boolean"?t:null,qh=t=>t==="left"?"right":"left",Bh=(t,e)=>e?{action:"expand",points:qh(t)}:{action:"collapse",points:t},Uh=t=>`dev-process-kit:sidebar-collapsed:${t}`;class Hh{#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(Co):le(Co),this.#r=Uh(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 Fh=t=>`dev-process-kit:sidebar-width:${t}`,ks={kind:"idle"};class Wh{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(Dh(i,s.clientX))},pointerup:s=>this.#o(s),pointercancel:s=>this.#o(s),keydown:s=>{const i=jh(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(Ao):le(Ao),this.#r=Fh(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 Vh=[Tt,xn,de`
1348
1348
  :host {
1349
1349
  display: block;
1350
1350
  min-height: 100%;
@@ -1365,6 +1365,15 @@ The brief is too long for a comment, so it is stored in this artifact's database
1365
1365
  grid-template-rows: auto minmax(0, 1fr) auto;
1366
1366
  min-height: 100%;
1367
1367
  max-height: 100%;
1368
+ /*
1369
+ * The fallback when the page gives the host no height: the viewport, less
1370
+ * the safe-area insets a Claude Artifact pads its root by. Without it the
1371
+ * shell grows with its content, leaving the page's own ground below a
1372
+ * short page and scrolling the header and the memo away on a long one.
1373
+ * A host with a height still wins: the min/max-height above pin the shell
1374
+ * to it.
1375
+ */
1376
+ height: calc(100dvh - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px));
1368
1377
  }
1369
1378
 
1370
1379
  /* ------------------------------------------------------------- header */
@@ -2506,7 +2515,7 @@ The brief is too long for a comment, so it is stored in this artifact's database
2506
2515
  order: 1;
2507
2516
  }
2508
2517
  }
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"
2518
+ `],Kh=30,Zh=Mt(x(),L({base:x(),value:x()})),To=t=>{const e=T(Zh,t);return e.success?e.output:null},Gh=t=>t.key===void 0?JSON.stringify(["field",t.hosts,t.name,t.base]):JSON.stringify(["key",t.key,t.name]),Yh=(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-Kh)))},Jh=(t,e)=>{if(!(e in t))return t;const{[e]:n,...s}=t;return s},Xh=(t,e,n)=>{const s=t[e];return s===void 0||s.base!==n||s.value===n?null:s.value},Qh=new Set(["text","search","url","email","tel"]),Eo=t=>t instanceof HTMLTextAreaElement||t instanceof HTMLInputElement&&Qh.has(t.type)?t:null,eu=(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},tu=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)}},nu=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):[],Ro=t=>t.replace(/\s+/g," ").trim();class su{#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()?sh(To):le(To),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(Ro));for(const s of this.#i){if(!n.has(Ro(s.value)))continue;this.#i.delete(s);const i=this.#t.get(s);i!==void 0&&this.#p(Jh(this.#l(),i.id))}}#o=e=>{const n=Eo(e.composedPath()[0]);if(n===null||this.#i.has(n))return;const s=eu(this.#e,n);if(s===null)return;const i=tu(n),r=n.value,o=Gh({...i===void 0?{}:{key:i},hosts:s,name:nu(n),base:r});this.#t.set(n,{id:o,base:r});const a=Xh(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=Eo(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(Yh(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 iu{#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"
2510
2519
  >dev-process-kit@<select
2511
2520
  class="dpk-version-select"
2512
2521
  aria-label=${n.versionLabel}
@@ -2517,7 +2526,7 @@ The brief is too long for a comment, so it is stored in this artifact's database
2517
2526
  >
2518
2527
  ${s.options.map(r=>b`<option value=${r.value} ?selected=${r.value===s.value}>${r.label}</option>`)}
2519
2528
  </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
2529
+ >`}}const xs=`script[type="application/json"]:not([${Or}])`,ru=30,_o={width:360,height:480},ou=t=>{try{return t.matches(":popover-open")}catch{return!1}},au=()=>new Promise(t=>requestAnimationFrame(()=>t()));class lu extends he{static{this.styles=Vh}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 Rh(this);#s=new bh(this,()=>this.storage!=="off"&&this.storage!=="memory");#r=new mh(this);#t=new $h(this);#i=new Wh(this,{persist:()=>this.storage!=="off"&&this.storage!=="memory",template:()=>this.definition.name,layout:()=>this.sidebarLayout});#o=new Hh(this,{persist:()=>this.storage!=="off"&&this.storage!=="memory",template:()=>this.definition.name});#a=new Th(this);#l=new su(this,{persist:()=>this.storage!=="off"&&this.storage!=="memory",storageKey:()=>`${this.storageKey??Qt(this.definition.name)}:unsent-text`});#p=null;#c=new oh(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 iu(this);#h=new Sh(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
2521
2530
  .definition=${this.controller.definition}
2522
2531
  .state=${e.state}
2523
2532
  .navigation=${e.navigation}
@@ -2615,8 +2624,8 @@ The brief is too long for a comment, so it is stored in this artifact's database
2615
2624
  </button>`}
2616
2625
  ${this.integratedReview?m:this.#G(s)} ${this.#V()}
2617
2626
  </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}>
2627
+ `}#W(){const e=this.#c.view;if(!e)return m;const n=F(this.locale);return b`${ah(e,n,this.#m)}
2628
+ ${lh(e,this.#c.revision,n,this.#m)}`}#V(){const e=this.#c.view;return e?ch(e,F(this.locale),this.#m):m}#K(){const e=this.renderRoot.querySelector(`#${en}`),n=this.renderRoot.querySelector(".dpk-bell");!e||!n||ou(e)||this.#k.open(e,n,{width:_o.width,height:Math.min(_o.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=hp({...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<ru;a+=1){if(await this.updateComplete,await au(),this.#p!==n)return;const l=yo(this,o);if(!(l===null||l.getClientRects().length===0)){Ph(this,l),Ih(l);return}}}showTarget(e){}#G(e){const n=eh({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
2629
  ${n.note?b`<p class="dpk-dock-note" role="alert">${n.note}</p>`:m}
2621
2630
  <div class="dpk-dock-actions">
2622
2631
  ${n.send?b`<button
@@ -2644,7 +2653,7 @@ The brief is too long for a comment, so it is stored in this artifact's database
2644
2653
  @change=${rs(s=>{const i=mn.find(r=>r===s);i!==void 0&&this.#h.pick(i)})}
2645
2654
  >
2646
2655
  ${mn.map(s=>b`<option value=${s} lang=${s} ?selected=${s===e}>
2647
- ${Jl[s]}
2656
+ ${Xl[s]}
2648
2657
  </option>`)}
2649
2658
  </select>`}#J(){const e=this.dataset.theme==="dark",n=F(this.locale),s=e?n.useLightTheme:n.useDarkTheme;return b`<button
2650
2659
  class="dpk-theme-toggle"
@@ -2653,8 +2662,8 @@ The brief is too long for a comment, so it is stored in this artifact's database
2653
2662
  title=${s}
2654
2663
  @click=${()=>this.#s.toggle(ut(this.theme))}
2655
2664
  >
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
2665
+ ${e?qc():Bc()}
2666
+ </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=Bh(this.sidebarLayout.side,e),r=i.action==="collapse"?s.collapseSidebar:s.expandSidebar;return b`<button
2658
2667
  class="dpk-sidebar-toggle"
2659
2668
  type="button"
2660
2669
  aria-controls="dpk-sidebar"
@@ -2680,4 +2689,4 @@ The brief is too long for a comment, so it is stored in this artifact's database
2680
2689
  @pointercancel=${n.pointercancel}
2681
2690
  @keydown=${n.keydown}
2682
2691
  @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};
2692
+ ></div>`}render(){if(!this.#d)return m;const e=this.#D();return this.renderChrome(e,this.renderRegions(e))}get sidebarLayout(){return Nh}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 nh(this.#_(),this)}#N(){return io(this.#_())}#D(){return th(this.#_())}#$(){return this.definition.resolveNavigation(this.derivation.state,this.#u)}#ne(){const e=this.#ie();this.#u=uo();const n=this.storageKey;this.#d=new to({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),ho(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,Eh(n,e)}#j=()=>{this.#u=uo(),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=xh(this,e=>{this.isConnected&&this.#A?.observe(e,{childList:!0,subtree:!0})}),this.#d&&(ho(this.#C,this.#d.actions),this.#d.setComponentSnapshot(yh(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(kp,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(Wl,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,zc 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,Jr as L,ds as M,Dt as N,ot as O,Ol as P,Un as Q,Pl as R,Nn as S,lu 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,ca as a1,de as a2,m as a3,b as a4,jt as a5,Pc as a6,Wo as a7,he as a8,Ar as a9,Rl as aA,B as aB,Ke as aC,le as aD,tp as aE,rs as aF,np as aG,Xt as aH,je as aI,Dd as aJ,yo as aK,Wn as aL,Fn as aM,ko as aN,$i as aO,_l as aP,Tl as aQ,Vs as aR,yi as aS,_ as aT,Qi as aU,er as aV,gn as aW,Xs as aX,qd as aY,Qe as aZ,wt as a_,bn as aa,Dc as ab,jc 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,Nc 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,Oc as b1,Lc as b2,Ei as b3,bo as b4,Si as b5,Xi as b6,tr as b7,to as c,In as d,zl as e,Hn as f,qi as g,at as h,Gr as i,xn as j,Di as k,Dl as l,Mn as m,ps as n,Qt as o,Ll as p,Vc as q,gl as r,Gd as s,Yr as t,_e as u,Il as v,He as w,Ic as x,Mc as y,qt as z};