@lark-apaas/miaoda-coding-sdk 0.0.10 → 0.0.11-alpha.20260825130527

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.
@@ -191,7 +191,7 @@ var MiaodaRuntime = (() => {
191
191
  __name(registerInspectorIdPlugin, "registerInspectorIdPlugin");
192
192
 
193
193
  // src/design-runtime.ts
194
- var version = "0.0.10";
194
+ var version = "0.0.11-alpha.20260825130527";
195
195
  var name = "@lark-apaas/miaoda-coding-sdk";
196
196
  if (!window.__CREATIVITY_RUNTIME__) {
197
197
  window.__CREATIVITY_RUNTIME__ = true;
@@ -191,7 +191,7 @@ var MiaodaRuntime = (() => {
191
191
  __name(registerInspectorIdPlugin, "registerInspectorIdPlugin");
192
192
 
193
193
  // src/design-runtime.ts
194
- var version = "0.0.10";
194
+ var version = "0.0.11-alpha.20260825130527";
195
195
  var name = "@lark-apaas/miaoda-coding-sdk";
196
196
  if (!window.__CREATIVITY_RUNTIME__) {
197
197
  window.__CREATIVITY_RUNTIME__ = true;
@@ -1 +1 @@
1
- "use strict";var MiaodaRuntime=(()=>{var g=Object.defineProperty;var A=Object.getOwnPropertyDescriptor;var T=Object.getOwnPropertyNames;var P=Object.prototype.hasOwnProperty;var f=(e,n)=>g(e,"name",{value:n,configurable:!0});var M=(e,n)=>{for(var o in n)g(e,o,{get:n[o],enumerable:!0})},N=(e,n,o,d)=>{if(n&&typeof n=="object"||typeof n=="function")for(let l of T(n))!P.call(e,l)&&l!==o&&g(e,l,{get:()=>n[l],enumerable:!(d=A(n,l))||d.enumerable});return e};var $=e=>N(g({},"__esModule",{value:!0}),e);var O={};M(O,{name:()=>L,version:()=>R});var C="https://lf3-short.ibytedapm.com/slardar/fe/sdk-web/browser.cn.js",h=!1;function I(){if(h)return;if(h=!0,window.Slardar){x();return}let e=document.createElement("script");e.src=C,e.onload=()=>{window.Slardar&&x()},e.onerror=()=>{},document.head.appendChild(e)}f(I,"initCreativePerf");function x(){var l,i,s;let e=window.Slardar;if(!e)return;e("context.merge",{app_id:(l=window.__appId__)!=null?l:"",creative_type:(i=window.__creativeType__)!=null?i:"unknown",is_public:String((s=window.__isExternallyVisible__)!=null?s:!1)}),e("init",{bid:"apaas_miaoda",env:window.ENVIRONMENT||"online"}),e("start");let n={},o=!1;try{new PerformanceObserver(r=>{let t=r.getEntries();for(let a=0;a<t.length;a++)t[a].name==="first-contentful-paint"&&(n.fcp=Math.round(t[a].startTime))}).observe({type:"paint",buffered:!0})}catch{}try{new PerformanceObserver(r=>{let t=r.getEntries();t.length&&(n.lcp=Math.round(t[t.length-1].startTime))}).observe({type:"largest-contentful-paint",buffered:!0})}catch{}function d(){var a,c,m,u,p,b;if(o||!window.Slardar)return;o=!0;let r=(a=performance.getEntriesByType("navigation")[0])!=null?a:{},t=performance.getEntriesByType("resource");window.Slardar("sendEvent",{name:"creative_perf",metrics:{fcp:(c=n.fcp)!=null?c:0,lcp:(u=(m=n.lcp)!=null?m:n.fcp)!=null?u:0,load:Math.round((p=r.loadEventEnd)!=null?p:0),dom_ready:Math.round((b=r.domContentLoadedEventEnd)!=null?b:0),transfer_size:t.reduce((w,y)=>{var _;return w+((_=y.transferSize)!=null?_:0)},0)},categories:{}})}f(d,"send"),window.addEventListener("load",()=>{setTimeout(d,500)}),setTimeout(d,15e3)}f(x,"bootstrap");function S(){let e="inspector-id";document.addEventListener("DOMContentLoaded",()=>{let n=window.Babel;if(!n||!n.registerPlugin)return;let o=null,d=f(()=>{let i={},s=0;return document.querySelectorAll('script[type="text/babel"],script[type="text/jsx"]').forEach(r=>{let t=r.getAttribute("src");if(t){let a=t.split("?")[0],c=a.split("/").pop()||a;i[c]=c in i?"":a}else{s++;let a=s===1?"Inline Babel script":`Inline Babel script (${s})`;i[a]=r.getAttribute("data-filename")||`inline-${s-1}`}}),i},"buildFileMap");n.availablePlugins&&delete n.availablePlugins[e],n.registerPlugin(e,({types:i})=>({visitor:{JSXOpeningElement(s,r){let t=s.node;if(t.name&&t.name.type==="JSXMemberExpression")return;for(let E=0;E<t.attributes.length;E++){let v=t.attributes[E];if(v.type==="JSXAttribute"&&v.name&&v.name.name==="data-inspector-id")return}let a=r.file&&r.file.opts&&r.file.opts.filename||"?";o===null&&(o=d());let c=a.split("?")[0],m=c.split("/").pop()||c,u=o[a]||o[m]||c.replace(/^\/?[a-z][a-z0-9+.-]*:\/{1,2}[^/]+/i,"").replace(/^\/+/,"")||a,p=t.loc&&t.loc.start,b=p?p.line:0,w=p?p.column+1:0,y=t.name&&t.name.type==="JSXIdentifier"?t.name.name:u,_=`jsx:${u}:${y}:${b}:${w}`;t.attributes.push(i.jsxAttribute(i.jsxIdentifier("data-inspector-id"),i.stringLiteral(_)))}}}));let l="";try{let i=document.getElementById("__srcmap");if(i&&i.textContent){let s=JSON.parse(i.textContent),r=s==null?void 0:s.file;typeof r=="string"&&(l=r)}}catch{}document.querySelectorAll('script[type="text/babel"],script[type="text/jsx"]').forEach((i,s)=>{let r=i.getAttribute("data-plugins")||"";if(r.indexOf(e)<0&&i.setAttribute("data-plugins",r?`${r},${e}`:e),!i.hasAttribute("data-filename")){let t=l?`${l}#inline-${s}`:`inline-${s}`;i.setAttribute("data-filename",i.getAttribute("src")||t)}})})}f(S,"registerInspectorIdPlugin");var R="0.0.10",L="@lark-apaas/miaoda-coding-sdk";window.__CREATIVITY_RUNTIME__||(window.__CREATIVITY_RUNTIME__=!0,S(),I());return $(O);})();
1
+ "use strict";var MiaodaRuntime=(()=>{var g=Object.defineProperty;var A=Object.getOwnPropertyDescriptor;var T=Object.getOwnPropertyNames;var P=Object.prototype.hasOwnProperty;var f=(e,n)=>g(e,"name",{value:n,configurable:!0});var M=(e,n)=>{for(var o in n)g(e,o,{get:n[o],enumerable:!0})},N=(e,n,o,d)=>{if(n&&typeof n=="object"||typeof n=="function")for(let l of T(n))!P.call(e,l)&&l!==o&&g(e,l,{get:()=>n[l],enumerable:!(d=A(n,l))||d.enumerable});return e};var $=e=>N(g({},"__esModule",{value:!0}),e);var O={};M(O,{name:()=>L,version:()=>R});var C="https://lf3-short.ibytedapm.com/slardar/fe/sdk-web/browser.cn.js",h=!1;function I(){if(h)return;if(h=!0,window.Slardar){x();return}let e=document.createElement("script");e.src=C,e.onload=()=>{window.Slardar&&x()},e.onerror=()=>{},document.head.appendChild(e)}f(I,"initCreativePerf");function x(){var l,i,s;let e=window.Slardar;if(!e)return;e("context.merge",{app_id:(l=window.__appId__)!=null?l:"",creative_type:(i=window.__creativeType__)!=null?i:"unknown",is_public:String((s=window.__isExternallyVisible__)!=null?s:!1)}),e("init",{bid:"apaas_miaoda",env:window.ENVIRONMENT||"online"}),e("start");let n={},o=!1;try{new PerformanceObserver(r=>{let t=r.getEntries();for(let a=0;a<t.length;a++)t[a].name==="first-contentful-paint"&&(n.fcp=Math.round(t[a].startTime))}).observe({type:"paint",buffered:!0})}catch{}try{new PerformanceObserver(r=>{let t=r.getEntries();t.length&&(n.lcp=Math.round(t[t.length-1].startTime))}).observe({type:"largest-contentful-paint",buffered:!0})}catch{}function d(){var a,c,m,u,p,b;if(o||!window.Slardar)return;o=!0;let r=(a=performance.getEntriesByType("navigation")[0])!=null?a:{},t=performance.getEntriesByType("resource");window.Slardar("sendEvent",{name:"creative_perf",metrics:{fcp:(c=n.fcp)!=null?c:0,lcp:(u=(m=n.lcp)!=null?m:n.fcp)!=null?u:0,load:Math.round((p=r.loadEventEnd)!=null?p:0),dom_ready:Math.round((b=r.domContentLoadedEventEnd)!=null?b:0),transfer_size:t.reduce((w,y)=>{var _;return w+((_=y.transferSize)!=null?_:0)},0)},categories:{}})}f(d,"send"),window.addEventListener("load",()=>{setTimeout(d,500)}),setTimeout(d,15e3)}f(x,"bootstrap");function S(){let e="inspector-id";document.addEventListener("DOMContentLoaded",()=>{let n=window.Babel;if(!n||!n.registerPlugin)return;let o=null,d=f(()=>{let i={},s=0;return document.querySelectorAll('script[type="text/babel"],script[type="text/jsx"]').forEach(r=>{let t=r.getAttribute("src");if(t){let a=t.split("?")[0],c=a.split("/").pop()||a;i[c]=c in i?"":a}else{s++;let a=s===1?"Inline Babel script":`Inline Babel script (${s})`;i[a]=r.getAttribute("data-filename")||`inline-${s-1}`}}),i},"buildFileMap");n.availablePlugins&&delete n.availablePlugins[e],n.registerPlugin(e,({types:i})=>({visitor:{JSXOpeningElement(s,r){let t=s.node;if(t.name&&t.name.type==="JSXMemberExpression")return;for(let E=0;E<t.attributes.length;E++){let v=t.attributes[E];if(v.type==="JSXAttribute"&&v.name&&v.name.name==="data-inspector-id")return}let a=r.file&&r.file.opts&&r.file.opts.filename||"?";o===null&&(o=d());let c=a.split("?")[0],m=c.split("/").pop()||c,u=o[a]||o[m]||c.replace(/^\/?[a-z][a-z0-9+.-]*:\/{1,2}[^/]+/i,"").replace(/^\/+/,"")||a,p=t.loc&&t.loc.start,b=p?p.line:0,w=p?p.column+1:0,y=t.name&&t.name.type==="JSXIdentifier"?t.name.name:u,_=`jsx:${u}:${y}:${b}:${w}`;t.attributes.push(i.jsxAttribute(i.jsxIdentifier("data-inspector-id"),i.stringLiteral(_)))}}}));let l="";try{let i=document.getElementById("__srcmap");if(i&&i.textContent){let s=JSON.parse(i.textContent),r=s==null?void 0:s.file;typeof r=="string"&&(l=r)}}catch{}document.querySelectorAll('script[type="text/babel"],script[type="text/jsx"]').forEach((i,s)=>{let r=i.getAttribute("data-plugins")||"";if(r.indexOf(e)<0&&i.setAttribute("data-plugins",r?`${r},${e}`:e),!i.hasAttribute("data-filename")){let t=l?`${l}#inline-${s}`:`inline-${s}`;i.setAttribute("data-filename",i.getAttribute("src")||t)}})})}f(S,"registerInspectorIdPlugin");var R="0.0.11-alpha.20260825130527",L="@lark-apaas/miaoda-coding-sdk";window.__CREATIVITY_RUNTIME__||(window.__CREATIVITY_RUNTIME__=!0,S(),I());return $(O);})();
@@ -1600,7 +1600,7 @@ var MiaodaRuntime = (() => {
1600
1600
  __name(mountDoubaoWatermark, "mountDoubaoWatermark");
1601
1601
 
1602
1602
  // src/doubao-runtime.ts
1603
- var version = "0.0.10";
1603
+ var version = "0.0.11-alpha.20260825130527";
1604
1604
  var name = "@lark-apaas/miaoda-coding-sdk";
1605
1605
  if (isOnlineEnv()) {
1606
1606
  reportPageView();
@@ -1600,7 +1600,7 @@ var MiaodaRuntime = (() => {
1600
1600
  __name(mountDoubaoWatermark, "mountDoubaoWatermark");
1601
1601
 
1602
1602
  // src/doubao-runtime.ts
1603
- var version = "0.0.10";
1603
+ var version = "0.0.11-alpha.20260825130527";
1604
1604
  var name = "@lark-apaas/miaoda-coding-sdk";
1605
1605
  if (isOnlineEnv()) {
1606
1606
  reportPageView();
@@ -1 +1 @@
1
- "use strict";var MiaodaRuntime=(()=>{var be=Object.create;var P=Object.defineProperty;var ye=Object.getOwnPropertyDescriptor;var _e=Object.getOwnPropertyNames;var we=Object.getPrototypeOf,xe=Object.prototype.hasOwnProperty;var i=(r,t)=>P(r,"name",{value:t,configurable:!0});var z=(r,t)=>()=>(t||r((t={exports:{}}).exports,t),t.exports),Ce=(r,t)=>{for(var d in t)P(r,d,{get:t[d],enumerable:!0})},J=(r,t,d,h)=>{if(t&&typeof t=="object"||typeof t=="function")for(let p of _e(t))!xe.call(r,p)&&p!==d&&P(r,p,{get:()=>t[p],enumerable:!(h=ye(t,p))||h.enumerable});return r};var q=(r,t,d)=>(d=r!=null?be(we(r)):{},J(t||!r||!r.__esModule?P(d,"default",{value:r,enumerable:!0}):d,r)),Se=r=>J(P({},"__esModule",{value:!0}),r);var X=z((G,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 h(e,f,n,b,w,S){return t(d(t(t(f,e),t(b,S)),w),n)}i(h,"md5cmn");function p(e,f,n,b,w,S,B){return h(f&n|~f&b,e,f,w,S,B)}i(p,"md5ff");function m(e,f,n,b,w,S,B){return h(f&b|n&~b,e,f,w,S,B)}i(m,"md5gg");function g(e,f,n,b,w,S,B){return h(f^n^b,e,f,w,S,B)}i(g,"md5hh");function y(e,f,n,b,w,S,B){return h(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=p(o,a,s,c,e[n],7,-680876936),c=p(c,o,a,s,e[n+1],12,-389564586),s=p(s,c,o,a,e[n+2],17,606105819),a=p(a,s,c,o,e[n+3],22,-1044525330),o=p(o,a,s,c,e[n+4],7,-176418897),c=p(c,o,a,s,e[n+5],12,1200080426),s=p(s,c,o,a,e[n+6],17,-1473231341),a=p(a,s,c,o,e[n+7],22,-45705983),o=p(o,a,s,c,e[n+8],7,1770035416),c=p(c,o,a,s,e[n+9],12,-1958414417),s=p(s,c,o,a,e[n+10],17,-42063),a=p(a,s,c,o,e[n+11],22,-1990404162),o=p(o,a,s,c,e[n+12],7,1804603682),c=p(c,o,a,s,e[n+13],12,-40341101),s=p(s,c,o,a,e[n+14],17,-1502002290),a=p(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 L(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(L,"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 L(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),L(k(S.concat(B),640))}i(E,"rstrHMACMD5");function T(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(T,"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 T(l(e))}i(u,"hexMD5");function _(e,f){return E(A(e),A(f))}i(_,"rawHMACMD5");function v(e,f){return T(_(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})(G)});var Q=z((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 h=Object.create||(function(){function l(){}return i(l,"F"),function(u){var _;return l.prototype=u,_=new l,l.prototype=null,_}})(),p={},m=p.lib={},g=m.Base=(function(){return{extend:i(function(l){var u=h(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||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 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=p.enc={},L=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}),T=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=p.algo={};return p})(Math);return r})});var te=z((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,h=d.WordArray,p=d.Hasher,m=t.algo,g=[],y=m.SHA1=p.extend({_doReset:i(function(){this._hash=new h.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)g[u]=k[L+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&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=p.clone.call(this);return k._hash=this._hash.clone(),k},"clone")});t.SHA1=p._createHelper(y),t.HmacSHA1=p._createHmacHelper(y)})(),r.SHA1})});var Ge={};Ce(Ge,{TrackKey:()=>U,name:()=>qe,reportTeaEvent:()=>V,version:()=>Je});var oe=q(X(),1),ae=q(te(),1);function O(){return window.appId||null}i(O,"getAppId");function ke(){var d;let r="suda-csrf-token",t=document.cookie.split("; ");for(let h of t){let[p,m]=h.split("=");if(p===r)return decodeURIComponent(m)}return(d=window.csrfToken)!=null?d:null}i(ke,"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 ne(){return window.appEnv!=null?window.appEnv==="runtime":!0}i(ne,"isOnlineEnv");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 re(){var h;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":(h=ke())!=null?h:""}})).json()}i(re,"getLarkUserInfo");var U={VIEW:"aily_agent_artifact_page_view"},Ee="08a441",Ie="42b91e";function ie(r){let t=String(r);return(0,ae.default)(Ee+(0,oe.default)(t+Ie)).toString()}i(ie,"encryptTea");var j=!1;async function Ae(){var m,g,y,k;let{data:r}=await re(),{tenantID:t,userID:d}=r||{},h=d&&d!=="0"?ie(d):void 0,p=t&&t!=="0"?ie(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:h,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:h,tenant_id:p}}),j=!0,(k=window.collectEvent)==null||k.call(window,"start")}i(Ae,"createTracker");async function V({trackKey:r,trackParams:t={}}){var d;try{j||(j=!0,await Ae()),(d=window.collectEvent)==null||d.call(window,r,t)}catch(h){console.error(h)}}i(V,"reportTeaEvent");function se(){return V({trackKey:U.VIEW,trackParams:{artifact_uid:O(),agent_id:"agent_miaoda",url:window.location.href}})}i(se,"reportPageView");function ce(){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(ce,"generateUUID");var le="x_sdk_device_id";function Be(){try{let r=localStorage.getItem(le);return r||(r=ce(),localStorage.setItem(le,r)),r}catch{return ce()}}i(Be,"getDeviceId");function Te(){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(Te,"getDeviceType");function Le(){return{app_id:window.appId||"",tenant_id:window.tenantId||"",user_id:window.userId||"",did:Be(),module:"app_web",app_env:"runtime",source_type:"user",device_type:Te(),release_commit_id:window.__RELEASE_COMMIT_ID__||""}}i(Le,"getDefaultAttributes");var Oe="1.0.0";function De(r){let t=Le(),d=String(BigInt(Date.now())*BigInt(1e6));return{metricsData:{resource:{attributes:{sdk_version:Oe,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(h=>({attributes:{...t,url:h.url,path:h.path,referrer:h.referrer},startTimeUnixNano:String(BigInt(h.timestampMs)*BigInt(1e6)),timeUnixNano:d,asDouble:1}))}}]}}}i(De,"buildPayload");function Pe(r,t,d={}){if(t.length===0)return;let h=JSON.stringify(De(t));try{fetch(r,{method:"POST",headers:{"Content-Type":"application/json","X-Suda-Csrf-Token":window.csrfToken||"",...d},body:h,keepalive:!0}).catch(()=>{})}catch{}}i(Pe,"sendPvData");var D,He=(D=class{constructor(){this.started=!1,this.buffer=[]}static get instance(){return this._instance||(this._instance=new D),this._instance}start(t){var d;if(this.started)return;this.config=t,this.started=!0,this.listenRouteChanges(),this.registerLifecycleListeners();let h=(d=t.flushIntervalMs)!=null?d:1e4;this.flushTimer=setInterval(()=>this.flush(),h)}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],h=i(()=>this.recordPv(),"recordPv");history[t]=function(...p){let m=d.apply(this,p);return h(),m}}registerLifecycleListeners(){document.addEventListener("visibilitychange",()=>{document.visibilityState==="hidden"&&this.flush()}),window.addEventListener("pagehide",()=>this.flush())}},i(D,"_PvTracker"),D),de=He.instance;function ue(){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`;de.start({collectorUrl:t})}i(ue,"initPvTracking");var Me="https://lf3-static.bytednsdoc.com/obj/eden-cn/LMfspH/ljhwZthlaukjlkulzlp/miaoda-ui",Re=`${Me}/doubao.svg`,Fe='<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>',Ne='<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,ze="\u8C46\u5305 AI \u751F\u6210",We="\u7531\u98DE\u4E66\u5999\u642D\u63D0\u4F9B\u652F\u6301",je="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)",Ue="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",Ve={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://${Ve[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=Fe;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=Re,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 me(r,t){let d=r==="desktop",h=document.createElement("div");Object.assign(h.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:je,cursor:"pointer"});let p=$e(d?16:18),m=document.createElement("span");if(m.textContent=ze,Object.assign(m.style,{fontFamily:K,fontSize:d?"12px":"14px",lineHeight:d?"18px":"22px",color:"rgba(255,255,255,0.85)",whiteSpace:"nowrap"}),h.append(p,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()}),h.appendChild(g)}return h}i(me,"buildPill");function $(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=Ne:d.appendChild(ge(16));let h=document.createElement("span");return h.textContent=r.label,Object.assign(h.style,{fontFamily:K,fontSize:`${r.fontSize}px`,lineHeight:`${r.fontSize+8}px`,color:"#000000",whiteSpace:"nowrap"}),t.append(d,h),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($,"buildMenuRow");function ve(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:Ue,overflow:"hidden",outline:"none"}),r.rows.length){let h=document.createElement("div");Object.assign(h.style,{boxSizing:"border-box",padding:"4px"}),r.rows.forEach(p=>h.appendChild(p)),t.appendChild(h)}let d=document.createElement("div");return d.textContent=We,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(ve,"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($({icon:"feedback",label:"\u6295\u8BC9\u4E0E\u4E3E\u62A5",fontSize:14,onClick:he}));let d=ve({rows:t,footerFontSize:12,minWidth:144});d.style.display="none";let h=me("desktop",()=>r.remove()),p=h.querySelector("[data-doubao-close]");r.append(d,h);let m=null;return r.addEventListener("mouseenter",()=>{m&&clearTimeout(m),d.style.display="flex",p&&(p.style.display="inline-flex")}),r.addEventListener("mouseleave",()=>{m=setTimeout(()=>{d.style.display="none",p&&(p.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",zIndex:"9999",display:"flex",flexDirection:"column",alignItems:"flex-end",gap:"8px",cursor:"pointer"});let t=[];pe&&t.push($({icon:"feedback",label:"\u6295\u8BC9\u4E0E\u4E3E\u62A5",fontSize:16,onClick:he})),t.push($({icon:"close",label:"\u4E0D\u518D\u5C55\u793A",fontSize:16,onClick:i(p=>{p.stopPropagation(),r.remove()},"onClick")}));let d=ve({rows:t,footerFontSize:14,minWidth:160});d.style.display="none";let h=me("mobile");return r.append(d,h),r.addEventListener("click",p=>{p.stopPropagation(),d.style.display=d.style.display==="none"?"flex":"none"}),document.addEventListener("click",()=>{d.style.display="none"}),r}i(Ze,"buildMobileWatermark");var fe=!1;function Z(){if(fe||typeof document=="undefined")return;if(document.readyState==="loading"){document.addEventListener("DOMContentLoaded",Z,{once:!0});return}fe=!0;let r=N()?Ze():Ke();document.body.appendChild(r)}i(Z,"mountDoubaoWatermark");var Je="0.0.10",qe="@lark-apaas/miaoda-coding-sdk";ne()&&(se(),ue());Z();return Se(Ge);})();
1
+ "use strict";var MiaodaRuntime=(()=>{var be=Object.create;var P=Object.defineProperty;var ye=Object.getOwnPropertyDescriptor;var _e=Object.getOwnPropertyNames;var we=Object.getPrototypeOf,xe=Object.prototype.hasOwnProperty;var i=(r,t)=>P(r,"name",{value:t,configurable:!0});var z=(r,t)=>()=>(t||r((t={exports:{}}).exports,t),t.exports),Ce=(r,t)=>{for(var d in t)P(r,d,{get:t[d],enumerable:!0})},J=(r,t,d,h)=>{if(t&&typeof t=="object"||typeof t=="function")for(let p of _e(t))!xe.call(r,p)&&p!==d&&P(r,p,{get:()=>t[p],enumerable:!(h=ye(t,p))||h.enumerable});return r};var q=(r,t,d)=>(d=r!=null?be(we(r)):{},J(t||!r||!r.__esModule?P(d,"default",{value:r,enumerable:!0}):d,r)),Se=r=>J(P({},"__esModule",{value:!0}),r);var X=z((G,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 h(e,f,n,b,w,S){return t(d(t(t(f,e),t(b,S)),w),n)}i(h,"md5cmn");function p(e,f,n,b,w,S,B){return h(f&n|~f&b,e,f,w,S,B)}i(p,"md5ff");function m(e,f,n,b,w,S,B){return h(f&b|n&~b,e,f,w,S,B)}i(m,"md5gg");function g(e,f,n,b,w,S,B){return h(f^n^b,e,f,w,S,B)}i(g,"md5hh");function y(e,f,n,b,w,S,B){return h(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=p(o,a,s,c,e[n],7,-680876936),c=p(c,o,a,s,e[n+1],12,-389564586),s=p(s,c,o,a,e[n+2],17,606105819),a=p(a,s,c,o,e[n+3],22,-1044525330),o=p(o,a,s,c,e[n+4],7,-176418897),c=p(c,o,a,s,e[n+5],12,1200080426),s=p(s,c,o,a,e[n+6],17,-1473231341),a=p(a,s,c,o,e[n+7],22,-45705983),o=p(o,a,s,c,e[n+8],7,1770035416),c=p(c,o,a,s,e[n+9],12,-1958414417),s=p(s,c,o,a,e[n+10],17,-42063),a=p(a,s,c,o,e[n+11],22,-1990404162),o=p(o,a,s,c,e[n+12],7,1804603682),c=p(c,o,a,s,e[n+13],12,-40341101),s=p(s,c,o,a,e[n+14],17,-1502002290),a=p(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 L(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(L,"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 L(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),L(k(S.concat(B),640))}i(E,"rstrHMACMD5");function T(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(T,"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 T(l(e))}i(u,"hexMD5");function _(e,f){return E(A(e),A(f))}i(_,"rawHMACMD5");function v(e,f){return T(_(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})(G)});var Q=z((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 h=Object.create||(function(){function l(){}return i(l,"F"),function(u){var _;return l.prototype=u,_=new l,l.prototype=null,_}})(),p={},m=p.lib={},g=m.Base=(function(){return{extend:i(function(l){var u=h(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||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 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=p.enc={},L=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}),T=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=p.algo={};return p})(Math);return r})});var te=z((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,h=d.WordArray,p=d.Hasher,m=t.algo,g=[],y=m.SHA1=p.extend({_doReset:i(function(){this._hash=new h.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)g[u]=k[L+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&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=p.clone.call(this);return k._hash=this._hash.clone(),k},"clone")});t.SHA1=p._createHelper(y),t.HmacSHA1=p._createHmacHelper(y)})(),r.SHA1})});var Ge={};Ce(Ge,{TrackKey:()=>U,name:()=>qe,reportTeaEvent:()=>V,version:()=>Je});var oe=q(X(),1),ae=q(te(),1);function O(){return window.appId||null}i(O,"getAppId");function ke(){var d;let r="suda-csrf-token",t=document.cookie.split("; ");for(let h of t){let[p,m]=h.split("=");if(p===r)return decodeURIComponent(m)}return(d=window.csrfToken)!=null?d:null}i(ke,"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 ne(){return window.appEnv!=null?window.appEnv==="runtime":!0}i(ne,"isOnlineEnv");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 re(){var h;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":(h=ke())!=null?h:""}})).json()}i(re,"getLarkUserInfo");var U={VIEW:"aily_agent_artifact_page_view"},Ee="08a441",Ie="42b91e";function ie(r){let t=String(r);return(0,ae.default)(Ee+(0,oe.default)(t+Ie)).toString()}i(ie,"encryptTea");var j=!1;async function Ae(){var m,g,y,k;let{data:r}=await re(),{tenantID:t,userID:d}=r||{},h=d&&d!=="0"?ie(d):void 0,p=t&&t!=="0"?ie(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:h,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:h,tenant_id:p}}),j=!0,(k=window.collectEvent)==null||k.call(window,"start")}i(Ae,"createTracker");async function V({trackKey:r,trackParams:t={}}){var d;try{j||(j=!0,await Ae()),(d=window.collectEvent)==null||d.call(window,r,t)}catch(h){console.error(h)}}i(V,"reportTeaEvent");function se(){return V({trackKey:U.VIEW,trackParams:{artifact_uid:O(),agent_id:"agent_miaoda",url:window.location.href}})}i(se,"reportPageView");function ce(){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(ce,"generateUUID");var le="x_sdk_device_id";function Be(){try{let r=localStorage.getItem(le);return r||(r=ce(),localStorage.setItem(le,r)),r}catch{return ce()}}i(Be,"getDeviceId");function Te(){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(Te,"getDeviceType");function Le(){return{app_id:window.appId||"",tenant_id:window.tenantId||"",user_id:window.userId||"",did:Be(),module:"app_web",app_env:"runtime",source_type:"user",device_type:Te(),release_commit_id:window.__RELEASE_COMMIT_ID__||""}}i(Le,"getDefaultAttributes");var Oe="1.0.0";function De(r){let t=Le(),d=String(BigInt(Date.now())*BigInt(1e6));return{metricsData:{resource:{attributes:{sdk_version:Oe,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(h=>({attributes:{...t,url:h.url,path:h.path,referrer:h.referrer},startTimeUnixNano:String(BigInt(h.timestampMs)*BigInt(1e6)),timeUnixNano:d,asDouble:1}))}}]}}}i(De,"buildPayload");function Pe(r,t,d={}){if(t.length===0)return;let h=JSON.stringify(De(t));try{fetch(r,{method:"POST",headers:{"Content-Type":"application/json","X-Suda-Csrf-Token":window.csrfToken||"",...d},body:h,keepalive:!0}).catch(()=>{})}catch{}}i(Pe,"sendPvData");var D,He=(D=class{constructor(){this.started=!1,this.buffer=[]}static get instance(){return this._instance||(this._instance=new D),this._instance}start(t){var d;if(this.started)return;this.config=t,this.started=!0,this.listenRouteChanges(),this.registerLifecycleListeners();let h=(d=t.flushIntervalMs)!=null?d:1e4;this.flushTimer=setInterval(()=>this.flush(),h)}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],h=i(()=>this.recordPv(),"recordPv");history[t]=function(...p){let m=d.apply(this,p);return h(),m}}registerLifecycleListeners(){document.addEventListener("visibilitychange",()=>{document.visibilityState==="hidden"&&this.flush()}),window.addEventListener("pagehide",()=>this.flush())}},i(D,"_PvTracker"),D),de=He.instance;function ue(){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`;de.start({collectorUrl:t})}i(ue,"initPvTracking");var Me="https://lf3-static.bytednsdoc.com/obj/eden-cn/LMfspH/ljhwZthlaukjlkulzlp/miaoda-ui",Re=`${Me}/doubao.svg`,Fe='<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>',Ne='<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,ze="\u8C46\u5305 AI \u751F\u6210",We="\u7531\u98DE\u4E66\u5999\u642D\u63D0\u4F9B\u652F\u6301",je="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)",Ue="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",Ve={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://${Ve[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=Fe;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=Re,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 me(r,t){let d=r==="desktop",h=document.createElement("div");Object.assign(h.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:je,cursor:"pointer"});let p=$e(d?16:18),m=document.createElement("span");if(m.textContent=ze,Object.assign(m.style,{fontFamily:K,fontSize:d?"12px":"14px",lineHeight:d?"18px":"22px",color:"rgba(255,255,255,0.85)",whiteSpace:"nowrap"}),h.append(p,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()}),h.appendChild(g)}return h}i(me,"buildPill");function $(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=Ne:d.appendChild(ge(16));let h=document.createElement("span");return h.textContent=r.label,Object.assign(h.style,{fontFamily:K,fontSize:`${r.fontSize}px`,lineHeight:`${r.fontSize+8}px`,color:"#000000",whiteSpace:"nowrap"}),t.append(d,h),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($,"buildMenuRow");function ve(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:Ue,overflow:"hidden",outline:"none"}),r.rows.length){let h=document.createElement("div");Object.assign(h.style,{boxSizing:"border-box",padding:"4px"}),r.rows.forEach(p=>h.appendChild(p)),t.appendChild(h)}let d=document.createElement("div");return d.textContent=We,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(ve,"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($({icon:"feedback",label:"\u6295\u8BC9\u4E0E\u4E3E\u62A5",fontSize:14,onClick:he}));let d=ve({rows:t,footerFontSize:12,minWidth:144});d.style.display="none";let h=me("desktop",()=>r.remove()),p=h.querySelector("[data-doubao-close]");r.append(d,h);let m=null;return r.addEventListener("mouseenter",()=>{m&&clearTimeout(m),d.style.display="flex",p&&(p.style.display="inline-flex")}),r.addEventListener("mouseleave",()=>{m=setTimeout(()=>{d.style.display="none",p&&(p.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",zIndex:"9999",display:"flex",flexDirection:"column",alignItems:"flex-end",gap:"8px",cursor:"pointer"});let t=[];pe&&t.push($({icon:"feedback",label:"\u6295\u8BC9\u4E0E\u4E3E\u62A5",fontSize:16,onClick:he})),t.push($({icon:"close",label:"\u4E0D\u518D\u5C55\u793A",fontSize:16,onClick:i(p=>{p.stopPropagation(),r.remove()},"onClick")}));let d=ve({rows:t,footerFontSize:14,minWidth:160});d.style.display="none";let h=me("mobile");return r.append(d,h),r.addEventListener("click",p=>{p.stopPropagation(),d.style.display=d.style.display==="none"?"flex":"none"}),document.addEventListener("click",()=>{d.style.display="none"}),r}i(Ze,"buildMobileWatermark");var fe=!1;function Z(){if(fe||typeof document=="undefined")return;if(document.readyState==="loading"){document.addEventListener("DOMContentLoaded",Z,{once:!0});return}fe=!0;let r=N()?Ze():Ke();document.body.appendChild(r)}i(Z,"mountDoubaoWatermark");var Je="0.0.11-alpha.20260825130527",qe="@lark-apaas/miaoda-coding-sdk";ne()&&(se(),ue());Z();return Se(Ge);})();
@@ -965,7 +965,7 @@ var MiaodaRuntime = (() => {
965
965
  }
966
966
  __name(getAppId, "getAppId");
967
967
  function getCsrfToken() {
968
- var _a;
968
+ var _a2;
969
969
  const cookieName = "suda-csrf-token";
970
970
  const cookies = document.cookie.split("; ");
971
971
  for (const cookie of cookies) {
@@ -974,7 +974,7 @@ var MiaodaRuntime = (() => {
974
974
  return decodeURIComponent(value);
975
975
  }
976
976
  }
977
- return (_a = window.csrfToken) != null ? _a : null;
977
+ return (_a2 = window.csrfToken) != null ? _a2 : null;
978
978
  }
979
979
  __name(getCsrfToken, "getCsrfToken");
980
980
  function isNewPathEnabled() {
@@ -994,6 +994,10 @@ var MiaodaRuntime = (() => {
994
994
  }
995
995
  }
996
996
  __name(getEnv, "getEnv");
997
+ function isOnlineEnv() {
998
+ return window.appEnv != null ? window.appEnv === "runtime" : false;
999
+ }
1000
+ __name(isOnlineEnv, "isOnlineEnv");
997
1001
  function isMobile() {
998
1002
  const ua = navigator.userAgent;
999
1003
  const isPhone = /(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i.test(ua);
@@ -1002,7 +1006,7 @@ var MiaodaRuntime = (() => {
1002
1006
  }
1003
1007
  __name(isMobile, "isMobile");
1004
1008
  async function getLarkUserInfo() {
1005
- var _a;
1009
+ var _a2;
1006
1010
  const appId = getAppId();
1007
1011
  if (!appId) {
1008
1012
  return {
@@ -1014,7 +1018,7 @@ var MiaodaRuntime = (() => {
1014
1018
  const url = isNewPathEnabled() ? `/app/${appId}/__runtime__/api/v1/studio/lark/user_info` : `/spark/b/${appId}/lark/user_info`;
1015
1019
  const response = await fetch(url, {
1016
1020
  headers: {
1017
- "X-Suda-Csrf-Token": (_a = getCsrfToken()) != null ? _a : ""
1021
+ "X-Suda-Csrf-Token": (_a2 = getCsrfToken()) != null ? _a2 : ""
1018
1022
  }
1019
1023
  });
1020
1024
  return await response.json();
@@ -1035,12 +1039,12 @@ var MiaodaRuntime = (() => {
1035
1039
  __name(encryptTea, "encryptTea");
1036
1040
  var teaInstance = false;
1037
1041
  async function createTracker() {
1038
- var _a, _b, _c, _d;
1042
+ var _a2, _b, _c, _d;
1039
1043
  const { data } = await getLarkUserInfo();
1040
1044
  const { tenantID, userID } = data || {};
1041
1045
  const userIDEncrypt = userID && userID !== "0" ? encryptTea(userID) : void 0;
1042
1046
  const tenantIDEncrypt = tenantID && tenantID !== "0" ? encryptTea(tenantID) : void 0;
1043
- (_a = window.collectEvent) == null ? void 0 : _a.call(window, "init", {
1047
+ (_a2 = window.collectEvent) == null ? void 0 : _a2.call(window, "init", {
1044
1048
  app_id: 788827,
1045
1049
  channel: "cn",
1046
1050
  disable_auto_pv: false,
@@ -1064,25 +1068,544 @@ var MiaodaRuntime = (() => {
1064
1068
  }
1065
1069
  __name(createTracker, "createTracker");
1066
1070
  async function reportTeaEvent({ trackKey, trackParams = {} }) {
1067
- var _a;
1071
+ var _a2;
1068
1072
  try {
1069
1073
  if (!teaInstance) {
1070
1074
  teaInstance = true;
1071
1075
  await createTracker();
1072
1076
  }
1073
- (_a = window.collectEvent) == null ? void 0 : _a.call(window, trackKey, trackParams);
1077
+ (_a2 = window.collectEvent) == null ? void 0 : _a2.call(window, trackKey, trackParams);
1074
1078
  } catch (err) {
1075
1079
  console.error(err);
1076
1080
  }
1077
1081
  }
1078
1082
  __name(reportTeaEvent, "reportTeaEvent");
1083
+ function reportPageView() {
1084
+ return reportTeaEvent({
1085
+ trackKey: TrackKey.VIEW,
1086
+ trackParams: {
1087
+ artifact_uid: getAppId(),
1088
+ agent_id: "agent_miaoda",
1089
+ url: window.location.href
1090
+ }
1091
+ });
1092
+ }
1093
+ __name(reportPageView, "reportPageView");
1094
+
1095
+ // ../observable-web-lite/dist/index.mjs
1096
+ function generateUUID() {
1097
+ if (typeof crypto !== "undefined" && crypto.getRandomValues) {
1098
+ const bytes = new Uint8Array(8);
1099
+ crypto.getRandomValues(bytes);
1100
+ return Array.from(bytes).map((b) => b.toString(16).padStart(2, "0")).join("");
1101
+ }
1102
+ let result = "";
1103
+ for (let i = 0; i < 16; i++) {
1104
+ result += Math.floor(Math.random() * 16).toString(16);
1105
+ }
1106
+ return result;
1107
+ }
1108
+ __name(generateUUID, "generateUUID");
1109
+ var STORAGE_KEY = "x_sdk_device_id";
1110
+ function getDeviceId() {
1111
+ try {
1112
+ let id = localStorage.getItem(STORAGE_KEY);
1113
+ if (!id) {
1114
+ id = generateUUID();
1115
+ localStorage.setItem(STORAGE_KEY, id);
1116
+ }
1117
+ return id;
1118
+ } catch {
1119
+ return generateUUID();
1120
+ }
1121
+ }
1122
+ __name(getDeviceId, "getDeviceId");
1123
+ function getDeviceType() {
1124
+ const ua = typeof navigator !== "undefined" ? navigator.userAgent : "";
1125
+ if (!ua) return "desktop";
1126
+ if (/Android/i.test(ua) && /Mobile/i.test(ua) || /iPhone|iPod/i.test(ua) || /BlackBerry|IEMobile|Opera Mini/i.test(ua)) {
1127
+ return "mobile";
1128
+ }
1129
+ return "desktop";
1130
+ }
1131
+ __name(getDeviceType, "getDeviceType");
1132
+ function getDefaultAttributes() {
1133
+ return {
1134
+ app_id: window.appId || "",
1135
+ tenant_id: window.tenantId || "",
1136
+ user_id: window.userId || "",
1137
+ did: getDeviceId(),
1138
+ module: "app_web",
1139
+ app_env: "runtime",
1140
+ source_type: "user",
1141
+ device_type: getDeviceType(),
1142
+ release_commit_id: window.__RELEASE_COMMIT_ID__ || ""
1143
+ };
1144
+ }
1145
+ __name(getDefaultAttributes, "getDefaultAttributes");
1146
+ var SDK_VERSION = "1.0.0";
1147
+ function buildPayload(dataPoints) {
1148
+ const defaultAttrs = getDefaultAttributes();
1149
+ const nowNs = String(BigInt(Date.now()) * BigInt(1e6));
1150
+ return {
1151
+ metricsData: {
1152
+ resource: {
1153
+ attributes: {
1154
+ sdk_version: SDK_VERSION,
1155
+ sdk_lang: "javascript",
1156
+ sdk_type: "client-frontend"
1157
+ }
1158
+ },
1159
+ metrics: [
1160
+ {
1161
+ name: "apaas_internal_metrics_pv_uv",
1162
+ description: "Count of page views",
1163
+ unit: "",
1164
+ scopeName: "apaas_internal_metrics_pv_uv",
1165
+ sum: {
1166
+ aggregationTemporality: 1,
1167
+ // DELTA
1168
+ isMonotonic: true,
1169
+ dataPoints: dataPoints.map((dp) => ({
1170
+ attributes: {
1171
+ ...defaultAttrs,
1172
+ url: dp.url,
1173
+ path: dp.path,
1174
+ referrer: dp.referrer
1175
+ },
1176
+ startTimeUnixNano: String(BigInt(dp.timestampMs) * BigInt(1e6)),
1177
+ timeUnixNano: nowNs,
1178
+ asDouble: 1
1179
+ }))
1180
+ }
1181
+ }
1182
+ ]
1183
+ }
1184
+ };
1185
+ }
1186
+ __name(buildPayload, "buildPayload");
1187
+ function sendPvData(collectorUrl, dataPoints, headers = {}) {
1188
+ if (dataPoints.length === 0) return;
1189
+ const body = JSON.stringify(buildPayload(dataPoints));
1190
+ try {
1191
+ fetch(collectorUrl, {
1192
+ method: "POST",
1193
+ headers: {
1194
+ "Content-Type": "application/json",
1195
+ "X-Suda-Csrf-Token": window.csrfToken || "",
1196
+ ...headers
1197
+ },
1198
+ body,
1199
+ keepalive: true
1200
+ }).catch(() => {
1201
+ });
1202
+ } catch {
1203
+ }
1204
+ }
1205
+ __name(sendPvData, "sendPvData");
1206
+ var _a;
1207
+ var PvTracker = (_a = class {
1208
+ constructor() {
1209
+ this.started = false;
1210
+ this.buffer = [];
1211
+ }
1212
+ static get instance() {
1213
+ if (!this._instance) {
1214
+ this._instance = new _a();
1215
+ }
1216
+ return this._instance;
1217
+ }
1218
+ start(config) {
1219
+ var _a2;
1220
+ if (this.started) return;
1221
+ this.config = config;
1222
+ this.started = true;
1223
+ this.listenRouteChanges();
1224
+ this.registerLifecycleListeners();
1225
+ const interval = (_a2 = config.flushIntervalMs) != null ? _a2 : 1e4;
1226
+ this.flushTimer = setInterval(() => this.flush(), interval);
1227
+ }
1228
+ shutdown() {
1229
+ this.flush();
1230
+ if (this.flushTimer) {
1231
+ clearInterval(this.flushTimer);
1232
+ this.flushTimer = void 0;
1233
+ }
1234
+ this.started = false;
1235
+ }
1236
+ recordPv() {
1237
+ const currentUrl = window.location.href;
1238
+ if (this.lastUrl === currentUrl) return;
1239
+ this.lastUrl = currentUrl;
1240
+ this.buffer.push({
1241
+ url: currentUrl,
1242
+ path: window.location.pathname,
1243
+ referrer: document.referrer,
1244
+ timestampMs: Date.now()
1245
+ });
1246
+ }
1247
+ flush() {
1248
+ if (!this.config || this.buffer.length === 0) return;
1249
+ const batch = this.buffer.splice(0);
1250
+ sendPvData(this.config.collectorUrl, batch, this.config.headers);
1251
+ }
1252
+ listenRouteChanges() {
1253
+ if (document.readyState === "complete") {
1254
+ this.recordPv();
1255
+ } else {
1256
+ window.addEventListener("load", () => this.recordPv());
1257
+ }
1258
+ window.addEventListener("popstate", () => this.recordPv());
1259
+ this.patchHistory("pushState");
1260
+ this.patchHistory("replaceState");
1261
+ }
1262
+ patchHistory(method) {
1263
+ const original = history[method];
1264
+ const recordPv = /* @__PURE__ */ __name(() => this.recordPv(), "recordPv");
1265
+ history[method] = function(...args) {
1266
+ const result = original.apply(this, args);
1267
+ recordPv();
1268
+ return result;
1269
+ };
1270
+ }
1271
+ registerLifecycleListeners() {
1272
+ document.addEventListener("visibilitychange", () => {
1273
+ if (document.visibilityState === "hidden") {
1274
+ this.flush();
1275
+ }
1276
+ });
1277
+ window.addEventListener("pagehide", () => this.flush());
1278
+ }
1279
+ }, __name(_a, "_PvTracker"), _a);
1280
+ var pvTracker = PvTracker.instance;
1281
+
1282
+ // src/runtime/pv.ts
1283
+ function initPvTracking() {
1284
+ var _a2;
1285
+ const appId = (_a2 = getAppId()) != null ? _a2 : "";
1286
+ const collectorUrl = isNewPathEnabled() ? `/app/${appId}/__runtime__/api/v1/observability/metrics/collect` : `/spark/app/${appId}/runtime/api/v1/observability/metrics/collect`;
1287
+ pvTracker.start({
1288
+ collectorUrl
1289
+ });
1290
+ }
1291
+ __name(initPvTracking, "initPvTracking");
1292
+
1293
+ // src/runtime/watermark.ts
1294
+ var CDN = "https://lf3-static.bytednsdoc.com/obj/eden-cn/LMfspH/ljhwZthlaukjlkulzlp/miaoda-ui";
1295
+ var DOUBAO_AVATAR_SRC = `${CDN}/doubao.svg`;
1296
+ var CLOSE_ICON_SVG = '<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>';
1297
+ var FEEDBACK_ICON_SVG = '<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>';
1298
+ var REPORT_ENABLED = true;
1299
+ var BRAND_TEXT = "\u8C46\u5305 AI \u751F\u6210";
1300
+ var POWERED_BY_TEXT = "\u7531\u98DE\u4E66\u5999\u642D\u63D0\u4F9B\u652F\u6301";
1301
+ 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)";
1302
+ 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)";
1303
+ var FONT_FAMILY = "'PingFang SC', -apple-system, BlinkMacSystemFont, sans-serif";
1304
+ var REPORT_DOMAIN = {
1305
+ BOE: "tns.feishu-boe.cn",
1306
+ PRE: "tns.feishu-pre.cn",
1307
+ ONLINE: "tns.feishu.cn"
1308
+ };
1309
+ function openDoubaoReport() {
1310
+ var _a2;
1311
+ const params = JSON.stringify({
1312
+ scene: "miaoda_app_report",
1313
+ entity_id: (_a2 = getAppId()) != null ? _a2 : "",
1314
+ entity_type: "miaoda_app",
1315
+ extra: ""
1316
+ });
1317
+ const url = `https://${REPORT_DOMAIN[getEnv()]}/cust/lark_report/?type=common&params=${encodeURIComponent(params)}&lang=zh-CN`;
1318
+ window.open(url, "_blank", "noopener,noreferrer");
1319
+ }
1320
+ __name(openDoubaoReport, "openDoubaoReport");
1321
+ function makeCloseIcon(size) {
1322
+ const span = document.createElement("span");
1323
+ Object.assign(span.style, {
1324
+ display: "inline-flex",
1325
+ width: `${size}px`,
1326
+ height: `${size}px`,
1327
+ flexShrink: "0"
1328
+ });
1329
+ span.innerHTML = CLOSE_ICON_SVG;
1330
+ const svg = span.firstElementChild;
1331
+ if (svg) {
1332
+ svg.setAttribute("width", String(size));
1333
+ svg.setAttribute("height", String(size));
1334
+ svg.style.display = "block";
1335
+ }
1336
+ return span;
1337
+ }
1338
+ __name(makeCloseIcon, "makeCloseIcon");
1339
+ function makeAvatar(size) {
1340
+ const img = document.createElement("img");
1341
+ img.src = DOUBAO_AVATAR_SRC;
1342
+ img.width = size;
1343
+ img.height = size;
1344
+ img.alt = "";
1345
+ Object.assign(img.style, {
1346
+ width: `${size}px`,
1347
+ height: `${size}px`,
1348
+ maxWidth: "none",
1349
+ maxHeight: "none",
1350
+ borderRadius: "100px",
1351
+ flexShrink: "0",
1352
+ display: "block"
1353
+ });
1354
+ return img;
1355
+ }
1356
+ __name(makeAvatar, "makeAvatar");
1357
+ function buildPill(variant, onClose) {
1358
+ const isDesktop = variant === "desktop";
1359
+ const pill = document.createElement("div");
1360
+ Object.assign(pill.style, {
1361
+ boxSizing: "border-box",
1362
+ display: "inline-flex",
1363
+ alignItems: "center",
1364
+ gap: isDesktop ? "4px" : "6px",
1365
+ padding: isDesktop ? "6px 12px 6px 8px" : "4px 12px 4px 8px",
1366
+ background: "#363636",
1367
+ border: "0.5px solid rgba(255,255,255,0.1)",
1368
+ borderRadius: "100px",
1369
+ boxShadow: PILL_SHADOW,
1370
+ cursor: "pointer"
1371
+ });
1372
+ const avatar = makeAvatar(isDesktop ? 16 : 18);
1373
+ const text = document.createElement("span");
1374
+ text.textContent = BRAND_TEXT;
1375
+ Object.assign(text.style, {
1376
+ fontFamily: FONT_FAMILY,
1377
+ fontSize: isDesktop ? "12px" : "14px",
1378
+ lineHeight: isDesktop ? "18px" : "22px",
1379
+ color: "rgba(255,255,255,0.85)",
1380
+ whiteSpace: "nowrap"
1381
+ });
1382
+ pill.append(avatar, text);
1383
+ if (isDesktop && onClose) {
1384
+ const close = document.createElement("span");
1385
+ close.setAttribute("role", "button");
1386
+ close.setAttribute("aria-label", "\u5173\u95ED");
1387
+ close.setAttribute("data-doubao-close", "");
1388
+ Object.assign(close.style, {
1389
+ display: "none",
1390
+ alignItems: "center",
1391
+ cursor: "pointer",
1392
+ flexShrink: "0",
1393
+ color: "rgba(255,255,255,0.5)"
1394
+ });
1395
+ close.appendChild(makeCloseIcon(10));
1396
+ close.addEventListener("click", (e) => {
1397
+ e.stopPropagation();
1398
+ onClose();
1399
+ });
1400
+ pill.appendChild(close);
1401
+ }
1402
+ return pill;
1403
+ }
1404
+ __name(buildPill, "buildPill");
1405
+ function buildMenuRow(opts) {
1406
+ const row = document.createElement("div");
1407
+ row.setAttribute("role", "menuitem");
1408
+ row.setAttribute("data-label", opts.label);
1409
+ Object.assign(row.style, {
1410
+ boxSizing: "border-box",
1411
+ display: "flex",
1412
+ alignItems: "center",
1413
+ gap: "8px",
1414
+ padding: "4px 10px",
1415
+ borderRadius: "6px",
1416
+ cursor: "pointer",
1417
+ color: "#000000"
1418
+ });
1419
+ const icon = document.createElement("span");
1420
+ Object.assign(icon.style, {
1421
+ display: "inline-flex",
1422
+ width: "16px",
1423
+ height: "16px",
1424
+ flexShrink: "0",
1425
+ color: "#000000"
1426
+ });
1427
+ if (opts.icon === "feedback") {
1428
+ icon.innerHTML = FEEDBACK_ICON_SVG;
1429
+ } else {
1430
+ icon.appendChild(makeCloseIcon(16));
1431
+ }
1432
+ const label = document.createElement("span");
1433
+ label.textContent = opts.label;
1434
+ Object.assign(label.style, {
1435
+ fontFamily: FONT_FAMILY,
1436
+ fontSize: `${opts.fontSize}px`,
1437
+ lineHeight: `${opts.fontSize + 8}px`,
1438
+ color: "#000000",
1439
+ whiteSpace: "nowrap"
1440
+ });
1441
+ row.append(icon, label);
1442
+ row.addEventListener("mouseenter", () => {
1443
+ row.style.background = "rgba(0,0,0,0.04)";
1444
+ });
1445
+ row.addEventListener("mouseleave", () => {
1446
+ row.style.background = "transparent";
1447
+ });
1448
+ row.addEventListener("click", opts.onClick);
1449
+ return row;
1450
+ }
1451
+ __name(buildMenuRow, "buildMenuRow");
1452
+ function buildMenuCard(opts) {
1453
+ const card = document.createElement("div");
1454
+ Object.assign(card.style, {
1455
+ boxSizing: "border-box",
1456
+ display: "flex",
1457
+ flexDirection: "column",
1458
+ minWidth: `${opts.minWidth}px`,
1459
+ background: "#ffffff",
1460
+ border: "0.5px solid rgba(0,0,0,0.1)",
1461
+ borderRadius: "10px",
1462
+ boxShadow: CARD_SHADOW,
1463
+ overflow: "hidden",
1464
+ outline: "none"
1465
+ });
1466
+ if (opts.rows.length) {
1467
+ const items = document.createElement("div");
1468
+ Object.assign(items.style, {
1469
+ boxSizing: "border-box",
1470
+ padding: "4px"
1471
+ });
1472
+ opts.rows.forEach((r) => items.appendChild(r));
1473
+ card.appendChild(items);
1474
+ }
1475
+ const footer = document.createElement("div");
1476
+ footer.textContent = POWERED_BY_TEXT;
1477
+ Object.assign(footer.style, {
1478
+ boxSizing: "border-box",
1479
+ background: "#f9f9f9",
1480
+ padding: "8px 14px",
1481
+ fontFamily: FONT_FAMILY,
1482
+ fontSize: `${opts.footerFontSize}px`,
1483
+ lineHeight: `${opts.footerFontSize + 8}px`,
1484
+ color: "rgba(0,0,0,0.35)",
1485
+ whiteSpace: "nowrap"
1486
+ });
1487
+ card.appendChild(footer);
1488
+ return card;
1489
+ }
1490
+ __name(buildMenuCard, "buildMenuCard");
1491
+ function buildDesktopWatermark() {
1492
+ const container = document.createElement("div");
1493
+ container.setAttribute("data-custom-element", "doubao-watermark");
1494
+ Object.assign(container.style, {
1495
+ position: "fixed",
1496
+ right: "12px",
1497
+ bottom: "12px",
1498
+ zIndex: "9999",
1499
+ display: "flex",
1500
+ flexDirection: "column",
1501
+ alignItems: "flex-end",
1502
+ gap: "8px"
1503
+ });
1504
+ const rows = [];
1505
+ if (REPORT_ENABLED) {
1506
+ rows.push(buildMenuRow({
1507
+ icon: "feedback",
1508
+ label: "\u6295\u8BC9\u4E0E\u4E3E\u62A5",
1509
+ fontSize: 14,
1510
+ onClick: openDoubaoReport
1511
+ }));
1512
+ }
1513
+ const menu = buildMenuCard({
1514
+ rows,
1515
+ footerFontSize: 12,
1516
+ minWidth: 144
1517
+ });
1518
+ menu.style.display = "none";
1519
+ const pill = buildPill("desktop", () => container.remove());
1520
+ const close = pill.querySelector("[data-doubao-close]");
1521
+ container.append(menu, pill);
1522
+ let timer = null;
1523
+ container.addEventListener("mouseenter", () => {
1524
+ if (timer) clearTimeout(timer);
1525
+ menu.style.display = "flex";
1526
+ if (close) close.style.display = "inline-flex";
1527
+ });
1528
+ container.addEventListener("mouseleave", () => {
1529
+ timer = setTimeout(() => {
1530
+ menu.style.display = "none";
1531
+ if (close) close.style.display = "none";
1532
+ }, 100);
1533
+ });
1534
+ return container;
1535
+ }
1536
+ __name(buildDesktopWatermark, "buildDesktopWatermark");
1537
+ function buildMobileWatermark() {
1538
+ const wrapper = document.createElement("div");
1539
+ wrapper.setAttribute("data-custom-element", "doubao-watermark-mobile");
1540
+ Object.assign(wrapper.style, {
1541
+ position: "fixed",
1542
+ right: "12px",
1543
+ bottom: "12px",
1544
+ zIndex: "9999",
1545
+ display: "flex",
1546
+ flexDirection: "column",
1547
+ alignItems: "flex-end",
1548
+ gap: "8px",
1549
+ cursor: "pointer"
1550
+ });
1551
+ const rows = [];
1552
+ if (REPORT_ENABLED) {
1553
+ rows.push(buildMenuRow({
1554
+ icon: "feedback",
1555
+ label: "\u6295\u8BC9\u4E0E\u4E3E\u62A5",
1556
+ fontSize: 16,
1557
+ onClick: openDoubaoReport
1558
+ }));
1559
+ }
1560
+ rows.push(buildMenuRow({
1561
+ icon: "close",
1562
+ label: "\u4E0D\u518D\u5C55\u793A",
1563
+ fontSize: 16,
1564
+ onClick: /* @__PURE__ */ __name((e) => {
1565
+ e.stopPropagation();
1566
+ wrapper.remove();
1567
+ }, "onClick")
1568
+ }));
1569
+ const menu = buildMenuCard({
1570
+ rows,
1571
+ footerFontSize: 14,
1572
+ minWidth: 160
1573
+ });
1574
+ menu.style.display = "none";
1575
+ const pill = buildPill("mobile");
1576
+ wrapper.append(menu, pill);
1577
+ wrapper.addEventListener("click", (e) => {
1578
+ e.stopPropagation();
1579
+ menu.style.display = menu.style.display === "none" ? "flex" : "none";
1580
+ });
1581
+ document.addEventListener("click", () => {
1582
+ menu.style.display = "none";
1583
+ });
1584
+ return wrapper;
1585
+ }
1586
+ __name(buildMobileWatermark, "buildMobileWatermark");
1587
+ var mounted = false;
1588
+ function mountDoubaoWatermark() {
1589
+ if (mounted || typeof document === "undefined") return;
1590
+ if (document.readyState === "loading") {
1591
+ document.addEventListener("DOMContentLoaded", mountDoubaoWatermark, {
1592
+ once: true
1593
+ });
1594
+ return;
1595
+ }
1596
+ mounted = true;
1597
+ const el = isMobile() ? buildMobileWatermark() : buildDesktopWatermark();
1598
+ document.body.appendChild(el);
1599
+ }
1600
+ __name(mountDoubaoWatermark, "mountDoubaoWatermark");
1079
1601
 
1080
1602
  // src/runtime.ts
1081
- var version = "0.0.10";
1603
+ var version = "0.0.11-alpha.20260825130527";
1082
1604
  var name = "@lark-apaas/miaoda-coding-sdk";
1083
- if (false) {
1605
+ if (isOnlineEnv()) {
1084
1606
  reportPageView();
1085
1607
  initPvTracking();
1086
1608
  }
1609
+ mountDoubaoWatermark();
1087
1610
  return __toCommonJS(runtime_exports);
1088
1611
  })();
package/dist/runtime.js CHANGED
@@ -994,6 +994,10 @@ var MiaodaRuntime = (() => {
994
994
  }
995
995
  }
996
996
  __name(getEnv, "getEnv");
997
+ function isOnlineEnv() {
998
+ return window.appEnv != null ? window.appEnv === "runtime" : true;
999
+ }
1000
+ __name(isOnlineEnv, "isOnlineEnv");
997
1001
  function isMobile() {
998
1002
  const ua = navigator.userAgent;
999
1003
  const isPhone = /(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i.test(ua);
@@ -1286,12 +1290,322 @@ var MiaodaRuntime = (() => {
1286
1290
  }
1287
1291
  __name(initPvTracking, "initPvTracking");
1288
1292
 
1293
+ // src/runtime/watermark.ts
1294
+ var CDN = "https://lf3-static.bytednsdoc.com/obj/eden-cn/LMfspH/ljhwZthlaukjlkulzlp/miaoda-ui";
1295
+ var DOUBAO_AVATAR_SRC = `${CDN}/doubao.svg`;
1296
+ var CLOSE_ICON_SVG = '<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>';
1297
+ var FEEDBACK_ICON_SVG = '<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>';
1298
+ var REPORT_ENABLED = true;
1299
+ var BRAND_TEXT = "\u8C46\u5305 AI \u751F\u6210";
1300
+ var POWERED_BY_TEXT = "\u7531\u98DE\u4E66\u5999\u642D\u63D0\u4F9B\u652F\u6301";
1301
+ 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)";
1302
+ 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)";
1303
+ var FONT_FAMILY = "'PingFang SC', -apple-system, BlinkMacSystemFont, sans-serif";
1304
+ var REPORT_DOMAIN = {
1305
+ BOE: "tns.feishu-boe.cn",
1306
+ PRE: "tns.feishu-pre.cn",
1307
+ ONLINE: "tns.feishu.cn"
1308
+ };
1309
+ function openDoubaoReport() {
1310
+ var _a2;
1311
+ const params = JSON.stringify({
1312
+ scene: "miaoda_app_report",
1313
+ entity_id: (_a2 = getAppId()) != null ? _a2 : "",
1314
+ entity_type: "miaoda_app",
1315
+ extra: ""
1316
+ });
1317
+ const url = `https://${REPORT_DOMAIN[getEnv()]}/cust/lark_report/?type=common&params=${encodeURIComponent(params)}&lang=zh-CN`;
1318
+ window.open(url, "_blank", "noopener,noreferrer");
1319
+ }
1320
+ __name(openDoubaoReport, "openDoubaoReport");
1321
+ function makeCloseIcon(size) {
1322
+ const span = document.createElement("span");
1323
+ Object.assign(span.style, {
1324
+ display: "inline-flex",
1325
+ width: `${size}px`,
1326
+ height: `${size}px`,
1327
+ flexShrink: "0"
1328
+ });
1329
+ span.innerHTML = CLOSE_ICON_SVG;
1330
+ const svg = span.firstElementChild;
1331
+ if (svg) {
1332
+ svg.setAttribute("width", String(size));
1333
+ svg.setAttribute("height", String(size));
1334
+ svg.style.display = "block";
1335
+ }
1336
+ return span;
1337
+ }
1338
+ __name(makeCloseIcon, "makeCloseIcon");
1339
+ function makeAvatar(size) {
1340
+ const img = document.createElement("img");
1341
+ img.src = DOUBAO_AVATAR_SRC;
1342
+ img.width = size;
1343
+ img.height = size;
1344
+ img.alt = "";
1345
+ Object.assign(img.style, {
1346
+ width: `${size}px`,
1347
+ height: `${size}px`,
1348
+ maxWidth: "none",
1349
+ maxHeight: "none",
1350
+ borderRadius: "100px",
1351
+ flexShrink: "0",
1352
+ display: "block"
1353
+ });
1354
+ return img;
1355
+ }
1356
+ __name(makeAvatar, "makeAvatar");
1357
+ function buildPill(variant, onClose) {
1358
+ const isDesktop = variant === "desktop";
1359
+ const pill = document.createElement("div");
1360
+ Object.assign(pill.style, {
1361
+ boxSizing: "border-box",
1362
+ display: "inline-flex",
1363
+ alignItems: "center",
1364
+ gap: isDesktop ? "4px" : "6px",
1365
+ padding: isDesktop ? "6px 12px 6px 8px" : "4px 12px 4px 8px",
1366
+ background: "#363636",
1367
+ border: "0.5px solid rgba(255,255,255,0.1)",
1368
+ borderRadius: "100px",
1369
+ boxShadow: PILL_SHADOW,
1370
+ cursor: "pointer"
1371
+ });
1372
+ const avatar = makeAvatar(isDesktop ? 16 : 18);
1373
+ const text = document.createElement("span");
1374
+ text.textContent = BRAND_TEXT;
1375
+ Object.assign(text.style, {
1376
+ fontFamily: FONT_FAMILY,
1377
+ fontSize: isDesktop ? "12px" : "14px",
1378
+ lineHeight: isDesktop ? "18px" : "22px",
1379
+ color: "rgba(255,255,255,0.85)",
1380
+ whiteSpace: "nowrap"
1381
+ });
1382
+ pill.append(avatar, text);
1383
+ if (isDesktop && onClose) {
1384
+ const close = document.createElement("span");
1385
+ close.setAttribute("role", "button");
1386
+ close.setAttribute("aria-label", "\u5173\u95ED");
1387
+ close.setAttribute("data-doubao-close", "");
1388
+ Object.assign(close.style, {
1389
+ display: "none",
1390
+ alignItems: "center",
1391
+ cursor: "pointer",
1392
+ flexShrink: "0",
1393
+ color: "rgba(255,255,255,0.5)"
1394
+ });
1395
+ close.appendChild(makeCloseIcon(10));
1396
+ close.addEventListener("click", (e) => {
1397
+ e.stopPropagation();
1398
+ onClose();
1399
+ });
1400
+ pill.appendChild(close);
1401
+ }
1402
+ return pill;
1403
+ }
1404
+ __name(buildPill, "buildPill");
1405
+ function buildMenuRow(opts) {
1406
+ const row = document.createElement("div");
1407
+ row.setAttribute("role", "menuitem");
1408
+ row.setAttribute("data-label", opts.label);
1409
+ Object.assign(row.style, {
1410
+ boxSizing: "border-box",
1411
+ display: "flex",
1412
+ alignItems: "center",
1413
+ gap: "8px",
1414
+ padding: "4px 10px",
1415
+ borderRadius: "6px",
1416
+ cursor: "pointer",
1417
+ color: "#000000"
1418
+ });
1419
+ const icon = document.createElement("span");
1420
+ Object.assign(icon.style, {
1421
+ display: "inline-flex",
1422
+ width: "16px",
1423
+ height: "16px",
1424
+ flexShrink: "0",
1425
+ color: "#000000"
1426
+ });
1427
+ if (opts.icon === "feedback") {
1428
+ icon.innerHTML = FEEDBACK_ICON_SVG;
1429
+ } else {
1430
+ icon.appendChild(makeCloseIcon(16));
1431
+ }
1432
+ const label = document.createElement("span");
1433
+ label.textContent = opts.label;
1434
+ Object.assign(label.style, {
1435
+ fontFamily: FONT_FAMILY,
1436
+ fontSize: `${opts.fontSize}px`,
1437
+ lineHeight: `${opts.fontSize + 8}px`,
1438
+ color: "#000000",
1439
+ whiteSpace: "nowrap"
1440
+ });
1441
+ row.append(icon, label);
1442
+ row.addEventListener("mouseenter", () => {
1443
+ row.style.background = "rgba(0,0,0,0.04)";
1444
+ });
1445
+ row.addEventListener("mouseleave", () => {
1446
+ row.style.background = "transparent";
1447
+ });
1448
+ row.addEventListener("click", opts.onClick);
1449
+ return row;
1450
+ }
1451
+ __name(buildMenuRow, "buildMenuRow");
1452
+ function buildMenuCard(opts) {
1453
+ const card = document.createElement("div");
1454
+ Object.assign(card.style, {
1455
+ boxSizing: "border-box",
1456
+ display: "flex",
1457
+ flexDirection: "column",
1458
+ minWidth: `${opts.minWidth}px`,
1459
+ background: "#ffffff",
1460
+ border: "0.5px solid rgba(0,0,0,0.1)",
1461
+ borderRadius: "10px",
1462
+ boxShadow: CARD_SHADOW,
1463
+ overflow: "hidden",
1464
+ outline: "none"
1465
+ });
1466
+ if (opts.rows.length) {
1467
+ const items = document.createElement("div");
1468
+ Object.assign(items.style, {
1469
+ boxSizing: "border-box",
1470
+ padding: "4px"
1471
+ });
1472
+ opts.rows.forEach((r) => items.appendChild(r));
1473
+ card.appendChild(items);
1474
+ }
1475
+ const footer = document.createElement("div");
1476
+ footer.textContent = POWERED_BY_TEXT;
1477
+ Object.assign(footer.style, {
1478
+ boxSizing: "border-box",
1479
+ background: "#f9f9f9",
1480
+ padding: "8px 14px",
1481
+ fontFamily: FONT_FAMILY,
1482
+ fontSize: `${opts.footerFontSize}px`,
1483
+ lineHeight: `${opts.footerFontSize + 8}px`,
1484
+ color: "rgba(0,0,0,0.35)",
1485
+ whiteSpace: "nowrap"
1486
+ });
1487
+ card.appendChild(footer);
1488
+ return card;
1489
+ }
1490
+ __name(buildMenuCard, "buildMenuCard");
1491
+ function buildDesktopWatermark() {
1492
+ const container = document.createElement("div");
1493
+ container.setAttribute("data-custom-element", "doubao-watermark");
1494
+ Object.assign(container.style, {
1495
+ position: "fixed",
1496
+ right: "12px",
1497
+ bottom: "12px",
1498
+ zIndex: "9999",
1499
+ display: "flex",
1500
+ flexDirection: "column",
1501
+ alignItems: "flex-end",
1502
+ gap: "8px"
1503
+ });
1504
+ const rows = [];
1505
+ if (REPORT_ENABLED) {
1506
+ rows.push(buildMenuRow({
1507
+ icon: "feedback",
1508
+ label: "\u6295\u8BC9\u4E0E\u4E3E\u62A5",
1509
+ fontSize: 14,
1510
+ onClick: openDoubaoReport
1511
+ }));
1512
+ }
1513
+ const menu = buildMenuCard({
1514
+ rows,
1515
+ footerFontSize: 12,
1516
+ minWidth: 144
1517
+ });
1518
+ menu.style.display = "none";
1519
+ const pill = buildPill("desktop", () => container.remove());
1520
+ const close = pill.querySelector("[data-doubao-close]");
1521
+ container.append(menu, pill);
1522
+ let timer = null;
1523
+ container.addEventListener("mouseenter", () => {
1524
+ if (timer) clearTimeout(timer);
1525
+ menu.style.display = "flex";
1526
+ if (close) close.style.display = "inline-flex";
1527
+ });
1528
+ container.addEventListener("mouseleave", () => {
1529
+ timer = setTimeout(() => {
1530
+ menu.style.display = "none";
1531
+ if (close) close.style.display = "none";
1532
+ }, 100);
1533
+ });
1534
+ return container;
1535
+ }
1536
+ __name(buildDesktopWatermark, "buildDesktopWatermark");
1537
+ function buildMobileWatermark() {
1538
+ const wrapper = document.createElement("div");
1539
+ wrapper.setAttribute("data-custom-element", "doubao-watermark-mobile");
1540
+ Object.assign(wrapper.style, {
1541
+ position: "fixed",
1542
+ right: "12px",
1543
+ bottom: "12px",
1544
+ zIndex: "9999",
1545
+ display: "flex",
1546
+ flexDirection: "column",
1547
+ alignItems: "flex-end",
1548
+ gap: "8px",
1549
+ cursor: "pointer"
1550
+ });
1551
+ const rows = [];
1552
+ if (REPORT_ENABLED) {
1553
+ rows.push(buildMenuRow({
1554
+ icon: "feedback",
1555
+ label: "\u6295\u8BC9\u4E0E\u4E3E\u62A5",
1556
+ fontSize: 16,
1557
+ onClick: openDoubaoReport
1558
+ }));
1559
+ }
1560
+ rows.push(buildMenuRow({
1561
+ icon: "close",
1562
+ label: "\u4E0D\u518D\u5C55\u793A",
1563
+ fontSize: 16,
1564
+ onClick: /* @__PURE__ */ __name((e) => {
1565
+ e.stopPropagation();
1566
+ wrapper.remove();
1567
+ }, "onClick")
1568
+ }));
1569
+ const menu = buildMenuCard({
1570
+ rows,
1571
+ footerFontSize: 14,
1572
+ minWidth: 160
1573
+ });
1574
+ menu.style.display = "none";
1575
+ const pill = buildPill("mobile");
1576
+ wrapper.append(menu, pill);
1577
+ wrapper.addEventListener("click", (e) => {
1578
+ e.stopPropagation();
1579
+ menu.style.display = menu.style.display === "none" ? "flex" : "none";
1580
+ });
1581
+ document.addEventListener("click", () => {
1582
+ menu.style.display = "none";
1583
+ });
1584
+ return wrapper;
1585
+ }
1586
+ __name(buildMobileWatermark, "buildMobileWatermark");
1587
+ var mounted = false;
1588
+ function mountDoubaoWatermark() {
1589
+ if (mounted || typeof document === "undefined") return;
1590
+ if (document.readyState === "loading") {
1591
+ document.addEventListener("DOMContentLoaded", mountDoubaoWatermark, {
1592
+ once: true
1593
+ });
1594
+ return;
1595
+ }
1596
+ mounted = true;
1597
+ const el = isMobile() ? buildMobileWatermark() : buildDesktopWatermark();
1598
+ document.body.appendChild(el);
1599
+ }
1600
+ __name(mountDoubaoWatermark, "mountDoubaoWatermark");
1601
+
1289
1602
  // src/runtime.ts
1290
- var version = "0.0.10";
1603
+ var version = "0.0.11-alpha.20260825130527";
1291
1604
  var name = "@lark-apaas/miaoda-coding-sdk";
1292
- if (true) {
1605
+ if (isOnlineEnv()) {
1293
1606
  reportPageView();
1294
1607
  initPvTracking();
1295
1608
  }
1609
+ mountDoubaoWatermark();
1296
1610
  return __toCommonJS(runtime_exports);
1297
1611
  })();
@@ -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})},V=(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 j=(f,r,l)=>(l=f!=null?ct(dt(f)):{},V(r||!f||!f.__esModule?M(l,"default",{value:f,enumerable:!0}):l,f)),pt=f=>V(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,y,I){return r(l(r(r(d,t),r(v,I)),y),e)}c(_,"md5cmn");function h(t,d,e,v,y,I,P){return _(d&e|~d&v,t,d,y,I,P)}c(h,"md5ff");function m(t,d,e,v,y,I,P){return _(d&v|e&~v,t,d,y,I,P)}c(m,"md5gg");function g(t,d,e,v,y,I,P){return _(d^e^v,t,d,y,I,P)}c(g,"md5hh");function b(t,d,e,v,y,I,P){return _(e^(d|~v),t,d,y,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,y,I,P,n=1732584193,i=-271733879,a=-1732584194,o=271733878;for(e=0;e<t.length;e+=16)v=n,y=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,y),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 T(t){return D(k(S(t),t.length*8))}c(T,"rstrMD5");function E(t,d){var e,v=S(t),y=[],I=[],P;for(y[15]=I[15]=void 0,v.length>16&&(v=k(v,t.length*8)),e=0;e<16;e+=1)y[e]=v[e]^909522486,I[e]=v[e]^1549556828;return P=k(y.concat(S(d)),512+d.length*8),D(k(I.concat(P),640))}c(E,"rstrHMACMD5");function A(t){var d="0123456789abcdef",e="",v,y;for(y=0;y<t.length;y+=1)v=t.charCodeAt(y),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 T(C(t))}c(s,"rawMD5");function u(t){return A(s(t))}c(u,"hexMD5");function w(t,d){return E(C(t),C(d))}c(w,"rawHMACMD5");function p(t,d){return A(w(t,d))}c(p,"hexHMACMD5");function B(t,d,e){return d?e?w(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 w;return s.prototype=u,w=new s,s.prototype=null,w}})(),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,w=s.words,p=this.sigBytes,B=s.sigBytes;if(this.clamp(),p%4)for(var t=0;t<B;t++){var d=w[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]=w[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=[],w=c(function(e){var e=e,v=987654321,y=4294967295;return function(){v=36969*(v&65535)+(v>>16)&y,e=18e3*(e&65535)+(e>>16)&y;var I=(v<<16)+e&y;return I/=4294967296,I+=.5,I*(r.random()>.5?1:-1)}},"r"),p=0,B;p<s;p+=4){var t=w((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,w=s.sigBytes,p=[],B=0;B<w;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,w=[],p=0;p<u;p+=2)w[p>>>3]|=parseInt(s.substr(p,2),16)<<24-p%8*4;return new b.init(w,u/2)},"parse")},S=k.Latin1={stringify:c(function(s){for(var u=s.words,w=s.sigBytes,p=[],B=0;B<w;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,w=[],p=0;p<u;p++)w[p>>>2]|=(s.charCodeAt(p)&255)<<24-p%4*8;return new b.init(w,u)},"parse")},T=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")},E=m.BufferedBlockAlgorithm=g.extend({reset:c(function(){this._data=new b.init,this._nDataBytes=0},"reset"),_append:c(function(s){typeof s=="string"&&(s=T.parse(s)),this._data.concat(s),this._nDataBytes+=s.sigBytes},"_append"),_process:c(function(s){var u=this._data,w=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 y=0;y<e;y+=B)this._doProcessBlock(w,y);var I=w.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=E.extend({cfg:g.extend(),init:c(function(s){this.cfg=this.cfg.extend(s),this.reset()},"init"),reset:c(function(){E.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,w){return new s.init(w).finalize(u)}},"_createHelper"),_createHmacHelper:c(function(s){return function(u,w){return new C.HMAC.init(s,w).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,T=S[0],E=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 w=g[u-3]^g[u-8]^g[u-14]^g[u-16];g[u]=w<<1|w>>>31}var p=(T<<5|T>>>27)+s+g[u];u<20?p+=(E&A|~E&C)+1518500249:u<40?p+=(E^A^C)+1859775393:u<60?p+=(E&A|E&C|A&C)-1894007588:p+=(E^A^C)-899497514,s=C,C=A,A=E<<30|E>>>2,E=T,T=p}S[0]=S[0]+T|0,S[1]=S[1]+E|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,T=k.sigBytes*8;return D[T>>>5]|=128<<24-T%32,D[(T+64>>>9<<4)+14]=Math.floor(S/4294967296),D[(T+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:()=>Tt,reportTeaEvent:()=>z,version:()=>Et});var et=j($(),1),rt=j(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 wt(){try{let f=localStorage.getItem(at);return f||(f=it(),localStorage.setItem(at,f)),f}catch{return it()}}c(wt,"getDeviceId");function yt(){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(yt,"getDeviceType");function bt(){return{app_id:window.appId||"",tenant_id:window.tenantId||"",user_id:window.userId||"",did:wt(),module:"app_web",app_env:"runtime",source_type:"user",device_type:yt(),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 Et="0.0.10",Tt="@lark-apaas/miaoda-coding-sdk";nt(),st();return pt(Ct);})();
1
+ "use strict";var MiaodaRuntime=(()=>{var be=Object.create;var P=Object.defineProperty;var ye=Object.getOwnPropertyDescriptor;var _e=Object.getOwnPropertyNames;var we=Object.getPrototypeOf,xe=Object.prototype.hasOwnProperty;var i=(r,t)=>P(r,"name",{value:t,configurable:!0});var z=(r,t)=>()=>(t||r((t={exports:{}}).exports,t),t.exports),Ce=(r,t)=>{for(var d in t)P(r,d,{get:t[d],enumerable:!0})},J=(r,t,d,h)=>{if(t&&typeof t=="object"||typeof t=="function")for(let p of _e(t))!xe.call(r,p)&&p!==d&&P(r,p,{get:()=>t[p],enumerable:!(h=ye(t,p))||h.enumerable});return r};var q=(r,t,d)=>(d=r!=null?be(we(r)):{},J(t||!r||!r.__esModule?P(d,"default",{value:r,enumerable:!0}):d,r)),Se=r=>J(P({},"__esModule",{value:!0}),r);var X=z((G,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 h(e,f,n,b,w,S){return t(d(t(t(f,e),t(b,S)),w),n)}i(h,"md5cmn");function p(e,f,n,b,w,S,B){return h(f&n|~f&b,e,f,w,S,B)}i(p,"md5ff");function m(e,f,n,b,w,S,B){return h(f&b|n&~b,e,f,w,S,B)}i(m,"md5gg");function g(e,f,n,b,w,S,B){return h(f^n^b,e,f,w,S,B)}i(g,"md5hh");function y(e,f,n,b,w,S,B){return h(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=p(o,a,s,c,e[n],7,-680876936),c=p(c,o,a,s,e[n+1],12,-389564586),s=p(s,c,o,a,e[n+2],17,606105819),a=p(a,s,c,o,e[n+3],22,-1044525330),o=p(o,a,s,c,e[n+4],7,-176418897),c=p(c,o,a,s,e[n+5],12,1200080426),s=p(s,c,o,a,e[n+6],17,-1473231341),a=p(a,s,c,o,e[n+7],22,-45705983),o=p(o,a,s,c,e[n+8],7,1770035416),c=p(c,o,a,s,e[n+9],12,-1958414417),s=p(s,c,o,a,e[n+10],17,-42063),a=p(a,s,c,o,e[n+11],22,-1990404162),o=p(o,a,s,c,e[n+12],7,1804603682),c=p(c,o,a,s,e[n+13],12,-40341101),s=p(s,c,o,a,e[n+14],17,-1502002290),a=p(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 L(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(L,"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 L(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),L(k(S.concat(B),640))}i(E,"rstrHMACMD5");function T(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(T,"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 T(l(e))}i(u,"hexMD5");function _(e,f){return E(A(e),A(f))}i(_,"rawHMACMD5");function v(e,f){return T(_(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})(G)});var Q=z((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 h=Object.create||(function(){function l(){}return i(l,"F"),function(u){var _;return l.prototype=u,_=new l,l.prototype=null,_}})(),p={},m=p.lib={},g=m.Base=(function(){return{extend:i(function(l){var u=h(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||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 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=p.enc={},L=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}),T=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=p.algo={};return p})(Math);return r})});var te=z((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,h=d.WordArray,p=d.Hasher,m=t.algo,g=[],y=m.SHA1=p.extend({_doReset:i(function(){this._hash=new h.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)g[u]=k[L+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&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=p.clone.call(this);return k._hash=this._hash.clone(),k},"clone")});t.SHA1=p._createHelper(y),t.HmacSHA1=p._createHmacHelper(y)})(),r.SHA1})});var Ge={};Ce(Ge,{TrackKey:()=>U,name:()=>qe,reportTeaEvent:()=>V,version:()=>Je});var oe=q(X(),1),ae=q(te(),1);function O(){return window.appId||null}i(O,"getAppId");function ke(){var d;let r="suda-csrf-token",t=document.cookie.split("; ");for(let h of t){let[p,m]=h.split("=");if(p===r)return decodeURIComponent(m)}return(d=window.csrfToken)!=null?d:null}i(ke,"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 ne(){return window.appEnv!=null?window.appEnv==="runtime":!0}i(ne,"isOnlineEnv");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 re(){var h;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":(h=ke())!=null?h:""}})).json()}i(re,"getLarkUserInfo");var U={VIEW:"aily_agent_artifact_page_view"},Ee="08a441",Ie="42b91e";function ie(r){let t=String(r);return(0,ae.default)(Ee+(0,oe.default)(t+Ie)).toString()}i(ie,"encryptTea");var j=!1;async function Ae(){var m,g,y,k;let{data:r}=await re(),{tenantID:t,userID:d}=r||{},h=d&&d!=="0"?ie(d):void 0,p=t&&t!=="0"?ie(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:h,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:h,tenant_id:p}}),j=!0,(k=window.collectEvent)==null||k.call(window,"start")}i(Ae,"createTracker");async function V({trackKey:r,trackParams:t={}}){var d;try{j||(j=!0,await Ae()),(d=window.collectEvent)==null||d.call(window,r,t)}catch(h){console.error(h)}}i(V,"reportTeaEvent");function se(){return V({trackKey:U.VIEW,trackParams:{artifact_uid:O(),agent_id:"agent_miaoda",url:window.location.href}})}i(se,"reportPageView");function ce(){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(ce,"generateUUID");var le="x_sdk_device_id";function Be(){try{let r=localStorage.getItem(le);return r||(r=ce(),localStorage.setItem(le,r)),r}catch{return ce()}}i(Be,"getDeviceId");function Te(){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(Te,"getDeviceType");function Le(){return{app_id:window.appId||"",tenant_id:window.tenantId||"",user_id:window.userId||"",did:Be(),module:"app_web",app_env:"runtime",source_type:"user",device_type:Te(),release_commit_id:window.__RELEASE_COMMIT_ID__||""}}i(Le,"getDefaultAttributes");var Oe="1.0.0";function De(r){let t=Le(),d=String(BigInt(Date.now())*BigInt(1e6));return{metricsData:{resource:{attributes:{sdk_version:Oe,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(h=>({attributes:{...t,url:h.url,path:h.path,referrer:h.referrer},startTimeUnixNano:String(BigInt(h.timestampMs)*BigInt(1e6)),timeUnixNano:d,asDouble:1}))}}]}}}i(De,"buildPayload");function Pe(r,t,d={}){if(t.length===0)return;let h=JSON.stringify(De(t));try{fetch(r,{method:"POST",headers:{"Content-Type":"application/json","X-Suda-Csrf-Token":window.csrfToken||"",...d},body:h,keepalive:!0}).catch(()=>{})}catch{}}i(Pe,"sendPvData");var D,He=(D=class{constructor(){this.started=!1,this.buffer=[]}static get instance(){return this._instance||(this._instance=new D),this._instance}start(t){var d;if(this.started)return;this.config=t,this.started=!0,this.listenRouteChanges(),this.registerLifecycleListeners();let h=(d=t.flushIntervalMs)!=null?d:1e4;this.flushTimer=setInterval(()=>this.flush(),h)}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],h=i(()=>this.recordPv(),"recordPv");history[t]=function(...p){let m=d.apply(this,p);return h(),m}}registerLifecycleListeners(){document.addEventListener("visibilitychange",()=>{document.visibilityState==="hidden"&&this.flush()}),window.addEventListener("pagehide",()=>this.flush())}},i(D,"_PvTracker"),D),de=He.instance;function ue(){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`;de.start({collectorUrl:t})}i(ue,"initPvTracking");var Me="https://lf3-static.bytednsdoc.com/obj/eden-cn/LMfspH/ljhwZthlaukjlkulzlp/miaoda-ui",Re=`${Me}/doubao.svg`,Fe='<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>',Ne='<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,ze="\u8C46\u5305 AI \u751F\u6210",We="\u7531\u98DE\u4E66\u5999\u642D\u63D0\u4F9B\u652F\u6301",je="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)",Ue="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",Ve={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://${Ve[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=Fe;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=Re,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 me(r,t){let d=r==="desktop",h=document.createElement("div");Object.assign(h.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:je,cursor:"pointer"});let p=$e(d?16:18),m=document.createElement("span");if(m.textContent=ze,Object.assign(m.style,{fontFamily:K,fontSize:d?"12px":"14px",lineHeight:d?"18px":"22px",color:"rgba(255,255,255,0.85)",whiteSpace:"nowrap"}),h.append(p,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()}),h.appendChild(g)}return h}i(me,"buildPill");function $(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=Ne:d.appendChild(ge(16));let h=document.createElement("span");return h.textContent=r.label,Object.assign(h.style,{fontFamily:K,fontSize:`${r.fontSize}px`,lineHeight:`${r.fontSize+8}px`,color:"#000000",whiteSpace:"nowrap"}),t.append(d,h),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($,"buildMenuRow");function ve(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:Ue,overflow:"hidden",outline:"none"}),r.rows.length){let h=document.createElement("div");Object.assign(h.style,{boxSizing:"border-box",padding:"4px"}),r.rows.forEach(p=>h.appendChild(p)),t.appendChild(h)}let d=document.createElement("div");return d.textContent=We,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(ve,"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($({icon:"feedback",label:"\u6295\u8BC9\u4E0E\u4E3E\u62A5",fontSize:14,onClick:he}));let d=ve({rows:t,footerFontSize:12,minWidth:144});d.style.display="none";let h=me("desktop",()=>r.remove()),p=h.querySelector("[data-doubao-close]");r.append(d,h);let m=null;return r.addEventListener("mouseenter",()=>{m&&clearTimeout(m),d.style.display="flex",p&&(p.style.display="inline-flex")}),r.addEventListener("mouseleave",()=>{m=setTimeout(()=>{d.style.display="none",p&&(p.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",zIndex:"9999",display:"flex",flexDirection:"column",alignItems:"flex-end",gap:"8px",cursor:"pointer"});let t=[];pe&&t.push($({icon:"feedback",label:"\u6295\u8BC9\u4E0E\u4E3E\u62A5",fontSize:16,onClick:he})),t.push($({icon:"close",label:"\u4E0D\u518D\u5C55\u793A",fontSize:16,onClick:i(p=>{p.stopPropagation(),r.remove()},"onClick")}));let d=ve({rows:t,footerFontSize:14,minWidth:160});d.style.display="none";let h=me("mobile");return r.append(d,h),r.addEventListener("click",p=>{p.stopPropagation(),d.style.display=d.style.display==="none"?"flex":"none"}),document.addEventListener("click",()=>{d.style.display="none"}),r}i(Ze,"buildMobileWatermark");var fe=!1;function Z(){if(fe||typeof document=="undefined")return;if(document.readyState==="loading"){document.addEventListener("DOMContentLoaded",Z,{once:!0});return}fe=!0;let r=N()?Ze():Ke();document.body.appendChild(r)}i(Z,"mountDoubaoWatermark");var Je="0.0.11-alpha.20260825130527",qe="@lark-apaas/miaoda-coding-sdk";ne()&&(se(),ue());Z();return Se(Ge);})();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lark-apaas/miaoda-coding-sdk",
3
- "version": "0.0.10",
3
+ "version": "0.0.11-alpha.20260825130527",
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",