dev-process-kit 0.0.12 → 0.0.13
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.
- package/dist/chunks/{shared-DBJaP5gF.js → shared-0MFKKPnB.js} +144 -92
- package/dist/chunks/{shared-DUq2-pM9.js → shared-B2YRwZ0P.js} +99 -60
- package/dist/chunks/{shared-y3FwoRgh.js → shared-B4Mwapvi.js} +88 -62
- package/dist/chunks/shared-BDUe3aT-.js +1 -0
- package/dist/chunks/{shared-BwaDMwUS.js → shared-C1KQ5iU8.js} +55 -32
- package/dist/chunks/{shared-BvuW5NtY.js → shared-CQG0dnvb.js} +15 -5
- package/dist/chunks/{shared-BC5MlWBY.js → shared-CSC14I4g.js} +248 -87
- package/dist/chunks/{shared-D7CMQLaX.js → shared-Cd8A5TjZ.js} +140 -35
- package/dist/chunks/{shared-CcrRNZCH.js → shared-CirHYajF.js} +1 -1
- package/dist/chunks/shared-D4K7KsfJ.js +1 -0
- package/dist/chunks/{shared-DYe0OZr-.js → shared-D7poXZ0z.js} +15 -7
- package/dist/chunks/shared-DO0pUSjw.js +571 -0
- package/dist/chunks/shared-DdefS1nG.js +1 -0
- package/dist/chunks/{shared-C__W71Hw.js → shared-DjmQsa0n.js} +1 -1
- package/dist/chunks/{shared-CLnfjHCQ.js → shared-DklLt1Sc.js} +1 -1
- package/dist/chunks/{shared-DkkBQzIf.js → shared-DrMSORn-.js} +31 -8
- package/dist/chunks/shared-DxAiavwJ.js +1102 -0
- package/dist/components.js +1 -1
- package/dist/index.js +1 -1
- package/dist/templates/delegation-poker.js +1 -1
- package/dist/templates/event-storming.js +1 -1
- package/dist/templates/example-mapping.js +1 -1
- package/dist/templates/grill.js +1 -1
- package/dist/templates/plain.js +1 -1
- package/dist/templates/prototype.js +1 -1
- package/dist/templates/slides.js +1 -1
- package/dist/templates/task-board.js +1 -1
- package/dist/templates/usm.js +1 -1
- package/dist/templates/whiteboard.js +1 -1
- package/package.json +1 -1
- package/dist/chunks/shared-CoDXb-Yj.js +0 -556
- package/dist/chunks/shared-DhwK_dh_.js +0 -1093
- package/dist/chunks/shared-xrCdgpNS.js +0 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
const qe=globalThis,dt=qe.ShadowRoot&&(qe.ShadyCSS===void 0||qe.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,pt=Symbol(),ws=new WeakMap;let $s=class{constructor(e,s,n){if(this._$cssResult$=!0,n!==pt)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=s}get styleSheet(){let e=this.o;const s=this.t;if(dt&&e===void 0){const n=s!==void 0&&s.length===1;n&&(e=ws.get(s)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),n&&ws.set(s,e))}return e}toString(){return this.cssText}};const Ss=t=>new $s(typeof t=="string"?t:t+"",void 0,pt),B=(t,...e)=>{const s=t.length===1?t[0]:e.reduce((n,r,i)=>n+(a=>{if(a._$cssResult$===!0)return a.cssText;if(typeof a=="number")return a;throw Error("Value passed to 'css' function must be a 'css' function result: "+a+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(r)+t[i+1],t[0]);return new $s(s,t,pt)},Yr=(t,e)=>{if(dt)t.adoptedStyleSheets=e.map(s=>s instanceof CSSStyleSheet?s:s.styleSheet);else for(const s of e){const n=document.createElement("style"),r=qe.litNonce;r!==void 0&&n.setAttribute("nonce",r),n.textContent=s.cssText,t.appendChild(n)}},As=dt?t=>t:t=>t instanceof CSSStyleSheet?(e=>{let s="";for(const n of e.cssRules)s+=n.cssText;return Ss(s)})(t):t,{is:Qr,defineProperty:Xr,getOwnPropertyDescriptor:ei,getOwnPropertyNames:ti,getOwnPropertySymbols:si,getPrototypeOf:ni}=Object,Ne=globalThis,
|
|
2
|
-
\f\r]`,we=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,
|
|
3
|
-
\f\r"'\`<>=]|("|')|))|$)`,"g"),Ms=/'/g,js=/"/g,Is=/^(?:script|style|textarea|title)$/i,qs=t=>(e,...s)=>({_$litType$:t,strings:e,values:s}),k=qs(1),li=qs(2),O=Symbol.for("lit-noChange"),g=Symbol.for("lit-nothing"),Ns=new WeakMap,X=Y.createTreeWalker(Y,129);function Ds(t,e){if(!ft(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return Rs!==void 0?Rs.createHTML(e):e}const ci=(t,e)=>{const s=t.length-1,n=[];let r,i=e===2?"<svg>":e===3?"<math>":"",a=we;for(let o=0;o<s;o++){const l=t[o];let c,p,d=-1,h=0;for(;h<l.length&&(a.lastIndex=h,p=a.exec(l),p!==null);)h=a.lastIndex,a===we?p[1]==="!--"?a=zs:p[1]!==void 0?a=Os:p[2]!==void 0?(Is.test(p[2])&&(r=RegExp("</"+p[2],"g")),a=Q):p[3]!==void 0&&(a=Q):a===Q?p[0]===">"?(a=r??we,d=-1):p[1]===void 0?d=-2:(d=a.lastIndex-p[2].length,c=p[1],a=p[3]===void 0?Q:p[3]==='"'?js:Ms):a===js||a===Ms?a=Q:a===zs||a===Os?a=we:(a=Q,r=void 0);const u=a===Q&&t[o+1].startsWith("/>")?" ":"";i+=a===we?l+ai:d>=0?(n.push(c),l.slice(0,d)+Ls+l.slice(d)+H+u):l+H+(d===-2?o:u)}return[Ds(t,i+(t[s]||"<?>")+(e===2?"</svg>":e===3?"</math>":"")),n]};let mt=class Zr{constructor({strings:e,_$litType$:s},n){let r;this.parts=[];let i=0,a=0;const o=e.length-1,l=this.parts,[c,p]=ci(e,s);if(this.el=Zr.createElement(c,n),X.currentNode=this.el.content,s===2||s===3){const d=this.el.content.firstChild;d.replaceWith(...d.childNodes)}for(;(r=X.nextNode())!==null&&l.length<o;){if(r.nodeType===1){if(r.hasAttributes())for(const d of r.getAttributeNames())if(d.endsWith(Ls)){const h=p[a++],u=r.getAttribute(d).split(H),f=/([.?@])?(.*)/.exec(h);l.push({type:1,index:i,name:f[2],strings:u,ctor:f[1]==="."?pi:f[1]==="?"?hi:f[1]==="@"?ui:Be}),r.removeAttribute(d)}else d.startsWith(H)&&(l.push({type:6,index:i}),r.removeAttribute(d));if(Is.test(r.tagName)){const d=r.textContent.split(H),h=d.length-1;if(h>0){r.textContent=De?De.emptyScript:"";for(let u=0;u<h;u++)r.append(d[u],ve()),X.nextNode(),l.push({type:2,index:++i});r.append(d[h],ve())}}}else if(r.nodeType===8)if(r.data===Ps)l.push({type:2,index:i});else{let d=-1;for(;(d=r.data.indexOf(H,d+1))!==-1;)l.push({type:7,index:i}),d+=H.length-1}i++}}static createElement(e,s){const n=Y.createElement("template");return n.innerHTML=e,n}};function ce(t,e,s=t,n){if(e===O)return e;let r=n!==void 0?s._$Co?.[n]:s._$Cl;const i=ye(e)?void 0:e._$litDirective$;return r?.constructor!==i&&(r?._$AO?.(!1),i===void 0?r=void 0:(r=new i(t),r._$AT(t,s,n)),n!==void 0?(s._$Co??=[])[n]=r:s._$Cl=r),r!==void 0&&(e=ce(t,r._$AS(t,e.values),r,n)),e}let di=class{constructor(e,s){this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=s}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(e){const{el:{content:s},parts:n}=this._$AD,r=(e?.creationScope??Y).importNode(s,!0);X.currentNode=r;let i=X.nextNode(),a=0,o=0,l=n[0];for(;l!==void 0;){if(a===l.index){let c;l.type===2?c=new Ue(i,i.nextSibling,this,e):l.type===1?c=new l.ctor(i,l.name,l.strings,this,e):l.type===6&&(c=new fi(i,this,e)),this._$AV.push(c),l=n[++o]}a!==l?.index&&(i=X.nextNode(),a++)}return X.currentNode=Y,r}p(e){let s=0;for(const n of this._$AV)n!==void 0&&(n.strings!==void 0?(n._$AI(e,n,s),s+=n.strings.length-2):n._$AI(e[s])),s++}},Ue=class Wr{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(e,s,n,r){this.type=2,this._$AH=g,this._$AN=void 0,this._$AA=e,this._$AB=s,this._$AM=n,this.options=r,this._$Cv=r?.isConnected??!0}get parentNode(){let e=this._$AA.parentNode;const s=this._$AM;return s!==void 0&&e?.nodeType===11&&(e=s.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,s=this){e=ce(this,e,s),ye(e)?e===g||e==null||e===""?(this._$AH!==g&&this._$AR(),this._$AH=g):e!==this._$AH&&e!==O&&this._(e):e._$litType$!==void 0?this.$(e):e.nodeType!==void 0?this.T(e):oi(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&&ye(this._$AH)?this._$AA.nextSibling.data=e:this.T(Y.createTextNode(e)),this._$AH=e}$(e){const{values:s,_$litType$:n}=e,r=typeof n=="number"?this._$AC(e):(n.el===void 0&&(n.el=mt.createElement(Ds(n.h,n.h[0]),this.options)),n);if(this._$AH?._$AD===r)this._$AH.p(s);else{const i=new di(r,this),a=i.u(this.options);i.p(s),this.T(a),this._$AH=i}}_$AC(e){let s=Ns.get(e.strings);return s===void 0&&Ns.set(e.strings,s=new mt(e)),s}k(e){ft(this._$AH)||(this._$AH=[],this._$AR());const s=this._$AH;let n,r=0;for(const i of e)r===s.length?s.push(n=new Wr(this.O(ve()),this.O(ve()),this,this.options)):n=s[r],n._$AI(i),r++;r<s.length&&(this._$AR(n&&n._$AB.nextSibling,r),s.length=r)}_$AR(e=this._$AA.nextSibling,s){for(this._$AP?.(!1,!0,s);e!==this._$AB;){const n=_s(e).nextSibling;_s(e).remove(),e=n}}setConnected(e){this._$AM===void 0&&(this._$Cv=e,this._$AP?.(e))}};class Be{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,s,n,r,i){this.type=1,this._$AH=g,this._$AN=void 0,this.element=e,this.name=s,this._$AM=r,this.options=i,n.length>2||n[0]!==""||n[1]!==""?(this._$AH=Array(n.length-1).fill(new String),this.strings=n):this._$AH=g}_$AI(e,s=this,n,r){const i=this.strings;let a=!1;if(i===void 0)e=ce(this,e,s,0),a=!ye(e)||e!==this._$AH&&e!==O,a&&(this._$AH=e);else{const o=e;let l,c;for(e=i[0],l=0;l<i.length-1;l++)c=ce(this,o[n+l],s,l),c===O&&(c=this._$AH[l]),a||=!ye(c)||c!==this._$AH[l],c===g?e=g:e!==g&&(e+=(c??"")+i[l+1]),this._$AH[l]=c}a&&!r&&this.j(e)}j(e){e===g?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}}let pi=class extends Be{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===g?void 0:e}},hi=class extends Be{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==g)}},ui=class extends Be{constructor(e,s,n,r,i){super(e,s,n,r,i),this.type=5}_$AI(e,s=this){if((e=ce(this,e,s,0)??g)===O)return;const n=this._$AH,r=e===g&&n!==g||e.capture!==n.capture||e.once!==n.once||e.passive!==n.passive,i=e!==g&&(n===g||r);r&&this.element.removeEventListener(this.name,this,n),i&&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 fi{constructor(e,s,n){this.element=e,this.type=6,this._$AN=void 0,this._$AM=s,this.options=n}get _$AU(){return this._$AM._$AU}_$AI(e){ce(this,e)}}const gi={I:Ue},mi=ut.litHtmlPolyfillSupport;mi?.(mt,Ue),(ut.litHtmlVersions??=[]).push("3.3.3");const ki=(t,e,s)=>{const n=s?.renderBefore??e;let r=n._$litPart$;if(r===void 0){const i=s?.renderBefore??null;n._$litPart$=r=new Ue(e.insertBefore(ve(),i),i,void 0,s??{})}return r._$AI(t),r},kt=globalThis;let F=class extends le{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 s=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=ki(s,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return O}};F._$litElement$=!0,F.finalized=!0,kt.litElementHydrateSupport?.({LitElement:F});const bi=kt.litElementPolyfillSupport;bi?.({LitElement:F}),(kt.litElementVersions??=[]).push("4.2.2");const K={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4},$e=t=>(...e)=>({_$litDirective$:t,values:e});let He=class{constructor(e){}get _$AU(){return this._$AM._$AU}_$AT(e,s,n){this._$Ct=e,this._$AM=s,this._$Ci=n}_$AS(e,s){return this.update(e,s)}update(e,s){return this.render(...s)}};const{I:xi}=gi,Us=t=>t,vi=t=>t.strings===void 0,Bs=()=>document.createComment(""),Se=(t,e,s)=>{const n=t._$AA.parentNode,r=e===void 0?t._$AB:e._$AA;if(s===void 0){const i=n.insertBefore(Bs(),r),a=n.insertBefore(Bs(),r);s=new xi(i,a,t,t.options)}else{const i=s._$AB.nextSibling,a=s._$AM,o=a!==t;if(o){let l;s._$AQ?.(t),s._$AM=t,s._$AP!==void 0&&(l=t._$AU)!==a._$AU&&s._$AP(l)}if(i!==r||o){let l=s._$AA;for(;l!==i;){const c=Us(l).nextSibling;Us(n).insertBefore(l,r),l=c}}}return s},ee=(t,e,s=t)=>(t._$AI(e,s),t),yi={},bt=(t,e=yi)=>t._$AH=e,wi=t=>t._$AH,xt=t=>{t._$AR(),t._$AA.remove()},vt=$e(class extends He{constructor(t){if(super(t),t.type!==K.PROPERTY&&t.type!==K.ATTRIBUTE&&t.type!==K.BOOLEAN_ATTRIBUTE)throw Error("The `live` directive is not allowed on child or event bindings");if(!vi(t))throw Error("`live` bindings can only contain a single expression")}render(t){return t}update(t,[e]){if(e===O||e===g)return e;const s=t.element,n=t.name;if(t.type===K.PROPERTY){if(e===s[n])return O}else if(t.type===K.BOOLEAN_ATTRIBUTE){if(!!e===s.hasAttribute(n))return O}else if(t.type===K.ATTRIBUTE&&s.getAttribute(n)===e+"")return O;return bt(t),e}});class Fe extends He{constructor(e){if(super(e),this.it=g,e.type!==K.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===O)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 s=[e];return s.raw=s,this._t={_$litType$:this.constructor.resultType,strings:s,values:[]}}}Fe.directiveName="unsafeHTML",Fe.resultType=1;const Hs=$e(Fe),Ke=t=>{let e=t;for(;e!==null;){if(e instanceof Element){const s=e.getAttribute("lang");if(s!==null)return s}e=e instanceof ShadowRoot?e.host:e.parentNode}return null},yt=["en","ja"],Fs="en",Ks=t=>yt.some(e=>e===t),Ze=t=>{const e=(t??"").split("-")[0]?.toLowerCase()??"";return Ks(e)?e:Fs},Zs=t=>Ze(Ke(t)),wt="dpk-locale-change",Ws=t=>typeof t=="string"&&Ks(t)?t:null,$i=t=>t.preference??t.authored,Si=(t,e)=>t===e?null:t,We=t=>e=>e==="ja"?t.ja:t.en;class $t{#e;#i;#n=Fs;constructor(e,s=()=>{}){this.#e=e,this.#i=s,e.addController(this)}get locale(){return this.#n}hostConnected(){this.#n=Zs(this.#e),document.addEventListener(wt,this.#r)}hostDisconnected(){document.removeEventListener(wt,this.#r)}#r=()=>{const e=Zs(this.#e);e!==this.#n&&(this.#n=e,this.#i(),this.#e.requestUpdate())}}const Ai={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)"]},Vs=t=>Ss(Object.entries(Ai).map(([e,[s,n]])=>`--dpk-${e}: ${t(s,n)};`).join(`
|
|
1
|
+
const qe=globalThis,dt=qe.ShadowRoot&&(qe.ShadyCSS===void 0||qe.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,pt=Symbol(),ws=new WeakMap;let $s=class{constructor(e,s,n){if(this._$cssResult$=!0,n!==pt)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=s}get styleSheet(){let e=this.o;const s=this.t;if(dt&&e===void 0){const n=s!==void 0&&s.length===1;n&&(e=ws.get(s)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),n&&ws.set(s,e))}return e}toString(){return this.cssText}};const Ss=t=>new $s(typeof t=="string"?t:t+"",void 0,pt),B=(t,...e)=>{const s=t.length===1?t[0]:e.reduce((n,r,i)=>n+(a=>{if(a._$cssResult$===!0)return a.cssText;if(typeof a=="number")return a;throw Error("Value passed to 'css' function must be a 'css' function result: "+a+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(r)+t[i+1],t[0]);return new $s(s,t,pt)},Yr=(t,e)=>{if(dt)t.adoptedStyleSheets=e.map(s=>s instanceof CSSStyleSheet?s:s.styleSheet);else for(const s of e){const n=document.createElement("style"),r=qe.litNonce;r!==void 0&&n.setAttribute("nonce",r),n.textContent=s.cssText,t.appendChild(n)}},As=dt?t=>t:t=>t instanceof CSSStyleSheet?(e=>{let s="";for(const n of e.cssRules)s+=n.cssText;return Ss(s)})(t):t,{is:Qr,defineProperty:Xr,getOwnPropertyDescriptor:ei,getOwnPropertyNames:ti,getOwnPropertySymbols:si,getPrototypeOf:ni}=Object,Ne=globalThis,Cs=Ne.trustedTypes,ri=Cs?Cs.emptyScript:"",ii=Ne.reactiveElementPolyfillSupport,xe=(t,e)=>t,ht={toAttribute(t,e){switch(e){case Boolean:t=t?ri:null;break;case Object:case Array:t=t==null?t:JSON.stringify(t)}return t},fromAttribute(t,e){let s=t;switch(e){case Boolean:s=t!==null;break;case Number:s=t===null?null:Number(t);break;case Object:case Array:try{s=JSON.parse(t)}catch{s=null}}return s}},Ts=(t,e)=>!Qr(t,e),Es={attribute:!0,type:String,converter:ht,reflect:!1,useDefault:!1,hasChanged:Ts};Symbol.metadata??=Symbol("metadata"),Ne.litPropertyMetadata??=new WeakMap;let le=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,s=Es){if(s.state&&(s.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(e)&&((s=Object.create(s)).wrapped=!0),this.elementProperties.set(e,s),!s.noAccessor){const n=Symbol(),r=this.getPropertyDescriptor(e,n,s);r!==void 0&&Xr(this.prototype,e,r)}}static getPropertyDescriptor(e,s,n){const{get:r,set:i}=ei(this.prototype,e)??{get(){return this[s]},set(a){this[s]=a}};return{get:r,set(a){const o=r?.call(this);i?.call(this,a),this.requestUpdate(e,o,n)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??Es}static _$Ei(){if(this.hasOwnProperty(xe("elementProperties")))return;const e=ni(this);e.finalize(),e.l!==void 0&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(xe("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(xe("properties"))){const s=this.properties,n=[...ti(s),...si(s)];for(const r of n)this.createProperty(r,s[r])}const e=this[Symbol.metadata];if(e!==null){const s=litPropertyMetadata.get(e);if(s!==void 0)for(const[n,r]of s)this.elementProperties.set(n,r)}this._$Eh=new Map;for(const[s,n]of this.elementProperties){const r=this._$Eu(s,n);r!==void 0&&this._$Eh.set(r,s)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){const s=[];if(Array.isArray(e)){const n=new Set(e.flat(1/0).reverse());for(const r of n)s.unshift(As(r))}else e!==void 0&&s.push(As(e));return s}static _$Eu(e,s){const n=s.attribute;return n===!1?void 0:typeof n=="string"?n: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,s=this.constructor.elementProperties;for(const n of s.keys())this.hasOwnProperty(n)&&(e.set(n,this[n]),delete this[n]);e.size>0&&(this._$Ep=e)}createRenderRoot(){const e=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return Yr(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,s,n){this._$AK(e,n)}_$ET(e,s){const n=this.constructor.elementProperties.get(e),r=this.constructor._$Eu(e,n);if(r!==void 0&&n.reflect===!0){const i=(n.converter?.toAttribute!==void 0?n.converter:ht).toAttribute(s,n.type);this._$Em=e,i==null?this.removeAttribute(r):this.setAttribute(r,i),this._$Em=null}}_$AK(e,s){const n=this.constructor,r=n._$Eh.get(e);if(r!==void 0&&this._$Em!==r){const i=n.getPropertyOptions(r),a=typeof i.converter=="function"?{fromAttribute:i.converter}:i.converter?.fromAttribute!==void 0?i.converter:ht;this._$Em=r;const o=a.fromAttribute(s,i.type);this[r]=o??this._$Ej?.get(r)??o,this._$Em=null}}requestUpdate(e,s,n,r=!1,i){if(e!==void 0){const a=this.constructor;if(r===!1&&(i=this[e]),n??=a.getPropertyOptions(e),!((n.hasChanged??Ts)(i,s)||n.useDefault&&n.reflect&&i===this._$Ej?.get(e)&&!this.hasAttribute(a._$Eu(e,n))))return;this.C(e,s,n)}this.isUpdatePending===!1&&(this._$ES=this._$EP())}C(e,s,{useDefault:n,reflect:r,wrapped:i},a){n&&!(this._$Ej??=new Map).has(e)&&(this._$Ej.set(e,a??s??this[e]),i!==!0||a!==void 0)||(this._$AL.has(e)||(this.hasUpdated||n||(s=void 0),this._$AL.set(e,s)),r===!0&&this._$Em!==e&&(this._$Eq??=new Set).add(e))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(s){Promise.reject(s)}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[r,i]of this._$Ep)this[r]=i;this._$Ep=void 0}const n=this.constructor.elementProperties;if(n.size>0)for(const[r,i]of n){const{wrapped:a}=i,o=this[r];a!==!0||this._$AL.has(r)||o===void 0||this.C(r,void 0,i,o)}}let e=!1;const s=this._$AL;try{e=this.shouldUpdate(s),e?(this.willUpdate(s),this._$EO?.forEach(n=>n.hostUpdate?.()),this.update(s)):this._$EM()}catch(n){throw e=!1,this._$EM(),n}e&&this._$AE(s)}willUpdate(e){}_$AE(e){this._$EO?.forEach(s=>s.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(s=>this._$ET(s,this[s])),this._$EM()}updated(e){}firstUpdated(e){}};le.elementStyles=[],le.shadowRootOptions={mode:"open"},le[xe("elementProperties")]=new Map,le[xe("finalized")]=new Map,ii?.({ReactiveElement:le}),(Ne.reactiveElementVersions??=[]).push("2.1.2");const ut=globalThis,_s=t=>t,De=ut.trustedTypes,Rs=De?De.createPolicy("lit-html",{createHTML:t=>t}):void 0,Ls="$lit$",H=`lit$${Math.random().toFixed(9).slice(2)}$`,zs="?"+H,ai=`<${zs}>`,Y=document,ve=()=>Y.createComment(""),ye=t=>t===null||typeof t!="object"&&typeof t!="function",ft=Array.isArray,oi=t=>ft(t)||typeof t?.[Symbol.iterator]=="function",gt=`[
|
|
2
|
+
\f\r]`,we=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,Ps=/-->/g,Os=/>/g,Q=RegExp(`>|${gt}(?:([^\\s"'>=/]+)(${gt}*=${gt}*(?:[^
|
|
3
|
+
\f\r"'\`<>=]|("|')|))|$)`,"g"),Ms=/'/g,js=/"/g,Is=/^(?:script|style|textarea|title)$/i,qs=t=>(e,...s)=>({_$litType$:t,strings:e,values:s}),k=qs(1),li=qs(2),O=Symbol.for("lit-noChange"),g=Symbol.for("lit-nothing"),Ns=new WeakMap,X=Y.createTreeWalker(Y,129);function Ds(t,e){if(!ft(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return Rs!==void 0?Rs.createHTML(e):e}const ci=(t,e)=>{const s=t.length-1,n=[];let r,i=e===2?"<svg>":e===3?"<math>":"",a=we;for(let o=0;o<s;o++){const l=t[o];let c,p,d=-1,h=0;for(;h<l.length&&(a.lastIndex=h,p=a.exec(l),p!==null);)h=a.lastIndex,a===we?p[1]==="!--"?a=Ps:p[1]!==void 0?a=Os:p[2]!==void 0?(Is.test(p[2])&&(r=RegExp("</"+p[2],"g")),a=Q):p[3]!==void 0&&(a=Q):a===Q?p[0]===">"?(a=r??we,d=-1):p[1]===void 0?d=-2:(d=a.lastIndex-p[2].length,c=p[1],a=p[3]===void 0?Q:p[3]==='"'?js:Ms):a===js||a===Ms?a=Q:a===Ps||a===Os?a=we:(a=Q,r=void 0);const u=a===Q&&t[o+1].startsWith("/>")?" ":"";i+=a===we?l+ai:d>=0?(n.push(c),l.slice(0,d)+Ls+l.slice(d)+H+u):l+H+(d===-2?o:u)}return[Ds(t,i+(t[s]||"<?>")+(e===2?"</svg>":e===3?"</math>":"")),n]};let mt=class Wr{constructor({strings:e,_$litType$:s},n){let r;this.parts=[];let i=0,a=0;const o=e.length-1,l=this.parts,[c,p]=ci(e,s);if(this.el=Wr.createElement(c,n),X.currentNode=this.el.content,s===2||s===3){const d=this.el.content.firstChild;d.replaceWith(...d.childNodes)}for(;(r=X.nextNode())!==null&&l.length<o;){if(r.nodeType===1){if(r.hasAttributes())for(const d of r.getAttributeNames())if(d.endsWith(Ls)){const h=p[a++],u=r.getAttribute(d).split(H),f=/([.?@])?(.*)/.exec(h);l.push({type:1,index:i,name:f[2],strings:u,ctor:f[1]==="."?pi:f[1]==="?"?hi:f[1]==="@"?ui:Be}),r.removeAttribute(d)}else d.startsWith(H)&&(l.push({type:6,index:i}),r.removeAttribute(d));if(Is.test(r.tagName)){const d=r.textContent.split(H),h=d.length-1;if(h>0){r.textContent=De?De.emptyScript:"";for(let u=0;u<h;u++)r.append(d[u],ve()),X.nextNode(),l.push({type:2,index:++i});r.append(d[h],ve())}}}else if(r.nodeType===8)if(r.data===zs)l.push({type:2,index:i});else{let d=-1;for(;(d=r.data.indexOf(H,d+1))!==-1;)l.push({type:7,index:i}),d+=H.length-1}i++}}static createElement(e,s){const n=Y.createElement("template");return n.innerHTML=e,n}};function ce(t,e,s=t,n){if(e===O)return e;let r=n!==void 0?s._$Co?.[n]:s._$Cl;const i=ye(e)?void 0:e._$litDirective$;return r?.constructor!==i&&(r?._$AO?.(!1),i===void 0?r=void 0:(r=new i(t),r._$AT(t,s,n)),n!==void 0?(s._$Co??=[])[n]=r:s._$Cl=r),r!==void 0&&(e=ce(t,r._$AS(t,e.values),r,n)),e}let di=class{constructor(e,s){this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=s}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(e){const{el:{content:s},parts:n}=this._$AD,r=(e?.creationScope??Y).importNode(s,!0);X.currentNode=r;let i=X.nextNode(),a=0,o=0,l=n[0];for(;l!==void 0;){if(a===l.index){let c;l.type===2?c=new Ue(i,i.nextSibling,this,e):l.type===1?c=new l.ctor(i,l.name,l.strings,this,e):l.type===6&&(c=new fi(i,this,e)),this._$AV.push(c),l=n[++o]}a!==l?.index&&(i=X.nextNode(),a++)}return X.currentNode=Y,r}p(e){let s=0;for(const n of this._$AV)n!==void 0&&(n.strings!==void 0?(n._$AI(e,n,s),s+=n.strings.length-2):n._$AI(e[s])),s++}},Ue=class Zr{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(e,s,n,r){this.type=2,this._$AH=g,this._$AN=void 0,this._$AA=e,this._$AB=s,this._$AM=n,this.options=r,this._$Cv=r?.isConnected??!0}get parentNode(){let e=this._$AA.parentNode;const s=this._$AM;return s!==void 0&&e?.nodeType===11&&(e=s.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,s=this){e=ce(this,e,s),ye(e)?e===g||e==null||e===""?(this._$AH!==g&&this._$AR(),this._$AH=g):e!==this._$AH&&e!==O&&this._(e):e._$litType$!==void 0?this.$(e):e.nodeType!==void 0?this.T(e):oi(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&&ye(this._$AH)?this._$AA.nextSibling.data=e:this.T(Y.createTextNode(e)),this._$AH=e}$(e){const{values:s,_$litType$:n}=e,r=typeof n=="number"?this._$AC(e):(n.el===void 0&&(n.el=mt.createElement(Ds(n.h,n.h[0]),this.options)),n);if(this._$AH?._$AD===r)this._$AH.p(s);else{const i=new di(r,this),a=i.u(this.options);i.p(s),this.T(a),this._$AH=i}}_$AC(e){let s=Ns.get(e.strings);return s===void 0&&Ns.set(e.strings,s=new mt(e)),s}k(e){ft(this._$AH)||(this._$AH=[],this._$AR());const s=this._$AH;let n,r=0;for(const i of e)r===s.length?s.push(n=new Zr(this.O(ve()),this.O(ve()),this,this.options)):n=s[r],n._$AI(i),r++;r<s.length&&(this._$AR(n&&n._$AB.nextSibling,r),s.length=r)}_$AR(e=this._$AA.nextSibling,s){for(this._$AP?.(!1,!0,s);e!==this._$AB;){const n=_s(e).nextSibling;_s(e).remove(),e=n}}setConnected(e){this._$AM===void 0&&(this._$Cv=e,this._$AP?.(e))}};class Be{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,s,n,r,i){this.type=1,this._$AH=g,this._$AN=void 0,this.element=e,this.name=s,this._$AM=r,this.options=i,n.length>2||n[0]!==""||n[1]!==""?(this._$AH=Array(n.length-1).fill(new String),this.strings=n):this._$AH=g}_$AI(e,s=this,n,r){const i=this.strings;let a=!1;if(i===void 0)e=ce(this,e,s,0),a=!ye(e)||e!==this._$AH&&e!==O,a&&(this._$AH=e);else{const o=e;let l,c;for(e=i[0],l=0;l<i.length-1;l++)c=ce(this,o[n+l],s,l),c===O&&(c=this._$AH[l]),a||=!ye(c)||c!==this._$AH[l],c===g?e=g:e!==g&&(e+=(c??"")+i[l+1]),this._$AH[l]=c}a&&!r&&this.j(e)}j(e){e===g?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}}let pi=class extends Be{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===g?void 0:e}},hi=class extends Be{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==g)}},ui=class extends Be{constructor(e,s,n,r,i){super(e,s,n,r,i),this.type=5}_$AI(e,s=this){if((e=ce(this,e,s,0)??g)===O)return;const n=this._$AH,r=e===g&&n!==g||e.capture!==n.capture||e.once!==n.once||e.passive!==n.passive,i=e!==g&&(n===g||r);r&&this.element.removeEventListener(this.name,this,n),i&&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 fi{constructor(e,s,n){this.element=e,this.type=6,this._$AN=void 0,this._$AM=s,this.options=n}get _$AU(){return this._$AM._$AU}_$AI(e){ce(this,e)}}const gi={I:Ue},mi=ut.litHtmlPolyfillSupport;mi?.(mt,Ue),(ut.litHtmlVersions??=[]).push("3.3.3");const ki=(t,e,s)=>{const n=s?.renderBefore??e;let r=n._$litPart$;if(r===void 0){const i=s?.renderBefore??null;n._$litPart$=r=new Ue(e.insertBefore(ve(),i),i,void 0,s??{})}return r._$AI(t),r},kt=globalThis;let F=class extends le{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 s=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=ki(s,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return O}};F._$litElement$=!0,F.finalized=!0,kt.litElementHydrateSupport?.({LitElement:F});const bi=kt.litElementPolyfillSupport;bi?.({LitElement:F}),(kt.litElementVersions??=[]).push("4.2.2");const K={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4},$e=t=>(...e)=>({_$litDirective$:t,values:e});let He=class{constructor(e){}get _$AU(){return this._$AM._$AU}_$AT(e,s,n){this._$Ct=e,this._$AM=s,this._$Ci=n}_$AS(e,s){return this.update(e,s)}update(e,s){return this.render(...s)}};const{I:xi}=gi,Us=t=>t,vi=t=>t.strings===void 0,Bs=()=>document.createComment(""),Se=(t,e,s)=>{const n=t._$AA.parentNode,r=e===void 0?t._$AB:e._$AA;if(s===void 0){const i=n.insertBefore(Bs(),r),a=n.insertBefore(Bs(),r);s=new xi(i,a,t,t.options)}else{const i=s._$AB.nextSibling,a=s._$AM,o=a!==t;if(o){let l;s._$AQ?.(t),s._$AM=t,s._$AP!==void 0&&(l=t._$AU)!==a._$AU&&s._$AP(l)}if(i!==r||o){let l=s._$AA;for(;l!==i;){const c=Us(l).nextSibling;Us(n).insertBefore(l,r),l=c}}}return s},ee=(t,e,s=t)=>(t._$AI(e,s),t),yi={},bt=(t,e=yi)=>t._$AH=e,wi=t=>t._$AH,xt=t=>{t._$AR(),t._$AA.remove()},vt=$e(class extends He{constructor(t){if(super(t),t.type!==K.PROPERTY&&t.type!==K.ATTRIBUTE&&t.type!==K.BOOLEAN_ATTRIBUTE)throw Error("The `live` directive is not allowed on child or event bindings");if(!vi(t))throw Error("`live` bindings can only contain a single expression")}render(t){return t}update(t,[e]){if(e===O||e===g)return e;const s=t.element,n=t.name;if(t.type===K.PROPERTY){if(e===s[n])return O}else if(t.type===K.BOOLEAN_ATTRIBUTE){if(!!e===s.hasAttribute(n))return O}else if(t.type===K.ATTRIBUTE&&s.getAttribute(n)===e+"")return O;return bt(t),e}});class Fe extends He{constructor(e){if(super(e),this.it=g,e.type!==K.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===O)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 s=[e];return s.raw=s,this._t={_$litType$:this.constructor.resultType,strings:s,values:[]}}}Fe.directiveName="unsafeHTML",Fe.resultType=1;const Hs=$e(Fe),Ke=t=>{let e=t;for(;e!==null;){if(e instanceof Element){const s=e.getAttribute("lang");if(s!==null)return s}e=e instanceof ShadowRoot?e.host:e.parentNode}return null},yt=["en","ja"],Fs="en",Ks=t=>yt.some(e=>e===t),We=t=>{const e=(t??"").split("-")[0]?.toLowerCase()??"";return Ks(e)?e:Fs},Ws=t=>We(Ke(t)),wt="dpk-locale-change",Zs=t=>typeof t=="string"&&Ks(t)?t:null,$i=t=>t.preference??t.authored,Si=(t,e)=>t===e?null:t,Ze=t=>e=>e==="ja"?t.ja:t.en;class $t{#e;#r;#n=Fs;constructor(e,s=()=>{}){this.#e=e,this.#r=s,e.addController(this)}get locale(){return this.#n}hostConnected(){this.#n=Ws(this.#e),document.addEventListener(wt,this.#i)}hostDisconnected(){document.removeEventListener(wt,this.#i)}#i=()=>{const e=Ws(this.#e);e!==this.#n&&(this.#n=e,this.#r(),this.#e.requestUpdate())}}const Ai={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)"]},Vs=t=>Ss(Object.entries(Ai).map(([e,[s,n]])=>`--dpk-${e}: ${t(s,n)};`).join(`
|
|
4
4
|
`)),Ve=B`
|
|
5
5
|
:host {
|
|
6
6
|
/* Browsers without light-dark() stay light. */
|
|
@@ -328,7 +328,7 @@ const qe=globalThis,dt=qe.ShadowRoot&&(qe.ShadyCSS===void 0||qe.ShadyCSS.nativeS
|
|
|
328
328
|
min-height: 64px;
|
|
329
329
|
line-height: 1.55;
|
|
330
330
|
}
|
|
331
|
-
`,
|
|
331
|
+
`,Ci=B`
|
|
332
332
|
.comment-pop {
|
|
333
333
|
box-sizing: border-box;
|
|
334
334
|
overflow: auto;
|
|
@@ -464,11 +464,18 @@ const qe=globalThis,dt=qe.ShadowRoot&&(qe.ShadyCSS===void 0||qe.ShadyCSS.nativeS
|
|
|
464
464
|
color: var(--dpk-ink-soft);
|
|
465
465
|
}
|
|
466
466
|
|
|
467
|
+
/* A table wider than its box scrolls on its own instead of being clipped by it. */
|
|
467
468
|
.dpk-prose table {
|
|
469
|
+
display: block;
|
|
470
|
+
max-width: 100%;
|
|
471
|
+
overflow-x: auto;
|
|
468
472
|
border-collapse: collapse;
|
|
469
473
|
}
|
|
470
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. */
|
|
471
477
|
.dpk-prose :is(th, td) {
|
|
478
|
+
overflow-wrap: break-word;
|
|
472
479
|
padding: 2px 8px;
|
|
473
480
|
border: 1px solid var(--dpk-rule);
|
|
474
481
|
text-align: left;
|
|
@@ -482,14 +489,14 @@ const qe=globalThis,dt=qe.ShadowRoot&&(qe.ShadyCSS===void 0||qe.ShadyCSS.nativeS
|
|
|
482
489
|
.dpk-prose img {
|
|
483
490
|
max-width: 100%;
|
|
484
491
|
}
|
|
485
|
-
`,de=(t,e)=>t instanceof e?t:null;function At(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var te=At();function Js(t){te=t}var se={exec:()=>null};function pe(t){let e=[];return s=>{let n=Math.max(0,Math.min(3,s-1)),r=e[n];return r||(r=t(n),e[n]=r),r}}function b(t,e=""){let s=typeof t=="string"?t:t.source,n={replace:(r,i)=>{let a=typeof i=="string"?i:i.source;return a=a.replace(E.caret,"$1"),s=s.replace(r,a),n},getRegex:()=>new RegExp(s,e)};return n}var
|
|
486
|
-
]`).replace("lheading",Qs).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},Bi=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,Hi=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,tn=/^( {2,}|\\)\n(?!\s*$)[ \t]*/,Fi=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,U=/[\p{P}\p{S}]/u,he=/[\s\p{P}\p{S}]/u,
|
|
492
|
+
`,de=(t,e)=>t instanceof e?t:null;function At(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var te=At();function Js(t){te=t}var se={exec:()=>null};function pe(t){let e=[];return s=>{let n=Math.max(0,Math.min(3,s-1)),r=e[n];return r||(r=t(n),e[n]=r),r}}function b(t,e=""){let s=typeof t=="string"?t:t.source,n={replace:(r,i)=>{let a=typeof i=="string"?i:i.source;return a=a.replace(E.caret,"$1"),s=s.replace(r,a),n},getRegex:()=>new RegExp(s,e)};return n}var Ti=((t="")=>{try{return!!new RegExp("(?<=1)(?<!1)"+t)}catch{return!1}})(),E={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:pe(t=>new RegExp(`^ {0,${t}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`)),hrRegex:pe(t=>new RegExp(`^ {0,${t}}((?:-[ ]*){3,}|(?:_[ ]*){3,}|(?:\\*[ ]*){3,})(?:\\n+|$)`)),fencesBeginRegex:pe(t=>new RegExp(`^ {0,${t}}(?:\`\`\`|~~~)`)),headingBeginRegex:pe(t=>new RegExp(`^ {0,${t}}#`)),htmlBeginRegex:pe(t=>new RegExp(`^ {0,${t}}(?:</?(?:${Ce})(?: +|$|/?>)|<(?:script|pre|style|textarea|!--))`,"i")),blockquoteBeginRegex:pe(t=>new RegExp(`^ {0,${t}}>`))},Ei=/^(?:[ \t]*(?:\n|$))+/,_i=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,Ri=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,Ae=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,Li=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,Ct=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,Ys=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |fences|blockquote|heading|hr|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,Qs=b(Ys).replace(/bull/g,Ct).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(),zi=b(Ys).replace(/bull/g,Ct).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(),Tt=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table|[ \t]+\n)[^\n]+)*)/,Pi=/^[^\n]+/,Et=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,Oi=b(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",Et).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),Mi=b(/^(bull)([ \t][^\n]*?)?(?:\n|$)/).replace(/bull/g,Ct).getRegex(),Ce="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",_t=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,ji=b("^ {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",_t).replace("tag",Ce).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Xs=t=>b(Tt).replace("hr",Ae).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",Ce).getRegex(),Ii=Xs(/ {0,3}(?:[*+-]|1[.)])[ \t]+[^ \t\n]/),qi=Xs(/ {0,3}(?:[*+-]|\d{1,9}[.)])(?:[ \t]|\n|$)/),Ni=b(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",qi).getRegex(),Rt={blockquote:Ni,code:_i,def:Oi,fences:Ri,heading:Li,hr:Ae,html:ji,lheading:Qs,list:Mi,newline:Ei,paragraph:Ii,table:se,text:Pi},en=b("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",Ae).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",Ce).getRegex(),Di={...Rt,lheading:zi,table:en,paragraph:b(Tt).replace("hr",Ae).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",en).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",Ce).getRegex()},Ui={...Rt,html:b(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",_t).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:se,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:b(Tt).replace("hr",Ae).replace("heading",` *#{1,6} *[^
|
|
493
|
+
]`).replace("lheading",Qs).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},Bi=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,Hi=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,tn=/^( {2,}|\\)\n(?!\s*$)[ \t]*/,Fi=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,U=/[\p{P}\p{S}]/u,he=/[\s\p{P}\p{S}]/u,Te=/[^\s\p{P}\p{S}]/u,Ki=b(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,he).getRegex(),Wi=/[\p{Pi}\p{Ps}"']/u,sn=/(?!~)[\p{P}\p{S}]/u,Zi=/(?!~)[\s\p{P}\p{S}]/u,Vi=/(?:[^\s\p{P}\p{S}]|~)/u,Gi=b(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",Ti?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),nn=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,Ji=b(nn,"u").replace(/punct/g,U).getRegex(),Yi=b(nn,"u").replace(/punct/g,sn).getRegex(),Qi=/^(?:\*+(?:((?!\*)(?!openQuote)punct)|([^\s*]))?)|^_+(?:((?!_)(?!openQuote)punct)|([^\s_]))?/,Xi=b(Qi,"u").replace(/openQuote/g,Wi).replace(/punct/g,U).getRegex(),rn="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",ea=b(rn,"gu").replace(/notPunctSpace/g,Te).replace(/punctSpace/g,he).replace(/punct/g,U).getRegex(),ta=b(rn,"gu").replace(/notPunctSpace/g,Vi).replace(/punctSpace/g,Zi).replace(/punct/g,sn).getRegex(),sa="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)[\\s](\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|(?:(?!\\*)punct|notPunctSpace)(\\*+)(?!\\*)(?=notPunctSpace)",na=b(sa,"gu").replace(/notPunctSpace/g,Te).replace(/punctSpace/g,he).replace(/punct/g,U).getRegex(),ra=b("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,Te).replace(/punctSpace/g,he).replace(/punct/g,U).getRegex(),ia="^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)[\\s](_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)|(?:(?!_)punct|notPunctSpace)(_+)(?!_)(?=notPunctSpace)",aa=b(ia,"gu").replace(/notPunctSpace/g,Te).replace(/punctSpace/g,he).replace(/punct/g,U).getRegex(),oa=b(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,U).getRegex(),la="^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)",ca=b(la,"gu").replace(/notPunctSpace/g,Te).replace(/punctSpace/g,he).replace(/punct/g,U).getRegex(),da=b(/\\(punct)/,"gu").replace(/punct/g,U).getRegex(),pa=b(/^<(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(),ha=b(_t).replace("(?:-->|$)","-->").getRegex(),ua=b("^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",ha).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),an=/\[(?:\\[\s\S]|[^\[\]\\])*\]/,Ge=b(/(?:\[(?:brackets|\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/).replace("brackets",an).getRegex(),fa=b(/^!?\[(label)\]\([ \t\n]*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?[ \t\n]*\)/).replace("label",Ge).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]+|(?=\))/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),ga=b(/^!?\[(label)\]\[(ref)\]/).replace("label",Ge).replace("ref",Et).getRegex(),ma=b(/^!?\[(ref)\](?:\[\])?/).replace("ref",Et).getRegex(),on=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\]){1,999}/,ka=b(/(?:[^\[\]\\`]*(?:\[(?:brackets|\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\]))){0,999}?[^\[\]\\`]*?/).replace("brackets",an).getRegex(),ba=b("reflink|nolink(?!\\()","g").replace("reflink",b(/^!?\[(label)\]\[(ref)\]/).replace("label",ka).replace("ref",on).getRegex()).replace("nolink",b(/^!?\[(ref)\](?:\[\])?/).replace("ref",on).getRegex()).getRegex(),ln=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,xa=/[A-Za-z0-9._+-]+@[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![\w-])/,va=b(/(?:mailto:email|xmpp:email(?:\/[A-Za-z0-9@.]+)?)/).replace(/email/g,xa).getRegex(),Lt={_backpedal:se,anyPunctuation:da,autolink:pa,blockSkip:Gi,br:tn,code:Hi,del:se,delLDelim:se,delRDelim:se,emStrongLDelim:Ji,emStrongRDelimAst:ea,emStrongRDelimUnd:ra,escape:Bi,link:fa,nolink:ma,punctuation:Ki,reflink:ga,reflinkSearch:ba,tag:ua,text:Fi,url:se},ya={...Lt,emStrongLDelim:Xi,emStrongRDelimAst:na,emStrongRDelimUnd:aa,link:b(/^!?\[(label)\]\((.*?)\)/).replace("label",Ge).getRegex(),reflink:b(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Ge).getRegex()},zt={...Lt,emStrongRDelimAst:ta,emStrongLDelim:Yi,delLDelim:oa,delRDelim:ca,url:b(/^emailProtocol|^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("emailProtocol",va).replace("protocol",ln).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:b(/^(?:[^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",ln).replace(/emailProtocol/g,/(?:mailto|xmpp):/).getRegex()},wa={...zt,br:b(tn).replace("{2,}","*").getRegex(),text:b(zt.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},Je={normal:Rt,gfm:Di,pedantic:Ui},Ee={normal:Lt,gfm:zt,breaks:wa,pedantic:ya},$a={"&":"&","<":"<",">":">",'"':""","'":"'"},cn=t=>$a[t];function z(t,e){if(e){if(E.escapeTest.test(t))return t.replace(E.escapeReplace,cn)}else if(E.escapeTestNoEncode.test(t))return t.replace(E.escapeReplaceNoEncode,cn);return t}function Sa(t){return t.replace(E.numericCharacterReference,(e,s,n)=>{let r=s===void 0?Number.parseInt(n,16):Number.parseInt(s,10);return r===0||r>1114111||r>=55296&&r<=57343?"\uFFFD":String.fromCodePoint(r)})}function dn(t){try{t=encodeURI(t).replace(E.percentDecode,"%")}catch{return null}return t}function pn(t,e){let s=t.replace(E.findPipe,(i,a,o)=>{let l=!1,c=a;for(;--c>=0&&o[c]==="\\";)l=!l;return l?"|":" |"}),n=s.split(E.splitPipe),r=0;if(n[0].trim()||n.shift(),n.length>0&&!n.at(-1)?.trim()&&n.pop(),e)if(n.length>e)n.splice(e);else for(;n.length<e;)n.push("");for(;r<n.length;r++)n[r]=n[r].trim().replace(E.slashPipe,"|");return n}function W(t,e,s){let n=t.length;if(n===0)return"";let r=0;for(;r<n&&t.charAt(n-r-1)===e;)r++;return t.slice(0,n-r)}function hn(t){let e=t.split(`
|
|
487
494
|
`),s=e.length-1;for(;s>=0&&E.blankLine.test(e[s]);)s--;return e.length-s<=2?t:e.slice(0,s+1).join(`
|
|
488
495
|
`)}function Ye(t){return t.trim().toLowerCase().toUpperCase().toLowerCase()}function un(t,e){if(t.indexOf(e[0])===-1&&t.indexOf(e[1])===-1)return-1;let s=0;for(let n=0;n<t.length;n++)if(t[n]==="\\")n++;else if(t[n]===e[0])s++;else if(t[n]===e[1]&&(s--,s<0))return n;return s>0?-2:-1}function fn(t,e=0){let s=e,n="";for(let r of t)if(r===" "){let i=4-s%4;n+=" ".repeat(i),s+=i}else n+=r,s++;return n}function gn(t,e,s,n,r){let i=e.href,a=e.title||null,o=t[1].replace(r.other.outputLinkReplace,"$1"),l=t[0].charAt(0)==="!";n.state.inLink=!0;let c=n.state.linkEmitted,p=n.state.inRawBlock;n.state.linkEmitted=!1;let d=n.inlineTokens(o),h=n.state.linkEmitted;if(n.state.linkEmitted=c,n.state.inLink=!1,!l){if(h){n.state.inRawBlock=p;return}n.state.linkEmitted=!0}return{type:l?"image":"link",raw:s,href:i,title:a,text:o,tokens:d}}function Aa(t,e,s){let n=t.match(s.other.indentCodeCompensation);if(n===null)return e;let r=n[1];return e.split(`
|
|
489
496
|
`).map(i=>{let a=i.match(s.other.beginningSpace);if(a===null)return i;let[o]=a;return i.slice(Math.min(o.length,r.length))}).join(`
|
|
490
|
-
`)}function mn(t,e,s,n){if(!e.includes("<"))return!1;for(let r=0;r<e.length;r++){if(e[r]==="\\"){r++;continue}if(e[r]==="`"){let o=n.inline.code.exec(e.slice(r));if(o){r+=o[0].length-1;continue}}if(e[r]!=="<")continue;let i=t.slice(s+r),a=n.inline.tag.exec(i)||n.inline.autolink.exec(i);if(a){if(a[0].length>e.length-r)return!0;r+=a[0].length-1}}return!1}var Qe=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 s=this.options.pedantic?e[0]:hn(e[0]),n=s.replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:s,codeBlockStyle:"indented",text:n}}}fences(t){let e=this.rules.block.fences.exec(t);if(e){let s=e[0],n=Aa(s,e[3]||"",this.rules);return{type:"code",raw:s,lang:e[2]?e[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):e[2],text:n}}}heading(t){let e=this.rules.block.heading.exec(t);if(e){let s=e[2].trim();if(this.rules.other.endingHash.test(s)){let n=
|
|
491
|
-
`),depth:e[1].length,text:s,tokens:this.lexer.inline(s)}}}hr(t){let e=this.rules.block.hr.exec(t);if(e)return{type:"hr",raw:
|
|
492
|
-
`)}}blockquote(t){let e=this.rules.block.blockquote.exec(t);if(e){let s=
|
|
497
|
+
`)}function mn(t,e,s,n){if(!e.includes("<"))return!1;for(let r=0;r<e.length;r++){if(e[r]==="\\"){r++;continue}if(e[r]==="`"){let o=n.inline.code.exec(e.slice(r));if(o){r+=o[0].length-1;continue}}if(e[r]!=="<")continue;let i=t.slice(s+r),a=n.inline.tag.exec(i)||n.inline.autolink.exec(i);if(a){if(a[0].length>e.length-r)return!0;r+=a[0].length-1}}return!1}var Qe=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 s=this.options.pedantic?e[0]:hn(e[0]),n=s.replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:s,codeBlockStyle:"indented",text:n}}}fences(t){let e=this.rules.block.fences.exec(t);if(e){let s=e[0],n=Aa(s,e[3]||"",this.rules);return{type:"code",raw:s,lang:e[2]?e[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):e[2],text:n}}}heading(t){let e=this.rules.block.heading.exec(t);if(e){let s=e[2].trim();if(this.rules.other.endingHash.test(s)){let n=W(s,"#");(this.options.pedantic||!n||this.rules.other.endingSpaceTabChar.test(n))&&(s=n.trim())}return{type:"heading",raw:W(e[0],`
|
|
498
|
+
`),depth:e[1].length,text:s,tokens:this.lexer.inline(s)}}}hr(t){let e=this.rules.block.hr.exec(t);if(e)return{type:"hr",raw:W(e[0],`
|
|
499
|
+
`)}}blockquote(t){let e=this.rules.block.blockquote.exec(t);if(e){let s=W(e[0],`
|
|
493
500
|
`).split(`
|
|
494
501
|
`),n="",r="",i=[];for(;s.length>0;){let a=!1,o=[],l;for(l=0;l<s.length;l++)if(this.rules.other.blockquoteStart.test(s[l]))o.push(s[l]),a=!0;else if(!a)o.push(s[l]);else break;s=s.slice(l);let c=o.join(`
|
|
495
502
|
`),p=c.replace(this.rules.other.blockquoteSetextReplace,`
|
|
@@ -510,12 +517,12 @@ ${ke.join(`
|
|
|
510
517
|
`,1)[0],be;if(f=ct,this.options.pedantic?(f=f.replace(this.rules.other.listReplaceNesting," "),be=f):be=f.replace(this.rules.other.leadingSpaceTab,Jr=>Jr.replace(this.rules.other.tabCharGlobal," ")),ke.test(f)||ys.test(f)||Vr.test(f)||Gr.test(f)||R.test(f)||me.test(f))break;if(be.search(this.rules.other.nonSpaceChar)>=x||!f.trim())p+=`
|
|
511
518
|
`+be.slice(x);else{if(y||u.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||ke.test(u)||ys.test(u)||me.test(u))break;p+=`
|
|
512
519
|
`+f}y=!f.trim(),c+=ct+`
|
|
513
|
-
`,t=t.substring(ct.length+1),u=be.slice(x)}}r.loose||(a?r.loose=!0:this.rules.other.doubleBlankLine.test(c)&&(a=!0)),r.items.push({type:"list_item",raw:c,task:!!this.options.gfm&&this.rules.other.listIsTask.test(p),loose:!1,text:p,tokens:[]}),r.raw+=c}let o=r.items.at(-1);if(o)o.raw=o.raw.trimEnd(),o.text=o.text.trimEnd();else return;r.raw=r.raw.trimEnd();for(let l of r.items)if(this.lexer.state.top=!1,l.tokens=this.lexer.blockTokens(l.text,[]),!r.loose){let c=l.tokens.filter(d=>d.type==="space"),p=c.length>0&&c.some(d=>this.rules.other.anyLine.test(d.raw));r.loose=p}for(let l of r.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,r.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(r.loose)for(let l of r.items){l.loose=!0;for(let c of l.tokens)c.type==="text"&&(c.type="paragraph")}return r}}html(t){let e=this.rules.block.html.exec(t);if(e){let s=hn(e[0]);return{type:"html",block:!0,raw:s,pre:e[1]==="pre"||e[1]==="script"||e[1]==="style",text:s}}}def(t){let e=this.rules.block.def.exec(t);if(e){if(!this.rules.other.startAngleBracket.test(e[2])&&un(e[2],"()")!==-1)return;let s=Ye(e[1]).replace(this.rules.other.multipleSpaceGlobal," "),n=e[2]?e[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",r=e[3]?e[3].substring(1,e[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):e[3];return{type:"def",tag:s,raw:
|
|
520
|
+
`,t=t.substring(ct.length+1),u=be.slice(x)}}r.loose||(a?r.loose=!0:this.rules.other.doubleBlankLine.test(c)&&(a=!0)),r.items.push({type:"list_item",raw:c,task:!!this.options.gfm&&this.rules.other.listIsTask.test(p),loose:!1,text:p,tokens:[]}),r.raw+=c}let o=r.items.at(-1);if(o)o.raw=o.raw.trimEnd(),o.text=o.text.trimEnd();else return;r.raw=r.raw.trimEnd();for(let l of r.items)if(this.lexer.state.top=!1,l.tokens=this.lexer.blockTokens(l.text,[]),!r.loose){let c=l.tokens.filter(d=>d.type==="space"),p=c.length>0&&c.some(d=>this.rules.other.anyLine.test(d.raw));r.loose=p}for(let l of r.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,r.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(r.loose)for(let l of r.items){l.loose=!0;for(let c of l.tokens)c.type==="text"&&(c.type="paragraph")}return r}}html(t){let e=this.rules.block.html.exec(t);if(e){let s=hn(e[0]);return{type:"html",block:!0,raw:s,pre:e[1]==="pre"||e[1]==="script"||e[1]==="style",text:s}}}def(t){let e=this.rules.block.def.exec(t);if(e){if(!this.rules.other.startAngleBracket.test(e[2])&&un(e[2],"()")!==-1)return;let s=Ye(e[1]).replace(this.rules.other.multipleSpaceGlobal," "),n=e[2]?e[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",r=e[3]?e[3].substring(1,e[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):e[3];return{type:"def",tag:s,raw:W(e[0],`
|
|
514
521
|
`),href:n,title:r}}}table(t){let e=this.rules.block.table.exec(t);if(!e||!this.rules.other.tableDelimiter.test(e[2]))return;let s=pn(e[1]),n=e[2].replace(this.rules.other.tableAlignChars,"").split("|"),r=e[3]?.trim()?e[3].replace(this.rules.other.tableRowBlankLine,"").split(`
|
|
515
|
-
`):[],i={type:"table",raw:
|
|
516
|
-
`),header:[],align:[],rows:[]};if(s.length===n.length){for(let a of n)this.rules.other.tableAlignRight.test(a)?i.align.push("right"):this.rules.other.tableAlignCenter.test(a)?i.align.push("center"):this.rules.other.tableAlignLeft.test(a)?i.align.push("left"):i.align.push(null);for(let a=0;a<s.length;a++)i.header.push({text:s[a],tokens:this.lexer.inline(s[a]),header:!0,align:i.align[a]});for(let a of r)i.rows.push(pn(a,i.header.length).map((o,l)=>({text:o,tokens:this.lexer.inline(o),header:!1,align:i.align[l]})));return i}}lheading(t){let e=this.rules.block.lheading.exec(t);if(e){let s=e[1].trim();return{type:"heading",raw:
|
|
522
|
+
`):[],i={type:"table",raw:W(e[0],`
|
|
523
|
+
`),header:[],align:[],rows:[]};if(s.length===n.length){for(let a of n)this.rules.other.tableAlignRight.test(a)?i.align.push("right"):this.rules.other.tableAlignCenter.test(a)?i.align.push("center"):this.rules.other.tableAlignLeft.test(a)?i.align.push("left"):i.align.push(null);for(let a=0;a<s.length;a++)i.header.push({text:s[a],tokens:this.lexer.inline(s[a]),header:!0,align:i.align[a]});for(let a of r)i.rows.push(pn(a,i.header.length).map((o,l)=>({text:o,tokens:this.lexer.inline(o),header:!1,align:i.align[l]})));return i}}lheading(t){let e=this.rules.block.lheading.exec(t);if(e){let s=e[1].trim();return{type:"heading",raw:W(e[0],`
|
|
517
524
|
`),depth:e[2].charAt(0)==="="?1:2,text:s,tokens:this.lexer.inline(s)}}}paragraph(t){let e=this.rules.block.paragraph.exec(t);if(e){let s=e[1].charAt(e[1].length-1)===`
|
|
518
|
-
`?e[1].slice(0,-1):e[1];return{type:"paragraph",raw:e[0],text:s,tokens:this.lexer.inline(s)}}}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 s=e[0].charAt(0)==="!"?2:1;if(!this.options.pedantic&&mn(t,e[1],s,this.rules))return;let n=e[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(n)){if(!this.rules.other.endAngleBracket.test(n))return;let a=
|
|
525
|
+
`?e[1].slice(0,-1):e[1];return{type:"paragraph",raw:e[0],text:s,tokens:this.lexer.inline(s)}}}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 s=e[0].charAt(0)==="!"?2:1;if(!this.options.pedantic&&mn(t,e[1],s,this.rules))return;let n=e[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(n)){if(!this.rules.other.endAngleBracket.test(n))return;let a=W(n.slice(0,-1),"\\");if((n.length-a.length)%2===0)return}else{let a=un(e[2],"()");if(a===-2)return;if(a>-1){let o=(e[0].indexOf("!")===0?5:4)+e[1].length+a;e[2]=e[2].substring(0,a),e[0]=e[0].substring(0,o).trim(),e[3]=""}}let r=e[2],i="";if(this.options.pedantic){let a=this.rules.other.pedanticHrefTitle.exec(r);a&&(r=a[1],i=a[3])}else i=e[3]?e[3].slice(1,-1):"";return r=r.trim(),this.rules.other.startAngleBracket.test(r)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(n)?r=r.slice(1):r=r.slice(1,-1)),gn(e,{href:r&&r.replace(this.rules.inline.anyPunctuation,"$1"),title:i&&i.replace(this.rules.inline.anyPunctuation,"$1")},e[0],this.lexer,this.rules)}}reflink(t,e){let s;if((s=this.rules.inline.reflink.exec(t))||(s=this.rules.inline.nolink.exec(t))){let n=s[0].charAt(0)==="!"?2:1;if(!this.options.pedantic&&mn(t,s[1],n,this.rules))return;let r=(s[2]||s[1]).replace(this.rules.other.multipleSpaceGlobal," "),i=e[Ye(r)];if(!i){let a=s[0].charAt(0);return{type:"text",raw:a,text:a}}return gn(s,i,s[0],this.lexer,this.rules)}}emStrong(t,e,s=""){let n=this.rules.inline.emStrongLDelim.exec(t);if(!(!n||!n[1]&&!n[2]&&!n[3]&&!n[4]||n[4]&&s.match(this.rules.other.unicodeAlphaNumeric))&&(!(n[1]||n[3])||!s||this.rules.inline.punctuation.exec(s))){let r=[...n[0]].length-1,i,a,o=r,l=0,c=n[0][0],p=s===c,d=c==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(d.lastIndex=0,e=e.slice(-1*t.length+r);(n=d.exec(e))!==null;){if(i=n[1]||n[2]||n[3]||n[4]||n[5]||n[6],!i)continue;if(a=[...i].length,n[3]||n[4]){o+=a;continue}else if(n[5]||n[6]){if(r%3&&!((r+a)%3)){l+=a;continue}if(p)break}if(o-=a,o>0)continue;a=Math.min(a,a+o+l);let h=[...n[0]][0].length,u=t.slice(0,r+n.index+h+a);if(Math.min(r,a)%2){let y=u.slice(1,-1);return{type:"em",raw:u,text:y,tokens:this.lexer.inlineTokens(y)}}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 s=e[2].replace(this.rules.other.newLineCharGlobal," "),n=this.rules.other.nonSpaceChar.test(s),r=this.rules.other.startingSpaceChar.test(s)&&this.rules.other.endingSpaceChar.test(s);return n&&r&&(s=s.substring(1,s.length-1)),{type:"codespan",raw:e[0],text:s}}}br(t){let e=this.rules.inline.br.exec(t);if(e)return{type:"br",raw:e[0]}}del(t,e,s=""){let n=this.rules.inline.delLDelim.exec(t);if(n&&(!n[1]||!s||this.rules.inline.punctuation.exec(s))){let r=[...n[0]].length-1,i,a,o=r,l=this.rules.inline.delRDelim;for(l.lastIndex=0,e=e.slice(-1*t.length+r);(n=l.exec(e))!==null;){if(i=n[1]||n[2]||n[3]||n[4]||n[5]||n[6],!i||(a=[...i].length,a!==r))continue;if(n[3]||n[4]){o+=a;continue}if(o-=a,o>0)continue;a=Math.min(a,a+o);let c=[...n[0]][0].length,p=t.slice(0,r+n.index+c+a),d=p.slice(r,-r);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 s,n;return e[2]==="@"?(s=e[1],n="mailto:"+s):(s=e[1],n=s),{type:"link",raw:e[0],text:s,href:n,autolink:!0,tokens:[{type:"text",raw:s,text:s}]}}}url(t){let e;if(e=this.rules.inline.url.exec(t)){let s,n;if(e[2]==="@")s=e[0],n="mailto:"+s;else{let r;do r=e[0],e[0]=this.rules.inline._backpedal.exec(e[0])?.[0]??"";while(r!==e[0]);s=e[0],e[1]==="www."?n="http://"+e[0]:n=e[0]}return{type:"link",raw:e[0],text:s,href:n,autolink:!0,tokens:[{type:"text",raw:s,text:s}]}}}inlineText(t){let e=this.rules.inline.text.exec(t);if(e){let s=this.lexer.state.inRawBlock;return{type:"text",raw:e[0],text:s?e[0]:Sa(e[0]),escaped:s}}}},j=class xs{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 Qe,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 s={other:E,block:Je.normal,inline:Ee.normal};this.options.pedantic?(s.block=Je.pedantic,s.inline=Ee.pedantic):this.options.gfm&&(s.block=Je.gfm,this.options.breaks?s.inline=Ee.breaks:s.inline=Ee.gfm),this.tokenizer.rules=s}static get rules(){return{block:Je,inline:Ee}}static lex(e,s){return new xs(s).lex(e)}static lexInline(e,s){return new xs(s).inlineTokens(e)}lex(e){e=e.replace(E.carriageReturn,`
|
|
519
526
|
`),this.blockTokens(e,this.tokens);for(let s=0;s<this.inlineQueue.length;s++){let n=this.inlineQueue[s];this.inlineTokens(n.src,n.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,s=[],n=!1){this.tokenizer.lexer=this,this.options.pedantic&&(e=e.replace(E.tabCharGlobal," ").replace(E.spaceLine,""));let r=1/0;for(;e;){if(e.length<r)r=e.length;else{this.infiniteLoopError(e.charCodeAt(0));break}let i;if(this.options.extensions?.block?.some(o=>(i=o.call({lexer:this},e,s))?(e=e.substring(i.raw.length),s.push(i),!0):!1))continue;if(i=this.tokenizer.space(e)){e=e.substring(i.raw.length);let o=s.at(-1);i.raw.length===1&&o!==void 0?o.raw+=`
|
|
520
527
|
`:s.push(i);continue}if(i=this.tokenizer.code(e)){e=e.substring(i.raw.length);let o=s.at(-1);o?.type==="paragraph"||o?.type==="text"?(o.raw+=(o.raw.endsWith(`
|
|
521
528
|
`)?"":`
|
|
@@ -530,8 +537,8 @@ ${ke.join(`
|
|
|
530
537
|
`)?"":`
|
|
531
538
|
`)+i.raw,o.text+=`
|
|
532
539
|
`+i.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=o.text):s.push(i);continue}if(e){this.infiniteLoopError(e.charCodeAt(0));break}}return this.state.top=!0,s}inline(e,s=[]){return this.inlineQueue.push({src:e,tokens:s}),s}linkInText(e){if(!e.includes("["))return!1;let s=this.tokenizer.rules.inline.link;for(let n of e.matchAll(this.tokenizer.rules.inline.blockSkip))if(s.test(n[0])&&e.charAt(n.index-1)!=="!")return!0;for(let n of e.matchAll(this.tokenizer.rules.inline.reflinkSearch)){let r=n[0],i=r.lastIndexOf("[");if(!(r.charAt(0)==="!"||!Object.hasOwn(this.tokens.links,Ye(r.slice(i+1,-1))))&&!(i>1&&this.linkInText(r.slice(1,i-1))))return!0}return!1}inlineTokens(e,s=[]){this.tokenizer.lexer=this;let n=this.state.linkParenPossible;this.state.linkParenPossible=n&&e.includes(")");try{return this.#e(e,s)}finally{this.state.linkParenPossible=n}}#e(e,s){let n=e;if(this.tokens.links&&e.includes("[")){let o=this.tokenizer.rules.inline.reflinkSearch,l=c=>{let p=c.lastIndexOf("[");if(!Object.hasOwn(this.tokens.links,Ye(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(o,l)+"]["+"a".repeat(c.length-p-2)+"]"}return"["+"a".repeat(c.length-2)+"]"};n=n.replace(o,l)}n=n.replace(this.tokenizer.rules.inline.anyPunctuation,o=>"+".repeat(o.length)),n=n.replace(this.tokenizer.rules.inline.blockSkip,(o,l,c)=>{let p=c?c.length:0;return o.slice(0,p)+"["+"a".repeat(o.length-p-2)+"]"}),n=this.options.hooks?.emStrongMask?.call({lexer:this},n)??n;let r=!1,i="",a=1/0;for(;e;){if(e.length<a)a=e.length;else{this.infiniteLoopError(e.charCodeAt(0));break}r||(i=""),r=!1;let o;if(this.options.extensions?.inline?.some(c=>(o=c.call({lexer:this},e,s))?(e=e.substring(o.raw.length),s.push(o),!0):!1))continue;if(o=this.tokenizer.escape(e)){e=e.substring(o.raw.length),s.push(o);continue}if(o=this.tokenizer.tag(e)){e=e.substring(o.raw.length),s.push(o);continue}if(o=this.tokenizer.link(e)){e=e.substring(o.raw.length),s.push(o);continue}if(o=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(o.raw.length);let c=s.at(-1);o.type==="text"&&c?.type==="text"?(c.raw+=o.raw,c.text+=o.text):s.push(o);continue}if(o=this.tokenizer.emStrong(e,n,i)){e=e.substring(o.raw.length),s.push(o);continue}if(o=this.tokenizer.codespan(e)){e=e.substring(o.raw.length),s.push(o);continue}if(o=this.tokenizer.br(e)){e=e.substring(o.raw.length),s.push(o);continue}if(o=this.tokenizer.del(e,n,i)){e=e.substring(o.raw.length),s.push(o);continue}if(o=this.tokenizer.autolink(e)){e=e.substring(o.raw.length),s.push(o);continue}if(!this.state.inLink&&(o=this.tokenizer.url(e))){e=e.substring(o.raw.length),s.push(o);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(o=this.tokenizer.inlineText(l)){e=e.substring(o.raw.length),o.raw.slice(-1)!=="_"&&(i=o.raw.slice(-1)),r=!0;let c=s.at(-1);c?.type==="text"?(c.raw+=o.raw,c.text+=o.text):s.push(o);continue}if(e){this.infiniteLoopError(e.charCodeAt(0));break}}return s}infiniteLoopError(e){let s="Infinite loop on byte: "+e;if(this.options.silent)console.error(s);else throw new Error(s)}},Xe=class{options;parser;constructor(t){this.options=t||te}space(t){return""}code({text:t,lang:e,escaped:s}){let n=(e||"").match(E.notSpaceStart)?.[0],r=t?t.replace(E.endingNewline,"")+`
|
|
533
|
-
`:"";return n?'<pre><code class="language-'+
|
|
534
|
-
`:"<pre><code>"+(s?r:
|
|
540
|
+
`:"";return n?'<pre><code class="language-'+z(n)+'">'+(s?r:z(r,!0))+`</code></pre>
|
|
541
|
+
`:"<pre><code>"+(s?r:z(r,!0))+`</code></pre>
|
|
535
542
|
`}blockquote({tokens:t}){return`<blockquote>
|
|
536
543
|
${this.parser.parse(t)}</blockquote>
|
|
537
544
|
`}html({text:t}){return t}def(t){return""}heading({tokens:t,depth:e}){return`<h${e}>${this.parser.parseInline(t)}</h${e}>
|
|
@@ -547,8 +554,8 @@ ${this.parser.parse(t)}</blockquote>
|
|
|
547
554
|
`}tablerow({text:t}){return`<tr>
|
|
548
555
|
${t}</tr>
|
|
549
556
|
`}tablecell(t){let e=this.parser.parseInline(t.tokens),s=t.header?"th":"td";return(t.align?`<${s} align="${t.align}">`:`<${s}>`)+e+`</${s}>
|
|
550
|
-
`}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>${
|
|
551
|
-
Please report this to https://github.com/markedjs/marked.`,t){let n="<p>An error occurred:</p><pre>"+
|
|
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>${z(t,!0)}</code>`}br(t){return"<br>"}del({tokens:t}){return`<del>${this.parser.parseInline(t)}</del>`}link({href:t,title:e,text:s,tokens:n,autolink:r}){let i=r?z(s,!0):this.parser.parseInline(n),a=dn(t);if(a===null)return i;t=z(a,r);let o='<a href="'+t+'"';return e&&(o+=' title="'+z(e)+'"'),o+=">"+i+"</a>",o}image({href:t,title:e,text:s,tokens:n}){n&&(s=this.parser.parseInline(n,this.parser.textRenderer));let r=dn(t);if(r===null)return z(s);t=r;let i=`<img src="${z(t)}" alt="${z(s)}"`;return e&&(i+=` title="${z(e)}"`),i+=">",i}text(t){return"tokens"in t&&t.tokens?this.parser.parseInline(t.tokens):"escaped"in t&&t.escaped?t.text:z(t.text)}},Pt=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}},I=class vs{options;renderer;textRenderer;constructor(e){this.options=e||te,this.options.renderer=this.options.renderer||new Xe,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new Pt}static parse(e,s){return new vs(s).parse(e)}static parseInline(e,s){return new vs(s).parseInline(e)}parse(e){this.renderer.parser=this;let s="";for(let n=0;n<e.length;n++){let r=e[n];if(this.options.extensions?.renderers?.[r.type]){let a=r,o=this.options.extensions.renderers[a.type].call({parser:this},a);if(o!==!1||!["space","hr","heading","code","table","blockquote","list","checkbox","html","def","paragraph","text"].includes(a.type)){s+=o||"";continue}}let i=r;switch(i.type){case"space":{s+=this.renderer.space(i);break}case"hr":{s+=this.renderer.hr(i);break}case"heading":{s+=this.renderer.heading(i);break}case"code":{s+=this.renderer.code(i);break}case"table":{s+=this.renderer.table(i);break}case"blockquote":{s+=this.renderer.blockquote(i);break}case"list":{s+=this.renderer.list(i);break}case"checkbox":{s+=this.renderer.checkbox(i);break}case"html":{s+=this.renderer.html(i);break}case"def":{s+=this.renderer.def(i);break}case"paragraph":{s+=this.renderer.paragraph(i);break}case"text":{s+=this.renderer.text(i);break}default:{let a='Token with "'+i.type+'" type was not found.';if(this.options.silent)return console.error(a),"";throw new Error(a)}}}return s}parseInline(e,s=this.renderer){this.renderer.parser=this;let n="";for(let r=0;r<e.length;r++){let i=e[r];if(this.options.extensions?.renderers?.[i.type]){let o=this.options.extensions.renderers[i.type].call({parser:this},i);if(o!==!1||!["escape","html","link","image","checkbox","strong","em","codespan","br","del","text"].includes(i.type)){n+=o||"";continue}}let a=i;switch(a.type){case"escape":{n+=s.text(a);break}case"html":{n+=s.html(a);break}case"link":{n+=s.link(a);break}case"image":{n+=s.image(a);break}case"checkbox":{n+=s.checkbox(a);break}case"strong":{n+=s.strong(a);break}case"em":{n+=s.em(a);break}case"codespan":{n+=s.codespan(a);break}case"br":{n+=s.br(a);break}case"del":{n+=s.del(a);break}case"text":{n+=s.text(a);break}default:{let o='Token with "'+a.type+'" type was not found.';if(this.options.silent)return console.error(o),"";throw new Error(o)}}}return n}},_e=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?j.lex:j.lexInline}provideParser(t=this.block){return t?I.parse:I.parseInline}},kn=class{defaults=At();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=I;Renderer=Xe;TextRenderer=Pt;Lexer=j;Tokenizer=Qe;Hooks=_e;constructor(...t){this.use(...t)}walkTokens(t,e){let s=[];for(let n of t)switch(s=s.concat(e.call(this,n)),n.type){case"table":{let r=n;for(let i of r.header)s=s.concat(this.walkTokens(i.tokens,e));for(let i of r.rows)for(let a of i)s=s.concat(this.walkTokens(a.tokens,e));break}case"list":{let r=n;s=s.concat(this.walkTokens(r.items,e));break}default:{let r=n;this.defaults.extensions?.childTokens?.[r.type]?this.defaults.extensions.childTokens[r.type].forEach(i=>{let a=r[i].flat(1/0);s=s.concat(this.walkTokens(a,e))}):r.tokens&&(s=s.concat(this.walkTokens(r.tokens,e)))}}return s}use(...t){let e=this.defaults.extensions||{renderers:{},childTokens:{}};return t.forEach(s=>{let n={...s};if(n.async=this.defaults.async||n.async||!1,s.extensions&&(s.extensions.forEach(r=>{if(!r.name)throw new Error("extension name required");if("renderer"in r){let i=e.renderers[r.name];i?e.renderers[r.name]=function(...a){let o=r.renderer.apply(this,a);return o===!1&&(o=i.apply(this,a)),o}:e.renderers[r.name]=r.renderer}if("tokenizer"in r){if(!r.level||r.level!=="block"&&r.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let i=e[r.level];i?i.unshift(r.tokenizer):e[r.level]=[r.tokenizer],r.start&&(r.level==="block"?e.startBlock?e.startBlock.push(r.start):e.startBlock=[r.start]:r.level==="inline"&&(e.startInline?e.startInline.push(r.start):e.startInline=[r.start]))}"childTokens"in r&&r.childTokens&&(e.childTokens[r.name]=r.childTokens)}),n.extensions=e),s.renderer){let r=this.defaults.renderer||new Xe(this.defaults);for(let i in s.renderer){if(!(i in r))throw new Error(`renderer '${i}' does not exist`);if(["options","parser"].includes(i))continue;let a=i,o=s.renderer[a],l=r[a];r[a]=(...c)=>{let p=o.apply(r,c);return p===!1&&(p=l.apply(r,c)),p||""}}n.renderer=r}if(s.tokenizer){let r=this.defaults.tokenizer||new Qe(this.defaults);for(let i in s.tokenizer){if(!(i in r))throw new Error(`tokenizer '${i}' does not exist`);if(["options","rules","lexer"].includes(i))continue;let a=i,o=s.tokenizer[a],l=r[a];r[a]=(...c)=>{let p=o.apply(r,c);return p===!1&&(p=l.apply(r,c)),p}}n.tokenizer=r}if(s.hooks){let r=this.defaults.hooks||new _e;for(let i in s.hooks){if(!(i in r))throw new Error(`hook '${i}' does not exist`);if(["options","block"].includes(i))continue;let a=i,o=s.hooks[a],l=r[a];_e.passThroughHooks.has(i)?r[a]=c=>{if(this.defaults.async&&_e.passThroughHooksRespectAsync.has(i))return(async()=>{let d=await o.call(r,c);return l.call(r,d)})();let p=o.call(r,c);return l.call(r,p)}:r[a]=(...c)=>{if(this.defaults.async)return(async()=>{let d=await o.apply(r,c);return d===!1&&(d=await l.apply(r,c)),d})();let p=o.apply(r,c);return p===!1&&(p=l.apply(r,c)),p}}n.hooks=r}if(s.walkTokens){let r=this.defaults.walkTokens,i=s.walkTokens;n.walkTokens=function(a){let o=[];return o.push(i.call(this,a)),r&&(o=o.concat(r.call(this,a))),o}}this.defaults={...this.defaults,...n}}),this}setOptions(t){return this.defaults={...this.defaults,...t},this}lexer(t,e){return j.lex(t,e??this.defaults)}parser(t,e){return I.parse(t,e??this.defaults)}parseMarkdown(t){return(e,s)=>{let n={...s},r={...this.defaults,...n},i=this.onError(!!r.silent,!!r.async);if(this.defaults.async===!0&&n.async===!1)return i(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 i(new Error("marked(): input parameter is undefined or null"));if(typeof e!="string")return i(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(e)+", string expected"));if(r.hooks&&(r.hooks.options=r,r.hooks.block=t),r.async)return(async()=>{let a=r.hooks?await r.hooks.preprocess(e):e,o=await(r.hooks?await r.hooks.provideLexer(t):t?j.lex:j.lexInline)(a,r),l=r.hooks?await r.hooks.processAllTokens(o):o;r.walkTokens&&await Promise.all(this.walkTokens(l,r.walkTokens));let c=await(r.hooks?await r.hooks.provideParser(t):t?I.parse:I.parseInline)(l,r);return r.hooks?await r.hooks.postprocess(c):c})().catch(i);try{r.hooks&&(e=r.hooks.preprocess(e));let a=(r.hooks?r.hooks.provideLexer(t):t?j.lex:j.lexInline)(e,r);r.hooks&&(a=r.hooks.processAllTokens(a)),r.walkTokens&&this.walkTokens(a,r.walkTokens);let o=(r.hooks?r.hooks.provideParser(t):t?I.parse:I.parseInline)(a,r);return r.hooks&&(o=r.hooks.postprocess(o)),o}catch(a){return i(a)}}}onError(t,e){return s=>{if(s.message+=`
|
|
558
|
+
Please report this to https://github.com/markedjs/marked.`,t){let n="<p>An error occurred:</p><pre>"+z(s.message+"",!0)+"</pre>";return e?Promise.resolve(n):n}if(e)return Promise.reject(s);throw s}}},ne=new kn;function $(t,e){return ne.parse(t,e)}$.options=$.setOptions=function(t){return ne.setOptions(t),$.defaults=ne.defaults,Js($.defaults),$},$.getDefaults=At,$.defaults=te;function Ca(...t){return ne.use(...t),$.defaults=ne.defaults,Js($.defaults),$}$.use=Ca,$.walkTokens=function(t,e){return ne.walkTokens(t,e)},$.parseInline=ne.parseInline,$.Parser=I,$.parser=I.parse,$.Renderer=Xe,$.TextRenderer=Pt,$.Lexer=j,$.lexer=j.lex,$.Tokenizer=Qe,$.Hooks=_e,$.parse=$,$.options,$.setOptions,$.walkTokens,$.parseInline,I.parse,j.lex;const Ta={"&":"&","<":"<",">":">",'"':""","'":"'"},re=t=>t.replace(/[&<>"']/g,e=>Ta[e]??e),Ea=new Set(["http","https","mailto"]),bn=t=>{const e=t.replace(/[\u0000- \u007f]/g,""),s=/^([a-z][a-z0-9+.-]*):/i.exec(e)?.[1];return s===void 0||Ea.has(s.toLowerCase())},_a=t=>/^https?:/i.test(t.trim()),Ra=new kn({gfm:!0,breaks:!0,renderer:{html({text:t}){return re(t)},link({href:t,title:e,tokens:s}){const n=this.parser.parseInline(s);if(!bn(t))return n;const r=e?` title="${re(e)}"`:"",i=_a(t)?' target="_blank" rel="noopener noreferrer"':"";return`<a href="${re(t)}"${r}${i}>${n}</a>`},image({href:t,title:e,text:s}){if(!bn(t))return re(s);const n=e?` title="${re(e)}"`:"";return`<img src="${re(t)}" alt="${re(s)}"${n}>`}}}),xn=t=>Ra.parse(t,{async:!1}),La=Ze({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 vn extends F{static{this.styles=[Ve,Gs,B`
|
|
552
559
|
/* One atomic box in both states, so the text can be edited where it sits:
|
|
553
560
|
while editing, the text stays (hidden) underneath and keeps sizing the
|
|
554
561
|
box, and the field lies over it. Starting an edit moves nothing; the
|
|
@@ -652,6 +659,21 @@ Please report this to https://github.com/markedjs/marked.`,t){let n="<p>An error
|
|
|
652
659
|
}
|
|
653
660
|
}
|
|
654
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
|
+
|
|
655
677
|
/* seamless: no field chrome at all — the text is edited where it sits. */
|
|
656
678
|
:host([seamless]) .view,
|
|
657
679
|
:host([seamless]) .field {
|
|
@@ -663,7 +685,7 @@ Please report this to https://github.com/markedjs/marked.`,t){let n="<p>An error
|
|
|
663
685
|
background: transparent;
|
|
664
686
|
box-shadow: none;
|
|
665
687
|
}
|
|
666
|
-
`]}static{this.properties={value:{type:String},placeholder:{type:String},multiline:{type:Boolean},wrap:{type:Boolean,reflect:!0},seamless:{type:Boolean,reflect:!0},markdown:{type:Boolean},label:{type:String},editing:{state:!0}}}#e="";#
|
|
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="";#r=0;#n=new $t(this);connectedCallback(){super.connectedCallback(),this.#r+=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"),s=this.renderRoot,n=s instanceof ShadowRoot?s.activeElement:document.activeElement;e&&n!==e&&(e.focus(),e.setSelectionRange(0,e.value.length,"backward"),e.scrollLeft=0,e.scrollTop=0)}render(){const e=La(this.#n.locale),s=this.placeholder||e.unset,{editing:n}=this,r=n?this.#e:this.value,i=r===""?s:n&&r.endsWith(`
|
|
667
689
|
`)?`${r}\u200B`:r;return this.markdown&&!n&&r!==""?k`<span class="box"
|
|
668
690
|
><div
|
|
669
691
|
class="view dpk-prose"
|
|
@@ -671,8 +693,8 @@ Please report this to https://github.com/markedjs/marked.`,t){let n="<p>An error
|
|
|
671
693
|
role="button"
|
|
672
694
|
tabindex="0"
|
|
673
695
|
title=${e.clickToEdit}
|
|
674
|
-
@click=${this.#
|
|
675
|
-
@keydown=${this.#
|
|
696
|
+
@click=${this.#s}
|
|
697
|
+
@keydown=${this.#t}
|
|
676
698
|
>
|
|
677
699
|
${Hs(xn(r))}
|
|
678
700
|
</div></span
|
|
@@ -683,44 +705,45 @@ Please report this to https://github.com/markedjs/marked.`,t){let n="<p>An error
|
|
|
683
705
|
aria-hidden=${n?"true":g}
|
|
684
706
|
role=${n?g:"button"}
|
|
685
707
|
tabindex=${n?g:"0"}
|
|
686
|
-
title=${n?g:e.clickToEdit}
|
|
687
|
-
@click=${this.#
|
|
688
|
-
@keydown=${this.#
|
|
708
|
+
title=${n?g:this.truncate&&r!==""?r:e.clickToEdit}
|
|
709
|
+
@click=${this.#s}
|
|
710
|
+
@keydown=${this.#t}
|
|
689
711
|
>${i}</span
|
|
690
|
-
>${n?this.#
|
|
691
|
-
>`}#
|
|
712
|
+
>${n?this.#i(this.label||this.placeholder||e.edit,s):g}</span
|
|
713
|
+
>`}#i(e,s){return this.multiline||this.wrap?k`<textarea
|
|
692
714
|
class="field"
|
|
693
715
|
rows="1"
|
|
694
716
|
.value=${vt(this.#e)}
|
|
695
717
|
placeholder=${s}
|
|
696
718
|
aria-label=${e}
|
|
697
719
|
@input=${this.#a}
|
|
698
|
-
@keydown=${this.#
|
|
699
|
-
@blur=${this.#
|
|
720
|
+
@keydown=${this.#l}
|
|
721
|
+
@blur=${this.#o}
|
|
700
722
|
></textarea>`:k`<input
|
|
701
723
|
class="field"
|
|
702
724
|
.value=${vt(this.#e)}
|
|
703
725
|
placeholder=${s}
|
|
704
726
|
aria-label=${e}
|
|
705
727
|
@input=${this.#a}
|
|
706
|
-
@keydown=${this.#
|
|
707
|
-
@blur=${this.#
|
|
708
|
-
/>`}#t=e=>{e.composedPath().some(s=>s instanceof HTMLAnchorElement)||(e.stopPropagation(),!this.editing&&(this.#e=this.value,this.editing=!0))};#s=e=>{e.isComposing||this.editing||e.target instanceof HTMLAnchorElement||(e.key==="Enter"||e.key===" ")&&(e.preventDefault(),this.editing=!0)};#a=e=>{const s=de(e.target,HTMLInputElement)??de(e.target,HTMLTextAreaElement);s!==null&&(this.#e=s.value,this.requestUpdate())};#o=e=>{if(!e.isComposing){if(e.key==="Escape"){e.preventDefault(),this.#e=this.value,this.editing=!1;return}e.key==="Enter"&&(!this.multiline||this.wrap||e.metaKey||e.ctrlKey)&&(e.preventDefault(),this.#p())}};#l=e=>{const s=e.currentTarget;if(!(s instanceof HTMLInputElement||s instanceof HTMLTextAreaElement))return;const n=this.#i,{selectionStart:r,selectionEnd:i}=s;queueMicrotask(()=>{!this.isConnected||!this.editing||(n!==this.#i?(s.focus(),s.setSelectionRange(r,i)):this.#p())})};#p=()=>{if(!this.editing)return;this.editing=!1;const s=(this.wrap?this.#e.replace(/\r?\n/g," "):this.#e).trim();s!==this.value&&this.dispatchEvent(new CustomEvent("dpk-commit",{detail:{value:s},bubbles:!0,composed:!0}))}}const Pa=()=>{customElements.get("dpk-component-inline-edit")||customElements.define("dpk-component-inline-edit",vn)},za={lang:void 0,message:void 0,abortEarly:void 0,abortPipeEarly:void 0};function Ot(t){return za}let Oa;function Ma(t){return Oa?.get(t)}let ja;function Ia(t){return ja?.get(t)}let qa;function Na(t,e){return qa?.get(t)?.get(e)}function Re(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 A(t,e,s,n,r){const i=r&&"input"in r?r.input:s.value,a=r?.expected??t.expects??null,o=r?.received??Re(i),l={kind:t.kind,type:t.type,input:i,expected:a,received:o,message:`Invalid ${e}: ${a?`Expected ${a} but r`:"R"}eceived ${o}`,requirement:t.requirement,path:r?.path,issues:r?.issues,lang:n.lang,abortEarly:n.abortEarly,abortPipeEarly:n.abortPipeEarly},c=t.kind==="schema",p=r?.message??t.message??Na(t.reference,l.lang)??(c?Ia(l.lang):null)??n.message??Ma(l.lang);p!==void 0&&(l.message=typeof p=="function"?p(l):p),c&&(s.typed=!1),s.issues?s.issues.push(l):s.issues=[l]}function Da(t,e){return t===e||Number.isNaN(t)&&Number.isNaN(e)}function Ua(t,e){return Object.prototype.hasOwnProperty.call(t,e)&&e!=="__proto__"&&e!=="prototype"&&e!=="constructor"}function Mt(t,e){const s=[...new Set(t)];return s.length>1?`(${s.join(` ${e} `)})`:s[0]??"never"}function _(t){return t["~standard"]={version:1,vendor:"valibot",validate:e=>t["~run"]({value:e},Ot())},t}var Ba=class extends Error{constructor(t){super(t[0].message),this.name="ValiError",this.issues=t}};function yn(t,e){return{kind:"validation",type:"check",reference:yn,async:!1,expects:null,requirement:t,message:e,"~run"(s,n){return s.typed&&!this.requirement(s.value)&&A(this,"input",s,n),s}}}function wn(t){return{kind:"validation",type:"finite",reference:wn,async:!1,expects:null,requirement:Number.isFinite,message:t,"~run"(e,s){return e.typed&&!this.requirement(e.value)&&A(this,"finite",e,s),e}}}function $n(t){return{kind:"validation",type:"integer",reference:$n,async:!1,expects:null,requirement:Number.isInteger,message:t,"~run"(e,s){return e.typed&&!this.requirement(e.value)&&A(this,"integer",e,s),e}}}function w(t,e){return{kind:"validation",type:"min_length",reference:w,async:!1,expects:`>=${t}`,requirement:t,message:e,"~run"(s,n){return s.typed&&s.value.length<this.requirement&&A(this,"length",s,n,{received:`${s.value.length}`}),s}}}function Sn(t,e){return{kind:"validation",type:"min_value",reference:Sn,async:!1,expects:`>=${t instanceof Date?t.toJSON():Re(t)}`,requirement:t,message:e,"~run"(s,n){return s.typed&&!(s.value>=this.requirement)&&A(this,"value",s,n,{received:s.value instanceof Date?s.value.toJSON():Re(s.value)}),s}}}function ie(t,e){return{kind:"validation",type:"regex",reference:ie,async:!1,expects:`${t}`,requirement:t,message:e,"~run"(s,n){return s.typed&&!this.requirement.test(s.value)&&A(this,"format",s,n),s}}}function jt(){return{kind:"transformation",type:"trim",reference:jt,async:!1,"~run"(t){return t.value=t.value.trim(),t}}}function An(t){return{kind:"validation",type:"url",reference:An,async:!1,expects:null,requirement(e){try{return URL.canParse?URL.canParse(e):(new URL(e),!0)}catch{return!1}},message:t,"~run"(e,s){return e.typed&&!this.requirement(e.value)&&A(this,"URL",e,s),e}}}const Tn={abortEarly:!0};function Cn(t,e,s){return typeof t.fallback=="function"?t.fallback(e,s):t.fallback}function et(t,e,s){return typeof t.default=="function"?t.default(e,s):t.default}function Ha(t,e){return!t["~run"]({value:e},Tn).issues}function W(t,e){return _({kind:"schema",type:"array",reference:W,expects:"Array",async:!1,item:t,message:e,"~run"(s,n){const r=s.value;if(Array.isArray(r)){s.typed=!0,s.value=[];for(let i=0;i<r.length;i++){const a=r[i],o=this.item["~run"]({value:a},n);if(o.issues){const l={type:"array",origin:"value",input:r,key:i,value:a};for(const c of o.issues)c.path?c.path.unshift(l):c.path=[l],s.issues?.push(c);if(s.issues||(s.issues=o.issues),n.abortEarly){s.typed=!1;break}}o.typed||(s.typed=!1),s.value.push(o.value)}}else A(this,"type",s,n);return s}})}function En(t){return _({kind:"schema",type:"boolean",reference:En,expects:"boolean",async:!1,message:t,"~run"(e,s){return typeof e.value=="boolean"?e.typed=!0:A(this,"type",e,s),e}})}function P(t,e){return _({kind:"schema",type:"exact_optional",reference:P,expects:t.expects,async:!1,wrapped:t,default:e,"~run"(s,n){return this.wrapped["~run"](s,n)}})}function _n(t){return _({kind:"schema",type:"lazy",reference:_n,expects:"unknown",async:!1,getter:t,"~run"(e,s){return this.getter(e.value)["~run"](e,s)}})}function ue(t,e){return _({kind:"schema",type:"literal",reference:ue,expects:Re(t),async:!1,literal:t,message:e,"~run"(s,n){return Da(s.value,this.literal)?s.typed=!0:A(this,"type",s,n),s}})}function Rn(t,e){return _({kind:"schema",type:"nullable",reference:Rn,expects:`(${t.expects} | null)`,async:!1,wrapped:t,default:e,"~run"(s,n){return s.value===null&&(this.default!==void 0&&(s.value=et(this,s,n)),s.value===null)?(s.typed=!0,s):this.wrapped["~run"](s,n)}})}function Ln(t){return _({kind:"schema",type:"number",reference:Ln,expects:"number",async:!1,message:t,"~run"(e,s){return typeof e.value=="number"&&!isNaN(e.value)?e.typed=!0:A(this,"type",e,s),e}})}function C(t,e){return _({kind:"schema",type:"object",reference:C,expects:"Object",async:!1,entries:t,message:e,"~run"(s,n){const r=s.value;if(r&&typeof r=="object"){s.typed=!0,s.value={};for(const i in this.entries){const a=this.entries[i];if(i in r||(a.type==="exact_optional"||a.type==="optional"||a.type==="nullish")&&a.default!==void 0){const o=i in r?r[i]:et(a),l=a["~run"]({value:o},n);if(l.issues){const c={type:"object",origin:"value",input:r,key:i,value:o};for(const p of l.issues)p.path?p.path.unshift(c):p.path=[c],s.issues?.push(p);if(s.issues||(s.issues=l.issues),n.abortEarly){s.typed=!1;break}}l.typed||(s.typed=!1),s.value[i]=l.value}else if(a.fallback!==void 0)s.value[i]=Cn(a);else if(a.type!=="exact_optional"&&a.type!=="optional"&&a.type!=="nullish"&&(A(this,"key",s,n,{input:void 0,expected:`"${i}"`,path:[{type:"object",origin:"key",input:r,key:i,value:r[i]}]}),n.abortEarly))break}}else A(this,"type",s,n);return s}})}function Le(t,e){return _({kind:"schema",type:"optional",reference:Le,expects:`(${t.expects} | undefined)`,async:!1,wrapped:t,default:e,"~run"(s,n){return s.value===void 0&&(this.default!==void 0&&(s.value=et(this,s,n)),s.value===void 0)?(s.typed=!0,s):this.wrapped["~run"](s,n)}})}function tt(t,e){return _({kind:"schema",type:"picklist",reference:tt,expects:Mt(t.map(Re),"|"),async:!1,options:t,message:e,"~run"(s,n){return this.options.includes(s.value)?s.typed=!0:A(this,"type",s,n),s}})}function st(t,e,s){return _({kind:"schema",type:"record",reference:st,expects:"Object",async:!1,key:t,value:e,message:s,"~run"(n,r){const i=n.value;if(i&&typeof i=="object"){n.typed=!0,n.value={};for(const a in i)if(Ua(i,a)){const o=i[a],l=this.key["~run"]({value:a},r);if(l.issues){const p={type:"object",origin:"key",input:i,key:a,value:o};for(const d of l.issues)d.path=[p],n.issues?.push(d);if(n.issues||(n.issues=l.issues),r.abortEarly){n.typed=!1;break}}const c=this.value["~run"]({value:o},r);if(c.issues){const p={type:"object",origin:"value",input:i,key:a,value:o};for(const d of c.issues)d.path?d.path.unshift(p):d.path=[p],n.issues?.push(d);if(n.issues||(n.issues=c.issues),r.abortEarly){n.typed=!1;break}}(!l.typed||!c.typed)&&(n.typed=!1),l.typed&&(n.value[l.value]=c.value)}}else A(this,"type",n,r);return n}})}function fe(t,e){return _({kind:"schema",type:"strict_object",reference:fe,expects:"Object",async:!1,entries:t,message:e,"~run"(s,n){const r=s.value;if(r&&typeof r=="object"){s.typed=!0,s.value={};for(const i in this.entries){const a=this.entries[i];if(i in r||(a.type==="exact_optional"||a.type==="optional"||a.type==="nullish")&&a.default!==void 0){const o=i in r?r[i]:et(a),l=a["~run"]({value:o},n);if(l.issues){const c={type:"object",origin:"value",input:r,key:i,value:o};for(const p of l.issues)p.path?p.path.unshift(c):p.path=[c],s.issues?.push(p);if(s.issues||(s.issues=l.issues),n.abortEarly){s.typed=!1;break}}l.typed||(s.typed=!1),s.value[i]=l.value}else if(a.fallback!==void 0)s.value[i]=Cn(a);else if(a.type!=="exact_optional"&&a.type!=="optional"&&a.type!=="nullish"&&(A(this,"key",s,n,{input:void 0,expected:`"${i}"`,path:[{type:"object",origin:"key",input:r,key:i,value:r[i]}]}),n.abortEarly))break}if(!s.issues||!n.abortEarly){for(const i in r)if(!Object.prototype.hasOwnProperty.call(this.entries,i)){A(this,"key",s,n,{input:i,expected:"never",path:[{type:"object",origin:"key",input:r,key:i,value:r[i]}]});break}}}else A(this,"type",s,n);return s}})}function m(t){return _({kind:"schema",type:"string",reference:m,expects:"string",async:!1,message:t,"~run"(e,s){return typeof e.value=="string"?e.typed=!0:A(this,"type",e,s),e}})}function Pn(t){let e;if(t)for(const s of t)if(e)for(const n of s.issues)e.push(n);else e=s.issues;return e}function It(t,e){return _({kind:"schema",type:"union",reference:It,expects:Mt(t.map(s=>s.expects),"|"),async:!1,options:t,message:e,"~run"(s,n){let r,i,a;for(const o of this.options){const l=o["~run"]({value:s.value},n);if(l.typed)if(l.issues)i?i.push(l):i=[l];else{r=l;break}else a?a.push(l):a=[l]}if(r)return r;if(i){if(i.length===1)return i[0];A(this,"type",s,n,{issues:Pn(i)}),s.typed=!0}else{if(a?.length===1)return a[0];A(this,"type",s,n,{issues:Pn(a)})}return s}})}function V(){return _({kind:"schema",type:"unknown",reference:V,expects:"unknown",async:!1,"~run"(t){return t.typed=!0,t}})}function zn(t,e,s){return _({kind:"schema",type:"variant",reference:zn,expects:"Object",async:!1,key:t,options:e,message:s,"~run"(n,r){const i=n.value;if(i&&typeof i=="object"){let a,o=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,y=0;for(const x of h){const R=u.entries[x];if(x in i?R["~run"]({typed:!1,value:i[x]},Tn).issues:R.type!=="exact_optional"&&R.type!=="optional"&&R.type!=="nullish"){f=!1,l!==x&&(o<y||o===y&&x in i&&!(l in i))&&(o=y,l=x,c=[]),l===x&&c.push(u.entries[x].expects);break}y++}if(f){const x=u["~run"]({value:i},r);(!a||!a.typed&&x.typed)&&(a=x)}}if(a&&!a.issues)break}};if(p(this,new Set([this.key])),a)return a;A(this,"type",n,r,{input:i[l],expected:Mt(c,"|"),path:[{type:"object",origin:"value",input:i,key:l,value:i[l]}]})}else A(this,"type",n,r);return n}})}function qt(t,e,s){const n=t["~run"]({value:e},Ot());if(n.issues)throw new Ba(n.issues);return n.value}function v(...t){return _({...t[0],pipe:t,"~run"(e,s){for(const n of t)if(n.kind!=="metadata"){if(e.issues&&(n.kind==="schema"||n.kind==="transformation")){e.typed=!1;break}(!e.issues||!s.abortEarly&&!s.abortPipeEarly)&&(e=n["~run"](e,s))}return e}})}function S(t,e,s){const n=t["~run"]({value:e},Ot());return{typed:n.typed,success:!n.issues,output:n.value,issues:n.issues}}const nt=C({type:v(m(),w(1)),id:v(m(),w(1))}),Fa=v(m(),w(1),ie(/^[A-Za-z0-9_-]+$/,'ids may only contain letters, digits, "_" and "-" (a "." builds a path)')),Ka=(t,e)=>{if(e===1)return t.includes(".")?null:[t];const s=t.split(".");return s.length===e&&s.every(n=>n.length>0)?s:null},ae=C({id:v(m(),w(1)),type:v(m(),w(1)),target:nt,payload:V(),note:P(m()),createdAt:v(m(),w(1))}),Za=(t,e,s,n={})=>{const r=C({id:v(m(),w(1)),type:ue(t),target:nt,payload:s,note:P(m()),createdAt:v(m(),w(1))}),i=a=>{const o=S(ae,a);if(!o.success||o.output.type!==t)return null;const l=S(s,a.payload);return l.success?{id:o.output.id,type:t,target:o.output.target,payload:l.output,...o.output.note===void 0?{}:{note:o.output.note},createdAt:o.output.createdAt}:null};return{schema:r,mode:n.mode??"patch",targetType:e,actionType:t,payloadSchema:s,parse:i,...n.dedupeKey?{dedupeKey:n.dedupeKey}:{}}},Wa=(t,e)=>{const s=rt(t,e.type);if(s===void 0)return null;const n=s.parse(e);return n===null?null:n},Va=(t,e)=>{const s=S(t.payloadSchema,e.payload);if(!s.success)throw new Error(`invalid payload for action "${e.type}"`);return s.output},rt=(t,e)=>Object.hasOwn(t,e)?t[e]:void 0,Ga=t=>{throw new Error(`unhandled action: ${JSON.stringify(t)}`)},Ja=C({id:v(m(),w(1))}),Ya=t=>{const e=S(Ja,t.payload);return`${t.type}|${e.success?e.output.id:JSON.stringify(t.payload)}`},M=t=>`${t.type}:${t.id}`,On=t=>{const e=t.indexOf(":");return e<=0?{type:"unknown",id:t}:{type:t.slice(0,e),id:t.slice(e+1)}},Nt=(t,e)=>typeof t=="string"?On(t.includes(":")?t:`${e}:${t}`):{type:t.type,id:t.id},Qa=(t,e)=>t.type===e.type&&t.id===e.id,Mn=t=>{const e=t.normalize("NFKD").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"").slice(0,40);return e.length>0?e:"item"},Xa=(t,e)=>{const s=Mn(t),n=new Set(e);if(!n.has(s))return s;for(let r=2;r<1e3;r+=1){const i=`${s}-${r}`;if(!n.has(i))return i}return`${s}-${Math.random().toString(36).slice(2,8)}`},jn=()=>{const t=globalThis.crypto;return t?.randomUUID?t.randomUUID():`a-${Date.now().toString(36)}-${Math.random().toString(36).slice(2,10)}`},z="comment",oe=t=>{const[e]=t;return{path:e?.path?.map(s=>String(s.key)).join(".")??"",message:e?.message??"invalid action"}},In=C({type:v(m(),w(1)),target:It([v(m(),w(1)),nt]),payload:Le(V()),note:P(m()),id:P(v(m(),w(1))),createdAt:P(v(m(),w(1)))}),eo=(t,e)=>{const s=S(In,t);if(!s.success)return{ok:!1,issue:oe(s.issues)};const n=s.output,r=Nt(n.target,e.targetType),i={id:n.id??jn(),type:n.type,target:r,payload:n.payload??{},...n.note===void 0?{}:{note:n.note},createdAt:n.createdAt??new Date().toISOString()},a=S(e.schema,i);if(!a.success)return{ok:!1,issue:oe(a.issues)};const o=S(ae,a.output);return o.success?{ok:!0,action:o.output}:{ok:!1,issue:oe(o.issues)}},Dt=(t,e)=>e.dedupeKey?e.dedupeKey(t):e.mode!=="patch"?null:`${t.type}|${M(t.target)}`,Ut=(t,e,s)=>{const n=Dt(e,s);if(n===null)return[...t,e];const r=t.at(-1);return!r||Dt(r,s)!==n||!to(r,e)?[...t,e]:[...t.slice(0,-1),e]},to=(t,e)=>Qa(t.target,e.target),Bt=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),qn=C({id:v(m(),w(1)),type:ue(z),target:C({type:v(m(),w(1)),id:v(m(),w(1))}),payload:C({body:v(m(),w(1))}),note:P(m()),createdAt:v(m(),w(1))}),Ht={schema:qn,mode:"append",targetType:"page"},so=C({body:m()}),Pe=t=>{const e=S(so,t.payload);return e.success?e.output.body:""},Ft="element",Nn=v(m(),ie(/^[A-Z][A-Z0-9_]*$/,"component action types are CONSTANT_CASE")),Dn=st(m(),V()),no=C({type:ue(Ft),id:v(m(),ie(/^[^/]+\/.+/,"component references start with a provider id"))}),ro=C({id:v(m(),w(1)),type:Nn,target:no,payload:Dn,note:P(m()),createdAt:v(m(),w(1))}),io={schema:ro,mode:"sequence",targetType:Ft},ao=fe({type:Nn,target:v(m(),ie(/^element:[^/]+\/.+/)),payload:Le(Dn,{})}),Un=fe({id:v(m(),w(1)),title:v(m(),w(1)),summary:P(m()),tone:P(tt(["create","update","delete","move","meta"])),stale:P(tt(["unsupported-action-type","target-missing","constraint-violated"]))}),Kt=t=>{if(t.type!==Ft)return null;const e=t.id.indexOf("/");if(e<=0)return null;try{return decodeURIComponent(t.id.slice(0,e))}catch{return null}},q=t=>t.type!==z&&Kt(t.target)!==null,oo=(t,e)=>t.filter(s=>q(s)&&Kt(s.target)===e),Bn=(t,e)=>{const s=new Map(t.flatMap(n=>q(n)?[[n.id,Kt(n.target)]]:[]));return new Map(e.flatMap(n=>n.results.flatMap(r=>s.get(r.id)===n.id?[[r.id,r]]:[])))},Zt=Object.freeze({}),Wt=t=>{const e=t.startsWith("#")?t.slice(1):t;if(e.length===0)return Zt;const s=new URLSearchParams(e.startsWith("?")?e.slice(1):e),n={};for(const[r,i]of s)r.length>0&&i.length>0&&(n[r]=i);return n},ge=t=>{const e=new URLSearchParams;for(const n of Object.keys(t).sort((r,i)=>r<i?-1:r>i?1:0)){const r=t[n];r!=null&&r!==""&&e.set(n,r)}const s=e.toString();return s.length===0?"":`#${s}`},Vt=(t,e,s=[])=>{const n={...t},r=Object.keys(e).map(i=>s.indexOf(i)).filter(i=>i>=0);if(r.length>0)for(const i of s.slice(Math.min(...r)+1))Object.hasOwn(e,i)||delete n[i];for(const[i,a]of Object.entries(e))a==null||a===""?delete n[i]:n[i]=a;return n},lo=(t,e="json")=>`\`\`\`${e}
|
|
728
|
+
@keydown=${this.#l}
|
|
729
|
+
@blur=${this.#o}
|
|
730
|
+
/>`}#s=e=>{e.composedPath().some(s=>s instanceof HTMLAnchorElement)||(e.stopPropagation(),!this.editing&&(this.#e=this.value,this.editing=!0))};#t=e=>{e.isComposing||this.editing||e.target instanceof HTMLAnchorElement||(e.key==="Enter"||e.key===" ")&&(e.preventDefault(),this.editing=!0)};#a=e=>{const s=de(e.target,HTMLInputElement)??de(e.target,HTMLTextAreaElement);s!==null&&(this.#e=s.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.#d())}};#o=e=>{const s=e.currentTarget;if(!(s instanceof HTMLInputElement||s instanceof HTMLTextAreaElement))return;const n=this.#r,{selectionStart:r,selectionEnd:i}=s;queueMicrotask(()=>{!this.isConnected||!this.editing||(n!==this.#r?(s.focus(),s.setSelectionRange(r,i)):this.#d())})};#d=()=>{if(!this.editing)return;this.editing=!1;const s=(this.wrap?this.#e.replace(/\r?\n/g," "):this.#e).trim();s!==this.value&&this.dispatchEvent(new CustomEvent("dpk-commit",{detail:{value:s},bubbles:!0,composed:!0}))}}const za=()=>{customElements.get("dpk-component-inline-edit")||customElements.define("dpk-component-inline-edit",vn)},Pa={lang:void 0,message:void 0,abortEarly:void 0,abortPipeEarly:void 0};function Ot(t){return Pa}let Oa;function Ma(t){return Oa?.get(t)}let ja;function Ia(t){return ja?.get(t)}let qa;function Na(t,e){return qa?.get(t)?.get(e)}function Re(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 A(t,e,s,n,r){const i=r&&"input"in r?r.input:s.value,a=r?.expected??t.expects??null,o=r?.received??Re(i),l={kind:t.kind,type:t.type,input:i,expected:a,received:o,message:`Invalid ${e}: ${a?`Expected ${a} but r`:"R"}eceived ${o}`,requirement:t.requirement,path:r?.path,issues:r?.issues,lang:n.lang,abortEarly:n.abortEarly,abortPipeEarly:n.abortPipeEarly},c=t.kind==="schema",p=r?.message??t.message??Na(t.reference,l.lang)??(c?Ia(l.lang):null)??n.message??Ma(l.lang);p!==void 0&&(l.message=typeof p=="function"?p(l):p),c&&(s.typed=!1),s.issues?s.issues.push(l):s.issues=[l]}function Da(t,e){return t===e||Number.isNaN(t)&&Number.isNaN(e)}function Ua(t,e){return Object.prototype.hasOwnProperty.call(t,e)&&e!=="__proto__"&&e!=="prototype"&&e!=="constructor"}function Mt(t,e){const s=[...new Set(t)];return s.length>1?`(${s.join(` ${e} `)})`:s[0]??"never"}function _(t){return t["~standard"]={version:1,vendor:"valibot",validate:e=>t["~run"]({value:e},Ot())},t}var Ba=class extends Error{constructor(t){super(t[0].message),this.name="ValiError",this.issues=t}};function yn(t,e){return{kind:"validation",type:"check",reference:yn,async:!1,expects:null,requirement:t,message:e,"~run"(s,n){return s.typed&&!this.requirement(s.value)&&A(this,"input",s,n),s}}}function wn(t){return{kind:"validation",type:"finite",reference:wn,async:!1,expects:null,requirement:Number.isFinite,message:t,"~run"(e,s){return e.typed&&!this.requirement(e.value)&&A(this,"finite",e,s),e}}}function $n(t){return{kind:"validation",type:"integer",reference:$n,async:!1,expects:null,requirement:Number.isInteger,message:t,"~run"(e,s){return e.typed&&!this.requirement(e.value)&&A(this,"integer",e,s),e}}}function w(t,e){return{kind:"validation",type:"min_length",reference:w,async:!1,expects:`>=${t}`,requirement:t,message:e,"~run"(s,n){return s.typed&&s.value.length<this.requirement&&A(this,"length",s,n,{received:`${s.value.length}`}),s}}}function Sn(t,e){return{kind:"validation",type:"min_value",reference:Sn,async:!1,expects:`>=${t instanceof Date?t.toJSON():Re(t)}`,requirement:t,message:e,"~run"(s,n){return s.typed&&!(s.value>=this.requirement)&&A(this,"value",s,n,{received:s.value instanceof Date?s.value.toJSON():Re(s.value)}),s}}}function ie(t,e){return{kind:"validation",type:"regex",reference:ie,async:!1,expects:`${t}`,requirement:t,message:e,"~run"(s,n){return s.typed&&!this.requirement.test(s.value)&&A(this,"format",s,n),s}}}function jt(){return{kind:"transformation",type:"trim",reference:jt,async:!1,"~run"(t){return t.value=t.value.trim(),t}}}function An(t){return{kind:"validation",type:"url",reference:An,async:!1,expects:null,requirement(e){try{return URL.canParse?URL.canParse(e):(new URL(e),!0)}catch{return!1}},message:t,"~run"(e,s){return e.typed&&!this.requirement(e.value)&&A(this,"URL",e,s),e}}}const Cn={abortEarly:!0};function Tn(t,e,s){return typeof t.fallback=="function"?t.fallback(e,s):t.fallback}function et(t,e,s){return typeof t.default=="function"?t.default(e,s):t.default}function Ha(t,e){return!t["~run"]({value:e},Cn).issues}function Z(t,e){return _({kind:"schema",type:"array",reference:Z,expects:"Array",async:!1,item:t,message:e,"~run"(s,n){const r=s.value;if(Array.isArray(r)){s.typed=!0,s.value=[];for(let i=0;i<r.length;i++){const a=r[i],o=this.item["~run"]({value:a},n);if(o.issues){const l={type:"array",origin:"value",input:r,key:i,value:a};for(const c of o.issues)c.path?c.path.unshift(l):c.path=[l],s.issues?.push(c);if(s.issues||(s.issues=o.issues),n.abortEarly){s.typed=!1;break}}o.typed||(s.typed=!1),s.value.push(o.value)}}else A(this,"type",s,n);return s}})}function En(t){return _({kind:"schema",type:"boolean",reference:En,expects:"boolean",async:!1,message:t,"~run"(e,s){return typeof e.value=="boolean"?e.typed=!0:A(this,"type",e,s),e}})}function P(t,e){return _({kind:"schema",type:"exact_optional",reference:P,expects:t.expects,async:!1,wrapped:t,default:e,"~run"(s,n){return this.wrapped["~run"](s,n)}})}function _n(t){return _({kind:"schema",type:"lazy",reference:_n,expects:"unknown",async:!1,getter:t,"~run"(e,s){return this.getter(e.value)["~run"](e,s)}})}function ue(t,e){return _({kind:"schema",type:"literal",reference:ue,expects:Re(t),async:!1,literal:t,message:e,"~run"(s,n){return Da(s.value,this.literal)?s.typed=!0:A(this,"type",s,n),s}})}function Rn(t,e){return _({kind:"schema",type:"nullable",reference:Rn,expects:`(${t.expects} | null)`,async:!1,wrapped:t,default:e,"~run"(s,n){return s.value===null&&(this.default!==void 0&&(s.value=et(this,s,n)),s.value===null)?(s.typed=!0,s):this.wrapped["~run"](s,n)}})}function Ln(t){return _({kind:"schema",type:"number",reference:Ln,expects:"number",async:!1,message:t,"~run"(e,s){return typeof e.value=="number"&&!isNaN(e.value)?e.typed=!0:A(this,"type",e,s),e}})}function T(t,e){return _({kind:"schema",type:"object",reference:T,expects:"Object",async:!1,entries:t,message:e,"~run"(s,n){const r=s.value;if(r&&typeof r=="object"){s.typed=!0,s.value={};for(const i in this.entries){const a=this.entries[i];if(i in r||(a.type==="exact_optional"||a.type==="optional"||a.type==="nullish")&&a.default!==void 0){const o=i in r?r[i]:et(a),l=a["~run"]({value:o},n);if(l.issues){const c={type:"object",origin:"value",input:r,key:i,value:o};for(const p of l.issues)p.path?p.path.unshift(c):p.path=[c],s.issues?.push(p);if(s.issues||(s.issues=l.issues),n.abortEarly){s.typed=!1;break}}l.typed||(s.typed=!1),s.value[i]=l.value}else if(a.fallback!==void 0)s.value[i]=Tn(a);else if(a.type!=="exact_optional"&&a.type!=="optional"&&a.type!=="nullish"&&(A(this,"key",s,n,{input:void 0,expected:`"${i}"`,path:[{type:"object",origin:"key",input:r,key:i,value:r[i]}]}),n.abortEarly))break}}else A(this,"type",s,n);return s}})}function Le(t,e){return _({kind:"schema",type:"optional",reference:Le,expects:`(${t.expects} | undefined)`,async:!1,wrapped:t,default:e,"~run"(s,n){return s.value===void 0&&(this.default!==void 0&&(s.value=et(this,s,n)),s.value===void 0)?(s.typed=!0,s):this.wrapped["~run"](s,n)}})}function tt(t,e){return _({kind:"schema",type:"picklist",reference:tt,expects:Mt(t.map(Re),"|"),async:!1,options:t,message:e,"~run"(s,n){return this.options.includes(s.value)?s.typed=!0:A(this,"type",s,n),s}})}function st(t,e,s){return _({kind:"schema",type:"record",reference:st,expects:"Object",async:!1,key:t,value:e,message:s,"~run"(n,r){const i=n.value;if(i&&typeof i=="object"){n.typed=!0,n.value={};for(const a in i)if(Ua(i,a)){const o=i[a],l=this.key["~run"]({value:a},r);if(l.issues){const p={type:"object",origin:"key",input:i,key:a,value:o};for(const d of l.issues)d.path=[p],n.issues?.push(d);if(n.issues||(n.issues=l.issues),r.abortEarly){n.typed=!1;break}}const c=this.value["~run"]({value:o},r);if(c.issues){const p={type:"object",origin:"value",input:i,key:a,value:o};for(const d of c.issues)d.path?d.path.unshift(p):d.path=[p],n.issues?.push(d);if(n.issues||(n.issues=c.issues),r.abortEarly){n.typed=!1;break}}(!l.typed||!c.typed)&&(n.typed=!1),l.typed&&(n.value[l.value]=c.value)}}else A(this,"type",n,r);return n}})}function fe(t,e){return _({kind:"schema",type:"strict_object",reference:fe,expects:"Object",async:!1,entries:t,message:e,"~run"(s,n){const r=s.value;if(r&&typeof r=="object"){s.typed=!0,s.value={};for(const i in this.entries){const a=this.entries[i];if(i in r||(a.type==="exact_optional"||a.type==="optional"||a.type==="nullish")&&a.default!==void 0){const o=i in r?r[i]:et(a),l=a["~run"]({value:o},n);if(l.issues){const c={type:"object",origin:"value",input:r,key:i,value:o};for(const p of l.issues)p.path?p.path.unshift(c):p.path=[c],s.issues?.push(p);if(s.issues||(s.issues=l.issues),n.abortEarly){s.typed=!1;break}}l.typed||(s.typed=!1),s.value[i]=l.value}else if(a.fallback!==void 0)s.value[i]=Tn(a);else if(a.type!=="exact_optional"&&a.type!=="optional"&&a.type!=="nullish"&&(A(this,"key",s,n,{input:void 0,expected:`"${i}"`,path:[{type:"object",origin:"key",input:r,key:i,value:r[i]}]}),n.abortEarly))break}if(!s.issues||!n.abortEarly){for(const i in r)if(!Object.prototype.hasOwnProperty.call(this.entries,i)){A(this,"key",s,n,{input:i,expected:"never",path:[{type:"object",origin:"key",input:r,key:i,value:r[i]}]});break}}}else A(this,"type",s,n);return s}})}function m(t){return _({kind:"schema",type:"string",reference:m,expects:"string",async:!1,message:t,"~run"(e,s){return typeof e.value=="string"?e.typed=!0:A(this,"type",e,s),e}})}function zn(t){let e;if(t)for(const s of t)if(e)for(const n of s.issues)e.push(n);else e=s.issues;return e}function It(t,e){return _({kind:"schema",type:"union",reference:It,expects:Mt(t.map(s=>s.expects),"|"),async:!1,options:t,message:e,"~run"(s,n){let r,i,a;for(const o of this.options){const l=o["~run"]({value:s.value},n);if(l.typed)if(l.issues)i?i.push(l):i=[l];else{r=l;break}else a?a.push(l):a=[l]}if(r)return r;if(i){if(i.length===1)return i[0];A(this,"type",s,n,{issues:zn(i)}),s.typed=!0}else{if(a?.length===1)return a[0];A(this,"type",s,n,{issues:zn(a)})}return s}})}function V(){return _({kind:"schema",type:"unknown",reference:V,expects:"unknown",async:!1,"~run"(t){return t.typed=!0,t}})}function Pn(t,e,s){return _({kind:"schema",type:"variant",reference:Pn,expects:"Object",async:!1,key:t,options:e,message:s,"~run"(n,r){const i=n.value;if(i&&typeof i=="object"){let a,o=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,y=0;for(const x of h){const R=u.entries[x];if(x in i?R["~run"]({typed:!1,value:i[x]},Cn).issues:R.type!=="exact_optional"&&R.type!=="optional"&&R.type!=="nullish"){f=!1,l!==x&&(o<y||o===y&&x in i&&!(l in i))&&(o=y,l=x,c=[]),l===x&&c.push(u.entries[x].expects);break}y++}if(f){const x=u["~run"]({value:i},r);(!a||!a.typed&&x.typed)&&(a=x)}}if(a&&!a.issues)break}};if(p(this,new Set([this.key])),a)return a;A(this,"type",n,r,{input:i[l],expected:Mt(c,"|"),path:[{type:"object",origin:"value",input:i,key:l,value:i[l]}]})}else A(this,"type",n,r);return n}})}function qt(t,e,s){const n=t["~run"]({value:e},Ot());if(n.issues)throw new Ba(n.issues);return n.value}function v(...t){return _({...t[0],pipe:t,"~run"(e,s){for(const n of t)if(n.kind!=="metadata"){if(e.issues&&(n.kind==="schema"||n.kind==="transformation")){e.typed=!1;break}(!e.issues||!s.abortEarly&&!s.abortPipeEarly)&&(e=n["~run"](e,s))}return e}})}function S(t,e,s){const n=t["~run"]({value:e},Ot());return{typed:n.typed,success:!n.issues,output:n.value,issues:n.issues}}const nt=T({type:v(m(),w(1)),id:v(m(),w(1))}),Fa=v(m(),w(1),ie(/^[A-Za-z0-9_-]+$/,'ids may only contain letters, digits, "_" and "-" (a "." builds a path)')),Ka=(t,e)=>{if(e===1)return t.includes(".")?null:[t];const s=t.split(".");return s.length===e&&s.every(n=>n.length>0)?s:null},ae=T({id:v(m(),w(1)),type:v(m(),w(1)),target:nt,payload:V(),note:P(m()),createdAt:v(m(),w(1))}),Wa=(t,e,s,n={})=>{const r=T({id:v(m(),w(1)),type:ue(t),target:nt,payload:s,note:P(m()),createdAt:v(m(),w(1))}),i=a=>{const o=S(ae,a);if(!o.success||o.output.type!==t)return null;const l=S(s,a.payload);return l.success?{id:o.output.id,type:t,target:o.output.target,payload:l.output,...o.output.note===void 0?{}:{note:o.output.note},createdAt:o.output.createdAt}:null};return{schema:r,mode:n.mode??"patch",targetType:e,actionType:t,payloadSchema:s,parse:i,...n.dedupeKey?{dedupeKey:n.dedupeKey}:{}}},Za=(t,e)=>{const s=rt(t,e.type);if(s===void 0)return null;const n=s.parse(e);return n===null?null:n},Va=(t,e)=>{const s=S(t.payloadSchema,e.payload);if(!s.success)throw new Error(`invalid payload for action "${e.type}"`);return s.output},rt=(t,e)=>Object.hasOwn(t,e)?t[e]:void 0,Ga=t=>{throw new Error(`unhandled action: ${JSON.stringify(t)}`)},Ja=T({id:v(m(),w(1))}),Ya=t=>{const e=S(Ja,t.payload);return`${t.type}|${e.success?e.output.id:JSON.stringify(t.payload)}`},M=t=>`${t.type}:${t.id}`,On=t=>{const e=t.indexOf(":");return e<=0?{type:"unknown",id:t}:{type:t.slice(0,e),id:t.slice(e+1)}},Nt=(t,e)=>typeof t=="string"?On(t.includes(":")?t:`${e}:${t}`):{type:t.type,id:t.id},Qa=(t,e)=>t.type===e.type&&t.id===e.id,Mn=t=>{const e=t.normalize("NFKD").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"").slice(0,40);return e.length>0?e:"item"},Xa=(t,e)=>{const s=Mn(t),n=new Set(e);if(!n.has(s))return s;for(let r=2;r<1e3;r+=1){const i=`${s}-${r}`;if(!n.has(i))return i}return`${s}-${Math.random().toString(36).slice(2,8)}`},jn=()=>{const t=globalThis.crypto;return t?.randomUUID?t.randomUUID():`a-${Date.now().toString(36)}-${Math.random().toString(36).slice(2,10)}`},L="comment",oe=t=>{const[e]=t;return{path:e?.path?.map(s=>String(s.key)).join(".")??"",message:e?.message??"invalid action"}},In=T({type:v(m(),w(1)),target:It([v(m(),w(1)),nt]),payload:Le(V()),note:P(m()),id:P(v(m(),w(1))),createdAt:P(v(m(),w(1)))}),eo=(t,e)=>{const s=S(In,t);if(!s.success)return{ok:!1,issue:oe(s.issues)};const n=s.output,r=Nt(n.target,e.targetType),i={id:n.id??jn(),type:n.type,target:r,payload:n.payload??{},...n.note===void 0?{}:{note:n.note},createdAt:n.createdAt??new Date().toISOString()},a=S(e.schema,i);if(!a.success)return{ok:!1,issue:oe(a.issues)};const o=S(ae,a.output);return o.success?{ok:!0,action:o.output}:{ok:!1,issue:oe(o.issues)}},Dt=(t,e)=>e.dedupeKey?e.dedupeKey(t):e.mode!=="patch"?null:`${t.type}|${M(t.target)}`,Ut=(t,e,s)=>{const n=Dt(e,s);if(n===null)return[...t,e];const r=t.at(-1);return!r||Dt(r,s)!==n||!to(r,e)?[...t,e]:[...t.slice(0,-1),e]},to=(t,e)=>Qa(t.target,e.target),Bt=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),qn=T({id:v(m(),w(1)),type:ue(L),target:T({type:v(m(),w(1)),id:v(m(),w(1))}),payload:T({body:v(m(),w(1))}),note:P(m()),createdAt:v(m(),w(1))}),Ht={schema:qn,mode:"append",targetType:"page"},so=T({body:m()}),ze=t=>{const e=S(so,t.payload);return e.success?e.output.body:""},Ft="element",Nn=v(m(),ie(/^[A-Z][A-Z0-9_]*$/,"component action types are CONSTANT_CASE")),Dn=st(m(),V()),no=T({type:ue(Ft),id:v(m(),ie(/^[^/]+\/.+/,"component references start with a provider id"))}),ro=T({id:v(m(),w(1)),type:Nn,target:no,payload:Dn,note:P(m()),createdAt:v(m(),w(1))}),io={schema:ro,mode:"sequence",targetType:Ft},ao=fe({type:Nn,target:v(m(),ie(/^element:[^/]+\/.+/)),payload:Le(Dn,{})}),Un=fe({id:v(m(),w(1)),title:v(m(),w(1)),summary:P(m()),tone:P(tt(["create","update","delete","move","meta"])),stale:P(tt(["unsupported-action-type","target-missing","constraint-violated"]))}),Kt=t=>{if(t.type!==Ft)return null;const e=t.id.indexOf("/");if(e<=0)return null;try{return decodeURIComponent(t.id.slice(0,e))}catch{return null}},q=t=>t.type!==L&&Kt(t.target)!==null,oo=(t,e)=>t.filter(s=>q(s)&&Kt(s.target)===e),Bn=(t,e)=>{const s=new Map(t.flatMap(n=>q(n)?[[n.id,Kt(n.target)]]:[]));return new Map(e.flatMap(n=>n.results.flatMap(r=>s.get(r.id)===n.id?[[r.id,r]]:[])))},Wt=Object.freeze({}),Zt=t=>{const e=t.startsWith("#")?t.slice(1):t;if(e.length===0)return Wt;const s=new URLSearchParams(e.startsWith("?")?e.slice(1):e),n={};for(const[r,i]of s)r.length>0&&i.length>0&&(n[r]=i);return n},ge=t=>{const e=new URLSearchParams;for(const n of Object.keys(t).sort((r,i)=>r<i?-1:r>i?1:0)){const r=t[n];r!=null&&r!==""&&e.set(n,r)}const s=e.toString();return s.length===0?"":`#${s}`},Vt=(t,e,s=[])=>{const n={...t},r=Object.keys(e).map(i=>s.indexOf(i)).filter(i=>i>=0);if(r.length>0)for(const i of s.slice(Math.min(...r)+1))Object.hasOwn(e,i)||delete n[i];for(const[i,a]of Object.entries(e))a==null||a===""?delete n[i]:n[i]=a;return n},lo=(t,e="json")=>`\`\`\`${e}
|
|
709
731
|
${t}
|
|
710
|
-
\`\`\``,co=t=>JSON.stringify({type:t.type,target:t.target,payload:t.payload,...t.note===void 0?{}:{note:t.note}},null,2),Gt=(t,e,s)=>{const{actions:n,state:r}=t,i=new Set(t.stale.map(p=>p.action.id)),a=n.filter(p=>!i.has(p.id)),o=a.filter(p=>p.type===
|
|
732
|
+
\`\`\``,co=t=>JSON.stringify({type:t.type,target:t.target,payload:t.payload,...t.note===void 0?{}:{note:t.note}},null,2),Gt=(t,e,s)=>{const{actions:n,state:r}=t,i=new Set(t.stale.map(p=>p.action.id)),a=n.filter(p=>!i.has(p.id)),o=a.filter(p=>p.type===L),l=a.filter(p=>p.type!==L),c=[];if(c.push(`# Review draft \u2014 ${e.label}`),c.push(""),c.push(`- template: \`${e.name}\``),c.push(`- framework: \`dev-process-kit@${s}\``),c.push(`- navigation: \`${ge(t.navigation)||"(none)"}\``),c.push(`- pending: ${l.length} change(s), ${o.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(q)&&(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(""),o.length>0){c.push(`## Comments (${o.length})`),c.push("");for(const[p,d]of o.entries()){const h=e.describe(d,r,t.base);c.push(`${p+1}. **${h.targetLabel}** \u2014 \`${M(d.target)}\``),c.push(` > ${ze(d).replace(/\n/g,`
|
|
711
733
|
> `)}`)}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,r,t.base),u=h.summary?` \u2014 ${h.summary}`:"";c.push(`${p+1}. **${h.title}**${u}`),c.push(` target: \`${M(d.target)}\` (${d.target.type})`),c.push(` \`\`\`json
|
|
712
734
|
${co(d).replace(/\n/g,`
|
|
713
735
|
`)}
|
|
714
|
-
\`\`\``)}c.push("")}if(l.length===0&&o.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,r,t.base),f=d.type===
|
|
715
|
-
`)},N="0.0.
|
|
736
|
+
\`\`\``)}c.push("")}if(l.length===0&&o.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,r,t.base),f=d.type===L?ze(d):u.title;c.push(`${p+1}. \`${d.type}\` on \`${M(d.target)}\` (${h}) \u2014 ${f}`)}c.push("")}return c.push("## Canonical draft (JSON)"),c.push(""),c.push(lo(Bt(n))),c.push(""),c.join(`
|
|
737
|
+
`)},N="0.0.13",Jt=async t=>{try{if(navigator.clipboard?.writeText)return await navigator.clipboard.writeText(t),!0}catch{}const e=document.activeElement,s=document.createElement("textarea");try{return s.value=t,s.setAttribute("readonly",""),s.style.position="fixed",s.style.opacity="0",document.body.append(s),s.select(),document.execCommand("copy")}catch{return!1}finally{s.remove(),e instanceof HTMLElement&&e.focus()}},Hn=Ze({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"}}),po=()=>({body:"",editing:null,attachment:{kind:"page"},copy:{kind:"idle"},copyRequest:0,send:{kind:"idle"},sendRequest:0}),Fn=t=>t.kind==="explicit"?{kind:t.resume}:t,Kn=(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:Fn(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:Fn(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}}}},ho=(t,e)=>{const s=t.body.trim();return s===""?null:{target:e,body:s}},uo=t=>{if(!t.editing)return null;const e=t.editing.body.trim();return e===""?null:{id:t.editing.id,body:e}},fo={en:"English",ja:"\u65E5\u672C\u8A9E"},D=Ze({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"},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"}}),go=4096,mo="reviews",Wn="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.",ko=t=>new TextEncoder().encode(t).length,bo=t=>t.replace(/[\u0000-\u0008\u000B-\u001F\u007F]/g,""),xo=t=>{const e=`${Wn}
|
|
716
738
|
|
|
717
|
-
${bo(t)}`;return ko(e)<=go?e:null},vo=t=>`${
|
|
739
|
+
${bo(t)}`;return ko(e)<=go?e:null},vo=t=>`${Wn}
|
|
718
740
|
|
|
719
|
-
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).`,yo={consent_required:"consent",forbidden:"forbidden",not_granted:"forbidden",capability_disabled:"forbidden",capability_removed:"forbidden",claude_unavailable:"claude_unavailable",rate_limited:"rate_limited"},wo=t=>{const e=typeof t=="object"&&t!==null&&"code"in t?t.code:void 0;return(typeof e=="string"?yo[e]:void 0)??"error"},$o={too_large:"handoffTooLarge",consent:"handoffConsent",forbidden:"handoffForbidden",claude_unavailable:"handoffClaudeUnavailable",rate_limited:"handoffRateLimited",storage:"handoffStorage",error:"handoffError"},Yt=(t,e)=>D(e)[$o[t]],
|
|
741
|
+
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).`,yo={consent_required:"consent",forbidden:"forbidden",not_granted:"forbidden",capability_disabled:"forbidden",capability_removed:"forbidden",claude_unavailable:"claude_unavailable",rate_limited:"rate_limited"},wo=t=>{const e=typeof t=="object"&&t!==null&&"code"in t?t.code:void 0;return(typeof e=="string"?yo[e]:void 0)??"error"},$o={too_large:"handoffTooLarge",consent:"handoffConsent",forbidden:"handoffForbidden",claude_unavailable:"handoffClaudeUnavailable",rate_limited:"handoffRateLimited",storage:"handoffStorage",error:"handoffError"},Yt=(t,e)=>D(e)[$o[t]],Zn=t=>t.group?`${t.group} \xB7 ${t.label}`:t.label,Vn=(t,e)=>{const{definition:s,state:n,navigation:r,derivation:i}=t,a=Hn(t.locale),o=s.currentTarget?.(n,r)??null,l=e.attachment,c=l.kind==="explicit"?s.commentTargets(n,r).find(h=>h.value===l.ref):null,p=l.kind==="explicit"?{ref:l.ref,label:c?Zn(c):l.ref}:l.kind==="current"&&o?{ref:o.value,label:Zn(o)}:{ref:`page:${s.name}`,label:a.wholePage},d=new Map(i.stale.map(h=>[h.action.id,h.reason]));return{body:e.body,target:p,attachment:l.kind==="explicit"?{kind:"explicit"}:o?{kind:"checkbox",checked:l.kind==="current",group:o.group??""}:{kind:"none"},canSubmit:e.body.trim().length>0,items:i.actions.map(h=>{const u=s.describe(h,n,i.base),f=h.type==="comment";return{id:h.id,title:f?a.comment:u.title,targetLabel:u.targetLabel,tone:f?"comment":u.tone,text:{kind:f?"comment":"summary",body:f?ze(h):u.summary??""},code:f?null:s.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":i.actions.length===0||e.send.kind==="pending"?"disabled":"ready",flash:e.send.kind==="sent"?a.sent:e.send.kind==="failed"?Yt(e.send.reason,t.locale):e.copy.kind==="copied"?a.copied:e.copy.kind==="failed"?a.copyFailed:""}},So=[Ve,St,B`
|
|
720
742
|
:host {
|
|
721
743
|
display: flex;
|
|
722
744
|
flex-direction: column;
|
|
723
745
|
min-height: 0;
|
|
746
|
+
min-width: 0;
|
|
724
747
|
width: 100%;
|
|
725
748
|
background: var(--dpk-paper-raised);
|
|
726
749
|
}
|
|
@@ -763,8 +786,10 @@ The brief is too long for a comment, so it is stored in this artifact's database
|
|
|
763
786
|
inset 0 1px 2px var(--dpk-shade-1);
|
|
764
787
|
}
|
|
765
788
|
|
|
789
|
+
/* Wraps on a narrow rail rather than pushing the add button out of it. */
|
|
766
790
|
.composer .row {
|
|
767
791
|
display: flex;
|
|
792
|
+
flex-wrap: wrap;
|
|
768
793
|
align-items: center;
|
|
769
794
|
gap: 8px;
|
|
770
795
|
}
|
|
@@ -821,7 +846,9 @@ The brief is too long for a comment, so it is stored in this artifact's database
|
|
|
821
846
|
}
|
|
822
847
|
|
|
823
848
|
.target-line {
|
|
849
|
+
min-width: 0;
|
|
824
850
|
margin-right: auto;
|
|
851
|
+
overflow-wrap: anywhere;
|
|
825
852
|
padding: 3px 9px;
|
|
826
853
|
border-radius: 999px;
|
|
827
854
|
background: var(--dpk-paper-inset);
|
|
@@ -834,11 +861,14 @@ The brief is too long for a comment, so it is stored in this artifact's database
|
|
|
834
861
|
.list {
|
|
835
862
|
list-style: none;
|
|
836
863
|
margin: 0;
|
|
837
|
-
|
|
864
|
+
/* The page's hand-off dock may float over the bottom of the list. */
|
|
865
|
+
padding: 10px 12px calc(10px + var(--dpk-dock-clearance, 0px));
|
|
838
866
|
overflow: auto;
|
|
839
867
|
flex: 1;
|
|
840
868
|
min-height: 0;
|
|
841
869
|
display: grid;
|
|
870
|
+
/* One unbroken comment must not widen the column every item shares. */
|
|
871
|
+
grid-template-columns: minmax(0, 1fr);
|
|
842
872
|
gap: 8px;
|
|
843
873
|
align-content: start;
|
|
844
874
|
}
|
|
@@ -846,6 +876,7 @@ The brief is too long for a comment, so it is stored in this artifact's database
|
|
|
846
876
|
.item {
|
|
847
877
|
position: relative;
|
|
848
878
|
display: grid;
|
|
879
|
+
grid-template-columns: minmax(0, 1fr);
|
|
849
880
|
gap: 5px;
|
|
850
881
|
padding: 10px 12px 11px 16px;
|
|
851
882
|
border: 1px solid var(--dpk-rule);
|
|
@@ -986,6 +1017,7 @@ The brief is too long for a comment, so it is stored in this artifact's database
|
|
|
986
1017
|
border-left: 2px solid var(--dpk-accent);
|
|
987
1018
|
font-size: 12.5px;
|
|
988
1019
|
white-space: pre-wrap;
|
|
1020
|
+
overflow-wrap: anywhere;
|
|
989
1021
|
}
|
|
990
1022
|
|
|
991
1023
|
.item-editor {
|
|
@@ -1095,7 +1127,7 @@ The brief is too long for a comment, so it is stored in this artifact's database
|
|
|
1095
1127
|
letter-spacing: 0.04em;
|
|
1096
1128
|
color: var(--dpk-green);
|
|
1097
1129
|
}
|
|
1098
|
-
`],Gn=(t,e,s)=>{const n=new Map;for(let r=e;r<=s;r++)n.set(t[r],r);return n},Jn=$e(class extends He{constructor(t){if(super(t),t.type!==K.CHILD)throw Error("repeat() can only be used in text expressions")}dt(t,e,s){let n;s===void 0?s=e:e!==void 0&&(n=e);const r=[],i=[];let a=0;for(const o of t)r[a]=n?n(o,a):a,i[a]=s(o,a),a++;return{values:i,keys:r}}render(t,e,s){return this.dt(t,e,s).values}update(t,[e,s,n]){const r=wi(t),{values:i,keys:a}=this.dt(e,s,n);if(!Array.isArray(r))return this.ut=a,i;const o=this.ut??=[],l=[];let c,p,d=0,h=r.length-1,u=0,f=i.length-1;for(;d<=h&&u<=f;)if(r[d]===null)d++;else if(r[h]===null)h--;else if(o[d]===a[u])l[u]=ee(r[d],i[u]),d++,u++;else if(o[h]===a[f])l[f]=ee(r[h],i[f]),h--,f--;else if(o[d]===a[f])l[f]=ee(r[d],i[f]),Se(t,l[f+1],r[d]),d++,f--;else if(o[h]===a[u])l[u]=ee(r[h],i[u]),Se(t,r[d],r[h]),h--,u++;else if(c===void 0&&(c=Gn(a,u,f),p=Gn(o,d,h)),c.has(o[d]))if(c.has(o[h])){const y=p.get(a[u]),x=y!==void 0?r[y]:null;if(x===null){const R=Se(t,r[d]);ee(R,i[u]),l[u]=R}else l[u]=ee(x,i[u]),Se(t,r[d],x),r[y]=null;u++}else xt(r[h]),h--;else xt(r[d]),d++;for(;u<=f;){const y=Se(t,l[f+1]);ee(y,i[u]),l[u++]=y}for(;d<=h;){const y=r[d++];y!==null&&xt(y)}return this.ut=a,bt(t,l),O}});class Qt extends Fe{}Qt.directiveName="unsafeSVG",Qt.resultType=2;const Ao=$e(Qt),Yn=[["path",{d:"M12 5v14"}],["path",{d:"m19 12-7 7-7-7"}]],Qn=[["path",{d:"m12 19-7-7 7-7"}],["path",{d:"M19 12H5"}]],Xn=[["path",{d:"M5 12h14"}],["path",{d:"m12 5 7 7-7 7"}]],er=[["path",{d:"m5 12 7-7 7 7"}],["path",{d:"M12 19V5"}]],
|
|
1130
|
+
`],Gn=(t,e,s)=>{const n=new Map;for(let r=e;r<=s;r++)n.set(t[r],r);return n},Jn=$e(class extends He{constructor(t){if(super(t),t.type!==K.CHILD)throw Error("repeat() can only be used in text expressions")}dt(t,e,s){let n;s===void 0?s=e:e!==void 0&&(n=e);const r=[],i=[];let a=0;for(const o of t)r[a]=n?n(o,a):a,i[a]=s(o,a),a++;return{values:i,keys:r}}render(t,e,s){return this.dt(t,e,s).values}update(t,[e,s,n]){const r=wi(t),{values:i,keys:a}=this.dt(e,s,n);if(!Array.isArray(r))return this.ut=a,i;const o=this.ut??=[],l=[];let c,p,d=0,h=r.length-1,u=0,f=i.length-1;for(;d<=h&&u<=f;)if(r[d]===null)d++;else if(r[h]===null)h--;else if(o[d]===a[u])l[u]=ee(r[d],i[u]),d++,u++;else if(o[h]===a[f])l[f]=ee(r[h],i[f]),h--,f--;else if(o[d]===a[f])l[f]=ee(r[d],i[f]),Se(t,l[f+1],r[d]),d++,f--;else if(o[h]===a[u])l[u]=ee(r[h],i[u]),Se(t,r[d],r[h]),h--,u++;else if(c===void 0&&(c=Gn(a,u,f),p=Gn(o,d,h)),c.has(o[d]))if(c.has(o[h])){const y=p.get(a[u]),x=y!==void 0?r[y]:null;if(x===null){const R=Se(t,r[d]);ee(R,i[u]),l[u]=R}else l[u]=ee(x,i[u]),Se(t,r[d],x),r[y]=null;u++}else xt(r[h]),h--;else xt(r[d]),d++;for(;u<=f;){const y=Se(t,l[f+1]);ee(y,i[u]),l[u++]=y}for(;d<=h;){const y=r[d++];y!==null&&xt(y)}return this.ut=a,bt(t,l),O}});class Qt extends Fe{}Qt.directiveName="unsafeSVG",Qt.resultType=2;const Ao=$e(Qt),Yn=[["path",{d:"M12 5v14"}],["path",{d:"m19 12-7 7-7-7"}]],Qn=[["path",{d:"m12 19-7-7 7-7"}],["path",{d:"M19 12H5"}]],Xn=[["path",{d:"M5 12h14"}],["path",{d:"m12 5 7 7-7 7"}]],er=[["path",{d:"m5 12 7-7 7 7"}],["path",{d:"M12 19V5"}]],Co=[["path",{d:"M20 6 9 17l-5-5"}]],To=[["path",{d:"m6 9 6 6 6-6"}]],Eo=[["path",{d:"m15 18-6-6 6-6"}]],_o=[["path",{d:"m9 18 6-6-6-6"}]],Ro=[["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"}]],Lo=[["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"}]],zo=[["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"}]],Po=[["path",{d:"M15 3h6v6"}],["path",{d:"m21 3-7 7"}],["path",{d:"m3 21 7-7"}],["path",{d:"M9 21H3v-6"}]],Oo=[["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"}]],Mo=[["path",{d:"m14 10 7-7"}],["path",{d:"M20 10h-6V4"}],["path",{d:"m3 21 7-7"}],["path",{d:"M4 14h6v6"}]],jo=[["path",{d:"M5 12h14"}]],Io=[["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"}]],qo=[["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"}]],No=[["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"}]],Do=[["path",{d:"M5 12h14"}],["path",{d:"M12 5v14"}]],Uo=[["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"}]],Bo=[["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"}]],Ho=[["path",{d:"M18 6 6 18"}],["path",{d:"m6 6 12 12"}]],Fo=t=>t.replaceAll("&","&").replaceAll('"',"""),Ko=t=>t.map(([e,s])=>`<${e}${Object.entries(s).map(([n,r])=>` ${n}="${Fo(String(r))}"`).join("")}></${e}>`).join(""),C=t=>{const e=Ko(t);return()=>k`<svg
|
|
1099
1131
|
viewBox="0 0 24 24"
|
|
1100
1132
|
fill="none"
|
|
1101
1133
|
stroke="currentColor"
|
|
@@ -1106,7 +1138,7 @@ The brief is too long for a comment, so it is stored in this artifact's database
|
|
|
1106
1138
|
focusable="false"
|
|
1107
1139
|
>
|
|
1108
1140
|
${Ao(e)}
|
|
1109
|
-
</svg>`},Xt=
|
|
1141
|
+
</svg>`},Xt=C(Ho),tr=C(Bo),es=C(No),ts=C(Oo),sr=C(zo),Wo=C(Ro),Zo=C(Co),nr=C(Do),Vo=C(jo),Go=C(Lo),rr=C(qo),Jo=C(er),Yo=C(Yn);C(Qn),C(Xn);const ir=C(Eo),ss=C(_o),Qo=C(To),Xo=C(Po),el=C(Mo),tl=C(Uo),sl=C(Io),nl=t=>{switch(t){case"comment":return ts();case"create":return nr();case"update":return es();case"delete":return tr();case"move":return rr();default:return sr()}},rl=(t,e,s,n=!1)=>k`
|
|
1110
1142
|
${n?g:k`<header><h2>${t.heading}</h2></header>`}
|
|
1111
1143
|
${e.issues.length>0?k`<div class="issues" role="alert">
|
|
1112
1144
|
<strong>${t.rejected}</strong>
|
|
@@ -1214,7 +1246,7 @@ The brief is too long for a comment, so it is stored in this artifact's database
|
|
|
1214
1246
|
</div>
|
|
1215
1247
|
<div class="item-target">${e.targetLabel}</div>
|
|
1216
1248
|
${e.edit.kind==="editing"?al(t,e.edit,s):e.text.kind==="comment"?k`<p class="item-body">${e.text.body}</p>`:e.text.body?k`<div class="item-summary">${e.text.body}</div>`:g}
|
|
1217
|
-
|
|
1249
|
+
${e.code===null?g:k`<code class="item-code">${e.code}</code>`}
|
|
1218
1250
|
</li>
|
|
1219
1251
|
`,al=(t,e,s)=>k`
|
|
1220
1252
|
<div class="item-editor">
|
|
@@ -1240,7 +1272,7 @@ The brief is too long for a comment, so it is stored in this artifact's database
|
|
|
1240
1272
|
</button>
|
|
1241
1273
|
</div>
|
|
1242
1274
|
</div>
|
|
1243
|
-
`;class ar extends F{static{this.styles=So}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=po();#
|
|
1275
|
+
`;class ar extends F{static{this.styles=So}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=po();#r=null;#n=new $t(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=Kn(this.#e,{kind:"target-requested",ref:this.pendingTarget}))}updated(e){e.has("pendingTarget")&&this.pendingTarget&&this.isConnected&&this.renderRoot.querySelector("textarea")?.focus();const s=this.#r;s&&(this.#r=null,[...this.renderRoot.querySelectorAll(".item")].find(r=>r.dataset.id===s.id)?.querySelector(s.kind==="editor"?".item-editor textarea":".item-edit")?.focus())}#i(){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.#n.locale}}render(){const e=this.#i();return e?rl(Hn(this.#n.locale),Vn(e,this.#e),this.#t,this.embedded):g}#s(e){this.#e=Kn(this.#e,e),this.requestUpdate()}#t=e=>{switch(e.kind){case"delete":this.onDelete?.(e.id);return;case"clear":this.onClear?.();return;case"copy":this.#l();return;case"send":this.#a();return;case"edit-start":this.#r={kind:"editor",id:e.id},this.#s(e);return;case"edit-cancel":{const s=this.#e.editing;s&&(this.#r={kind:"edit-button",id:s.id}),this.#s(e);return}case"edit-save":{const s=uo(this.#e);if(!s||!this.onEditComment||!this.onEditComment(s.id,s.body).ok)return;this.#r={kind:"edit-button",id:s.id},this.#s({kind:"edited"});return}case"submit":{const s=this.#i();if(!s||!this.onComment)return;const n=ho(this.#e,Vn(s,this.#e).target.ref);if(!n||!this.onComment(n.target,n.body).ok)return;this.#s({kind:"submitted"});return}default:this.#s(e)}};async#a(){const e=this.sendToClaude;if(!e||this.#e.send.kind==="pending")return;this.#s({kind:"send-started"});const s=this.#e.sendRequest,n=await e().catch(()=>({ok:!1,reason:"error"}));this.isConnected&&this.#s({kind:"send-finished",request:s,outcome:n})}async#l(){const e=this.#i();if(!e)return;this.#s({kind:"copy-started"});const s=this.#e.copyRequest;try{const n=this.exportBrief?.()??Gt({...e.derivation,navigation:e.navigation,issues:e.issues},e.definition,N),r=await Jt(n);this.isConnected&&this.#s({kind:"copy-finished",request:s,ok:r})}catch{this.isConnected&&this.#s({kind:"copy-finished",request:s,ok:!1})}}}const ol=()=>{customElements.get("dpk-component-comment-panel")||customElements.define("dpk-component-comment-panel",ar)},or=(t,e,s)=>{typeof window>"u"||Object.assign(window,{devProcessKit:{version:t,templates:e,versionParam:s}})},Pe="dpk-version",lr="version",ll=/^\d+\.\d+\.\d+(?:-[0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*)?$/,it=t=>ll.test(t),cl="https://cdn.jsdelivr.net/npm/dev-process-kit@",cr="https://data.jsdelivr.com/v1/packages/npm/dev-process-kit",ns=t=>{const e=new URLSearchParams(t),s=e.get(Pe)??e.get(lr);return s!==null&&it(s)?s:null},dl=(t,e)=>{const s=ns(t);return s===null||s===e?null:s},pl=(t,e)=>{if(!it(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`${cl}${t}/dist/${e}`},hl=(t,e)=>{const s=new URL(t);return s.searchParams.delete(lr),e===null?s.searchParams.delete(Pe):s.searchParams.set(Pe,e),s.href},ul=T({tags:Le(st(m(),V()),{}),versions:Z(T({version:m()}))}),fl=t=>{const e=qt(ul,t),s=e.tags.latest;return{latest:typeof s=="string"&&it(s)?s:null,versions:e.versions.map(n=>n.version).filter(it)}},dr=t=>{const e=t.published?.versions??[],s=e.includes(t.current)?e:[t.current,...e],n=t.published?.latest??null;return{value:t.current,options:[...t.requested?[{value:"",label:t.text.pinned}]:[],...s.map(r=>({value:r,label:r===n&&r!==t.current?t.text.latest(r):r}))]}};let at;const pr=()=>(at??=fetch(cr).then(async t=>{if(!t.ok)throw new Error(`${cr} answered ${t.status}`);return fl(await t.json())}),at.catch(()=>{at=void 0}),at),hr=t=>{location.assign(hl(location.href,t))},gl=t=>import(t),ml=({entry:t,templates:e,register:s,importModule:n=gl})=>{const r=()=>{s(),or(N,e,Pe)},i=typeof location>"u"?null:dl(location.search,N);if(i===null){r();return}n(pl(i,t)).then(()=>{kl()||xl(i)},a=>{console.error(`dev-process-kit@${i} could not be loaded; running ${N}`,a),r()})},kl=()=>{const t=Reflect.get(window,"devProcessKit");return typeof t=="object"&&t!==null&&"versionParam"in t},rs="dpk-version-fallback",bl=`
|
|
1244
1276
|
.${rs} {
|
|
1245
1277
|
flex: none;
|
|
1246
1278
|
height: 24px;
|
|
@@ -1259,7 +1291,7 @@ The brief is too long for a comment, so it is stored in this artifact's database
|
|
|
1259
1291
|
letter-spacing: 0.02em;
|
|
1260
1292
|
cursor: pointer;
|
|
1261
1293
|
}
|
|
1262
|
-
`,xl=t=>{const e=[...document.body.querySelectorAll("*")].filter(s=>s.localName.startsWith("dpk-template-")&&!s.querySelector(`:scope > .${rs}`));if(e.length!==0){document.head.append(Object.assign(document.createElement("style"),{textContent:bl}));for(const s of e)s.append(vl(s,t))}},vl=(t,e)=>{const s=D(Ze(Ke(t))),n=document.createElement("select");n.className=rs,n.slot="header",n.setAttribute("aria-label",s.versionLabel),n.title=s.versionLabel;const r=a=>{const o=dr({current:e,requested:ns(location.search)!==null,published:a,text:{pinned:s.versionPinned,latest:s.versionLatest}});n.replaceChildren(...o.options.map(l=>Object.assign(document.createElement("option"),{value:l.value,textContent:l.label}))),n.value=o.value},i=()=>{pr().then(r,a=>console.warn(a))};return n.addEventListener("pointerenter",i,{once:!0}),n.addEventListener("focus",i,{once:!0}),n.addEventListener("change",()=>hr(n.value===""?null:n.value)),r(null),n},yl=C({value:m()}),wl=t=>e=>{if(!(e instanceof CustomEvent))return;const s=S(yl,e.detail);s.success&&t(s.output.value)},is=t=>e=>{const s=de(e.target,HTMLSelectElement);s!==null&&t(s.value)},$l=t=>e=>{const s=de(e.target,HTMLInputElement);s!==null&&t(s.checked)},Oe=t=>t==="light"||t==="dark"?t:null,ur=t=>t.authored??t.environment,fr=t=>t.preference??ur(t),Sl=t=>{const e=fr(t)==="dark"?"light":"dark";return e===ur(t)?null:e},gr=W(fe({value:v(m(),ie(/^element:.+/)),label:v(m(),w(1)),group:P(m())})),Al=C({targets:gr,providers:W(C({id:v(m(),w(1)),results:W(Un)}))}),Tl=fe({target:v(m(),ie(/^element:.+/)),body:v(m(),jt(),w(1))}),mr=t=>t.group?`${t.group} \xB7 ${t.label}`:t.label,kr=(t,e,s)=>{const n=new Map(e.map(r=>[r.value,r]));return{...t,hasTarget:(r,i)=>t.hasTarget(r,i)||n.has(M(i)),commentTargets:(r,i)=>{const a=t.commentTargets(r,i),o=new Set(a.map(l=>l.value));return[...a,...e.filter(l=>!o.has(l.value))]},describe:(r,i,a)=>{if(q(r)){const c=s.get(r.id),p=n.get(M(r.target));return{title:c?.title??r.type,...c?.summary===void 0?{}:{summary:c.summary},tone:c?.tone??"update",targetLabel:p?mr(p):r.target.id}}const o=t.describe(r,i,a),l=r.type==="comment"&&!t.hasTarget(i,r.target)?n.get(M(r.target)):void 0;return l===void 0?o:{...o,targetLabel:mr(l)}},serialize:r=>q(r)?`${r.type} ${M(r.target)} ${JSON.stringify(r.payload)}`:t.serialize(r)}},br=typeof globalThis=="object"&&globalThis||typeof window=="object"&&window||typeof self=="object"&&self||typeof global=="object"&&global||(function(){return this})();function xr(t){return typeof br.Buffer<"u"&&br.Buffer.isBuffer(t)}function vr(t){if(!t||typeof t!="object")return!1;const e=Object.getPrototypeOf(t);return e===null||e===Object.prototype||Object.getPrototypeOf(e)===null?Object.prototype.toString.call(t)==="[object Object]":!1}function yr(t){return Object.getOwnPropertySymbols(t).filter(e=>Object.prototype.propertyIsEnumerable.call(t,e))}function wr(t){return t==null?t===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(t)}const Cl="[object RegExp]",El="[object String]",_l="[object Number]",Rl="[object Boolean]",Ll="[object Symbol]",Pl="[object Date]",zl="[object Map]",Ol="[object Set]",Ml="[object Array]",jl="[object Function]",Il="[object ArrayBuffer]",as="[object Object]",ql="[object Error]",Nl="[object DataView]",Dl="[object Uint8Array]",Ul="[object Uint8ClampedArray]",Bl="[object Uint16Array]",Hl="[object Uint32Array]",Fl="[object BigUint64Array]",Kl="[object Int8Array]",Zl="[object Int16Array]",Wl="[object Int32Array]",Vl="[object BigInt64Array]",Gl="[object Float32Array]",Jl="[object Float64Array]";function Yl(t,e){return t===e||Number.isNaN(t)&&Number.isNaN(e)}function Ql(t,e,s){return Me(t,e,void 0,void 0,void 0,void 0,s)}function Me(t,e,s,n,r,i,a){const o=a(t,e,s,n,r,i);if(o!==void 0)return o;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 je(t,e,i,a)}return je(t,e,i,a)}function je(t,e,s,n){if(Object.is(t,e))return!0;let r=wr(t),i=wr(e);if(r==="[object Arguments]"&&(r=as),i==="[object Arguments]"&&(i=as),r!==i)return!1;switch(r){case El:return t.toString()===e.toString();case _l:return Yl(t.valueOf(),e.valueOf());case Rl:case Pl:case Ll:return Object.is(t.valueOf(),e.valueOf());case Cl:return t.source===e.source&&t.flags===e.flags;case jl:return t===e}s=s??new Map;const a=s.get(t),o=s.get(e);if(a!=null&&o!=null)return a===e;s.set(t,e),s.set(e,t);try{switch(r){case zl:if(t.size!==e.size)return!1;for(const[l,c]of t.entries())if(!e.has(l)||!Me(c,e.get(l),l,t,e,s,n))return!1;return!0;case Ol:{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=>Me(d,u,void 0,t,e,s,n));if(h===-1)return!1;c.splice(h,1)}return!0}case Ml:case Dl:case Ul:case Bl:case Hl:case Fl:case Kl:case Zl:case Wl:case Vl:case Gl:case Jl:if(xr(t)!==xr(e)||t.length!==e.length)return!1;for(let l=0;l<t.length;l++)if(!Me(t[l],e[l],l,t,e,s,n))return!1;return!0;case Il:return t.byteLength!==e.byteLength?!1:je(new Uint8Array(t),new Uint8Array(e),s,n);case Nl:return t.byteLength!==e.byteLength||t.byteOffset!==e.byteOffset?!1:je(new Uint8Array(t),new Uint8Array(e),s,n);case ql:return t.name===e.name&&t.message===e.message;case as:{if(!(je(t.constructor,e.constructor,s,n)||vr(t)&&vr(e)))return!1;const l=[...Object.keys(t),...yr(t)],c=[...Object.keys(e),...yr(e)];if(l.length!==c.length)return!1;for(let p=0;p<l.length;p++){const d=l[p],h=t[d];if(!Object.hasOwn(e,d))return!1;const u=e[d];if(!Me(h,u,d,t,e,s,n))return!1}return!0}default:return!1}}finally{s.delete(t),s.delete(e)}}function Xl(){}function ot(t,e){return Ql(t,e,Xl)}const $r="page",Sr=t=>M(t),Ar=(t,e,s,n=new Map)=>{let r=e;const i=[],a=[],o=[],l=[],c=new Map;for(const d of s){if(d.type===z)continue;if(q(d)){const f=n.get(d.id);f===void 0||f.stale!==void 0?a.push({action:d,reason:f?.stale??"target-missing"}):i.push(d);continue}const h=rt(t.actions,d.type);if(!h){a.push({action:d,reason:"unsupported-action-type"});continue}const u=t.apply(r,d);if(u===null){a.push({action:d,reason:t.hasTarget(r,d.target)?"constraint-violated":"target-missing"});continue}if(h.mode!=="append"&&os(t,r,u)){o.push(d);continue}r=u,i.push(d)}for(const d of s){if(d.type!==z)continue;if(d.target.type!==$r&&!t.hasTarget(r,d.target)){a.push({action:d,reason:"target-missing"});continue}l.push(d);const h=Sr(d.target);c.set(h,[...c.get(h)??[],d])}const p=new Map(s.map((d,h)=>[d.id,h]));return a.sort((d,h)=>(p.get(d.action.id)??0)-(p.get(h.action.id)??0)),{base:e,state:r,actions:s,applied:i,stale:a,obsolete:o,comments:l,commentsByTarget:c}},os=(t,e,s)=>e===s?!0:t.canonicalState===void 0?ot(e,s):ot(t.canonicalState(e),t.canonicalState(s)),Tr=t=>{const e=new Set(t.obsolete.map(s=>s.id));return t.actions.filter(s=>!e.has(s.id))},ec=(t,e,s,n)=>{let r=e;const i=n??Cr(r).map(a=>a.id);for(const a of[...i].reverse())r=tc(t,r,s,a,n!==void 0)??r;return r},Cr=t=>t.applied.filter(e=>!q(e)),tc=(t,e,s,n,r)=>{const i=Cr(e),a=i.findIndex(h=>h.id===n),o=i[a];if(o===void 0)return null;const l=i.slice(0,a),c=[...r?sc(t,e.base,i,a):[],...nc(t,l,o)],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=rc(t,e,s,h);if(u!==null)return u}return null},sc=(t,e,s,n)=>{const r=[];let i=e;for(const a of s.slice(0,n+1))r.push(i),i=t.apply(i,a)??i;return r.flatMap((a,o)=>os(t,a,i)?[s.slice(o,n+1).map(l=>l.id)]:[])},nc=(t,e,s)=>{const n=Er(s),r=e.filter(l=>Er(l).some(c=>n.includes(c))),i=_r(t,s),a=r.filter(l=>_r(t,l)===i),o=l=>l.map((c,p)=>[...l.slice(p).map(d=>d.id),s.id]);return[...o(r),...o(a),...r.map(l=>[l.id,s.id]),...r.map(l=>[l.id])]},Er=t=>{const e=t.target.type===$r?[]:t.target.id.split("."),s=typeof t.payload=="object"&&t.payload!==null?Object.values(t.payload).filter(n=>typeof n=="string"&&n!==""):[];return[...e,...s]},_r=(t,e)=>rt(t.actions,e.type)?.mode,rc=(t,e,s,n)=>{const r=new Set(e.stale.map(a=>a.action.id)),i=new Set(n);for(;;){const a=s(e.actions.filter(l=>!i.has(l.id))),o=a.stale.filter(l=>!r.has(l.action.id)).map(l=>l.action);if(o.length===0)return os(t,a.state,e.state)?a:null;if(o.some(l=>l.type===z||q(l)))return null;for(const l of o)i.add(l.id)}},ic=C({v:ue(1),template:v(m(),w(1)),actions:W(V())});class ls{constructor(e){this.storage=e}load(e,s){try{const n=this.storage.getItem(e);if(n===null)return[];const r=S(ic,JSON.parse(n));return!r.success||r.output.template!==s?[]:r.output.actions.flatMap(i=>{const a=S(ae,i);return a.success?[a.output]:[]})}catch{return[]}}save(e,s,n){const r={v:1,template:s,actions:n};try{this.storage.setItem(e,JSON.stringify(r))}catch{}}clear(e){try{this.storage.removeItem(e)}catch{}}}class cs{constructor(){this.store=new Map}load(e,s){return new ls({getItem:n=>this.store.get(n)??null,setItem:(n,r)=>{this.store.set(n,r)},removeItem:n=>{this.store.delete(n)}}).load(e,s)}save(e,s,n){this.store.set(e,JSON.stringify({v:1,template:s,actions:n}))}clear(e){this.store.delete(e)}}const ds=()=>{try{if(typeof localStorage<"u")return new ls(localStorage)}catch{}return new cs},ps=t=>`dev-process-kit:draft:${typeof location>"u"?"local":`${location.pathname}${location.search}`}:${t}`,ac=W(V());class Rr{#e;#i;#n={targets:[],providers:[]};#r=new Map;#t;#s;#a;#o;#l;#p=new Set;#x=[];#m=0;constructor(e){this.#e=e.definition,this.#i=kr(e.definition,[],this.#r),this.#t=e.base,this.#l=e.storageKey??ps(e.definition.name),this.#o=e.storage===void 0?ds():e.storage;const s=e.initialActions??this.#o?.load(this.#l,this.definition.name)??[];this.#s=Pr(this.definition,s),this.#a=this.#d(this.#s),this.#y()&&this.#k()}get definition(){return this.#i}setComponentSnapshot(e){const s=qt(Al,e);if(!ot(s,this.#n)){this.#n=s,this.#c(),this.#a=this.#d(this.#s);for(const n of this.#p)n()}}setTemplate(e){this.#e=e,this.#c(),this.#a=this.#d(this.#s);for(const s of this.#p)s()}#c(){this.#r=Bn(this.#s,this.#n.providers),this.#i=kr(this.#e,this.#n.targets,this.#r)}#d(e){return Ar(this.definition,this.#t,e,Bn(e,this.#n.providers))}get base(){return this.#t}get actions(){return this.#s}get derivation(){return this.#a}get lastIssues(){return this.#x}get prunedCount(){return this.#m}descriptorFor(e,s){return Lr(this.definition,e,s)}dispatch(e){const s=this.#v(e,this.#a.state);if(!s.ok)return this.#h([s.issue]);const n=this.descriptorFor(s.action.type,s.action.target);return n?(this.#u(Ut(this.#s,s.action,n),[s.action.id]),{ok:!0,id:s.action.id}):this.#h([{path:"type",message:"unknown action type"}])}dispatchBatch(e){const s=S(ac,e);if(!s.success)return this.#h([oe(s.issues)]);const n=s.output;if(n.length===0)return{ok:!0,ids:[]};let r=this.#s,i=this.#a.state;const a=[];for(const o of n){const l=this.#v(o,i);if(!l.ok)return this.#h([l.issue]);const c=l.action,p=this.descriptorFor(c.type,c.target);if(!p)return this.#h([{path:"type",message:"unknown action type"}]);if((c.type==="comment"||q(c)?c.target.type==="page"||this.definition.hasTarget(i,c.target)?i:null:this.definition.apply(i,c))===null)return this.#h([{path:"target",message:"batch action is not applicable"}]);r=Ut(r,c,p),i=this.#d(r).state,a.push(c.id)}return this.#u(r,a),{ok:!0,ids:a}}#v(e,s){const n=S(In,e);if(!n.success)return{ok:!1,issue:oe(n.issues)};const r=this.descriptorFor(n.output.type,typeof n.output.target=="string"?Nt(n.output.target,"page"):n.output.target);if(!r)return{ok:!1,issue:{path:"type",message:`unknown action type "${n.output.type}"`}};const i=eo(n.output,r);if(!i.ok)return i;const a=this.definition.canonicalTarget?.(s,i.action.target)??i.action.target;return{ok:!0,action:{...i.action,target:a}}}#h(e){return this.#x=e,{ok:!1,issues:e}}editComment(e,s){const n=this.#s.find(o=>o.id===e);if(n?.type!==z)return this.#h([{path:"id",message:`no comment "${e}" in the draft`}]);if(Pe(n)===s)return{ok:!0,id:e};const r=S(Ht.schema,{...n,payload:{body:s}});if(!r.success)return this.#h([oe(r.issues)]);const i=S(ae,r.output);if(!i.success)return this.#h([oe(i.issues)]);const a=i.output;return this.#u(this.#s.map(o=>o===n?a:o),[]),{ok:!0,id:e}}removeAction(e){const s=this.#s.filter(n=>n.id!==e);s.length!==this.#s.length&&this.#u(s)}clearActions(){this.#s.length>0&&this.#u([])}replaceActions(e){this.#u(Pr(this.definition,e))}setBase(e){this.#t=e,this.#u(this.#s)}subscribe(e){return this.#p.add(e),()=>{this.#p.delete(e)}}exportDraft(e){return{template:this.definition.name,frameworkVersion:e,exportedAt:new Date().toISOString(),actions:this.#s}}#u(e,s){this.#x=[],this.#s=e,this.#c(),this.#a=this.#d(this.#s),this.#y(s),this.#k();for(const n of this.#p)n()}#y(e){const s=this.#g(),n=ec(this.definition,this.#a,r=>this.#d(r),e);return n===this.#a?s:(this.#m+=this.#s.length-n.actions.length,this.#s=[...n.actions],this.#c(),this.#a=this.#d(this.#s),this.#g(),!0)}#g(){return this.#a.obsolete.length===0?!1:(this.#m+=this.#a.obsolete.length,this.#s=Tr(this.#a),this.#c(),this.#a=this.#d(this.#s),!0)}#k(){this.#o?.save(this.#l,this.definition.name,this.#s)}}const Lr=(t,e,s)=>e==="comment"?Ht:s!==void 0&&q({type:e,target:s})?io:rt(t.actions,e),Pr=(t,e)=>e.flatMap(s=>{const n=S(ae,s);if(!n.success)return[];const r=n.output,i=Lr(t,r.type,r.target);if(!i)return[];const a=S(i.schema,r);if(!a.success)return[];const o=S(ae,a.output);return o.success?[o.output]:[]}),oc=()=>({status:{kind:"idle"},request:0}),lc=(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}},cc=(t,e)=>{if(t.actions===0||t.railOpen)return null;const s=D(t.locale),n=e.status;return{send:t.sendable?{label:n.kind==="sending"?s.handoffSending:n.kind==="sent"?s.handoffSent:s.handoffSend,disabled:n.kind==="sending"}:null,copy:n.kind==="copied"?{label:s.handoffCopied,status:"copied"}:n.kind==="copy-failed"?{label:s.handoffCopyFailed,status:"failed"}:{label:s.handoffCopy,status:"idle"},note:n.kind==="send-failed"?Yt(n.reason,t.locale):null}},zr=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()}},dc=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:s=>{const n=typeof s=="string"?s:M(s);return e.commentsByTarget.get(n)?.length??0},dispatch:s=>t.dispatch(s),dispatchBatch:s=>t.dispatchBatch(s),navigate:(s,n)=>t.navigate(s,n),hashFor:s=>t.hashFor(s),requestComment:s=>t.requestComment(s)}},pc=(t,e)=>{const s=()=>zr(t);return{version:N,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:n=>t.dispatch(n),dispatchBatch:n=>t.dispatchBatch(n),comment:(n,r)=>t.dispatch({type:z,target:n,payload:{body:r}}),editComment:(n,r)=>t.editComment(n,r),removeAction:n=>t.removeAction(n),clearActions:()=>t.clearActions(),importDraft:n=>t.controller().replaceActions(n),navigate:(n,r)=>t.navigate(n,r),hashFor:n=>t.hashFor(n),snapshot:s,exportDraft:()=>t.controller().exportDraft(N),exportBrief:()=>Gt(s(),t.controller().definition,N),subscribe:n=>t.subscribe(n)}},hs=(t,e)=>typeof t=="object"&&t!==null&&e.every(s=>typeof Reflect.get(t,s)=="function"),hc=t=>hs(t,["use"]),uc=t=>hs(t,["anchorFor","canSendToClaude","sendToClaude"]),fc=t=>hs(t,["collection"]),Or=async(t,e)=>{try{return await t.use(e)}catch{return null}},gc=(t,e)=>({async canSend(){try{return await t.canSendToClaude()==="available"}catch{return!1}},async send({brief:s,draft:n,anchor:r}){let i=xo(s);if(i===null){if(e===null)return{ok:!1,reason:"too_large"};try{const a=e.collection(mo).doc();await a.set({brief:s,draft:n,createdAt:new Date().toISOString()}),i=vo(a.path)}catch{return{ok:!1,reason:"storage"}}}try{return await t.sendToClaude({anchor:await t.anchorFor(r),text:i}),{ok:!0}}catch(a){return{ok:!1,reason:wo(a)}}}}),mc=async t=>{if(!hc(t))return null;const[e,s]=await Promise.all([Or(t,"comments"),Or(t,"db")]);return uc(e)?gc(e,fc(s)?s:null):null},kc=()=>Reflect.get(globalThis,"claude");class bc{#e;#i;#n=null;#r=!1;constructor(e,s=kc){this.#e=e,this.#i=s,e.addController(this)}get available(){return this.#r}hostConnected(){this.#n??=mc(this.#i()),this.#t(),window.addEventListener("focus",this.#t)}hostDisconnected(){window.removeEventListener("focus",this.#t)}async send(e){const s=await this.#n;if(!s)return{ok:!1,reason:"forbidden"};const n=await s.send(e);return this.#t(),n}#t=async()=>{const e=await this.#n,s=e?await e.canSend():!1;s!==this.#r&&(this.#r=s,this.#e.requestUpdate())}}const us=(t,e)=>({read(s){try{const n=t.getItem(s);return n===null?null:e(JSON.parse(n))}catch{return null}},write(s,n){try{return t.setItem(s,JSON.stringify(n)),!0}catch{return!1}},remove(s){try{t.removeItem(s)}catch{}}}),G=t=>{const e=new Map;return us({getItem:s=>e.get(s)??null,setItem:(s,n)=>{e.set(s,n)},removeItem:s=>{e.delete(s)}},t)},Ie=t=>{try{if(typeof localStorage<"u")return us(localStorage,t)}catch{}return G(t)},xc=t=>{try{if(typeof sessionStorage<"u")return us(sessionStorage,t)}catch{}return G(t)},fs="dev-process-kit:color-scheme",vc="(prefers-color-scheme: dark)",Mr=()=>typeof matchMedia=="function"?matchMedia(vc):null,jr=()=>Oe(document.documentElement.dataset.theme)??(Mr()?.matches===!0?"dark":"light");class yc{#e;#i;#n=null;#r=null;#t="light";#s=null;#a=null;constructor(e,s){this.#e=e,this.#i=s,e.addController(this)}hostConnected(){this.#n===null&&(this.#n=this.#i()?Ie(Oe):G(Oe),this.#r=this.#n.read(fs)),this.#t=jr(),this.#s=Mr(),this.#s?.addEventListener("change",this.#l),this.#a=new MutationObserver(this.#l),this.#a.observe(document.documentElement,{attributes:!0,attributeFilter:["data-theme"]})}hostDisconnected(){this.#s?.removeEventListener("change",this.#l),this.#s=null,this.#a?.disconnect(),this.#a=null}resolve(e){return fr(this.#o(e))}toggle(e){this.#r=Sl(this.#o(e)),this.#r===null?this.#n?.remove(fs):this.#n?.write(fs,this.#r),this.#e.requestUpdate()}#o(e){return{preference:this.#r,authored:e,environment:this.#t}}#l=()=>{const e=jr();e!==this.#t&&(this.#t=e,this.#e.requestUpdate())}}const wc=(t,e)=>{const s=[],n=r=>{(r===t||r instanceof ShadowRoot)&&e?.(r);for(const i of r.children)i.hasAttribute("data-template")||(("commentTargets"in i||"elementActions"in i)&&s.push(i),n(i),i.shadowRoot&&n(i.shadowRoot))};return n(t),s},Ir=(t,e)=>{const s=new Map;for(const n of t)s.set(e(n),(s.get(e(n))??0)+1);return t.filter(n=>s.get(e(n))===1)},qr=t=>Ir(t.filter(e=>"elementActions"in e&&e.id.length>0),e=>e.id),Nr=(t,e)=>{for(const s of qr(t)){const n=oo(e,s.id),r=Reflect.get(s,"elementActions");Array.isArray(r)&&r.length===n.length&&n.every((a,o)=>{const l=r[o];return typeof l=="object"&&l!==null&&"id"in l&&l.id===a.id})||Reflect.set(s,"elementActions",n)}},$c=t=>{const e=Reflect.get(t,"elementActionResults");return Array.isArray(e)?e.flatMap(s=>{const n=S(Un,s);return n.success?[n.output]:[]}):[]},Sc=t=>{const e=[];for(const s of t){if(!("commentTargets"in s))continue;const n=S(gr,s.commentTargets);n.success&&e.push(...n.output)}return{targets:Ir(e,s=>s.value),providers:qr(t).map(s=>({id:s.id,results:$c(s)}))}},Ac=2400;class Tc{#e=oc();#i=null;#n;constructor(e){this.#n=e,e.addController(this)}get state(){return this.#e}hostDisconnected(){this.#s()}async copy(e){this.#r({kind:"copy-started"});const s=this.#e.request,n=await Jt(e()).catch(()=>!1);this.#r({kind:"copy-finished",request:s,ok:n}),this.#t(s)}async send(e){if(this.#e.status.kind==="sending")return;this.#r({kind:"send-started"});const s=this.#e.request,n=await e().catch(()=>({ok:!1,reason:"error"}));this.#r({kind:"send-finished",request:s,outcome:n}),n.ok&&this.#t(s)}#r(e){(e.kind==="copy-started"||e.kind==="send-started")&&this.#s(),this.#e=lc(this.#e,e),this.#n.requestUpdate()}#t(e){e===this.#e.request&&(this.#s(),this.#i=setTimeout(()=>{this.#i=null,this.#r({kind:"settled",request:e})},Ac))}#s(){this.#i!==null&&clearTimeout(this.#i),this.#i=null}}const gs="dev-process-kit:locale";class Cc{#e;#i;#n;#r=null;#t=null;#s;#a;constructor(e,s,n){this.#e=e,this.#i=s,this.#n=n,e.addController(this)}get authored(){if(this.#s===void 0)return Ze(Ke(this.#e));const e=this.#e.parentNode;return Ze(this.#s??(e===null?null:Ke(e)))}get locale(){return this.#a??this.#o()}#o(){return $i({preference:this.#t,authored:this.authored})}hostConnected(){this.#r===null&&(this.#r=this.#i()?Ie(Ws):G(Ws),this.#t=this.#r.read(gs)),this.#s??=this.#e.getAttribute("lang"),this.#l()}pick(e){this.#t=Si(e,this.authored),this.#t===null?this.#r?.remove(gs):this.#r?.write(gs,this.#t),this.#l(),this.#e.requestUpdate()}#l(){const e=this.#t??this.#s??null;e===null?this.#e.removeAttribute("lang"):this.#e.getAttribute("lang")!==e&&this.#e.setAttribute("lang",e);const s=this.#o();if(s===this.#a)return;const n=this.#a===void 0;this.#a=s,this.#n(),(!n||this.#t!==null)&&document.dispatchEvent(new Event(wt))}}const Dr=()=>Wt(typeof location>"u"?"":location.hash),Ec=(t,e)=>{if(typeof history>"u")return;const s=`${location.pathname}${location.search}${ge(t)}`;`${location.pathname}${location.search}${location.hash}`!==s&&(e?history.replaceState(null,"",s):history.pushState(null,"",s))};class _c{#e;#i=null;#n=0;constructor(e){this.#e=e}get orphans(){return this.#n}route(){const e=this.#e.renderRoot,s=de(e.querySelector('slot[name="preview"]'),HTMLSlotElement);if(s===null)return;this.#i!==s&&(this.#i=s,s.addEventListener("slotchange",this.#r));const n=new Set(Array.from(e.querySelectorAll("slot")).map(i=>i.getAttribute("name")??"")),r=s.assignedElements();for(const i of r){const a=i.getAttribute("data-preview-id");if(!a)continue;const o=`preview:${a}`;i.getAttribute("slot")!==o&&n.has(o)&&i.setAttribute("slot",o)}r.length!==this.#n&&(this.#n=r.length,queueMicrotask(()=>this.#e.requestUpdate()))}#r=()=>{queueMicrotask(()=>this.route())}}const J={min:180,max:560,step:16,largeStep:64},Rc={side:"left",defaultWidth:260},lt=t=>Math.round(Math.min(J.max,Math.max(J.min,t))),Ur=t=>typeof t=="number"&&Number.isFinite(t)?lt(t):null,ms=(t,e)=>t==="left"?e:-e,Lc=(t,e)=>lt(t.startWidth+ms(t.side,e-t.startX)),Pc=(t,e,{key:s,shiftKey:n})=>{const r=n?J.largeStep:J.step;switch(s){case"ArrowLeft":return lt(t+ms(e,-r));case"ArrowRight":return lt(t+ms(e,r));case"Home":return J.min;case"End":return J.max;default:return null}},Br=t=>typeof t=="boolean"?t:null,zc=t=>t==="left"?"right":"left",Oc=(t,e)=>e?{action:"expand",points:zc(t)}:{action:"collapse",points:t},Mc=t=>`dev-process-kit:sidebar-collapsed:${t}`;class jc{#e;#i;#n=null;#r="";#t=!1;constructor(e,s){this.#e=e,this.#i=s,e.addController(this)}hostConnected(){this.#n===null&&(this.#n=this.#i.persist()?Ie(Br):G(Br),this.#r=Mc(this.#i.template()),this.#t=this.#n.read(this.#r)??!1)}get collapsed(){return this.#t}toggle(){this.#t=!this.#t,this.#t?this.#n?.write(this.#r,!0):this.#n?.remove(this.#r),this.#e.requestUpdate()}}const Ic=t=>`dev-process-kit:sidebar-width:${t}`,ks={kind:"idle"};class qc{constructor(e,s){this.#n=null,this.#r="",this.#t=null,this.#s=ks,this.handlers={pointerdown:n=>{n.button===0&&(n.preventDefault(),n.currentTarget instanceof Element&&n.currentTarget.setPointerCapture(n.pointerId),this.#s={kind:"dragging",pointerId:n.pointerId,side:this.#i.layout().side,startX:n.clientX,startWidth:this.width},this.#e.requestUpdate())},pointermove:n=>{const r=this.#s;r.kind!=="dragging"||r.pointerId!==n.pointerId||this.#o(Lc(r,n.clientX))},pointerup:n=>this.#a(n),pointercancel:n=>this.#a(n),keydown:n=>{const r=Pc(this.width,this.#i.layout().side,n);r!==null&&(n.preventDefault(),this.#o(r),this.#l())},dblclick:()=>{this.#o(this.#i.layout().defaultWidth),this.#l()}},this.#e=e,this.#i=s,e.addController(this)}#e;#i;#n;#r;#t;#s;hostConnected(){this.#n===null&&(this.#n=this.#i.persist()?Ie(Ur):G(Ur),this.#r=Ic(this.#i.template()),this.#t=this.#n.read(this.#r))}hostDisconnected(){this.#s=ks}get width(){return this.#t??this.#i.layout().defaultWidth}get dragging(){return this.#s.kind==="dragging"}#a(e){const s=this.#s;s.kind!=="dragging"||s.pointerId!==e.pointerId||(this.#s=ks,this.#l(),this.#e.requestUpdate())}#o(e){const s=e===this.#i.layout().defaultWidth?null:e;s!==this.#t&&(this.#t=s,this.#e.requestUpdate())}#l(){this.#t===null?this.#n?.remove(this.#r):this.#n?.write(this.#r,this.#t)}}const Nc=[Ve,St,B`
|
|
1294
|
+
`,xl=t=>{const e=[...document.body.querySelectorAll("*")].filter(s=>s.localName.startsWith("dpk-template-")&&!s.querySelector(`:scope > .${rs}`));if(e.length!==0){document.head.append(Object.assign(document.createElement("style"),{textContent:bl}));for(const s of e)s.append(vl(s,t))}},vl=(t,e)=>{const s=D(We(Ke(t))),n=document.createElement("select");n.className=rs,n.slot="header",n.setAttribute("aria-label",s.versionLabel),n.title=s.versionLabel;const r=a=>{const o=dr({current:e,requested:ns(location.search)!==null,published:a,text:{pinned:s.versionPinned,latest:s.versionLatest}});n.replaceChildren(...o.options.map(l=>Object.assign(document.createElement("option"),{value:l.value,textContent:l.label}))),n.value=o.value},i=()=>{pr().then(r,a=>console.warn(a))};return n.addEventListener("pointerenter",i,{once:!0}),n.addEventListener("focus",i,{once:!0}),n.addEventListener("change",()=>hr(n.value===""?null:n.value)),r(null),n},yl=T({value:m()}),wl=t=>e=>{if(!(e instanceof CustomEvent))return;const s=S(yl,e.detail);s.success&&t(s.output.value)},is=t=>e=>{const s=de(e.target,HTMLSelectElement);s!==null&&t(s.value)},$l=t=>e=>{const s=de(e.target,HTMLInputElement);s!==null&&t(s.checked)},Oe=t=>t==="light"||t==="dark"?t:null,ur=t=>t.authored??t.environment,fr=t=>t.preference??ur(t),Sl=t=>{const e=fr(t)==="dark"?"light":"dark";return e===ur(t)?null:e},gr=Z(fe({value:v(m(),ie(/^element:.+/)),label:v(m(),w(1)),group:P(m())})),Al=T({targets:gr,providers:Z(T({id:v(m(),w(1)),results:Z(Un)}))}),Cl=fe({target:v(m(),ie(/^element:.+/)),body:v(m(),jt(),w(1))}),mr=t=>t.group?`${t.group} \xB7 ${t.label}`:t.label,kr=(t,e,s)=>{const n=new Map(e.map(r=>[r.value,r]));return{...t,hasTarget:(r,i)=>t.hasTarget(r,i)||n.has(M(i)),commentTargets:(r,i)=>{const a=t.commentTargets(r,i),o=new Set(a.map(l=>l.value));return[...a,...e.filter(l=>!o.has(l.value))]},describe:(r,i,a)=>{if(q(r)){const c=s.get(r.id),p=n.get(M(r.target));return{title:c?.title??r.type,...c?.summary===void 0?{}:{summary:c.summary},tone:c?.tone??"update",targetLabel:p?mr(p):r.target.id}}const o=t.describe(r,i,a),l=r.type==="comment"&&!t.hasTarget(i,r.target)?n.get(M(r.target)):void 0;return l===void 0?o:{...o,targetLabel:mr(l)}},serialize:r=>q(r)?`${r.type} ${M(r.target)} ${JSON.stringify(r.payload)}`:t.serialize(r)}},br=typeof globalThis=="object"&&globalThis||typeof window=="object"&&window||typeof self=="object"&&self||typeof global=="object"&&global||(function(){return this})();function xr(t){return typeof br.Buffer<"u"&&br.Buffer.isBuffer(t)}function vr(t){if(!t||typeof t!="object")return!1;const e=Object.getPrototypeOf(t);return e===null||e===Object.prototype||Object.getPrototypeOf(e)===null?Object.prototype.toString.call(t)==="[object Object]":!1}function yr(t){return Object.getOwnPropertySymbols(t).filter(e=>Object.prototype.propertyIsEnumerable.call(t,e))}function wr(t){return t==null?t===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(t)}const Tl="[object RegExp]",El="[object String]",_l="[object Number]",Rl="[object Boolean]",Ll="[object Symbol]",zl="[object Date]",Pl="[object Map]",Ol="[object Set]",Ml="[object Array]",jl="[object Function]",Il="[object ArrayBuffer]",as="[object Object]",ql="[object Error]",Nl="[object DataView]",Dl="[object Uint8Array]",Ul="[object Uint8ClampedArray]",Bl="[object Uint16Array]",Hl="[object Uint32Array]",Fl="[object BigUint64Array]",Kl="[object Int8Array]",Wl="[object Int16Array]",Zl="[object Int32Array]",Vl="[object BigInt64Array]",Gl="[object Float32Array]",Jl="[object Float64Array]";function Yl(t,e){return t===e||Number.isNaN(t)&&Number.isNaN(e)}function Ql(t,e,s){return Me(t,e,void 0,void 0,void 0,void 0,s)}function Me(t,e,s,n,r,i,a){const o=a(t,e,s,n,r,i);if(o!==void 0)return o;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 je(t,e,i,a)}return je(t,e,i,a)}function je(t,e,s,n){if(Object.is(t,e))return!0;let r=wr(t),i=wr(e);if(r==="[object Arguments]"&&(r=as),i==="[object Arguments]"&&(i=as),r!==i)return!1;switch(r){case El:return t.toString()===e.toString();case _l:return Yl(t.valueOf(),e.valueOf());case Rl:case zl:case Ll:return Object.is(t.valueOf(),e.valueOf());case Tl:return t.source===e.source&&t.flags===e.flags;case jl:return t===e}s=s??new Map;const a=s.get(t),o=s.get(e);if(a!=null&&o!=null)return a===e;s.set(t,e),s.set(e,t);try{switch(r){case Pl:if(t.size!==e.size)return!1;for(const[l,c]of t.entries())if(!e.has(l)||!Me(c,e.get(l),l,t,e,s,n))return!1;return!0;case Ol:{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=>Me(d,u,void 0,t,e,s,n));if(h===-1)return!1;c.splice(h,1)}return!0}case Ml:case Dl:case Ul:case Bl:case Hl:case Fl:case Kl:case Wl:case Zl:case Vl:case Gl:case Jl:if(xr(t)!==xr(e)||t.length!==e.length)return!1;for(let l=0;l<t.length;l++)if(!Me(t[l],e[l],l,t,e,s,n))return!1;return!0;case Il:return t.byteLength!==e.byteLength?!1:je(new Uint8Array(t),new Uint8Array(e),s,n);case Nl:return t.byteLength!==e.byteLength||t.byteOffset!==e.byteOffset?!1:je(new Uint8Array(t),new Uint8Array(e),s,n);case ql:return t.name===e.name&&t.message===e.message;case as:{if(!(je(t.constructor,e.constructor,s,n)||vr(t)&&vr(e)))return!1;const l=[...Object.keys(t),...yr(t)],c=[...Object.keys(e),...yr(e)];if(l.length!==c.length)return!1;for(let p=0;p<l.length;p++){const d=l[p],h=t[d];if(!Object.hasOwn(e,d))return!1;const u=e[d];if(!Me(h,u,d,t,e,s,n))return!1}return!0}default:return!1}}finally{s.delete(t),s.delete(e)}}function Xl(){}function ot(t,e){return Ql(t,e,Xl)}const $r="page",Sr=t=>M(t),Ar=(t,e,s,n=new Map)=>{let r=e;const i=[],a=[],o=[],l=[],c=new Map;for(const d of s){if(d.type===L)continue;if(q(d)){const f=n.get(d.id);f===void 0||f.stale!==void 0?a.push({action:d,reason:f?.stale??"target-missing"}):i.push(d);continue}const h=rt(t.actions,d.type);if(!h){a.push({action:d,reason:"unsupported-action-type"});continue}const u=t.apply(r,d);if(u===null){a.push({action:d,reason:t.hasTarget(r,d.target)?"constraint-violated":"target-missing"});continue}if(h.mode!=="append"&&os(t,r,u)){o.push(d);continue}r=u,i.push(d)}for(const d of s){if(d.type!==L)continue;if(d.target.type!==$r&&!t.hasTarget(r,d.target)){a.push({action:d,reason:"target-missing"});continue}l.push(d);const h=Sr(d.target);c.set(h,[...c.get(h)??[],d])}const p=new Map(s.map((d,h)=>[d.id,h]));return a.sort((d,h)=>(p.get(d.action.id)??0)-(p.get(h.action.id)??0)),{base:e,state:r,actions:s,applied:i,stale:a,obsolete:o,comments:l,commentsByTarget:c}},os=(t,e,s)=>e===s?!0:t.canonicalState===void 0?ot(e,s):ot(t.canonicalState(e),t.canonicalState(s)),Cr=t=>{const e=new Set(t.obsolete.map(s=>s.id));return t.actions.filter(s=>!e.has(s.id))},ec=(t,e,s,n)=>{let r=e;const i=n??Tr(r).map(a=>a.id);for(const a of[...i].reverse())r=tc(t,r,s,a,n!==void 0)??r;return r},Tr=t=>t.applied.filter(e=>!q(e)),tc=(t,e,s,n,r)=>{const i=Tr(e),a=i.findIndex(h=>h.id===n),o=i[a];if(o===void 0)return null;const l=i.slice(0,a),c=[...r?sc(t,e.base,i,a):[],...nc(t,l,o)],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=rc(t,e,s,h);if(u!==null)return u}return null},sc=(t,e,s,n)=>{const r=[];let i=e;for(const a of s.slice(0,n+1))r.push(i),i=t.apply(i,a)??i;return r.flatMap((a,o)=>os(t,a,i)?[s.slice(o,n+1).map(l=>l.id)]:[])},nc=(t,e,s)=>{const n=Er(s),r=e.filter(l=>Er(l).some(c=>n.includes(c))),i=_r(t,s),a=r.filter(l=>_r(t,l)===i),o=l=>l.map((c,p)=>[...l.slice(p).map(d=>d.id),s.id]);return[...o(r),...o(a),...r.map(l=>[l.id,s.id]),...r.map(l=>[l.id])]},Er=t=>{const e=t.target.type===$r?[]:t.target.id.split("."),s=typeof t.payload=="object"&&t.payload!==null?Object.values(t.payload).filter(n=>typeof n=="string"&&n!==""):[];return[...e,...s]},_r=(t,e)=>rt(t.actions,e.type)?.mode,rc=(t,e,s,n)=>{const r=new Set(e.stale.map(a=>a.action.id)),i=new Set(n);for(;;){const a=s(e.actions.filter(l=>!i.has(l.id))),o=a.stale.filter(l=>!r.has(l.action.id)).map(l=>l.action);if(o.length===0)return os(t,a.state,e.state)?a:null;if(o.some(l=>l.type===L||q(l)))return null;for(const l of o)i.add(l.id)}},ic=T({v:ue(1),template:v(m(),w(1)),actions:Z(V())});class ls{constructor(e){this.storage=e}load(e,s){try{const n=this.storage.getItem(e);if(n===null)return[];const r=S(ic,JSON.parse(n));return!r.success||r.output.template!==s?[]:r.output.actions.flatMap(i=>{const a=S(ae,i);return a.success?[a.output]:[]})}catch{return[]}}save(e,s,n){const r={v:1,template:s,actions:n};try{this.storage.setItem(e,JSON.stringify(r))}catch{}}clear(e){try{this.storage.removeItem(e)}catch{}}}class cs{constructor(){this.store=new Map}load(e,s){return new ls({getItem:n=>this.store.get(n)??null,setItem:(n,r)=>{this.store.set(n,r)},removeItem:n=>{this.store.delete(n)}}).load(e,s)}save(e,s,n){this.store.set(e,JSON.stringify({v:1,template:s,actions:n}))}clear(e){this.store.delete(e)}}const ds=()=>{try{if(typeof localStorage<"u")return new ls(localStorage)}catch{}return new cs},ps=t=>`dev-process-kit:draft:${typeof location>"u"?"local":`${location.pathname}${location.search}`}:${t}`,ac=Z(V());class Rr{#e;#r;#n={targets:[],providers:[]};#i=new Map;#s;#t;#a;#l;#o;#d=new Set;#v=[];#x=0;constructor(e){this.#e=e.definition,this.#r=kr(e.definition,[],this.#i),this.#s=e.base,this.#o=e.storageKey??ps(e.definition.name),this.#l=e.storage===void 0?ds():e.storage;const s=e.initialActions??this.#l?.load(this.#o,this.definition.name)??[];this.#t=zr(this.definition,s),this.#a=this.#c(this.#t),this.#k()&&this.#m()}get definition(){return this.#r}setComponentSnapshot(e){const s=qt(Al,e);if(!ot(s,this.#n)){this.#n=s,this.#f(),this.#a=this.#c(this.#t);for(const n of this.#d)n()}}setTemplate(e){this.#e=e,this.#f(),this.#a=this.#c(this.#t);for(const s of this.#d)s()}#f(){this.#i=Bn(this.#t,this.#n.providers),this.#r=kr(this.#e,this.#n.targets,this.#i)}#c(e){return Ar(this.definition,this.#s,e,Bn(e,this.#n.providers))}get base(){return this.#s}get actions(){return this.#t}get derivation(){return this.#a}get lastIssues(){return this.#v}get prunedCount(){return this.#x}descriptorFor(e,s){return Lr(this.definition,e,s)}dispatch(e){const s=this.#h(e,this.#a.state);if(!s.ok)return this.#p([s.issue]);const n=this.descriptorFor(s.action.type,s.action.target);return n?(this.#u(Ut(this.#t,s.action,n),[s.action.id]),{ok:!0,id:s.action.id}):this.#p([{path:"type",message:"unknown action type"}])}dispatchBatch(e){const s=S(ac,e);if(!s.success)return this.#p([oe(s.issues)]);const n=s.output;if(n.length===0)return{ok:!0,ids:[]};let r=this.#t,i=this.#a.state;const a=[];for(const o of n){const l=this.#h(o,i);if(!l.ok)return this.#p([l.issue]);const c=l.action,p=this.descriptorFor(c.type,c.target);if(!p)return this.#p([{path:"type",message:"unknown action type"}]);if((c.type==="comment"||q(c)?c.target.type==="page"||this.definition.hasTarget(i,c.target)?i:null:this.definition.apply(i,c))===null)return this.#p([{path:"target",message:"batch action is not applicable"}]);r=Ut(r,c,p),i=this.#c(r).state,a.push(c.id)}return this.#u(r,a),{ok:!0,ids:a}}#h(e,s){const n=S(In,e);if(!n.success)return{ok:!1,issue:oe(n.issues)};const r=this.descriptorFor(n.output.type,typeof n.output.target=="string"?Nt(n.output.target,"page"):n.output.target);if(!r)return{ok:!1,issue:{path:"type",message:`unknown action type "${n.output.type}"`}};const i=eo(n.output,r);if(!i.ok)return i;const a=this.definition.canonicalTarget?.(s,i.action.target)??i.action.target;return{ok:!0,action:{...i.action,target:a}}}#p(e){return this.#v=e,{ok:!1,issues:e}}editComment(e,s){const n=this.#t.find(o=>o.id===e);if(n?.type!==L)return this.#p([{path:"id",message:`no comment "${e}" in the draft`}]);if(ze(n)===s)return{ok:!0,id:e};const r=S(Ht.schema,{...n,payload:{body:s}});if(!r.success)return this.#p([oe(r.issues)]);const i=S(ae,r.output);if(!i.success)return this.#p([oe(i.issues)]);const a=i.output;return this.#u(this.#t.map(o=>o===n?a:o),[]),{ok:!0,id:e}}removeAction(e){const s=this.#t.filter(n=>n.id!==e);s.length!==this.#t.length&&this.#u(s)}clearActions(){this.#t.length>0&&this.#u([])}replaceActions(e){this.#u(zr(this.definition,e))}setBase(e){this.#s=e,this.#u(this.#t)}subscribe(e){return this.#d.add(e),()=>{this.#d.delete(e)}}exportDraft(e){return{template:this.definition.name,frameworkVersion:e,exportedAt:new Date().toISOString(),actions:this.#t}}#u(e,s){this.#v=[],this.#t=e,this.#f(),this.#a=this.#c(this.#t),this.#k(s),this.#m();for(const n of this.#d)n()}#k(e){const s=this.#y(),n=ec(this.definition,this.#a,r=>this.#c(r),e);return n===this.#a?s:(this.#x+=this.#t.length-n.actions.length,this.#t=[...n.actions],this.#f(),this.#a=this.#c(this.#t),this.#y(),!0)}#y(){return this.#a.obsolete.length===0?!1:(this.#x+=this.#a.obsolete.length,this.#t=Cr(this.#a),this.#f(),this.#a=this.#c(this.#t),!0)}#m(){this.#l?.save(this.#o,this.definition.name,this.#t)}}const Lr=(t,e,s)=>e==="comment"?Ht:s!==void 0&&q({type:e,target:s})?io:rt(t.actions,e),zr=(t,e)=>e.flatMap(s=>{const n=S(ae,s);if(!n.success)return[];const r=n.output,i=Lr(t,r.type,r.target);if(!i)return[];const a=S(i.schema,r);if(!a.success)return[];const o=S(ae,a.output);return o.success?[o.output]:[]}),oc=()=>({status:{kind:"idle"},request:0}),lc=(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}},cc=(t,e)=>{if(t.actions===0||t.railOpen)return null;const s=D(t.locale),n=e.status;return{send:t.sendable?{label:n.kind==="sending"?s.handoffSending:n.kind==="sent"?s.handoffSent:s.handoffSend,disabled:n.kind==="sending"}:null,copy:n.kind==="copied"?{label:s.handoffCopied,status:"copied"}:n.kind==="copy-failed"?{label:s.handoffCopyFailed,status:"failed"}:{label:s.handoffCopy,status:"idle"},note:n.kind==="send-failed"?Yt(n.reason,t.locale):null}},Pr=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()}},dc=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:s=>{const n=typeof s=="string"?s:M(s);return e.commentsByTarget.get(n)?.length??0},dispatch:s=>t.dispatch(s),dispatchBatch:s=>t.dispatchBatch(s),navigate:(s,n)=>t.navigate(s,n),hashFor:s=>t.hashFor(s),requestComment:s=>t.requestComment(s)}},pc=(t,e)=>{const s=()=>Pr(t);return{version:N,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:n=>t.dispatch(n),dispatchBatch:n=>t.dispatchBatch(n),comment:(n,r)=>t.dispatch({type:L,target:n,payload:{body:r}}),editComment:(n,r)=>t.editComment(n,r),removeAction:n=>t.removeAction(n),clearActions:()=>t.clearActions(),importDraft:n=>t.controller().replaceActions(n),navigate:(n,r)=>t.navigate(n,r),hashFor:n=>t.hashFor(n),snapshot:s,exportDraft:()=>t.controller().exportDraft(N),exportBrief:()=>Gt(s(),t.controller().definition,N),subscribe:n=>t.subscribe(n)}},hs=(t,e)=>typeof t=="object"&&t!==null&&e.every(s=>typeof Reflect.get(t,s)=="function"),hc=t=>hs(t,["use"]),uc=t=>hs(t,["anchorFor","canSendToClaude","sendToClaude"]),fc=t=>hs(t,["collection"]),Or=async(t,e)=>{try{return await t.use(e)}catch{return null}},gc=(t,e)=>({async canSend(){try{return await t.canSendToClaude()==="available"}catch{return!1}},async send({brief:s,draft:n,anchor:r}){let i=xo(s);if(i===null){if(e===null)return{ok:!1,reason:"too_large"};try{const a=e.collection(mo).doc();await a.set({brief:s,draft:n,createdAt:new Date().toISOString()}),i=vo(a.path)}catch{return{ok:!1,reason:"storage"}}}try{return await t.sendToClaude({anchor:await t.anchorFor(r),text:i}),{ok:!0}}catch(a){return{ok:!1,reason:wo(a)}}}}),mc=async t=>{if(!hc(t))return null;const[e,s]=await Promise.all([Or(t,"comments"),Or(t,"db")]);return uc(e)?gc(e,fc(s)?s:null):null},kc=()=>Reflect.get(globalThis,"claude");class bc{#e;#r;#n=null;#i=!1;constructor(e,s=kc){this.#e=e,this.#r=s,e.addController(this)}get available(){return this.#i}hostConnected(){this.#n??=mc(this.#r()),this.#s(),window.addEventListener("focus",this.#s)}hostDisconnected(){window.removeEventListener("focus",this.#s)}async send(e){const s=await this.#n;if(!s)return{ok:!1,reason:"forbidden"};const n=await s.send(e);return this.#s(),n}#s=async()=>{const e=await this.#n,s=e?await e.canSend():!1;s!==this.#i&&(this.#i=s,this.#e.requestUpdate())}}const us=(t,e)=>({read(s){try{const n=t.getItem(s);return n===null?null:e(JSON.parse(n))}catch{return null}},write(s,n){try{return t.setItem(s,JSON.stringify(n)),!0}catch{return!1}},remove(s){try{t.removeItem(s)}catch{}}}),G=t=>{const e=new Map;return us({getItem:s=>e.get(s)??null,setItem:(s,n)=>{e.set(s,n)},removeItem:s=>{e.delete(s)}},t)},Ie=t=>{try{if(typeof localStorage<"u")return us(localStorage,t)}catch{}return G(t)},xc=t=>{try{if(typeof sessionStorage<"u")return us(sessionStorage,t)}catch{}return G(t)},fs="dev-process-kit:color-scheme",vc="(prefers-color-scheme: dark)",Mr=()=>typeof matchMedia=="function"?matchMedia(vc):null,jr=()=>Oe(document.documentElement.dataset.theme)??(Mr()?.matches===!0?"dark":"light");class yc{#e;#r;#n=null;#i=null;#s="light";#t=null;#a=null;constructor(e,s){this.#e=e,this.#r=s,e.addController(this)}hostConnected(){this.#n===null&&(this.#n=this.#r()?Ie(Oe):G(Oe),this.#i=this.#n.read(fs)),this.#s=jr(),this.#t=Mr(),this.#t?.addEventListener("change",this.#o),this.#a=new MutationObserver(this.#o),this.#a.observe(document.documentElement,{attributes:!0,attributeFilter:["data-theme"]})}hostDisconnected(){this.#t?.removeEventListener("change",this.#o),this.#t=null,this.#a?.disconnect(),this.#a=null}resolve(e){return fr(this.#l(e))}toggle(e){this.#i=Sl(this.#l(e)),this.#i===null?this.#n?.remove(fs):this.#n?.write(fs,this.#i),this.#e.requestUpdate()}#l(e){return{preference:this.#i,authored:e,environment:this.#s}}#o=()=>{const e=jr();e!==this.#s&&(this.#s=e,this.#e.requestUpdate())}}const wc=(t,e)=>{const s=[],n=r=>{(r===t||r instanceof ShadowRoot)&&e?.(r);for(const i of r.children)i.hasAttribute("data-template")||(("commentTargets"in i||"elementActions"in i)&&s.push(i),n(i),i.shadowRoot&&n(i.shadowRoot))};return n(t),s},Ir=(t,e)=>{const s=new Map;for(const n of t)s.set(e(n),(s.get(e(n))??0)+1);return t.filter(n=>s.get(e(n))===1)},qr=t=>Ir(t.filter(e=>"elementActions"in e&&e.id.length>0),e=>e.id),Nr=(t,e)=>{for(const s of qr(t)){const n=oo(e,s.id),r=Reflect.get(s,"elementActions");Array.isArray(r)&&r.length===n.length&&n.every((a,o)=>{const l=r[o];return typeof l=="object"&&l!==null&&"id"in l&&l.id===a.id})||Reflect.set(s,"elementActions",n)}},$c=t=>{const e=Reflect.get(t,"elementActionResults");return Array.isArray(e)?e.flatMap(s=>{const n=S(Un,s);return n.success?[n.output]:[]}):[]},Sc=t=>{const e=[];for(const s of t){if(!("commentTargets"in s))continue;const n=S(gr,s.commentTargets);n.success&&e.push(...n.output)}return{targets:Ir(e,s=>s.value),providers:qr(t).map(s=>({id:s.id,results:$c(s)}))}},Ac=2400;class Cc{#e=oc();#r=null;#n;constructor(e){this.#n=e,e.addController(this)}get state(){return this.#e}hostDisconnected(){this.#t()}async copy(e){this.#i({kind:"copy-started"});const s=this.#e.request,n=await Jt(e()).catch(()=>!1);this.#i({kind:"copy-finished",request:s,ok:n}),this.#s(s)}async send(e){if(this.#e.status.kind==="sending")return;this.#i({kind:"send-started"});const s=this.#e.request,n=await e().catch(()=>({ok:!1,reason:"error"}));this.#i({kind:"send-finished",request:s,outcome:n}),n.ok&&this.#s(s)}#i(e){(e.kind==="copy-started"||e.kind==="send-started")&&this.#t(),this.#e=lc(this.#e,e),this.#n.requestUpdate()}#s(e){e===this.#e.request&&(this.#t(),this.#r=setTimeout(()=>{this.#r=null,this.#i({kind:"settled",request:e})},Ac))}#t(){this.#r!==null&&clearTimeout(this.#r),this.#r=null}}const gs="dev-process-kit:locale";class Tc{#e;#r;#n;#i=null;#s=null;#t;#a;constructor(e,s,n){this.#e=e,this.#r=s,this.#n=n,e.addController(this)}get authored(){if(this.#t===void 0)return We(Ke(this.#e));const e=this.#e.parentNode;return We(this.#t??(e===null?null:Ke(e)))}get locale(){return this.#a??this.#l()}#l(){return $i({preference:this.#s,authored:this.authored})}hostConnected(){this.#i===null&&(this.#i=this.#r()?Ie(Zs):G(Zs),this.#s=this.#i.read(gs)),this.#t??=this.#e.getAttribute("lang"),this.#o()}pick(e){this.#s=Si(e,this.authored),this.#s===null?this.#i?.remove(gs):this.#i?.write(gs,this.#s),this.#o(),this.#e.requestUpdate()}#o(){const e=this.#s??this.#t??null;e===null?this.#e.removeAttribute("lang"):this.#e.getAttribute("lang")!==e&&this.#e.setAttribute("lang",e);const s=this.#l();if(s===this.#a)return;const n=this.#a===void 0;this.#a=s,this.#n(),(!n||this.#s!==null)&&document.dispatchEvent(new Event(wt))}}const Ec="(max-width: 760px)",_c=()=>typeof matchMedia=="function"?matchMedia(Ec):null;class Rc{#e;#r=null;#n=!1;constructor(e){this.#e=e,e.addController(this)}hostConnected(){this.#r=_c(),this.#n=this.#r?.matches===!0,this.#r?.addEventListener("change",this.#i)}hostDisconnected(){this.#r?.removeEventListener("change",this.#i),this.#r=null}get narrow(){return this.#n}#i=e=>{this.#n=e.matches,this.#e.requestUpdate()}}const Dr=()=>Zt(typeof location>"u"?"":location.hash),Lc=(t,e)=>{if(typeof history>"u")return;const s=`${location.pathname}${location.search}${ge(t)}`;`${location.pathname}${location.search}${location.hash}`!==s&&(e?history.replaceState(null,"",s):history.pushState(null,"",s))};class zc{#e;#r=null;#n=0;constructor(e){this.#e=e}get orphans(){return this.#n}route(){const e=this.#e.renderRoot,s=de(e.querySelector('slot[name="preview"]'),HTMLSlotElement);if(s===null)return;this.#r!==s&&(this.#r=s,s.addEventListener("slotchange",this.#i));const n=new Set(Array.from(e.querySelectorAll("slot")).map(i=>i.getAttribute("name")??"")),r=s.assignedElements();for(const i of r){const a=i.getAttribute("data-preview-id");if(!a)continue;const o=`preview:${a}`;i.getAttribute("slot")!==o&&n.has(o)&&i.setAttribute("slot",o)}r.length!==this.#n&&(this.#n=r.length,queueMicrotask(()=>this.#e.requestUpdate()))}#i=()=>{queueMicrotask(()=>this.route())}}const J={min:180,max:560,step:16,largeStep:64},Pc={side:"left",defaultWidth:260},lt=t=>Math.round(Math.min(J.max,Math.max(J.min,t))),Ur=t=>typeof t=="number"&&Number.isFinite(t)?lt(t):null,ms=(t,e)=>t==="left"?e:-e,Oc=(t,e)=>lt(t.startWidth+ms(t.side,e-t.startX)),Mc=(t,e,{key:s,shiftKey:n})=>{const r=n?J.largeStep:J.step;switch(s){case"ArrowLeft":return lt(t+ms(e,-r));case"ArrowRight":return lt(t+ms(e,r));case"Home":return J.min;case"End":return J.max;default:return null}},Br=t=>typeof t=="boolean"?t:null,jc=t=>t==="left"?"right":"left",Ic=(t,e)=>e?{action:"expand",points:jc(t)}:{action:"collapse",points:t},qc=t=>`dev-process-kit:sidebar-collapsed:${t}`;class Nc{#e;#r;#n=null;#i="";#s=!1;#t=!1;constructor(e,s){this.#e=e,this.#r=s,e.addController(this)}hostConnected(){this.#n===null&&(this.#n=this.#r.persist()?Ie(Br):G(Br),this.#i=qc(this.#r.template()),this.#s=this.#n.read(this.#i)??!1)}get collapsed(){return this.#s}get drawerOpen(){return this.#t}toggleDrawer(){this.#t=!this.#t,this.#e.requestUpdate()}closeDrawer(){this.#t&&(this.#t=!1,this.#e.requestUpdate())}toggle(){this.#s=!this.#s,this.#s?this.#n?.write(this.#i,!0):this.#n?.remove(this.#i),this.#e.requestUpdate()}}const Dc=t=>`dev-process-kit:sidebar-width:${t}`,ks={kind:"idle"};class Uc{constructor(e,s){this.#n=null,this.#i="",this.#s=null,this.#t=ks,this.handlers={pointerdown:n=>{n.button===0&&(n.preventDefault(),n.currentTarget instanceof Element&&n.currentTarget.setPointerCapture(n.pointerId),this.#t={kind:"dragging",pointerId:n.pointerId,side:this.#r.layout().side,startX:n.clientX,startWidth:this.width},this.#e.requestUpdate())},pointermove:n=>{const r=this.#t;r.kind!=="dragging"||r.pointerId!==n.pointerId||this.#l(Oc(r,n.clientX))},pointerup:n=>this.#a(n),pointercancel:n=>this.#a(n),keydown:n=>{const r=Mc(this.width,this.#r.layout().side,n);r!==null&&(n.preventDefault(),this.#l(r),this.#o())},dblclick:()=>{this.#l(this.#r.layout().defaultWidth),this.#o()}},this.#e=e,this.#r=s,e.addController(this)}#e;#r;#n;#i;#s;#t;hostConnected(){this.#n===null&&(this.#n=this.#r.persist()?Ie(Ur):G(Ur),this.#i=Dc(this.#r.template()),this.#s=this.#n.read(this.#i))}hostDisconnected(){this.#t=ks}get width(){return this.#s??this.#r.layout().defaultWidth}get dragging(){return this.#t.kind==="dragging"}#a(e){const s=this.#t;s.kind!=="dragging"||s.pointerId!==e.pointerId||(this.#t=ks,this.#o(),this.#e.requestUpdate())}#l(e){const s=e===this.#r.layout().defaultWidth?null:e;s!==this.#s&&(this.#s=s,this.#e.requestUpdate())}#o(){this.#s===null?this.#n?.remove(this.#i):this.#n?.write(this.#i,this.#s)}}const Bc=[Ve,St,B`
|
|
1263
1295
|
:host {
|
|
1264
1296
|
display: block;
|
|
1265
1297
|
min-height: 100%;
|
|
@@ -1288,8 +1320,9 @@ The brief is too long for a comment, so it is stored in this artifact's database
|
|
|
1288
1320
|
position: relative;
|
|
1289
1321
|
z-index: 20;
|
|
1290
1322
|
display: flex;
|
|
1323
|
+
flex-wrap: wrap;
|
|
1291
1324
|
align-items: center;
|
|
1292
|
-
gap: 14px;
|
|
1325
|
+
gap: 8px 14px;
|
|
1293
1326
|
min-height: 60px;
|
|
1294
1327
|
/* Right padding keeps the header content clear of the fixed review button. */
|
|
1295
1328
|
padding: 10px 72px 10px 16px;
|
|
@@ -1356,11 +1389,16 @@ The brief is too long for a comment, so it is stored in this artifact's database
|
|
|
1356
1389
|
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.22);
|
|
1357
1390
|
}
|
|
1358
1391
|
|
|
1392
|
+
/* The title takes what the header has left: the template's header content
|
|
1393
|
+
keeps its own width, and only a title too long for the rest ellipsizes.
|
|
1394
|
+
Header content with no room beside the title wraps to a row of its own
|
|
1395
|
+
rather than being squeezed. */
|
|
1359
1396
|
.dpk-title {
|
|
1397
|
+
flex: 1 1 0%;
|
|
1360
1398
|
display: flex;
|
|
1361
1399
|
flex-direction: column;
|
|
1362
1400
|
gap: 3px;
|
|
1363
|
-
min-width:
|
|
1401
|
+
min-width: min(160px, 100%);
|
|
1364
1402
|
}
|
|
1365
1403
|
|
|
1366
1404
|
.dpk-title h1 {
|
|
@@ -1384,7 +1422,7 @@ The brief is too long for a comment, so it is stored in this artifact's database
|
|
|
1384
1422
|
}
|
|
1385
1423
|
|
|
1386
1424
|
.dpk-header-slot {
|
|
1387
|
-
flex: 1;
|
|
1425
|
+
flex: 0 1 auto;
|
|
1388
1426
|
min-width: 0;
|
|
1389
1427
|
display: flex;
|
|
1390
1428
|
align-items: center;
|
|
@@ -1534,7 +1572,9 @@ The brief is too long for a comment, so it is stored in this artifact's database
|
|
|
1534
1572
|
|
|
1535
1573
|
/* --------------------------------------------------------------- body */
|
|
1536
1574
|
|
|
1575
|
+
/* Positioned: the sidebar drawer and a narrow screen's review open over it. */
|
|
1537
1576
|
.dpk-body {
|
|
1577
|
+
position: relative;
|
|
1538
1578
|
display: flex;
|
|
1539
1579
|
min-height: 0;
|
|
1540
1580
|
}
|
|
@@ -1674,6 +1714,34 @@ The brief is too long for a comment, so it is stored in this artifact's database
|
|
|
1674
1714
|
outline: none;
|
|
1675
1715
|
}
|
|
1676
1716
|
|
|
1717
|
+
/*
|
|
1718
|
+
* A phone-width screen has no room for a column beside the main one: the
|
|
1719
|
+
* sidebar is a drawer that the strip's button slides over the main column,
|
|
1720
|
+
* leaving a sliver of it to tap the drawer shut.
|
|
1721
|
+
*/
|
|
1722
|
+
.dpk-body[data-sidebar-drawer] > .dpk-sidebar {
|
|
1723
|
+
position: absolute;
|
|
1724
|
+
top: 0;
|
|
1725
|
+
bottom: 0;
|
|
1726
|
+
left: 36px;
|
|
1727
|
+
z-index: 25;
|
|
1728
|
+
width: min(var(--dpk-sidebar-width), calc(100% - 36px - 48px));
|
|
1729
|
+
max-width: none;
|
|
1730
|
+
box-shadow: var(--dpk-shadow-lg);
|
|
1731
|
+
}
|
|
1732
|
+
|
|
1733
|
+
.dpk-body[data-sidebar-drawer][data-sidebar-side='right'] > .dpk-sidebar {
|
|
1734
|
+
left: auto;
|
|
1735
|
+
right: 36px;
|
|
1736
|
+
}
|
|
1737
|
+
|
|
1738
|
+
.dpk-sidebar-scrim {
|
|
1739
|
+
position: absolute;
|
|
1740
|
+
inset: 0;
|
|
1741
|
+
z-index: 24;
|
|
1742
|
+
background: color-mix(in srgb, var(--dpk-ink) 16%, transparent);
|
|
1743
|
+
}
|
|
1744
|
+
|
|
1677
1745
|
/* While dragging, the cursor stays put and nothing underneath (text, preview frames) reacts. */
|
|
1678
1746
|
.dpk-shell[data-resizing] {
|
|
1679
1747
|
cursor: col-resize;
|
|
@@ -1709,6 +1777,8 @@ The brief is too long for a comment, so it is stored in this artifact's database
|
|
|
1709
1777
|
.dpk-main-body {
|
|
1710
1778
|
flex: 1 0 auto;
|
|
1711
1779
|
display: grid;
|
|
1780
|
+
/* The column is as wide as the page, not as its widest unbreakable line. */
|
|
1781
|
+
grid-template-columns: minmax(0, 1fr);
|
|
1712
1782
|
align-content: start;
|
|
1713
1783
|
gap: 16px;
|
|
1714
1784
|
min-width: 0;
|
|
@@ -1716,6 +1786,24 @@ The brief is too long for a comment, so it is stored in this artifact's database
|
|
|
1716
1786
|
animation: dpk-rise 420ms var(--dpk-ease) backwards;
|
|
1717
1787
|
}
|
|
1718
1788
|
|
|
1789
|
+
/*
|
|
1790
|
+
* Scrolled to the end, the last of the content clears the hand-off dock
|
|
1791
|
+
* floating over the bottom right. \`--dpk-dock-clearance\` is how far up
|
|
1792
|
+
* that is; it reaches into components too, and a template's own floating
|
|
1793
|
+
* controls rise by it. \`:where\` lets a full-bleed template keep no padding.
|
|
1794
|
+
*/
|
|
1795
|
+
.dpk-shell:has(> .dpk-dock) {
|
|
1796
|
+
--dpk-dock-clearance: 64px;
|
|
1797
|
+
}
|
|
1798
|
+
|
|
1799
|
+
:where(.dpk-shell:has(> .dpk-dock)) .dpk-main-body {
|
|
1800
|
+
padding-bottom: calc(24px + var(--dpk-dock-clearance));
|
|
1801
|
+
}
|
|
1802
|
+
|
|
1803
|
+
:where(.dpk-shell:has(> .dpk-dock)) .dpk-sidebar {
|
|
1804
|
+
padding-bottom: calc(18px + var(--dpk-dock-clearance));
|
|
1805
|
+
}
|
|
1806
|
+
|
|
1719
1807
|
@keyframes dpk-rise {
|
|
1720
1808
|
from {
|
|
1721
1809
|
opacity: 0;
|
|
@@ -1853,6 +1941,47 @@ The brief is too long for a comment, so it is stored in this artifact's database
|
|
|
1853
1941
|
display: none;
|
|
1854
1942
|
}
|
|
1855
1943
|
|
|
1944
|
+
/*
|
|
1945
|
+
* Where a column of its own would leave the main column too little room,
|
|
1946
|
+
* the review opens over the main column's edge instead; on a phone it
|
|
1947
|
+
* takes the screen, below the review button that closes it.
|
|
1948
|
+
*/
|
|
1949
|
+
@media (max-width: 1100px) {
|
|
1950
|
+
.dpk-body:has(> .dpk-sidebar:not([hidden])) > .dpk-notes {
|
|
1951
|
+
position: absolute;
|
|
1952
|
+
top: 0;
|
|
1953
|
+
right: 0;
|
|
1954
|
+
bottom: 0;
|
|
1955
|
+
z-index: 30;
|
|
1956
|
+
max-width: 100%;
|
|
1957
|
+
box-shadow: var(--dpk-shadow-lg);
|
|
1958
|
+
}
|
|
1959
|
+
}
|
|
1960
|
+
|
|
1961
|
+
@media (max-width: 860px) {
|
|
1962
|
+
.dpk-notes {
|
|
1963
|
+
position: absolute;
|
|
1964
|
+
top: 0;
|
|
1965
|
+
right: 0;
|
|
1966
|
+
bottom: 0;
|
|
1967
|
+
z-index: 30;
|
|
1968
|
+
max-width: 100%;
|
|
1969
|
+
box-shadow: var(--dpk-shadow-lg);
|
|
1970
|
+
}
|
|
1971
|
+
}
|
|
1972
|
+
|
|
1973
|
+
@media (max-width: 760px) {
|
|
1974
|
+
.dpk-notes,
|
|
1975
|
+
.dpk-body:has(> .dpk-sidebar:not([hidden])) > .dpk-notes {
|
|
1976
|
+
position: fixed;
|
|
1977
|
+
inset: 0;
|
|
1978
|
+
z-index: 50;
|
|
1979
|
+
width: auto;
|
|
1980
|
+
padding-top: 60px;
|
|
1981
|
+
border-left: 0;
|
|
1982
|
+
}
|
|
1983
|
+
}
|
|
1984
|
+
|
|
1856
1985
|
/* ------------------------------------------------------------- footer */
|
|
1857
1986
|
|
|
1858
1987
|
.dpk-footer {
|
|
@@ -2020,18 +2149,43 @@ The brief is too long for a comment, so it is stored in this artifact's database
|
|
|
2020
2149
|
line-height: 1.6;
|
|
2021
2150
|
}
|
|
2022
2151
|
|
|
2152
|
+
/* The template's name repeats the mark above the title; the title needs the room more. */
|
|
2153
|
+
@media (max-width: 1100px) {
|
|
2154
|
+
.dpk-header-meta > .dpk-meta-name {
|
|
2155
|
+
display: none;
|
|
2156
|
+
}
|
|
2157
|
+
}
|
|
2158
|
+
|
|
2023
2159
|
@media (max-width: 720px) {
|
|
2024
|
-
/* The version select stays: it is the reader's only way to switch
|
|
2025
|
-
|
|
2160
|
+
/* The version select stays: it is the reader's only way to switch
|
|
2161
|
+
versions; so do the counts, the review's progress at a glance. */
|
|
2162
|
+
.dpk-header-meta > :not(.dpk-version, .dpk-meta-count) {
|
|
2026
2163
|
display: none;
|
|
2027
2164
|
}
|
|
2028
2165
|
|
|
2029
|
-
/*
|
|
2030
|
-
|
|
2031
|
-
|
|
2032
|
-
|
|
2166
|
+
/* On a phone the row may be narrower than both: the counts stay whole and
|
|
2167
|
+
the version select gives up its width instead. */
|
|
2168
|
+
.dpk-header-meta {
|
|
2169
|
+
min-width: 0;
|
|
2170
|
+
max-width: 100%;
|
|
2171
|
+
}
|
|
2172
|
+
|
|
2173
|
+
.dpk-header-meta > .dpk-version {
|
|
2174
|
+
display: flex;
|
|
2175
|
+
min-width: 0;
|
|
2033
2176
|
}
|
|
2034
2177
|
|
|
2178
|
+
.dpk-header-meta .dpk-version-select {
|
|
2179
|
+
width: 100%;
|
|
2180
|
+
min-width: 0;
|
|
2181
|
+
text-overflow: ellipsis;
|
|
2182
|
+
}
|
|
2183
|
+
|
|
2184
|
+
.dpk-header-meta > .dpk-meta-count {
|
|
2185
|
+
flex: none;
|
|
2186
|
+
}
|
|
2187
|
+
|
|
2188
|
+
/* The title takes the first row whole; the version select and tools wrap below it. */
|
|
2035
2189
|
.dpk-title {
|
|
2036
2190
|
flex: 1 0 100%;
|
|
2037
2191
|
}
|
|
@@ -2039,8 +2193,14 @@ The brief is too long for a comment, so it is stored in this artifact's database
|
|
|
2039
2193
|
.dpk-brand {
|
|
2040
2194
|
display: none;
|
|
2041
2195
|
}
|
|
2196
|
+
|
|
2197
|
+
/* The page's own content goes last, so a long one cannot push the version
|
|
2198
|
+
select and tools below it. */
|
|
2199
|
+
.dpk-header-slot {
|
|
2200
|
+
order: 1;
|
|
2201
|
+
}
|
|
2042
2202
|
}
|
|
2043
|
-
`],
|
|
2203
|
+
`],Hc=30,Fc=st(m(),T({base:m(),value:m()})),Hr=t=>{const e=S(Fc,t);return e.success?e.output:null},Kc=t=>t.key===void 0?JSON.stringify(["field",t.hosts,t.name,t.base]):JSON.stringify(["key",t.key,t.name]),Wc=(t,e,s)=>{const{[e]:n,...r}=t;if(s.value===s.base)return r;const i=Object.entries({...r,[e]:s});return Object.fromEntries(i.slice(Math.max(0,i.length-Hc)))},Zc=(t,e)=>{if(!(e in t))return t;const{[e]:s,...n}=t;return n},Vc=(t,e,s)=>{const n=t[e];return n===void 0||n.base!==s||n.value===s?null:n.value},Gc=new Set(["text","search","url","email","tel"]),Fr=t=>t instanceof HTMLTextAreaElement||t instanceof HTMLInputElement&&Gc.has(t.type)?t:null,Jc=(t,e)=>{const s=[];let n=e.getRootNode();for(;n instanceof ShadowRoot;){if(n.host===t)return s;s.unshift(n.host.localName),n=n.host.getRootNode()}return null},Yc=t=>{let e=t;for(;e!==null;){const s=e.getAttribute("data-dpk-text-key");if(s!==null&&s!=="")return s;const n=e.getRootNode();e=e.parentElement??(n instanceof ShadowRoot?n.host:null)}},Qc=t=>t.getAttribute("aria-label")??(t.placeholder||t.name||t.localName),bs=t=>typeof t=="string"?[t]:Array.isArray(t)?t.flatMap(bs):typeof t=="object"&&t!==null?Object.values(t).flatMap(bs):[],Kr=t=>t.replace(/\s+/g," ").trim();class Xc{#e;#r;#n=null;#i="";#s=new WeakMap;#t=new Set;constructor(e,s){this.#e=e,this.#r=s,e.addController(this)}hostConnected(){this.#n===null&&(this.#n=this.#r.persist()?xc(Hr):G(Hr),this.#i=this.#r.storageKey()),this.#e.addEventListener("focusin",this.#a),this.#e.addEventListener("input",this.#l)}hostDisconnected(){this.#e.removeEventListener("focusin",this.#a),this.#e.removeEventListener("input",this.#l)}settle(e){const s=new Set(e.flatMap(bs).map(Kr));for(const n of this.#t){if(!s.has(Kr(n.value)))continue;this.#t.delete(n);const r=this.#s.get(n);r!==void 0&&this.#d(Zc(this.#o(),r.id))}}#a=e=>{const s=Fr(e.composedPath()[0]);if(s===null||this.#t.has(s))return;const n=Jc(this.#e,s);if(n===null)return;const r=Yc(s),i=s.value,a=Kc({...r===void 0?{}:{key:r},hosts:n,name:Qc(s),base:i});this.#s.set(s,{id:a,base:i});const o=Vc(this.#o(),a,i);o!==null&&queueMicrotask(()=>{if(s.value===i){s.value=o;try{s.setSelectionRange(o.length,o.length)}catch{}this.#t.add(s),s.dispatchEvent(new Event("input",{bubbles:!0,composed:!0}))}})};#l=e=>{const s=Fr(e.composedPath()[0]),n=s===null?void 0:this.#s.get(s);if(!(s===null||n===void 0)){for(const r of this.#t)r.isConnected||this.#t.delete(r);this.#t.add(s),this.#d(Wc(this.#o(),n.id,{base:n.base,value:s.value}))}};#o(){return this.#n?.read(this.#i)??{}}#d(e){Object.keys(e).length===0?this.#n?.remove(this.#i):this.#n?.write(this.#i,e)}}class ed{#e;#r;#n;#i=null;#s=!1;constructor(e,s={}){this.#e=e,this.#r=s.fetchVersions??pr,this.#n=s.switchTo??hr,e.addController(this)}hostConnected(){}load(){this.#s||this.#i!==null||(this.#s=!0,this.#r().then(e=>{this.#i=e,this.#s=!1,this.#e.requestUpdate()},e=>{this.#s=!1,console.warn("dev-process-kit: could not list the published versions",e)}))}pick(e){e!==N&&this.#n(e===""?null:e)}render(e){const s=D(e),n=dr({current:N,requested:ns(location.search)!==null,published:this.#i,text:{pinned:s.versionPinned,latest:s.versionLatest}}),r=()=>this.load();return k`<span class="dpk-version"
|
|
2044
2204
|
>dev-process-kit@<select
|
|
2045
2205
|
class="dpk-version-select"
|
|
2046
2206
|
aria-label=${s.versionLabel}
|
|
@@ -2051,7 +2211,7 @@ The brief is too long for a comment, so it is stored in this artifact's database
|
|
|
2051
2211
|
>
|
|
2052
2212
|
${n.options.map(i=>k`<option value=${i.value} ?selected=${i.value===n.value}>${i.label}</option>`)}
|
|
2053
2213
|
</select></span
|
|
2054
|
-
>`}}class
|
|
2214
|
+
>`}}class td extends F{static{this.styles=Bc}static{this.properties={storageKey:{type:String,attribute:"storage-key"},storage:{type:String},notes:{type:String},theme:{type:String},notesOpen:{state:!0}}}#e=!1;#r=new zc(this);#n=new yc(this,()=>this.storage!=="off"&&this.storage!=="memory");#i=new bc(this);#s=new Cc(this);#t=new Uc(this,{persist:()=>this.storage!=="off"&&this.storage!=="memory",template:()=>this.definition.name,layout:()=>this.sidebarLayout});#a=new Nc(this,{persist:()=>this.storage!=="off"&&this.storage!=="memory",template:()=>this.definition.name});#l=new Rc(this);#o=new Xc(this,{persist:()=>this.storage!=="off"&&this.storage!=="memory",storageKey:()=>`${this.storageKey??ps(this.definition.name)}:unsent-text`});#d=!1;#v=new ed(this);#x=new Tc(this,()=>this.storage!=="off"&&this.storage!=="memory",()=>this.#c?.setTemplate(this.definition));#f;#c;#h=Wt;#p=null;#u=new Set;#k=null;#y;#m;#$;#S=[];#E;#D=new Promise(e=>{this.#E=e});#_;get locale(){return this.#x.locale}get definition(){const e=this.locale;return this.#f?.locale!==e&&(this.#f={locale:e,value:this.definitionFor(e)}),this.#f.value}connectedCallback(){super.connectedCallback(),this.dataset.template=this.definition.name,this.#e||(this.#e=!0,this.notesOpen=this.notes==="on"||this.notes==="open"),this.#R(),window.addEventListener("hashchange",this.#M),this.addEventListener("click",this.#N),this.addEventListener("dpk-comment-targets-change",this.#g),this.addEventListener("dpk-comment-request",this.#j),this.addEventListener("dpk-comment-submit",this.#I),this.addEventListener("dpk-element-action",this.#q),this.#$??=new MutationObserver(this.#g),this.#g()}disconnectedCallback(){super.disconnectedCallback(),window.removeEventListener("hashchange",this.#M),this.removeEventListener("click",this.#N),this.#m?.disconnect(),this.#$?.disconnect(),this.removeEventListener("dpk-comment-targets-change",this.#g),this.removeEventListener("dpk-comment-request",this.#j),this.removeEventListener("dpk-comment-submit",this.#I),this.removeEventListener("dpk-element-action",this.#q)}#R(e=0){if(this.#c){this.#L();return}if(this.childNodes.length===0&&e<2){queueMicrotask(()=>this.#R(e+1));return}this.#V()}#L(){this.#y||(this.#y=this.#c?.subscribe(()=>this.#Q()))}willUpdate(){this.dataset.theme=this.#n.resolve(Oe(this.theme))}updated(){this.#ee(),this.#X(),this.#d&&(this.#d=!1,this.renderRoot.querySelector(".dpk-sidebar-toggle")?.focus())}get api(){return this.#_??=this.#Z(),this.#_}get controller(){if(!this.#c)throw new Error(`<${this.tagName.toLowerCase()}> is not initialized yet`);return this.#c}get derivation(){return this.controller.derivation}get navigation(){return this.#h}dispatch(e){const s=this.controller.dispatch(e);return s.ok&&this.#o.settle([e.payload,e.note]),s.ok||(this.requestUpdate(),this.dispatchEvent(new CustomEvent("dpk-error",{detail:{issues:s.issues},bubbles:!0,composed:!0})),this.#b()),s}dispatchBatch(e){const s=this.controller.dispatchBatch(e);return s.ok&&this.#o.settle(e.flatMap(n=>[n.payload,n.note])),s.ok||(this.requestUpdate(),this.dispatchEvent(new CustomEvent("dpk-error",{detail:{issues:s.issues},bubbles:!0,composed:!0})),this.#b()),s}editComment(e,s){const n=this.controller.editComment(e,s);return n.ok&&this.#o.settle([s]),n.ok||(this.requestUpdate(),this.dispatchEvent(new CustomEvent("dpk-error",{detail:{issues:n.issues},bubbles:!0,composed:!0})),this.#b()),n}removeAction(e){this.controller.removeAction(e)}clearActions(){this.controller.clearActions()}navigate(e,s={}){const n=ge(this.#w());this.#h=Vt(this.#h,e,this.definition.navigationHierarchy),this.#A(s.replace??!1);const r=ge(this.#w());this.requestUpdate(),n!==r&&(this.#b(),this.dispatchEvent(new CustomEvent("dpk-navigate",{detail:{navigation:this.#h},bubbles:!0,composed:!0})))}hashFor(e){const s=this.#w();return ge(this.definition.resolveNavigation(this.derivation.state,Vt(s,e,this.definition.navigationHierarchy)))}requestComment(e){this.#p=typeof e=="string"?e:M(e),this.notesOpen=!0,this.requestUpdate()}get integratedReview(){return!1}get canSendToClaude(){return this.#i.available}sendToClaude(){return this.#i.send({brief:this.api.exportBrief(),draft:Bt(this.derivation.actions),anchor:this})}renderReviewPanel(e){return k`<dpk-component-comment-panel
|
|
2055
2215
|
.definition=${this.controller.definition}
|
|
2056
2216
|
.state=${e.state}
|
|
2057
2217
|
.navigation=${e.navigation}
|
|
@@ -2059,61 +2219,62 @@ The brief is too long for a comment, so it is stored in this artifact's database
|
|
|
2059
2219
|
.issues=${this.controller.lastIssues}
|
|
2060
2220
|
.exportBrief=${()=>this.api.exportBrief()}
|
|
2061
2221
|
.sendToClaude=${this.canSendToClaude?()=>this.sendToClaude():void 0}
|
|
2062
|
-
.pendingTarget=${this.#
|
|
2222
|
+
.pendingTarget=${this.#p}
|
|
2063
2223
|
.embedded=${this.integratedReview}
|
|
2064
2224
|
.onDelete=${s=>this.removeAction(s)}
|
|
2065
2225
|
.onEditComment=${(s,n)=>this.editComment(s,n)}
|
|
2066
2226
|
.onClear=${()=>this.clearActions()}
|
|
2067
|
-
.onComment=${(s,n)=>{const r=this.dispatch({type:
|
|
2068
|
-
></dpk-component-comment-panel>`}renderChrome(e,s){const n=e.actions.length,r=e.
|
|
2069
|
-
<div class="dpk-shell" ?data-resizing=${this.#
|
|
2227
|
+
.onComment=${(s,n)=>{const r=this.dispatch({type:L,target:s,payload:{body:n}});return r.ok&&(this.#p=null),r}}
|
|
2228
|
+
></dpk-component-comment-panel>`}renderChrome(e,s){const n=e.actions.length,r=e.actions.filter(u=>u.type===L).length,i=n-r,a=D(this.locale),o=s.sidebarHidden===!0||!s.sidebar&&!this.hasSidebarContent(),l=this.sidebarLayout.side,c=this.#F,p=!o&&this.#C&&(c?!this.#a.drawerOpen:this.#a.collapsed),d=o?g:this.#K(p,c),h=this.definition.title(e.state);return k`
|
|
2229
|
+
<div class="dpk-shell" ?data-resizing=${this.#t.dragging}>
|
|
2070
2230
|
<header class="dpk-header">
|
|
2071
2231
|
<span class="dpk-brand" aria-hidden="true"></span>
|
|
2072
2232
|
<div class="dpk-title">
|
|
2073
2233
|
<span class="dpk-template-mark">${this.definition.label}</span>
|
|
2074
|
-
<h1>${
|
|
2234
|
+
<h1 title=${h}>${h}</h1>
|
|
2075
2235
|
</div>
|
|
2076
2236
|
<div class="dpk-header-slot">
|
|
2077
2237
|
${s.header??g}
|
|
2078
2238
|
<slot name="header"></slot>
|
|
2079
2239
|
</div>
|
|
2080
2240
|
<div class="dpk-header-meta">
|
|
2081
|
-
${this.#
|
|
2082
|
-
<span>${this.definition.name}</span>
|
|
2241
|
+
${this.#v.render(this.locale)}
|
|
2242
|
+
<span class="dpk-meta-name">${this.definition.name}</span>
|
|
2083
2243
|
<span class="dpk-meta-count" data-active=${n>0?"true":"false"}>
|
|
2084
|
-
${
|
|
2244
|
+
${a.draftCount(i,r)}
|
|
2085
2245
|
</span>
|
|
2086
2246
|
</div>
|
|
2087
|
-
<div class="dpk-header-tools">${this.#
|
|
2247
|
+
<div class="dpk-header-tools">${this.#B()} ${this.#H()}</div>
|
|
2088
2248
|
</header>
|
|
2089
|
-
<div class="dpk-body" data-sidebar-side=${
|
|
2090
|
-
${
|
|
2249
|
+
<div class="dpk-body" data-sidebar-side=${l} ?data-sidebar-drawer=${c}>
|
|
2250
|
+
${l==="right"?d:g}
|
|
2091
2251
|
<aside
|
|
2092
2252
|
id="dpk-sidebar"
|
|
2093
2253
|
class="dpk-sidebar"
|
|
2094
|
-
?hidden=${
|
|
2095
|
-
style=${`--dpk-sidebar-width: ${this.#
|
|
2254
|
+
?hidden=${o||p}
|
|
2255
|
+
style=${`--dpk-sidebar-width: ${this.#t.width}px`}
|
|
2096
2256
|
>
|
|
2097
2257
|
${s.sidebar??g}
|
|
2098
2258
|
<slot name="sidebar"></slot>
|
|
2099
2259
|
</aside>
|
|
2100
|
-
${
|
|
2260
|
+
${l==="left"?d:g}
|
|
2261
|
+
${c&&!p&&!o?k`<div class="dpk-sidebar-scrim" @click=${()=>this.#a.closeDrawer()}></div>`:g}
|
|
2101
2262
|
<main class="dpk-main">
|
|
2102
2263
|
<div class="dpk-main-body">
|
|
2103
|
-
${this.#
|
|
2104
|
-
<strong>${
|
|
2105
|
-
<code>${this.#
|
|
2264
|
+
${this.#k?k`<div class="dpk-banner" role="alert">
|
|
2265
|
+
<strong>${a.baseDataError}</strong>
|
|
2266
|
+
<code>${this.#k}</code>
|
|
2106
2267
|
</div>`:g}
|
|
2107
2268
|
${s.main??g}
|
|
2108
2269
|
<slot name="main"></slot>
|
|
2109
|
-
<section class="dpk-orphans" ?hidden=${this.#
|
|
2270
|
+
<section class="dpk-orphans" ?hidden=${this.#r.orphans===0}>
|
|
2110
2271
|
<p class="dpk-label">previews without metadata</p>
|
|
2111
2272
|
<slot name="preview"></slot>
|
|
2112
2273
|
</section>
|
|
2113
2274
|
</div>
|
|
2114
2275
|
<div class="dpk-memo" ?hidden=${!this.hasMemoContent()}>
|
|
2115
2276
|
<details class="dpk-memo-fold">
|
|
2116
|
-
<summary class="dpk-memo-bar">${ss()} ${
|
|
2277
|
+
<summary class="dpk-memo-bar">${ss()} ${a.memo}</summary>
|
|
2117
2278
|
<div class="dpk-memo-body"><slot name="memo"></slot></div>
|
|
2118
2279
|
</details>
|
|
2119
2280
|
</div>
|
|
@@ -2128,7 +2289,7 @@ The brief is too long for a comment, so it is stored in this artifact's database
|
|
|
2128
2289
|
class="dpk-fab"
|
|
2129
2290
|
type="button"
|
|
2130
2291
|
aria-expanded=${this.notesOpen?"true":"false"}
|
|
2131
|
-
title=${
|
|
2292
|
+
title=${a.reviewToggle}
|
|
2132
2293
|
@click=${()=>{this.notesOpen=!this.notesOpen}}
|
|
2133
2294
|
>
|
|
2134
2295
|
<span class="dpk-fab-icon" aria-hidden="true"></span>
|
|
@@ -2136,20 +2297,20 @@ The brief is too long for a comment, so it is stored in this artifact's database
|
|
|
2136
2297
|
class="dpk-label"
|
|
2137
2298
|
style="position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)"
|
|
2138
2299
|
>
|
|
2139
|
-
${
|
|
2300
|
+
${a.review}
|
|
2140
2301
|
</span>
|
|
2141
2302
|
${n>0?k`<span class="dpk-fab-badge">${n}</span>`:g}
|
|
2142
2303
|
</button>`}
|
|
2143
|
-
${this.integratedReview?g:this.#
|
|
2304
|
+
${this.integratedReview?g:this.#U(n)}
|
|
2144
2305
|
</div>
|
|
2145
|
-
`}#
|
|
2306
|
+
`}#U(e){const s=cc({actions:e,railOpen:this.notesOpen,sendable:this.canSendToClaude,locale:this.locale},this.#s.state);if(!s)return g;const n=D(this.locale);return k`<div class="dpk-dock" role="group" aria-label=${n.handoffLabel}>
|
|
2146
2307
|
${s.note?k`<p class="dpk-dock-note" role="alert">${s.note}</p>`:g}
|
|
2147
2308
|
<div class="dpk-dock-actions">
|
|
2148
2309
|
${s.send?k`<button
|
|
2149
2310
|
class="dpk-btn dpk-btn--accent"
|
|
2150
2311
|
type="button"
|
|
2151
2312
|
?disabled=${s.send.disabled}
|
|
2152
|
-
@click=${()=>{this.#
|
|
2313
|
+
@click=${()=>{this.#s.send(()=>this.sendToClaude())}}
|
|
2153
2314
|
>
|
|
2154
2315
|
${s.send.label}
|
|
2155
2316
|
</button>`:g}
|
|
@@ -2158,12 +2319,12 @@ The brief is too long for a comment, so it is stored in this artifact's database
|
|
|
2158
2319
|
type="button"
|
|
2159
2320
|
data-status=${s.copy.status}
|
|
2160
2321
|
title=${n.handoffCopyTitle}
|
|
2161
|
-
@click=${()=>{this.#
|
|
2322
|
+
@click=${()=>{this.#s.copy(()=>this.api.exportBrief())}}
|
|
2162
2323
|
>
|
|
2163
2324
|
${s.copy.label}
|
|
2164
2325
|
</button>
|
|
2165
2326
|
</div>
|
|
2166
|
-
</div>`}#
|
|
2327
|
+
</div>`}#B(){const e=this.locale,s=D(e).language;return k`<select
|
|
2167
2328
|
class="dpk-lang-select"
|
|
2168
2329
|
aria-label=${s}
|
|
2169
2330
|
title=${s}
|
|
@@ -2172,7 +2333,7 @@ The brief is too long for a comment, so it is stored in this artifact's database
|
|
|
2172
2333
|
${yt.map(n=>k`<option value=${n} lang=${n} ?selected=${n===e}>
|
|
2173
2334
|
${fo[n]}
|
|
2174
2335
|
</option>`)}
|
|
2175
|
-
</select>`}#
|
|
2336
|
+
</select>`}#H(){const e=this.dataset.theme==="dark",s=D(this.locale),n=e?s.useLightTheme:s.useDarkTheme;return k`<button
|
|
2176
2337
|
class="dpk-theme-toggle"
|
|
2177
2338
|
type="button"
|
|
2178
2339
|
aria-label=${n}
|
|
@@ -2180,17 +2341,17 @@ The brief is too long for a comment, so it is stored in this artifact's database
|
|
|
2180
2341
|
@click=${()=>this.#n.toggle(Oe(this.theme))}
|
|
2181
2342
|
>
|
|
2182
2343
|
${e?tl():sl()}
|
|
2183
|
-
</button>`}get#
|
|
2344
|
+
</button>`}get#C(){return this.sidebarLayout.collapsible!==!1}get#F(){return this.#l.narrow&&this.#C&&this.sidebarLayout.narrow!=="stack"}#K(e,s){const n=this.#C?this.#W(e,s):g;return e||s?k`<div class="dpk-sidebar-strip">${n}</div>`:this.sidebarLayout.side==="left"?k`${this.#z()}${n}`:k`${n}${this.#z()}`}#W(e,s){const n=D(this.locale),r=Ic(this.sidebarLayout.side,e),i=r.action==="collapse"?n.collapseSidebar:n.expandSidebar;return k`<button
|
|
2184
2345
|
class="dpk-sidebar-toggle"
|
|
2185
2346
|
type="button"
|
|
2186
2347
|
aria-controls="dpk-sidebar"
|
|
2187
2348
|
aria-expanded=${e?"false":"true"}
|
|
2188
|
-
aria-label=${
|
|
2189
|
-
title=${
|
|
2190
|
-
@click=${()=>{this.#
|
|
2349
|
+
aria-label=${i}
|
|
2350
|
+
title=${i}
|
|
2351
|
+
@click=${()=>{this.#d=!0,s?this.#a.toggleDrawer():this.#a.toggle()}}
|
|
2191
2352
|
>
|
|
2192
|
-
${
|
|
2193
|
-
</button>`}#
|
|
2353
|
+
${r.points==="left"?ir():ss()}
|
|
2354
|
+
</button>`}#z(){const e=D(this.locale),s=this.#t.handlers;return k`<div
|
|
2194
2355
|
class="dpk-sidebar-resizer"
|
|
2195
2356
|
role="separator"
|
|
2196
2357
|
tabindex="0"
|
|
@@ -2198,7 +2359,7 @@ The brief is too long for a comment, so it is stored in this artifact's database
|
|
|
2198
2359
|
aria-label=${e.resizeSidebar}
|
|
2199
2360
|
aria-valuemin=${J.min}
|
|
2200
2361
|
aria-valuemax=${J.max}
|
|
2201
|
-
aria-valuenow=${this.#
|
|
2362
|
+
aria-valuenow=${this.#t.width}
|
|
2202
2363
|
title=${e.resizeSidebarHint}
|
|
2203
2364
|
@pointerdown=${s.pointerdown}
|
|
2204
2365
|
@pointermove=${s.pointermove}
|
|
@@ -2206,4 +2367,4 @@ The brief is too long for a comment, so it is stored in this artifact's database
|
|
|
2206
2367
|
@pointercancel=${s.pointercancel}
|
|
2207
2368
|
@keydown=${s.keydown}
|
|
2208
2369
|
@dblclick=${s.dblclick}
|
|
2209
|
-
></div>`}render(){if(!this.#c)return g;const e=this.#
|
|
2370
|
+
></div>`}render(){if(!this.#c)return g;const e=this.#O();return this.renderChrome(e,this.renderRegions(e))}get sidebarLayout(){return Pc}hasSidebarContent(){return this.querySelector('[slot="sidebar"]')!==null}hasMemoContent(){return this.querySelector('[slot="memo"]')!==null}hasFooterContent(){return this.querySelector('[slot="footer"]')!==null}context(){return this.#O()}#T(){return{definition:this.definition,controller:()=>this.controller,derivation:()=>this.derivation,ready:this.#D,navigation:()=>this.#w(),issues:()=>this.controller.lastIssues,dispatch:e=>this.dispatch(e),dispatchBatch:e=>this.dispatchBatch(e),subscribe:e=>(this.#u.add(e),()=>{this.#u.delete(e)}),editComment:(e,s)=>this.editComment(e,s),removeAction:e=>this.removeAction(e),clearActions:()=>this.clearActions(),navigate:(e,s)=>this.navigate(e,s),hashFor:e=>this.hashFor(e),requestComment:e=>this.requestComment(e)}}#Z(){return pc(this.#T(),this)}#P(){return Pr(this.#T())}#O(){return dc(this.#T())}#w(){return this.definition.resolveNavigation(this.derivation.state,this.#h)}#V(){const e=this.#J();this.#h=Dr();const s=this.storageKey;this.#c=new Rr({definition:this.definition,base:e,storage:this.#G(),...typeof s=="string"?{storageKey:s}:{}}),this.#L(),this.#g(),this.#A(!0),this.#E?.(),this.#Y(),this.requestUpdate()}#G(){return this.storage==="off"?null:this.storage==="memory"?new cs:ds()}#J(){const e=this.querySelector('script[type="application/json"]');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.#k='no <script type="application/json"> child found',this.definition.emptyBase();try{return this.definition.parseBase(JSON.parse(e.textContent))}catch(s){return console.error("[dev-process-kit] invalid base data:",s),this.#k=s instanceof Error?s.message:String(s),this.definition.emptyBase()}}#Y(){this.querySelector('script[type="application/json"]')||(this.#m=new MutationObserver(()=>{const e=this.querySelector('script[type="application/json"]');if(e){this.#m?.disconnect(),this.#m=void 0;try{this.controller.setBase(this.definition.parseBase(JSON.parse(e.textContent??"null")))}catch(s){console.error("[dev-process-kit] invalid base data:",s)}}}),this.#m.observe(this,{childList:!0,subtree:!0}))}#b(){const e=this.#P();for(const s of this.#u)s(e)}#Q(){if(!this.isConnected){this.requestUpdate(),this.#b();return}this.#A(!0),Nr(this.#S,this.controller.actions),queueMicrotask(this.#g),this.requestUpdate(),this.#b(),this.dispatchEvent(new CustomEvent("dpk-change",{detail:this.#P(),bubbles:!0,composed:!0}))}#A(e){const s=this.#w();this.#h=s,Lc(s,e)}#M=()=>{this.#h=Dr(),this.#A(!0),this.requestUpdate(),this.#b(),this.dispatchEvent(new CustomEvent("dpk-navigate",{detail:{navigation:this.#h},bubbles:!0,composed:!0}))};#g=()=>{this.#$?.disconnect(),this.#S=wc(this,e=>{this.isConnected&&this.#$?.observe(e,{childList:!0,subtree:!0})}),this.#c&&(Nr(this.#S,this.#c.actions),this.#c.setComponentSnapshot(Sc(this.#S)))};#j=e=>{if(e.stopPropagation(),!(e instanceof CustomEvent)||!this.#c)return;const s=e.detail;typeof s!="object"||s===null||!("target"in s)||typeof s.target!="string"||(this.#g(),!this.controller.definition.commentTargets(this.derivation.state,this.navigation).some(r=>r.value===s.target))||this.requestComment(s.target)};#I=e=>{if(e.stopPropagation(),!(e instanceof CustomEvent)||!e.cancelable||!this.#c)return;const s=S(Cl,e.detail);if(!s.success)return;this.#g();const{target:n,body:r}=s.output;if(!this.controller.definition.commentTargets(this.derivation.state,this.navigation).some(o=>o.value===n))return;this.dispatch({type:L,target:n,payload:{body:r}}).ok&&e.preventDefault()};#q=e=>{if(e.stopPropagation(),!(e instanceof CustomEvent)||!e.cancelable||!this.#c)return;const s=S(ao,e.detail);if(!s.success)return;this.#g();const{type:n,target:r,payload:i}=s.output;if(!this.controller.definition.commentTargets(this.derivation.state,this.navigation).some(l=>l.value===r))return;this.dispatch({type:n,target:r,payload:i}).ok&&e.preventDefault()};#N=e=>{for(const s of e.composedPath()){if(!(s instanceof Element))continue;if(s===this||s.hasAttribute("data-template"))break;const n=s.getAttribute("data-dpk-navigate");if(n!==null){e.preventDefault(),this.navigate(Zt(n.includes("=")?n:`step=${n}`));return}const r=s.getAttribute("data-dpk-comment");if(r!==null){e.preventDefault(),this.requestComment(r);return}}};#X(){const e=this.renderRoot.querySelector(".dpk-shell"),s=this.renderRoot.querySelector(".dpk-dock-actions");e&&(s?e.style.setProperty("--dpk-dock-space",`${s.offsetWidth+8}px`):e.style.removeProperty("--dpk-dock-space"))}#ee(){this.#r.route()}}export{Pe as $,ts as A,Go as B,L as C,ar as D,Wt as E,N as F,sr as G,rr as H,es as I,nr as J,tr as K,Cr as L,cs as M,Zt as N,On as O,Za as P,Vt as Q,Va as R,Bt as S,td as T,Mn as U,M as V,ls as W,nt as X,Nt as Y,Ve as Z,or as _,Ht as a,wn as a$,Ze as a0,Ci as a1,B as a2,g as a3,k as a4,Jn as a5,Vo as a6,li as a7,F as a8,$t as a9,P as aA,Ie as aB,G as aC,wl as aD,is as aE,$l as aF,ot as aG,de as aH,Yt as aI,Jt as aJ,yn as aK,Ka as aL,Ha as aM,Hs as aN,xn as aO,C as aP,Qn as aQ,Xn as aR,vt as aS,Gs as aT,$e as aU,He as aV,bt as aW,ir as aX,Zo as aY,Wo as aZ,An as a_,Xo as aa,el as ab,qt as ac,fe as ad,Le as ae,Z as af,m as ag,tt as ah,v as ai,w as aj,Ln as ak,Pn as al,V as am,ue as an,En as ao,ss as ap,Qo as aq,It as ar,S as as,T as at,_n as au,jt as av,Sn as aw,$n as ax,Rn as ay,Fa as az,vn as b,Yn as b0,er as b1,Rr as c,Ut as d,Ga as e,Gt as f,qn as g,ze as h,Sr as i,St as j,jn as k,Xa as l,Dt as m,ds as n,ps as o,Wa as p,ol as q,za as r,ml as s,Ar as t,ae as u,Ya as v,ge as w,Yo as x,Jo as y,Xt as z};
|