dev-process-kit 0.0.13 → 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 (34) hide show
  1. package/README.md +1 -1
  2. package/dist/chunks/{shared-CirHYajF.js → shared-BJvnqK51.js} +1 -1
  3. package/dist/chunks/{shared-0MFKKPnB.js → shared-BS9TMOvt.js} +11 -11
  4. package/dist/chunks/{shared-Cd8A5TjZ.js → shared-BYoX4LxS.js} +174 -157
  5. package/dist/chunks/shared-B_nvELQt.js +572 -0
  6. package/dist/chunks/{shared-C1KQ5iU8.js → shared-Bp3FCPZj.js} +15 -21
  7. package/dist/chunks/shared-BtEAASxQ.js +1049 -0
  8. package/dist/chunks/shared-CBRj9Yll.js +2692 -0
  9. package/dist/chunks/{shared-DjmQsa0n.js → shared-CLabLKYD.js} +1 -1
  10. package/dist/chunks/{shared-B2YRwZ0P.js → shared-CRpGBd1Z.js} +139 -128
  11. package/dist/chunks/{shared-D7poXZ0z.js → shared-CVI7znpk.js} +6 -5
  12. package/dist/chunks/{shared-DklLt1Sc.js → shared-CeM-gXAw.js} +1 -1
  13. package/dist/chunks/{shared-CQG0dnvb.js → shared-D0PnnUir.js} +5 -4
  14. package/dist/chunks/shared-DsUcMhpJ.js +1104 -0
  15. package/dist/chunks/{shared-DrMSORn-.js → shared-m1HXI5YR.js} +176 -168
  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
  29. package/dist/chunks/shared-B4Mwapvi.js +0 -1043
  30. package/dist/chunks/shared-BDUe3aT-.js +0 -1
  31. package/dist/chunks/shared-CSC14I4g.js +0 -2370
  32. package/dist/chunks/shared-DO0pUSjw.js +0 -571
  33. package/dist/chunks/shared-DxAiavwJ.js +0 -1102
  34. package/dist/chunks/shared-aDPp8Vry.js +0 -1
