dev-process-kit 0.0.17 → 0.1.0

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 (39) hide show
  1. package/README.md +1 -1
  2. package/dist/chunks/shared-B5lBiq5s.js +1 -0
  3. package/dist/chunks/shared-BDka-8DG.js +3720 -0
  4. package/dist/chunks/shared-BWk3i0ft.js +2774 -0
  5. package/dist/chunks/{shared-XCFMpX43.js → shared-BZK_cqqQ.js} +12 -12
  6. package/dist/chunks/{shared-3uutHtJD.js → shared-Bhrkz9uX.js} +22 -25
  7. package/dist/chunks/{shared-D7TEJdR2.js → shared-BqL8W-G6.js} +1 -1
  8. package/dist/chunks/shared-BqvHpTHr.js +572 -0
  9. package/dist/chunks/shared-CjW1DhGL.js +1 -0
  10. package/dist/chunks/{shared-B_MRyp8K.js → shared-CqjOqXJ3.js} +32 -50
  11. package/dist/chunks/shared-D1W4I3eq.js +4143 -0
  12. package/dist/chunks/{shared-C_Ru__JO.js → shared-D6pr-dx0.js} +1 -1
  13. package/dist/chunks/{shared-DG16QEdg.js → shared-DRzfRsiJ.js} +173 -203
  14. package/dist/chunks/{shared-Bnqz77V3.js → shared-XXW1oBnj.js} +15 -13
  15. package/dist/chunks/{shared-QJPpnJIO.js → shared-gytWODMC.js} +2 -2
  16. package/dist/chunks/shared-k9bZPE_p.js +49 -0
  17. package/dist/components.js +1 -1
  18. package/dist/index.js +1 -1
  19. package/dist/templates/delegation-poker.js +1 -1
  20. package/dist/templates/event-storming.js +1 -1
  21. package/dist/templates/example-mapping.js +1 -1
  22. package/dist/templates/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 -2
  29. package/dist/chunks/shared-B9XMvOh-.js +0 -1027
  30. package/dist/chunks/shared-BnGxP2qu.js +0 -2560
  31. package/dist/chunks/shared-CLSKGVCT.js +0 -572
  32. package/dist/chunks/shared-CjhDJ2vV.js +0 -2766
  33. package/dist/chunks/shared-CtHWU02m.js +0 -1
  34. package/dist/chunks/shared-D4K7KsfJ.js +0 -1
  35. package/dist/chunks/shared-DdefS1nG.js +0 -1
  36. package/dist/chunks/shared-DmOHk6B_.js +0 -3457
  37. package/dist/chunks/shared-OIF3QVAa.js +0 -30
  38. package/dist/chunks/shared-ml5h7U5L.js +0 -1
  39. package/dist/templates/grill.js +0 -1
