@uibot/page-annotation 0.7.0 → 0.9.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/{SOURCE.md → README.md} +17 -15
- package/dist/{vendor → core}/composer.d.ts +1 -1
- package/dist/{vendor → core}/geometry.d.ts +1 -1
- package/dist/core/index.d.ts +10 -0
- package/dist/core/inject.d.ts +1 -0
- package/dist/{vendor → core}/marks.d.ts +23 -23
- package/dist/{vendor → core}/model.d.ts +18 -18
- package/dist/{vendor → core}/normalize.d.ts +1 -1
- package/dist/{vendor → core}/runtime/capture.d.ts +2 -2
- package/dist/core/runtime/entry.d.ts +3 -0
- package/dist/{vendor → core}/runtime/in-page-host.d.ts +1 -1
- package/dist/core/runtime/index.d.ts +10 -0
- package/dist/{vendor → core}/runtime/overlay-marks.d.ts +1 -1
- package/dist/{vendor → core}/runtime/overlay.d.ts +2 -2
- package/dist/{vendor → core}/runtime/performance.d.ts +2 -2
- package/dist/{vendor → core}/runtime/ports.d.ts +2 -2
- package/dist/{vendor → core}/runtime/protocol.d.ts +16 -16
- package/dist/core/runtime/styles.d.ts +2 -0
- package/dist/{vendor → core}/select.d.ts +2 -2
- package/dist/{vendor → core}/store.d.ts +1 -1
- package/dist/{vendor → core}/theme.d.ts +1 -1
- package/dist/{vendor → core}/types.d.ts +1 -1
- package/dist/guest.d.ts +21 -0
- package/dist/guest.js +2 -0
- package/dist/host.d.ts +1 -1
- package/dist/host.js +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/runtime.d.ts +1 -1
- package/dist/runtime.js +13 -13
- package/dist/uibot/controller.d.ts +2 -2
- package/dist/uibot/format.d.ts +1 -1
- package/dist/uibot/inject.d.ts +1 -1
- package/dist/uibot/overlay-adapter.d.ts +1 -1
- package/dist/uibot/theme.d.ts +1 -1
- package/dist/uibot/validation.d.ts +1 -1
- package/package.json +10 -3
- package/dist/vendor/index.d.ts +0 -10
- package/dist/vendor/inject.d.ts +0 -2
- package/dist/vendor/runtime/entry.d.ts +0 -3
- package/dist/vendor/runtime/index.d.ts +0 -10
- package/dist/vendor/runtime/styles.d.ts +0 -2
- /package/dist/{vendor → core}/runtime/overlay-drag.d.ts +0 -0
- /package/dist/{vendor → core}/runtime/scheduler.d.ts +0 -0
package/{SOURCE.md → README.md}
RENAMED
|
@@ -1,26 +1,28 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @uibot/page-annotation
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
网页标注:在页面上框选、圈画、写评论,产出给 AI 的修改上下文。UIBot 维护这份唯一实现;InfoOS 桌面端与 Web 端都从这里引用(ADR 0012 B6)。来源是 InfoOS `packages/page-annotation`(2026-10-23 起收归 UIBot,InfoOS 不再保留副本)。
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
5
|
+
| 入口 | 内容 |
|
|
6
|
+
| --- | --- |
|
|
7
|
+
| `.` | 标注模型、归一化、选择器、composer 附件(`withComposerAnnotations`、`splitComposerImages`)、主题校验、UIBot 格式化 |
|
|
8
|
+
| `./runtime` | 运行时端口与 overlay;`ANNOTATOR_IIFE` 是惰性脚本,HTML 预览按需启动 |
|
|
9
|
+
| `./host` | 浏览器宿主控制器与 Studio 主题映射 |
|
|
10
|
+
| `./guest` | 桌面宿主注入访客页的脚本:`annotatorBootScript(theme?)`(加载即启动的 IIFE)、快照/更新/删除/截图脚本、控制台标记判断 |
|
|
9
11
|
|
|
10
|
-
|
|
12
|
+
目录:`src/core/` 是模型与运行时;`src/uibot/` 是 iframe 传输、宿主控制器、体验增强与格式化;`src/guest.ts` 是桌面访客脚本。页面全局名与控制台标记统一用 `__uibot` 前缀。
|
|
11
13
|
|
|
12
|
-
|
|
14
|
+
两份 IIFE(`src/core/inject.ts`、`src/uibot/inject.ts`)是生成文件:改 overlay 或入口后运行 `bun run scripts/build-page-annotation.ts`;`scripts/build-page-annotation.test.ts` 在测试中以 `--check` 重建并比对,过期即失败。
|
|
13
15
|
|
|
14
16
|
## 主题 token
|
|
15
17
|
|
|
16
|
-
|
|
17
|
-
`applyAnnotationTheme(host, theme?)
|
|
18
|
+
包根与 `./runtime` 导出 `AnnotationTheme`、`validateAnnotationTheme` 与
|
|
19
|
+
`applyAnnotationTheme(host, theme?)`。创建 overlay 时可传
|
|
18
20
|
`startAnnotationRuntime({ theme }, runtimeHost)`;运行中对同一 shadow host 再调用
|
|
19
21
|
`applyAnnotationTheme` 即时更新,无需重建。函数替换完整 token map;传 `{}` 或省略
|
|
20
22
|
清除旧覆盖。也可从宿主 CSS 继承这些变量。每个使用位置保留原颜色 fallback;同一语义
|
|
21
|
-
在旧 UI
|
|
23
|
+
在旧 UI 不同位置可能有不同默认值,因此下表列出所有原值。未传主题时使用下表的默认值。
|
|
22
24
|
|
|
23
|
-
| Token | 用途 |
|
|
25
|
+
| Token | 用途 | 默认值(按位置回落) |
|
|
24
26
|
| --- | --- | --- |
|
|
25
27
|
| `--pa-accent` | 边框、标记、主要强调 | `#7c2d34` |
|
|
26
28
|
| `--pa-accent-soft` | 选中/区域高亮底色 | `rgba(124,45,52,0.10)`, `rgba(124,45,52,0.06)`, `rgba(124,45,52,.10)` |
|
|
@@ -46,7 +48,7 @@ InfoOS 源头导出 `AnnotationTheme`、`validateAnnotationTheme` 与
|
|
|
46
48
|
| `--pa-color-default` | 原生颜色选择器无可解析颜色时的初值 | `#000000` |
|
|
47
49
|
|
|
48
50
|
```ts
|
|
49
|
-
import { applyAnnotationTheme } from "@
|
|
51
|
+
import { applyAnnotationTheme } from "@uibot/page-annotation";
|
|
50
52
|
applyAnnotationTheme(host, {
|
|
51
53
|
"--pa-accent": "#2563eb",
|
|
52
54
|
"--pa-accent-soft": "color-mix(in srgb, #2563eb 10%, transparent)",
|
|
@@ -60,7 +62,7 @@ rgb/hsl/hwb/lab/lch/oklab/oklch、标准色域 `color()` 与具体颜色的 srgb
|
|
|
60
62
|
原生颜色输入框先读取 computed 色,再经 canvas 解析为真实 hex,绝不将 `var()`
|
|
61
63
|
传入 canvas。作品本身的颜色与区域绘图的固定标记色属于内容数据,保持原契约。
|
|
62
64
|
|
|
63
|
-
|
|
65
|
+
`./host`
|
|
64
66
|
另导出 `resolveStudioAnnotationTheme(element)` 与 `observeStudioAnnotationTheme`:
|
|
65
67
|
页面标记(强调色、对比文字、选中态、描边)叠在作品页面上,与 Studio 的浅/深色无关,固定为深色强调加浅色描边,在浅色和深色页面上都可见;其余界面色随 Studio:card/card-foreground 映射表面与文字,
|
|
66
68
|
popover/popover-foreground 映射菜单,border/destructive/ring/muted 等映射对应角色。
|
|
@@ -69,5 +71,5 @@ prefers-color-scheme 变化时调用 `controller.update({ theme })`;停止绑
|
|
|
69
71
|
主题只通过既有 source/nonce 校验后的 sync 消息传递,shell 与 page 均复用源头校验。
|
|
70
72
|
它不改变 sandbox、作品源、权限或导出。宿主负责成对设置前景/背景以保持对比度。
|
|
71
73
|
|
|
72
|
-
|
|
74
|
+
回归夹具 `src/core/runtime/styles.before.txt` 保存改前文本;测试剥离 `var` 包装后
|
|
73
75
|
逐字比较,覆盖全部默认规则。该证据证明默认样式等价,不是浏览器截图像素比对。
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { AnnotationPriority, AnnotationType, WebAnnotationTarget, WebPageAnnotation } from
|
|
1
|
+
import type { AnnotationPriority, AnnotationType, WebAnnotationTarget, WebPageAnnotation } from "./model.js";
|
|
2
2
|
/** Compact note shown above the chat composer. */
|
|
3
3
|
export type ComposerAnnotation = {
|
|
4
4
|
id: string;
|
|
@@ -10,7 +10,7 @@ export interface AnnotationRect extends AnnotationPoint {
|
|
|
10
10
|
width: number;
|
|
11
11
|
height: number;
|
|
12
12
|
}
|
|
13
|
-
export type AnnotationDirection =
|
|
13
|
+
export type AnnotationDirection = "left" | "right" | "up" | "down";
|
|
14
14
|
/** Pure region geometry in viewport CSS pixels. */
|
|
15
15
|
export declare function normalizeRegionRect(start: AnnotationPoint, end: AnnotationPoint, viewport: AnnotationViewport): AnnotationRect | null;
|
|
16
16
|
export declare function createKeyboardRegion(viewport: AnnotationViewport): AnnotationRect;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export * from "./composer.js";
|
|
2
|
+
export * from "./geometry.js";
|
|
3
|
+
export * from "./marks.js";
|
|
4
|
+
export * from "./model.js";
|
|
5
|
+
export * from "./normalize.js";
|
|
6
|
+
export * from "./select.js";
|
|
7
|
+
export * from "./store.js";
|
|
8
|
+
export * from "./types.js";
|
|
9
|
+
export { ANNOTATION_CAPTURE_MARK, ANNOTATION_CHANGED_MARK, ANNOTATION_CLOSED_MARK, normalizePageUrl, } from "./runtime/protocol.js";
|
|
10
|
+
export * from "./theme.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const ANNOTATOR_IIFE = "(()=>{var{defineProperty:st,getOwnPropertyNames:Rn,getOwnPropertyDescriptor:Ln}=Object,_n=Object.prototype.hasOwnProperty;function Pn(e){return this[e]}var On=(e)=>{var t=(zt??=new WeakMap).get(e),o;if(t)return t;if(t=st({},\"__esModule\",{value:!0}),e&&typeof e===\"object\"||typeof e===\"function\"){for(var i of Rn(e))if(!_n.call(t,i))st(t,i,{get:Pn.bind(e,i),enumerable:!(o=Ln(e,i))||o.enumerable})}return zt.set(e,t),t},zt;var In=(e)=>e;function $n(e,t){this[e]=In.bind(null,t)}var zn=(e,t)=>{for(var o in t)st(e,o,{get:t[o],enumerable:!0,configurable:!0,set:$n.bind(t,o)})};var No={};zn(No,{bootUIBotAnnotator:()=>pn});function Dn(e){return e.startsWith(\"data:image/\")&&e.length<=1500000}function Hn(e){if(e.kind===\"region\")return`\u533A\u57DF ${Math.round(e.rect.width)}\u00D7${Math.round(e.rect.height)}`;let t=e.textContent?.replace(/\\s+/g,\" \").trim();if(t){let o=t.length>28?`${t.slice(0,28)}\u2026`:t;return`${e.tagName}\u300C${o}\u300D`}return e.cssSelector||e.tagName}function Dt(e){return{id:e.id,comment:e.comment,pageUrl:e.pageUrl,...e.pageContext.title?{pageTitle:e.pageContext.title}:{},targetLabel:Hn(e.target),type:e.type,priority:e.priority,...e.screenshot&&Dn(e.screenshot)?{screenshot:e.screenshot}:{}}}var He=[{id:\"red\",value:\"#ef4444\",label:\"\u7EA2\"},{id:\"orange\",value:\"#f97316\",label:\"\u6A59\"},{id:\"yellow\",value:\"#eab308\",label:\"\u9EC4\"},{id:\"green\",value:\"#22c55e\",label:\"\u7EFF\"},{id:\"blue\",value:\"#3b82f6\",label:\"\u84DD\"},{id:\"white\",value:\"#f8fafc\",label:\"\u767D\"}],Ht=12,Bt=48,lt=4,ct=16;function Ge(e){let t=Math.round(e/4)*4;return Math.min(48,Math.max(12,t))}function Bn(e,t){let o=Ge(t),i=Math.max(1,[...e].length);return{width:Math.max(o,i*o),height:Math.ceil(o*1.35)}}var Wn=new Set(He.map((e)=>e.value));function Fn(e){return Wn.has(e)}function Wt(){return He[0].value}function re(e){return typeof e===\"number\"&&Number.isFinite(e)}function Un(e){if(!e||typeof e!==\"object\"||Array.isArray(e))return null;let t=e;if(typeof t.color!==\"string\"||!Fn(t.color))return null;if(t.kind===\"rect\"){if(!re(t.x)||!re(t.y)||!re(t.width)||!re(t.height))return null;if(t.width<8||t.height<8)return null;return{kind:\"rect\",color:t.color,x:t.x,y:t.y,width:t.width,height:t.height}}if(t.kind===\"arrow\"){if(!re(t.x1)||!re(t.y1)||!re(t.x2)||!re(t.y2))return null;return{kind:\"arrow\",color:t.color,x1:t.x1,y1:t.y1,x2:t.x2,y2:t.y2}}if(t.kind===\"text\"){if(!re(t.x)||!re(t.y)||typeof t.text!==\"string\")return null;let o=t.text.trim();if(!o)return null;let i=t.fontSize===void 0?16:re(t.fontSize)?Ge(t.fontSize):null;if(i==null)return null;return{kind:\"text\",color:t.color,x:t.x,y:t.y,text:o,fontSize:i}}return null}function Ft(e){if(e===void 0)return;if(!Array.isArray(e))return;let t=[];for(let o of e){let i=Un(o);if(!i)return;t.push(i)}return t}function Ut(e){if(e.length===0)return\"\u533A\u57DF\u6807\u6CE8\";let t=e.filter((c)=>c.kind===\"rect\").length,o=e.filter((c)=>c.kind===\"arrow\").length,i=e.filter((c)=>c.kind===\"text\"),s=[];if(t)s.push(`${t} \u4E2A\u6846`);if(o)s.push(`${o} \u4E2A\u7BAD\u5934`);if(i.length){let c=i.map((l)=>l.text.trim()).filter(Boolean).slice(0,3).map((l)=>`\u300C${l.length>16?`${l.slice(0,16)}\u2026`:l}\u300D`);s.push(c.length?`\u6587\u672C ${c.join(\" \")}`:`${i.length} \u5904\u6587\u672C`)}return`\u533A\u57DF\u6807\u6CE8\uFF08${s.join(\"\uFF0C\")}\uFF09`}function Be(e,t=16){if(e.length===0)return null;let{POSITIVE_INFINITY:o,POSITIVE_INFINITY:i,NEGATIVE_INFINITY:s,NEGATIVE_INFINITY:c}=Number;for(let l of e)if(l.kind===\"rect\")o=Math.min(o,l.x),i=Math.min(i,l.y),s=Math.max(s,l.x+l.width),c=Math.max(c,l.y+l.height);else if(l.kind===\"arrow\")o=Math.min(o,l.x1,l.x2),i=Math.min(i,l.y1,l.y2),s=Math.max(s,l.x1,l.x2),c=Math.max(c,l.y1,l.y2);else{let g=Bn(l.text,l.fontSize);o=Math.min(o,l.x),i=Math.min(i,l.y),s=Math.max(s,l.x+g.width),c=Math.max(c,l.y+g.height)}return{x:o-t,y:i-t,width:Math.max(8,s-o+t*2),height:Math.max(8,c-i+t*2)}}function Vt(e,t,o){return e.map((i)=>{if(i.kind===\"rect\")return{...i,x:i.x+t,y:i.y+o};if(i.kind===\"arrow\")return{...i,x1:i.x1+t,y1:i.y1+o,x2:i.x2+t,y2:i.y2+o};return{...i,x:i.x+t,y:i.y+o,fontSize:i.fontSize}})}function dt(e,t){let o=Math.max(0,Math.min(e.x,t.width)),i=Math.max(0,Math.min(e.y,t.height)),s=Math.min(e.width,t.width-o),c=Math.min(e.height,t.height-i);if(s<8||c<8)return null;return{x:o,y:i,width:s,height:c}}var Vn=[\"open\",\"processing\",\"done\",\"verified\",\"ignored\"],jn=[\"bug\",\"style\",\"copywriting\",\"feature\",\"interaction\",\"data\",\"other\"],Yn=[\"low\",\"medium\",\"high\",\"blocker\"],Kn=[\"testid\",\"id\",\"aria\",\"class\",\"text\",\"path\"],Xn=[\"light\",\"dark\",\"unknown\"],Gn=[\"react\",\"vue\",\"angular\",\"svelte\",\"nextjs\",\"nuxt\",\"unknown\"];function X(e){return e!==null&&typeof e===\"object\"&&!Array.isArray(e)}function ve(e,t){return typeof e===\"string\"&&t.includes(e)}function he(e){return typeof e===\"number\"&&Number.isFinite(e)}function be(e){return he(e)&&e>0}function ut(e){return Array.isArray(e)&&e.every((t)=>typeof t===\"string\")}function Yt(e){return X(e)&&Object.values(e).every((t)=>typeof t===\"string\")}function B(e){return e===void 0||typeof e===\"string\"}function Kt(e){if(!X(e)||!he(e.x)||!he(e.y)||!be(e.width)||!be(e.height))return;return{x:e.x,y:e.y,width:e.width,height:e.height}}function pt(e){if(!X(e)||!be(e.width)||!be(e.height))return;return{width:e.width,height:e.height}}function ft(e){if(!X(e)||!he(e.x)||!he(e.y))return;return{x:e.x,y:e.y}}function jt(e){if(!X(e)||typeof e.fileName!==\"string\"||!be(e.lineNumber))return;if(e.columnNumber!==void 0&&(!he(e.columnNumber)||e.columnNumber<0))return;if(!B(e.componentName))return;return{fileName:e.fileName,lineNumber:e.lineNumber,...e.columnNumber===void 0?{}:{columnNumber:e.columnNumber},...e.componentName===void 0?{}:{componentName:e.componentName}}}function qn(e){let t=Kt(e.boundingBox);if(typeof e.tagName!==\"string\"||!e.tagName||typeof e.cssSelector!==\"string\"||!e.cssSelector||typeof e.xpath!==\"string\"||!e.xpath||!Yt(e.attributes)||!t||!ut(e.domPath))return;if(!B(e.textContent)||e.breadcrumb!==void 0&&!ut(e.breadcrumb))return;if(e.selectorStrategy!==void 0&&!ve(e.selectorStrategy,Kn))return;if(!B(e.region))return;let o;if(e.accessibility!==void 0){if(!X(e.accessibility)||!B(e.accessibility.role)||!B(e.accessibility.name)||!B(e.accessibility.ariaLabel))return;o={...e.accessibility.role===void 0?{}:{role:e.accessibility.role},...e.accessibility.name===void 0?{}:{name:e.accessibility.name},...e.accessibility.ariaLabel===void 0?{}:{ariaLabel:e.accessibility.ariaLabel}}}let i=e.sourceLocation===void 0?void 0:jt(e.sourceLocation);if(e.sourceLocation!==void 0&&!i)return;let s;if(e.sourceStack!==void 0){if(!Array.isArray(e.sourceStack))return;let c=e.sourceStack.map(jt);if(c.some((l)=>!l))return;s=c.filter((l)=>Boolean(l))}return{kind:\"element\",tagName:e.tagName,cssSelector:e.cssSelector,xpath:e.xpath,...e.textContent===void 0?{}:{textContent:e.textContent},attributes:{...e.attributes},boundingBox:t,domPath:[...e.domPath],...o?{accessibility:o}:{},...e.selectorStrategy===void 0?{}:{selectorStrategy:e.selectorStrategy},...e.region===void 0?{}:{region:e.region},...e.breadcrumb===void 0?{}:{breadcrumb:[...e.breadcrumb]},...i?{sourceLocation:i}:{},...s?{sourceStack:s}:{}}}function Zn(e){let t=Kt(e.rect),o=pt(e.viewport),i=ft(e.scroll);if(!t||t.width<8||t.height<8||!o||!i||!be(e.devicePixelRatio))return;if(e.breadcrumb!==void 0&&!ut(e.breadcrumb))return;let s;if(e.topLevelElements!==void 0){if(!Array.isArray(e.topLevelElements))return;s=[];for(let l of e.topLevelElements){if(!X(l)||typeof l.tagName!==\"string\"||!l.tagName||!B(l.text)||!B(l.role))return;s.push({tagName:l.tagName,...l.text===void 0?{}:{text:l.text},...l.role===void 0?{}:{role:l.role}})}}let c=e.marks===void 0?void 0:Ft(e.marks);if(e.marks!==void 0&&!c)return;return{kind:\"region\",rect:t,viewport:o,scroll:i,devicePixelRatio:e.devicePixelRatio,...e.breadcrumb===void 0?{}:{breadcrumb:[...e.breadcrumb]},...s?{topLevelElements:s}:{},...c?.length?{marks:c}:{}}}function Jn(e){if(!X(e))return{ok:!1,reason:\"target is not an object\",raw:e};if(e.kind===\"region\"){let t=Zn(e);return t?{ok:!0,value:t}:{ok:!1,reason:\"invalid region target\",raw:e}}if(e.kind===\"element\"||e.kind===void 0){let t=qn(e);return t?{ok:!0,value:t}:{ok:!1,reason:\"invalid element target\",raw:e}}return{ok:!1,reason:`unknown target kind: ${String(e.kind)}`,raw:e}}function Qn(e){if(!X(e))return;let t=pt(e.viewport),o=ft(e.scroll);if(!t||!o||!be(e.devicePixelRatio)||!X(e.center)||!he(e.center.x)||!he(e.center.y)||typeof e.visible!==\"boolean\"||!B(e.positioning))return;return{viewport:t,scroll:o,devicePixelRatio:e.devicePixelRatio,center:{x:e.center.x,y:e.center.y},visible:e.visible,...e.positioning===void 0?{}:{positioning:e.positioning}}}function eo(e){if(!X(e))return;let{url:t,origin:o,path:i,title:s,capturedAt:c,query:l,hash:g,referrer:y,language:A,userAgent:E,uiState:M}=e,R=pt(e.viewport),_=ft(e.scroll);if(!R||!X(e.viewport)||!be(e.viewport.devicePixelRatio)||!_)return;if(typeof t!==\"string\"||!t||typeof o!==\"string\"||!o||typeof i!==\"string\"||!i||typeof s!==\"string\"||typeof c!==\"string\"||!c)return;if(!B(l)||!B(g)||!B(y)||!B(A)||!B(E)||!B(M))return;if(e.theme!==void 0&&!ve(e.theme,Xn))return;if(e.framework!==void 0&&!ve(e.framework,Gn))return;return{url:t,origin:o,path:i,title:s,viewport:{...R,devicePixelRatio:e.viewport.devicePixelRatio},scroll:_,capturedAt:c,...l===void 0?{}:{query:l},...g===void 0?{}:{hash:g},...y===void 0?{}:{referrer:y},...e.theme===void 0?{}:{theme:e.theme},...e.framework===void 0?{}:{framework:e.framework},...A===void 0?{}:{language:A},...E===void 0?{}:{userAgent:E},...M===void 0?{}:{uiState:M}}}function to(e){if(e===void 0)return[];if(!Array.isArray(e))return;let t=[];for(let o of e){if(!X(o)||!ve(o.kind,[\"style\",\"text\"])||typeof o.label!==\"string\"||!B(o.property)||typeof o.before!==\"string\"||typeof o.after!==\"string\")return;t.push({kind:o.kind,label:o.label,before:o.before,after:o.after,...o.property===void 0?{}:{property:o.property}})}return t}function mt(e){if(!X(e))return{ok:!1,reason:\"annotation is not an object\",raw:e};let{id:t,pageUrl:o,comment:i,createdAt:s,updatedAt:c}=e;if(!ve(e.status,Vn))return{ok:!1,reason:\"invalid status\",raw:e};if(!ve(e.type,jn))return{ok:!1,reason:\"invalid type\",raw:e};if(!ve(e.priority,Yn))return{ok:!1,reason:\"invalid priority\",raw:e};if(typeof t!==\"string\"||!t)return{ok:!1,reason:\"invalid id\",raw:e};if(typeof o!==\"string\"||!o)return{ok:!1,reason:\"invalid pageUrl\",raw:e};if(typeof i!==\"string\"||!i)return{ok:!1,reason:\"invalid comment\",raw:e};if(typeof s!==\"string\"||!s)return{ok:!1,reason:\"invalid createdAt\",raw:e};if(typeof c!==\"string\"||!c)return{ok:!1,reason:\"invalid updatedAt\",raw:e};if(!B(e.expectedResult)||!B(e.preserve)||!B(e.screenshot))return{ok:!1,reason:\"invalid optional annotation text\",raw:e};if(!Yt(e.styleSummary))return{ok:!1,reason:\"invalid styleSummary\",raw:e};let l=Qn(e.geometry);if(!l)return{ok:!1,reason:\"invalid geometry\",raw:e};let g=eo(e.pageContext);if(!g)return{ok:!1,reason:\"invalid pageContext\",raw:e};let y=to(e.edits);if(!y)return{ok:!1,reason:\"invalid edits\",raw:e};let A=Jn(e.target);if(!A.ok)return A;return{ok:!0,value:{id:t,pageUrl:o,status:e.status,type:e.type,priority:e.priority,comment:i,target:A.value,styleSummary:{...e.styleSummary},geometry:l,pageContext:g,createdAt:s,updatedAt:c,...e.expectedResult===void 0?{}:{expectedResult:e.expectedResult},...e.preserve===void 0?{}:{preserve:e.preserve},...e.screenshot===void 0?{}:{screenshot:e.screenshot},...y.length?{edits:y}:{}}}}var H={start:\"annotation:start\",teardown:\"annotation:teardown\",save:\"annotation:save\",enrich:\"annotation:enrich\",closed:\"annotation:overlay-closed\",list:\"annotation:list\",update:\"annotation:update\",remove:\"annotation:remove\",clear:\"annotation:clear\",changed:\"annotation:changed\",reveal:\"annotation:reveal\"};var Xt=\"__uibot-annotation:changed\";var Gt=\"__uibot-annotation:capture\";function xe(e){try{let t=new URL(e);return t.hash=\"\",t.toString()}catch{return e}}function qt(e){return new Date(e()).toISOString()}function no(e,t){return`ann_${e().toString(36)}_${Math.floor(t()*1e9).toString(36)}`}function Zt(e={}){let t=e.now??Date.now,o=e.random??Math.random,i=new Map;return{list(s){let c=xe(s);return[...i.values()].filter((l)=>xe(l.pageUrl)===c)},listAll(){return[...i.values()]},save(s,c){let l=qt(t),g={...s,id:no(t,o),pageUrl:xe(c??s.pageContext.url),status:\"open\",createdAt:l,updatedAt:l},y=mt(g);if(!y.ok)throw Error(`\u6807\u6CE8\u6570\u636E\u65E0\u6548\uFF1A${y.reason}`);return i.set(y.value.id,y.value),y.value},update(s,c){let l=i.get(s);if(!l)return null;let g={...l,...c,id:l.id,updatedAt:qt(t)},y=mt(g);if(!y.ok)throw Error(`\u6807\u6CE8\u6570\u636E\u65E0\u6548\uFF1A${y.reason}`);return i.set(s,y.value),y.value},remove(s){return i.delete(s)},clear(s){let c=xe(s),l=0;for(let[g,y]of i)if(xe(y.pageUrl)===c)i.delete(g),l+=1;return l},clearAll(){let s=i.size;return i.clear(),s}}}function Ae(){let e=globalThis;return e.__uibotPageAnnotationStore??=Zt(),e.__uibotPageAnnotationStore}function gt(){let e=globalThis;return e.__uibotAnnotationListeners??=[],e.__uibotAnnotationListeners}function qe(e){for(let t of[...gt()])t(e)}function We(e){let t=globalThis,o=Ae().list(e).map(Dt);t.__uibotAnnotationSnapshot=JSON.stringify({pageUrl:xe(e),items:o});try{console.debug(Xt)}catch{}}function oo(e){let t=Ae();if(e.action===H.list)return{success:!0,data:t.list(e.pageUrl)};if(e.action===H.save){let o=t.save(e.data);return qe({action:H.changed}),We(o.pageUrl),{success:!0,data:o}}if(e.action===H.enrich)return{success:!0};if(e.action===H.closed)return{success:!0};return{success:!1,error:\"unknown-action\"}}function ro(){let e=globalThis;e.__uibotAnnotationBridge={snapshot(){return e.__uibotAnnotationSnapshot??JSON.stringify({pageUrl:\"\",items:[]})},update(t,o){let i=Ae().update(t,{comment:o});if(!i)return!1;return qe({action:H.changed}),We(i.pageUrl),!0},remove(t){let o=Ae().listAll().find((i)=>i.id===t);if(!o)return!1;return Ae().remove(t),qe({action:H.changed}),We(o.pageUrl),!0},clear(){let t=[...new Set(Ae().listAll().map((o)=>o.pageUrl))];if(Ae().clearAll(),qe({action:H.changed}),t.length===0)return We(typeof location>\"u\"?\"\":location.href),!0;for(let o of t)We(o);return!0}}}function Jt(){return ro(),{sendMessage(e){try{return Promise.resolve(oo(e))}catch(t){return Promise.resolve({success:!1,error:t instanceof Error?t.message:String(t)})}},subscribe(e){return gt().push(e),()=>{let t=gt(),o=t.indexOf(e);if(o>=0)t.splice(o,1)}}}}var Qt=[\"--pa-accent\",\"--pa-accent-soft\",\"--pa-outline\",\"--pa-accent-contrast\",\"--pa-surface\",\"--pa-surface-contrast\",\"--pa-shadow\",\"--pa-muted\",\"--pa-hover\",\"--pa-border\",\"--pa-popover-contrast\",\"--pa-popover\",\"--pa-focus\",\"--pa-selected\",\"--pa-accent-halo\",\"--pa-field\",\"--pa-checker\",\"--pa-success\",\"--pa-success-contrast\",\"--pa-danger\",\"--pa-danger-contrast\",\"--pa-color-default\"];function Ze(e){if(typeof e!==\"string\"||e.length>256||!e.trim())return!1;if(/[;{}\\\\<>!@'\"]/.test(e)||[...e].some((l)=>l.charCodeAt(0)<32)||/url\\s*\\(|var\\s*\\(|\\/\\*|\\*\\//i.test(e))return!1;let t=e.trim();if(/^#(?:[\\da-f]{3,4}|[\\da-f]{6}|[\\da-f]{8})$/i.test(t))return!0;if(new Set(\"aliceblue antiquewhite aqua aquamarine azure beige bisque black blanchedalmond blue blueviolet brown burlywood cadetblue chartreuse chocolate coral cornflowerblue cornsilk crimson cyan darkblue darkcyan darkgoldenrod darkgray darkgreen darkgrey darkkhaki darkmagenta darkolivegreen darkorange darkorchid darkred darksalmon darkseagreen darkslateblue darkslategray darkslategrey darkturquoise darkviolet deeppink deepskyblue dimgray dimgrey dodgerblue firebrick floralwhite forestgreen fuchsia gainsboro ghostwhite gold goldenrod gray green greenyellow grey honeydew hotpink indianred indigo ivory khaki lavender lavenderblush lawngreen lemonchiffon lightblue lightcoral lightcyan lightgoldenrodyellow lightgray lightgreen lightgrey lightpink lightsalmon lightseagreen lightskyblue lightslategray lightslategrey lightsteelblue lightyellow lime limegreen linen magenta maroon mediumaquamarine mediumblue mediumorchid mediumpurple mediumseagreen mediumslateblue mediumspringgreen mediumturquoise mediumvioletred midnightblue mintcream mistyrose moccasin navajowhite navy oldlace olive olivedrab orange orangered orchid palegoldenrod palegreen paleturquoise palevioletred papayawhip peachpuff peru pink plum powderblue purple rebeccapurple red rosybrown royalblue saddlebrown salmon sandybrown seagreen seashell sienna silver skyblue slateblue slategray slategrey snow springgreen steelblue tan teal thistle tomato transparent turquoise violet wheat white whitesmoke yellow yellowgreen\".split(\" \")).has(t.toLowerCase()))return!0;let i=t.match(/^(rgb|rgba|hsl|hsla|hwb|lab|lch|oklab|oklch)\\(([^()]+)\\)$/i);if(i){let l=(i[1]??\"\").toLowerCase(),g=(i[2]??\"\").trim(),y=g.includes(\",\");if(y&&(!/^(rgb|rgba|hsl|hsla)$/.test(l)||g.includes(\"/\")))return!1;let A=g.split(\"/\");if(A.length>2)return!1;let E=y?g.split(\",\").map((_)=>_.trim()):(A[0]??\"\").trim().split(/\\s+/),M=y?E[3]:A[1]?.trim();if(E.length!==3&&!(y&&E.length===4))return!1;let R=/^[+-]?(?:\\d+(?:\\.\\d*)?|\\.\\d+)(?:e[+-]?\\d+)?%?$/i;if(M!==void 0&&!R.test(M)&&!(M===\"none\"&&!y))return!1;return E.slice(0,3).every((_,N)=>{if(_===\"none\")return!y;let L=/^(hsl|hsla|hwb)$/.test(l)?N===0:/^(lch|oklch)$/.test(l)&&N===2;return R.test(_)||L&&/^[+-]?(?:\\d+(?:\\.\\d*)?|\\.\\d+)(deg|rad|grad|turn)$/i.test(_)})}let s=t.match(/^color\\((srgb|srgb-linear|display-p3|a98-rgb|prophoto-rgb|rec2020|xyz|xyz-d50|xyz-d65) ([^()]+)\\)$/i);if(s)return Ze(`rgb(${s[2]})`);let c=t.match(/^color-mix\\(in srgb, (.+) (\\d+(?:\\.\\d+)?)%, (.+)\\)$/i);return!!c&&Number(c[2])<=100&&Ze(c[1])&&Ze(c[3])}function io(e){if(!e||typeof e!==\"object\"||Array.isArray(e))return{};try{if(new TextEncoder().encode(JSON.stringify(e)).length>8192)return{}}catch{return{}}let t={};for(let o of Qt){let i=Object.hasOwn(e,o)?e[o]:void 0;if(Ze(i))t[o]=i.trim()}return t}function en(e,t){let o=io(t);for(let i of Qt){let s=o[i];if(s===void 0)e.style.removeProperty(i);else e.style.setProperty(i,s)}}var ao=[\"color\",\"backgroundColor\",\"fontSize\",\"fontWeight\",\"fontFamily\",\"lineHeight\",\"margin\",\"padding\",\"border\",\"borderRadius\",\"width\",\"height\",\"display\",\"position\",\"zIndex\",\"flexDirection\",\"justifyContent\",\"alignItems\",\"gap\",\"overflow\",\"opacity\",\"transform\"];function ht(e){if(typeof CSS<\"u\"&&typeof CSS.escape===\"function\")return CSS.escape(e);return e.replace(/([^a-zA-Z0-9_-])/g,\"\\\\$1\")}function tn(e){return e.replace(/\\\\/g,\"\\\\\\\\\").replace(/\"/g,\"\\\\\\\"\").replace(/[\\n\\r\\f]/g,\"\\\\a \")}function nn(e){if(!e||e.length>40)return!1;if(/^(css-|sc-|jss|makeStyles|emotion-|_)/i.test(e))return!1;if(/[0-9a-f]{6,}/.test(e))return!1;return!0}function on(e){if(!e||e.length>40)return!1;if(/[0-9a-f]{8,}/.test(e))return!1;if(/^(radix-|headlessui-|mui-|:r)/i.test(e))return!1;return!0}function so(e){let t=[],o=e;while(o&&o.nodeType===1&&o!==document.documentElement){let i=o.tagName.toLowerCase();if(o.id&&on(o.id)){t.unshift(`#${ht(o.id)}`);break}let s=o.parentElement;if(s){let c=Array.from(s.children).filter((g)=>g.tagName===o.tagName),l=c.indexOf(o)+1;t.unshift(c.length>1?`${i}:nth-of-type(${l})`:i)}else t.unshift(i);o=s}return t.join(\" > \")}function lo(e){let t=e.tagName.toLowerCase();for(let s of[\"data-testid\",\"data-cy\",\"data-qa\"]){let c=e.getAttribute(s);if(c)return{selector:`${t}[${s}=\"${tn(c)}\"]`,strategy:\"testid\"}}if(e.id&&on(e.id)){let s=`#${ht(e.id)}`;if(document.querySelectorAll(s).length===1)return{selector:s,strategy:\"id\"}}let o=e.getAttribute(\"aria-label\");if(o){let s=`${t}[aria-label=\"${tn(o)}\"]`;if(document.querySelectorAll(s).length===1)return{selector:s,strategy:\"aria\"}}let i=Array.from(e.classList).filter(nn);if(i.length){let s=`${t}.${i.map(ht).join(\".\")}`;if(document.querySelectorAll(s).length===1)return{selector:s,strategy:\"class\"}}return{selector:so(e),strategy:\"path\"}}function co(e){let t=[],o=e;while(o&&o.nodeType===1){let i=1,s=o.previousElementSibling;while(s){if(s.tagName===o.tagName)i+=1;s=s.previousElementSibling}t.unshift(`${o.tagName.toLowerCase()}[${i}]`),o=o.parentElement}return`/${t.join(\"/\")}`}function uo(e){let t=[],o=e,i=0;while(o&&o.nodeType===1&&i<6){let s=o.tagName.toLowerCase(),c=o.id?`#${o.id}`:\"\",l=Array.from(o.classList).filter(nn).slice(0,2);t.unshift(`${s}${c}${l.length?`.${l.join(\".\")}`:\"\"}`),o=o.parentElement,i+=1}return t}function po(e){let t={};for(let o of Array.from(e.attributes)){if(o.name===\"style\")continue;t[o.name]=o.value.length>200?o.value.slice(0,200):o.value}return t}function fo(e){let t=getComputedStyle(e),o={};for(let i of ao){let s=t.getPropertyValue(i.replace(/[A-Z]/g,(c)=>`-${c.toLowerCase()}`));if(s)o[i]=s.trim()}return o}function mo(){let e=window;if(e.__NEXT_DATA__)return\"nextjs\";if(e.__NUXT__)return\"nuxt\";if(document.querySelector(\"[ng-version]\"))return\"angular\";if(document.querySelector(\"[data-reactroot]\")||e.React||e.__REACT_DEVTOOLS_GLOBAL_HOOK__)return\"react\";if(e.__VUE__||document.querySelector(\"[data-v-app]\"))return\"vue\";if(document.querySelector(\"[data-svelte-h]\"))return\"svelte\";return\"unknown\"}function bt(){let e=window.location,t=document.documentElement.classList.contains(\"dark\")||Boolean(window.matchMedia?.(\"(prefers-color-scheme: dark)\").matches);return{url:e.href,origin:e.origin,path:e.pathname,query:e.search||void 0,hash:e.hash||void 0,title:document.title,referrer:document.referrer||void 0,viewport:{width:window.innerWidth,height:window.innerHeight,devicePixelRatio:window.devicePixelRatio||1},scroll:{x:window.scrollX,y:window.scrollY},theme:t?\"dark\":\"light\",framework:mo(),language:document.documentElement.lang||navigator.language,userAgent:navigator.userAgent,capturedAt:new Date().toISOString()}}function go(e){let t=e.getBoundingClientRect(),o=getComputedStyle(e);return{viewport:{width:window.innerWidth,height:window.innerHeight},scroll:{x:window.scrollX,y:window.scrollY},devicePixelRatio:window.devicePixelRatio||1,center:{x:Math.round(t.left+t.width/2),y:Math.round(t.top+t.height/2)},visible:t.width>0&&t.height>0&&o.display!==\"none\"&&o.visibility!==\"hidden\",positioning:o.position}}function ke(e,t){let o=e.replace(/\\s+/g,\" \").trim();return o.length>t?`${o.slice(0,t)}\u2026`:o}function ho(e){let t=e.tagName.toLowerCase(),o=(e.getAttribute(\"role\")||\"\").toLowerCase();if(t===\"main\"||o===\"main\")return\"\u4E3B\u5185\u5BB9\u533A\";if(t===\"nav\"||o===\"navigation\")return\"\u5BFC\u822A/\u83DC\u5355\";if(t===\"header\"||o===\"banner\")return\"\u9875\u5934\";if(t===\"footer\"||o===\"contentinfo\")return\"\u9875\u811A\";if(t===\"aside\"||o===\"complementary\")return\"\u4FA7\u8FB9\u680F\";if(t===\"dialog\"||o===\"dialog\"||o===\"alertdialog\")return\"\u5F39\u7A97\";if(t===\"form\")return\"\u8868\u5355\";if(t===\"table\")return\"\u8868\u683C\";if(t===\"tr\")return\"\u8868\u683C\u884C\";if(t===\"th\"||t===\"td\")return\"\u5355\u5143\u683C\";if(t===\"li\")return\"\u5217\u8868\u9879\";if(t===\"ul\"||t===\"ol\")return\"\u5217\u8868\";if(t===\"section\"||t===\"article\"){let c=e.querySelector(\"h1,h2,h3,h4,h5,h6\"),g=(e.getAttribute(\"aria-label\")||c?.textContent||\"\").replace(/\\s+/g,\" \").trim();return g?`\u533A\u5757\u300C${ke(g,16)}\u300D`:\"\u533A\u5757\"}let i=Array.from(e.classList).find((c)=>/card|modal|dialog|drawer|side-?bar|menu|panel|toolbar|tabs?|header|footer|nav|hero|banner|widget|popover|dropdown/i.test(c));if(!i)return null;return`${/card/i.test(i)?\"\u5361\u7247\":/modal|dialog/i.test(i)?\"\u5F39\u7A97\":/drawer/i.test(i)?\"\u62BD\u5C49\":/side-?bar/i.test(i)?\"\u4FA7\u8FB9\u680F\":/toolbar/i.test(i)?\"\u5DE5\u5177\u680F\":/menu/i.test(i)?\"\u83DC\u5355\":/tab/i.test(i)?\"\u6807\u7B7E\u9875\":/panel/i.test(i)?\"\u9762\u677F\":/nav/i.test(i)?\"\u5BFC\u822A\":/header/i.test(i)?\"\u9875\u5934\":/footer/i.test(i)?\"\u9875\u811A\":/popover|dropdown/i.test(i)?\"\u6D6E\u5C42\":/hero|banner/i.test(i)?\"\u6A2A\u5E45\":\"\u533A\u5757\"}(.${i})`}function bo(e){let t=[],o=e.parentElement;while(o&&o.nodeType===1&&o!==document.body&&o!==document.documentElement){let E=ho(o);if(E&&t[t.length-1]!==E)t.push(E);o=o.parentElement}t.reverse();let i=e.getBoundingClientRect(),s=i.left+i.width/2,c=i.top+i.height/2,l=window.innerWidth||1,g=window.innerHeight||1,y=s<l/3?\"\u9760\u5DE6\":s>l*2/3?\"\u9760\u53F3\":\"\u6C34\u5E73\u5C45\u4E2D\",A=c<g/3?\"\u9760\u4E0A\":c>g*2/3?\"\u9760\u4E0B\":\"\u5782\u76F4\u5C45\u4E2D\";return{region:`${y} \u00B7 ${A}`,breadcrumb:t.slice(-5)}}function xt(e){let t=e.getBoundingClientRect(),{selector:o,strategy:i}=lo(e),s=(e.textContent||\"\").replace(/\\s+/g,\" \").trim(),c=bo(e);return{comment:\"\",type:\"style\",priority:\"medium\",target:{kind:\"element\",tagName:e.tagName.toLowerCase(),cssSelector:o,xpath:co(e),textContent:s?s.slice(0,200):void 0,attributes:po(e),boundingBox:{x:Math.round(t.left+window.scrollX),y:Math.round(t.top+window.scrollY),width:Math.round(t.width),height:Math.round(t.height)},domPath:uo(e),accessibility:{role:e.getAttribute(\"role\")||void 0,ariaLabel:e.getAttribute(\"aria-label\")||void 0},selectorStrategy:i,region:c.region,breadcrumb:c.breadcrumb},styleSummary:fo(e),geometry:go(e),pageContext:bt()}}function xo(e,t,o,i,s=8){let c=Math.max(s,i.width-o.width-s),l=Math.max(s,i.height-o.height-s);return{left:Math.min(Math.max(e,s),c),top:Math.min(Math.max(t,s),l)}}function yt(e,t){let o=!1,i=null,s=0,c=0,l=0,g=0;function y(){return{width:window.innerWidth,height:window.innerHeight}}function A(N,L){let de=e.getBoundingClientRect(),q=xo(N,L,{width:de.width,height:de.height},y());e.style.left=`${q.left}px`,e.style.top=`${q.top}px`,e.style.right=\"auto\",e.style.transform=\"none\"}function E(N){if(N.button!==0)return;N.preventDefault(),N.stopPropagation(),o=!0,i=N.pointerId,t.setPointerCapture?.(N.pointerId);let L=e.getBoundingClientRect();s=N.clientX,c=N.clientY,l=L.left,g=L.top,A(l,g),t.classList.add(\"dragging\")}function M(N){if(!o||i!=null&&N.pointerId!==i)return;N.preventDefault(),A(l+N.clientX-s,g+N.clientY-c)}function R(N){if(!o||i!=null&&N.pointerId!==i)return;o=!1,i=null,t.classList.remove(\"dragging\");try{t.releasePointerCapture?.(N.pointerId)}catch{}}function _(){let N=e.getBoundingClientRect();A(N.left,N.top)}return t.addEventListener(\"pointerdown\",E),t.addEventListener(\"pointermove\",M),t.addEventListener(\"pointerup\",R),t.addEventListener(\"pointercancel\",R),window.addEventListener(\"resize\",_),()=>{t.removeEventListener(\"pointerdown\",E),t.removeEventListener(\"pointermove\",M),t.removeEventListener(\"pointerup\",R),t.removeEventListener(\"pointercancel\",R),window.removeEventListener(\"resize\",_)}}function rn(e){if(e?.isConnected)e.remove()}function ce(e,t){let o=document.createElementNS(\"http://www.w3.org/2000/svg\",e);for(let[i,s]of Object.entries(t))o.setAttribute(i,s);return o}function yo(e){let t=ce(\"svg\",{viewBox:\"0 0 16 16\",width:\"14\",height:\"14\"});if(t.setAttribute(\"aria-hidden\",\"true\"),e===\"rect\")t.appendChild(ce(\"rect\",{x:\"3\",y:\"4\",width:\"10\",height:\"8\",rx:\"1.5\",fill:\"none\",stroke:\"currentColor\",\"stroke-width\":\"1.6\"}));else if(e===\"arrow\")t.appendChild(ce(\"path\",{d:\"M3 13 L12 4 M8 4 h4 v4\",fill:\"none\",stroke:\"currentColor\",\"stroke-width\":\"1.6\",\"stroke-linecap\":\"round\",\"stroke-linejoin\":\"round\"}));else t.appendChild(ce(\"path\",{d:\"M4 13 L8 3 L12 13 M5.5 10 h5\",fill:\"none\",stroke:\"currentColor\",\"stroke-width\":\"1.6\",\"stroke-linecap\":\"round\",\"stroke-linejoin\":\"round\"}));return t}function an(e,t){let o=!1,i=\"rect\",s=Wt(),c=ct,l=[],g=null,y=null,A=null,E=document.createElement(\"div\");E.className=\"mark-layer\";let M=ce(\"svg\",{class:\"mark-svg\"});M.setAttribute(\"width\",\"100%\"),M.setAttribute(\"height\",\"100%\"),E.appendChild(M),e.appendChild(E);let R=document.createElement(\"div\");R.className=\"mark-dock\",R.hidden=!0;let _=document.createElement(\"div\");_.className=\"mark-seg\";let N=new Map;for(let p of[\"rect\",\"arrow\",\"text\"]){let h=document.createElement(\"button\");h.type=\"button\",h.dataset.mark=p,h.setAttribute(\"aria-label\",p===\"rect\"?\"\u6846\u9009\":p===\"arrow\"?\"\u7BAD\u5934\":\"\u6587\u672C\"),h.title=h.getAttribute(\"aria-label\")??p,h.appendChild(yo(p)),h.addEventListener(\"click\",()=>{i=p,oe(),j()}),N.set(p,h),_.appendChild(h)}let L=document.createElement(\"div\");L.className=\"mark-colors\",L.setAttribute(\"role\",\"radiogroup\"),L.setAttribute(\"aria-label\",\"\u6279\u6CE8\u989C\u8272\");let de=[];for(let p of He){let h=document.createElement(\"button\");h.type=\"button\",h.className=\"mark-color\",h.style.background=p.value,h.setAttribute(\"aria-label\",p.label),h.title=p.label,h.addEventListener(\"click\",()=>{s=p.value,Ee()}),de.push(h),L.appendChild(h)}let q=document.createElement(\"div\");q.className=\"mark-size\",q.setAttribute(\"aria-label\",\"\u5B57\u53F7\");let V=document.createElement(\"button\");V.type=\"button\",V.setAttribute(\"aria-label\",\"\u51CF\u5C0F\u5B57\u53F7\"),V.title=\"\u51CF\u5C0F\u5B57\u53F7\",V.textContent=\"\u2212\";let we=document.createElement(\"span\");we.className=\"v\";let Z=document.createElement(\"button\");Z.type=\"button\",Z.setAttribute(\"aria-label\",\"\u589E\u5927\u5B57\u53F7\"),Z.title=\"\u589E\u5927\u5B57\u53F7\",Z.textContent=\"+\",q.append(V,we,Z);let J=document.createElement(\"input\");J.type=\"text\",J.className=\"mark-comment\",J.placeholder=\"\u8BF4\u660E\uFF08\u53EF\u9009\uFF09\",J.setAttribute(\"aria-label\",\"\u533A\u57DF\u6807\u6CE8\u8BF4\u660E\");let W=document.createElement(\"button\");W.type=\"button\",W.className=\"mark-save\",W.textContent=\"\u2713\",W.title=\"\u4FDD\u5B58\u533A\u57DF\u6807\u6CE8\",W.setAttribute(\"aria-label\",\"\u4FDD\u5B58\u533A\u57DF\u6807\u6CE8\"),W.disabled=!0,W.addEventListener(\"click\",()=>{if(!l.length||W.disabled)return;t.onSave({marks:l.map((p)=>({...p})),comment:J.value.trim()})}),R.append(_,L,q,J,W),e.appendChild(R);function oe(){for(let[p,h]of N)h.classList.toggle(\"on\",p===i)}function Ee(){de.forEach((p,h)=>{p.classList.toggle(\"on\",He[h]?.value===s)})}function Q(p){if(c=Ge(p),we.textContent=String(c),V.disabled=c<=Ht,Z.disabled=c>=Bt,A){A.style.fontSize=`${c}px`;return}for(let h=l.length-1;h>=0;h-=1){let x=l[h];if(x?.kind!==\"text\")continue;l[h]={...x,fontSize:c},P();break}}function ee(p){p.preventDefault()}V.addEventListener(\"mousedown\",ee),Z.addEventListener(\"mousedown\",ee),V.addEventListener(\"click\",()=>Q(c-lt)),Z.addEventListener(\"click\",()=>Q(c+lt));function te(){W.disabled=l.length===0,t.onBusyChange?.(!1)}function j(){g=null,y=null,P()}function Fe(){ie(!0)}function ie(p){let h=A;if(!h)return;A=null,h.removeEventListener(\"blur\",Fe);let x=h.value.trim(),v=Number.parseFloat(h.dataset.x??\"0\"),D=Number.parseFloat(h.dataset.y??\"0\");if(rn(h),p&&x)l.push({kind:\"text\",color:s,x:v,y:D,text:x,fontSize:c});P(),te()}function P(){M.replaceChildren();for(let x of[...E.querySelectorAll(\".mark-text\")]){if(x===A)continue;rn(x)}let p=ce(\"defs\",{});M.appendChild(p),(y?[...l,y]:l).forEach((x,v)=>{if(x.kind===\"rect\"){M.appendChild(ce(\"rect\",{x:String(x.x),y:String(x.y),width:String(x.width),height:String(x.height),fill:\"none\",stroke:x.color,\"stroke-width\":\"3\",rx:\"2\"}));return}if(x.kind===\"arrow\"){let Y=`uibot-arrow-${v}`,pe=ce(\"marker\",{id:Y,markerWidth:\"8\",markerHeight:\"8\",refX:\"6\",refY:\"4\",orient:\"auto\",markerUnits:\"strokeWidth\"});pe.appendChild(ce(\"path\",{d:\"M0,0 L8,4 L0,8 z\",fill:x.color})),p.appendChild(pe),M.appendChild(ce(\"line\",{x1:String(x.x1),y1:String(x.y1),x2:String(x.x2),y2:String(x.y2),stroke:x.color,\"stroke-width\":\"3\",\"stroke-linecap\":\"round\",\"marker-end\":`url(#${Y})`}));return}let D=document.createElement(\"div\");D.className=\"mark-text\",D.textContent=x.text,D.style.left=`${x.x}px`,D.style.top=`${x.y}px`,D.style.color=x.color,D.style.fontSize=`${x.fontSize}px`,E.appendChild(D)})}return oe(),Ee(),Q(c),P(),{setActive(p){if(o=p,R.hidden=!p,E.classList.toggle(\"on\",p),!p)ie(!1),l.length=0,J.value=\"\",i=\"rect\",Q(ct),j(),te(),oe()},isActive:()=>o,tool:()=>i,getMarks:()=>l.map((p)=>({...p})),addRect(p){if(!o)return;l.push({kind:\"rect\",color:s,...p}),P(),te()},handlePointerDown(p){if(!o||p.button!==0||A)return!1;if(p.target instanceof Node&&R.contains(p.target))return!1;return g={x:p.clientX,y:p.clientY},y=null,!0},handlePointerMove(p){if(!o||!g||i===\"text\")return!1;let h=Math.min(g.x,p.clientX),x=Math.min(g.y,p.clientY),v=Math.abs(p.clientX-g.x),D=Math.abs(p.clientY-g.y);return y=i===\"arrow\"?{kind:\"arrow\",color:s,x1:g.x,y1:g.y,x2:p.clientX,y2:p.clientY}:{kind:\"rect\",color:s,x:h,y:x,width:v,height:D},P(),!0},handlePointerUp(p){if(!o||p.button!==0)return!1;if(i===\"text\"){let x=g;if(g=null,!x)return!1;return ie(!1),A=document.createElement(\"input\"),A.className=\"mark-text editing\",A.dataset.x=String(p.clientX),A.dataset.y=String(p.clientY),A.style.left=`${p.clientX}px`,A.style.top=`${p.clientY}px`,A.style.color=s,A.style.fontSize=`${c}px`,A.placeholder=\"\u8F93\u5165\u6587\u5B57\",A.addEventListener(\"keydown\",(v)=>{if(v.key===\"Enter\")v.preventDefault(),ie(!0);else if(v.key===\"Escape\")v.preventDefault(),ie(!1)}),A.addEventListener(\"blur\",Fe),E.appendChild(A),A.focus(),!0}if(!g)return!1;let h=g;if(g=null,i===\"arrow\"){let x=p.clientX-h.x,v=p.clientY-h.y;if(Math.hypot(x,v)<8)return j(),!0;l.push({kind:\"arrow\",color:s,x1:h.x,y1:h.y,x2:p.clientX,y2:p.clientY})}else{let x={x:Math.min(h.x,p.clientX),y:Math.min(h.y,p.clientY),width:Math.abs(p.clientX-h.x),height:Math.abs(p.clientY-h.y)};if(x.width<8||x.height<8)return j(),!0;l.push({kind:\"rect\",color:s,...x})}return y=null,P(),te(),!0},handlePointerCancel(){if(!o)return;j()},captureRect(){return Be(l,16)},setCapturing(p){R.hidden=p||!o},setBusy(p){W.disabled=p||l.length===0,W.textContent=p?\"\u2026\":\"\u2713\",J.disabled=p},clear(){ie(!1),l.length=0,J.value=\"\",j(),te()},detach(){ie(!1),E.remove(),R.remove()}}}var vo=()=>globalThis.performance?.now()??Date.now();function sn(e,t=vo){let o=t(),i=(s,c,l)=>{e?.({stage:s,durationMs:Math.max(0,t()-c),outcome:l})};return{markFromStart(s,c=\"success\"){i(s,o,c)},start(s){let c=t(),l=!1;return(g=\"success\")=>{if(l)return;l=!0,i(s,c,g)}}}}function Ao(){return{requestIdleCallback:typeof window.requestIdleCallback===\"function\"?(e,t)=>window.requestIdleCallback(()=>e(),t):void 0,cancelIdleCallback:typeof window.cancelIdleCallback===\"function\"?(e)=>window.cancelIdleCallback(e):void 0,setTimeout:(e,t)=>window.setTimeout(e,t),clearTimeout:(e)=>window.clearTimeout(e)}}function ln(e,t=Ao()){let o=!0,i=()=>{if(!o)return;o=!1,e()};if(t.requestIdleCallback){let c=t.requestIdleCallback(i,{timeout:120});return()=>{if(!o)return;o=!1,t.cancelIdleCallback?.(c)}}let s=t.setTimeout(i,0);return()=>{if(!o)return;o=!1,t.clearTimeout(s)}}var cn=`\n *{box-sizing:border-box;font-family:-apple-system,BlinkMacSystemFont,\"Segoe UI\",system-ui,sans-serif;}\n .hl{position:fixed;border:2px solid var(--pa-accent, #7c2d34);background:var(--pa-accent-soft, rgba(124,45,52,0.10));border-radius:4px;\n pointer-events:none;transition:all .04s linear;z-index:1;box-shadow:0 0 0 1px var(--pa-outline, rgba(255,255,255,0.4));}\n .tag{position:fixed;background:var(--pa-accent, #7c2d34);color:var(--pa-accent-contrast, #f1f0ed);font-size:11px;line-height:1.4;font-weight:500;\n padding:2px 7px;border-radius:5px;pointer-events:none;white-space:nowrap;z-index:2;}\n .bar{position:fixed;top:14px;left:50%;transform:translateX(-50%);background:var(--pa-surface, rgba(23,23,26,0.94));\n color:var(--pa-surface-contrast, #fff);font-size:12.5px;padding:6px 6px 6px 8px;border-radius:999px;pointer-events:auto;\n z-index:5;display:flex;gap:8px;align-items:center;box-shadow:0 8px 24px var(--pa-shadow, rgba(0,0,0,0.28));}\n .bar .grip{display:flex;align-items:center;justify-content:center;width:18px;height:22px;padding:0;\n border:none;background:transparent;color:var(--pa-muted, rgba(255,255,255,0.72));cursor:grab;touch-action:none;}\n .bar .grip:hover,.bar .grip.dragging{color:var(--pa-surface-contrast, #fff);background:transparent;}\n .bar .grip.dragging{cursor:grabbing;}\n .bar button{background:var(--pa-hover, rgba(255,255,255,0.14));color:var(--pa-surface-contrast, #fff);border:none;border-radius:999px;\n padding:4px 11px;font-size:12px;cursor:pointer;transition:background .12s;}\n .bar button:hover{background:var(--pa-hover, rgba(255,255,255,0.26));}\n .bar button.exit{width:28px;height:28px;padding:0;display:flex;align-items:center;justify-content:center;}\n\n @keyframes uibotpop{from{opacity:0;transform:translateY(4px) scale(.98);}to{opacity:1;transform:none;}}\n\n .dd{position:relative;}\n .dd-btn{width:100%;display:flex;align-items:center;gap:6px;border:1px solid var(--pa-border, #e6d6bf);border-radius:9px;\n padding:7px 10px;font-size:12.5px;color:var(--pa-popover-contrast, #3b3024);background:var(--pa-popover, #fff);cursor:pointer;transition:border-color .12s,box-shadow .12s;}\n .dd-btn:hover{border-color:var(--pa-border, #d2bd9c);}\n .dd-btn.open{border-color:var(--pa-accent, #7c2d34);box-shadow:0 0 0 3px var(--pa-focus, rgba(124,45,52,0.14));}\n .dd-btn .v{flex:1;text-align:left;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;display:flex;align-items:center;gap:6px;}\n .dd-btn .chev{font-size:9px;color:var(--pa-muted, #b69b73);transition:transform .12s;}\n .dd-btn.open .chev{transform:rotate(180deg);}\n .dd-menu{position:absolute;left:0;right:0;top:calc(100% + 4px);background:var(--pa-popover, #fff);border:1px solid var(--pa-border, #ecdcc4);\n border-radius:10px;box-shadow:0 10px 28px var(--pa-shadow, rgba(60,40,15,0.18));padding:4px;z-index:10;max-height:208px;overflow:auto;}\n .dd-item{width:100%;display:flex;align-items:center;gap:7px;text-align:left;border:none;background:transparent;\n border-radius:7px;padding:7px 9px;font-size:12.5px;color:var(--pa-popover-contrast, #3b3024);cursor:pointer;}\n .dd-item:hover{background:var(--pa-hover, #f6ecdb);}\n .dd-item.sel{background:var(--pa-selected, #f1f0ed);color:var(--pa-accent-contrast, #7c2d34);font-weight:500;}\n .swatch{width:8px;height:8px;border-radius:50%;flex-shrink:0;}\n\n .toast{position:fixed;bottom:22px;left:50%;transform:translateX(-50%);color:var(--pa-surface-contrast, #fff);font-size:12.5px;\n padding:8px 16px;border-radius:999px;pointer-events:none;z-index:7;box-shadow:0 6px 20px var(--pa-shadow, rgba(0,0,0,0.2));}\n .pin{position:fixed;width:21px;height:21px;border-radius:50% 50% 50% 2px;background:var(--pa-accent, #7c2d34);color:var(--pa-accent-contrast, #f1f0ed);\n font-size:11px;font-weight:700;display:flex;align-items:center;justify-content:center;\n pointer-events:none;z-index:3;box-shadow:0 2px 6px var(--pa-shadow, rgba(0,0,0,0.3));}\n .pin.marker{pointer-events:auto;cursor:pointer;transition:transform .1s;}\n .pin.marker:hover{transform:scale(1.18);}\n .flash{position:fixed;border:3px solid var(--pa-accent, #7c2d34);border-radius:4px;pointer-events:none;z-index:4;\n animation:uibotflash 1.2s ease-out forwards;}\n @keyframes uibotflash{0%{box-shadow:0 0 0 5px var(--pa-accent-halo, rgba(124,45,52,0.45));}100%{box-shadow:0 0 0 5px var(--pa-accent-halo, rgba(124,45,52,0));}}\n .selbox{position:fixed;border:2px solid var(--pa-accent, #7c2d34);border-radius:4px;pointer-events:none;z-index:2;\n box-shadow:0 0 0 1px var(--pa-outline, rgba(241,240,237,0.35));background:var(--pa-accent-soft, rgba(124,45,52,0.06));}\n .pin.active{background:var(--pa-accent, #7c2d34);}\n .region-box{position:fixed;border:2px solid var(--pa-accent, #7c2d34);background:var(--pa-accent-soft, rgba(124,45,52,.10));pointer-events:none;z-index:3;display:none;}\n .region-size{position:absolute;right:0;bottom:-24px;background:var(--pa-surface, #17171a);color:var(--pa-surface-contrast, #f1f0ed);border-radius:999px;padding:3px 7px;font-size:11px;white-space:nowrap;}\n .sr-live{position:fixed;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap;}\n .mark-layer{position:fixed;inset:0;pointer-events:none;z-index:4;}\n .mark-layer .mark-svg{position:absolute;inset:0;width:100%;height:100%;overflow:visible;}\n .mark-text{position:fixed;font-size:15px;font-weight:700;line-height:1.2;pointer-events:none;white-space:pre;\n text-shadow:0 1px 2px var(--pa-shadow, rgba(0,0,0,.75)),0 0 8px var(--pa-shadow, rgba(0,0,0,.45));z-index:4;}\n .mark-text.editing{pointer-events:auto;min-width:72px;background:var(--pa-surface, rgba(23,23,26,.9));border:1px solid var(--pa-border, rgba(255,255,255,.24));\n border-radius:6px;padding:4px 8px;outline:none;font:inherit;}\n .mark-dock{position:fixed;top:58px;left:50%;transform:translateX(-50%);background:var(--pa-surface, rgba(23,23,26,0.94));color:var(--pa-surface-contrast, #fff);\n padding:6px 8px;border-radius:14px;pointer-events:auto;z-index:5;display:flex;gap:8px;align-items:center;\n flex-wrap:wrap;max-width:calc(100vw - 16px);box-shadow:0 8px 24px var(--pa-shadow, rgba(0,0,0,0.28));}\n .mark-dock[hidden]{display:none;}\n .mark-seg{display:flex;background:var(--pa-field, rgba(255,255,255,0.12));border-radius:999px;padding:2px;gap:2px;}\n .mark-seg button{width:28px;height:26px;padding:0;display:flex;align-items:center;justify-content:center;\n background:transparent;border:none;color:var(--pa-muted, rgba(255,255,255,.72));border-radius:999px;cursor:pointer;}\n .mark-seg button.on{background:var(--pa-selected, #f1f0ed);color:var(--pa-accent-contrast, #17171a);}\n .mark-colors{display:flex;gap:5px;align-items:center;}\n .mark-color{width:16px;height:16px;border-radius:50%;border:2px solid transparent;padding:0;cursor:pointer;\n box-shadow:inset 0 0 0 1px var(--pa-shadow, rgba(0,0,0,.28));}\n .mark-color.on{border-color:var(--pa-surface-contrast, #fff);}\n .mark-size{display:flex;align-items:center;gap:2px;background:var(--pa-field, rgba(255,255,255,0.12));border-radius:999px;padding:2px 4px;}\n .mark-size button{width:22px;height:22px;padding:0;border:none;border-radius:999px;background:transparent;\n color:var(--pa-surface-contrast, #fff);cursor:pointer;font-size:14px;line-height:1;}\n .mark-size button:hover:not(:disabled){background:var(--pa-hover, rgba(255,255,255,0.16));}\n .mark-size button:disabled{opacity:.34;cursor:default;}\n .mark-size .v{min-width:22px;text-align:center;font-size:11px;font-variant-numeric:tabular-nums;color:var(--pa-surface-contrast, #f1f0ed);}\n .mark-comment{width:120px;height:28px;border:1px solid var(--pa-border, rgba(255,255,255,.18));background:var(--pa-field, rgba(0,0,0,.25));\n color:var(--pa-surface-contrast, #f1f0ed);border-radius:8px;padding:0 8px;font-size:12px;outline:none;}\n .mark-save{width:28px;height:28px;border:none;border-radius:50%;background:var(--pa-selected, #f1f0ed);color:var(--pa-accent-contrast, #17171a);cursor:pointer;font-size:15px;}\n .mark-save:disabled{opacity:.45;cursor:default;}\n :host(.capturing) .bar,:host(.capturing) .mark-dock,:host(.capturing) .epanel,:host(.capturing) .pin,\n :host(.capturing) .toast,:host(.capturing) .hl,:host(.capturing) .tag,:host(.capturing) .region-box,\n :host(.capturing) .region-size{visibility:hidden!important;}\n\n .seg{display:flex;background:var(--pa-field, rgba(255,255,255,0.12));border-radius:999px;padding:2px;}\n .seg button{background:transparent;border:none;color:var(--pa-muted, rgba(255,255,255,0.72));padding:3px 12px;\n border-radius:999px;font-size:12px;cursor:pointer;transition:background .12s,color .12s;}\n .seg button.on{background:var(--pa-selected, #f1f0ed);color:var(--pa-accent-contrast, #17171a);font-weight:600;}\n\n .epanel{position:fixed;width:340px;max-width:94vw;background:var(--pa-surface, #17171a);border:1px solid var(--pa-border, #3a352f);\n border-radius:16px;box-shadow:0 18px 48px var(--pa-shadow, rgba(0,0,0,0.5));pointer-events:auto;z-index:6;\n color:var(--pa-surface-contrast, #f1f0ed);overflow:hidden;animation:uibotpop .12s ease-out;}\n .epanel .etop{display:flex;align-items:center;gap:9px;padding:11px 13px;border-bottom:1px solid var(--pa-border, #332f29);}\n .epanel .etop .ico{flex-shrink:0;color:var(--pa-muted, #b9b1a4);font-size:15px;}\n .epanel .etop input{flex:1;background:transparent;border:none;outline:none;color:var(--pa-surface-contrast, #ece7df);font-size:13.5px;}\n .epanel .etop input::placeholder{color:var(--pa-muted, #8a8275);}\n .epanel .etop textarea{flex:1;background:transparent;border:none;outline:none;color:var(--pa-surface-contrast, #ece7df);font-size:13.5px;\n resize:none;font-family:inherit;line-height:1.45;max-height:96px;padding:0;}\n .epanel .etop textarea::placeholder{color:var(--pa-muted, #8a8275);}\n .epanel .ehead{display:flex;align-items:center;padding:8px 14px 4px;color:var(--pa-surface-contrast, #cfc8bb);font-size:12.5px;cursor:move;user-select:none;}\n .epanel .ehead .tg{font-family:ui-monospace,Menlo,monospace;color:var(--pa-surface-contrast, #e7e0d4);}\n .epanel .ehead .grip{margin-left:auto;color:var(--pa-muted, #6f685c);letter-spacing:2px;font-size:12px;}\n .erows{max-height:46vh;overflow:auto;padding:2px 0 4px;}\n .erow{display:flex;align-items:center;gap:10px;padding:6px 14px;}\n .erow>span.lb{width:64px;flex-shrink:0;font-size:12.5px;color:var(--pa-muted, #a9a194);}\n .erow .ctl{flex:1;min-width:0;}\n .efield{width:100%;display:flex;align-items:center;gap:8px;background:var(--pa-field, #1d1b19);border:1px solid var(--pa-border, #3a352f);\n border-radius:9px;padding:7px 10px;transition:border-color .12s;}\n .efield:focus-within{border-color:var(--pa-accent, #7c2d34);}\n .efield input{flex:1;min-width:0;background:transparent;border:none;outline:none;color:var(--pa-surface-contrast, #ece7df);\n font-size:12.5px;font-family:ui-monospace,Menlo,monospace;}\n .sw{width:22px;height:22px;border-radius:50%;flex-shrink:0;border:1px solid var(--pa-border, rgba(255,255,255,0.28));cursor:pointer;\n background-image:linear-gradient(45deg,var(--pa-checker, #555) 25%,transparent 25%),linear-gradient(-45deg,var(--pa-checker, #555) 25%,transparent 25%),linear-gradient(45deg,transparent 75%,var(--pa-checker, #555) 75%),linear-gradient(-45deg,transparent 75%,var(--pa-checker, #555) 75%);\n background-size:8px 8px;background-position:0 0,0 4px,4px -4px,-4px 0;position:relative;overflow:hidden;}\n .sw i{position:absolute;inset:0;border-radius:50%;}\n .sw:focus-within{outline:2px solid var(--pa-selected, #f1f0ed);outline-offset:2px;}\n .color-hit{position:absolute;inset:0;width:100%!important;height:100%;opacity:0;cursor:pointer;pointer-events:auto;}\n .stepper{display:grid;grid-template-columns:30px minmax(48px,1fr) auto 30px;align-items:center;gap:4px;padding:3px;}\n .stepper button{width:30px;height:30px;border:0;border-radius:7px;background:var(--pa-field, #2b2723);color:var(--pa-surface-contrast, #ece7df);cursor:pointer;\n display:flex;align-items:center;justify-content:center;transition:background .12s,color .12s;}\n .stepper button:hover:not(:disabled){background:var(--pa-hover, #3b352e);color:var(--pa-surface-contrast, #fff);}\n .stepper button:disabled{opacity:.34;cursor:default;}\n .stepper button svg{width:14px;height:14px;pointer-events:none;}\n .stepper input[type=number]{width:100%;text-align:center;font-variant-numeric:tabular-nums;appearance:textfield;}\n .stepper input[type=number]::-webkit-inner-spin-button,.stepper input[type=number]::-webkit-outer-spin-button{appearance:none;margin:0;}\n .stepper .unit{min-width:18px;color:var(--pa-muted, #8a8275);font-size:11px;text-align:left;}\n .ebar{display:flex;align-items:center;padding:11px 14px;border-top:1px solid var(--pa-border, #332f29);gap:10px;}\n .ebar .cancel{background:transparent;border:1px solid var(--pa-border, #4a443c);color:var(--pa-surface-contrast, #cfc8bb);border-radius:999px;\n padding:6px 16px;font-size:13px;cursor:pointer;transition:background .12s;}\n .ebar .cancel:hover{background:var(--pa-hover, rgba(255,255,255,0.06));}\n .ebar .ok{margin-left:auto;width:36px;height:36px;border-radius:50%;background:var(--pa-selected, #f1f0ed);color:var(--pa-accent-contrast, #17171a);border:none;\n cursor:pointer;display:flex;align-items:center;justify-content:center;font-size:17px;line-height:1;transition:background .12s;}\n .ebar .ok:hover{background:var(--pa-hover, #f0ece4);}\n .ebar .ok:disabled{opacity:.55;cursor:default;}\n .epanel .dd-btn{background:var(--pa-field, #1d1b19);border-color:var(--pa-border, #3a352f);color:var(--pa-surface-contrast, #ece7df);}\n .epanel .dd-btn:hover{border-color:var(--pa-border, #5a5347);}\n .epanel .dd-btn.open{border-color:var(--pa-accent, #7c2d34);box-shadow:0 0 0 3px var(--pa-focus, rgba(124,45,52,0.18));}\n .epanel .dd-btn .chev{color:var(--pa-muted, #8a8275);}\n .epanel .dd-menu{background:var(--pa-field, #2b2723);border-color:var(--pa-border, #3a352f);}\n .epanel .dd-item{color:var(--pa-surface-contrast, #ece7df);}\n .epanel .dd-item:hover{background:var(--pa-hover, #37322b);}\n .epanel .dd-item.sel{background:var(--pa-selected, #3f372c);color:var(--pa-accent-contrast, #f1f0ed);}\n .quick-target{padding:10px 14px 0;color:var(--pa-muted, #a9a194);font-size:12px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}\n .quick-more{background:transparent;border:0;color:var(--pa-surface-contrast, #cfc8bb);cursor:pointer;padding:8px 14px;text-align:left;font-size:12px;}\n .advanced{border-top:1px solid var(--pa-border, #332f29);padding:4px 0;}\n .advanced[hidden]{display:none;}\n .advanced textarea{width:100%;min-height:54px;resize:vertical;background:var(--pa-field, #1d1b19);border:1px solid var(--pa-border, #3a352f);border-radius:9px;color:var(--pa-surface-contrast, #ece7df);padding:8px;font-size:12px;}\n .advanced select{width:100%;min-height:34px;background:var(--pa-field, #1d1b19);border:1px solid var(--pa-border, #3a352f);border-radius:9px;color:var(--pa-surface-contrast, #ece7df);padding:6px 8px;}\n @media (prefers-reduced-motion: reduce){\n *,*::before,*::after{animation:none!important;transition:none!important;scroll-behavior:auto!important;}\n }\n`;function dn(e){let t=document.createElementNS(\"http://www.w3.org/2000/svg\",\"svg\");return t.setAttribute(\"viewBox\",\"0 0 16 16\"),t.setAttribute(\"width\",\"14\"),t.setAttribute(\"height\",\"14\"),t.setAttribute(\"aria-hidden\",\"true\"),e(t),t}function ko(){return dn((e)=>{for(let[t,o]of[[5.5,3],[10.5,3],[5.5,8],[10.5,8],[5.5,13],[10.5,13]]){let i=document.createElementNS(\"http://www.w3.org/2000/svg\",\"circle\");i.setAttribute(\"cx\",String(t)),i.setAttribute(\"cy\",String(o)),i.setAttribute(\"r\",\"1.15\"),i.setAttribute(\"fill\",\"currentColor\"),e.appendChild(i)}})}function wo(){return dn((e)=>{let t=document.createElementNS(\"http://www.w3.org/2000/svg\",\"path\");t.setAttribute(\"d\",\"M4 4l8 8M12 4l-8 8\"),t.setAttribute(\"fill\",\"none\"),t.setAttribute(\"stroke\",\"currentColor\"),t.setAttribute(\"stroke-width\",\"1.8\"),t.setAttribute(\"stroke-linecap\",\"round\"),e.appendChild(t)})}function un(e,t){let o=e.annotationRegionV2!==!1,i=\"__uibotAnnotatorActive\",s=window;if(s.__uibotAnnotatorActive)return;s.__uibotAnnotatorActive=!0;let c=sn(t.recordPerformance?.bind(t)),l=()=>{return},g=document.createElement(\"div\");g.id=\"__uibot-annotator-host\",g.style.cssText=\"position:fixed;inset:0;z-index:2147483646;pointer-events:none;color-scheme:dark;\",en(g,e.theme);let y=g.attachShadow({mode:\"open\"});(document.documentElement||document.body).appendChild(g);let A=document.createElement(\"style\");A.textContent=cn,y.appendChild(A);let E=document.createElement(\"div\");y.appendChild(E);let M=document.createElement(\"div\");M.className=\"hl\",M.style.display=\"none\";let R=document.createElement(\"div\");R.className=\"tag\",R.style.display=\"none\";let _=document.createElement(\"div\");_.className=\"selbox\",_.style.display=\"none\";let N=document.createElement(\"div\");N.className=\"pin active\",N.style.display=\"none\";let L=document.createElement(\"div\");L.className=\"region-box\";let de=document.createElement(\"span\");de.className=\"region-size\",L.appendChild(de);let q=document.createElement(\"div\");q.className=\"sr-live\",q.setAttribute(\"aria-live\",\"polite\"),E.append(M,R,_,N,L,q);let V=null;function we(n,r){V=n,N.textContent=String(r),J()}function Z(){V=null,_.style.display=\"none\",N.style.display=\"none\"}function J(){if(!V)return;let n=V.getBoundingClientRect();_.style.display=\"block\",_.style.left=`${n.left-1}px`,_.style.top=`${n.top-1}px`,_.style.width=`${n.width+2}px`,_.style.height=`${n.height+2}px`,N.style.display=\"flex\",N.style.left=`${Math.max(2,n.left-6)}px`,N.style.top=`${Math.max(2,n.top-6)}px`}let W=document.createElement(\"div\");W.className=\"bar\";let oe=document.createElement(\"button\");oe.type=\"button\",oe.className=\"grip\",oe.setAttribute(\"aria-label\",\"\u62D6\u52A8\u5DE5\u5177\u680F\"),oe.title=\"\u62D6\u52A8\",oe.appendChild(ko());let Ee=document.createElement(\"div\");Ee.className=\"seg\";let Q=document.createElement(\"button\");Q.type=\"button\",Q.dataset.tool=\"element\",Q.textContent=\"\u5143\u7D20\",Q.className=\"on\";let ee=document.createElement(\"button\");ee.type=\"button\",ee.dataset.tool=\"region\",ee.textContent=\"\u533A\u57DF\",ee.disabled=!o,ee.title=o?\"\u6846\u9009\u533A\u57DF\":\"\u533A\u57DF\u6807\u6CE8\u5DF2\u5173\u95ED\";let te=document.createElement(\"button\");te.type=\"button\",te.dataset.tool=\"adjust\",te.textContent=\"\u8C03\u6574\",Ee.append(Q,ee,te);let j=document.createElement(\"button\");j.type=\"button\",j.className=\"exit\",j.setAttribute(\"aria-label\",\"\u9000\u51FA\"),j.title=\"\u9000\u51FA\",j.appendChild(wo()),W.append(oe,Ee,j),E.appendChild(W);let Fe=yt(W,oe),ie={current:()=>{return}},P=an(E,{onSave:(n)=>ie.current(n)}),p=\"element\",h=\"hovering\",x=null,v=null,D=null,Y=!1,pe=null,fe=null;function Je(){if(pe&&fe!=null)try{pe.releasePointerCapture?.(fe)}catch{}pe=null,fe=null}function Qe(){Je(),D=null,Y=!1,v=null,L.style.display=\"none\"}function Ne(n){if(n===\"region\"&&!o)return;if(n===p)return;Mt(!0),p=n,Q.classList.toggle(\"on\",p===\"element\"),ee.classList.toggle(\"on\",p===\"region\"),te.classList.toggle(\"on\",p===\"adjust\"),tt(),L.style.display=\"none\",v=null,D=null,Y=!1,Je(),P.setActive(p===\"region\")}Q.addEventListener(\"click\",()=>Ne(\"element\")),ee.addEventListener(\"click\",()=>Ne(\"region\")),te.addEventListener(\"click\",()=>Ne(\"adjust\"));function ae(n,r,a){return Math.min(a,Math.max(r,n))}function To(n,r){let a=ae(n.x,0,window.innerWidth),u=ae(n.y,0,window.innerHeight),f=ae(r.x,0,window.innerWidth),m=ae(r.y,0,window.innerHeight),d={x:Math.min(a,f),y:Math.min(u,m),width:Math.abs(f-a),height:Math.abs(m-u)};return d.width>=8&&d.height>=8?d:null}function et(n){L.style.display=\"block\",L.style.left=`${n.x}px`,L.style.top=`${n.y}px`,L.style.width=`${n.width}px`,L.style.height=`${n.height}px`,de.textContent=`${Math.round(n.width)} \u00D7 ${Math.round(n.height)}`,q.textContent=`\u533A\u57DF x ${Math.round(n.x)}\uFF0Cy ${Math.round(n.y)}\uFF0C\u5BBD ${Math.round(n.width)}\uFF0C\u9AD8 ${Math.round(n.height)}`}function fn(n){let r=[[n.x+n.width/2,n.y+n.height/2],[n.x+1,n.y+1],[n.x+n.width-1,n.y+n.height-1]],a=[];return r.forEach(([u,f])=>{let m=document.elementFromPoint(u,f);if(!m||Ye(m)||a.some((d)=>d.tagName===m.tagName.toLowerCase()))return;a.push({tagName:m.tagName.toLowerCase(),...ke(m.textContent||\"\",60)?{text:ke(m.textContent||\"\",60)}:{},...m.getAttribute(\"role\")?{role:m.getAttribute(\"role\")}:{}})}),a}function vt(n,r=[]){let a={x:Math.round(n.x+window.scrollX),y:Math.round(n.y+window.scrollY),width:Math.round(n.width),height:Math.round(n.height)},u={width:window.innerWidth,height:window.innerHeight},f={x:window.scrollX,y:window.scrollY},m=Vt(r,window.scrollX,window.scrollY);return{comment:\"\",type:\"other\",priority:\"medium\",target:{kind:\"region\",rect:a,viewport:u,scroll:f,devicePixelRatio:window.devicePixelRatio||1,topLevelElements:fn(n),...m.length?{marks:m}:{}},styleSummary:{},geometry:{viewport:u,scroll:f,devicePixelRatio:window.devicePixelRatio||1,center:{x:Math.round(n.x+n.width/2),y:Math.round(n.y+n.height/2)},visible:!0},pageContext:bt()}}function At(n){let r=n.getBoundingClientRect();M.style.display=\"block\",M.style.left=`${r.left}px`,M.style.top=`${r.top}px`,M.style.width=`${r.width}px`,M.style.height=`${r.height}px`;let a=Array.from(n.classList).slice(0,2).join(\".\");R.textContent=`${n.tagName.toLowerCase()}${a?\".\"+a:\"\"} \u00B7 ${Math.round(r.width)}\u00D7${Math.round(r.height)}`,R.style.display=\"block\";let u=r.top>22?r.top-20:r.bottom+4;R.style.left=`${Math.max(2,r.left)}px`,R.style.top=`${u}px`}function tt(){M.style.display=\"none\",R.style.display=\"none\"}function Me(n){let r=document.createElement(\"div\");r.className=\"toast\",r.style.background=\"var(--pa-success, #15803d)\",r.style.color=\"var(--pa-success-contrast, #fff)\",r.textContent=n,E.appendChild(r),setTimeout(()=>r.remove(),1600)}let kt={blocker:0,high:1,medium:2,low:3},Te=[];function mn(n){let r=n.getBoundingClientRect(),a=document.createElement(\"div\");a.className=\"flash\",a.style.left=`${r.left-2}px`,a.style.top=`${r.top-2}px`,a.style.width=`${r.width+4}px`,a.style.height=`${r.height+4}px`,E.appendChild(a),setTimeout(()=>a.remove(),1300)}function nt(n,r){let a=n.kind===\"element\"?document.querySelector(n.cssSelector):null;if(n.kind===\"element\"&&!a){r.style.display=\"none\";return}let u=a?.getBoundingClientRect()??{left:n.kind===\"region\"?n.rect.x-window.scrollX:0,top:n.kind===\"region\"?n.rect.y-window.scrollY:0,width:n.kind===\"region\"?n.rect.width:0,height:n.kind===\"region\"?n.rect.height:0};if(u.width===0&&u.height===0){r.style.display=\"none\";return}r.style.display=\"flex\",r.style.left=`${Math.max(2,u.left-6)}px`,r.style.top=`${Math.max(2,u.top-6)}px`}function wt(){for(let n of Te)n.pinEl.remove();Te=[]}function gn(n){wt(),n.filter((a)=>a.status===\"open\"||a.status===\"processing\").sort((a,u)=>(kt[a.priority]??9)-(kt[u.priority]??9)||(a.createdAt||\"\").localeCompare(u.createdAt||\"\")).forEach((a,u)=>{if(!a.target||a.target.kind===\"element\"&&!a.target.cssSelector)return;let f=document.createElement(\"div\");f.className=\"pin marker\",f.textContent=String(u+1),f.title=a.comment||\"\",f.addEventListener(\"click\",(m)=>{m.stopPropagation();let d=a.target.kind===\"element\"?document.querySelector(a.target.cssSelector):null;if(d)d.scrollIntoView({block:\"center\"}),mn(d),Me(a.comment?`#${u+1} ${a.comment}`:`#${u+1}`),nt(a.target,f);else if(a.target.kind===\"region\")window.scrollTo({top:Math.max(0,a.target.rect.y-window.innerHeight/2),left:a.target.rect.x}),et({x:a.target.rect.x-window.scrollX,y:a.target.rect.y-window.scrollY,width:a.target.rect.width,height:a.target.rect.height}),setTimeout(()=>{if(!v)L.style.display=\"none\"},1300),Me(a.comment?`#${u+1} ${a.comment}`:`#${u+1}`);else G(`#${u+1} \u5143\u7D20\u672A\u627E\u5230\uFF08\u9875\u9762\u53EF\u80FD\u5DF2\u53D8\u5316\uFF09`)}),E.appendChild(f),Te.push({target:a.target,pinEl:f}),nt(a.target,f)})}async function Re(){let n=c.start(\"markers_loaded\");try{let r=await t.sendMessage({action:H.list,pageUrl:location.href});if(r&&r.success&&Array.isArray(r.data))gn(r.data),n(\"success\");else n(\"failure\")}catch{n(\"failure\")}}let me=[];function hn(n,r,a){let u=r,f=document.createElement(\"div\");f.className=\"dd\";let m=document.createElement(\"button\");m.type=\"button\",m.className=\"dd-btn\";let d=document.createElement(\"span\");d.className=\"v\";let b=document.createElement(\"span\");b.className=\"chev\",b.textContent=\"\u25BE\",m.append(d,b);let k=document.createElement(\"div\");k.className=\"dd-menu\",k.style.display=\"none\";function O(){let C=n.find((I)=>I.value===u);if(d.textContent=\"\",C?.color){let I=document.createElement(\"span\");I.className=\"swatch\",I.style.background=C.color,d.appendChild(I)}d.appendChild(document.createTextNode(C?.label??\"\")),Array.from(k.children).forEach((I,S)=>{I.classList.toggle(\"sel\",n[S].value===u)})}function w(){k.style.display=\"none\",m.classList.remove(\"open\")}function z(){for(let C of me)C();k.style.display=\"block\",m.classList.add(\"open\")}return me.push(w),n.forEach((C)=>{let I=document.createElement(\"button\");if(I.type=\"button\",I.className=\"dd-item\",C.color){let S=document.createElement(\"span\");S.className=\"swatch\",S.style.background=C.color,I.appendChild(S)}I.appendChild(document.createTextNode(C.label)),I.addEventListener(\"click\",(S)=>{S.stopPropagation(),u=C.value,O(),w(),a?.(u)}),k.appendChild(I)}),m.addEventListener(\"click\",(C)=>{C.stopPropagation(),k.style.display===\"none\"?z():w()}),f.append(m,k),O(),{el:f,get:()=>u,close:w}}let bn=[{value:\"style\",label:\"\u6837\u5F0F\u95EE\u9898\"},{value:\"copywriting\",label:\"\u6587\u6848\u4FEE\u6539\"},{value:\"bug\",label:\"Bug\"},{value:\"feature\",label:\"\u529F\u80FD\u5EFA\u8BAE\"},{value:\"interaction\",label:\"\u4EA4\u4E92\u95EE\u9898\"},{value:\"data\",label:\"\u6570\u636E\u95EE\u9898\"},{value:\"other\",label:\"\u5176\u4ED6\"}],xn=[{value:\"low\",label:\"\u4F4E\",color:\"var(--pa-muted, #737373)\"},{value:\"medium\",label:\"\u4E2D\",color:\"var(--pa-surface-contrast, #17171a)\"},{value:\"high\",label:\"\u9AD8\",color:\"var(--pa-accent, #7c2d34)\"},{value:\"blocker\",label:\"\u963B\u585E\",color:\"var(--pa-danger, #5c151c)\"}],F=null,K=null,Le=null,_e=null,Pe=null,Oe=null,se=null;function Et(n){let r=document.createElement(\"button\");return r.type=\"button\",r.className=\"ok\",r.dataset.icon=\"confirm\",r.textContent=\"\u2713\",r.title=n,r.setAttribute(\"aria-label\",n),r}function Ce(n,r){if(!n)return;n.textContent=r?\"\u2026\":\"\u2713\",n.toggleAttribute(\"aria-busy\",r),n.disabled=r}function ot(){F?.remove(),F=null,K=Le=_e=se=null,Pe=Oe=null,me.length=0,Z(),L.style.display=\"none\",h=\"hovering\",x=null,v=null,Y=!1}function Nt(n,r){if(r&&!o)return;if(h=\"editing\",x=n,v=r??null,tt(),n)we(n,Te.length+1);else Z();if(r)et(r);let a=n?.getBoundingClientRect(),u=a?{left:a.left,top:a.top,right:a.right,bottom:a.bottom}:r?{left:r.x,top:r.y,right:r.x+r.width,bottom:r.y+r.height}:{left:8,top:80,right:8,bottom:80};me.length=0,F=document.createElement(\"div\"),F.className=\"epanel\",F.setAttribute(\"role\",\"dialog\"),F.setAttribute(\"aria-modal\",\"true\"),F.setAttribute(\"aria-label\",r?\"\u65B0\u5EFA\u533A\u57DF\u6807\u6CE8\":\"\u65B0\u5EFA\u5143\u7D20\u6807\u6CE8\"),F.addEventListener(\"click\",()=>{for(let T of me)T()});let f=document.createElement(\"div\");f.className=\"quick-target\",f.textContent=r?`\u533A\u57DF ${Math.round(r.width)}\u00D7${Math.round(r.height)}`:`${n.tagName.toLowerCase()}\u300C${ke(n.textContent||\"\",28)}\u300D`;let m=document.createElement(\"div\");m.className=\"etop\",K=document.createElement(\"textarea\"),K.rows=3,K.placeholder=\"\u54EA\u91CC\u4E0D\u5BF9\uFF1F\u8BF4\u660E\u671F\u671B\u5373\u53EF\uFF0C\u4F8B\u5982\uFF1A\u79FB\u52A8\u7AEF\u6309\u94AE\u6587\u5B57\u6362\u884C\uFF1B\u80FD\u653E\u4E0B\u65F6\u4FDD\u6301\u5355\u884C\uFF0C\u4E14\u5361\u7247\u9AD8\u5EA6\u4E0D\u53D8\u3002\",K.addEventListener(\"input\",()=>{if(K.style.height=\"auto\",K.style.height=`${Math.min(Math.max(K.scrollHeight,72),144)}px`,se)se.disabled=!K.value.trim()}),m.append(K);let d=document.createElement(\"button\");d.type=\"button\",d.dataset.action=\"more\",d.className=\"quick-more\",d.textContent=\"\u66F4\u591A\u8BBE\u7F6E \u25BE\",d.setAttribute(\"aria-expanded\",\"false\");let b=document.createElement(\"div\");b.className=\"advanced\",b.id=\"__uibot-annotation-advanced\",b.hidden=!0,d.setAttribute(\"aria-controls\",b.id);let k=(T,ue)=>{let le=document.createElement(\"label\");le.className=\"erow\";let U=document.createElement(\"span\");U.className=\"lb\",U.textContent=T;let ge=document.createElement(\"div\");return ge.className=\"ctl\",ge.append(ue),le.append(U,ge),le};Le=document.createElement(\"textarea\"),Le.placeholder=\"\u4F8B\u5982\uFF1A\u5BBD\u5EA6\u8DB3\u591F\u65F6\u4FDD\u6301\u5355\u884C\",_e=document.createElement(\"textarea\"),_e.placeholder=\"\u4F8B\u5982\uFF1A\u5361\u7247\u9AD8\u5EA6\u548C\u70B9\u51FB\u884C\u4E3A\u4E0D\u53D8\",Pe=document.createElement(\"select\");for(let T of bn)Pe.add(new Option(T.label,T.value,!1,T.value===\"other\"));Oe=document.createElement(\"select\");for(let T of xn)Oe.add(new Option(T.label,T.value,!1,T.value===\"medium\"));b.append(k(\"\u671F\u671B\u7ED3\u679C\uFF08\u53EF\u9009\uFF09\",Le),k(\"\u4FDD\u62A4\u8303\u56F4\uFF08\u53EF\u9009\uFF09\",_e),k(\"\u7C7B\u578B\",Pe),k(\"\u4F18\u5148\u7EA7\",Oe)),d.addEventListener(\"click\",(T)=>{T.stopPropagation(),b.hidden=!b.hidden,d.textContent=b.hidden?\"\u66F4\u591A\u8BBE\u7F6E \u25BE\":\"\u6536\u8D77\u8BBE\u7F6E \u25B4\",d.setAttribute(\"aria-expanded\",String(!b.hidden))});let O=document.createElement(\"div\");O.className=\"ebar\";let w=document.createElement(\"button\");w.type=\"button\",w.className=\"cancel\",w.textContent=\"\u53D6\u6D88\",w.addEventListener(\"click\",ot),se=Et(\"\u4FDD\u5B58\u6807\u6CE8\"),se.dataset.action=\"save\",se.disabled=!0,se.addEventListener(\"click\",()=>void Tt()),O.append(w,se),F.append(f,m,d,b,O),F.addEventListener(\"keydown\",(T)=>{if(T.key===\"Enter\"&&(T.ctrlKey||T.metaKey)){if(T.preventDefault(),!se?.disabled)Tt();return}if(T.key!==\"Tab\")return;let ue=[...F.querySelectorAll(\"button:not([disabled]),textarea:not([disabled]),select:not([disabled]),input:not([disabled])\")].filter((at)=>!at.closest(\"[hidden]\"));if(!ue.length)return;let le=ue[0],U=ue[ue.length-1],ge=y.activeElement;if(T.shiftKey&&ge===le)T.preventDefault(),U.focus();else if(!T.shiftKey&&ge===U)T.preventDefault(),le.focus()}),E.appendChild(F);let z=340,C=u.left,I=u.bottom+10;if(C+z>window.innerWidth-8)C=window.innerWidth-z-8;if(C<8)C=8;let S=F.offsetHeight||300;if(I+S>window.innerHeight-8)I=Math.max(8,u.top-S-10);F.style.left=`${C}px`,F.style.top=`${I}px`,K.focus()}async function Tt(){if(!x&&!v||!K)return;if(v&&!o){G(\"\u533A\u57DF\u6807\u6CE8\u5DF2\u5173\u95ED\uFF0C\u8BF7\u6539\u7528\u5143\u7D20\u6807\u6CE8\");return}let n=K.value.trim();if(!n){G(\"\u8BF7\u5148\u586B\u5199\u6807\u6CE8\u5185\u5BB9\"),K.focus();return}let r=v?vt(v):xt(x);r.comment=n,r.type=Pe?.value??\"other\",r.priority=Oe?.value??\"medium\";let a=Le?.value.trim();if(a)r.expectedResult=a;let u=_e?.value.trim();if(u)r.preserve=u;g.style.visibility=\"hidden\";let f=se;Ce(f,!0);let m=c.start(\"save_durable\");try{let d=await t.sendMessage({action:H.save,data:r});if(g.style.visibility=\"visible\",d&&d.success){m(\"success\"),ot(),Re(),Me(\"\u5DF2\u4FDD\u5B58\");let b=d.data?.id;if(b)t.sendMessage({action:H.enrich,annotationId:b,data:r}).catch(()=>{})}else m(\"failure\"),console.error(\"[uibot annotation] save rejected:\",d),G(d?.error?`\u4FDD\u5B58\u5931\u8D25\uFF1A${d.error}`:\"\u4FDD\u5B58\u5931\u8D25\"),Ce(f,!1)}catch(d){m(\"failure\"),g.style.visibility=\"visible\",console.error(\"[uibot annotation] save threw:\",d);let b=d instanceof Error?d.message:String(d);G(/context invalidated/i.test(b)?\"\u8BF7\u5237\u65B0\u9875\u9762\u540E\u91CD\u65B0\u6807\u6CE8\":`\u4FDD\u5B58\u5931\u8D25\uFF1A${b}`),Ce(f,!1)}}async function yn(){return new Promise((n)=>{let r=!1,a=(u)=>{if(r)return;r=!0,n(u)};s.__uibotAnnotationCaptureDone=()=>a(!0),window.setTimeout(()=>a(!1),4000)})}async function vn(n){if(!o){G(\"\u533A\u57DF\u6807\u6CE8\u5DF2\u5173\u95ED\uFF0C\u8BF7\u6539\u7528\u5143\u7D20\u6807\u6CE8\");return}let r=Be(n.marks,0),a=r?dt(r,{width:window.innerWidth,height:window.innerHeight}):null;if(!a){G(\"\u8BF7\u5148\u6846\u9009\u533A\u57DF\u6216\u6DFB\u52A0\u7BAD\u5934/\u6587\u672C\");return}let u=n.comment.trim()||Ut(n.marks),f=vt(a,n.marks);f.comment=u,P.setBusy(!0),g.classList.add(\"capturing\"),P.setCapturing(!0);let m=c.start(\"save_durable\");try{let d=await t.sendMessage({action:H.save,data:f});if(d&&d.success){m(\"success\");let b=d.data?.id,k=dt(Be(n.marks,16)??a,{width:window.innerWidth,height:window.innerHeight}),O=!0;if(b&&k){s.__uibotAnnotationCapture={id:b,...k},await new Promise((w)=>{requestAnimationFrame(()=>requestAnimationFrame(()=>w()))});try{console.debug(Gt)}catch{}O=await yn()}if(P.clear(),P.setBusy(!1),Re(),O)Me(\"\u5DF2\u4FDD\u5B58\");else G(\"\u6807\u6CE8\u5DF2\u4FDD\u5B58\uFF0C\u622A\u56FE\u672A\u5B8C\u6210\");if(b)t.sendMessage({action:H.enrich,annotationId:b,data:f}).catch(()=>{})}else m(\"failure\"),G(d?.error?`\u4FDD\u5B58\u5931\u8D25\uFF1A${d.error}`:\"\u4FDD\u5B58\u5931\u8D25\"),P.setBusy(!1)}catch(d){m(\"failure\");let b=d instanceof Error?d.message:String(d);G(/context invalidated/i.test(b)?\"\u8BF7\u5237\u65B0\u9875\u9762\u540E\u91CD\u65B0\u6807\u6CE8\":`\u4FDD\u5B58\u5931\u8D25\uFF1A${b}`),P.setBusy(!1)}finally{g.classList.remove(\"capturing\"),P.setCapturing(!1),delete s.__uibotAnnotationCapture,delete s.__uibotAnnotationCaptureDone}}ie.current=(n)=>{vn(n)};function G(n){let r=document.createElement(\"div\");r.className=\"toast\",r.style.background=\"var(--pa-danger, #b91c1c)\",r.style.color=\"var(--pa-danger-contrast, #fff)\",r.textContent=n,E.appendChild(r),setTimeout(()=>r.remove(),1800)}let ne=null,Ue=null,Se=null,Ie=null,ye=[],$e=[];function An(n){let r=n.match(/rgba?\\((\\d+),\\s*(\\d+),\\s*(\\d+)/);if(!r){let u=document.createElement(\"span\");if(u.style.color=n,!u.style.color)u.style.color=\"var(--pa-color-default, #000000)\";y.appendChild(u);let f=getComputedStyle(u).color;u.remove();let m=document.createElement(\"canvas\").getContext(\"2d\");if(!m)return\"#000000\";if(m.fillStyle=f,/^#[0-9a-f]{6}$/i.test(m.fillStyle))return m.fillStyle;m.fillRect(0,0,1,1);let d=m.getImageData(0,0,1,1).data;return`#${[d[0],d[1],d[2]].map((b)=>(b??0).toString(16).padStart(2,\"0\")).join(\"\")}`}let a=(u)=>Math.max(0,Math.min(255,Number.parseInt(u,10))).toString(16).padStart(2,\"0\");return`#${a(r[1])}${a(r[2])}${a(r[3])}`}function ze(n,r,a){n.style.setProperty(r,a)}function rt(n,r){let a=n.style.getPropertyValue(r);$e.push(()=>{if(a)n.style.setProperty(r,a);else n.style.removeProperty(r)})}function Ve(n){let r=document.createElement(\"div\");r.className=\"erow\";let a=document.createElement(\"span\");a.className=\"lb\",a.textContent=n;let u=document.createElement(\"div\");return u.className=\"ctl\",r.append(a,u),{row:r,ctl:u}}function Ct(n,r,a,u){let f=u.getPropertyValue(a).trim();rt(n,a);let{row:m,ctl:d}=Ve(r),b=document.createElement(\"div\");b.className=\"efield\";let k=document.createElement(\"label\");k.className=\"sw\";let O=document.createElement(\"i\");O.style.background=f,k.appendChild(O);let w=document.createElement(\"input\");w.value=f;let z=document.createElement(\"input\");return z.type=\"color\",z.value=An(f),z.className=\"color-hit\",z.setAttribute(\"aria-label\",`\u9009\u62E9${r}`),z.addEventListener(\"input\",()=>{w.value=z.value,O.style.background=z.value,ze(n,a,z.value)}),w.addEventListener(\"input\",()=>{O.style.background=w.value,ze(n,a,w.value)}),k.appendChild(z),b.append(k,w),d.appendChild(b),ye.push({kind:\"style\",label:r,property:a,before:f,read:()=>w.value.trim()}),m}function St(n){let r=document.createElementNS(\"http://www.w3.org/2000/svg\",\"svg\");r.setAttribute(\"viewBox\",\"0 0 16 16\"),r.setAttribute(\"aria-hidden\",\"true\");let a=document.createElementNS(\"http://www.w3.org/2000/svg\",\"path\");if(a.setAttribute(\"d\",\"M3 8h10\"),a.setAttribute(\"fill\",\"none\"),a.setAttribute(\"stroke\",\"currentColor\"),a.setAttribute(\"stroke-width\",\"1.8\"),a.setAttribute(\"stroke-linecap\",\"round\"),r.appendChild(a),n===\"plus\"){let u=a.cloneNode();u.setAttribute(\"d\",\"M8 3v10\"),r.appendChild(u)}return r}function je(n,r,a,u,f){let m=u.getPropertyValue(a).trim();rt(n,a);let{row:d,ctl:b}=Ve(r),k=document.createElement(\"div\");k.className=\"efield stepper\";let O=document.createElement(\"button\");O.type=\"button\",O.setAttribute(\"aria-label\",`\u964D\u4F4E${r}`),O.appendChild(St(\"minus\"));let w=document.createElement(\"input\");w.type=\"number\",w.min=String(f.min),w.max=String(f.max),w.step=String(f.step),w.setAttribute(\"aria-label\",r);let z=document.createElement(\"span\");z.className=\"unit\",z.textContent=f.unit;let C=document.createElement(\"button\");C.type=\"button\",C.setAttribute(\"aria-label\",`\u63D0\u9AD8${r}`),C.appendChild(St(\"plus\"));let I=Math.max(0,(String(f.step).split(\".\")[1]||\"\").length),S=(U)=>{let ge=ae(Number.isFinite(U)?U:f.min,f.min,f.max),at=Math.round(ge/f.step)*f.step;return Number(at.toFixed(I))},T=S(f.fromCss(m)),ue=()=>{w.value=String(T),O.disabled=T<=f.min,C.disabled=T>=f.max,ze(n,a,f.toCss(T))},le=(U)=>{T=S(U),ue()};return w.value=String(T),w.addEventListener(\"input\",()=>{let U=Number(w.value);if(Number.isFinite(U))T=U,ze(n,a,f.toCss(ae(U,f.min,f.max)))}),w.addEventListener(\"change\",()=>le(Number(w.value))),O.addEventListener(\"click\",()=>le(T-f.step)),C.addEventListener(\"click\",()=>le(T+f.step)),ue(),k.append(O,w,z,C),b.appendChild(k),ye.push({kind:\"style\",label:r,property:a,before:m,read:()=>f.toCss(T)}),d}function kn(n){let r=n.textContent||\"\",a=r.replace(/\\s+/g,\" \").trim();$e.push(()=>{n.textContent=r});let{row:u,ctl:f}=Ve(\"\u6587\u6848\"),m=document.createElement(\"div\");m.className=\"efield\";let d=document.createElement(\"input\");return d.value=a,m.appendChild(d),f.appendChild(m),d.addEventListener(\"input\",()=>{n.textContent=d.value}),ye.push({kind:\"text\",label:\"\u6587\u6848\",before:a,read:()=>d.value.trim()}),u}function wn(n,r){let a=r.getPropertyValue(\"font-weight\").trim()||\"400\";rt(n,\"font-weight\");let{row:u,ctl:f}=Ve(\"\u5B57\u91CD\"),m=[{value:\"300\",label:\"\u7EC6 300\"},{value:\"400\",label:\"\u5E38\u89C4 400\"},{value:\"500\",label:\"\u4E2D 500\"},{value:\"600\",label:\"\u534A\u7C97 600\"},{value:\"700\",label:\"\u7C97 700\"}],d=m.some((k)=>k.value===a)?a:\"400\",b=hn(m,d,(k)=>ze(n,\"font-weight\",k));return f.appendChild(b.el),ye.push({kind:\"style\",label:\"\u5B57\u91CD\",property:\"font-weight\",before:a,read:()=>b.get()}),u}let De=()=>{return};function it(n){if(n)$e.forEach((r)=>{try{r()}catch{}});$e.length=0,ye=[],De(),De=()=>{return},ne?.remove(),ne=null,Ue=null,Se=Ie=null,me.length=0,Z(),h=\"hovering\",x=null}function Mt(n){if(F)ot();if(ne)it(n)}function En(n){h=\"editing\",x=n,Ue=n,tt(),we(n,Te.length+1),ye=[],$e.length=0,me.length=0;let r=getComputedStyle(n),a=n.getBoundingClientRect();ne=document.createElement(\"div\"),ne.className=\"epanel\",ne.addEventListener(\"click\",()=>{for(let S of me)S()});let u=document.createElement(\"div\");u.className=\"etop\";let f=document.createElement(\"span\");f.className=\"ico\",f.textContent=\"\u2699\",Se=document.createElement(\"input\"),Se.placeholder=\"\u7528\u4E00\u53E5\u8BDD\u63CF\u8FF0\u60F3\u8981\u7684\u4FEE\u6539\uFF08\u53EF\u9009\uFF09\",u.append(f,Se);let m=document.createElement(\"div\");m.className=\"ehead\";let d=document.createElement(\"span\");d.className=\"tg\",d.textContent=n.tagName.toLowerCase();let b=document.createElement(\"span\");b.className=\"grip\",b.textContent=\"\u283F\",m.append(d,b);let k=document.createElement(\"div\");if(k.className=\"erows\",n.children.length===0&&(n.textContent||\"\").trim())k.appendChild(kn(n));k.appendChild(Ct(n,\"\u6587\u5B57\u989C\u8272\",\"color\",r)),k.appendChild(Ct(n,\"\u80CC\u666F\",\"background-color\",r)),k.appendChild(je(n,\"\u4E0D\u900F\u660E\u5EA6\",\"opacity\",r,{min:0,max:100,step:5,unit:\"%\",fromCss:(S)=>Number.parseFloat(S||\"1\")*100,toCss:(S)=>String(S/100)})),k.appendChild(je(n,\"\u5B57\u53F7\",\"font-size\",r,{min:8,max:96,step:1,unit:\"px\",fromCss:(S)=>Number.parseFloat(S||\"16\"),toCss:(S)=>`${S}px`})),k.appendChild(wn(n,r)),k.appendChild(je(n,\"\u5706\u89D2\",\"border-radius\",r,{min:0,max:96,step:1,unit:\"px\",fromCss:(S)=>Number.parseFloat(S||\"0\"),toCss:(S)=>`${S}px`})),k.appendChild(je(n,\"\u5185\u8FB9\u8DDD\",\"padding\",r,{min:0,max:96,step:1,unit:\"px\",fromCss:(S)=>Number.parseFloat(S||\"0\"),toCss:(S)=>`${S}px`}));let O=document.createElement(\"div\");O.className=\"ebar\";let w=document.createElement(\"button\");w.type=\"button\",w.className=\"cancel\",w.textContent=\"\u53D6\u6D88\",w.addEventListener(\"click\",()=>it(!0)),Ie=Et(\"\u4FDD\u5B58\u4FEE\u6539\"),Ie.addEventListener(\"click\",()=>void Tn()),O.append(w,Ie),ne.append(u,m,k,O),E.appendChild(ne),De(),De=yt(ne,m);let z=340,C=a.right+12;if(C+z>window.innerWidth-8)C=Math.max(8,a.left-z-12);if(C<8)C=8;let I=Math.max(8,Math.min(a.top,window.innerHeight-(ne.offsetHeight||360)-8));ne.style.left=`${C}px`,ne.style.top=`${I}px`,Se.focus()}function Nn(n){return n.map((r)=>`${r.label} ${ke(r.before,24)}\u2192${ke(r.after,24)}`).join(\"\uFF1B\")}async function Tn(){if(!Ue)return;let n=Ue,r=[];for(let d of ye){let b=d.read();if(b!==d.before)r.push({kind:d.kind,label:d.label,property:d.property,before:d.before,after:b})}let a=Se?.value.trim()||\"\";if(r.length===0&&!a){G(\"\u672A\u505A\u4EFB\u4F55\u4FEE\u6539\");return}let u=xt(n);u.type=\"style\",u.edits=r;let f=Nn(r);if(u.comment=a||(f?`\u53EF\u89C6\u5316\u4FEE\u6539\uFF1A${f}`:\"\u53EF\u89C6\u5316\u4FEE\u6539\"),a&&f)u.expectedResult=f;g.style.visibility=\"hidden\";let m=Ie;Ce(m,!0);try{let d=await t.sendMessage({action:H.save,data:u});if(g.style.visibility=\"visible\",d&&d.success){it(!1),Re(),Me(\"\u5DF2\u4FDD\u5B58\");let b=d.data?.id;if(b)t.sendMessage({action:H.enrich,annotationId:b,data:u}).catch(()=>{})}else console.error(\"[uibot annotation] edit save rejected:\",d),G(d?.error?`\u4FDD\u5B58\u5931\u8D25\uFF1A${d.error}`:\"\u4FDD\u5B58\u5931\u8D25\"),Ce(m,!1)}catch(d){g.style.visibility=\"visible\";let b=d instanceof Error?d.message:String(d);G(/context invalidated/i.test(b)?\"\u8BF7\u5237\u65B0\u9875\u9762\u540E\u91CD\u8BD5\":`\u4FDD\u5B58\u5931\u8D25\uFF1A${b}`),Ce(m,!1)}}function Ye(n){return n instanceof Node&&g.contains(n)}function Rt(n){if(h!==\"hovering\"||p===\"region\")return;let r=n.target;if(!r||Ye(r)||r===g)return;x=r,At(r)}function Lt(n){if(Ye(n.target))return;let r=n.target;if(!r)return;if(n.preventDefault(),n.stopPropagation(),n.stopImmediatePropagation?.(),h===\"hovering\"){if(p===\"adjust\")En(r);else if(p===\"element\")Nt(r)}}function Cn(){let n=y.activeElement;return n instanceof HTMLInputElement||n instanceof HTMLTextAreaElement||n instanceof HTMLElement&&n.isContentEditable}function _t(n){if(Cn()||n.target instanceof HTMLInputElement||n.target instanceof HTMLTextAreaElement||n.target instanceof HTMLElement&&n.target.isContentEditable)return;if(h===\"hovering\"&&!Y){if(n.key.toLowerCase()===\"e\")Ne(\"element\");if(o&&n.key.toLowerCase()===\"r\")Ne(\"region\");if(n.key.toLowerCase()===\"a\")Ne(\"adjust\")}if(o&&p===\"region\"&&Y&&v&&h===\"hovering\"){if(n.key===\"Enter\"){n.preventDefault(),Y=!1,Nt(null,v);return}if(n.key.startsWith(\"Arrow\")){n.preventDefault();let a=n.shiftKey?10:1,u=n.key.replace(\"Arrow\",\"\").toLowerCase();if(n.altKey){let f=u===\"left\"?-a:u===\"right\"?a:0,m=u===\"up\"?-a:u===\"down\"?a:0;v={...v,width:ae(v.width+f,8,window.innerWidth-v.x),height:ae(v.height+m,8,window.innerHeight-v.y)}}else{let f=u===\"left\"?-a:u===\"right\"?a:0,m=u===\"up\"?-a:u===\"down\"?a:0;v={...v,x:ae(v.x+f,0,window.innerWidth-v.width),y:ae(v.y+m,0,window.innerHeight-v.height)}}et(v);return}}if(n.key!==\"Escape\")return;if(P.isActive()&&(P.getMarks().length>0||D||Y)){P.clear(),Qe();return}if(D||Y){D=null,Y=!1,v=null,L.style.display=\"none\";return}if(h===\"editing\")Mt(!0);else Xe(!0)}function Pt(n){if(!o||p!==\"region\"||h!==\"hovering\"||Ye(n.target))return;let r=n;if(!P.handlePointerDown(r))return;r.preventDefault(),r.stopPropagation(),pe=r.target instanceof Element?r.target:null,fe=r.pointerId;try{pe?.setPointerCapture?.(r.pointerId)}catch{}D={x:r.clientX,y:r.clientY},v=null,Y=!1}function Ot(n){if(!o||p!==\"region\"||h!==\"hovering\")return;let r=n;if(!P.handlePointerMove(r))return;r.preventDefault()}function It(n){if(!o||p!==\"region\"||h!==\"hovering\")return;let r=n;if(r.button!==0||fe!=null&&r.pointerId!==fe)return;if(P.handlePointerUp(r))r.preventDefault(),r.stopPropagation();Je(),D=null,L.style.display=\"none\"}function $t(n){let r=n;if(fe!=null&&r.pointerId!==fe)return;P.handlePointerCancel(),Qe()}ee.addEventListener(\"keydown\",(n)=>{if(!o||n.key!==\"Enter\"||p!==\"region\")return;n.preventDefault(),n.stopPropagation();let r=Math.min(160,window.innerWidth),a=Math.min(96,window.innerHeight);v={x:Math.round((window.innerWidth-r)/2),y:Math.round((window.innerHeight-a)/2),width:r,height:a},Y=!1,P.addRect(v),L.style.display=\"none\"});function Ke(){if(D)Qe();if(h===\"hovering\"&&x)At(x);if(V)J();for(let n of Te)nt(n.target,n.pinEl)}document.addEventListener(\"mousemove\",Rt,!0),document.addEventListener(\"click\",Lt,!0),document.addEventListener(\"keydown\",_t,!0),document.addEventListener(\"pointerdown\",Pt,!0),document.addEventListener(\"pointermove\",Ot,!0),document.addEventListener(\"pointerup\",It,!0),document.addEventListener(\"pointercancel\",$t,!0),window.addEventListener(\"scroll\",Ke,!0),window.addEventListener(\"resize\",Ke,!0),j.addEventListener(\"click\",()=>Xe(!0));function Xe(n){let r=c.start(\"overlay_exit\");if(l(),Fe(),De(),P.detach(),document.removeEventListener(\"mousemove\",Rt,!0),document.removeEventListener(\"click\",Lt,!0),document.removeEventListener(\"keydown\",_t,!0),document.removeEventListener(\"pointerdown\",Pt,!0),document.removeEventListener(\"pointermove\",Ot,!0),document.removeEventListener(\"pointerup\",It,!0),document.removeEventListener(\"pointercancel\",$t,!0),window.removeEventListener(\"scroll\",Ke,!0),window.removeEventListener(\"resize\",Ke,!0),Mn(),wt(),g.remove(),delete s.__uibotAnnotatorActive,delete s.__uibotAnnotatorTeardown,r(\"success\"),n)try{t.sendMessage({action:H.closed}).catch(()=>{}),s.__uibotAnnotationClosed?.()}catch{}}function Sn(n){if(n.action===H.teardown)Xe(!1);else if(n.action===H.changed)Re()}let Mn=t.subscribe(Sn);s.__uibotAnnotatorTeardown=()=>Xe(!1),c.markFromStart(\"overlay_ready\"),l=ln(()=>{Re()})}function Eo(){let e=globalThis.__uibotAnnotationTheme;return e&&typeof e===\"object\"?e:void 0}function pn(e={}){let t=e.theme??Eo();un({annotationRegionV2:e.annotationRegionV2!==!1,...t?{theme:t}:{}},Jt())}pn({annotationRegionV2:!0});})();";
|
|
@@ -1,46 +1,46 @@
|
|
|
1
1
|
export declare const ANNOTATION_MARK_COLORS: readonly [{
|
|
2
|
-
readonly id:
|
|
3
|
-
readonly value:
|
|
4
|
-
readonly label:
|
|
2
|
+
readonly id: "red";
|
|
3
|
+
readonly value: "#ef4444";
|
|
4
|
+
readonly label: "红";
|
|
5
5
|
}, {
|
|
6
|
-
readonly id:
|
|
7
|
-
readonly value:
|
|
8
|
-
readonly label:
|
|
6
|
+
readonly id: "orange";
|
|
7
|
+
readonly value: "#f97316";
|
|
8
|
+
readonly label: "橙";
|
|
9
9
|
}, {
|
|
10
|
-
readonly id:
|
|
11
|
-
readonly value:
|
|
12
|
-
readonly label:
|
|
10
|
+
readonly id: "yellow";
|
|
11
|
+
readonly value: "#eab308";
|
|
12
|
+
readonly label: "黄";
|
|
13
13
|
}, {
|
|
14
|
-
readonly id:
|
|
15
|
-
readonly value:
|
|
16
|
-
readonly label:
|
|
14
|
+
readonly id: "green";
|
|
15
|
+
readonly value: "#22c55e";
|
|
16
|
+
readonly label: "绿";
|
|
17
17
|
}, {
|
|
18
|
-
readonly id:
|
|
19
|
-
readonly value:
|
|
20
|
-
readonly label:
|
|
18
|
+
readonly id: "blue";
|
|
19
|
+
readonly value: "#3b82f6";
|
|
20
|
+
readonly label: "蓝";
|
|
21
21
|
}, {
|
|
22
|
-
readonly id:
|
|
23
|
-
readonly value:
|
|
24
|
-
readonly label:
|
|
22
|
+
readonly id: "white";
|
|
23
|
+
readonly value: "#f8fafc";
|
|
24
|
+
readonly label: "白";
|
|
25
25
|
}];
|
|
26
|
-
export type AnnotationMarkColorId = (typeof ANNOTATION_MARK_COLORS)[number][
|
|
27
|
-
export type RegionMarkKind =
|
|
26
|
+
export type AnnotationMarkColorId = (typeof ANNOTATION_MARK_COLORS)[number]["id"];
|
|
27
|
+
export type RegionMarkKind = "rect" | "arrow" | "text";
|
|
28
28
|
export type RegionMark = {
|
|
29
|
-
kind:
|
|
29
|
+
kind: "rect";
|
|
30
30
|
color: string;
|
|
31
31
|
x: number;
|
|
32
32
|
y: number;
|
|
33
33
|
width: number;
|
|
34
34
|
height: number;
|
|
35
35
|
} | {
|
|
36
|
-
kind:
|
|
36
|
+
kind: "arrow";
|
|
37
37
|
color: string;
|
|
38
38
|
x1: number;
|
|
39
39
|
y1: number;
|
|
40
40
|
x2: number;
|
|
41
41
|
y2: number;
|
|
42
42
|
} | {
|
|
43
|
-
kind:
|
|
43
|
+
kind: "text";
|
|
44
44
|
color: string;
|
|
45
45
|
x: number;
|
|
46
46
|
y: number;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import type { RegionMark } from
|
|
2
|
-
export type AnnotationType =
|
|
3
|
-
export type AnnotationPriority =
|
|
4
|
-
export type AnnotationStatus =
|
|
5
|
-
export type PromptMode =
|
|
6
|
-
export type SelectorStrategy =
|
|
1
|
+
import type { RegionMark } from "./marks.js";
|
|
2
|
+
export type AnnotationType = "bug" | "style" | "copywriting" | "feature" | "interaction" | "data" | "other";
|
|
3
|
+
export type AnnotationPriority = "low" | "medium" | "high" | "blocker";
|
|
4
|
+
export type AnnotationStatus = "open" | "processing" | "done" | "verified" | "ignored";
|
|
5
|
+
export type PromptMode = "minimal" | "standard" | "compact";
|
|
6
|
+
export type SelectorStrategy = "testid" | "id" | "aria" | "class" | "text" | "path";
|
|
7
7
|
export interface PageRect {
|
|
8
8
|
x: number;
|
|
9
9
|
y: number;
|
|
@@ -17,7 +17,7 @@ export interface AnnotationSourceLocation {
|
|
|
17
17
|
componentName?: string | undefined;
|
|
18
18
|
}
|
|
19
19
|
export interface WebAnnotationElementTarget {
|
|
20
|
-
kind:
|
|
20
|
+
kind: "element";
|
|
21
21
|
tagName: string;
|
|
22
22
|
cssSelector: string;
|
|
23
23
|
xpath: string;
|
|
@@ -37,7 +37,7 @@ export interface WebAnnotationElementTarget {
|
|
|
37
37
|
sourceStack?: AnnotationSourceLocation[] | undefined;
|
|
38
38
|
}
|
|
39
39
|
export interface WebAnnotationRegionTarget {
|
|
40
|
-
kind:
|
|
40
|
+
kind: "region";
|
|
41
41
|
rect: PageRect;
|
|
42
42
|
viewport: {
|
|
43
43
|
width: number;
|
|
@@ -92,15 +92,15 @@ export interface AnnotationPageContext {
|
|
|
92
92
|
x: number;
|
|
93
93
|
y: number;
|
|
94
94
|
};
|
|
95
|
-
theme?:
|
|
96
|
-
framework?:
|
|
95
|
+
theme?: "light" | "dark" | "unknown" | undefined;
|
|
96
|
+
framework?: "react" | "vue" | "angular" | "svelte" | "nextjs" | "nuxt" | "unknown" | undefined;
|
|
97
97
|
language?: string | undefined;
|
|
98
98
|
userAgent?: string | undefined;
|
|
99
99
|
capturedAt: string;
|
|
100
100
|
uiState?: string | undefined;
|
|
101
101
|
}
|
|
102
102
|
export interface AnnotationEdit {
|
|
103
|
-
kind:
|
|
103
|
+
kind: "style" | "text";
|
|
104
104
|
label: string;
|
|
105
105
|
property?: string | undefined;
|
|
106
106
|
before: string;
|
|
@@ -136,8 +136,8 @@ export interface WebAnnotationDraft {
|
|
|
136
136
|
pageContext: AnnotationPageContext;
|
|
137
137
|
edits?: AnnotationEdit[] | undefined;
|
|
138
138
|
}
|
|
139
|
-
export type EvidenceKind =
|
|
140
|
-
export type EvidenceAvailability =
|
|
139
|
+
export type EvidenceKind = "target-location" | "screenshot" | "context-bundle" | "dom-snapshot" | "style-snapshot";
|
|
140
|
+
export type EvidenceAvailability = "inline" | "exported-file" | "url" | "none";
|
|
141
141
|
export interface EvidenceReference {
|
|
142
142
|
annotationId?: string | undefined;
|
|
143
143
|
kind: EvidenceKind;
|
|
@@ -153,7 +153,7 @@ export interface DeliverySummary {
|
|
|
153
153
|
disabledReason?: string | undefined;
|
|
154
154
|
}
|
|
155
155
|
export interface DeliveryPlan {
|
|
156
|
-
channel:
|
|
156
|
+
channel: "clipboard-text" | "download-file";
|
|
157
157
|
itemCount: number;
|
|
158
158
|
text: string;
|
|
159
159
|
activeAnnotationIds: string[];
|
|
@@ -161,18 +161,18 @@ export interface DeliveryPlan {
|
|
|
161
161
|
summary: DeliverySummary;
|
|
162
162
|
}
|
|
163
163
|
export interface DeliveryReceipt {
|
|
164
|
-
channel:
|
|
164
|
+
channel: "clipboard-text" | "download-file";
|
|
165
165
|
itemCount: number;
|
|
166
166
|
evidence: EvidenceReference[];
|
|
167
167
|
userMessage: string;
|
|
168
168
|
filename?: string | undefined;
|
|
169
169
|
}
|
|
170
170
|
export interface AnnotationContextBundleV2 {
|
|
171
|
-
schema:
|
|
172
|
-
version:
|
|
171
|
+
schema: "uibot/web-annotation-context";
|
|
172
|
+
version: "2.0";
|
|
173
173
|
contextId: string;
|
|
174
174
|
createdAt: string;
|
|
175
|
-
scope:
|
|
175
|
+
scope: "active" | "all";
|
|
176
176
|
page?: AnnotationPageContext | undefined;
|
|
177
177
|
summary: {
|
|
178
178
|
totalAnnotations: number;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { AnnotationContextBundleV2, NormalizationResult, WebPageAnnotation } from
|
|
1
|
+
import type { AnnotationContextBundleV2, NormalizationResult, WebPageAnnotation } from "./model.js";
|
|
2
2
|
export declare function normalizePageAnnotation(raw: unknown): NormalizationResult<WebPageAnnotation>;
|
|
3
3
|
export declare function normalizePageAnnotations(raw: readonly unknown[]): {
|
|
4
4
|
annotations: WebPageAnnotation[];
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import type { AnnotationDraft, SelectorStrategy } from
|
|
1
|
+
import type { AnnotationDraft, SelectorStrategy } from "../types.js";
|
|
2
2
|
export declare function isStableClass(cls: string): boolean;
|
|
3
3
|
export declare function isStableId(id: string): boolean;
|
|
4
4
|
export declare function buildSelector(el: Element): {
|
|
5
5
|
selector: string;
|
|
6
6
|
strategy: SelectorStrategy;
|
|
7
7
|
};
|
|
8
|
-
export declare function collectPageContext(): AnnotationDraft[
|
|
8
|
+
export declare function collectPageContext(): AnnotationDraft["pageContext"];
|
|
9
9
|
export declare function shortText(value: string, max: number): string;
|
|
10
10
|
export declare function buildElementAnnotationDraft(el: Element): AnnotationDraft;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import type { AnnotationRuntimeHost } from
|
|
1
|
+
import type { AnnotationRuntimeHost } from "./ports.js";
|
|
2
2
|
/** Host that keeps annotations in the current document. Electron injects this with the overlay. */
|
|
3
3
|
export declare function createInPageAnnotationHost(): AnnotationRuntimeHost;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export { ANNOTATION_ACTIONS, ANNOTATION_CAPTURE_MARK, isAnnotationRuntimeControlMessage, normalizePageUrl, type AnnotationAction, type AnnotationRuntimeControlMessage, type AnnotationRuntimeOptions, type AnnotationRuntimeOutboundMessage, } from "./protocol.js";
|
|
2
|
+
export { startAnnotationRuntime } from "./overlay.js";
|
|
3
|
+
export { attachOverlayDrag, clampOverlayPosition } from "./overlay-drag.js";
|
|
4
|
+
export { attachRegionMarkup } from "./overlay-marks.js";
|
|
5
|
+
export { createInPageAnnotationHost } from "./in-page-host.js";
|
|
6
|
+
export type { AnnotationRuntimeHost, AnnotationRuntimeResponse } from "./ports.js";
|
|
7
|
+
export { ANNOTATION_PERFORMANCE_STAGES, createAnnotationPerformanceTracker, type AnnotationPerformanceEntry, type AnnotationPerformanceOutcome, type AnnotationPerformanceStage, } from "./performance.js";
|
|
8
|
+
export { scheduleAnnotationIdleTask } from "./scheduler.js";
|
|
9
|
+
export { buildElementAnnotationDraft, collectPageContext, shortText } from "./capture.js";
|
|
10
|
+
export * from "../theme.js";
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* The Electron guest injects a bundled IIFE of this module. Hosts talk only through
|
|
5
5
|
* AnnotationRuntimeHost; storage and screenshots stay outside the overlay.
|
|
6
6
|
*/
|
|
7
|
-
import type { AnnotationRuntimeHost } from
|
|
8
|
-
import { type AnnotationRuntimeOptions } from
|
|
7
|
+
import type { AnnotationRuntimeHost } from "./ports.js";
|
|
8
|
+
import { type AnnotationRuntimeOptions } from "./protocol.js";
|
|
9
9
|
/** Framework-free overlay orchestrator. Product hosts provide messaging through a port. */
|
|
10
10
|
export declare function startAnnotationRuntime(featureFlags: AnnotationRuntimeOptions, runtimeHost: AnnotationRuntimeHost): void;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export declare const ANNOTATION_PERFORMANCE_STAGES: readonly [
|
|
1
|
+
export declare const ANNOTATION_PERFORMANCE_STAGES: readonly ["overlay_ready", "markers_loaded", "save_durable", "overlay_exit"];
|
|
2
2
|
export type AnnotationPerformanceStage = (typeof ANNOTATION_PERFORMANCE_STAGES)[number];
|
|
3
|
-
export type AnnotationPerformanceOutcome =
|
|
3
|
+
export type AnnotationPerformanceOutcome = "success" | "failure";
|
|
4
4
|
/** Content-free timing payload. Never add page URL, selector, comment or evidence fields. */
|
|
5
5
|
export interface AnnotationPerformanceEntry {
|
|
6
6
|
stage: AnnotationPerformanceStage;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { AnnotationPerformanceEntry } from
|
|
2
|
-
import type { AnnotationRuntimeControlMessage, AnnotationRuntimeOutboundMessage } from
|
|
1
|
+
import type { AnnotationPerformanceEntry } from "./performance.js";
|
|
2
|
+
import type { AnnotationRuntimeControlMessage, AnnotationRuntimeOutboundMessage } from "./protocol.js";
|
|
3
3
|
export interface AnnotationRuntimeResponse {
|
|
4
4
|
success?: boolean;
|
|
5
5
|
data?: unknown;
|