commerce-kit 0.41.0 → 0.43.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -100,6 +100,27 @@ await commerce.eventUpdate({ idOrSlug: 'summer-fest' }, { capacity: 600, status:
100
100
  const { attendees, totalTickets } = await commerce.eventAttendeesBrowse({ idOrSlug: 'summer-fest' });
101
101
  ```
102
102
 
103
+ ## Collections & Categories
104
+
105
+ Full CRUD for product collections, product categories, and blog categories. Mutations are
106
+ partial (send only the fields you want to change; pass `null` to clear an optional field).
107
+
108
+ ```typescript
109
+ // Collections — create, partially update, delete
110
+ const collection = await commerce.collectionCreate({ name: 'Summer', filter: { type: 'manual' }, active: true });
111
+ await commerce.collectionUpdate({ idOrSlug: 'summer' }, { name: 'Summer 2026', active: false });
112
+ await commerce.collectionDelete({ idOrSlug: 'summer' }); // { ok: true, deleted: 1 }
113
+
114
+ // Categories — delete (create/update already supported)
115
+ await commerce.categoryUpdate({ idOrSlug: 'shoes' }, { name: 'Footwear' });
116
+ await commerce.categoryDelete({ idOrSlug: 'footwear' }); // 409 if still referenced by products
117
+
118
+ // Blog categories — full CRUD
119
+ const blogCategory = await commerce.blogCategoryCreate({ name: 'Guides' });
120
+ await commerce.blogCategoryUpdate({ idOrSlug: 'guides' }, { description: null });
121
+ await commerce.blogCategoryDelete({ idOrSlug: 'guides' });
122
+ ```
123
+
103
124
  ## Raw API Requests
104
125
 
105
126
  For endpoints not yet implemented in the SDK, use the `request()` method:
@@ -6694,6 +6694,10 @@ type APIMeGetResult = {
6694
6694
  cartRecommendations?: {
6695
6695
  layout: "inline" | "sidebar";
6696
6696
  } | null | undefined;
6697
+ stockHold?: {
6698
+ enabled: boolean;
6699
+ holdMinutes: number;
6700
+ } | null | undefined;
6697
6701
  aiInstructions?: string | null | undefined;
6698
6702
  blogSettings?: {
6699
6703
  modelTier: "extra" | "max" | "regular";
@@ -7046,6 +7050,57 @@ type APIBlogCategoryGetByIdResult = {
7046
7050
  type APIBlogCategoryGetByIdParams = {
7047
7051
  idOrSlug: string;
7048
7052
  };
7053
+ type APIBlogCategoryCreateBody = {
7054
+ name: string;
7055
+ slug?: string | undefined;
7056
+ description?: string | null | undefined;
7057
+ image?: string | null | undefined;
7058
+ };
7059
+ type APIBlogCategoryCreateResult = {
7060
+ id: string;
7061
+ name: string;
7062
+ image: string | null;
7063
+ createdAt: string;
7064
+ updatedAt: string;
7065
+ slug: string;
7066
+ active: boolean;
7067
+ storeId: string;
7068
+ description: string | null;
7069
+ position: string;
7070
+ seo: {
7071
+ title?: string | null | undefined;
7072
+ description?: string | null | undefined;
7073
+ canonical?: string | null | undefined;
7074
+ } | null;
7075
+ };
7076
+ type APIBlogCategoryUpdateBody = {
7077
+ name?: string | undefined;
7078
+ slug?: string | undefined;
7079
+ description?: string | null | undefined;
7080
+ image?: string | null | undefined;
7081
+ active?: boolean | undefined;
7082
+ };
7083
+ type APIBlogCategoryUpdateResult = {
7084
+ id: string;
7085
+ name: string;
7086
+ image: string | null;
7087
+ createdAt: string;
7088
+ updatedAt: string;
7089
+ slug: string;
7090
+ active: boolean;
7091
+ storeId: string;
7092
+ description: string | null;
7093
+ position: string;
7094
+ seo: {
7095
+ title?: string | null | undefined;
7096
+ description?: string | null | undefined;
7097
+ canonical?: string | null | undefined;
7098
+ } | null;
7099
+ };
7100
+ type APIBlogCategoryDeleteResult = {
7101
+ ok: boolean;
7102
+ deleted: number;
7103
+ };
7049
7104
  type APIPostCommentsBrowseResult = {
7050
7105
  data: Array<{
7051
7106
  id: string;
@@ -7390,6 +7445,10 @@ type APICategoryUpdateResult = {
7390
7445
  longDescription: JSONContent | null;
7391
7446
  parentId: string | null;
7392
7447
  };
7448
+ type APICategoryDeleteResult = {
7449
+ ok: boolean;
7450
+ deleted: number;
7451
+ };
7393
7452
  type APIOrderUpdateBody = {
7394
7453
  status?: "processing" | "shipped" | "delivered" | "canceled";
7395
7454
  trackingNumber?: string;
@@ -7451,6 +7510,78 @@ type APICollectionCreateResult = {
7451
7510
  count: number;
7452
7511
  };
7453
7512
  };
7513
+ type APICollectionUpdateBody = {
7514
+ name?: string | undefined;
7515
+ slug?: string | undefined;
7516
+ description?: string | null | undefined;
7517
+ image?: string | null | undefined;
7518
+ filter?: {
7519
+ type: "manual";
7520
+ } | {
7521
+ type: "dynamicPrice";
7522
+ min?: number | null | undefined;
7523
+ max?: number | null | undefined;
7524
+ } | undefined;
7525
+ active?: boolean | undefined;
7526
+ };
7527
+ type APICollectionUpdateResult = {
7528
+ id: string;
7529
+ name: string;
7530
+ image: string | null;
7531
+ createdAt: string;
7532
+ updatedAt: string;
7533
+ slug: string;
7534
+ active: boolean;
7535
+ filter: {
7536
+ type: "manual";
7537
+ } | {
7538
+ type: "dynamicPrice";
7539
+ min?: number | null | undefined;
7540
+ max?: number | null | undefined;
7541
+ };
7542
+ storeId: string;
7543
+ description: JSONContent | null;
7544
+ seo: {
7545
+ title?: string | null | undefined;
7546
+ description?: string | null | undefined;
7547
+ canonical?: string | null | undefined;
7548
+ } | null;
7549
+ longDescription: JSONContent | null;
7550
+ kind: "product" | "event";
7551
+ productCollections: {
7552
+ position: string | null;
7553
+ productId: string;
7554
+ collectionId: string;
7555
+ product: {
7556
+ id: string;
7557
+ name: string;
7558
+ createdAt: string;
7559
+ updatedAt: string;
7560
+ type: "set" | "product" | "bundle";
7561
+ slug: string;
7562
+ status: "published" | "draft" | "hidden" | null;
7563
+ flags: unknown;
7564
+ storeId: string;
7565
+ summary: string | null;
7566
+ content: JSONContent | null;
7567
+ images: string[];
7568
+ badge: unknown;
7569
+ bundleDiscountPercentage: string | null;
7570
+ seo: {
7571
+ title?: string | null | undefined;
7572
+ description?: string | null | undefined;
7573
+ canonical?: string | null | undefined;
7574
+ } | null;
7575
+ stripeTaxCode: string | null;
7576
+ categoryId: string | null;
7577
+ brandId: string | null;
7578
+ };
7579
+ }[];
7580
+ };
7581
+ type APICollectionDeleteResult = {
7582
+ ok: boolean;
7583
+ deleted: number;
7584
+ };
7454
7585
  type APIProductReviewsBrowseResult = {
7455
7586
  data: Array<{
7456
7587
  id: string;
@@ -7942,4 +8073,4 @@ type APICartDeleteResult = {
7942
8073
  success: boolean;
7943
8074
  };
7944
8075
 
7945
- export type { APIBlogCategoriesBrowseQueryParams, APIBlogCategoriesBrowseResult, APIBlogCategoryGetByIdParams, APIBlogCategoryGetByIdResult, APIBrandAssignProductsBody, APIBrandAssignProductsResult, APIBrandCreateBody, APIBrandCreateResult, APIBrandDeleteResult, APIBrandGetByIdParams, APIBrandGetByIdResult, APIBrandUpdateBody, APIBrandUpdateResult, APIBrandsBrowseQueryParams, APIBrandsBrowseResult, APICartAddBody, APICartAddResult, APICartCreateBody, APICartCreateResult, APICartDeleteResult, APICartGetResult, APICartRemoveItemQueryParams, APICartRemoveItemResult, APICategoriesBrowseQueryParams, APICategoriesBrowseResult, APICategoryCreateBody, APICategoryCreateResult, APICategoryGetByIdParams, APICategoryGetByIdQueryParams, APICategoryGetByIdResult, APICategoryUpdateBody, APICategoryUpdateQueryParams, APICategoryUpdateResult, APICollectionCreateBody, APICollectionCreateResult, APICollectionGetByIdParams, APICollectionGetByIdQueryParams, APICollectionGetByIdResult, APICollectionsBrowseQueryParams, APICollectionsBrowseResult, APIContactMessageCreateBody, APIContactMessageCreateResult, APICustomerAddressCreateBody, APICustomerAddressCreateResult, APICustomerGetByIdParams, APICustomerGetByIdResult, APICustomerOrdersBrowseQueryParams, APICustomerOrdersBrowseResult, APICustomerUpdateBody, APICustomerUpdateResult, APICustomersBrowseQueryParams, APICustomersBrowseResult, APIEventAttendeesBrowseResult, APIEventCreateBody, APIEventCreateResult, APIEventGetByIdParams, APIEventGetByIdResult, APIEventUpdateBody, APIEventUpdateResult, APIEventsBrowseQueryParams, APIEventsBrowseResult, APIInstaviewImagesBrowseParams, APIInstaviewImagesBrowseQueryParams, APIInstaviewImagesBrowseResult, APIInventoryAdjustBody, APIInventoryAdjustResult, APIInventoryBrowseQueryParams, APIInventoryBrowseResult, APILegalPageGetByPathResult, APILegalPagesBrowseResult, APIMeGetResult, APIOrderGetByIdParams, APIOrderGetByIdResult, APIOrderRefundGetParams, APIOrderRefundGetResult, APIOrderRefundsBrowseQueryParams, APIOrderRefundsBrowseResult, APIOrderRefundsParams, APIOrderUpdateBody, APIOrderUpdateResult, APIOrdersBrowseQueryParams, APIOrdersBrowseResult, APIPostCommentCreateBody, APIPostCommentCreateResult, APIPostCommentsBrowseQueryParams, APIPostCommentsBrowseResult, APIPostCreateBody, APIPostCreateResult, APIPostDeleteResult, APIPostGetByIdParams, APIPostGetByIdResult, APIPostUpdateBody, APIPostUpdateResult, APIPostsBrowseQueryParams, APIPostsBrowseResult, APIProductBatchBody, APIProductBatchResult, APIProductCreateBody, APIProductCreateResult, APIProductDeleteQueryParams, APIProductDeleteResult, APIProductFiltersResult, APIProductGetByIdParams, APIProductGetByIdQueryParams, APIProductGetByIdResult, APIProductReviewCreateBody, APIProductReviewCreateResult, APIProductReviewsBrowseQueryParams, APIProductReviewsBrowseResult, APIProductUpdateBody, APIProductUpdateQueryParams, APIProductUpdateResult, APIProductsBrowseQueryParams, APIProductsBrowseResult, APISearchQueryParams, APISearchResult, APISocialsGetResult, APISubscriberCreateBody, APISubscriberCreateResult, APISubscriberDeleteResult, APIVariantCreateBody, APIVariantCreateResult, APIVariantGetByIdParams, APIVariantGetByIdQueryParams, APIVariantGetByIdResult, APIVariantUpdateBody, APIVariantUpdateResult, JSONContent };
8076
+ export type { APIBlogCategoriesBrowseQueryParams, APIBlogCategoriesBrowseResult, APIBlogCategoryCreateBody, APIBlogCategoryCreateResult, APIBlogCategoryDeleteResult, APIBlogCategoryGetByIdParams, APIBlogCategoryGetByIdResult, APIBlogCategoryUpdateBody, APIBlogCategoryUpdateResult, APIBrandAssignProductsBody, APIBrandAssignProductsResult, APIBrandCreateBody, APIBrandCreateResult, APIBrandDeleteResult, APIBrandGetByIdParams, APIBrandGetByIdResult, APIBrandUpdateBody, APIBrandUpdateResult, APIBrandsBrowseQueryParams, APIBrandsBrowseResult, APICartAddBody, APICartAddResult, APICartCreateBody, APICartCreateResult, APICartDeleteResult, APICartGetResult, APICartRemoveItemQueryParams, APICartRemoveItemResult, APICategoriesBrowseQueryParams, APICategoriesBrowseResult, APICategoryCreateBody, APICategoryCreateResult, APICategoryDeleteResult, APICategoryGetByIdParams, APICategoryGetByIdQueryParams, APICategoryGetByIdResult, APICategoryUpdateBody, APICategoryUpdateQueryParams, APICategoryUpdateResult, APICollectionCreateBody, APICollectionCreateResult, APICollectionDeleteResult, APICollectionGetByIdParams, APICollectionGetByIdQueryParams, APICollectionGetByIdResult, APICollectionUpdateBody, APICollectionUpdateResult, APICollectionsBrowseQueryParams, APICollectionsBrowseResult, APIContactMessageCreateBody, APIContactMessageCreateResult, APICustomerAddressCreateBody, APICustomerAddressCreateResult, APICustomerGetByIdParams, APICustomerGetByIdResult, APICustomerOrdersBrowseQueryParams, APICustomerOrdersBrowseResult, APICustomerUpdateBody, APICustomerUpdateResult, APICustomersBrowseQueryParams, APICustomersBrowseResult, APIEventAttendeesBrowseResult, APIEventCreateBody, APIEventCreateResult, APIEventGetByIdParams, APIEventGetByIdResult, APIEventUpdateBody, APIEventUpdateResult, APIEventsBrowseQueryParams, APIEventsBrowseResult, APIInstaviewImagesBrowseParams, APIInstaviewImagesBrowseQueryParams, APIInstaviewImagesBrowseResult, APIInventoryAdjustBody, APIInventoryAdjustResult, APIInventoryBrowseQueryParams, APIInventoryBrowseResult, APILegalPageGetByPathResult, APILegalPagesBrowseResult, APIMeGetResult, APIOrderGetByIdParams, APIOrderGetByIdResult, APIOrderRefundGetParams, APIOrderRefundGetResult, APIOrderRefundsBrowseQueryParams, APIOrderRefundsBrowseResult, APIOrderRefundsParams, APIOrderUpdateBody, APIOrderUpdateResult, APIOrdersBrowseQueryParams, APIOrdersBrowseResult, APIPostCommentCreateBody, APIPostCommentCreateResult, APIPostCommentsBrowseQueryParams, APIPostCommentsBrowseResult, APIPostCreateBody, APIPostCreateResult, APIPostDeleteResult, APIPostGetByIdParams, APIPostGetByIdResult, APIPostUpdateBody, APIPostUpdateResult, APIPostsBrowseQueryParams, APIPostsBrowseResult, APIProductBatchBody, APIProductBatchResult, APIProductCreateBody, APIProductCreateResult, APIProductDeleteQueryParams, APIProductDeleteResult, APIProductFiltersResult, APIProductGetByIdParams, APIProductGetByIdQueryParams, APIProductGetByIdResult, APIProductReviewCreateBody, APIProductReviewCreateResult, APIProductReviewsBrowseQueryParams, APIProductReviewsBrowseResult, APIProductUpdateBody, APIProductUpdateQueryParams, APIProductUpdateResult, APIProductsBrowseQueryParams, APIProductsBrowseResult, APISearchQueryParams, APISearchResult, APISocialsGetResult, APISubscriberCreateBody, APISubscriberCreateResult, APISubscriberDeleteResult, APIVariantCreateBody, APIVariantCreateResult, APIVariantGetByIdParams, APIVariantGetByIdQueryParams, APIVariantGetByIdResult, APIVariantUpdateBody, APIVariantUpdateResult, JSONContent };
package/dist/browser.d.ts CHANGED
@@ -1,2 +1 @@
1
- export { mountFeedbackToolbar } from './feedback-toolbar.js';
2
1
  export { startSandboxInspectors } from './sandbox-inspectors.js';
package/dist/browser.js CHANGED
@@ -1,5 +1,2 @@
1
- import{useEffect as T,useRef as B,useState as C}from"react";import{createRoot as Re}from"react-dom/client";import{Fragment as ke,jsx as i,jsxs as g}from"react/jsx-runtime";var V="yns-feedback-toolbar-root",ne={todo:"Open",in_progress:"In progress",done:"Resolved",wont_fix:"Won't fix"},Ae=()=>{if(typeof window>"u")return null;let e=(process.env.NEXT_PUBLIC_YNS_API_BASE??"").trim();if(e)return e.replace(/\/$/,"");let n=window.location.hostname,t=window.location.protocol;return n.endsWith(".yns.store")?`${t}//yns.store`:n.endsWith(".yns.cx")?`${t}//yns.cx`:window.location.origin},Le=e=>{if(e.id)return`#${CSS.escape(e.id)}`;let n=[],t=e;for(;t&&t.nodeType===Node.ELEMENT_NODE&&n.length<6;){let o=t.tagName.toLowerCase(),s=t.getAttribute("class");if(s){let l=s.split(/\s+/).filter(Boolean).slice(0,2).map(d=>`.${CSS.escape(d)}`).join("");o+=l}let a=t.parentElement,c=t.tagName;if(a){let l=Array.from(a.children).filter(d=>d.tagName===c);if(l.length>1){let d=l.indexOf(t)+1;o+=`:nth-of-type(${d})`}}n.unshift(o),t=a}return n.join(" > ")},Ie=["id","class","data-testid","aria-label","role","name","href","src"],K=e=>{let n=[];for(let t of Ie){let o=e.getAttribute(t);if(!o)continue;let s=o.length>80?`${o.slice(0,80)}\u2026`:o;n.push(` ${t}="${s.replace(/"/g,"&quot;")}"`)}return n.join("")},oe=e=>{let n=(e.textContent??"").replace(/\s+/g," ").trim();return n?n.length>100?`${n.slice(0,100)}\u2026`:n:""},Te=e=>{let n=[],t=e;for(;t&&t!==document.documentElement&&n.length<5;){let d=t.parentElement;if(!d)break;n.unshift(d),t=d}let o=[],s=0;for(let d of n){let m=" ".repeat(s);o.push(`${m}<${d.tagName.toLowerCase()}${K(d)}>`),s++}let a=" ".repeat(s),c=e.tagName.toLowerCase(),l=oe(e);if(o.push(`${a}<${c}${K(e)}>${l?`${l}</${c}>`:""} \u2190 TARGET`),!l){let d=" ".repeat(s+1),m=Array.from(e.children).slice(0,6);for(let v of m){let k=oe(v);o.push(`${d}<${v.tagName.toLowerCase()}${K(v)}>${k?`${k}</${v.tagName.toLowerCase()}>`:""}`)}e.children.length>6&&o.push(`${d}\u2026 (${e.children.length-6} more children)`),o.push(`${a}</${c}>`)}for(let d=n.length-1;d>=0;d--){let m=" ".repeat(d),v=n[d];v&&o.push(`${m}</${v.tagName.toLowerCase()}>`)}return o.join(`
2
- `)},ie=e=>{let n=e;for(;n;){if(n instanceof HTMLElement&&n.dataset.ynsFeedbackUi==="true")return!0;n=n.parentElement}return!1},$e=new Set(["HTML","HEAD","SCRIPT","STYLE","NOSCRIPT"]),Me=1e4,Ne=3e4,Fe=e=>typeof e=="object"&&e!==null&&"viewer"in e&&(e.viewer==="anonymous"||e.viewer==="non-member"||e.viewer==="member"),ze=e=>{let n=new Date(e),t=n.getTime()-Date.now(),o=n.toLocaleString(void 0,{weekday:"short",month:"short",day:"numeric",hour:"numeric",minute:"2-digit"});if(t<=0)return`Any moment now (estimated by ${o})`;let s=Math.ceil(t/6e4);if(s<60)return`~${s} minutes (by ${o})`;let a=Math.round(t/36e5);if(a<24)return`~${a} ${a===1?"hour":"hours"} (by ${o})`;let c=Math.round(t/864e5);return`~${c} ${c===1?"day":"days"} (by ${o})`};async function se(e,n){try{let t=await fetch(`${e}/api/auth/sign-out`,{method:"POST",credentials:"include"});t.ok||console.warn("[YNS Feedback Toolbar] sign-out responded non-OK",t.status)}catch(t){console.warn("[YNS Feedback Toolbar] sign-out fetch failed",t)}n()}function _e(){let[e,n]=C(null),[t,o]=C(!0),[s,a]=C(!1),[c,l]=C(null),[d,m]=C(null),[v,k]=C(!1),[E,w]=C(!1),p=B(null),y=B(()=>{});T(()=>{if(p.current=Ae(),!p.current){o(!1);return}let r=!1,f=null,b=0,S=null,A=null,P=()=>{S!==null&&(window.clearTimeout(S),S=null)},I=(F,N)=>{r||N<b||(A=F?.viewer??null,n(F),o(!1))},$=()=>{if(r)return;let F=A==="member"?Me:Ne;S=window.setTimeout(()=>{H()},F)},H=async()=>{if(r)return;f?.abort();let F=new AbortController;f=F;let N=++b;try{let _=await fetch(`${p.current}/api/feedback-comments?host=${encodeURIComponent(window.location.host)}`,{credentials:"include",signal:F.signal});if(r||N<b)return;if(_.status===404||!_.ok){I(null,N),$();return}let te=await _.json();if(r||N<b)return;if(!Fe(te)){I(null,N),$();return}I(te,N),$()}catch(_){if(_?.name==="AbortError"||r)return;I(null,N),$()}},Z=()=>{r||(P(),H())};y.current=Z;let ee=()=>{document.hidden?(f?.abort(),P()):Z()};return document.addEventListener("visibilitychange",ee),H(),()=>{r=!0,document.removeEventListener("visibilitychange",ee),f?.abort(),P(),y.current=()=>{}}},[]);let u=e?.viewer==="member"?e:null;T(()=>{!u||u.canComment||(a(!1),l(null),k(!1),m(null))},[u]),T(()=>{if(s)return document.body.style.cursor="crosshair",()=>{document.body.style.cursor=""}},[s]),T(()=>{if(!s)return;let r=document.createElement("div");r.dataset.ynsFeedbackUi="true",r.style.cssText=["position: fixed","pointer-events: none","z-index: 2147483644","border: 2px dashed #10b981","background: rgba(16, 185, 129, 0.08)","border-radius: 3px","display: none","transition: top 0.05s, left 0.05s, width 0.05s, height 0.05s"].join(";");let f=document.createElement("div");f.dataset.ynsFeedbackUi="true",f.textContent="Click to comment",f.style.cssText=["position: fixed","pointer-events: none","z-index: 2147483645","background: #059669","color: #fff","font-size: 11px","font-family: ui-sans-serif, system-ui, sans-serif","padding: 3px 8px","border-radius: 4px","white-space: nowrap","display: none","box-shadow: 0 2px 6px rgba(0,0,0,0.15)"].join(";"),document.documentElement.appendChild(r),document.documentElement.appendChild(f);let b=null,S=P=>{let I=document.elementFromPoint(P.clientX,P.clientY);if(!I||$e.has(I.tagName)||ie(I)){r.style.display="none",f.style.display="none",b=null;return}b=I,requestAnimationFrame(()=>{if(b!==I)return;let $=I.getBoundingClientRect();r.style.top=`${$.top}px`,r.style.left=`${$.left}px`,r.style.width=`${$.width}px`,r.style.height=`${$.height}px`,r.style.display="block",f.style.left=`${P.clientX+14}px`,f.style.top=`${P.clientY+14}px`,f.style.display="block"})},A=()=>{r.style.display="none",f.style.display="none",b=null};return document.addEventListener("mousemove",S,!0),document.addEventListener("mouseleave",A),()=>{document.removeEventListener("mousemove",S,!0),document.removeEventListener("mouseleave",A),r.remove(),f.remove()}},[s]),T(()=>{if(!s)return;let r=f=>{let b=f.target;if(!(b instanceof Element)||ie(b))return;f.preventDefault(),f.stopPropagation();let S=b.getBoundingClientRect(),A=S.width>0?(f.clientX-S.left)/S.width:.5,P=S.height>0?(f.clientY-S.top)/S.height:.5;l({cssSelector:Le(b),pagePath:window.location.pathname,surroundingHtml:Te(b),rect:{top:S.top+window.scrollY,left:S.left+window.scrollX,width:S.width,height:S.height},clickX:f.clientX+window.scrollX,clickY:f.clientY+window.scrollY,offsetXRatio:Math.min(1,Math.max(0,A)),offsetYRatio:Math.min(1,Math.max(0,P))}),a(!1)};return document.addEventListener("click",r,{capture:!0}),()=>document.removeEventListener("click",r,{capture:!0})},[s]);let h=()=>{y.current()},R=async(r,f)=>{!p.current||!u||!c||!(await fetch(`${p.current}/api/feedback-comments`,{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({feedbackSessionId:u.feedbackSessionId,content:r,pagePath:c.pagePath,cssSelector:c.cssSelector,surroundingHtml:c.surroundingHtml,offsetXRatio:c.offsetXRatio,offsetYRatio:c.offsetYRatio,...f.length>0?{attachments:f}:{}})})).ok||(l(null),a(!0),h())},z=async(r,f,b)=>{!p.current||!(await fetch(`${p.current}/api/feedback-comments/${r}`,{method:"PATCH",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({content:f,attachments:b})})).ok||(m(null),h())},W=async r=>{!p.current||!(await fetch(`${p.current}/api/feedback-comments/${r}`,{method:"DELETE",credentials:"include"})).ok||h()},Y=async(r,f)=>{!p.current||!(await fetch(`${p.current}/api/feedback-comments/${r}`,{method:"PATCH",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({status:f})})).ok||h()},X=async(r,f)=>{!p.current||!(await fetch(`${p.current}/api/feedback-comments/${r}/replies`,{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({content:f})})).ok||h()},x=async()=>{if(!(!p.current||!u)&&window.confirm(ct(u))){w(!0);try{let r=await fetch(`${p.current}/api/feedback-sessions/${u.feedbackSessionId}/finalize`,{method:"POST",credentials:"include"});if(!r.ok)return;let b=(await r.json().catch(()=>null))?.status??"extracting";n(S=>S?.viewer==="member"?{...S,canComment:!1,sessionStatus:b}:S)}finally{w(!1)}}},L=r=>{if(r.pagePath!==window.location.pathname){window.location.assign(r.pagePath);return}let f=null;try{f=document.querySelector(r.cssSelector)}catch{f=null}f&&(f.scrollIntoView({behavior:"smooth",block:"center"}),m(r.id))};if(t||!e)return null;if(e.viewer==="anonymous")return i(pt,{loginUrl:e.loginUrl});if(e.viewer==="non-member")return i(mt,{user:e.user,onSignOut:()=>{p.current&&se(p.current,()=>y.current())}});if(!u)return null;if(!u.canComment)return u.sessionStatus!=="extracting"&&u.sessionStatus!=="tasks_review"&&u.sessionStatus!=="processing"&&u.sessionStatus!=="in_review"?null:i("div",{"data-yns-feedback-ui":"true",children:i(Be,{progress:u.progress,eta:u.eta,status:u.sessionStatus,dashboardUrl:`${p.current??""}/feedback`})});let M=u.comments.filter(r=>r.pagePath===window.location.pathname&&r.status!=="done"&&r.status!=="wont_fix");return g("div",{"data-yns-feedback-ui":"true",children:[M.map((r,f)=>i(Oe,{pin:r,number:f+1,editing:d===r.id,feedbackSessionId:u.feedbackSessionId,apiBase:p.current,onStartEdit:()=>m(r.id),onCancelEdit:()=>m(null),onSave:(b,S)=>z(r.id,b,S),onRemove:()=>W(r.id),onReply:b=>X(r.id,b),onStatusChange:b=>Y(r.id,b)},r.id)),c&&i(Ue,{pending:c,feedbackSessionId:u.feedbackSessionId,apiBase:p.current,onCancel:()=>{l(null),a(!0)},onSave:(r,f)=>R(r,f)}),v&&i(De,{comments:u.comments,currentPath:window.location.pathname,onClose:()=>k(!1),onSelect:L}),g("div",{style:G,children:[i("button",{type:"button",onClick:()=>a(r=>!r),style:s?He:j,children:s?"Cancel":"Add comment"}),i("button",{type:"button",onClick:()=>k(r=>!r),style:Ve,children:v?"Hide list":`List (${u.comments.length})`}),i("button",{type:"button",onClick:x,disabled:E,style:Ke,children:E?"Finalizing\u2026":"Finalize"}),i("span",{style:J,children:s?"Click any element to comment":`${M.length} on this page`}),i(ut,{authors:u.authors,viewerId:u.user.id}),i(ft,{user:u.user,onSignOut:()=>{p.current&&se(p.current,()=>y.current())}})]})]})}function Be({progress:e,eta:n,status:t,dashboardUrl:o}){let[,s]=C(0);if(T(()=>{let d=window.setInterval(()=>s(m=>m+1),6e4);return()=>window.clearInterval(d)},[]),t==="extracting"||t==="tasks_review"){let d=t==="tasks_review";return g("div",{style:de,children:[i("style",{children:re}),g("div",{style:ce,children:[i(ae,{}),i("span",{style:ue,children:d?"Review":"Working"}),i("strong",{style:{fontSize:13},children:d?"Tasks ready to review":"Preparing tasks"})]}),i("p",{style:pe,children:d?"We turned your comments into tasks. Open your YNS dashboard to review them and start the changes.":"Turning each comment thread into a task. This only takes a moment."}),d&&o&&i("a",{href:o,target:"_blank",rel:"noreferrer",style:Nt,children:"Review tasks \u2192"})]})}let a=ze(n);return g("div",{style:de,children:[i("style",{children:re}),g("div",{style:ce,children:[i(ae,{}),i("span",{style:ue,children:"Submitted"}),i("strong",{style:{fontSize:13},children:t==="in_review"?"Feedback under review":"Applying feedback"})]}),g("div",{style:Tt,children:[i("span",{children:"Review progress"}),i("span",{style:{opacity:.7},children:e.label})]}),i("div",{style:$t,children:i("div",{style:{...Mt,width:`${e.fillPct}%`}})}),g("p",{style:pe,children:["Estimated delivery: ",i("span",{style:{fontWeight:600},children:a})]})]})}var re="@keyframes yns-feedback-spin { to { transform: rotate(360deg); } }";function ae({size:e=14}){return i("span",{"aria-hidden":!0,style:{display:"inline-block",width:e,height:e,border:"2px solid rgba(16, 185, 129, 0.25)",borderTopColor:"#10b981",borderRadius:999,animation:"yns-feedback-spin 0.9s linear infinite"}})}function le({comment:e,onReply:n,onStatusChange:t}){let[o,s]=C(""),[a,c]=C(!1),l=e.replies??[],d=async()=>{let m=o.trim();if(!(!m||a)){c(!0);try{await n(m),s("")}finally{c(!1)}}};return g("div",{style:Ft,children:[t&&g("div",{style:zt,children:[i("span",{style:_t,children:"Status"}),i("select",{value:e.status,onChange:m=>void t(m.target.value),style:Bt,children:Object.keys(ne).map(m=>i("option",{value:m,children:ne[m]},m))})]}),l.length>0&&i("div",{style:Ot,children:l.map(m=>g("div",{style:jt,children:[i("span",{style:Ut,children:m.authorKind==="system"?"System":m.author?.name||m.author?.email||"Reviewer"}),i("span",{style:Dt,children:m.content})]},m.id))}),g("div",{style:Wt,children:[i("textarea",{value:o,onChange:m=>s(m.target.value),placeholder:"Reply\u2026",rows:2,style:be,onKeyDown:m=>{m.key==="Enter"&&!m.shiftKey&&(m.preventDefault(),d())}}),i("button",{type:"button",onClick:()=>void d(),style:Se,disabled:a||!o.trim(),children:a?"\u2026":"Reply"})]})]})}function Oe({pin:e,number:n,editing:t,feedbackSessionId:o,apiBase:s,onStartEdit:a,onCancelEdit:c,onSave:l,onRemove:d,onReply:m,onStatusChange:v}){let k=Xe(e.cssSelector,e.offsetXRatio,e.offsetYRatio);if(!k)return null;let E=e.canMutate!==!1;return g("div",{style:{position:"absolute",top:k.top,left:k.left,zIndex:2147483600,pointerEvents:"auto"},children:[i("button",{type:"button",onClick:a,style:ge,title:e.content,children:n}),e.author&&i("span",{style:Qe,title:e.author.name||e.author.email,children:i(O,{user:e.author,size:16})}),t&&(E?i(fe,{initial:e.content,initialAttachments:e.attachments,feedbackSessionId:o,apiBase:s,onCancel:c,onSave:l,onRemove:d,thread:i(le,{comment:e,onReply:m,onStatusChange:v})}):i(je,{comment:e,onClose:c,thread:i(le,{comment:e,onReply:m})}))]})}function je({comment:e,onClose:n,thread:t}){return g("div",{style:ye,children:[e.author&&g("div",{style:Ze,children:[i(O,{user:e.author,size:20}),i("span",{style:et,children:e.author.name||e.author.email})]}),i("div",{style:tt,children:e.content}),e.attachments.length>0&&i("div",{style:ve,children:e.attachments.map(o=>i("a",{href:o.url,target:"_blank",rel:"noreferrer",style:we,children:i("img",{src:o.url,alt:"",style:xe})},o.url))}),t,g("div",{style:he,children:[i("span",{style:{flex:1,fontSize:12,color:"#6b7280"},children:"Only the author can edit"}),i("button",{type:"button",onClick:n,style:Q,children:"Close"})]})]})}function Ue({pending:e,feedbackSessionId:n,apiBase:t,onCancel:o,onSave:s}){return g(ke,{children:[i("div",{style:{position:"absolute",top:e.rect.top+e.rect.height*e.offsetYRatio-12,left:e.rect.left+e.rect.width*e.offsetXRatio-12,zIndex:2147483600,pointerEvents:"none"},children:i("div",{style:ge,children:"\u2022"})}),i("div",{style:{position:"absolute",top:e.clickY+10,left:e.clickX+10,zIndex:2147483647},children:i(fe,{initial:"",initialAttachments:[],feedbackSessionId:n,apiBase:t,onCancel:o,onSave:s})})]})}function De({comments:e,currentPath:n,onClose:t,onSelect:o}){let s=new Map;for(let c of e){let l=s.get(c.pagePath)??[];l.push(c),s.set(c.pagePath,l)}let a=Array.from(s.keys()).sort((c,l)=>c===n?-1:l===n?1:c.localeCompare(l));return g("div",{style:wt,children:[g("div",{style:xt,children:[g("strong",{style:{fontSize:14},children:["Comments (",e.length,")"]}),i("button",{type:"button",onClick:t,style:Q,children:"Close"})]}),i("div",{style:Ct,children:e.length===0?i("div",{style:kt,children:"No comments yet. Click \u201CAdd comment\u201D to leave one."}):a.map(c=>g("div",{style:{marginBottom:12},children:[i("div",{style:Et,children:c===n?`${c} \xB7 current`:c}),(s.get(c)??[]).map((l,d)=>g("button",{type:"button",onClick:()=>o(l),style:Pt,disabled:l.status==="done"&&!1,children:[i("span",{style:Rt,children:d+1}),g("span",{style:At,children:[l.author&&i("span",{style:Lt,children:l.author.name||l.author.email}),l.content.length>140?`${l.content.slice(0,140)}\u2026`:l.content]}),l.status==="done"&&i("span",{style:It,children:"done"})]},l.id))]},c))})]})}var q=5,We=5*1024*1024,Ye=e=>new Promise(n=>{let t=URL.createObjectURL(e),o=new window.Image;o.onload=()=>{URL.revokeObjectURL(t),n({width:o.naturalWidth,height:o.naturalHeight})},o.onerror=()=>{URL.revokeObjectURL(t),n(null)},o.src=t});function fe({initial:e,initialAttachments:n,feedbackSessionId:t,apiBase:o,onCancel:s,onSave:a,onRemove:c,thread:l}){let[d,m]=C(e),[v,k]=C(n),[E,w]=C(!1),[p,y]=C(!1),[u,h]=C(null),R=B(null),z=B(null);T(()=>{let x=R.current;if(!x)return;x.focus();let L=x.value.length;x.setSelectionRange(L,L)},[]);let W=async x=>{x.preventDefault();let L=d.trim();if(L){w(!0);try{await a(L,v)}finally{w(!1)}}},Y=async x=>{if(!x||x.length===0||!o)return;h(null);let L=q-v.length;if(L<=0){h(`Max ${q} images per comment`);return}let M=Array.from(x).slice(0,L);for(let r of M){if(!r.type.startsWith("image/")){h(`"${r.name}" is not an image`);return}if(r.size>We){h(`"${r.name}" exceeds 5 MB`);return}}y(!0);try{let r=await Promise.all(M.map(Ye)),f=new FormData;M.forEach((A,P)=>{f.append("file",A),f.append("width",r[P]?.width?String(r[P]?.width):""),f.append("height",r[P]?.height?String(r[P]?.height):"")});let b=await fetch(`${o}/api/feedback-comments/uploads?feedbackSessionId=${encodeURIComponent(t)}`,{method:"POST",credentials:"include",body:f});if(!b.ok){let A=await b.json().catch(()=>null);h(A?.error??"Upload failed");return}let S=await b.json();k(A=>[...A,...S.uploads])}catch{h("Upload failed")}finally{y(!1),z.current&&(z.current.value="")}},X=x=>{k(L=>L.filter(M=>M.url!==x))};return g("form",{onSubmit:W,style:ye,children:[i("textarea",{ref:R,value:d,onChange:x=>m(x.target.value),placeholder:"Leave a comment\u2026",style:be,rows:3}),v.length>0&&i("div",{style:ve,children:v.map(x=>g("div",{style:we,children:[i("img",{src:x.url,alt:"",style:xe}),i("button",{type:"button",onClick:()=>X(x.url),style:ot,disabled:E||p,"aria-label":"Remove attachment",children:"\xD7"})]},x.url))}),u&&i("div",{style:it,children:u}),i("input",{ref:z,type:"file",accept:"image/*",multiple:!0,onChange:x=>void Y(x.target.files),style:{display:"none"}}),g("div",{style:he,children:[c&&i("button",{type:"button",onClick:()=>c(),style:nt,disabled:E,children:"Delete"}),i("button",{type:"button",onClick:()=>z.current?.click(),style:st,disabled:E||p||v.length>=q,"aria-label":p?"Uploading\u2026":"Attach image",title:p?"Uploading\u2026":"Attach image",children:p?i(at,{}):i(rt,{})}),i("div",{style:{flex:1}}),i("button",{type:"button",onClick:s,style:Q,disabled:E,children:"Cancel"}),i("button",{type:"submit",style:Se,disabled:E||p||!d.trim(),children:E?"Saving\u2026":"Save"})]}),l]})}function Xe(e,n,t){let[o,s]=C(null);return T(()=>{let a=()=>{let l=null;try{l=document.querySelector(e)}catch{l=null}if(!l){s(null);return}let d=l.getBoundingClientRect();s({top:d.top+window.scrollY+d.height*t-12,left:d.left+window.scrollX+d.width*n-12})};a();let c=new ResizeObserver(a);try{let l=document.querySelector(e);l&&c.observe(l)}catch{}return window.addEventListener("scroll",a,!0),window.addEventListener("resize",a),()=>{c.disconnect(),window.removeEventListener("scroll",a,!0),window.removeEventListener("resize",a)}},[e,n,t]),o}var G={position:"fixed",bottom:16,left:"50%",transform:"translateX(-50%)",zIndex:2147483646,display:"flex",alignItems:"center",gap:8,padding:"8px 12px",background:"rgba(17, 17, 17, 0.92)",color:"white",borderRadius:999,boxShadow:"0 8px 24px rgba(0,0,0,0.25)",fontFamily:'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji"',fontSize:14,pointerEvents:"auto"},j={border:"none",background:"white",color:"#111",padding:"6px 12px",borderRadius:999,cursor:"pointer",fontWeight:600,fontSize:13},He={...j,background:"#ef4444",color:"white"},Ve={border:"1px solid rgba(255,255,255,0.4)",background:"transparent",color:"white",padding:"6px 12px",borderRadius:999,cursor:"pointer",fontWeight:500,fontSize:13},Ke={border:"none",background:"#10b981",color:"white",padding:"6px 12px",borderRadius:999,cursor:"pointer",fontWeight:600,fontSize:13},J={opacity:.8,fontSize:12},qe={display:"inline-flex",alignItems:"center",paddingLeft:4},Ge={marginLeft:-6,display:"inline-flex",borderRadius:999,boxShadow:"0 0 0 2px rgba(17, 17, 17, 0.92)"},Je={marginLeft:-2,padding:"0 6px",height:18,minWidth:18,borderRadius:999,background:"rgba(255,255,255,0.18)",color:"white",fontSize:10,fontWeight:600,display:"inline-flex",alignItems:"center",justifyContent:"center"},ge={width:24,height:24,borderRadius:999,background:"#10b981",color:"white",border:"2px solid white",cursor:"pointer",fontSize:12,fontWeight:700,boxShadow:"0 2px 6px rgba(0,0,0,0.3)",display:"inline-flex",alignItems:"center",justifyContent:"center",padding:0},Qe={position:"absolute",bottom:-6,right:-6,width:20,height:20,borderRadius:999,border:"2px solid white",background:"#111",display:"inline-flex",alignItems:"center",justifyContent:"center",boxShadow:"0 1px 3px rgba(0,0,0,0.3)",pointerEvents:"none"},Ze={display:"flex",alignItems:"center",gap:8},et={fontSize:13,fontWeight:600,color:"#111"},tt={fontSize:14,color:"#111",whiteSpace:"pre-wrap",wordBreak:"break-word"},ye={background:"white",border:"1px solid #e5e7eb",borderRadius:8,padding:12,width:280,boxShadow:"0 12px 32px rgba(0,0,0,0.18)",fontFamily:'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji"',display:"flex",flexDirection:"column",gap:8,color:"#111"},be={width:"100%",border:"1px solid #d1d5db",borderRadius:6,padding:8,fontSize:14,resize:"vertical",fontFamily:"inherit",color:"#111",background:"white",boxSizing:"border-box"},he={display:"flex",alignItems:"center",gap:6},U={border:"1px solid transparent",borderRadius:6,padding:"6px 10px",fontSize:13,cursor:"pointer",fontWeight:500},Se={...U,background:"#111",color:"white"},Q={...U,background:"transparent",color:"#374151",borderColor:"#d1d5db"},nt={...U,background:"transparent",color:"#b91c1c",borderColor:"#fecaca"},ve={display:"flex",flexWrap:"wrap",gap:6},we={position:"relative",width:56,height:56,borderRadius:6,overflow:"hidden",border:"1px solid #e5e7eb",background:"#f9fafb"},xe={width:"100%",height:"100%",objectFit:"cover",display:"block"},ot={position:"absolute",top:2,right:2,width:18,height:18,borderRadius:999,border:"none",background:"rgba(17, 17, 17, 0.85)",color:"white",fontSize:13,lineHeight:"16px",cursor:"pointer",padding:0,display:"inline-flex",alignItems:"center",justifyContent:"center"},it={color:"#b91c1c",fontSize:12,margin:0},st={...U,background:"transparent",color:"#374151",borderColor:"#d1d5db",width:30,height:30,padding:0,display:"inline-flex",alignItems:"center",justifyContent:"center",flexShrink:0};function rt(){return g("svg",{role:"img","aria-label":"Attach image",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[i("title",{children:"Attach image"}),i("path",{d:"m21.44 11.05-9.19 9.19a6 6 0 0 1-8.49-8.49l8.57-8.57A4 4 0 1 1 17.93 8.83l-8.59 8.57a2 2 0 0 1-2.83-2.83l8.49-8.48"})]})}function at(){return g(ke,{children:[i("style",{children:"@keyframes yns-attach-spin { to { transform: rotate(360deg); } }"}),i("span",{"aria-hidden":!0,style:{display:"inline-block",width:12,height:12,border:"2px solid rgba(55, 65, 81, 0.25)",borderTopColor:"#374151",borderRadius:999,animation:"yns-attach-spin 0.9s linear infinite"}})]})}var lt=480;function Ce(){let[e,n]=C(!1);return T(()=>{let t=window.matchMedia(`(max-width: ${lt}px)`),o=()=>n(t.matches);return o(),t.addEventListener("change",o),()=>t.removeEventListener("change",o)},[]),e}var dt=e=>{let n=e.name?.trim();return n?n.split(/\s+/).filter(Boolean).slice(0,2).map(o=>o[0]?.toUpperCase()??"").join(""):e.email[0]?.toUpperCase()??"?"};function O({user:e,size:n=22}){return e.image?i("img",{src:e.image,alt:"",width:n,height:n,style:{width:n,height:n,borderRadius:999,objectFit:"cover",display:"block",flexShrink:0}}):i("span",{"aria-hidden":!0,style:{width:n,height:n,borderRadius:999,background:"rgba(255,255,255,0.18)",color:"white",display:"inline-flex",alignItems:"center",justifyContent:"center",fontSize:Math.max(10,Math.round(n*.45)),fontWeight:600,flexShrink:0},children:dt(e)})}function ct(e){let n=e.authors??[],t=e.anonymousCount??0,o=e.commentTotal;if(o===0)return"Finalize this feedback session with zero comments? It will be canceled instead of submitted.";if(n.length===0&&t===0)return`Finalize this feedback session with ${o} comment${o===1?"":"s"}? You won't be able to add more.`;let s=n.length+(t>0?1:0),a=n.map(l=>l.name||l.email);t>0&&a.push(`${t} anonymous`);let c=a.length===1?a[0]:`${a.slice(0,-1).join(", ")} and ${a.at(-1)}`;return`Submit ${o} comment${o===1?"":"s"} from ${s} reviewer${s===1?"":"s"} (${c})?
3
-
4
- This sends ALL comments \u2014 including those from other reviewers \u2014 for AI processing. You won't be able to add more comments after finalizing.`}function ut({authors:e,viewerId:n}){if(!e||e.length===0)return null;let t=e.filter(a=>a.id!==n);if(t.length===0)return null;let o=t.slice(0,3),s=t.length-o.length;return g("div",{style:qe,title:`Also commenting: ${t.map(a=>`${a.name||a.email} (${a.commentCount})`).join(", ")}`,children:[o.map(a=>i("span",{style:Ge,children:i(O,{user:a,size:18})},a.id)),s>0&&g("span",{style:Je,children:["+",s]})]})}function pt({loginUrl:e}){return i("div",{"data-yns-feedback-ui":"true",children:g("div",{style:G,children:[i("span",{style:J,children:"Log in to provide feedback"}),i("button",{type:"button",onClick:()=>window.location.assign(e),style:j,children:"Log in"})]})})}function mt({user:e,onSignOut:n}){let t=Ce();return i("div",{"data-yns-feedback-ui":"true",children:g("div",{style:G,children:[i(O,{user:e}),!t&&i("span",{style:gt,children:e.email}),i("span",{style:J,children:"You don't have access to this store"}),i("button",{type:"button",onClick:n,style:j,children:"Sign out"})]})})}function ft({user:e,onSignOut:n}){let[t,o]=C(!1),s=B(null),a=Ce();T(()=>{if(!t)return;let d=m=>{s.current&&(m.target instanceof Node&&s.current.contains(m.target)||o(!1))};return document.addEventListener("mousedown",d),()=>document.removeEventListener("mousedown",d)},[t]);let c=e.name?.trim()||e.email,l=c.length>16?`${c.slice(0,16)}\u2026`:c;return g("div",{ref:s,style:{position:"relative"},children:[g("button",{type:"button",onClick:()=>o(d=>!d),style:yt,"aria-haspopup":"menu","aria-expanded":t,title:c,children:[i(O,{user:e,size:20}),!a&&i("span",{style:bt,children:l}),i("span",{"aria-hidden":!0,style:ht,children:"\u25BE"})]}),t&&i("div",{role:"menu",style:St,children:i("button",{type:"button",role:"menuitem",onClick:()=>{o(!1),n()},style:vt,children:"Sign out"})})]})}var gt={fontSize:13,color:"white",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",maxWidth:200},yt={display:"inline-flex",alignItems:"center",gap:6,background:"rgba(255,255,255,0.08)",border:"1px solid rgba(255,255,255,0.16)",color:"white",padding:"4px 8px 4px 4px",borderRadius:999,cursor:"pointer",fontSize:12,fontWeight:500,fontFamily:"inherit"},bt={maxWidth:"16ch",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},ht={opacity:.7,fontSize:10},St={position:"absolute",right:0,bottom:"calc(100% + 8px)",background:"white",color:"#111",border:"1px solid #e5e7eb",borderRadius:8,boxShadow:"0 12px 32px rgba(0,0,0,0.18)",minWidth:140,padding:4,zIndex:2147483647},vt={display:"block",width:"100%",textAlign:"left",background:"transparent",border:"none",padding:"6px 10px",fontSize:13,color:"#111",cursor:"pointer",borderRadius:6},wt={position:"fixed",top:0,right:0,bottom:0,width:360,maxWidth:"92vw",background:"white",borderLeft:"1px solid #e5e7eb",boxShadow:"-12px 0 32px rgba(0,0,0,0.12)",zIndex:2147483646,display:"flex",flexDirection:"column",fontFamily:'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji"',color:"#111"},xt={display:"flex",alignItems:"center",justifyContent:"space-between",padding:"12px 16px",borderBottom:"1px solid #e5e7eb"},Ct={flex:1,overflow:"auto",padding:"12px 12px 24px"},kt={color:"#6b7280",fontSize:13,padding:"24px 8px",textAlign:"center"},Et={fontSize:11,textTransform:"uppercase",letterSpacing:.5,color:"#6b7280",padding:"4px 4px 6px",wordBreak:"break-all"},Pt={display:"flex",alignItems:"flex-start",gap:8,width:"100%",textAlign:"left",background:"white",border:"1px solid #e5e7eb",borderRadius:6,padding:"8px 10px",cursor:"pointer",fontSize:13,marginBottom:6,color:"#111"},Rt={flexShrink:0,width:22,height:22,borderRadius:999,background:"#10b981",color:"white",fontWeight:700,fontSize:11,display:"inline-flex",alignItems:"center",justifyContent:"center"},At={flex:1,whiteSpace:"pre-wrap",wordBreak:"break-word"},Lt={display:"block",fontSize:11,fontWeight:600,color:"#6b7280",marginBottom:2},It={flexShrink:0,background:"#d1fae5",color:"#065f46",fontSize:11,fontWeight:600,padding:"2px 6px",borderRadius:4,alignSelf:"center"},de={position:"fixed",bottom:16,left:"50%",transform:"translateX(-50%)",zIndex:2147483646,display:"flex",flexDirection:"column",gap:8,padding:"12px 16px",width:"min(420px, calc(100vw - 32px))",background:"white",border:"1px solid #e5e7eb",borderRadius:12,boxShadow:"0 12px 32px rgba(0,0,0,0.18)",fontFamily:'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji"',color:"#111",pointerEvents:"auto"},ce={display:"flex",alignItems:"center",gap:8},ue={background:"#d1fae5",color:"#065f46",fontSize:11,fontWeight:700,padding:"2px 8px",borderRadius:999,textTransform:"uppercase",letterSpacing:.5},Tt={display:"flex",justifyContent:"space-between",fontSize:12},$t={width:"100%",height:6,background:"#f3f4f6",borderRadius:999,overflow:"hidden"},Mt={height:"100%",background:"#10b981",borderRadius:999,transition:"width 500ms"},pe={margin:0,fontSize:12,color:"#6b7280"},Nt={alignSelf:"flex-start",fontSize:13,fontWeight:600,color:"#059669",textDecoration:"none"},Ft={display:"flex",flexDirection:"column",gap:8,borderTop:"1px solid #e5e7eb",paddingTop:8,marginTop:2},zt={display:"flex",alignItems:"center",gap:8},_t={fontSize:12,fontWeight:600,color:"#6b7280"},Bt={flex:1,border:"1px solid #d1d5db",borderRadius:6,padding:"4px 8px",fontSize:13,color:"#111",background:"white",fontFamily:"inherit"},Ot={display:"flex",flexDirection:"column",gap:6,maxHeight:160,overflowY:"auto"},jt={display:"flex",flexDirection:"column",gap:1,borderLeft:"2px solid #e5e7eb",paddingLeft:8},Ut={fontSize:11,fontWeight:600,color:"#6b7280"},Dt={fontSize:13,color:"#111",whiteSpace:"pre-wrap",wordBreak:"break-word"},Wt={display:"flex",alignItems:"flex-end",gap:6};function me(){if(console.log("[YNS Feedback Toolbar] mountFeedbackToolbar() called",{isWindow:typeof window<"u",vercelEnv:process.env.NEXT_PUBLIC_VERCEL_ENV,alreadyMounted:typeof document<"u"&&!!document.getElementById(V)}),typeof window>"u")return null;if(process.env.NEXT_PUBLIC_VERCEL_ENV!=="preview")return console.log("[YNS Feedback Toolbar] gate failed \u2014 NEXT_PUBLIC_VERCEL_ENV is",process.env.NEXT_PUBLIC_VERCEL_ENV),null;if(document.getElementById(V))return null;let e=document.createElement("div");e.id=V,e.dataset.ynsFeedbackUi="true",document.body.appendChild(e);let n=Re(e);return n.render(i(_e,{})),{unmount:()=>{n.unmount(),e.remove()}}}typeof window<"u"&&console.log("[YNS Feedback Toolbar] module evaluated",{vercelEnv:process.env.NEXT_PUBLIC_VERCEL_ENV,readyState:document.readyState,willAutoMount:process.env.NEXT_PUBLIC_VERCEL_ENV==="preview"});typeof window<"u"&&process.env.NEXT_PUBLIC_VERCEL_ENV==="preview"&&(document.readyState==="loading"?document.addEventListener("DOMContentLoaded",()=>{me()}):me());function Ee(){typeof window>"u"||(console.log("[YNS Sandbox Inspectors] module evaluated"),Ht(),Vt())}Ee();var Yt=new Set(["HEAD","SCRIPT","STYLE","NOSCRIPT","HTML"]);function Xt(e){if(e.id)return`${e.tagName.toLowerCase()}#${CSS.escape(e.id)}`;let n=[],t=e;for(;t&&t!==document.body&&t!==document.documentElement;){let o=t.tagName.toLowerCase();if(t.id){n.unshift(`${o}#${CSS.escape(t.id)}`);break}let s=Array.from(t.classList).filter(l=>!l.startsWith("data-yns-"));s.length>0&&(o+=`.${s.map(l=>CSS.escape(l)).join(".")}`);let a=t.parentElement,c=t.tagName;if(a&&Array.from(a.children).filter(d=>d.tagName===c&&(s.length===0||s.every(m=>d.classList.contains(m)))).length>1){let d=Array.from(a.children).indexOf(t)+1;o+=`:nth-child(${d})`}n.unshift(o),t=t.parentElement}return n.join(" > ")}function Pe(e,n){let t=e.getBoundingClientRect(),o=window.getComputedStyle(e),s=(e.textContent??"").trim();return{tag:e.tagName.toLowerCase(),id:e.id||void 0,classes:Array.from(e.classList).filter(a=>!a.startsWith("data-yns-")),textContent:s.length>n?`${s.slice(0,n)}\u2026`:s,cssSelector:Xt(e),boundingRect:{top:t.top,left:t.left,width:t.width,height:t.height},computedStyles:{color:o.color,backgroundColor:o.backgroundColor,fontSize:o.fontSize,fontFamily:o.fontFamily,padding:o.padding,margin:o.margin}}}function D(e,n){if(!e?.tagName||Yt.has(e.tagName))return!0;for(let t of n)if(e.hasAttribute?.(t))return!0;return!1}function Ht(){let e=!1,n=null,t=null,o=document.createElement("div");o.setAttribute("data-yns-design-overlay","hover"),o.style.cssText=["position: fixed","pointer-events: none","z-index: 2147483646","border: 2px solid #3b82f6","background: rgba(59, 130, 246, 0.08)","border-radius: 3px","display: none","transition: top 0.05s, left 0.05s, width 0.05s, height 0.05s"].join(";");let s=document.createElement("div");s.setAttribute("data-yns-design-overlay","label"),s.style.cssText=["position: fixed","pointer-events: none","z-index: 2147483647","background: #3b82f6","color: #fff","font-size: 11px","font-family: ui-monospace, monospace","padding: 2px 6px","border-radius: 3px","white-space: nowrap","display: none"].join(";"),document.documentElement.appendChild(o),document.documentElement.appendChild(s);let a=document.createElement("style");a.setAttribute("data-yns-design-overlay","style"),a.textContent="[data-yns-selected] { outline: 2px solid #3b82f6 !important; outline-offset: 1px; }",document.head.appendChild(a);function c(w){let p=w.getBoundingClientRect();o.style.top=`${p.top}px`,o.style.left=`${p.left}px`,o.style.width=`${p.width}px`,o.style.height=`${p.height}px`,o.style.display="block";let y=Array.from(w.classList).filter(h=>!h.startsWith("data-yns-")),u=w.tagName.toLowerCase()+(y.length?`.${y[0]}`:"");s.textContent=u,s.style.left=`${p.left}px`,s.style.top=`${Math.max(0,p.top-22)}px`,s.style.display="block"}let l=w=>{let p=document.elementFromPoint(w.clientX,w.clientY);if(D(p,["data-yns-design-overlay"])){o.style.display="none",s.style.display="none",n=null;return}n=p,requestAnimationFrame(()=>{n===p&&e&&p&&c(p)})},d=()=>{o.style.display="none",s.style.display="none",n=null},m=w=>{if(!e||!n)return;w.preventDefault(),w.stopPropagation(),w.stopImmediatePropagation();let p=n;if(D(p,["data-yns-design-overlay"]))return;let y=Pe(p,120),u=y.cssSelector;t&&t.el.removeAttribute("data-yns-selected"),t&&t.cssSelector===u?(t=null,window.parent.postMessage({type:"element-deselected",data:y},"*")):(t={el:p,cssSelector:u},p.setAttribute("data-yns-selected",""),window.parent.postMessage({type:"element-selected",data:y},"*"))},v=w=>{w.key==="Escape"&&e&&(E(),window.parent.postMessage({type:"design-mode-cleared"},"*"))};function k(){e=!0,document.addEventListener("mousemove",l,!0),document.addEventListener("mouseleave",d),document.addEventListener("click",m,!0),document.addEventListener("keydown",v,!0)}function E(){e=!1,document.removeEventListener("mousemove",l,!0),document.removeEventListener("mouseleave",d),document.removeEventListener("click",m,!0),document.removeEventListener("keydown",v,!0),o.style.display="none",s.style.display="none",n=null,t&&(t.el.removeAttribute("data-yns-selected"),t=null)}window.addEventListener("message",w=>{let p=w.data;!p||typeof p!="object"||(p.type==="design-mode-toggle"&&(p.enabled?k():(E(),window.parent.postMessage({type:"design-mode-cleared"},"*"))),p.type==="design-mode-deselect"&&t&&(t.el.removeAttribute("data-yns-selected"),t=null))})}function Vt(){let e=!1,n=null,t=[],o=document.createElement("div");o.setAttribute("data-yns-comment-overlay","hover"),o.style.cssText=["position: fixed","pointer-events: none","z-index: 2147483644","border: 2px dashed #10b981","background: rgba(16, 185, 129, 0.06)","border-radius: 3px","display: none","transition: top 0.05s, left 0.05s, width 0.05s, height 0.05s"].join(";");let s=document.createElement("div");s.setAttribute("data-yns-comment-overlay","cursor-label"),s.textContent="Click to comment",s.style.cssText=["position: fixed","pointer-events: none","z-index: 2147483645","background: #059669","color: #fff","font-size: 11px","font-family: ui-sans-serif, system-ui, sans-serif","padding: 3px 8px","border-radius: 4px","white-space: nowrap","display: none","box-shadow: 0 2px 6px rgba(0,0,0,0.15)"].join(";");let a=document.createElement("div");a.setAttribute("data-yns-comment-overlay","pins"),a.style.cssText="position: fixed; top: 0; left: 0; width: 100%; height: 100%; pointer-events: none; z-index: 2147483643;",document.documentElement.appendChild(o),document.documentElement.appendChild(s),document.documentElement.appendChild(a);function c(){a.innerHTML="";for(let y of t){let u=null;try{u=document.querySelector(y.selector)}catch{u=null}if(!u)continue;let h=u.getBoundingClientRect(),R=document.createElement("div");R.style.cssText=["position: fixed",`top: ${h.top-12}px`,`left: ${h.left+h.width/2-12}px`,"width: 24px","height: 24px","border-radius: 50%","background: #059669","color: #fff","display: flex","align-items: center","justify-content: center","font-size: 12px","font-weight: 600","font-family: ui-sans-serif, system-ui, sans-serif","box-shadow: 0 2px 8px rgba(0,0,0,0.2)","pointer-events: none"].join(";"),R.textContent=String(y.number),a.appendChild(R)}}let l=y=>{let u=document.elementFromPoint(y.clientX,y.clientY);if(D(u,["data-yns-comment-overlay","data-yns-design-overlay"])){o.style.display="none",s.style.display="none",n=null;return}n=u,requestAnimationFrame(()=>{if(n===u&&e&&u){let h=u.getBoundingClientRect();o.style.top=`${h.top}px`,o.style.left=`${h.left}px`,o.style.width=`${h.width}px`,o.style.height=`${h.height}px`,o.style.display="block",s.style.left=`${y.clientX+14}px`,s.style.top=`${y.clientY+14}px`,s.style.display="block"}})},d=()=>{o.style.display="none",s.style.display="none",n=null},m=y=>{if(!e||!n)return;y.preventDefault(),y.stopPropagation(),y.stopImmediatePropagation();let u=n;if(D(u,["data-yns-comment-overlay","data-yns-design-overlay"]))return;let h=Pe(u,200),R=u.getBoundingClientRect();window.parent.postMessage({type:"comment-click",data:{element:h,clickPosition:{x:y.clientX,y:y.clientY},elementRect:{top:R.top,left:R.left,width:R.width,height:R.height},pagePath:window.location.pathname}},"*")},v=y=>{y.key==="Escape"&&e&&(E(),window.parent.postMessage({type:"comment-mode-cleared"},"*"))};function k(){e=!0,document.body.style.cursor="crosshair",document.addEventListener("mousemove",l,!0),document.addEventListener("mouseleave",d),document.addEventListener("click",m,!0),document.addEventListener("keydown",v,!0)}function E(){e=!1,document.body.style.cursor="",document.removeEventListener("mousemove",l,!0),document.removeEventListener("mouseleave",d),document.removeEventListener("click",m,!0),document.removeEventListener("keydown",v,!0),o.style.display="none",s.style.display="none",n=null}let w=!1,p=()=>{w||(w=!0,requestAnimationFrame(()=>{w=!1,c()}))};window.addEventListener("scroll",p,{passive:!0}),window.addEventListener("resize",p,{passive:!0}),window.addEventListener("message",y=>{let u=y.data;!u||typeof u!="object"||(u.type==="comment-mode-toggle"&&(u.enabled?k():E()),u.type==="comment-pins-update"&&(t=u.pins??[],c()),u.type==="comment-pin-remove"&&(t=t.filter(h=>h.id!==u.pinId),c()))})}export{me as mountFeedbackToolbar,Ee as startSandboxInspectors};
1
+ function x(){typeof window>"u"||(console.log("[YNS Sandbox Inspectors] module evaluated"),L(),S())}x();var w=new Set(["HEAD","SCRIPT","STYLE","NOSCRIPT","HTML"]);function C(o){if(o.id)return`${o.tagName.toLowerCase()}#${CSS.escape(o.id)}`;let l=[],e=o;for(;e&&e!==document.body&&e!==document.documentElement;){let t=e.tagName.toLowerCase();if(e.id){l.unshift(`${t}#${CSS.escape(e.id)}`);break}let n=Array.from(e.classList).filter(u=>!u.startsWith("data-yns-"));n.length>0&&(t+=`.${n.map(u=>CSS.escape(u)).join(".")}`);let a=e.parentElement,f=e.tagName;if(a&&Array.from(a.children).filter(m=>m.tagName===f&&(n.length===0||n.every(y=>m.classList.contains(y)))).length>1){let m=Array.from(a.children).indexOf(e)+1;t+=`:nth-child(${m})`}l.unshift(t),e=e.parentElement}return l.join(" > ")}function E(o,l){let e=o.getBoundingClientRect(),t=window.getComputedStyle(o),n=(o.textContent??"").trim();return{tag:o.tagName.toLowerCase(),id:o.id||void 0,classes:Array.from(o.classList).filter(a=>!a.startsWith("data-yns-")),textContent:n.length>l?`${n.slice(0,l)}\u2026`:n,cssSelector:C(o),boundingRect:{top:e.top,left:e.left,width:e.width,height:e.height},computedStyles:{color:t.color,backgroundColor:t.backgroundColor,fontSize:t.fontSize,fontFamily:t.fontFamily,padding:t.padding,margin:t.margin}}}function v(o,l){if(!o?.tagName||w.has(o.tagName))return!0;for(let e of l)if(o.hasAttribute?.(e))return!0;return!1}function L(){let o=!1,l=null,e=null,t=document.createElement("div");t.setAttribute("data-yns-design-overlay","hover"),t.style.cssText=["position: fixed","pointer-events: none","z-index: 2147483646","border: 2px solid #3b82f6","background: rgba(59, 130, 246, 0.08)","border-radius: 3px","display: none","transition: top 0.05s, left 0.05s, width 0.05s, height 0.05s"].join(";");let n=document.createElement("div");n.setAttribute("data-yns-design-overlay","label"),n.style.cssText=["position: fixed","pointer-events: none","z-index: 2147483647","background: #3b82f6","color: #fff","font-size: 11px","font-family: ui-monospace, monospace","padding: 2px 6px","border-radius: 3px","white-space: nowrap","display: none"].join(";"),document.documentElement.appendChild(t),document.documentElement.appendChild(n);let a=document.createElement("style");a.setAttribute("data-yns-design-overlay","style"),a.textContent="[data-yns-selected] { outline: 2px solid #3b82f6 !important; outline-offset: 1px; }",document.head.appendChild(a);function f(d){let i=d.getBoundingClientRect();t.style.top=`${i.top}px`,t.style.left=`${i.left}px`,t.style.width=`${i.width}px`,t.style.height=`${i.height}px`,t.style.display="block";let r=Array.from(d.classList).filter(c=>!c.startsWith("data-yns-")),s=d.tagName.toLowerCase()+(r.length?`.${r[0]}`:"");n.textContent=s,n.style.left=`${i.left}px`,n.style.top=`${Math.max(0,i.top-22)}px`,n.style.display="block"}let u=d=>{let i=document.elementFromPoint(d.clientX,d.clientY);if(v(i,["data-yns-design-overlay"])){t.style.display="none",n.style.display="none",l=null;return}l=i,requestAnimationFrame(()=>{l===i&&o&&i&&f(i)})},m=()=>{t.style.display="none",n.style.display="none",l=null},y=d=>{if(!o||!l)return;d.preventDefault(),d.stopPropagation(),d.stopImmediatePropagation();let i=l;if(v(i,["data-yns-design-overlay"]))return;let r=E(i,120),s=r.cssSelector;e&&e.el.removeAttribute("data-yns-selected"),e&&e.cssSelector===s?(e=null,window.parent.postMessage({type:"element-deselected",data:r},"*")):(e={el:i,cssSelector:s},i.setAttribute("data-yns-selected",""),window.parent.postMessage({type:"element-selected",data:r},"*"))},g=d=>{d.key==="Escape"&&o&&(h(),window.parent.postMessage({type:"design-mode-cleared"},"*"))};function b(){o=!0,document.addEventListener("mousemove",u,!0),document.addEventListener("mouseleave",m),document.addEventListener("click",y,!0),document.addEventListener("keydown",g,!0)}function h(){o=!1,document.removeEventListener("mousemove",u,!0),document.removeEventListener("mouseleave",m),document.removeEventListener("click",y,!0),document.removeEventListener("keydown",g,!0),t.style.display="none",n.style.display="none",l=null,e&&(e.el.removeAttribute("data-yns-selected"),e=null)}window.addEventListener("message",d=>{let i=d.data;!i||typeof i!="object"||(i.type==="design-mode-toggle"&&(i.enabled?b():(h(),window.parent.postMessage({type:"design-mode-cleared"},"*"))),i.type==="design-mode-deselect"&&e&&(e.el.removeAttribute("data-yns-selected"),e=null))})}function S(){let o=!1,l=null,e=[],t=document.createElement("div");t.setAttribute("data-yns-comment-overlay","hover"),t.style.cssText=["position: fixed","pointer-events: none","z-index: 2147483644","border: 2px dashed #10b981","background: rgba(16, 185, 129, 0.06)","border-radius: 3px","display: none","transition: top 0.05s, left 0.05s, width 0.05s, height 0.05s"].join(";");let n=document.createElement("div");n.setAttribute("data-yns-comment-overlay","cursor-label"),n.textContent="Click to comment",n.style.cssText=["position: fixed","pointer-events: none","z-index: 2147483645","background: #059669","color: #fff","font-size: 11px","font-family: ui-sans-serif, system-ui, sans-serif","padding: 3px 8px","border-radius: 4px","white-space: nowrap","display: none","box-shadow: 0 2px 6px rgba(0,0,0,0.15)"].join(";");let a=document.createElement("div");a.setAttribute("data-yns-comment-overlay","pins"),a.style.cssText="position: fixed; top: 0; left: 0; width: 100%; height: 100%; pointer-events: none; z-index: 2147483643;",document.documentElement.appendChild(t),document.documentElement.appendChild(n),document.documentElement.appendChild(a);function f(){a.innerHTML="";for(let r of e){let s=null;try{s=document.querySelector(r.selector)}catch{s=null}if(!s)continue;let c=s.getBoundingClientRect(),p=document.createElement("div");p.style.cssText=["position: fixed",`top: ${c.top-12}px`,`left: ${c.left+c.width/2-12}px`,"width: 24px","height: 24px","border-radius: 50%","background: #059669","color: #fff","display: flex","align-items: center","justify-content: center","font-size: 12px","font-weight: 600","font-family: ui-sans-serif, system-ui, sans-serif","box-shadow: 0 2px 8px rgba(0,0,0,0.2)","pointer-events: none"].join(";"),p.textContent=String(r.number),a.appendChild(p)}}let u=r=>{let s=document.elementFromPoint(r.clientX,r.clientY);if(v(s,["data-yns-comment-overlay","data-yns-design-overlay"])){t.style.display="none",n.style.display="none",l=null;return}l=s,requestAnimationFrame(()=>{if(l===s&&o&&s){let c=s.getBoundingClientRect();t.style.top=`${c.top}px`,t.style.left=`${c.left}px`,t.style.width=`${c.width}px`,t.style.height=`${c.height}px`,t.style.display="block",n.style.left=`${r.clientX+14}px`,n.style.top=`${r.clientY+14}px`,n.style.display="block"}})},m=()=>{t.style.display="none",n.style.display="none",l=null},y=r=>{if(!o||!l)return;r.preventDefault(),r.stopPropagation(),r.stopImmediatePropagation();let s=l;if(v(s,["data-yns-comment-overlay","data-yns-design-overlay"]))return;let c=E(s,200),p=s.getBoundingClientRect();window.parent.postMessage({type:"comment-click",data:{element:c,clickPosition:{x:r.clientX,y:r.clientY},elementRect:{top:p.top,left:p.left,width:p.width,height:p.height},pagePath:window.location.pathname}},"*")},g=r=>{r.key==="Escape"&&o&&(h(),window.parent.postMessage({type:"comment-mode-cleared"},"*"))};function b(){o=!0,document.body.style.cursor="crosshair",document.addEventListener("mousemove",u,!0),document.addEventListener("mouseleave",m),document.addEventListener("click",y,!0),document.addEventListener("keydown",g,!0)}function h(){o=!1,document.body.style.cursor="",document.removeEventListener("mousemove",u,!0),document.removeEventListener("mouseleave",m),document.removeEventListener("click",y,!0),document.removeEventListener("keydown",g,!0),t.style.display="none",n.style.display="none",l=null}let d=!1,i=()=>{d||(d=!0,requestAnimationFrame(()=>{d=!1,f()}))};window.addEventListener("scroll",i,{passive:!0}),window.addEventListener("resize",i,{passive:!0}),window.addEventListener("message",r=>{let s=r.data;!s||typeof s!="object"||(s.type==="comment-mode-toggle"&&(s.enabled?b():h()),s.type==="comment-pins-update"&&(e=s.pins??[],f()),s.type==="comment-pin-remove"&&(e=e.filter(c=>c.id!==s.pinId),f()))})}export{x as startSandboxInspectors};
5
2
  //# sourceMappingURL=browser.js.map