dev-process-kit 0.0.2 → 0.0.3
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/README.md +10 -9
- package/dist/chunks/shared-B2K3LoOU.js +1016 -0
- package/dist/chunks/{shared-D6UXy-Qw.js → shared-BqW3KAJ4.js} +99 -46
- package/dist/chunks/{shared-DZlREPaN.js → shared-Byv6cc0r.js} +480 -238
- package/dist/chunks/{shared-D3EKtSkd.js → shared-CKG_SQh5.js} +1 -1
- package/dist/chunks/{shared-C4Y4jSXa.js → shared-CPAT0Cgk.js} +4 -2
- package/dist/chunks/shared-CwbzACTe.js +1874 -0
- package/dist/chunks/{shared-utv1engQ.js → shared-DBDgdVsd.js} +1 -1
- package/dist/chunks/shared-DMlMTd3c.js +1018 -0
- package/dist/chunks/shared-DaoPCw6-.js +556 -0
- package/dist/chunks/shared-DqB_TR20.js +1599 -0
- package/dist/chunks/shared-DsVxrO_3.js +609 -0
- package/dist/chunks/shared-iQIywbRc.js +676 -0
- package/dist/chunks/shared-xrCdgpNS.js +1 -0
- package/dist/components.js +1 -1
- package/dist/index.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 -0
- package/dist/templates/usm.js +1 -1
- package/package.json +3 -2
- package/dist/chunks/shared-BFAVBf4I.js +0 -1
- package/dist/chunks/shared-BXV4Dm_n.js +0 -522
- package/dist/chunks/shared-CQlssGTf.js +0 -692
- package/dist/chunks/shared-CcD4vDCE.js +0 -1461
- package/dist/chunks/shared-D2QreyJq.js +0 -926
- package/dist/chunks/shared-OdGbSUTa.js +0 -574
- package/dist/chunks/shared-TjJWiz7W.js +0 -546
|
@@ -1,1461 +0,0 @@
|
|
|
1
|
-
const le=globalThis,Ae=le.ShadowRoot&&(le.ShadyCSS===void 0||le.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,Se=Symbol(),rt=new WeakMap;let ot=class{constructor(e,s,n){if(this._$cssResult$=!0,n!==Se)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(Ae&&e===void 0){const n=s!==void 0&&s.length===1;n&&(e=rt.get(s)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),n&&rt.set(s,e))}return e}toString(){return this.cssText}};const at=t=>new ot(typeof t=="string"?t:t+"",void 0,Se),R=(t,...e)=>{const s=t.length===1?t[0]:e.reduce((n,i,r)=>n+(o=>{if(o._$cssResult$===!0)return o.cssText;if(typeof o=="number")return o;throw Error("Value passed to 'css' function must be a 'css' function result: "+o+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(i)+t[r+1],t[0]);return new ot(s,t,Se)},Js=(t,e)=>{if(Ae)t.adoptedStyleSheets=e.map(s=>s instanceof CSSStyleSheet?s:s.styleSheet);else for(const s of e){const n=document.createElement("style"),i=le.litNonce;i!==void 0&&n.setAttribute("nonce",i),n.textContent=s.cssText,t.appendChild(n)}},lt=Ae?t=>t:t=>t instanceof CSSStyleSheet?(e=>{let s="";for(const n of e.cssRules)s+=n.cssText;return at(s)})(t):t,{is:Vs,defineProperty:Ws,getOwnPropertyDescriptor:Gs,getOwnPropertyNames:Ys,getOwnPropertySymbols:Zs,getPrototypeOf:Qs}=Object,ce=globalThis,ct=ce.trustedTypes,Xs=ct?ct.emptyScript:"",en=ce.reactiveElementPolyfillSupport,Y=(t,e)=>t,Ce={toAttribute(t,e){switch(e){case Boolean:t=t?Xs: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}},dt=(t,e)=>!Vs(t,e),pt={attribute:!0,type:String,converter:Ce,reflect:!1,useDefault:!1,hasChanged:dt};Symbol.metadata??=Symbol("metadata"),ce.litPropertyMetadata??=new WeakMap;let q=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=pt){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(),i=this.getPropertyDescriptor(e,n,s);i!==void 0&&Ws(this.prototype,e,i)}}static getPropertyDescriptor(e,s,n){const{get:i,set:r}=Gs(this.prototype,e)??{get(){return this[s]},set(o){this[s]=o}};return{get:i,set(o){const c=i?.call(this);r?.call(this,o),this.requestUpdate(e,c,n)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??pt}static _$Ei(){if(this.hasOwnProperty(Y("elementProperties")))return;const e=Qs(this);e.finalize(),e.l!==void 0&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(Y("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(Y("properties"))){const s=this.properties,n=[...Ys(s),...Zs(s)];for(const i of n)this.createProperty(i,s[i])}const e=this[Symbol.metadata];if(e!==null){const s=litPropertyMetadata.get(e);if(s!==void 0)for(const[n,i]of s)this.elementProperties.set(n,i)}this._$Eh=new Map;for(const[s,n]of this.elementProperties){const i=this._$Eu(s,n);i!==void 0&&this._$Eh.set(i,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 i of n)s.unshift(lt(i))}else e!==void 0&&s.push(lt(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 Js(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),i=this.constructor._$Eu(e,n);if(i!==void 0&&n.reflect===!0){const r=(n.converter?.toAttribute!==void 0?n.converter:Ce).toAttribute(s,n.type);this._$Em=e,r==null?this.removeAttribute(i):this.setAttribute(i,r),this._$Em=null}}_$AK(e,s){const n=this.constructor,i=n._$Eh.get(e);if(i!==void 0&&this._$Em!==i){const r=n.getPropertyOptions(i),o=typeof r.converter=="function"?{fromAttribute:r.converter}:r.converter?.fromAttribute!==void 0?r.converter:Ce;this._$Em=i;const c=o.fromAttribute(s,r.type);this[i]=c??this._$Ej?.get(i)??c,this._$Em=null}}requestUpdate(e,s,n,i=!1,r){if(e!==void 0){const o=this.constructor;if(i===!1&&(r=this[e]),n??=o.getPropertyOptions(e),!((n.hasChanged??dt)(r,s)||n.useDefault&&n.reflect&&r===this._$Ej?.get(e)&&!this.hasAttribute(o._$Eu(e,n))))return;this.C(e,s,n)}this.isUpdatePending===!1&&(this._$ES=this._$EP())}C(e,s,{useDefault:n,reflect:i,wrapped:r},o){n&&!(this._$Ej??=new Map).has(e)&&(this._$Ej.set(e,o??s??this[e]),r!==!0||o!==void 0)||(this._$AL.has(e)||(this.hasUpdated||n||(s=void 0),this._$AL.set(e,s)),i===!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[i,r]of this._$Ep)this[i]=r;this._$Ep=void 0}const n=this.constructor.elementProperties;if(n.size>0)for(const[i,r]of n){const{wrapped:o}=r,c=this[i];o!==!0||this._$AL.has(i)||c===void 0||this.C(i,void 0,r,c)}}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){}};q.elementStyles=[],q.shadowRootOptions={mode:"open"},q[Y("elementProperties")]=new Map,q[Y("finalized")]=new Map,en?.({ReactiveElement:q}),(ce.reactiveElementVersions??=[]).push("2.1.2");const _e=globalThis,ut=t=>t,de=_e.trustedTypes,ht=de?de.createPolicy("lit-html",{createHTML:t=>t}):void 0,ft="$lit$",M=`lit$${Math.random().toFixed(9).slice(2)}$`,gt="?"+M,tn=`<${gt}>`,L=document,Z=()=>L.createComment(""),Q=t=>t===null||typeof t!="object"&&typeof t!="function",Ee=Array.isArray,sn=t=>Ee(t)||typeof t?.[Symbol.iterator]=="function",Te=`[
|
|
2
|
-
\f\r]`,X=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,mt=/-->/g,vt=/>/g,N=RegExp(`>|${Te}(?:([^\\s"'>=/]+)(${Te}*=${Te}*(?:[^
|
|
3
|
-
\f\r"'\`<>=]|("|')|))|$)`,"g"),bt=/'/g,yt=/"/g,kt=/^(?:script|style|textarea|title)$/i,xt=t=>(e,...s)=>({_$litType$:t,strings:e,values:s}),f=xt(1),nn=xt(2),P=Symbol.for("lit-noChange"),m=Symbol.for("lit-nothing"),$t=new WeakMap,U=L.createTreeWalker(L,129);function wt(t,e){if(!Ee(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return ht!==void 0?ht.createHTML(e):e}const rn=(t,e)=>{const s=t.length-1,n=[];let i,r=e===2?"<svg>":e===3?"<math>":"",o=X;for(let c=0;c<s;c++){const a=t[c];let l,p,d=-1,u=0;for(;u<a.length&&(o.lastIndex=u,p=o.exec(a),p!==null);)u=o.lastIndex,o===X?p[1]==="!--"?o=mt:p[1]!==void 0?o=vt:p[2]!==void 0?(kt.test(p[2])&&(i=RegExp("</"+p[2],"g")),o=N):p[3]!==void 0&&(o=N):o===N?p[0]===">"?(o=i??X,d=-1):p[1]===void 0?d=-2:(d=o.lastIndex-p[2].length,l=p[1],o=p[3]===void 0?N:p[3]==='"'?yt:bt):o===yt||o===bt?o=N:o===mt||o===vt?o=X:(o=N,i=void 0);const h=o===N&&t[c+1].startsWith("/>")?" ":"";r+=o===X?a+tn:d>=0?(n.push(l),a.slice(0,d)+ft+a.slice(d)+M+h):a+M+(d===-2?c:h)}return[wt(t,r+(t[s]||"<?>")+(e===2?"</svg>":e===3?"</math>":"")),n]};class ae{constructor({strings:e,_$litType$:s},n){let i;this.parts=[];let r=0,o=0;const c=e.length-1,a=this.parts,[l,p]=rn(e,s);if(this.el=ae.createElement(l,n),U.currentNode=this.el.content,s===2||s===3){const d=this.el.content.firstChild;d.replaceWith(...d.childNodes)}for(;(i=U.nextNode())!==null&&a.length<c;){if(i.nodeType===1){if(i.hasAttributes())for(const d of i.getAttributeNames())if(d.endsWith(ft)){const u=p[o++],h=i.getAttribute(d).split(M),v=/([.?@])?(.*)/.exec(u);a.push({type:1,index:r,name:v[2],strings:h,ctor:v[1]==="."?an:v[1]==="?"?ln:v[1]==="@"?cn:pe}),i.removeAttribute(d)}else d.startsWith(M)&&(a.push({type:6,index:r}),i.removeAttribute(d));if(kt.test(i.tagName)){const d=i.textContent.split(M),u=d.length-1;if(u>0){i.textContent=de?de.emptyScript:"";for(let h=0;h<u;h++)i.append(d[h],Z()),U.nextNode(),a.push({type:2,index:++r});i.append(d[u],Z())}}}else if(i.nodeType===8)if(i.data===gt)a.push({type:2,index:r});else{let d=-1;for(;(d=i.data.indexOf(M,d+1))!==-1;)a.push({type:7,index:r}),d+=M.length-1}r++}}static createElement(e,s){const n=L.createElement("template");return n.innerHTML=e,n}}function H(t,e,s=t,n){if(e===P)return e;let i=n!==void 0?s._$Co?.[n]:s._$Cl;const r=Q(e)?void 0:e._$litDirective$;return i?.constructor!==r&&(i?._$AO?.(!1),r===void 0?i=void 0:(i=new r(t),i._$AT(t,s,n)),n!==void 0?(s._$Co??=[])[n]=i:s._$Cl=i),i!==void 0&&(e=H(t,i._$AS(t,e.values),i,n)),e}class on{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,i=(e?.creationScope??L).importNode(s,!0);U.currentNode=i;let r=U.nextNode(),o=0,c=0,a=n[0];for(;a!==void 0;){if(o===a.index){let l;a.type===2?l=new G(r,r.nextSibling,this,e):a.type===1?l=new a.ctor(r,a.name,a.strings,this,e):a.type===6&&(l=new dn(r,this,e)),this._$AV.push(l),a=n[++c]}o!==a?.index&&(r=U.nextNode(),o++)}return U.currentNode=L,i}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++}}class G{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(e,s,n,i){this.type=2,this._$AH=m,this._$AN=void 0,this._$AA=e,this._$AB=s,this._$AM=n,this.options=i,this._$Cv=i?.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=H(this,e,s),Q(e)?e===m||e==null||e===""?(this._$AH!==m&&this._$AR(),this._$AH=m):e!==this._$AH&&e!==P&&this._(e):e._$litType$!==void 0?this.$(e):e.nodeType!==void 0?this.T(e):sn(e)?this.k(e):this._(e)}O(e){return this._$AA.parentNode.insertBefore(e,this._$AB)}T(e){this._$AH!==e&&(this._$AR(),this._$AH=this.O(e))}_(e){this._$AH!==m&&Q(this._$AH)?this._$AA.nextSibling.data=e:this.T(L.createTextNode(e)),this._$AH=e}$(e){const{values:s,_$litType$:n}=e,i=typeof n=="number"?this._$AC(e):(n.el===void 0&&(n.el=ae.createElement(wt(n.h,n.h[0]),this.options)),n);if(this._$AH?._$AD===i)this._$AH.p(s);else{const r=new on(i,this),o=r.u(this.options);r.p(s),this.T(o),this._$AH=r}}_$AC(e){let s=$t.get(e.strings);return s===void 0&&$t.set(e.strings,s=new ae(e)),s}k(e){Ee(this._$AH)||(this._$AH=[],this._$AR());const s=this._$AH;let n,i=0;for(const r of e)i===s.length?s.push(n=new G(this.O(Z()),this.O(Z()),this,this.options)):n=s[i],n._$AI(r),i++;i<s.length&&(this._$AR(n&&n._$AB.nextSibling,i),s.length=i)}_$AR(e=this._$AA.nextSibling,s){for(this._$AP?.(!1,!0,s);e!==this._$AB;){const n=ut(e).nextSibling;ut(e).remove(),e=n}}setConnected(e){this._$AM===void 0&&(this._$Cv=e,this._$AP?.(e))}}class pe{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,s,n,i,r){this.type=1,this._$AH=m,this._$AN=void 0,this.element=e,this.name=s,this._$AM=i,this.options=r,n.length>2||n[0]!==""||n[1]!==""?(this._$AH=Array(n.length-1).fill(new String),this.strings=n):this._$AH=m}_$AI(e,s=this,n,i){const r=this.strings;let o=!1;if(r===void 0)e=H(this,e,s,0),o=!Q(e)||e!==this._$AH&&e!==P,o&&(this._$AH=e);else{const c=e;let a,l;for(e=r[0],a=0;a<r.length-1;a++)l=H(this,c[n+a],s,a),l===P&&(l=this._$AH[a]),o||=!Q(l)||l!==this._$AH[a],l===m?e=m:e!==m&&(e+=(l??"")+r[a+1]),this._$AH[a]=l}o&&!i&&this.j(e)}j(e){e===m?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}}class an extends pe{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===m?void 0:e}}class ln extends pe{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==m)}}class cn extends pe{constructor(e,s,n,i,r){super(e,s,n,i,r),this.type=5}_$AI(e,s=this){if((e=H(this,e,s,0)??m)===P)return;const n=this._$AH,i=e===m&&n!==m||e.capture!==n.capture||e.once!==n.once||e.passive!==n.passive,r=e!==m&&(n===m||i);i&&this.element.removeEventListener(this.name,this,n),r&&this.element.addEventListener(this.name,this,e),this._$AH=e}handleEvent(e){typeof this._$AH=="function"?this._$AH.call(this.options?.host??this.element,e):this._$AH.handleEvent(e)}}class dn{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){H(this,e)}}const pn={I:G},un=_e.litHtmlPolyfillSupport;un?.(ae,G),(_e.litHtmlVersions??=[]).push("3.3.3");const hn=(t,e,s)=>{const n=s?.renderBefore??e;let i=n._$litPart$;if(i===void 0){const r=s?.renderBefore??null;n._$litPart$=i=new G(e.insertBefore(Z(),r),r,void 0,s??{})}return i._$AI(t),i},Me=globalThis;let O=class extends q{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=hn(s,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return P}};O._$litElement$=!0,O.finalized=!0,Me.litElementHydrateSupport?.({LitElement:O});const fn=Me.litElementPolyfillSupport;fn?.({LitElement:O}),(Me.litElementVersions??=[]).push("4.2.2");const Oe=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},je=["en","ja"],At="en",St=t=>je.some(e=>e===t),Re=t=>{const e=(t??"").split("-")[0]?.toLowerCase()??"";return St(e)?e:At},Ct=t=>Re(Oe(t)),Le="dpk-locale-change",_t=t=>typeof t=="string"&&St(t)?t:null,gn=t=>t.preference??t.authored,mn=(t,e)=>t===e?null:t,ue=t=>e=>e==="ja"?t.ja:t.en;class Ne{#e;#o;#i=At;constructor(e,s=()=>{}){this.#e=e,this.#o=s,e.addController(this)}get locale(){return this.#i}hostConnected(){this.#i=Ct(this.#e),document.addEventListener(Le,this.#n)}hostDisconnected(){document.removeEventListener(Le,this.#n)}#n=()=>{const e=Ct(this.#e);e!==this.#i&&(this.#i=e,this.#o(),this.#e.requestUpdate())}}const vn={paper:["#fafbfc","#15171c"],"paper-raised":["#ffffff","#1d2027"],"paper-sunken":["#f3f5f8","#111317"],"paper-inset":["#eceef2","#272b34"],ink:["#1a1d24","#e6e9ef"],"ink-soft":["#4d5566","#aeb5c2"],"ink-faint":["#7c8599","#7f8798"],rule:["rgba(20, 28, 44, 0.08)","rgba(222, 230, 245, 0.09)"],"rule-strong":["rgba(20, 28, 44, 0.14)","rgba(222, 230, 245, 0.16)"],"rule-hover":["rgba(20, 28, 44, 0.22)","rgba(222, 230, 245, 0.26)"],accent:["#d94920","#ee6a40"],"accent-strong":["#c23e12","#d4532a"],"accent-bright":["#e55a2b","#f47d55"],"accent-soft":["rgba(217, 73, 32, 0.07)","rgba(238, 106, 64, 0.15)"],"accent-ink":["#ffffff","#ffffff"],blue:["#3366cc","#6f9bf0"],"blue-strong":["#2952a3","#4f7fdc"],"blue-soft":["rgba(51, 102, 204, 0.08)","rgba(111, 155, 240, 0.15)"],green:["#1a8a4a","#43c07a"],"green-soft":["rgba(26, 138, 74, 0.08)","rgba(67, 192, 122, 0.14)"],amber:["#b47a0a","#e2a73c"],"amber-soft":["rgba(180, 122, 10, 0.09)","rgba(226, 167, 60, 0.15)"],violet:["#7c4dcc","#a88af0"],"violet-soft":["rgba(124, 77, 204, 0.08)","rgba(168, 138, 240, 0.15)"],danger:["#b81c33","#f36b80"],"danger-soft":["rgba(214, 53, 80, 0.08)","rgba(243, 107, 128, 0.14)"],shade:["rgb(20, 28, 44)","rgb(0, 0, 0)"]},Et=t=>at(Object.entries(vn).map(([e,[s,n]])=>`--dpk-${e}: ${t(s,n)};`).join(`
|
|
4
|
-
`)),he=R`
|
|
5
|
-
:host {
|
|
6
|
-
/* Browsers without light-dark() stay light. */
|
|
7
|
-
${Et(t=>t)}
|
|
8
|
-
--dpk-display: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
|
|
9
|
-
--dpk-body: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
|
|
10
|
-
--dpk-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, 'Liberation Mono', monospace;
|
|
11
|
-
|
|
12
|
-
/* Shape + elevation scale, so every surface reads as one system. */
|
|
13
|
-
--dpk-radius-xs: 5px;
|
|
14
|
-
--dpk-radius-sm: 7px;
|
|
15
|
-
--dpk-radius: 8px;
|
|
16
|
-
--dpk-radius-lg: 12px;
|
|
17
|
-
--dpk-shadow-xs:
|
|
18
|
-
0 1px 2px color-mix(in srgb, var(--dpk-shade) 5%, transparent),
|
|
19
|
-
0 1px 1px color-mix(in srgb, var(--dpk-shade) 3%, transparent);
|
|
20
|
-
--dpk-shadow-sm:
|
|
21
|
-
0 1px 2px color-mix(in srgb, var(--dpk-shade) 6%, transparent),
|
|
22
|
-
0 2px 8px -2px color-mix(in srgb, var(--dpk-shade) 12%, transparent);
|
|
23
|
-
--dpk-shadow:
|
|
24
|
-
0 1px 3px color-mix(in srgb, var(--dpk-shade) 6%, transparent),
|
|
25
|
-
0 8px 24px -8px color-mix(in srgb, var(--dpk-shade) 18%, transparent);
|
|
26
|
-
--dpk-shadow-lg:
|
|
27
|
-
0 2px 6px color-mix(in srgb, var(--dpk-shade) 6%, transparent),
|
|
28
|
-
0 16px 40px -12px color-mix(in srgb, var(--dpk-shade) 22%, transparent);
|
|
29
|
-
--dpk-focus: 0 0 0 3px color-mix(in srgb, var(--dpk-blue) 28%, transparent);
|
|
30
|
-
--dpk-control-h: 32px;
|
|
31
|
-
|
|
32
|
-
color: var(--dpk-ink);
|
|
33
|
-
font-family: var(--dpk-body);
|
|
34
|
-
font-size: 14px;
|
|
35
|
-
line-height: 1.5;
|
|
36
|
-
-webkit-font-smoothing: antialiased;
|
|
37
|
-
text-rendering: optimizeLegibility;
|
|
38
|
-
display: block;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
@supports (color: light-dark(#000, #fff)) {
|
|
42
|
-
:host {
|
|
43
|
-
${Et((t,e)=>`light-dark(${t}, ${e})`)}
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
*,
|
|
48
|
-
*::before,
|
|
49
|
-
*::after {
|
|
50
|
-
box-sizing: border-box;
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
h1,
|
|
54
|
-
h2,
|
|
55
|
-
h3,
|
|
56
|
-
h4 {
|
|
57
|
-
font-family: var(--dpk-display);
|
|
58
|
-
font-weight: 650;
|
|
59
|
-
margin: 0;
|
|
60
|
-
line-height: 1.2;
|
|
61
|
-
letter-spacing: -0.01em;
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
button {
|
|
65
|
-
font: inherit;
|
|
66
|
-
color: inherit;
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
::selection {
|
|
70
|
-
background: rgba(47, 90, 168, 0.18);
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
.dpk-mono,
|
|
74
|
-
.dpk-num {
|
|
75
|
-
font-variant-numeric: tabular-nums;
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
.dpk-label {
|
|
79
|
-
font-family: var(--dpk-mono);
|
|
80
|
-
font-size: 10px;
|
|
81
|
-
font-weight: 500;
|
|
82
|
-
letter-spacing: 0.12em;
|
|
83
|
-
text-transform: uppercase;
|
|
84
|
-
color: var(--dpk-ink-faint);
|
|
85
|
-
}
|
|
86
|
-
`,fe=R`
|
|
87
|
-
.dpk-btn {
|
|
88
|
-
display: inline-flex;
|
|
89
|
-
align-items: center;
|
|
90
|
-
justify-content: center;
|
|
91
|
-
gap: 6px;
|
|
92
|
-
min-height: 30px;
|
|
93
|
-
padding: 0 12px;
|
|
94
|
-
border: 1px solid var(--dpk-rule-strong);
|
|
95
|
-
border-radius: var(--dpk-radius-sm);
|
|
96
|
-
background: var(--dpk-paper-raised);
|
|
97
|
-
color: var(--dpk-ink);
|
|
98
|
-
font-size: 12.5px;
|
|
99
|
-
font-weight: 520;
|
|
100
|
-
line-height: 1;
|
|
101
|
-
white-space: nowrap;
|
|
102
|
-
box-shadow: var(--dpk-shadow-xs);
|
|
103
|
-
cursor: pointer;
|
|
104
|
-
transition:
|
|
105
|
-
background 140ms ease,
|
|
106
|
-
border-color 140ms ease,
|
|
107
|
-
box-shadow 140ms ease,
|
|
108
|
-
color 140ms ease,
|
|
109
|
-
transform 80ms ease;
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
.dpk-btn:hover:not([disabled]) {
|
|
113
|
-
background: var(--dpk-paper-sunken);
|
|
114
|
-
border-color: var(--dpk-rule-hover);
|
|
115
|
-
box-shadow: var(--dpk-shadow-sm);
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
.dpk-btn:active:not([disabled]) {
|
|
119
|
-
transform: translateY(1px);
|
|
120
|
-
box-shadow: none;
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
.dpk-btn:focus-visible {
|
|
124
|
-
outline: none;
|
|
125
|
-
box-shadow: var(--dpk-focus);
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
.dpk-btn[disabled] {
|
|
129
|
-
opacity: 0.45;
|
|
130
|
-
box-shadow: none;
|
|
131
|
-
cursor: not-allowed;
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
.dpk-btn--accent {
|
|
135
|
-
border-color: transparent;
|
|
136
|
-
background: linear-gradient(180deg, var(--dpk-accent), var(--dpk-accent-strong));
|
|
137
|
-
color: var(--dpk-accent-ink);
|
|
138
|
-
box-shadow:
|
|
139
|
-
0 1px 2px rgba(217, 73, 32, 0.25),
|
|
140
|
-
0 0 0 1px rgba(217, 73, 32, 0.15);
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
.dpk-btn--accent:hover:not([disabled]) {
|
|
144
|
-
background: linear-gradient(180deg, var(--dpk-accent-bright), var(--dpk-accent-strong));
|
|
145
|
-
border-color: transparent;
|
|
146
|
-
box-shadow:
|
|
147
|
-
0 2px 6px rgba(217, 73, 32, 0.3),
|
|
148
|
-
0 0 0 1px rgba(217, 73, 32, 0.2);
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
/* Selection state, shared by every template's filter/nav controls. */
|
|
152
|
-
.dpk-btn--selected {
|
|
153
|
-
border-color: transparent;
|
|
154
|
-
background: linear-gradient(180deg, var(--dpk-blue), var(--dpk-blue-strong));
|
|
155
|
-
color: #fff;
|
|
156
|
-
box-shadow: 0 1px 3px rgba(51, 102, 204, 0.3);
|
|
157
|
-
}
|
|
158
|
-
|
|
159
|
-
.dpk-btn--selected:hover:not([disabled]) {
|
|
160
|
-
background: linear-gradient(180deg, var(--dpk-blue-strong), var(--dpk-blue-strong));
|
|
161
|
-
border-color: transparent;
|
|
162
|
-
box-shadow: 0 2px 6px rgba(51, 102, 204, 0.35);
|
|
163
|
-
}
|
|
164
|
-
|
|
165
|
-
.dpk-btn--ghost {
|
|
166
|
-
border-color: transparent;
|
|
167
|
-
background: transparent;
|
|
168
|
-
box-shadow: none;
|
|
169
|
-
color: var(--dpk-ink-soft);
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
.dpk-btn--ghost:hover:not([disabled]) {
|
|
173
|
-
background: var(--dpk-paper-inset);
|
|
174
|
-
border-color: transparent;
|
|
175
|
-
color: var(--dpk-ink);
|
|
176
|
-
}
|
|
177
|
-
|
|
178
|
-
.dpk-icon-btn {
|
|
179
|
-
position: relative;
|
|
180
|
-
display: inline-flex;
|
|
181
|
-
align-items: center;
|
|
182
|
-
justify-content: center;
|
|
183
|
-
width: 26px;
|
|
184
|
-
height: 26px;
|
|
185
|
-
padding: 0;
|
|
186
|
-
border: 1px solid transparent;
|
|
187
|
-
border-radius: var(--dpk-radius-xs);
|
|
188
|
-
background: transparent;
|
|
189
|
-
color: var(--dpk-ink-faint);
|
|
190
|
-
font-size: 11px;
|
|
191
|
-
line-height: 1;
|
|
192
|
-
cursor: pointer;
|
|
193
|
-
transition:
|
|
194
|
-
background 140ms ease,
|
|
195
|
-
color 140ms ease,
|
|
196
|
-
transform 100ms ease;
|
|
197
|
-
}
|
|
198
|
-
|
|
199
|
-
.dpk-icon-btn:hover:not([disabled]) {
|
|
200
|
-
background: var(--dpk-paper-inset);
|
|
201
|
-
color: var(--dpk-ink);
|
|
202
|
-
transform: scale(1.08);
|
|
203
|
-
}
|
|
204
|
-
|
|
205
|
-
.dpk-icon-btn:focus-visible {
|
|
206
|
-
outline: none;
|
|
207
|
-
box-shadow: var(--dpk-focus);
|
|
208
|
-
}
|
|
209
|
-
|
|
210
|
-
.dpk-icon-btn[disabled] {
|
|
211
|
-
opacity: 0.35;
|
|
212
|
-
cursor: default;
|
|
213
|
-
}
|
|
214
|
-
|
|
215
|
-
.dpk-icon-btn[data-active='true'] {
|
|
216
|
-
background: var(--dpk-blue-soft);
|
|
217
|
-
color: var(--dpk-blue);
|
|
218
|
-
}
|
|
219
|
-
|
|
220
|
-
.dpk-icon-btn svg {
|
|
221
|
-
display: block;
|
|
222
|
-
width: 15px;
|
|
223
|
-
height: 15px;
|
|
224
|
-
}
|
|
225
|
-
|
|
226
|
-
/* Count badge for an icon-only control (comments on a card, drafts on the rail). */
|
|
227
|
-
.dpk-icon-badge {
|
|
228
|
-
position: absolute;
|
|
229
|
-
top: -4px;
|
|
230
|
-
right: -4px;
|
|
231
|
-
min-width: 15px;
|
|
232
|
-
height: 15px;
|
|
233
|
-
padding: 0 3px;
|
|
234
|
-
border: 1.5px solid var(--dpk-paper-raised);
|
|
235
|
-
border-radius: 999px;
|
|
236
|
-
background: var(--dpk-accent);
|
|
237
|
-
color: var(--dpk-accent-ink);
|
|
238
|
-
font-family: var(--dpk-mono);
|
|
239
|
-
font-size: 9px;
|
|
240
|
-
font-variant-numeric: tabular-nums;
|
|
241
|
-
line-height: 12px;
|
|
242
|
-
text-align: center;
|
|
243
|
-
}
|
|
244
|
-
|
|
245
|
-
.dpk-input,
|
|
246
|
-
.dpk-textarea,
|
|
247
|
-
.dpk-select {
|
|
248
|
-
box-sizing: border-box;
|
|
249
|
-
width: 100%;
|
|
250
|
-
min-height: var(--dpk-control-h);
|
|
251
|
-
padding: 5px 9px;
|
|
252
|
-
border: 1px solid var(--dpk-rule-strong);
|
|
253
|
-
border-radius: var(--dpk-radius-sm);
|
|
254
|
-
background: var(--dpk-paper-raised);
|
|
255
|
-
color: var(--dpk-ink);
|
|
256
|
-
font: inherit;
|
|
257
|
-
font-size: 12.5px;
|
|
258
|
-
transition:
|
|
259
|
-
border-color 120ms ease,
|
|
260
|
-
box-shadow 120ms ease;
|
|
261
|
-
}
|
|
262
|
-
|
|
263
|
-
.dpk-input:hover,
|
|
264
|
-
.dpk-textarea:hover,
|
|
265
|
-
.dpk-select:hover {
|
|
266
|
-
border-color: var(--dpk-rule-hover);
|
|
267
|
-
}
|
|
268
|
-
|
|
269
|
-
.dpk-input:focus,
|
|
270
|
-
.dpk-textarea:focus,
|
|
271
|
-
.dpk-select:focus {
|
|
272
|
-
outline: none;
|
|
273
|
-
border-color: var(--dpk-blue);
|
|
274
|
-
box-shadow: var(--dpk-focus);
|
|
275
|
-
}
|
|
276
|
-
|
|
277
|
-
.dpk-select {
|
|
278
|
-
appearance: none;
|
|
279
|
-
background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'><path d='M3 4.5 6 7.5 9 4.5' fill='none' stroke='%23878e9e' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'/></svg>");
|
|
280
|
-
background-repeat: no-repeat;
|
|
281
|
-
background-position: right 7px center;
|
|
282
|
-
padding-right: 26px;
|
|
283
|
-
cursor: pointer;
|
|
284
|
-
}
|
|
285
|
-
|
|
286
|
-
.dpk-textarea {
|
|
287
|
-
resize: vertical;
|
|
288
|
-
min-height: 64px;
|
|
289
|
-
line-height: 1.55;
|
|
290
|
-
}
|
|
291
|
-
`,bn=R`
|
|
292
|
-
.comment-pop {
|
|
293
|
-
box-sizing: border-box;
|
|
294
|
-
overflow: auto;
|
|
295
|
-
position: fixed;
|
|
296
|
-
inset: auto;
|
|
297
|
-
margin: 0;
|
|
298
|
-
display: grid;
|
|
299
|
-
gap: 8px;
|
|
300
|
-
padding: 12px;
|
|
301
|
-
border: 1px solid var(--dpk-rule);
|
|
302
|
-
border-radius: var(--dpk-radius-lg);
|
|
303
|
-
background: var(--dpk-paper-raised);
|
|
304
|
-
box-shadow: var(--dpk-shadow-lg);
|
|
305
|
-
color: var(--dpk-ink);
|
|
306
|
-
font-size: 12.5px;
|
|
307
|
-
}
|
|
308
|
-
|
|
309
|
-
.comment-pop .comment-list {
|
|
310
|
-
list-style: none;
|
|
311
|
-
margin: 0;
|
|
312
|
-
padding: 0;
|
|
313
|
-
display: grid;
|
|
314
|
-
gap: 4px;
|
|
315
|
-
max-height: 140px;
|
|
316
|
-
overflow: auto;
|
|
317
|
-
font-size: 12px;
|
|
318
|
-
color: var(--dpk-ink-soft);
|
|
319
|
-
}
|
|
320
|
-
|
|
321
|
-
.comment-pop .comment-list li {
|
|
322
|
-
padding-left: 8px;
|
|
323
|
-
border-left: 2px solid var(--dpk-accent);
|
|
324
|
-
}
|
|
325
|
-
|
|
326
|
-
.comment-pop .dpk-textarea {
|
|
327
|
-
min-height: 54px;
|
|
328
|
-
}
|
|
329
|
-
|
|
330
|
-
.pop-actions {
|
|
331
|
-
display: flex;
|
|
332
|
-
gap: 2px;
|
|
333
|
-
align-items: center;
|
|
334
|
-
justify-content: flex-end;
|
|
335
|
-
}
|
|
336
|
-
`,ee=(t,e)=>t instanceof e?t:null,yn=ue({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 Tt extends O{static{this.styles=[he,fe,R`
|
|
337
|
-
:host {
|
|
338
|
-
display: inline;
|
|
339
|
-
/* Inherit the surrounding type scale instead of forcing the chrome size:
|
|
340
|
-
an inline edit inside a 17px heading must look like a 17px heading.
|
|
341
|
-
Color comes along too, so an edit on a colored card stays legible. */
|
|
342
|
-
font-family: inherit;
|
|
343
|
-
font-size: inherit;
|
|
344
|
-
font-weight: inherit;
|
|
345
|
-
line-height: inherit;
|
|
346
|
-
color: inherit;
|
|
347
|
-
}
|
|
348
|
-
|
|
349
|
-
.view {
|
|
350
|
-
cursor: text;
|
|
351
|
-
border-bottom: 1px dashed transparent;
|
|
352
|
-
border-radius: 3px;
|
|
353
|
-
padding: 1px 3px;
|
|
354
|
-
transition:
|
|
355
|
-
background 140ms ease,
|
|
356
|
-
border-color 140ms ease;
|
|
357
|
-
}
|
|
358
|
-
|
|
359
|
-
.view:hover {
|
|
360
|
-
border-bottom-color: var(--dpk-blue);
|
|
361
|
-
background: var(--dpk-blue-soft);
|
|
362
|
-
}
|
|
363
|
-
|
|
364
|
-
.view[data-empty='true'] {
|
|
365
|
-
color: var(--dpk-ink-faint);
|
|
366
|
-
font-style: italic;
|
|
367
|
-
}
|
|
368
|
-
|
|
369
|
-
input,
|
|
370
|
-
textarea {
|
|
371
|
-
font: inherit;
|
|
372
|
-
color: inherit;
|
|
373
|
-
background: var(--dpk-paper-raised);
|
|
374
|
-
border: 1px solid var(--dpk-blue);
|
|
375
|
-
border-radius: var(--dpk-radius-sm);
|
|
376
|
-
box-shadow: var(--dpk-focus);
|
|
377
|
-
padding: 3px 7px;
|
|
378
|
-
min-width: 0;
|
|
379
|
-
width: 100%;
|
|
380
|
-
transition: box-shadow 140ms ease;
|
|
381
|
-
}
|
|
382
|
-
|
|
383
|
-
textarea {
|
|
384
|
-
min-height: var(--dpk-inline-textarea-min-height, 90px);
|
|
385
|
-
resize: vertical;
|
|
386
|
-
font-family: var(--dpk-body);
|
|
387
|
-
line-height: 1.5;
|
|
388
|
-
}
|
|
389
|
-
|
|
390
|
-
/* wrap: the field wraps like the text it replaces, and Enter still
|
|
391
|
-
commits, so a one-line value is edited without losing sight of it. */
|
|
392
|
-
:host([wrap]) textarea {
|
|
393
|
-
min-height: 0;
|
|
394
|
-
resize: none;
|
|
395
|
-
line-height: inherit;
|
|
396
|
-
}
|
|
397
|
-
|
|
398
|
-
/* seamless: no field chrome at all — the text is edited where it sits.
|
|
399
|
-
The chrome theme paints fields with its own ink and size, so the
|
|
400
|
-
seamless field re-states the inherited type and color. */
|
|
401
|
-
:host([seamless]) input,
|
|
402
|
-
:host([seamless]) textarea {
|
|
403
|
-
padding: 0;
|
|
404
|
-
border: none;
|
|
405
|
-
border-radius: 0;
|
|
406
|
-
background: transparent;
|
|
407
|
-
box-shadow: none;
|
|
408
|
-
height: 100%;
|
|
409
|
-
min-height: 0;
|
|
410
|
-
overflow: auto;
|
|
411
|
-
resize: none;
|
|
412
|
-
font: inherit;
|
|
413
|
-
font-size: inherit;
|
|
414
|
-
line-height: inherit;
|
|
415
|
-
color: inherit;
|
|
416
|
-
}
|
|
417
|
-
|
|
418
|
-
:host([seamless]) .view {
|
|
419
|
-
padding: 0;
|
|
420
|
-
}
|
|
421
|
-
`]}static{this.properties={value:{type:String},placeholder:{type:String},multiline:{type:Boolean},wrap:{type:Boolean,reflect:!0},seamless:{type:Boolean,reflect:!0},label:{type:String},editing:{state:!0}}}#e="";#o=0;#i=new Ne(this);connectedCallback(){super.connectedCallback(),this.#o+=1}constructor(){super(),this.value="",this.placeholder="",this.multiline=!1,this.wrap=!1,this.seamless=!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("input, textarea"),s=this.renderRoot,n=s instanceof ShadowRoot?s.activeElement:document.activeElement;e&&n!==e&&(e.focus(),e.select())}render(){const e=yn(this.#i.locale);if(!this.editing){const n=this.value.length===0;return f`<span
|
|
422
|
-
class="view"
|
|
423
|
-
data-empty=${String(n)}
|
|
424
|
-
role="button"
|
|
425
|
-
tabindex="0"
|
|
426
|
-
title=${e.clickToEdit}
|
|
427
|
-
@click=${this.#n}
|
|
428
|
-
@keydown=${this.#r}
|
|
429
|
-
>${n?this.placeholder||e.unset:this.value}</span
|
|
430
|
-
>`}const s=this.label||this.placeholder||e.edit;return f`
|
|
431
|
-
${this.multiline||this.wrap?f`<textarea
|
|
432
|
-
class="dpk-textarea"
|
|
433
|
-
.value=${this.#e}
|
|
434
|
-
aria-label=${s}
|
|
435
|
-
@input=${this.#s}
|
|
436
|
-
@keydown=${this.#t}
|
|
437
|
-
@blur=${this.#a}
|
|
438
|
-
></textarea>`:f`<input
|
|
439
|
-
class="dpk-input"
|
|
440
|
-
.value=${this.#e}
|
|
441
|
-
aria-label=${s}
|
|
442
|
-
@input=${this.#s}
|
|
443
|
-
@keydown=${this.#t}
|
|
444
|
-
@blur=${this.#a}
|
|
445
|
-
/>`}
|
|
446
|
-
`}#n=e=>{e.stopPropagation(),this.editing=!0};#r=e=>{e.isComposing||(e.key==="Enter"||e.key===" ")&&(e.preventDefault(),this.editing=!0)};#s=e=>{const s=ee(e.target,HTMLInputElement)??ee(e.target,HTMLTextAreaElement);s!==null&&(this.#e=s.value)};#t=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.#l())}};#a=e=>{const s=e.currentTarget;if(!(s instanceof HTMLInputElement||s instanceof HTMLTextAreaElement))return;const n=this.#o,{selectionStart:i,selectionEnd:r}=s;queueMicrotask(()=>{!this.isConnected||!this.editing||(n!==this.#o?(s.focus(),s.setSelectionRange(i,r)):this.#l())})};#l=()=>{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 kn=()=>{customElements.get("dpk-component-inline-edit")||customElements.define("dpk-component-inline-edit",Tt)},xn={lang:void 0,message:void 0,abortEarly:void 0,abortPipeEarly:void 0};function Pe(t){return xn}let $n;function wn(t){return $n?.get(t)}let An;function Sn(t){return An?.get(t)}let Cn;function _n(t,e){return Cn?.get(t)?.get(e)}function te(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 x(t,e,s,n,i){const r=i&&"input"in i?i.input:s.value,o=i?.expected??t.expects??null,c=i?.received??te(r),a={kind:t.kind,type:t.type,input:r,expected:o,received:c,message:`Invalid ${e}: ${o?`Expected ${o} but r`:"R"}eceived ${c}`,requirement:t.requirement,path:i?.path,issues:i?.issues,lang:n.lang,abortEarly:n.abortEarly,abortPipeEarly:n.abortPipeEarly},l=t.kind==="schema",p=i?.message??t.message??_n(t.reference,a.lang)??(l?Sn(a.lang):null)??n.message??wn(a.lang);p!==void 0&&(a.message=typeof p=="function"?p(a):p),l&&(s.typed=!1),s.issues?s.issues.push(a):s.issues=[a]}function En(t,e){return t===e||Number.isNaN(t)&&Number.isNaN(e)}function Tn(t,e){return Object.prototype.hasOwnProperty.call(t,e)&&e!=="__proto__"&&e!=="prototype"&&e!=="constructor"}function Ue(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},Pe())},t}var Mn=class extends Error{constructor(t){super(t[0].message),this.name="ValiError",this.issues=t}};function Mt(t){return{kind:"validation",type:"integer",reference:Mt,async:!1,expects:null,requirement:Number.isInteger,message:t,"~run"(e,s){return e.typed&&!this.requirement(e.value)&&x(this,"integer",e,s),e}}}function y(t,e){return{kind:"validation",type:"min_length",reference:y,async:!1,expects:`>=${t}`,requirement:t,message:e,"~run"(s,n){return s.typed&&s.value.length<this.requirement&&x(this,"length",s,n,{received:`${s.value.length}`}),s}}}function Ot(t,e){return{kind:"validation",type:"min_value",reference:Ot,async:!1,expects:`>=${t instanceof Date?t.toJSON():te(t)}`,requirement:t,message:e,"~run"(s,n){return s.typed&&!(s.value>=this.requirement)&&x(this,"value",s,n,{received:s.value instanceof Date?s.value.toJSON():te(s.value)}),s}}}function I(t,e){return{kind:"validation",type:"regex",reference:I,async:!1,expects:`${t}`,requirement:t,message:e,"~run"(s,n){return s.typed&&!this.requirement.test(s.value)&&x(this,"format",s,n),s}}}function Ie(){return{kind:"transformation",type:"trim",reference:Ie,async:!1,"~run"(t){return t.value=t.value.trim(),t}}}const On={abortEarly:!0};function jt(t,e,s){return typeof t.fallback=="function"?t.fallback(e,s):t.fallback}function ge(t,e,s){return typeof t.default=="function"?t.default(e,s):t.default}function D(t,e){return $({kind:"schema",type:"array",reference:D,expects:"Array",async:!1,item:t,message:e,"~run"(s,n){const i=s.value;if(Array.isArray(i)){s.typed=!0,s.value=[];for(let r=0;r<i.length;r++){const o=i[r],c=this.item["~run"]({value:o},n);if(c.issues){const a={type:"array",origin:"value",input:i,key:r,value:o};for(const l of c.issues)l.path?l.path.unshift(a):l.path=[a],s.issues?.push(l);if(s.issues||(s.issues=c.issues),n.abortEarly){s.typed=!1;break}}c.typed||(s.typed=!1),s.value.push(c.value)}}else x(this,"type",s,n);return s}})}function Rt(t){return $({kind:"schema",type:"boolean",reference:Rt,expects:"boolean",async:!1,message:t,"~run"(e,s){return typeof e.value=="boolean"?e.typed=!0:x(this,"type",e,s),e}})}function C(t,e){return $({kind:"schema",type:"exact_optional",reference:C,expects:t.expects,async:!1,wrapped:t,default:e,"~run"(s,n){return this.wrapped["~run"](s,n)}})}function Lt(t){return $({kind:"schema",type:"lazy",reference:Lt,expects:"unknown",async:!1,getter:t,"~run"(e,s){return this.getter(e.value)["~run"](e,s)}})}function F(t,e){return $({kind:"schema",type:"literal",reference:F,expects:te(t),async:!1,literal:t,message:e,"~run"(s,n){return En(s.value,this.literal)?s.typed=!0:x(this,"type",s,n),s}})}function Nt(t,e){return $({kind:"schema",type:"nullable",reference:Nt,expects:`(${t.expects} | null)`,async:!1,wrapped:t,default:e,"~run"(s,n){return s.value===null&&(this.default!==void 0&&(s.value=ge(this,s,n)),s.value===null)?(s.typed=!0,s):this.wrapped["~run"](s,n)}})}function Pt(t){return $({kind:"schema",type:"number",reference:Pt,expects:"number",async:!1,message:t,"~run"(e,s){return typeof e.value=="number"&&!isNaN(e.value)?e.typed=!0:x(this,"type",e,s),e}})}function w(t,e){return $({kind:"schema",type:"object",reference:w,expects:"Object",async:!1,entries:t,message:e,"~run"(s,n){const i=s.value;if(i&&typeof i=="object"){s.typed=!0,s.value={};for(const r in this.entries){const o=this.entries[r];if(r in i||(o.type==="exact_optional"||o.type==="optional"||o.type==="nullish")&&o.default!==void 0){const c=r in i?i[r]:ge(o),a=o["~run"]({value:c},n);if(a.issues){const l={type:"object",origin:"value",input:i,key:r,value:c};for(const p of a.issues)p.path?p.path.unshift(l):p.path=[l],s.issues?.push(p);if(s.issues||(s.issues=a.issues),n.abortEarly){s.typed=!1;break}}a.typed||(s.typed=!1),s.value[r]=a.value}else if(o.fallback!==void 0)s.value[r]=jt(o);else if(o.type!=="exact_optional"&&o.type!=="optional"&&o.type!=="nullish"&&(x(this,"key",s,n,{input:void 0,expected:`"${r}"`,path:[{type:"object",origin:"key",input:i,key:r,value:i[r]}]}),n.abortEarly))break}}else x(this,"type",s,n);return s}})}function me(t,e){return $({kind:"schema",type:"optional",reference:me,expects:`(${t.expects} | undefined)`,async:!1,wrapped:t,default:e,"~run"(s,n){return s.value===void 0&&(this.default!==void 0&&(s.value=ge(this,s,n)),s.value===void 0)?(s.typed=!0,s):this.wrapped["~run"](s,n)}})}function ve(t,e){return $({kind:"schema",type:"picklist",reference:ve,expects:Ue(t.map(te),"|"),async:!1,options:t,message:e,"~run"(s,n){return this.options.includes(s.value)?s.typed=!0:x(this,"type",s,n),s}})}function Ut(t,e,s){return $({kind:"schema",type:"record",reference:Ut,expects:"Object",async:!1,key:t,value:e,message:s,"~run"(n,i){const r=n.value;if(r&&typeof r=="object"){n.typed=!0,n.value={};for(const o in r)if(Tn(r,o)){const c=r[o],a=this.key["~run"]({value:o},i);if(a.issues){const p={type:"object",origin:"key",input:r,key:o,value:c};for(const d of a.issues)d.path=[p],n.issues?.push(d);if(n.issues||(n.issues=a.issues),i.abortEarly){n.typed=!1;break}}const l=this.value["~run"]({value:c},i);if(l.issues){const p={type:"object",origin:"value",input:r,key:o,value:c};for(const d of l.issues)d.path?d.path.unshift(p):d.path=[p],n.issues?.push(d);if(n.issues||(n.issues=l.issues),i.abortEarly){n.typed=!1;break}}(!a.typed||!l.typed)&&(n.typed=!1),a.typed&&(n.value[a.value]=l.value)}}else x(this,"type",n,i);return n}})}function K(t,e){return $({kind:"schema",type:"strict_object",reference:K,expects:"Object",async:!1,entries:t,message:e,"~run"(s,n){const i=s.value;if(i&&typeof i=="object"){s.typed=!0,s.value={};for(const r in this.entries){const o=this.entries[r];if(r in i||(o.type==="exact_optional"||o.type==="optional"||o.type==="nullish")&&o.default!==void 0){const c=r in i?i[r]:ge(o),a=o["~run"]({value:c},n);if(a.issues){const l={type:"object",origin:"value",input:i,key:r,value:c};for(const p of a.issues)p.path?p.path.unshift(l):p.path=[l],s.issues?.push(p);if(s.issues||(s.issues=a.issues),n.abortEarly){s.typed=!1;break}}a.typed||(s.typed=!1),s.value[r]=a.value}else if(o.fallback!==void 0)s.value[r]=jt(o);else if(o.type!=="exact_optional"&&o.type!=="optional"&&o.type!=="nullish"&&(x(this,"key",s,n,{input:void 0,expected:`"${r}"`,path:[{type:"object",origin:"key",input:i,key:r,value:i[r]}]}),n.abortEarly))break}if(!s.issues||!n.abortEarly){for(const r in i)if(!Object.prototype.hasOwnProperty.call(this.entries,r)){x(this,"key",s,n,{input:r,expected:"never",path:[{type:"object",origin:"key",input:i,key:r,value:i[r]}]});break}}}else x(this,"type",s,n);return s}})}function g(t){return $({kind:"schema",type:"string",reference:g,expects:"string",async:!1,message:t,"~run"(e,s){return typeof e.value=="string"?e.typed=!0:x(this,"type",e,s),e}})}function It(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 Dt(t,e){return $({kind:"schema",type:"union",reference:Dt,expects:Ue(t.map(s=>s.expects),"|"),async:!1,options:t,message:e,"~run"(s,n){let i,r,o;for(const c of this.options){const a=c["~run"]({value:s.value},n);if(a.typed)if(a.issues)r?r.push(a):r=[a];else{i=a;break}else o?o.push(a):o=[a]}if(i)return i;if(r){if(r.length===1)return r[0];x(this,"type",s,n,{issues:It(r)}),s.typed=!0}else{if(o?.length===1)return o[0];x(this,"type",s,n,{issues:It(o)})}return s}})}function z(){return $({kind:"schema",type:"unknown",reference:z,expects:"unknown",async:!1,"~run"(t){return t.typed=!0,t}})}function zt(t,e,s){return $({kind:"schema",type:"variant",reference:zt,expects:"Object",async:!1,key:t,options:e,message:s,"~run"(n,i){const r=n.value;if(r&&typeof r=="object"){let o,c=0,a=this.key,l=[];const p=(d,u)=>{for(const h of d.options){if(h.type==="variant")p(h,new Set(u).add(h.key));else{let v=!0,S=0;for(const A of u){const j=h.entries[A];if(A in r?j["~run"]({typed:!1,value:r[A]},On).issues:j.type!=="exact_optional"&&j.type!=="optional"&&j.type!=="nullish"){v=!1,a!==A&&(c<S||c===S&&A in r&&!(a in r))&&(c=S,a=A,l=[]),a===A&&l.push(h.entries[A].expects);break}S++}if(v){const A=h["~run"]({value:r},i);(!o||!o.typed&&A.typed)&&(o=A)}}if(o&&!o.issues)break}};if(p(this,new Set([this.key])),o)return o;x(this,"type",n,i,{input:r[a],expected:Ue(l,"|"),path:[{type:"object",origin:"value",input:r,key:a,value:r[a]}]})}else x(this,"type",n,i);return n}})}function Bt(t,e,s){const n=t["~run"]({value:e},Pe());if(n.issues)throw new Mn(n.issues);return n.value}function b(...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 k(t,e,s){const n=t["~run"]({value:e},Pe());return{typed:n.typed,success:!n.issues,output:n.value,issues:n.issues}}const be=w({type:b(g(),y(1)),id:b(g(),y(1))}),jn=b(g(),y(1),I(/^[A-Za-z0-9_-]+$/,'ids may only contain letters, digits, "_" and "-" (a "." builds a path)')),Rn=(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},J=w({id:b(g(),y(1)),type:b(g(),y(1)),target:be,payload:z(),note:C(g()),createdAt:b(g(),y(1))}),Ln=(t,e,s,n={})=>{const i=w({id:b(g(),y(1)),type:F(t),target:be,payload:s,note:C(g()),createdAt:b(g(),y(1))}),r=o=>{const c=k(J,o);if(!c.success||c.output.type!==t)return null;const a=k(s,o.payload);return a.success?{id:c.output.id,type:t,target:c.output.target,payload:a.output,...c.output.note===void 0?{}:{note:c.output.note},createdAt:c.output.createdAt}:null};return{schema:i,mode:n.mode??"patch",targetType:e,actionType:t,payloadSchema:s,parse:r,...n.dedupeKey?{dedupeKey:n.dedupeKey}:{}}},Nn=(t,e)=>{const s=ye(t,e.type);if(s===void 0)return null;const n=s.parse(e);return n===null?null:n},Pn=(t,e)=>{const s=k(t.payloadSchema,e.payload);if(!s.success)throw new Error(`invalid payload for action "${e.type}"`);return s.output},ye=(t,e)=>Object.hasOwn(t,e)?t[e]:void 0,Un=t=>{throw new Error(`unhandled action: ${JSON.stringify(t)}`)},In=w({id:b(g(),y(1))}),Dn=t=>{const e=k(In,t.payload);return`${t.type}|${e.success?e.output.id:JSON.stringify(t.payload)}`},_=t=>`${t.type}:${t.id}`,qt=t=>{const e=t.indexOf(":");return e<=0?{type:"unknown",id:t}:{type:t.slice(0,e),id:t.slice(e+1)}},De=(t,e)=>typeof t=="string"?qt(t.includes(":")?t:`${e}:${t}`):{type:t.type,id:t.id},zn=(t,e)=>t.type===e.type&&t.id===e.id,Ht=t=>{const e=t.normalize("NFKD").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"").slice(0,40);return e.length>0?e:"item"},Bn=(t,e)=>{const s=Ht(t),n=new Set(e);if(!n.has(s))return s;for(let i=2;i<1e3;i+=1){const r=`${s}-${i}`;if(!n.has(r))return r}return`${s}-${Math.random().toString(36).slice(2,8)}`},Ft=()=>{const t=globalThis.crypto;return t?.randomUUID?t.randomUUID():`a-${Date.now().toString(36)}-${Math.random().toString(36).slice(2,10)}`},E="comment",se=t=>{const[e]=t;return{path:e?.path?.map(s=>String(s.key)).join(".")??"",message:e?.message??"invalid action"}},Kt=w({type:b(g(),y(1)),target:Dt([b(g(),y(1)),be]),payload:me(z()),note:C(g()),id:C(b(g(),y(1))),createdAt:C(b(g(),y(1)))}),qn=(t,e)=>{const s=k(Kt,t);if(!s.success)return{ok:!1,issue:se(s.issues)};const n=s.output,i=De(n.target,e.targetType),r={id:n.id??Ft(),type:n.type,target:i,payload:n.payload??{},...n.note===void 0?{}:{note:n.note},createdAt:n.createdAt??new Date().toISOString()},o=k(e.schema,r);if(!o.success)return{ok:!1,issue:se(o.issues)};const c=k(J,o.output);return c.success?{ok:!0,action:c.output}:{ok:!1,issue:se(c.issues)}},ze=(t,e)=>e.dedupeKey?e.dedupeKey(t):e.mode!=="patch"?null:`${t.type}|${_(t.target)}`,Be=(t,e,s)=>{const n=ze(e,s);if(n===null)return[...t,e];const i=t.at(-1);return!i||ze(i,s)!==n||!Hn(i,e)?[...t,e]:[...t.slice(0,-1),e]},Hn=(t,e)=>zn(t.target,e.target),ke=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),Jt=w({id:b(g(),y(1)),type:F(E),target:w({type:b(g(),y(1)),id:b(g(),y(1))}),payload:w({body:b(g(),y(1))}),note:C(g()),createdAt:b(g(),y(1))}),Vt={schema:Jt,mode:"append",targetType:"page"},Fn=w({body:g()}),xe=t=>{const e=k(Fn,t.payload);return e.success?e.output.body:""},qe="element",Wt=b(g(),I(/^[A-Z][A-Z0-9_]*$/,"component action types are CONSTANT_CASE")),Gt=Ut(g(),z()),Kn=w({type:F(qe),id:b(g(),I(/^[^/]+\/.+/,"component references start with a provider id"))}),Jn=w({id:b(g(),y(1)),type:Wt,target:Kn,payload:Gt,note:C(g()),createdAt:b(g(),y(1))}),Vn={schema:Jn,mode:"sequence",targetType:qe},Wn=K({type:Wt,target:b(g(),I(/^element:[^/]+\/.+/)),payload:me(Gt,{})}),Yt=K({id:b(g(),y(1)),title:b(g(),y(1)),summary:C(g()),tone:C(ve(["create","update","delete","move","meta"])),stale:C(ve(["unsupported-action-type","target-missing","constraint-violated"]))}),He=t=>{if(t.type!==qe)return null;const e=t.id.indexOf("/");if(e<=0)return null;try{return decodeURIComponent(t.id.slice(0,e))}catch{return null}},T=t=>t.type!==E&&He(t.target)!==null,Gn=(t,e)=>t.filter(s=>T(s)&&He(s.target)===e),Zt=(t,e)=>{const s=new Map(t.flatMap(n=>T(n)?[[n.id,He(n.target)]]:[]));return new Map(e.flatMap(n=>n.results.flatMap(i=>s.get(i.id)===n.id?[[i.id,i]]:[])))},Fe=Object.freeze({}),Ke=t=>{const e=t.startsWith("#")?t.slice(1):t;if(e.length===0)return Fe;const s=new URLSearchParams(e.startsWith("?")?e.slice(1):e),n={};for(const[i,r]of s)i.length>0&&r.length>0&&(n[i]=r);return n},V=t=>{const e=new URLSearchParams;for(const n of Object.keys(t).sort((i,r)=>i<r?-1:i>r?1:0)){const i=t[n];i!=null&&i!==""&&e.set(n,i)}const s=e.toString();return s.length===0?"":`#${s}`},Je=(t,e)=>{const s={...t};for(const[n,i]of Object.entries(e))i==null||i===""?delete s[n]:s[n]=i;return s},Yn=(t,e="json")=>`\`\`\`${e}
|
|
447
|
-
${t}
|
|
448
|
-
\`\`\``,Zn=t=>JSON.stringify({type:t.type,target:t.target,payload:t.payload,...t.note===void 0?{}:{note:t.note}},null,2),Ve=(t,e,s)=>{const{actions:n,state:i}=t,r=new Set(t.stale.map(p=>p.action.id)),o=n.filter(p=>!r.has(p.id)),c=o.filter(p=>p.type===E),a=o.filter(p=>p.type!==E),l=[];if(l.push(`# Review draft \u2014 ${e.label}`),l.push(""),l.push(`- template: \`${e.name}\``),l.push(`- framework: \`dev-process-kit@${s}\``),l.push(`- navigation: \`${V(t.navigation)||"(none)"}\``),l.push(`- pending: ${a.length} change(s), ${c.length} comment(s)`),t.stale.length>0&&l.push(`- stale (not applicable to the current base): ${t.stale.length}`),l.push(""),l.push("## How to apply"),l.push(""),l.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."),a.some(T)&&(l.push(""),l.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.")),l.push(""),c.length>0){l.push(`## Comments (${c.length})`),l.push("");for(const[p,d]of c.entries()){const u=e.describe(d,i,t.base);l.push(`${p+1}. **${u.targetLabel}** \u2014 \`${_(d.target)}\``),l.push(` > ${xe(d).replace(/\n/g,`
|
|
449
|
-
> `)}`)}l.push("")}if(a.length>0){l.push(`## Requested changes (${a.length})`),l.push("");for(const[p,d]of a.entries()){const u=e.describe(d,i,t.base),h=u.summary?` \u2014 ${u.summary}`:"";l.push(`${p+1}. **${u.title}**${h}`),l.push(` target: \`${_(d.target)}\` (${d.target.type})`),l.push(` \`\`\`json
|
|
450
|
-
${Zn(d).replace(/\n/g,`
|
|
451
|
-
`)}
|
|
452
|
-
\`\`\``)}l.push("")}if(a.length===0&&c.length===0&&(l.push("_No pending draft actions._"),l.push("")),t.stale.length>0){l.push(`## Not applicable to the current base (${t.stale.length})`),l.push(""),l.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."),l.push("");for(const[p,{action:d,reason:u}]of t.stale.entries()){const h=e.describe(d,i,t.base),v=d.type===E?xe(d):h.title;l.push(`${p+1}. \`${d.type}\` on \`${_(d.target)}\` (${u}) \u2014 ${v}`)}l.push("")}return l.push("## Canonical draft (JSON)"),l.push(""),l.push(Yn(ke(n))),l.push(""),l.join(`
|
|
453
|
-
`)},W="0.0.2",Qt=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()}},Xt=ue({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",copyJson:"Copy JSON",copyBrief:"Copy brief",clear:"Clear",deleteAction:"Delete this draft action",wholePage:"Whole page",comment:"Comment",sent:"Sent to Claude \u2713",copied:t=>`copied ${t} \u2713`,copyFailed:"copy failed"},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",copyJson:"JSON \u3092\u30B3\u30D4\u30FC",copyBrief:"brief \u3092\u30B3\u30D4\u30FC",clear:"\u30AF\u30EA\u30A2",deleteAction:"\u3053\u306E draft action \u3092\u524A\u9664",wholePage:"\u30DA\u30FC\u30B8\u5168\u4F53",comment:"\u30B3\u30E1\u30F3\u30C8",sent:"Claude \u306B\u9001\u308A\u307E\u3057\u305F \u2713",copied:t=>`${t} \u3092\u30B3\u30D4\u30FC\u3057\u307E\u3057\u305F \u2713`,copyFailed:"\u30B3\u30D4\u30FC\u3067\u304D\u307E\u305B\u3093\u3067\u3057\u305F"}}),Qn=()=>({body:"",attachment:{kind:"page"},copy:{kind:"idle"},copyRequest:0,send:{kind:"idle"},sendRequest:0}),es=t=>t.kind==="explicit"?{kind:t.resume}:t,ts=(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:es(t.attachment)};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:es(t.attachment),copy:{kind:"idle"},copyRequest:t.copyRequest+1,send:{kind:"idle"},sendRequest:t.sendRequest+1};case"copy-started":return{...t,copy:{kind:"pending",format:e.format},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:e.ok?{kind:"copied",format:t.copy.format}:{kind:"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}}}},Xn=(t,e)=>{const s=t.body.trim();return s===""?null:{target:e,body:s}},ei={en:"English",ja:"\u65E5\u672C\u8A9E"},$e=ue({en:{review:"Review",reviewToggle:"Review / comments",useLightTheme:"Switch to light theme",useDarkTheme:"Switch to dark theme",language:"Language",baseDataError:"Could not read the base data (showing an empty page)",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"},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",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",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"}}),ti=4096,si="reviews",ss="Review from the page (dev-process-kit). Apply it to the base data and republish this artifact.",ni=t=>new TextEncoder().encode(t).length,ii=t=>t.replace(/[\u0000-\u0008\u000B-\u001F\u007F]/g,""),ri=t=>{const e=`${ss}
|
|
454
|
-
|
|
455
|
-
${ii(t)}`;return ni(e)<=ti?e:null},oi=t=>`${ss}
|
|
456
|
-
|
|
457
|
-
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).`,ai={consent_required:"consent",forbidden:"forbidden",not_granted:"forbidden",capability_disabled:"forbidden",capability_removed:"forbidden",claude_unavailable:"claude_unavailable",rate_limited:"rate_limited"},li=t=>{const e=typeof t=="object"&&t!==null&&"code"in t?t.code:void 0;return(typeof e=="string"?ai[e]:void 0)??"error"},ci={too_large:"handoffTooLarge",consent:"handoffConsent",forbidden:"handoffForbidden",claude_unavailable:"handoffClaudeUnavailable",rate_limited:"handoffRateLimited",storage:"handoffStorage",error:"handoffError"},ns=(t,e)=>$e(e)[ci[t]],is=t=>t.group?`${t.group} \xB7 ${t.label}`:t.label,rs=(t,e)=>{const{definition:s,state:n,navigation:i,derivation:r}=t,o=Xt(t.locale),c=s.currentTarget?.(n,i)??null,a=e.attachment,l=a.kind==="explicit"?s.commentTargets(n,i).find(u=>u.value===a.ref):null,p=a.kind==="explicit"?{ref:a.ref,label:l?is(l):a.ref}:a.kind==="current"&&c?{ref:c.value,label:is(c)}:{ref:`page:${s.name}`,label:o.wholePage},d=new Map(r.stale.map(u=>[u.action.id,u.reason]));return{body:e.body,target:p,attachment:a.kind==="explicit"?{kind:"explicit"}:c?{kind:"checkbox",checked:a.kind==="current",group:c.group??""}:{kind:"none"},canSubmit:e.body.trim().length>0,items:r.actions.map(u=>{const h=s.describe(u,n,r.base),v=u.type==="comment";return{id:u.id,title:v?o.comment:h.title,targetLabel:h.targetLabel,tone:v?"comment":h.tone,text:{kind:v?"comment":"summary",body:v?xe(u):h.summary??""},code:s.serialize(u),stale:d.get(u.id)??null}}),issues:t.issues.map(u=>`${u.path?`${u.path}: `:""}${u.message}`),send:t.sendable!==!0?"hidden":r.actions.length===0||e.send.kind==="pending"?"disabled":"ready",flash:e.send.kind==="sent"?o.sent:e.send.kind==="failed"?ns(e.send.reason,t.locale):e.copy.kind==="copied"?o.copied(e.copy.format==="json"?"JSON":"brief"):e.copy.kind==="failed"?o.copyFailed:""}},di=[he,fe,R`
|
|
458
|
-
:host {
|
|
459
|
-
display: flex;
|
|
460
|
-
flex-direction: column;
|
|
461
|
-
min-height: 0;
|
|
462
|
-
width: 100%;
|
|
463
|
-
background: var(--dpk-paper-raised);
|
|
464
|
-
}
|
|
465
|
-
|
|
466
|
-
header {
|
|
467
|
-
display: flex;
|
|
468
|
-
align-items: center;
|
|
469
|
-
justify-content: space-between;
|
|
470
|
-
gap: 8px;
|
|
471
|
-
padding: 14px 16px 12px;
|
|
472
|
-
border-bottom: 1px solid var(--dpk-rule);
|
|
473
|
-
background: linear-gradient(180deg, var(--dpk-paper-raised), var(--dpk-paper));
|
|
474
|
-
}
|
|
475
|
-
|
|
476
|
-
header h2 {
|
|
477
|
-
font-size: 13.5px;
|
|
478
|
-
font-weight: 620;
|
|
479
|
-
letter-spacing: -0.01em;
|
|
480
|
-
}
|
|
481
|
-
|
|
482
|
-
.composer {
|
|
483
|
-
display: grid;
|
|
484
|
-
gap: 10px;
|
|
485
|
-
padding: 14px 16px 14px;
|
|
486
|
-
border-bottom: 1px solid var(--dpk-rule);
|
|
487
|
-
background: var(--dpk-paper-sunken);
|
|
488
|
-
}
|
|
489
|
-
|
|
490
|
-
.composer textarea {
|
|
491
|
-
min-height: 62px;
|
|
492
|
-
background: var(--dpk-paper-raised);
|
|
493
|
-
border-radius: var(--dpk-radius);
|
|
494
|
-
}
|
|
495
|
-
|
|
496
|
-
.composer .row {
|
|
497
|
-
display: flex;
|
|
498
|
-
align-items: center;
|
|
499
|
-
gap: 8px;
|
|
500
|
-
}
|
|
501
|
-
|
|
502
|
-
.composer .attach {
|
|
503
|
-
display: inline-flex;
|
|
504
|
-
align-items: center;
|
|
505
|
-
gap: 7px;
|
|
506
|
-
font-size: 12px;
|
|
507
|
-
color: var(--dpk-ink-soft);
|
|
508
|
-
cursor: pointer;
|
|
509
|
-
}
|
|
510
|
-
|
|
511
|
-
.composer .attach input {
|
|
512
|
-
width: 14px;
|
|
513
|
-
height: 14px;
|
|
514
|
-
margin: 0;
|
|
515
|
-
accent-color: var(--dpk-accent);
|
|
516
|
-
cursor: pointer;
|
|
517
|
-
}
|
|
518
|
-
|
|
519
|
-
.composer .chip {
|
|
520
|
-
display: inline-flex;
|
|
521
|
-
align-items: center;
|
|
522
|
-
gap: 6px;
|
|
523
|
-
padding: 3px 10px;
|
|
524
|
-
border: 1px solid var(--dpk-rule);
|
|
525
|
-
border-radius: 999px;
|
|
526
|
-
background: var(--dpk-paper-raised);
|
|
527
|
-
font-size: 11.5px;
|
|
528
|
-
cursor: pointer;
|
|
529
|
-
}
|
|
530
|
-
|
|
531
|
-
.composer .chip svg {
|
|
532
|
-
flex: none;
|
|
533
|
-
width: 12px;
|
|
534
|
-
height: 12px;
|
|
535
|
-
}
|
|
536
|
-
|
|
537
|
-
.composer .chip:hover {
|
|
538
|
-
border-color: var(--dpk-rule-strong);
|
|
539
|
-
}
|
|
540
|
-
|
|
541
|
-
.target-line {
|
|
542
|
-
margin-right: auto;
|
|
543
|
-
font-family: var(--dpk-mono);
|
|
544
|
-
font-size: 10px;
|
|
545
|
-
letter-spacing: 0.03em;
|
|
546
|
-
color: var(--dpk-ink-faint);
|
|
547
|
-
}
|
|
548
|
-
|
|
549
|
-
.list {
|
|
550
|
-
list-style: none;
|
|
551
|
-
margin: 0;
|
|
552
|
-
padding: 10px 12px;
|
|
553
|
-
overflow: auto;
|
|
554
|
-
flex: 1;
|
|
555
|
-
min-height: 0;
|
|
556
|
-
display: grid;
|
|
557
|
-
gap: 8px;
|
|
558
|
-
align-content: start;
|
|
559
|
-
}
|
|
560
|
-
|
|
561
|
-
.item {
|
|
562
|
-
position: relative;
|
|
563
|
-
display: grid;
|
|
564
|
-
gap: 4px;
|
|
565
|
-
padding: 10px 12px 11px 14px;
|
|
566
|
-
border: 1px solid var(--dpk-rule);
|
|
567
|
-
border-radius: var(--dpk-radius);
|
|
568
|
-
background: var(--dpk-paper-raised);
|
|
569
|
-
box-shadow: var(--dpk-shadow-xs);
|
|
570
|
-
transition:
|
|
571
|
-
box-shadow 160ms ease,
|
|
572
|
-
border-color 160ms ease;
|
|
573
|
-
}
|
|
574
|
-
|
|
575
|
-
.item:hover {
|
|
576
|
-
box-shadow: var(--dpk-shadow-sm);
|
|
577
|
-
}
|
|
578
|
-
|
|
579
|
-
.item::before {
|
|
580
|
-
content: '';
|
|
581
|
-
position: absolute;
|
|
582
|
-
left: 0;
|
|
583
|
-
top: 10px;
|
|
584
|
-
bottom: 10px;
|
|
585
|
-
width: 3px;
|
|
586
|
-
border-radius: 0 2px 2px 0;
|
|
587
|
-
background: var(--tone, var(--dpk-ink-faint));
|
|
588
|
-
}
|
|
589
|
-
|
|
590
|
-
.item[data-tone='comment'] {
|
|
591
|
-
--tone: var(--dpk-accent);
|
|
592
|
-
background: linear-gradient(90deg, var(--dpk-accent-soft), transparent 55%);
|
|
593
|
-
}
|
|
594
|
-
|
|
595
|
-
.item[data-tone='create'] {
|
|
596
|
-
--tone: var(--dpk-green);
|
|
597
|
-
}
|
|
598
|
-
|
|
599
|
-
.item[data-tone='update'] {
|
|
600
|
-
--tone: var(--dpk-blue);
|
|
601
|
-
}
|
|
602
|
-
|
|
603
|
-
.item[data-tone='delete'] {
|
|
604
|
-
--tone: var(--dpk-accent);
|
|
605
|
-
}
|
|
606
|
-
|
|
607
|
-
.item[data-tone='move'] {
|
|
608
|
-
--tone: var(--dpk-violet);
|
|
609
|
-
}
|
|
610
|
-
|
|
611
|
-
.item[data-stale='true'] {
|
|
612
|
-
opacity: 0.5;
|
|
613
|
-
border-style: dashed;
|
|
614
|
-
box-shadow: none;
|
|
615
|
-
}
|
|
616
|
-
|
|
617
|
-
.item-head {
|
|
618
|
-
display: flex;
|
|
619
|
-
align-items: center;
|
|
620
|
-
gap: 6px;
|
|
621
|
-
}
|
|
622
|
-
|
|
623
|
-
.item-title {
|
|
624
|
-
font-size: 12.5px;
|
|
625
|
-
font-weight: 600;
|
|
626
|
-
}
|
|
627
|
-
|
|
628
|
-
.stale-badge {
|
|
629
|
-
padding: 1px 7px;
|
|
630
|
-
border: 1px solid var(--dpk-rule-strong);
|
|
631
|
-
border-radius: 999px;
|
|
632
|
-
font-family: var(--dpk-mono);
|
|
633
|
-
font-size: 9px;
|
|
634
|
-
letter-spacing: 0.06em;
|
|
635
|
-
text-transform: uppercase;
|
|
636
|
-
color: var(--dpk-ink-faint);
|
|
637
|
-
}
|
|
638
|
-
|
|
639
|
-
.item-head .dpk-icon-btn {
|
|
640
|
-
margin-left: auto;
|
|
641
|
-
}
|
|
642
|
-
|
|
643
|
-
.item-target {
|
|
644
|
-
font-family: var(--dpk-mono);
|
|
645
|
-
font-size: 10px;
|
|
646
|
-
color: var(--dpk-ink-faint);
|
|
647
|
-
}
|
|
648
|
-
|
|
649
|
-
.item-summary {
|
|
650
|
-
font-size: 12px;
|
|
651
|
-
color: var(--dpk-ink-soft);
|
|
652
|
-
}
|
|
653
|
-
|
|
654
|
-
.item-body {
|
|
655
|
-
margin: 2px 0 0;
|
|
656
|
-
padding-left: 9px;
|
|
657
|
-
border-left: 2px solid var(--dpk-accent);
|
|
658
|
-
font-size: 12.5px;
|
|
659
|
-
white-space: pre-wrap;
|
|
660
|
-
}
|
|
661
|
-
|
|
662
|
-
.item-code {
|
|
663
|
-
margin-top: 2px;
|
|
664
|
-
font-family: var(--dpk-mono);
|
|
665
|
-
font-size: 10px;
|
|
666
|
-
color: var(--dpk-ink-faint);
|
|
667
|
-
overflow-wrap: anywhere;
|
|
668
|
-
}
|
|
669
|
-
|
|
670
|
-
.empty {
|
|
671
|
-
padding: 6px 4px;
|
|
672
|
-
font-size: 12px;
|
|
673
|
-
line-height: 1.7;
|
|
674
|
-
color: var(--dpk-ink-faint);
|
|
675
|
-
}
|
|
676
|
-
|
|
677
|
-
.issues {
|
|
678
|
-
margin: 10px 12px 0;
|
|
679
|
-
padding: 9px 11px;
|
|
680
|
-
border: 1px solid rgba(194, 64, 15, 0.35);
|
|
681
|
-
border-radius: var(--dpk-radius-sm);
|
|
682
|
-
background: var(--dpk-accent-soft);
|
|
683
|
-
font-size: 11.5px;
|
|
684
|
-
}
|
|
685
|
-
|
|
686
|
-
.issues ul {
|
|
687
|
-
margin: 4px 0 0;
|
|
688
|
-
padding-left: 16px;
|
|
689
|
-
}
|
|
690
|
-
|
|
691
|
-
footer {
|
|
692
|
-
display: flex;
|
|
693
|
-
flex-wrap: wrap;
|
|
694
|
-
align-items: center;
|
|
695
|
-
gap: 8px;
|
|
696
|
-
padding: 12px 16px;
|
|
697
|
-
border-top: 1px solid var(--dpk-rule);
|
|
698
|
-
background: linear-gradient(180deg, var(--dpk-paper-sunken), var(--dpk-paper-inset));
|
|
699
|
-
}
|
|
700
|
-
|
|
701
|
-
.flash {
|
|
702
|
-
font-family: var(--dpk-mono);
|
|
703
|
-
font-size: 10px;
|
|
704
|
-
letter-spacing: 0.04em;
|
|
705
|
-
color: var(--dpk-green);
|
|
706
|
-
}
|
|
707
|
-
`],pi={CHILD:2},os=t=>(...e)=>({_$litDirective$:t,values:e});let as=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:ui}=pn,ls=t=>t,cs=()=>document.createComment(""),ne=(t,e,s)=>{const n=t._$AA.parentNode,i=e===void 0?t._$AB:e._$AA;if(s===void 0){const r=n.insertBefore(cs(),i),o=n.insertBefore(cs(),i);s=new ui(r,o,t,t.options)}else{const r=s._$AB.nextSibling,o=s._$AM,c=o!==t;if(c){let a;s._$AQ?.(t),s._$AM=t,s._$AP!==void 0&&(a=t._$AU)!==o._$AU&&s._$AP(a)}if(r!==i||c){let a=s._$AA;for(;a!==r;){const l=ls(a).nextSibling;ls(n).insertBefore(a,i),a=l}}}return s},B=(t,e,s=t)=>(t._$AI(e,s),t),hi={},ds=(t,e=hi)=>t._$AH=e,fi=t=>t._$AH,We=t=>{t._$AR(),t._$AA.remove()},ps=(t,e,s)=>{const n=new Map;for(let i=e;i<=s;i++)n.set(t[i],i);return n},us=os(class extends as{constructor(t){if(super(t),t.type!==pi.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 i=[],r=[];let o=0;for(const c of t)i[o]=n?n(c,o):o,r[o]=s(c,o),o++;return{values:r,keys:i}}render(t,e,s){return this.dt(t,e,s).values}update(t,[e,s,n]){const i=fi(t),{values:r,keys:o}=this.dt(e,s,n);if(!Array.isArray(i))return this.ut=o,r;const c=this.ut??=[],a=[];let l,p,d=0,u=i.length-1,h=0,v=r.length-1;for(;d<=u&&h<=v;)if(i[d]===null)d++;else if(i[u]===null)u--;else if(c[d]===o[h])a[h]=B(i[d],r[h]),d++,h++;else if(c[u]===o[v])a[v]=B(i[u],r[v]),u--,v--;else if(c[d]===o[v])a[v]=B(i[d],r[v]),ne(t,a[v+1],i[d]),d++,v--;else if(c[u]===o[h])a[h]=B(i[u],r[h]),ne(t,i[d],i[u]),u--,h++;else if(l===void 0&&(l=ps(o,h,v),p=ps(c,d,u)),l.has(c[d]))if(l.has(c[u])){const S=p.get(o[h]),A=S!==void 0?i[S]:null;if(A===null){const j=ne(t,i[d]);B(j,r[h]),a[h]=j}else a[h]=B(A,r[h]),ne(t,i[d],A),i[S]=null;h++}else We(i[u]),u--;else We(i[d]),d++;for(;h<=v;){const S=ne(t,a[v+1]);B(S,r[h]),a[h++]=S}for(;d<=u;){const S=i[d++];S!==null&&We(S)}return this.ut=o,ds(t,a),P}}),Ge=()=>f`<svg
|
|
708
|
-
viewBox="0 0 16 16"
|
|
709
|
-
fill="none"
|
|
710
|
-
stroke="currentColor"
|
|
711
|
-
stroke-width="1.5"
|
|
712
|
-
stroke-linecap="round"
|
|
713
|
-
stroke-linejoin="round"
|
|
714
|
-
aria-hidden="true"
|
|
715
|
-
focusable="false"
|
|
716
|
-
>
|
|
717
|
-
<path d="M4 4l8 8M12 4l-8 8" />
|
|
718
|
-
</svg>`,gi=()=>f`<svg
|
|
719
|
-
viewBox="0 0 16 16"
|
|
720
|
-
fill="none"
|
|
721
|
-
stroke="currentColor"
|
|
722
|
-
stroke-width="1.5"
|
|
723
|
-
stroke-linecap="round"
|
|
724
|
-
stroke-linejoin="round"
|
|
725
|
-
aria-hidden="true"
|
|
726
|
-
focusable="false"
|
|
727
|
-
>
|
|
728
|
-
<path d="M3.5 5h9M5.5 5V3.5a1 1 0 011-1h3a1 1 0 011 1V5" />
|
|
729
|
-
<path d="M5 5l.5 7.5h5L11 5" />
|
|
730
|
-
<path d="M6.8 7.5v3.5M9.2 7.5v3.5" />
|
|
731
|
-
</svg>`,mi=()=>f`<svg
|
|
732
|
-
viewBox="0 0 16 16"
|
|
733
|
-
fill="none"
|
|
734
|
-
stroke="currentColor"
|
|
735
|
-
stroke-width="1.5"
|
|
736
|
-
stroke-linecap="round"
|
|
737
|
-
stroke-linejoin="round"
|
|
738
|
-
aria-hidden="true"
|
|
739
|
-
focusable="false"
|
|
740
|
-
>
|
|
741
|
-
<path d="M3 13l1.5-1.5M11.3 2.7a1.5 1.5 0 012.1 2.1L5.5 12.7l-3 .8.8-3z" />
|
|
742
|
-
</svg>`,vi=()=>f`<svg
|
|
743
|
-
viewBox="0 0 16 16"
|
|
744
|
-
fill="none"
|
|
745
|
-
stroke="currentColor"
|
|
746
|
-
stroke-width="1.5"
|
|
747
|
-
stroke-linecap="round"
|
|
748
|
-
stroke-linejoin="round"
|
|
749
|
-
aria-hidden="true"
|
|
750
|
-
focusable="false"
|
|
751
|
-
>
|
|
752
|
-
<path d="M3.5 3.5h9a1 1 0 011 1v5a1 1 0 01-1 1H8.2l-2.7 2.2v-2.2H3.5a1 1 0 01-1-1v-5a1 1 0 011-1z" />
|
|
753
|
-
</svg>`,bi=()=>f`<svg
|
|
754
|
-
viewBox="0 0 16 16"
|
|
755
|
-
fill="none"
|
|
756
|
-
stroke="currentColor"
|
|
757
|
-
stroke-width="1.5"
|
|
758
|
-
stroke-linecap="round"
|
|
759
|
-
stroke-linejoin="round"
|
|
760
|
-
aria-hidden="true"
|
|
761
|
-
focusable="false"
|
|
762
|
-
>
|
|
763
|
-
<path d="M6.5 9.5l3-3" />
|
|
764
|
-
<path d="M7 5.5l1-1a2.1 2.1 0 013 3l-1 1" />
|
|
765
|
-
<path d="M9 10.5l-1 1a2.1 2.1 0 01-3-3l1-1" />
|
|
766
|
-
</svg>`,yi=()=>f`<svg
|
|
767
|
-
viewBox="0 0 16 16"
|
|
768
|
-
fill="none"
|
|
769
|
-
stroke="currentColor"
|
|
770
|
-
stroke-width="1.5"
|
|
771
|
-
stroke-linecap="round"
|
|
772
|
-
stroke-linejoin="round"
|
|
773
|
-
aria-hidden="true"
|
|
774
|
-
focusable="false"
|
|
775
|
-
>
|
|
776
|
-
<path d="M8 3.5v9M3.5 8h9" />
|
|
777
|
-
</svg>`,ki=()=>f`<svg viewBox="0 0 16 16" fill="currentColor" aria-hidden="true" focusable="false">
|
|
778
|
-
<circle cx="6.5" cy="4.5" r="1" />
|
|
779
|
-
<circle cx="9.5" cy="4.5" r="1" />
|
|
780
|
-
<circle cx="6.5" cy="8" r="1" />
|
|
781
|
-
<circle cx="9.5" cy="8" r="1" />
|
|
782
|
-
<circle cx="6.5" cy="11.5" r="1" />
|
|
783
|
-
<circle cx="9.5" cy="11.5" r="1" />
|
|
784
|
-
</svg>`,xi=()=>f`<svg
|
|
785
|
-
viewBox="0 0 16 16"
|
|
786
|
-
fill="none"
|
|
787
|
-
stroke="currentColor"
|
|
788
|
-
stroke-width="1.5"
|
|
789
|
-
stroke-linecap="round"
|
|
790
|
-
stroke-linejoin="round"
|
|
791
|
-
aria-hidden="true"
|
|
792
|
-
focusable="false"
|
|
793
|
-
>
|
|
794
|
-
<path
|
|
795
|
-
d="M8 2.5v11M8 2.5L5.5 5M8 2.5l2.5 2.5M8 13.5l-2.5-2.5M8 13.5l2.5-2.5M2.5 8h11M2.5 8L5 5.5M2.5 8l2.5 2.5M13.5 8L11 5.5M13.5 8L11 10.5"
|
|
796
|
-
/>
|
|
797
|
-
</svg>`,$i=()=>f`<svg
|
|
798
|
-
viewBox="0 0 16 16"
|
|
799
|
-
fill="none"
|
|
800
|
-
stroke="currentColor"
|
|
801
|
-
stroke-width="1.5"
|
|
802
|
-
stroke-linecap="round"
|
|
803
|
-
stroke-linejoin="round"
|
|
804
|
-
aria-hidden="true"
|
|
805
|
-
focusable="false"
|
|
806
|
-
>
|
|
807
|
-
<path d="M8 12.5V3.5M4.5 7L8 3.5 11.5 7" />
|
|
808
|
-
</svg>`,wi=()=>f`<svg
|
|
809
|
-
viewBox="0 0 16 16"
|
|
810
|
-
fill="none"
|
|
811
|
-
stroke="currentColor"
|
|
812
|
-
stroke-width="1.5"
|
|
813
|
-
stroke-linecap="round"
|
|
814
|
-
stroke-linejoin="round"
|
|
815
|
-
aria-hidden="true"
|
|
816
|
-
focusable="false"
|
|
817
|
-
>
|
|
818
|
-
<path d="M8 3.5v9M4.5 9L8 12.5 11.5 9" />
|
|
819
|
-
</svg>`,Ai=()=>f`<svg
|
|
820
|
-
viewBox="0 0 16 16"
|
|
821
|
-
fill="none"
|
|
822
|
-
stroke="currentColor"
|
|
823
|
-
stroke-width="1.5"
|
|
824
|
-
stroke-linecap="round"
|
|
825
|
-
stroke-linejoin="round"
|
|
826
|
-
aria-hidden="true"
|
|
827
|
-
focusable="false"
|
|
828
|
-
>
|
|
829
|
-
<path d="M10 3.5L5.5 8 10 12.5" />
|
|
830
|
-
</svg>`,Si=()=>f`<svg
|
|
831
|
-
viewBox="0 0 16 16"
|
|
832
|
-
fill="none"
|
|
833
|
-
stroke="currentColor"
|
|
834
|
-
stroke-width="1.5"
|
|
835
|
-
stroke-linecap="round"
|
|
836
|
-
stroke-linejoin="round"
|
|
837
|
-
aria-hidden="true"
|
|
838
|
-
focusable="false"
|
|
839
|
-
>
|
|
840
|
-
<path d="M6 3.5L10.5 8 6 12.5" />
|
|
841
|
-
</svg>`,Ci=()=>f`<svg
|
|
842
|
-
viewBox="0 0 16 16"
|
|
843
|
-
fill="none"
|
|
844
|
-
stroke="currentColor"
|
|
845
|
-
stroke-width="1.5"
|
|
846
|
-
stroke-linecap="round"
|
|
847
|
-
stroke-linejoin="round"
|
|
848
|
-
aria-hidden="true"
|
|
849
|
-
focusable="false"
|
|
850
|
-
>
|
|
851
|
-
<path d="M9.5 2.5h4v4M6.5 13.5h-4v-4M13.5 2.5L9 7M2.5 13.5L7 9" />
|
|
852
|
-
</svg>`,_i=()=>f`<svg
|
|
853
|
-
viewBox="0 0 16 16"
|
|
854
|
-
fill="none"
|
|
855
|
-
stroke="currentColor"
|
|
856
|
-
stroke-width="1.5"
|
|
857
|
-
stroke-linecap="round"
|
|
858
|
-
stroke-linejoin="round"
|
|
859
|
-
aria-hidden="true"
|
|
860
|
-
focusable="false"
|
|
861
|
-
>
|
|
862
|
-
<path d="M13.5 7h-4.5v-4.5M2.5 9h4.5v4.5M9 7l4.5-4.5M7 9l-4.5 4.5" />
|
|
863
|
-
</svg>`,Ei=()=>f`<svg
|
|
864
|
-
viewBox="0 0 16 16"
|
|
865
|
-
fill="none"
|
|
866
|
-
stroke="currentColor"
|
|
867
|
-
stroke-width="1.5"
|
|
868
|
-
stroke-linecap="round"
|
|
869
|
-
stroke-linejoin="round"
|
|
870
|
-
aria-hidden="true"
|
|
871
|
-
focusable="false"
|
|
872
|
-
>
|
|
873
|
-
<circle cx="8" cy="8" r="2.75" />
|
|
874
|
-
<path
|
|
875
|
-
d="M8 1.5v1.5M8 13v1.5M1.5 8H3M13 8h1.5M3.4 3.4l1.06 1.06M11.54 11.54l1.06 1.06M3.4 12.6l1.06-1.06M11.54 4.46l1.06-1.06"
|
|
876
|
-
/>
|
|
877
|
-
</svg>`,Ti=()=>f`<svg
|
|
878
|
-
viewBox="0 0 16 16"
|
|
879
|
-
fill="none"
|
|
880
|
-
stroke="currentColor"
|
|
881
|
-
stroke-width="1.5"
|
|
882
|
-
stroke-linecap="round"
|
|
883
|
-
stroke-linejoin="round"
|
|
884
|
-
aria-hidden="true"
|
|
885
|
-
focusable="false"
|
|
886
|
-
>
|
|
887
|
-
<path d="M13.5 9.6A5.75 5.75 0 016.4 2.5a5.75 5.75 0 107.1 7.1z" />
|
|
888
|
-
</svg>`,Mi=(t,e,s,n=!1)=>f`
|
|
889
|
-
${n?m:f`<header><h2>${t.heading}</h2></header>`}
|
|
890
|
-
${e.issues.length>0?f`<div class="issues" role="alert">
|
|
891
|
-
<strong>${t.rejected}</strong>
|
|
892
|
-
<ul>
|
|
893
|
-
${e.issues.map(i=>f`<li>${i}</li>`)}
|
|
894
|
-
</ul>
|
|
895
|
-
</div>`:m}
|
|
896
|
-
<div class="composer">
|
|
897
|
-
<textarea
|
|
898
|
-
class="dpk-textarea"
|
|
899
|
-
aria-label=${t.commentLabel}
|
|
900
|
-
placeholder=${t.commentPlaceholder}
|
|
901
|
-
.value=${e.body}
|
|
902
|
-
@input=${i=>{i.currentTarget instanceof HTMLTextAreaElement&&s({kind:"input",body:i.currentTarget.value})}}
|
|
903
|
-
@keydown=${i=>{!i.isComposing&&i.key==="Enter"&&(i.metaKey||i.ctrlKey)&&(i.preventDefault(),s({kind:"submit"}))}}
|
|
904
|
-
></textarea>
|
|
905
|
-
${e.attachment.kind==="explicit"?f`<div class="row">
|
|
906
|
-
<button class="chip" type="button" aria-label=${t.detach} @click=${()=>s({kind:"clear-target"})}>
|
|
907
|
-
${e.target.label} ${Ge()}
|
|
908
|
-
</button>
|
|
909
|
-
</div>`:e.attachment.kind==="checkbox"?f`<div class="row">
|
|
910
|
-
<label class="attach">
|
|
911
|
-
<input
|
|
912
|
-
type="checkbox"
|
|
913
|
-
.checked=${e.attachment.checked}
|
|
914
|
-
@change=${i=>{i.currentTarget instanceof HTMLInputElement&&s({kind:"attach",current:i.currentTarget.checked})}}
|
|
915
|
-
/>
|
|
916
|
-
<span>${t.attachTo(e.attachment.group)}</span>
|
|
917
|
-
</label>
|
|
918
|
-
</div>`:m}
|
|
919
|
-
<div class="row">
|
|
920
|
-
<span class="target-line">→ ${e.target.label}</span>
|
|
921
|
-
<button
|
|
922
|
-
class="dpk-btn dpk-btn--accent"
|
|
923
|
-
type="button"
|
|
924
|
-
?disabled=${!e.canSubmit}
|
|
925
|
-
@click=${()=>s({kind:"submit"})}
|
|
926
|
-
>
|
|
927
|
-
${t.addNote}
|
|
928
|
-
</button>
|
|
929
|
-
</div>
|
|
930
|
-
</div>
|
|
931
|
-
<ul class="list">
|
|
932
|
-
${e.items.length===0?f`<li class="empty">
|
|
933
|
-
${t.empty}<br />
|
|
934
|
-
${t.emptyHint}
|
|
935
|
-
</li>`:us(e.items,i=>i.id,i=>Oi(t,i,s))}
|
|
936
|
-
</ul>
|
|
937
|
-
<footer>
|
|
938
|
-
${n?m:f`
|
|
939
|
-
${e.send==="hidden"?m:f`<button
|
|
940
|
-
class="dpk-btn dpk-btn--accent"
|
|
941
|
-
type="button"
|
|
942
|
-
?disabled=${e.send==="disabled"}
|
|
943
|
-
@click=${()=>s({kind:"send"})}
|
|
944
|
-
>
|
|
945
|
-
${t.sendToClaude}
|
|
946
|
-
</button>`}
|
|
947
|
-
<button class="dpk-btn" type="button" @click=${()=>s({kind:"copy",format:"json"})}>
|
|
948
|
-
${t.copyJson}
|
|
949
|
-
</button>
|
|
950
|
-
<button class="dpk-btn" type="button" @click=${()=>s({kind:"copy",format:"brief"})}>
|
|
951
|
-
${t.copyBrief}
|
|
952
|
-
</button>
|
|
953
|
-
`}
|
|
954
|
-
<button
|
|
955
|
-
class="dpk-btn dpk-btn--ghost"
|
|
956
|
-
type="button"
|
|
957
|
-
?disabled=${e.items.length===0}
|
|
958
|
-
@click=${()=>s({kind:"clear"})}
|
|
959
|
-
>
|
|
960
|
-
${t.clear}
|
|
961
|
-
</button>
|
|
962
|
-
${e.flash?f`<span class="flash" role="status">${e.flash}</span>`:m}
|
|
963
|
-
</footer>
|
|
964
|
-
`,Oi=(t,e,s)=>f`
|
|
965
|
-
<li class="item" data-tone=${e.tone} data-stale=${String(e.stale!==null)}>
|
|
966
|
-
<div class="item-head">
|
|
967
|
-
<span class="item-title">${e.title}</span>
|
|
968
|
-
${e.stale?f`<span class="stale-badge">${e.stale}</span>`:m}
|
|
969
|
-
<button
|
|
970
|
-
class="dpk-icon-btn"
|
|
971
|
-
type="button"
|
|
972
|
-
aria-label=${t.deleteAction}
|
|
973
|
-
@click=${()=>s({kind:"delete",id:e.id})}
|
|
974
|
-
>
|
|
975
|
-
${Ge()}
|
|
976
|
-
</button>
|
|
977
|
-
</div>
|
|
978
|
-
<div class="item-target">${e.targetLabel}</div>
|
|
979
|
-
${e.text.kind==="comment"?f`<p class="item-body">${e.text.body}</p>`:e.text.body?f`<div class="item-summary">${e.text.body}</div>`:m}
|
|
980
|
-
<code class="item-code">${e.code}</code>
|
|
981
|
-
</li>
|
|
982
|
-
`;class hs extends O{static{this.styles=di}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},exportBrief:{attribute:!1},sendToClaude:{attribute:!1},embedded:{type:Boolean}}}#e=Qn();#o=new Ne(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=ts(this.#e,{kind:"target-requested",ref:this.pendingTarget}))}updated(e){e.has("pendingTarget")&&this.pendingTarget&&this.isConnected&&this.renderRoot.querySelector("textarea")?.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,locale:this.#o.locale}}render(){const e=this.#i();return e?Mi(Xt(this.#o.locale),rs(e,this.#e),this.#r,this.embedded):m}#n(e){this.#e=ts(this.#e,e),this.requestUpdate()}#r=e=>{switch(e.kind){case"delete":this.onDelete?.(e.id);return;case"clear":this.onClear?.();return;case"copy":this.#t(e.format);return;case"send":this.#s();return;case"submit":{const s=this.#i();if(!s||!this.onComment)return;const n=Xn(this.#e,rs(s,this.#e).target.ref);if(!n||!this.onComment(n.target,n.body).ok)return;this.#n({kind:"submitted"});return}default:this.#n(e)}};async#s(){const e=this.sendToClaude;if(!e||this.#e.send.kind==="pending")return;this.#n({kind:"send-started"});const s=this.#e.sendRequest,n=await e().catch(()=>({ok:!1,reason:"error"}));this.isConnected&&this.#n({kind:"send-finished",request:s,outcome:n})}async#t(e){const s=this.#i();if(!s)return;this.#n({kind:"copy-started",format:e});const n=this.#e.copyRequest;try{const i=e==="json"?ke(s.derivation.actions):this.exportBrief?.()??Ve({...s.derivation,navigation:s.navigation,issues:s.issues},s.definition,W),r=await Qt(i);this.isConnected&&this.#n({kind:"copy-finished",request:n,ok:r})}catch{this.isConnected&&this.#n({kind:"copy-finished",request:n,ok:!1})}}}const ji=()=>{customElements.get("dpk-component-comment-panel")||customElements.define("dpk-component-comment-panel",hs)},Ri=w({value:g()}),Li=t=>e=>{if(!(e instanceof CustomEvent))return;const s=k(Ri,e.detail);s.success&&t(s.output.value)},fs=t=>e=>{const s=ee(e.target,HTMLSelectElement);s!==null&&t(s.value)},ie=t=>t==="light"||t==="dark"?t:null,gs=t=>t.authored??t.environment,ms=t=>t.preference??gs(t),Ni=t=>{const e=ms(t)==="dark"?"light":"dark";return e===gs(t)?null:e},vs=D(K({value:b(g(),I(/^element:.+/)),label:b(g(),y(1)),group:C(g())})),Pi=w({targets:vs,providers:D(w({id:b(g(),y(1)),results:D(Yt)}))}),Ui=K({target:b(g(),I(/^element:.+/)),body:b(g(),Ie(),y(1))}),bs=t=>t.group?`${t.group} \xB7 ${t.label}`:t.label,ys=(t,e,s)=>{const n=new Map(e.map(i=>[i.value,i]));return{...t,hasTarget:(i,r)=>t.hasTarget(i,r)||n.has(_(r)),commentTargets:(i,r)=>{const o=t.commentTargets(i,r),c=new Set(o.map(a=>a.value));return[...o,...e.filter(a=>!c.has(a.value))]},describe:(i,r,o)=>{if(T(i)){const l=s.get(i.id),p=n.get(_(i.target));return{title:l?.title??i.type,...l?.summary===void 0?{}:{summary:l.summary},tone:l?.tone??"update",targetLabel:p?bs(p):i.target.id}}const c=t.describe(i,r,o),a=i.type==="comment"&&!t.hasTarget(r,i.target)?n.get(_(i.target)):void 0;return a===void 0?c:{...c,targetLabel:bs(a)}},serialize:i=>T(i)?`${i.type} ${_(i.target)} ${JSON.stringify(i.payload)}`:t.serialize(i)}},ks=typeof globalThis=="object"&&globalThis||typeof window=="object"&&window||typeof self=="object"&&self||typeof global=="object"&&global||(function(){return this})();function xs(t){return typeof ks.Buffer<"u"&&ks.Buffer.isBuffer(t)}function $s(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 ws(t){return Object.getOwnPropertySymbols(t).filter(e=>Object.prototype.propertyIsEnumerable.call(t,e))}function As(t){return t==null?t===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(t)}const Ii="[object RegExp]",Di="[object String]",zi="[object Number]",Bi="[object Boolean]",qi="[object Symbol]",Hi="[object Date]",Fi="[object Map]",Ki="[object Set]",Ji="[object Array]",Vi="[object Function]",Wi="[object ArrayBuffer]",Ye="[object Object]",Gi="[object Error]",Yi="[object DataView]",Zi="[object Uint8Array]",Qi="[object Uint8ClampedArray]",Xi="[object Uint16Array]",er="[object Uint32Array]",tr="[object BigUint64Array]",sr="[object Int8Array]",nr="[object Int16Array]",ir="[object Int32Array]",rr="[object BigInt64Array]",or="[object Float32Array]",ar="[object Float64Array]";function lr(t,e){return t===e||Number.isNaN(t)&&Number.isNaN(e)}function cr(t,e,s){return re(t,e,void 0,void 0,void 0,void 0,s)}function re(t,e,s,n,i,r,o){const c=o(t,e,s,n,i,r);if(c!==void 0)return c;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 oe(t,e,r,o)}return oe(t,e,r,o)}function oe(t,e,s,n){if(Object.is(t,e))return!0;let i=As(t),r=As(e);if(i==="[object Arguments]"&&(i=Ye),r==="[object Arguments]"&&(r=Ye),i!==r)return!1;switch(i){case Di:return t.toString()===e.toString();case zi:return lr(t.valueOf(),e.valueOf());case Bi:case Hi:case qi:return Object.is(t.valueOf(),e.valueOf());case Ii:return t.source===e.source&&t.flags===e.flags;case Vi:return t===e}s=s??new Map;const o=s.get(t),c=s.get(e);if(o!=null&&c!=null)return o===e;s.set(t,e),s.set(e,t);try{switch(i){case Fi:if(t.size!==e.size)return!1;for(const[a,l]of t.entries())if(!e.has(a)||!re(l,e.get(a),a,t,e,s,n))return!1;return!0;case Ki:{if(t.size!==e.size)return!1;const a=Array.from(t.values()),l=Array.from(e.values());for(let p=0;p<a.length;p++){const d=a[p],u=l.findIndex(h=>re(d,h,void 0,t,e,s,n));if(u===-1)return!1;l.splice(u,1)}return!0}case Ji:case Zi:case Qi:case Xi:case er:case tr:case sr:case nr:case ir:case rr:case or:case ar:if(xs(t)!==xs(e)||t.length!==e.length)return!1;for(let a=0;a<t.length;a++)if(!re(t[a],e[a],a,t,e,s,n))return!1;return!0;case Wi:return t.byteLength!==e.byteLength?!1:oe(new Uint8Array(t),new Uint8Array(e),s,n);case Yi:return t.byteLength!==e.byteLength||t.byteOffset!==e.byteOffset?!1:oe(new Uint8Array(t),new Uint8Array(e),s,n);case Gi:return t.name===e.name&&t.message===e.message;case Ye:{if(!(oe(t.constructor,e.constructor,s,n)||$s(t)&&$s(e)))return!1;const a=[...Object.keys(t),...ws(t)],l=[...Object.keys(e),...ws(e)];if(a.length!==l.length)return!1;for(let p=0;p<a.length;p++){const d=a[p],u=t[d];if(!Object.hasOwn(e,d))return!1;const h=e[d];if(!re(u,h,d,t,e,s,n))return!1}return!0}default:return!1}}finally{s.delete(t),s.delete(e)}}function dr(){}function we(t,e){return cr(t,e,dr)}const Ss="page",Cs=t=>_(t),_s=(t,e,s,n=new Map)=>{let i=e;const r=[],o=[],c=[],a=[],l=new Map;for(const d of s){if(d.type===E)continue;if(T(d)){const v=n.get(d.id);v===void 0||v.stale!==void 0?o.push({action:d,reason:v?.stale??"target-missing"}):r.push(d);continue}const u=ye(t.actions,d.type);if(!u){o.push({action:d,reason:"unsupported-action-type"});continue}const h=t.apply(i,d);if(h===null){o.push({action:d,reason:t.hasTarget(i,d.target)?"constraint-violated":"target-missing"});continue}if(u.mode!=="append"&&Ze(t,i,h)){c.push(d);continue}i=h,r.push(d)}for(const d of s){if(d.type!==E)continue;if(d.target.type!==Ss&&!t.hasTarget(i,d.target)){o.push({action:d,reason:"target-missing"});continue}a.push(d);const u=Cs(d.target);l.set(u,[...l.get(u)??[],d])}const p=new Map(s.map((d,u)=>[d.id,u]));return o.sort((d,u)=>(p.get(d.action.id)??0)-(p.get(u.action.id)??0)),{base:e,state:i,actions:s,applied:r,stale:o,obsolete:c,comments:a,commentsByTarget:l}},Ze=(t,e,s)=>e===s?!0:t.canonicalState===void 0?we(e,s):we(t.canonicalState(e),t.canonicalState(s)),Es=t=>{const e=new Set(t.obsolete.map(s=>s.id));return t.actions.filter(s=>!e.has(s.id))},pr=(t,e,s,n)=>{let i=e;const r=n??Ts(i).map(o=>o.id);for(const o of[...r].reverse())i=ur(t,i,s,o,n!==void 0)??i;return i},Ts=t=>t.applied.filter(e=>!T(e)),ur=(t,e,s,n,i)=>{const r=Ts(e),o=r.findIndex(u=>u.id===n),c=r[o];if(c===void 0)return null;const a=r.slice(0,o),l=[...i?hr(t,e.base,r,o):[],...fr(t,a,c)],p=new Set,d=l.filter(u=>{const h=u.join(" ");return p.has(h)?!1:(p.add(h),!0)}).sort((u,h)=>h.length-u.length);for(const u of d){const h=gr(t,e,s,u);if(h!==null)return h}return null},hr=(t,e,s,n)=>{const i=[];let r=e;for(const o of s.slice(0,n+1))i.push(r),r=t.apply(r,o)??r;return i.flatMap((o,c)=>Ze(t,o,r)?[s.slice(c,n+1).map(a=>a.id)]:[])},fr=(t,e,s)=>{const n=Ms(s),i=e.filter(a=>Ms(a).some(l=>n.includes(l))),r=Os(t,s),o=i.filter(a=>Os(t,a)===r),c=a=>a.map((l,p)=>[...a.slice(p).map(d=>d.id),s.id]);return[...c(i),...c(o),...i.map(a=>[a.id,s.id]),...i.map(a=>[a.id])]},Ms=t=>{const e=t.target.type===Ss?[]: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]},Os=(t,e)=>ye(t.actions,e.type)?.mode,gr=(t,e,s,n)=>{const i=new Set(e.stale.map(o=>o.action.id)),r=new Set(n);for(;;){const o=s(e.actions.filter(a=>!r.has(a.id))),c=o.stale.filter(a=>!i.has(a.action.id)).map(a=>a.action);if(c.length===0)return Ze(t,o.state,e.state)?o:null;if(c.some(a=>a.type===E||T(a)))return null;for(const a of c)r.add(a.id)}},mr=w({v:F(1),template:b(g(),y(1)),actions:D(z())});class Qe{constructor(e){this.storage=e}load(e,s){try{const n=this.storage.getItem(e);if(n===null)return[];const i=k(mr,JSON.parse(n));return!i.success||i.output.template!==s?[]:i.output.actions.flatMap(r=>{const o=k(J,r);return o.success?[o.output]:[]})}catch{return[]}}save(e,s,n){const i={v:1,template:s,actions:n};try{this.storage.setItem(e,JSON.stringify(i))}catch{}}clear(e){try{this.storage.removeItem(e)}catch{}}}class Xe{constructor(){this.store=new Map}load(e,s){return new Qe({getItem:n=>this.store.get(n)??null,setItem:(n,i)=>{this.store.set(n,i)},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 et=()=>{try{if(typeof localStorage<"u")return new Qe(localStorage)}catch{}return new Xe},js=t=>`dev-process-kit:draft:${typeof location>"u"?"local":`${location.pathname}${location.search}`}:${t}`,vr=D(z());class Rs{#e;#o;#i={targets:[],providers:[]};#n=new Map;#r;#s;#t;#a;#l;#p=new Set;#f=[];#v=0;constructor(e){this.#e=e.definition,this.#o=ys(e.definition,[],this.#n),this.#r=e.base,this.#l=e.storageKey??js(e.definition.name),this.#a=e.storage===void 0?et():e.storage;const s=e.initialActions??this.#a?.load(this.#l,this.definition.name)??[];this.#s=Ns(this.definition,s),this.#t=this.#c(this.#s),this.#y()&&this.#x()}get definition(){return this.#o}setComponentSnapshot(e){const s=Bt(Pi,e);if(!we(s,this.#i)){this.#i=s,this.#d(),this.#t=this.#c(this.#s);for(const n of this.#p)n()}}setTemplate(e){this.#e=e,this.#d(),this.#t=this.#c(this.#s);for(const s of this.#p)s()}#d(){this.#n=Zt(this.#s,this.#i.providers),this.#o=ys(this.#e,this.#i.targets,this.#n)}#c(e){return _s(this.definition,this.#r,e,Zt(e,this.#i.providers))}get base(){return this.#r}get actions(){return this.#s}get derivation(){return this.#t}get lastIssues(){return this.#f}get prunedCount(){return this.#v}descriptorFor(e,s){return Ls(this.definition,e,s)}dispatch(e){const s=this.#m(e,this.#t.state);if(!s.ok)return this.#u([s.issue]);const n=this.descriptorFor(s.action.type,s.action.target);return n?(this.#g(Be(this.#s,s.action,n),[s.action.id]),{ok:!0,id:s.action.id}):this.#u([{path:"type",message:"unknown action type"}])}dispatchBatch(e){const s=k(vr,e);if(!s.success)return this.#u([se(s.issues)]);const n=s.output;if(n.length===0)return{ok:!0,ids:[]};let i=this.#s,r=this.#t.state;const o=[];for(const c of n){const a=this.#m(c,r);if(!a.ok)return this.#u([a.issue]);const l=a.action,p=this.descriptorFor(l.type,l.target);if(!p)return this.#u([{path:"type",message:"unknown action type"}]);if((l.type==="comment"||T(l)?l.target.type==="page"||this.definition.hasTarget(r,l.target)?r:null:this.definition.apply(r,l))===null)return this.#u([{path:"target",message:"batch action is not applicable"}]);i=Be(i,l,p),r=this.#c(i).state,o.push(l.id)}return this.#g(i,o),{ok:!0,ids:o}}#m(e,s){const n=k(Kt,e);if(!n.success)return{ok:!1,issue:se(n.issues)};const i=this.descriptorFor(n.output.type,typeof n.output.target=="string"?De(n.output.target,"page"):n.output.target);if(!i)return{ok:!1,issue:{path:"type",message:`unknown action type "${n.output.type}"`}};const r=qn(n.output,i);if(!r.ok)return r;const o=this.definition.canonicalTarget?.(s,r.action.target)??r.action.target;return{ok:!0,action:{...r.action,target:o}}}#u(e){return this.#f=e,{ok:!1,issues:e}}removeAction(e){const s=this.#s.filter(n=>n.id!==e);s.length!==this.#s.length&&this.#g(s)}clearActions(){this.#s.length>0&&this.#g([])}replaceActions(e){this.#g(Ns(this.definition,e))}setBase(e){this.#r=e,this.#g(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}}#g(e,s){this.#f=[],this.#s=e,this.#d(),this.#t=this.#c(this.#s),this.#y(s),this.#x();for(const n of this.#p)n()}#y(e){const s=this.#k(),n=pr(this.definition,this.#t,i=>this.#c(i),e);return n===this.#t?s:(this.#v+=this.#s.length-n.actions.length,this.#s=[...n.actions],this.#d(),this.#t=this.#c(this.#s),this.#k(),!0)}#k(){return this.#t.obsolete.length===0?!1:(this.#v+=this.#t.obsolete.length,this.#s=Es(this.#t),this.#d(),this.#t=this.#c(this.#s),!0)}#x(){this.#a?.save(this.#l,this.definition.name,this.#s)}}const Ls=(t,e,s)=>e==="comment"?Vt:s!==void 0&&T({type:e,target:s})?Vn:ye(t.actions,e),Ns=(t,e)=>e.flatMap(s=>{const n=k(J,s);if(!n.success)return[];const i=n.output,r=Ls(t,i.type,i.target);if(!r)return[];const o=k(r.schema,i);if(!o.success)return[];const c=k(J,o.output);return c.success?[c.output]:[]}),Ps=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()}},br=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:_(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)}},yr=(t,e)=>{const s=()=>Ps(t);return{version:W,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,i)=>t.dispatch({type:E,target:n,payload:{body:i}}),removeAction:n=>t.removeAction(n),clearActions:()=>t.clearActions(),importDraft:n=>t.controller().replaceActions(n),navigate:(n,i)=>t.navigate(n,i),hashFor:n=>t.hashFor(n),snapshot:s,exportDraft:()=>t.controller().exportDraft(W),exportBrief:()=>Ve(s(),t.controller().definition,W),subscribe:n=>t.subscribe(n)}},tt=(t,e)=>typeof t=="object"&&t!==null&&e.every(s=>typeof Reflect.get(t,s)=="function"),kr=t=>tt(t,["use"]),xr=t=>tt(t,["anchorFor","canSendToClaude","sendToClaude"]),$r=t=>tt(t,["collection"]),Us=async(t,e)=>{try{return await t.use(e)}catch{return null}},wr=(t,e)=>({async canSend(){try{return await t.canSendToClaude()==="available"}catch{return!1}},async send({brief:s,draft:n,anchor:i}){let r=ri(s);if(r===null){if(e===null)return{ok:!1,reason:"too_large"};try{const o=e.collection(si).doc();await o.set({brief:s,draft:n,createdAt:new Date().toISOString()}),r=oi(o.path)}catch{return{ok:!1,reason:"storage"}}}try{return await t.sendToClaude({anchor:await t.anchorFor(i),text:r}),{ok:!0}}catch(o){return{ok:!1,reason:li(o)}}}}),Ar=async t=>{if(!kr(t))return null;const[e,s]=await Promise.all([Us(t,"comments"),Us(t,"db")]);return xr(e)?wr(e,$r(s)?s:null):null},Sr=()=>Reflect.get(globalThis,"claude");class Cr{#e;#o;#i=null;#n=!1;constructor(e,s=Sr){this.#e=e,this.#o=s,e.addController(this)}get available(){return this.#n}hostConnected(){this.#i??=Ar(this.#o()),this.#r(),window.addEventListener("focus",this.#r)}hostDisconnected(){window.removeEventListener("focus",this.#r)}async send(e){const s=await this.#i;if(!s)return{ok:!1,reason:"forbidden"};const n=await s.send(e);return this.#r(),n}#r=async()=>{const e=await this.#i,s=e?await e.canSend():!1;s!==this.#n&&(this.#n=s,this.#e.requestUpdate())}}const Is=(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{}}}),st=t=>{const e=new Map;return Is({getItem:s=>e.get(s)??null,setItem:(s,n)=>{e.set(s,n)},removeItem:s=>{e.delete(s)}},t)},Ds=t=>{try{if(typeof localStorage<"u")return Is(localStorage,t)}catch{}return st(t)},nt="dev-process-kit:color-scheme",_r="(prefers-color-scheme: dark)",zs=()=>typeof matchMedia=="function"?matchMedia(_r):null,Bs=()=>ie(document.documentElement.dataset.theme)??(zs()?.matches===!0?"dark":"light");class Er{#e;#o;#i=null;#n=null;#r="light";#s=null;#t=null;constructor(e,s){this.#e=e,this.#o=s,e.addController(this)}hostConnected(){this.#i===null&&(this.#i=this.#o()?Ds(ie):st(ie),this.#n=this.#i.read(nt)),this.#r=Bs(),this.#s=zs(),this.#s?.addEventListener("change",this.#l),this.#t=new MutationObserver(this.#l),this.#t.observe(document.documentElement,{attributes:!0,attributeFilter:["data-theme"]})}hostDisconnected(){this.#s?.removeEventListener("change",this.#l),this.#s=null,this.#t?.disconnect(),this.#t=null}resolve(e){return ms(this.#a(e))}toggle(e){this.#n=Ni(this.#a(e)),this.#n===null?this.#i?.remove(nt):this.#i?.write(nt,this.#n),this.#e.requestUpdate()}#a(e){return{preference:this.#n,authored:e,environment:this.#r}}#l=()=>{const e=Bs();e!==this.#r&&(this.#r=e,this.#e.requestUpdate())}}const Tr=(t,e)=>{const s=[],n=i=>{(i===t||i instanceof ShadowRoot)&&e?.(i);for(const r of i.children)r.hasAttribute("data-template")||(("commentTargets"in r||"elementActions"in r)&&s.push(r),n(r),r.shadowRoot&&n(r.shadowRoot))};return n(t),s},qs=(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)},Hs=t=>qs(t.filter(e=>"elementActions"in e&&e.id.length>0),e=>e.id),Fs=(t,e)=>{for(const s of Hs(t)){const n=Gn(e,s.id),i=Reflect.get(s,"elementActions");Array.isArray(i)&&i.length===n.length&&n.every((o,c)=>{const a=i[c];return typeof a=="object"&&a!==null&&"id"in a&&a.id===o.id})||Reflect.set(s,"elementActions",n)}},Mr=t=>{const e=Reflect.get(t,"elementActionResults");return Array.isArray(e)?e.flatMap(s=>{const n=k(Yt,s);return n.success?[n.output]:[]}):[]},Or=t=>{const e=[];for(const s of t){if(!("commentTargets"in s))continue;const n=k(vs,s.commentTargets);n.success&&e.push(...n.output)}return{targets:qs(e,s=>s.value),providers:Hs(t).map(s=>({id:s.id,results:Mr(s)}))}},it="dev-process-kit:locale";class jr{#e;#o;#i;#n=null;#r=null;#s;#t;constructor(e,s,n){this.#e=e,this.#o=s,this.#i=n,e.addController(this)}get authored(){if(this.#s===void 0)return Re(Oe(this.#e));const e=this.#e.parentNode;return Re(this.#s??(e===null?null:Oe(e)))}get locale(){return this.#t??this.#a()}#a(){return gn({preference:this.#r,authored:this.authored})}hostConnected(){this.#n===null&&(this.#n=this.#o()?Ds(_t):st(_t),this.#r=this.#n.read(it)),this.#s??=this.#e.getAttribute("lang"),this.#l()}pick(e){this.#r=mn(e,this.authored),this.#r===null?this.#n?.remove(it):this.#n?.write(it,this.#r),this.#l(),this.#e.requestUpdate()}#l(){const e=this.#r??this.#s??null;e===null?this.#e.removeAttribute("lang"):this.#e.getAttribute("lang")!==e&&this.#e.setAttribute("lang",e);const s=this.#a();if(s===this.#t)return;const n=this.#t===void 0;this.#t=s,this.#i(),(!n||this.#r!==null)&&document.dispatchEvent(new Event(Le))}}const Ks=()=>Ke(typeof location>"u"?"":location.hash),Rr=(t,e)=>{if(typeof history>"u")return;const s=`${location.pathname}${location.search}${V(t)}`;`${location.pathname}${location.search}${location.hash}`!==s&&(e?history.replaceState(null,"",s):history.pushState(null,"",s))};class Lr{#e;#o=null;#i=0;constructor(e){this.#e=e}get orphans(){return this.#i}route(){const e=this.#e.renderRoot,s=ee(e.querySelector('slot[name="preview"]'),HTMLSlotElement);if(s===null)return;this.#o!==s&&(this.#o=s,s.addEventListener("slotchange",this.#n));const n=new Set(Array.from(e.querySelectorAll("slot")).map(r=>r.getAttribute("name")??"")),i=s.assignedElements();for(const r of i){const o=r.getAttribute("data-preview-id");if(!o)continue;const c=`preview:${o}`;r.getAttribute("slot")!==c&&n.has(c)&&r.setAttribute("slot",c)}i.length!==this.#i&&(this.#i=i.length,queueMicrotask(()=>this.#e.requestUpdate()))}#n=()=>{queueMicrotask(()=>this.route())}}const Nr=[he,fe,R`
|
|
983
|
-
:host {
|
|
984
|
-
display: block;
|
|
985
|
-
min-height: 100%;
|
|
986
|
-
background: var(--dpk-paper);
|
|
987
|
-
color-scheme: light;
|
|
988
|
-
}
|
|
989
|
-
|
|
990
|
-
/* The element stamps its resolved scheme; nested components inherit it. */
|
|
991
|
-
:host([data-theme='dark']) {
|
|
992
|
-
color-scheme: dark;
|
|
993
|
-
}
|
|
994
|
-
|
|
995
|
-
.dpk-shell {
|
|
996
|
-
display: grid;
|
|
997
|
-
grid-template-rows: auto minmax(0, 1fr) auto;
|
|
998
|
-
min-height: 100%;
|
|
999
|
-
max-height: 100%;
|
|
1000
|
-
}
|
|
1001
|
-
|
|
1002
|
-
/* ------------------------------------------------------------- header */
|
|
1003
|
-
|
|
1004
|
-
.dpk-header {
|
|
1005
|
-
display: flex;
|
|
1006
|
-
align-items: center;
|
|
1007
|
-
gap: 16px;
|
|
1008
|
-
/* Right padding keeps the header content clear of the fixed review button. */
|
|
1009
|
-
padding: 14px 78px 14px 20px;
|
|
1010
|
-
border-bottom: 1px solid var(--dpk-rule);
|
|
1011
|
-
background: linear-gradient(180deg, var(--dpk-paper-raised) 0%, var(--dpk-paper) 100%);
|
|
1012
|
-
}
|
|
1013
|
-
|
|
1014
|
-
.dpk-title {
|
|
1015
|
-
display: flex;
|
|
1016
|
-
flex-direction: column;
|
|
1017
|
-
gap: 2px;
|
|
1018
|
-
min-width: 0;
|
|
1019
|
-
}
|
|
1020
|
-
|
|
1021
|
-
.dpk-title h1 {
|
|
1022
|
-
font-size: 16.5px;
|
|
1023
|
-
font-weight: 620;
|
|
1024
|
-
white-space: nowrap;
|
|
1025
|
-
overflow: hidden;
|
|
1026
|
-
text-overflow: ellipsis;
|
|
1027
|
-
}
|
|
1028
|
-
|
|
1029
|
-
.dpk-template-mark {
|
|
1030
|
-
display: inline-flex;
|
|
1031
|
-
align-items: center;
|
|
1032
|
-
gap: 6px;
|
|
1033
|
-
padding: 2px 9px 2px 7px;
|
|
1034
|
-
border-radius: 999px;
|
|
1035
|
-
background: var(--dpk-accent-soft);
|
|
1036
|
-
font-family: var(--dpk-mono);
|
|
1037
|
-
font-size: 9.5px;
|
|
1038
|
-
font-weight: 550;
|
|
1039
|
-
letter-spacing: 0.12em;
|
|
1040
|
-
text-transform: uppercase;
|
|
1041
|
-
color: var(--dpk-accent);
|
|
1042
|
-
}
|
|
1043
|
-
|
|
1044
|
-
.dpk-template-mark::before {
|
|
1045
|
-
content: '';
|
|
1046
|
-
width: 6px;
|
|
1047
|
-
height: 6px;
|
|
1048
|
-
border-radius: 50%;
|
|
1049
|
-
background: var(--dpk-accent);
|
|
1050
|
-
}
|
|
1051
|
-
|
|
1052
|
-
.dpk-header-slot {
|
|
1053
|
-
flex: 1;
|
|
1054
|
-
min-width: 0;
|
|
1055
|
-
display: flex;
|
|
1056
|
-
align-items: center;
|
|
1057
|
-
gap: 10px;
|
|
1058
|
-
}
|
|
1059
|
-
|
|
1060
|
-
.dpk-header-meta {
|
|
1061
|
-
display: flex;
|
|
1062
|
-
align-items: center;
|
|
1063
|
-
gap: 8px;
|
|
1064
|
-
margin-left: auto;
|
|
1065
|
-
padding: 4px 12px;
|
|
1066
|
-
border-radius: 999px;
|
|
1067
|
-
border: 1px solid var(--dpk-rule);
|
|
1068
|
-
background: var(--dpk-paper-sunken);
|
|
1069
|
-
font-family: var(--dpk-mono);
|
|
1070
|
-
font-size: 10px;
|
|
1071
|
-
letter-spacing: 0.04em;
|
|
1072
|
-
color: var(--dpk-ink-faint);
|
|
1073
|
-
white-space: nowrap;
|
|
1074
|
-
}
|
|
1075
|
-
|
|
1076
|
-
.dpk-header-meta span + span::before {
|
|
1077
|
-
content: '';
|
|
1078
|
-
display: inline-block;
|
|
1079
|
-
width: 3px;
|
|
1080
|
-
height: 3px;
|
|
1081
|
-
margin-right: 8px;
|
|
1082
|
-
vertical-align: 1px;
|
|
1083
|
-
border-radius: 50%;
|
|
1084
|
-
background: var(--dpk-ink-faint);
|
|
1085
|
-
opacity: 0.5;
|
|
1086
|
-
}
|
|
1087
|
-
|
|
1088
|
-
.dpk-lang-select {
|
|
1089
|
-
flex: none;
|
|
1090
|
-
height: 30px;
|
|
1091
|
-
padding: 0 10px;
|
|
1092
|
-
border: 1px solid var(--dpk-rule);
|
|
1093
|
-
border-radius: 999px;
|
|
1094
|
-
background: var(--dpk-paper-sunken);
|
|
1095
|
-
color: var(--dpk-ink-soft);
|
|
1096
|
-
font: inherit;
|
|
1097
|
-
font-size: 12px;
|
|
1098
|
-
cursor: pointer;
|
|
1099
|
-
transition:
|
|
1100
|
-
color 160ms ease,
|
|
1101
|
-
border-color 160ms ease;
|
|
1102
|
-
}
|
|
1103
|
-
|
|
1104
|
-
.dpk-lang-select:hover {
|
|
1105
|
-
color: var(--dpk-ink);
|
|
1106
|
-
border-color: var(--dpk-rule-hover);
|
|
1107
|
-
}
|
|
1108
|
-
|
|
1109
|
-
.dpk-lang-select:focus-visible {
|
|
1110
|
-
outline: none;
|
|
1111
|
-
box-shadow: var(--dpk-focus);
|
|
1112
|
-
}
|
|
1113
|
-
|
|
1114
|
-
.dpk-theme-toggle {
|
|
1115
|
-
display: inline-flex;
|
|
1116
|
-
flex: none;
|
|
1117
|
-
align-items: center;
|
|
1118
|
-
justify-content: center;
|
|
1119
|
-
width: 30px;
|
|
1120
|
-
height: 30px;
|
|
1121
|
-
padding: 0;
|
|
1122
|
-
border: 1px solid var(--dpk-rule);
|
|
1123
|
-
border-radius: 999px;
|
|
1124
|
-
background: var(--dpk-paper-sunken);
|
|
1125
|
-
color: var(--dpk-ink-soft);
|
|
1126
|
-
cursor: pointer;
|
|
1127
|
-
transition:
|
|
1128
|
-
color 160ms ease,
|
|
1129
|
-
border-color 160ms ease;
|
|
1130
|
-
}
|
|
1131
|
-
|
|
1132
|
-
.dpk-theme-toggle svg {
|
|
1133
|
-
width: 15px;
|
|
1134
|
-
height: 15px;
|
|
1135
|
-
}
|
|
1136
|
-
|
|
1137
|
-
.dpk-theme-toggle:hover {
|
|
1138
|
-
color: var(--dpk-ink);
|
|
1139
|
-
border-color: var(--dpk-rule-hover);
|
|
1140
|
-
}
|
|
1141
|
-
|
|
1142
|
-
.dpk-theme-toggle:focus-visible {
|
|
1143
|
-
outline: none;
|
|
1144
|
-
box-shadow: var(--dpk-focus);
|
|
1145
|
-
}
|
|
1146
|
-
|
|
1147
|
-
/* --------------------------------------------------------------- body */
|
|
1148
|
-
|
|
1149
|
-
.dpk-body {
|
|
1150
|
-
display: flex;
|
|
1151
|
-
min-height: 0;
|
|
1152
|
-
}
|
|
1153
|
-
|
|
1154
|
-
.dpk-sidebar {
|
|
1155
|
-
width: 252px;
|
|
1156
|
-
flex: 0 0 auto;
|
|
1157
|
-
border-right: 1px solid var(--dpk-rule);
|
|
1158
|
-
background: linear-gradient(180deg, var(--dpk-paper-sunken) 0%, var(--dpk-paper-inset) 100%);
|
|
1159
|
-
overflow: auto;
|
|
1160
|
-
padding: 16px 14px;
|
|
1161
|
-
}
|
|
1162
|
-
|
|
1163
|
-
.dpk-sidebar[hidden] {
|
|
1164
|
-
display: none;
|
|
1165
|
-
}
|
|
1166
|
-
|
|
1167
|
-
.dpk-main {
|
|
1168
|
-
flex: 1 1 0%;
|
|
1169
|
-
display: flex;
|
|
1170
|
-
flex-direction: column;
|
|
1171
|
-
min-width: 0;
|
|
1172
|
-
overflow: auto;
|
|
1173
|
-
background: var(--dpk-paper);
|
|
1174
|
-
}
|
|
1175
|
-
|
|
1176
|
-
.dpk-main-body {
|
|
1177
|
-
flex: 1 0 auto;
|
|
1178
|
-
display: grid;
|
|
1179
|
-
align-content: start;
|
|
1180
|
-
gap: 16px;
|
|
1181
|
-
min-width: 0;
|
|
1182
|
-
padding: 24px;
|
|
1183
|
-
}
|
|
1184
|
-
|
|
1185
|
-
/*
|
|
1186
|
-
* Author memo. It sits at the end of the main column and sticks to the
|
|
1187
|
-
* bottom of the scrollport: always visible, floating over whatever scrolls
|
|
1188
|
-
* behind it, and never stealing height from the preview.
|
|
1189
|
-
*/
|
|
1190
|
-
.dpk-memo {
|
|
1191
|
-
position: sticky;
|
|
1192
|
-
bottom: 0;
|
|
1193
|
-
z-index: 5;
|
|
1194
|
-
padding: 0 20px 20px;
|
|
1195
|
-
pointer-events: none;
|
|
1196
|
-
}
|
|
1197
|
-
|
|
1198
|
-
.dpk-memo[hidden] {
|
|
1199
|
-
display: none;
|
|
1200
|
-
}
|
|
1201
|
-
|
|
1202
|
-
.dpk-memo ::slotted(*) {
|
|
1203
|
-
display: block;
|
|
1204
|
-
max-width: 100%;
|
|
1205
|
-
padding: 10px 14px;
|
|
1206
|
-
border: 1px solid var(--dpk-rule);
|
|
1207
|
-
border-radius: var(--dpk-radius-lg);
|
|
1208
|
-
background: var(--dpk-paper-raised);
|
|
1209
|
-
box-shadow: var(--dpk-shadow-lg);
|
|
1210
|
-
font-size: 12.5px;
|
|
1211
|
-
line-height: 1.65;
|
|
1212
|
-
color: var(--dpk-ink-soft);
|
|
1213
|
-
pointer-events: auto;
|
|
1214
|
-
}
|
|
1215
|
-
|
|
1216
|
-
.dpk-orphans {
|
|
1217
|
-
margin-top: 16px;
|
|
1218
|
-
border: 1px dashed var(--dpk-rule-strong);
|
|
1219
|
-
border-radius: var(--dpk-radius-sm);
|
|
1220
|
-
padding: 10px;
|
|
1221
|
-
}
|
|
1222
|
-
|
|
1223
|
-
.dpk-banner {
|
|
1224
|
-
display: grid;
|
|
1225
|
-
gap: 4px;
|
|
1226
|
-
margin-bottom: 14px;
|
|
1227
|
-
border: 1px solid var(--dpk-accent);
|
|
1228
|
-
border-left-width: 3px;
|
|
1229
|
-
border-radius: var(--dpk-radius-sm);
|
|
1230
|
-
background: var(--dpk-accent-soft);
|
|
1231
|
-
padding: 10px 12px;
|
|
1232
|
-
max-width: 900px;
|
|
1233
|
-
}
|
|
1234
|
-
|
|
1235
|
-
.dpk-banner strong {
|
|
1236
|
-
font-size: 13px;
|
|
1237
|
-
}
|
|
1238
|
-
|
|
1239
|
-
.dpk-banner code {
|
|
1240
|
-
font-family: var(--dpk-mono);
|
|
1241
|
-
font-size: 11px;
|
|
1242
|
-
color: var(--dpk-ink-soft);
|
|
1243
|
-
overflow-wrap: anywhere;
|
|
1244
|
-
}
|
|
1245
|
-
|
|
1246
|
-
.dpk-notes {
|
|
1247
|
-
flex: 0 0 auto;
|
|
1248
|
-
width: 344px;
|
|
1249
|
-
border-left: 1px solid var(--dpk-rule);
|
|
1250
|
-
background: var(--dpk-paper-raised);
|
|
1251
|
-
overflow: hidden;
|
|
1252
|
-
display: flex;
|
|
1253
|
-
}
|
|
1254
|
-
|
|
1255
|
-
.dpk-notes[hidden] {
|
|
1256
|
-
display: none;
|
|
1257
|
-
}
|
|
1258
|
-
|
|
1259
|
-
/* ------------------------------------------------------------- footer */
|
|
1260
|
-
|
|
1261
|
-
.dpk-footer {
|
|
1262
|
-
border-top: 1px solid var(--dpk-rule);
|
|
1263
|
-
padding: 10px 20px;
|
|
1264
|
-
display: flex;
|
|
1265
|
-
gap: 12px;
|
|
1266
|
-
align-items: center;
|
|
1267
|
-
background: var(--dpk-paper-sunken);
|
|
1268
|
-
font-size: 12px;
|
|
1269
|
-
color: var(--dpk-ink-faint);
|
|
1270
|
-
}
|
|
1271
|
-
|
|
1272
|
-
/* --------------------------------------------------- floating review */
|
|
1273
|
-
|
|
1274
|
-
/* Review toggle: pinned to the top right corner, always in the same place. */
|
|
1275
|
-
.dpk-fab {
|
|
1276
|
-
position: fixed;
|
|
1277
|
-
top: 10px;
|
|
1278
|
-
right: 16px;
|
|
1279
|
-
z-index: 60;
|
|
1280
|
-
display: inline-flex;
|
|
1281
|
-
align-items: center;
|
|
1282
|
-
justify-content: center;
|
|
1283
|
-
width: 38px;
|
|
1284
|
-
height: 38px;
|
|
1285
|
-
padding: 0;
|
|
1286
|
-
border: 1px solid var(--dpk-rule-strong);
|
|
1287
|
-
border-radius: 999px;
|
|
1288
|
-
background: var(--dpk-paper-raised);
|
|
1289
|
-
color: var(--dpk-ink-soft);
|
|
1290
|
-
box-shadow: var(--dpk-shadow);
|
|
1291
|
-
cursor: pointer;
|
|
1292
|
-
transition:
|
|
1293
|
-
color 160ms ease,
|
|
1294
|
-
background 160ms ease,
|
|
1295
|
-
border-color 160ms ease,
|
|
1296
|
-
box-shadow 160ms ease,
|
|
1297
|
-
transform 160ms cubic-bezier(0.34, 1.56, 0.64, 1);
|
|
1298
|
-
}
|
|
1299
|
-
|
|
1300
|
-
.dpk-fab:hover {
|
|
1301
|
-
color: var(--dpk-ink);
|
|
1302
|
-
transform: translateY(-2px) scale(1.05);
|
|
1303
|
-
box-shadow: var(--dpk-shadow-lg);
|
|
1304
|
-
}
|
|
1305
|
-
|
|
1306
|
-
.dpk-fab:active {
|
|
1307
|
-
transform: translateY(0) scale(0.97);
|
|
1308
|
-
box-shadow: var(--dpk-shadow-xs);
|
|
1309
|
-
}
|
|
1310
|
-
|
|
1311
|
-
.dpk-fab:focus-visible {
|
|
1312
|
-
outline: none;
|
|
1313
|
-
box-shadow: var(--dpk-focus);
|
|
1314
|
-
}
|
|
1315
|
-
|
|
1316
|
-
.dpk-fab[aria-expanded='true'] {
|
|
1317
|
-
color: var(--dpk-accent-ink);
|
|
1318
|
-
border-color: transparent;
|
|
1319
|
-
background: linear-gradient(135deg, var(--dpk-accent), var(--dpk-accent-strong));
|
|
1320
|
-
box-shadow: 0 2px 8px rgba(217, 73, 32, 0.3);
|
|
1321
|
-
}
|
|
1322
|
-
|
|
1323
|
-
.dpk-fab[aria-expanded='true']:hover {
|
|
1324
|
-
box-shadow: 0 4px 14px rgba(217, 73, 32, 0.4);
|
|
1325
|
-
}
|
|
1326
|
-
|
|
1327
|
-
.dpk-fab-icon {
|
|
1328
|
-
position: relative;
|
|
1329
|
-
display: block;
|
|
1330
|
-
width: 16px;
|
|
1331
|
-
height: 12px;
|
|
1332
|
-
border: 1.6px solid currentColor;
|
|
1333
|
-
border-radius: 3.5px;
|
|
1334
|
-
}
|
|
1335
|
-
|
|
1336
|
-
.dpk-fab-icon::after {
|
|
1337
|
-
content: '';
|
|
1338
|
-
position: absolute;
|
|
1339
|
-
left: 2px;
|
|
1340
|
-
bottom: -4px;
|
|
1341
|
-
border-left: 3.5px solid transparent;
|
|
1342
|
-
border-right: 3.5px solid transparent;
|
|
1343
|
-
border-top: 4px solid currentColor;
|
|
1344
|
-
}
|
|
1345
|
-
|
|
1346
|
-
.dpk-fab-badge {
|
|
1347
|
-
position: absolute;
|
|
1348
|
-
top: -5px;
|
|
1349
|
-
right: -5px;
|
|
1350
|
-
min-width: 18px;
|
|
1351
|
-
height: 18px;
|
|
1352
|
-
padding: 0 4px;
|
|
1353
|
-
border: 2px solid var(--dpk-paper-raised);
|
|
1354
|
-
border-radius: 999px;
|
|
1355
|
-
background: linear-gradient(135deg, var(--dpk-accent-bright), var(--dpk-accent));
|
|
1356
|
-
color: var(--dpk-accent-ink);
|
|
1357
|
-
font-family: var(--dpk-mono);
|
|
1358
|
-
font-size: 9.5px;
|
|
1359
|
-
font-weight: 600;
|
|
1360
|
-
font-variant-numeric: tabular-nums;
|
|
1361
|
-
line-height: 14px;
|
|
1362
|
-
text-align: center;
|
|
1363
|
-
box-shadow: 0 1px 4px rgba(217, 73, 32, 0.3);
|
|
1364
|
-
}
|
|
1365
|
-
`];class Pr extends O{static{this.styles=Nr}static{this.properties={storageKey:{type:String,attribute:"storage-key"},storage:{type:String},notes:{type:String},theme:{type:String},notesOpen:{state:!0}}}#e=!1;#o=new Lr(this);#i=new Er(this,()=>this.storage!=="off"&&this.storage!=="memory");#n=new Cr(this);#r=new jr(this,()=>this.storage!=="off"&&this.storage!=="memory",()=>this.#t?.setTemplate(this.definition));#s;#t;#a=Fe;#l=null;#p=new Set;#f=null;#v;#d;#c;#m=[];#u;#g=new Promise(e=>{this.#u=e});#y;get locale(){return this.#r.locale}get definition(){const e=this.locale;return this.#s?.locale!==e&&(this.#s={locale:e,value:this.definitionFor(e)}),this.#s.value}connectedCallback(){super.connectedCallback(),this.dataset.template=this.definition.name,this.#e||(this.#e=!0,this.notesOpen=this.notes==="on"||this.notes==="open"),this.#k(),window.addEventListener("hashchange",this.#_),this.addEventListener("click",this.#O),this.addEventListener("dpk-comment-targets-change",this.#h),this.addEventListener("dpk-comment-request",this.#E),this.addEventListener("dpk-comment-submit",this.#T),this.addEventListener("dpk-element-action",this.#M),this.#c??=new MutationObserver(this.#h),this.#h()}disconnectedCallback(){super.disconnectedCallback(),window.removeEventListener("hashchange",this.#_),this.removeEventListener("click",this.#O),this.#d?.disconnect(),this.#c?.disconnect(),this.removeEventListener("dpk-comment-targets-change",this.#h),this.removeEventListener("dpk-comment-request",this.#E),this.removeEventListener("dpk-comment-submit",this.#T),this.removeEventListener("dpk-element-action",this.#M)}#k(e=0){if(this.#t){this.#x();return}if(this.childNodes.length===0&&e<2){queueMicrotask(()=>this.#k(e+1));return}this.#N()}#x(){this.#v||(this.#v=this.#t?.subscribe(()=>this.#D()))}willUpdate(){this.dataset.theme=this.#i.resolve(ie(this.theme))}updated(){this.#z()}get api(){return this.#y??=this.#L(),this.#y}get controller(){if(!this.#t)throw new Error(`<${this.tagName.toLowerCase()}> is not initialized yet`);return this.#t}get derivation(){return this.controller.derivation}get navigation(){return this.#a}dispatch(e){const s=this.controller.dispatch(e);return 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.requestUpdate(),this.dispatchEvent(new CustomEvent("dpk-error",{detail:{issues:s.issues},bubbles:!0,composed:!0})),this.#b()),s}removeAction(e){this.controller.removeAction(e)}clearActions(){this.controller.clearActions()}navigate(e,s={}){const n=V(this.#$());this.#a=Je(this.#a,e),this.#w(s.replace??!1);const i=V(this.#$());this.requestUpdate(),n!==i&&(this.#b(),this.dispatchEvent(new CustomEvent("dpk-navigate",{detail:{navigation:this.#a},bubbles:!0,composed:!0})))}hashFor(e){const s=this.#$();return V(this.definition.resolveNavigation(this.derivation.state,Je(s,e)))}requestComment(e){this.#l=typeof e=="string"?e:_(e),this.notesOpen=!0,this.requestUpdate()}get integratedReview(){return!1}get canSendToClaude(){return this.#n.available}sendToClaude(){return this.#n.send({brief:this.api.exportBrief(),draft:ke(this.derivation.actions),anchor:this})}renderReviewPanel(e){return f`<dpk-component-comment-panel
|
|
1366
|
-
.definition=${this.controller.definition}
|
|
1367
|
-
.state=${e.state}
|
|
1368
|
-
.navigation=${e.navigation}
|
|
1369
|
-
.derivation=${this.derivation}
|
|
1370
|
-
.issues=${this.controller.lastIssues}
|
|
1371
|
-
.exportBrief=${()=>this.api.exportBrief()}
|
|
1372
|
-
.sendToClaude=${this.canSendToClaude?()=>this.sendToClaude():void 0}
|
|
1373
|
-
.pendingTarget=${this.#l}
|
|
1374
|
-
.embedded=${this.integratedReview}
|
|
1375
|
-
.onDelete=${s=>this.removeAction(s)}
|
|
1376
|
-
.onClear=${()=>this.clearActions()}
|
|
1377
|
-
.onComment=${(s,n)=>{const i=this.dispatch({type:E,target:s,payload:{body:n}});return i.ok&&(this.#l=null),i}}
|
|
1378
|
-
></dpk-component-comment-panel>`}renderChrome(e,s){const n=e.actions.length,i=e.comments.length,r=$e(this.locale);return f`
|
|
1379
|
-
<div class="dpk-shell">
|
|
1380
|
-
<header class="dpk-header">
|
|
1381
|
-
<div class="dpk-title">
|
|
1382
|
-
<span class="dpk-template-mark">${this.definition.label}</span>
|
|
1383
|
-
<h1>${this.definition.title(e.state)}</h1>
|
|
1384
|
-
</div>
|
|
1385
|
-
<div class="dpk-header-slot">
|
|
1386
|
-
${s.header??m}
|
|
1387
|
-
<slot name="header"></slot>
|
|
1388
|
-
</div>
|
|
1389
|
-
<div class="dpk-header-meta">
|
|
1390
|
-
<span>dev-process-kit@${W}</span>
|
|
1391
|
-
<span>${this.definition.name}</span>
|
|
1392
|
-
<span>${n} draft · ${i} note</span>
|
|
1393
|
-
</div>
|
|
1394
|
-
${this.#j()} ${this.#R()}
|
|
1395
|
-
</header>
|
|
1396
|
-
<div class="dpk-body">
|
|
1397
|
-
<aside
|
|
1398
|
-
class="dpk-sidebar"
|
|
1399
|
-
?hidden=${s.sidebarHidden||!s.sidebar&&!this.hasSidebarContent()}
|
|
1400
|
-
>
|
|
1401
|
-
${s.sidebar??m}
|
|
1402
|
-
<slot name="sidebar"></slot>
|
|
1403
|
-
</aside>
|
|
1404
|
-
<main class="dpk-main">
|
|
1405
|
-
<div class="dpk-main-body">
|
|
1406
|
-
${this.#f?f`<div class="dpk-banner" role="alert">
|
|
1407
|
-
<strong>${r.baseDataError}</strong>
|
|
1408
|
-
<code>${this.#f}</code>
|
|
1409
|
-
</div>`:m}
|
|
1410
|
-
${s.main??m}
|
|
1411
|
-
<slot name="main"></slot>
|
|
1412
|
-
<section class="dpk-orphans" ?hidden=${this.#o.orphans===0}>
|
|
1413
|
-
<p class="dpk-label">previews without metadata</p>
|
|
1414
|
-
<slot name="preview"></slot>
|
|
1415
|
-
</section>
|
|
1416
|
-
</div>
|
|
1417
|
-
<div class="dpk-memo" ?hidden=${!this.hasMemoContent()}>
|
|
1418
|
-
<slot name="memo"></slot>
|
|
1419
|
-
</div>
|
|
1420
|
-
</main>
|
|
1421
|
-
${this.integratedReview?m:f`<aside class="dpk-notes" ?hidden=${!this.notesOpen}>${this.renderReviewPanel(e)}</aside>`}
|
|
1422
|
-
</div>
|
|
1423
|
-
${s.footer||this.hasFooterContent()?f`<footer class="dpk-footer">
|
|
1424
|
-
${s.footer??m}
|
|
1425
|
-
<slot name="footer"></slot>
|
|
1426
|
-
</footer>`:m}
|
|
1427
|
-
${this.integratedReview?m:f`<button
|
|
1428
|
-
class="dpk-fab"
|
|
1429
|
-
type="button"
|
|
1430
|
-
aria-expanded=${this.notesOpen?"true":"false"}
|
|
1431
|
-
title=${r.reviewToggle}
|
|
1432
|
-
@click=${()=>{this.notesOpen=!this.notesOpen}}
|
|
1433
|
-
>
|
|
1434
|
-
<span class="dpk-fab-icon" aria-hidden="true"></span>
|
|
1435
|
-
<span
|
|
1436
|
-
class="dpk-label"
|
|
1437
|
-
style="position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)"
|
|
1438
|
-
>
|
|
1439
|
-
${r.review}
|
|
1440
|
-
</span>
|
|
1441
|
-
${n>0?f`<span class="dpk-fab-badge">${n}</span>`:m}
|
|
1442
|
-
</button>`}
|
|
1443
|
-
</div>
|
|
1444
|
-
`}#j(){const e=this.locale,s=$e(e).language;return f`<select
|
|
1445
|
-
class="dpk-lang-select"
|
|
1446
|
-
aria-label=${s}
|
|
1447
|
-
title=${s}
|
|
1448
|
-
@change=${fs(n=>{const i=je.find(r=>r===n);i!==void 0&&this.#r.pick(i)})}
|
|
1449
|
-
>
|
|
1450
|
-
${je.map(n=>f`<option value=${n} lang=${n} ?selected=${n===e}>
|
|
1451
|
-
${ei[n]}
|
|
1452
|
-
</option>`)}
|
|
1453
|
-
</select>`}#R(){const e=this.dataset.theme==="dark",s=$e(this.locale),n=e?s.useLightTheme:s.useDarkTheme;return f`<button
|
|
1454
|
-
class="dpk-theme-toggle"
|
|
1455
|
-
type="button"
|
|
1456
|
-
aria-label=${n}
|
|
1457
|
-
title=${n}
|
|
1458
|
-
@click=${()=>this.#i.toggle(ie(this.theme))}
|
|
1459
|
-
>
|
|
1460
|
-
${e?Ei():Ti()}
|
|
1461
|
-
</button>`}render(){if(!this.#t)return m;const e=this.#C();return this.renderChrome(e,this.renderRegions(e))}hasSidebarContent(){return this.querySelector('[slot="sidebar"]')!==null}hasMemoContent(){return this.querySelector('[slot="memo"]')!==null}hasFooterContent(){return this.querySelector('[slot="footer"]')!==null}context(){return this.#C()}#A(){return{definition:this.definition,controller:()=>this.controller,derivation:()=>this.derivation,ready:this.#g,navigation:()=>this.#$(),issues:()=>this.controller.lastIssues,dispatch:e=>this.dispatch(e),dispatchBatch:e=>this.dispatchBatch(e),subscribe:e=>(this.#p.add(e),()=>{this.#p.delete(e)}),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)}}#L(){return yr(this.#A(),this)}#S(){return Ps(this.#A())}#C(){return br(this.#A())}#$(){return this.definition.resolveNavigation(this.derivation.state,this.#a)}#N(){const e=this.#U();this.#a=Ks();const s=this.storageKey;this.#t=new Rs({definition:this.definition,base:e,storage:this.#P(),...typeof s=="string"?{storageKey:s}:{}}),this.#x(),this.#h(),this.#w(!0),this.#u?.(),this.#I(),this.requestUpdate()}#P(){return this.storage==="off"?null:this.storage==="memory"?new Xe:et()}#U(){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.#f='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.#f=s instanceof Error?s.message:String(s),this.definition.emptyBase()}}#I(){this.querySelector('script[type="application/json"]')||(this.#d=new MutationObserver(()=>{const e=this.querySelector('script[type="application/json"]');if(e){this.#d?.disconnect(),this.#d=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.#d.observe(this,{childList:!0,subtree:!0}))}#b(){const e=this.#S();for(const s of this.#p)s(e)}#D(){if(!this.isConnected){this.requestUpdate(),this.#b();return}this.#w(!0),Fs(this.#m,this.controller.actions),queueMicrotask(this.#h),this.requestUpdate(),this.#b(),this.dispatchEvent(new CustomEvent("dpk-change",{detail:this.#S(),bubbles:!0,composed:!0}))}#w(e){const s=this.#$();this.#a=s,Rr(s,e)}#_=()=>{this.#a=Ks(),this.#w(!0),this.requestUpdate(),this.#b(),this.dispatchEvent(new CustomEvent("dpk-navigate",{detail:{navigation:this.#a},bubbles:!0,composed:!0}))};#h=()=>{this.#c?.disconnect(),this.#m=Tr(this,e=>{this.isConnected&&this.#c?.observe(e,{childList:!0,subtree:!0})}),this.#t&&(Fs(this.#m,this.#t.actions),this.#t.setComponentSnapshot(Or(this.#m)))};#E=e=>{if(e.stopPropagation(),!(e instanceof CustomEvent)||!this.#t)return;const s=e.detail;typeof s!="object"||s===null||!("target"in s)||typeof s.target!="string"||(this.#h(),!this.controller.definition.commentTargets(this.derivation.state,this.navigation).some(i=>i.value===s.target))||this.requestComment(s.target)};#T=e=>{if(e.stopPropagation(),!(e instanceof CustomEvent)||!e.cancelable||!this.#t)return;const s=k(Ui,e.detail);if(!s.success)return;this.#h();const{target:n,body:i}=s.output;if(!this.controller.definition.commentTargets(this.derivation.state,this.navigation).some(c=>c.value===n))return;this.dispatch({type:E,target:n,payload:{body:i}}).ok&&e.preventDefault()};#M=e=>{if(e.stopPropagation(),!(e instanceof CustomEvent)||!e.cancelable||!this.#t)return;const s=k(Wn,e.detail);if(!s.success)return;this.#h();const{type:n,target:i,payload:r}=s.output;if(!this.controller.definition.commentTargets(this.derivation.state,this.navigation).some(a=>a.value===i))return;this.dispatch({type:n,target:i,payload:r}).ok&&e.preventDefault()};#O=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(Ke(n.includes("=")?n:`step=${n}`));return}const i=s.getAttribute("data-dpk-comment");if(i!==null){e.preventDefault(),this.requestComment(i);return}}};#z(){this.#o.route()}}const Ur=(t,e)=>{typeof window>"u"||Object.assign(window,{devProcessKit:{version:t,templates:e}})};export{bn as $,vi as A,ki as B,E as C,hs as D,Fe as E,W as F,bi as G,xi as H,mi as I,yi as J,gi as K,Es as L,Xe as M,Ke as N,qt as O,Nn as P,Je as Q,Pn as R,ke as S,Pr as T,Ht as U,_ as V,Qe as W,be as X,De as Y,he as Z,ue as _,Ur as a,R as a0,m as a1,f as a2,us as a3,nn as a4,O as a5,Ne as a6,Ci as a7,_i as a8,Bt as a9,Rn as aA,fs as aB,os as aC,as as aD,ds as aE,Ai as aF,Si as aG,K as aa,me as ab,D as ac,g as ad,ve as ae,b as af,y as ag,Pt as ah,zt as ai,z as aj,F as ak,Rt as al,k as am,w as an,Lt as ao,Ie as ap,Ot as aq,Mt as ar,Nt as as,C as at,jn as au,Li as av,we as aw,ee as ax,ns as ay,Qt as az,Vt as b,Tt as c,Rs as d,Be as e,Un as f,Ve as g,Jt as h,xe as i,Cs as j,fe as k,Ft as l,Bn as m,ze as n,et as o,js as p,Ln as q,ji as r,kn as s,_s as t,J as u,Dn as v,V as w,wi as x,$i as y,Ge as z};
|