@lark-apaas/miaoda-coding-sdk 0.0.7-alpha.4 → 0.0.7

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.
@@ -0,0 +1,201 @@
1
+ "use strict";
2
+ var MiaodaRuntime = (() => {
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
8
+ var __export = (target, all) => {
9
+ for (var name2 in all)
10
+ __defProp(target, name2, { get: all[name2], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
21
+
22
+ // src/design-runtime.ts
23
+ var design_runtime_exports = {};
24
+ __export(design_runtime_exports, {
25
+ name: () => name,
26
+ version: () => version
27
+ });
28
+
29
+ // src/creative-perf.ts
30
+ var SLARDAR_URL = "https://lf3-short.ibytedapm.com/slardar/fe/sdk-web/browser.cn.js";
31
+ var initialized = false;
32
+ function initCreativePerf() {
33
+ if (initialized) return;
34
+ initialized = true;
35
+ if (window.Slardar) {
36
+ bootstrap();
37
+ return;
38
+ }
39
+ const script = document.createElement("script");
40
+ script.src = SLARDAR_URL;
41
+ script.onload = () => {
42
+ if (window.Slardar) bootstrap();
43
+ };
44
+ script.onerror = () => {
45
+ };
46
+ document.head.appendChild(script);
47
+ }
48
+ __name(initCreativePerf, "initCreativePerf");
49
+ function bootstrap() {
50
+ var _a, _b, _c;
51
+ window.Slardar("init", {
52
+ bid: "apaas_miaoda",
53
+ autoReportPerf: false,
54
+ autoReportError: false,
55
+ common: {
56
+ app_id: (_a = window.__appId__) != null ? _a : "",
57
+ creative_type: (_b = window.__creativeType__) != null ? _b : "unknown",
58
+ is_public: String((_c = window.__isExternallyVisible__) != null ? _c : false)
59
+ }
60
+ });
61
+ window.Slardar("start");
62
+ const metrics = {};
63
+ let sent = false;
64
+ try {
65
+ new PerformanceObserver((list) => {
66
+ const entries = list.getEntries();
67
+ for (let i = 0; i < entries.length; i++) {
68
+ if (entries[i].name === "first-contentful-paint") {
69
+ metrics.fcp = Math.round(entries[i].startTime);
70
+ }
71
+ }
72
+ }).observe({
73
+ type: "paint",
74
+ buffered: true
75
+ });
76
+ } catch {
77
+ }
78
+ try {
79
+ new PerformanceObserver((list) => {
80
+ const entries = list.getEntries();
81
+ if (entries.length) {
82
+ metrics.lcp = Math.round(entries[entries.length - 1].startTime);
83
+ }
84
+ }).observe({
85
+ type: "largest-contentful-paint",
86
+ buffered: true
87
+ });
88
+ } catch {
89
+ }
90
+ function send() {
91
+ var _a2, _b2, _c2, _d, _e, _f;
92
+ if (sent || !window.Slardar) return;
93
+ sent = true;
94
+ const nav = (_a2 = performance.getEntriesByType("navigation")[0]) != null ? _a2 : {};
95
+ const res = performance.getEntriesByType("resource");
96
+ window.Slardar("sendEvent", {
97
+ name: "creative_perf",
98
+ metrics: {
99
+ fcp: (_b2 = metrics.fcp) != null ? _b2 : 0,
100
+ lcp: (_d = (_c2 = metrics.lcp) != null ? _c2 : metrics.fcp) != null ? _d : 0,
101
+ load: Math.round((_e = nav.loadEventEnd) != null ? _e : 0),
102
+ dom_ready: Math.round((_f = nav.domContentLoadedEventEnd) != null ? _f : 0),
103
+ transfer_size: res.reduce((s, e) => {
104
+ var _a3;
105
+ return s + ((_a3 = e.transferSize) != null ? _a3 : 0);
106
+ }, 0)
107
+ },
108
+ categories: {}
109
+ });
110
+ }
111
+ __name(send, "send");
112
+ window.addEventListener("load", () => {
113
+ setTimeout(send, 500);
114
+ });
115
+ setTimeout(send, 15e3);
116
+ }
117
+ __name(bootstrap, "bootstrap");
118
+
119
+ // src/register-inspector-id.ts
120
+ function registerInspectorIdPlugin() {
121
+ const PLUGIN_NAME = "inspector-id";
122
+ document.addEventListener("DOMContentLoaded", () => {
123
+ const Babel = window.Babel;
124
+ if (!Babel || !Babel.registerPlugin) return;
125
+ let fileMap = null;
126
+ const buildFileMap = /* @__PURE__ */ __name(() => {
127
+ const map = {};
128
+ let inlineSeq = 0;
129
+ document.querySelectorAll('script[type="text/babel"],script[type="text/jsx"]').forEach((el) => {
130
+ const src = el.getAttribute("src");
131
+ if (src) {
132
+ const clean = src.split("?")[0];
133
+ const basename = clean.split("/").pop() || clean;
134
+ map[basename] = basename in map ? "" : clean;
135
+ } else {
136
+ inlineSeq++;
137
+ const babelName = inlineSeq === 1 ? "Inline Babel script" : `Inline Babel script (${inlineSeq})`;
138
+ map[babelName] = el.getAttribute("data-filename") || `inline-${inlineSeq - 1}`;
139
+ }
140
+ });
141
+ return map;
142
+ }, "buildFileMap");
143
+ if (Babel.availablePlugins) delete Babel.availablePlugins[PLUGIN_NAME];
144
+ Babel.registerPlugin(PLUGIN_NAME, ({ types: t }) => ({
145
+ visitor: {
146
+ JSXOpeningElement(path, state) {
147
+ const node = path.node;
148
+ if (node.name && node.name.type === "JSXMemberExpression") return;
149
+ for (let i = 0; i < node.attributes.length; i++) {
150
+ const attr = node.attributes[i];
151
+ if (attr.type === "JSXAttribute" && attr.name && attr.name.name === "data-inspector-id") return;
152
+ }
153
+ const rawFilename = state.file && state.file.opts && state.file.opts.filename || "?";
154
+ if (fileMap === null) fileMap = buildFileMap();
155
+ const noQuery = rawFilename.split("?")[0];
156
+ const basename = noQuery.split("/").pop() || noQuery;
157
+ const filePath = fileMap[rawFilename] || fileMap[basename] || noQuery.replace(/^\/?[a-z][a-z0-9+.-]*:\/{1,2}[^/]+/i, "").replace(/^\/+/, "") || // 去开头多余的 /
158
+ rawFilename;
159
+ const loc = node.loc && node.loc.start;
160
+ const line = loc ? loc.line : 0;
161
+ const column = loc ? loc.column + 1 : 0;
162
+ const elementName = node.name && node.name.type === "JSXIdentifier" ? node.name.name : filePath;
163
+ const id = `jsx:${filePath}:${elementName}:${line}:${column}`;
164
+ node.attributes.push(t.jsxAttribute(t.jsxIdentifier("data-inspector-id"), t.stringLiteral(id)));
165
+ }
166
+ }
167
+ }));
168
+ let hostFile = "";
169
+ try {
170
+ const srcmapEl = document.getElementById("__srcmap");
171
+ if (srcmapEl && srcmapEl.textContent) {
172
+ const parsed = JSON.parse(srcmapEl.textContent);
173
+ const file = parsed == null ? void 0 : parsed.file;
174
+ if (typeof file === "string") hostFile = file;
175
+ }
176
+ } catch {
177
+ }
178
+ document.querySelectorAll('script[type="text/babel"],script[type="text/jsx"]').forEach((el, i) => {
179
+ const plugins = el.getAttribute("data-plugins") || "";
180
+ if (plugins.indexOf(PLUGIN_NAME) < 0) {
181
+ el.setAttribute("data-plugins", plugins ? `${plugins},${PLUGIN_NAME}` : PLUGIN_NAME);
182
+ }
183
+ if (!el.hasAttribute("data-filename")) {
184
+ const inlineName = hostFile ? `${hostFile}#inline-${i}` : `inline-${i}`;
185
+ el.setAttribute("data-filename", el.getAttribute("src") || inlineName);
186
+ }
187
+ });
188
+ });
189
+ }
190
+ __name(registerInspectorIdPlugin, "registerInspectorIdPlugin");
191
+
192
+ // src/design-runtime.ts
193
+ var version = "0.0.7";
194
+ var name = "@lark-apaas/miaoda-coding-sdk";
195
+ if (!window.__CREATIVITY_RUNTIME__) {
196
+ window.__CREATIVITY_RUNTIME__ = true;
197
+ registerInspectorIdPlugin();
198
+ initCreativePerf();
199
+ }
200
+ return __toCommonJS(design_runtime_exports);
201
+ })();
@@ -0,0 +1,201 @@
1
+ "use strict";
2
+ var MiaodaRuntime = (() => {
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
8
+ var __export = (target, all) => {
9
+ for (var name2 in all)
10
+ __defProp(target, name2, { get: all[name2], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
21
+
22
+ // src/design-runtime.ts
23
+ var design_runtime_exports = {};
24
+ __export(design_runtime_exports, {
25
+ name: () => name,
26
+ version: () => version
27
+ });
28
+
29
+ // src/creative-perf.ts
30
+ var SLARDAR_URL = "https://lf3-short.ibytedapm.com/slardar/fe/sdk-web/browser.cn.js";
31
+ var initialized = false;
32
+ function initCreativePerf() {
33
+ if (initialized) return;
34
+ initialized = true;
35
+ if (window.Slardar) {
36
+ bootstrap();
37
+ return;
38
+ }
39
+ const script = document.createElement("script");
40
+ script.src = SLARDAR_URL;
41
+ script.onload = () => {
42
+ if (window.Slardar) bootstrap();
43
+ };
44
+ script.onerror = () => {
45
+ };
46
+ document.head.appendChild(script);
47
+ }
48
+ __name(initCreativePerf, "initCreativePerf");
49
+ function bootstrap() {
50
+ var _a, _b, _c;
51
+ window.Slardar("init", {
52
+ bid: "apaas_miaoda",
53
+ autoReportPerf: false,
54
+ autoReportError: false,
55
+ common: {
56
+ app_id: (_a = window.__appId__) != null ? _a : "",
57
+ creative_type: (_b = window.__creativeType__) != null ? _b : "unknown",
58
+ is_public: String((_c = window.__isExternallyVisible__) != null ? _c : false)
59
+ }
60
+ });
61
+ window.Slardar("start");
62
+ const metrics = {};
63
+ let sent = false;
64
+ try {
65
+ new PerformanceObserver((list) => {
66
+ const entries = list.getEntries();
67
+ for (let i = 0; i < entries.length; i++) {
68
+ if (entries[i].name === "first-contentful-paint") {
69
+ metrics.fcp = Math.round(entries[i].startTime);
70
+ }
71
+ }
72
+ }).observe({
73
+ type: "paint",
74
+ buffered: true
75
+ });
76
+ } catch {
77
+ }
78
+ try {
79
+ new PerformanceObserver((list) => {
80
+ const entries = list.getEntries();
81
+ if (entries.length) {
82
+ metrics.lcp = Math.round(entries[entries.length - 1].startTime);
83
+ }
84
+ }).observe({
85
+ type: "largest-contentful-paint",
86
+ buffered: true
87
+ });
88
+ } catch {
89
+ }
90
+ function send() {
91
+ var _a2, _b2, _c2, _d, _e, _f;
92
+ if (sent || !window.Slardar) return;
93
+ sent = true;
94
+ const nav = (_a2 = performance.getEntriesByType("navigation")[0]) != null ? _a2 : {};
95
+ const res = performance.getEntriesByType("resource");
96
+ window.Slardar("sendEvent", {
97
+ name: "creative_perf",
98
+ metrics: {
99
+ fcp: (_b2 = metrics.fcp) != null ? _b2 : 0,
100
+ lcp: (_d = (_c2 = metrics.lcp) != null ? _c2 : metrics.fcp) != null ? _d : 0,
101
+ load: Math.round((_e = nav.loadEventEnd) != null ? _e : 0),
102
+ dom_ready: Math.round((_f = nav.domContentLoadedEventEnd) != null ? _f : 0),
103
+ transfer_size: res.reduce((s, e) => {
104
+ var _a3;
105
+ return s + ((_a3 = e.transferSize) != null ? _a3 : 0);
106
+ }, 0)
107
+ },
108
+ categories: {}
109
+ });
110
+ }
111
+ __name(send, "send");
112
+ window.addEventListener("load", () => {
113
+ setTimeout(send, 500);
114
+ });
115
+ setTimeout(send, 15e3);
116
+ }
117
+ __name(bootstrap, "bootstrap");
118
+
119
+ // src/register-inspector-id.ts
120
+ function registerInspectorIdPlugin() {
121
+ const PLUGIN_NAME = "inspector-id";
122
+ document.addEventListener("DOMContentLoaded", () => {
123
+ const Babel = window.Babel;
124
+ if (!Babel || !Babel.registerPlugin) return;
125
+ let fileMap = null;
126
+ const buildFileMap = /* @__PURE__ */ __name(() => {
127
+ const map = {};
128
+ let inlineSeq = 0;
129
+ document.querySelectorAll('script[type="text/babel"],script[type="text/jsx"]').forEach((el) => {
130
+ const src = el.getAttribute("src");
131
+ if (src) {
132
+ const clean = src.split("?")[0];
133
+ const basename = clean.split("/").pop() || clean;
134
+ map[basename] = basename in map ? "" : clean;
135
+ } else {
136
+ inlineSeq++;
137
+ const babelName = inlineSeq === 1 ? "Inline Babel script" : `Inline Babel script (${inlineSeq})`;
138
+ map[babelName] = el.getAttribute("data-filename") || `inline-${inlineSeq - 1}`;
139
+ }
140
+ });
141
+ return map;
142
+ }, "buildFileMap");
143
+ if (Babel.availablePlugins) delete Babel.availablePlugins[PLUGIN_NAME];
144
+ Babel.registerPlugin(PLUGIN_NAME, ({ types: t }) => ({
145
+ visitor: {
146
+ JSXOpeningElement(path, state) {
147
+ const node = path.node;
148
+ if (node.name && node.name.type === "JSXMemberExpression") return;
149
+ for (let i = 0; i < node.attributes.length; i++) {
150
+ const attr = node.attributes[i];
151
+ if (attr.type === "JSXAttribute" && attr.name && attr.name.name === "data-inspector-id") return;
152
+ }
153
+ const rawFilename = state.file && state.file.opts && state.file.opts.filename || "?";
154
+ if (fileMap === null) fileMap = buildFileMap();
155
+ const noQuery = rawFilename.split("?")[0];
156
+ const basename = noQuery.split("/").pop() || noQuery;
157
+ const filePath = fileMap[rawFilename] || fileMap[basename] || noQuery.replace(/^\/?[a-z][a-z0-9+.-]*:\/{1,2}[^/]+/i, "").replace(/^\/+/, "") || // 去开头多余的 /
158
+ rawFilename;
159
+ const loc = node.loc && node.loc.start;
160
+ const line = loc ? loc.line : 0;
161
+ const column = loc ? loc.column + 1 : 0;
162
+ const elementName = node.name && node.name.type === "JSXIdentifier" ? node.name.name : filePath;
163
+ const id = `jsx:${filePath}:${elementName}:${line}:${column}`;
164
+ node.attributes.push(t.jsxAttribute(t.jsxIdentifier("data-inspector-id"), t.stringLiteral(id)));
165
+ }
166
+ }
167
+ }));
168
+ let hostFile = "";
169
+ try {
170
+ const srcmapEl = document.getElementById("__srcmap");
171
+ if (srcmapEl && srcmapEl.textContent) {
172
+ const parsed = JSON.parse(srcmapEl.textContent);
173
+ const file = parsed == null ? void 0 : parsed.file;
174
+ if (typeof file === "string") hostFile = file;
175
+ }
176
+ } catch {
177
+ }
178
+ document.querySelectorAll('script[type="text/babel"],script[type="text/jsx"]').forEach((el, i) => {
179
+ const plugins = el.getAttribute("data-plugins") || "";
180
+ if (plugins.indexOf(PLUGIN_NAME) < 0) {
181
+ el.setAttribute("data-plugins", plugins ? `${plugins},${PLUGIN_NAME}` : PLUGIN_NAME);
182
+ }
183
+ if (!el.hasAttribute("data-filename")) {
184
+ const inlineName = hostFile ? `${hostFile}#inline-${i}` : `inline-${i}`;
185
+ el.setAttribute("data-filename", el.getAttribute("src") || inlineName);
186
+ }
187
+ });
188
+ });
189
+ }
190
+ __name(registerInspectorIdPlugin, "registerInspectorIdPlugin");
191
+
192
+ // src/design-runtime.ts
193
+ var version = "0.0.7";
194
+ var name = "@lark-apaas/miaoda-coding-sdk";
195
+ if (!window.__CREATIVITY_RUNTIME__) {
196
+ window.__CREATIVITY_RUNTIME__ = true;
197
+ registerInspectorIdPlugin();
198
+ initCreativePerf();
199
+ }
200
+ return __toCommonJS(design_runtime_exports);
201
+ })();
@@ -0,0 +1 @@
1
+ "use strict";var MiaodaRuntime=(()=>{var _=Object.defineProperty;var A=Object.getOwnPropertyDescriptor;var P=Object.getOwnPropertyNames;var T=Object.prototype.hasOwnProperty;var f=(e,i)=>_(e,"name",{value:i,configurable:!0});var M=(e,i)=>{for(var o in i)_(e,o,{get:i[o],enumerable:!0})},$=(e,i,o,d)=>{if(i&&typeof i=="object"||typeof i=="function")for(let s of P(i))!T.call(e,s)&&s!==o&&_(e,s,{get:()=>i[s],enumerable:!(d=A(i,s))||d.enumerable});return e};var C=e=>$(_({},"__esModule",{value:!0}),e);var B={};M(B,{name:()=>L,version:()=>N});var R="https://lf3-short.ibytedapm.com/slardar/fe/sdk-web/browser.cn.js",h=!1;function x(){if(h)return;if(h=!0,window.Slardar){v();return}let e=document.createElement("script");e.src=R,e.onload=()=>{window.Slardar&&v()},e.onerror=()=>{},document.head.appendChild(e)}f(x,"initCreativePerf");function v(){var d,s,r;window.Slardar("init",{bid:"apaas_miaoda",autoReportPerf:!1,autoReportError:!1,common:{app_id:(d=window.__appId__)!=null?d:"",creative_type:(s=window.__creativeType__)!=null?s:"unknown",is_public:String((r=window.__isExternallyVisible__)!=null?r:!1)}}),window.Slardar("start");let e={},i=!1;try{new PerformanceObserver(a=>{let t=a.getEntries();for(let n=0;n<t.length;n++)t[n].name==="first-contentful-paint"&&(e.fcp=Math.round(t[n].startTime))}).observe({type:"paint",buffered:!0})}catch{}try{new PerformanceObserver(a=>{let t=a.getEntries();t.length&&(e.lcp=Math.round(t[t.length-1].startTime))}).observe({type:"largest-contentful-paint",buffered:!0})}catch{}function o(){var n,l,c,m,u,p;if(i||!window.Slardar)return;i=!0;let a=(n=performance.getEntriesByType("navigation")[0])!=null?n:{},t=performance.getEntriesByType("resource");window.Slardar("sendEvent",{name:"creative_perf",metrics:{fcp:(l=e.fcp)!=null?l:0,lcp:(m=(c=e.lcp)!=null?c:e.fcp)!=null?m:0,load:Math.round((u=a.loadEventEnd)!=null?u:0),dom_ready:Math.round((p=a.domContentLoadedEventEnd)!=null?p:0),transfer_size:t.reduce((g,w)=>{var b;return g+((b=w.transferSize)!=null?b:0)},0)},categories:{}})}f(o,"send"),window.addEventListener("load",()=>{setTimeout(o,500)}),setTimeout(o,15e3)}f(v,"bootstrap");function S(){let e="inspector-id";document.addEventListener("DOMContentLoaded",()=>{let i=window.Babel;if(!i||!i.registerPlugin)return;let o=null,d=f(()=>{let r={},a=0;return document.querySelectorAll('script[type="text/babel"],script[type="text/jsx"]').forEach(t=>{let n=t.getAttribute("src");if(n){let l=n.split("?")[0],c=l.split("/").pop()||l;r[c]=c in r?"":l}else{a++;let l=a===1?"Inline Babel script":`Inline Babel script (${a})`;r[l]=t.getAttribute("data-filename")||`inline-${a-1}`}}),r},"buildFileMap");i.availablePlugins&&delete i.availablePlugins[e],i.registerPlugin(e,({types:r})=>({visitor:{JSXOpeningElement(a,t){let n=a.node;if(n.name&&n.name.type==="JSXMemberExpression")return;for(let y=0;y<n.attributes.length;y++){let E=n.attributes[y];if(E.type==="JSXAttribute"&&E.name&&E.name.name==="data-inspector-id")return}let l=t.file&&t.file.opts&&t.file.opts.filename||"?";o===null&&(o=d());let c=l.split("?")[0],m=c.split("/").pop()||c,u=o[l]||o[m]||c.replace(/^\/?[a-z][a-z0-9+.-]*:\/{1,2}[^/]+/i,"").replace(/^\/+/,"")||l,p=n.loc&&n.loc.start,g=p?p.line:0,w=p?p.column+1:0,b=n.name&&n.name.type==="JSXIdentifier"?n.name.name:u,I=`jsx:${u}:${b}:${g}:${w}`;n.attributes.push(r.jsxAttribute(r.jsxIdentifier("data-inspector-id"),r.stringLiteral(I)))}}}));let s="";try{let r=document.getElementById("__srcmap");if(r&&r.textContent){let a=JSON.parse(r.textContent),t=a==null?void 0:a.file;typeof t=="string"&&(s=t)}}catch{}document.querySelectorAll('script[type="text/babel"],script[type="text/jsx"]').forEach((r,a)=>{let t=r.getAttribute("data-plugins")||"";if(t.indexOf(e)<0&&r.setAttribute("data-plugins",t?`${t},${e}`:e),!r.hasAttribute("data-filename")){let n=s?`${s}#inline-${a}`:`inline-${a}`;r.setAttribute("data-filename",r.getAttribute("src")||n)}})})}f(S,"registerInspectorIdPlugin");var N="0.0.7",L="@lark-apaas/miaoda-coding-sdk";window.__CREATIVITY_RUNTIME__||(window.__CREATIVITY_RUNTIME__=!0,S(),x());return C(B);})();
@@ -1089,7 +1089,6 @@ var MiaodaRuntime = (() => {
1089
1089
  var PILL_SHADOW = "0px 8px 32px rgba(0,0,0,0.08), 0px 4px 16px rgba(0,0,0,0.04), 0px 2px 4px rgba(0,0,0,0.02)";
1090
1090
  var CARD_SHADOW = "0px 4px 16px rgba(0,0,0,0.03), 0px 4px 10px rgba(0,0,0,0.03), 0px 2px 4px rgba(0,0,0,0.02)";
1091
1091
  var FONT_FAMILY = "'PingFang SC', -apple-system, BlinkMacSystemFont, sans-serif";
1092
- var HOST_TAG = "doubao-watermark";
1093
1092
  var REPORT_DOMAIN = {
1094
1093
  BOE: "tns.feishu-boe.cn",
1095
1094
  PRE: "tns.feishu-pre.cn",
@@ -1134,6 +1133,8 @@ var MiaodaRuntime = (() => {
1134
1133
  Object.assign(img.style, {
1135
1134
  width: `${size}px`,
1136
1135
  height: `${size}px`,
1136
+ maxWidth: "none",
1137
+ maxHeight: "none",
1137
1138
  borderRadius: "100px",
1138
1139
  flexShrink: "0",
1139
1140
  display: "block"
@@ -1275,15 +1276,14 @@ var MiaodaRuntime = (() => {
1275
1276
  return card;
1276
1277
  }
1277
1278
  __name(buildMenuCard, "buildMenuCard");
1278
- function hostOf(node) {
1279
- const root = node.getRootNode();
1280
- return root instanceof ShadowRoot ? root.host : null;
1281
- }
1282
- __name(hostOf, "hostOf");
1283
1279
  function buildDesktopWatermark() {
1284
1280
  const container = document.createElement("div");
1285
1281
  container.setAttribute("data-custom-element", "doubao-watermark");
1286
1282
  Object.assign(container.style, {
1283
+ position: "fixed",
1284
+ right: "12px",
1285
+ bottom: "12px",
1286
+ zIndex: "9999",
1287
1287
  display: "flex",
1288
1288
  flexDirection: "column",
1289
1289
  alignItems: "flex-end",
@@ -1304,10 +1304,7 @@ var MiaodaRuntime = (() => {
1304
1304
  minWidth: 144
1305
1305
  });
1306
1306
  menu.style.display = "none";
1307
- const pill = buildPill("desktop", () => {
1308
- var _a;
1309
- ((_a = hostOf(container)) != null ? _a : container).remove();
1310
- });
1307
+ const pill = buildPill("desktop", () => container.remove());
1311
1308
  const close = pill.querySelector("[data-doubao-close]");
1312
1309
  container.append(menu, pill);
1313
1310
  let timer = null;
@@ -1329,9 +1326,12 @@ var MiaodaRuntime = (() => {
1329
1326
  const wrapper = document.createElement("div");
1330
1327
  wrapper.setAttribute("data-custom-element", "doubao-watermark-mobile");
1331
1328
  Object.assign(wrapper.style, {
1332
- position: "relative",
1329
+ position: "fixed",
1330
+ right: "12px",
1331
+ bottom: "12px",
1333
1332
  width: "122px",
1334
1333
  height: "30px",
1334
+ zIndex: "9999",
1335
1335
  cursor: "pointer"
1336
1336
  });
1337
1337
  const pill = document.createElement("img");
@@ -1345,6 +1345,8 @@ var MiaodaRuntime = (() => {
1345
1345
  bottom: "-40px",
1346
1346
  width: "166px",
1347
1347
  height: "94px",
1348
+ maxWidth: "none",
1349
+ maxHeight: "none",
1348
1350
  display: "block",
1349
1351
  pointerEvents: "none"
1350
1352
  });
@@ -1358,19 +1360,13 @@ var MiaodaRuntime = (() => {
1358
1360
  onClick: openDoubaoReport
1359
1361
  }));
1360
1362
  }
1361
- const outsideCloseCtrl = new AbortController();
1362
- const dismiss = /* @__PURE__ */ __name(() => {
1363
- var _a;
1364
- outsideCloseCtrl.abort();
1365
- ((_a = hostOf(wrapper)) != null ? _a : wrapper).remove();
1366
- }, "dismiss");
1367
1363
  rows.push(buildMenuRow({
1368
1364
  icon: "close",
1369
1365
  label: "\u4E0D\u518D\u5C55\u793A",
1370
1366
  fontSize: 16,
1371
1367
  onClick: /* @__PURE__ */ __name((e) => {
1372
1368
  e.stopPropagation();
1373
- dismiss();
1369
+ wrapper.remove();
1374
1370
  }, "onClick")
1375
1371
  }));
1376
1372
  const menu = buildMenuCard({
@@ -1389,21 +1385,13 @@ var MiaodaRuntime = (() => {
1389
1385
  e.stopPropagation();
1390
1386
  menu.style.display = menu.style.display === "none" ? "flex" : "none";
1391
1387
  });
1392
- wrapper.__attachOutsideClose = (host) => {
1393
- document.addEventListener("click", (e) => {
1394
- const path = typeof e.composedPath === "function" ? e.composedPath() : [];
1395
- if (!path.includes(host)) {
1396
- menu.style.display = "none";
1397
- }
1398
- }, {
1399
- signal: outsideCloseCtrl.signal
1400
- });
1401
- };
1388
+ document.addEventListener("click", () => {
1389
+ menu.style.display = "none";
1390
+ });
1402
1391
  return wrapper;
1403
1392
  }
1404
1393
  __name(buildMobileWatermark, "buildMobileWatermark");
1405
1394
  var mounted = false;
1406
- var currentHost = null;
1407
1395
  function mountDoubaoWatermark() {
1408
1396
  if (mounted || typeof document === "undefined") return;
1409
1397
  if (document.readyState === "loading") {
@@ -1413,34 +1401,13 @@ var MiaodaRuntime = (() => {
1413
1401
  return;
1414
1402
  }
1415
1403
  mounted = true;
1416
- const host = document.createElement(HOST_TAG);
1417
- host.style.cssText = [
1418
- "all: initial",
1419
- "position: fixed",
1420
- "right: 12px",
1421
- "bottom: 12px",
1422
- // 32-bit 有符号整数上限,盖过绝大多数应用 z-index 竞争。
1423
- "z-index: 2147483647",
1424
- // 自定义元素默认 display:inline,shadow 内的 flex 布局需要 host 是 block/inline-block。
1425
- "display: block",
1426
- // 内容尺寸自适应。
1427
- "width: auto",
1428
- "height: auto"
1429
- ].join("; ");
1430
- const shadow = host.attachShadow({
1431
- mode: "open"
1432
- });
1433
1404
  const el = isMobile() ? buildMobileWatermark() : buildDesktopWatermark();
1434
- shadow.appendChild(el);
1435
- document.body.appendChild(host);
1436
- currentHost = host;
1437
- const wrapper = el;
1438
- if (typeof wrapper.__attachOutsideClose === "function") wrapper.__attachOutsideClose(host);
1405
+ document.body.appendChild(el);
1439
1406
  }
1440
1407
  __name(mountDoubaoWatermark, "mountDoubaoWatermark");
1441
1408
 
1442
1409
  // src/doubao-runtime.ts
1443
- var version = "0.0.7-alpha.4";
1410
+ var version = "0.0.7";
1444
1411
  var name = "@lark-apaas/miaoda-coding-sdk";
1445
1412
  if (false) {
1446
1413
  reportPageView();
@@ -1298,7 +1298,6 @@ var MiaodaRuntime = (() => {
1298
1298
  var PILL_SHADOW = "0px 8px 32px rgba(0,0,0,0.08), 0px 4px 16px rgba(0,0,0,0.04), 0px 2px 4px rgba(0,0,0,0.02)";
1299
1299
  var CARD_SHADOW = "0px 4px 16px rgba(0,0,0,0.03), 0px 4px 10px rgba(0,0,0,0.03), 0px 2px 4px rgba(0,0,0,0.02)";
1300
1300
  var FONT_FAMILY = "'PingFang SC', -apple-system, BlinkMacSystemFont, sans-serif";
1301
- var HOST_TAG = "doubao-watermark";
1302
1301
  var REPORT_DOMAIN = {
1303
1302
  BOE: "tns.feishu-boe.cn",
1304
1303
  PRE: "tns.feishu-pre.cn",
@@ -1343,6 +1342,8 @@ var MiaodaRuntime = (() => {
1343
1342
  Object.assign(img.style, {
1344
1343
  width: `${size}px`,
1345
1344
  height: `${size}px`,
1345
+ maxWidth: "none",
1346
+ maxHeight: "none",
1346
1347
  borderRadius: "100px",
1347
1348
  flexShrink: "0",
1348
1349
  display: "block"
@@ -1484,15 +1485,14 @@ var MiaodaRuntime = (() => {
1484
1485
  return card;
1485
1486
  }
1486
1487
  __name(buildMenuCard, "buildMenuCard");
1487
- function hostOf(node) {
1488
- const root = node.getRootNode();
1489
- return root instanceof ShadowRoot ? root.host : null;
1490
- }
1491
- __name(hostOf, "hostOf");
1492
1488
  function buildDesktopWatermark() {
1493
1489
  const container = document.createElement("div");
1494
1490
  container.setAttribute("data-custom-element", "doubao-watermark");
1495
1491
  Object.assign(container.style, {
1492
+ position: "fixed",
1493
+ right: "12px",
1494
+ bottom: "12px",
1495
+ zIndex: "9999",
1496
1496
  display: "flex",
1497
1497
  flexDirection: "column",
1498
1498
  alignItems: "flex-end",
@@ -1513,10 +1513,7 @@ var MiaodaRuntime = (() => {
1513
1513
  minWidth: 144
1514
1514
  });
1515
1515
  menu.style.display = "none";
1516
- const pill = buildPill("desktop", () => {
1517
- var _a2;
1518
- ((_a2 = hostOf(container)) != null ? _a2 : container).remove();
1519
- });
1516
+ const pill = buildPill("desktop", () => container.remove());
1520
1517
  const close = pill.querySelector("[data-doubao-close]");
1521
1518
  container.append(menu, pill);
1522
1519
  let timer = null;
@@ -1538,9 +1535,12 @@ var MiaodaRuntime = (() => {
1538
1535
  const wrapper = document.createElement("div");
1539
1536
  wrapper.setAttribute("data-custom-element", "doubao-watermark-mobile");
1540
1537
  Object.assign(wrapper.style, {
1541
- position: "relative",
1538
+ position: "fixed",
1539
+ right: "12px",
1540
+ bottom: "12px",
1542
1541
  width: "122px",
1543
1542
  height: "30px",
1543
+ zIndex: "9999",
1544
1544
  cursor: "pointer"
1545
1545
  });
1546
1546
  const pill = document.createElement("img");
@@ -1554,6 +1554,8 @@ var MiaodaRuntime = (() => {
1554
1554
  bottom: "-40px",
1555
1555
  width: "166px",
1556
1556
  height: "94px",
1557
+ maxWidth: "none",
1558
+ maxHeight: "none",
1557
1559
  display: "block",
1558
1560
  pointerEvents: "none"
1559
1561
  });
@@ -1567,19 +1569,13 @@ var MiaodaRuntime = (() => {
1567
1569
  onClick: openDoubaoReport
1568
1570
  }));
1569
1571
  }
1570
- const outsideCloseCtrl = new AbortController();
1571
- const dismiss = /* @__PURE__ */ __name(() => {
1572
- var _a2;
1573
- outsideCloseCtrl.abort();
1574
- ((_a2 = hostOf(wrapper)) != null ? _a2 : wrapper).remove();
1575
- }, "dismiss");
1576
1572
  rows.push(buildMenuRow({
1577
1573
  icon: "close",
1578
1574
  label: "\u4E0D\u518D\u5C55\u793A",
1579
1575
  fontSize: 16,
1580
1576
  onClick: /* @__PURE__ */ __name((e) => {
1581
1577
  e.stopPropagation();
1582
- dismiss();
1578
+ wrapper.remove();
1583
1579
  }, "onClick")
1584
1580
  }));
1585
1581
  const menu = buildMenuCard({
@@ -1598,21 +1594,13 @@ var MiaodaRuntime = (() => {
1598
1594
  e.stopPropagation();
1599
1595
  menu.style.display = menu.style.display === "none" ? "flex" : "none";
1600
1596
  });
1601
- wrapper.__attachOutsideClose = (host) => {
1602
- document.addEventListener("click", (e) => {
1603
- const path = typeof e.composedPath === "function" ? e.composedPath() : [];
1604
- if (!path.includes(host)) {
1605
- menu.style.display = "none";
1606
- }
1607
- }, {
1608
- signal: outsideCloseCtrl.signal
1609
- });
1610
- };
1597
+ document.addEventListener("click", () => {
1598
+ menu.style.display = "none";
1599
+ });
1611
1600
  return wrapper;
1612
1601
  }
1613
1602
  __name(buildMobileWatermark, "buildMobileWatermark");
1614
1603
  var mounted = false;
1615
- var currentHost = null;
1616
1604
  function mountDoubaoWatermark() {
1617
1605
  if (mounted || typeof document === "undefined") return;
1618
1606
  if (document.readyState === "loading") {
@@ -1622,34 +1610,13 @@ var MiaodaRuntime = (() => {
1622
1610
  return;
1623
1611
  }
1624
1612
  mounted = true;
1625
- const host = document.createElement(HOST_TAG);
1626
- host.style.cssText = [
1627
- "all: initial",
1628
- "position: fixed",
1629
- "right: 12px",
1630
- "bottom: 12px",
1631
- // 32-bit 有符号整数上限,盖过绝大多数应用 z-index 竞争。
1632
- "z-index: 2147483647",
1633
- // 自定义元素默认 display:inline,shadow 内的 flex 布局需要 host 是 block/inline-block。
1634
- "display: block",
1635
- // 内容尺寸自适应。
1636
- "width: auto",
1637
- "height: auto"
1638
- ].join("; ");
1639
- const shadow = host.attachShadow({
1640
- mode: "open"
1641
- });
1642
1613
  const el = isMobile() ? buildMobileWatermark() : buildDesktopWatermark();
1643
- shadow.appendChild(el);
1644
- document.body.appendChild(host);
1645
- currentHost = host;
1646
- const wrapper = el;
1647
- if (typeof wrapper.__attachOutsideClose === "function") wrapper.__attachOutsideClose(host);
1614
+ document.body.appendChild(el);
1648
1615
  }
1649
1616
  __name(mountDoubaoWatermark, "mountDoubaoWatermark");
1650
1617
 
1651
1618
  // src/doubao-runtime.ts
1652
- var version = "0.0.7-alpha.4";
1619
+ var version = "0.0.7";
1653
1620
  var name = "@lark-apaas/miaoda-coding-sdk";
1654
1621
  if (true) {
1655
1622
  reportPageView();
@@ -1 +1 @@
1
- "use strict";var MiaodaRuntime=(()=>{var bt=Object.create;var D=Object.defineProperty;var yt=Object.getOwnPropertyDescriptor;var _t=Object.getOwnPropertyNames;var wt=Object.getPrototypeOf,xt=Object.prototype.hasOwnProperty;var i=(n,e)=>D(n,"name",{value:e,configurable:!0});var j=(n,e)=>()=>(e||n((e={exports:{}}).exports,e),e.exports),Ct=(n,e)=>{for(var d in e)D(n,d,{get:e[d],enumerable:!0})},G=(n,e,d,p)=>{if(e&&typeof e=="object"||typeof e=="function")for(let g of _t(e))!xt.call(n,g)&&g!==d&&D(n,g,{get:()=>e[g],enumerable:!(p=yt(e,g))||p.enumerable});return n};var J=(n,e,d)=>(d=n!=null?bt(wt(n)):{},G(e||!n||!n.__esModule?D(d,"default",{value:n,enumerable:!0}):d,n)),St=n=>G(D({},"__esModule",{value:!0}),n);var X=j((q,H)=>{"use strict";(function(n){"use strict";function e(t,f){var r=(t&65535)+(f&65535),b=(t>>16)+(f>>16)+(r>>16);return b<<16|r&65535}i(e,"safeAdd");function d(t,f){return t<<f|t>>>32-f}i(d,"bitRotateLeft");function p(t,f,r,b,w,S){return e(d(e(e(f,t),e(b,S)),w),r)}i(p,"md5cmn");function g(t,f,r,b,w,S,B){return p(f&r|~f&b,t,f,w,S,B)}i(g,"md5ff");function m(t,f,r,b,w,S,B){return p(f&b|r&~b,t,f,w,S,B)}i(m,"md5gg");function h(t,f,r,b,w,S,B){return p(f^r^b,t,f,w,S,B)}i(h,"md5hh");function y(t,f,r,b,w,S,B){return p(r^(f|~b),t,f,w,S,B)}i(y,"md5ii");function k(t,f){t[f>>5]|=128<<f%32,t[(f+64>>>9<<4)+14]=f;var r,b,w,S,B,o=1732584193,a=-271733879,s=-1732584194,c=271733878;for(r=0;r<t.length;r+=16)b=o,w=a,S=s,B=c,o=g(o,a,s,c,t[r],7,-680876936),c=g(c,o,a,s,t[r+1],12,-389564586),s=g(s,c,o,a,t[r+2],17,606105819),a=g(a,s,c,o,t[r+3],22,-1044525330),o=g(o,a,s,c,t[r+4],7,-176418897),c=g(c,o,a,s,t[r+5],12,1200080426),s=g(s,c,o,a,t[r+6],17,-1473231341),a=g(a,s,c,o,t[r+7],22,-45705983),o=g(o,a,s,c,t[r+8],7,1770035416),c=g(c,o,a,s,t[r+9],12,-1958414417),s=g(s,c,o,a,t[r+10],17,-42063),a=g(a,s,c,o,t[r+11],22,-1990404162),o=g(o,a,s,c,t[r+12],7,1804603682),c=g(c,o,a,s,t[r+13],12,-40341101),s=g(s,c,o,a,t[r+14],17,-1502002290),a=g(a,s,c,o,t[r+15],22,1236535329),o=m(o,a,s,c,t[r+1],5,-165796510),c=m(c,o,a,s,t[r+6],9,-1069501632),s=m(s,c,o,a,t[r+11],14,643717713),a=m(a,s,c,o,t[r],20,-373897302),o=m(o,a,s,c,t[r+5],5,-701558691),c=m(c,o,a,s,t[r+10],9,38016083),s=m(s,c,o,a,t[r+15],14,-660478335),a=m(a,s,c,o,t[r+4],20,-405537848),o=m(o,a,s,c,t[r+9],5,568446438),c=m(c,o,a,s,t[r+14],9,-1019803690),s=m(s,c,o,a,t[r+3],14,-187363961),a=m(a,s,c,o,t[r+8],20,1163531501),o=m(o,a,s,c,t[r+13],5,-1444681467),c=m(c,o,a,s,t[r+2],9,-51403784),s=m(s,c,o,a,t[r+7],14,1735328473),a=m(a,s,c,o,t[r+12],20,-1926607734),o=h(o,a,s,c,t[r+5],4,-378558),c=h(c,o,a,s,t[r+8],11,-2022574463),s=h(s,c,o,a,t[r+11],16,1839030562),a=h(a,s,c,o,t[r+14],23,-35309556),o=h(o,a,s,c,t[r+1],4,-1530992060),c=h(c,o,a,s,t[r+4],11,1272893353),s=h(s,c,o,a,t[r+7],16,-155497632),a=h(a,s,c,o,t[r+10],23,-1094730640),o=h(o,a,s,c,t[r+13],4,681279174),c=h(c,o,a,s,t[r],11,-358537222),s=h(s,c,o,a,t[r+3],16,-722521979),a=h(a,s,c,o,t[r+6],23,76029189),o=h(o,a,s,c,t[r+9],4,-640364487),c=h(c,o,a,s,t[r+12],11,-421815835),s=h(s,c,o,a,t[r+15],16,530742520),a=h(a,s,c,o,t[r+2],23,-995338651),o=y(o,a,s,c,t[r],6,-198630844),c=y(c,o,a,s,t[r+7],10,1126891415),s=y(s,c,o,a,t[r+14],15,-1416354905),a=y(a,s,c,o,t[r+5],21,-57434055),o=y(o,a,s,c,t[r+12],6,1700485571),c=y(c,o,a,s,t[r+3],10,-1894986606),s=y(s,c,o,a,t[r+10],15,-1051523),a=y(a,s,c,o,t[r+1],21,-2054922799),o=y(o,a,s,c,t[r+8],6,1873313359),c=y(c,o,a,s,t[r+15],10,-30611744),s=y(s,c,o,a,t[r+6],15,-1560198380),a=y(a,s,c,o,t[r+13],21,1309151649),o=y(o,a,s,c,t[r+4],6,-145523070),c=y(c,o,a,s,t[r+11],10,-1120210379),s=y(s,c,o,a,t[r+2],15,718787259),a=y(a,s,c,o,t[r+9],21,-343485551),o=e(o,b),a=e(a,w),s=e(s,S),c=e(c,B);return[o,a,s,c]}i(k,"binlMD5");function L(t){var f,r="",b=t.length*32;for(f=0;f<b;f+=8)r+=String.fromCharCode(t[f>>5]>>>f%32&255);return r}i(L,"binl2rstr");function x(t){var f,r=[];for(r[(t.length>>2)-1]=void 0,f=0;f<r.length;f+=1)r[f]=0;var b=t.length*8;for(f=0;f<b;f+=8)r[f>>5]|=(t.charCodeAt(f/8)&255)<<f%32;return r}i(x,"rstr2binl");function I(t){return L(k(x(t),t.length*8))}i(I,"rstrMD5");function E(t,f){var r,b=x(t),w=[],S=[],B;for(w[15]=S[15]=void 0,b.length>16&&(b=k(b,t.length*8)),r=0;r<16;r+=1)w[r]=b[r]^909522486,S[r]=b[r]^1549556828;return B=k(w.concat(x(f)),512+f.length*8),L(k(S.concat(B),640))}i(E,"rstrHMACMD5");function T(t){var f="0123456789abcdef",r="",b,w;for(w=0;w<t.length;w+=1)b=t.charCodeAt(w),r+=f.charAt(b>>>4&15)+f.charAt(b&15);return r}i(T,"rstr2hex");function A(t){return unescape(encodeURIComponent(t))}i(A,"str2rstrUTF8");function l(t){return I(A(t))}i(l,"rawMD5");function u(t){return T(l(t))}i(u,"hexMD5");function _(t,f){return E(A(t),A(f))}i(_,"rawHMACMD5");function v(t,f){return T(_(t,f))}i(v,"hexHMACMD5");function C(t,f,r){return f?r?_(f,t):v(f,t):r?l(t):u(t)}i(C,"md5"),typeof define=="function"&&define.amd?define(function(){return C}):typeof H=="object"&&H.exports?H.exports=C:n.md5=C})(q)});var Q=j((M,Y)=>{"use strict";(function(n,e){typeof M=="object"?Y.exports=M=e():typeof define=="function"&&define.amd?define([],e):n.CryptoJS=e()})(M,function(){var n=n||(function(e,d){var p=Object.create||(function(){function l(){}return i(l,"F"),function(u){var _;return l.prototype=u,_=new l,l.prototype=null,_}})(),g={},m=g.lib={},h=m.Base=(function(){return{extend:i(function(l){var u=p(this);return l&&u.mixIn(l),(!u.hasOwnProperty("init")||this.init===u.init)&&(u.init=function(){u.$super.init.apply(this,arguments)}),u.init.prototype=u,u.$super=this,u},"extend"),create:i(function(){var l=this.extend();return l.init.apply(l,arguments),l},"create"),init:i(function(){},"init"),mixIn:i(function(l){for(var u in l)l.hasOwnProperty(u)&&(this[u]=l[u]);l.hasOwnProperty("toString")&&(this.toString=l.toString)},"mixIn"),clone:i(function(){return this.init.prototype.extend(this)},"clone")}})(),y=m.WordArray=h.extend({init:i(function(l,u){l=this.words=l||[],u!=d?this.sigBytes=u:this.sigBytes=l.length*4},"init"),toString:i(function(l){return(l||L).stringify(this)},"toString"),concat:i(function(l){var u=this.words,_=l.words,v=this.sigBytes,C=l.sigBytes;if(this.clamp(),v%4)for(var t=0;t<C;t++){var f=_[t>>>2]>>>24-t%4*8&255;u[v+t>>>2]|=f<<24-(v+t)%4*8}else for(var t=0;t<C;t+=4)u[v+t>>>2]=_[t>>>2];return this.sigBytes+=C,this},"concat"),clamp:i(function(){var l=this.words,u=this.sigBytes;l[u>>>2]&=4294967295<<32-u%4*8,l.length=e.ceil(u/4)},"clamp"),clone:i(function(){var l=h.clone.call(this);return l.words=this.words.slice(0),l},"clone"),random:i(function(l){for(var u=[],_=i(function(r){var r=r,b=987654321,w=4294967295;return function(){b=36969*(b&65535)+(b>>16)&w,r=18e3*(r&65535)+(r>>16)&w;var S=(b<<16)+r&w;return S/=4294967296,S+=.5,S*(e.random()>.5?1:-1)}},"r"),v=0,C;v<l;v+=4){var t=_((C||e.random())*4294967296);C=t()*987654071,u.push(t()*4294967296|0)}return new y.init(u,l)},"random")}),k=g.enc={},L=k.Hex={stringify:i(function(l){for(var u=l.words,_=l.sigBytes,v=[],C=0;C<_;C++){var t=u[C>>>2]>>>24-C%4*8&255;v.push((t>>>4).toString(16)),v.push((t&15).toString(16))}return v.join("")},"stringify"),parse:i(function(l){for(var u=l.length,_=[],v=0;v<u;v+=2)_[v>>>3]|=parseInt(l.substr(v,2),16)<<24-v%8*4;return new y.init(_,u/2)},"parse")},x=k.Latin1={stringify:i(function(l){for(var u=l.words,_=l.sigBytes,v=[],C=0;C<_;C++){var t=u[C>>>2]>>>24-C%4*8&255;v.push(String.fromCharCode(t))}return v.join("")},"stringify"),parse:i(function(l){for(var u=l.length,_=[],v=0;v<u;v++)_[v>>>2]|=(l.charCodeAt(v)&255)<<24-v%4*8;return new y.init(_,u)},"parse")},I=k.Utf8={stringify:i(function(l){try{return decodeURIComponent(escape(x.stringify(l)))}catch{throw new Error("Malformed UTF-8 data")}},"stringify"),parse:i(function(l){return x.parse(unescape(encodeURIComponent(l)))},"parse")},E=m.BufferedBlockAlgorithm=h.extend({reset:i(function(){this._data=new y.init,this._nDataBytes=0},"reset"),_append:i(function(l){typeof l=="string"&&(l=I.parse(l)),this._data.concat(l),this._nDataBytes+=l.sigBytes},"_append"),_process:i(function(l){var u=this._data,_=u.words,v=u.sigBytes,C=this.blockSize,t=C*4,f=v/t;l?f=e.ceil(f):f=e.max((f|0)-this._minBufferSize,0);var r=f*C,b=e.min(r*4,v);if(r){for(var w=0;w<r;w+=C)this._doProcessBlock(_,w);var S=_.splice(0,r);u.sigBytes-=b}return new y.init(S,b)},"_process"),clone:i(function(){var l=h.clone.call(this);return l._data=this._data.clone(),l},"clone"),_minBufferSize:0}),T=m.Hasher=E.extend({cfg:h.extend(),init:i(function(l){this.cfg=this.cfg.extend(l),this.reset()},"init"),reset:i(function(){E.reset.call(this),this._doReset()},"reset"),update:i(function(l){return this._append(l),this._process(),this},"update"),finalize:i(function(l){l&&this._append(l);var u=this._doFinalize();return u},"finalize"),blockSize:512/32,_createHelper:i(function(l){return function(u,_){return new l.init(_).finalize(u)}},"_createHelper"),_createHmacHelper:i(function(l){return function(u,_){return new A.HMAC.init(l,_).finalize(u)}},"_createHmacHelper")}),A=g.algo={};return g})(Math);return n})});var et=j((R,tt)=>{"use strict";(function(n,e){typeof R=="object"?tt.exports=R=e(Q()):typeof define=="function"&&define.amd?define(["./core"],e):e(n.CryptoJS)})(R,function(n){return(function(){var e=n,d=e.lib,p=d.WordArray,g=d.Hasher,m=e.algo,h=[],y=m.SHA1=g.extend({_doReset:i(function(){this._hash=new p.init([1732584193,4023233417,2562383102,271733878,3285377520])},"_doReset"),_doProcessBlock:i(function(k,L){for(var x=this._hash.words,I=x[0],E=x[1],T=x[2],A=x[3],l=x[4],u=0;u<80;u++){if(u<16)h[u]=k[L+u]|0;else{var _=h[u-3]^h[u-8]^h[u-14]^h[u-16];h[u]=_<<1|_>>>31}var v=(I<<5|I>>>27)+l+h[u];u<20?v+=(E&T|~E&A)+1518500249:u<40?v+=(E^T^A)+1859775393:u<60?v+=(E&T|E&A|T&A)-1894007588:v+=(E^T^A)-899497514,l=A,A=T,T=E<<30|E>>>2,E=I,I=v}x[0]=x[0]+I|0,x[1]=x[1]+E|0,x[2]=x[2]+T|0,x[3]=x[3]+A|0,x[4]=x[4]+l|0},"_doProcessBlock"),_doFinalize:i(function(){var k=this._data,L=k.words,x=this._nDataBytes*8,I=k.sigBytes*8;return L[I>>>5]|=128<<24-I%32,L[(I+64>>>9<<4)+14]=Math.floor(x/4294967296),L[(I+64>>>9<<4)+15]=x,k.sigBytes=L.length*4,this._process(),this._hash},"_doFinalize"),clone:i(function(){var k=g.clone.call(this);return k._hash=this._hash.clone(),k},"clone")});e.SHA1=g._createHelper(y),e.HmacSHA1=g._createHmacHelper(y)})(),n.SHA1})});var Qt={};Ct(Qt,{TrackKey:()=>U,name:()=>Yt,reportTeaEvent:()=>$,version:()=>Xt});var it=J(X(),1),ot=J(et(),1);function O(){return window.appId||null}i(O,"getAppId");function kt(){var d;let n="suda-csrf-token",e=document.cookie.split("; ");for(let p of e){let[g,m]=p.split("=");if(g===n)return decodeURIComponent(m)}return(d=window.csrfToken)!=null?d:null}i(kt,"getCsrfToken");function z(){let n=globalThis.CLIENT_BASE_PATH||"/";return/^\/app\/[^/]/.test(n)}i(z,"isNewPathEnabled");function F(){switch(globalThis.ENVIRONMENT){case"gray":return"PRE";case"online":return"ONLINE";default:return"BOE"}}i(F,"getEnv");function N(){let n=navigator.userAgent,e=/(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i.test(n),d=/iPad|Tab|Tablet/i.test(n)&&navigator.maxTouchPoints>1;return e||d}i(N,"isMobile");async function nt(){var p;let n=O();if(!n)return{code:1,msg:"appId is required",data:{}};let e=z()?`/app/${n}/__runtime__/api/v1/studio/lark/user_info`:`/spark/b/${n}/lark/user_info`;return await(await fetch(e,{headers:{"X-Suda-Csrf-Token":(p=kt())!=null?p:""}})).json()}i(nt,"getLarkUserInfo");var U={VIEW:"aily_agent_artifact_page_view"},Et="08a441",It="42b91e";function rt(n){let e=String(n);return(0,ot.default)(Et+(0,it.default)(e+It)).toString()}i(rt,"encryptTea");var W=!1;async function At(){var m,h,y,k;let{data:n}=await nt(),{tenantID:e,userID:d}=n||{},p=d&&d!=="0"?rt(d):void 0,g=e&&e!=="0"?rt(e):void 0;(m=window.collectEvent)==null||m.call(window,"init",{app_id:788827,channel:"cn",disable_auto_pv:!1,enable_ab_test:!1,enable_debug:!1,enable_stay_duration:!0,reportTime:1e3}),(y=window.collectEvent)==null||y.call(window,"config",{user_unique_id:p,device_type:N()?"mobile":"pc",evtParams:{open_from:(h=new URLSearchParams(window.location.search).get("open-from"))!=null?h:void 0,env:F(),user_id:p,tenant_id:g}}),W=!0,(k=window.collectEvent)==null||k.call(window,"start")}i(At,"createTracker");async function $({trackKey:n,trackParams:e={}}){var d;try{W||(W=!0,await At()),(d=window.collectEvent)==null||d.call(window,n,e)}catch(p){console.error(p)}}i($,"reportTeaEvent");function at(){return $({trackKey:U.VIEW,trackParams:{artifact_uid:O(),agent_id:"agent_miaoda",url:window.location.href}})}i(at,"reportPageView");function st(){if(typeof crypto!="undefined"&&crypto.getRandomValues){let e=new Uint8Array(8);return crypto.getRandomValues(e),Array.from(e).map(d=>d.toString(16).padStart(2,"0")).join("")}let n="";for(let e=0;e<16;e++)n+=Math.floor(Math.random()*16).toString(16);return n}i(st,"generateUUID");var ct="x_sdk_device_id";function Bt(){try{let n=localStorage.getItem(ct);return n||(n=st(),localStorage.setItem(ct,n)),n}catch{return st()}}i(Bt,"getDeviceId");function Tt(){let n=typeof navigator!="undefined"?navigator.userAgent:"";return n&&(/Android/i.test(n)&&/Mobile/i.test(n)||/iPhone|iPod/i.test(n)||/BlackBerry|IEMobile|Opera Mini/i.test(n))?"mobile":"desktop"}i(Tt,"getDeviceType");function Lt(){return{app_id:window.appId||"",tenant_id:window.tenantId||"",user_id:window.userId||"",did:Bt(),module:"app_web",app_env:"runtime",source_type:"user",device_type:Tt(),release_commit_id:window.__RELEASE_COMMIT_ID__||""}}i(Lt,"getDefaultAttributes");var Ot="1.0.0";function Pt(n){let e=Lt(),d=String(BigInt(Date.now())*BigInt(1e6));return{metricsData:{resource:{attributes:{sdk_version:Ot,sdk_lang:"javascript",sdk_type:"client-frontend"}},metrics:[{name:"apaas_internal_metrics_pv_uv",description:"Count of page views",unit:"",scopeName:"apaas_internal_metrics_pv_uv",sum:{aggregationTemporality:1,isMonotonic:!0,dataPoints:n.map(p=>({attributes:{...e,url:p.url,path:p.path,referrer:p.referrer},startTimeUnixNano:String(BigInt(p.timestampMs)*BigInt(1e6)),timeUnixNano:d,asDouble:1}))}}]}}}i(Pt,"buildPayload");function Dt(n,e,d={}){if(e.length===0)return;let p=JSON.stringify(Pt(e));try{fetch(n,{method:"POST",headers:{"Content-Type":"application/json","X-Suda-Csrf-Token":window.csrfToken||"",...d},body:p,keepalive:!0}).catch(()=>{})}catch{}}i(Dt,"sendPvData");var P,Ht=(P=class{constructor(){this.started=!1,this.buffer=[]}static get instance(){return this._instance||(this._instance=new P),this._instance}start(e){var d;if(this.started)return;this.config=e,this.started=!0,this.listenRouteChanges(),this.registerLifecycleListeners();let p=(d=e.flushIntervalMs)!=null?d:1e4;this.flushTimer=setInterval(()=>this.flush(),p)}shutdown(){this.flush(),this.flushTimer&&(clearInterval(this.flushTimer),this.flushTimer=void 0),this.started=!1}recordPv(){let e=window.location.href;this.lastUrl!==e&&(this.lastUrl=e,this.buffer.push({url:e,path:window.location.pathname,referrer:document.referrer,timestampMs:Date.now()}))}flush(){if(!this.config||this.buffer.length===0)return;let e=this.buffer.splice(0);Dt(this.config.collectorUrl,e,this.config.headers)}listenRouteChanges(){document.readyState==="complete"?this.recordPv():window.addEventListener("load",()=>this.recordPv()),window.addEventListener("popstate",()=>this.recordPv()),this.patchHistory("pushState"),this.patchHistory("replaceState")}patchHistory(e){let d=history[e],p=i(()=>this.recordPv(),"recordPv");history[e]=function(...g){let m=d.apply(this,g);return p(),m}}registerLifecycleListeners(){document.addEventListener("visibilitychange",()=>{document.visibilityState==="hidden"&&this.flush()}),window.addEventListener("pagehide",()=>this.flush())}},i(P,"_PvTracker"),P),lt=Ht.instance;function dt(){var d;let n=(d=O())!=null?d:"",e=z()?`/app/${n}/__runtime__/api/v1/observability/metrics/collect`:`/spark/app/${n}/runtime/api/v1/observability/metrics/collect`;lt.start({collectorUrl:e})}i(dt,"initPvTracking");var ft="https://lf3-static.bytednsdoc.com/obj/eden-cn/LMfspH/ljhwZthlaukjlkulzlp/miaoda-ui",Mt=`${ft}/setting_voice.svg`,Rt=`${ft}/Frame%202147223991%20(3).png`,Ft='<svg viewBox="0 0 10 10" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M8.08312 8.08298C8.2384 7.92769 8.23953 7.67705 8.08424 7.52176L5.3625 4.80002L8.08422 2.07829C8.23951 1.92301 8.23839 1.67236 8.0831 1.51708C7.92781 1.36179 7.67717 1.36066 7.52188 1.51595C7.36659 1.67124 4.80016 4.23767 4.80016 4.23767L2.07841 1.51593C1.92313 1.36064 1.67248 1.36177 1.5172 1.51705C1.36191 1.67234 1.36078 1.92298 1.51607 2.07827L4.23782 4.80002L1.51605 7.52178C1.36076 7.67707 1.36189 7.92771 1.51718 8.083C1.67246 8.23829 1.92311 8.23941 2.07839 8.08412L4.80016 5.36236L7.5219 8.0841C7.67719 8.23939 7.92783 8.23826 8.08312 8.08298Z" fill="currentColor"/></svg>',Nt='<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M12.6667 2H3.33333V14H6.66667V15.3334H3.33333C2.59695 15.3334 2 14.7364 2 14V2C2 1.26364 2.59695 0.666687 3.33333 0.666687H12.6667C13.403 0.666687 14 1.26364 14 2V7.33335H12.6667V2Z" fill="currentColor"/><path d="M5.33333 4.66669C4.96514 4.66669 4.66667 4.96516 4.66667 5.33335C4.66667 5.70154 4.96514 6 5.33333 6H10.6667C11.0349 6 11.3333 5.70154 11.3333 5.33335C11.3333 4.96516 11.0349 4.66669 10.6667 4.66669H5.33333Z" fill="currentColor"/><path d="M4.66667 8.33335C4.66667 7.96516 4.96514 7.66669 5.33333 7.66669H8C8.36819 7.66669 8.66667 7.96516 8.66667 8.33335C8.66667 8.70154 8.36819 9 8 9H5.33333C4.96514 9 4.66667 8.70154 4.66667 8.33335Z" fill="currentColor"/><path d="M13.5523 8.70017C13.9428 8.30964 14.576 8.30964 14.9665 8.70017C15.357 9.09069 15.357 9.72386 14.9665 10.1144L14.2594 10.8215L12.8452 9.40728L13.5523 8.70017Z" fill="currentColor"/><path d="M12.1381 10.1144L13.5523 11.5286L10.2309 14.85C10.0916 14.9892 9.91229 15.0815 9.71798 15.1138L8.45737 15.3234C8.42136 15.3294 8.38467 15.3177 8.35885 15.2918C8.33271 15.2657 8.32099 15.2284 8.32749 15.192L8.55128 13.9374C8.58465 13.7502 8.6746 13.5779 8.80901 13.4435L12.1381 10.1144Z" fill="currentColor"/></svg>',pt=!0,jt="\u8C46\u5305 AI \u751F\u6210",zt="\u7531\u98DE\u4E66\u5999\u642D\u63D0\u4F9B\u652F\u6301",Wt="0px 8px 32px rgba(0,0,0,0.08), 0px 4px 16px rgba(0,0,0,0.04), 0px 2px 4px rgba(0,0,0,0.02)",Ut="0px 4px 16px rgba(0,0,0,0.03), 0px 4px 10px rgba(0,0,0,0.03), 0px 2px 4px rgba(0,0,0,0.02)",K="'PingFang SC', -apple-system, BlinkMacSystemFont, sans-serif",$t="doubao-watermark",Vt={BOE:"tns.feishu-boe.cn",PRE:"tns.feishu-pre.cn",ONLINE:"tns.feishu.cn"};function ht(){var d;let n=JSON.stringify({scene:"miaoda_app_report",entity_id:(d=O())!=null?d:"",entity_type:"miaoda_app",extra:""}),e=`https://${Vt[F()]}/cust/lark_report/?type=common&params=${encodeURIComponent(n)}&lang=zh-CN`;window.open(e,"_blank","noopener,noreferrer")}i(ht,"openDoubaoReport");function gt(n){let e=document.createElement("span");Object.assign(e.style,{display:"inline-flex",width:`${n}px`,height:`${n}px`,flexShrink:"0"}),e.innerHTML=Ft;let d=e.firstElementChild;return d&&(d.setAttribute("width",String(n)),d.setAttribute("height",String(n)),d.style.display="block"),e}i(gt,"makeCloseIcon");function Kt(n){let e=document.createElement("img");return e.src=Mt,e.width=n,e.height=n,e.alt="",Object.assign(e.style,{width:`${n}px`,height:`${n}px`,borderRadius:"100px",flexShrink:"0",display:"block"}),e}i(Kt,"makeAvatar");function Zt(n,e){let d=n==="desktop",p=document.createElement("div");Object.assign(p.style,{boxSizing:"border-box",display:"inline-flex",alignItems:"center",gap:d?"4px":"6px",padding:d?"6px 12px 6px 8px":"4px 12px 4px 8px",background:"#363636",border:"0.5px solid rgba(255,255,255,0.1)",borderRadius:"100px",boxShadow:Wt,cursor:"pointer"});let g=Kt(d?16:18),m=document.createElement("span");if(m.textContent=jt,Object.assign(m.style,{fontFamily:K,fontSize:d?"12px":"14px",lineHeight:d?"18px":"22px",color:"rgba(255,255,255,0.85)",whiteSpace:"nowrap"}),p.append(g,m),d&&e){let h=document.createElement("span");h.setAttribute("role","button"),h.setAttribute("aria-label","\u5173\u95ED"),h.setAttribute("data-doubao-close",""),Object.assign(h.style,{display:"none",alignItems:"center",cursor:"pointer",flexShrink:"0",color:"rgba(255,255,255,0.5)"}),h.appendChild(gt(10)),h.addEventListener("click",y=>{y.stopPropagation(),e()}),p.appendChild(h)}return p}i(Zt,"buildPill");function V(n){let e=document.createElement("div");e.setAttribute("role","menuitem"),e.setAttribute("data-label",n.label),Object.assign(e.style,{boxSizing:"border-box",display:"flex",alignItems:"center",gap:"8px",padding:"4px 10px",borderRadius:"6px",cursor:"pointer",color:"#000000"});let d=document.createElement("span");Object.assign(d.style,{display:"inline-flex",width:"16px",height:"16px",flexShrink:"0",color:"#000000"}),n.icon==="feedback"?d.innerHTML=Nt:d.appendChild(gt(16));let p=document.createElement("span");return p.textContent=n.label,Object.assign(p.style,{fontFamily:K,fontSize:`${n.fontSize}px`,lineHeight:`${n.fontSize+8}px`,color:"#000000",whiteSpace:"nowrap"}),e.append(d,p),e.addEventListener("mouseenter",()=>{e.style.background="rgba(0,0,0,0.04)"}),e.addEventListener("mouseleave",()=>{e.style.background="transparent"}),e.addEventListener("click",n.onClick),e}i(V,"buildMenuRow");function mt(n){let e=document.createElement("div");if(Object.assign(e.style,{boxSizing:"border-box",display:"flex",flexDirection:"column",minWidth:`${n.minWidth}px`,background:"#ffffff",border:"0.5px solid rgba(0,0,0,0.1)",borderRadius:"10px",boxShadow:Ut,overflow:"hidden",outline:"none"}),n.rows.length){let p=document.createElement("div");Object.assign(p.style,{boxSizing:"border-box",padding:"4px"}),n.rows.forEach(g=>p.appendChild(g)),e.appendChild(p)}let d=document.createElement("div");return d.textContent=zt,Object.assign(d.style,{boxSizing:"border-box",background:"#f9f9f9",padding:"8px 14px",fontFamily:K,fontSize:`${n.footerFontSize}px`,lineHeight:`${n.footerFontSize+8}px`,color:"rgba(0,0,0,0.35)",whiteSpace:"nowrap"}),e.appendChild(d),e}i(mt,"buildMenuCard");function vt(n){let e=n.getRootNode();return e instanceof ShadowRoot?e.host:null}i(vt,"hostOf");function Gt(){let n=document.createElement("div");n.setAttribute("data-custom-element","doubao-watermark"),Object.assign(n.style,{display:"flex",flexDirection:"column",alignItems:"flex-end",gap:"8px"});let e=[];pt&&e.push(V({icon:"feedback",label:"\u6295\u8BC9\u4E0E\u4E3E\u62A5",fontSize:14,onClick:ht}));let d=mt({rows:e,footerFontSize:12,minWidth:144});d.style.display="none";let p=Zt("desktop",()=>{var h;((h=vt(n))!=null?h:n).remove()}),g=p.querySelector("[data-doubao-close]");n.append(d,p);let m=null;return n.addEventListener("mouseenter",()=>{m&&clearTimeout(m),d.style.display="flex",g&&(g.style.display="inline-flex")}),n.addEventListener("mouseleave",()=>{m=setTimeout(()=>{d.style.display="none",g&&(g.style.display="none")},100)}),n}i(Gt,"buildDesktopWatermark");function Jt(){let n=document.createElement("div");n.setAttribute("data-custom-element","doubao-watermark-mobile"),Object.assign(n.style,{position:"relative",width:"122px",height:"30px",cursor:"pointer"});let e=document.createElement("img");e.src=Rt,e.width=166,e.height=94,e.alt="\u8C46\u5305 AI \u751F\u6210",Object.assign(e.style,{position:"absolute",right:"-12px",bottom:"-40px",width:"166px",height:"94px",display:"block",pointerEvents:"none"}),n.appendChild(e);let d=[];pt&&d.push(V({icon:"feedback",label:"\u6295\u8BC9\u4E0E\u4E3E\u62A5",fontSize:16,onClick:ht}));let p=new AbortController,g=i(()=>{var h;p.abort(),((h=vt(n))!=null?h:n).remove()},"dismiss");d.push(V({icon:"close",label:"\u4E0D\u518D\u5C55\u793A",fontSize:16,onClick:i(h=>{h.stopPropagation(),g()},"onClick")}));let m=mt({rows:d,footerFontSize:14,minWidth:160});return Object.assign(m.style,{position:"absolute",right:"0",bottom:"38px",display:"none"}),n.appendChild(m),n.addEventListener("click",h=>{h.stopPropagation(),m.style.display=m.style.display==="none"?"flex":"none"}),n.__attachOutsideClose=h=>{document.addEventListener("click",y=>{(typeof y.composedPath=="function"?y.composedPath():[]).includes(h)||(m.style.display="none")},{signal:p.signal})},n}i(Jt,"buildMobileWatermark");var ut=!1,qt=null;function Z(){if(ut||typeof document=="undefined")return;if(document.readyState==="loading"){document.addEventListener("DOMContentLoaded",Z,{once:!0});return}ut=!0;let n=document.createElement($t);n.style.cssText=["all: initial","position: fixed","right: 12px","bottom: 12px","z-index: 2147483647","display: block","width: auto","height: auto"].join("; ");let e=n.attachShadow({mode:"open"}),d=N()?Jt():Gt();e.appendChild(d),document.body.appendChild(n),qt=n;let p=d;typeof p.__attachOutsideClose=="function"&&p.__attachOutsideClose(n)}i(Z,"mountDoubaoWatermark");var Xt="0.0.7-alpha.4",Yt="@lark-apaas/miaoda-coding-sdk";at(),dt();Z();return St(Qt);})();
1
+ "use strict";var MiaodaRuntime=(()=>{var ve=Object.create;var D=Object.defineProperty;var be=Object.getOwnPropertyDescriptor;var ye=Object.getOwnPropertyNames;var _e=Object.getPrototypeOf,we=Object.prototype.hasOwnProperty;var i=(r,t)=>D(r,"name",{value:t,configurable:!0});var j=(r,t)=>()=>(t||r((t={exports:{}}).exports,t),t.exports),xe=(r,t)=>{for(var d in t)D(r,d,{get:t[d],enumerable:!0})},G=(r,t,d,p)=>{if(t&&typeof t=="object"||typeof t=="function")for(let h of ye(t))!we.call(r,h)&&h!==d&&D(r,h,{get:()=>t[h],enumerable:!(p=be(t,h))||p.enumerable});return r};var J=(r,t,d)=>(d=r!=null?ve(_e(r)):{},G(t||!r||!r.__esModule?D(d,"default",{value:r,enumerable:!0}):d,r)),Ce=r=>G(D({},"__esModule",{value:!0}),r);var X=j((q,H)=>{"use strict";(function(r){"use strict";function t(e,f){var n=(e&65535)+(f&65535),b=(e>>16)+(f>>16)+(n>>16);return b<<16|n&65535}i(t,"safeAdd");function d(e,f){return e<<f|e>>>32-f}i(d,"bitRotateLeft");function p(e,f,n,b,w,S){return t(d(t(t(f,e),t(b,S)),w),n)}i(p,"md5cmn");function h(e,f,n,b,w,S,B){return p(f&n|~f&b,e,f,w,S,B)}i(h,"md5ff");function m(e,f,n,b,w,S,B){return p(f&b|n&~b,e,f,w,S,B)}i(m,"md5gg");function g(e,f,n,b,w,S,B){return p(f^n^b,e,f,w,S,B)}i(g,"md5hh");function y(e,f,n,b,w,S,B){return p(n^(f|~b),e,f,w,S,B)}i(y,"md5ii");function k(e,f){e[f>>5]|=128<<f%32,e[(f+64>>>9<<4)+14]=f;var n,b,w,S,B,o=1732584193,a=-271733879,s=-1732584194,c=271733878;for(n=0;n<e.length;n+=16)b=o,w=a,S=s,B=c,o=h(o,a,s,c,e[n],7,-680876936),c=h(c,o,a,s,e[n+1],12,-389564586),s=h(s,c,o,a,e[n+2],17,606105819),a=h(a,s,c,o,e[n+3],22,-1044525330),o=h(o,a,s,c,e[n+4],7,-176418897),c=h(c,o,a,s,e[n+5],12,1200080426),s=h(s,c,o,a,e[n+6],17,-1473231341),a=h(a,s,c,o,e[n+7],22,-45705983),o=h(o,a,s,c,e[n+8],7,1770035416),c=h(c,o,a,s,e[n+9],12,-1958414417),s=h(s,c,o,a,e[n+10],17,-42063),a=h(a,s,c,o,e[n+11],22,-1990404162),o=h(o,a,s,c,e[n+12],7,1804603682),c=h(c,o,a,s,e[n+13],12,-40341101),s=h(s,c,o,a,e[n+14],17,-1502002290),a=h(a,s,c,o,e[n+15],22,1236535329),o=m(o,a,s,c,e[n+1],5,-165796510),c=m(c,o,a,s,e[n+6],9,-1069501632),s=m(s,c,o,a,e[n+11],14,643717713),a=m(a,s,c,o,e[n],20,-373897302),o=m(o,a,s,c,e[n+5],5,-701558691),c=m(c,o,a,s,e[n+10],9,38016083),s=m(s,c,o,a,e[n+15],14,-660478335),a=m(a,s,c,o,e[n+4],20,-405537848),o=m(o,a,s,c,e[n+9],5,568446438),c=m(c,o,a,s,e[n+14],9,-1019803690),s=m(s,c,o,a,e[n+3],14,-187363961),a=m(a,s,c,o,e[n+8],20,1163531501),o=m(o,a,s,c,e[n+13],5,-1444681467),c=m(c,o,a,s,e[n+2],9,-51403784),s=m(s,c,o,a,e[n+7],14,1735328473),a=m(a,s,c,o,e[n+12],20,-1926607734),o=g(o,a,s,c,e[n+5],4,-378558),c=g(c,o,a,s,e[n+8],11,-2022574463),s=g(s,c,o,a,e[n+11],16,1839030562),a=g(a,s,c,o,e[n+14],23,-35309556),o=g(o,a,s,c,e[n+1],4,-1530992060),c=g(c,o,a,s,e[n+4],11,1272893353),s=g(s,c,o,a,e[n+7],16,-155497632),a=g(a,s,c,o,e[n+10],23,-1094730640),o=g(o,a,s,c,e[n+13],4,681279174),c=g(c,o,a,s,e[n],11,-358537222),s=g(s,c,o,a,e[n+3],16,-722521979),a=g(a,s,c,o,e[n+6],23,76029189),o=g(o,a,s,c,e[n+9],4,-640364487),c=g(c,o,a,s,e[n+12],11,-421815835),s=g(s,c,o,a,e[n+15],16,530742520),a=g(a,s,c,o,e[n+2],23,-995338651),o=y(o,a,s,c,e[n],6,-198630844),c=y(c,o,a,s,e[n+7],10,1126891415),s=y(s,c,o,a,e[n+14],15,-1416354905),a=y(a,s,c,o,e[n+5],21,-57434055),o=y(o,a,s,c,e[n+12],6,1700485571),c=y(c,o,a,s,e[n+3],10,-1894986606),s=y(s,c,o,a,e[n+10],15,-1051523),a=y(a,s,c,o,e[n+1],21,-2054922799),o=y(o,a,s,c,e[n+8],6,1873313359),c=y(c,o,a,s,e[n+15],10,-30611744),s=y(s,c,o,a,e[n+6],15,-1560198380),a=y(a,s,c,o,e[n+13],21,1309151649),o=y(o,a,s,c,e[n+4],6,-145523070),c=y(c,o,a,s,e[n+11],10,-1120210379),s=y(s,c,o,a,e[n+2],15,718787259),a=y(a,s,c,o,e[n+9],21,-343485551),o=t(o,b),a=t(a,w),s=t(s,S),c=t(c,B);return[o,a,s,c]}i(k,"binlMD5");function T(e){var f,n="",b=e.length*32;for(f=0;f<b;f+=8)n+=String.fromCharCode(e[f>>5]>>>f%32&255);return n}i(T,"binl2rstr");function x(e){var f,n=[];for(n[(e.length>>2)-1]=void 0,f=0;f<n.length;f+=1)n[f]=0;var b=e.length*8;for(f=0;f<b;f+=8)n[f>>5]|=(e.charCodeAt(f/8)&255)<<f%32;return n}i(x,"rstr2binl");function I(e){return T(k(x(e),e.length*8))}i(I,"rstrMD5");function E(e,f){var n,b=x(e),w=[],S=[],B;for(w[15]=S[15]=void 0,b.length>16&&(b=k(b,e.length*8)),n=0;n<16;n+=1)w[n]=b[n]^909522486,S[n]=b[n]^1549556828;return B=k(w.concat(x(f)),512+f.length*8),T(k(S.concat(B),640))}i(E,"rstrHMACMD5");function L(e){var f="0123456789abcdef",n="",b,w;for(w=0;w<e.length;w+=1)b=e.charCodeAt(w),n+=f.charAt(b>>>4&15)+f.charAt(b&15);return n}i(L,"rstr2hex");function A(e){return unescape(encodeURIComponent(e))}i(A,"str2rstrUTF8");function l(e){return I(A(e))}i(l,"rawMD5");function u(e){return L(l(e))}i(u,"hexMD5");function _(e,f){return E(A(e),A(f))}i(_,"rawHMACMD5");function v(e,f){return L(_(e,f))}i(v,"hexHMACMD5");function C(e,f,n){return f?n?_(f,e):v(f,e):n?l(e):u(e)}i(C,"md5"),typeof define=="function"&&define.amd?define(function(){return C}):typeof H=="object"&&H.exports?H.exports=C:r.md5=C})(q)});var Q=j((M,Y)=>{"use strict";(function(r,t){typeof M=="object"?Y.exports=M=t():typeof define=="function"&&define.amd?define([],t):r.CryptoJS=t()})(M,function(){var r=r||(function(t,d){var p=Object.create||(function(){function l(){}return i(l,"F"),function(u){var _;return l.prototype=u,_=new l,l.prototype=null,_}})(),h={},m=h.lib={},g=m.Base=(function(){return{extend:i(function(l){var u=p(this);return l&&u.mixIn(l),(!u.hasOwnProperty("init")||this.init===u.init)&&(u.init=function(){u.$super.init.apply(this,arguments)}),u.init.prototype=u,u.$super=this,u},"extend"),create:i(function(){var l=this.extend();return l.init.apply(l,arguments),l},"create"),init:i(function(){},"init"),mixIn:i(function(l){for(var u in l)l.hasOwnProperty(u)&&(this[u]=l[u]);l.hasOwnProperty("toString")&&(this.toString=l.toString)},"mixIn"),clone:i(function(){return this.init.prototype.extend(this)},"clone")}})(),y=m.WordArray=g.extend({init:i(function(l,u){l=this.words=l||[],u!=d?this.sigBytes=u:this.sigBytes=l.length*4},"init"),toString:i(function(l){return(l||T).stringify(this)},"toString"),concat:i(function(l){var u=this.words,_=l.words,v=this.sigBytes,C=l.sigBytes;if(this.clamp(),v%4)for(var e=0;e<C;e++){var f=_[e>>>2]>>>24-e%4*8&255;u[v+e>>>2]|=f<<24-(v+e)%4*8}else for(var e=0;e<C;e+=4)u[v+e>>>2]=_[e>>>2];return this.sigBytes+=C,this},"concat"),clamp:i(function(){var l=this.words,u=this.sigBytes;l[u>>>2]&=4294967295<<32-u%4*8,l.length=t.ceil(u/4)},"clamp"),clone:i(function(){var l=g.clone.call(this);return l.words=this.words.slice(0),l},"clone"),random:i(function(l){for(var u=[],_=i(function(n){var n=n,b=987654321,w=4294967295;return function(){b=36969*(b&65535)+(b>>16)&w,n=18e3*(n&65535)+(n>>16)&w;var S=(b<<16)+n&w;return S/=4294967296,S+=.5,S*(t.random()>.5?1:-1)}},"r"),v=0,C;v<l;v+=4){var e=_((C||t.random())*4294967296);C=e()*987654071,u.push(e()*4294967296|0)}return new y.init(u,l)},"random")}),k=h.enc={},T=k.Hex={stringify:i(function(l){for(var u=l.words,_=l.sigBytes,v=[],C=0;C<_;C++){var e=u[C>>>2]>>>24-C%4*8&255;v.push((e>>>4).toString(16)),v.push((e&15).toString(16))}return v.join("")},"stringify"),parse:i(function(l){for(var u=l.length,_=[],v=0;v<u;v+=2)_[v>>>3]|=parseInt(l.substr(v,2),16)<<24-v%8*4;return new y.init(_,u/2)},"parse")},x=k.Latin1={stringify:i(function(l){for(var u=l.words,_=l.sigBytes,v=[],C=0;C<_;C++){var e=u[C>>>2]>>>24-C%4*8&255;v.push(String.fromCharCode(e))}return v.join("")},"stringify"),parse:i(function(l){for(var u=l.length,_=[],v=0;v<u;v++)_[v>>>2]|=(l.charCodeAt(v)&255)<<24-v%4*8;return new y.init(_,u)},"parse")},I=k.Utf8={stringify:i(function(l){try{return decodeURIComponent(escape(x.stringify(l)))}catch{throw new Error("Malformed UTF-8 data")}},"stringify"),parse:i(function(l){return x.parse(unescape(encodeURIComponent(l)))},"parse")},E=m.BufferedBlockAlgorithm=g.extend({reset:i(function(){this._data=new y.init,this._nDataBytes=0},"reset"),_append:i(function(l){typeof l=="string"&&(l=I.parse(l)),this._data.concat(l),this._nDataBytes+=l.sigBytes},"_append"),_process:i(function(l){var u=this._data,_=u.words,v=u.sigBytes,C=this.blockSize,e=C*4,f=v/e;l?f=t.ceil(f):f=t.max((f|0)-this._minBufferSize,0);var n=f*C,b=t.min(n*4,v);if(n){for(var w=0;w<n;w+=C)this._doProcessBlock(_,w);var S=_.splice(0,n);u.sigBytes-=b}return new y.init(S,b)},"_process"),clone:i(function(){var l=g.clone.call(this);return l._data=this._data.clone(),l},"clone"),_minBufferSize:0}),L=m.Hasher=E.extend({cfg:g.extend(),init:i(function(l){this.cfg=this.cfg.extend(l),this.reset()},"init"),reset:i(function(){E.reset.call(this),this._doReset()},"reset"),update:i(function(l){return this._append(l),this._process(),this},"update"),finalize:i(function(l){l&&this._append(l);var u=this._doFinalize();return u},"finalize"),blockSize:512/32,_createHelper:i(function(l){return function(u,_){return new l.init(_).finalize(u)}},"_createHelper"),_createHmacHelper:i(function(l){return function(u,_){return new A.HMAC.init(l,_).finalize(u)}},"_createHmacHelper")}),A=h.algo={};return h})(Math);return r})});var te=j((R,ee)=>{"use strict";(function(r,t){typeof R=="object"?ee.exports=R=t(Q()):typeof define=="function"&&define.amd?define(["./core"],t):t(r.CryptoJS)})(R,function(r){return(function(){var t=r,d=t.lib,p=d.WordArray,h=d.Hasher,m=t.algo,g=[],y=m.SHA1=h.extend({_doReset:i(function(){this._hash=new p.init([1732584193,4023233417,2562383102,271733878,3285377520])},"_doReset"),_doProcessBlock:i(function(k,T){for(var x=this._hash.words,I=x[0],E=x[1],L=x[2],A=x[3],l=x[4],u=0;u<80;u++){if(u<16)g[u]=k[T+u]|0;else{var _=g[u-3]^g[u-8]^g[u-14]^g[u-16];g[u]=_<<1|_>>>31}var v=(I<<5|I>>>27)+l+g[u];u<20?v+=(E&L|~E&A)+1518500249:u<40?v+=(E^L^A)+1859775393:u<60?v+=(E&L|E&A|L&A)-1894007588:v+=(E^L^A)-899497514,l=A,A=L,L=E<<30|E>>>2,E=I,I=v}x[0]=x[0]+I|0,x[1]=x[1]+E|0,x[2]=x[2]+L|0,x[3]=x[3]+A|0,x[4]=x[4]+l|0},"_doProcessBlock"),_doFinalize:i(function(){var k=this._data,T=k.words,x=this._nDataBytes*8,I=k.sigBytes*8;return T[I>>>5]|=128<<24-I%32,T[(I+64>>>9<<4)+14]=Math.floor(x/4294967296),T[(I+64>>>9<<4)+15]=x,k.sigBytes=T.length*4,this._process(),this._hash},"_doFinalize"),clone:i(function(){var k=h.clone.call(this);return k._hash=this._hash.clone(),k},"clone")});t.SHA1=h._createHelper(y),t.HmacSHA1=h._createHmacHelper(y)})(),r.SHA1})});var qe={};xe(qe,{TrackKey:()=>U,name:()=>Je,reportTeaEvent:()=>$,version:()=>Ge});var ie=J(X(),1),oe=J(te(),1);function O(){return window.appId||null}i(O,"getAppId");function Se(){var d;let r="suda-csrf-token",t=document.cookie.split("; ");for(let p of t){let[h,m]=p.split("=");if(h===r)return decodeURIComponent(m)}return(d=window.csrfToken)!=null?d:null}i(Se,"getCsrfToken");function W(){let r=globalThis.CLIENT_BASE_PATH||"/";return/^\/app\/[^/]/.test(r)}i(W,"isNewPathEnabled");function F(){switch(globalThis.ENVIRONMENT){case"gray":return"PRE";case"online":return"ONLINE";default:return"BOE"}}i(F,"getEnv");function N(){let r=navigator.userAgent,t=/(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i.test(r),d=/iPad|Tab|Tablet/i.test(r)&&navigator.maxTouchPoints>1;return t||d}i(N,"isMobile");async function ne(){var p;let r=O();if(!r)return{code:1,msg:"appId is required",data:{}};let t=W()?`/app/${r}/__runtime__/api/v1/studio/lark/user_info`:`/spark/b/${r}/lark/user_info`;return await(await fetch(t,{headers:{"X-Suda-Csrf-Token":(p=Se())!=null?p:""}})).json()}i(ne,"getLarkUserInfo");var U={VIEW:"aily_agent_artifact_page_view"},ke="08a441",Ee="42b91e";function re(r){let t=String(r);return(0,oe.default)(ke+(0,ie.default)(t+Ee)).toString()}i(re,"encryptTea");var z=!1;async function Ie(){var m,g,y,k;let{data:r}=await ne(),{tenantID:t,userID:d}=r||{},p=d&&d!=="0"?re(d):void 0,h=t&&t!=="0"?re(t):void 0;(m=window.collectEvent)==null||m.call(window,"init",{app_id:788827,channel:"cn",disable_auto_pv:!1,enable_ab_test:!1,enable_debug:!1,enable_stay_duration:!0,reportTime:1e3}),(y=window.collectEvent)==null||y.call(window,"config",{user_unique_id:p,device_type:N()?"mobile":"pc",evtParams:{open_from:(g=new URLSearchParams(window.location.search).get("open-from"))!=null?g:void 0,env:F(),user_id:p,tenant_id:h}}),z=!0,(k=window.collectEvent)==null||k.call(window,"start")}i(Ie,"createTracker");async function $({trackKey:r,trackParams:t={}}){var d;try{z||(z=!0,await Ie()),(d=window.collectEvent)==null||d.call(window,r,t)}catch(p){console.error(p)}}i($,"reportTeaEvent");function ae(){return $({trackKey:U.VIEW,trackParams:{artifact_uid:O(),agent_id:"agent_miaoda",url:window.location.href}})}i(ae,"reportPageView");function se(){if(typeof crypto!="undefined"&&crypto.getRandomValues){let t=new Uint8Array(8);return crypto.getRandomValues(t),Array.from(t).map(d=>d.toString(16).padStart(2,"0")).join("")}let r="";for(let t=0;t<16;t++)r+=Math.floor(Math.random()*16).toString(16);return r}i(se,"generateUUID");var ce="x_sdk_device_id";function Ae(){try{let r=localStorage.getItem(ce);return r||(r=se(),localStorage.setItem(ce,r)),r}catch{return se()}}i(Ae,"getDeviceId");function Be(){let r=typeof navigator!="undefined"?navigator.userAgent:"";return r&&(/Android/i.test(r)&&/Mobile/i.test(r)||/iPhone|iPod/i.test(r)||/BlackBerry|IEMobile|Opera Mini/i.test(r))?"mobile":"desktop"}i(Be,"getDeviceType");function Le(){return{app_id:window.appId||"",tenant_id:window.tenantId||"",user_id:window.userId||"",did:Ae(),module:"app_web",app_env:"runtime",source_type:"user",device_type:Be(),release_commit_id:window.__RELEASE_COMMIT_ID__||""}}i(Le,"getDefaultAttributes");var Te="1.0.0";function Oe(r){let t=Le(),d=String(BigInt(Date.now())*BigInt(1e6));return{metricsData:{resource:{attributes:{sdk_version:Te,sdk_lang:"javascript",sdk_type:"client-frontend"}},metrics:[{name:"apaas_internal_metrics_pv_uv",description:"Count of page views",unit:"",scopeName:"apaas_internal_metrics_pv_uv",sum:{aggregationTemporality:1,isMonotonic:!0,dataPoints:r.map(p=>({attributes:{...t,url:p.url,path:p.path,referrer:p.referrer},startTimeUnixNano:String(BigInt(p.timestampMs)*BigInt(1e6)),timeUnixNano:d,asDouble:1}))}}]}}}i(Oe,"buildPayload");function Pe(r,t,d={}){if(t.length===0)return;let p=JSON.stringify(Oe(t));try{fetch(r,{method:"POST",headers:{"Content-Type":"application/json","X-Suda-Csrf-Token":window.csrfToken||"",...d},body:p,keepalive:!0}).catch(()=>{})}catch{}}i(Pe,"sendPvData");var P,De=(P=class{constructor(){this.started=!1,this.buffer=[]}static get instance(){return this._instance||(this._instance=new P),this._instance}start(t){var d;if(this.started)return;this.config=t,this.started=!0,this.listenRouteChanges(),this.registerLifecycleListeners();let p=(d=t.flushIntervalMs)!=null?d:1e4;this.flushTimer=setInterval(()=>this.flush(),p)}shutdown(){this.flush(),this.flushTimer&&(clearInterval(this.flushTimer),this.flushTimer=void 0),this.started=!1}recordPv(){let t=window.location.href;this.lastUrl!==t&&(this.lastUrl=t,this.buffer.push({url:t,path:window.location.pathname,referrer:document.referrer,timestampMs:Date.now()}))}flush(){if(!this.config||this.buffer.length===0)return;let t=this.buffer.splice(0);Pe(this.config.collectorUrl,t,this.config.headers)}listenRouteChanges(){document.readyState==="complete"?this.recordPv():window.addEventListener("load",()=>this.recordPv()),window.addEventListener("popstate",()=>this.recordPv()),this.patchHistory("pushState"),this.patchHistory("replaceState")}patchHistory(t){let d=history[t],p=i(()=>this.recordPv(),"recordPv");history[t]=function(...h){let m=d.apply(this,h);return p(),m}}registerLifecycleListeners(){document.addEventListener("visibilitychange",()=>{document.visibilityState==="hidden"&&this.flush()}),window.addEventListener("pagehide",()=>this.flush())}},i(P,"_PvTracker"),P),le=De.instance;function de(){var d;let r=(d=O())!=null?d:"",t=W()?`/app/${r}/__runtime__/api/v1/observability/metrics/collect`:`/spark/app/${r}/runtime/api/v1/observability/metrics/collect`;le.start({collectorUrl:t})}i(de,"initPvTracking");var fe="https://lf3-static.bytednsdoc.com/obj/eden-cn/LMfspH/ljhwZthlaukjlkulzlp/miaoda-ui",He=`${fe}/setting_voice.svg`,Me=`${fe}/Frame%202147223991%20(3).png`,Re='<svg viewBox="0 0 10 10" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M8.08312 8.08298C8.2384 7.92769 8.23953 7.67705 8.08424 7.52176L5.3625 4.80002L8.08422 2.07829C8.23951 1.92301 8.23839 1.67236 8.0831 1.51708C7.92781 1.36179 7.67717 1.36066 7.52188 1.51595C7.36659 1.67124 4.80016 4.23767 4.80016 4.23767L2.07841 1.51593C1.92313 1.36064 1.67248 1.36177 1.5172 1.51705C1.36191 1.67234 1.36078 1.92298 1.51607 2.07827L4.23782 4.80002L1.51605 7.52178C1.36076 7.67707 1.36189 7.92771 1.51718 8.083C1.67246 8.23829 1.92311 8.23941 2.07839 8.08412L4.80016 5.36236L7.5219 8.0841C7.67719 8.23939 7.92783 8.23826 8.08312 8.08298Z" fill="currentColor"/></svg>',Fe='<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M12.6667 2H3.33333V14H6.66667V15.3334H3.33333C2.59695 15.3334 2 14.7364 2 14V2C2 1.26364 2.59695 0.666687 3.33333 0.666687H12.6667C13.403 0.666687 14 1.26364 14 2V7.33335H12.6667V2Z" fill="currentColor"/><path d="M5.33333 4.66669C4.96514 4.66669 4.66667 4.96516 4.66667 5.33335C4.66667 5.70154 4.96514 6 5.33333 6H10.6667C11.0349 6 11.3333 5.70154 11.3333 5.33335C11.3333 4.96516 11.0349 4.66669 10.6667 4.66669H5.33333Z" fill="currentColor"/><path d="M4.66667 8.33335C4.66667 7.96516 4.96514 7.66669 5.33333 7.66669H8C8.36819 7.66669 8.66667 7.96516 8.66667 8.33335C8.66667 8.70154 8.36819 9 8 9H5.33333C4.96514 9 4.66667 8.70154 4.66667 8.33335Z" fill="currentColor"/><path d="M13.5523 8.70017C13.9428 8.30964 14.576 8.30964 14.9665 8.70017C15.357 9.09069 15.357 9.72386 14.9665 10.1144L14.2594 10.8215L12.8452 9.40728L13.5523 8.70017Z" fill="currentColor"/><path d="M12.1381 10.1144L13.5523 11.5286L10.2309 14.85C10.0916 14.9892 9.91229 15.0815 9.71798 15.1138L8.45737 15.3234C8.42136 15.3294 8.38467 15.3177 8.35885 15.2918C8.33271 15.2657 8.32099 15.2284 8.32749 15.192L8.55128 13.9374C8.58465 13.7502 8.6746 13.5779 8.80901 13.4435L12.1381 10.1144Z" fill="currentColor"/></svg>',pe=!0,Ne="\u8C46\u5305 AI \u751F\u6210",je="\u7531\u98DE\u4E66\u5999\u642D\u63D0\u4F9B\u652F\u6301",We="0px 8px 32px rgba(0,0,0,0.08), 0px 4px 16px rgba(0,0,0,0.04), 0px 2px 4px rgba(0,0,0,0.02)",ze="0px 4px 16px rgba(0,0,0,0.03), 0px 4px 10px rgba(0,0,0,0.03), 0px 2px 4px rgba(0,0,0,0.02)",K="'PingFang SC', -apple-system, BlinkMacSystemFont, sans-serif",Ue={BOE:"tns.feishu-boe.cn",PRE:"tns.feishu-pre.cn",ONLINE:"tns.feishu.cn"};function he(){var d;let r=JSON.stringify({scene:"miaoda_app_report",entity_id:(d=O())!=null?d:"",entity_type:"miaoda_app",extra:""}),t=`https://${Ue[F()]}/cust/lark_report/?type=common&params=${encodeURIComponent(r)}&lang=zh-CN`;window.open(t,"_blank","noopener,noreferrer")}i(he,"openDoubaoReport");function ge(r){let t=document.createElement("span");Object.assign(t.style,{display:"inline-flex",width:`${r}px`,height:`${r}px`,flexShrink:"0"}),t.innerHTML=Re;let d=t.firstElementChild;return d&&(d.setAttribute("width",String(r)),d.setAttribute("height",String(r)),d.style.display="block"),t}i(ge,"makeCloseIcon");function $e(r){let t=document.createElement("img");return t.src=He,t.width=r,t.height=r,t.alt="",Object.assign(t.style,{width:`${r}px`,height:`${r}px`,maxWidth:"none",maxHeight:"none",borderRadius:"100px",flexShrink:"0",display:"block"}),t}i($e,"makeAvatar");function Ve(r,t){let d=r==="desktop",p=document.createElement("div");Object.assign(p.style,{boxSizing:"border-box",display:"inline-flex",alignItems:"center",gap:d?"4px":"6px",padding:d?"6px 12px 6px 8px":"4px 12px 4px 8px",background:"#363636",border:"0.5px solid rgba(255,255,255,0.1)",borderRadius:"100px",boxShadow:We,cursor:"pointer"});let h=$e(d?16:18),m=document.createElement("span");if(m.textContent=Ne,Object.assign(m.style,{fontFamily:K,fontSize:d?"12px":"14px",lineHeight:d?"18px":"22px",color:"rgba(255,255,255,0.85)",whiteSpace:"nowrap"}),p.append(h,m),d&&t){let g=document.createElement("span");g.setAttribute("role","button"),g.setAttribute("aria-label","\u5173\u95ED"),g.setAttribute("data-doubao-close",""),Object.assign(g.style,{display:"none",alignItems:"center",cursor:"pointer",flexShrink:"0",color:"rgba(255,255,255,0.5)"}),g.appendChild(ge(10)),g.addEventListener("click",y=>{y.stopPropagation(),t()}),p.appendChild(g)}return p}i(Ve,"buildPill");function V(r){let t=document.createElement("div");t.setAttribute("role","menuitem"),t.setAttribute("data-label",r.label),Object.assign(t.style,{boxSizing:"border-box",display:"flex",alignItems:"center",gap:"8px",padding:"4px 10px",borderRadius:"6px",cursor:"pointer",color:"#000000"});let d=document.createElement("span");Object.assign(d.style,{display:"inline-flex",width:"16px",height:"16px",flexShrink:"0",color:"#000000"}),r.icon==="feedback"?d.innerHTML=Fe:d.appendChild(ge(16));let p=document.createElement("span");return p.textContent=r.label,Object.assign(p.style,{fontFamily:K,fontSize:`${r.fontSize}px`,lineHeight:`${r.fontSize+8}px`,color:"#000000",whiteSpace:"nowrap"}),t.append(d,p),t.addEventListener("mouseenter",()=>{t.style.background="rgba(0,0,0,0.04)"}),t.addEventListener("mouseleave",()=>{t.style.background="transparent"}),t.addEventListener("click",r.onClick),t}i(V,"buildMenuRow");function me(r){let t=document.createElement("div");if(Object.assign(t.style,{boxSizing:"border-box",display:"flex",flexDirection:"column",minWidth:`${r.minWidth}px`,background:"#ffffff",border:"0.5px solid rgba(0,0,0,0.1)",borderRadius:"10px",boxShadow:ze,overflow:"hidden",outline:"none"}),r.rows.length){let p=document.createElement("div");Object.assign(p.style,{boxSizing:"border-box",padding:"4px"}),r.rows.forEach(h=>p.appendChild(h)),t.appendChild(p)}let d=document.createElement("div");return d.textContent=je,Object.assign(d.style,{boxSizing:"border-box",background:"#f9f9f9",padding:"8px 14px",fontFamily:K,fontSize:`${r.footerFontSize}px`,lineHeight:`${r.footerFontSize+8}px`,color:"rgba(0,0,0,0.35)",whiteSpace:"nowrap"}),t.appendChild(d),t}i(me,"buildMenuCard");function Ke(){let r=document.createElement("div");r.setAttribute("data-custom-element","doubao-watermark"),Object.assign(r.style,{position:"fixed",right:"12px",bottom:"12px",zIndex:"9999",display:"flex",flexDirection:"column",alignItems:"flex-end",gap:"8px"});let t=[];pe&&t.push(V({icon:"feedback",label:"\u6295\u8BC9\u4E0E\u4E3E\u62A5",fontSize:14,onClick:he}));let d=me({rows:t,footerFontSize:12,minWidth:144});d.style.display="none";let p=Ve("desktop",()=>r.remove()),h=p.querySelector("[data-doubao-close]");r.append(d,p);let m=null;return r.addEventListener("mouseenter",()=>{m&&clearTimeout(m),d.style.display="flex",h&&(h.style.display="inline-flex")}),r.addEventListener("mouseleave",()=>{m=setTimeout(()=>{d.style.display="none",h&&(h.style.display="none")},100)}),r}i(Ke,"buildDesktopWatermark");function Ze(){let r=document.createElement("div");r.setAttribute("data-custom-element","doubao-watermark-mobile"),Object.assign(r.style,{position:"fixed",right:"12px",bottom:"12px",width:"122px",height:"30px",zIndex:"9999",cursor:"pointer"});let t=document.createElement("img");t.src=Me,t.width=166,t.height=94,t.alt="\u8C46\u5305 AI \u751F\u6210",Object.assign(t.style,{position:"absolute",right:"-12px",bottom:"-40px",width:"166px",height:"94px",maxWidth:"none",maxHeight:"none",display:"block",pointerEvents:"none"}),r.appendChild(t);let d=[];pe&&d.push(V({icon:"feedback",label:"\u6295\u8BC9\u4E0E\u4E3E\u62A5",fontSize:16,onClick:he})),d.push(V({icon:"close",label:"\u4E0D\u518D\u5C55\u793A",fontSize:16,onClick:i(h=>{h.stopPropagation(),r.remove()},"onClick")}));let p=me({rows:d,footerFontSize:14,minWidth:160});return Object.assign(p.style,{position:"absolute",right:"0",bottom:"38px",display:"none"}),r.appendChild(p),r.addEventListener("click",h=>{h.stopPropagation(),p.style.display=p.style.display==="none"?"flex":"none"}),document.addEventListener("click",()=>{p.style.display="none"}),r}i(Ze,"buildMobileWatermark");var ue=!1;function Z(){if(ue||typeof document=="undefined")return;if(document.readyState==="loading"){document.addEventListener("DOMContentLoaded",Z,{once:!0});return}ue=!0;let r=N()?Ze():Ke();document.body.appendChild(r)}i(Z,"mountDoubaoWatermark");var Ge="0.0.7",Je="@lark-apaas/miaoda-coding-sdk";ae(),de();Z();return Ce(qe);})();
@@ -1078,7 +1078,7 @@ var MiaodaRuntime = (() => {
1078
1078
  __name(reportTeaEvent, "reportTeaEvent");
1079
1079
 
1080
1080
  // src/runtime.ts
1081
- var version = "0.0.7-alpha.4";
1081
+ var version = "0.0.7";
1082
1082
  var name = "@lark-apaas/miaoda-coding-sdk";
1083
1083
  if (false) {
1084
1084
  reportPageView();
package/dist/runtime.js CHANGED
@@ -1287,7 +1287,7 @@ var MiaodaRuntime = (() => {
1287
1287
  __name(initPvTracking, "initPvTracking");
1288
1288
 
1289
1289
  // src/runtime.ts
1290
- var version = "0.0.7-alpha.4";
1290
+ var version = "0.0.7";
1291
1291
  var name = "@lark-apaas/miaoda-coding-sdk";
1292
1292
  if (true) {
1293
1293
  reportPageView();
@@ -1 +1 @@
1
- "use strict";var MiaodaRuntime=(()=>{var ct=Object.create;var M=Object.defineProperty;var ft=Object.getOwnPropertyDescriptor;var ut=Object.getOwnPropertyNames;var dt=Object.getPrototypeOf,lt=Object.prototype.hasOwnProperty;var c=(f,r)=>M(f,"name",{value:r,configurable:!0});var O=(f,r)=>()=>(r||f((r={exports:{}}).exports,r),r.exports),ht=(f,r)=>{for(var l in r)M(f,l,{get:r[l],enumerable:!0})},j=(f,r,l,_)=>{if(r&&typeof r=="object"||typeof r=="function")for(let h of ut(r))!lt.call(f,h)&&h!==l&&M(f,h,{get:()=>r[h],enumerable:!(_=ft(r,h))||_.enumerable});return f};var V=(f,r,l)=>(l=f!=null?ct(dt(f)):{},j(r||!f||!f.__esModule?M(l,"default",{value:f,enumerable:!0}):l,f)),pt=f=>j(M({},"__esModule",{value:!0}),f);var $=O((K,U)=>{"use strict";(function(f){"use strict";function r(t,d){var e=(t&65535)+(d&65535),v=(t>>16)+(d>>16)+(e>>16);return v<<16|e&65535}c(r,"safeAdd");function l(t,d){return t<<d|t>>>32-d}c(l,"bitRotateLeft");function _(t,d,e,v,w,I){return r(l(r(r(d,t),r(v,I)),w),e)}c(_,"md5cmn");function h(t,d,e,v,w,I,P){return _(d&e|~d&v,t,d,w,I,P)}c(h,"md5ff");function m(t,d,e,v,w,I,P){return _(d&v|e&~v,t,d,w,I,P)}c(m,"md5gg");function g(t,d,e,v,w,I,P){return _(d^e^v,t,d,w,I,P)}c(g,"md5hh");function b(t,d,e,v,w,I,P){return _(e^(d|~v),t,d,w,I,P)}c(b,"md5ii");function k(t,d){t[d>>5]|=128<<d%32,t[(d+64>>>9<<4)+14]=d;var e,v,w,I,P,n=1732584193,i=-271733879,a=-1732584194,o=271733878;for(e=0;e<t.length;e+=16)v=n,w=i,I=a,P=o,n=h(n,i,a,o,t[e],7,-680876936),o=h(o,n,i,a,t[e+1],12,-389564586),a=h(a,o,n,i,t[e+2],17,606105819),i=h(i,a,o,n,t[e+3],22,-1044525330),n=h(n,i,a,o,t[e+4],7,-176418897),o=h(o,n,i,a,t[e+5],12,1200080426),a=h(a,o,n,i,t[e+6],17,-1473231341),i=h(i,a,o,n,t[e+7],22,-45705983),n=h(n,i,a,o,t[e+8],7,1770035416),o=h(o,n,i,a,t[e+9],12,-1958414417),a=h(a,o,n,i,t[e+10],17,-42063),i=h(i,a,o,n,t[e+11],22,-1990404162),n=h(n,i,a,o,t[e+12],7,1804603682),o=h(o,n,i,a,t[e+13],12,-40341101),a=h(a,o,n,i,t[e+14],17,-1502002290),i=h(i,a,o,n,t[e+15],22,1236535329),n=m(n,i,a,o,t[e+1],5,-165796510),o=m(o,n,i,a,t[e+6],9,-1069501632),a=m(a,o,n,i,t[e+11],14,643717713),i=m(i,a,o,n,t[e],20,-373897302),n=m(n,i,a,o,t[e+5],5,-701558691),o=m(o,n,i,a,t[e+10],9,38016083),a=m(a,o,n,i,t[e+15],14,-660478335),i=m(i,a,o,n,t[e+4],20,-405537848),n=m(n,i,a,o,t[e+9],5,568446438),o=m(o,n,i,a,t[e+14],9,-1019803690),a=m(a,o,n,i,t[e+3],14,-187363961),i=m(i,a,o,n,t[e+8],20,1163531501),n=m(n,i,a,o,t[e+13],5,-1444681467),o=m(o,n,i,a,t[e+2],9,-51403784),a=m(a,o,n,i,t[e+7],14,1735328473),i=m(i,a,o,n,t[e+12],20,-1926607734),n=g(n,i,a,o,t[e+5],4,-378558),o=g(o,n,i,a,t[e+8],11,-2022574463),a=g(a,o,n,i,t[e+11],16,1839030562),i=g(i,a,o,n,t[e+14],23,-35309556),n=g(n,i,a,o,t[e+1],4,-1530992060),o=g(o,n,i,a,t[e+4],11,1272893353),a=g(a,o,n,i,t[e+7],16,-155497632),i=g(i,a,o,n,t[e+10],23,-1094730640),n=g(n,i,a,o,t[e+13],4,681279174),o=g(o,n,i,a,t[e],11,-358537222),a=g(a,o,n,i,t[e+3],16,-722521979),i=g(i,a,o,n,t[e+6],23,76029189),n=g(n,i,a,o,t[e+9],4,-640364487),o=g(o,n,i,a,t[e+12],11,-421815835),a=g(a,o,n,i,t[e+15],16,530742520),i=g(i,a,o,n,t[e+2],23,-995338651),n=b(n,i,a,o,t[e],6,-198630844),o=b(o,n,i,a,t[e+7],10,1126891415),a=b(a,o,n,i,t[e+14],15,-1416354905),i=b(i,a,o,n,t[e+5],21,-57434055),n=b(n,i,a,o,t[e+12],6,1700485571),o=b(o,n,i,a,t[e+3],10,-1894986606),a=b(a,o,n,i,t[e+10],15,-1051523),i=b(i,a,o,n,t[e+1],21,-2054922799),n=b(n,i,a,o,t[e+8],6,1873313359),o=b(o,n,i,a,t[e+15],10,-30611744),a=b(a,o,n,i,t[e+6],15,-1560198380),i=b(i,a,o,n,t[e+13],21,1309151649),n=b(n,i,a,o,t[e+4],6,-145523070),o=b(o,n,i,a,t[e+11],10,-1120210379),a=b(a,o,n,i,t[e+2],15,718787259),i=b(i,a,o,n,t[e+9],21,-343485551),n=r(n,v),i=r(i,w),a=r(a,I),o=r(o,P);return[n,i,a,o]}c(k,"binlMD5");function D(t){var d,e="",v=t.length*32;for(d=0;d<v;d+=8)e+=String.fromCharCode(t[d>>5]>>>d%32&255);return e}c(D,"binl2rstr");function S(t){var d,e=[];for(e[(t.length>>2)-1]=void 0,d=0;d<e.length;d+=1)e[d]=0;var v=t.length*8;for(d=0;d<v;d+=8)e[d>>5]|=(t.charCodeAt(d/8)&255)<<d%32;return e}c(S,"rstr2binl");function E(t){return D(k(S(t),t.length*8))}c(E,"rstrMD5");function T(t,d){var e,v=S(t),w=[],I=[],P;for(w[15]=I[15]=void 0,v.length>16&&(v=k(v,t.length*8)),e=0;e<16;e+=1)w[e]=v[e]^909522486,I[e]=v[e]^1549556828;return P=k(w.concat(S(d)),512+d.length*8),D(k(I.concat(P),640))}c(T,"rstrHMACMD5");function A(t){var d="0123456789abcdef",e="",v,w;for(w=0;w<t.length;w+=1)v=t.charCodeAt(w),e+=d.charAt(v>>>4&15)+d.charAt(v&15);return e}c(A,"rstr2hex");function C(t){return unescape(encodeURIComponent(t))}c(C,"str2rstrUTF8");function s(t){return E(C(t))}c(s,"rawMD5");function u(t){return A(s(t))}c(u,"hexMD5");function y(t,d){return T(C(t),C(d))}c(y,"rawHMACMD5");function p(t,d){return A(y(t,d))}c(p,"hexHMACMD5");function B(t,d,e){return d?e?y(d,t):p(d,t):e?s(t):u(t)}c(B,"md5"),typeof define=="function"&&define.amd?define(function(){return B}):typeof U=="object"&&U.exports?U.exports=B:f.md5=B})(K)});var q=O((L,J)=>{"use strict";(function(f,r){typeof L=="object"?J.exports=L=r():typeof define=="function"&&define.amd?define([],r):f.CryptoJS=r()})(L,function(){var f=f||(function(r,l){var _=Object.create||(function(){function s(){}return c(s,"F"),function(u){var y;return s.prototype=u,y=new s,s.prototype=null,y}})(),h={},m=h.lib={},g=m.Base=(function(){return{extend:c(function(s){var u=_(this);return s&&u.mixIn(s),(!u.hasOwnProperty("init")||this.init===u.init)&&(u.init=function(){u.$super.init.apply(this,arguments)}),u.init.prototype=u,u.$super=this,u},"extend"),create:c(function(){var s=this.extend();return s.init.apply(s,arguments),s},"create"),init:c(function(){},"init"),mixIn:c(function(s){for(var u in s)s.hasOwnProperty(u)&&(this[u]=s[u]);s.hasOwnProperty("toString")&&(this.toString=s.toString)},"mixIn"),clone:c(function(){return this.init.prototype.extend(this)},"clone")}})(),b=m.WordArray=g.extend({init:c(function(s,u){s=this.words=s||[],u!=l?this.sigBytes=u:this.sigBytes=s.length*4},"init"),toString:c(function(s){return(s||D).stringify(this)},"toString"),concat:c(function(s){var u=this.words,y=s.words,p=this.sigBytes,B=s.sigBytes;if(this.clamp(),p%4)for(var t=0;t<B;t++){var d=y[t>>>2]>>>24-t%4*8&255;u[p+t>>>2]|=d<<24-(p+t)%4*8}else for(var t=0;t<B;t+=4)u[p+t>>>2]=y[t>>>2];return this.sigBytes+=B,this},"concat"),clamp:c(function(){var s=this.words,u=this.sigBytes;s[u>>>2]&=4294967295<<32-u%4*8,s.length=r.ceil(u/4)},"clamp"),clone:c(function(){var s=g.clone.call(this);return s.words=this.words.slice(0),s},"clone"),random:c(function(s){for(var u=[],y=c(function(e){var e=e,v=987654321,w=4294967295;return function(){v=36969*(v&65535)+(v>>16)&w,e=18e3*(e&65535)+(e>>16)&w;var I=(v<<16)+e&w;return I/=4294967296,I+=.5,I*(r.random()>.5?1:-1)}},"r"),p=0,B;p<s;p+=4){var t=y((B||r.random())*4294967296);B=t()*987654071,u.push(t()*4294967296|0)}return new b.init(u,s)},"random")}),k=h.enc={},D=k.Hex={stringify:c(function(s){for(var u=s.words,y=s.sigBytes,p=[],B=0;B<y;B++){var t=u[B>>>2]>>>24-B%4*8&255;p.push((t>>>4).toString(16)),p.push((t&15).toString(16))}return p.join("")},"stringify"),parse:c(function(s){for(var u=s.length,y=[],p=0;p<u;p+=2)y[p>>>3]|=parseInt(s.substr(p,2),16)<<24-p%8*4;return new b.init(y,u/2)},"parse")},S=k.Latin1={stringify:c(function(s){for(var u=s.words,y=s.sigBytes,p=[],B=0;B<y;B++){var t=u[B>>>2]>>>24-B%4*8&255;p.push(String.fromCharCode(t))}return p.join("")},"stringify"),parse:c(function(s){for(var u=s.length,y=[],p=0;p<u;p++)y[p>>>2]|=(s.charCodeAt(p)&255)<<24-p%4*8;return new b.init(y,u)},"parse")},E=k.Utf8={stringify:c(function(s){try{return decodeURIComponent(escape(S.stringify(s)))}catch{throw new Error("Malformed UTF-8 data")}},"stringify"),parse:c(function(s){return S.parse(unescape(encodeURIComponent(s)))},"parse")},T=m.BufferedBlockAlgorithm=g.extend({reset:c(function(){this._data=new b.init,this._nDataBytes=0},"reset"),_append:c(function(s){typeof s=="string"&&(s=E.parse(s)),this._data.concat(s),this._nDataBytes+=s.sigBytes},"_append"),_process:c(function(s){var u=this._data,y=u.words,p=u.sigBytes,B=this.blockSize,t=B*4,d=p/t;s?d=r.ceil(d):d=r.max((d|0)-this._minBufferSize,0);var e=d*B,v=r.min(e*4,p);if(e){for(var w=0;w<e;w+=B)this._doProcessBlock(y,w);var I=y.splice(0,e);u.sigBytes-=v}return new b.init(I,v)},"_process"),clone:c(function(){var s=g.clone.call(this);return s._data=this._data.clone(),s},"clone"),_minBufferSize:0}),A=m.Hasher=T.extend({cfg:g.extend(),init:c(function(s){this.cfg=this.cfg.extend(s),this.reset()},"init"),reset:c(function(){T.reset.call(this),this._doReset()},"reset"),update:c(function(s){return this._append(s),this._process(),this},"update"),finalize:c(function(s){s&&this._append(s);var u=this._doFinalize();return u},"finalize"),blockSize:512/32,_createHelper:c(function(s){return function(u,y){return new s.init(y).finalize(u)}},"_createHelper"),_createHmacHelper:c(function(s){return function(u,y){return new C.HMAC.init(s,y).finalize(u)}},"_createHmacHelper")}),C=h.algo={};return h})(Math);return f})});var Q=O((N,G)=>{"use strict";(function(f,r){typeof N=="object"?G.exports=N=r(q()):typeof define=="function"&&define.amd?define(["./core"],r):r(f.CryptoJS)})(N,function(f){return(function(){var r=f,l=r.lib,_=l.WordArray,h=l.Hasher,m=r.algo,g=[],b=m.SHA1=h.extend({_doReset:c(function(){this._hash=new _.init([1732584193,4023233417,2562383102,271733878,3285377520])},"_doReset"),_doProcessBlock:c(function(k,D){for(var S=this._hash.words,E=S[0],T=S[1],A=S[2],C=S[3],s=S[4],u=0;u<80;u++){if(u<16)g[u]=k[D+u]|0;else{var y=g[u-3]^g[u-8]^g[u-14]^g[u-16];g[u]=y<<1|y>>>31}var p=(E<<5|E>>>27)+s+g[u];u<20?p+=(T&A|~T&C)+1518500249:u<40?p+=(T^A^C)+1859775393:u<60?p+=(T&A|T&C|A&C)-1894007588:p+=(T^A^C)-899497514,s=C,C=A,A=T<<30|T>>>2,T=E,E=p}S[0]=S[0]+E|0,S[1]=S[1]+T|0,S[2]=S[2]+A|0,S[3]=S[3]+C|0,S[4]=S[4]+s|0},"_doProcessBlock"),_doFinalize:c(function(){var k=this._data,D=k.words,S=this._nDataBytes*8,E=k.sigBytes*8;return D[E>>>5]|=128<<24-E%32,D[(E+64>>>9<<4)+14]=Math.floor(S/4294967296),D[(E+64>>>9<<4)+15]=S,k.sigBytes=D.length*4,this._process(),this._hash},"_doFinalize"),clone:c(function(){var k=h.clone.call(this);return k._hash=this._hash.clone(),k},"clone")});r.SHA1=h._createHelper(b),r.HmacSHA1=h._createHmacHelper(b)})(),f.SHA1})});var Ct={};ht(Ct,{TrackKey:()=>W,name:()=>Et,reportTeaEvent:()=>z,version:()=>Tt});var et=V($(),1),rt=V(Q(),1);function R(){return window.appId||null}c(R,"getAppId");function vt(){var l;let f="suda-csrf-token",r=document.cookie.split("; ");for(let _ of r){let[h,m]=_.split("=");if(h===f)return decodeURIComponent(m)}return(l=window.csrfToken)!=null?l:null}c(vt,"getCsrfToken");function x(){let f=globalThis.CLIENT_BASE_PATH||"/";return/^\/app\/[^/]/.test(f)}c(x,"isNewPathEnabled");function X(){switch(globalThis.ENVIRONMENT){case"gray":return"PRE";case"online":return"ONLINE";default:return"BOE"}}c(X,"getEnv");function Y(){let f=navigator.userAgent,r=/(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i.test(f),l=/iPad|Tab|Tablet/i.test(f)&&navigator.maxTouchPoints>1;return r||l}c(Y,"isMobile");async function Z(){var _;let f=R();if(!f)return{code:1,msg:"appId is required",data:{}};let r=x()?`/app/${f}/__runtime__/api/v1/studio/lark/user_info`:`/spark/b/${f}/lark/user_info`;return await(await fetch(r,{headers:{"X-Suda-Csrf-Token":(_=vt())!=null?_:""}})).json()}c(Z,"getLarkUserInfo");var W={VIEW:"aily_agent_artifact_page_view"},gt="08a441",_t="42b91e";function tt(f){let r=String(f);return(0,rt.default)(gt+(0,et.default)(r+_t)).toString()}c(tt,"encryptTea");var F=!1;async function mt(){var m,g,b,k;let{data:f}=await Z(),{tenantID:r,userID:l}=f||{},_=l&&l!=="0"?tt(l):void 0,h=r&&r!=="0"?tt(r):void 0;(m=window.collectEvent)==null||m.call(window,"init",{app_id:788827,channel:"cn",disable_auto_pv:!1,enable_ab_test:!1,enable_debug:!1,enable_stay_duration:!0,reportTime:1e3}),(b=window.collectEvent)==null||b.call(window,"config",{user_unique_id:_,device_type:Y()?"mobile":"pc",evtParams:{open_from:(g=new URLSearchParams(window.location.search).get("open-from"))!=null?g:void 0,env:X(),user_id:_,tenant_id:h}}),F=!0,(k=window.collectEvent)==null||k.call(window,"start")}c(mt,"createTracker");async function z({trackKey:f,trackParams:r={}}){var l;try{F||(F=!0,await mt()),(l=window.collectEvent)==null||l.call(window,f,r)}catch(_){console.error(_)}}c(z,"reportTeaEvent");function nt(){return z({trackKey:W.VIEW,trackParams:{artifact_uid:R(),agent_id:"agent_miaoda",url:window.location.href}})}c(nt,"reportPageView");function it(){if(typeof crypto!="undefined"&&crypto.getRandomValues){let r=new Uint8Array(8);return crypto.getRandomValues(r),Array.from(r).map(l=>l.toString(16).padStart(2,"0")).join("")}let f="";for(let r=0;r<16;r++)f+=Math.floor(Math.random()*16).toString(16);return f}c(it,"generateUUID");var at="x_sdk_device_id";function yt(){try{let f=localStorage.getItem(at);return f||(f=it(),localStorage.setItem(at,f)),f}catch{return it()}}c(yt,"getDeviceId");function wt(){let f=typeof navigator!="undefined"?navigator.userAgent:"";return f&&(/Android/i.test(f)&&/Mobile/i.test(f)||/iPhone|iPod/i.test(f)||/BlackBerry|IEMobile|Opera Mini/i.test(f))?"mobile":"desktop"}c(wt,"getDeviceType");function bt(){return{app_id:window.appId||"",tenant_id:window.tenantId||"",user_id:window.userId||"",did:yt(),module:"app_web",app_env:"runtime",source_type:"user",device_type:wt(),release_commit_id:window.__RELEASE_COMMIT_ID__||""}}c(bt,"getDefaultAttributes");var St="1.0.0";function Bt(f){let r=bt(),l=String(BigInt(Date.now())*BigInt(1e6));return{metricsData:{resource:{attributes:{sdk_version:St,sdk_lang:"javascript",sdk_type:"client-frontend"}},metrics:[{name:"apaas_internal_metrics_pv_uv",description:"Count of page views",unit:"",scopeName:"apaas_internal_metrics_pv_uv",sum:{aggregationTemporality:1,isMonotonic:!0,dataPoints:f.map(_=>({attributes:{...r,url:_.url,path:_.path,referrer:_.referrer},startTimeUnixNano:String(BigInt(_.timestampMs)*BigInt(1e6)),timeUnixNano:l,asDouble:1}))}}]}}}c(Bt,"buildPayload");function It(f,r,l={}){if(r.length===0)return;let _=JSON.stringify(Bt(r));try{fetch(f,{method:"POST",headers:{"Content-Type":"application/json","X-Suda-Csrf-Token":window.csrfToken||"",...l},body:_,keepalive:!0}).catch(()=>{})}catch{}}c(It,"sendPvData");var H,kt=(H=class{constructor(){this.started=!1,this.buffer=[]}static get instance(){return this._instance||(this._instance=new H),this._instance}start(r){var l;if(this.started)return;this.config=r,this.started=!0,this.listenRouteChanges(),this.registerLifecycleListeners();let _=(l=r.flushIntervalMs)!=null?l:1e4;this.flushTimer=setInterval(()=>this.flush(),_)}shutdown(){this.flush(),this.flushTimer&&(clearInterval(this.flushTimer),this.flushTimer=void 0),this.started=!1}recordPv(){let r=window.location.href;this.lastUrl!==r&&(this.lastUrl=r,this.buffer.push({url:r,path:window.location.pathname,referrer:document.referrer,timestampMs:Date.now()}))}flush(){if(!this.config||this.buffer.length===0)return;let r=this.buffer.splice(0);It(this.config.collectorUrl,r,this.config.headers)}listenRouteChanges(){document.readyState==="complete"?this.recordPv():window.addEventListener("load",()=>this.recordPv()),window.addEventListener("popstate",()=>this.recordPv()),this.patchHistory("pushState"),this.patchHistory("replaceState")}patchHistory(r){let l=history[r],_=c(()=>this.recordPv(),"recordPv");history[r]=function(...h){let m=l.apply(this,h);return _(),m}}registerLifecycleListeners(){document.addEventListener("visibilitychange",()=>{document.visibilityState==="hidden"&&this.flush()}),window.addEventListener("pagehide",()=>this.flush())}},c(H,"_PvTracker"),H),ot=kt.instance;function st(){var l;let f=(l=R())!=null?l:"",r=x()?`/app/${f}/__runtime__/api/v1/observability/metrics/collect`:`/spark/app/${f}/runtime/api/v1/observability/metrics/collect`;ot.start({collectorUrl:r})}c(st,"initPvTracking");var Tt="0.0.7-alpha.4",Et="@lark-apaas/miaoda-coding-sdk";nt(),st();return pt(Ct);})();
1
+ "use strict";var MiaodaRuntime=(()=>{var ct=Object.create;var M=Object.defineProperty;var ft=Object.getOwnPropertyDescriptor;var ut=Object.getOwnPropertyNames;var dt=Object.getPrototypeOf,lt=Object.prototype.hasOwnProperty;var c=(f,r)=>M(f,"name",{value:r,configurable:!0});var O=(f,r)=>()=>(r||f((r={exports:{}}).exports,r),r.exports),ht=(f,r)=>{for(var l in r)M(f,l,{get:r[l],enumerable:!0})},j=(f,r,l,_)=>{if(r&&typeof r=="object"||typeof r=="function")for(let h of ut(r))!lt.call(f,h)&&h!==l&&M(f,h,{get:()=>r[h],enumerable:!(_=ft(r,h))||_.enumerable});return f};var V=(f,r,l)=>(l=f!=null?ct(dt(f)):{},j(r||!f||!f.__esModule?M(l,"default",{value:f,enumerable:!0}):l,f)),pt=f=>j(M({},"__esModule",{value:!0}),f);var $=O((K,U)=>{"use strict";(function(f){"use strict";function r(t,d){var e=(t&65535)+(d&65535),v=(t>>16)+(d>>16)+(e>>16);return v<<16|e&65535}c(r,"safeAdd");function l(t,d){return t<<d|t>>>32-d}c(l,"bitRotateLeft");function _(t,d,e,v,w,I){return r(l(r(r(d,t),r(v,I)),w),e)}c(_,"md5cmn");function h(t,d,e,v,w,I,P){return _(d&e|~d&v,t,d,w,I,P)}c(h,"md5ff");function m(t,d,e,v,w,I,P){return _(d&v|e&~v,t,d,w,I,P)}c(m,"md5gg");function g(t,d,e,v,w,I,P){return _(d^e^v,t,d,w,I,P)}c(g,"md5hh");function b(t,d,e,v,w,I,P){return _(e^(d|~v),t,d,w,I,P)}c(b,"md5ii");function k(t,d){t[d>>5]|=128<<d%32,t[(d+64>>>9<<4)+14]=d;var e,v,w,I,P,n=1732584193,i=-271733879,a=-1732584194,o=271733878;for(e=0;e<t.length;e+=16)v=n,w=i,I=a,P=o,n=h(n,i,a,o,t[e],7,-680876936),o=h(o,n,i,a,t[e+1],12,-389564586),a=h(a,o,n,i,t[e+2],17,606105819),i=h(i,a,o,n,t[e+3],22,-1044525330),n=h(n,i,a,o,t[e+4],7,-176418897),o=h(o,n,i,a,t[e+5],12,1200080426),a=h(a,o,n,i,t[e+6],17,-1473231341),i=h(i,a,o,n,t[e+7],22,-45705983),n=h(n,i,a,o,t[e+8],7,1770035416),o=h(o,n,i,a,t[e+9],12,-1958414417),a=h(a,o,n,i,t[e+10],17,-42063),i=h(i,a,o,n,t[e+11],22,-1990404162),n=h(n,i,a,o,t[e+12],7,1804603682),o=h(o,n,i,a,t[e+13],12,-40341101),a=h(a,o,n,i,t[e+14],17,-1502002290),i=h(i,a,o,n,t[e+15],22,1236535329),n=m(n,i,a,o,t[e+1],5,-165796510),o=m(o,n,i,a,t[e+6],9,-1069501632),a=m(a,o,n,i,t[e+11],14,643717713),i=m(i,a,o,n,t[e],20,-373897302),n=m(n,i,a,o,t[e+5],5,-701558691),o=m(o,n,i,a,t[e+10],9,38016083),a=m(a,o,n,i,t[e+15],14,-660478335),i=m(i,a,o,n,t[e+4],20,-405537848),n=m(n,i,a,o,t[e+9],5,568446438),o=m(o,n,i,a,t[e+14],9,-1019803690),a=m(a,o,n,i,t[e+3],14,-187363961),i=m(i,a,o,n,t[e+8],20,1163531501),n=m(n,i,a,o,t[e+13],5,-1444681467),o=m(o,n,i,a,t[e+2],9,-51403784),a=m(a,o,n,i,t[e+7],14,1735328473),i=m(i,a,o,n,t[e+12],20,-1926607734),n=g(n,i,a,o,t[e+5],4,-378558),o=g(o,n,i,a,t[e+8],11,-2022574463),a=g(a,o,n,i,t[e+11],16,1839030562),i=g(i,a,o,n,t[e+14],23,-35309556),n=g(n,i,a,o,t[e+1],4,-1530992060),o=g(o,n,i,a,t[e+4],11,1272893353),a=g(a,o,n,i,t[e+7],16,-155497632),i=g(i,a,o,n,t[e+10],23,-1094730640),n=g(n,i,a,o,t[e+13],4,681279174),o=g(o,n,i,a,t[e],11,-358537222),a=g(a,o,n,i,t[e+3],16,-722521979),i=g(i,a,o,n,t[e+6],23,76029189),n=g(n,i,a,o,t[e+9],4,-640364487),o=g(o,n,i,a,t[e+12],11,-421815835),a=g(a,o,n,i,t[e+15],16,530742520),i=g(i,a,o,n,t[e+2],23,-995338651),n=b(n,i,a,o,t[e],6,-198630844),o=b(o,n,i,a,t[e+7],10,1126891415),a=b(a,o,n,i,t[e+14],15,-1416354905),i=b(i,a,o,n,t[e+5],21,-57434055),n=b(n,i,a,o,t[e+12],6,1700485571),o=b(o,n,i,a,t[e+3],10,-1894986606),a=b(a,o,n,i,t[e+10],15,-1051523),i=b(i,a,o,n,t[e+1],21,-2054922799),n=b(n,i,a,o,t[e+8],6,1873313359),o=b(o,n,i,a,t[e+15],10,-30611744),a=b(a,o,n,i,t[e+6],15,-1560198380),i=b(i,a,o,n,t[e+13],21,1309151649),n=b(n,i,a,o,t[e+4],6,-145523070),o=b(o,n,i,a,t[e+11],10,-1120210379),a=b(a,o,n,i,t[e+2],15,718787259),i=b(i,a,o,n,t[e+9],21,-343485551),n=r(n,v),i=r(i,w),a=r(a,I),o=r(o,P);return[n,i,a,o]}c(k,"binlMD5");function D(t){var d,e="",v=t.length*32;for(d=0;d<v;d+=8)e+=String.fromCharCode(t[d>>5]>>>d%32&255);return e}c(D,"binl2rstr");function S(t){var d,e=[];for(e[(t.length>>2)-1]=void 0,d=0;d<e.length;d+=1)e[d]=0;var v=t.length*8;for(d=0;d<v;d+=8)e[d>>5]|=(t.charCodeAt(d/8)&255)<<d%32;return e}c(S,"rstr2binl");function E(t){return D(k(S(t),t.length*8))}c(E,"rstrMD5");function T(t,d){var e,v=S(t),w=[],I=[],P;for(w[15]=I[15]=void 0,v.length>16&&(v=k(v,t.length*8)),e=0;e<16;e+=1)w[e]=v[e]^909522486,I[e]=v[e]^1549556828;return P=k(w.concat(S(d)),512+d.length*8),D(k(I.concat(P),640))}c(T,"rstrHMACMD5");function A(t){var d="0123456789abcdef",e="",v,w;for(w=0;w<t.length;w+=1)v=t.charCodeAt(w),e+=d.charAt(v>>>4&15)+d.charAt(v&15);return e}c(A,"rstr2hex");function C(t){return unescape(encodeURIComponent(t))}c(C,"str2rstrUTF8");function s(t){return E(C(t))}c(s,"rawMD5");function u(t){return A(s(t))}c(u,"hexMD5");function y(t,d){return T(C(t),C(d))}c(y,"rawHMACMD5");function p(t,d){return A(y(t,d))}c(p,"hexHMACMD5");function B(t,d,e){return d?e?y(d,t):p(d,t):e?s(t):u(t)}c(B,"md5"),typeof define=="function"&&define.amd?define(function(){return B}):typeof U=="object"&&U.exports?U.exports=B:f.md5=B})(K)});var q=O((L,J)=>{"use strict";(function(f,r){typeof L=="object"?J.exports=L=r():typeof define=="function"&&define.amd?define([],r):f.CryptoJS=r()})(L,function(){var f=f||(function(r,l){var _=Object.create||(function(){function s(){}return c(s,"F"),function(u){var y;return s.prototype=u,y=new s,s.prototype=null,y}})(),h={},m=h.lib={},g=m.Base=(function(){return{extend:c(function(s){var u=_(this);return s&&u.mixIn(s),(!u.hasOwnProperty("init")||this.init===u.init)&&(u.init=function(){u.$super.init.apply(this,arguments)}),u.init.prototype=u,u.$super=this,u},"extend"),create:c(function(){var s=this.extend();return s.init.apply(s,arguments),s},"create"),init:c(function(){},"init"),mixIn:c(function(s){for(var u in s)s.hasOwnProperty(u)&&(this[u]=s[u]);s.hasOwnProperty("toString")&&(this.toString=s.toString)},"mixIn"),clone:c(function(){return this.init.prototype.extend(this)},"clone")}})(),b=m.WordArray=g.extend({init:c(function(s,u){s=this.words=s||[],u!=l?this.sigBytes=u:this.sigBytes=s.length*4},"init"),toString:c(function(s){return(s||D).stringify(this)},"toString"),concat:c(function(s){var u=this.words,y=s.words,p=this.sigBytes,B=s.sigBytes;if(this.clamp(),p%4)for(var t=0;t<B;t++){var d=y[t>>>2]>>>24-t%4*8&255;u[p+t>>>2]|=d<<24-(p+t)%4*8}else for(var t=0;t<B;t+=4)u[p+t>>>2]=y[t>>>2];return this.sigBytes+=B,this},"concat"),clamp:c(function(){var s=this.words,u=this.sigBytes;s[u>>>2]&=4294967295<<32-u%4*8,s.length=r.ceil(u/4)},"clamp"),clone:c(function(){var s=g.clone.call(this);return s.words=this.words.slice(0),s},"clone"),random:c(function(s){for(var u=[],y=c(function(e){var e=e,v=987654321,w=4294967295;return function(){v=36969*(v&65535)+(v>>16)&w,e=18e3*(e&65535)+(e>>16)&w;var I=(v<<16)+e&w;return I/=4294967296,I+=.5,I*(r.random()>.5?1:-1)}},"r"),p=0,B;p<s;p+=4){var t=y((B||r.random())*4294967296);B=t()*987654071,u.push(t()*4294967296|0)}return new b.init(u,s)},"random")}),k=h.enc={},D=k.Hex={stringify:c(function(s){for(var u=s.words,y=s.sigBytes,p=[],B=0;B<y;B++){var t=u[B>>>2]>>>24-B%4*8&255;p.push((t>>>4).toString(16)),p.push((t&15).toString(16))}return p.join("")},"stringify"),parse:c(function(s){for(var u=s.length,y=[],p=0;p<u;p+=2)y[p>>>3]|=parseInt(s.substr(p,2),16)<<24-p%8*4;return new b.init(y,u/2)},"parse")},S=k.Latin1={stringify:c(function(s){for(var u=s.words,y=s.sigBytes,p=[],B=0;B<y;B++){var t=u[B>>>2]>>>24-B%4*8&255;p.push(String.fromCharCode(t))}return p.join("")},"stringify"),parse:c(function(s){for(var u=s.length,y=[],p=0;p<u;p++)y[p>>>2]|=(s.charCodeAt(p)&255)<<24-p%4*8;return new b.init(y,u)},"parse")},E=k.Utf8={stringify:c(function(s){try{return decodeURIComponent(escape(S.stringify(s)))}catch{throw new Error("Malformed UTF-8 data")}},"stringify"),parse:c(function(s){return S.parse(unescape(encodeURIComponent(s)))},"parse")},T=m.BufferedBlockAlgorithm=g.extend({reset:c(function(){this._data=new b.init,this._nDataBytes=0},"reset"),_append:c(function(s){typeof s=="string"&&(s=E.parse(s)),this._data.concat(s),this._nDataBytes+=s.sigBytes},"_append"),_process:c(function(s){var u=this._data,y=u.words,p=u.sigBytes,B=this.blockSize,t=B*4,d=p/t;s?d=r.ceil(d):d=r.max((d|0)-this._minBufferSize,0);var e=d*B,v=r.min(e*4,p);if(e){for(var w=0;w<e;w+=B)this._doProcessBlock(y,w);var I=y.splice(0,e);u.sigBytes-=v}return new b.init(I,v)},"_process"),clone:c(function(){var s=g.clone.call(this);return s._data=this._data.clone(),s},"clone"),_minBufferSize:0}),A=m.Hasher=T.extend({cfg:g.extend(),init:c(function(s){this.cfg=this.cfg.extend(s),this.reset()},"init"),reset:c(function(){T.reset.call(this),this._doReset()},"reset"),update:c(function(s){return this._append(s),this._process(),this},"update"),finalize:c(function(s){s&&this._append(s);var u=this._doFinalize();return u},"finalize"),blockSize:512/32,_createHelper:c(function(s){return function(u,y){return new s.init(y).finalize(u)}},"_createHelper"),_createHmacHelper:c(function(s){return function(u,y){return new C.HMAC.init(s,y).finalize(u)}},"_createHmacHelper")}),C=h.algo={};return h})(Math);return f})});var Q=O((N,G)=>{"use strict";(function(f,r){typeof N=="object"?G.exports=N=r(q()):typeof define=="function"&&define.amd?define(["./core"],r):r(f.CryptoJS)})(N,function(f){return(function(){var r=f,l=r.lib,_=l.WordArray,h=l.Hasher,m=r.algo,g=[],b=m.SHA1=h.extend({_doReset:c(function(){this._hash=new _.init([1732584193,4023233417,2562383102,271733878,3285377520])},"_doReset"),_doProcessBlock:c(function(k,D){for(var S=this._hash.words,E=S[0],T=S[1],A=S[2],C=S[3],s=S[4],u=0;u<80;u++){if(u<16)g[u]=k[D+u]|0;else{var y=g[u-3]^g[u-8]^g[u-14]^g[u-16];g[u]=y<<1|y>>>31}var p=(E<<5|E>>>27)+s+g[u];u<20?p+=(T&A|~T&C)+1518500249:u<40?p+=(T^A^C)+1859775393:u<60?p+=(T&A|T&C|A&C)-1894007588:p+=(T^A^C)-899497514,s=C,C=A,A=T<<30|T>>>2,T=E,E=p}S[0]=S[0]+E|0,S[1]=S[1]+T|0,S[2]=S[2]+A|0,S[3]=S[3]+C|0,S[4]=S[4]+s|0},"_doProcessBlock"),_doFinalize:c(function(){var k=this._data,D=k.words,S=this._nDataBytes*8,E=k.sigBytes*8;return D[E>>>5]|=128<<24-E%32,D[(E+64>>>9<<4)+14]=Math.floor(S/4294967296),D[(E+64>>>9<<4)+15]=S,k.sigBytes=D.length*4,this._process(),this._hash},"_doFinalize"),clone:c(function(){var k=h.clone.call(this);return k._hash=this._hash.clone(),k},"clone")});r.SHA1=h._createHelper(b),r.HmacSHA1=h._createHmacHelper(b)})(),f.SHA1})});var Ct={};ht(Ct,{TrackKey:()=>W,name:()=>Et,reportTeaEvent:()=>z,version:()=>Tt});var et=V($(),1),rt=V(Q(),1);function R(){return window.appId||null}c(R,"getAppId");function vt(){var l;let f="suda-csrf-token",r=document.cookie.split("; ");for(let _ of r){let[h,m]=_.split("=");if(h===f)return decodeURIComponent(m)}return(l=window.csrfToken)!=null?l:null}c(vt,"getCsrfToken");function x(){let f=globalThis.CLIENT_BASE_PATH||"/";return/^\/app\/[^/]/.test(f)}c(x,"isNewPathEnabled");function X(){switch(globalThis.ENVIRONMENT){case"gray":return"PRE";case"online":return"ONLINE";default:return"BOE"}}c(X,"getEnv");function Y(){let f=navigator.userAgent,r=/(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i.test(f),l=/iPad|Tab|Tablet/i.test(f)&&navigator.maxTouchPoints>1;return r||l}c(Y,"isMobile");async function Z(){var _;let f=R();if(!f)return{code:1,msg:"appId is required",data:{}};let r=x()?`/app/${f}/__runtime__/api/v1/studio/lark/user_info`:`/spark/b/${f}/lark/user_info`;return await(await fetch(r,{headers:{"X-Suda-Csrf-Token":(_=vt())!=null?_:""}})).json()}c(Z,"getLarkUserInfo");var W={VIEW:"aily_agent_artifact_page_view"},gt="08a441",_t="42b91e";function tt(f){let r=String(f);return(0,rt.default)(gt+(0,et.default)(r+_t)).toString()}c(tt,"encryptTea");var F=!1;async function mt(){var m,g,b,k;let{data:f}=await Z(),{tenantID:r,userID:l}=f||{},_=l&&l!=="0"?tt(l):void 0,h=r&&r!=="0"?tt(r):void 0;(m=window.collectEvent)==null||m.call(window,"init",{app_id:788827,channel:"cn",disable_auto_pv:!1,enable_ab_test:!1,enable_debug:!1,enable_stay_duration:!0,reportTime:1e3}),(b=window.collectEvent)==null||b.call(window,"config",{user_unique_id:_,device_type:Y()?"mobile":"pc",evtParams:{open_from:(g=new URLSearchParams(window.location.search).get("open-from"))!=null?g:void 0,env:X(),user_id:_,tenant_id:h}}),F=!0,(k=window.collectEvent)==null||k.call(window,"start")}c(mt,"createTracker");async function z({trackKey:f,trackParams:r={}}){var l;try{F||(F=!0,await mt()),(l=window.collectEvent)==null||l.call(window,f,r)}catch(_){console.error(_)}}c(z,"reportTeaEvent");function nt(){return z({trackKey:W.VIEW,trackParams:{artifact_uid:R(),agent_id:"agent_miaoda",url:window.location.href}})}c(nt,"reportPageView");function it(){if(typeof crypto!="undefined"&&crypto.getRandomValues){let r=new Uint8Array(8);return crypto.getRandomValues(r),Array.from(r).map(l=>l.toString(16).padStart(2,"0")).join("")}let f="";for(let r=0;r<16;r++)f+=Math.floor(Math.random()*16).toString(16);return f}c(it,"generateUUID");var at="x_sdk_device_id";function yt(){try{let f=localStorage.getItem(at);return f||(f=it(),localStorage.setItem(at,f)),f}catch{return it()}}c(yt,"getDeviceId");function wt(){let f=typeof navigator!="undefined"?navigator.userAgent:"";return f&&(/Android/i.test(f)&&/Mobile/i.test(f)||/iPhone|iPod/i.test(f)||/BlackBerry|IEMobile|Opera Mini/i.test(f))?"mobile":"desktop"}c(wt,"getDeviceType");function bt(){return{app_id:window.appId||"",tenant_id:window.tenantId||"",user_id:window.userId||"",did:yt(),module:"app_web",app_env:"runtime",source_type:"user",device_type:wt(),release_commit_id:window.__RELEASE_COMMIT_ID__||""}}c(bt,"getDefaultAttributes");var St="1.0.0";function Bt(f){let r=bt(),l=String(BigInt(Date.now())*BigInt(1e6));return{metricsData:{resource:{attributes:{sdk_version:St,sdk_lang:"javascript",sdk_type:"client-frontend"}},metrics:[{name:"apaas_internal_metrics_pv_uv",description:"Count of page views",unit:"",scopeName:"apaas_internal_metrics_pv_uv",sum:{aggregationTemporality:1,isMonotonic:!0,dataPoints:f.map(_=>({attributes:{...r,url:_.url,path:_.path,referrer:_.referrer},startTimeUnixNano:String(BigInt(_.timestampMs)*BigInt(1e6)),timeUnixNano:l,asDouble:1}))}}]}}}c(Bt,"buildPayload");function It(f,r,l={}){if(r.length===0)return;let _=JSON.stringify(Bt(r));try{fetch(f,{method:"POST",headers:{"Content-Type":"application/json","X-Suda-Csrf-Token":window.csrfToken||"",...l},body:_,keepalive:!0}).catch(()=>{})}catch{}}c(It,"sendPvData");var H,kt=(H=class{constructor(){this.started=!1,this.buffer=[]}static get instance(){return this._instance||(this._instance=new H),this._instance}start(r){var l;if(this.started)return;this.config=r,this.started=!0,this.listenRouteChanges(),this.registerLifecycleListeners();let _=(l=r.flushIntervalMs)!=null?l:1e4;this.flushTimer=setInterval(()=>this.flush(),_)}shutdown(){this.flush(),this.flushTimer&&(clearInterval(this.flushTimer),this.flushTimer=void 0),this.started=!1}recordPv(){let r=window.location.href;this.lastUrl!==r&&(this.lastUrl=r,this.buffer.push({url:r,path:window.location.pathname,referrer:document.referrer,timestampMs:Date.now()}))}flush(){if(!this.config||this.buffer.length===0)return;let r=this.buffer.splice(0);It(this.config.collectorUrl,r,this.config.headers)}listenRouteChanges(){document.readyState==="complete"?this.recordPv():window.addEventListener("load",()=>this.recordPv()),window.addEventListener("popstate",()=>this.recordPv()),this.patchHistory("pushState"),this.patchHistory("replaceState")}patchHistory(r){let l=history[r],_=c(()=>this.recordPv(),"recordPv");history[r]=function(...h){let m=l.apply(this,h);return _(),m}}registerLifecycleListeners(){document.addEventListener("visibilitychange",()=>{document.visibilityState==="hidden"&&this.flush()}),window.addEventListener("pagehide",()=>this.flush())}},c(H,"_PvTracker"),H),ot=kt.instance;function st(){var l;let f=(l=R())!=null?l:"",r=x()?`/app/${f}/__runtime__/api/v1/observability/metrics/collect`:`/spark/app/${f}/runtime/api/v1/observability/metrics/collect`;ot.start({collectorUrl:r})}c(st,"initPvTracking");var Tt="0.0.7",Et="@lark-apaas/miaoda-coding-sdk";nt(),st();return pt(Ct);})();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lark-apaas/miaoda-coding-sdk",
3
- "version": "0.0.7-alpha.4",
3
+ "version": "0.0.7",
4
4
  "description": "CDN distribution of aPaaS Web SDK for no-build HTML — self-contained IIFE entries consumed via <script src>",
5
5
  "license": "MIT",
6
6
  "type": "module",