@popmelt.com/core 0.36.0 → 0.37.1
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 +106 -23
- package/claude-plugin/.claude-plugin/plugin.json +1 -1
- package/claude-plugin/skills/popmelt-core/SKILL.md +6 -1
- package/codex-plugin/.codex-plugin/plugin.json +1 -1
- package/codex-plugin/skills/popmelt-core/SKILL.md +6 -1
- package/dist/ExploreAttachment-6AIMXC2K.mjs +1 -0
- package/dist/PagePreviewLayer-SIH7DDBF.mjs +1 -0
- package/dist/ParticipantRuntime-RTMEFDKF.mjs +1 -0
- package/dist/PhoneHostGate-RZRGWS2E.mjs +1 -0
- package/dist/PopmeltTasteConnectedPane-FAJXJEQQ.mjs +1 -0
- package/dist/PreviewRuntime-MW33PLMV.mjs +1 -0
- package/dist/{QueuedReplies-ESIFFRKS.mjs → QueuedReplies-4APDDNQX.mjs} +1 -1
- package/dist/SamplePlacementOverlay-2VLBRDPZ.mjs +1 -0
- package/dist/ShareProjectPane-OR2LS2A3.mjs +1 -0
- package/dist/SuppliedContext-SAQKEDWW.mjs +1 -0
- package/dist/ThreadErrorCard-OSHIWSHR.mjs +1 -0
- package/dist/ThreadPanel-CMC5Q6WM.mjs +1 -0
- package/dist/adapter-react-three-fiber.d.mts +20 -3
- package/dist/adapter-react-three-fiber.mjs +1 -1
- package/dist/adapter-three.d.mts +53 -2
- package/dist/adapter-three.mjs +45 -1
- package/dist/bridge-entry.mjs +1 -1
- package/dist/bridgeSSEStream-6OMAFDFW.mjs +1 -0
- package/dist/bridgeWebSocketStream-WIOGOPJW.mjs +1 -0
- package/dist/browser-runtime-5W2ZKUCZ.mjs +1 -0
- package/dist/browser.d.mts +4 -4
- package/dist/browser.mjs +1 -1
- package/dist/canvas-chat-note-O3USBECW.mjs +1 -0
- package/dist/checkFixture-DQPLFEUL.mjs +1 -0
- package/dist/{chunk-AH6LZOQC.mjs → chunk-3PSB5BST.mjs} +1 -1
- package/dist/chunk-3QYA5LGF.mjs +1 -0
- package/dist/chunk-3VOEPWRL.mjs +1 -0
- package/dist/chunk-4LVGVKSS.mjs +1 -0
- package/dist/chunk-5GEBVPTA.mjs +1 -0
- package/dist/chunk-5IZHN3A7.mjs +1 -0
- package/dist/chunk-6EO73WJN.mjs +1 -0
- package/dist/chunk-6XEEXK3U.mjs +1 -0
- package/dist/chunk-76WRZ2NH.mjs +1 -0
- package/dist/chunk-7EISKUU7.mjs +1 -0
- package/dist/chunk-7JWADHTH.mjs +1 -0
- package/dist/chunk-A4GARXVQ.mjs +1 -0
- package/dist/chunk-AAMUU2QA.mjs +1 -0
- package/dist/chunk-AGCS65LT.mjs +1 -0
- package/dist/{chunk-RR4SHK7O.mjs → chunk-AOTDTBQO.mjs} +1 -1
- package/dist/chunk-ATLUO4G7.mjs +1 -0
- package/dist/chunk-AYZUOBFI.mjs +1 -0
- package/dist/chunk-B22WBEQC.mjs +1 -0
- package/dist/chunk-B4DYUYX4.mjs +1 -0
- package/dist/{chunk-NDGM4DAP.mjs → chunk-BYASSHKJ.mjs} +1 -1
- package/dist/chunk-C2ZSNUXQ.mjs +1 -0
- package/dist/chunk-CCFTIBCJ.mjs +1 -0
- package/dist/chunk-CIKFUS7J.mjs +1 -0
- package/dist/chunk-CK3CDA3L.mjs +1 -0
- package/dist/chunk-CVVD2OMQ.mjs +1 -0
- package/dist/chunk-EBJ23A7F.mjs +1 -0
- package/dist/chunk-ECMLCGAM.mjs +1 -0
- package/dist/chunk-EFGQKWSZ.mjs +1 -0
- package/dist/chunk-EILBHZDX.mjs +1 -0
- package/dist/{chunk-DOCRI237.mjs → chunk-ELKVFX2O.mjs} +1 -1
- package/dist/{chunk-EXIUW3JX.mjs → chunk-EUFR7R5Q.mjs} +1 -1
- package/dist/chunk-EZVFCJEG.mjs +1 -0
- package/dist/chunk-F3VZQGPM.mjs +1 -0
- package/dist/chunk-FHCKFQBY.mjs +1 -0
- package/dist/chunk-FJWWBKCQ.mjs +1 -0
- package/dist/chunk-FON4QY7P.mjs +1 -0
- package/dist/chunk-GAUQZAW6.mjs +1 -0
- package/dist/chunk-GLF7Z5IR.mjs +1 -0
- package/dist/chunk-HAN6CUNB.mjs +1 -0
- package/dist/chunk-HAZXZ5TU.mjs +1 -0
- package/dist/chunk-HBFSPXIC.mjs +1 -0
- package/dist/chunk-HKHZBKAN.mjs +1 -0
- package/dist/chunk-HPU2UMVE.mjs +1 -0
- package/dist/{chunk-YHYFWNN6.mjs → chunk-IAXSC2ZN.mjs} +1 -1
- package/dist/chunk-IW7V7WNL.mjs +1 -0
- package/dist/chunk-JEGBAHYK.mjs +1 -0
- package/dist/chunk-JJK4LAN6.mjs +1 -0
- package/dist/chunk-JSNK6NX7.mjs +1 -0
- package/dist/chunk-KCDHP4N3.mjs +1 -0
- package/dist/chunk-KF73S7MG.mjs +1 -0
- package/dist/chunk-KXVXWEN4.mjs +1 -0
- package/dist/chunk-L6S66APQ.mjs +1 -0
- package/dist/chunk-LH7HKUCK.mjs +1 -0
- package/dist/chunk-LOUWY55X.mjs +1 -0
- package/dist/chunk-MPEVFQ43.mjs +1 -0
- package/dist/{chunk-57FM7XQV.mjs → chunk-NI77Y3WC.mjs} +1 -1
- package/dist/chunk-O2ZQFLNV.mjs +1 -0
- package/dist/chunk-OA63PYHZ.mjs +1 -0
- package/dist/chunk-OIKFQ2FV.mjs +1 -0
- package/dist/chunk-OREALBUO.mjs +1 -0
- package/dist/chunk-OVZ4CQGM.mjs +1 -0
- package/dist/chunk-PRPXMDZ7.mjs +1 -0
- package/dist/chunk-PWQB3FIW.mjs +1 -0
- package/dist/chunk-QE5XGXIA.mjs +30 -0
- package/dist/chunk-QV5G3XRE.mjs +1 -0
- package/dist/chunk-ROKRMYFR.mjs +1 -0
- package/dist/chunk-SBD7GQDN.mjs +1 -0
- package/dist/chunk-SKKHZBOJ.mjs +1 -0
- package/dist/chunk-SOGN7S54.mjs +1 -0
- package/dist/chunk-SOT33EQ4.mjs +1 -0
- package/dist/chunk-SUAHDXJZ.mjs +1 -0
- package/dist/chunk-TCGXG7UA.mjs +1 -0
- package/dist/chunk-TIAPJGX2.mjs +1 -0
- package/dist/chunk-TMSGNHXH.mjs +1 -0
- package/dist/chunk-UTP56NCY.mjs +1 -0
- package/dist/chunk-UX3DTCHL.mjs +1 -0
- package/dist/chunk-VVNZ5IEG.mjs +24 -0
- package/dist/chunk-W2QQVB2H.mjs +1 -0
- package/dist/chunk-WF3YGZPI.mjs +1 -0
- package/dist/chunk-WJHYEACV.mjs +1 -0
- package/dist/chunk-WP2SHSCG.mjs +1 -0
- package/dist/chunk-X6I6KQDG.mjs +1 -0
- package/dist/chunk-XJJDBMZI.mjs +1 -0
- package/dist/chunk-YMWXWXPV.mjs +1 -0
- package/dist/chunk-YYODLRV3.mjs +1 -0
- package/dist/cli.mjs +1 -1
- package/dist/codex-note-context-6QGJT2V3.mjs +1 -0
- package/dist/codex-project-3GJPU63O.mjs +1 -0
- package/dist/codex-session-registry-YNU6LEVH.mjs +1 -0
- package/dist/codex-store-mount-F6RBC77X.mjs +1 -0
- package/dist/{dev-server-DtX2_HCa.d.mts → dev-server-BRrhkH5t.d.mts} +11 -1
- package/dist/dev-server-KWVIMLLL.mjs +1 -0
- package/dist/focus-inspection-F25RXWZV.mjs +1 -0
- package/dist/guest-admission.d.mts +2 -0
- package/dist/guest-admission.mjs +1 -0
- package/dist/guest-live-canvas.d.mts +2 -0
- package/dist/guest-live-canvas.mjs +1 -0
- package/dist/index.d.mts +6 -6
- package/dist/index.mjs +1 -1
- package/dist/invitationLink-LUIIOAEZ.mjs +1 -0
- package/dist/inviteQr-HVHH45SN.mjs +1 -0
- package/dist/inviteQr-U77MLSEQ.mjs +1 -0
- package/dist/media.d.mts +3 -3
- package/dist/memory-store.d.mts +5 -1
- package/dist/page-interaction-TV3P6B3X.mjs +1 -0
- package/dist/page-planes-2ZepTpen.d.mts +817 -0
- package/dist/participantBootstrap-BuTrTQbo.d.mts +22 -0
- package/dist/{participantBootstrap-DFJlcKRI.d.mts → participantBootstrap-CSLsiQ-C.d.mts} +9 -3
- package/dist/peer-client-7X52EKMX.mjs +1 -0
- package/dist/plain-html-EF7MUNRZ.mjs +1 -0
- package/dist/plugin-astro.d.mts +5 -2
- package/dist/plugin-astro.mjs +1 -1
- package/dist/plugin-next.mjs +1 -1
- package/dist/plugin-nuxt.d.mts +4 -2
- package/dist/plugin-nuxt.mjs +1 -1
- package/dist/plugin-vite.d.mts +69 -9
- package/dist/plugin-vite.mjs +1 -1
- package/dist/qr-encoder.mjs +3 -0
- package/dist/server.d.mts +45 -20
- package/dist/server.mjs +1 -1
- package/dist/shared-page-GO76UP7I.mjs +1 -0
- package/dist/{subjects-DdavjSTL.d.mts → subjects-BQFCkehy.d.mts} +84 -1
- package/dist/taste-proposal-session-DBOUA54V.mjs +1 -0
- package/dist/toolbarFonts-GVPRHJGB.mjs +1 -0
- package/dist/{types-g9YCBx4Z.d.mts → types-CggBG-H6.d.mts} +1 -137
- package/dist/{video-adapter-DB6Hex1f.d.mts → video-adapter-C0kSwUir.d.mts} +2 -2
- package/dist/workspace-snapshot-6LN7U2NJ.mjs +1 -0
- package/package.json +45 -22
- package/samples/README.md +32 -0
- package/samples/build.d.mts +16 -0
- package/samples/build.mjs +138 -0
- package/dist/ExploreAttachment-H5WPEAZB.mjs +0 -1
- package/dist/PagePreviewLayer-WCYOBKAS.mjs +0 -1
- package/dist/ParticipantRuntime-HEC26AER.mjs +0 -1
- package/dist/PhoneHostGate-Q2AXVOSH.mjs +0 -1
- package/dist/PopmeltTasteConnectedPane-B7DHQKRQ.mjs +0 -1
- package/dist/PreviewRuntime-H2UOLP6T.mjs +0 -1
- package/dist/SuppliedContext-7ASO6GAW.mjs +0 -1
- package/dist/ThreadErrorCard-6R7W3RGZ.mjs +0 -1
- package/dist/ThreadPanel-3IS7GUYS.mjs +0 -1
- package/dist/bridgeSSEStream-K3UIMBTC.mjs +0 -1
- package/dist/bridgeWebSocketStream-2SUZUBE3.mjs +0 -1
- package/dist/browser-runtime-ILNTJLZ5.mjs +0 -1
- package/dist/canvas-chat-note-MGAEUYJO.mjs +0 -1
- package/dist/checkFixture-YE2ROOLL.mjs +0 -1
- package/dist/chunk-26P7UUHT.mjs +0 -1
- package/dist/chunk-2P2NUZW7.mjs +0 -1
- package/dist/chunk-3SEXH3AZ.mjs +0 -1
- package/dist/chunk-3XJEC6LS.mjs +0 -1
- package/dist/chunk-4LHTPRFY.mjs +0 -1
- package/dist/chunk-5D2ADU7H.mjs +0 -1
- package/dist/chunk-5K7SACPW.mjs +0 -1
- package/dist/chunk-67QNAAUC.mjs +0 -1
- package/dist/chunk-7CGKO4IU.mjs +0 -30
- package/dist/chunk-BACXPVHP.mjs +0 -1
- package/dist/chunk-DC47WNPG.mjs +0 -1
- package/dist/chunk-DJTGR3RO.mjs +0 -1
- package/dist/chunk-DLUNNAZC.mjs +0 -1
- package/dist/chunk-EX63NVDN.mjs +0 -1
- package/dist/chunk-FLTHWLRC.mjs +0 -1
- package/dist/chunk-G6RYESYI.mjs +0 -1
- package/dist/chunk-G7JR5Z3P.mjs +0 -1
- package/dist/chunk-GBVPRXA3.mjs +0 -1
- package/dist/chunk-HAE5LUJX.mjs +0 -1
- package/dist/chunk-HU2XWUJC.mjs +0 -1
- package/dist/chunk-HV7HRQ2S.mjs +0 -1
- package/dist/chunk-J4WDYITA.mjs +0 -1
- package/dist/chunk-L7QONR4K.mjs +0 -1
- package/dist/chunk-LVEMYZOA.mjs +0 -1
- package/dist/chunk-MSWXKP77.mjs +0 -1
- package/dist/chunk-NSCO633B.mjs +0 -1
- package/dist/chunk-NWE5PYKM.mjs +0 -1
- package/dist/chunk-O4HZP3RP.mjs +0 -1
- package/dist/chunk-OAHYSDJ4.mjs +0 -1
- package/dist/chunk-PNTM77NT.mjs +0 -1
- package/dist/chunk-RUTWU5W2.mjs +0 -1
- package/dist/chunk-TLREGQQB.mjs +0 -1
- package/dist/chunk-TUXBMJQZ.mjs +0 -1
- package/dist/chunk-V2I7PSJW.mjs +0 -1
- package/dist/chunk-WDAXARLI.mjs +0 -1
- package/dist/chunk-WHJEKDNP.mjs +0 -1
- package/dist/chunk-X2Q3H6X7.mjs +0 -1
- package/dist/chunk-XJQJQ5V5.mjs +0 -1
- package/dist/chunk-XT6PHPPG.mjs +0 -1
- package/dist/chunk-YD3PDEFX.mjs +0 -1
- package/dist/chunk-ZDXQ7WNW.mjs +0 -1
- package/dist/codex-note-context-YFURG7VL.mjs +0 -1
- package/dist/codex-project-3NSU5OWL.mjs +0 -1
- package/dist/codex-session-registry-ONODFWFD.mjs +0 -1
- package/dist/focus-inspection-SZJ5KP23.mjs +0 -1
- package/dist/peer-client-56EAHIGF.mjs +0 -1
- package/dist/taste-proposal-session-XU4N7RUV.mjs +0 -1
- package/dist/workspace-snapshot-RTTXNNUX.mjs +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";var a="\n 0%, 100% { translate: 0 0; }\n 20% { translate: -4px 0; }\n 45% { translate: 4px 0; }\n 70% { translate: -2px 0; }\n 88% { translate: 1px 0; }\n";export{a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import{useId as e,useState as t,useLayoutEffect as n}from"react";function i(i,r){let o=e(),[s,a]=t(-1),[c,l]=t(!1),u=r.some(({suffix:e})=>e);n(()=>{let e=i.current;if(!e||!u)return;let t=()=>a(e.matches(":focus")&&e.selectionStart===e.selectionEnd?e.selectionEnd:-1),n=()=>a(-1);return t(),e.addEventListener("selectionchange",t),e.addEventListener("select",t),e.addEventListener("input",t),e.addEventListener("focus",t),e.addEventListener("blur",n),()=>{e.removeEventListener("selectionchange",t),e.removeEventListener("select",t),e.removeEventListener("input",t),e.removeEventListener("focus",t),e.removeEventListener("blur",n)}},[u,i]);let d=c?void 0:r.find(({start:e,token:t,suffix:n})=>n&&e+t.length===s);return{active:d,complete:function(e,t){let n=e.currentTarget;if(!d||"Tab"!==e.key||e.shiftKey||e.altKey||e.ctrlKey||e.metaKey||e.nativeEvent.isComposing||n.selectionStart!==s||n.selectionEnd!==s)return!1;e.preventDefault(),e.stopPropagation();let i=/\s/.test(n.value.charAt(s)),r=d.suffix+(i?"":" ");return n.ownerDocument.execCommand?.("insertText",!1,r)||(n.setRangeText(r,s,s,"end"),t()),i&&n.setSelectionRange(s+r.length+1,s+r.length+1),!0},hintId:o,inputProps:{"aria-autocomplete":d?"inline":void 0,"aria-describedby":d?o:void 0,onCompositionStart:()=>l(!0),onCompositionEnd:()=>l(!1)}}}export{i as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";function t(t){if(0===t.length)return{x:0,y:0,width:0,height:0};let h=t.map(t=>t.x),a=t.map(t=>t.y),i=Math.min(...h),e=Math.max(...h),n=Math.min(...a);return{x:i,y:n,width:e-i,height:Math.max(...a)-n}}export{t as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import{a as e}from"./chunk-FHCKFQBY.mjs";import{a as t}from"./chunk-APP5IYTE.mjs";import{i as r,J as n,p as l,a as o,n as i,z as a,G as s,H as f,D as c,q as u}from"./chunk-5IZHN3A7.mjs";import{a as p,b as d}from"./chunk-WP2SHSCG.mjs";import{v as m,l as h,k as g}from"./chunk-LH7HKUCK.mjs";var y='[role="img"], [role="group"][aria-label], [role="group"][aria-labelledby]';function b(e){let t=e?.closest(y);return t&&"canvas"!==t.localName&&t.querySelector("canvas")?t:null}function w(e,t){let r=t?.querySelector("canvas")?t:b(e);if(!r||r===e)return null;let n=r.querySelectorAll("canvas");if(1!==n.length)return null;let l=n[0].getBoundingClientRect(),o=e.getBoundingClientRect();return l.width<=0||l.height<=0?null:o.left<=l.left+1&&o.top<=l.top+1&&o.right>=l.right-1&&o.bottom>=l.bottom-1?r:null}function S(e){let t=m(e.selector,e.element),r=function(e,t=m(e.selector,e.element)){let r=e.element;if("canvas"!==r?.tagName&&"svg"!==r?.tagName&&!t?.closest("svg,canvas"))return t;let n=b(t);if(n)return n;if(t)return t;let l=r?.selector,o=l?.lastIndexOf(" > ")??-1;if(l&&o>=0)try{let e=b(h(l.slice(0,o)));if(e&&(!r?.reactComponent||p(e)?.name===r.reactComponent))return e}catch{}if(!r?.reactComponent||r.frameContext?.length||l?.includes(" >>> "))return null;let i=g().flatMap(e=>Array.from(e.querySelectorAll(y)).filter(e=>e.querySelector("canvas")&&p(e)?.name===r.reactComponent));return 1===i.length?i[0]:null}(e,t),n=e.element?.reactComponent,l=t&&(n?function(e,t){let r=d(e).findLast(e=>e.name===t)?.fiber;if(!r?.child)return null;let n=[r.child],l=null;for(;n.length;){let e=n.pop();if(4===e.tag)return null;e.sibling&&n.push(e.sibling);let t=e.stateNode;if((1===t?.nodeType||3===t?.nodeType)&&(!l&&1===t.nodeType&&(l=t),!l?.contains(t)))return null;e.child&&n.push(e.child)}return l?.contains(e)?l:null}(t,n):b(t));return{element:t,component:l,legacy:r,legacyScene:t&&w(t,l)}}function E(e,t,r){let n="component"===t?e.component:"element"===t?e.element:r&&e.legacyScene||e.legacy;return n?.isConnected&&n.parentElement&&!n.matches("body,html")&&!n.closest("[data-devtools]")?n:null}var v=["font-family","font-size","font-weight","font-style","font-stretch","font-variation-settings","font-feature-settings","line-height","letter-spacing","white-space","overflow-wrap","word-break","flex-wrap","color"];function x(e){return e.trim().replace(/^(['"])(.*)\1$/,"$2").toLowerCase()}function*N(e){let t=e.ownerDocument.createTreeWalker(e,NodeFilter.SHOW_TEXT|NodeFilter.SHOW_ELEMENT,{acceptNode(e){if(e.nodeType===Node.TEXT_NODE)return e.textContent?.trim()?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP;let t=e;return t.matches("script,style,noscript,template,[hidden],[data-devtools],[data-popmelt-root]")?NodeFilter.FILTER_REJECT:t.matches("input,textarea,select")?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}}),r=new Set;for(let e=t.nextNode();e;e=t.nextNode()){let t=e.nodeType===Node.TEXT_NODE?e.parentElement:e;!t||r.has(t)||(r.add(t),yield[t,e.nodeType===Node.TEXT_NODE?e.textContent.trim():""])}}function C(e){let t=[],r=new Set;for(let[n,l]of N(e)){let o=getComputedStyle(n),i=n.closest("button,a,label"),a=(i&&e.contains(i)?i:n).localName,{fontFamily:s,fontWeight:f,fontSize:c}=o,u=JSON.stringify([a,s,f,c]);if(s&&!r.has(u)&&(r.add(u),t.push({tag:a,text:l.slice(0,64),family:s,weight:f,size:c}),12===t.length))break}return t}function T(e,t){let r=e.ownerDocument,n=[];function l(e){if(!e||e.disabled)return;let t;try{t=e.cssRules}catch{return}o(t,e.href??r.baseURI)}function o(e,r){for(let i of e)if(i.type===CSSRule.FONT_FACE_RULE){let{style:e}=i;if(!t.has(x(e.getPropertyValue("font-family"))))continue;let l=i.cssText.replace(/url\("([^"]*)"\)|url\('([^']*)'\)|url\(([^)]*)\)/gi,(e,t,n,l)=>{try{return"url("+JSON.stringify(new URL(t??n??l.trim(),r).href)+")"}catch{return e}});n.push(l)}else i.type===CSSRule.IMPORT_RULE?l(i.styleSheet):"cssRules"in i&&o(i.cssRules,r)}let i=[r];for(let t=e.getRootNode();"host"in t;t=t.host.getRootNode())i.push(t);for(let e of i)for(let t of[...e.styleSheets,...e.adoptedStyleSheets??[]])l(t);return n}async function I(e,t){let r=function(e,t){let r=new Set([t]);for(let[t]of N(e))t!==e&&r.add(getComputedStyle(t).fontFamily);let n=new Set;for(let e of r)for(let t of e.matchAll(/\s*("[^"]*"|'[^']*'|[^,]+)\s*(?:,|$)/g))n.add(x(t[1]));return n}(e,getComputedStyle(e).fontFamily),n=T(e,r).join("\n"),l=new Set(Array.from(n.matchAll(/url\("([^"]+)"\)/g),e=>e[1])),o=n;return await Promise.all([...l].map(async e=>{if(!e.startsWith("data:"))try{let r=await fetch(e,{signal:t,credentials:"same-origin"});if(!r.ok)return;let n=await r.blob(),l=await new Promise((e,t)=>{let r=new FileReader;r.onload=()=>e(String(r.result)),r.onerror=t,r.readAsDataURL(n)});o=o.replaceAll(JSON.stringify(e),JSON.stringify(l))}catch{}})),o}var k=/^(?:@[a-zA-Z][\w-]{0,63}|~?(?:0|[1-9]\d{0,3})(?:\.(?:0|[1-9]\d{0,3})){0,31}|)$/;function R(e,t){let r="text"===t?e.replace(/\/text\/(?:0|[1-9]\d{0,3})$/,""):e;return k.test(r)}function A(e){if(e.matches('svg, img, [role="img"]'))return!0;if(e.childElementCount||"http://www.w3.org/1999/xhtml"!==e.namespaceURI)return!1;let t=e.ownerDocument.defaultView?.getComputedStyle(e).maskImage;return!!t&&"none"!==t}function O(e){let t=e.getAttribute("data-popmelt-subject-label")||e.getAttribute("data-explore-part");if(t)return t.slice(0,80);let r=e.closest('button, a[href], [role="button"], [role="link"]');if(r===e)return e.matches('a[href], [role="link"]')?"link":"button";let n=e.getAttribute("aria-label");if(A(e)){let t=n||e.getAttribute("alt")||e.querySelector(":scope > title")?.textContent;if(t)return t.slice(0,80);if(r){let t=Array.from(r.querySelectorAll("*")).filter(A);if(t.length>1)return"icon "+(t.indexOf(e)+1)}return"icon"}let l=Array.from(e.childNodes).filter(e=>e.nodeType===Node.TEXT_NODE).map(e=>e.textContent).join(" ").trim();return r&&l?"label":(n||l||e.localName).slice(0,80)}function j(e,t){let r=new Map;for(let n of[...e,...t]){let e=n.part+":"+n.property,t=r.get(e)?.from??n.from;t===n.to?r.delete(e):(r.delete(e),r.set(e,{...n,from:t}))}return[...r.values()]}function F(e){let t=Object.create(null);for(let{batchId:r,option:n,part:l,property:o,to:i}of e){let e=t[r]??(t[r]=Object.create(null)),a=e[n]??(e[n]=Object.create(null));(a[l]??(a[l]=Object.create(null)))[o]=i}return t}function _(e){if(!e||"object"!=typeof e)throw new Error("Invalid Steer edit.");let{batchId:n,option:l,part:o,property:a,from:s,to:f,sticker:c}=e;if("string"!=typeof n||"number"!=typeof l||!Number.isInteger(l)||"string"!=typeof o||"string"!=typeof a||"string"!=typeof s||"string"!=typeof f||("text"===a||"paragraphs"===a)&&void 0!==c)throw new Error("Invalid Steer edit.");"paragraphs"===a?(t(s),t(f)):"text"!==a&&$({[a]:f});let p={batchId:n,option:l,part:o,property:a,from:s,to:f};if(void 0===c)return p;let{family:d,subproperty:m,step:h,axisSteps:g}=c;if(!r.includes(d)||u(d,m)!==m||!i(d,m).includes(h))throw new Error("Invalid Steer dimension.");let y={family:d,subproperty:m,step:h};if(void 0===g)return{...p,sticker:y};let b=i("transform","translate");if("transform"!==d||"translate"!==m||!b.includes(g.x)||!b.includes(g.y))throw new Error("Invalid Steer translation.");return{...p,sticker:{...y,axisSteps:{x:g.x,y:g.y}}}}var L=new Map;function P(e,t){L.has(e)||L.set(e,new Set),L.get(e).add(t)}for(let e of r){let t=n(e);t&&P("display",t);for(let t of l(e))for(let r of"color"===t?o:[t]){let t=i(e,r);for(let n of t){let l=a(e,r);P(l,s(e,n,r));for(let t of f(e,r,n))P(t.property,t.value);if("border"===e&&l.endsWith("width")&&P(c(r),"solid"),"translate"===l)for(let e of t)P(l,4*Number(n)+"px "+4*Number(e)+"px")}}}function U(e){if(!e||"object"!=typeof e||Array.isArray(e))throw new Error("Invalid Steer draft.");return Object.entries(e)}function $(e){return Object.fromEntries(U(e).map(([e,t])=>{if("string"!=typeof t||!L.get(e)?.has(t))throw new Error("Unsupported Steer declaration: "+e);return[e,t]}))}function q(e,r){if(void 0===r)return e;let n=structuredClone(e);for(let[e,l]of U(r)){let r=n.messages.find(t=>t.batch?.id===e)?.batch;if(!r)throw new Error("Steer draft refers to an unknown batch.");for(let[e,n]of U(l)){let l=/^[0-5]$/.test(e)&&r.options[Number(e)];if(!l)throw new Error("Steer draft refers to an unknown option.");for(let[e,r]of U(n)){if("fixture"in l){if(!U(r).every(([t])=>R(e,t)))throw new Error("Invalid fixture part.");let{text:n,paragraphs:l,...o}=Object.fromEntries(U(r));if(void 0!==n&&"string"!=typeof n)throw new Error("Invalid fixture text.");if(void 0!==l){if("string"!=typeof l)throw Error("Invalid paragraph draft.");t(l)}$(o);continue}if(!/^(?:[0-7](?:\.[0-7]){0,3})?(?:\/label)?$/.test(e))throw new Error("Invalid specimen path.");let[n,o]=e.split("/"),i=l.root;for(let e of n?n.split("."):[])i=i?.children?.[Number(e)];if(!i||o&&(!i.label||"text"===i.kind))throw new Error("Steered element no longer exists.");let{text:a,...s}=Object.fromEntries(U(r));if(void 0!==a){if("string"!=typeof a||!o&&"text"!==i.kind)throw new Error("Invalid specimen text.");i.label=a}if(Object.keys(s).length){let e=o?"labelStyle":"style";i[e]={...i[e],...$(s)}}}}}return n}function D(e){return[...e.original?.runnable?[e.original.runnable]:[],...e.options]}function H(e,t){if(!e||e.target)return;let r=e.elements?.find(t=>t.selector===e.linkedSelector)??e.elements?.[0],n=e.linkedSelector??r?.selector;return n?{selector:n,element:r,pathname:e.pathname??t}:void 0}var W=new RegExp(`^${e.explore}(?=\\s|$)`,"i");function z(e){let t=W.exec(e.trimStart());return!!t&&!!e.trimStart().slice(t[0].length).trim()}function J(e,t){let r=e.label?.trim().replace(/\s*[→↓]$/,"").slice(0,52),n=r?r[0].toUpperCase()+r.slice(1)+" "+e.kind:e.kind[0].toUpperCase()+e.kind.slice(1),l=e.name||n;return"label"===t?l+" label":l}export{b as a,S as b,E as c,v as d,C as e,I as f,k as g,R as h,O as i,j,F as k,_ as l,q as m,D as n,H as o,z as p,J as q};
|