@@ -1,2766 +0,0 @@
1
- const xt=globalThis,on=xt.ShadowRoot&&(xt.ShadyCSS===void 0||xt.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,an=Symbol(),Es=new WeakMap;let Rs=class{constructor(e,n,s){if(this._$cssResult$=!0,s!==an)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=n}get styleSheet(){let e=this.o;const n=this.t;if(on&&e===void 0){const s=n!==void 0&&n.length===1;s&&(e=Es.get(n)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),s&&Es.set(n,e))}return e}toString(){return this.cssText}};const _s=t=>new Rs(typeof t=="string"?t:t+"",void 0,an),de=(t,...e)=>{const n=t.length===1?t[0]:e.reduce((s,i,r)=>s+(o=>{if(o._$cssResult$===!0)return o.cssText;if(typeof o=="number")return o;throw Error("Value passed to 'css' function must be a 'css' function result: "+o+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(i)+t[r+1],t[0]);return new Rs(n,t,an)},Bo=(t,e)=>{if(on)t.adoptedStyleSheets=e.map(n=>n instanceof CSSStyleSheet?n:n.styleSheet);else for(const n of e){const s=document.createElement("style"),i=xt.litNonce;i!==void 0&&s.setAttribute("nonce",i),s.textContent=n.cssText,t.appendChild(s)}},Ls=on?t=>t:t=>t instanceof CSSStyleSheet?(e=>{let n="";for(const s of e.cssRules)n+=s.cssText;return _s(n)})(t):t,{is:Uo,defineProperty:Ho,getOwnPropertyDescriptor:Fo,getOwnPropertyNames:Wo,getOwnPropertySymbols:Vo,getPrototypeOf:Ko}=Object,yt=globalThis,Os=yt.trustedTypes,Go=Os?Os.emptyScript:"",Zo=yt.reactiveElementPolyfillSupport,Ye=(t,e)=>t,ln={toAttribute(t,e){switch(e){case Boolean:t=t?Go:null;break;case Object:case Array:t=t==null?t:JSON.stringify(t)}return t},fromAttribute(t,e){let n=t;switch(e){case Boolean:n=t!==null;break;case Number:n=t===null?null:Number(t);break;case Object:case Array:try{n=JSON.parse(t)}catch{n=null}}return n}},Ps=(t,e)=>!Uo(t,e),zs={attribute:!0,type:String,converter:ln,reflect:!1,useDefault:!1,hasChanged:Ps};Symbol.metadata??=Symbol("metadata"),yt.litPropertyMetadata??=new WeakMap;let De=class extends HTMLElement{static addInitializer(e){this._$Ei(),(this.l??=[]).push(e)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(e,n=zs){if(n.state&&(n.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(e)&&((n=Object.create(n)).wrapped=!0),this.elementProperties.set(e,n),!n.noAccessor){const s=Symbol(),i=this.getPropertyDescriptor(e,s,n);i!==void 0&&Ho(this.prototype,e,i)}}static getPropertyDescriptor(e,n,s){const{get:i,set:r}=Fo(this.prototype,e)??{get(){return this[n]},set(o){this[n]=o}};return{get:i,set(o){const a=i?.call(this);r?.call(this,o),this.requestUpdate(e,a,s)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??zs}static _$Ei(){if(this.hasOwnProperty(Ye("elementProperties")))return;const e=Ko(this);e.finalize(),e.l!==void 0&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(Ye("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(Ye("properties"))){const n=this.properties,s=[...Wo(n),...Vo(n)];for(const i of s)this.createProperty(i,n[i])}const e=this[Symbol.metadata];if(e!==null){const n=litPropertyMetadata.get(e);if(n!==void 0)for(const[s,i]of n)this.elementProperties.set(s,i)}this._$Eh=new Map;for(const[n,s]of this.elementProperties){const i=this._$Eu(n,s);i!==void 0&&this._$Eh.set(i,n)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){const n=[];if(Array.isArray(e)){const s=new Set(e.flat(1/0).reverse());for(const i of s)n.unshift(Ls(i))}else e!==void 0&&n.push(Ls(e));return n}static _$Eu(e,n){const s=n.attribute;return s===!1?void 0:typeof s=="string"?s:typeof e=="string"?e.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise(e=>this.enableUpdating=e),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(e=>e(this))}addController(e){(this._$EO??=new Set).add(e),this.renderRoot!==void 0&&this.isConnected&&e.hostConnected?.()}removeController(e){this._$EO?.delete(e)}_$E_(){const e=new Map,n=this.constructor.elementProperties;for(const s of n.keys())this.hasOwnProperty(s)&&(e.set(s,this[s]),delete this[s]);e.size>0&&(this._$Ep=e)}createRenderRoot(){const e=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return Bo(e,this.constructor.elementStyles),e}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach(e=>e.hostConnected?.())}enableUpdating(e){}disconnectedCallback(){this._$EO?.forEach(e=>e.hostDisconnected?.())}attributeChangedCallback(e,n,s){this._$AK(e,s)}_$ET(e,n){const s=this.constructor.elementProperties.get(e),i=this.constructor._$Eu(e,s);if(i!==void 0&&s.reflect===!0){const r=(s.converter?.toAttribute!==void 0?s.converter:ln).toAttribute(n,s.type);this._$Em=e,r==null?this.removeAttribute(i):this.setAttribute(i,r),this._$Em=null}}_$AK(e,n){const s=this.constructor,i=s._$Eh.get(e);if(i!==void 0&&this._$Em!==i){const r=s.getPropertyOptions(i),o=typeof r.converter=="function"?{fromAttribute:r.converter}:r.converter?.fromAttribute!==void 0?r.converter:ln;this._$Em=i;const a=o.fromAttribute(n,r.type);this[i]=a??this._$Ej?.get(i)??a,this._$Em=null}}requestUpdate(e,n,s,i=!1,r){if(e!==void 0){const o=this.constructor;if(i===!1&&(r=this[e]),s??=o.getPropertyOptions(e),!((s.hasChanged??Ps)(r,n)||s.useDefault&&s.reflect&&r===this._$Ej?.get(e)&&!this.hasAttribute(o._$Eu(e,s))))return;this.C(e,n,s)}this.isUpdatePending===!1&&(this._$ES=this._$EP())}C(e,n,{useDefault:s,reflect:i,wrapped:r},o){s&&!(this._$Ej??=new Map).has(e)&&(this._$Ej.set(e,o??n??this[e]),r!==!0||o!==void 0)||(this._$AL.has(e)||(this.hasUpdated||s||(n=void 0),this._$AL.set(e,n)),i===!0&&this._$Em!==e&&(this._$Eq??=new Set).add(e))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(n){Promise.reject(n)}const e=this.scheduleUpdate();return e!=null&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(const[i,r]of this._$Ep)this[i]=r;this._$Ep=void 0}const s=this.constructor.elementProperties;if(s.size>0)for(const[i,r]of s){const{wrapped:o}=r,a=this[i];o!==!0||this._$AL.has(i)||a===void 0||this.C(i,void 0,r,a)}}let e=!1;const n=this._$AL;try{e=this.shouldUpdate(n),e?(this.willUpdate(n),this._$EO?.forEach(s=>s.hostUpdate?.()),this.update(n)):this._$EM()}catch(s){throw e=!1,this._$EM(),s}e&&this._$AE(n)}willUpdate(e){}_$AE(e){this._$EO?.forEach(n=>n.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(e){return!0}update(e){this._$Eq&&=this._$Eq.forEach(n=>this._$ET(n,this[n])),this._$EM()}updated(e){}firstUpdated(e){}};De.elementStyles=[],De.shadowRootOptions={mode:"open"},De[Ye("elementProperties")]=new Map,De[Ye("finalized")]=new Map,Zo?.({ReactiveElement:De}),(yt.reactiveElementVersions??=[]).push("2.1.2");const cn=globalThis,Ms=t=>t,wt=cn.trustedTypes,Is=wt?wt.createPolicy("lit-html",{createHTML:t=>t}):void 0,Ns="$lit$",pe=`lit$${Math.random().toFixed(9).slice(2)}$`,Ds="?"+pe,Yo=`<${Ds}>`,we=document,Je=()=>we.createComment(""),Xe=t=>t===null||typeof t!="object"&&typeof t!="function",dn=Array.isArray,Jo=t=>dn(t)||typeof t?.[Symbol.iterator]=="function",pn=`[
2
- \f\r]`,Qe=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,js=/-->/g,qs=/>/g,$e=RegExp(`>|${pn}(?:([^\\s"'>=/]+)(${pn}*=${pn}*(?:[^
3
- \f\r"'\`<>=]|("|')|))|$)`,"g"),Bs=/'/g,Us=/"/g,Hs=/^(?:script|style|textarea|title)$/i,Fs=t=>(e,...n)=>({_$litType$:t,strings:e,values:n}),b=Fs(1),Xo=Fs(2),H=Symbol.for("lit-noChange"),g=Symbol.for("lit-nothing"),Ws=new WeakMap,Se=we.createTreeWalker(we,129);function Vs(t,e){if(!dn(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return Is!==void 0?Is.createHTML(e):e}const Qo=(t,e)=>{const n=t.length-1,s=[];let i,r=e===2?"<svg>":e===3?"<math>":"",o=Qe;for(let a=0;a<n;a++){const l=t[a];let c,p,d=-1,h=0;for(;h<l.length&&(o.lastIndex=h,p=o.exec(l),p!==null);)h=o.lastIndex,o===Qe?p[1]==="!--"?o=js:p[1]!==void 0?o=qs:p[2]!==void 0?(Hs.test(p[2])&&(i=RegExp("</"+p[2],"g")),o=$e):p[3]!==void 0&&(o=$e):o===$e?p[0]===">"?(o=i??Qe,d=-1):p[1]===void 0?d=-2:(d=o.lastIndex-p[2].length,c=p[1],o=p[3]===void 0?$e:p[3]==='"'?Us:Bs):o===Us||o===Bs?o=$e:o===js||o===qs?o=Qe:(o=$e,i=void 0);const u=o===$e&&t[a+1].startsWith("/>")?" ":"";r+=o===Qe?l+Yo:d>=0?(s.push(c),l.slice(0,d)+Ns+l.slice(d)+pe+u):l+pe+(d===-2?a:u)}return[Vs(t,r+(t[n]||"<?>")+(e===2?"</svg>":e===3?"</math>":"")),s]};let hn=class Do{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]=Qo(e,n);if(this.el=Do.createElement(c,s),Se.currentNode=this.el.content,n===2||n===3){const d=this.el.content.firstChild;d.replaceWith(...d.childNodes)}for(;(i=Se.nextNode())!==null&&l.length<a;){if(i.nodeType===1){if(i.hasAttributes())for(const d of i.getAttributeNames())if(d.endsWith(Ns)){const h=p[o++],u=i.getAttribute(d).split(pe),f=/([.?@])?(.*)/.exec(h);l.push({type:1,index:r,name:f[2],strings:u,ctor:f[1]==="."?ta:f[1]==="?"?na:f[1]==="@"?sa:St}),i.removeAttribute(d)}else d.startsWith(pe)&&(l.push({type:6,index:r}),i.removeAttribute(d));if(Hs.test(i.tagName)){const d=i.textContent.split(pe),h=d.length-1;if(h>0){i.textContent=wt?wt.emptyScript:"";for(let u=0;u<h;u++)i.append(d[u],Je()),Se.nextNode(),l.push({type:2,index:++r});i.append(d[h],Je())}}}else if(i.nodeType===8)if(i.data===Ds)l.push({type:2,index:r});else{let d=-1;for(;(d=i.data.indexOf(pe,d+1))!==-1;)l.push({type:7,index:r}),d+=pe.length-1}r++}}static createElement(e,n){const s=we.createElement("template");return s.innerHTML=e,s}};function je(t,e,n=t,s){if(e===H)return e;let i=s!==void 0?n._$Co?.[s]:n._$Cl;const r=Xe(e)?void 0:e._$litDirective$;return i?.constructor!==r&&(i?._$AO?.(!1),r===void 0?i=void 0:(i=new r(t),i._$AT(t,n,s)),s!==void 0?(n._$Co??=[])[s]=i:n._$Cl=i),i!==void 0&&(e=je(t,i._$AS(t,e.values),i,s)),e}let ea=class{constructor(e,n){this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=n}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(e){const{el:{content:n},parts:s}=this._$AD,i=(e?.creationScope??we).importNode(n,!0);Se.currentNode=i;let r=Se.nextNode(),o=0,a=0,l=s[0];for(;l!==void 0;){if(o===l.index){let c;l.type===2?c=new $t(r,r.nextSibling,this,e):l.type===1?c=new l.ctor(r,l.name,l.strings,this,e):l.type===6&&(c=new ia(r,this,e)),this._$AV.push(c),l=s[++a]}o!==l?.index&&(r=Se.nextNode(),o++)}return Se.currentNode=we,i}p(e){let n=0;for(const s of this._$AV)s!==void 0&&(s.strings!==void 0?(s._$AI(e,s,n),n+=s.strings.length-2):s._$AI(e[n])),n++}},$t=class jo{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(e,n,s,i){this.type=2,this._$AH=g,this._$AN=void 0,this._$AA=e,this._$AB=n,this._$AM=s,this.options=i,this._$Cv=i?.isConnected??!0}get parentNode(){let e=this._$AA.parentNode;const n=this._$AM;return n!==void 0&&e?.nodeType===11&&(e=n.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,n=this){e=je(this,e,n),Xe(e)?e===g||e==null||e===""?(this._$AH!==g&&this._$AR(),this._$AH=g):e!==this._$AH&&e!==H&&this._(e):e._$litType$!==void 0?this.$(e):e.nodeType!==void 0?this.T(e):Jo(e)?this.k(e):this._(e)}O(e){return this._$AA.parentNode.insertBefore(e,this._$AB)}T(e){this._$AH!==e&&(this._$AR(),this._$AH=this.O(e))}_(e){this._$AH!==g&&Xe(this._$AH)?this._$AA.nextSibling.data=e:this.T(we.createTextNode(e)),this._$AH=e}$(e){const{values:n,_$litType$:s}=e,i=typeof s=="number"?this._$AC(e):(s.el===void 0&&(s.el=hn.createElement(Vs(s.h,s.h[0]),this.options)),s);if(this._$AH?._$AD===i)this._$AH.p(n);else{const r=new ea(i,this),o=r.u(this.options);r.p(n),this.T(o),this._$AH=r}}_$AC(e){let n=Ws.get(e.strings);return n===void 0&&Ws.set(e.strings,n=new hn(e)),n}k(e){dn(this._$AH)||(this._$AH=[],this._$AR());const n=this._$AH;let s,i=0;for(const r of e)i===n.length?n.push(s=new jo(this.O(Je()),this.O(Je()),this,this.options)):s=n[i],s._$AI(r),i++;i<n.length&&(this._$AR(s&&s._$AB.nextSibling,i),n.length=i)}_$AR(e=this._$AA.nextSibling,n){for(this._$AP?.(!1,!0,n);e!==this._$AB;){const s=Ms(e).nextSibling;Ms(e).remove(),e=s}}setConnected(e){this._$AM===void 0&&(this._$Cv=e,this._$AP?.(e))}};class St{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,n,s,i,r){this.type=1,this._$AH=g,this._$AN=void 0,this.element=e,this.name=n,this._$AM=i,this.options=r,s.length>2||s[0]!==""||s[1]!==""?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=g}_$AI(e,n=this,s,i){const r=this.strings;let o=!1;if(r===void 0)e=je(this,e,n,0),o=!Xe(e)||e!==this._$AH&&e!==H,o&&(this._$AH=e);else{const a=e;let l,c;for(e=r[0],l=0;l<r.length-1;l++)c=je(this,a[s+l],n,l),c===H&&(c=this._$AH[l]),o||=!Xe(c)||c!==this._$AH[l],c===g?e=g:e!==g&&(e+=(c??"")+r[l+1]),this._$AH[l]=c}o&&!i&&this.j(e)}j(e){e===g?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}}let ta=class extends St{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===g?void 0:e}},na=class extends St{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==g)}},sa=class extends St{constructor(e,n,s,i,r){super(e,n,s,i,r),this.type=5}_$AI(e,n=this){if((e=je(this,e,n,0)??g)===H)return;const s=this._$AH,i=e===g&&s!==g||e.capture!==s.capture||e.once!==s.once||e.passive!==s.passive,r=e!==g&&(s===g||i);i&&this.element.removeEventListener(this.name,this,s),r&&this.element.addEventListener(this.name,this,e),this._$AH=e}handleEvent(e){typeof this._$AH=="function"?this._$AH.call(this.options?.host??this.element,e):this._$AH.handleEvent(e)}};class ia{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){je(this,e)}}const ra={I:$t},oa=cn.litHtmlPolyfillSupport;oa?.(hn,$t),(cn.litHtmlVersions??=[]).push("3.3.3");const aa=(t,e,n)=>{const s=n?.renderBefore??e;let i=s._$litPart$;if(i===void 0){const r=n?.renderBefore??null;s._$litPart$=i=new $t(e.insertBefore(Je(),r),r,void 0,n??{})}return i._$AI(t),i},un=globalThis;let he=class extends De{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=aa(n,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return H}};he._$litElement$=!0,he.finalized=!0,un.litElementHydrateSupport?.({LitElement:he});const la=un.litElementPolyfillSupport;la?.({LitElement:he}),(un.litElementVersions??=[]).push("4.2.2");const ue={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4},et=t=>(...e)=>({_$litDirective$:t,values:e});let At=class{constructor(e){}get _$AU(){return this._$AM._$AU}_$AT(e,n,s){this._$Ct=e,this._$AM=n,this._$Ci=s}_$AS(e,n){return this.update(e,n)}update(e,n){return this.render(...n)}};const{I:ca}=ra,Ks=t=>t,da=t=>t.strings===void 0,Gs=()=>document.createComment(""),tt=(t,e,n)=>{const s=t._$AA.parentNode,i=e===void 0?t._$AB:e._$AA;if(n===void 0){const r=s.insertBefore(Gs(),i),o=s.insertBefore(Gs(),i);n=new ca(r,o,t,t.options)}else{const r=n._$AB.nextSibling,o=n._$AM,a=o!==t;if(a){let l;n._$AQ?.(t),n._$AM=t,n._$AP!==void 0&&(l=t._$AU)!==o._$AU&&n._$AP(l)}if(r!==i||a){let l=n._$AA;for(;l!==r;){const c=Ks(l).nextSibling;Ks(s).insertBefore(l,i),l=c}}}return n},Ae=(t,e,n=t)=>(t._$AI(e,n),t),pa={},fn=(t,e=pa)=>t._$AH=e,ha=t=>t._$AH,gn=t=>{t._$AR(),t._$AA.remove()},mn=et(class extends At{constructor(t){if(super(t),t.type!==ue.PROPERTY&&t.type!==ue.ATTRIBUTE&&t.type!==ue.BOOLEAN_ATTRIBUTE)throw Error("The `live` directive is not allowed on child or event bindings");if(!da(t))throw Error("`live` bindings can only contain a single expression")}render(t){return t}update(t,[e]){if(e===H||e===g)return e;const n=t.element,s=t.name;if(t.type===ue.PROPERTY){if(e===n[s])return H}else if(t.type===ue.BOOLEAN_ATTRIBUTE){if(!!e===n.hasAttribute(s))return H}else if(t.type===ue.ATTRIBUTE&&n.getAttribute(s)===e+"")return H;return fn(t),e}});class Ct extends At{constructor(e){if(super(e),this.it=g,e.type!==ue.CHILD)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(e){if(e===g||e==null)return this._t=void 0,this.it=e;if(e===H)return e;if(typeof e!="string")throw Error(this.constructor.directiveName+"() called with a non-string value");if(e===this.it)return this._t;this.it=e;const n=[e];return n.raw=n,this._t={_$litType$:this.constructor.resultType,strings:n,values:[]}}}Ct.directiveName="unsafeHTML",Ct.resultType=1;const Zs=et(Ct),Tt=t=>{let e=t;for(;e!==null;){if(e instanceof Element){const n=e.getAttribute("lang");if(n!==null)return n}e=e instanceof ShadowRoot?e.host:e.parentNode}return null},kn=["en","ja"],Ys="en",Js=t=>kn.some(e=>e===t),Et=t=>{const e=(t??"").split("-")[0]?.toLowerCase()??"";return Js(e)?e:Ys},Xs=t=>Et(Tt(t)),bn="dpk-locale-change",Qs=t=>typeof t=="string"&&Js(t)?t:null,ua=t=>t.preference??t.authored,fa=(t,e)=>t===e?null:t,Rt=t=>e=>e==="ja"?t.ja:t.en;class vn{#e;#n;#s=Ys;constructor(e,n=()=>{}){this.#e=e,this.#n=n,e.addController(this)}get locale(){return this.#s}hostConnected(){this.#s=Xs(this.#e),document.addEventListener(bn,this.#r)}hostDisconnected(){document.removeEventListener(bn,this.#r)}#r=()=>{const e=Xs(this.#e);e!==this.#s&&(this.#s=e,this.#n(),this.#e.requestUpdate())}}const ga={paper:["#f6f7f9","#0e1014"],"paper-raised":["#ffffff","#171a20"],"paper-sunken":["#eff1f4","#0a0b0e"],"paper-inset":["#e7eaef","#22262e"],ink:["#11141b","#eceef3"],"ink-soft":["#464e5f","#a9b0bd"],"ink-faint":["#788195","#737b8b"],rule:["rgba(17, 24, 39, 0.08)","rgba(226, 232, 244, 0.08)"],"rule-strong":["rgba(17, 24, 39, 0.13)","rgba(226, 232, 244, 0.14)"],"rule-hover":["rgba(17, 24, 39, 0.24)","rgba(226, 232, 244, 0.26)"],accent:["#e04e1f","#f26a3d"],"accent-strong":["#c63f12","#dc5226"],"accent-bright":["#f0652f","#ff8a5e"],"accent-soft":["rgba(224, 78, 31, 0.08)","rgba(242, 106, 61, 0.14)"],"accent-ink":["#ffffff","#ffffff"],blue:["#3563d9","#7aa2f7"],"blue-strong":["#2a4fb3","#5b86e8"],"blue-soft":["rgba(53, 99, 217, 0.09)","rgba(122, 162, 247, 0.15)"],green:["#15894a","#4cc787"],"green-soft":["rgba(21, 137, 74, 0.09)","rgba(76, 199, 135, 0.14)"],amber:["#b27406","#e9ae45"],"amber-soft":["rgba(178, 116, 6, 0.1)","rgba(233, 174, 69, 0.15)"],violet:["#7549d6","#ab90f5"],"violet-soft":["rgba(117, 73, 214, 0.09)","rgba(171, 144, 245, 0.15)"],danger:["#c11d38","#f5707f"],"danger-soft":["rgba(214, 53, 80, 0.09)","rgba(245, 112, 127, 0.14)"],shade:["rgb(17, 24, 39)","rgb(0, 0, 0)"],"shade-1":["rgba(17, 24, 39, 0.06)","rgba(0, 0, 0, 0.32)"],"shade-2":["rgba(17, 24, 39, 0.08)","rgba(0, 0, 0, 0.38)"],"shade-3":["rgba(17, 24, 39, 0.13)","rgba(0, 0, 0, 0.5)"],highlight:["rgba(255, 255, 255, 0.9)","rgba(255, 255, 255, 0.05)"]},ei=t=>_s(Object.entries(ga).map(([e,[n,s]])=>`--dpk-${e}: ${t(n,s)};`).join(`
4
- `)),_t=de`
5
- :host {
6
- /* Browsers without light-dark() stay light. */
7
- ${ei(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
- ${ei((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
- `,ma=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
- `,ti=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
- `,Ce=(t,e)=>t instanceof e?t:null;function yn(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var Te=yn();function ni(t){Te=t}var Ee={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 ka=((t="")=>{try{return!!new RegExp("(?<=1)(?<!1)"+t)}catch{return!1}})(),P={codeRemoveIndent:/^(?: {0,3}\t| {1,4})/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,endingSpaceTabChar:/[ \t]$/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,leadingSpaceTab:/^[ \t]+/,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,numericCharacterReference:/&#(?:(\d{1,7})|[Xx]([A-Fa-f0-9]{1,6}));/g,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:t=>new RegExp(`^( {0,3}${t})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:qe(t=>new RegExp(`^ {0,${t}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`)),hrRegex:qe(t=>new RegExp(`^ {0,${t}}((?:-[ ]*){3,}|(?:_[ ]*){3,}|(?:\\*[ ]*){3,})(?:\\n+|$)`)),fencesBeginRegex:qe(t=>new RegExp(`^ {0,${t}}(?:\`\`\`|~~~)`)),headingBeginRegex:qe(t=>new RegExp(`^ {0,${t}}#`)),htmlBeginRegex:qe(t=>new RegExp(`^ {0,${t}}(?:</?(?:${st})(?: +|$|/?>)|<(?:script|pre|style|textarea|!--))`,"i")),blockquoteBeginRegex:qe(t=>new RegExp(`^ {0,${t}}>`))},ba=/^(?:[ \t]*(?:\n|$))+/,va=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,xa=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,nt=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,ya=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,wn=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,si=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |fences|blockquote|heading|hr|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,ii=y(si).replace(/bull/g,wn).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}(?:\s|$)/).replace(/hr/g,/ {0,3}(?:(?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),wa=y(si).replace(/bull/g,wn).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}(?:\s|$)/).replace(/hr/g,/ {0,3}(?:(?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),$n=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table|[ \t]+\n)[^\n]+)*)/,$a=/^[^\n]+/,Sn=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,Sa=y(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",Sn).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),Aa=y(/^(bull)([ \t][^\n]*?)?(?:\n|$)/).replace(/bull/g,wn).getRegex(),st="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",An=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,Ca=y("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n*|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>[^\\n]*\\n*|$)|<![A-Z][\\s\\S]*?(?:>[^\\n]*\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>[^\\n]*\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][a-z0-9-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][a-z0-9-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",An).replace("tag",st).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),ri=t=>y($n).replace("hr",nt).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace("list",t).replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",st).getRegex(),Ta=ri(/ {0,3}(?:[*+-]|1[.)])[ \t]+[^ \t\n]/),Ea=ri(/ {0,3}(?:[*+-]|\d{1,9}[.)])(?:[ \t]|\n|$)/),Ra=y(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",Ea).getRegex(),Cn={blockquote:Ra,code:va,def:Sa,fences:xa,heading:ya,hr:nt,html:Ca,lheading:ii,list:Aa,newline:ba,paragraph:Ta,table:Ee,text:$a},oi=y("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",nt).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",st).getRegex(),_a={...Cn,lheading:wa,table:oi,paragraph:y($n).replace("hr",nt).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",oi).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]+[^ \\t\\n]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",st).getRegex()},La={...Cn,html:y(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",An).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:Ee,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:y($n).replace("hr",nt).replace("heading",` *#{1,6} *[^
493
- ]`).replace("lheading",ii).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},Oa=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,Pa=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,ai=/^( {2,}|\\)\n(?!\s*$)[ \t]*/,za=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,ne=/[\p{P}\p{S}]/u,Be=/[\s\p{P}\p{S}]/u,it=/[^\s\p{P}\p{S}]/u,Ma=y(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,Be).getRegex(),Ia=/[\p{Pi}\p{Ps}"']/u,li=/(?!~)[\p{P}\p{S}]/u,Na=/(?!~)[\s\p{P}\p{S}]/u,Da=/(?:[^\s\p{P}\p{S}]|~)/u,ja=y(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",ka?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),ci=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,qa=y(ci,"u").replace(/punct/g,ne).getRegex(),Ba=y(ci,"u").replace(/punct/g,li).getRegex(),Ua=/^(?:\*+(?:((?!\*)(?!openQuote)punct)|([^\s*]))?)|^_+(?:((?!_)(?!openQuote)punct)|([^\s_]))?/,Ha=y(Ua,"u").replace(/openQuote/g,Ia).replace(/punct/g,ne).getRegex(),di="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",Fa=y(di,"gu").replace(/notPunctSpace/g,it).replace(/punctSpace/g,Be).replace(/punct/g,ne).getRegex(),Wa=y(di,"gu").replace(/notPunctSpace/g,Da).replace(/punctSpace/g,Na).replace(/punct/g,li).getRegex(),Va="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)[\\s](\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|(?:(?!\\*)punct|notPunctSpace)(\\*+)(?!\\*)(?=notPunctSpace)",Ka=y(Va,"gu").replace(/notPunctSpace/g,it).replace(/punctSpace/g,Be).replace(/punct/g,ne).getRegex(),Ga=y("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,it).replace(/punctSpace/g,Be).replace(/punct/g,ne).getRegex(),Za="^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)[\\s](_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)|(?:(?!_)punct|notPunctSpace)(_+)(?!_)(?=notPunctSpace)",Ya=y(Za,"gu").replace(/notPunctSpace/g,it).replace(/punctSpace/g,Be).replace(/punct/g,ne).getRegex(),Ja=y(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,ne).getRegex(),Xa="^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)",Qa=y(Xa,"gu").replace(/notPunctSpace/g,it).replace(/punctSpace/g,Be).replace(/punct/g,ne).getRegex(),el=y(/\\(punct)/,"gu").replace(/punct/g,ne).getRegex(),tl=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(),nl=y(An).replace("(?:-->|$)","-->").getRegex(),sl=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",nl).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),pi=/\[(?:\\[\s\S]|[^\[\]\\])*\]/,Lt=y(/(?:\[(?:brackets|\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/).replace("brackets",pi).getRegex(),il=y(/^!?\[(label)\]\([ \t\n]*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?[ \t\n]*\)/).replace("label",Lt).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]+|(?=\))/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),rl=y(/^!?\[(label)\]\[(ref)\]/).replace("label",Lt).replace("ref",Sn).getRegex(),ol=y(/^!?\[(ref)\](?:\[\])?/).replace("ref",Sn).getRegex(),hi=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\]){1,999}/,al=y(/(?:[^\[\]\\`]*(?:\[(?:brackets|\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\]))){0,999}?[^\[\]\\`]*?/).replace("brackets",pi).getRegex(),ll=y("reflink|nolink(?!\\()","g").replace("reflink",y(/^!?\[(label)\]\[(ref)\]/).replace("label",al).replace("ref",hi).getRegex()).replace("nolink",y(/^!?\[(ref)\](?:\[\])?/).replace("ref",hi).getRegex()).getRegex(),ui=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,cl=/[A-Za-z0-9._+-]+@[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![\w-])/,dl=y(/(?:mailto:email|xmpp:email(?:\/[A-Za-z0-9@.]+)?)/).replace(/email/g,cl).getRegex(),Tn={_backpedal:Ee,anyPunctuation:el,autolink:tl,blockSkip:ja,br:ai,code:Pa,del:Ee,delLDelim:Ee,delRDelim:Ee,emStrongLDelim:qa,emStrongRDelimAst:Fa,emStrongRDelimUnd:Ga,escape:Oa,link:il,nolink:ol,punctuation:Ma,reflink:rl,reflinkSearch:ll,tag:sl,text:za,url:Ee},pl={...Tn,emStrongLDelim:Ha,emStrongRDelimAst:Ka,emStrongRDelimUnd:Ya,link:y(/^!?\[(label)\]\((.*?)\)/).replace("label",Lt).getRegex(),reflink:y(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Lt).getRegex()},En={...Tn,emStrongRDelimAst:Wa,emStrongLDelim:Ba,delLDelim:Ja,delRDelim:Qa,url:y(/^emailProtocol|^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("emailProtocol",dl).replace("protocol",ui).replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![\w-])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:y(/^(?:[^a-zA-Z0-9](?=emailProtocol)|(`+|~+|[^`~])(?:(?=[`~])|(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9](?=emailProtocol)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@))))/).replace("protocol",ui).replace(/emailProtocol/g,/(?:mailto|xmpp):/).getRegex()},hl={...En,br:y(ai).replace("{2,}","*").getRegex(),text:y(En.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},Ot={normal:Cn,gfm:_a,pedantic:La},rt={normal:Tn,gfm:En,breaks:hl,pedantic:pl},ul={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},fi=t=>ul[t];function q(t,e){if(e){if(P.escapeTest.test(t))return t.replace(P.escapeReplace,fi)}else if(P.escapeTestNoEncode.test(t))return t.replace(P.escapeReplaceNoEncode,fi);return t}function fl(t){return t.replace(P.numericCharacterReference,(e,n,s)=>{let i=n===void 0?Number.parseInt(s,16):Number.parseInt(n,10);return i===0||i>1114111||i>=55296&&i<=57343?"\uFFFD":String.fromCodePoint(i)})}function gi(t){try{t=encodeURI(t).replace(P.percentDecode,"%")}catch{return null}return t}function mi(t,e){let n=t.replace(P.findPipe,(r,o,a)=>{let l=!1,c=o;for(;--c>=0&&a[c]==="\\";)l=!l;return l?"|":" |"}),s=n.split(P.splitPipe),i=0;if(s[0].trim()||s.shift(),s.length>0&&!s.at(-1)?.trim()&&s.pop(),e)if(s.length>e)s.splice(e);else for(;s.length<e;)s.push("");for(;i<s.length;i++)s[i]=s[i].trim().replace(P.slashPipe,"|");return s}function fe(t,e,n){let s=t.length;if(s===0)return"";let i=0;for(;i<s&&t.charAt(s-i-1)===e;)i++;return t.slice(0,s-i)}function ki(t){let e=t.split(`
494
- `),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 Pt(t){return t.trim().toLowerCase().toUpperCase().toLowerCase()}function bi(t,e){if(t.indexOf(e[0])===-1&&t.indexOf(e[1])===-1)return-1;let n=0;for(let s=0;s<t.length;s++)if(t[s]==="\\")s++;else if(t[s]===e[0])n++;else if(t[s]===e[1]&&(n--,n<0))return s;return n>0?-2:-1}function vi(t,e=0){let n=e,s="";for(let i of t)if(i===" "){let r=4-n%4;s+=" ".repeat(r),n+=r}else s+=i,n++;return s}function xi(t,e,n,s,i){let r=e.href,o=e.title||null,a=t[1].replace(i.other.outputLinkReplace,"$1"),l=t[0].charAt(0)==="!";s.state.inLink=!0;let c=s.state.linkEmitted,p=s.state.inRawBlock;s.state.linkEmitted=!1;let d=s.inlineTokens(a),h=s.state.linkEmitted;if(s.state.linkEmitted=c,s.state.inLink=!1,!l){if(h){s.state.inRawBlock=p;return}s.state.linkEmitted=!0}return{type:l?"image":"link",raw:n,href:r,title:o,text:a,tokens:d}}function gl(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 yi(t,e,n,s){if(!e.includes("<"))return!1;for(let i=0;i<e.length;i++){if(e[i]==="\\"){i++;continue}if(e[i]==="`"){let a=s.inline.code.exec(e.slice(i));if(a){i+=a[0].length-1;continue}}if(e[i]!=="<")continue;let r=t.slice(n+i),o=s.inline.tag.exec(r)||s.inline.autolink.exec(r);if(o){if(o[0].length>e.length-i)return!0;i+=o[0].length-1}}return!1}var zt=class{options;rules;lexer;constructor(t){this.options=t||Te}space(t){let e=this.rules.block.newline.exec(t);if(e&&e[0].length>0)return{type:"space",raw:e[0]}}code(t){let e=this.rules.block.code.exec(t);if(e){let n=this.options.pedantic?e[0]:ki(e[0]),s=n.replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:n,codeBlockStyle:"indented",text:s}}}fences(t){let e=this.rules.block.fences.exec(t);if(e){let n=e[0],s=gl(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,""),m=this.blockquote(k);r[r.length-1]=m;let x=k.substring(m.raw.length).replace(/^\n/,""),$=x?x.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)+m.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?vi(d,h):d.replace(this.rules.other.leadingSpaceTab,x=>vi(x,h)),f=t.split(`
515
- `,1)[0],k=!u.trim(),m=0;if(this.options.pedantic?(m=2,p=u.trimStart()):k?m=h+1:(m=u.search(this.rules.other.nonSpaceChar),m=m>4?1:m,p=u.slice(m),m+=h),k&&this.rules.other.blankLine.test(f)&&(c+=f+`
516
- `,t=t.substring(f.length+1),l=!0),!l){let x=this.rules.other.nextBulletRegex(m),$=this.rules.other.hrRegex(m),A=this.rules.other.fencesBeginRegex(m),R=this.rules.other.headingBeginRegex(m),I=this.rules.other.htmlBeginRegex(m),O=this.rules.other.blockquoteBeginRegex(m);for(;t;){let U=t.split(`
517
- `,1)[0],M;if(f=U,this.options.pedantic?(f=f.replace(this.rules.other.listReplaceNesting," "),M=f):M=f.replace(this.rules.other.leadingSpaceTab,te=>te.replace(this.rules.other.tabCharGlobal," ")),A.test(f)||R.test(f)||I.test(f)||O.test(f)||x.test(f)||$.test(f))break;if(M.search(this.rules.other.nonSpaceChar)>=m||!f.trim())p+=`
518
- `+M.slice(m);else{if(k||u.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||A.test(u)||R.test(u)||$.test(u))break;p+=`
519
- `+f}k=!f.trim(),c+=U+`
520
- `,t=t.substring(U.length+1),u=M.slice(m)}}i.loose||(o?i.loose=!0:this.rules.other.doubleBlankLine.test(c)&&(o=!0)),i.items.push({type:"list_item",raw:c,task:!!this.options.gfm&&this.rules.other.listIsTask.test(p),loose:!1,text:p,tokens:[]}),i.raw+=c}let a=i.items.at(-1);if(a)a.raw=a.raw.trimEnd(),a.text=a.text.trimEnd();else return;i.raw=i.raw.trimEnd();for(let l of i.items)if(this.lexer.state.top=!1,l.tokens=this.lexer.blockTokens(l.text,[]),!i.loose){let c=l.tokens.filter(d=>d.type==="space"),p=c.length>0&&c.some(d=>this.rules.other.anyLine.test(d.raw));i.loose=p}for(let l of i.items){let c=l.tokens[0];if(l.task&&(c?.type==="text"||c?.type==="paragraph")){l.text=l.text.replace(this.rules.other.listReplaceTask,""),c.raw=c.raw.replace(this.rules.other.listReplaceTask,""),c.text=c.text.replace(this.rules.other.listReplaceTask,"");for(let d=this.lexer.inlineQueue.length-1;d>=0;d--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[d].src)){this.lexer.inlineQueue[d].src=this.lexer.inlineQueue[d].src.replace(this.rules.other.listReplaceTask,"");break}let p=this.rules.other.listTaskCheckbox.exec(l.raw);if(p){let d={type:"checkbox",raw:p[0]+" ",checked:p[0]!=="[ ]"};l.checked=d.checked,i.loose?l.tokens[0]&&["paragraph","text"].includes(l.tokens[0].type)&&"tokens"in l.tokens[0]&&l.tokens[0].tokens?(l.tokens[0].raw=d.raw+l.tokens[0].raw,l.tokens[0].text=d.raw+l.tokens[0].text,l.tokens[0].tokens.unshift(d)):l.tokens.unshift({type:"paragraph",raw:d.raw,text:d.raw,tokens:[d]}):l.tokens.unshift(d)}}else l.task&&(l.task=!1)}if(i.loose)for(let l of i.items){l.loose=!0;for(let c of l.tokens)c.type==="text"&&(c.type="paragraph")}return i}}html(t){let e=this.rules.block.html.exec(t);if(e){let n=ki(e[0]);return{type:"html",block:!0,raw:n,pre:e[1]==="pre"||e[1]==="script"||e[1]==="style",text:n}}}def(t){let e=this.rules.block.def.exec(t);if(e){if(!this.rules.other.startAngleBracket.test(e[2])&&bi(e[2],"()")!==-1)return;let n=Pt(e[1]).replace(this.rules.other.multipleSpaceGlobal," "),s=e[2]?e[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",i=e[3]?e[3].substring(1,e[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):e[3];return{type:"def",tag:n,raw:fe(e[0],`
521
- `),href:s,title:i}}}table(t){let e=this.rules.block.table.exec(t);if(!e||!this.rules.other.tableDelimiter.test(e[2]))return;let n=mi(e[1]),s=e[2].replace(this.rules.other.tableAlignChars,"").split("|"),i=e[3]?.trim()?e[3].replace(this.rules.other.tableRowBlankLine,"").split(`
522
- `):[],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(mi(o,r.header.length).map((a,l)=>({text:a,tokens:this.lexer.inline(a),header:!1,align:r.align[l]})));return r}}lheading(t){let e=this.rules.block.lheading.exec(t);if(e){let n=e[1].trim();return{type:"heading",raw:fe(e[0],`
524
- `),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&&yi(t,e[1],n,this.rules))return;let s=e[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(s)){if(!this.rules.other.endAngleBracket.test(s))return;let o=fe(s.slice(0,-1),"\\");if((s.length-o.length)%2===0)return}else{let o=bi(e[2],"()");if(o===-2)return;if(o>-1){let a=(e[0].indexOf("!")===0?5:4)+e[1].length+o;e[2]=e[2].substring(0,o),e[0]=e[0].substring(0,a).trim(),e[3]=""}}let i=e[2],r="";if(this.options.pedantic){let o=this.rules.other.pedanticHrefTitle.exec(i);o&&(i=o[1],r=o[3])}else r=e[3]?e[3].slice(1,-1):"";return i=i.trim(),this.rules.other.startAngleBracket.test(i)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(s)?i=i.slice(1):i=i.slice(1,-1)),xi(e,{href:i&&i.replace(this.rules.inline.anyPunctuation,"$1"),title:r&&r.replace(this.rules.inline.anyPunctuation,"$1")},e[0],this.lexer,this.rules)}}reflink(t,e){let n;if((n=this.rules.inline.reflink.exec(t))||(n=this.rules.inline.nolink.exec(t))){let s=n[0].charAt(0)==="!"?2:1;if(!this.options.pedantic&&yi(t,n[1],s,this.rules))return;let i=(n[2]||n[1]).replace(this.rules.other.multipleSpaceGlobal," "),r=e[Pt(i)];if(!r){let o=n[0].charAt(0);return{type:"text",raw:o,text:o}}return xi(n,r,n[0],this.lexer,this.rules)}}emStrong(t,e,n=""){let s=this.rules.inline.emStrongLDelim.exec(t);if(!(!s||!s[1]&&!s[2]&&!s[3]&&!s[4]||s[4]&&n.match(this.rules.other.unicodeAlphaNumeric))&&(!(s[1]||s[3])||!n||this.rules.inline.punctuation.exec(n))){let i=[...s[0]].length-1,r,o,a=i,l=0,c=s[0][0],p=n===c,d=c==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(d.lastIndex=0,e=e.slice(-1*t.length+i);(s=d.exec(e))!==null;){if(r=s[1]||s[2]||s[3]||s[4]||s[5]||s[6],!r)continue;if(o=[...r].length,s[3]||s[4]){a+=o;continue}else if(s[5]||s[6]){if(i%3&&!((i+o)%3)){l+=o;continue}if(p)break}if(a-=o,a>0)continue;o=Math.min(o,o+a+l);let h=[...s[0]][0].length,u=t.slice(0,i+s.index+h+o);if(Math.min(i,o)%2){let k=u.slice(1,-1);return{type:"em",raw:u,text:k,tokens:this.lexer.inlineTokens(k)}}let f=u.slice(2,-2);return{type:"strong",raw:u,text:f,tokens:this.lexer.inlineTokens(f)}}}}codespan(t){let e=this.rules.inline.code.exec(t);if(e){let n=e[2].replace(this.rules.other.newLineCharGlobal," "),s=this.rules.other.nonSpaceChar.test(n),i=this.rules.other.startingSpaceChar.test(n)&&this.rules.other.endingSpaceChar.test(n);return s&&i&&(n=n.substring(1,n.length-1)),{type:"codespan",raw:e[0],text:n}}}br(t){let e=this.rules.inline.br.exec(t);if(e)return{type:"br",raw:e[0]}}del(t,e,n=""){let s=this.rules.inline.delLDelim.exec(t);if(s&&(!s[1]||!n||this.rules.inline.punctuation.exec(n))){let i=[...s[0]].length-1,r,o,a=i,l=this.rules.inline.delRDelim;for(l.lastIndex=0,e=e.slice(-1*t.length+i);(s=l.exec(e))!==null;){if(r=s[1]||s[2]||s[3]||s[4]||s[5]||s[6],!r||(o=[...r].length,o!==i))continue;if(s[3]||s[4]){a+=o;continue}if(a-=o,a>0)continue;o=Math.min(o,o+a);let c=[...s[0]][0].length,p=t.slice(0,i+s.index+c+o),d=p.slice(i,-i);return{type:"del",raw:p,text:d,tokens:this.lexer.inlineTokens(d)}}}}autolink(t){let e=this.rules.inline.autolink.exec(t);if(e){let n,s;return e[2]==="@"?(n=e[1],s="mailto:"+n):(n=e[1],s=n),{type:"link",raw:e[0],text:n,href:s,autolink:!0,tokens:[{type:"text",raw:n,text:n}]}}}url(t){let e;if(e=this.rules.inline.url.exec(t)){let n,s;if(e[2]==="@")n=e[0],s="mailto:"+n;else{let i;do i=e[0],e[0]=this.rules.inline._backpedal.exec(e[0])?.[0]??"";while(i!==e[0]);n=e[0],e[1]==="www."?s="http://"+e[0]:s=e[0]}return{type:"link",raw:e[0],text:n,href:s,autolink:!0,tokens:[{type:"text",raw:n,text:n}]}}}inlineText(t){let e=this.rules.inline.text.exec(t);if(e){let n=this.lexer.state.inRawBlock;return{type:"text",raw:e[0],text:n?e[0]:fl(e[0]),escaped:n}}}},K=class $s{tokens;options;state;inlineQueue;tokenizer;constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||Te,this.options.tokenizer=this.options.tokenizer||new zt,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,linkEmitted:!1,linkParenPossible:!0,top:!0};let n={other:P,block:Ot.normal,inline:rt.normal};this.options.pedantic?(n.block=Ot.pedantic,n.inline=rt.pedantic):this.options.gfm&&(n.block=Ot.gfm,this.options.breaks?n.inline=rt.breaks:n.inline=rt.gfm),this.tokenizer.rules=n}static get rules(){return{block:Ot,inline:rt}}static lex(e,n){return new $s(n).lex(e)}static lexInline(e,n){return new $s(n).inlineTokens(e)}lex(e){e=e.replace(P.carriageReturn,`
526
- `),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,Pt(i.slice(r+1,-1))))&&!(r>1&&this.linkInText(i.slice(1,r-1))))return!0}return!1}inlineTokens(e,n=[]){this.tokenizer.lexer=this;let s=this.state.linkParenPossible;this.state.linkParenPossible=s&&e.includes(")");try{return this.#e(e,n)}finally{this.state.linkParenPossible=s}}#e(e,n){let s=e;if(this.tokens.links&&e.includes("[")){let a=this.tokenizer.rules.inline.reflinkSearch,l=c=>{let p=c.lastIndexOf("[");if(!Object.hasOwn(this.tokens.links,Pt(c.slice(p+1,-1))))return c;if(p>1&&c.charAt(0)!=="!"){let d=c.slice(1,p-1);if(this.linkInText(d))return"["+d.replace(a,l)+"]["+"a".repeat(c.length-p-2)+"]"}return"["+"a".repeat(c.length-2)+"]"};s=s.replace(a,l)}s=s.replace(this.tokenizer.rules.inline.anyPunctuation,a=>"+".repeat(a.length)),s=s.replace(this.tokenizer.rules.inline.blockSkip,(a,l,c)=>{let p=c?c.length:0;return a.slice(0,p)+"["+"a".repeat(a.length-p-2)+"]"}),s=this.options.hooks?.emStrongMask?.call({lexer:this},s)??s;let i=!1,r="",o=1/0;for(;e;){if(e.length<o)o=e.length;else{this.infiniteLoopError(e.charCodeAt(0));break}i||(r=""),i=!1;let a;if(this.options.extensions?.inline?.some(c=>(a=c.call({lexer:this},e,n))?(e=e.substring(a.raw.length),n.push(a),!0):!1))continue;if(a=this.tokenizer.escape(e)){e=e.substring(a.raw.length),n.push(a);continue}if(a=this.tokenizer.tag(e)){e=e.substring(a.raw.length),n.push(a);continue}if(a=this.tokenizer.link(e)){e=e.substring(a.raw.length),n.push(a);continue}if(a=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(a.raw.length);let c=n.at(-1);a.type==="text"&&c?.type==="text"?(c.raw+=a.raw,c.text+=a.text):n.push(a);continue}if(a=this.tokenizer.emStrong(e,s,r)){e=e.substring(a.raw.length),n.push(a);continue}if(a=this.tokenizer.codespan(e)){e=e.substring(a.raw.length),n.push(a);continue}if(a=this.tokenizer.br(e)){e=e.substring(a.raw.length),n.push(a);continue}if(a=this.tokenizer.del(e,s,r)){e=e.substring(a.raw.length),n.push(a);continue}if(a=this.tokenizer.autolink(e)){e=e.substring(a.raw.length),n.push(a);continue}if(!this.state.inLink&&(a=this.tokenizer.url(e))){e=e.substring(a.raw.length),n.push(a);continue}let l=e;if(this.options.extensions?.startInline){let c=1/0,p=e.slice(1),d;this.options.extensions.startInline.forEach(h=>{d=h.call({lexer:this},p),typeof d=="number"&&d>=0&&(c=Math.min(c,d))}),c<1/0&&c>=0&&(l=e.substring(0,c+1))}if(a=this.tokenizer.inlineText(l)){e=e.substring(a.raw.length),a.raw.slice(-1)!=="_"&&(r=a.raw.slice(-1)),i=!0;let c=n.at(-1);c?.type==="text"?(c.raw+=a.raw,c.text+=a.text):n.push(a);continue}if(e){this.infiniteLoopError(e.charCodeAt(0));break}}return n}infiniteLoopError(e){let n="Infinite loop on byte: "+e;if(this.options.silent)console.error(n);else throw new Error(n)}},Mt=class{options;parser;constructor(t){this.options=t||Te}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=gi(t);if(o===null)return r;t=q(o,i);let a='<a href="'+t+'"';return e&&(a+=' title="'+q(e)+'"'),a+=">"+r+"</a>",a}image({href:t,title:e,text:n,tokens:s}){s&&(n=this.parser.parseInline(s,this.parser.textRenderer));let i=gi(t);if(i===null)return q(n);t=i;let r=`<img src="${q(t)}" alt="${q(n)}"`;return e&&(r+=` title="${q(e)}"`),r+=">",r}text(t){return"tokens"in t&&t.tokens?this.parser.parseInline(t.tokens):"escaped"in t&&t.escaped?t.text:q(t.text)}},Rn=class{strong({text:t}){return t}em({text:t}){return t}codespan({text:t}){return t}del({text:t}){return t}html({text:t}){return t}text({text:t}){return t}link({text:t}){return""+t}image({text:t}){return""+t}br(){return""}checkbox({raw:t}){return t}},G=class Ss{options;renderer;textRenderer;constructor(e){this.options=e||Te,this.options.renderer=this.options.renderer||new Mt,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new Rn}static parse(e,n){return new Ss(n).parse(e)}static parseInline(e,n){return new Ss(n).parseInline(e)}parse(e){this.renderer.parser=this;let n="";for(let s=0;s<e.length;s++){let i=e[s];if(this.options.extensions?.renderers?.[i.type]){let o=i,a=this.options.extensions.renderers[o.type].call({parser:this},o);if(a!==!1||!["space","hr","heading","code","table","blockquote","list","checkbox","html","def","paragraph","text"].includes(o.type)){n+=a||"";continue}}let r=i;switch(r.type){case"space":{n+=this.renderer.space(r);break}case"hr":{n+=this.renderer.hr(r);break}case"heading":{n+=this.renderer.heading(r);break}case"code":{n+=this.renderer.code(r);break}case"table":{n+=this.renderer.table(r);break}case"blockquote":{n+=this.renderer.blockquote(r);break}case"list":{n+=this.renderer.list(r);break}case"checkbox":{n+=this.renderer.checkbox(r);break}case"html":{n+=this.renderer.html(r);break}case"def":{n+=this.renderer.def(r);break}case"paragraph":{n+=this.renderer.paragraph(r);break}case"text":{n+=this.renderer.text(r);break}default:{let o='Token with "'+r.type+'" type was not found.';if(this.options.silent)return console.error(o),"";throw new Error(o)}}}return n}parseInline(e,n=this.renderer){this.renderer.parser=this;let s="";for(let i=0;i<e.length;i++){let r=e[i];if(this.options.extensions?.renderers?.[r.type]){let a=this.options.extensions.renderers[r.type].call({parser:this},r);if(a!==!1||!["escape","html","link","image","checkbox","strong","em","codespan","br","del","text"].includes(r.type)){s+=a||"";continue}}let o=r;switch(o.type){case"escape":{s+=n.text(o);break}case"html":{s+=n.html(o);break}case"link":{s+=n.link(o);break}case"image":{s+=n.image(o);break}case"checkbox":{s+=n.checkbox(o);break}case"strong":{s+=n.strong(o);break}case"em":{s+=n.em(o);break}case"codespan":{s+=n.codespan(o);break}case"br":{s+=n.br(o);break}case"del":{s+=n.del(o);break}case"text":{s+=n.text(o);break}default:{let a='Token with "'+o.type+'" type was not found.';if(this.options.silent)return console.error(a),"";throw new Error(a)}}}return s}},ot=class{options;block;constructor(t){this.options=t||Te}static passThroughHooks=new Set(["preprocess","postprocess","processAllTokens","emStrongMask"]);static passThroughHooksRespectAsync=new Set(["preprocess","postprocess","processAllTokens"]);preprocess(t){return t}postprocess(t){return t}processAllTokens(t){return t}emStrongMask(t){return t}provideLexer(t=this.block){return t?K.lex:K.lexInline}provideParser(t=this.block){return t?G.parse:G.parseInline}},wi=class{defaults=yn();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=G;Renderer=Mt;TextRenderer=Rn;Lexer=K;Tokenizer=zt;Hooks=ot;constructor(...t){this.use(...t)}walkTokens(t,e){let n=[];for(let s of t)switch(n=n.concat(e.call(this,s)),s.type){case"table":{let i=s;for(let r of i.header)n=n.concat(this.walkTokens(r.tokens,e));for(let r of i.rows)for(let o of r)n=n.concat(this.walkTokens(o.tokens,e));break}case"list":{let i=s;n=n.concat(this.walkTokens(i.items,e));break}default:{let i=s;this.defaults.extensions?.childTokens?.[i.type]?this.defaults.extensions.childTokens[i.type].forEach(r=>{let o=i[r].flat(1/0);n=n.concat(this.walkTokens(o,e))}):i.tokens&&(n=n.concat(this.walkTokens(i.tokens,e)))}}return n}use(...t){let e=this.defaults.extensions||{renderers:{},childTokens:{}};return t.forEach(n=>{let s={...n};if(s.async=this.defaults.async||s.async||!1,n.extensions&&(n.extensions.forEach(i=>{if(!i.name)throw new Error("extension name required");if("renderer"in i){let r=e.renderers[i.name];r?e.renderers[i.name]=function(...o){let a=i.renderer.apply(this,o);return a===!1&&(a=r.apply(this,o)),a}:e.renderers[i.name]=i.renderer}if("tokenizer"in i){if(!i.level||i.level!=="block"&&i.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let r=e[i.level];r?r.unshift(i.tokenizer):e[i.level]=[i.tokenizer],i.start&&(i.level==="block"?e.startBlock?e.startBlock.push(i.start):e.startBlock=[i.start]:i.level==="inline"&&(e.startInline?e.startInline.push(i.start):e.startInline=[i.start]))}"childTokens"in i&&i.childTokens&&(e.childTokens[i.name]=i.childTokens)}),s.extensions=e),n.renderer){let i=this.defaults.renderer||new Mt(this.defaults);for(let r in n.renderer){if(!(r in i))throw new Error(`renderer '${r}' does not exist`);if(["options","parser"].includes(r))continue;let o=r,a=n.renderer[o],l=i[o];i[o]=(...c)=>{let p=a.apply(i,c);return p===!1&&(p=l.apply(i,c)),p||""}}s.renderer=i}if(n.tokenizer){let i=this.defaults.tokenizer||new zt(this.defaults);for(let r in n.tokenizer){if(!(r in i))throw new Error(`tokenizer '${r}' does not exist`);if(["options","rules","lexer"].includes(r))continue;let o=r,a=n.tokenizer[o],l=i[o];i[o]=(...c)=>{let p=a.apply(i,c);return p===!1&&(p=l.apply(i,c)),p}}s.tokenizer=i}if(n.hooks){let i=this.defaults.hooks||new ot;for(let r in n.hooks){if(!(r in i))throw new Error(`hook '${r}' does not exist`);if(["options","block"].includes(r))continue;let o=r,a=n.hooks[o],l=i[o];ot.passThroughHooks.has(r)?i[o]=c=>{if(this.defaults.async&&ot.passThroughHooksRespectAsync.has(r))return(async()=>{let d=await a.call(i,c);return l.call(i,d)})();let p=a.call(i,c);return l.call(i,p)}:i[o]=(...c)=>{if(this.defaults.async)return(async()=>{let d=await a.apply(i,c);return d===!1&&(d=await l.apply(i,c)),d})();let p=a.apply(i,c);return p===!1&&(p=l.apply(i,c)),p}}s.hooks=i}if(n.walkTokens){let i=this.defaults.walkTokens,r=n.walkTokens;s.walkTokens=function(o){let a=[];return a.push(r.call(this,o)),i&&(a=a.concat(i.call(this,o))),a}}this.defaults={...this.defaults,...s}}),this}setOptions(t){return this.defaults={...this.defaults,...t},this}lexer(t,e){return K.lex(t,e??this.defaults)}parser(t,e){return G.parse(t,e??this.defaults)}parseMarkdown(t){return(e,n)=>{let s={...n},i={...this.defaults,...s},r=this.onError(!!i.silent,!!i.async);if(this.defaults.async===!0&&s.async===!1)return r(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof e>"u"||e===null)return r(new Error("marked(): input parameter is undefined or null"));if(typeof e!="string")return r(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(e)+", string expected"));if(i.hooks&&(i.hooks.options=i,i.hooks.block=t),i.async)return(async()=>{let o=i.hooks?await i.hooks.preprocess(e):e,a=await(i.hooks?await i.hooks.provideLexer(t):t?K.lex:K.lexInline)(o,i),l=i.hooks?await i.hooks.processAllTokens(a):a;i.walkTokens&&await Promise.all(this.walkTokens(l,i.walkTokens));let c=await(i.hooks?await i.hooks.provideParser(t):t?G.parse:G.parseInline)(l,i);return i.hooks?await i.hooks.postprocess(c):c})().catch(r);try{i.hooks&&(e=i.hooks.preprocess(e));let o=(i.hooks?i.hooks.provideLexer(t):t?K.lex:K.lexInline)(e,i);i.hooks&&(o=i.hooks.processAllTokens(o)),i.walkTokens&&this.walkTokens(o,i.walkTokens);let a=(i.hooks?i.hooks.provideParser(t):t?G.parse:G.parseInline)(o,i);return i.hooks&&(a=i.hooks.postprocess(a)),a}catch(o){return r(o)}}}onError(t,e){return n=>{if(n.message+=`
558
- Please report this to https://github.com/markedjs/marked.`,t){let s="<p>An error occurred:</p><pre>"+q(n.message+"",!0)+"</pre>";return e?Promise.resolve(s):s}if(e)return Promise.reject(n);throw n}}},Re=new wi;function T(t,e){return Re.parse(t,e)}T.options=T.setOptions=function(t){return Re.setOptions(t),T.defaults=Re.defaults,ni(T.defaults),T},T.getDefaults=yn,T.defaults=Te;function ml(...t){return Re.use(...t),T.defaults=Re.defaults,ni(T.defaults),T}T.use=ml,T.walkTokens=function(t,e){return Re.walkTokens(t,e)},T.parseInline=Re.parseInline,T.Parser=G,T.parser=G.parse,T.Renderer=Mt,T.TextRenderer=Rn,T.Lexer=K,T.lexer=K.lex,T.Tokenizer=zt,T.Hooks=ot,T.parse=T,T.options,T.setOptions,T.walkTokens,T.parseInline,G.parse,K.lex;const kl={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},_e=t=>t.replace(/[&<>"']/g,e=>kl[e]??e),bl=new Set(["http","https","mailto"]),$i=t=>{const e=t.replace(/[\u0000- \u007f]/g,""),n=/^([a-z][a-z0-9+.-]*):/i.exec(e)?.[1];return n===void 0||bl.has(n.toLowerCase())},vl=t=>/^https?:/i.test(t.trim()),xl=new wi({gfm:!0,breaks:!0,renderer:{html({text:t}){return _e(t)},link({href:t,title:e,tokens:n}){const s=this.parser.parseInline(n);if(!$i(t))return s;const i=e?` title="${_e(e)}"`:"",r=vl(t)?' target="_blank" rel="noopener noreferrer"':"";return`<a href="${_e(t)}"${i}${r}>${s}</a>`},image({href:t,title:e,text:n}){if(!$i(t))return _e(n);const s=e?` title="${_e(e)}"`:"";return`<img src="${_e(t)}" alt="${_e(n)}"${s}>`}}}),Si=t=>xl.parse(t,{async:!1}),yl=Rt({en:{clickToEdit:"Click to edit",unset:"Not set",edit:"Edit"},ja:{clickToEdit:"\u30AF\u30EA\u30C3\u30AF\u3057\u3066\u7DE8\u96C6",unset:"\u672A\u8A2D\u5B9A",edit:"\u7DE8\u96C6"}});class Ai extends he{static{this.styles=[_t,ti,de`
559
- /* 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 vn(this);connectedCallback(){super.connectedCallback(),this.#n+=1}constructor(){super(),this.value="",this.placeholder="",this.multiline=!1,this.wrap=!1,this.truncate=!1,this.seamless=!1,this.markdown=!1,this.label="",this.editing=!1,this.#e=""}startEditing(){this.#e=this.value,this.editing=!0}willUpdate(e){e.has("value")&&!this.editing&&(this.#e=this.value)}updated(){if(!this.editing)return;const e=this.renderRoot.querySelector(".field"),n=this.renderRoot,s=n instanceof ShadowRoot?n.activeElement:document.activeElement;e&&s!==e&&(e.focus(),e.setSelectionRange(0,e.value.length,"backward"),e.scrollLeft=0,e.scrollTop=0)}render(){const e=yl(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
- ${Zs(Si(i))}
700
- </div></span
701
- >`:b`<span class="box"
702
- ><span
703
- class="view"
704
- data-empty=${String(i==="")}
705
- aria-hidden=${s?"true":g}
706
- role=${s?g:"button"}
707
- tabindex=${s?g:"0"}
708
- title=${s?g:this.truncate&&i!==""?i:e.clickToEdit}
709
- @click=${this.#t}
710
- @keydown=${this.#i}
711
- >${r}</span
712
- >${s?this.#r(this.label||this.placeholder||e.edit,n):g}</span
713
- >`}#r(e,n){return this.multiline||this.wrap?b`<textarea
714
- class="field"
715
- rows="1"
716
- .value=${mn(this.#e)}
717
- placeholder=${n}
718
- aria-label=${e}
719
- @input=${this.#o}
720
- @keydown=${this.#l}
721
- @blur=${this.#a}
722
- ></textarea>`:b`<input
723
- class="field"
724
- .value=${mn(this.#e)}
725
- placeholder=${n}
726
- aria-label=${e}
727
- @input=${this.#o}
728
- @keydown=${this.#l}
729
- @blur=${this.#a}
730
- />`}#t=e=>{e.composedPath().some(n=>n instanceof HTMLAnchorElement)||(e.stopPropagation(),!this.editing&&(this.#e=this.value,this.editing=!0))};#i=e=>{e.isComposing||this.editing||e.target instanceof HTMLAnchorElement||(e.key==="Enter"||e.key===" ")&&(e.preventDefault(),this.editing=!0)};#o=e=>{const n=Ce(e.target,HTMLInputElement)??Ce(e.target,HTMLTextAreaElement);n!==null&&(this.#e=n.value,this.requestUpdate())};#l=e=>{if(!e.isComposing){if(e.key==="Escape"){e.preventDefault(),this.#e=this.value,this.editing=!1;return}e.key==="Enter"&&(!this.multiline||this.wrap||e.metaKey||e.ctrlKey)&&(e.preventDefault(),this.#c())}};#a=e=>{const n=e.currentTarget;if(!(n instanceof HTMLInputElement||n instanceof HTMLTextAreaElement))return;const s=this.#n,{selectionStart:i,selectionEnd:r}=n;queueMicrotask(()=>{!this.isConnected||!this.editing||(s!==this.#n?(n.focus(),n.setSelectionRange(i,r)):this.#c())})};#c=()=>{if(!this.editing)return;this.editing=!1;const n=(this.wrap?this.#e.replace(/\r?\n/g," "):this.#e).trim();n!==this.value&&this.dispatchEvent(new CustomEvent("dpk-commit",{detail:{value:n},bubbles:!0,composed:!0}))}}const wl=()=>{customElements.get("dpk-component-inline-edit")||customElements.define("dpk-component-inline-edit",Ai)},$l={lang:void 0,message:void 0,abortEarly:void 0,abortPipeEarly:void 0};function _n(t){return $l}let Sl;function Al(t){return Sl?.get(t)}let Cl;function Tl(t){return Cl?.get(t)}let El;function Rl(t,e){return El?.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 E(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??Rl(t.reference,l.lang)??(c?Tl(l.lang):null)??s.message??Al(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 Ll(t,e){return Object.prototype.hasOwnProperty.call(t,e)&&e!=="__proto__"&&e!=="prototype"&&e!=="constructor"}function Ln(t,e){const n=[...new Set(t)];return n.length>1?`(${n.join(` ${e} `)})`:n[0]??"never"}function z(t){return t["~standard"]={version:1,vendor:"valibot",validate:e=>t["~run"]({value:e},_n())},t}function Ol(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 Pl=class extends Error{constructor(t){super(t[0].message),this.name="ValiError",this.issues=t}};const zl=/^\d{4}-(?:0[1-9]|1[0-2])-(?:[12]\d|0[1-9]|3[01])$/u,Ml=/^\d{4}-(?:0[1-9]|1[0-2])-(?:[12]\d|0[1-9]|3[01])[T ](?:0\d|1\d|2[0-3])(?::[0-5]\d){2}(?:\.\d{1,9})?(?:Z| ?[+-](?:0\d|1\d|2[0-3])(?::?[0-5]\d)?)$/u;function Ci(t,e){return{kind:"validation",type:"check",reference:Ci,async:!1,expects:null,requirement:t,message:e,"~run"(n,s){return n.typed&&!this.requirement(n.value)&&E(this,"input",n,s),n}}}function Ti(t){return{kind:"validation",type:"finite",reference:Ti,async:!1,expects:null,requirement:Number.isFinite,message:t,"~run"(e,n){return e.typed&&!this.requirement(e.value)&&E(this,"finite",e,n),e}}}function Ei(t,e){const n=Ue(t);return{kind:"validation",type:"includes",reference:Ei,async:!1,expects:n,requirement:t,message:e,"~run"(s,i){return s.typed&&!s.value.includes(this.requirement)&&E(this,"content",s,i,{received:`!${n}`}),s}}}function Ri(t){return{kind:"validation",type:"integer",reference:Ri,async:!1,expects:null,requirement:Number.isInteger,message:t,"~run"(e,n){return e.typed&&!this.requirement(e.value)&&E(this,"integer",e,n),e}}}function _i(t){return{kind:"validation",type:"iso_date",reference:_i,async:!1,expects:null,requirement:zl,message:t,"~run"(e,n){return e.typed&&!this.requirement.test(e.value)&&E(this,"date",e,n),e}}}function Li(t){return{kind:"validation",type:"iso_timestamp",reference:Li,async:!1,expects:null,requirement:Ml,message:t,"~run"(e,n){return e.typed&&!this.requirement.test(e.value)&&E(this,"timestamp",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&&E(this,"length",n,s,{received:`${n.value.length}`}),n}}}function Oi(t,e){return{kind:"validation",type:"min_value",reference:Oi,async:!1,expects:`>=${t instanceof Date?t.toJSON():Ue(t)}`,requirement:t,message:e,"~run"(n,s){return n.typed&&!(n.value>=this.requirement)&&E(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)&&E(this,"format",n,s),n}}}function On(){return{kind:"transformation",type:"trim",reference:On,async:!1,"~run"(t){return t.value=t.value.trim(),t}}}function Pi(t){return{kind:"validation",type:"url",reference:Pi,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)&&E(this,"URL",e,n),e}}}const zi={abortEarly:!0};function Mi(t,e,n){return typeof t.fallback=="function"?t.fallback(e,n):t.fallback}function It(t,e,n){return typeof t.default=="function"?t.default(e,n):t.default}function Il(t,e){return!t["~run"]({value:e},zi).issues}function F(t,e){return z({kind:"schema",type:"array",reference:F,expects:"Array",async:!1,item:t,message:e,"~run"(n,s){const i=n.value;if(Array.isArray(i)){n.typed=!0,n.value=[];for(let r=0;r<i.length;r++){const o=i[r],a=this.item["~run"]({value:o},s);if(a.issues){const l={type:"array",origin:"value",input:i,key:r,value:o};for(const c of a.issues)c.path?c.path.unshift(l):c.path=[l],n.issues?.push(c);if(n.issues||(n.issues=a.issues),s.abortEarly){n.typed=!1;break}}a.typed||(n.typed=!1),n.value.push(a.value)}}else E(this,"type",n,s);return n}})}function Ii(t){return z({kind:"schema",type:"boolean",reference:Ii,expects:"boolean",async:!1,message:t,"~run"(e,n){return typeof e.value=="boolean"?e.typed=!0:E(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 Ni(t){return z({kind:"schema",type:"lazy",reference:Ni,expects:"unknown",async:!1,getter:t,"~run"(e,n){return this.getter(e.value)["~run"](e,n)}})}function me(t,e){return z({kind:"schema",type:"literal",reference:me,expects:Ue(t),async:!1,literal:t,message:e,"~run"(n,s){return _l(n.value,this.literal)?n.typed=!0:E(this,"type",n,s),n}})}function Di(t,e){return z({kind:"schema",type:"nullable",reference:Di,expects:`(${t.expects} | null)`,async:!1,wrapped:t,default:e,"~run"(n,s){return n.value===null&&(this.default!==void 0&&(n.value=It(this,n,s)),n.value===null)?(n.typed=!0,n):this.wrapped["~run"](n,s)}})}function ji(t){return z({kind:"schema",type:"number",reference:ji,expects:"number",async:!1,message:t,"~run"(e,n){return typeof e.value=="number"&&!isNaN(e.value)?e.typed=!0:E(this,"type",e,n),e}})}function L(t,e){return z({kind:"schema",type:"object",reference:L,expects:"Object",async:!1,entries:t,message:e,"~run"(n,s){const i=n.value;if(i&&typeof i=="object"){n.typed=!0,n.value={};for(const r in this.entries){const o=this.entries[r];if(r in i||(o.type==="exact_optional"||o.type==="optional"||o.type==="nullish")&&o.default!==void 0){const a=r in i?i[r]:It(o),l=o["~run"]({value:a},s);if(l.issues){const c={type:"object",origin:"value",input:i,key:r,value:a};for(const p of l.issues)p.path?p.path.unshift(c):p.path=[c],n.issues?.push(p);if(n.issues||(n.issues=l.issues),s.abortEarly){n.typed=!1;break}}l.typed||(n.typed=!1),n.value[r]=l.value}else if(o.fallback!==void 0)n.value[r]=Mi(o);else if(o.type!=="exact_optional"&&o.type!=="optional"&&o.type!=="nullish"&&(E(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 E(this,"type",n,s);return n}})}function se(t,e){return z({kind:"schema",type:"optional",reference:se,expects:`(${t.expects} | undefined)`,async:!1,wrapped:t,default:e,"~run"(n,s){return n.value===void 0&&(this.default!==void 0&&(n.value=It(this,n,s)),n.value===void 0)?(n.typed=!0,n):this.wrapped["~run"](n,s)}})}function Nt(t,e){return z({kind:"schema",type:"picklist",reference:Nt,expects:Ln(t.map(Ue),"|"),async:!1,options:t,message:e,"~run"(n,s){return this.options.includes(n.value)?n.typed=!0:E(this,"type",n,s),n}})}function He(t,e,n){return z({kind:"schema",type:"record",reference:He,expects:"Object",async:!1,key:t,value:e,message:n,"~run"(s,i){const r=s.value;if(r&&typeof r=="object"){s.typed=!0,s.value={};for(const o in r)if(Ll(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 E(this,"type",s,i);return s}})}function Z(t,e){return z({kind:"schema",type:"strict_object",reference:Z,expects:"Object",async:!1,entries:t,message:e,"~run"(n,s){const i=n.value;if(i&&typeof i=="object"){n.typed=!0,n.value={};for(const r in this.entries){const o=this.entries[r];if(r in i||(o.type==="exact_optional"||o.type==="optional"||o.type==="nullish")&&o.default!==void 0){const a=r in i?i[r]:It(o),l=o["~run"]({value:a},s);if(l.issues){const c={type:"object",origin:"value",input:i,key:r,value:a};for(const p of l.issues)p.path?p.path.unshift(c):p.path=[c],n.issues?.push(p);if(n.issues||(n.issues=l.issues),s.abortEarly){n.typed=!1;break}}l.typed||(n.typed=!1),n.value[r]=l.value}else if(o.fallback!==void 0)n.value[r]=Mi(o);else if(o.type!=="exact_optional"&&o.type!=="optional"&&o.type!=="nullish"&&(E(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)){E(this,"key",n,s,{input:r,expected:"never",path:[{type:"object",origin:"key",input:i,key:r,value:i[r]}]});break}}}else E(this,"type",n,s);return n}})}function v(t){return z({kind:"schema",type:"string",reference:v,expects:"string",async:!1,message:t,"~run"(e,n){return typeof e.value=="string"?e.typed=!0:E(this,"type",e,n),e}})}function qi(t){let e;if(t)for(const n of t)if(e)for(const s of n.issues)e.push(s);else e=n.issues;return e}function Pn(t,e){return z({kind:"schema",type:"union",reference:Pn,expects:Ln(t.map(n=>n.expects),"|"),async:!1,options:t,message:e,"~run"(n,s){let i,r,o;for(const a of this.options){const l=a["~run"]({value:n.value},s);if(l.typed)if(l.issues)r?r.push(l):r=[l];else{i=l;break}else o?o.push(l):o=[l]}if(i)return i;if(r){if(r.length===1)return r[0];E(this,"type",n,s,{issues:qi(r)}),n.typed=!0}else{if(o?.length===1)return o[0];E(this,"type",n,s,{issues:qi(o)})}return n}})}function ke(){return z({kind:"schema",type:"unknown",reference:ke,expects:"unknown",async:!1,"~run"(t){return t.typed=!0,t}})}function Bi(t,e,n){return z({kind:"schema",type:"variant",reference:Bi,expects:"Object",async:!1,key:t,options:e,message:n,"~run"(s,i){const r=s.value;if(r&&typeof r=="object"){let o,a=0,l=this.key,c=[];const p=(d,h)=>{for(const u of d.options){if(u.type==="variant")p(u,new Set(h).add(u.key));else{let f=!0,k=0;for(const m of h){const x=u.entries[m];if(m in r?x["~run"]({typed:!1,value:r[m]},zi).issues:x.type!=="exact_optional"&&x.type!=="optional"&&x.type!=="nullish"){f=!1,l!==m&&(a<k||a===k&&m in r&&!(l in r))&&(a=k,l=m,c=[]),l===m&&c.push(u.entries[m].expects);break}k++}if(f){const m=u["~run"]({value:r},i);(!o||!o.typed&&m.typed)&&(o=m)}}if(o&&!o.issues)break}};if(p(this,new Set([this.key])),o)return o;E(this,"type",s,i,{input:r[l],expected:Ln(c,"|"),path:[{type:"object",origin:"value",input:r,key:l,value:r[l]}]})}else E(this,"type",s,i);return s}})}function zn(t,e,n){const s=t["~run"]({value:e},_n());if(s.issues)throw new Pl(s.issues);return s.value}function w(...t){return z({...t[0],pipe:t,"~run"(e,n){for(const s of t)if(s.kind!=="metadata"){if(e.issues&&(s.kind==="schema"||s.kind==="transformation")){e.typed=!1;break}(!e.issues||!n.abortEarly&&!n.abortPipeEarly)&&(e=s["~run"](e,n))}return e}})}function C(t,e,n){const s=t["~run"]({value:e},_n());return{typed:s.typed,success:!s.issues,output:s.value,issues:s.issues}}function Nl(t){let e="";for(const n of t){e&&(e+=`
731
- `),e+=`\xD7 ${n.message}`;const s=Ol(n);s&&(e+=`
732
- \u2192 at ${s}`)}return e}const Dt=L({type:w(v(),S(1)),id:w(v(),S(1))}),Dl=w(v(),S(1),ge(/^[A-Za-z0-9_-]+$/,'ids may only contain letters, digits, "_" and "-" (a "." builds a path)')),jl=(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},Le=L({id:w(v(),S(1)),type:w(v(),S(1)),target:Dt,payload:ke(),note:B(v()),createdAt:w(v(),S(1))}),ql=(t,e,n,s={})=>{const i=L({id:w(v(),S(1)),type:me(t),target:Dt,payload:n,note:B(v()),createdAt:w(v(),S(1))}),r=o=>{const a=C(Le,o);if(!a.success||a.output.type!==t)return null;const l=C(n,o.payload);return l.success?{id:a.output.id,type:t,target:a.output.target,payload:l.output,...a.output.note===void 0?{}:{note:a.output.note},createdAt:a.output.createdAt}:null};return{schema:i,mode:s.mode??"patch",targetType:e,actionType:t,payloadSchema:n,parse:r,...s.dedupeKey?{dedupeKey:s.dedupeKey}:{}}},Bl=(t,e)=>{const n=jt(t,e.type);if(n===void 0)return null;const s=n.parse(e);return s===null?null:s},Ul=(t,e)=>{const n=C(t.payloadSchema,e.payload);if(!n.success)throw new Error(`invalid payload for action "${e.type}"`);return n.output},jt=(t,e)=>Object.hasOwn(t,e)?t[e]:void 0,Hl=t=>{throw new Error(`unhandled action: ${JSON.stringify(t)}`)},Fl=L({id:w(v(),S(1))}),Wl=t=>{const e=C(Fl,t.payload);return`${t.type}|${e.success?e.output.id:JSON.stringify(t.payload)}`},N=t=>`${t.type}:${t.id}`,at=t=>{const e=t.indexOf(":");return e<=0?{type:"unknown",id:t}:{type:t.slice(0,e),id:t.slice(e+1)}},Mn=(t,e)=>typeof t=="string"?at(t.includes(":")?t:`${e}:${t}`):{type:t.type,id:t.id},Vl=(t,e)=>t.type===e.type&&t.id===e.id,Ui=t=>{const e=t.normalize("NFKD").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"").slice(0,40);return e.length>0?e:"item"},Kl=(t,e)=>{const n=Ui(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)}`},Hi=()=>{const t=globalThis.crypto;return t?.randomUUID?t.randomUUID():`a-${Date.now().toString(36)}-${Math.random().toString(36).slice(2,10)}`},D="comment",Oe=t=>{const[e]=t;return{path:e?.path?.map(n=>String(n.key)).join(".")??"",message:e?.message??"invalid action"}},Fi=L({type:w(v(),S(1)),target:Pn([w(v(),S(1)),Dt]),payload:se(ke()),note:B(v()),id:B(w(v(),S(1))),createdAt:B(w(v(),S(1)))}),Gl=(t,e)=>{const n=C(Fi,t);if(!n.success)return{ok:!1,issue:Oe(n.issues)};const s=n.output,i=Mn(s.target,e.targetType),r={id:s.id??Hi(),type:s.type,target:i,payload:s.payload??{},...s.note===void 0?{}:{note:s.note},createdAt:s.createdAt??new Date().toISOString()},o=C(e.schema,r);if(!o.success)return{ok:!1,issue:Oe(o.issues)};const a=C(Le,o.output);return a.success?{ok:!0,action:a.output}:{ok:!1,issue:Oe(a.issues)}},In=(t,e)=>e.dedupeKey?e.dedupeKey(t):e.mode!=="patch"?null:`${t.type}|${N(t.target)}`,Nn=(t,e,n)=>{const s=In(e,n);if(s===null)return[...t,e];const i=t.at(-1);return!i||In(i,n)!==s||!Zl(i,e)?[...t,e]:[...t.slice(0,-1),e]},Zl=(t,e)=>Vl(t.target,e.target),Dn=t=>JSON.stringify(t.map(e=>({id:e.id,type:e.type,target:e.target,payload:e.payload,...e.note===void 0?{}:{note:e.note},createdAt:e.createdAt})),null,2),Wi=L({id:w(v(),S(1)),type:me(D),target:L({type:w(v(),S(1)),id:w(v(),S(1))}),payload:L({body:w(v(),S(1))}),note:B(v()),createdAt:w(v(),S(1))}),jn={schema:Wi,mode:"append",targetType:"page"},Yl=L({body:v()}),lt=t=>{const e=C(Yl,t.payload);return e.success?e.output.body:""},qn="element",Vi=w(v(),ge(/^[A-Z][A-Z0-9_]*$/,"component action types are CONSTANT_CASE")),Ki=He(v(),ke()),Jl=L({type:me(qn),id:w(v(),ge(/^[^/]+\/.+/,"component references start with a provider id"))}),Xl=L({id:w(v(),S(1)),type:Vi,target:Jl,payload:Ki,note:B(v()),createdAt:w(v(),S(1))}),Ql={schema:Xl,mode:"sequence",targetType:qn},ec=Z({type:Vi,target:w(v(),ge(/^element:[^/]+\/.+/)),payload:se(Ki,{})}),Gi=Z({id:w(v(),S(1)),title:w(v(),S(1)),summary:B(v()),tone:B(Nt(["create","update","delete","move","meta"])),stale:B(Nt(["unsupported-action-type","target-missing","constraint-violated"]))}),Bn=t=>{if(t.type!==qn)return null;const e=t.id.indexOf("/");if(e<=0)return null;try{return decodeURIComponent(t.id.slice(0,e))}catch{return null}},J=t=>t.type!==D&&Bn(t.target)!==null,tc=(t,e)=>t.filter(n=>J(n)&&Bn(n.target)===e),Zi=(t,e)=>{const n=new Map(t.flatMap(s=>J(s)?[[s.id,Bn(s.target)]]:[]));return new Map(e.flatMap(s=>s.results.flatMap(i=>n.get(i.id)===s.id?[[i.id,i]]:[])))},Un=Object.freeze({}),qt=t=>{const e=t.startsWith("#")?t.slice(1):t;if(e.length===0)return Un;const n=new URLSearchParams(e.startsWith("?")?e.slice(1):e),s={};for(const[i,r]of n)i.length>0&&r.length>0&&(s[i]=r);return s},Fe=t=>{const e=new URLSearchParams;for(const s of Object.keys(t).sort((i,r)=>i<r?-1:i>r?1:0)){const i=t[s];i!=null&&i!==""&&e.set(s,i)}const n=e.toString();return n.length===0?"":`#${n}`},Hn=(t,e,n=[])=>{const s={...t},i=Object.keys(e).map(r=>n.indexOf(r)).filter(r=>r>=0);if(i.length>0)for(const r of n.slice(Math.min(...i)+1))Object.hasOwn(e,r)||delete s[r];for(const[r,o]of Object.entries(e))o==null||o===""?delete s[r]:s[r]=o;return s},nc=(t,e="json")=>`\`\`\`${e}
733
- ${t}
734
- \`\`\``,sc=t=>JSON.stringify({type:t.type,target:t.target,payload:t.payload,...t.note===void 0?{}:{note:t.note}},null,2),Fn=(t,e,n)=>{const{actions:s,state:i}=t,r=new Set(t.stale.map(p=>p.action.id)),o=s.filter(p=>!r.has(p.id)),a=o.filter(p=>p.type===D),l=o.filter(p=>p.type!==D),c=[];if(c.push(`# Review draft \u2014 ${e.label}`),c.push(""),c.push(`- template: \`${e.name}\``),c.push(`- framework: \`dev-process-kit@${n}\``),c.push(`- navigation: \`${Fe(t.navigation)||"(none)"}\``),c.push(`- pending: ${l.length} change(s), ${a.length} comment(s)`),t.stale.length>0&&c.push(`- stale (not applicable to the current base): ${t.stale.length}`),c.push(""),c.push("## How to apply"),c.push(""),c.push("These are patches against the base HTML, not a command log. Apply the requested end state to the meaning model, keep the stable ids of surviving concepts, and keep the base JSON free of any draft envelope."),l.some(J)&&(c.push(""),c.push("Changes targeting `element:<id>/\u2026` belong to the component with that `id` (for example a diagram): apply them to that component's own JSON, following its documented action vocabulary.")),c.push(""),a.length>0){c.push(`## Comments (${a.length})`),c.push("");for(const[p,d]of a.entries()){const h=e.describe(d,i,t.base);c.push(`${p+1}. **${h.targetLabel}** \u2014 \`${N(d.target)}\``),c.push(` > ${lt(d).replace(/\n/g,`
735
- > `)}`)}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
- ${sc(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?lt(d):u.title;c.push(`${p+1}. \`${d.type}\` on \`${N(d.target)}\` (${h}) \u2014 ${f}`)}c.push("")}return c.push("## Canonical draft (JSON)"),c.push(""),c.push(nc(Dn(s))),c.push(""),c.join(`
739
- `)},X="0.0.17",Wn=async t=>{try{if(navigator.clipboard?.writeText)return await navigator.clipboard.writeText(t),!0}catch{}const e=document.activeElement,n=document.createElement("textarea");try{return n.value=t,n.setAttribute("readonly",""),n.style.position="fixed",n.style.opacity="0",document.body.append(n),n.select(),document.execCommand("copy")}catch{return!1}finally{n.remove(),e instanceof HTMLElement&&e.focus()}},Yi=Rt({en:{heading:"Review notes",rejected:"Action rejected.",commentLabel:"Review comment",commentPlaceholder:"What should change, or what you noticed (passed to the agent as an instruction)",detach:"Detach",attachTo:t=>`Attach to this ${t}`,addNote:"Add note",empty:"No draft actions yet.",emptyHint:"Comments and structural patches both land here, and survive reload via LocalStorage.",sendToClaude:"Send to Claude",copy:"Copy changes & comments",copyTitle:"Copy the review to paste it to the agent",clear:"Clear",deleteAction:"Delete this draft action",editComment:"Edit this comment",editLabel:"Edit the comment",saveEdit:"Save",cancelEdit:"Cancel",editHint:"Ctrl/Cmd + Enter to save, Esc to cancel",wholePage:"Whole page",comment:"Comment",sent:"Sent to Claude \u2713",copied:"Copied \u2713",copyFailed:"Could not copy"},ja:{heading:"\u30EC\u30D3\u30E5\u30FC\u30CE\u30FC\u30C8",rejected:"action \u3092\u53D7\u3051\u4ED8\u3051\u3089\u308C\u307E\u305B\u3093\u3067\u3057\u305F\u3002",commentLabel:"\u30EC\u30D3\u30E5\u30FC\u30B3\u30E1\u30F3\u30C8",commentPlaceholder:"\u5909\u66F4\u3057\u305F\u3044\u3053\u3068 / \u6C17\u3065\u304D\u3092\u66F8\u304F\uFF08Agent \u3078\u306E\u6307\u793A\u3068\u3057\u3066\u6E21\u308B\uFF09",detach:"\u7D10\u3065\u3051\u3092\u89E3\u9664",attachTo:t=>`\u3053\u306E ${t} \u306B\u7D10\u3065\u3051\u308B`,addNote:"\u30CE\u30FC\u30C8\u3092\u8FFD\u52A0",empty:"draft action \u306F\u307E\u3060\u3042\u308A\u307E\u305B\u3093\u3002",emptyHint:"\u30B3\u30E1\u30F3\u30C8\u3082\u69CB\u9020\u306E\u5909\u66F4\u3082\u3053\u3053\u306B\u96C6\u307E\u308A\u3001LocalStorage \u306B\u6B8B\u308B\u306E\u3067\u30EA\u30ED\u30FC\u30C9\u3057\u3066\u3082\u6D88\u3048\u307E\u305B\u3093\u3002",sendToClaude:"Claude \u306B\u9001\u308B",copy:"\u5909\u66F4\u30FB\u30B3\u30E1\u30F3\u30C8\u3092\u30B3\u30D4\u30FC",copyTitle:"Review \u3092\u30B3\u30D4\u30FC\u3057\u3066 Agent \u306B\u8CBC\u308A\u4ED8\u3051\u308B",clear:"\u30AF\u30EA\u30A2",deleteAction:"\u3053\u306E draft action \u3092\u524A\u9664",editComment:"\u3053\u306E\u30B3\u30E1\u30F3\u30C8\u3092\u7DE8\u96C6",editLabel:"\u30B3\u30E1\u30F3\u30C8\u3092\u7DE8\u96C6",saveEdit:"\u4FDD\u5B58",cancelEdit:"\u30AD\u30E3\u30F3\u30BB\u30EB",editHint:"Ctrl/Cmd + Enter \u3067\u4FDD\u5B58\u3001Esc \u3067\u30AD\u30E3\u30F3\u30BB\u30EB",wholePage:"\u30DA\u30FC\u30B8\u5168\u4F53",comment:"\u30B3\u30E1\u30F3\u30C8",sent:"Claude \u306B\u9001\u308A\u307E\u3057\u305F \u2713",copied:"\u30B3\u30D4\u30FC\u3057\u307E\u3057\u305F \u2713",copyFailed:"\u30B3\u30D4\u30FC\u3067\u304D\u307E\u305B\u3093\u3067\u3057\u305F"}}),ic=()=>({body:"",editing:null,attachment:{kind:"page"},copy:{kind:"idle"},copyRequest:0,send:{kind:"idle"},sendRequest:0}),Ji=t=>t.kind==="explicit"?{kind:t.resume}:t,Xi=(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:Ji(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:Ji(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}}}},rc=(t,e)=>{const n=t.body.trim();return n===""?null:{target:e,body:n}},oc=t=>{if(!t.editing)return null;const e=t.editing.body.trim();return e===""?null:{id:t.editing.id,body:e}},ac={en:"English",ja:"\u65E5\u672C\u8A9E"},W=Rt({en:{review:"Review",reviewToggle:"Review / comments",useLightTheme:"Switch to light theme",useDarkTheme:"Switch to dark theme",language:"Language",versionLabel:"dev-process-kit version (reloads the page)",versionPinned:"Pinned by the page",versionLatest:t=>`${t} (latest)`,resizeSidebar:"Resize sidebar",resizeSidebarHint:"Drag to resize. Double-click to reset",collapseSidebar:"Collapse sidebar",expandSidebar:"Expand sidebar",baseDataError:"Could not read the base data (showing an empty page)",memo:"Memo",draftCount:(t,e)=>`${t} ${t===1?"change":"changes"} \xB7 ${e} ${e===1?"note":"notes"}`,handoffTooLarge:"The review is too long to send. Copy it and paste it instead",handoffConsent:"Commenting needs your permission. Allow it, then send again",handoffForbidden:"This page cannot send to Claude. Copy the review and paste it instead",handoffClaudeUnavailable:"Could not reach the Claude session. Copy the review and paste it instead",handoffRateLimited:"Too many sends in a row. Wait a moment, then send again",handoffStorage:"Could not save the review. Copy it and paste it instead",handoffError:"Could not send. Copy the review and paste it instead",handoffLabel:"Hand the review to the agent",handoffSend:"Send to Claude",handoffSending:"Sending\u2026",handoffSent:"Sent to Claude \u2713",handoffCopy:"Copy changes & comments",handoffCopyTitle:"Copy the review to paste it to the agent",handoffCopied:"Copied \u2713",handoffCopyFailed:"Could not copy",changes:"Updates",changesUnread:t=>`Updates (${t} new)`,changesTitle:"Changes by version",changesCurrent:"This version",changesReadAll:"Mark all as read",changesNew:"New",changesShow:"Show",changesDismiss:"Dismiss",changesWaiting:t=>`${t} more`,changesSeeAll:"See all",changesError:"Could not read the change log"},ja:{review:"\u30EC\u30D3\u30E5\u30FC",reviewToggle:"\u30EC\u30D3\u30E5\u30FC / \u30B3\u30E1\u30F3\u30C8",useLightTheme:"\u30E9\u30A4\u30C8\u30C6\u30FC\u30DE\u306B\u3059\u308B",useDarkTheme:"\u30C0\u30FC\u30AF\u30C6\u30FC\u30DE\u306B\u3059\u308B",language:"\u8A00\u8A9E",versionLabel:"dev-process-kit \u306E\u30D0\u30FC\u30B8\u30E7\u30F3\uFF08\u30DA\u30FC\u30B8\u3092\u518D\u8AAD\u307F\u8FBC\u307F\u3057\u307E\u3059\uFF09",versionPinned:"\u30DA\u30FC\u30B8\u6307\u5B9A\u306E\u30D0\u30FC\u30B8\u30E7\u30F3",versionLatest:t=>`${t}\uFF08\u6700\u65B0\uFF09`,resizeSidebar:"\u30B5\u30A4\u30C9\u30D0\u30FC\u306E\u5E45\u3092\u5909\u66F4",resizeSidebarHint:"\u30C9\u30E9\u30C3\u30B0\u3067\u5E45\u3092\u5909\u66F4\u3002\u30C0\u30D6\u30EB\u30AF\u30EA\u30C3\u30AF\u3067\u5143\u306B\u623B\u3059",collapseSidebar:"\u30B5\u30A4\u30C9\u30D0\u30FC\u3092\u6298\u308A\u305F\u305F\u3080",expandSidebar:"\u30B5\u30A4\u30C9\u30D0\u30FC\u3092\u958B\u304F",baseDataError:"base data \u3092\u8AAD\u307F\u8FBC\u3081\u307E\u305B\u3093\u3067\u3057\u305F\uFF08\u7A7A\u306E\u30DA\u30FC\u30B8\u3068\u3057\u3066\u8868\u793A\u4E2D\uFF09",memo:"\u30E1\u30E2",draftCount:(t,e)=>`\u5909\u66F4 ${t} \xB7 \u30B3\u30E1\u30F3\u30C8 ${e}`,handoffTooLarge:"Review \u304C\u9577\u3059\u304E\u3066\u9001\u308C\u307E\u305B\u3093\u3002\u30B3\u30D4\u30FC\u3057\u3066\u6E21\u3057\u3066\u304F\u3060\u3055\u3044",handoffConsent:"\u30B3\u30E1\u30F3\u30C8\u306E\u8A31\u53EF\u304C\u5FC5\u8981\u3067\u3059\u3002\u8A31\u53EF\u3057\u3066\u304B\u3089\u3082\u3046\u4E00\u5EA6\u9001\u3063\u3066\u304F\u3060\u3055\u3044",handoffForbidden:"\u3053\u306E\u30DA\u30FC\u30B8\u304B\u3089\u306F\u9001\u308C\u307E\u305B\u3093\u3002\u30B3\u30D4\u30FC\u3057\u3066\u6E21\u3057\u3066\u304F\u3060\u3055\u3044",handoffClaudeUnavailable:"Claude \u306E\u30BB\u30C3\u30B7\u30E7\u30F3\u306B\u5C4A\u304D\u307E\u305B\u3093\u3067\u3057\u305F\u3002\u30B3\u30D4\u30FC\u3057\u3066\u6E21\u3057\u3066\u304F\u3060\u3055\u3044",handoffRateLimited:"\u9001\u4FE1\u304C\u7D9A\u3044\u3066\u3044\u307E\u3059\u3002\u5C11\u3057\u5F85\u3063\u3066\u304B\u3089\u9001\u3063\u3066\u304F\u3060\u3055\u3044",handoffStorage:"Review \u3092\u4FDD\u5B58\u3067\u304D\u307E\u305B\u3093\u3067\u3057\u305F\u3002\u30B3\u30D4\u30FC\u3057\u3066\u6E21\u3057\u3066\u304F\u3060\u3055\u3044",handoffError:"\u9001\u308C\u307E\u305B\u3093\u3067\u3057\u305F\u3002\u30B3\u30D4\u30FC\u3057\u3066\u6E21\u3057\u3066\u304F\u3060\u3055\u3044",handoffLabel:"Review \u3092 Agent \u306B\u6E21\u3059",handoffSend:"Claude \u306B\u9001\u308B",handoffSending:"\u9001\u4FE1\u4E2D\u2026",handoffSent:"Claude \u306B\u9001\u308A\u307E\u3057\u305F \u2713",handoffCopy:"\u5909\u66F4\u30FB\u30B3\u30E1\u30F3\u30C8\u3092\u30B3\u30D4\u30FC",handoffCopyTitle:"Review \u3092\u30B3\u30D4\u30FC\u3057\u3066 Agent \u306B\u8CBC\u308A\u4ED8\u3051\u308B",handoffCopied:"\u30B3\u30D4\u30FC\u3057\u307E\u3057\u305F \u2713",handoffCopyFailed:"\u30B3\u30D4\u30FC\u3067\u304D\u307E\u305B\u3093\u3067\u3057\u305F",changes:"\u66F4\u65B0\u306E\u304A\u77E5\u3089\u305B",changesUnread:t=>`\u66F4\u65B0\u306E\u304A\u77E5\u3089\u305B\uFF08\u65B0\u7740 ${t} \u4EF6\uFF09`,changesTitle:"\u7248\u3054\u3068\u306E\u5909\u66F4",changesCurrent:"\u3053\u306E\u7248",changesReadAll:"\u3059\u3079\u3066\u65E2\u8AAD\u306B\u3059\u308B",changesNew:"\u65B0\u7740",changesShow:"\u898B\u308B",changesDismiss:"\u9589\u3058\u308B",changesWaiting:t=>`\u307B\u304B ${t} \u4EF6`,changesSeeAll:"\u3059\u3079\u3066\u898B\u308B",changesError:"\u5909\u66F4\u306E\u4E00\u89A7\u3092\u8AAD\u307F\u8FBC\u3081\u307E\u305B\u3093\u3067\u3057\u305F"}}),lc=4096,cc="reviews",Qi="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.",dc=t=>new TextEncoder().encode(t).length,pc=t=>t.replace(/[\u0000-\u0008\u000B-\u001F\u007F]/g,""),hc=t=>{const e=`${Qi}
740
-
741
- ${pc(t)}`;return dc(e)<=lc?e:null},uc=t=>`${Qi}
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).`,fc={consent_required:"consent",forbidden:"forbidden",not_granted:"forbidden",capability_disabled:"forbidden",capability_removed:"forbidden",claude_unavailable:"claude_unavailable",rate_limited:"rate_limited"},gc=t=>{const e=typeof t=="object"&&t!==null&&"code"in t?t.code:void 0;return(typeof e=="string"?fc[e]:void 0)??"error"},mc={too_large:"handoffTooLarge",consent:"handoffConsent",forbidden:"handoffForbidden",claude_unavailable:"handoffClaudeUnavailable",rate_limited:"handoffRateLimited",storage:"handoffStorage",error:"handoffError"},Vn=(t,e)=>W(e)[mc[t]],er=t=>t.group?`${t.group} \xB7 ${t.label}`:t.label,tr=(t,e)=>{const{definition:n,state:s,navigation:i,derivation:r}=t,o=Yi(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?er(c):l.ref}:l.kind==="current"&&a?{ref:a.value,label:er(a)}:{ref:`page:${n.name}`,label:o.wholePage},d=new Map(r.stale.map(h=>[h.action.id,h.reason]));return{body:e.body,target:p,attachment:l.kind==="explicit"?{kind:"explicit"}:a?{kind:"checkbox",checked:l.kind==="current",group:a.group??""}:{kind:"none"},canSubmit:e.body.trim().length>0,items:r.actions.map(h=>{const u=n.describe(h,s,r.base),f=h.type==="comment";return{id:h.id,title:f?o.comment:u.title,targetLabel:u.targetLabel,tone:f?"comment":u.tone,text:{kind:f?"comment":"summary",body:f?lt(h):u.summary??""},code:f?null:n.serialize(h),stale:d.get(h.id)??null,edit:!f||t.editable!==!0?{kind:"none"}:e.editing?.id===h.id?{kind:"editing",body:e.editing.body,canSave:e.editing.body.trim().length>0}:{kind:"available"}}}),issues:t.issues.map(h=>`${h.path?`${h.path}: `:""}${h.message}`),send:t.sendable!==!0?"hidden":r.actions.length===0||e.send.kind==="pending"?"disabled":"ready",flash:e.send.kind==="sent"?o.sent:e.send.kind==="failed"?Vn(e.send.reason,t.locale):e.copy.kind==="copied"?o.copied:e.copy.kind==="failed"?o.copyFailed:""}},kc=[_t,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
- `],nr=(t,e,n)=>{const s=new Map;for(let i=e;i<=n;i++)s.set(t[i],i);return s},ct=et(class extends At{constructor(t){if(super(t),t.type!==ue.CHILD)throw Error("repeat() can only be used in text expressions")}dt(t,e,n){let s;n===void 0?n=e:e!==void 0&&(s=e);const i=[],r=[];let o=0;for(const a of t)i[o]=s?s(a,o):o,r[o]=n(a,o),o++;return{values:r,keys:i}}render(t,e,n){return this.dt(t,e,n).values}update(t,[e,n,s]){const i=ha(t),{values:r,keys:o}=this.dt(e,n,s);if(!Array.isArray(i))return this.ut=o,r;const a=this.ut??=[],l=[];let c,p,d=0,h=i.length-1,u=0,f=r.length-1;for(;d<=h&&u<=f;)if(i[d]===null)d++;else if(i[h]===null)h--;else if(a[d]===o[u])l[u]=Ae(i[d],r[u]),d++,u++;else if(a[h]===o[f])l[f]=Ae(i[h],r[f]),h--,f--;else if(a[d]===o[f])l[f]=Ae(i[d],r[f]),tt(t,l[f+1],i[d]),d++,f--;else if(a[h]===o[u])l[u]=Ae(i[h],r[u]),tt(t,i[d],i[h]),h--,u++;else if(c===void 0&&(c=nr(o,u,f),p=nr(a,d,h)),c.has(a[d]))if(c.has(a[h])){const k=p.get(o[u]),m=k!==void 0?i[k]:null;if(m===null){const x=tt(t,i[d]);Ae(x,r[u]),l[u]=x}else l[u]=Ae(m,r[u]),tt(t,i[d],m),i[k]=null;u++}else gn(i[h]),h--;else gn(i[d]),d++;for(;u<=f;){const k=tt(t,l[f+1]);Ae(k,r[u]),l[u++]=k}for(;d<=h;){const k=i[d++];k!==null&&gn(k)}return this.ut=o,fn(t,l),H}});class Kn extends Ct{}Kn.directiveName="unsafeSVG",Kn.resultType=2;const bc=et(Kn),sr=[["path",{d:"M12 5v14"}],["path",{d:"m19 12-7 7-7-7"}]],ir=[["path",{d:"m12 19-7-7 7-7"}],["path",{d:"M19 12H5"}]],rr=[["path",{d:"M5 12h14"}],["path",{d:"m12 5 7 7-7 7"}]],or=[["path",{d:"m5 12 7-7 7 7"}],["path",{d:"M12 19V5"}]],vc=[["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"}]],xc=[["path",{d:"M20 6 9 17l-5-5"}]],ar=[["path",{d:"m6 9 6 6 6-6"}]],yc=[["path",{d:"m15 18-6-6 6-6"}]],wc=[["path",{d:"m9 18 6-6-6-6"}]],$c=[["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"}]],Sc=[["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"}]],Ac=[["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"}]],Cc=[["path",{d:"M15 3h6v6"}],["path",{d:"m21 3-7 7"}],["path",{d:"m3 21 7-7"}],["path",{d:"M9 21H3v-6"}]],Tc=[["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"}]],Ec=[["path",{d:"m14 10 7-7"}],["path",{d:"M20 10h-6V4"}],["path",{d:"m3 21 7-7"}],["path",{d:"M4 14h6v6"}]],Rc=[["path",{d:"M5 12h14"}]],_c=[["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"}]],Lc=[["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"}]],Oc=[["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"}]],Pc=[["path",{d:"M5 12h14"}],["path",{d:"M12 5v14"}]],zc=[["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"}]],Mc=[["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"}]],Ic=[["path",{d:"M18 6 6 18"}],["path",{d:"m6 6 12 12"}]],Nc=t=>t.replaceAll("&","&amp;").replaceAll('"',"&quot;"),Dc=t=>t.map(([e,n])=>`<${e}${Object.entries(n).map(([s,i])=>` ${s}="${Nc(String(i))}"`).join("")}></${e}>`).join(""),_=t=>{const e=Dc(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
- ${bc(e)}
1143
- </svg>`},Bt=_(Ic),lr=_(Mc),Gn=_(Oc),Zn=_(Tc),cr=_(Ac),jc=_($c),qc=_(xc),dr=_(Pc),Bc=_(Rc),Uc=_(Sc),pr=_(Lc),Hc=_(or),Fc=_(sr);_(ir),_(rr);const hr=_(yc),Yn=_(wc),Wc=_(ar),Vc=_(Cc),Kc=_(Ec),Gc=_(zc),Zc=_(_c),ur=_(vc),Yc=t=>{switch(t){case"comment":return Zn();case"create":return dr();case"update":return Gn();case"delete":return lr();case"move":return pr();default:return cr()}},Jc=(t,e,n,s=!1)=>b`
1144
- ${s?g: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>`:g}
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} ${Bt()}
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>`:g}
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>`:ct(e.items,i=>i.id,i=>Xc(t,i,n))}
1194
- </ul>
1195
- <footer>
1196
- ${s||e.send==="hidden"?g: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?g: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>`:g}
1224
- </footer>
1225
- `,Xc=(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">${Yc(e.tone)}</span>
1229
- <span class="item-title">${e.title}</span>
1230
- ${e.stale?b`<span class="stale-badge">${e.stale}</span>`:g}
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
- ${Gn()}
1239
- </button>`:g}
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
- ${Bt()}
1247
- </button>
1248
- </div>
1249
- <div class="item-target">${e.targetLabel}</div>
1250
- ${e.edit.kind==="editing"?Qc(t,e.edit,n):e.text.kind==="comment"?b`<p class="item-body">${e.text.body}</p>`:e.text.body?b`<div class="item-summary">${e.text.body}</div>`:g}
1251
- ${e.code===null?g:b`<code class="item-code">${e.code}</code>`}
1252
- </li>
1253
- `,Qc=(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 fr extends he{static{this.styles=kc}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=ic();#n=null;#s=new vn(this);constructor(){super(),this.embedded=!1,this.definition=null,this.state=void 0,this.navigation={},this.derivation=null,this.issues=[],this.pendingTarget=null}willUpdate(e){e.has("pendingTarget")&&this.pendingTarget&&(this.#e=Xi(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?Jc(Yi(this.#s.locale),tr(e,this.#e),this.#i,this.embedded):g}#t(e){this.#e=Xi(this.#e,e),this.requestUpdate()}#i=e=>{switch(e.kind){case"delete":this.onDelete?.(e.id);return;case"clear":this.onClear?.();return;case"copy":this.#l();return;case"send":this.#o();return;case"edit-start":this.#n={kind:"editor",id:e.id},this.#t(e);return;case"edit-cancel":{const n=this.#e.editing;n&&(this.#n={kind:"edit-button",id:n.id}),this.#t(e);return}case"edit-save":{const n=oc(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=rc(this.#e,tr(n,this.#e).target.ref);if(!s||!this.onComment(s.target,s.body).ok)return;this.#t({kind:"submitted"});return}default:this.#t(e)}};async#o(){const e=this.sendToClaude;if(!e||this.#e.send.kind==="pending")return;this.#t({kind:"send-started"});const n=this.#e.sendRequest,s=await e().catch(()=>({ok:!1,reason:"error"}));this.isConnected&&this.#t({kind:"send-finished",request:n,outcome:s})}async#l(){const e=this.#r();if(!e)return;this.#t({kind:"copy-started"});const n=this.#e.copyRequest;try{const s=this.exportBrief?.()??Fn({...e.derivation,navigation:e.navigation,issues:e.issues},e.definition,X),i=await Wn(s);this.isConnected&&this.#t({kind:"copy-finished",request:n,ok:i})}catch{this.isConnected&&this.#t({kind:"copy-finished",request:n,ok:!1})}}}const ed=()=>{customElements.get("dpk-component-comment-panel")||customElements.define("dpk-component-comment-panel",fr)},We=Math.min,ie=Math.max,Ut=Math.round,Ht=Math.floor,re=t=>({x:t,y:t}),td={left:"right",right:"left",bottom:"top",top:"bottom"};function nd(t,e,n){return ie(t,We(e,n))}function dt(t,e){return typeof t=="function"?t(e):t}function Pe(t){return t.split("-")[0]}function pt(t){return t.split("-")[1]}function gr(t){return t==="x"?"y":"x"}function mr(t){return t==="y"?"height":"width"}function oe(t){const e=t[0];return e==="t"||e==="b"?"y":"x"}function kr(t){return gr(oe(t))}function sd(t,e,n){n===void 0&&(n=!1);const s=pt(t),i=kr(t),r=mr(i);let o=i==="x"?s===(n?"end":"start")?"right":"left":s==="start"?"bottom":"top";return e.reference[r]>e.floating[r]&&(o=Ft(o)),[o,Ft(o)]}function id(t){const e=Ft(t);return[Jn(t),e,Jn(e)]}function Jn(t){return t.includes("start")?t.replace("start","end"):t.replace("end","start")}const br=["left","right"],vr=["right","left"],rd=["top","bottom"],od=["bottom","top"];function ad(t,e,n){switch(t){case"top":case"bottom":return n?e?vr:br:e?br:vr;case"left":case"right":return e?rd:od;default:return[]}}function ld(t,e,n,s){const i=pt(t);let r=ad(Pe(t),n==="start",s);return i&&(r=r.map(o=>o+"-"+i),e&&(r=r.concat(r.map(Jn)))),r}function Ft(t){const e=Pe(t);return td[e]+t.slice(e.length)}function cd(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 dd(t){return typeof t!="number"?cd(t):{top:t,right:t,bottom:t,left:t}}function Wt(t){const{x:e,y:n,width:s,height:i}=t;return{width:s,height:i,top:n,left:e,right:e+s,bottom:n+i,x:e,y:n}}function xr(t,e,n){let{reference:s,floating:i}=t;const r=oe(e),o=kr(e),a=mr(o),l=Pe(e),c=r==="y",p=s.x+s.width/2-i.width/2,d=s.y+s.height/2-i.height/2,h=s[a]/2-i[a]/2;let u;switch(l){case"top":u={x:p,y:s.y-i.height};break;case"bottom":u={x:p,y:s.y+s.height};break;case"right":u={x:s.x+s.width,y:d};break;case"left":u={x:s.x-i.width,y:d};break;default:u={x:s.x,y:s.y}}const f=pt(e);return f&&(u[o]+=h*(f==="end"?1:-1)*(n&&c?-1:1)),u}async function pd(t,e){var n;e===void 0&&(e={});const{x:s,y:i,platform:r,rects:o,elements:a,strategy:l}=t,{boundary:c="clippingAncestors",rootBoundary:p="viewport",elementContext:d="floating",altBoundary:h=!1,padding:u=0}=dt(e,t),f=dd(u),m=a[h?d==="floating"?"reference":"floating":d],x=Wt(await r.getClippingRect({element:(n=await(r.isElement==null?void 0:r.isElement(m)))==null||n?m:m.contextElement||await(r.getDocumentElement==null?void 0:r.getDocumentElement(a.floating)),boundary:c,rootBoundary:p,strategy:l})),$=d==="floating"?{x:s,y:i,width:o.floating.width,height:o.floating.height}:o.reference,A=await(r.getOffsetParent==null?void 0:r.getOffsetParent(a.floating)),R=await(r.isElement==null?void 0:r.isElement(A))&&await(r.getScale==null?void 0:r.getScale(A))||{x:1,y:1},I=Wt(r.convertOffsetParentRelativeRectToViewportRelativeRect?await r.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:$,offsetParent:A,strategy:l}):$);return{top:(x.top-I.top+f.top)/R.y,bottom:(I.bottom-x.bottom+f.bottom)/R.y,left:(x.left-I.left+f.left)/R.x,right:(I.right-x.right+f.right)/R.x}}const hd=50,ud=async(t,e,n)=>{const{placement:s="bottom",strategy:i="absolute",middleware:r=[],platform:o}=n,a=o.detectOverflow?o:{...o,detectOverflow:pd},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}=xr(c,s,l),h=s,u=0;const f={};for(let k=0;k<r.length;k++){const m=r[k];if(!m)continue;const{name:x,fn:$}=m,{x:A,y:R,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=R??d,f[x]={...f[x],...I},O&&u<hd&&(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}=xr(c,h,l)),k=-1)}return{x:p,y:d,placement:h,strategy:i,middlewareData:f}},fd=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var n,s;const{placement:i,middlewareData:r,rects:o,initialPlacement:a,platform:l,elements:c}=e,{mainAxis:p=!0,crossAxis:d=!0,fallbackPlacements:h,fallbackStrategy:u="bestFit",fallbackAxisSideDirection:f="none",flipAlignment:k=!0,...m}=dt(t,e);if((n=r.arrow)!=null&&n.alignmentOffset)return{};const x=Pe(i),$=oe(a),A=Pe(a)===a,R=await(l.isRTL==null?void 0:l.isRTL(c.floating)),I=h||(A||!k?[Ft(a)]:id(a)),O=f!=="none";!h&&O&&I.push(...ld(a,k,f,R));const U=[a,...I],M=await l.detectOverflow(e,m),te=[];let Y=((s=r.flip)==null?void 0:s.overflows)||[];if(p&&te.push(M[x]),d){const xe=sd(i,o,R);te.push(M[xe[0]],M[xe[1]])}if(Y=[...Y,{placement:i,overflows:te}],!te.every(xe=>xe<=0)){var As,Cs;const xe=(((As=r.flip)==null?void 0:As.index)||0)+1,rn=U[xe];if(rn&&(!(d==="alignment"?$!==oe(rn):!1)||Y.every(V=>oe(V.placement)===$?V.overflows[0]>0:!0)))return{data:{index:xe,overflows:Y},reset:{placement:rn}};let Ze=(Cs=Y.filter(ye=>ye.overflows[0]<=0).sort((ye,V)=>ye.overflows[1]-V.overflows[1])[0])==null?void 0:Cs.placement;if(!Ze)switch(u){case"bestFit":{var Ts;const ye=(Ts=Y.filter(V=>{if(O){const ce=oe(V.placement);return ce===$||ce==="y"}return!0}).map(V=>[V.placement,V.overflows.filter(ce=>ce>0).reduce((ce,qo)=>ce+qo,0)]).sort((V,ce)=>V[1]-ce[1])[0])==null?void 0:Ts[0];ye&&(Ze=ye);break}case"initialPlacement":Ze=a;break}if(i!==Ze)return{reset:{placement:Ze}}}return{}}}},gd=new Set(["left","top"]);async function md(t,e){const{placement:n,platform:s,elements:i}=t,r=await(s.isRTL==null?void 0:s.isRTL(i.floating)),o=Pe(n),a=pt(n),l=oe(n)==="y",c=gd.has(o)?-1:1,p=r&&l?-1:1,d=dt(e,t);let{mainAxis:h,crossAxis:u,alignmentAxis:f}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return a&&typeof f=="number"&&(u=a==="end"?f*-1:f),l?{x:u*p,y:h*c}:{x:h*c,y:u*p}}const kd=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 md(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}}}}},bd=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:R}=$;return{x:A,y:R}}},...c}=dt(t,e),p={x:n,y:s},d=await r.detectOverflow(e,c),h=oe(i),u=gr(h);let f=p[u],k=p[h];const m=($,A)=>nd(A+d[$==="y"?"top":"left"],A,A-d[$==="y"?"bottom":"right"]);o&&(f=m(u,f)),a&&(k=m(h,k));const x=l.fn({...e,[u]:f,[h]:k});return{...x,data:{x:x.x-n,y:x.y-s,enabled:{[u]:o,[h]:a}}}}}},vd=function(t){return t===void 0&&(t={}),{name:"size",options:t,async fn(e){const{placement:n,rects:s,platform:i,elements:r}=e,{apply:o=()=>{},...a}=dt(t,e),l=await i.detectOverflow(e,a),c=Pe(n),p=pt(n),d=oe(n)==="y",{width:h,height:u}=s.floating;let f,k;c==="top"||c==="bottom"?(f=c,k=p===(await(i.isRTL==null?void 0:i.isRTL(r.floating))?"start":"end")?"left":"right"):(k=c,f=p==="end"?"top":"bottom");const m=u-l.top-l.bottom,x=h-l.left-l.right,$=We(u-l[f],m),A=We(h-l[k],x),R=e.middlewareData.shift,I=!R;let O=$,U=A;R!=null&&R.enabled.x&&(U=x),R!=null&&R.enabled.y&&(O=m),I&&!p&&(d?U=h-2*ie(l.left,l.right):O=u-2*ie(l.top,l.bottom)),await o({...e,availableWidth:U,availableHeight:O});const M=await i.getDimensions(r.floating);return h!==M.width||u!==M.height?{reset:{rects:!0}}:{}}}};function Vt(){return typeof window<"u"}function Ve(t){return yr(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=(yr(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function yr(t){return Vt()?t instanceof Node||t instanceof j(t).Node:!1}function Q(t){return Vt()?t instanceof Element||t instanceof j(t).Element:!1}function be(t){return Vt()?t instanceof HTMLElement||t instanceof j(t).HTMLElement:!1}function wr(t){return!Vt()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof j(t).ShadowRoot}function Kt(t){const{overflow:e,overflowX:n,overflowY:s,display:i}=ee(t);return/auto|scroll|overlay|hidden|clip/.test(e+s+n)&&i!=="inline"&&i!=="contents"}function xd(t){return/^(table|td|th)$/.test(Ve(t))}function Gt(t){try{if(t.matches(":popover-open"))return!0}catch{}try{return t.matches(":modal")}catch{return!1}}const yd=/transform|translate|scale|rotate|perspective|filter/,wd=/paint|layout|strict|content/,ze=t=>!!t&&t!=="none";let Xn;function Qn(t){const e=Q(t)?ee(t):t;return ze(e.transform)||ze(e.translate)||ze(e.scale)||ze(e.rotate)||ze(e.perspective)||!es()&&(ze(e.backdropFilter)||ze(e.filter))||yd.test(e.willChange||"")||wd.test(e.contain||"")}function $d(t){let e=Me(t);for(;be(e)&&!ht(e);){if(Qn(e))return e;if(Gt(e))return null;e=Me(e)}return null}function es(){return Xn==null&&(Xn=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),Xn}function ht(t){return/^(html|body|#document)$/.test(Ve(t))}function ee(t){return j(t).getComputedStyle(t)}function Zt(t){return Q(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function Me(t){if(Ve(t)==="html")return t;const e=t.assignedSlot||t.parentNode||wr(t)&&t.host||ae(t);return wr(e)?e.host:e}function $r(t){const e=Me(t);return ht(e)?(t.ownerDocument||t).body:be(e)&&Kt(e)?e:$r(e)}function ut(t,e,n){var s;e===void 0&&(e=[]),n===void 0&&(n=!0);const i=$r(t),r=i===((s=t.ownerDocument)==null?void 0:s.body),o=j(i);if(r){const a=ts(o);return e.concat(o,o.visualViewport||[],Kt(i)?i:[],a&&n?ut(a):[])}else return e.concat(i,ut(i,[],n))}function ts(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function Sr(t){const e=ee(t);let n=parseFloat(e.width)||0,s=parseFloat(e.height)||0;const i=be(t),r=i?t.offsetWidth:n,o=i?t.offsetHeight:s,a=Ut(n)!==r||Ut(s)!==o;return a&&(n=r,s=o),{width:n,height:s,$:a}}function ns(t){return Q(t)?t:t.contextElement}function Ke(t){const e=ns(t);if(!be(e))return re(1);const n=e.getBoundingClientRect(),{width:s,height:i,$:r}=Sr(e);let o=(r?Ut(n.width):n.width)/s,a=(r?Ut(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!a||!Number.isFinite(a))&&(a=1),{x:o,y:a}}const Sd=re(0);function Ar(t){const e=j(t);return!es()||!e.visualViewport?Sd:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function Ad(t,e,n){return e===void 0&&(e=!1),!!n&&e&&n===j(t)}function Ie(t,e,n,s){e===void 0&&(e=!1),n===void 0&&(n=!1);const i=t.getBoundingClientRect(),r=ns(t);let o=re(1);e&&(s?Q(s)&&(o=Ke(s)):o=Ke(t));const a=Ad(r,n,s)?Ar(r):re(0);let l=(i.left+a.x)/o.x,c=(i.top+a.y)/o.y,p=i.width/o.x,d=i.height/o.y;if(r&&s){const h=j(r),u=Q(s)?j(s):s;let f=h,k=ts(f);for(;k&&u!==f;){const m=Ke(k),x=k.getBoundingClientRect(),$=ee(k),A=x.left+(k.clientLeft+parseFloat($.paddingLeft))*m.x,R=x.top+(k.clientTop+parseFloat($.paddingTop))*m.y;l*=m.x,c*=m.y,p*=m.x,d*=m.y,l+=A,c+=R,f=j(k),k=ts(f)}}return Wt({width:p,height:d,x:l,y:c})}function Yt(t,e){const n=Zt(t).scrollLeft;return e?e.left+n:Ie(ae(t)).left+n}function Cr(t,e){const n=t.getBoundingClientRect(),s=n.left+e.scrollLeft-Yt(t,n),i=n.top+e.scrollTop;return{x:s,y:i}}function Cd(t){let{elements:e,rect:n,offsetParent:s,strategy:i}=t;const r=i==="fixed",o=ae(s),a=e?Gt(e.floating):!1;if(s===o||a&&r)return n;let l={scrollLeft:0,scrollTop:0},c=re(1);const p=re(0),d=be(s);if((d||!r)&&((Ve(s)!=="body"||Kt(o))&&(l=Zt(s)),d)){const u=Ie(s);c=Ke(s),p.x=u.x+s.clientLeft,p.y=u.y+s.clientTop}const h=o&&!d&&!r?Cr(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 Td(t){return t.getClientRects?Array.from(t.getClientRects()):[]}function Ed(t){const e=Zt(t),n=t.ownerDocument.body,s=ie(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),i=ie(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight);let r=-e.scrollLeft+Yt(t);const o=-e.scrollTop;return ee(n).direction==="rtl"&&(r+=ie(t.clientWidth,n.clientWidth)-s),{width:s,height:i,x:r,y:o}}const Rd=25;function _d(t,e,n){n===void 0&&(n="viewport");const s=n==="layoutViewport",i=j(t),r=ae(t),o=i.visualViewport;let a=r.clientWidth,l=r.clientHeight,c=0,p=0;if(o){const h=!es()||e==="fixed";s?h||(c=-o.offsetLeft,p=-o.offsetTop):(a=o.width,l=o.height,h&&(c=o.offsetLeft,p=o.offsetTop))}if(Yt(r)<=0){const h=r.ownerDocument,u=h.body,f=getComputedStyle(u),k=h.compatMode==="CSS1Compat"&&parseFloat(f.marginLeft)+parseFloat(f.marginRight)||0,m=Math.abs(r.clientWidth-u.clientWidth-k),x=getComputedStyle(r).scrollbarGutter==="stable both-edges"?m/2:m;x<=Rd&&(a-=x)}return{width:a,height:l,x:c,y:p}}function Ld(t,e){const n=Ie(t,!0,e==="fixed"),s=n.top+t.clientTop,i=n.left+t.clientLeft,r=Ke(t),o=t.clientWidth*r.x,a=t.clientHeight*r.y,l=i*r.x,c=s*r.y;return{width:o,height:a,x:l,y:c}}function Tr(t,e,n){let s;if(e==="viewport"||e==="layoutViewport")s=_d(t,n,e);else if(e==="document")s=Ed(ae(t));else if(Q(e))s=Ld(e,n);else{const i=Ar(t);s={x:e.x-i.x,y:e.y-i.y,width:e.width,height:e.height}}return Wt(s)}function Od(t,e){const n=e.get(t);if(n)return n;let s=ut(t,[],!1).filter(a=>Q(a)&&Ve(a)!=="body"),i=null;const r=ee(t).position==="fixed";let o=r?Me(t):t;for(;Q(o)&&!ht(o);){const a=ee(o),l=Qn(o),c=i?i.position:r?"fixed":"";!l&&(c==="fixed"||c==="absolute"&&a.position==="static")?s=s.filter(d=>d!==o):i=a,o=Me(o)}return e.set(t,s),s}function Pd(t){let{element:e,boundary:n,rootBoundary:s,strategy:i}=t;const o=[...n==="clippingAncestors"?Gt(e)?[]:Od(e,this._c):[].concat(n),s],a=Tr(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=Tr(e,o[h],i);l=ie(u.top,l),c=We(u.right,c),p=We(u.bottom,p),d=ie(u.left,d)}return{width:c-d,height:p-l,x:d,y:l}}function zd(t){const{width:e,height:n}=Sr(t);return{width:e,height:n}}function Md(t,e,n){const s=be(e),i=ae(e),r=n==="fixed",o=Ie(t,!0,r,e);let a={scrollLeft:0,scrollTop:0};const l=re(0);if((s||!r)&&((Ve(e)!=="body"||Kt(i))&&(a=Zt(e)),s)){const h=Ie(e,!0,r,e);l.x=h.x+e.clientLeft,l.y=h.y+e.clientTop}!s&&i&&(l.x=Yt(i));const c=i&&!s&&!r?Cr(i,a):re(0),p=o.left+a.scrollLeft-l.x-c.x,d=o.top+a.scrollTop-l.y-c.y;return{x:p,y:d,width:o.width,height:o.height}}function ss(t){return ee(t).position==="static"}function Er(t,e){if(!be(t)||ee(t).position==="fixed")return null;if(e)return e(t);let n=t.offsetParent;return ae(t)===n&&(n=n.ownerDocument.body),n}function Rr(t,e){const n=j(t);if(Gt(t))return n;if(!be(t)){let i=Me(t);for(;i&&!ht(i);){if(Q(i)&&!ss(i))return i;i=Me(i)}return n}let s=Er(t,e);for(;s&&xd(s)&&ss(s);)s=Er(s,e);return s&&ht(s)&&ss(s)&&!Qn(s)?n:s||$d(t)||n}const Id=async function(t){const e=this.getOffsetParent||Rr,n=this.getDimensions,s=await n(t.floating);return{reference:Md(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:s.width,height:s.height}}};function Nd(t){return ee(t).direction==="rtl"}const Dd={convertOffsetParentRelativeRectToViewportRelativeRect:Cd,getDocumentElement:ae,getClippingRect:Pd,getOffsetParent:Rr,getElementRects:Id,getClientRects:Td,getDimensions:zd,getScale:Ke,isElement:Q,isRTL:Nd};function _r(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function jd(t,e,n){let s=null,i;const r=ae(t);function o(){var p;clearTimeout(i),(p=s)==null||p.disconnect(),s=null}function a(p,d){p===void 0&&(p=!1),d===void 0&&(d=1),o();const h=t.getBoundingClientRect(),{left:u,top:f,width:k,height:m}=h;if(p||e(),!k||!m)return;const x=Ht(f),$=Ht(r.clientWidth-(u+k)),A=Ht(r.clientHeight-(f+m)),R=Ht(u),O={rootMargin:-x+"px "+-$+"px "+-A+"px "+-R+"px",threshold:ie(0,We(1,d))||1};let U=!0;function M(te){const Y=te[0].intersectionRatio;if(!_r(h,t.getBoundingClientRect()))return a();if(Y!==d){if(!U)return a();Y?a(!1,Y):i=setTimeout(()=>{a(!1,1e-7)},1e3)}U=!1}try{s=new IntersectionObserver(M,{...O,root:r.ownerDocument})}catch{s=new IntersectionObserver(M,O)}s.observe(t)}const l=j(t),c=()=>a(n);return l.addEventListener("resize",c),a(!0),()=>{l.removeEventListener("resize",c),o()}}function qd(t,e,n,s){s===void 0&&(s={});const{ancestorScroll:i=!0,ancestorResize:r=!0,elementResize:o=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:l=!1}=s,c=ns(t),p=i||r?[...c?ut(c):[],...e?ut(e):[]]:[];p.forEach(x=>{i&&x.addEventListener("scroll",n),r&&x.addEventListener("resize",n)});const d=c&&a?jd(c,n,r):null;let h=-1,u=null;o&&(u=new ResizeObserver(x=>{let[$]=x;$&&$.target===c&&u&&e&&(u.unobserve(e),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var A;(A=u)==null||A.observe(e)})),n()}),c&&!l&&u.observe(c),e&&u.observe(e));let f,k=l?Ie(t):null;l&&m();function m(){const x=Ie(t);k&&!_r(k,x)&&n(),k=x,f=requestAnimationFrame(m)}return n(),()=>{var x;p.forEach($=>{i&&$.removeEventListener("scroll",n),r&&$.removeEventListener("resize",n)}),d?.(),(x=u)==null||x.disconnect(),u=null,l&&cancelAnimationFrame(f)}}const Bd=kd,Ud=bd,Hd=fd,Fd=vd,Wd=(t,e,n)=>{const s=new Map,i=n??{},r={...Dd,...i.platform,_c:s};return ud(t,e,{...i,platform:r})},Vd=(t,e)=>({top:e,bottom:e,right:t}),Kd=(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=qd(o,t,()=>{const c=++r;Wd(o,t,{strategy:"fixed",placement:s.placement??"bottom-end",middleware:[Bd(8),Hd({padding:8,fallbackAxisSideDirection:"end"}),Ud({padding:8}),Fd({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()}},Gd=t=>{if(!(!t||typeof t.hidePopover!="function"))try{t.hidePopover()}catch{}};class Lr{#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,Kd(e,n,s,i))}}const Or=(t,e,n)=>{typeof window>"u"||Object.assign(window,{devProcessKit:{version:t,templates:e,versionParam:n}})},ft="dpk-version",Pr="version",Zd=/^\d+\.\d+\.\d+(?:-[0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*)?$/,Jt=t=>Zd.test(t),Yd="https://cdn.jsdelivr.net/npm/dev-process-kit@",zr="https://data.jsdelivr.com/v1/packages/npm/dev-process-kit",is=t=>{const e=new URLSearchParams(t),n=e.get(ft)??e.get(Pr);return n!==null&&Jt(n)?n:null},Jd=(t,e)=>{const n=is(t);return n===null||n===e?null:n},Xd=(t,e)=>{if(!Jt(t))throw new Error(`not an exact version: ${t}`);if(!/^[a-z0-9-]+(?:\/[a-z0-9-]+)*\.js$/.test(e))throw new Error(`not an entry path: ${e}`);return`${Yd}${t}/dist/${e}`},Qd=(t,e)=>{const n=new URL(t);return n.searchParams.delete(Pr),e===null?n.searchParams.delete(ft):n.searchParams.set(ft,e),n.href},ep=L({tags:se(He(v(),ke()),{}),versions:F(L({version:v()}))}),tp=t=>{const e=zn(ep,t),n=e.tags.latest;return{latest:typeof n=="string"&&Jt(n)?n:null,versions:e.versions.map(s=>s.version).filter(Jt)}},Mr=t=>{const e=t.published?.versions??[],n=e.includes(t.current)?e:[t.current,...e],s=t.published?.latest??null;return{value:t.current,options:[...t.requested?[{value:"",label:t.text.pinned}]:[],...n.map(i=>({value:i,label:i===s&&i!==t.current?t.text.latest(i):i}))]}};let Xt;const Ir=()=>(Xt??=fetch(zr).then(async t=>{if(!t.ok)throw new Error(`${zr} answered ${t.status}`);return tp(await t.json())}),Xt.catch(()=>{Xt=void 0}),Xt),Nr=t=>{location.assign(Qd(location.href,t))},np=t=>import(t),sp=({entry:t,templates:e,register:n,importModule:s=np})=>{const i=()=>{n(),Or(X,e,ft)},r=typeof location>"u"?null:Jd(location.search,X);if(r===null){i();return}s(Xd(r,t)).then(()=>{ip()||op(r)},o=>{console.error(`dev-process-kit@${r} could not be loaded; running ${X}`,o),i()})},ip=()=>{const t=Reflect.get(window,"devProcessKit");return typeof t=="object"&&t!==null&&"versionParam"in t},rs="dpk-version-fallback",rp=`
1278
- .${rs} {
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
- `,op=t=>{const e=[...document.body.querySelectorAll("*")].filter(n=>n.localName.startsWith("dpk-template-")&&!n.querySelector(`:scope > .${rs}`));if(e.length!==0){document.head.append(Object.assign(document.createElement("style"),{textContent:rp}));for(const n of e)n.append(ap(n,t))}},ap=(t,e)=>{const n=W(Et(Tt(t))),s=document.createElement("select");s.className=rs,s.slot="header",s.setAttribute("aria-label",n.versionLabel),s.title=n.versionLabel;const i=o=>{const a=Mr({current:e,requested:is(location.search)!==null,published:o,text:{pinned:n.versionPinned,latest:n.versionLatest}});s.replaceChildren(...a.options.map(l=>Object.assign(document.createElement("option"),{value:l.value,textContent:l.label}))),s.value=a.value},r=()=>{Ir().then(i,o=>console.warn(o))};return s.addEventListener("pointerenter",r,{once:!0}),s.addEventListener("focus",r,{once:!0}),s.addEventListener("change",()=>Nr(s.value===""?null:s.value)),i(null),s},lp=L({value:v()}),cp=t=>e=>{if(!(e instanceof CustomEvent))return;const n=C(lp,e.detail);n.success&&t(n.output.value)},os=t=>e=>{const n=Ce(e.target,HTMLSelectElement);n!==null&&t(n.value)},dp=t=>e=>{const n=Ce(e.target,HTMLInputElement);n!==null&&t(n.value,n)},pp=t=>e=>{const n=Ce(e.target,HTMLInputElement);n!==null&&t(n.checked)},Dr="data-dpk-changes",hp=/^[^:\s]+:\S+$/,up=Z({id:se(w(v(),S(1))),title:w(v(),S(1)),body:se(v()),target:se(w(v(),ge(hp,'target must be written "type:id"'))),navigate:se(w(v(),Ei("=",'navigate must be written "key=value"')))}),fp=F(up),gp=w(v(),S(1)),jr=Z({revision:gp,changes:fp}),mp=Z({revisions:w(F(jr),S(1,"list at least one version"))}),kp=(t,e)=>JSON.stringify([t,e]),gt=t=>[...t.earlier,t.latest],bp=t=>{const e=t.changes.map((s,i)=>{const r=s.id??String(i);return{key:kp(t.revision,r),id:r,revision:t.revision,title:s.title,body:s.body??null,target:s.target??null,navigate:s.navigate??null}});return new Set(e.map(s=>s.id)).size!==e.length?`change ids must be unique within version "${t.revision}"`:{revision:t.revision,entries:e}},vp=t=>{const e=typeof t=="object"&&t!==null&&"revisions"in t,n=C(e?mp:jr,t);if(!n.success)return{ok:!1,error:Nl(n.issues)};const s=n.output,i="revisions"in s?s.revisions:[s],r=[];for(const a of i){if(r.some(c=>c.revision===a.revision))return{ok:!1,error:`version "${a.revision}" is listed twice`};const l=bp(a);if(typeof l=="string")return{ok:!1,error:l};r.push(l)}const o=r.pop();return o?{ok:!0,log:{earlier:r,latest:o}}:{ok:!1,error:"list at least one version"}},xp=Z({v:me(1),revision:v(),seen:F(v())}),yp=Z({v:me(2),since:v(),seen:He(v(),F(v()))}),qr=t=>{const e=C(yp,t);if(e.success)return e.output;const n=C(xp,t);return n.success?{v:2,since:n.output.revision,seen:{[n.output.revision]:n.output.seen}}:null},as={open:!1,fresh:new Set},Br=t=>e=>t.told.has(e.revision)&&!t.seen.has(e.key),ls=(t,e)=>gt(t).flatMap(n=>n.entries.filter(Br(e))),Ur=t=>t.target!==null||t.navigate!==null,wp=(t,e)=>{const n=gt(t),s=e===null?-1:n.findIndex(o=>o.revision===e.since),i=e===null?[t.latest]:n.slice(Math.max(0,s)),r=new Set(i.flatMap(o=>{const a=new Set(e?.seen[o.revision]??[]);return o.entries.filter(l=>a.has(l.id)).map(l=>l.key)}));return{told:new Set(i.map(o=>o.revision)),seen:r,toasts:t.latest.entries.filter(o=>!r.has(o.key)).map(o=>o.key),list:as}},cs=(t,e)=>new Set([...t.seen,...e]),$p=(t,e,n)=>{switch(n.kind){case"open-list":{const s=ls(t,e),i=new Set(s.map(o=>o.key)),r=s.filter(o=>!Ur(o)).map(o=>o.key);return{...e,seen:cs(e,r),toasts:[],list:{open:!0,fresh:i}}}case"close-list":return{...e,list:as};case"close-toast":return{...e,toasts:e.toasts.filter(s=>s!==n.key)};case"jump":return{...e,seen:cs(e,[n.key]),toasts:e.toasts.filter(s=>s!==n.key),list:as};case"read-all":return{...e,seen:cs(e,ls(t,e).map(s=>s.key)),toasts:[],list:{open:e.list.open,fresh:new Set}}}},Sp=(t,e)=>ls(t,e).length,Ap=(t,e)=>{const n=gt(t),s=n.findIndex(o=>e.told.has(o.revision)&&o.entries.some(Br(e))),i=s===-1?n.length-1:s,r=n.slice(i).flatMap(o=>{const a=o.entries.filter(l=>e.seen.has(l.key)).map(l=>l.id);return a.length>0?[[o.revision,a]]:[]});return{v:2,since:n[i]?.revision??t.latest.revision,seen:Object.fromEntries(r)}},Cp=(t,e)=>t.target===null&&t.navigate===null?null:{navigate:t.navigate!==null?qt(t.navigate):t.target!==null?e(at(t.target)):null,target:t.target},Hr=3,Tp=t=>e=>({key:e.key,id:e.id,revision:e.revision,title:e.title,body:e.body,jumpable:Ur(e),fresh:t.list.fresh.has(e.key)}),Ep=(t,e)=>{const n=gt(t).map(r=>({revision:r.revision,latest:r===t.latest,cards:r.entries.map(Tp(e))})).reverse(),s=new Map(n.flatMap(r=>r.cards.map(o=>[o.key,o]))),i=e.toasts.flatMap(r=>{const o=s.get(r);return o?[o]:[]});return{unread:Sp(t,e),open:e.list.open,groups:n,toasts:i.slice(0,Hr),waiting:Math.max(0,i.length-Hr)}},mt=t=>t==="light"||t==="dark"?t:null,Fr=t=>t.authored??t.environment,Wr=t=>t.preference??Fr(t),Rp=t=>{const e=Wr(t)==="dark"?"light":"dark";return e===Fr(t)?null:e},Vr=F(Z({value:w(v(),ge(/^element:.+/)),label:w(v(),S(1)),group:B(v())})),_p=L({targets:Vr,providers:F(L({id:w(v(),S(1)),results:F(Gi)}))}),Lp=Z({target:w(v(),ge(/^element:.+/)),body:w(v(),On(),S(1))}),Kr=t=>t.group?`${t.group} \xB7 ${t.label}`:t.label,Gr=(t,e,n)=>{const s=new Map(e.map(i=>[i.value,i]));return{...t,hasTarget:(i,r)=>t.hasTarget(i,r)||s.has(N(r)),commentTargets:(i,r)=>{const o=t.commentTargets(i,r),a=new Set(o.map(l=>l.value));return[...o,...e.filter(l=>!a.has(l.value))]},describe:(i,r,o)=>{if(J(i)){const c=n.get(i.id),p=s.get(N(i.target));return{title:c?.title??i.type,...c?.summary===void 0?{}:{summary:c.summary},tone:c?.tone??"update",targetLabel:p?Kr(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:Kr(l)}},serialize:i=>J(i)?`${i.type} ${N(i.target)} ${JSON.stringify(i.payload)}`:t.serialize(i)}},Zr=typeof globalThis=="object"&&globalThis||typeof window=="object"&&window||typeof self=="object"&&self||typeof global=="object"&&global||(function(){return this})();function Yr(t){return typeof Zr.Buffer<"u"&&Zr.Buffer.isBuffer(t)}function Jr(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 Xr(t){return Object.getOwnPropertySymbols(t).filter(e=>Object.prototype.propertyIsEnumerable.call(t,e))}function Qr(t){return t==null?t===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(t)}const Op="[object RegExp]",Pp="[object String]",zp="[object Number]",Mp="[object Boolean]",Ip="[object Symbol]",Np="[object Date]",Dp="[object Map]",jp="[object Set]",qp="[object Array]",Bp="[object Function]",Up="[object ArrayBuffer]",ds="[object Object]",Hp="[object Error]",Fp="[object DataView]",Wp="[object Uint8Array]",Vp="[object Uint8ClampedArray]",Kp="[object Uint16Array]",Gp="[object Uint32Array]",Zp="[object BigUint64Array]",Yp="[object Int8Array]",Jp="[object Int16Array]",Xp="[object Int32Array]",Qp="[object BigInt64Array]",eh="[object Float32Array]",th="[object Float64Array]";function nh(t,e){return t===e||Number.isNaN(t)&&Number.isNaN(e)}function sh(t,e,n){return kt(t,e,void 0,void 0,void 0,void 0,n)}function kt(t,e,n,s,i,r,o){const a=o(t,e,n,s,i,r);if(a!==void 0)return a;if(typeof t==typeof e)switch(typeof t){case"bigint":case"string":case"boolean":case"symbol":case"undefined":return t===e;case"number":return t===e||Object.is(t,e);case"function":return t===e;case"object":return bt(t,e,r,o)}return bt(t,e,r,o)}function bt(t,e,n,s){if(Object.is(t,e))return!0;let i=Qr(t),r=Qr(e);if(i==="[object Arguments]"&&(i=ds),r==="[object Arguments]"&&(r=ds),i!==r)return!1;switch(i){case Pp:return t.toString()===e.toString();case zp:return nh(t.valueOf(),e.valueOf());case Mp:case Np:case Ip:return Object.is(t.valueOf(),e.valueOf());case Op:return t.source===e.source&&t.flags===e.flags;case Bp: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 Dp:if(t.size!==e.size)return!1;for(const[l,c]of t.entries())if(!e.has(l)||!kt(c,e.get(l),l,t,e,n,s))return!1;return!0;case jp:{if(t.size!==e.size)return!1;const l=Array.from(t.values()),c=Array.from(e.values());for(let p=0;p<l.length;p++){const d=l[p],h=c.findIndex(u=>kt(d,u,void 0,t,e,n,s));if(h===-1)return!1;c.splice(h,1)}return!0}case qp:case Wp:case Vp:case Kp:case Gp:case Zp:case Yp:case Jp:case Xp:case Qp:case eh:case th:if(Yr(t)!==Yr(e)||t.length!==e.length)return!1;for(let l=0;l<t.length;l++)if(!kt(t[l],e[l],l,t,e,n,s))return!1;return!0;case Up:return t.byteLength!==e.byteLength?!1:bt(new Uint8Array(t),new Uint8Array(e),n,s);case Fp:return t.byteLength!==e.byteLength||t.byteOffset!==e.byteOffset?!1:bt(new Uint8Array(t),new Uint8Array(e),n,s);case Hp:return t.name===e.name&&t.message===e.message;case ds:{if(!(bt(t.constructor,e.constructor,n,s)||Jr(t)&&Jr(e)))return!1;const l=[...Object.keys(t),...Xr(t)],c=[...Object.keys(e),...Xr(e)];if(l.length!==c.length)return!1;for(let p=0;p<l.length;p++){const d=l[p],h=t[d];if(!Object.hasOwn(e,d))return!1;const u=e[d];if(!kt(h,u,d,t,e,n,s))return!1}return!0}default:return!1}}finally{n.delete(t),n.delete(e)}}function ih(){}function Qt(t,e){return sh(t,e,ih)}const eo="page",to=t=>N(t),no=(t,e,n,s=new Map)=>{let i=e;const r=[],o=[],a=[],l=[],c=new Map;for(const d of n){if(d.type===D)continue;if(J(d)){const f=s.get(d.id);f===void 0||f.stale!==void 0?o.push({action:d,reason:f?.stale??"target-missing"}):r.push(d);continue}const h=jt(t.actions,d.type);if(!h){o.push({action:d,reason:"unsupported-action-type"});continue}const u=t.apply(i,d);if(u===null){o.push({action:d,reason:t.hasTarget(i,d.target)?"constraint-violated":"target-missing"});continue}if(h.mode!=="append"&&ps(t,i,u)){a.push(d);continue}i=u,r.push(d)}for(const d of n){if(d.type!==D)continue;if(d.target.type!==eo&&!t.hasTarget(i,d.target)){o.push({action:d,reason:"target-missing"});continue}l.push(d);const h=to(d.target);c.set(h,[...c.get(h)??[],d])}const p=new Map(n.map((d,h)=>[d.id,h]));return o.sort((d,h)=>(p.get(d.action.id)??0)-(p.get(h.action.id)??0)),{base:e,state:i,actions:n,applied:r,stale:o,obsolete:a,comments:l,commentsByTarget:c}},ps=(t,e,n)=>e===n?!0:t.canonicalState===void 0?Qt(e,n):Qt(t.canonicalState(e),t.canonicalState(n)),so=t=>{const e=new Set(t.obsolete.map(n=>n.id));return t.actions.filter(n=>!e.has(n.id))},rh=(t,e,n,s)=>{let i=e;const r=s??io(i).map(o=>o.id);for(const o of[...r].reverse())i=oh(t,i,n,o,s!==void 0)??i;return i},io=t=>t.applied.filter(e=>!J(e)),oh=(t,e,n,s,i)=>{const r=io(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?ah(t,e.base,r,o):[],...lh(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=ch(t,e,n,h);if(u!==null)return u}return null},ah=(t,e,n,s)=>{const i=[];let r=e;for(const o of n.slice(0,s+1))i.push(r),r=t.apply(r,o)??r;return i.flatMap((o,a)=>ps(t,o,r)?[n.slice(a,s+1).map(l=>l.id)]:[])},lh=(t,e,n)=>{const s=ro(n),i=e.filter(l=>ro(l).some(c=>s.includes(c))),r=oo(t,n),o=i.filter(l=>oo(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])]},ro=t=>{const e=t.target.type===eo?[]: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]},oo=(t,e)=>jt(t.actions,e.type)?.mode,ch=(t,e,n,s)=>{const i=new Set(e.stale.map(o=>o.action.id)),r=new Set(s);for(;;){const o=n(e.actions.filter(l=>!r.has(l.id))),a=o.stale.filter(l=>!i.has(l.action.id)).map(l=>l.action);if(a.length===0)return ps(t,o.state,e.state)?o:null;if(a.some(l=>l.type===D||J(l)))return null;for(const l of a)r.add(l.id)}},dh=L({v:me(1),template:w(v(),S(1)),actions:F(ke())});class hs{constructor(e){this.storage=e}load(e,n){try{const s=this.storage.getItem(e);if(s===null)return[];const i=C(dh,JSON.parse(s));return!i.success||i.output.template!==n?[]:i.output.actions.flatMap(r=>{const o=C(Le,r);return o.success?[o.output]:[]})}catch{return[]}}save(e,n,s){const i={v:1,template:n,actions:s};try{this.storage.setItem(e,JSON.stringify(i))}catch{}}clear(e){try{this.storage.removeItem(e)}catch{}}}class us{constructor(){this.store=new Map}load(e,n){return new hs({getItem:s=>this.store.get(s)??null,setItem:(s,i)=>{this.store.set(s,i)},removeItem:s=>{this.store.delete(s)}}).load(e,n)}save(e,n,s){this.store.set(e,JSON.stringify({v:1,template:n,actions:s}))}clear(e){this.store.delete(e)}}const fs=()=>{try{if(typeof localStorage<"u")return new hs(localStorage)}catch{}return new us},en=t=>`dev-process-kit:draft:${typeof location>"u"?"local":`${location.pathname}${location.search}`}:${t}`,ph=F(ke());class ao{#e;#n;#s={targets:[],providers:[]};#r=new Map;#t;#i;#o;#l;#a;#c=new Set;#p=[];#m=0;constructor(e){this.#e=e.definition,this.#n=Gr(e.definition,[],this.#r),this.#t=e.base,this.#a=e.storageKey??en(e.definition.name),this.#l=e.storage===void 0?fs():e.storage;const n=e.initialActions??this.#l?.load(this.#a,this.definition.name)??[];this.#i=co(this.definition,n),this.#o=this.#h(this.#i),this.#d()&&this.#b()}get definition(){return this.#n}setComponentSnapshot(e){const n=zn(_p,e);if(!Qt(n,this.#s)){this.#s=n,this.#k(),this.#o=this.#h(this.#i);for(const s of this.#c)s()}}setTemplate(e){this.#e=e,this.#k(),this.#o=this.#h(this.#i);for(const n of this.#c)n()}#k(){this.#r=Zi(this.#i,this.#s.providers),this.#n=Gr(this.#e,this.#s.targets,this.#r)}#h(e){return no(this.definition,this.#t,e,Zi(e,this.#s.providers))}get base(){return this.#t}get actions(){return this.#i}get derivation(){return this.#o}get lastIssues(){return this.#p}get prunedCount(){return this.#m}descriptorFor(e,n){return lo(this.definition,e,n)}dispatch(e){const n=this.#x(e,this.#o.state);if(!n.ok)return this.#g([n.issue]);const s=this.descriptorFor(n.action.type,n.action.target);return s?(this.#u(Nn(this.#i,n.action,s),[n.action.id]),{ok:!0,id:n.action.id}):this.#g([{path:"type",message:"unknown action type"}])}dispatchBatch(e){const n=C(ph,e);if(!n.success)return this.#g([Oe(n.issues)]);const s=n.output;if(s.length===0)return{ok:!0,ids:[]};let i=this.#i,r=this.#o.state;const o=[];for(const a of s){const l=this.#x(a,r);if(!l.ok)return this.#g([l.issue]);const c=l.action,p=this.descriptorFor(c.type,c.target);if(!p)return this.#g([{path:"type",message:"unknown action type"}]);if((c.type==="comment"||J(c)?c.target.type==="page"||this.definition.hasTarget(r,c.target)?r:null:this.definition.apply(r,c))===null)return this.#g([{path:"target",message:"batch action is not applicable"}]);i=Nn(i,c,p),r=this.#h(i).state,o.push(c.id)}return this.#u(i,o),{ok:!0,ids:o}}#x(e,n){const s=C(Fi,e);if(!s.success)return{ok:!1,issue:Oe(s.issues)};const i=this.descriptorFor(s.output.type,typeof s.output.target=="string"?Mn(s.output.target,"page"):s.output.target);if(!i)return{ok:!1,issue:{path:"type",message:`unknown action type "${s.output.type}"`}};const r=Gl(s.output,i);if(!r.ok)return r;const o=this.definition.canonicalTarget?.(n,r.action.target)??r.action.target;return{ok:!0,action:{...r.action,target:o}}}#g(e){return this.#p=e,{ok:!1,issues:e}}editComment(e,n){const s=this.#i.find(a=>a.id===e);if(s?.type!==D)return this.#g([{path:"id",message:`no comment "${e}" in the draft`}]);if(lt(s)===n)return{ok:!0,id:e};const i=C(jn.schema,{...s,payload:{body:n}});if(!i.success)return this.#g([Oe(i.issues)]);const r=C(Le,i.output);if(!r.success)return this.#g([Oe(r.issues)]);const o=r.output;return this.#u(this.#i.map(a=>a===s?o:a),[]),{ok:!0,id:e}}removeAction(e){const n=this.#i.filter(s=>s.id!==e);n.length!==this.#i.length&&this.#u(n)}clearActions(){this.#i.length>0&&this.#u([])}replaceActions(e){this.#u(co(this.definition,e))}setBase(e){this.#t=e,this.#u(this.#i)}subscribe(e){return this.#c.add(e),()=>{this.#c.delete(e)}}exportDraft(e){return{template:this.definition.name,frameworkVersion:e,exportedAt:new Date().toISOString(),actions:this.#i}}#u(e,n){this.#p=[],this.#i=e,this.#k(),this.#o=this.#h(this.#i),this.#d(n),this.#b();for(const s of this.#c)s()}#d(e){const n=this.#f(),s=rh(this.definition,this.#o,i=>this.#h(i),e);return s===this.#o?n:(this.#m+=this.#i.length-s.actions.length,this.#i=[...s.actions],this.#k(),this.#o=this.#h(this.#i),this.#f(),!0)}#f(){return this.#o.obsolete.length===0?!1:(this.#m+=this.#o.obsolete.length,this.#i=so(this.#o),this.#k(),this.#o=this.#h(this.#i),!0)}#b(){this.#l?.save(this.#a,this.definition.name,this.#i)}}const lo=(t,e,n)=>e==="comment"?jn:n!==void 0&&J({type:e,target:n})?Ql:jt(t.actions,e),co=(t,e)=>e.flatMap(n=>{const s=C(Le,n);if(!s.success)return[];const i=s.output,r=lo(t,i.type,i.target);if(!r)return[];const o=C(r.schema,i);if(!o.success)return[];const a=C(Le,o.output);return a.success?[a.output]:[]}),hh=()=>({status:{kind:"idle"},request:0}),uh=(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}},fh=(t,e)=>{if(t.actions===0||t.railOpen)return null;const n=W(t.locale),s=e.status;return{send:t.sendable?{label:s.kind==="sending"?n.handoffSending:s.kind==="sent"?n.handoffSent:n.handoffSend,disabled:s.kind==="sending"}:null,copy:s.kind==="copied"?{label:n.handoffCopied,status:"copied"}:s.kind==="copy-failed"?{label:n.handoffCopyFailed,status:"failed"}:{label:n.handoffCopy,status:"idle"},note:s.kind==="send-failed"?Vn(s.reason,t.locale):null}},po=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()}},gh=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)}},mh=(t,e)=>{const n=()=>po(t);return{version:X,template:t.definition.name,host:e,ready:t.ready,get base(){return t.controller().base},get state(){return t.derivation().state},get navigation(){return t.navigation()},get actions(){return t.controller().actions},get comments(){return t.derivation().comments},get stale(){return t.derivation().stale},get issues(){return t.issues()},dispatch:s=>t.dispatch(s),dispatchBatch:s=>t.dispatchBatch(s),comment:(s,i)=>t.dispatch({type:D,target:s,payload:{body:i}}),editComment:(s,i)=>t.editComment(s,i),removeAction:s=>t.removeAction(s),clearActions:()=>t.clearActions(),importDraft:s=>t.controller().replaceActions(s),navigate:(s,i)=>t.navigate(s,i),hashFor:s=>t.hashFor(s),snapshot:n,exportDraft:()=>t.controller().exportDraft(X),exportBrief:()=>Fn(n(),t.controller().definition,X),subscribe:s=>t.subscribe(s)}},gs=(t,e)=>({read(n){try{const s=t.getItem(n);return s===null?null:e(JSON.parse(s))}catch{return null}},write(n,s){try{return t.setItem(n,JSON.stringify(s)),!0}catch{return!1}},remove(n){try{t.removeItem(n)}catch{}}}),le=t=>{const e=new Map;return gs({getItem:n=>e.get(n)??null,setItem:(n,s)=>{e.set(n,s)},removeItem:n=>{e.delete(n)}},t)},Ge=t=>{try{if(typeof localStorage<"u")return gs(localStorage,t)}catch{}return le(t)},kh=t=>{try{if(typeof sessionStorage<"u")return gs(sessionStorage,t)}catch{}return le(t)},bh=8e3,vh=t=>t.localName==="script"&&t.getAttribute("type")==="application/json"&&t.hasAttribute(Dr);class xh{#e;#n;#s=null;#r=null;#t=null;#i=null;#o="";#l=null;#a=new Map;#c=new Set;constructor(e,n){this.#e=e,this.#n=n,e.addController(this)}get view(){return this.#s&&this.#t?Ep(this.#s,this.#t):null}get error(){return this.#r}hostConnected(){!this.#m()&&!this.#k()&&this.#g(),document.addEventListener("pointerdown",this.#b,!0),document.addEventListener("keydown",this.#w)}hostUpdate(){!this.#m()&&this.#k()&&this.#u()}hostDisconnected(){this.#u(),document.removeEventListener("pointerdown",this.#b,!0),document.removeEventListener("keydown",this.#w);for(const e of this.#a.values())e.handle!==null&&clearTimeout(e.handle);this.#a.clear()}send(e){!this.#s||!this.#t||(this.#t=$p(this.#s,this.#t,e),this.#h(),this.#d(),this.#e.requestUpdate())}toggleList(){this.send({kind:this.#t?.list.open?"close-list":"open-list"})}show(e){const n=this.#s?gt(this.#s).flatMap(s=>s.entries).find(s=>s.key===e):void 0;n&&(this.send({kind:"jump",key:e}),this.#n.show(n))}pause(e){const n=this.#c.size>0;if(this.#c.add(e),n)return;const s=Date.now();for(const i of this.#a.values())i.handle!==null&&clearTimeout(i.handle),i.handle=null,i.remaining=Math.max(0,i.deadline-s)}resume(e){if(!(!this.#c.delete(e)||this.#c.size>0))for(const[n,s]of this.#a)this.#f(n,s)}#p(){return`${this.#n.storageKey()}:seen-changes`}#m(){return this.#s!==null||this.#r!==null}#k(){const e=[...this.#e.children].find(vh);if(!e)return!1;let n;try{n=JSON.parse(e.textContent??"")}catch(i){return this.#x(i instanceof Error?i.message:String(i))}const s=vp(n);return s.ok?(this.#s=s.log,this.#i=this.#n.persist()?Ge(qr):le(qr),this.#t=wp(s.log,this.#i.read(this.#p())),this.#h(),this.#d(),this.#e.requestUpdate(),!0):this.#x(s.error)}#h(){if(!this.#s||!this.#t)return;const e=Ap(this.#s,this.#t),n=JSON.stringify(e);n!==this.#o&&(this.#o=n,this.#i?.write(this.#p(),e))}#x(e){return console.error("[dev-process-kit] invalid change log:",e),this.#r=e,this.#e.requestUpdate(),!0}#g(){this.#l=new MutationObserver(()=>{(this.#m()||this.#k())&&this.#u()}),this.#l.observe(this.#e,{childList:!0})}#u(){this.#l?.disconnect(),this.#l=null}#d(){const e=new Set(this.view?.toasts.map(n=>n.key)??[]);for(const[n,s]of this.#a)e.has(n)||(s.handle!==null&&clearTimeout(s.handle),this.#a.delete(n));for(const n of e){if(this.#a.has(n))continue;const s={handle:null,deadline:0,remaining:bh};this.#a.set(n,s),this.#c.size===0&&this.#f(n,s)}}#f(e,n){n.deadline=Date.now()+n.remaining,n.handle=setTimeout(()=>{n.handle=null,this.send({kind:"close-toast",key:e})},n.remaining)}#b=e=>{!this.#t?.list.open||this.#n.inside(e.composedPath())||this.send({kind:"close-list"})};#w=e=>{e.key!=="Escape"||!this.#t?.list.open||this.send({kind:"close-list"})}}const tn="dpk-changes",yh=(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=${tn}
1300
- aria-expanded=${t.open?"true":"false"}
1301
- aria-label=${s}
1302
- title=${s}
1303
- @click=${n.toggleList}
1304
- >
1305
- ${ur()} ${t.unread>0?b`<span class="dpk-bell-badge" aria-hidden="true">${t.unread}</span>`:g}
1306
- </button>`},ho=(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>`:g,uo=(t,e,n,s)=>s==="list"||t.unread>0?b`<button
1309
- class=${s==="list"?"dpk-btn dpk-changes-read-all":"dpk-toast-more dpk-changes-read-all"}
1310
- type="button"
1311
- aria-disabled=${t.unread>0?"false":"true"}
1312
- @click=${n.readAll}
1313
- >
1314
- ${e.changesReadAll}
1315
- </button>`:g,wh=(t,e,n)=>b`<section class="dpk-changes-group" data-revision=${t.revision}>
1316
- <h3 class="dpk-changes-revision">
1317
- <span>${t.revision}</span>
1318
- ${t.latest?b`<span class="dpk-changes-current">${e.changesCurrent}</span>`:g}
1319
- </h3>
1320
- <ol class="dpk-changes-list">
1321
- ${ct(t.cards,s=>s.key,s=>b`<li
1322
- class="dpk-change"
1323
- data-key=${s.id}
1324
- data-revision=${s.revision}
1325
- ?data-fresh=${s.fresh}
1326
- >
1327
- <p class="dpk-change-title">
1328
- ${s.fresh?b`<span class="dpk-change-new">${e.changesNew}</span>`:g} ${s.title}
1329
- </p>
1330
- ${s.body===null?g:b`<p class="dpk-change-body">${s.body}</p>`} ${ho(s,e,n)}
1331
- </li>`)}
1332
- </ol>
1333
- </section>`,$h=(t,e,n)=>t.open?b`<div id=${tn} class="dpk-changes" popover="manual" role="dialog" aria-label=${e.changesTitle}>
1334
- <div class="dpk-changes-head">
1335
- <h2 class="dpk-changes-title">${e.changesTitle}</h2>
1336
- ${uo(t,e,n,"list")}
1337
- </div>
1338
- ${ct(t.groups,s=>s.revision,s=>wh(s,e,n))}
1339
- </div>`:g,Sh=(t,e,n)=>b`<section
1340
- class="dpk-toasts"
1341
- aria-live="polite"
1342
- aria-label=${e.changes}
1343
- @pointerenter=${()=>n.pause("pointer")}
1344
- @pointerleave=${()=>n.resume("pointer")}
1345
- @focusin=${()=>n.pause("focus")}
1346
- @focusout=${()=>n.resume("focus")}
1347
- >
1348
- ${ct(t.toasts,s=>s.key,s=>b`<div class="dpk-toast" data-key=${s.id}>
1349
- <span class="dpk-toast-icon" aria-hidden="true">${ur()}</span>
1350
- <div class="dpk-toast-text">
1351
- <p class="dpk-change-title">${s.title}</p>
1352
- ${s.body===null?g:b`<p class="dpk-change-body">${s.body}</p>`}
1353
- </div>
1354
- ${ho(s,e,n)}
1355
- <button
1356
- class="dpk-toast-close"
1357
- type="button"
1358
- aria-label=${e.changesDismiss}
1359
- title=${e.changesDismiss}
1360
- @click=${()=>n.dismiss(s.key)}
1361
- >
1362
- ${Bt()}
1363
- </button>
1364
- </div>`)}
1365
- ${t.toasts.length+t.waiting>1?b`<div class="dpk-toast-actions">
1366
- ${t.waiting>0?b`<button class="dpk-toast-more" type="button" @click=${n.openList}>
1367
- ${e.changesWaiting(t.waiting)} · ${e.changesSeeAll}
1368
- </button>`:g}
1369
- ${uo(t,e,n,"toasts")}
1370
- </div>`:g}
1371
- </section>`,ms=(t,e)=>typeof t=="object"&&t!==null&&e.every(n=>typeof Reflect.get(t,n)=="function"),Ah=t=>ms(t,["use"]),Ch=t=>ms(t,["anchorFor","canSendToClaude","sendToClaude"]),Th=t=>ms(t,["collection"]),fo=async(t,e)=>{try{return await t.use(e)}catch{return null}},Eh=(t,e)=>({async canSend(){try{return await t.canSendToClaude()==="available"}catch{return!1}},async send({brief:n,draft:s,anchor:i}){let r=hc(n);if(r===null){if(e===null)return{ok:!1,reason:"too_large"};try{const o=e.collection(cc).doc();await o.set({brief:n,draft:s,createdAt:new Date().toISOString()}),r=uc(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:gc(o)}}}}),Rh=async t=>{if(!Ah(t))return null;const[e,n]=await Promise.all([fo(t,"comments"),fo(t,"db")]);return Ch(e)?Eh(e,Th(n)?n:null):null},_h=()=>Reflect.get(globalThis,"claude");class Lh{#e;#n;#s=null;#r=!1;constructor(e,n=_h){this.#e=e,this.#n=n,e.addController(this)}get available(){return this.#r}hostConnected(){this.#s??=Rh(this.#n()),this.#t(),window.addEventListener("focus",this.#t)}hostDisconnected(){window.removeEventListener("focus",this.#t)}async send(e){const n=await this.#s;if(!n)return{ok:!1,reason:"forbidden"};const s=await n.send(e);return this.#t(),s}#t=async()=>{const e=await this.#s,n=e?await e.canSend():!1;n!==this.#r&&(this.#r=n,this.#e.requestUpdate())}}const ks="dev-process-kit:color-scheme",Oh="(prefers-color-scheme: dark)",go=()=>typeof matchMedia=="function"?matchMedia(Oh):null,mo=()=>mt(document.documentElement.dataset.theme)??(go()?.matches===!0?"dark":"light");class Ph{#e;#n;#s=null;#r=null;#t="light";#i=null;#o=null;constructor(e,n){this.#e=e,this.#n=n,e.addController(this)}hostConnected(){this.#s===null&&(this.#s=this.#n()?Ge(mt):le(mt),this.#r=this.#s.read(ks)),this.#t=mo(),this.#i=go(),this.#i?.addEventListener("change",this.#a),this.#o=new MutationObserver(this.#a),this.#o.observe(document.documentElement,{attributes:!0,attributeFilter:["data-theme"]})}hostDisconnected(){this.#i?.removeEventListener("change",this.#a),this.#i=null,this.#o?.disconnect(),this.#o=null}resolve(e){return Wr(this.#l(e))}toggle(e){this.#r=Rp(this.#l(e)),this.#r===null?this.#s?.remove(ks):this.#s?.write(ks,this.#r),this.#e.requestUpdate()}#l(e){return{preference:this.#r,authored:e,environment:this.#t}}#a=()=>{const e=mo();e!==this.#t&&(this.#t=e,this.#e.requestUpdate())}}const zh=(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},ko=(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)},bo=t=>ko(t.filter(e=>"elementActions"in e&&e.id.length>0),e=>e.id),vo=(t,e)=>{for(const n of bo(t)){const s=tc(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)}},Mh=t=>{const e=Reflect.get(t,"elementActionResults");return Array.isArray(e)?e.flatMap(n=>{const s=C(Gi,n);return s.success?[s.output]:[]}):[]},Ih=t=>{const e=[];for(const n of t){if(!("commentTargets"in n))continue;const s=C(Vr,n.commentTargets);s.success&&e.push(...s.output)}return{targets:ko(e,n=>n.value),providers:bo(t).map(n=>({id:n.id,results:Mh(n)}))}},Nh=2400;class Dh{#e=hh();#n=null;#s;constructor(e){this.#s=e,e.addController(this)}get state(){return this.#e}hostDisconnected(){this.#i()}async copy(e){this.#r({kind:"copy-started"});const n=this.#e.request,s=await Wn(e()).catch(()=>!1);this.#r({kind:"copy-finished",request:n,ok:s}),this.#t(n)}async send(e){if(this.#e.status.kind==="sending")return;this.#r({kind:"send-started"});const n=this.#e.request,s=await e().catch(()=>({ok:!1,reason:"error"}));this.#r({kind:"send-finished",request:n,outcome:s}),s.ok&&this.#t(n)}#r(e){(e.kind==="copy-started"||e.kind==="send-started")&&this.#i(),this.#e=uh(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})},Nh))}#i(){this.#n!==null&&clearTimeout(this.#n),this.#n=null}}const bs="dev-process-kit:locale";class jh{#e;#n;#s;#r=null;#t=null;#i;#o;constructor(e,n,s){this.#e=e,this.#n=n,this.#s=s,e.addController(this)}get authored(){if(this.#i===void 0)return Et(Tt(this.#e));const e=this.#e.parentNode;return Et(this.#i??(e===null?null:Tt(e)))}get locale(){return this.#o??this.#l()}#l(){return ua({preference:this.#t,authored:this.authored})}hostConnected(){this.#r===null&&(this.#r=this.#n()?Ge(Qs):le(Qs),this.#t=this.#r.read(bs)),this.#i??=this.#e.getAttribute("lang"),this.#a()}pick(e){this.#t=fa(e,this.authored),this.#t===null?this.#r?.remove(bs):this.#r?.write(bs,this.#t),this.#a(),this.#e.requestUpdate()}#a(){const e=this.#t??this.#i??null;e===null?this.#e.removeAttribute("lang"):this.#e.getAttribute("lang")!==e&&this.#e.setAttribute("lang",e);const n=this.#l();if(n===this.#o)return;const s=this.#o===void 0;this.#o=n,this.#s(),(!s||this.#t!==null)&&document.dispatchEvent(new Event(bn))}}const qh="(max-width: 760px)",Bh=()=>typeof matchMedia=="function"?matchMedia(qh):null;class Uh{#e;#n=null;#s=!1;constructor(e){this.#e=e,e.addController(this)}hostConnected(){this.#n=Bh(),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 xo=()=>qt(typeof location>"u"?"":location.hash),Hh=(t,e)=>{if(typeof history>"u")return;const n=`${location.pathname}${location.search}${Fe(t)}`;`${location.pathname}${location.search}${location.hash}`!==n&&(e?history.replaceState(null,"",n):history.pushState(null,"",n))};class Fh{#e;#n=null;#s=0;constructor(e){this.#e=e}get orphans(){return this.#s}route(){const e=this.#e.renderRoot,n=Ce(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 yo=(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},Wh=(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},wo=(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),$o=(t,e,n)=>{const s=Math.min(n,e/4);return{top:t+s,bottom:t+e-s}},So=(t,e,n=0)=>{const s=t.getBoundingClientRect();t.scrollTop=wo(t.scrollTop,$o(s.top+t.clientTop,t.clientHeight,n),e.getBoundingClientRect())},Ao=(t,e,n=0)=>{const s=t.getBoundingClientRect(),i=e.getBoundingClientRect();t.scrollLeft=wo(t.scrollLeft,$o(s.left+t.clientLeft,t.clientWidth,n),{top:i.left,bottom:i.right})},Co="data-dpk-target",Vh=2800,To=48,Kh=t=>t.getClientRects().length>0,Eo=(t,e)=>{const n=yo(t,`[${Co}]`).filter(r=>(r.getAttribute(Co)??"").split(/\s+/).includes(e)),s=yo(t,"[data-dpk-comment]").filter(r=>r.getAttribute("data-dpk-comment")===e),i=[...n,...s];return i.find(Kh)??i[0]??null},Ro=(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},Gh=(t,e)=>{for(const n of Wh(e,t))Ro(n,"y")&&So(n,e,To),Ro(n,"x")&&Ao(n,e,To)},_o="color-mix(in srgb, var(--dpk-accent) 45%, transparent)",Ne={outline:"2px solid var(--dpk-accent)",outlineOffset:"3px"},Lo={outline:"2px solid transparent",outlineOffset:"3px"},Zh=t=>t?[{...Ne},{...Ne,offset:.85},{...Lo}]:[{...Ne,boxShadow:`0 0 0 0 ${_o}`},{...Ne,boxShadow:"0 0 0 14px transparent",offset:.3},{...Ne,boxShadow:`0 0 0 0 ${_o}`,offset:.31},{...Ne,boxShadow:"0 0 0 14px transparent",offset:.6},{...Ne,offset:.85},{...Lo}],vt={filter:"drop-shadow(0 0 3px var(--dpk-accent)) drop-shadow(0 0 3px var(--dpk-accent))"},nn={filter:"drop-shadow(0 0 3px transparent) drop-shadow(0 0 3px transparent)"},Yh=t=>t?[{...vt},{...vt,offset:.85},{...nn}]:[{...vt},{...nn,offset:.3},{...vt,offset:.31},{...nn,offset:.6},{...vt,offset:.61},{...nn}],Jh=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?Yh(e):Zh(e),{duration:Vh,easing:"ease-out"})},ve={min:180,max:560,step:16,largeStep:64},Xh={side:"left",defaultWidth:260},sn=t=>Math.round(Math.min(ve.max,Math.max(ve.min,t))),Oo=t=>typeof t=="number"&&Number.isFinite(t)?sn(t):null,vs=(t,e)=>t==="left"?e:-e,Qh=(t,e)=>sn(t.startWidth+vs(t.side,e-t.startX)),eu=(t,e,{key:n,shiftKey:s})=>{const i=s?ve.largeStep:ve.step;switch(n){case"ArrowLeft":return sn(t+vs(e,-i));case"ArrowRight":return sn(t+vs(e,i));case"Home":return ve.min;case"End":return ve.max;default:return null}},Po=t=>typeof t=="boolean"?t:null,tu=t=>t==="left"?"right":"left",nu=(t,e)=>e?{action:"expand",points:tu(t)}:{action:"collapse",points:t},su=t=>`dev-process-kit:sidebar-collapsed:${t}`;class iu{#e;#n;#s=null;#r="";#t=!1;#i=!1;constructor(e,n){this.#e=e,this.#n=n,e.addController(this)}hostConnected(){this.#s===null&&(this.#s=this.#n.persist()?Ge(Po):le(Po),this.#r=su(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 ru=t=>`dev-process-kit:sidebar-width:${t}`,xs={kind:"idle"};class ou{constructor(e,n){this.#s=null,this.#r="",this.#t=null,this.#i=xs,this.handlers={pointerdown:s=>{s.button===0&&(s.preventDefault(),s.currentTarget instanceof Element&&s.currentTarget.setPointerCapture(s.pointerId),this.#i={kind:"dragging",pointerId:s.pointerId,side:this.#n.layout().side,startX:s.clientX,startWidth:this.width},this.#e.requestUpdate())},pointermove:s=>{const i=this.#i;i.kind!=="dragging"||i.pointerId!==s.pointerId||this.#l(Qh(i,s.clientX))},pointerup:s=>this.#o(s),pointercancel:s=>this.#o(s),keydown:s=>{const i=eu(this.width,this.#n.layout().side,s);i!==null&&(s.preventDefault(),this.#l(i),this.#a())},dblclick:()=>{this.#l(this.#n.layout().defaultWidth),this.#a()}},this.#e=e,this.#n=n,e.addController(this)}#e;#n;#s;#r;#t;#i;hostConnected(){this.#s===null&&(this.#s=this.#n.persist()?Ge(Oo):le(Oo),this.#r=ru(this.#n.template()),this.#t=this.#s.read(this.#r))}hostDisconnected(){this.#i=xs}get width(){return this.#t??this.#n.layout().defaultWidth}get dragging(){return this.#i.kind==="dragging"}#o(e){const n=this.#i;n.kind!=="dragging"||n.pointerId!==e.pointerId||(this.#i=xs,this.#a(),this.#e.requestUpdate())}#l(e){const n=e===this.#n.layout().defaultWidth?null:e;n!==this.#t&&(this.#t=n,this.#e.requestUpdate())}#a(){this.#t===null?this.#s?.remove(this.#r):this.#s?.write(this.#r,this.#t)}}const au=[_t,xn,de`
1372
- :host {
1373
- display: block;
1374
- min-height: 100%;
1375
- background: var(--dpk-paper);
1376
- color-scheme: light;
1377
- }
1378
-
1379
- /* The element stamps its resolved scheme; nested components inherit it. */
1380
- :host([data-theme='dark']) {
1381
- color-scheme: dark;
1382
- }
1383
-
1384
- .dpk-shell {
1385
- display: grid;
1386
- /* One column no wider than the host: a truncated title must not widen
1387
- the page past a phone screen. */
1388
- grid-template-columns: minmax(0, 1fr);
1389
- grid-template-rows: auto minmax(0, 1fr) auto;
1390
- min-height: 100%;
1391
- max-height: 100%;
1392
- /*
1393
- * The fallback when the page gives the host no height: the viewport, less
1394
- * the safe-area insets a Claude Artifact pads its root by. Without it the
1395
- * shell grows with its content, leaving the page's own ground below a
1396
- * short page and scrolling the header and the memo away on a long one.
1397
- * A host with a height still wins: the min/max-height above pin the shell
1398
- * to it.
1399
- */
1400
- height: calc(100dvh - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px));
1401
- }
1402
-
1403
- /* ------------------------------------------------------------- header */
1404
-
1405
- .dpk-header {
1406
- position: relative;
1407
- z-index: 20;
1408
- display: flex;
1409
- flex-wrap: wrap;
1410
- align-items: center;
1411
- gap: 8px 14px;
1412
- min-height: 60px;
1413
- /* Right padding keeps the header content clear of the fixed review button. */
1414
- padding: 10px 72px 10px 16px;
1415
- border-bottom: 1px solid var(--dpk-rule);
1416
- background: var(--dpk-glass);
1417
- backdrop-filter: saturate(1.6) blur(14px);
1418
- box-shadow: 0 1px 0 var(--dpk-highlight) inset;
1419
- }
1420
-
1421
- /* A hairline of the accent along the bottom edge, fading out to the right. */
1422
- .dpk-header::after {
1423
- content: '';
1424
- position: absolute;
1425
- left: 0;
1426
- right: 0;
1427
- bottom: -1px;
1428
- height: 1px;
1429
- background: linear-gradient(
1430
- 90deg,
1431
- color-mix(in srgb, var(--dpk-accent) 70%, transparent),
1432
- color-mix(in srgb, var(--dpk-accent) 0%, transparent) 38%
1433
- );
1434
- pointer-events: none;
1435
- }
1436
-
1437
- /* Kit mark: a stack of pages, the single HTML page the agent wrote. */
1438
- .dpk-brand {
1439
- position: relative;
1440
- flex: none;
1441
- width: 32px;
1442
- height: 32px;
1443
- border-radius: 9px;
1444
- background:
1445
- radial-gradient(circle at 30% 20%, rgba(255, 255, 255, 0.35), transparent 60%),
1446
- linear-gradient(145deg, var(--dpk-accent-bright), var(--dpk-accent-strong));
1447
- box-shadow:
1448
- inset 0 1px 0 rgba(255, 255, 255, 0.3),
1449
- inset 0 -1px 0 rgba(0, 0, 0, 0.12),
1450
- 0 4px 12px -4px color-mix(in srgb, var(--dpk-accent) 70%, transparent);
1451
- }
1452
-
1453
- .dpk-brand::before,
1454
- .dpk-brand::after {
1455
- content: '';
1456
- position: absolute;
1457
- width: 12px;
1458
- height: 15px;
1459
- border-radius: 3px;
1460
- }
1461
-
1462
- .dpk-brand::before {
1463
- left: 12px;
1464
- top: 7px;
1465
- background: rgba(255, 255, 255, 0.4);
1466
- }
1467
-
1468
- .dpk-brand::after {
1469
- left: 8px;
1470
- top: 10px;
1471
- background:
1472
- linear-gradient(var(--dpk-accent), var(--dpk-accent)) 3px 4px / 6px 1.5px no-repeat,
1473
- linear-gradient(var(--dpk-accent), var(--dpk-accent)) 3px 7.5px / 4px 1.5px no-repeat,
1474
- #fff;
1475
- box-shadow: 0 1px 3px rgba(0, 0, 0, 0.22);
1476
- }
1477
-
1478
- /* The title takes what the header has left: the template's header content
1479
- keeps its own width, and only a title too long for the rest ellipsizes.
1480
- Header content with no room beside the title wraps to a row of its own
1481
- rather than being squeezed. */
1482
- .dpk-title {
1483
- flex: 1 1 0%;
1484
- display: flex;
1485
- flex-direction: column;
1486
- gap: 3px;
1487
- min-width: min(160px, 100%);
1488
- }
1489
-
1490
- .dpk-title h1 {
1491
- font-size: 16px;
1492
- font-weight: 680;
1493
- letter-spacing: -0.02em;
1494
- white-space: nowrap;
1495
- overflow: hidden;
1496
- text-overflow: ellipsis;
1497
- }
1498
-
1499
- .dpk-template-mark {
1500
- align-self: flex-start;
1501
- font-family: var(--dpk-mono);
1502
- font-size: 9.5px;
1503
- font-weight: 600;
1504
- letter-spacing: 0.14em;
1505
- line-height: 1;
1506
- text-transform: uppercase;
1507
- color: var(--dpk-accent);
1508
- }
1509
-
1510
- .dpk-header-slot {
1511
- flex: 0 1 auto;
1512
- min-width: 0;
1513
- display: flex;
1514
- align-items: center;
1515
- gap: 10px;
1516
- }
1517
-
1518
- .dpk-header-meta {
1519
- display: flex;
1520
- align-items: center;
1521
- gap: 0;
1522
- margin-left: auto;
1523
- padding: 3px;
1524
- border-radius: 999px;
1525
- border: 1px solid var(--dpk-rule);
1526
- background: var(--dpk-paper-sunken);
1527
- font-family: var(--dpk-mono);
1528
- font-size: 10px;
1529
- letter-spacing: 0.02em;
1530
- color: var(--dpk-ink-faint);
1531
- white-space: nowrap;
1532
- }
1533
-
1534
- .dpk-header-meta span {
1535
- padding: 3px 9px;
1536
- }
1537
-
1538
- .dpk-header-meta span + span {
1539
- border-left: 1px solid var(--dpk-rule);
1540
- }
1541
-
1542
- .dpk-version-select {
1543
- margin: -3px 0;
1544
- padding: 3px 14px 3px 0;
1545
- border: 0;
1546
- border-radius: 4px;
1547
- background: transparent
1548
- 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>")
1549
- no-repeat right 2px center;
1550
- appearance: none;
1551
- /* As wide as the version shown, not the longest prerelease in the list. */
1552
- field-sizing: content;
1553
- color: inherit;
1554
- font: inherit;
1555
- letter-spacing: inherit;
1556
- cursor: pointer;
1557
- }
1558
-
1559
- .dpk-version-select:hover {
1560
- color: var(--dpk-ink-soft);
1561
- }
1562
-
1563
- .dpk-version-select:focus-visible {
1564
- outline: none;
1565
- box-shadow: var(--dpk-focus);
1566
- }
1567
-
1568
- .dpk-header-meta .dpk-meta-count {
1569
- margin-left: 2px;
1570
- border-left: 0;
1571
- border-radius: 999px;
1572
- background: var(--dpk-paper-raised);
1573
- color: var(--dpk-ink-soft);
1574
- box-shadow: var(--dpk-bevel), var(--dpk-shadow-xs);
1575
- }
1576
-
1577
- .dpk-header-meta .dpk-meta-count[data-active='true'] {
1578
- background: var(--dpk-accent-soft);
1579
- color: var(--dpk-accent);
1580
- box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--dpk-accent) 25%, transparent);
1581
- }
1582
-
1583
- .dpk-header-tools {
1584
- display: flex;
1585
- flex: none;
1586
- align-items: center;
1587
- gap: 2px;
1588
- padding: 3px;
1589
- border: 1px solid var(--dpk-rule);
1590
- border-radius: 999px;
1591
- background: var(--dpk-paper-sunken);
1592
- }
1593
-
1594
- .dpk-lang-select {
1595
- flex: none;
1596
- height: 26px;
1597
- padding: 0 24px 0 10px;
1598
- border: 0;
1599
- border-radius: 999px;
1600
- background: transparent
1601
- 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>")
1602
- no-repeat right 8px center;
1603
- appearance: none;
1604
- color: var(--dpk-ink-soft);
1605
- font: inherit;
1606
- font-size: 12px;
1607
- font-weight: 520;
1608
- cursor: pointer;
1609
- transition:
1610
- color 160ms var(--dpk-ease),
1611
- background-color 160ms var(--dpk-ease);
1612
- }
1613
-
1614
- .dpk-lang-select:hover {
1615
- color: var(--dpk-ink);
1616
- background-color: var(--dpk-paper-raised);
1617
- }
1618
-
1619
- .dpk-lang-select:focus-visible {
1620
- outline: none;
1621
- box-shadow: var(--dpk-focus);
1622
- }
1623
-
1624
- .dpk-theme-toggle {
1625
- display: inline-flex;
1626
- flex: none;
1627
- align-items: center;
1628
- justify-content: center;
1629
- width: 26px;
1630
- height: 26px;
1631
- padding: 0;
1632
- border: 0;
1633
- border-radius: 999px;
1634
- background: transparent;
1635
- color: var(--dpk-ink-soft);
1636
- cursor: pointer;
1637
- transition:
1638
- color 160ms var(--dpk-ease),
1639
- background 160ms var(--dpk-ease),
1640
- transform 300ms var(--dpk-ease-spring);
1641
- }
1642
-
1643
- .dpk-theme-toggle svg {
1644
- width: 14px;
1645
- height: 14px;
1646
- }
1647
-
1648
- .dpk-theme-toggle:hover {
1649
- color: var(--dpk-ink);
1650
- background: var(--dpk-paper-raised);
1651
- transform: rotate(-18deg);
1652
- }
1653
-
1654
- .dpk-theme-toggle:focus-visible {
1655
- outline: none;
1656
- box-shadow: var(--dpk-focus);
1657
- }
1658
-
1659
- /* ------------------------------------------------------------ changes */
1660
-
1661
- .dpk-bell {
1662
- position: relative;
1663
- display: inline-flex;
1664
- flex: none;
1665
- align-items: center;
1666
- justify-content: center;
1667
- width: 26px;
1668
- height: 26px;
1669
- padding: 0;
1670
- border: 0;
1671
- border-radius: 999px;
1672
- background: transparent;
1673
- color: var(--dpk-ink-soft);
1674
- cursor: pointer;
1675
- transition:
1676
- color 160ms var(--dpk-ease),
1677
- background 160ms var(--dpk-ease);
1678
- }
1679
-
1680
- .dpk-bell svg {
1681
- width: 14px;
1682
- height: 14px;
1683
- }
1684
-
1685
- .dpk-bell:hover,
1686
- .dpk-bell[aria-expanded='true'] {
1687
- color: var(--dpk-ink);
1688
- background: var(--dpk-paper-raised);
1689
- }
1690
-
1691
- .dpk-bell:focus-visible {
1692
- outline: none;
1693
- box-shadow: var(--dpk-focus);
1694
- }
1695
-
1696
- .dpk-bell-badge {
1697
- position: absolute;
1698
- top: -5px;
1699
- right: -5px;
1700
- min-width: 16px;
1701
- height: 16px;
1702
- padding: 0 3px;
1703
- border: 2px solid var(--dpk-paper);
1704
- border-radius: 999px;
1705
- background: linear-gradient(145deg, var(--dpk-accent-bright), var(--dpk-accent));
1706
- color: var(--dpk-accent-ink);
1707
- font-family: var(--dpk-mono);
1708
- font-size: 9px;
1709
- font-weight: 650;
1710
- font-variant-numeric: tabular-nums;
1711
- line-height: 12px;
1712
- text-align: center;
1713
- animation: dpk-pop 260ms var(--dpk-ease-spring);
1714
- }
1715
-
1716
- .dpk-changes {
1717
- box-sizing: border-box;
1718
- overflow: auto;
1719
- position: fixed;
1720
- inset: auto;
1721
- margin: 0;
1722
- padding: 12px;
1723
- border: 1px solid var(--dpk-rule-strong);
1724
- border-radius: var(--dpk-radius-lg);
1725
- background: var(--dpk-paper-raised);
1726
- box-shadow: var(--dpk-bevel), var(--dpk-shadow-lg);
1727
- color: var(--dpk-ink);
1728
- font-size: 12.5px;
1729
- animation: dpk-notice-in 180ms var(--dpk-ease);
1730
- }
1731
-
1732
- .dpk-changes-head {
1733
- display: flex;
1734
- align-items: baseline;
1735
- justify-content: space-between;
1736
- gap: 8px;
1737
- margin: 0 2px 10px;
1738
- }
1739
-
1740
- .dpk-changes-head {
1741
- align-items: center;
1742
- }
1743
-
1744
- .dpk-changes-title {
1745
- margin: 0;
1746
- font-size: inherit;
1747
- font-weight: 650;
1748
- }
1749
-
1750
- .dpk-changes-read-all.dpk-btn {
1751
- flex: none;
1752
- font-size: 11.5px;
1753
- }
1754
-
1755
- .dpk-changes-read-all[aria-disabled='true'] {
1756
- opacity: 0.5;
1757
- cursor: default;
1758
- pointer-events: none;
1759
- }
1760
-
1761
- .dpk-changes-group + .dpk-changes-group {
1762
- margin-top: 14px;
1763
- }
1764
-
1765
- .dpk-changes-revision {
1766
- display: flex;
1767
- align-items: center;
1768
- gap: 6px;
1769
- margin: 0 2px 6px;
1770
- color: var(--dpk-ink-faint);
1771
- font-family: var(--dpk-mono);
1772
- font-size: 11px;
1773
- font-weight: 500;
1774
- }
1775
-
1776
- .dpk-changes-revision span:first-child {
1777
- overflow: hidden;
1778
- text-overflow: ellipsis;
1779
- white-space: nowrap;
1780
- }
1781
-
1782
- .dpk-changes-current {
1783
- flex: none;
1784
- padding: 1px 6px;
1785
- border: 1px solid var(--dpk-rule-strong);
1786
- border-radius: 999px;
1787
- color: var(--dpk-ink-soft);
1788
- font-family: var(--dpk-body);
1789
- font-size: 10px;
1790
- }
1791
-
1792
- .dpk-changes-list {
1793
- display: grid;
1794
- gap: 6px;
1795
- margin: 0;
1796
- padding: 0;
1797
- list-style: none;
1798
- }
1799
-
1800
- .dpk-change {
1801
- display: grid;
1802
- gap: 4px;
1803
- padding: 9px 10px;
1804
- border: 1px solid var(--dpk-rule);
1805
- border-radius: var(--dpk-radius);
1806
- background: var(--dpk-paper);
1807
- }
1808
-
1809
- .dpk-change[data-fresh] {
1810
- border-color: color-mix(in srgb, var(--dpk-accent) 35%, transparent);
1811
- background: var(--dpk-accent-soft);
1812
- }
1813
-
1814
- .dpk-change .dpk-notice-show {
1815
- justify-self: end;
1816
- }
1817
-
1818
- .dpk-change-title {
1819
- margin: 0;
1820
- font-weight: 600;
1821
- line-height: 1.4;
1822
- overflow-wrap: anywhere;
1823
- }
1824
-
1825
- .dpk-change-new {
1826
- margin-right: 4px;
1827
- padding: 1px 6px;
1828
- border-radius: 999px;
1829
- background: var(--dpk-accent);
1830
- color: var(--dpk-accent-ink);
1831
- font-size: 10px;
1832
- font-weight: 650;
1833
- vertical-align: 1px;
1834
- }
1835
-
1836
- .dpk-change-body {
1837
- margin: 0;
1838
- color: var(--dpk-ink-soft);
1839
- line-height: 1.5;
1840
- white-space: pre-line;
1841
- overflow-wrap: anywhere;
1842
- }
1843
-
1844
- /* Below the review button, at the top right where the bell is. */
1845
- .dpk-toasts {
1846
- position: fixed;
1847
- top: 64px;
1848
- right: 16px;
1849
- z-index: 70;
1850
- display: grid;
1851
- justify-items: end;
1852
- gap: 8px;
1853
- width: min(360px, calc(100vw - 32px));
1854
- pointer-events: none;
1855
- }
1856
-
1857
- .dpk-toast {
1858
- box-sizing: border-box;
1859
- display: grid;
1860
- grid-template-columns: auto minmax(0, 1fr) auto auto;
1861
- align-items: start;
1862
- gap: 10px;
1863
- width: 100%;
1864
- padding: 10px 8px 10px 12px;
1865
- border: 1px solid var(--dpk-rule-strong);
1866
- border-radius: var(--dpk-radius-lg);
1867
- background: var(--dpk-paper-raised);
1868
- box-shadow: var(--dpk-bevel), var(--dpk-shadow-lg);
1869
- color: var(--dpk-ink);
1870
- font-size: 12.5px;
1871
- pointer-events: auto;
1872
- animation: dpk-notice-in 260ms var(--dpk-ease);
1873
- }
1874
-
1875
- .dpk-toast-icon {
1876
- display: inline-flex;
1877
- padding-top: 2px;
1878
- color: var(--dpk-accent);
1879
- }
1880
-
1881
- .dpk-toast-icon svg {
1882
- width: 14px;
1883
- height: 14px;
1884
- }
1885
-
1886
- .dpk-toast-text {
1887
- display: grid;
1888
- gap: 2px;
1889
- }
1890
-
1891
- .dpk-toast .dpk-change-body {
1892
- display: -webkit-box;
1893
- overflow: hidden;
1894
- -webkit-box-orient: vertical;
1895
- -webkit-line-clamp: 2;
1896
- }
1897
-
1898
- .dpk-toast-close {
1899
- display: inline-flex;
1900
- align-items: center;
1901
- justify-content: center;
1902
- width: 22px;
1903
- height: 22px;
1904
- padding: 0;
1905
- border: 0;
1906
- border-radius: 999px;
1907
- background: transparent;
1908
- color: var(--dpk-ink-faint);
1909
- cursor: pointer;
1910
- }
1911
-
1912
- .dpk-toast-close svg {
1913
- width: 12px;
1914
- height: 12px;
1915
- }
1916
-
1917
- .dpk-toast-close:hover {
1918
- color: var(--dpk-ink);
1919
- background: var(--dpk-paper-sunken);
1920
- }
1921
-
1922
- .dpk-toast-close:focus-visible {
1923
- outline: none;
1924
- box-shadow: var(--dpk-focus);
1925
- }
1926
-
1927
- .dpk-toast-actions {
1928
- display: flex;
1929
- flex-wrap: wrap;
1930
- justify-content: end;
1931
- gap: 6px;
1932
- }
1933
-
1934
- .dpk-toast-more {
1935
- padding: 4px 10px;
1936
- border: 1px solid var(--dpk-rule-strong);
1937
- border-radius: 999px;
1938
- background: var(--dpk-paper-raised);
1939
- color: var(--dpk-ink-soft);
1940
- font: inherit;
1941
- font-size: 11.5px;
1942
- cursor: pointer;
1943
- pointer-events: auto;
1944
- }
1945
-
1946
- .dpk-toast-more:hover {
1947
- color: var(--dpk-ink);
1948
- }
1949
-
1950
- .dpk-toast-more:focus-visible {
1951
- outline: none;
1952
- box-shadow: var(--dpk-focus);
1953
- }
1954
-
1955
- @keyframes dpk-notice-in {
1956
- from {
1957
- opacity: 0;
1958
- transform: translateY(-6px) scale(0.98);
1959
- }
1960
- }
1961
-
1962
- /* --------------------------------------------------------------- body */
1963
-
1964
- /* Positioned: the sidebar drawer and a narrow screen's review open over it. */
1965
- .dpk-body {
1966
- position: relative;
1967
- display: flex;
1968
- min-height: 0;
1969
- }
1970
-
1971
- .dpk-sidebar {
1972
- /* The element sets the template's or the reader's width; on a narrow
1973
- screen a wide one still leaves the main column some room. */
1974
- width: var(--dpk-sidebar-width);
1975
- max-width: calc(100% - 120px);
1976
- flex: 0 0 auto;
1977
- border-right: 1px solid var(--dpk-rule);
1978
- background: var(--dpk-paper-sunken);
1979
- overflow: auto;
1980
- padding: 18px 14px;
1981
- scrollbar-width: thin;
1982
- }
1983
-
1984
- .dpk-sidebar[hidden] {
1985
- display: none;
1986
- }
1987
-
1988
- /*
1989
- * A right-hand sidebar: a rail beside the main column rather than a list
1990
- * before it. \`:where\` keeps these as weak as the rules above, so a
1991
- * template can still restyle the rail (stacking it on a phone, say).
1992
- */
1993
- :where(.dpk-body[data-sidebar-side='right']) .dpk-main {
1994
- order: 1;
1995
- }
1996
-
1997
- :where(.dpk-body[data-sidebar-side='right']) .dpk-sidebar,
1998
- :where(.dpk-body[data-sidebar-side='right']) .dpk-sidebar-resizer,
1999
- :where(.dpk-body[data-sidebar-side='right']) .dpk-sidebar-toggle,
2000
- :where(.dpk-body[data-sidebar-side='right']) .dpk-sidebar-strip {
2001
- order: 2;
2002
- }
2003
-
2004
- :where(.dpk-body[data-sidebar-side='right']) .dpk-sidebar,
2005
- :where(.dpk-body[data-sidebar-side='right']) .dpk-sidebar-strip {
2006
- border-right: 0;
2007
- border-left: 1px solid var(--dpk-rule);
2008
- }
2009
-
2010
- /*
2011
- * The fold button. Expanded, it sits on the sidebar's border near the top
2012
- * and, like the resizer, takes no room of its own; folded, it is the only
2013
- * thing left in a narrow strip where the sidebar was.
2014
- */
2015
- .dpk-sidebar-toggle {
2016
- position: relative;
2017
- z-index: 7;
2018
- display: inline-flex;
2019
- flex: none;
2020
- align-self: flex-start;
2021
- align-items: center;
2022
- justify-content: center;
2023
- width: 22px;
2024
- height: 22px;
2025
- margin: 14px -11px 0;
2026
- padding: 0;
2027
- border: 1px solid var(--dpk-rule-strong);
2028
- border-radius: 999px;
2029
- background: var(--dpk-paper-raised);
2030
- color: var(--dpk-ink-soft);
2031
- box-shadow: var(--dpk-bevel), var(--dpk-shadow-xs);
2032
- cursor: pointer;
2033
- transition:
2034
- color 160ms var(--dpk-ease),
2035
- border-color 160ms var(--dpk-ease),
2036
- background 160ms var(--dpk-ease);
2037
- }
2038
-
2039
- .dpk-sidebar-toggle svg {
2040
- width: 13px;
2041
- height: 13px;
2042
- }
2043
-
2044
- .dpk-sidebar-toggle:hover {
2045
- color: var(--dpk-accent);
2046
- border-color: color-mix(in srgb, var(--dpk-accent) 45%, transparent);
2047
- }
2048
-
2049
- .dpk-sidebar-toggle:focus-visible {
2050
- outline: none;
2051
- box-shadow: var(--dpk-focus);
2052
- }
2053
-
2054
- .dpk-sidebar-strip {
2055
- display: flex;
2056
- flex: none;
2057
- justify-content: center;
2058
- width: 36px;
2059
- padding-top: 14px;
2060
- border-right: 1px solid var(--dpk-rule);
2061
- background: var(--dpk-paper-sunken);
2062
- }
2063
-
2064
- .dpk-sidebar-strip .dpk-sidebar-toggle {
2065
- margin: 0;
2066
- }
2067
-
2068
- /*
2069
- * The sidebar's resizable edge: a hit area straddling its border that takes
2070
- * no room of its own, with an accent line while hovered, focused or dragged.
2071
- */
2072
- .dpk-sidebar-resizer {
2073
- position: relative;
2074
- z-index: 6;
2075
- flex: none;
2076
- width: 9px;
2077
- /* Centred on the sidebar's border, whichever side that is. */
2078
- margin: 0 -5px 0 -4px;
2079
- cursor: col-resize;
2080
- touch-action: none;
2081
- }
2082
-
2083
- .dpk-sidebar-resizer::after {
2084
- content: '';
2085
- position: absolute;
2086
- top: 0;
2087
- bottom: 0;
2088
- left: 3px;
2089
- width: 2px;
2090
- border-radius: 1px;
2091
- background: var(--dpk-accent);
2092
- opacity: 0;
2093
- transition: opacity 160ms var(--dpk-ease);
2094
- }
2095
-
2096
- .dpk-sidebar-resizer:hover::after,
2097
- .dpk-sidebar-resizer:focus-visible::after,
2098
- .dpk-shell[data-resizing] .dpk-sidebar-resizer::after {
2099
- opacity: 1;
2100
- }
2101
-
2102
- .dpk-sidebar-resizer:focus-visible {
2103
- outline: none;
2104
- }
2105
-
2106
- /*
2107
- * A phone-width screen has no room for a column beside the main one: the
2108
- * sidebar is a drawer that the strip's button slides over the main column,
2109
- * leaving a sliver of it to tap the drawer shut.
2110
- */
2111
- .dpk-body[data-sidebar-drawer] > .dpk-sidebar {
2112
- position: absolute;
2113
- top: 0;
2114
- bottom: 0;
2115
- left: 36px;
2116
- z-index: 25;
2117
- width: min(var(--dpk-sidebar-width), calc(100% - 36px - 48px));
2118
- max-width: none;
2119
- box-shadow: var(--dpk-shadow-lg);
2120
- }
2121
-
2122
- .dpk-body[data-sidebar-drawer][data-sidebar-side='right'] > .dpk-sidebar {
2123
- left: auto;
2124
- right: 36px;
2125
- }
2126
-
2127
- .dpk-sidebar-scrim {
2128
- position: absolute;
2129
- inset: 0;
2130
- z-index: 24;
2131
- background: color-mix(in srgb, var(--dpk-ink) 16%, transparent);
2132
- }
2133
-
2134
- /* While dragging, the cursor stays put and nothing underneath (text, preview frames) reacts. */
2135
- .dpk-shell[data-resizing] {
2136
- cursor: col-resize;
2137
- user-select: none;
2138
- }
2139
-
2140
- .dpk-shell[data-resizing] .dpk-main {
2141
- pointer-events: none;
2142
- }
2143
-
2144
- .dpk-main {
2145
- flex: 1 1 0%;
2146
- display: flex;
2147
- flex-direction: column;
2148
- min-width: 0;
2149
- overflow: auto;
2150
- /* A faint wash of the accent from the top left corner gives the ground some depth. */
2151
- background:
2152
- radial-gradient(
2153
- ellipse 900px 360px at 0% 0%,
2154
- color-mix(in srgb, var(--dpk-accent) 5%, transparent),
2155
- transparent 70%
2156
- ),
2157
- radial-gradient(
2158
- ellipse 700px 320px at 100% 0%,
2159
- color-mix(in srgb, var(--dpk-blue) 4%, transparent),
2160
- transparent 70%
2161
- ),
2162
- var(--dpk-paper);
2163
- background-attachment: local;
2164
- }
2165
-
2166
- .dpk-main-body {
2167
- flex: 1 0 auto;
2168
- display: grid;
2169
- /* The column is as wide as the page, not as its widest unbreakable line. */
2170
- grid-template-columns: minmax(0, 1fr);
2171
- align-content: start;
2172
- gap: 16px;
2173
- min-width: 0;
2174
- padding: 24px;
2175
- animation: dpk-rise 420ms var(--dpk-ease) backwards;
2176
- }
2177
-
2178
- /*
2179
- * Scrolled to the end, the last of the content clears the hand-off dock
2180
- * floating over the bottom right. \`--dpk-dock-clearance\` is how far up
2181
- * that is; it reaches into components too, and a template's own floating
2182
- * controls rise by it. \`:where\` lets a full-bleed template keep no padding.
2183
- */
2184
- .dpk-shell:has(> .dpk-dock) {
2185
- --dpk-dock-clearance: 64px;
2186
- }
2187
-
2188
- :where(.dpk-shell:has(> .dpk-dock)) .dpk-main-body {
2189
- padding-bottom: calc(24px + var(--dpk-dock-clearance));
2190
- }
2191
-
2192
- :where(.dpk-shell:has(> .dpk-dock)) .dpk-sidebar {
2193
- padding-bottom: calc(18px + var(--dpk-dock-clearance));
2194
- }
2195
-
2196
- @keyframes dpk-rise {
2197
- from {
2198
- opacity: 0;
2199
- transform: translateY(6px);
2200
- }
2201
- }
2202
-
2203
- /*
2204
- * Author memo. It sits at the end of the main column and sticks to the
2205
- * bottom of the scrollport as a bar the full width of the column, edge to
2206
- * edge: always in reach and never stealing height from the preview. Opened,
2207
- * it grows upward over the content and shows the memo whole; only a memo
2208
- * taller than the window scrolls, so its top stays reachable.
2209
- */
2210
- .dpk-memo {
2211
- position: sticky;
2212
- bottom: 0;
2213
- z-index: 5;
2214
- margin-top: auto;
2215
- }
2216
-
2217
- .dpk-memo[hidden] {
2218
- display: none;
2219
- }
2220
-
2221
- .dpk-memo-fold {
2222
- /* A faint amber wash over the whole note marks it as the author's aside. */
2223
- border-top: 1px solid color-mix(in srgb, var(--dpk-amber) 28%, var(--dpk-rule-strong));
2224
- background: color-mix(in srgb, color-mix(in srgb, var(--dpk-amber) 7%, var(--dpk-paper-raised)) 94%, transparent);
2225
- backdrop-filter: blur(12px);
2226
- box-shadow: 0 -8px 24px -18px color-mix(in srgb, var(--dpk-ink) 40%, transparent);
2227
- }
2228
-
2229
- .dpk-memo-bar {
2230
- display: flex;
2231
- align-items: center;
2232
- gap: 6px;
2233
- /* Clear of the hand-off dock at the bottom right while it is shown. */
2234
- padding: 8px calc(16px + var(--dpk-dock-space, 0px)) 8px 16px;
2235
- font-size: 12.5px;
2236
- font-weight: 600;
2237
- color: var(--dpk-ink-soft);
2238
- cursor: pointer;
2239
- list-style: none;
2240
- user-select: none;
2241
- }
2242
-
2243
- .dpk-memo-bar::-webkit-details-marker {
2244
- display: none;
2245
- }
2246
-
2247
- .dpk-memo-bar:hover {
2248
- color: var(--dpk-ink);
2249
- }
2250
-
2251
- .dpk-memo-bar:focus-visible {
2252
- outline: none;
2253
- box-shadow: var(--dpk-focus);
2254
- }
2255
-
2256
- .dpk-memo-bar svg {
2257
- width: 14px;
2258
- height: 14px;
2259
- transition: transform 160ms var(--dpk-ease);
2260
- }
2261
-
2262
- .dpk-memo-fold[open] .dpk-memo-bar svg {
2263
- transform: rotate(90deg);
2264
- }
2265
-
2266
- .dpk-memo-body {
2267
- max-height: calc(100dvh - 120px);
2268
- overflow: auto;
2269
- overscroll-behavior: contain;
2270
- padding: 0 calc(16px + var(--dpk-dock-space, 0px)) 16px 16px;
2271
- font-size: 12.5px;
2272
- line-height: 1.7;
2273
- color: var(--dpk-ink-soft);
2274
- }
2275
-
2276
- .dpk-memo ::slotted(*) {
2277
- display: block;
2278
- max-width: 100%;
2279
- }
2280
-
2281
- .dpk-orphans {
2282
- margin-top: 16px;
2283
- border: 1px dashed var(--dpk-rule-strong);
2284
- border-radius: var(--dpk-radius);
2285
- padding: 12px;
2286
- }
2287
-
2288
- .dpk-banner {
2289
- display: grid;
2290
- gap: 4px;
2291
- margin-bottom: 14px;
2292
- border: 1px solid color-mix(in srgb, var(--dpk-danger) 35%, transparent);
2293
- border-radius: var(--dpk-radius);
2294
- background: linear-gradient(90deg, var(--dpk-danger) 0 3px, transparent 3px), var(--dpk-danger-soft);
2295
- padding: 12px 14px 12px 17px;
2296
- max-width: 900px;
2297
- }
2298
-
2299
- .dpk-banner strong {
2300
- font-size: 13px;
2301
- color: var(--dpk-danger);
2302
- }
2303
-
2304
- .dpk-banner code {
2305
- font-family: var(--dpk-mono);
2306
- font-size: 11px;
2307
- color: var(--dpk-ink-soft);
2308
- overflow-wrap: anywhere;
2309
- }
2310
-
2311
- .dpk-notes {
2312
- flex: 0 0 auto;
2313
- width: 360px;
2314
- border-left: 1px solid var(--dpk-rule);
2315
- background: var(--dpk-paper-raised);
2316
- box-shadow: -12px 0 32px -24px var(--dpk-shade-3);
2317
- overflow: hidden;
2318
- display: flex;
2319
- animation: dpk-slide-in 260ms var(--dpk-ease) backwards;
2320
- }
2321
-
2322
- @keyframes dpk-slide-in {
2323
- from {
2324
- opacity: 0;
2325
- transform: translateX(16px);
2326
- }
2327
- }
2328
-
2329
- .dpk-notes[hidden] {
2330
- display: none;
2331
- }
2332
-
2333
- /*
2334
- * Where a column of its own would leave the main column too little room,
2335
- * the review opens over the main column's edge instead; on a phone it
2336
- * takes the screen, below the review button that closes it.
2337
- */
2338
- @media (max-width: 1100px) {
2339
- .dpk-body:has(> .dpk-sidebar:not([hidden])) > .dpk-notes {
2340
- position: absolute;
2341
- top: 0;
2342
- right: 0;
2343
- bottom: 0;
2344
- z-index: 30;
2345
- max-width: 100%;
2346
- box-shadow: var(--dpk-shadow-lg);
2347
- }
2348
- }
2349
-
2350
- @media (max-width: 860px) {
2351
- .dpk-notes {
2352
- position: absolute;
2353
- top: 0;
2354
- right: 0;
2355
- bottom: 0;
2356
- z-index: 30;
2357
- max-width: 100%;
2358
- box-shadow: var(--dpk-shadow-lg);
2359
- }
2360
- }
2361
-
2362
- @media (max-width: 760px) {
2363
- .dpk-notes,
2364
- .dpk-body:has(> .dpk-sidebar:not([hidden])) > .dpk-notes {
2365
- position: fixed;
2366
- inset: 0;
2367
- z-index: 50;
2368
- width: auto;
2369
- padding-top: 60px;
2370
- border-left: 0;
2371
- }
2372
- }
2373
-
2374
- /* ------------------------------------------------------------- footer */
2375
-
2376
- .dpk-footer {
2377
- border-top: 1px solid var(--dpk-rule);
2378
- padding: 10px 20px;
2379
- display: flex;
2380
- gap: 12px;
2381
- align-items: center;
2382
- background: var(--dpk-glass);
2383
- backdrop-filter: blur(12px);
2384
- font-size: 12px;
2385
- color: var(--dpk-ink-faint);
2386
- }
2387
-
2388
- /* --------------------------------------------------- floating review */
2389
-
2390
- /* Review toggle: pinned to the top right corner, always in the same place. */
2391
- .dpk-fab {
2392
- position: fixed;
2393
- top: 12px;
2394
- right: 16px;
2395
- z-index: 60;
2396
- display: inline-flex;
2397
- align-items: center;
2398
- justify-content: center;
2399
- width: 36px;
2400
- height: 36px;
2401
- padding: 0;
2402
- border: 1px solid var(--dpk-rule-strong);
2403
- border-radius: 11px;
2404
- background: var(--dpk-paper-raised);
2405
- color: var(--dpk-ink-soft);
2406
- box-shadow: var(--dpk-bevel), var(--dpk-shadow-sm);
2407
- cursor: pointer;
2408
- transition:
2409
- color 180ms var(--dpk-ease),
2410
- background 180ms var(--dpk-ease),
2411
- border-color 180ms var(--dpk-ease),
2412
- box-shadow 180ms var(--dpk-ease),
2413
- transform 220ms var(--dpk-ease-spring);
2414
- }
2415
-
2416
- .dpk-fab:hover {
2417
- color: var(--dpk-ink);
2418
- border-color: var(--dpk-rule-hover);
2419
- transform: translateY(-1px);
2420
- box-shadow: var(--dpk-bevel), var(--dpk-shadow);
2421
- }
2422
-
2423
- .dpk-fab:active {
2424
- transform: translateY(0) scale(0.95);
2425
- box-shadow: var(--dpk-shadow-xs);
2426
- }
2427
-
2428
- .dpk-fab:focus-visible {
2429
- outline: none;
2430
- box-shadow: var(--dpk-focus);
2431
- }
2432
-
2433
- .dpk-fab[aria-expanded='true'] {
2434
- color: var(--dpk-accent-ink);
2435
- border-color: color-mix(in srgb, var(--dpk-accent-strong) 70%, transparent);
2436
- background: linear-gradient(145deg, var(--dpk-accent-bright), var(--dpk-accent-strong));
2437
- box-shadow:
2438
- inset 0 1px 0 rgba(255, 255, 255, 0.25),
2439
- 0 6px 16px -6px color-mix(in srgb, var(--dpk-accent) 70%, transparent);
2440
- }
2441
-
2442
- .dpk-fab[aria-expanded='true']:hover {
2443
- box-shadow:
2444
- inset 0 1px 0 rgba(255, 255, 255, 0.25),
2445
- 0 10px 22px -8px color-mix(in srgb, var(--dpk-accent) 80%, transparent);
2446
- }
2447
-
2448
- .dpk-fab-icon {
2449
- position: relative;
2450
- display: block;
2451
- width: 16px;
2452
- height: 12px;
2453
- border: 1.6px solid currentColor;
2454
- border-radius: 4px;
2455
- }
2456
-
2457
- .dpk-fab-icon::after {
2458
- content: '';
2459
- position: absolute;
2460
- left: 2px;
2461
- bottom: -4px;
2462
- border-left: 3.5px solid transparent;
2463
- border-right: 3.5px solid transparent;
2464
- border-top: 4px solid currentColor;
2465
- }
2466
-
2467
- .dpk-fab-badge {
2468
- position: absolute;
2469
- top: -6px;
2470
- right: -6px;
2471
- min-width: 18px;
2472
- height: 18px;
2473
- padding: 0 4px;
2474
- border: 2px solid var(--dpk-paper);
2475
- border-radius: 999px;
2476
- background: linear-gradient(145deg, var(--dpk-accent-bright), var(--dpk-accent));
2477
- color: var(--dpk-accent-ink);
2478
- font-family: var(--dpk-mono);
2479
- font-size: 9.5px;
2480
- font-weight: 650;
2481
- font-variant-numeric: tabular-nums;
2482
- line-height: 14px;
2483
- text-align: center;
2484
- box-shadow: 0 3px 8px -2px color-mix(in srgb, var(--dpk-accent) 60%, transparent);
2485
- animation: dpk-pop 260ms var(--dpk-ease-spring);
2486
- }
2487
-
2488
- @keyframes dpk-pop {
2489
- from {
2490
- transform: scale(0.4);
2491
- opacity: 0;
2492
- }
2493
- }
2494
-
2495
- /* ------------------------------------------------------ hand-off dock */
2496
-
2497
- .dpk-dock {
2498
- position: fixed;
2499
- right: 16px;
2500
- bottom: 16px;
2501
- z-index: 60;
2502
- display: flex;
2503
- flex-direction: column;
2504
- align-items: flex-end;
2505
- gap: 8px;
2506
- max-width: calc(100vw - 32px);
2507
- animation: dpk-dock-in 260ms var(--dpk-ease) backwards;
2508
- }
2509
-
2510
- @keyframes dpk-dock-in {
2511
- from {
2512
- transform: translateY(8px);
2513
- opacity: 0;
2514
- }
2515
- }
2516
-
2517
- .dpk-dock-actions {
2518
- display: flex;
2519
- gap: 6px;
2520
- padding: 6px;
2521
- border: 1px solid var(--dpk-rule-strong);
2522
- border-radius: var(--dpk-radius-lg);
2523
- background: var(--dpk-glass);
2524
- backdrop-filter: blur(12px);
2525
- box-shadow: var(--dpk-bevel), var(--dpk-shadow-lg);
2526
- }
2527
-
2528
- .dpk-dock-note {
2529
- max-width: 320px;
2530
- margin: 0;
2531
- padding: 8px 12px;
2532
- border: 1px solid var(--dpk-rule-strong);
2533
- border-radius: var(--dpk-radius);
2534
- background: var(--dpk-paper-raised);
2535
- box-shadow: var(--dpk-shadow);
2536
- color: var(--dpk-ink-soft);
2537
- font-size: 12px;
2538
- line-height: 1.6;
2539
- }
2540
-
2541
- /* The template's name repeats the mark above the title; the title needs the room more. */
2542
- @media (max-width: 1100px) {
2543
- .dpk-header-meta > .dpk-meta-name {
2544
- display: none;
2545
- }
2546
- }
2547
-
2548
- @media (max-width: 720px) {
2549
- /* The version select stays: it is the reader's only way to switch
2550
- versions; so do the counts, the review's progress at a glance. */
2551
- .dpk-header-meta > :not(.dpk-version, .dpk-meta-count) {
2552
- display: none;
2553
- }
2554
-
2555
- /* On a phone the row may be narrower than both: the counts stay whole and
2556
- the version select gives up its width instead. */
2557
- .dpk-header-meta {
2558
- min-width: 0;
2559
- max-width: 100%;
2560
- }
2561
-
2562
- .dpk-header-meta > .dpk-version {
2563
- display: flex;
2564
- min-width: 0;
2565
- }
2566
-
2567
- .dpk-header-meta .dpk-version-select {
2568
- width: 100%;
2569
- min-width: 0;
2570
- text-overflow: ellipsis;
2571
- }
2572
-
2573
- .dpk-header-meta > .dpk-meta-count {
2574
- flex: none;
2575
- }
2576
-
2577
- /* The title takes the first row whole; the version select and tools wrap below it. */
2578
- .dpk-title {
2579
- flex: 1 0 100%;
2580
- }
2581
-
2582
- .dpk-brand {
2583
- display: none;
2584
- }
2585
-
2586
- /* The page's own content goes last, so a long one cannot push the version
2587
- select and tools below it. */
2588
- .dpk-header-slot {
2589
- order: 1;
2590
- }
2591
- }
2592
- `],lu=30,cu=He(v(),L({base:v(),value:v()})),zo=t=>{const e=C(cu,t);return e.success?e.output:null},du=t=>t.key===void 0?JSON.stringify(["field",t.hosts,t.name,t.base]):JSON.stringify(["key",t.key,t.name]),pu=(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-lu)))},hu=(t,e)=>{if(!(e in t))return t;const{[e]:n,...s}=t;return s},uu=(t,e,n)=>{const s=t[e];return s===void 0||s.base!==n||s.value===n?null:s.value},fu=new Set(["text","search","url","email","tel"]),Mo=t=>t instanceof HTMLTextAreaElement||t instanceof HTMLInputElement&&fu.has(t.type)?t:null,gu=(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},mu=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)}},ku=t=>t.getAttribute("aria-label")??(t.placeholder||t.name||t.localName),ys=t=>typeof t=="string"?[t]:Array.isArray(t)?t.flatMap(ys):typeof t=="object"&&t!==null?Object.values(t).flatMap(ys):[],Io=t=>t.replace(/\s+/g," ").trim();class bu{#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()?kh(zo):le(zo),this.#r=this.#n.storageKey()),this.#e.addEventListener("focusin",this.#o),this.#e.addEventListener("input",this.#l)}hostDisconnected(){this.#e.removeEventListener("focusin",this.#o),this.#e.removeEventListener("input",this.#l)}settle(e){const n=new Set(e.flatMap(ys).map(Io));for(const s of this.#i){if(!n.has(Io(s.value)))continue;this.#i.delete(s);const i=this.#t.get(s);i!==void 0&&this.#c(hu(this.#a(),i.id))}}#o=e=>{const n=Mo(e.composedPath()[0]);if(n===null||this.#i.has(n))return;const s=gu(this.#e,n);if(s===null)return;const i=mu(n),r=n.value,o=du({...i===void 0?{}:{key:i},hosts:s,name:ku(n),base:r});this.#t.set(n,{id:o,base:r});const a=uu(this.#a(),o,r);a!==null&&queueMicrotask(()=>{if(n.value===r){n.value=a;try{n.setSelectionRange(a.length,a.length)}catch{}this.#i.add(n),n.dispatchEvent(new Event("input",{bubbles:!0,composed:!0}))}})};#l=e=>{const n=Mo(e.composedPath()[0]),s=n===null?void 0:this.#t.get(n);if(!(n===null||s===void 0)){for(const i of this.#i)i.isConnected||this.#i.delete(i);this.#i.add(n),this.#c(pu(this.#a(),s.id,{base:s.base,value:n.value}))}};#a(){return this.#s?.read(this.#r)??{}}#c(e){Object.keys(e).length===0?this.#s?.remove(this.#r):this.#s?.write(this.#r,e)}}class vu{#e;#n;#s;#r=null;#t=!1;constructor(e,n={}){this.#e=e,this.#n=n.fetchVersions??Ir,this.#s=n.switchTo??Nr,e.addController(this)}hostConnected(){}load(){this.#t||this.#r!==null||(this.#t=!0,this.#n().then(e=>{this.#r=e,this.#t=!1,this.#e.requestUpdate()},e=>{this.#t=!1,console.warn("dev-process-kit: could not list the published versions",e)}))}pick(e){e!==X&&this.#s(e===""?null:e)}render(e){const n=W(e),s=Mr({current:X,requested:is(location.search)!==null,published:this.#r,text:{pinned:n.versionPinned,latest:n.versionLatest}}),i=()=>this.load();return b`<span class="dpk-version"
2593
- >dev-process-kit@<select
2594
- class="dpk-version-select"
2595
- aria-label=${n.versionLabel}
2596
- title=${n.versionLabel}
2597
- @pointerenter=${i}
2598
- @focus=${i}
2599
- @change=${os(r=>this.pick(r))}
2600
- >
2601
- ${s.options.map(r=>b`<option value=${r.value} ?selected=${r.value===s.value}>${r.label}</option>`)}
2602
- </select></span
2603
- >`}}const ws=`script[type="application/json"]:not([${Dr}])`,xu=30,No={width:360,height:480},yu=t=>{try{return t.matches(":popover-open")}catch{return!1}},wu=()=>new Promise(t=>requestAnimationFrame(()=>t()));class $u extends he{static{this.styles=au}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 Fh(this);#s=new Ph(this,()=>this.storage!=="off"&&this.storage!=="memory");#r=new Lh(this);#t=new Dh(this);#i=new ou(this,{persist:()=>this.storage!=="off"&&this.storage!=="memory",template:()=>this.definition.name,layout:()=>this.sidebarLayout});#o=new iu(this,{persist:()=>this.storage!=="off"&&this.storage!=="memory",template:()=>this.definition.name});#l=new Uh(this);#a=new bu(this,{persist:()=>this.storage!=="off"&&this.storage!=="memory",storageKey:()=>`${this.storageKey??en(this.definition.name)}:unsent-text`});#c=null;#p=new xh(this,{persist:()=>this.storage!=="off"&&this.storage!=="memory",storageKey:()=>this.storageKey??en(this.definition.name),inside:e=>e.some(n=>n instanceof Element&&(n.id===tn||n.classList.contains("dpk-bell"))),show:e=>{this.#G(e)}});#m={toggleList:()=>this.#p.toggleList(),openList:()=>this.#p.send({kind:"open-list"}),show:e=>this.#p.show(e),dismiss:e=>this.#p.send({kind:"close-toast",key:e}),readAll:()=>this.#p.send({kind:"read-all"}),pause:e=>this.#p.pause(e),resume:e=>this.#p.resume(e)};#k=new Lr(this);#h=!1;#x=new vu(this);#g=new jh(this,()=>this.storage!=="off"&&this.storage!=="memory",()=>this.#d?.setTemplate(this.definition));#u;#d;#f=Un;#b=null;#w=new Set;#A=null;#L;#$;#C;#T=[];#O;#F=new Promise(e=>{this.#O=e});#P;get locale(){return this.#g.locale}get definition(){const e=this.locale;return this.#u?.locale!==e&&(this.#u={locale:e,value:this.definitionFor(e)}),this.#u.value}connectedCallback(){super.connectedCallback(),this.dataset.template=this.definition.name,this.#e||(this.#e=!0,this.notesOpen=this.notes==="on"||this.notes==="open"),this.#z(),window.addEventListener("hashchange",this.#j),this.addEventListener("click",this.#H),this.addEventListener("dpk-comment-targets-change",this.#v),this.addEventListener("dpk-comment-request",this.#q),this.addEventListener("dpk-comment-submit",this.#B),this.addEventListener("dpk-element-action",this.#U),this.#C??=new MutationObserver(this.#v),this.#v()}disconnectedCallback(){super.disconnectedCallback(),window.removeEventListener("hashchange",this.#j),this.removeEventListener("click",this.#H),this.#$?.disconnect(),this.#C?.disconnect(),this.removeEventListener("dpk-comment-targets-change",this.#v),this.removeEventListener("dpk-comment-request",this.#q),this.removeEventListener("dpk-comment-submit",this.#B),this.removeEventListener("dpk-element-action",this.#U)}#z(e=0){if(this.#d){this.#M();return}if(this.childNodes.length===0&&e<2){queueMicrotask(()=>this.#z(e+1));return}this.#ne()}#M(){this.#L||(this.#L=this.#d?.subscribe(()=>this.#oe()))}willUpdate(){this.dataset.theme=this.#s.resolve(mt(this.theme))}updated(){this.#le(),this.#ae(),this.#K(),this.#h&&(this.#h=!1,this.renderRoot.querySelector(".dpk-sidebar-toggle")?.focus())}get api(){return this.#P??=this.#te(),this.#P}get controller(){if(!this.#d)throw new Error(`<${this.tagName.toLowerCase()}> is not initialized yet`);return this.#d}get derivation(){return this.controller.derivation}get navigation(){return this.#f}dispatch(e){const n=this.controller.dispatch(e);return n.ok&&this.#a.settle([e.payload,e.note]),n.ok||(this.requestUpdate(),this.dispatchEvent(new CustomEvent("dpk-error",{detail:{issues:n.issues},bubbles:!0,composed:!0})),this.#y()),n}dispatchBatch(e){const n=this.controller.dispatchBatch(e);return n.ok&&this.#a.settle(e.flatMap(s=>[s.payload,s.note])),n.ok||(this.requestUpdate(),this.dispatchEvent(new CustomEvent("dpk-error",{detail:{issues:n.issues},bubbles:!0,composed:!0})),this.#y()),n}editComment(e,n){const s=this.controller.editComment(e,n);return s.ok&&this.#a.settle([n]),s.ok||(this.requestUpdate(),this.dispatchEvent(new CustomEvent("dpk-error",{detail:{issues:s.issues},bubbles:!0,composed:!0})),this.#y()),s}removeAction(e){this.controller.removeAction(e)}clearActions(){this.controller.clearActions()}navigate(e,n={}){const s=Fe(this.#S());this.#f=Hn(this.#f,e,this.definition.navigationHierarchy),this.#E(n.replace??!1);const i=Fe(this.#S());this.requestUpdate(),s!==i&&(this.#y(),this.dispatchEvent(new CustomEvent("dpk-navigate",{detail:{navigation:this.#f},bubbles:!0,composed:!0})))}hashFor(e){const n=this.#S();return Fe(this.definition.resolveNavigation(this.derivation.state,Hn(n,e,this.definition.navigationHierarchy)))}requestComment(e){this.#b=typeof e=="string"?e:N(e),this.notesOpen=!0,this.requestUpdate()}get integratedReview(){return!1}get canSendToClaude(){return this.#r.available}sendToClaude(){return this.#r.send({brief:this.api.exportBrief(),draft:Dn(this.derivation.actions),anchor:this})}renderReviewPanel(e){return b`<dpk-component-comment-panel
2604
- .definition=${this.controller.definition}
2605
- .state=${e.state}
2606
- .navigation=${e.navigation}
2607
- .derivation=${this.derivation}
2608
- .issues=${this.controller.lastIssues}
2609
- .exportBrief=${()=>this.api.exportBrief()}
2610
- .sendToClaude=${this.canSendToClaude?()=>this.sendToClaude():void 0}
2611
- .pendingTarget=${this.#b}
2612
- .embedded=${this.integratedReview}
2613
- .onDelete=${n=>this.removeAction(n)}
2614
- .onEditComment=${(n,s)=>this.editComment(n,s)}
2615
- .onClear=${()=>this.clearActions()}
2616
- .onComment=${(n,s)=>{const i=this.dispatch({type:D,target:n,payload:{body:s}});return i.ok&&(this.#b=null),i}}
2617
- ></dpk-component-comment-panel>`}renderChrome(e,n){const s=e.actions.length,i=e.actions.filter(u=>u.type===D).length,r=s-i,o=W(this.locale),a=n.sidebarHidden===!0||!n.sidebar&&!this.hasSidebarContent(),l=this.sidebarLayout.side,c=this.#X,p=!a&&this.#R&&(c?!this.#o.drawerOpen:this.#o.collapsed),d=a?g:this.#Q(p,c),h=this.definition.title(e.state);return b`
2618
- <div class="dpk-shell" ?data-resizing=${this.#i.dragging}>
2619
- <header class="dpk-header">
2620
- <span class="dpk-brand" aria-hidden="true"></span>
2621
- <div class="dpk-title">
2622
- <span class="dpk-template-mark">${this.definition.label}</span>
2623
- <h1 title=${h}>${h}</h1>
2624
- </div>
2625
- <div class="dpk-header-slot">
2626
- ${n.header??g}
2627
- <slot name="header"></slot>
2628
- </div>
2629
- <div class="dpk-header-meta">
2630
- ${this.#x.render(this.locale)}
2631
- <span class="dpk-meta-name">${this.definition.name}</span>
2632
- <span class="dpk-meta-count" data-active=${s>0?"true":"false"}>
2633
- ${o.draftCount(r,i)}
2634
- </span>
2635
- </div>
2636
- <div class="dpk-header-tools">
2637
- ${this.#W()} ${this.#Y()} ${this.#J()}
2638
- </div>
2639
- </header>
2640
- <div class="dpk-body" data-sidebar-side=${l} ?data-sidebar-drawer=${c}>
2641
- ${l==="right"?d:g}
2642
- <aside
2643
- id="dpk-sidebar"
2644
- class="dpk-sidebar"
2645
- ?hidden=${a||p}
2646
- style=${`--dpk-sidebar-width: ${this.#i.width}px`}
2647
- >
2648
- ${n.sidebar??g}
2649
- <slot name="sidebar"></slot>
2650
- </aside>
2651
- ${l==="left"?d:g}
2652
- ${c&&!p&&!a?b`<div class="dpk-sidebar-scrim" @click=${()=>this.#o.closeDrawer()}></div>`:g}
2653
- <main class="dpk-main">
2654
- <div class="dpk-main-body">
2655
- ${this.#A?b`<div class="dpk-banner" role="alert">
2656
- <strong>${o.baseDataError}</strong>
2657
- <code>${this.#A}</code>
2658
- </div>`:g}
2659
- ${this.#p.error===null?g:b`<div class="dpk-banner" role="alert">
2660
- <strong>${o.changesError}</strong>
2661
- <code>${this.#p.error}</code>
2662
- </div>`}
2663
- ${n.main??g}
2664
- <slot name="main"></slot>
2665
- <section class="dpk-orphans" ?hidden=${this.#n.orphans===0}>
2666
- <p class="dpk-label">previews without metadata</p>
2667
- <slot name="preview"></slot>
2668
- </section>
2669
- </div>
2670
- <div class="dpk-memo" ?hidden=${!this.hasMemoContent()}>
2671
- <details class="dpk-memo-fold">
2672
- <summary class="dpk-memo-bar">${Yn()} ${o.memo}</summary>
2673
- <div class="dpk-memo-body"><slot name="memo"></slot></div>
2674
- </details>
2675
- </div>
2676
- </main>
2677
- ${this.integratedReview?g:b`<aside class="dpk-notes" ?hidden=${!this.notesOpen}>${this.renderReviewPanel(e)}</aside>`}
2678
- </div>
2679
- ${n.footer||this.hasFooterContent()?b`<footer class="dpk-footer">
2680
- ${n.footer??g}
2681
- <slot name="footer"></slot>
2682
- </footer>`:g}
2683
- ${this.integratedReview?g:b`<button
2684
- class="dpk-fab"
2685
- type="button"
2686
- aria-expanded=${this.notesOpen?"true":"false"}
2687
- title=${o.reviewToggle}
2688
- @click=${()=>{this.notesOpen=!this.notesOpen}}
2689
- >
2690
- <span class="dpk-fab-icon" aria-hidden="true"></span>
2691
- <span
2692
- class="dpk-label"
2693
- style="position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)"
2694
- >
2695
- ${o.review}
2696
- </span>
2697
- ${s>0?b`<span class="dpk-fab-badge">${s}</span>`:g}
2698
- </button>`}
2699
- ${this.integratedReview?g:this.#Z(s)} ${this.#V()}
2700
- </div>
2701
- `}#W(){const e=this.#p.view;if(!e)return g;const n=W(this.locale);return b`${yh(e,n,this.#m)}
2702
- ${$h(e,n,this.#m)}`}#V(){const e=this.#p.view;return e?Sh(e,W(this.locale),this.#m):g}#K(){const e=this.renderRoot.querySelector(`#${tn}`),n=this.renderRoot.querySelector(".dpk-bell");!e||!n||yu(e)||this.#k.open(e,n,{width:No.width,height:Math.min(No.height,window.innerHeight-96)})}async#G(e){const n={};this.#c=n;const s=this.derivation.state,i=e.target===null?null:this.definition.canonicalTarget?.(s,at(e.target))??at(e.target),r=Cp({...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<xu;a+=1){if(await this.updateComplete,await wu(),this.#c!==n)return;const l=Eo(this,o);if(!(l===null||l.getClientRects().length===0)){Gh(this,l),Jh(l);return}}}showTarget(e){}#Z(e){const n=fh({actions:e,railOpen:this.notesOpen,sendable:this.canSendToClaude,locale:this.locale},this.#t.state);if(!n)return g;const s=W(this.locale);return b`<div class="dpk-dock" role="group" aria-label=${s.handoffLabel}>
2703
- ${n.note?b`<p class="dpk-dock-note" role="alert">${n.note}</p>`:g}
2704
- <div class="dpk-dock-actions">
2705
- ${n.send?b`<button
2706
- class="dpk-btn dpk-btn--accent"
2707
- type="button"
2708
- ?disabled=${n.send.disabled}
2709
- @click=${()=>{this.#t.send(()=>this.sendToClaude())}}
2710
- >
2711
- ${n.send.label}
2712
- </button>`:g}
2713
- <button
2714
- class=${n.send?"dpk-btn":"dpk-btn dpk-btn--accent"}
2715
- type="button"
2716
- data-status=${n.copy.status}
2717
- title=${s.handoffCopyTitle}
2718
- @click=${()=>{this.#t.copy(()=>this.api.exportBrief())}}
2719
- >
2720
- ${n.copy.label}
2721
- </button>
2722
- </div>
2723
- </div>`}#Y(){const e=this.locale,n=W(e).language;return b`<select
2724
- class="dpk-lang-select"
2725
- aria-label=${n}
2726
- title=${n}
2727
- @change=${os(s=>{const i=kn.find(r=>r===s);i!==void 0&&this.#g.pick(i)})}
2728
- >
2729
- ${kn.map(s=>b`<option value=${s} lang=${s} ?selected=${s===e}>
2730
- ${ac[s]}
2731
- </option>`)}
2732
- </select>`}#J(){const e=this.dataset.theme==="dark",n=W(this.locale),s=e?n.useLightTheme:n.useDarkTheme;return b`<button
2733
- class="dpk-theme-toggle"
2734
- type="button"
2735
- aria-label=${s}
2736
- title=${s}
2737
- @click=${()=>this.#s.toggle(mt(this.theme))}
2738
- >
2739
- ${e?Gc():Zc()}
2740
- </button>`}get#R(){return this.sidebarLayout.collapsible!==!1}get#X(){return this.#l.narrow&&this.#R&&this.sidebarLayout.narrow!=="stack"}#Q(e,n){const s=this.#R?this.#ee(e,n):g;return e||n?b`<div class="dpk-sidebar-strip">${s}</div>`:this.sidebarLayout.side==="left"?b`${this.#I()}${s}`:b`${s}${this.#I()}`}#ee(e,n){const s=W(this.locale),i=nu(this.sidebarLayout.side,e),r=i.action==="collapse"?s.collapseSidebar:s.expandSidebar;return b`<button
2741
- class="dpk-sidebar-toggle"
2742
- type="button"
2743
- aria-controls="dpk-sidebar"
2744
- aria-expanded=${e?"false":"true"}
2745
- aria-label=${r}
2746
- title=${r}
2747
- @click=${()=>{this.#h=!0,n?this.#o.toggleDrawer():this.#o.toggle()}}
2748
- >
2749
- ${i.points==="left"?hr():Yn()}
2750
- </button>`}#I(){const e=W(this.locale),n=this.#i.handlers;return b`<div
2751
- class="dpk-sidebar-resizer"
2752
- role="separator"
2753
- tabindex="0"
2754
- aria-orientation="vertical"
2755
- aria-label=${e.resizeSidebar}
2756
- aria-valuemin=${ve.min}
2757
- aria-valuemax=${ve.max}
2758
- aria-valuenow=${this.#i.width}
2759
- title=${e.resizeSidebarHint}
2760
- @pointerdown=${n.pointerdown}
2761
- @pointermove=${n.pointermove}
2762
- @pointerup=${n.pointerup}
2763
- @pointercancel=${n.pointercancel}
2764
- @keydown=${n.keydown}
2765
- @dblclick=${n.dblclick}
2766
- ></div>`}render(){if(!this.#d)return g;const e=this.#D();return this.renderChrome(e,this.renderRegions(e))}get sidebarLayout(){return Xh}hasSidebarContent(){return this.querySelector('[slot="sidebar"]')!==null}hasMemoContent(){return this.querySelector('[slot="memo"]')!==null}hasFooterContent(){return this.querySelector('[slot="footer"]')!==null}context(){return this.#D()}#_(){return{definition:this.definition,controller:()=>this.controller,derivation:()=>this.derivation,ready:this.#F,navigation:()=>this.#S(),issues:()=>this.controller.lastIssues,dispatch:e=>this.dispatch(e),dispatchBatch:e=>this.dispatchBatch(e),subscribe:e=>(this.#w.add(e),()=>{this.#w.delete(e)}),editComment:(e,n)=>this.editComment(e,n),removeAction:e=>this.removeAction(e),clearActions:()=>this.clearActions(),navigate:(e,n)=>this.navigate(e,n),hashFor:e=>this.hashFor(e),requestComment:e=>this.requestComment(e)}}#te(){return mh(this.#_(),this)}#N(){return po(this.#_())}#D(){return gh(this.#_())}#S(){return this.definition.resolveNavigation(this.derivation.state,this.#f)}#ne(){const e=this.#ie();this.#f=xo();const n=this.storageKey;this.#d=new ao({definition:this.definition,base:e,storage:this.#se(),...typeof n=="string"?{storageKey:n}:{}}),this.#M(),this.#v(),this.#E(!0),this.#O?.(),this.#re(),this.requestUpdate()}#se(){return this.storage==="off"?null:this.storage==="memory"?new us:fs()}#ie(){const e=this.querySelector(ws);if(!e?.textContent||e.textContent.trim().length===0)return console.warn(`[dev-process-kit] <${this.tagName.toLowerCase()}> has no base JSON; starting from an empty state.`),this.#A='no <script type="application/json"> child found',this.definition.emptyBase();try{return this.definition.parseBase(JSON.parse(e.textContent))}catch(n){return console.error("[dev-process-kit] invalid base data:",n),this.#A=n instanceof Error?n.message:String(n),this.definition.emptyBase()}}#re(){this.querySelector(ws)||(this.#$=new MutationObserver(()=>{const e=this.querySelector(ws);if(e){this.#$?.disconnect(),this.#$=void 0;try{this.controller.setBase(this.definition.parseBase(JSON.parse(e.textContent??"null")))}catch(n){console.error("[dev-process-kit] invalid base data:",n)}}}),this.#$.observe(this,{childList:!0,subtree:!0}))}#y(){const e=this.#N();for(const n of this.#w)n(e)}#oe(){if(!this.isConnected){this.requestUpdate(),this.#y();return}this.#E(!0),vo(this.#T,this.controller.actions),queueMicrotask(this.#v),this.requestUpdate(),this.#y(),this.dispatchEvent(new CustomEvent("dpk-change",{detail:this.#N(),bubbles:!0,composed:!0}))}#E(e){const n=this.#S();this.#f=n,Hh(n,e)}#j=()=>{this.#f=xo(),this.#E(!0),this.requestUpdate(),this.#y(),this.dispatchEvent(new CustomEvent("dpk-navigate",{detail:{navigation:this.#f},bubbles:!0,composed:!0}))};#v=()=>{this.#C?.disconnect(),this.#T=zh(this,e=>{this.isConnected&&this.#C?.observe(e,{childList:!0,subtree:!0})}),this.#d&&(vo(this.#T,this.#d.actions),this.#d.setComponentSnapshot(Ih(this.#T)))};#q=e=>{if(e.stopPropagation(),!(e instanceof CustomEvent)||!this.#d)return;const n=e.detail;typeof n!="object"||n===null||!("target"in n)||typeof n.target!="string"||(this.#v(),!this.controller.definition.commentTargets(this.derivation.state,this.navigation).some(i=>i.value===n.target))||this.requestComment(n.target)};#B=e=>{if(e.stopPropagation(),!(e instanceof CustomEvent)||!e.cancelable||!this.#d)return;const n=C(Lp,e.detail);if(!n.success)return;this.#v();const{target:s,body:i}=n.output;if(!this.controller.definition.commentTargets(this.derivation.state,this.navigation).some(a=>a.value===s))return;this.dispatch({type:D,target:s,payload:{body:i}}).ok&&e.preventDefault()};#U=e=>{if(e.stopPropagation(),!(e instanceof CustomEvent)||!e.cancelable||!this.#d)return;const n=C(ec,e.detail);if(!n.success)return;this.#v();const{type:s,target:i,payload:r}=n.output;if(!this.controller.definition.commentTargets(this.derivation.state,this.navigation).some(l=>l.value===i))return;this.dispatch({type:s,target:i,payload:r}).ok&&e.preventDefault()};#H=e=>{for(const n of e.composedPath()){if(!(n instanceof Element))continue;if(n===this||n.hasAttribute("data-template"))break;const s=n.getAttribute("data-dpk-navigate");if(s!==null){e.preventDefault(),this.navigate(qt(s.includes("=")?s:`step=${s}`));return}const i=n.getAttribute("data-dpk-comment");if(i!==null){e.preventDefault(),this.requestComment(i);return}}};#ae(){const e=this.renderRoot.querySelector(".dpk-shell"),n=this.renderRoot.querySelector(".dpk-dock-actions");e&&(n?e.style.setProperty("--dpk-dock-space",`${n.offsetWidth+8}px`):e.style.removeProperty("--dpk-dock-space"))}#le(){this.#n.route()}}export{ft as $,Zn as A,Uc as B,D as C,fr as D,Un as E,X as F,cr as G,pr as H,Gn as I,dr as J,lr as K,so as L,us as M,qt as N,at as O,Bl as P,Hn as Q,Ul as R,Dn as S,$u as T,Ui as U,N as V,hs as W,Dt as X,Mn as Y,_t as Z,Or as _,jn as a,et as a$,Rt as a0,ma as a1,de as a2,g as a3,b as a4,ct as a5,Bc as a6,Xo as a7,he as a8,Lr as a9,Dl as aA,B as aB,Ge as aC,le as aD,cp as aE,os as aF,pp as aG,Qt as aH,Ce as aI,Vd as aJ,Eo as aK,Vn as aL,Wn as aM,So as aN,Ci as aO,jl as aP,Il as aQ,He as aR,Zs as aS,Si as aT,_ as aU,ar as aV,ir as aW,rr as aX,mn as aY,ti as aZ,Gd as a_,vn as aa,Vc as ab,Kc as ac,zn as ad,Z as ae,se as af,F as ag,v as ah,Nt as ai,w as aj,S as ak,ji as al,Bi as am,ke as an,me as ao,Ii as ap,Yn as aq,Wc as ar,Pn as as,C as at,L as au,Ni as av,On as aw,Oi as ax,Ri as ay,Di as az,Ai as b,At as b0,fn as b1,hr as b2,qc as b3,jc as b4,Pi as b5,Li as b6,Ti as b7,_i as b8,dp as b9,Ao as ba,sr as bb,or as bc,ao as c,Nn as d,Hl as e,Fn as f,Wi as g,lt as h,to as i,xn as j,Hi as k,Kl as l,In as m,fs as n,en as o,ql as p,ed as q,wl as r,sp as s,no as t,Le as u,Wl as v,Fe as w,Fc as x,Hc as y,Bt as z};