@@ -0,0 +1,2692 @@
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
+ \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),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
+ `)),Tt=de`
5
+ :host {
6
+ /* Browsers without light-dark() stay light. */
7
+ ${Js(t=>t)}
8
+ --dpk-display: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
9
+ --dpk-body: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
10
+ --dpk-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, 'Liberation Mono', monospace;
11
+
12
+ /* Shape + elevation scale, so every surface reads as one system. */
13
+ --dpk-radius-xs: 6px;
14
+ --dpk-radius-sm: 8px;
15
+ --dpk-radius: 10px;
16
+ --dpk-radius-lg: 14px;
17
+ --dpk-radius-xl: 20px;
18
+ --dpk-bevel: inset 0 1px 0 var(--dpk-highlight);
19
+ --dpk-shadow-xs: 0 1px 2px var(--dpk-shade-1);
20
+ --dpk-shadow-sm: 0 1px 2px var(--dpk-shade-1), 0 3px 8px -2px var(--dpk-shade-2);
21
+ --dpk-shadow:
22
+ 0 1px 2px var(--dpk-shade-1), 0 6px 16px -4px var(--dpk-shade-2), 0 14px 32px -12px var(--dpk-shade-3);
23
+ --dpk-shadow-lg:
24
+ 0 2px 4px var(--dpk-shade-1), 0 12px 28px -6px var(--dpk-shade-2), 0 32px 64px -20px var(--dpk-shade-3);
25
+ --dpk-focus: 0 0 0 1px var(--dpk-paper-raised), 0 0 0 3.5px color-mix(in srgb, var(--dpk-blue) 45%, transparent);
26
+ --dpk-control-h: 32px;
27
+ --dpk-ease: cubic-bezier(0.2, 0.7, 0.2, 1);
28
+ --dpk-ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
29
+ /* Frosted chrome: headers and toolbars that float over scrolling content. */
30
+ --dpk-glass: color-mix(in srgb, var(--dpk-paper-raised) 78%, transparent);
31
+ /* Working surface behind boards and canvases: a quiet dot lattice. */
32
+ --dpk-dots: radial-gradient(circle at 1px 1px, var(--dpk-rule-strong) 1px, transparent 0) 0 0 / 20px 20px;
33
+
34
+ color: var(--dpk-ink);
35
+ font-family: var(--dpk-body);
36
+ font-size: 14px;
37
+ line-height: 1.5;
38
+ -webkit-font-smoothing: antialiased;
39
+ text-rendering: optimizeLegibility;
40
+ display: block;
41
+ }
42
+
43
+ @supports (color: light-dark(#000, #fff)) {
44
+ :host {
45
+ ${Js((t,e)=>`light-dark(${t}, ${e})`)}
46
+ }
47
+ }
48
+
49
+ *,
50
+ *::before,
51
+ *::after {
52
+ box-sizing: border-box;
53
+ }
54
+
55
+ h1,
56
+ h2,
57
+ h3,
58
+ h4 {
59
+ font-family: var(--dpk-display);
60
+ font-weight: 660;
61
+ margin: 0;
62
+ line-height: 1.2;
63
+ letter-spacing: -0.015em;
64
+ }
65
+
66
+ button {
67
+ font: inherit;
68
+ color: inherit;
69
+ }
70
+
71
+ ::selection {
72
+ background: color-mix(in srgb, var(--dpk-blue) 22%, transparent);
73
+ }
74
+
75
+ .dpk-mono,
76
+ .dpk-num {
77
+ font-variant-numeric: tabular-nums;
78
+ }
79
+
80
+ .dpk-label {
81
+ font-family: var(--dpk-mono);
82
+ font-size: 10px;
83
+ font-weight: 550;
84
+ letter-spacing: 0.1em;
85
+ text-transform: uppercase;
86
+ color: var(--dpk-ink-faint);
87
+ }
88
+
89
+ @media (prefers-reduced-motion: reduce) {
90
+ *,
91
+ *::before,
92
+ *::after {
93
+ animation-duration: 1ms !important;
94
+ animation-iteration-count: 1 !important;
95
+ transition-duration: 1ms !important;
96
+ }
97
+ }
98
+ `,xn=de`
99
+ .dpk-btn {
100
+ display: inline-flex;
101
+ align-items: center;
102
+ justify-content: center;
103
+ gap: 6px;
104
+ min-height: 30px;
105
+ padding: 0 12px;
106
+ border: 1px solid var(--dpk-rule-strong);
107
+ border-radius: var(--dpk-radius-sm);
108
+ background: var(--dpk-paper-raised);
109
+ color: var(--dpk-ink);
110
+ font-size: 12.5px;
111
+ font-weight: 550;
112
+ line-height: 1;
113
+ white-space: nowrap;
114
+ box-shadow: var(--dpk-bevel), var(--dpk-shadow-xs);
115
+ cursor: pointer;
116
+ transition:
117
+ background 160ms var(--dpk-ease),
118
+ border-color 160ms var(--dpk-ease),
119
+ box-shadow 160ms var(--dpk-ease),
120
+ color 160ms var(--dpk-ease),
121
+ transform 120ms var(--dpk-ease);
122
+ }
123
+
124
+ .dpk-btn:hover:not([disabled]) {
125
+ border-color: var(--dpk-rule-hover);
126
+ box-shadow: var(--dpk-bevel), var(--dpk-shadow-sm);
127
+ }
128
+
129
+ .dpk-btn:active:not([disabled]) {
130
+ transform: translateY(1px) scale(0.985);
131
+ box-shadow: none;
132
+ }
133
+
134
+ .dpk-btn:focus-visible {
135
+ outline: none;
136
+ box-shadow: var(--dpk-focus);
137
+ }
138
+
139
+ .dpk-btn[disabled] {
140
+ opacity: 0.45;
141
+ box-shadow: none;
142
+ cursor: not-allowed;
143
+ }
144
+
145
+ .dpk-btn--accent {
146
+ border-color: color-mix(in srgb, var(--dpk-accent-strong) 70%, transparent);
147
+ background: linear-gradient(180deg, var(--dpk-accent-bright), var(--dpk-accent) 55%, var(--dpk-accent-strong));
148
+ color: var(--dpk-accent-ink);
149
+ text-shadow: 0 1px 0 rgba(0, 0, 0, 0.12);
150
+ box-shadow:
151
+ inset 0 1px 0 rgba(255, 255, 255, 0.22),
152
+ 0 1px 2px color-mix(in srgb, var(--dpk-accent) 30%, transparent),
153
+ 0 4px 12px -4px color-mix(in srgb, var(--dpk-accent) 55%, transparent);
154
+ }
155
+
156
+ .dpk-btn--accent:hover:not([disabled]) {
157
+ border-color: color-mix(in srgb, var(--dpk-accent-strong) 70%, transparent);
158
+ background: linear-gradient(180deg, var(--dpk-accent-bright), var(--dpk-accent-bright) 40%, var(--dpk-accent));
159
+ box-shadow:
160
+ inset 0 1px 0 rgba(255, 255, 255, 0.25),
161
+ 0 2px 4px color-mix(in srgb, var(--dpk-accent) 30%, transparent),
162
+ 0 8px 20px -6px color-mix(in srgb, var(--dpk-accent) 65%, transparent);
163
+ }
164
+
165
+ /* Selection state, shared by every template's filter/nav controls. */
166
+ .dpk-btn--selected {
167
+ border-color: color-mix(in srgb, var(--dpk-blue-strong) 70%, transparent);
168
+ background: linear-gradient(180deg, var(--dpk-blue), var(--dpk-blue-strong));
169
+ color: #fff;
170
+ box-shadow:
171
+ inset 0 1px 0 rgba(255, 255, 255, 0.2),
172
+ 0 2px 8px -2px color-mix(in srgb, var(--dpk-blue) 60%, transparent);
173
+ }
174
+
175
+ .dpk-btn--selected:hover:not([disabled]) {
176
+ border-color: color-mix(in srgb, var(--dpk-blue-strong) 70%, transparent);
177
+ background: linear-gradient(180deg, var(--dpk-blue), var(--dpk-blue));
178
+ box-shadow:
179
+ inset 0 1px 0 rgba(255, 255, 255, 0.22),
180
+ 0 4px 12px -3px color-mix(in srgb, var(--dpk-blue) 65%, transparent);
181
+ }
182
+
183
+ .dpk-btn--ghost {
184
+ border-color: transparent;
185
+ background: transparent;
186
+ box-shadow: none;
187
+ color: var(--dpk-ink-soft);
188
+ }
189
+
190
+ .dpk-btn--ghost:hover:not([disabled]) {
191
+ background: var(--dpk-paper-inset);
192
+ border-color: transparent;
193
+ box-shadow: none;
194
+ color: var(--dpk-ink);
195
+ }
196
+
197
+ .dpk-icon-btn {
198
+ position: relative;
199
+ display: inline-flex;
200
+ align-items: center;
201
+ justify-content: center;
202
+ width: 26px;
203
+ height: 26px;
204
+ padding: 0;
205
+ border: 1px solid transparent;
206
+ border-radius: var(--dpk-radius-xs);
207
+ background: transparent;
208
+ color: var(--dpk-ink-faint);
209
+ font-size: 11px;
210
+ line-height: 1;
211
+ cursor: pointer;
212
+ transition:
213
+ background 160ms var(--dpk-ease),
214
+ color 160ms var(--dpk-ease),
215
+ transform 160ms var(--dpk-ease-spring);
216
+ }
217
+
218
+ .dpk-icon-btn:hover:not([disabled]) {
219
+ background: var(--dpk-paper-inset);
220
+ color: var(--dpk-ink);
221
+ }
222
+
223
+ .dpk-icon-btn:active:not([disabled]) {
224
+ transform: scale(0.92);
225
+ }
226
+
227
+ .dpk-icon-btn:focus-visible {
228
+ outline: none;
229
+ box-shadow: var(--dpk-focus);
230
+ }
231
+
232
+ .dpk-icon-btn[disabled] {
233
+ opacity: 0.35;
234
+ cursor: default;
235
+ }
236
+
237
+ .dpk-icon-btn[data-active='true'] {
238
+ background: var(--dpk-blue-soft);
239
+ color: var(--dpk-blue);
240
+ }
241
+
242
+ .dpk-icon-btn svg {
243
+ display: block;
244
+ width: 15px;
245
+ height: 15px;
246
+ }
247
+
248
+ /* Count badge for an icon-only control (comments on a card, drafts on the rail). */
249
+ .dpk-icon-badge {
250
+ position: absolute;
251
+ top: -5px;
252
+ right: -5px;
253
+ min-width: 16px;
254
+ height: 16px;
255
+ padding: 0 4px;
256
+ border: 1.5px solid var(--dpk-paper-raised);
257
+ border-radius: 999px;
258
+ background: linear-gradient(180deg, var(--dpk-accent-bright), var(--dpk-accent));
259
+ color: var(--dpk-accent-ink);
260
+ font-family: var(--dpk-mono);
261
+ font-size: 9px;
262
+ font-weight: 650;
263
+ font-variant-numeric: tabular-nums;
264
+ line-height: 13px;
265
+ text-align: center;
266
+ box-shadow: 0 2px 6px -1px color-mix(in srgb, var(--dpk-accent) 55%, transparent);
267
+ animation: dpk-pop 260ms var(--dpk-ease-spring);
268
+ }
269
+
270
+ @keyframes dpk-pop {
271
+ from {
272
+ transform: scale(0.4);
273
+ opacity: 0;
274
+ }
275
+ }
276
+
277
+ .dpk-input,
278
+ .dpk-textarea,
279
+ .dpk-select {
280
+ box-sizing: border-box;
281
+ width: 100%;
282
+ min-height: var(--dpk-control-h);
283
+ padding: 6px 10px;
284
+ border: 1px solid var(--dpk-rule-strong);
285
+ border-radius: var(--dpk-radius-sm);
286
+ background: var(--dpk-paper-raised);
287
+ color: var(--dpk-ink);
288
+ font: inherit;
289
+ font-size: 12.5px;
290
+ box-shadow: inset 0 1px 2px var(--dpk-shade-1);
291
+ transition:
292
+ border-color 160ms var(--dpk-ease),
293
+ box-shadow 160ms var(--dpk-ease),
294
+ background 160ms var(--dpk-ease);
295
+ }
296
+
297
+ .dpk-input::placeholder,
298
+ .dpk-textarea::placeholder {
299
+ color: var(--dpk-ink-faint);
300
+ }
301
+
302
+ .dpk-input:hover,
303
+ .dpk-textarea:hover,
304
+ .dpk-select:hover {
305
+ border-color: var(--dpk-rule-hover);
306
+ }
307
+
308
+ .dpk-input:focus,
309
+ .dpk-textarea:focus,
310
+ .dpk-select:focus {
311
+ outline: none;
312
+ border-color: var(--dpk-blue);
313
+ box-shadow: var(--dpk-focus);
314
+ }
315
+
316
+ .dpk-select {
317
+ appearance: none;
318
+ background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'><path d='M3 4.5 6 7.5 9 4.5' fill='none' stroke='%23878e9e' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'/></svg>");
319
+ background-repeat: no-repeat;
320
+ background-position: right 8px center;
321
+ padding-right: 28px;
322
+ box-shadow: var(--dpk-bevel), var(--dpk-shadow-xs);
323
+ cursor: pointer;
324
+ }
325
+
326
+ .dpk-textarea {
327
+ resize: vertical;
328
+ min-height: 64px;
329
+ line-height: 1.55;
330
+ }
331
+ `,ca=de`
332
+ .comment-pop {
333
+ box-sizing: border-box;
334
+ overflow: auto;
335
+ position: fixed;
336
+ inset: auto;
337
+ margin: 0;
338
+ display: grid;
339
+ gap: 10px;
340
+ padding: 14px;
341
+ border: 1px solid var(--dpk-rule-strong);
342
+ border-radius: var(--dpk-radius-lg);
343
+ background: var(--dpk-paper-raised);
344
+ box-shadow: var(--dpk-bevel), var(--dpk-shadow-lg);
345
+ color: var(--dpk-ink);
346
+ font-size: 12.5px;
347
+ animation: dpk-pop-in 180ms var(--dpk-ease);
348
+ }
349
+
350
+ @keyframes dpk-pop-in {
351
+ from {
352
+ opacity: 0;
353
+ transform: translateY(4px) scale(0.98);
354
+ }
355
+ }
356
+
357
+ .comment-pop .comment-list {
358
+ list-style: none;
359
+ margin: 0;
360
+ padding: 0;
361
+ display: grid;
362
+ gap: 6px;
363
+ max-height: 140px;
364
+ overflow: auto;
365
+ font-size: 12px;
366
+ color: var(--dpk-ink-soft);
367
+ }
368
+
369
+ .comment-pop .comment-list li {
370
+ padding: 6px 10px;
371
+ border-radius: var(--dpk-radius-xs);
372
+ background: var(--dpk-accent-soft);
373
+ border-left: 2px solid var(--dpk-accent);
374
+ }
375
+
376
+ .comment-pop .dpk-textarea {
377
+ min-height: 54px;
378
+ }
379
+
380
+ .pop-actions {
381
+ display: flex;
382
+ gap: 4px;
383
+ align-items: center;
384
+ justify-content: flex-end;
385
+ }
386
+ `,Xs=de`
387
+ .dpk-prose {
388
+ overflow-wrap: anywhere;
389
+ }
390
+
391
+ .dpk-prose > :first-child {
392
+ margin-top: 0;
393
+ }
394
+
395
+ .dpk-prose > :last-child {
396
+ margin-bottom: 0;
397
+ }
398
+
399
+ .dpk-prose :is(p, ul, ol, pre, blockquote, table) {
400
+ margin: 0 0 0.6em;
401
+ }
402
+
403
+ .dpk-prose :is(h1, h2, h3, h4, h5, h6) {
404
+ margin: 0.8em 0 0.3em;
405
+ font-size: 1em;
406
+ font-weight: 650;
407
+ line-height: 1.4;
408
+ color: var(--dpk-ink);
409
+ }
410
+
411
+ .dpk-prose :is(ul, ol) {
412
+ padding-left: 1.3em;
413
+ }
414
+
415
+ .dpk-prose li + li {
416
+ margin-top: 0.15em;
417
+ }
418
+
419
+ /* A task list item: its checkbox is the marker, so it has no bullet of its own. */
420
+ .dpk-prose li:has(> input[type='checkbox']:first-child) {
421
+ margin-left: -1.3em;
422
+ list-style: none;
423
+ }
424
+
425
+ .dpk-prose li > input[type='checkbox']:first-child {
426
+ margin: 0 0.4em 0 0;
427
+ vertical-align: -0.1em;
428
+ }
429
+
430
+ .dpk-prose strong {
431
+ font-weight: 650;
432
+ color: var(--dpk-ink);
433
+ }
434
+
435
+ .dpk-prose a {
436
+ color: var(--dpk-blue);
437
+ text-decoration: underline;
438
+ text-underline-offset: 2px;
439
+ }
440
+
441
+ .dpk-prose code {
442
+ padding: 0.05em 0.3em;
443
+ border-radius: var(--dpk-radius-xs);
444
+ background: var(--dpk-paper-sunken);
445
+ font-family: var(--dpk-mono);
446
+ font-size: 0.9em;
447
+ }
448
+
449
+ .dpk-prose pre {
450
+ padding: 8px 10px;
451
+ border-radius: var(--dpk-radius-xs);
452
+ background: var(--dpk-paper-sunken);
453
+ overflow: auto;
454
+ }
455
+
456
+ .dpk-prose pre code {
457
+ padding: 0;
458
+ background: none;
459
+ }
460
+
461
+ .dpk-prose blockquote {
462
+ padding-left: 0.8em;
463
+ border-left: 2px solid var(--dpk-rule-strong);
464
+ color: var(--dpk-ink-soft);
465
+ }
466
+
467
+ /* A table wider than its box scrolls on its own instead of being clipped by it. */
468
+ .dpk-prose table {
469
+ display: block;
470
+ max-width: 100%;
471
+ overflow-x: auto;
472
+ border-collapse: collapse;
473
+ }
474
+
475
+ /* A cell breaks a word only once it runs out of room: the box's 'anywhere' would
476
+ let the table shrink a column to one letter rather than scroll. */
477
+ .dpk-prose :is(th, td) {
478
+ overflow-wrap: break-word;
479
+ padding: 2px 8px;
480
+ border: 1px solid var(--dpk-rule);
481
+ text-align: left;
482
+ }
483
+
484
+ .dpk-prose hr {
485
+ border: none;
486
+ border-top: 1px solid var(--dpk-rule);
487
+ }
488
+
489
+ .dpk-prose img {
490
+ max-width: 100%;
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 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
+ `),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 ll(t,e,n){let s=t.match(n.other.indentCodeCompensation);if(s===null)return e;let i=s[1];return e.split(`
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=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
+ `),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
+ `)}}blockquote(t){let e=this.rules.block.blockquote.exec(t);if(e){let n=fe(e[0],`
500
+ `).split(`
501
+ `),s="",i="",r=[];for(;n.length>0;){let o=!1,a=[],l;for(l=0;l<n.length;l++)if(this.rules.other.blockquoteStart.test(n[l]))a.push(n[l]),o=!0;else if(!o)a.push(n[l]);else break;n=n.slice(l);let c=a.join(`
502
+ `),p=c.replace(this.rules.other.blockquoteSetextReplace,`
503
+ $1`).replace(this.rules.other.blockquoteSetextReplace2,"");s=s?`${s}
504
+ ${c}`:c,i=i?`${i}
505
+ ${p}`:p;let d=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(p,r,!0),this.lexer.state.top=d,n.length===0)break;let h=r.at(-1);if(h?.type==="code")break;if(h?.type==="blockquote"){let u=h,f=n.join(`
506
+ `),k=u.raw+`
507
+ `+f.replace(this.rules.other.blockquoteSetextReplace2,""),g=this.blockquote(k);r[r.length-1]=g;let v=k.substring(g.raw.length).replace(/^\n/,""),$=v?v.split(`
508
+ `).length:0,A=$?n.slice(0,-$):n;A.length>0&&(s=`${s}
509
+ ${A.join(`
510
+ `)}`),i=i.substring(0,i.length-u.text.length)+g.text;break}else if(h?.type==="list"){let u=h,f=u.raw+`
511
+ `+n.join(`
512
+ `),k=this.list(f);r[r.length-1]=k,s=s.substring(0,s.length-h.raw.length)+k.raw,i=i.substring(0,i.length-u.raw.length)+k.raw,n=f.substring(r.at(-1).raw.length).split(`
513
+ `);continue}}return{type:"blockquote",raw:s,tokens:r,text:i}}}list(t){let e=this.rules.block.list.exec(t);if(e){let n=e[1].trim(),s=n.length>1,i={type:"list",raw:"",ordered:s,start:s?+n.slice(0,-1):"",loose:!1,items:[]};n=s?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=s?n:"[*+-]");let r=this.rules.other.listItemRegex(n),o=!1;for(;t;){let l=!1,c="",p="";if(!(e=r.exec(t))||this.rules.block.hr.test(t))break;c=e[0],t=t.substring(c.length);let d=e[2].split(`
514
+ `,1)[0],h=e[1].length,u=this.options.pedantic?mi(d,h):d.replace(this.rules.other.leadingSpaceTab,v=>mi(v,h)),f=t.split(`
515
+ `,1)[0],k=!u.trim(),g=0;if(this.options.pedantic?(g=2,p=u.trimStart()):k?g=h+1:(g=u.search(this.rules.other.nonSpaceChar),g=g>4?1:g,p=u.slice(g),g+=h),k&&this.rules.other.blankLine.test(f)&&(c+=f+`
516
+ `,t=t.substring(f.length+1),l=!0),!l){let v=this.rules.other.nextBulletRegex(g),$=this.rules.other.hrRegex(g),A=this.rules.other.fencesBeginRegex(g),E=this.rules.other.headingBeginRegex(g),I=this.rules.other.htmlBeginRegex(g),O=this.rules.other.blockquoteBeginRegex(g);for(;t;){let U=t.split(`
517
+ `,1)[0],M;if(f=U,this.options.pedantic?(f=f.replace(this.rules.other.listReplaceNesting," "),M=f):M=f.replace(this.rules.other.leadingSpaceTab,ee=>ee.replace(this.rules.other.tabCharGlobal," ")),A.test(f)||E.test(f)||I.test(f)||O.test(f)||v.test(f)||$.test(f))break;if(M.search(this.rules.other.nonSpaceChar)>=g||!f.trim())p+=`
518
+ `+M.slice(g);else{if(k||u.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||A.test(u)||E.test(u)||$.test(u))break;p+=`
519
+ `+f}k=!f.trim(),c+=U+`
520
+ `,t=t.substring(U.length+1),u=M.slice(g)}}i.loose||(o?i.loose=!0:this.rules.other.doubleBlankLine.test(c)&&(o=!0)),i.items.push({type:"list_item",raw:c,task:!!this.options.gfm&&this.rules.other.listIsTask.test(p),loose:!1,text:p,tokens:[]}),i.raw+=c}let a=i.items.at(-1);if(a)a.raw=a.raw.trimEnd(),a.text=a.text.trimEnd();else return;i.raw=i.raw.trimEnd();for(let l of i.items)if(this.lexer.state.top=!1,l.tokens=this.lexer.blockTokens(l.text,[]),!i.loose){let c=l.tokens.filter(d=>d.type==="space"),p=c.length>0&&c.some(d=>this.rules.other.anyLine.test(d.raw));i.loose=p}for(let l of i.items){let c=l.tokens[0];if(l.task&&(c?.type==="text"||c?.type==="paragraph")){l.text=l.text.replace(this.rules.other.listReplaceTask,""),c.raw=c.raw.replace(this.rules.other.listReplaceTask,""),c.text=c.text.replace(this.rules.other.listReplaceTask,"");for(let d=this.lexer.inlineQueue.length-1;d>=0;d--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[d].src)){this.lexer.inlineQueue[d].src=this.lexer.inlineQueue[d].src.replace(this.rules.other.listReplaceTask,"");break}let p=this.rules.other.listTaskCheckbox.exec(l.raw);if(p){let d={type:"checkbox",raw:p[0]+" ",checked:p[0]!=="[ ]"};l.checked=d.checked,i.loose?l.tokens[0]&&["paragraph","text"].includes(l.tokens[0].type)&&"tokens"in l.tokens[0]&&l.tokens[0].tokens?(l.tokens[0].raw=d.raw+l.tokens[0].raw,l.tokens[0].text=d.raw+l.tokens[0].text,l.tokens[0].tokens.unshift(d)):l.tokens.unshift({type:"paragraph",raw:d.raw,text:d.raw,tokens:[d]}):l.tokens.unshift(d)}}else l.task&&(l.task=!1)}if(i.loose)for(let l of i.items){l.loose=!0;for(let c of l.tokens)c.type==="text"&&(c.type="paragraph")}return i}}html(t){let e=this.rules.block.html.exec(t);if(e){let n=fi(e[0]);return{type:"html",block:!0,raw:n,pre:e[1]==="pre"||e[1]==="script"||e[1]==="style",text:n}}}def(t){let e=this.rules.block.def.exec(t);if(e){if(!this.rules.other.startAngleBracket.test(e[2])&&gi(e[2],"()")!==-1)return;let n=_t(e[1]).replace(this.rules.other.multipleSpaceGlobal," "),s=e[2]?e[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",i=e[3]?e[3].substring(1,e[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):e[3];return{type:"def",tag:n,raw:fe(e[0],`
521
+ `),href:s,title:i}}}table(t){let e=this.rules.block.table.exec(t);if(!e||!this.rules.other.tableDelimiter.test(e[2]))return;let n=ui(e[1]),s=e[2].replace(this.rules.other.tableAlignChars,"").split("|"),i=e[3]?.trim()?e[3].replace(this.rules.other.tableRowBlankLine,"").split(`
522
+ `):[],r={type:"table",raw:fe(e[0],`
523
+ `),header:[],align:[],rows:[]};if(n.length===s.length){for(let o of s)this.rules.other.tableAlignRight.test(o)?r.align.push("right"):this.rules.other.tableAlignCenter.test(o)?r.align.push("center"):this.rules.other.tableAlignLeft.test(o)?r.align.push("left"):r.align.push(null);for(let o=0;o<n.length;o++)r.header.push({text:n[o],tokens:this.lexer.inline(n[o]),header:!0,align:r.align[o]});for(let o of i)r.rows.push(ui(o,r.header.length).map((a,l)=>({text:a,tokens:this.lexer.inline(a),header:!1,align:r.align[l]})));return r}}lheading(t){let e=this.rules.block.lheading.exec(t);if(e){let n=e[1].trim();return{type:"heading",raw:fe(e[0],`
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]: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
+ `),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
+ `: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
+ `)?"":`
529
+ `)+r.raw,a.text+=`
530
+ `+r.text,this.inlineQueue.at(-1).src=a.text):n.push(r);continue}if(r=this.tokenizer.fences(e)){e=e.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.heading(e)){e=e.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.hr(e)){e=e.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.blockquote(e)){e=e.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.list(e)){e=e.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.html(e)){e=e.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.def(e)){e=e.substring(r.raw.length);let a=n.at(-1);a?.type==="paragraph"||a?.type==="text"?(a.raw+=(a.raw.endsWith(`
531
+ `)?"":`
532
+ `)+r.raw,a.text+=`
533
+ `+r.raw,this.inlineQueue.at(-1).src=a.text):this.tokens.links[r.tag]||(this.tokens.links[r.tag]={href:r.href,title:r.title},n.push(r));continue}if(r=this.tokenizer.table(e)){e=e.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.lheading(e)){e=e.substring(r.raw.length),n.push(r);continue}let o=e;if(this.options.extensions?.startBlock){let a=1/0,l=e.slice(1),c;this.options.extensions.startBlock.forEach(p=>{c=p.call({lexer:this},l),typeof c=="number"&&c>=0&&(a=Math.min(a,c))}),a<1/0&&a>=0&&(o=e.substring(0,a+1))}if(this.state.top&&(r=this.tokenizer.paragraph(o))){let a=n.at(-1);s&&a?.type==="paragraph"?(a.raw+=(a.raw.endsWith(`
534
+ `)?"":`
535
+ `)+r.raw,a.text+=`
536
+ `+r.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=a.text):n.push(r),s=o.length!==e.length,e=e.substring(r.raw.length);continue}if(r=this.tokenizer.text(e)){e=e.substring(r.raw.length);let a=n.at(-1);a?.type==="text"?(a.raw+=(a.raw.endsWith(`
537
+ `)?"":`
538
+ `)+r.raw,a.text+=`
539
+ `+r.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=a.text):n.push(r);continue}if(e){this.infiniteLoopError(e.charCodeAt(0));break}}return this.state.top=!0,n}inline(e,n=[]){return this.inlineQueue.push({src:e,tokens:n}),n}linkInText(e){if(!e.includes("["))return!1;let n=this.tokenizer.rules.inline.link;for(let s of e.matchAll(this.tokenizer.rules.inline.blockSkip))if(n.test(s[0])&&e.charAt(s.index-1)!=="!")return!0;for(let s of e.matchAll(this.tokenizer.rules.inline.reflinkSearch)){let i=s[0],r=i.lastIndexOf("[");if(!(i.charAt(0)==="!"||!Object.hasOwn(this.tokens.links,_t(i.slice(r+1,-1))))&&!(r>1&&this.linkInText(i.slice(1,r-1))))return!0}return!1}inlineTokens(e,n=[]){this.tokenizer.lexer=this;let s=this.state.linkParenPossible;this.state.linkParenPossible=s&&e.includes(")");try{return this.#e(e,n)}finally{this.state.linkParenPossible=s}}#e(e,n){let s=e;if(this.tokens.links&&e.includes("[")){let a=this.tokenizer.rules.inline.reflinkSearch,l=c=>{let p=c.lastIndexOf("[");if(!Object.hasOwn(this.tokens.links,_t(c.slice(p+1,-1))))return c;if(p>1&&c.charAt(0)!=="!"){let d=c.slice(1,p-1);if(this.linkInText(d))return"["+d.replace(a,l)+"]["+"a".repeat(c.length-p-2)+"]"}return"["+"a".repeat(c.length-2)+"]"};s=s.replace(a,l)}s=s.replace(this.tokenizer.rules.inline.anyPunctuation,a=>"+".repeat(a.length)),s=s.replace(this.tokenizer.rules.inline.blockSkip,(a,l,c)=>{let p=c?c.length:0;return a.slice(0,p)+"["+"a".repeat(a.length-p-2)+"]"}),s=this.options.hooks?.emStrongMask?.call({lexer:this},s)??s;let i=!1,r="",o=1/0;for(;e;){if(e.length<o)o=e.length;else{this.infiniteLoopError(e.charCodeAt(0));break}i||(r=""),i=!1;let a;if(this.options.extensions?.inline?.some(c=>(a=c.call({lexer:this},e,n))?(e=e.substring(a.raw.length),n.push(a),!0):!1))continue;if(a=this.tokenizer.escape(e)){e=e.substring(a.raw.length),n.push(a);continue}if(a=this.tokenizer.tag(e)){e=e.substring(a.raw.length),n.push(a);continue}if(a=this.tokenizer.link(e)){e=e.substring(a.raw.length),n.push(a);continue}if(a=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(a.raw.length);let c=n.at(-1);a.type==="text"&&c?.type==="text"?(c.raw+=a.raw,c.text+=a.text):n.push(a);continue}if(a=this.tokenizer.emStrong(e,s,r)){e=e.substring(a.raw.length),n.push(a);continue}if(a=this.tokenizer.codespan(e)){e=e.substring(a.raw.length),n.push(a);continue}if(a=this.tokenizer.br(e)){e=e.substring(a.raw.length),n.push(a);continue}if(a=this.tokenizer.del(e,s,r)){e=e.substring(a.raw.length),n.push(a);continue}if(a=this.tokenizer.autolink(e)){e=e.substring(a.raw.length),n.push(a);continue}if(!this.state.inLink&&(a=this.tokenizer.url(e))){e=e.substring(a.raw.length),n.push(a);continue}let l=e;if(this.options.extensions?.startInline){let c=1/0,p=e.slice(1),d;this.options.extensions.startInline.forEach(h=>{d=h.call({lexer:this},p),typeof d=="number"&&d>=0&&(c=Math.min(c,d))}),c<1/0&&c>=0&&(l=e.substring(0,c+1))}if(a=this.tokenizer.inlineText(l)){e=e.substring(a.raw.length),a.raw.slice(-1)!=="_"&&(r=a.raw.slice(-1)),i=!0;let c=n.at(-1);c?.type==="text"?(c.raw+=a.raw,c.text+=a.text):n.push(a);continue}if(e){this.infiniteLoopError(e.charCodeAt(0));break}}return n}infiniteLoopError(e){let n="Infinite loop on byte: "+e;if(this.options.silent)console.error(n);else throw new Error(n)}},Ot=class{options;parser;constructor(t){this.options=t||Ae}space(t){return""}code({text:t,lang:e,escaped:n}){let s=(e||"").match(P.notSpaceStart)?.[0],i=t?t.replace(P.endingNewline,"")+`
540
+ `:"";return s?'<pre><code class="language-'+q(s)+'">'+(n?i:q(i,!0))+`</code></pre>
541
+ `:"<pre><code>"+(n?i:q(i,!0))+`</code></pre>
542
+ `}blockquote({tokens:t}){return`<blockquote>
543
+ ${this.parser.parse(t)}</blockquote>
544
+ `}html({text:t}){return t}def(t){return""}heading({tokens:t,depth:e}){return`<h${e}>${this.parser.parseInline(t)}</h${e}>
545
+ `}hr(t){return`<hr>
546
+ `}list(t){let e=t.ordered,n=t.start,s="";for(let o=0;o<t.items.length;o++){let a=t.items[o];s+=this.listitem(a)}let i=e?"ol":"ul",r=e&&n!==1?' start="'+n+'"':"";return"<"+i+r+`>
547
+ `+s+"</"+i+`>
548
+ `}listitem(t){return`<li>${this.parser.parse(t.tokens)}</li>
549
+ `}checkbox({checked:t}){return"<input "+(t?'checked="" ':"")+'disabled="" type="checkbox"> '}paragraph({tokens:t}){return`<p>${this.parser.parseInline(t)}</p>
550
+ `}table(t){let e="",n="";for(let i=0;i<t.header.length;i++)n+=this.tablecell(t.header[i]);e+=this.tablerow({text:n});let s="";for(let i=0;i<t.rows.length;i++){let r=t.rows[i];n="";for(let o=0;o<r.length;o++)n+=this.tablecell(r[o]);s+=this.tablerow({text:n})}return s&&(s=`<tbody>${s}</tbody>`),`<table>
551
+ <thead>
552
+ `+e+`</thead>
553
+ `+s+`</table>
554
+ `}tablerow({text:t}){return`<tr>
555
+ ${t}</tr>
556
+ `}tablecell(t){let e=this.parser.parseInline(t.tokens),n=t.header?"th":"td";return(t.align?`<${n} align="${t.align}">`:`<${n}>`)+e+`</${n}>
557
+ `}strong({tokens:t}){return`<strong>${this.parser.parseInline(t)}</strong>`}em({tokens:t}){return`<em>${this.parser.parseInline(t)}</em>`}codespan({text:t}){return`<code>${q(t,!0)}</code>`}br(t){return"<br>"}del({tokens:t}){return`<del>${this.parser.parseInline(t)}</del>`}link({href:t,title:e,text:n,tokens:s,autolink:i}){let r=i?q(n,!0):this.parser.parseInline(s),o=hi(t);if(o===null)return r;t=q(o,i);let a='<a href="'+t+'"';return e&&(a+=' title="'+q(e)+'"'),a+=">"+r+"</a>",a}image({href:t,title:e,text:n,tokens:s}){s&&(n=this.parser.parseInline(s,this.parser.textRenderer));let i=hi(t);if(i===null)return q(n);t=i;let r=`<img src="${q(t)}" alt="${q(n)}"`;return e&&(r+=` title="${q(e)}"`),r+=">",r}text(t){return"tokens"in t&&t.tokens?this.parser.parseInline(t.tokens):"escaped"in t&&t.escaped?t.text:q(t.text)}},En=class{strong({text:t}){return t}em({text:t}){return t}codespan({text:t}){return t}del({text:t}){return t}html({text:t}){return t}text({text:t}){return t}link({text:t}){return""+t}image({text:t}){return""+t}br(){return""}checkbox({raw:t}){return t}},K=class ys{options;renderer;textRenderer;constructor(e){this.options=e||Ae,this.options.renderer=this.options.renderer||new Ot,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new En}static parse(e,n){return new ys(n).parse(e)}static parseInline(e,n){return new ys(n).parseInline(e)}parse(e){this.renderer.parser=this;let n="";for(let s=0;s<e.length;s++){let i=e[s];if(this.options.extensions?.renderers?.[i.type]){let o=i,a=this.options.extensions.renderers[o.type].call({parser:this},o);if(a!==!1||!["space","hr","heading","code","table","blockquote","list","checkbox","html","def","paragraph","text"].includes(o.type)){n+=a||"";continue}}let r=i;switch(r.type){case"space":{n+=this.renderer.space(r);break}case"hr":{n+=this.renderer.hr(r);break}case"heading":{n+=this.renderer.heading(r);break}case"code":{n+=this.renderer.code(r);break}case"table":{n+=this.renderer.table(r);break}case"blockquote":{n+=this.renderer.blockquote(r);break}case"list":{n+=this.renderer.list(r);break}case"checkbox":{n+=this.renderer.checkbox(r);break}case"html":{n+=this.renderer.html(r);break}case"def":{n+=this.renderer.def(r);break}case"paragraph":{n+=this.renderer.paragraph(r);break}case"text":{n+=this.renderer.text(r);break}default:{let o='Token with "'+r.type+'" type was not found.';if(this.options.silent)return console.error(o),"";throw new Error(o)}}}return n}parseInline(e,n=this.renderer){this.renderer.parser=this;let s="";for(let i=0;i<e.length;i++){let r=e[i];if(this.options.extensions?.renderers?.[r.type]){let a=this.options.extensions.renderers[r.type].call({parser:this},r);if(a!==!1||!["escape","html","link","image","checkbox","strong","em","codespan","br","del","text"].includes(r.type)){s+=a||"";continue}}let o=r;switch(o.type){case"escape":{s+=n.text(o);break}case"html":{s+=n.html(o);break}case"link":{s+=n.link(o);break}case"image":{s+=n.image(o);break}case"checkbox":{s+=n.checkbox(o);break}case"strong":{s+=n.strong(o);break}case"em":{s+=n.em(o);break}case"codespan":{s+=n.codespan(o);break}case"br":{s+=n.br(o);break}case"del":{s+=n.del(o);break}case"text":{s+=n.text(o);break}default:{let a='Token with "'+o.type+'" type was not found.';if(this.options.silent)return console.error(a),"";throw new Error(a)}}}return s}},rt=class{options;block;constructor(t){this.options=t||Ae}static passThroughHooks=new Set(["preprocess","postprocess","processAllTokens","emStrongMask"]);static passThroughHooksRespectAsync=new Set(["preprocess","postprocess","processAllTokens"]);preprocess(t){return t}postprocess(t){return t}processAllTokens(t){return t}emStrongMask(t){return t}provideLexer(t=this.block){return t?V.lex:V.lexInline}provideParser(t=this.block){return t?K.parse:K.parseInline}},xi=class{defaults=vn();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=K;Renderer=Ot;TextRenderer=En;Lexer=V;Tokenizer=Lt;Hooks=rt;constructor(...t){this.use(...t)}walkTokens(t,e){let n=[];for(let s of t)switch(n=n.concat(e.call(this,s)),s.type){case"table":{let i=s;for(let r of i.header)n=n.concat(this.walkTokens(r.tokens,e));for(let r of i.rows)for(let o of r)n=n.concat(this.walkTokens(o.tokens,e));break}case"list":{let i=s;n=n.concat(this.walkTokens(i.items,e));break}default:{let i=s;this.defaults.extensions?.childTokens?.[i.type]?this.defaults.extensions.childTokens[i.type].forEach(r=>{let o=i[r].flat(1/0);n=n.concat(this.walkTokens(o,e))}):i.tokens&&(n=n.concat(this.walkTokens(i.tokens,e)))}}return n}use(...t){let e=this.defaults.extensions||{renderers:{},childTokens:{}};return t.forEach(n=>{let s={...n};if(s.async=this.defaults.async||s.async||!1,n.extensions&&(n.extensions.forEach(i=>{if(!i.name)throw new Error("extension name required");if("renderer"in i){let r=e.renderers[i.name];r?e.renderers[i.name]=function(...o){let a=i.renderer.apply(this,o);return a===!1&&(a=r.apply(this,o)),a}:e.renderers[i.name]=i.renderer}if("tokenizer"in i){if(!i.level||i.level!=="block"&&i.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let r=e[i.level];r?r.unshift(i.tokenizer):e[i.level]=[i.tokenizer],i.start&&(i.level==="block"?e.startBlock?e.startBlock.push(i.start):e.startBlock=[i.start]:i.level==="inline"&&(e.startInline?e.startInline.push(i.start):e.startInline=[i.start]))}"childTokens"in i&&i.childTokens&&(e.childTokens[i.name]=i.childTokens)}),s.extensions=e),n.renderer){let i=this.defaults.renderer||new Ot(this.defaults);for(let r in n.renderer){if(!(r in i))throw new Error(`renderer '${r}' does not exist`);if(["options","parser"].includes(r))continue;let o=r,a=n.renderer[o],l=i[o];i[o]=(...c)=>{let p=a.apply(i,c);return p===!1&&(p=l.apply(i,c)),p||""}}s.renderer=i}if(n.tokenizer){let i=this.defaults.tokenizer||new Lt(this.defaults);for(let r in n.tokenizer){if(!(r in i))throw new Error(`tokenizer '${r}' does not exist`);if(["options","rules","lexer"].includes(r))continue;let o=r,a=n.tokenizer[o],l=i[o];i[o]=(...c)=>{let p=a.apply(i,c);return p===!1&&(p=l.apply(i,c)),p}}s.tokenizer=i}if(n.hooks){let i=this.defaults.hooks||new rt;for(let r in n.hooks){if(!(r in i))throw new Error(`hook '${r}' does not exist`);if(["options","block"].includes(r))continue;let o=r,a=n.hooks[o],l=i[o];rt.passThroughHooks.has(r)?i[o]=c=>{if(this.defaults.async&&rt.passThroughHooksRespectAsync.has(r))return(async()=>{let d=await a.call(i,c);return l.call(i,d)})();let p=a.call(i,c);return l.call(i,p)}:i[o]=(...c)=>{if(this.defaults.async)return(async()=>{let d=await a.apply(i,c);return d===!1&&(d=await l.apply(i,c)),d})();let p=a.apply(i,c);return p===!1&&(p=l.apply(i,c)),p}}s.hooks=i}if(n.walkTokens){let i=this.defaults.walkTokens,r=n.walkTokens;s.walkTokens=function(o){let a=[];return a.push(r.call(this,o)),i&&(a=a.concat(i.call(this,o))),a}}this.defaults={...this.defaults,...s}}),this}setOptions(t){return this.defaults={...this.defaults,...t},this}lexer(t,e){return V.lex(t,e??this.defaults)}parser(t,e){return K.parse(t,e??this.defaults)}parseMarkdown(t){return(e,n)=>{let s={...n},i={...this.defaults,...s},r=this.onError(!!i.silent,!!i.async);if(this.defaults.async===!0&&s.async===!1)return r(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof e>"u"||e===null)return r(new Error("marked(): input parameter is undefined or null"));if(typeof e!="string")return r(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(e)+", string expected"));if(i.hooks&&(i.hooks.options=i,i.hooks.block=t),i.async)return(async()=>{let o=i.hooks?await i.hooks.preprocess(e):e,a=await(i.hooks?await i.hooks.provideLexer(t):t?V.lex:V.lexInline)(o,i),l=i.hooks?await i.hooks.processAllTokens(a):a;i.walkTokens&&await Promise.all(this.walkTokens(l,i.walkTokens));let c=await(i.hooks?await i.hooks.provideParser(t):t?K.parse:K.parseInline)(l,i);return i.hooks?await i.hooks.postprocess(c):c})().catch(r);try{i.hooks&&(e=i.hooks.preprocess(e));let o=(i.hooks?i.hooks.provideLexer(t):t?V.lex:V.lexInline)(e,i);i.hooks&&(o=i.hooks.processAllTokens(o)),i.walkTokens&&this.walkTokens(o,i.walkTokens);let a=(i.hooks?i.hooks.provideParser(t):t?K.parse:K.parseInline)(o,i);return i.hooks&&(a=i.hooks.postprocess(a)),a}catch(o){return r(o)}}}onError(t,e){return n=>{if(n.message+=`
558
+ Please report this to https://github.com/markedjs/marked.`,t){let s="<p>An error occurred:</p><pre>"+q(n.message+"",!0)+"</pre>";return e?Promise.resolve(s):s}if(e)return Promise.reject(n);throw n}}},Te=new xi;function C(t,e){return Te.parse(t,e)}C.options=C.setOptions=function(t){return Te.setOptions(t),C.defaults=Te.defaults,Qs(C.defaults),C},C.getDefaults=vn,C.defaults=Ae;function 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
+ /* One atomic box in both states, so the text can be edited where it sits:
560
+ while editing, the text stays (hidden) underneath and keeps sizing the
561
+ box, and the field lies over it. Starting an edit moves nothing; the
562
+ box grows only as the draft does. */
563
+ :host {
564
+ display: inline-block;
565
+ max-width: 100%;
566
+ vertical-align: baseline;
567
+ /* Inherit the surrounding type scale instead of forcing the chrome size:
568
+ an inline edit inside a 17px heading must look like a 17px heading.
569
+ Color comes along too, so an edit on a colored card stays legible. */
570
+ font-family: inherit;
571
+ font-size: inherit;
572
+ font-weight: inherit;
573
+ line-height: inherit;
574
+ color: inherit;
575
+ }
576
+
577
+ .box {
578
+ position: relative;
579
+ display: block;
580
+ }
581
+
582
+ /* No vertical padding or border: the box is exactly the lines of text.
583
+ The underline and ring are shadows, which never move the layout. */
584
+ .view {
585
+ display: block;
586
+ padding: 0 4px;
587
+ border-radius: var(--dpk-radius-xs);
588
+ white-space: pre-wrap;
589
+ overflow-wrap: anywhere;
590
+ cursor: text;
591
+ transition:
592
+ background 140ms var(--dpk-ease),
593
+ box-shadow 140ms var(--dpk-ease);
594
+ }
595
+
596
+ .view:hover {
597
+ background: var(--dpk-blue-soft);
598
+ box-shadow:
599
+ inset 0 -1px 0 var(--dpk-blue),
600
+ inset 0 0 0 1px color-mix(in srgb, var(--dpk-blue) 22%, transparent);
601
+ }
602
+
603
+ /* Formatted text keeps its own line breaks: a break in the source is a <br>. */
604
+ .view.dpk-prose {
605
+ white-space: normal;
606
+ }
607
+
608
+ .view[data-empty='true'] {
609
+ box-shadow: inset 0 -1px 0 var(--dpk-rule-strong);
610
+ color: var(--dpk-ink-faint);
611
+ font-style: italic;
612
+ }
613
+
614
+ .view[data-empty='true']:hover {
615
+ box-shadow: inset 0 -1px 0 var(--dpk-blue);
616
+ }
617
+
618
+ .view[aria-hidden='true'] {
619
+ visibility: hidden;
620
+ transition: none;
621
+ }
622
+
623
+ .field {
624
+ position: absolute;
625
+ inset: 0;
626
+ box-sizing: border-box;
627
+ width: 100%;
628
+ height: 100%;
629
+ min-width: 0;
630
+ margin: 0;
631
+ padding: 0 4px;
632
+ border: none;
633
+ border-radius: var(--dpk-radius-xs);
634
+ outline: none;
635
+ background: var(--dpk-paper-raised);
636
+ box-shadow:
637
+ inset 0 0 0 1px var(--dpk-blue),
638
+ var(--dpk-focus);
639
+ font: inherit;
640
+ line-height: inherit;
641
+ letter-spacing: inherit;
642
+ color: inherit;
643
+ white-space: pre-wrap;
644
+ overflow-wrap: anywhere;
645
+ overflow: hidden;
646
+ resize: none;
647
+ animation: dpk-inline-edit-in 140ms var(--dpk-ease) backwards;
648
+ }
649
+
650
+ .field::placeholder {
651
+ color: var(--dpk-ink-faint);
652
+ font-style: italic;
653
+ opacity: 1;
654
+ }
655
+
656
+ @keyframes dpk-inline-edit-in {
657
+ from {
658
+ opacity: 0;
659
+ }
660
+ }
661
+
662
+ :host([truncate]) .view {
663
+ overflow: hidden;
664
+ text-overflow: ellipsis;
665
+ white-space: pre;
666
+ }
667
+
668
+ /* Wrapped, it keeps --dpk-inline-edit-lines lines; the hidden text under a
669
+ field still sizes the box to the whole draft. */
670
+ :host([truncate][wrap]) .view:not([aria-hidden='true']) {
671
+ display: -webkit-box;
672
+ -webkit-box-orient: vertical;
673
+ -webkit-line-clamp: var(--dpk-inline-edit-lines, 3);
674
+ white-space: pre-wrap;
675
+ }
676
+
677
+ /* seamless: no field chrome at all — the text is edited where it sits. */
678
+ :host([seamless]) .view,
679
+ :host([seamless]) .field {
680
+ padding: 0;
681
+ }
682
+
683
+ :host([seamless]) .field {
684
+ border-radius: 0;
685
+ background: transparent;
686
+ box-shadow: none;
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=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
+ `)?`${i}\u200B`:i;return this.markdown&&!s&&i!==""?b`<span class="box"
690
+ ><div
691
+ class="view dpk-prose"
692
+ data-empty="false"
693
+ role="button"
694
+ tabindex="0"
695
+ title=${e.clickToEdit}
696
+ @click=${this.#t}
697
+ @keydown=${this.#i}
698
+ >
699
+ ${Vs(yi(i))}
700
+ </div></span
701
+ >`:b`<span class="box"
702
+ ><span
703
+ class="view"
704
+ data-empty=${String(i==="")}
705
+ aria-hidden=${s?"true":m}
706
+ role=${s?m:"button"}
707
+ tabindex=${s?m:"0"}
708
+ title=${s?m:this.truncate&&i!==""?i:e.clickToEdit}
709
+ @click=${this.#t}
710
+ @keydown=${this.#i}
711
+ >${r}</span
712
+ >${s?this.#r(this.label||this.placeholder||e.edit,n):m}</span
713
+ >`}#r(e,n){return this.multiline||this.wrap?b`<textarea
714
+ class="field"
715
+ rows="1"
716
+ .value=${gn(this.#e)}
717
+ placeholder=${n}
718
+ aria-label=${e}
719
+ @input=${this.#o}
720
+ @keydown=${this.#a}
721
+ @blur=${this.#l}
722
+ ></textarea>`:b`<input
723
+ class="field"
724
+ .value=${gn(this.#e)}
725
+ placeholder=${n}
726
+ aria-label=${e}
727
+ @input=${this.#o}
728
+ @keydown=${this.#a}
729
+ @blur=${this.#l}
730
+ />`}#t=e=>{e.composedPath().some(n=>n instanceof HTMLAnchorElement)||(e.stopPropagation(),!this.editing&&(this.#e=this.value,this.editing=!0))};#i=e=>{e.isComposing||this.editing||e.target instanceof HTMLAnchorElement||(e.key==="Enter"||e.key===" ")&&(e.preventDefault(),this.editing=!0)};#o=e=>{const n=je(e.target,HTMLInputElement)??je(e.target,HTMLTextAreaElement);n!==null&&(this.#e=n.value,this.requestUpdate())};#a=e=>{if(!e.isComposing){if(e.key==="Escape"){e.preventDefault(),this.#e=this.value,this.editing=!1;return}e.key==="Enter"&&(!this.multiline||this.wrap||e.metaKey||e.ctrlKey)&&(e.preventDefault(),this.#p())}};#l=e=>{const n=e.currentTarget;if(!(n instanceof HTMLInputElement||n instanceof HTMLTextAreaElement))return;const s=this.#n,{selectionStart:i,selectionEnd:r}=n;queueMicrotask(()=>{!this.isConnected||!this.editing||(s!==this.#n?(n.focus(),n.setSelectionRange(i,r)):this.#p())})};#p=()=>{if(!this.editing)return;this.editing=!1;const n=(this.wrap?this.#e.replace(/\r?\n/g," "):this.#e).trim();n!==this.value&&this.dispatchEvent(new CustomEvent("dpk-commit",{detail:{value:n},bubbles:!0,composed:!0}))}}const 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
+ ${t}
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
+ > `)}`)}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
+ ${Zl(d).replace(/\n/g,`
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(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
+
741
+ ${nc(t)}`;return tc(e)<=Ql?e:null},ic=t=>`${Zi}
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).`,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
+ :host {
745
+ display: flex;
746
+ flex-direction: column;
747
+ min-height: 0;
748
+ min-width: 0;
749
+ width: 100%;
750
+ background: var(--dpk-paper-raised);
751
+ }
752
+
753
+ header {
754
+ position: relative;
755
+ z-index: 1;
756
+ display: flex;
757
+ align-items: center;
758
+ justify-content: space-between;
759
+ gap: 8px;
760
+ padding: 14px 16px 12px;
761
+ border-bottom: 1px solid var(--dpk-rule);
762
+ background: var(--dpk-glass);
763
+ backdrop-filter: blur(12px);
764
+ box-shadow: 0 1px 0 var(--dpk-highlight) inset;
765
+ }
766
+
767
+ header h2 {
768
+ font-size: 13.5px;
769
+ font-weight: 660;
770
+ letter-spacing: -0.015em;
771
+ }
772
+
773
+ .composer {
774
+ display: grid;
775
+ gap: 10px;
776
+ padding: 14px 16px 14px;
777
+ border-bottom: 1px solid var(--dpk-rule);
778
+ background: var(--dpk-paper-sunken);
779
+ box-shadow: inset 0 1px 3px var(--dpk-shade-1);
780
+ }
781
+
782
+ .composer textarea {
783
+ min-height: 62px;
784
+ background: var(--dpk-paper-raised);
785
+ border-radius: var(--dpk-radius);
786
+ box-shadow:
787
+ var(--dpk-bevel),
788
+ inset 0 1px 2px var(--dpk-shade-1);
789
+ }
790
+
791
+ /* Wraps on a narrow rail rather than pushing the add button out of it. */
792
+ .composer .row {
793
+ display: flex;
794
+ flex-wrap: wrap;
795
+ align-items: center;
796
+ gap: 8px;
797
+ }
798
+
799
+ .composer .attach {
800
+ display: inline-flex;
801
+ align-items: center;
802
+ gap: 7px;
803
+ font-size: 12px;
804
+ color: var(--dpk-ink-soft);
805
+ cursor: pointer;
806
+ transition: color 140ms var(--dpk-ease);
807
+ }
808
+
809
+ .composer .attach:hover {
810
+ color: var(--dpk-ink);
811
+ }
812
+
813
+ .composer .attach input {
814
+ width: 14px;
815
+ height: 14px;
816
+ margin: 0;
817
+ accent-color: var(--dpk-accent);
818
+ cursor: pointer;
819
+ }
820
+
821
+ .composer .chip {
822
+ display: inline-flex;
823
+ align-items: center;
824
+ gap: 6px;
825
+ padding: 3px 10px;
826
+ border: 1px solid var(--dpk-rule-strong);
827
+ border-radius: 999px;
828
+ background: var(--dpk-paper-raised);
829
+ box-shadow: var(--dpk-shadow-xs);
830
+ font-size: 11.5px;
831
+ cursor: pointer;
832
+ transition:
833
+ border-color 140ms var(--dpk-ease),
834
+ box-shadow 140ms var(--dpk-ease),
835
+ transform 140ms var(--dpk-ease);
836
+ }
837
+
838
+ .composer .chip svg {
839
+ flex: none;
840
+ width: 12px;
841
+ height: 12px;
842
+ }
843
+
844
+ .composer .chip:hover {
845
+ border-color: color-mix(in srgb, var(--dpk-accent) 45%, var(--dpk-rule-strong));
846
+ box-shadow: var(--dpk-shadow-sm);
847
+ transform: translateY(-1px);
848
+ }
849
+
850
+ .target-line {
851
+ min-width: 0;
852
+ margin-right: auto;
853
+ overflow-wrap: anywhere;
854
+ padding: 3px 9px;
855
+ border-radius: 999px;
856
+ background: var(--dpk-paper-inset);
857
+ font-family: var(--dpk-mono);
858
+ font-size: 10px;
859
+ letter-spacing: 0.03em;
860
+ color: var(--dpk-ink-faint);
861
+ }
862
+
863
+ .list {
864
+ list-style: none;
865
+ margin: 0;
866
+ /* The page's hand-off dock may float over the bottom of the list. */
867
+ padding: 10px 12px calc(10px + var(--dpk-dock-clearance, 0px));
868
+ overflow: auto;
869
+ flex: 1;
870
+ min-height: 0;
871
+ display: grid;
872
+ /* One unbroken comment must not widen the column every item shares. */
873
+ grid-template-columns: minmax(0, 1fr);
874
+ gap: 8px;
875
+ align-content: start;
876
+ }
877
+
878
+ .item {
879
+ position: relative;
880
+ display: grid;
881
+ grid-template-columns: minmax(0, 1fr);
882
+ gap: 5px;
883
+ padding: 10px 12px 11px 16px;
884
+ border: 1px solid var(--dpk-rule);
885
+ border-radius: var(--dpk-radius);
886
+ background: var(--dpk-paper-raised);
887
+ box-shadow: var(--dpk-bevel), var(--dpk-shadow-xs);
888
+ transition:
889
+ box-shadow 160ms var(--dpk-ease),
890
+ border-color 160ms var(--dpk-ease),
891
+ transform 160ms var(--dpk-ease);
892
+ animation: dpk-item-in 200ms var(--dpk-ease) backwards;
893
+ }
894
+
895
+ @keyframes dpk-item-in {
896
+ from {
897
+ opacity: 0;
898
+ transform: translateY(3px);
899
+ }
900
+ }
901
+
902
+ .item:hover {
903
+ border-color: var(--dpk-rule-hover);
904
+ box-shadow: var(--dpk-bevel), var(--dpk-shadow-sm);
905
+ transform: translateY(-1px);
906
+ }
907
+
908
+ .item::before {
909
+ content: '';
910
+ position: absolute;
911
+ left: 0;
912
+ top: 10px;
913
+ bottom: 10px;
914
+ width: 3px;
915
+ border-radius: 0 2px 2px 0;
916
+ background: var(--tone, var(--dpk-ink-faint));
917
+ }
918
+
919
+ .item[data-tone='comment'] {
920
+ --tone: var(--dpk-accent);
921
+ background: linear-gradient(90deg, var(--dpk-accent-soft), transparent 55%), var(--dpk-paper-raised);
922
+ }
923
+
924
+ .item[data-tone='create'] {
925
+ --tone: var(--dpk-green);
926
+ }
927
+
928
+ .item[data-tone='update'] {
929
+ --tone: var(--dpk-blue);
930
+ }
931
+
932
+ .item[data-tone='delete'] {
933
+ --tone: var(--dpk-accent);
934
+ }
935
+
936
+ .item[data-tone='move'] {
937
+ --tone: var(--dpk-violet);
938
+ }
939
+
940
+ .item[data-stale='true'] {
941
+ opacity: 0.62;
942
+ border-style: dashed;
943
+ box-shadow: none;
944
+ transform: none;
945
+ }
946
+
947
+ .item-head {
948
+ display: flex;
949
+ align-items: center;
950
+ gap: 7px;
951
+ }
952
+
953
+ .item-icon {
954
+ display: inline-flex;
955
+ flex: none;
956
+ align-items: center;
957
+ justify-content: center;
958
+ width: 18px;
959
+ height: 18px;
960
+ border-radius: var(--dpk-radius-xs);
961
+ background: color-mix(in srgb, var(--tone, var(--dpk-ink-faint)) 16%, transparent);
962
+ color: var(--tone, var(--dpk-ink-faint));
963
+ }
964
+
965
+ .item-icon svg {
966
+ display: block;
967
+ width: 11px;
968
+ height: 11px;
969
+ }
970
+
971
+ .item-title {
972
+ font-size: 12.5px;
973
+ font-weight: 600;
974
+ letter-spacing: -0.005em;
975
+ }
976
+
977
+ .stale-badge {
978
+ padding: 1px 7px;
979
+ border: 1px solid color-mix(in srgb, var(--dpk-amber) 40%, transparent);
980
+ border-radius: 999px;
981
+ background: var(--dpk-amber-soft);
982
+ font-family: var(--dpk-mono);
983
+ font-size: 9px;
984
+ letter-spacing: 0.06em;
985
+ text-transform: uppercase;
986
+ color: var(--dpk-amber);
987
+ }
988
+
989
+ .item-head .dpk-icon-btn {
990
+ margin-left: auto;
991
+ }
992
+
993
+ /* Edit and delete sit together at the end of the row. */
994
+ .item-head .item-edit + .dpk-icon-btn {
995
+ margin-left: -4px;
996
+ }
997
+
998
+ .item-target {
999
+ display: inline-flex;
1000
+ align-items: center;
1001
+ width: fit-content;
1002
+ padding: 1px 7px;
1003
+ border-radius: var(--dpk-radius-xs);
1004
+ background: var(--dpk-paper-sunken);
1005
+ font-family: var(--dpk-mono);
1006
+ font-size: 10px;
1007
+ color: var(--dpk-ink-faint);
1008
+ overflow-wrap: anywhere;
1009
+ }
1010
+
1011
+ .item-summary {
1012
+ font-size: 12px;
1013
+ color: var(--dpk-ink-soft);
1014
+ }
1015
+
1016
+ .item-body {
1017
+ margin: 2px 0 0;
1018
+ padding-left: 9px;
1019
+ border-left: 2px solid var(--dpk-accent);
1020
+ font-size: 12.5px;
1021
+ white-space: pre-wrap;
1022
+ overflow-wrap: anywhere;
1023
+ }
1024
+
1025
+ .item-editor {
1026
+ display: grid;
1027
+ gap: 8px;
1028
+ margin-top: 2px;
1029
+ }
1030
+
1031
+ .item-editor textarea {
1032
+ min-height: 62px;
1033
+ background: var(--dpk-paper-raised);
1034
+ border-radius: var(--dpk-radius);
1035
+ }
1036
+
1037
+ .item-editor-actions {
1038
+ display: flex;
1039
+ justify-content: flex-end;
1040
+ gap: 6px;
1041
+ }
1042
+
1043
+ .item-code {
1044
+ margin-top: 2px;
1045
+ padding: 5px 7px;
1046
+ border-radius: var(--dpk-radius-xs);
1047
+ background: var(--dpk-paper-sunken);
1048
+ font-family: var(--dpk-mono);
1049
+ font-size: 10px;
1050
+ color: var(--dpk-ink-faint);
1051
+ overflow-wrap: anywhere;
1052
+ }
1053
+
1054
+ .empty {
1055
+ padding: 4px;
1056
+ }
1057
+
1058
+ .empty-box {
1059
+ display: grid;
1060
+ justify-items: center;
1061
+ gap: 6px;
1062
+ padding: 26px 16px;
1063
+ border: 1px dashed var(--dpk-rule-strong);
1064
+ border-radius: var(--dpk-radius-lg);
1065
+ background: var(--dpk-paper-sunken);
1066
+ text-align: center;
1067
+ }
1068
+
1069
+ .empty-box svg {
1070
+ width: 20px;
1071
+ height: 20px;
1072
+ color: var(--dpk-ink-faint);
1073
+ opacity: 0.7;
1074
+ }
1075
+
1076
+ .empty-box p {
1077
+ margin: 0;
1078
+ font-size: 12px;
1079
+ line-height: 1.6;
1080
+ color: var(--dpk-ink-soft);
1081
+ }
1082
+
1083
+ .empty-box .empty-hint {
1084
+ max-width: 30ch;
1085
+ color: var(--dpk-ink-faint);
1086
+ }
1087
+
1088
+ .issues {
1089
+ margin: 10px 12px 0;
1090
+ padding: 9px 11px 9px 13px;
1091
+ border: 1px solid color-mix(in srgb, var(--dpk-danger) 35%, transparent);
1092
+ border-radius: var(--dpk-radius-sm);
1093
+ background: linear-gradient(90deg, var(--dpk-danger) 0 3px, transparent 3px), var(--dpk-danger-soft);
1094
+ font-size: 11.5px;
1095
+ }
1096
+
1097
+ .issues strong {
1098
+ color: var(--dpk-danger);
1099
+ }
1100
+
1101
+ .issues ul {
1102
+ margin: 4px 0 0;
1103
+ padding-left: 16px;
1104
+ color: var(--dpk-ink-soft);
1105
+ }
1106
+
1107
+ footer {
1108
+ display: flex;
1109
+ flex-wrap: wrap;
1110
+ align-items: center;
1111
+ gap: 8px;
1112
+ padding: 12px 16px;
1113
+ border-top: 1px solid var(--dpk-rule);
1114
+ background: var(--dpk-glass);
1115
+ backdrop-filter: blur(12px);
1116
+ }
1117
+
1118
+ .footer-actions {
1119
+ display: flex;
1120
+ align-items: center;
1121
+ gap: 6px;
1122
+ flex-wrap: wrap;
1123
+ margin-left: auto;
1124
+ }
1125
+
1126
+ .flash {
1127
+ font-family: var(--dpk-mono);
1128
+ font-size: 10px;
1129
+ letter-spacing: 0.04em;
1130
+ color: var(--dpk-green);
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=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
+ viewBox="0 0 24 24"
1134
+ fill="none"
1135
+ stroke="currentColor"
1136
+ stroke-width="2"
1137
+ stroke-linecap="round"
1138
+ stroke-linejoin="round"
1139
+ aria-hidden="true"
1140
+ focusable="false"
1141
+ >
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
+ ${s?m:b`<header><h2>${t.heading}</h2></header>`}
1145
+ ${e.issues.length>0?b`<div class="issues" role="alert">
1146
+ <strong>${t.rejected}</strong>
1147
+ <ul>
1148
+ ${e.issues.map(i=>b`<li>${i}</li>`)}
1149
+ </ul>
1150
+ </div>`:m}
1151
+ <div class="composer">
1152
+ <textarea
1153
+ class="dpk-textarea"
1154
+ aria-label=${t.commentLabel}
1155
+ placeholder=${t.commentPlaceholder}
1156
+ .value=${e.body}
1157
+ @input=${i=>{i.currentTarget instanceof HTMLTextAreaElement&&n({kind:"input",body:i.currentTarget.value})}}
1158
+ @keydown=${i=>{!i.isComposing&&i.key==="Enter"&&(i.metaKey||i.ctrlKey)&&(i.preventDefault(),n({kind:"submit"}))}}
1159
+ ></textarea>
1160
+ ${e.attachment.kind==="explicit"?b`<div class="row">
1161
+ <button class="chip" type="button" aria-label=${t.detach} @click=${()=>n({kind:"clear-target"})}>
1162
+ ${e.target.label} ${qt()}
1163
+ </button>
1164
+ </div>`:e.attachment.kind==="checkbox"?b`<div class="row">
1165
+ <label class="attach">
1166
+ <input
1167
+ type="checkbox"
1168
+ .checked=${e.attachment.checked}
1169
+ @change=${i=>{i.currentTarget instanceof HTMLInputElement&&n({kind:"attach",current:i.currentTarget.checked})}}
1170
+ />
1171
+ <span>${t.attachTo(e.attachment.group)}</span>
1172
+ </label>
1173
+ </div>`:m}
1174
+ <div class="row">
1175
+ <span class="target-line">→ ${e.target.label}</span>
1176
+ <button
1177
+ class="dpk-btn dpk-btn--accent"
1178
+ type="button"
1179
+ ?disabled=${!e.canSubmit}
1180
+ @click=${()=>n({kind:"submit"})}
1181
+ >
1182
+ ${t.addNote}
1183
+ </button>
1184
+ </div>
1185
+ </div>
1186
+ <ul class="list">
1187
+ ${e.items.length===0?b`<li class="empty">
1188
+ <div class="empty-box">
1189
+ ${Zn()}
1190
+ <p>${t.empty}</p>
1191
+ <p class="empty-hint">${t.emptyHint}</p>
1192
+ </div>
1193
+ </li>`:jt(e.items,i=>i.id,i=>Fc(t,i,n))}
1194
+ </ul>
1195
+ <footer>
1196
+ ${s||e.send==="hidden"?m:b`<button
1197
+ class="dpk-btn dpk-btn--accent"
1198
+ type="button"
1199
+ ?disabled=${e.send==="disabled"}
1200
+ @click=${()=>n({kind:"send"})}
1201
+ >
1202
+ ${t.sendToClaude}
1203
+ </button>`}
1204
+ <div class="footer-actions">
1205
+ ${s?m:b`<button
1206
+ class=${e.send==="hidden"?"dpk-btn dpk-btn--accent":"dpk-btn"}
1207
+ type="button"
1208
+ title=${t.copyTitle}
1209
+ ?disabled=${e.items.length===0}
1210
+ @click=${()=>n({kind:"copy"})}
1211
+ >
1212
+ ${t.copy}
1213
+ </button>`}
1214
+ <button
1215
+ class="dpk-btn dpk-btn--ghost"
1216
+ type="button"
1217
+ ?disabled=${e.items.length===0}
1218
+ @click=${()=>n({kind:"clear"})}
1219
+ >
1220
+ ${t.clear}
1221
+ </button>
1222
+ </div>
1223
+ ${e.flash?b`<span class="flash" role="status">${e.flash}</span>`:m}
1224
+ </footer>
1225
+ `,Fc=(t,e,n)=>b`
1226
+ <li class="item" data-tone=${e.tone} data-stale=${String(e.stale!==null)} data-id=${e.id}>
1227
+ <div class="item-head">
1228
+ <span class="item-icon">${Uc(e.tone)}</span>
1229
+ <span class="item-title">${e.title}</span>
1230
+ ${e.stale?b`<span class="stale-badge">${e.stale}</span>`:m}
1231
+ ${e.edit.kind==="available"?b`<button
1232
+ class="dpk-icon-btn item-edit"
1233
+ type="button"
1234
+ aria-label=${t.editComment}
1235
+ title=${t.editComment}
1236
+ @click=${()=>n({kind:"edit-start",id:e.id,body:e.text.body})}
1237
+ >
1238
+ ${Kn()}
1239
+ </button>`:m}
1240
+ <button
1241
+ class="dpk-icon-btn"
1242
+ type="button"
1243
+ aria-label=${t.deleteAction}
1244
+ @click=${()=>n({kind:"delete",id:e.id})}
1245
+ >
1246
+ ${qt()}
1247
+ </button>
1248
+ </div>
1249
+ <div class="item-target">${e.targetLabel}</div>
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
+ ${e.code===null?m:b`<code class="item-code">${e.code}</code>`}
1252
+ </li>
1253
+ `,Wc=(t,e,n)=>b`
1254
+ <div class="item-editor">
1255
+ <textarea
1256
+ class="dpk-textarea"
1257
+ aria-label=${t.editLabel}
1258
+ title=${t.editHint}
1259
+ .value=${e.body}
1260
+ @input=${s=>{s.currentTarget instanceof HTMLTextAreaElement&&n({kind:"edit-input",body:s.currentTarget.value})}}
1261
+ @keydown=${s=>{s.isComposing||(s.key==="Enter"&&(s.metaKey||s.ctrlKey)?(s.preventDefault(),n({kind:"edit-save"})):s.key==="Escape"&&(s.preventDefault(),s.stopPropagation(),n({kind:"edit-cancel"})))}}
1262
+ ></textarea>
1263
+ <div class="row item-editor-actions">
1264
+ <button class="dpk-btn dpk-btn--ghost" type="button" @click=${()=>n({kind:"edit-cancel"})}>
1265
+ ${t.cancelEdit}
1266
+ </button>
1267
+ <button
1268
+ class="dpk-btn dpk-btn--accent"
1269
+ type="button"
1270
+ ?disabled=${!e.canSave}
1271
+ @click=${()=>n({kind:"edit-save"})}
1272
+ >
1273
+ ${t.saveEdit}
1274
+ </button>
1275
+ </div>
1276
+ </div>
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
+ .${is} {
1279
+ flex: none;
1280
+ height: 24px;
1281
+ margin-left: auto;
1282
+ padding: 0 22px 0 10px;
1283
+ border: 1px solid var(--dpk-rule, #8884);
1284
+ border-radius: 999px;
1285
+ background: var(--dpk-paper-sunken, transparent)
1286
+ url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 12 12'><path d='M3 4.5 6 7.5 9 4.5' fill='none' stroke='%23878e9e' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/></svg>")
1287
+ no-repeat right 8px center;
1288
+ appearance: none;
1289
+ field-sizing: content;
1290
+ color: var(--dpk-ink-soft, inherit);
1291
+ font-family: var(--dpk-mono, ui-monospace, monospace);
1292
+ font-size: 10px;
1293
+ letter-spacing: 0.02em;
1294
+ cursor: pointer;
1295
+ }
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
+ class="dpk-bell"
1298
+ type="button"
1299
+ aria-controls=${en}
1300
+ aria-expanded=${t.open?"true":"false"}
1301
+ aria-label=${s}
1302
+ title=${s}
1303
+ @click=${n.toggleList}
1304
+ >
1305
+ ${ar()} ${t.unread>0?b`<span class="dpk-bell-badge" aria-hidden="true">${t.unread}</span>`:m}
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
+ ${e.changesShow}
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
+ <p class="dpk-changes-head"><strong>${n.changesTitle}</strong> <span>${e}</span></p>
1310
+ <ol class="dpk-changes-list">
1311
+ ${jt(t.cards,i=>i.key,i=>b`<li class="dpk-change" data-key=${i.key} ?data-fresh=${i.fresh}>
1312
+ <p class="dpk-change-title">
1313
+ ${i.fresh?b`<span class="dpk-change-new">${n.changesNew}</span>`:m} ${i.title}
1314
+ </p>
1315
+ ${i.body===null?m:b`<p class="dpk-change-body">${i.body}</p>`} ${ro(i,n,s)}
1316
+ </li>`)}
1317
+ </ol>
1318
+ </div>`:m,ch=(t,e,n)=>b`<section
1319
+ class="dpk-toasts"
1320
+ aria-live="polite"
1321
+ aria-label=${e.changes}
1322
+ @pointerenter=${()=>n.pause("pointer")}
1323
+ @pointerleave=${()=>n.resume("pointer")}
1324
+ @focusin=${()=>n.pause("focus")}
1325
+ @focusout=${()=>n.resume("focus")}
1326
+ >
1327
+ ${jt(t.toasts,s=>s.key,s=>b`<div class="dpk-toast" data-key=${s.key}>
1328
+ <span class="dpk-toast-icon" aria-hidden="true">${ar()}</span>
1329
+ <div class="dpk-toast-text">
1330
+ <p class="dpk-change-title">${s.title}</p>
1331
+ ${s.body===null?m:b`<p class="dpk-change-body">${s.body}</p>`}
1332
+ </div>
1333
+ ${ro(s,e,n)}
1334
+ <button
1335
+ class="dpk-toast-close"
1336
+ type="button"
1337
+ aria-label=${e.changesDismiss}
1338
+ title=${e.changesDismiss}
1339
+ @click=${()=>n.dismiss(s.key)}
1340
+ >
1341
+ ${qt()}
1342
+ </button>
1343
+ </div>`)}
1344
+ ${t.waiting>0?b`<button class="dpk-toast-more" type="button" @click=${n.openList}>
1345
+ ${e.changesWaiting(t.waiting)} · ${e.changesSeeAll}
1346
+ </button>`:m}
1347
+ </section>`,us=(t,e)=>typeof t=="object"&&t!==null&&e.every(n=>typeof Reflect.get(t,n)=="function"),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
+ :host {
1349
+ display: block;
1350
+ min-height: 100%;
1351
+ background: var(--dpk-paper);
1352
+ color-scheme: light;
1353
+ }
1354
+
1355
+ /* The element stamps its resolved scheme; nested components inherit it. */
1356
+ :host([data-theme='dark']) {
1357
+ color-scheme: dark;
1358
+ }
1359
+
1360
+ .dpk-shell {
1361
+ display: grid;
1362
+ /* One column no wider than the host: a truncated title must not widen
1363
+ the page past a phone screen. */
1364
+ grid-template-columns: minmax(0, 1fr);
1365
+ grid-template-rows: auto minmax(0, 1fr) auto;
1366
+ min-height: 100%;
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));
1377
+ }
1378
+
1379
+ /* ------------------------------------------------------------- header */
1380
+
1381
+ .dpk-header {
1382
+ position: relative;
1383
+ z-index: 20;
1384
+ display: flex;
1385
+ flex-wrap: wrap;
1386
+ align-items: center;
1387
+ gap: 8px 14px;
1388
+ min-height: 60px;
1389
+ /* Right padding keeps the header content clear of the fixed review button. */
1390
+ padding: 10px 72px 10px 16px;
1391
+ border-bottom: 1px solid var(--dpk-rule);
1392
+ background: var(--dpk-glass);
1393
+ backdrop-filter: saturate(1.6) blur(14px);
1394
+ box-shadow: 0 1px 0 var(--dpk-highlight) inset;
1395
+ }
1396
+
1397
+ /* A hairline of the accent along the bottom edge, fading out to the right. */
1398
+ .dpk-header::after {
1399
+ content: '';
1400
+ position: absolute;
1401
+ left: 0;
1402
+ right: 0;
1403
+ bottom: -1px;
1404
+ height: 1px;
1405
+ background: linear-gradient(
1406
+ 90deg,
1407
+ color-mix(in srgb, var(--dpk-accent) 70%, transparent),
1408
+ color-mix(in srgb, var(--dpk-accent) 0%, transparent) 38%
1409
+ );
1410
+ pointer-events: none;
1411
+ }
1412
+
1413
+ /* Kit mark: a stack of pages, the single HTML page the agent wrote. */
1414
+ .dpk-brand {
1415
+ position: relative;
1416
+ flex: none;
1417
+ width: 32px;
1418
+ height: 32px;
1419
+ border-radius: 9px;
1420
+ background:
1421
+ radial-gradient(circle at 30% 20%, rgba(255, 255, 255, 0.35), transparent 60%),
1422
+ linear-gradient(145deg, var(--dpk-accent-bright), var(--dpk-accent-strong));
1423
+ box-shadow:
1424
+ inset 0 1px 0 rgba(255, 255, 255, 0.3),
1425
+ inset 0 -1px 0 rgba(0, 0, 0, 0.12),
1426
+ 0 4px 12px -4px color-mix(in srgb, var(--dpk-accent) 70%, transparent);
1427
+ }
1428
+
1429
+ .dpk-brand::before,
1430
+ .dpk-brand::after {
1431
+ content: '';
1432
+ position: absolute;
1433
+ width: 12px;
1434
+ height: 15px;
1435
+ border-radius: 3px;
1436
+ }
1437
+
1438
+ .dpk-brand::before {
1439
+ left: 12px;
1440
+ top: 7px;
1441
+ background: rgba(255, 255, 255, 0.4);
1442
+ }
1443
+
1444
+ .dpk-brand::after {
1445
+ left: 8px;
1446
+ top: 10px;
1447
+ background:
1448
+ linear-gradient(var(--dpk-accent), var(--dpk-accent)) 3px 4px / 6px 1.5px no-repeat,
1449
+ linear-gradient(var(--dpk-accent), var(--dpk-accent)) 3px 7.5px / 4px 1.5px no-repeat,
1450
+ #fff;
1451
+ box-shadow: 0 1px 3px rgba(0, 0, 0, 0.22);
1452
+ }
1453
+
1454
+ /* The title takes what the header has left: the template's header content
1455
+ keeps its own width, and only a title too long for the rest ellipsizes.
1456
+ Header content with no room beside the title wraps to a row of its own
1457
+ rather than being squeezed. */
1458
+ .dpk-title {
1459
+ flex: 1 1 0%;
1460
+ display: flex;
1461
+ flex-direction: column;
1462
+ gap: 3px;
1463
+ min-width: min(160px, 100%);
1464
+ }
1465
+
1466
+ .dpk-title h1 {
1467
+ font-size: 16px;
1468
+ font-weight: 680;
1469
+ letter-spacing: -0.02em;
1470
+ white-space: nowrap;
1471
+ overflow: hidden;
1472
+ text-overflow: ellipsis;
1473
+ }
1474
+
1475
+ .dpk-template-mark {
1476
+ align-self: flex-start;
1477
+ font-family: var(--dpk-mono);
1478
+ font-size: 9.5px;
1479
+ font-weight: 600;
1480
+ letter-spacing: 0.14em;
1481
+ line-height: 1;
1482
+ text-transform: uppercase;
1483
+ color: var(--dpk-accent);
1484
+ }
1485
+
1486
+ .dpk-header-slot {
1487
+ flex: 0 1 auto;
1488
+ min-width: 0;
1489
+ display: flex;
1490
+ align-items: center;
1491
+ gap: 10px;
1492
+ }
1493
+
1494
+ .dpk-header-meta {
1495
+ display: flex;
1496
+ align-items: center;
1497
+ gap: 0;
1498
+ margin-left: auto;
1499
+ padding: 3px;
1500
+ border-radius: 999px;
1501
+ border: 1px solid var(--dpk-rule);
1502
+ background: var(--dpk-paper-sunken);
1503
+ font-family: var(--dpk-mono);
1504
+ font-size: 10px;
1505
+ letter-spacing: 0.02em;
1506
+ color: var(--dpk-ink-faint);
1507
+ white-space: nowrap;
1508
+ }
1509
+
1510
+ .dpk-header-meta span {
1511
+ padding: 3px 9px;
1512
+ }
1513
+
1514
+ .dpk-header-meta span + span {
1515
+ border-left: 1px solid var(--dpk-rule);
1516
+ }
1517
+
1518
+ .dpk-version-select {
1519
+ margin: -3px 0;
1520
+ padding: 3px 14px 3px 0;
1521
+ border: 0;
1522
+ border-radius: 4px;
1523
+ background: transparent
1524
+ url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='8' height='8' viewBox='0 0 12 12'><path d='M3 4.5 6 7.5 9 4.5' fill='none' stroke='%23878e9e' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/></svg>")
1525
+ no-repeat right 2px center;
1526
+ appearance: none;
1527
+ /* As wide as the version shown, not the longest prerelease in the list. */
1528
+ field-sizing: content;
1529
+ color: inherit;
1530
+ font: inherit;
1531
+ letter-spacing: inherit;
1532
+ cursor: pointer;
1533
+ }
1534
+
1535
+ .dpk-version-select:hover {
1536
+ color: var(--dpk-ink-soft);
1537
+ }
1538
+
1539
+ .dpk-version-select:focus-visible {
1540
+ outline: none;
1541
+ box-shadow: var(--dpk-focus);
1542
+ }
1543
+
1544
+ .dpk-header-meta .dpk-meta-count {
1545
+ margin-left: 2px;
1546
+ border-left: 0;
1547
+ border-radius: 999px;
1548
+ background: var(--dpk-paper-raised);
1549
+ color: var(--dpk-ink-soft);
1550
+ box-shadow: var(--dpk-bevel), var(--dpk-shadow-xs);
1551
+ }
1552
+
1553
+ .dpk-header-meta .dpk-meta-count[data-active='true'] {
1554
+ background: var(--dpk-accent-soft);
1555
+ color: var(--dpk-accent);
1556
+ box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--dpk-accent) 25%, transparent);
1557
+ }
1558
+
1559
+ .dpk-header-tools {
1560
+ display: flex;
1561
+ flex: none;
1562
+ align-items: center;
1563
+ gap: 2px;
1564
+ padding: 3px;
1565
+ border: 1px solid var(--dpk-rule);
1566
+ border-radius: 999px;
1567
+ background: var(--dpk-paper-sunken);
1568
+ }
1569
+
1570
+ .dpk-lang-select {
1571
+ flex: none;
1572
+ height: 26px;
1573
+ padding: 0 24px 0 10px;
1574
+ border: 0;
1575
+ border-radius: 999px;
1576
+ background: transparent
1577
+ url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 12 12'><path d='M3 4.5 6 7.5 9 4.5' fill='none' stroke='%23878e9e' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/></svg>")
1578
+ no-repeat right 8px center;
1579
+ appearance: none;
1580
+ color: var(--dpk-ink-soft);
1581
+ font: inherit;
1582
+ font-size: 12px;
1583
+ font-weight: 520;
1584
+ cursor: pointer;
1585
+ transition:
1586
+ color 160ms var(--dpk-ease),
1587
+ background-color 160ms var(--dpk-ease);
1588
+ }
1589
+
1590
+ .dpk-lang-select:hover {
1591
+ color: var(--dpk-ink);
1592
+ background-color: var(--dpk-paper-raised);
1593
+ }
1594
+
1595
+ .dpk-lang-select:focus-visible {
1596
+ outline: none;
1597
+ box-shadow: var(--dpk-focus);
1598
+ }
1599
+
1600
+ .dpk-theme-toggle {
1601
+ display: inline-flex;
1602
+ flex: none;
1603
+ align-items: center;
1604
+ justify-content: center;
1605
+ width: 26px;
1606
+ height: 26px;
1607
+ padding: 0;
1608
+ border: 0;
1609
+ border-radius: 999px;
1610
+ background: transparent;
1611
+ color: var(--dpk-ink-soft);
1612
+ cursor: pointer;
1613
+ transition:
1614
+ color 160ms var(--dpk-ease),
1615
+ background 160ms var(--dpk-ease),
1616
+ transform 300ms var(--dpk-ease-spring);
1617
+ }
1618
+
1619
+ .dpk-theme-toggle svg {
1620
+ width: 14px;
1621
+ height: 14px;
1622
+ }
1623
+
1624
+ .dpk-theme-toggle:hover {
1625
+ color: var(--dpk-ink);
1626
+ background: var(--dpk-paper-raised);
1627
+ transform: rotate(-18deg);
1628
+ }
1629
+
1630
+ .dpk-theme-toggle:focus-visible {
1631
+ outline: none;
1632
+ box-shadow: var(--dpk-focus);
1633
+ }
1634
+
1635
+ /* ------------------------------------------------------------ changes */
1636
+
1637
+ .dpk-bell {
1638
+ position: relative;
1639
+ display: inline-flex;
1640
+ flex: none;
1641
+ align-items: center;
1642
+ justify-content: center;
1643
+ width: 26px;
1644
+ height: 26px;
1645
+ padding: 0;
1646
+ border: 0;
1647
+ border-radius: 999px;
1648
+ background: transparent;
1649
+ color: var(--dpk-ink-soft);
1650
+ cursor: pointer;
1651
+ transition:
1652
+ color 160ms var(--dpk-ease),
1653
+ background 160ms var(--dpk-ease);
1654
+ }
1655
+
1656
+ .dpk-bell svg {
1657
+ width: 14px;
1658
+ height: 14px;
1659
+ }
1660
+
1661
+ .dpk-bell:hover,
1662
+ .dpk-bell[aria-expanded='true'] {
1663
+ color: var(--dpk-ink);
1664
+ background: var(--dpk-paper-raised);
1665
+ }
1666
+
1667
+ .dpk-bell:focus-visible {
1668
+ outline: none;
1669
+ box-shadow: var(--dpk-focus);
1670
+ }
1671
+
1672
+ .dpk-bell-badge {
1673
+ position: absolute;
1674
+ top: -5px;
1675
+ right: -5px;
1676
+ min-width: 16px;
1677
+ height: 16px;
1678
+ padding: 0 3px;
1679
+ border: 2px solid var(--dpk-paper);
1680
+ border-radius: 999px;
1681
+ background: linear-gradient(145deg, var(--dpk-accent-bright), var(--dpk-accent));
1682
+ color: var(--dpk-accent-ink);
1683
+ font-family: var(--dpk-mono);
1684
+ font-size: 9px;
1685
+ font-weight: 650;
1686
+ font-variant-numeric: tabular-nums;
1687
+ line-height: 12px;
1688
+ text-align: center;
1689
+ animation: dpk-pop 260ms var(--dpk-ease-spring);
1690
+ }
1691
+
1692
+ .dpk-changes {
1693
+ box-sizing: border-box;
1694
+ overflow: auto;
1695
+ position: fixed;
1696
+ inset: auto;
1697
+ margin: 0;
1698
+ padding: 12px;
1699
+ border: 1px solid var(--dpk-rule-strong);
1700
+ border-radius: var(--dpk-radius-lg);
1701
+ background: var(--dpk-paper-raised);
1702
+ box-shadow: var(--dpk-bevel), var(--dpk-shadow-lg);
1703
+ color: var(--dpk-ink);
1704
+ font-size: 12.5px;
1705
+ animation: dpk-notice-in 180ms var(--dpk-ease);
1706
+ }
1707
+
1708
+ .dpk-changes-head {
1709
+ display: flex;
1710
+ align-items: baseline;
1711
+ justify-content: space-between;
1712
+ gap: 8px;
1713
+ margin: 0 2px 10px;
1714
+ }
1715
+
1716
+ .dpk-changes-head span {
1717
+ overflow: hidden;
1718
+ color: var(--dpk-ink-faint);
1719
+ font-family: var(--dpk-mono);
1720
+ font-size: 11px;
1721
+ text-overflow: ellipsis;
1722
+ white-space: nowrap;
1723
+ }
1724
+
1725
+ .dpk-changes-list {
1726
+ display: grid;
1727
+ gap: 6px;
1728
+ margin: 0;
1729
+ padding: 0;
1730
+ list-style: none;
1731
+ }
1732
+
1733
+ .dpk-change {
1734
+ display: grid;
1735
+ gap: 4px;
1736
+ padding: 9px 10px;
1737
+ border: 1px solid var(--dpk-rule);
1738
+ border-radius: var(--dpk-radius);
1739
+ background: var(--dpk-paper);
1740
+ }
1741
+
1742
+ .dpk-change[data-fresh] {
1743
+ border-color: color-mix(in srgb, var(--dpk-accent) 35%, transparent);
1744
+ background: var(--dpk-accent-soft);
1745
+ }
1746
+
1747
+ .dpk-change .dpk-notice-show {
1748
+ justify-self: end;
1749
+ }
1750
+
1751
+ .dpk-change-title {
1752
+ margin: 0;
1753
+ font-weight: 600;
1754
+ line-height: 1.4;
1755
+ overflow-wrap: anywhere;
1756
+ }
1757
+
1758
+ .dpk-change-new {
1759
+ margin-right: 4px;
1760
+ padding: 1px 6px;
1761
+ border-radius: 999px;
1762
+ background: var(--dpk-accent);
1763
+ color: var(--dpk-accent-ink);
1764
+ font-size: 10px;
1765
+ font-weight: 650;
1766
+ vertical-align: 1px;
1767
+ }
1768
+
1769
+ .dpk-change-body {
1770
+ margin: 0;
1771
+ color: var(--dpk-ink-soft);
1772
+ line-height: 1.5;
1773
+ white-space: pre-line;
1774
+ overflow-wrap: anywhere;
1775
+ }
1776
+
1777
+ /* Below the review button, at the top right where the bell is. */
1778
+ .dpk-toasts {
1779
+ position: fixed;
1780
+ top: 64px;
1781
+ right: 16px;
1782
+ z-index: 70;
1783
+ display: grid;
1784
+ justify-items: end;
1785
+ gap: 8px;
1786
+ width: min(360px, calc(100vw - 32px));
1787
+ pointer-events: none;
1788
+ }
1789
+
1790
+ .dpk-toast {
1791
+ box-sizing: border-box;
1792
+ display: grid;
1793
+ grid-template-columns: auto minmax(0, 1fr) auto auto;
1794
+ align-items: start;
1795
+ gap: 10px;
1796
+ width: 100%;
1797
+ padding: 10px 8px 10px 12px;
1798
+ border: 1px solid var(--dpk-rule-strong);
1799
+ border-radius: var(--dpk-radius-lg);
1800
+ background: var(--dpk-paper-raised);
1801
+ box-shadow: var(--dpk-bevel), var(--dpk-shadow-lg);
1802
+ color: var(--dpk-ink);
1803
+ font-size: 12.5px;
1804
+ pointer-events: auto;
1805
+ animation: dpk-notice-in 260ms var(--dpk-ease);
1806
+ }
1807
+
1808
+ .dpk-toast-icon {
1809
+ display: inline-flex;
1810
+ padding-top: 2px;
1811
+ color: var(--dpk-accent);
1812
+ }
1813
+
1814
+ .dpk-toast-icon svg {
1815
+ width: 14px;
1816
+ height: 14px;
1817
+ }
1818
+
1819
+ .dpk-toast-text {
1820
+ display: grid;
1821
+ gap: 2px;
1822
+ }
1823
+
1824
+ .dpk-toast .dpk-change-body {
1825
+ display: -webkit-box;
1826
+ overflow: hidden;
1827
+ -webkit-box-orient: vertical;
1828
+ -webkit-line-clamp: 2;
1829
+ }
1830
+
1831
+ .dpk-toast-close {
1832
+ display: inline-flex;
1833
+ align-items: center;
1834
+ justify-content: center;
1835
+ width: 22px;
1836
+ height: 22px;
1837
+ padding: 0;
1838
+ border: 0;
1839
+ border-radius: 999px;
1840
+ background: transparent;
1841
+ color: var(--dpk-ink-faint);
1842
+ cursor: pointer;
1843
+ }
1844
+
1845
+ .dpk-toast-close svg {
1846
+ width: 12px;
1847
+ height: 12px;
1848
+ }
1849
+
1850
+ .dpk-toast-close:hover {
1851
+ color: var(--dpk-ink);
1852
+ background: var(--dpk-paper-sunken);
1853
+ }
1854
+
1855
+ .dpk-toast-close:focus-visible {
1856
+ outline: none;
1857
+ box-shadow: var(--dpk-focus);
1858
+ }
1859
+
1860
+ .dpk-toast-more {
1861
+ padding: 4px 10px;
1862
+ border: 1px solid var(--dpk-rule-strong);
1863
+ border-radius: 999px;
1864
+ background: var(--dpk-paper-raised);
1865
+ color: var(--dpk-ink-soft);
1866
+ font: inherit;
1867
+ font-size: 11.5px;
1868
+ cursor: pointer;
1869
+ pointer-events: auto;
1870
+ }
1871
+
1872
+ .dpk-toast-more:hover {
1873
+ color: var(--dpk-ink);
1874
+ }
1875
+
1876
+ .dpk-toast-more:focus-visible {
1877
+ outline: none;
1878
+ box-shadow: var(--dpk-focus);
1879
+ }
1880
+
1881
+ @keyframes dpk-notice-in {
1882
+ from {
1883
+ opacity: 0;
1884
+ transform: translateY(-6px) scale(0.98);
1885
+ }
1886
+ }
1887
+
1888
+ /* --------------------------------------------------------------- body */
1889
+
1890
+ /* Positioned: the sidebar drawer and a narrow screen's review open over it. */
1891
+ .dpk-body {
1892
+ position: relative;
1893
+ display: flex;
1894
+ min-height: 0;
1895
+ }
1896
+
1897
+ .dpk-sidebar {
1898
+ /* The element sets the template's or the reader's width; on a narrow
1899
+ screen a wide one still leaves the main column some room. */
1900
+ width: var(--dpk-sidebar-width);
1901
+ max-width: calc(100% - 120px);
1902
+ flex: 0 0 auto;
1903
+ border-right: 1px solid var(--dpk-rule);
1904
+ background: var(--dpk-paper-sunken);
1905
+ overflow: auto;
1906
+ padding: 18px 14px;
1907
+ scrollbar-width: thin;
1908
+ }
1909
+
1910
+ .dpk-sidebar[hidden] {
1911
+ display: none;
1912
+ }
1913
+
1914
+ /*
1915
+ * A right-hand sidebar: a rail beside the main column rather than a list
1916
+ * before it. \`:where\` keeps these as weak as the rules above, so a
1917
+ * template can still restyle the rail (stacking it on a phone, say).
1918
+ */
1919
+ :where(.dpk-body[data-sidebar-side='right']) .dpk-main {
1920
+ order: 1;
1921
+ }
1922
+
1923
+ :where(.dpk-body[data-sidebar-side='right']) .dpk-sidebar,
1924
+ :where(.dpk-body[data-sidebar-side='right']) .dpk-sidebar-resizer,
1925
+ :where(.dpk-body[data-sidebar-side='right']) .dpk-sidebar-toggle,
1926
+ :where(.dpk-body[data-sidebar-side='right']) .dpk-sidebar-strip {
1927
+ order: 2;
1928
+ }
1929
+
1930
+ :where(.dpk-body[data-sidebar-side='right']) .dpk-sidebar,
1931
+ :where(.dpk-body[data-sidebar-side='right']) .dpk-sidebar-strip {
1932
+ border-right: 0;
1933
+ border-left: 1px solid var(--dpk-rule);
1934
+ }
1935
+
1936
+ /*
1937
+ * The fold button. Expanded, it sits on the sidebar's border near the top
1938
+ * and, like the resizer, takes no room of its own; folded, it is the only
1939
+ * thing left in a narrow strip where the sidebar was.
1940
+ */
1941
+ .dpk-sidebar-toggle {
1942
+ position: relative;
1943
+ z-index: 7;
1944
+ display: inline-flex;
1945
+ flex: none;
1946
+ align-self: flex-start;
1947
+ align-items: center;
1948
+ justify-content: center;
1949
+ width: 22px;
1950
+ height: 22px;
1951
+ margin: 14px -11px 0;
1952
+ padding: 0;
1953
+ border: 1px solid var(--dpk-rule-strong);
1954
+ border-radius: 999px;
1955
+ background: var(--dpk-paper-raised);
1956
+ color: var(--dpk-ink-soft);
1957
+ box-shadow: var(--dpk-bevel), var(--dpk-shadow-xs);
1958
+ cursor: pointer;
1959
+ transition:
1960
+ color 160ms var(--dpk-ease),
1961
+ border-color 160ms var(--dpk-ease),
1962
+ background 160ms var(--dpk-ease);
1963
+ }
1964
+
1965
+ .dpk-sidebar-toggle svg {
1966
+ width: 13px;
1967
+ height: 13px;
1968
+ }
1969
+
1970
+ .dpk-sidebar-toggle:hover {
1971
+ color: var(--dpk-accent);
1972
+ border-color: color-mix(in srgb, var(--dpk-accent) 45%, transparent);
1973
+ }
1974
+
1975
+ .dpk-sidebar-toggle:focus-visible {
1976
+ outline: none;
1977
+ box-shadow: var(--dpk-focus);
1978
+ }
1979
+
1980
+ .dpk-sidebar-strip {
1981
+ display: flex;
1982
+ flex: none;
1983
+ justify-content: center;
1984
+ width: 36px;
1985
+ padding-top: 14px;
1986
+ border-right: 1px solid var(--dpk-rule);
1987
+ background: var(--dpk-paper-sunken);
1988
+ }
1989
+
1990
+ .dpk-sidebar-strip .dpk-sidebar-toggle {
1991
+ margin: 0;
1992
+ }
1993
+
1994
+ /*
1995
+ * The sidebar's resizable edge: a hit area straddling its border that takes
1996
+ * no room of its own, with an accent line while hovered, focused or dragged.
1997
+ */
1998
+ .dpk-sidebar-resizer {
1999
+ position: relative;
2000
+ z-index: 6;
2001
+ flex: none;
2002
+ width: 9px;
2003
+ /* Centred on the sidebar's border, whichever side that is. */
2004
+ margin: 0 -5px 0 -4px;
2005
+ cursor: col-resize;
2006
+ touch-action: none;
2007
+ }
2008
+
2009
+ .dpk-sidebar-resizer::after {
2010
+ content: '';
2011
+ position: absolute;
2012
+ top: 0;
2013
+ bottom: 0;
2014
+ left: 3px;
2015
+ width: 2px;
2016
+ border-radius: 1px;
2017
+ background: var(--dpk-accent);
2018
+ opacity: 0;
2019
+ transition: opacity 160ms var(--dpk-ease);
2020
+ }
2021
+
2022
+ .dpk-sidebar-resizer:hover::after,
2023
+ .dpk-sidebar-resizer:focus-visible::after,
2024
+ .dpk-shell[data-resizing] .dpk-sidebar-resizer::after {
2025
+ opacity: 1;
2026
+ }
2027
+
2028
+ .dpk-sidebar-resizer:focus-visible {
2029
+ outline: none;
2030
+ }
2031
+
2032
+ /*
2033
+ * A phone-width screen has no room for a column beside the main one: the
2034
+ * sidebar is a drawer that the strip's button slides over the main column,
2035
+ * leaving a sliver of it to tap the drawer shut.
2036
+ */
2037
+ .dpk-body[data-sidebar-drawer] > .dpk-sidebar {
2038
+ position: absolute;
2039
+ top: 0;
2040
+ bottom: 0;
2041
+ left: 36px;
2042
+ z-index: 25;
2043
+ width: min(var(--dpk-sidebar-width), calc(100% - 36px - 48px));
2044
+ max-width: none;
2045
+ box-shadow: var(--dpk-shadow-lg);
2046
+ }
2047
+
2048
+ .dpk-body[data-sidebar-drawer][data-sidebar-side='right'] > .dpk-sidebar {
2049
+ left: auto;
2050
+ right: 36px;
2051
+ }
2052
+
2053
+ .dpk-sidebar-scrim {
2054
+ position: absolute;
2055
+ inset: 0;
2056
+ z-index: 24;
2057
+ background: color-mix(in srgb, var(--dpk-ink) 16%, transparent);
2058
+ }
2059
+
2060
+ /* While dragging, the cursor stays put and nothing underneath (text, preview frames) reacts. */
2061
+ .dpk-shell[data-resizing] {
2062
+ cursor: col-resize;
2063
+ user-select: none;
2064
+ }
2065
+
2066
+ .dpk-shell[data-resizing] .dpk-main {
2067
+ pointer-events: none;
2068
+ }
2069
+
2070
+ .dpk-main {
2071
+ flex: 1 1 0%;
2072
+ display: flex;
2073
+ flex-direction: column;
2074
+ min-width: 0;
2075
+ overflow: auto;
2076
+ /* A faint wash of the accent from the top left corner gives the ground some depth. */
2077
+ background:
2078
+ radial-gradient(
2079
+ ellipse 900px 360px at 0% 0%,
2080
+ color-mix(in srgb, var(--dpk-accent) 5%, transparent),
2081
+ transparent 70%
2082
+ ),
2083
+ radial-gradient(
2084
+ ellipse 700px 320px at 100% 0%,
2085
+ color-mix(in srgb, var(--dpk-blue) 4%, transparent),
2086
+ transparent 70%
2087
+ ),
2088
+ var(--dpk-paper);
2089
+ background-attachment: local;
2090
+ }
2091
+
2092
+ .dpk-main-body {
2093
+ flex: 1 0 auto;
2094
+ display: grid;
2095
+ /* The column is as wide as the page, not as its widest unbreakable line. */
2096
+ grid-template-columns: minmax(0, 1fr);
2097
+ align-content: start;
2098
+ gap: 16px;
2099
+ min-width: 0;
2100
+ padding: 24px;
2101
+ animation: dpk-rise 420ms var(--dpk-ease) backwards;
2102
+ }
2103
+
2104
+ /*
2105
+ * Scrolled to the end, the last of the content clears the hand-off dock
2106
+ * floating over the bottom right. \`--dpk-dock-clearance\` is how far up
2107
+ * that is; it reaches into components too, and a template's own floating
2108
+ * controls rise by it. \`:where\` lets a full-bleed template keep no padding.
2109
+ */
2110
+ .dpk-shell:has(> .dpk-dock) {
2111
+ --dpk-dock-clearance: 64px;
2112
+ }
2113
+
2114
+ :where(.dpk-shell:has(> .dpk-dock)) .dpk-main-body {
2115
+ padding-bottom: calc(24px + var(--dpk-dock-clearance));
2116
+ }
2117
+
2118
+ :where(.dpk-shell:has(> .dpk-dock)) .dpk-sidebar {
2119
+ padding-bottom: calc(18px + var(--dpk-dock-clearance));
2120
+ }
2121
+
2122
+ @keyframes dpk-rise {
2123
+ from {
2124
+ opacity: 0;
2125
+ transform: translateY(6px);
2126
+ }
2127
+ }
2128
+
2129
+ /*
2130
+ * Author memo. It sits at the end of the main column and sticks to the
2131
+ * bottom of the scrollport as a bar the full width of the column, edge to
2132
+ * edge: always in reach and never stealing height from the preview. Opened,
2133
+ * it grows upward over the content and shows the memo whole; only a memo
2134
+ * taller than the window scrolls, so its top stays reachable.
2135
+ */
2136
+ .dpk-memo {
2137
+ position: sticky;
2138
+ bottom: 0;
2139
+ z-index: 5;
2140
+ margin-top: auto;
2141
+ }
2142
+
2143
+ .dpk-memo[hidden] {
2144
+ display: none;
2145
+ }
2146
+
2147
+ .dpk-memo-fold {
2148
+ /* A faint amber wash over the whole note marks it as the author's aside. */
2149
+ border-top: 1px solid color-mix(in srgb, var(--dpk-amber) 28%, var(--dpk-rule-strong));
2150
+ background: color-mix(in srgb, color-mix(in srgb, var(--dpk-amber) 7%, var(--dpk-paper-raised)) 94%, transparent);
2151
+ backdrop-filter: blur(12px);
2152
+ box-shadow: 0 -8px 24px -18px color-mix(in srgb, var(--dpk-ink) 40%, transparent);
2153
+ }
2154
+
2155
+ .dpk-memo-bar {
2156
+ display: flex;
2157
+ align-items: center;
2158
+ gap: 6px;
2159
+ /* Clear of the hand-off dock at the bottom right while it is shown. */
2160
+ padding: 8px calc(16px + var(--dpk-dock-space, 0px)) 8px 16px;
2161
+ font-size: 12.5px;
2162
+ font-weight: 600;
2163
+ color: var(--dpk-ink-soft);
2164
+ cursor: pointer;
2165
+ list-style: none;
2166
+ user-select: none;
2167
+ }
2168
+
2169
+ .dpk-memo-bar::-webkit-details-marker {
2170
+ display: none;
2171
+ }
2172
+
2173
+ .dpk-memo-bar:hover {
2174
+ color: var(--dpk-ink);
2175
+ }
2176
+
2177
+ .dpk-memo-bar:focus-visible {
2178
+ outline: none;
2179
+ box-shadow: var(--dpk-focus);
2180
+ }
2181
+
2182
+ .dpk-memo-bar svg {
2183
+ width: 14px;
2184
+ height: 14px;
2185
+ transition: transform 160ms var(--dpk-ease);
2186
+ }
2187
+
2188
+ .dpk-memo-fold[open] .dpk-memo-bar svg {
2189
+ transform: rotate(90deg);
2190
+ }
2191
+
2192
+ .dpk-memo-body {
2193
+ max-height: calc(100dvh - 120px);
2194
+ overflow: auto;
2195
+ overscroll-behavior: contain;
2196
+ padding: 0 calc(16px + var(--dpk-dock-space, 0px)) 16px 16px;
2197
+ font-size: 12.5px;
2198
+ line-height: 1.7;
2199
+ color: var(--dpk-ink-soft);
2200
+ }
2201
+
2202
+ .dpk-memo ::slotted(*) {
2203
+ display: block;
2204
+ max-width: 100%;
2205
+ }
2206
+
2207
+ .dpk-orphans {
2208
+ margin-top: 16px;
2209
+ border: 1px dashed var(--dpk-rule-strong);
2210
+ border-radius: var(--dpk-radius);
2211
+ padding: 12px;
2212
+ }
2213
+
2214
+ .dpk-banner {
2215
+ display: grid;
2216
+ gap: 4px;
2217
+ margin-bottom: 14px;
2218
+ border: 1px solid color-mix(in srgb, var(--dpk-danger) 35%, transparent);
2219
+ border-radius: var(--dpk-radius);
2220
+ background: linear-gradient(90deg, var(--dpk-danger) 0 3px, transparent 3px), var(--dpk-danger-soft);
2221
+ padding: 12px 14px 12px 17px;
2222
+ max-width: 900px;
2223
+ }
2224
+
2225
+ .dpk-banner strong {
2226
+ font-size: 13px;
2227
+ color: var(--dpk-danger);
2228
+ }
2229
+
2230
+ .dpk-banner code {
2231
+ font-family: var(--dpk-mono);
2232
+ font-size: 11px;
2233
+ color: var(--dpk-ink-soft);
2234
+ overflow-wrap: anywhere;
2235
+ }
2236
+
2237
+ .dpk-notes {
2238
+ flex: 0 0 auto;
2239
+ width: 360px;
2240
+ border-left: 1px solid var(--dpk-rule);
2241
+ background: var(--dpk-paper-raised);
2242
+ box-shadow: -12px 0 32px -24px var(--dpk-shade-3);
2243
+ overflow: hidden;
2244
+ display: flex;
2245
+ animation: dpk-slide-in 260ms var(--dpk-ease) backwards;
2246
+ }
2247
+
2248
+ @keyframes dpk-slide-in {
2249
+ from {
2250
+ opacity: 0;
2251
+ transform: translateX(16px);
2252
+ }
2253
+ }
2254
+
2255
+ .dpk-notes[hidden] {
2256
+ display: none;
2257
+ }
2258
+
2259
+ /*
2260
+ * Where a column of its own would leave the main column too little room,
2261
+ * the review opens over the main column's edge instead; on a phone it
2262
+ * takes the screen, below the review button that closes it.
2263
+ */
2264
+ @media (max-width: 1100px) {
2265
+ .dpk-body:has(> .dpk-sidebar:not([hidden])) > .dpk-notes {
2266
+ position: absolute;
2267
+ top: 0;
2268
+ right: 0;
2269
+ bottom: 0;
2270
+ z-index: 30;
2271
+ max-width: 100%;
2272
+ box-shadow: var(--dpk-shadow-lg);
2273
+ }
2274
+ }
2275
+
2276
+ @media (max-width: 860px) {
2277
+ .dpk-notes {
2278
+ position: absolute;
2279
+ top: 0;
2280
+ right: 0;
2281
+ bottom: 0;
2282
+ z-index: 30;
2283
+ max-width: 100%;
2284
+ box-shadow: var(--dpk-shadow-lg);
2285
+ }
2286
+ }
2287
+
2288
+ @media (max-width: 760px) {
2289
+ .dpk-notes,
2290
+ .dpk-body:has(> .dpk-sidebar:not([hidden])) > .dpk-notes {
2291
+ position: fixed;
2292
+ inset: 0;
2293
+ z-index: 50;
2294
+ width: auto;
2295
+ padding-top: 60px;
2296
+ border-left: 0;
2297
+ }
2298
+ }
2299
+
2300
+ /* ------------------------------------------------------------- footer */
2301
+
2302
+ .dpk-footer {
2303
+ border-top: 1px solid var(--dpk-rule);
2304
+ padding: 10px 20px;
2305
+ display: flex;
2306
+ gap: 12px;
2307
+ align-items: center;
2308
+ background: var(--dpk-glass);
2309
+ backdrop-filter: blur(12px);
2310
+ font-size: 12px;
2311
+ color: var(--dpk-ink-faint);
2312
+ }
2313
+
2314
+ /* --------------------------------------------------- floating review */
2315
+
2316
+ /* Review toggle: pinned to the top right corner, always in the same place. */
2317
+ .dpk-fab {
2318
+ position: fixed;
2319
+ top: 12px;
2320
+ right: 16px;
2321
+ z-index: 60;
2322
+ display: inline-flex;
2323
+ align-items: center;
2324
+ justify-content: center;
2325
+ width: 36px;
2326
+ height: 36px;
2327
+ padding: 0;
2328
+ border: 1px solid var(--dpk-rule-strong);
2329
+ border-radius: 11px;
2330
+ background: var(--dpk-paper-raised);
2331
+ color: var(--dpk-ink-soft);
2332
+ box-shadow: var(--dpk-bevel), var(--dpk-shadow-sm);
2333
+ cursor: pointer;
2334
+ transition:
2335
+ color 180ms var(--dpk-ease),
2336
+ background 180ms var(--dpk-ease),
2337
+ border-color 180ms var(--dpk-ease),
2338
+ box-shadow 180ms var(--dpk-ease),
2339
+ transform 220ms var(--dpk-ease-spring);
2340
+ }
2341
+
2342
+ .dpk-fab:hover {
2343
+ color: var(--dpk-ink);
2344
+ border-color: var(--dpk-rule-hover);
2345
+ transform: translateY(-1px);
2346
+ box-shadow: var(--dpk-bevel), var(--dpk-shadow);
2347
+ }
2348
+
2349
+ .dpk-fab:active {
2350
+ transform: translateY(0) scale(0.95);
2351
+ box-shadow: var(--dpk-shadow-xs);
2352
+ }
2353
+
2354
+ .dpk-fab:focus-visible {
2355
+ outline: none;
2356
+ box-shadow: var(--dpk-focus);
2357
+ }
2358
+
2359
+ .dpk-fab[aria-expanded='true'] {
2360
+ color: var(--dpk-accent-ink);
2361
+ border-color: color-mix(in srgb, var(--dpk-accent-strong) 70%, transparent);
2362
+ background: linear-gradient(145deg, var(--dpk-accent-bright), var(--dpk-accent-strong));
2363
+ box-shadow:
2364
+ inset 0 1px 0 rgba(255, 255, 255, 0.25),
2365
+ 0 6px 16px -6px color-mix(in srgb, var(--dpk-accent) 70%, transparent);
2366
+ }
2367
+
2368
+ .dpk-fab[aria-expanded='true']:hover {
2369
+ box-shadow:
2370
+ inset 0 1px 0 rgba(255, 255, 255, 0.25),
2371
+ 0 10px 22px -8px color-mix(in srgb, var(--dpk-accent) 80%, transparent);
2372
+ }
2373
+
2374
+ .dpk-fab-icon {
2375
+ position: relative;
2376
+ display: block;
2377
+ width: 16px;
2378
+ height: 12px;
2379
+ border: 1.6px solid currentColor;
2380
+ border-radius: 4px;
2381
+ }
2382
+
2383
+ .dpk-fab-icon::after {
2384
+ content: '';
2385
+ position: absolute;
2386
+ left: 2px;
2387
+ bottom: -4px;
2388
+ border-left: 3.5px solid transparent;
2389
+ border-right: 3.5px solid transparent;
2390
+ border-top: 4px solid currentColor;
2391
+ }
2392
+
2393
+ .dpk-fab-badge {
2394
+ position: absolute;
2395
+ top: -6px;
2396
+ right: -6px;
2397
+ min-width: 18px;
2398
+ height: 18px;
2399
+ padding: 0 4px;
2400
+ border: 2px solid var(--dpk-paper);
2401
+ border-radius: 999px;
2402
+ background: linear-gradient(145deg, var(--dpk-accent-bright), var(--dpk-accent));
2403
+ color: var(--dpk-accent-ink);
2404
+ font-family: var(--dpk-mono);
2405
+ font-size: 9.5px;
2406
+ font-weight: 650;
2407
+ font-variant-numeric: tabular-nums;
2408
+ line-height: 14px;
2409
+ text-align: center;
2410
+ box-shadow: 0 3px 8px -2px color-mix(in srgb, var(--dpk-accent) 60%, transparent);
2411
+ animation: dpk-pop 260ms var(--dpk-ease-spring);
2412
+ }
2413
+
2414
+ @keyframes dpk-pop {
2415
+ from {
2416
+ transform: scale(0.4);
2417
+ opacity: 0;
2418
+ }
2419
+ }
2420
+
2421
+ /* ------------------------------------------------------ hand-off dock */
2422
+
2423
+ .dpk-dock {
2424
+ position: fixed;
2425
+ right: 16px;
2426
+ bottom: 16px;
2427
+ z-index: 60;
2428
+ display: flex;
2429
+ flex-direction: column;
2430
+ align-items: flex-end;
2431
+ gap: 8px;
2432
+ max-width: calc(100vw - 32px);
2433
+ animation: dpk-dock-in 260ms var(--dpk-ease) backwards;
2434
+ }
2435
+
2436
+ @keyframes dpk-dock-in {
2437
+ from {
2438
+ transform: translateY(8px);
2439
+ opacity: 0;
2440
+ }
2441
+ }
2442
+
2443
+ .dpk-dock-actions {
2444
+ display: flex;
2445
+ gap: 6px;
2446
+ padding: 6px;
2447
+ border: 1px solid var(--dpk-rule-strong);
2448
+ border-radius: var(--dpk-radius-lg);
2449
+ background: var(--dpk-glass);
2450
+ backdrop-filter: blur(12px);
2451
+ box-shadow: var(--dpk-bevel), var(--dpk-shadow-lg);
2452
+ }
2453
+
2454
+ .dpk-dock-note {
2455
+ max-width: 320px;
2456
+ margin: 0;
2457
+ padding: 8px 12px;
2458
+ border: 1px solid var(--dpk-rule-strong);
2459
+ border-radius: var(--dpk-radius);
2460
+ background: var(--dpk-paper-raised);
2461
+ box-shadow: var(--dpk-shadow);
2462
+ color: var(--dpk-ink-soft);
2463
+ font-size: 12px;
2464
+ line-height: 1.6;
2465
+ }
2466
+
2467
+ /* The template's name repeats the mark above the title; the title needs the room more. */
2468
+ @media (max-width: 1100px) {
2469
+ .dpk-header-meta > .dpk-meta-name {
2470
+ display: none;
2471
+ }
2472
+ }
2473
+
2474
+ @media (max-width: 720px) {
2475
+ /* The version select stays: it is the reader's only way to switch
2476
+ versions; so do the counts, the review's progress at a glance. */
2477
+ .dpk-header-meta > :not(.dpk-version, .dpk-meta-count) {
2478
+ display: none;
2479
+ }
2480
+
2481
+ /* On a phone the row may be narrower than both: the counts stay whole and
2482
+ the version select gives up its width instead. */
2483
+ .dpk-header-meta {
2484
+ min-width: 0;
2485
+ max-width: 100%;
2486
+ }
2487
+
2488
+ .dpk-header-meta > .dpk-version {
2489
+ display: flex;
2490
+ min-width: 0;
2491
+ }
2492
+
2493
+ .dpk-header-meta .dpk-version-select {
2494
+ width: 100%;
2495
+ min-width: 0;
2496
+ text-overflow: ellipsis;
2497
+ }
2498
+
2499
+ .dpk-header-meta > .dpk-meta-count {
2500
+ flex: none;
2501
+ }
2502
+
2503
+ /* The title takes the first row whole; the version select and tools wrap below it. */
2504
+ .dpk-title {
2505
+ flex: 1 0 100%;
2506
+ }
2507
+
2508
+ .dpk-brand {
2509
+ display: none;
2510
+ }
2511
+
2512
+ /* The page's own content goes last, so a long one cannot push the version
2513
+ select and tools below it. */
2514
+ .dpk-header-slot {
2515
+ order: 1;
2516
+ }
2517
+ }
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"
2519
+ >dev-process-kit@<select
2520
+ class="dpk-version-select"
2521
+ aria-label=${n.versionLabel}
2522
+ title=${n.versionLabel}
2523
+ @pointerenter=${i}
2524
+ @focus=${i}
2525
+ @change=${rs(r=>this.pick(r))}
2526
+ >
2527
+ ${s.options.map(r=>b`<option value=${r.value} ?selected=${r.value===s.value}>${r.label}</option>`)}
2528
+ </select></span
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
2530
+ .definition=${this.controller.definition}
2531
+ .state=${e.state}
2532
+ .navigation=${e.navigation}
2533
+ .derivation=${this.derivation}
2534
+ .issues=${this.controller.lastIssues}
2535
+ .exportBrief=${()=>this.api.exportBrief()}
2536
+ .sendToClaude=${this.canSendToClaude?()=>this.sendToClaude():void 0}
2537
+ .pendingTarget=${this.#y}
2538
+ .embedded=${this.integratedReview}
2539
+ .onDelete=${n=>this.removeAction(n)}
2540
+ .onEditComment=${(n,s)=>this.editComment(n,s)}
2541
+ .onClear=${()=>this.clearActions()}
2542
+ .onComment=${(n,s)=>{const i=this.dispatch({type:D,target:n,payload:{body:s}});return i.ok&&(this.#y=null),i}}
2543
+ ></dpk-component-comment-panel>`}renderChrome(e,n){const s=e.actions.length,i=e.actions.filter(u=>u.type===D).length,r=s-i,o=F(this.locale),a=n.sidebarHidden===!0||!n.sidebar&&!this.hasSidebarContent(),l=this.sidebarLayout.side,c=this.#X,p=!a&&this.#R&&(c?!this.#o.drawerOpen:this.#o.collapsed),d=a?m:this.#Q(p,c),h=this.definition.title(e.state);return b`
2544
+ <div class="dpk-shell" ?data-resizing=${this.#i.dragging}>
2545
+ <header class="dpk-header">
2546
+ <span class="dpk-brand" aria-hidden="true"></span>
2547
+ <div class="dpk-title">
2548
+ <span class="dpk-template-mark">${this.definition.label}</span>
2549
+ <h1 title=${h}>${h}</h1>
2550
+ </div>
2551
+ <div class="dpk-header-slot">
2552
+ ${n.header??m}
2553
+ <slot name="header"></slot>
2554
+ </div>
2555
+ <div class="dpk-header-meta">
2556
+ ${this.#x.render(this.locale)}
2557
+ <span class="dpk-meta-name">${this.definition.name}</span>
2558
+ <span class="dpk-meta-count" data-active=${s>0?"true":"false"}>
2559
+ ${o.draftCount(r,i)}
2560
+ </span>
2561
+ </div>
2562
+ <div class="dpk-header-tools">
2563
+ ${this.#W()} ${this.#Y()} ${this.#J()}
2564
+ </div>
2565
+ </header>
2566
+ <div class="dpk-body" data-sidebar-side=${l} ?data-sidebar-drawer=${c}>
2567
+ ${l==="right"?d:m}
2568
+ <aside
2569
+ id="dpk-sidebar"
2570
+ class="dpk-sidebar"
2571
+ ?hidden=${a||p}
2572
+ style=${`--dpk-sidebar-width: ${this.#i.width}px`}
2573
+ >
2574
+ ${n.sidebar??m}
2575
+ <slot name="sidebar"></slot>
2576
+ </aside>
2577
+ ${l==="left"?d:m}
2578
+ ${c&&!p&&!a?b`<div class="dpk-sidebar-scrim" @click=${()=>this.#o.closeDrawer()}></div>`:m}
2579
+ <main class="dpk-main">
2580
+ <div class="dpk-main-body">
2581
+ ${this.#S?b`<div class="dpk-banner" role="alert">
2582
+ <strong>${o.baseDataError}</strong>
2583
+ <code>${this.#S}</code>
2584
+ </div>`:m}
2585
+ ${this.#c.error===null?m:b`<div class="dpk-banner" role="alert">
2586
+ <strong>${o.changesError}</strong>
2587
+ <code>${this.#c.error}</code>
2588
+ </div>`}
2589
+ ${n.main??m}
2590
+ <slot name="main"></slot>
2591
+ <section class="dpk-orphans" ?hidden=${this.#n.orphans===0}>
2592
+ <p class="dpk-label">previews without metadata</p>
2593
+ <slot name="preview"></slot>
2594
+ </section>
2595
+ </div>
2596
+ <div class="dpk-memo" ?hidden=${!this.hasMemoContent()}>
2597
+ <details class="dpk-memo-fold">
2598
+ <summary class="dpk-memo-bar">${Gn()} ${o.memo}</summary>
2599
+ <div class="dpk-memo-body"><slot name="memo"></slot></div>
2600
+ </details>
2601
+ </div>
2602
+ </main>
2603
+ ${this.integratedReview?m:b`<aside class="dpk-notes" ?hidden=${!this.notesOpen}>${this.renderReviewPanel(e)}</aside>`}
2604
+ </div>
2605
+ ${n.footer||this.hasFooterContent()?b`<footer class="dpk-footer">
2606
+ ${n.footer??m}
2607
+ <slot name="footer"></slot>
2608
+ </footer>`:m}
2609
+ ${this.integratedReview?m:b`<button
2610
+ class="dpk-fab"
2611
+ type="button"
2612
+ aria-expanded=${this.notesOpen?"true":"false"}
2613
+ title=${o.reviewToggle}
2614
+ @click=${()=>{this.notesOpen=!this.notesOpen}}
2615
+ >
2616
+ <span class="dpk-fab-icon" aria-hidden="true"></span>
2617
+ <span
2618
+ class="dpk-label"
2619
+ style="position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)"
2620
+ >
2621
+ ${o.review}
2622
+ </span>
2623
+ ${s>0?b`<span class="dpk-fab-badge">${s}</span>`:m}
2624
+ </button>`}
2625
+ ${this.integratedReview?m:this.#G(s)} ${this.#V()}
2626
+ </div>
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}>
2629
+ ${n.note?b`<p class="dpk-dock-note" role="alert">${n.note}</p>`:m}
2630
+ <div class="dpk-dock-actions">
2631
+ ${n.send?b`<button
2632
+ class="dpk-btn dpk-btn--accent"
2633
+ type="button"
2634
+ ?disabled=${n.send.disabled}
2635
+ @click=${()=>{this.#t.send(()=>this.sendToClaude())}}
2636
+ >
2637
+ ${n.send.label}
2638
+ </button>`:m}
2639
+ <button
2640
+ class=${n.send?"dpk-btn":"dpk-btn dpk-btn--accent"}
2641
+ type="button"
2642
+ data-status=${n.copy.status}
2643
+ title=${s.handoffCopyTitle}
2644
+ @click=${()=>{this.#t.copy(()=>this.api.exportBrief())}}
2645
+ >
2646
+ ${n.copy.label}
2647
+ </button>
2648
+ </div>
2649
+ </div>`}#Y(){const e=this.locale,n=F(e).language;return b`<select
2650
+ class="dpk-lang-select"
2651
+ aria-label=${n}
2652
+ title=${n}
2653
+ @change=${rs(s=>{const i=mn.find(r=>r===s);i!==void 0&&this.#h.pick(i)})}
2654
+ >
2655
+ ${mn.map(s=>b`<option value=${s} lang=${s} ?selected=${s===e}>
2656
+ ${Xl[s]}
2657
+ </option>`)}
2658
+ </select>`}#J(){const e=this.dataset.theme==="dark",n=F(this.locale),s=e?n.useLightTheme:n.useDarkTheme;return b`<button
2659
+ class="dpk-theme-toggle"
2660
+ type="button"
2661
+ aria-label=${s}
2662
+ title=${s}
2663
+ @click=${()=>this.#s.toggle(ut(this.theme))}
2664
+ >
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
2667
+ class="dpk-sidebar-toggle"
2668
+ type="button"
2669
+ aria-controls="dpk-sidebar"
2670
+ aria-expanded=${e?"false":"true"}
2671
+ aria-label=${r}
2672
+ title=${r}
2673
+ @click=${()=>{this.#f=!0,n?this.#o.toggleDrawer():this.#o.toggle()}}
2674
+ >
2675
+ ${i.points==="left"?or():Gn()}
2676
+ </button>`}#I(){const e=F(this.locale),n=this.#i.handlers;return b`<div
2677
+ class="dpk-sidebar-resizer"
2678
+ role="separator"
2679
+ tabindex="0"
2680
+ aria-orientation="vertical"
2681
+ aria-label=${e.resizeSidebar}
2682
+ aria-valuemin=${be.min}
2683
+ aria-valuemax=${be.max}
2684
+ aria-valuenow=${this.#i.width}
2685
+ title=${e.resizeSidebarHint}
2686
+ @pointerdown=${n.pointerdown}
2687
+ @pointermove=${n.pointermove}
2688
+ @pointerup=${n.pointerup}
2689
+ @pointercancel=${n.pointercancel}
2690
+ @keydown=${n.keydown}
2691
+ @dblclick=${n.dblclick}
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};