@lark-apaas/miaoda-coding-sdk 0.0.21-beta.0 → 0.0.21

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.
@@ -927,7 +927,7 @@ var MiaodaRuntime = (() => {
927
927
  __name(initCreativePvTracking, "initCreativePvTracking");
928
928
 
929
929
  // src/design-runtime.ts
930
- var version = "0.0.21-beta.0";
930
+ var version = "0.0.21";
931
931
  var name = "@lark-apaas/miaoda-coding-sdk";
932
932
  if (!window.__CREATIVITY_RUNTIME__) {
933
933
  window.__CREATIVITY_RUNTIME__ = true;
@@ -927,7 +927,7 @@ var MiaodaRuntime = (() => {
927
927
  __name(initCreativePvTracking, "initCreativePvTracking");
928
928
 
929
929
  // src/design-runtime.ts
930
- var version = "0.0.21-beta.0";
930
+ var version = "0.0.21";
931
931
  var name = "@lark-apaas/miaoda-coding-sdk";
932
932
  if (!window.__CREATIVITY_RUNTIME__) {
933
933
  window.__CREATIVITY_RUNTIME__ = true;
@@ -1 +1 @@
1
- "use strict";var MiaodaRuntime=(()=>{var y=Object.defineProperty;var H=Object.getOwnPropertyDescriptor;var X=Object.getOwnPropertyNames;var q=Object.prototype.hasOwnProperty;var o=(t,e)=>y(t,"name",{value:e,configurable:!0});var K=(t,e)=>{for(var r in e)y(t,r,{get:e[r],enumerable:!0})},J=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of X(e))!q.call(t,s)&&s!==r&&y(t,s,{get:()=>e[s],enumerable:!(n=H(e,s))||n.enumerable});return t};var Y=t=>J(y({},"__esModule",{value:!0}),t);var De={};K(De,{name:()=>xe,version:()=>Ie});var z=new Set(["text/babel","text/jsx"]),Q=3e3,W=15e3,Z=1e3,ee=20,P=!1;function x(){P||(P=!0,document.addEventListener("DOMContentLoaded",te,{once:!0}))}o(x,"initCreativeBabelStages");function te(){var s;let t=re();if(!t.length)return;let e={fetchDur:0,transformDur:0,evalDur:0,externalCount:t.filter(i=>i.src).length,targets:((s=t.find(i=>i.hasAttribute("data-targets")))==null?void 0:s.getAttribute("data-targets"))||"none"},r={sent:!1,scriptsDone:!1,scriptsDoneAt:null,totalStart:null,renderStart:null,renderDur:null,takeover:!1,retries:0,hardTimer:null},n=window.Babel;if(!n||typeof n.transform!="function"||typeof n.disableScriptTags!="function"||e.externalCount>0&&typeof fetch!="function"){r.scriptsDone=!0,h(e,r);return}try{n.disableScriptTags()}catch{r.scriptsDone=!0,h(e,r);return}r.takeover=!0,r.totalStart=performance.now(),r.hardTimer=setTimeout(()=>h(e,r),W),oe(e,r),ie(n,t,e,r)}o(te,"onDomContentLoaded");function re(){let t=document.getElementsByTagName("script"),e=[];for(let r=0;r<t.length;r++){let n=t[r];z.has((n.type||"").split(";")[0])&&e.push(n)}return e}o(re,"collectBabelScripts");function S(t,e){let r=t.getAttribute(e);return r===""?[]:r?r.split(",").map(n=>n.trim()):null}o(S,"attrList");function ne(t,e){var s,i,a;let r=t.getAttribute("data-type"),n={browsers:(s=S(t,"data-targets"))!=null?s:void 0};return r==="module"&&(n.esmodules="intersect"),{filename:e,presets:(i=S(t,"data-presets"))!=null?i:r==="module"?["react",["env",{modules:!1}]]:["react","env"],plugins:(a=S(t,"data-plugins"))!=null?a:["transform-class-properties","transform-object-rest-spread","transform-flow-strip-types"],sourceMaps:"inline",sourceFileName:e,targets:n}}o(ne,"buildOptions");function ie(t,e,r,n){let s=0,i=o((l,d)=>{var m;let f;if(l.src)f=l.src;else{let p=l.getAttribute("data-module");p?f=p:(s++,f=s===1?"Inline Babel script":`Inline Babel script (${s})`)}try{let p=performance.now(),b=t.transform(d,ne(l,f)),v=performance.now(),_=document.createElement("script"),w=l.getAttribute("data-type");w&&_.setAttribute("type",w),l.nonce&&(_.nonce=l.nonce),_.text=(m=b==null?void 0:b.code)!=null?m:"",document.head.appendChild(_),r.transformDur+=v-p,r.evalDur+=performance.now()-v}catch(p){console.error("[creative-babel-stages] script failed:",f,p)}},"runOne"),a=0;for(;a<e.length&&!e[a].src;)i(e[a],e[a].innerHTML),a++;if(a>=e.length){I(r,n);return}let u=e.slice(a),c=u.map(l=>{if(!l.src)return Promise.resolve(l.innerHTML);let d=performance.now();return fetch(l.src).then(f=>{if(!f.ok)throw new Error(`HTTP ${f.status}`);return f.text()}).then(f=>(r.fetchDur+=performance.now()-d,f))});(async()=>{for(let l=0;l<u.length;l++){let d=null;try{d=await c[l]}catch(f){console.error("[creative-babel-stages] load failed:",u[l].src,f);continue}i(u[l],d)}I(r,n)})()}o(ie,"runScripts");function oe(t,e){let r=window.ReactDOM;if(!r)return;let n=o(a=>{if(e.renderStart===null){e.renderStart=performance.now();try{let u=new MutationObserver(()=>{u.disconnect(),e.renderDur=performance.now()-e.renderStart,e.scriptsDone&&h(t,e)});u.observe(a,{childList:!0,subtree:!0})}catch{}}},"observeCommit"),s=r.createRoot;typeof s=="function"&&(r.createRoot=(a,u)=>{let c=s.call(r,a,u),l=c.render.bind(c);return c.render=d=>(n(a),l(d)),c});let i=r.render;typeof i=="function"&&(r.render=(a,u,c)=>(n(u),i.call(r,a,u,c)))}o(oe,"instrumentRender");function I(t,e){e.scriptsDone=!0,e.scriptsDoneAt=performance.now(),e.renderStart===null||e.renderDur!==null?h(t,e):setTimeout(()=>h(t,e),Q)}o(I,"onScriptsDone");function h(t,e){var i;if(e.sent)return;let r=window.Slardar;if(!r){e.retries++<ee&&setTimeout(()=>h(t,e),Z);return}e.sent=!0,e.hardTimer!==null&&clearTimeout(e.hardTimer);let n=e.renderDur!==null&&e.renderStart!==null?e.renderStart+e.renderDur:(i=e.scriptsDoneAt)!=null?i:performance.now(),s=e.totalStart===null?0:Math.max(0,n-e.totalStart);r("sendEvent",{name:"creative_babel_stages",metrics:{babel_total_dur:Math.round(s),babel_fetch_dur:Math.round(t.fetchDur),babel_transform_dur:Math.round(t.transformDur),babel_eval_dur:Math.round(t.evalDur)},categories:{takeover:String(e.takeover),external:String(t.externalCount>0),render_observed:String(e.renderDur!==null),targets:t.targets}})}o(h,"trySend");var se='script[type="text/babel"],script[type="text/jsx"]',D=["transform-class-properties","transform-object-rest-spread","transform-flow-strip-types"],R=["transform-class-static-block","transform-class-properties","transform-private-methods","transform-private-property-in-object","transform-classes","transform-block-scoped-functions","transform-block-scoping"];var ae=/^(chrome|firefox|safari|ios_saf) (\d+)(?:\.(\d+))?$/;function M(){document.addEventListener("DOMContentLoaded",fe,{once:!0})}o(M,"initCreativeBabelTargets");function ce(t){let e=/\b(?:iPhone|iPad|iPod)\b.*? OS (\d+)(?:_(\d+))?/.exec(t);return e?{engine:"ios",version:[+e[1],+(e[2]||0)]}:/\bEdge\/\d/.test(t)?null:(e=/\bFirefox\/(\d+)/.exec(t),e?{engine:"firefox",version:[+e[1],0]}:(e=/Chrom(?:e|ium)\/(\d+)/.exec(t),e?{engine:"chrome",version:[+e[1],0]}:(e=/\bVersion\/(\d+)(?:\.(\d+))?.*\bSafari\//.exec(t),e?{engine:"safari",version:[+e[1],+(e[2]||0)]}:null)))}o(ce,"detectBrowserEngine");function ue(t,e){return t[0]-e[0]||t[1]-e[1]}o(ue,"compareVersion");function le(){let t=window.__creativeBabelTargets__;if(typeof t!="string"||t.length>200)return null;let e=[];for(let r of t.split(",")){let n=r.trim().toLowerCase().replace(/\s+/g," ");if(!n)continue;let s=ae.exec(n);if(!s)return null;e.push({query:n,engine:s[1]==="ios_saf"?"ios":s[1],version:[+s[2],+(s[3]||0)]})}return e.length?e:null}o(le,"readTargets");function de(t){let e=ce(navigator.userAgent||"");if(!e)return!1;let r=t.filter(n=>n.engine===e.engine);return r.length>0&&r.every(n=>ue(e.version,n.version)>=0)}o(de,"currentBrowserMeets");function C(t,e,r){let n=t.availablePlugins||{},s=o((a,u)=>a===u||n[a]!==void 0&&n[a]===n[u],"same"),i=e.slice();for(let a of r)i.some(u=>s(u,a))||i.push(a);return i}o(C,"appendPlugins");function fe(){let t=le();if(!t||!de(t))return;let e=window.Babel;if(!e||typeof e.transform!="function")return;let r=Array.from(document.querySelectorAll(se)).filter(i=>!i.hasAttribute("data-targets")&&!i.hasAttribute("data-presets")&&i.getAttribute("data-type")!=="module");if(!r.length)return;let n=t.map(i=>i.query);try{e.transform("",{presets:["react","env"],plugins:C(e,D,R),targets:{browsers:n}})}catch{return}let s=n.join(",");for(let i of r){let a=i.getAttribute("data-plugins"),u=a===null?D:a.split(",").map(c=>c.trim()).filter(Boolean);i.setAttribute("data-plugins",C(e,u,R).join(",")),i.setAttribute("data-targets",s)}}o(fe,"applyBabelTargets");var pe="https://lf3-short.ibytedapm.com/slardar/fe/sdk-web/browser.cn.js",me="miaoda:perf:fcp",k=!1;function N(){if(k)return;if(k=!0,he(),window.Slardar){L();return}let t=document.createElement("script");t.src=pe,t.onload=()=>{window.Slardar&&L()},t.onerror=()=>{},document.head.appendChild(t)}o(N,"initCreativePerf");function L(){var s,i,a;let t=window.Slardar;if(!t)return;let e=null;t("context.merge",{app_id:(s=window.__appId__)!=null?s:"",creative_type:(i=window.__creativeType__)!=null?i:"unknown",is_public:String((a=window.__isExternallyVisible__)!=null?a:!1)}),t("init",{bid:"apaas_miaoda",env:window.ENVIRONMENT||"online"}),t("start");try{new PerformanceObserver(u=>{for(let c of u.getEntries())if(c.name==="first-contentful-paint"){e=c.startTime,t("context.merge",{has_painted:"true"});break}}).observe({type:"paint",buffered:!0})}catch{}let r=!1,n=o(()=>{if(r||!window.Slardar)return;r=!0;let u=performance.getEntriesByType("resource"),c=performance.getEntriesByType("navigation")[0],l=e!=null?e:ge(),d={transfer_size:u.reduce((f,m)=>{var p;return f+((p=m.transferSize)!=null?p:0)},0)};c&&c.domContentLoadedEventEnd>=c.responseStart&&(d.ttfb_to_dom_ready_dur=Math.round(c.domContentLoadedEventEnd-c.responseStart)),c&&l!==null&&l>=c.domContentLoadedEventEnd&&(d.render_to_fcp_dur=Math.round(l-c.domContentLoadedEventEnd)),window.Slardar("sendEvent",{name:"creative_perf",metrics:d})},"send");window.addEventListener("load",()=>setTimeout(n,500)),setTimeout(n,15e3)}o(L,"bootstrap");function he(){if(window.parent===window||typeof performance.timeOrigin!="number")return;let t=!1;try{new PerformanceObserver(e=>{var r;if(!t)for(let n of e.getEntries()){if(n.name!=="first-contentful-paint")continue;t=!0;let s={type:me,fcpTime:performance.timeOrigin+n.startTime,creativeType:(r=window.__creativeType__)!=null?r:"unknown"};window.parent.postMessage(s,"*");break}}).observe({type:"paint",buffered:!0})}catch{}}o(he,"postFcpToParent");function ge(){var r;let e=performance.getEntriesByType("paint").find(n=>n.name==="first-contentful-paint");return(r=e==null?void 0:e.startTime)!=null?r:null}o(ge,"getBufferedFcpStartTime");function B(){let t="inspector-id";document.addEventListener("DOMContentLoaded",()=>{let e=window.Babel;if(!e||!e.registerPlugin)return;let r=null,n=o(()=>{let i={},a=0;return document.querySelectorAll('script[type="text/babel"],script[type="text/jsx"]').forEach(u=>{let c=u.getAttribute("src");if(c){let l=c.split("?")[0],d=l.split("/").pop()||l;i[d]=d in i?"":l}else{a++;let l=a===1?"Inline Babel script":`Inline Babel script (${a})`;i[l]=u.getAttribute("data-filename")||`inline-${a-1}`}}),i},"buildFileMap");e.availablePlugins&&delete e.availablePlugins[t],e.registerPlugin(t,({types:i})=>({visitor:{JSXOpeningElement(a,u){let c=a.node;if(c.name&&c.name.type==="JSXMemberExpression")return;for(let T=0;T<c.attributes.length;T++){let E=c.attributes[T];if(E.type==="JSXAttribute"&&E.name&&E.name.name==="data-inspector-id")return}let l=u.file&&u.file.opts&&u.file.opts.filename||"?";r===null&&(r=n());let d=l.split("?")[0],f=d.split("/").pop()||d,m=r[l]||r[f]||d.replace(/^\/?[a-z][a-z0-9+.-]*:\/{1,2}[^/]+/i,"").replace(/^\/+/,"")||l,p=c.loc&&c.loc.start,b=p?p.line:0,v=p?p.column+1:0,_=c.name&&c.name.type==="JSXIdentifier"?c.name.name:m,w=`jsx:${m}:${_}:${b}:${v}`;c.attributes.push(i.jsxAttribute(i.jsxIdentifier("data-inspector-id"),i.stringLiteral(w)))}}}));let s="";try{let i=document.getElementById("__srcmap");if(i&&i.textContent){let a=JSON.parse(i.textContent),u=a==null?void 0:a.file;typeof u=="string"&&(s=u)}}catch{}document.querySelectorAll('script[type="text/babel"],script[type="text/jsx"]').forEach((i,a)=>{let u=i.getAttribute("data-plugins")||"";if(u.indexOf(t)<0&&i.setAttribute("data-plugins",u?`${u},${t}`:t),!i.hasAttribute("data-filename")){let c=s?`${s}#inline-${a}`:`inline-${a}`;i.setAttribute("data-filename",i.getAttribute("src")||c)}})})}o(B,"registerInspectorIdPlugin");function O(){if(typeof crypto!="undefined"&&crypto.getRandomValues){let e=new Uint8Array(8);return crypto.getRandomValues(e),Array.from(e).map(r=>r.toString(16).padStart(2,"0")).join("")}let t="";for(let e=0;e<16;e++)t+=Math.floor(Math.random()*16).toString(16);return t}o(O,"generateUUID");var F="x_sdk_device_id";function _e(){try{let t=localStorage.getItem(F);return t||(t=O(),localStorage.setItem(F,t)),t}catch{return O()}}o(_e,"getDeviceId");function be(){let t=typeof navigator!="undefined"?navigator.userAgent:"";return t&&(/Android/i.test(t)&&/Mobile/i.test(t)||/iPhone|iPod/i.test(t)||/BlackBerry|IEMobile|Opera Mini/i.test(t))?"mobile":"desktop"}o(be,"getDeviceType");var ve="pageSessionID";function we(){try{return new URLSearchParams(window.location.search).get(ve)||""}catch{return""}}o(we,"getPvId");function ye(t={}){let e=t.pvId||we();return{app_id:window.appId||"",tenant_id:window.tenantId||"",user_id:window.userId||"",did:_e(),module:"app_web",app_env:"runtime",source_type:"user",device_type:be(),release_commit_id:window.__RELEASE_COMMIT_ID__||"",...e?{pv_id:e}:{}}}o(ye,"getDefaultAttributes");function $(t){let e=Math.round(t);if(!Number.isFinite(e))throw new RangeError(`toNanoString: \u975E\u6CD5\u65F6\u95F4\u6233 ${t}`);return typeof BigInt!="function"?e===0?"0":`${e}000000`:String(BigInt(e)*BigInt(1e6))}o($,"toNanoString");var Te="1.0.2";function Ee(t,e){let r=ye(e),n=$(Date.now());return{metricsData:{resource:{attributes:{sdk_version:Te,sdk_lang:"javascript",sdk_type:"client-frontend"}},metrics:[{name:"apaas_internal_metrics_pv_uv",description:"Count of page views",unit:"",scopeName:"apaas_internal_metrics_pv_uv",sum:{aggregationTemporality:1,isMonotonic:!0,dataPoints:t.map(s=>({attributes:{...r,url:s.url,path:s.path,referrer:s.referrer},startTimeUnixNano:$(s.timestampMs),timeUnixNano:n,asDouble:1}))}}]}}}o(Ee,"buildPayload");function Se(t,e,r={},n){if(e.length===0)return;let s;try{s=JSON.stringify(Ee(e,n))}catch{return}try{fetch(t,{method:"POST",headers:{"Content-Type":"application/json","X-Suda-Csrf-Token":window.csrfToken||"",...r},body:s,keepalive:!0}).catch(()=>{})}catch{}}o(Se,"sendPvData");var A="__APAAS_PV_TRACKER_STARTED__";function Ae(){try{let t=window;return t[A]?!1:(t[A]=!0,!0)}catch{return!0}}o(Ae,"claimPvReporting");function U(){try{window[A]=!1}catch{}}o(U,"releasePvReporting");var g,Pe=(g=class{constructor(){this.started=!1,this.disposers=[],this.holdsPvReporting=!1,this.buffer=[]}static get instance(){return this._instance||(this._instance=new g),this._instance}start(e){var r;if(!this.started&&Ae()){this.holdsPvReporting=!0,this.config=e,this.started=!0;try{this.listenRouteChanges(),this.registerLifecycleListeners();let n=(r=e.flushIntervalMs)!=null?r:1e4;this.flushTimer=setInterval(()=>this.flush(),n)}catch(n){throw this.started=!1,this.flushTimer&&(clearInterval(this.flushTimer),this.flushTimer=void 0),this.holdsPvReporting=!1,U(),n}}}shutdown(){this.flush(),this.flushTimer&&(clearInterval(this.flushTimer),this.flushTimer=void 0),this.firstFlushTimer&&(clearTimeout(this.firstFlushTimer),this.firstFlushTimer=void 0),this.started=!1;for(let e of this.disposers.splice(0))try{e()}catch{}this.holdsPvReporting&&(this.holdsPvReporting=!1,U())}pageKey(){let{origin:e,pathname:r,search:n}=window.location;return`${e}${r}${n}`}scheduleFirstFlush(){var e;let r=(e=this.config)==null?void 0:e.firstFlushDelayMs;r==null||this.firstFlushTimer||(this.firstFlushTimer=setTimeout(()=>this.flush(),r))}recordPv(){let e=this.pageKey();this.lastKey!==e&&(this.lastKey=e,this.buffer.push({url:window.location.href,path:window.location.pathname,referrer:document.referrer,timestampMs:Date.now()}),this.scheduleFirstFlush())}flush(){if(!this.config||this.buffer.length===0)return;let e=this.buffer.splice(0);Se(this.config.collectorUrl,e,this.config.headers,{pvId:this.config.pvId})}listenRouteChanges(){this.recordPv();let e=o(()=>this.recordPv(),"onPopState");window.addEventListener("popstate",e),this.disposers.push(()=>window.removeEventListener("popstate",e)),this.patchHistory("pushState"),this.patchHistory("replaceState")}patchHistory(e){let r=history[e],n=o(()=>this.recordPv(),"recordPv");history[e]=function(...s){let i=r.apply(this,s);return n(),i},this.disposers.push(()=>{history[e]=r})}registerLifecycleListeners(){let e=o(()=>{document.visibilityState==="hidden"&&this.flush()},"onVisibilityChange");document.addEventListener("visibilitychange",e),this.disposers.push(()=>document.removeEventListener("visibilitychange",e));let r=o(()=>this.flush(),"onPageHide");window.addEventListener("pagehide",r),this.disposers.push(()=>window.removeEventListener("pagehide",r))}},o(g,"_PvTracker"),g),j=Pe.instance;function V(){return window.appId||null}o(V,"getAppId");function G(){var e;let t=(e=V())!=null?e:"";j.start({collectorUrl:`/app/${t}/__runtime__/api/v1/observability/metrics/collect`,firstFlushDelayMs:1e3})}o(G,"initCreativePvTracking");var Ie="0.0.21-beta.0",xe="@lark-apaas/miaoda-coding-sdk";window.__CREATIVITY_RUNTIME__||(window.__CREATIVITY_RUNTIME__=!0,B(),M(),N(),G(),x());return Y(De);})();
1
+ "use strict";var MiaodaRuntime=(()=>{var y=Object.defineProperty;var H=Object.getOwnPropertyDescriptor;var X=Object.getOwnPropertyNames;var q=Object.prototype.hasOwnProperty;var o=(t,e)=>y(t,"name",{value:e,configurable:!0});var K=(t,e)=>{for(var r in e)y(t,r,{get:e[r],enumerable:!0})},J=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of X(e))!q.call(t,s)&&s!==r&&y(t,s,{get:()=>e[s],enumerable:!(n=H(e,s))||n.enumerable});return t};var Y=t=>J(y({},"__esModule",{value:!0}),t);var De={};K(De,{name:()=>xe,version:()=>Ie});var z=new Set(["text/babel","text/jsx"]),Q=3e3,W=15e3,Z=1e3,ee=20,P=!1;function x(){P||(P=!0,document.addEventListener("DOMContentLoaded",te,{once:!0}))}o(x,"initCreativeBabelStages");function te(){var s;let t=re();if(!t.length)return;let e={fetchDur:0,transformDur:0,evalDur:0,externalCount:t.filter(i=>i.src).length,targets:((s=t.find(i=>i.hasAttribute("data-targets")))==null?void 0:s.getAttribute("data-targets"))||"none"},r={sent:!1,scriptsDone:!1,scriptsDoneAt:null,totalStart:null,renderStart:null,renderDur:null,takeover:!1,retries:0,hardTimer:null},n=window.Babel;if(!n||typeof n.transform!="function"||typeof n.disableScriptTags!="function"||e.externalCount>0&&typeof fetch!="function"){r.scriptsDone=!0,h(e,r);return}try{n.disableScriptTags()}catch{r.scriptsDone=!0,h(e,r);return}r.takeover=!0,r.totalStart=performance.now(),r.hardTimer=setTimeout(()=>h(e,r),W),oe(e,r),ie(n,t,e,r)}o(te,"onDomContentLoaded");function re(){let t=document.getElementsByTagName("script"),e=[];for(let r=0;r<t.length;r++){let n=t[r];z.has((n.type||"").split(";")[0])&&e.push(n)}return e}o(re,"collectBabelScripts");function S(t,e){let r=t.getAttribute(e);return r===""?[]:r?r.split(",").map(n=>n.trim()):null}o(S,"attrList");function ne(t,e){var s,i,a;let r=t.getAttribute("data-type"),n={browsers:(s=S(t,"data-targets"))!=null?s:void 0};return r==="module"&&(n.esmodules="intersect"),{filename:e,presets:(i=S(t,"data-presets"))!=null?i:r==="module"?["react",["env",{modules:!1}]]:["react","env"],plugins:(a=S(t,"data-plugins"))!=null?a:["transform-class-properties","transform-object-rest-spread","transform-flow-strip-types"],sourceMaps:"inline",sourceFileName:e,targets:n}}o(ne,"buildOptions");function ie(t,e,r,n){let s=0,i=o((l,d)=>{var m;let f;if(l.src)f=l.src;else{let p=l.getAttribute("data-module");p?f=p:(s++,f=s===1?"Inline Babel script":`Inline Babel script (${s})`)}try{let p=performance.now(),b=t.transform(d,ne(l,f)),v=performance.now(),_=document.createElement("script"),w=l.getAttribute("data-type");w&&_.setAttribute("type",w),l.nonce&&(_.nonce=l.nonce),_.text=(m=b==null?void 0:b.code)!=null?m:"",document.head.appendChild(_),r.transformDur+=v-p,r.evalDur+=performance.now()-v}catch(p){console.error("[creative-babel-stages] script failed:",f,p)}},"runOne"),a=0;for(;a<e.length&&!e[a].src;)i(e[a],e[a].innerHTML),a++;if(a>=e.length){I(r,n);return}let u=e.slice(a),c=u.map(l=>{if(!l.src)return Promise.resolve(l.innerHTML);let d=performance.now();return fetch(l.src).then(f=>{if(!f.ok)throw new Error(`HTTP ${f.status}`);return f.text()}).then(f=>(r.fetchDur+=performance.now()-d,f))});(async()=>{for(let l=0;l<u.length;l++){let d=null;try{d=await c[l]}catch(f){console.error("[creative-babel-stages] load failed:",u[l].src,f);continue}i(u[l],d)}I(r,n)})()}o(ie,"runScripts");function oe(t,e){let r=window.ReactDOM;if(!r)return;let n=o(a=>{if(e.renderStart===null){e.renderStart=performance.now();try{let u=new MutationObserver(()=>{u.disconnect(),e.renderDur=performance.now()-e.renderStart,e.scriptsDone&&h(t,e)});u.observe(a,{childList:!0,subtree:!0})}catch{}}},"observeCommit"),s=r.createRoot;typeof s=="function"&&(r.createRoot=(a,u)=>{let c=s.call(r,a,u),l=c.render.bind(c);return c.render=d=>(n(a),l(d)),c});let i=r.render;typeof i=="function"&&(r.render=(a,u,c)=>(n(u),i.call(r,a,u,c)))}o(oe,"instrumentRender");function I(t,e){e.scriptsDone=!0,e.scriptsDoneAt=performance.now(),e.renderStart===null||e.renderDur!==null?h(t,e):setTimeout(()=>h(t,e),Q)}o(I,"onScriptsDone");function h(t,e){var i;if(e.sent)return;let r=window.Slardar;if(!r){e.retries++<ee&&setTimeout(()=>h(t,e),Z);return}e.sent=!0,e.hardTimer!==null&&clearTimeout(e.hardTimer);let n=e.renderDur!==null&&e.renderStart!==null?e.renderStart+e.renderDur:(i=e.scriptsDoneAt)!=null?i:performance.now(),s=e.totalStart===null?0:Math.max(0,n-e.totalStart);r("sendEvent",{name:"creative_babel_stages",metrics:{babel_total_dur:Math.round(s),babel_fetch_dur:Math.round(t.fetchDur),babel_transform_dur:Math.round(t.transformDur),babel_eval_dur:Math.round(t.evalDur)},categories:{takeover:String(e.takeover),external:String(t.externalCount>0),render_observed:String(e.renderDur!==null),targets:t.targets}})}o(h,"trySend");var se='script[type="text/babel"],script[type="text/jsx"]',D=["transform-class-properties","transform-object-rest-spread","transform-flow-strip-types"],R=["transform-class-static-block","transform-class-properties","transform-private-methods","transform-private-property-in-object","transform-classes","transform-block-scoped-functions","transform-block-scoping"];var ae=/^(chrome|firefox|safari|ios_saf) (\d+)(?:\.(\d+))?$/;function M(){document.addEventListener("DOMContentLoaded",fe,{once:!0})}o(M,"initCreativeBabelTargets");function ce(t){let e=/\b(?:iPhone|iPad|iPod)\b.*? OS (\d+)(?:_(\d+))?/.exec(t);return e?{engine:"ios",version:[+e[1],+(e[2]||0)]}:/\bEdge\/\d/.test(t)?null:(e=/\bFirefox\/(\d+)/.exec(t),e?{engine:"firefox",version:[+e[1],0]}:(e=/Chrom(?:e|ium)\/(\d+)/.exec(t),e?{engine:"chrome",version:[+e[1],0]}:(e=/\bVersion\/(\d+)(?:\.(\d+))?.*\bSafari\//.exec(t),e?{engine:"safari",version:[+e[1],+(e[2]||0)]}:null)))}o(ce,"detectBrowserEngine");function ue(t,e){return t[0]-e[0]||t[1]-e[1]}o(ue,"compareVersion");function le(){let t=window.__creativeBabelTargets__;if(typeof t!="string"||t.length>200)return null;let e=[];for(let r of t.split(",")){let n=r.trim().toLowerCase().replace(/\s+/g," ");if(!n)continue;let s=ae.exec(n);if(!s)return null;e.push({query:n,engine:s[1]==="ios_saf"?"ios":s[1],version:[+s[2],+(s[3]||0)]})}return e.length?e:null}o(le,"readTargets");function de(t){let e=ce(navigator.userAgent||"");if(!e)return!1;let r=t.filter(n=>n.engine===e.engine);return r.length>0&&r.every(n=>ue(e.version,n.version)>=0)}o(de,"currentBrowserMeets");function C(t,e,r){let n=t.availablePlugins||{},s=o((a,u)=>a===u||n[a]!==void 0&&n[a]===n[u],"same"),i=e.slice();for(let a of r)i.some(u=>s(u,a))||i.push(a);return i}o(C,"appendPlugins");function fe(){let t=le();if(!t||!de(t))return;let e=window.Babel;if(!e||typeof e.transform!="function")return;let r=Array.from(document.querySelectorAll(se)).filter(i=>!i.hasAttribute("data-targets")&&!i.hasAttribute("data-presets")&&i.getAttribute("data-type")!=="module");if(!r.length)return;let n=t.map(i=>i.query);try{e.transform("",{presets:["react","env"],plugins:C(e,D,R),targets:{browsers:n}})}catch{return}let s=n.join(",");for(let i of r){let a=i.getAttribute("data-plugins"),u=a===null?D:a.split(",").map(c=>c.trim()).filter(Boolean);i.setAttribute("data-plugins",C(e,u,R).join(",")),i.setAttribute("data-targets",s)}}o(fe,"applyBabelTargets");var pe="https://lf3-short.ibytedapm.com/slardar/fe/sdk-web/browser.cn.js",me="miaoda:perf:fcp",k=!1;function N(){if(k)return;if(k=!0,he(),window.Slardar){L();return}let t=document.createElement("script");t.src=pe,t.onload=()=>{window.Slardar&&L()},t.onerror=()=>{},document.head.appendChild(t)}o(N,"initCreativePerf");function L(){var s,i,a;let t=window.Slardar;if(!t)return;let e=null;t("context.merge",{app_id:(s=window.__appId__)!=null?s:"",creative_type:(i=window.__creativeType__)!=null?i:"unknown",is_public:String((a=window.__isExternallyVisible__)!=null?a:!1)}),t("init",{bid:"apaas_miaoda",env:window.ENVIRONMENT||"online"}),t("start");try{new PerformanceObserver(u=>{for(let c of u.getEntries())if(c.name==="first-contentful-paint"){e=c.startTime,t("context.merge",{has_painted:"true"});break}}).observe({type:"paint",buffered:!0})}catch{}let r=!1,n=o(()=>{if(r||!window.Slardar)return;r=!0;let u=performance.getEntriesByType("resource"),c=performance.getEntriesByType("navigation")[0],l=e!=null?e:ge(),d={transfer_size:u.reduce((f,m)=>{var p;return f+((p=m.transferSize)!=null?p:0)},0)};c&&c.domContentLoadedEventEnd>=c.responseStart&&(d.ttfb_to_dom_ready_dur=Math.round(c.domContentLoadedEventEnd-c.responseStart)),c&&l!==null&&l>=c.domContentLoadedEventEnd&&(d.render_to_fcp_dur=Math.round(l-c.domContentLoadedEventEnd)),window.Slardar("sendEvent",{name:"creative_perf",metrics:d})},"send");window.addEventListener("load",()=>setTimeout(n,500)),setTimeout(n,15e3)}o(L,"bootstrap");function he(){if(window.parent===window||typeof performance.timeOrigin!="number")return;let t=!1;try{new PerformanceObserver(e=>{var r;if(!t)for(let n of e.getEntries()){if(n.name!=="first-contentful-paint")continue;t=!0;let s={type:me,fcpTime:performance.timeOrigin+n.startTime,creativeType:(r=window.__creativeType__)!=null?r:"unknown"};window.parent.postMessage(s,"*");break}}).observe({type:"paint",buffered:!0})}catch{}}o(he,"postFcpToParent");function ge(){var r;let e=performance.getEntriesByType("paint").find(n=>n.name==="first-contentful-paint");return(r=e==null?void 0:e.startTime)!=null?r:null}o(ge,"getBufferedFcpStartTime");function B(){let t="inspector-id";document.addEventListener("DOMContentLoaded",()=>{let e=window.Babel;if(!e||!e.registerPlugin)return;let r=null,n=o(()=>{let i={},a=0;return document.querySelectorAll('script[type="text/babel"],script[type="text/jsx"]').forEach(u=>{let c=u.getAttribute("src");if(c){let l=c.split("?")[0],d=l.split("/").pop()||l;i[d]=d in i?"":l}else{a++;let l=a===1?"Inline Babel script":`Inline Babel script (${a})`;i[l]=u.getAttribute("data-filename")||`inline-${a-1}`}}),i},"buildFileMap");e.availablePlugins&&delete e.availablePlugins[t],e.registerPlugin(t,({types:i})=>({visitor:{JSXOpeningElement(a,u){let c=a.node;if(c.name&&c.name.type==="JSXMemberExpression")return;for(let T=0;T<c.attributes.length;T++){let E=c.attributes[T];if(E.type==="JSXAttribute"&&E.name&&E.name.name==="data-inspector-id")return}let l=u.file&&u.file.opts&&u.file.opts.filename||"?";r===null&&(r=n());let d=l.split("?")[0],f=d.split("/").pop()||d,m=r[l]||r[f]||d.replace(/^\/?[a-z][a-z0-9+.-]*:\/{1,2}[^/]+/i,"").replace(/^\/+/,"")||l,p=c.loc&&c.loc.start,b=p?p.line:0,v=p?p.column+1:0,_=c.name&&c.name.type==="JSXIdentifier"?c.name.name:m,w=`jsx:${m}:${_}:${b}:${v}`;c.attributes.push(i.jsxAttribute(i.jsxIdentifier("data-inspector-id"),i.stringLiteral(w)))}}}));let s="";try{let i=document.getElementById("__srcmap");if(i&&i.textContent){let a=JSON.parse(i.textContent),u=a==null?void 0:a.file;typeof u=="string"&&(s=u)}}catch{}document.querySelectorAll('script[type="text/babel"],script[type="text/jsx"]').forEach((i,a)=>{let u=i.getAttribute("data-plugins")||"";if(u.indexOf(t)<0&&i.setAttribute("data-plugins",u?`${u},${t}`:t),!i.hasAttribute("data-filename")){let c=s?`${s}#inline-${a}`:`inline-${a}`;i.setAttribute("data-filename",i.getAttribute("src")||c)}})})}o(B,"registerInspectorIdPlugin");function O(){if(typeof crypto!="undefined"&&crypto.getRandomValues){let e=new Uint8Array(8);return crypto.getRandomValues(e),Array.from(e).map(r=>r.toString(16).padStart(2,"0")).join("")}let t="";for(let e=0;e<16;e++)t+=Math.floor(Math.random()*16).toString(16);return t}o(O,"generateUUID");var F="x_sdk_device_id";function _e(){try{let t=localStorage.getItem(F);return t||(t=O(),localStorage.setItem(F,t)),t}catch{return O()}}o(_e,"getDeviceId");function be(){let t=typeof navigator!="undefined"?navigator.userAgent:"";return t&&(/Android/i.test(t)&&/Mobile/i.test(t)||/iPhone|iPod/i.test(t)||/BlackBerry|IEMobile|Opera Mini/i.test(t))?"mobile":"desktop"}o(be,"getDeviceType");var ve="pageSessionID";function we(){try{return new URLSearchParams(window.location.search).get(ve)||""}catch{return""}}o(we,"getPvId");function ye(t={}){let e=t.pvId||we();return{app_id:window.appId||"",tenant_id:window.tenantId||"",user_id:window.userId||"",did:_e(),module:"app_web",app_env:"runtime",source_type:"user",device_type:be(),release_commit_id:window.__RELEASE_COMMIT_ID__||"",...e?{pv_id:e}:{}}}o(ye,"getDefaultAttributes");function $(t){let e=Math.round(t);if(!Number.isFinite(e))throw new RangeError(`toNanoString: \u975E\u6CD5\u65F6\u95F4\u6233 ${t}`);return typeof BigInt!="function"?e===0?"0":`${e}000000`:String(BigInt(e)*BigInt(1e6))}o($,"toNanoString");var Te="1.0.2";function Ee(t,e){let r=ye(e),n=$(Date.now());return{metricsData:{resource:{attributes:{sdk_version:Te,sdk_lang:"javascript",sdk_type:"client-frontend"}},metrics:[{name:"apaas_internal_metrics_pv_uv",description:"Count of page views",unit:"",scopeName:"apaas_internal_metrics_pv_uv",sum:{aggregationTemporality:1,isMonotonic:!0,dataPoints:t.map(s=>({attributes:{...r,url:s.url,path:s.path,referrer:s.referrer},startTimeUnixNano:$(s.timestampMs),timeUnixNano:n,asDouble:1}))}}]}}}o(Ee,"buildPayload");function Se(t,e,r={},n){if(e.length===0)return;let s;try{s=JSON.stringify(Ee(e,n))}catch{return}try{fetch(t,{method:"POST",headers:{"Content-Type":"application/json","X-Suda-Csrf-Token":window.csrfToken||"",...r},body:s,keepalive:!0}).catch(()=>{})}catch{}}o(Se,"sendPvData");var A="__APAAS_PV_TRACKER_STARTED__";function Ae(){try{let t=window;return t[A]?!1:(t[A]=!0,!0)}catch{return!0}}o(Ae,"claimPvReporting");function U(){try{window[A]=!1}catch{}}o(U,"releasePvReporting");var g,Pe=(g=class{constructor(){this.started=!1,this.disposers=[],this.holdsPvReporting=!1,this.buffer=[]}static get instance(){return this._instance||(this._instance=new g),this._instance}start(e){var r;if(!this.started&&Ae()){this.holdsPvReporting=!0,this.config=e,this.started=!0;try{this.listenRouteChanges(),this.registerLifecycleListeners();let n=(r=e.flushIntervalMs)!=null?r:1e4;this.flushTimer=setInterval(()=>this.flush(),n)}catch(n){throw this.started=!1,this.flushTimer&&(clearInterval(this.flushTimer),this.flushTimer=void 0),this.holdsPvReporting=!1,U(),n}}}shutdown(){this.flush(),this.flushTimer&&(clearInterval(this.flushTimer),this.flushTimer=void 0),this.firstFlushTimer&&(clearTimeout(this.firstFlushTimer),this.firstFlushTimer=void 0),this.started=!1;for(let e of this.disposers.splice(0))try{e()}catch{}this.holdsPvReporting&&(this.holdsPvReporting=!1,U())}pageKey(){let{origin:e,pathname:r,search:n}=window.location;return`${e}${r}${n}`}scheduleFirstFlush(){var e;let r=(e=this.config)==null?void 0:e.firstFlushDelayMs;r==null||this.firstFlushTimer||(this.firstFlushTimer=setTimeout(()=>this.flush(),r))}recordPv(){let e=this.pageKey();this.lastKey!==e&&(this.lastKey=e,this.buffer.push({url:window.location.href,path:window.location.pathname,referrer:document.referrer,timestampMs:Date.now()}),this.scheduleFirstFlush())}flush(){if(!this.config||this.buffer.length===0)return;let e=this.buffer.splice(0);Se(this.config.collectorUrl,e,this.config.headers,{pvId:this.config.pvId})}listenRouteChanges(){this.recordPv();let e=o(()=>this.recordPv(),"onPopState");window.addEventListener("popstate",e),this.disposers.push(()=>window.removeEventListener("popstate",e)),this.patchHistory("pushState"),this.patchHistory("replaceState")}patchHistory(e){let r=history[e],n=o(()=>this.recordPv(),"recordPv");history[e]=function(...s){let i=r.apply(this,s);return n(),i},this.disposers.push(()=>{history[e]=r})}registerLifecycleListeners(){let e=o(()=>{document.visibilityState==="hidden"&&this.flush()},"onVisibilityChange");document.addEventListener("visibilitychange",e),this.disposers.push(()=>document.removeEventListener("visibilitychange",e));let r=o(()=>this.flush(),"onPageHide");window.addEventListener("pagehide",r),this.disposers.push(()=>window.removeEventListener("pagehide",r))}},o(g,"_PvTracker"),g),j=Pe.instance;function V(){return window.appId||null}o(V,"getAppId");function G(){var e;let t=(e=V())!=null?e:"";j.start({collectorUrl:`/app/${t}/__runtime__/api/v1/observability/metrics/collect`,firstFlushDelayMs:1e3})}o(G,"initCreativePvTracking");var Ie="0.0.21",xe="@lark-apaas/miaoda-coding-sdk";window.__CREATIVITY_RUNTIME__||(window.__CREATIVITY_RUNTIME__=!0,B(),M(),N(),G(),x());return Y(De);})();
@@ -1710,7 +1710,7 @@ var MiaodaRuntime = (() => {
1710
1710
  return bootstrap.init(options);
1711
1711
  });
1712
1712
  state[key] = runtime;
1713
- var version = "0.0.21-beta.0";
1713
+ var version = "0.0.21";
1714
1714
  function init({
1715
1715
  iframe,
1716
1716
  nonce = hostNonce
@@ -1922,7 +1922,7 @@ var MiaodaRuntime = (() => {
1922
1922
  }
1923
1923
 
1924
1924
  // src/doubao-html-runtime.ts
1925
- var version2 = "0.0.21-beta.0";
1925
+ var version2 = "0.0.21";
1926
1926
  var name = "@lark-apaas/miaoda-coding-sdk";
1927
1927
  registerInspectorIdPlugin();
1928
1928
  initDoubaoHtmlShareHost();
@@ -1710,7 +1710,7 @@ var MiaodaRuntime = (() => {
1710
1710
  return bootstrap.init(options);
1711
1711
  });
1712
1712
  state[key] = runtime;
1713
- var version = "0.0.21-beta.0";
1713
+ var version = "0.0.21";
1714
1714
  function init({
1715
1715
  iframe,
1716
1716
  nonce = hostNonce
@@ -1922,7 +1922,7 @@ var MiaodaRuntime = (() => {
1922
1922
  }
1923
1923
 
1924
1924
  // src/doubao-html-runtime.ts
1925
- var version2 = "0.0.21-beta.0";
1925
+ var version2 = "0.0.21";
1926
1926
  var name = "@lark-apaas/miaoda-coding-sdk";
1927
1927
  registerInspectorIdPlugin();
1928
1928
  initDoubaoHtmlShareHost();
@@ -1 +1 @@
1
- "use strict";var MiaodaRuntime=(()=>{var Ne=Object.create;var M=Object.defineProperty;var Fe=Object.getOwnPropertyDescriptor;var He=Object.getOwnPropertyNames;var xe=Object.getPrototypeOf,Oe=Object.prototype.hasOwnProperty;var D=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),G=(t,e)=>{for(var o in e)M(t,o,{get:e[o],enumerable:!0})},Q=(t,e,o,h)=>{if(e&&typeof e=="object"||typeof e=="function")for(let l of He(e))!Oe.call(t,l)&&l!==o&&M(t,l,{get:()=>e[l],enumerable:!(h=Fe(e,l))||h.enumerable});return t};var Z=(t,e,o)=>(o=t!=null?Ne(xe(t)):{},Q(e||!t||!t.__esModule?M(o,"default",{value:t,enumerable:!0}):o,t)),De=t=>Q(M({},"__esModule",{value:!0}),t);var ee=D((Y,B)=>{"use strict";(function(t){"use strict";function e(n,m){var r=(n&65535)+(m&65535),I=(n>>16)+(m>>16)+(r>>16);return I<<16|r&65535}function o(n,m){return n<<m|n>>>32-m}function h(n,m,r,I,k,S){return e(o(e(e(m,n),e(I,S)),k),r)}function l(n,m,r,I,k,S,E){return h(m&r|~m&I,n,m,k,S,E)}function p(n,m,r,I,k,S,E){return h(m&I|r&~I,n,m,k,S,E)}function f(n,m,r,I,k,S,E){return h(m^r^I,n,m,k,S,E)}function g(n,m,r,I,k,S,E){return h(r^(m|~I),n,m,k,S,E)}function v(n,m){n[m>>5]|=128<<m%32,n[(m+64>>>9<<4)+14]=m;var r,I,k,S,E,c=1732584193,s=-271733879,d=-1732584194,a=271733878;for(r=0;r<n.length;r+=16)I=c,k=s,S=d,E=a,c=l(c,s,d,a,n[r],7,-680876936),a=l(a,c,s,d,n[r+1],12,-389564586),d=l(d,a,c,s,n[r+2],17,606105819),s=l(s,d,a,c,n[r+3],22,-1044525330),c=l(c,s,d,a,n[r+4],7,-176418897),a=l(a,c,s,d,n[r+5],12,1200080426),d=l(d,a,c,s,n[r+6],17,-1473231341),s=l(s,d,a,c,n[r+7],22,-45705983),c=l(c,s,d,a,n[r+8],7,1770035416),a=l(a,c,s,d,n[r+9],12,-1958414417),d=l(d,a,c,s,n[r+10],17,-42063),s=l(s,d,a,c,n[r+11],22,-1990404162),c=l(c,s,d,a,n[r+12],7,1804603682),a=l(a,c,s,d,n[r+13],12,-40341101),d=l(d,a,c,s,n[r+14],17,-1502002290),s=l(s,d,a,c,n[r+15],22,1236535329),c=p(c,s,d,a,n[r+1],5,-165796510),a=p(a,c,s,d,n[r+6],9,-1069501632),d=p(d,a,c,s,n[r+11],14,643717713),s=p(s,d,a,c,n[r],20,-373897302),c=p(c,s,d,a,n[r+5],5,-701558691),a=p(a,c,s,d,n[r+10],9,38016083),d=p(d,a,c,s,n[r+15],14,-660478335),s=p(s,d,a,c,n[r+4],20,-405537848),c=p(c,s,d,a,n[r+9],5,568446438),a=p(a,c,s,d,n[r+14],9,-1019803690),d=p(d,a,c,s,n[r+3],14,-187363961),s=p(s,d,a,c,n[r+8],20,1163531501),c=p(c,s,d,a,n[r+13],5,-1444681467),a=p(a,c,s,d,n[r+2],9,-51403784),d=p(d,a,c,s,n[r+7],14,1735328473),s=p(s,d,a,c,n[r+12],20,-1926607734),c=f(c,s,d,a,n[r+5],4,-378558),a=f(a,c,s,d,n[r+8],11,-2022574463),d=f(d,a,c,s,n[r+11],16,1839030562),s=f(s,d,a,c,n[r+14],23,-35309556),c=f(c,s,d,a,n[r+1],4,-1530992060),a=f(a,c,s,d,n[r+4],11,1272893353),d=f(d,a,c,s,n[r+7],16,-155497632),s=f(s,d,a,c,n[r+10],23,-1094730640),c=f(c,s,d,a,n[r+13],4,681279174),a=f(a,c,s,d,n[r],11,-358537222),d=f(d,a,c,s,n[r+3],16,-722521979),s=f(s,d,a,c,n[r+6],23,76029189),c=f(c,s,d,a,n[r+9],4,-640364487),a=f(a,c,s,d,n[r+12],11,-421815835),d=f(d,a,c,s,n[r+15],16,530742520),s=f(s,d,a,c,n[r+2],23,-995338651),c=g(c,s,d,a,n[r],6,-198630844),a=g(a,c,s,d,n[r+7],10,1126891415),d=g(d,a,c,s,n[r+14],15,-1416354905),s=g(s,d,a,c,n[r+5],21,-57434055),c=g(c,s,d,a,n[r+12],6,1700485571),a=g(a,c,s,d,n[r+3],10,-1894986606),d=g(d,a,c,s,n[r+10],15,-1051523),s=g(s,d,a,c,n[r+1],21,-2054922799),c=g(c,s,d,a,n[r+8],6,1873313359),a=g(a,c,s,d,n[r+15],10,-30611744),d=g(d,a,c,s,n[r+6],15,-1560198380),s=g(s,d,a,c,n[r+13],21,1309151649),c=g(c,s,d,a,n[r+4],6,-145523070),a=g(a,c,s,d,n[r+11],10,-1120210379),d=g(d,a,c,s,n[r+2],15,718787259),s=g(s,d,a,c,n[r+9],21,-343485551),c=e(c,I),s=e(s,k),d=e(d,S),a=e(a,E);return[c,s,d,a]}function L(n){var m,r="",I=n.length*32;for(m=0;m<I;m+=8)r+=String.fromCharCode(n[m>>5]>>>m%32&255);return r}function w(n){var m,r=[];for(r[(n.length>>2)-1]=void 0,m=0;m<r.length;m+=1)r[m]=0;var I=n.length*8;for(m=0;m<I;m+=8)r[m>>5]|=(n.charCodeAt(m/8)&255)<<m%32;return r}function C(n){return L(v(w(n),n.length*8))}function T(n,m){var r,I=w(n),k=[],S=[],E;for(k[15]=S[15]=void 0,I.length>16&&(I=v(I,n.length*8)),r=0;r<16;r+=1)k[r]=I[r]^909522486,S[r]=I[r]^1549556828;return E=v(k.concat(w(m)),512+m.length*8),L(v(S.concat(E),640))}function _(n){var m="0123456789abcdef",r="",I,k;for(k=0;k<n.length;k+=1)I=n.charCodeAt(k),r+=m.charAt(I>>>4&15)+m.charAt(I&15);return r}function R(n){return unescape(encodeURIComponent(n))}function i(n){return C(R(n))}function u(n){return _(i(n))}function b(n,m){return T(R(n),R(m))}function y(n,m){return _(b(n,m))}function P(n,m,r){return m?r?b(m,n):y(m,n):r?i(n):u(n)}typeof define=="function"&&define.amd?define(function(){return P}):typeof B=="object"&&B.exports?B.exports=P:t.md5=P})(Y)});var ne=D((N,te)=>{"use strict";(function(t,e){typeof N=="object"?te.exports=N=e():typeof define=="function"&&define.amd?define([],e):t.CryptoJS=e()})(N,function(){var t=t||(function(e,o){var h=Object.create||(function(){function i(){}return function(u){var b;return i.prototype=u,b=new i,i.prototype=null,b}})(),l={},p=l.lib={},f=p.Base=(function(){return{extend:function(i){var u=h(this);return i&&u.mixIn(i),(!u.hasOwnProperty("init")||this.init===u.init)&&(u.init=function(){u.$super.init.apply(this,arguments)}),u.init.prototype=u,u.$super=this,u},create:function(){var i=this.extend();return i.init.apply(i,arguments),i},init:function(){},mixIn:function(i){for(var u in i)i.hasOwnProperty(u)&&(this[u]=i[u]);i.hasOwnProperty("toString")&&(this.toString=i.toString)},clone:function(){return this.init.prototype.extend(this)}}})(),g=p.WordArray=f.extend({init:function(i,u){i=this.words=i||[],u!=o?this.sigBytes=u:this.sigBytes=i.length*4},toString:function(i){return(i||L).stringify(this)},concat:function(i){var u=this.words,b=i.words,y=this.sigBytes,P=i.sigBytes;if(this.clamp(),y%4)for(var n=0;n<P;n++){var m=b[n>>>2]>>>24-n%4*8&255;u[y+n>>>2]|=m<<24-(y+n)%4*8}else for(var n=0;n<P;n+=4)u[y+n>>>2]=b[n>>>2];return this.sigBytes+=P,this},clamp:function(){var i=this.words,u=this.sigBytes;i[u>>>2]&=4294967295<<32-u%4*8,i.length=e.ceil(u/4)},clone:function(){var i=f.clone.call(this);return i.words=this.words.slice(0),i},random:function(i){for(var u=[],b=(function(r){var r=r,I=987654321,k=4294967295;return function(){I=36969*(I&65535)+(I>>16)&k,r=18e3*(r&65535)+(r>>16)&k;var S=(I<<16)+r&k;return S/=4294967296,S+=.5,S*(e.random()>.5?1:-1)}}),y=0,P;y<i;y+=4){var n=b((P||e.random())*4294967296);P=n()*987654071,u.push(n()*4294967296|0)}return new g.init(u,i)}}),v=l.enc={},L=v.Hex={stringify:function(i){for(var u=i.words,b=i.sigBytes,y=[],P=0;P<b;P++){var n=u[P>>>2]>>>24-P%4*8&255;y.push((n>>>4).toString(16)),y.push((n&15).toString(16))}return y.join("")},parse:function(i){for(var u=i.length,b=[],y=0;y<u;y+=2)b[y>>>3]|=parseInt(i.substr(y,2),16)<<24-y%8*4;return new g.init(b,u/2)}},w=v.Latin1={stringify:function(i){for(var u=i.words,b=i.sigBytes,y=[],P=0;P<b;P++){var n=u[P>>>2]>>>24-P%4*8&255;y.push(String.fromCharCode(n))}return y.join("")},parse:function(i){for(var u=i.length,b=[],y=0;y<u;y++)b[y>>>2]|=(i.charCodeAt(y)&255)<<24-y%4*8;return new g.init(b,u)}},C=v.Utf8={stringify:function(i){try{return decodeURIComponent(escape(w.stringify(i)))}catch{throw new Error("Malformed UTF-8 data")}},parse:function(i){return w.parse(unescape(encodeURIComponent(i)))}},T=p.BufferedBlockAlgorithm=f.extend({reset:function(){this._data=new g.init,this._nDataBytes=0},_append:function(i){typeof i=="string"&&(i=C.parse(i)),this._data.concat(i),this._nDataBytes+=i.sigBytes},_process:function(i){var u=this._data,b=u.words,y=u.sigBytes,P=this.blockSize,n=P*4,m=y/n;i?m=e.ceil(m):m=e.max((m|0)-this._minBufferSize,0);var r=m*P,I=e.min(r*4,y);if(r){for(var k=0;k<r;k+=P)this._doProcessBlock(b,k);var S=b.splice(0,r);u.sigBytes-=I}return new g.init(S,I)},clone:function(){var i=f.clone.call(this);return i._data=this._data.clone(),i},_minBufferSize:0}),_=p.Hasher=T.extend({cfg:f.extend(),init:function(i){this.cfg=this.cfg.extend(i),this.reset()},reset:function(){T.reset.call(this),this._doReset()},update:function(i){return this._append(i),this._process(),this},finalize:function(i){i&&this._append(i);var u=this._doFinalize();return u},blockSize:512/32,_createHelper:function(i){return function(u,b){return new i.init(b).finalize(u)}},_createHmacHelper:function(i){return function(u,b){return new R.HMAC.init(i,b).finalize(u)}}}),R=l.algo={};return l})(Math);return t})});var oe=D((F,re)=>{"use strict";(function(t,e){typeof F=="object"?re.exports=F=e(ne()):typeof define=="function"&&define.amd?define(["./core"],e):e(t.CryptoJS)})(F,function(t){return(function(){var e=t,o=e.lib,h=o.WordArray,l=o.Hasher,p=e.algo,f=[],g=p.SHA1=l.extend({_doReset:function(){this._hash=new h.init([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(v,L){for(var w=this._hash.words,C=w[0],T=w[1],_=w[2],R=w[3],i=w[4],u=0;u<80;u++){if(u<16)f[u]=v[L+u]|0;else{var b=f[u-3]^f[u-8]^f[u-14]^f[u-16];f[u]=b<<1|b>>>31}var y=(C<<5|C>>>27)+i+f[u];u<20?y+=(T&_|~T&R)+1518500249:u<40?y+=(T^_^R)+1859775393:u<60?y+=(T&_|T&R|_&R)-1894007588:y+=(T^_^R)-899497514,i=R,R=_,_=T<<30|T>>>2,T=C,C=y}w[0]=w[0]+C|0,w[1]=w[1]+T|0,w[2]=w[2]+_|0,w[3]=w[3]+R|0,w[4]=w[4]+i|0},_doFinalize:function(){var v=this._data,L=v.words,w=this._nDataBytes*8,C=v.sigBytes*8;return L[C>>>5]|=128<<24-C%32,L[(C+64>>>9<<4)+14]=Math.floor(w/4294967296),L[(C+64>>>9<<4)+15]=w,v.sigBytes=L.length*4,this._process(),this._hash},clone:function(){var v=l.clone.call(this);return v._hash=this._hash.clone(),v}});e.SHA1=l._createHelper(g),e.HmacSHA1=l._createHmacHelper(g)})(),t.SHA1})});var wt={};G(wt,{TrackKey:()=>V,comments:()=>O,name:()=>vt,reportTeaEvent:()=>j,version:()=>gt});var ue=Z(ee(),1),fe=Z(oe(),1);function A(){return window.appId||null}function U(){var o;let t="suda-csrf-token",e=document.cookie.split("; ");for(let h of e){let[l,p]=h.split("=");if(l===t)return decodeURIComponent(p)}return(o=window.csrfToken)!=null?o:null}function $(){let t=globalThis.CLIENT_BASE_PATH||"/";return/^\/app\/[^/]/.test(t)}function ie(){switch(globalThis.ENVIRONMENT){case"gray":return"PRE";case"online":return"ONLINE";default:return"BOE"}}function se(){return window.appEnv!=null?window.appEnv==="runtime":!0}function ae(){let t=navigator.userAgent,e=/(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i.test(t),o=/iPad|Tab|Tablet/i.test(t)&&navigator.maxTouchPoints>1;return e||o}async function ce(){var h;let t=A();if(!t)return{code:1,msg:"appId is required",data:{}};let e=$()?`/app/${t}/__runtime__/api/v1/studio/lark/user_info`:`/spark/b/${t}/lark/user_info`;return await(await fetch(e,{headers:{"X-Suda-Csrf-Token":(h=U())!=null?h:""}})).json()}var V={VIEW:"aily_agent_artifact_page_view"},Ue="08a441",$e="42b91e";function de(t){let e=String(t);return(0,fe.default)(Ue+(0,ue.default)(e+$e)).toString()}var W=!1;async function We(){var p,f,g,v;let{data:t}=await ce(),{tenantID:e,userID:o}=t||{},h=o&&o!=="0"?de(o):void 0,l=e&&e!=="0"?de(e):void 0;(p=window.collectEvent)==null||p.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}),(g=window.collectEvent)==null||g.call(window,"config",{user_unique_id:h,device_type:ae()?"mobile":"pc",evtParams:{open_from:(f=new URLSearchParams(window.location.search).get("open-from"))!=null?f:void 0,env:ie(),user_id:h,tenant_id:l}}),W=!0,(v=window.collectEvent)==null||v.call(window,"start")}async function j({trackKey:t,trackParams:e={}}){var o;try{W||(W=!0,await We()),(o=window.collectEvent)==null||o.call(window,t,e)}catch(h){console.error(h)}}function le(){return j({trackKey:V.VIEW,trackParams:{artifact_uid:A(),agent_id:"agent_miaoda",url:window.location.href}})}function pe(){if(typeof crypto!="undefined"&&crypto.getRandomValues){let e=new Uint8Array(8);return crypto.getRandomValues(e),Array.from(e).map(o=>o.toString(16).padStart(2,"0")).join("")}let t="";for(let e=0;e<16;e++)t+=Math.floor(Math.random()*16).toString(16);return t}var me="x_sdk_device_id";function Ve(){try{let t=localStorage.getItem(me);return t||(t=pe(),localStorage.setItem(me,t)),t}catch{return pe()}}function je(){let t=typeof navigator!="undefined"?navigator.userAgent:"";return t&&(/Android/i.test(t)&&/Mobile/i.test(t)||/iPhone|iPod/i.test(t)||/BlackBerry|IEMobile|Opera Mini/i.test(t))?"mobile":"desktop"}var ze="pageSessionID";function Je(){try{return new URLSearchParams(window.location.search).get(ze)||""}catch{return""}}function Xe(t={}){let e=t.pvId||Je();return{app_id:window.appId||"",tenant_id:window.tenantId||"",user_id:window.userId||"",did:Ve(),module:"app_web",app_env:"runtime",source_type:"user",device_type:je(),release_commit_id:window.__RELEASE_COMMIT_ID__||"",...e?{pv_id:e}:{}}}function he(t){let e=Math.round(t);if(!Number.isFinite(e))throw new RangeError(`toNanoString: \u975E\u6CD5\u65F6\u95F4\u6233 ${t}`);return typeof BigInt!="function"?e===0?"0":`${e}000000`:String(BigInt(e)*BigInt(1e6))}var Ke="1.0.2";function qe(t,e){let o=Xe(e),h=he(Date.now());return{metricsData:{resource:{attributes:{sdk_version:Ke,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:t.map(l=>({attributes:{...o,url:l.url,path:l.path,referrer:l.referrer},startTimeUnixNano:he(l.timestampMs),timeUnixNano:h,asDouble:1}))}}]}}}function Ge(t,e,o={},h){if(e.length===0)return;let l;try{l=JSON.stringify(qe(e,h))}catch{return}try{fetch(t,{method:"POST",headers:{"Content-Type":"application/json","X-Suda-Csrf-Token":window.csrfToken||"",...o},body:l,keepalive:!0}).catch(()=>{})}catch{}}var z="__APAAS_PV_TRACKER_STARTED__";function Qe(){try{let t=window;return t[z]?!1:(t[z]=!0,!0)}catch{return!0}}function ge(){try{window[z]=!1}catch{}}var Ze=class ve{constructor(){this.started=!1,this.disposers=[],this.holdsPvReporting=!1,this.buffer=[]}static get instance(){return this._instance||(this._instance=new ve),this._instance}start(e){var o;if(!this.started&&Qe()){this.holdsPvReporting=!0,this.config=e,this.started=!0;try{this.listenRouteChanges(),this.registerLifecycleListeners();let h=(o=e.flushIntervalMs)!=null?o:1e4;this.flushTimer=setInterval(()=>this.flush(),h)}catch(h){throw this.started=!1,this.flushTimer&&(clearInterval(this.flushTimer),this.flushTimer=void 0),this.holdsPvReporting=!1,ge(),h}}}shutdown(){this.flush(),this.flushTimer&&(clearInterval(this.flushTimer),this.flushTimer=void 0),this.firstFlushTimer&&(clearTimeout(this.firstFlushTimer),this.firstFlushTimer=void 0),this.started=!1;for(let e of this.disposers.splice(0))try{e()}catch{}this.holdsPvReporting&&(this.holdsPvReporting=!1,ge())}pageKey(){let{origin:e,pathname:o,search:h}=window.location;return`${e}${o}${h}`}scheduleFirstFlush(){var e;let o=(e=this.config)==null?void 0:e.firstFlushDelayMs;o==null||this.firstFlushTimer||(this.firstFlushTimer=setTimeout(()=>this.flush(),o))}recordPv(){let e=this.pageKey();this.lastKey!==e&&(this.lastKey=e,this.buffer.push({url:window.location.href,path:window.location.pathname,referrer:document.referrer,timestampMs:Date.now()}),this.scheduleFirstFlush())}flush(){if(!this.config||this.buffer.length===0)return;let e=this.buffer.splice(0);Ge(this.config.collectorUrl,e,this.config.headers,{pvId:this.config.pvId})}listenRouteChanges(){this.recordPv();let e=()=>this.recordPv();window.addEventListener("popstate",e),this.disposers.push(()=>window.removeEventListener("popstate",e)),this.patchHistory("pushState"),this.patchHistory("replaceState")}patchHistory(e){let o=history[e],h=()=>this.recordPv();history[e]=function(...l){let p=o.apply(this,l);return h(),p},this.disposers.push(()=>{history[e]=o})}registerLifecycleListeners(){let e=()=>{document.visibilityState==="hidden"&&this.flush()};document.addEventListener("visibilitychange",e),this.disposers.push(()=>document.removeEventListener("visibilitychange",e));let o=()=>this.flush();window.addEventListener("pagehide",o),this.disposers.push(()=>window.removeEventListener("pagehide",o))}},we=Ze.instance;function ye(){var o;let t=(o=A())!=null?o:"",e=$()?`/app/${t}/__runtime__/api/v1/observability/metrics/collect`:`/spark/app/${t}/runtime/api/v1/observability/metrics/collect`;we.start({collectorUrl:e})}var Ye=/\bLark\//i;function _e(){var e,o,h,l;let t=window;return typeof((h=(o=(e=t.webkit)==null?void 0:e.messageHandlers)==null?void 0:o.invokeNative)==null?void 0:h.postMessage)=="function"||typeof((l=t.Lark_Bridge)==null?void 0:l.invokeNative)=="function"?!0:Ye.test(navigator.userAgent)}function be({messageIds:t,token:e,docType:o=113}){var g,v;if(t.length===0||!e)return!1;let h={apiName:"markMiaodaFeedMessagesRead",data:{__v2__:!0,messageIds:t.map(String),token:e,docType:o}},l=window,p=(v=(g=l.webkit)==null?void 0:g.messageHandlers)==null?void 0:v.invokeNative;if(p!=null&&p.postMessage)return p.postMessage(h),!0;let f=l.Lark_Bridge;return f!=null&&f.invokeNative?(f.invokeNative(JSON.stringify(h)),!0):!1}var et=113,tt="/app/",nt="/__runtime__/api/v1/devops/read_lark_messages";function rt(t){if(!t||typeof t!="object")return[];let{data:e}=t;return Array.isArray(e)?e.map(String):e&&Array.isArray(e.message_ids)?e.message_ids.map(String):[]}var Ie=!1;async function ot(t){var h;let e=await fetch(`${tt}${t}${nt}`,{method:"POST",credentials:"same-origin",headers:{"Content-Type":"application/json","X-Suda-Csrf-Token":(h=U())!=null?h:""}});if(!e.ok)return[];let o=await e.json();return rt(o)}async function Se(){if(Ie||!_e())return;Ie=!0;let t=A();if(t)try{let e=await ot(t);if(!e.length)return;be({messageIds:e,token:t,docType:et})}catch{}}function Ee(){let t="inspector-id";document.addEventListener("DOMContentLoaded",()=>{let e=window.Babel;if(!e||!e.registerPlugin)return;let o=null,h=()=>{let p={},f=0;return document.querySelectorAll('script[type="text/babel"],script[type="text/jsx"]').forEach(g=>{let v=g.getAttribute("src");if(v){let L=v.split("?")[0],w=L.split("/").pop()||L;p[w]=w in p?"":L}else{f++;let L=f===1?"Inline Babel script":`Inline Babel script (${f})`;p[L]=g.getAttribute("data-filename")||`inline-${f-1}`}}),p};e.availablePlugins&&delete e.availablePlugins[t],e.registerPlugin(t,({types:p})=>({visitor:{JSXOpeningElement(f,g){let v=f.node;if(v.name&&v.name.type==="JSXMemberExpression")return;for(let y=0;y<v.attributes.length;y++){let P=v.attributes[y];if(P.type==="JSXAttribute"&&P.name&&P.name.name==="data-inspector-id")return}let L=g.file&&g.file.opts&&g.file.opts.filename||"?";o===null&&(o=h());let w=L.split("?")[0],C=w.split("/").pop()||w,T=o[L]||o[C]||w.replace(/^\/?[a-z][a-z0-9+.-]*:\/{1,2}[^/]+/i,"").replace(/^\/+/,"")||L,_=v.loc&&v.loc.start,R=_?_.line:0,i=_?_.column+1:0,u=v.name&&v.name.type==="JSXIdentifier"?v.name.name:T,b=`jsx:${T}:${u}:${R}:${i}`;v.attributes.push(p.jsxAttribute(p.jsxIdentifier("data-inspector-id"),p.stringLiteral(b)))}}}));let l="";try{let p=document.getElementById("__srcmap");if(p&&p.textContent){let f=JSON.parse(p.textContent),g=f==null?void 0:f.file;typeof g=="string"&&(l=g)}}catch{}document.querySelectorAll('script[type="text/babel"],script[type="text/jsx"]').forEach((p,f)=>{let g=p.getAttribute("data-plugins")||"";if(g.indexOf(t)<0&&p.setAttribute("data-plugins",g?`${g},${t}`:t),!p.hasAttribute("data-filename")){let v=l?`${l}#inline-${f}`:`inline-${f}`;p.setAttribute("data-filename",p.getAttribute("src")||v)}})})}var O={};G(O,{destroy:()=>ut,init:()=>X,version:()=>dt});var it=new Set(["https://comment.feishuapp.cn","https://comment.aiforce.cloud","https://comment.doubaoapps.com","https://comment.feishu.link","https://comment.feishuapp.com","https://comment.doubaowork.link","https://comment.doubao.link"]);function H(t,e){try{let o=new URL(t.src,document.URL);return!t.isConnected||t.hasAttribute("srcdoc")||!(e?o.origin===e:it.has(o.origin))||o.username||o.password?void 0:o}catch{return}}function x(){try{let t=window.__miaodaCommentIframeOrigin__;if(!t)return;let e=new URL(t);return e.protocol==="https:"&&!e.username&&!e.password&&e.origin===t?t:void 0}catch{return}}var ke="ccm-comment-bootstrap",st=x();function Ce(){return(t,e,o)=>{let h=H(t,st);return h?new Promise((l,p)=>{var C;let f=()=>{clearTimeout(w),window.removeEventListener("message",L),o.removeEventListener("abort",v)},g=T=>{f(),p(T)},v=()=>g(new Error("Comment session destroyed")),L=T=>{let _=T.data;if(T.source!==t.contentWindow||T.origin!==h.origin||(_==null?void 0:_.channel)!==ke||_.version!==1||_.type!=="waiting"||_.bootstrapSource===void 0)return;if(typeof _.bootstrapSource!="string"||!_.bootstrapSource.length||_.bootstrapSource.length>65536||typeof _.bootstrapVersion!="string"||!/^\d+\.\d+\.\d+(?:-[a-zA-Z0-9]+(?:\.[a-zA-Z0-9]+)*)?$/.test(_.bootstrapVersion)||_.bootstrapVersion.length>64||typeof _.buildId!="string"||!_.buildId.length||_.buildId.length>128){g(new Error("Invalid comment bootstrap payload"));return}f();let R=window,i=R.CCMCommentBootstrap,u=document.createElement("script");e&&(u.nonce=e),u.textContent=_.bootstrapSource;try{R.CCMCommentBootstrap=void 0,document.head.appendChild(u);let b=R.CCMCommentBootstrap;if(!b||typeof b.init!="function"||b.version!==_.bootstrapVersion||b.buildId!==_.buildId)throw new Error("Comment bootstrap blocked or version/buildId mismatch");l(b)}catch(b){R.CCMCommentBootstrap=i,p(b)}finally{u.remove()}},w=setTimeout(()=>g(new Error("Comment bootstrap announcement timed out")),15e3);if(window.addEventListener("message",L),o.addEventListener("abort",v,{once:!0}),o.aborted){v();return}(C=t.contentWindow)==null||C.postMessage({channel:ke,version:1,type:"request-bootstrap"},h.origin)}):Promise.reject(new Error("Untrusted comment iframe"))}}function Pe(t){let e;function o(){e==null||e.session.destroy()}function h(l){let{iframe:p}=l;if(!(p instanceof HTMLIFrameElement))throw new Error("A comment iframe is required");if((e==null?void 0:e.iframe)===p)return e.session;o();let f=new AbortController,g,v=new Promise((C,T)=>{let _=()=>{i(),C()},R=()=>{i(),T(new Error("Comment session destroyed"))},i=()=>{document.removeEventListener("DOMContentLoaded",_),f.signal.removeEventListener("abort",R)};f.signal.addEventListener("abort",R,{once:!0}),document.readyState==="loading"?document.addEventListener("DOMContentLoaded",_,{once:!0}):_()}).then(async()=>{if(f.signal.aborted)throw new Error("Comment session destroyed");let C=await t(l,f.signal);if(g=C,f.signal.aborted)throw C.destroy(),new Error("Comment session destroyed");return C.ready}),L=C=>{C.persisted||w.destroy()},w={ready:v,destroy(){f.abort(),g==null||g.destroy(),window.removeEventListener("pagehide",L),(e==null?void 0:e.session)===w&&(e=void 0)}};return e={iframe:p,session:w},window.addEventListener("pagehide",L),v.catch(()=>w.destroy()),w}return{init:h,destroy:o}}var at=document.currentScript instanceof HTMLScriptElement?document.currentScript.nonce:void 0,Te="__miaodaCommentRuntime__",Re=window,ct=Ce(),Le,J=(Le=Re[Te])!=null?Le:Pe(async(t,e)=>{let o=await ct(t.iframe,t.nonce,e);if(e.aborted)throw new Error("Comment session destroyed");return o.init(t)});Re[Te]=J;var dt="0.0.21-beta.0";function X({iframe:t,nonce:e=at}){return J.init({iframe:t,nonce:e})}var ut=J.destroy;function Ae(){let t=()=>{let e=document.getElementById("miaoda-html-comment");if(e instanceof HTMLIFrameElement)try{X({iframe:e}).ready.catch(o=>{console.warn("[MiaodaComments] initialization failed",o)})}catch(o){console.warn("[MiaodaComments] initialization failed",o)}};document.readyState==="loading"?document.addEventListener("DOMContentLoaded",t,{once:!0}):t()}var ft=/^[MmLlHhVvCcSsQqTtAaZz0-9.,\- ]+$/,lt=/^app_[a-zA-Z0-9]+$/;function Me(t){return typeof t=="string"&&lt.test(t)?t:""}function pt(t,e){try{let o=new URL(String(t)),h=e?"https://accounts.doubao.com":"https://open.feishu.cn",l=e?"/authorize":"/open-apis/authen/v1/authorize";return o.protocol==="https:"&&!o.username&&!o.password&&o.origin===h&&o.pathname===l?o.href:""}catch{return""}}function mt(t){if(!t||typeof t!="object")return!1;let e=t;return[e.top,e.right,e.bottom,e.left].every(o=>typeof o=="number"&&Number.isFinite(o)&&o>=0)}function ht(t,e={}){var m,r,I,k;let o=H(t,e.trustedOrigin);if(!o)return()=>{};let h=(m=e.location)!=null?m:window.location,l=(r=e.fetch)!=null?r:window.fetch.bind(window),p=(I=e.navigate)!=null?I:(S=>window.location.assign(S)),f=Me((k=e.appId)!=null?k:window.appId),g=document.documentElement,v=g.style.getPropertyValue("overflow"),L=g.style.getPropertyPriority("overflow"),w=!1,C=!1,T=!1,_=!1,R=()=>{var S;(S=t.contentWindow)==null||S.postMessage({type:"ccm-share-init",pageUrl:h.href},o.origin)},i=S=>{S&&!w?(w=!0,g.style.setProperty("overflow","hidden")):!S&&w&&(w=!1,v?g.style.setProperty("overflow",v,L):g.style.removeProperty("overflow"))},u=async()=>{var s;if(C||!f)return;let S=h.hostname.toLowerCase(),E=S.endsWith(".doubao.link"),c=S.endsWith(".feishu.link");if(!(!E&&!c)){C=!0;try{let d=E?`${o.origin}/iframe/login?app_id=${encodeURIComponent(f)}&redirect_uri=${encodeURIComponent(h.href)}`:`/app/${encodeURIComponent(f)}/__runtime__/api/v1/account/login/url?acceptedPolicy=true&redirectURI=${encodeURIComponent(h.href)}`,a=await l(d,{credentials:"include",cache:"no-store"});if(!a.ok)throw new Error("LOGIN_URL_REQUEST_FAILED");let K=await a.json(),q=pt(K.status_code==="0"?(s=K.data)==null?void 0:s.loginURL:void 0,E);if(!q)throw new Error("INVALID_LOGIN_URL");p(q)}catch{C=!1}}},b=()=>{T||!f||(T=!0,p(`/app/${encodeURIComponent(f)}/runtime/page/logout?redirect=${encodeURIComponent(h.href)}`))},y=S=>{if(S.source!==t.contentWindow||S.origin!==o.origin)return;let E=S.data||{};if(E.version===1&&E.type==="ccm-share-login"){u();return}if(E.version===1&&E.type==="ccm-share-logout"){b();return}if(E.type==="ccm-share-ready"){R();return}if(E.type==="ccm-share-clip"){if(E.mode==="none")t.style.clipPath="none";else if(E.mode==="inset"&&mt(E.rect)){let{top:c,right:s,bottom:d,left:a}=E.rect;t.style.clipPath=`inset(${c}px ${s}px ${d}px ${a}px)`}else E.mode==="path"&&typeof E.path=="string"&&ft.test(E.path)&&(t.style.clipPath=`path("${E.path}")`);return}E.type==="ccm-share-scroll-lock"&&typeof E.locked=="boolean"&&i(E.locked)},P=()=>{_||(_=!0,t.removeEventListener("load",R),window.removeEventListener("message",y),window.removeEventListener("pagehide",n),i(!1))},n=S=>{S.persisted||P()};return t.addEventListener("load",R),window.addEventListener("message",y),window.addEventListener("pagehide",n),R(),P}function Be(t={}){let e=Me(window.appId),o=x();if(!e||!o)return()=>{};let h=!1,l=()=>{},p=()=>{if(h)return;let f=document.getElementById("miaoda-html-comment");f instanceof HTMLIFrameElement&&(l=ht(f,{...t,appId:e,trustedOrigin:o}))};return document.readyState==="loading"?document.addEventListener("DOMContentLoaded",p,{once:!0}):p(),()=>{h=!0,document.removeEventListener("DOMContentLoaded",p),l()}}var gt="0.0.21-beta.0",vt="@lark-apaas/miaoda-coding-sdk";Ee();Be();se()&&(le(),ye());Se();Ae();return De(wt);})();
1
+ "use strict";var MiaodaRuntime=(()=>{var Ne=Object.create;var M=Object.defineProperty;var Fe=Object.getOwnPropertyDescriptor;var He=Object.getOwnPropertyNames;var xe=Object.getPrototypeOf,Oe=Object.prototype.hasOwnProperty;var D=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),G=(t,e)=>{for(var o in e)M(t,o,{get:e[o],enumerable:!0})},Q=(t,e,o,h)=>{if(e&&typeof e=="object"||typeof e=="function")for(let l of He(e))!Oe.call(t,l)&&l!==o&&M(t,l,{get:()=>e[l],enumerable:!(h=Fe(e,l))||h.enumerable});return t};var Z=(t,e,o)=>(o=t!=null?Ne(xe(t)):{},Q(e||!t||!t.__esModule?M(o,"default",{value:t,enumerable:!0}):o,t)),De=t=>Q(M({},"__esModule",{value:!0}),t);var ee=D((Y,B)=>{"use strict";(function(t){"use strict";function e(n,m){var r=(n&65535)+(m&65535),I=(n>>16)+(m>>16)+(r>>16);return I<<16|r&65535}function o(n,m){return n<<m|n>>>32-m}function h(n,m,r,I,k,S){return e(o(e(e(m,n),e(I,S)),k),r)}function l(n,m,r,I,k,S,E){return h(m&r|~m&I,n,m,k,S,E)}function p(n,m,r,I,k,S,E){return h(m&I|r&~I,n,m,k,S,E)}function f(n,m,r,I,k,S,E){return h(m^r^I,n,m,k,S,E)}function g(n,m,r,I,k,S,E){return h(r^(m|~I),n,m,k,S,E)}function v(n,m){n[m>>5]|=128<<m%32,n[(m+64>>>9<<4)+14]=m;var r,I,k,S,E,c=1732584193,s=-271733879,d=-1732584194,a=271733878;for(r=0;r<n.length;r+=16)I=c,k=s,S=d,E=a,c=l(c,s,d,a,n[r],7,-680876936),a=l(a,c,s,d,n[r+1],12,-389564586),d=l(d,a,c,s,n[r+2],17,606105819),s=l(s,d,a,c,n[r+3],22,-1044525330),c=l(c,s,d,a,n[r+4],7,-176418897),a=l(a,c,s,d,n[r+5],12,1200080426),d=l(d,a,c,s,n[r+6],17,-1473231341),s=l(s,d,a,c,n[r+7],22,-45705983),c=l(c,s,d,a,n[r+8],7,1770035416),a=l(a,c,s,d,n[r+9],12,-1958414417),d=l(d,a,c,s,n[r+10],17,-42063),s=l(s,d,a,c,n[r+11],22,-1990404162),c=l(c,s,d,a,n[r+12],7,1804603682),a=l(a,c,s,d,n[r+13],12,-40341101),d=l(d,a,c,s,n[r+14],17,-1502002290),s=l(s,d,a,c,n[r+15],22,1236535329),c=p(c,s,d,a,n[r+1],5,-165796510),a=p(a,c,s,d,n[r+6],9,-1069501632),d=p(d,a,c,s,n[r+11],14,643717713),s=p(s,d,a,c,n[r],20,-373897302),c=p(c,s,d,a,n[r+5],5,-701558691),a=p(a,c,s,d,n[r+10],9,38016083),d=p(d,a,c,s,n[r+15],14,-660478335),s=p(s,d,a,c,n[r+4],20,-405537848),c=p(c,s,d,a,n[r+9],5,568446438),a=p(a,c,s,d,n[r+14],9,-1019803690),d=p(d,a,c,s,n[r+3],14,-187363961),s=p(s,d,a,c,n[r+8],20,1163531501),c=p(c,s,d,a,n[r+13],5,-1444681467),a=p(a,c,s,d,n[r+2],9,-51403784),d=p(d,a,c,s,n[r+7],14,1735328473),s=p(s,d,a,c,n[r+12],20,-1926607734),c=f(c,s,d,a,n[r+5],4,-378558),a=f(a,c,s,d,n[r+8],11,-2022574463),d=f(d,a,c,s,n[r+11],16,1839030562),s=f(s,d,a,c,n[r+14],23,-35309556),c=f(c,s,d,a,n[r+1],4,-1530992060),a=f(a,c,s,d,n[r+4],11,1272893353),d=f(d,a,c,s,n[r+7],16,-155497632),s=f(s,d,a,c,n[r+10],23,-1094730640),c=f(c,s,d,a,n[r+13],4,681279174),a=f(a,c,s,d,n[r],11,-358537222),d=f(d,a,c,s,n[r+3],16,-722521979),s=f(s,d,a,c,n[r+6],23,76029189),c=f(c,s,d,a,n[r+9],4,-640364487),a=f(a,c,s,d,n[r+12],11,-421815835),d=f(d,a,c,s,n[r+15],16,530742520),s=f(s,d,a,c,n[r+2],23,-995338651),c=g(c,s,d,a,n[r],6,-198630844),a=g(a,c,s,d,n[r+7],10,1126891415),d=g(d,a,c,s,n[r+14],15,-1416354905),s=g(s,d,a,c,n[r+5],21,-57434055),c=g(c,s,d,a,n[r+12],6,1700485571),a=g(a,c,s,d,n[r+3],10,-1894986606),d=g(d,a,c,s,n[r+10],15,-1051523),s=g(s,d,a,c,n[r+1],21,-2054922799),c=g(c,s,d,a,n[r+8],6,1873313359),a=g(a,c,s,d,n[r+15],10,-30611744),d=g(d,a,c,s,n[r+6],15,-1560198380),s=g(s,d,a,c,n[r+13],21,1309151649),c=g(c,s,d,a,n[r+4],6,-145523070),a=g(a,c,s,d,n[r+11],10,-1120210379),d=g(d,a,c,s,n[r+2],15,718787259),s=g(s,d,a,c,n[r+9],21,-343485551),c=e(c,I),s=e(s,k),d=e(d,S),a=e(a,E);return[c,s,d,a]}function L(n){var m,r="",I=n.length*32;for(m=0;m<I;m+=8)r+=String.fromCharCode(n[m>>5]>>>m%32&255);return r}function w(n){var m,r=[];for(r[(n.length>>2)-1]=void 0,m=0;m<r.length;m+=1)r[m]=0;var I=n.length*8;for(m=0;m<I;m+=8)r[m>>5]|=(n.charCodeAt(m/8)&255)<<m%32;return r}function C(n){return L(v(w(n),n.length*8))}function T(n,m){var r,I=w(n),k=[],S=[],E;for(k[15]=S[15]=void 0,I.length>16&&(I=v(I,n.length*8)),r=0;r<16;r+=1)k[r]=I[r]^909522486,S[r]=I[r]^1549556828;return E=v(k.concat(w(m)),512+m.length*8),L(v(S.concat(E),640))}function _(n){var m="0123456789abcdef",r="",I,k;for(k=0;k<n.length;k+=1)I=n.charCodeAt(k),r+=m.charAt(I>>>4&15)+m.charAt(I&15);return r}function R(n){return unescape(encodeURIComponent(n))}function i(n){return C(R(n))}function u(n){return _(i(n))}function b(n,m){return T(R(n),R(m))}function y(n,m){return _(b(n,m))}function P(n,m,r){return m?r?b(m,n):y(m,n):r?i(n):u(n)}typeof define=="function"&&define.amd?define(function(){return P}):typeof B=="object"&&B.exports?B.exports=P:t.md5=P})(Y)});var ne=D((N,te)=>{"use strict";(function(t,e){typeof N=="object"?te.exports=N=e():typeof define=="function"&&define.amd?define([],e):t.CryptoJS=e()})(N,function(){var t=t||(function(e,o){var h=Object.create||(function(){function i(){}return function(u){var b;return i.prototype=u,b=new i,i.prototype=null,b}})(),l={},p=l.lib={},f=p.Base=(function(){return{extend:function(i){var u=h(this);return i&&u.mixIn(i),(!u.hasOwnProperty("init")||this.init===u.init)&&(u.init=function(){u.$super.init.apply(this,arguments)}),u.init.prototype=u,u.$super=this,u},create:function(){var i=this.extend();return i.init.apply(i,arguments),i},init:function(){},mixIn:function(i){for(var u in i)i.hasOwnProperty(u)&&(this[u]=i[u]);i.hasOwnProperty("toString")&&(this.toString=i.toString)},clone:function(){return this.init.prototype.extend(this)}}})(),g=p.WordArray=f.extend({init:function(i,u){i=this.words=i||[],u!=o?this.sigBytes=u:this.sigBytes=i.length*4},toString:function(i){return(i||L).stringify(this)},concat:function(i){var u=this.words,b=i.words,y=this.sigBytes,P=i.sigBytes;if(this.clamp(),y%4)for(var n=0;n<P;n++){var m=b[n>>>2]>>>24-n%4*8&255;u[y+n>>>2]|=m<<24-(y+n)%4*8}else for(var n=0;n<P;n+=4)u[y+n>>>2]=b[n>>>2];return this.sigBytes+=P,this},clamp:function(){var i=this.words,u=this.sigBytes;i[u>>>2]&=4294967295<<32-u%4*8,i.length=e.ceil(u/4)},clone:function(){var i=f.clone.call(this);return i.words=this.words.slice(0),i},random:function(i){for(var u=[],b=(function(r){var r=r,I=987654321,k=4294967295;return function(){I=36969*(I&65535)+(I>>16)&k,r=18e3*(r&65535)+(r>>16)&k;var S=(I<<16)+r&k;return S/=4294967296,S+=.5,S*(e.random()>.5?1:-1)}}),y=0,P;y<i;y+=4){var n=b((P||e.random())*4294967296);P=n()*987654071,u.push(n()*4294967296|0)}return new g.init(u,i)}}),v=l.enc={},L=v.Hex={stringify:function(i){for(var u=i.words,b=i.sigBytes,y=[],P=0;P<b;P++){var n=u[P>>>2]>>>24-P%4*8&255;y.push((n>>>4).toString(16)),y.push((n&15).toString(16))}return y.join("")},parse:function(i){for(var u=i.length,b=[],y=0;y<u;y+=2)b[y>>>3]|=parseInt(i.substr(y,2),16)<<24-y%8*4;return new g.init(b,u/2)}},w=v.Latin1={stringify:function(i){for(var u=i.words,b=i.sigBytes,y=[],P=0;P<b;P++){var n=u[P>>>2]>>>24-P%4*8&255;y.push(String.fromCharCode(n))}return y.join("")},parse:function(i){for(var u=i.length,b=[],y=0;y<u;y++)b[y>>>2]|=(i.charCodeAt(y)&255)<<24-y%4*8;return new g.init(b,u)}},C=v.Utf8={stringify:function(i){try{return decodeURIComponent(escape(w.stringify(i)))}catch{throw new Error("Malformed UTF-8 data")}},parse:function(i){return w.parse(unescape(encodeURIComponent(i)))}},T=p.BufferedBlockAlgorithm=f.extend({reset:function(){this._data=new g.init,this._nDataBytes=0},_append:function(i){typeof i=="string"&&(i=C.parse(i)),this._data.concat(i),this._nDataBytes+=i.sigBytes},_process:function(i){var u=this._data,b=u.words,y=u.sigBytes,P=this.blockSize,n=P*4,m=y/n;i?m=e.ceil(m):m=e.max((m|0)-this._minBufferSize,0);var r=m*P,I=e.min(r*4,y);if(r){for(var k=0;k<r;k+=P)this._doProcessBlock(b,k);var S=b.splice(0,r);u.sigBytes-=I}return new g.init(S,I)},clone:function(){var i=f.clone.call(this);return i._data=this._data.clone(),i},_minBufferSize:0}),_=p.Hasher=T.extend({cfg:f.extend(),init:function(i){this.cfg=this.cfg.extend(i),this.reset()},reset:function(){T.reset.call(this),this._doReset()},update:function(i){return this._append(i),this._process(),this},finalize:function(i){i&&this._append(i);var u=this._doFinalize();return u},blockSize:512/32,_createHelper:function(i){return function(u,b){return new i.init(b).finalize(u)}},_createHmacHelper:function(i){return function(u,b){return new R.HMAC.init(i,b).finalize(u)}}}),R=l.algo={};return l})(Math);return t})});var oe=D((F,re)=>{"use strict";(function(t,e){typeof F=="object"?re.exports=F=e(ne()):typeof define=="function"&&define.amd?define(["./core"],e):e(t.CryptoJS)})(F,function(t){return(function(){var e=t,o=e.lib,h=o.WordArray,l=o.Hasher,p=e.algo,f=[],g=p.SHA1=l.extend({_doReset:function(){this._hash=new h.init([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(v,L){for(var w=this._hash.words,C=w[0],T=w[1],_=w[2],R=w[3],i=w[4],u=0;u<80;u++){if(u<16)f[u]=v[L+u]|0;else{var b=f[u-3]^f[u-8]^f[u-14]^f[u-16];f[u]=b<<1|b>>>31}var y=(C<<5|C>>>27)+i+f[u];u<20?y+=(T&_|~T&R)+1518500249:u<40?y+=(T^_^R)+1859775393:u<60?y+=(T&_|T&R|_&R)-1894007588:y+=(T^_^R)-899497514,i=R,R=_,_=T<<30|T>>>2,T=C,C=y}w[0]=w[0]+C|0,w[1]=w[1]+T|0,w[2]=w[2]+_|0,w[3]=w[3]+R|0,w[4]=w[4]+i|0},_doFinalize:function(){var v=this._data,L=v.words,w=this._nDataBytes*8,C=v.sigBytes*8;return L[C>>>5]|=128<<24-C%32,L[(C+64>>>9<<4)+14]=Math.floor(w/4294967296),L[(C+64>>>9<<4)+15]=w,v.sigBytes=L.length*4,this._process(),this._hash},clone:function(){var v=l.clone.call(this);return v._hash=this._hash.clone(),v}});e.SHA1=l._createHelper(g),e.HmacSHA1=l._createHmacHelper(g)})(),t.SHA1})});var wt={};G(wt,{TrackKey:()=>V,comments:()=>O,name:()=>vt,reportTeaEvent:()=>j,version:()=>gt});var ue=Z(ee(),1),fe=Z(oe(),1);function A(){return window.appId||null}function U(){var o;let t="suda-csrf-token",e=document.cookie.split("; ");for(let h of e){let[l,p]=h.split("=");if(l===t)return decodeURIComponent(p)}return(o=window.csrfToken)!=null?o:null}function $(){let t=globalThis.CLIENT_BASE_PATH||"/";return/^\/app\/[^/]/.test(t)}function ie(){switch(globalThis.ENVIRONMENT){case"gray":return"PRE";case"online":return"ONLINE";default:return"BOE"}}function se(){return window.appEnv!=null?window.appEnv==="runtime":!0}function ae(){let t=navigator.userAgent,e=/(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i.test(t),o=/iPad|Tab|Tablet/i.test(t)&&navigator.maxTouchPoints>1;return e||o}async function ce(){var h;let t=A();if(!t)return{code:1,msg:"appId is required",data:{}};let e=$()?`/app/${t}/__runtime__/api/v1/studio/lark/user_info`:`/spark/b/${t}/lark/user_info`;return await(await fetch(e,{headers:{"X-Suda-Csrf-Token":(h=U())!=null?h:""}})).json()}var V={VIEW:"aily_agent_artifact_page_view"},Ue="08a441",$e="42b91e";function de(t){let e=String(t);return(0,fe.default)(Ue+(0,ue.default)(e+$e)).toString()}var W=!1;async function We(){var p,f,g,v;let{data:t}=await ce(),{tenantID:e,userID:o}=t||{},h=o&&o!=="0"?de(o):void 0,l=e&&e!=="0"?de(e):void 0;(p=window.collectEvent)==null||p.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}),(g=window.collectEvent)==null||g.call(window,"config",{user_unique_id:h,device_type:ae()?"mobile":"pc",evtParams:{open_from:(f=new URLSearchParams(window.location.search).get("open-from"))!=null?f:void 0,env:ie(),user_id:h,tenant_id:l}}),W=!0,(v=window.collectEvent)==null||v.call(window,"start")}async function j({trackKey:t,trackParams:e={}}){var o;try{W||(W=!0,await We()),(o=window.collectEvent)==null||o.call(window,t,e)}catch(h){console.error(h)}}function le(){return j({trackKey:V.VIEW,trackParams:{artifact_uid:A(),agent_id:"agent_miaoda",url:window.location.href}})}function pe(){if(typeof crypto!="undefined"&&crypto.getRandomValues){let e=new Uint8Array(8);return crypto.getRandomValues(e),Array.from(e).map(o=>o.toString(16).padStart(2,"0")).join("")}let t="";for(let e=0;e<16;e++)t+=Math.floor(Math.random()*16).toString(16);return t}var me="x_sdk_device_id";function Ve(){try{let t=localStorage.getItem(me);return t||(t=pe(),localStorage.setItem(me,t)),t}catch{return pe()}}function je(){let t=typeof navigator!="undefined"?navigator.userAgent:"";return t&&(/Android/i.test(t)&&/Mobile/i.test(t)||/iPhone|iPod/i.test(t)||/BlackBerry|IEMobile|Opera Mini/i.test(t))?"mobile":"desktop"}var ze="pageSessionID";function Je(){try{return new URLSearchParams(window.location.search).get(ze)||""}catch{return""}}function Xe(t={}){let e=t.pvId||Je();return{app_id:window.appId||"",tenant_id:window.tenantId||"",user_id:window.userId||"",did:Ve(),module:"app_web",app_env:"runtime",source_type:"user",device_type:je(),release_commit_id:window.__RELEASE_COMMIT_ID__||"",...e?{pv_id:e}:{}}}function he(t){let e=Math.round(t);if(!Number.isFinite(e))throw new RangeError(`toNanoString: \u975E\u6CD5\u65F6\u95F4\u6233 ${t}`);return typeof BigInt!="function"?e===0?"0":`${e}000000`:String(BigInt(e)*BigInt(1e6))}var Ke="1.0.2";function qe(t,e){let o=Xe(e),h=he(Date.now());return{metricsData:{resource:{attributes:{sdk_version:Ke,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:t.map(l=>({attributes:{...o,url:l.url,path:l.path,referrer:l.referrer},startTimeUnixNano:he(l.timestampMs),timeUnixNano:h,asDouble:1}))}}]}}}function Ge(t,e,o={},h){if(e.length===0)return;let l;try{l=JSON.stringify(qe(e,h))}catch{return}try{fetch(t,{method:"POST",headers:{"Content-Type":"application/json","X-Suda-Csrf-Token":window.csrfToken||"",...o},body:l,keepalive:!0}).catch(()=>{})}catch{}}var z="__APAAS_PV_TRACKER_STARTED__";function Qe(){try{let t=window;return t[z]?!1:(t[z]=!0,!0)}catch{return!0}}function ge(){try{window[z]=!1}catch{}}var Ze=class ve{constructor(){this.started=!1,this.disposers=[],this.holdsPvReporting=!1,this.buffer=[]}static get instance(){return this._instance||(this._instance=new ve),this._instance}start(e){var o;if(!this.started&&Qe()){this.holdsPvReporting=!0,this.config=e,this.started=!0;try{this.listenRouteChanges(),this.registerLifecycleListeners();let h=(o=e.flushIntervalMs)!=null?o:1e4;this.flushTimer=setInterval(()=>this.flush(),h)}catch(h){throw this.started=!1,this.flushTimer&&(clearInterval(this.flushTimer),this.flushTimer=void 0),this.holdsPvReporting=!1,ge(),h}}}shutdown(){this.flush(),this.flushTimer&&(clearInterval(this.flushTimer),this.flushTimer=void 0),this.firstFlushTimer&&(clearTimeout(this.firstFlushTimer),this.firstFlushTimer=void 0),this.started=!1;for(let e of this.disposers.splice(0))try{e()}catch{}this.holdsPvReporting&&(this.holdsPvReporting=!1,ge())}pageKey(){let{origin:e,pathname:o,search:h}=window.location;return`${e}${o}${h}`}scheduleFirstFlush(){var e;let o=(e=this.config)==null?void 0:e.firstFlushDelayMs;o==null||this.firstFlushTimer||(this.firstFlushTimer=setTimeout(()=>this.flush(),o))}recordPv(){let e=this.pageKey();this.lastKey!==e&&(this.lastKey=e,this.buffer.push({url:window.location.href,path:window.location.pathname,referrer:document.referrer,timestampMs:Date.now()}),this.scheduleFirstFlush())}flush(){if(!this.config||this.buffer.length===0)return;let e=this.buffer.splice(0);Ge(this.config.collectorUrl,e,this.config.headers,{pvId:this.config.pvId})}listenRouteChanges(){this.recordPv();let e=()=>this.recordPv();window.addEventListener("popstate",e),this.disposers.push(()=>window.removeEventListener("popstate",e)),this.patchHistory("pushState"),this.patchHistory("replaceState")}patchHistory(e){let o=history[e],h=()=>this.recordPv();history[e]=function(...l){let p=o.apply(this,l);return h(),p},this.disposers.push(()=>{history[e]=o})}registerLifecycleListeners(){let e=()=>{document.visibilityState==="hidden"&&this.flush()};document.addEventListener("visibilitychange",e),this.disposers.push(()=>document.removeEventListener("visibilitychange",e));let o=()=>this.flush();window.addEventListener("pagehide",o),this.disposers.push(()=>window.removeEventListener("pagehide",o))}},we=Ze.instance;function ye(){var o;let t=(o=A())!=null?o:"",e=$()?`/app/${t}/__runtime__/api/v1/observability/metrics/collect`:`/spark/app/${t}/runtime/api/v1/observability/metrics/collect`;we.start({collectorUrl:e})}var Ye=/\bLark\//i;function _e(){var e,o,h,l;let t=window;return typeof((h=(o=(e=t.webkit)==null?void 0:e.messageHandlers)==null?void 0:o.invokeNative)==null?void 0:h.postMessage)=="function"||typeof((l=t.Lark_Bridge)==null?void 0:l.invokeNative)=="function"?!0:Ye.test(navigator.userAgent)}function be({messageIds:t,token:e,docType:o=113}){var g,v;if(t.length===0||!e)return!1;let h={apiName:"markMiaodaFeedMessagesRead",data:{__v2__:!0,messageIds:t.map(String),token:e,docType:o}},l=window,p=(v=(g=l.webkit)==null?void 0:g.messageHandlers)==null?void 0:v.invokeNative;if(p!=null&&p.postMessage)return p.postMessage(h),!0;let f=l.Lark_Bridge;return f!=null&&f.invokeNative?(f.invokeNative(JSON.stringify(h)),!0):!1}var et=113,tt="/app/",nt="/__runtime__/api/v1/devops/read_lark_messages";function rt(t){if(!t||typeof t!="object")return[];let{data:e}=t;return Array.isArray(e)?e.map(String):e&&Array.isArray(e.message_ids)?e.message_ids.map(String):[]}var Ie=!1;async function ot(t){var h;let e=await fetch(`${tt}${t}${nt}`,{method:"POST",credentials:"same-origin",headers:{"Content-Type":"application/json","X-Suda-Csrf-Token":(h=U())!=null?h:""}});if(!e.ok)return[];let o=await e.json();return rt(o)}async function Se(){if(Ie||!_e())return;Ie=!0;let t=A();if(t)try{let e=await ot(t);if(!e.length)return;be({messageIds:e,token:t,docType:et})}catch{}}function Ee(){let t="inspector-id";document.addEventListener("DOMContentLoaded",()=>{let e=window.Babel;if(!e||!e.registerPlugin)return;let o=null,h=()=>{let p={},f=0;return document.querySelectorAll('script[type="text/babel"],script[type="text/jsx"]').forEach(g=>{let v=g.getAttribute("src");if(v){let L=v.split("?")[0],w=L.split("/").pop()||L;p[w]=w in p?"":L}else{f++;let L=f===1?"Inline Babel script":`Inline Babel script (${f})`;p[L]=g.getAttribute("data-filename")||`inline-${f-1}`}}),p};e.availablePlugins&&delete e.availablePlugins[t],e.registerPlugin(t,({types:p})=>({visitor:{JSXOpeningElement(f,g){let v=f.node;if(v.name&&v.name.type==="JSXMemberExpression")return;for(let y=0;y<v.attributes.length;y++){let P=v.attributes[y];if(P.type==="JSXAttribute"&&P.name&&P.name.name==="data-inspector-id")return}let L=g.file&&g.file.opts&&g.file.opts.filename||"?";o===null&&(o=h());let w=L.split("?")[0],C=w.split("/").pop()||w,T=o[L]||o[C]||w.replace(/^\/?[a-z][a-z0-9+.-]*:\/{1,2}[^/]+/i,"").replace(/^\/+/,"")||L,_=v.loc&&v.loc.start,R=_?_.line:0,i=_?_.column+1:0,u=v.name&&v.name.type==="JSXIdentifier"?v.name.name:T,b=`jsx:${T}:${u}:${R}:${i}`;v.attributes.push(p.jsxAttribute(p.jsxIdentifier("data-inspector-id"),p.stringLiteral(b)))}}}));let l="";try{let p=document.getElementById("__srcmap");if(p&&p.textContent){let f=JSON.parse(p.textContent),g=f==null?void 0:f.file;typeof g=="string"&&(l=g)}}catch{}document.querySelectorAll('script[type="text/babel"],script[type="text/jsx"]').forEach((p,f)=>{let g=p.getAttribute("data-plugins")||"";if(g.indexOf(t)<0&&p.setAttribute("data-plugins",g?`${g},${t}`:t),!p.hasAttribute("data-filename")){let v=l?`${l}#inline-${f}`:`inline-${f}`;p.setAttribute("data-filename",p.getAttribute("src")||v)}})})}var O={};G(O,{destroy:()=>ut,init:()=>X,version:()=>dt});var it=new Set(["https://comment.feishuapp.cn","https://comment.aiforce.cloud","https://comment.doubaoapps.com","https://comment.feishu.link","https://comment.feishuapp.com","https://comment.doubaowork.link","https://comment.doubao.link"]);function H(t,e){try{let o=new URL(t.src,document.URL);return!t.isConnected||t.hasAttribute("srcdoc")||!(e?o.origin===e:it.has(o.origin))||o.username||o.password?void 0:o}catch{return}}function x(){try{let t=window.__miaodaCommentIframeOrigin__;if(!t)return;let e=new URL(t);return e.protocol==="https:"&&!e.username&&!e.password&&e.origin===t?t:void 0}catch{return}}var ke="ccm-comment-bootstrap",st=x();function Ce(){return(t,e,o)=>{let h=H(t,st);return h?new Promise((l,p)=>{var C;let f=()=>{clearTimeout(w),window.removeEventListener("message",L),o.removeEventListener("abort",v)},g=T=>{f(),p(T)},v=()=>g(new Error("Comment session destroyed")),L=T=>{let _=T.data;if(T.source!==t.contentWindow||T.origin!==h.origin||(_==null?void 0:_.channel)!==ke||_.version!==1||_.type!=="waiting"||_.bootstrapSource===void 0)return;if(typeof _.bootstrapSource!="string"||!_.bootstrapSource.length||_.bootstrapSource.length>65536||typeof _.bootstrapVersion!="string"||!/^\d+\.\d+\.\d+(?:-[a-zA-Z0-9]+(?:\.[a-zA-Z0-9]+)*)?$/.test(_.bootstrapVersion)||_.bootstrapVersion.length>64||typeof _.buildId!="string"||!_.buildId.length||_.buildId.length>128){g(new Error("Invalid comment bootstrap payload"));return}f();let R=window,i=R.CCMCommentBootstrap,u=document.createElement("script");e&&(u.nonce=e),u.textContent=_.bootstrapSource;try{R.CCMCommentBootstrap=void 0,document.head.appendChild(u);let b=R.CCMCommentBootstrap;if(!b||typeof b.init!="function"||b.version!==_.bootstrapVersion||b.buildId!==_.buildId)throw new Error("Comment bootstrap blocked or version/buildId mismatch");l(b)}catch(b){R.CCMCommentBootstrap=i,p(b)}finally{u.remove()}},w=setTimeout(()=>g(new Error("Comment bootstrap announcement timed out")),15e3);if(window.addEventListener("message",L),o.addEventListener("abort",v,{once:!0}),o.aborted){v();return}(C=t.contentWindow)==null||C.postMessage({channel:ke,version:1,type:"request-bootstrap"},h.origin)}):Promise.reject(new Error("Untrusted comment iframe"))}}function Pe(t){let e;function o(){e==null||e.session.destroy()}function h(l){let{iframe:p}=l;if(!(p instanceof HTMLIFrameElement))throw new Error("A comment iframe is required");if((e==null?void 0:e.iframe)===p)return e.session;o();let f=new AbortController,g,v=new Promise((C,T)=>{let _=()=>{i(),C()},R=()=>{i(),T(new Error("Comment session destroyed"))},i=()=>{document.removeEventListener("DOMContentLoaded",_),f.signal.removeEventListener("abort",R)};f.signal.addEventListener("abort",R,{once:!0}),document.readyState==="loading"?document.addEventListener("DOMContentLoaded",_,{once:!0}):_()}).then(async()=>{if(f.signal.aborted)throw new Error("Comment session destroyed");let C=await t(l,f.signal);if(g=C,f.signal.aborted)throw C.destroy(),new Error("Comment session destroyed");return C.ready}),L=C=>{C.persisted||w.destroy()},w={ready:v,destroy(){f.abort(),g==null||g.destroy(),window.removeEventListener("pagehide",L),(e==null?void 0:e.session)===w&&(e=void 0)}};return e={iframe:p,session:w},window.addEventListener("pagehide",L),v.catch(()=>w.destroy()),w}return{init:h,destroy:o}}var at=document.currentScript instanceof HTMLScriptElement?document.currentScript.nonce:void 0,Te="__miaodaCommentRuntime__",Re=window,ct=Ce(),Le,J=(Le=Re[Te])!=null?Le:Pe(async(t,e)=>{let o=await ct(t.iframe,t.nonce,e);if(e.aborted)throw new Error("Comment session destroyed");return o.init(t)});Re[Te]=J;var dt="0.0.21";function X({iframe:t,nonce:e=at}){return J.init({iframe:t,nonce:e})}var ut=J.destroy;function Ae(){let t=()=>{let e=document.getElementById("miaoda-html-comment");if(e instanceof HTMLIFrameElement)try{X({iframe:e}).ready.catch(o=>{console.warn("[MiaodaComments] initialization failed",o)})}catch(o){console.warn("[MiaodaComments] initialization failed",o)}};document.readyState==="loading"?document.addEventListener("DOMContentLoaded",t,{once:!0}):t()}var ft=/^[MmLlHhVvCcSsQqTtAaZz0-9.,\- ]+$/,lt=/^app_[a-zA-Z0-9]+$/;function Me(t){return typeof t=="string"&&lt.test(t)?t:""}function pt(t,e){try{let o=new URL(String(t)),h=e?"https://accounts.doubao.com":"https://open.feishu.cn",l=e?"/authorize":"/open-apis/authen/v1/authorize";return o.protocol==="https:"&&!o.username&&!o.password&&o.origin===h&&o.pathname===l?o.href:""}catch{return""}}function mt(t){if(!t||typeof t!="object")return!1;let e=t;return[e.top,e.right,e.bottom,e.left].every(o=>typeof o=="number"&&Number.isFinite(o)&&o>=0)}function ht(t,e={}){var m,r,I,k;let o=H(t,e.trustedOrigin);if(!o)return()=>{};let h=(m=e.location)!=null?m:window.location,l=(r=e.fetch)!=null?r:window.fetch.bind(window),p=(I=e.navigate)!=null?I:(S=>window.location.assign(S)),f=Me((k=e.appId)!=null?k:window.appId),g=document.documentElement,v=g.style.getPropertyValue("overflow"),L=g.style.getPropertyPriority("overflow"),w=!1,C=!1,T=!1,_=!1,R=()=>{var S;(S=t.contentWindow)==null||S.postMessage({type:"ccm-share-init",pageUrl:h.href},o.origin)},i=S=>{S&&!w?(w=!0,g.style.setProperty("overflow","hidden")):!S&&w&&(w=!1,v?g.style.setProperty("overflow",v,L):g.style.removeProperty("overflow"))},u=async()=>{var s;if(C||!f)return;let S=h.hostname.toLowerCase(),E=S.endsWith(".doubao.link"),c=S.endsWith(".feishu.link");if(!(!E&&!c)){C=!0;try{let d=E?`${o.origin}/iframe/login?app_id=${encodeURIComponent(f)}&redirect_uri=${encodeURIComponent(h.href)}`:`/app/${encodeURIComponent(f)}/__runtime__/api/v1/account/login/url?acceptedPolicy=true&redirectURI=${encodeURIComponent(h.href)}`,a=await l(d,{credentials:"include",cache:"no-store"});if(!a.ok)throw new Error("LOGIN_URL_REQUEST_FAILED");let K=await a.json(),q=pt(K.status_code==="0"?(s=K.data)==null?void 0:s.loginURL:void 0,E);if(!q)throw new Error("INVALID_LOGIN_URL");p(q)}catch{C=!1}}},b=()=>{T||!f||(T=!0,p(`/app/${encodeURIComponent(f)}/runtime/page/logout?redirect=${encodeURIComponent(h.href)}`))},y=S=>{if(S.source!==t.contentWindow||S.origin!==o.origin)return;let E=S.data||{};if(E.version===1&&E.type==="ccm-share-login"){u();return}if(E.version===1&&E.type==="ccm-share-logout"){b();return}if(E.type==="ccm-share-ready"){R();return}if(E.type==="ccm-share-clip"){if(E.mode==="none")t.style.clipPath="none";else if(E.mode==="inset"&&mt(E.rect)){let{top:c,right:s,bottom:d,left:a}=E.rect;t.style.clipPath=`inset(${c}px ${s}px ${d}px ${a}px)`}else E.mode==="path"&&typeof E.path=="string"&&ft.test(E.path)&&(t.style.clipPath=`path("${E.path}")`);return}E.type==="ccm-share-scroll-lock"&&typeof E.locked=="boolean"&&i(E.locked)},P=()=>{_||(_=!0,t.removeEventListener("load",R),window.removeEventListener("message",y),window.removeEventListener("pagehide",n),i(!1))},n=S=>{S.persisted||P()};return t.addEventListener("load",R),window.addEventListener("message",y),window.addEventListener("pagehide",n),R(),P}function Be(t={}){let e=Me(window.appId),o=x();if(!e||!o)return()=>{};let h=!1,l=()=>{},p=()=>{if(h)return;let f=document.getElementById("miaoda-html-comment");f instanceof HTMLIFrameElement&&(l=ht(f,{...t,appId:e,trustedOrigin:o}))};return document.readyState==="loading"?document.addEventListener("DOMContentLoaded",p,{once:!0}):p(),()=>{h=!0,document.removeEventListener("DOMContentLoaded",p),l()}}var gt="0.0.21",vt="@lark-apaas/miaoda-coding-sdk";Ee();Be();se()&&(le(),ye());Se();Ae();return De(wt);})();
@@ -1954,7 +1954,7 @@ var MiaodaRuntime = (() => {
1954
1954
  __name(mountDoubaoWatermark, "mountDoubaoWatermark");
1955
1955
 
1956
1956
  // src/doubao-runtime.ts
1957
- var version = "0.0.21-beta.0";
1957
+ var version = "0.0.21";
1958
1958
  var name = "@lark-apaas/miaoda-coding-sdk";
1959
1959
  if (isOnlineEnv()) {
1960
1960
  reportPageView();
@@ -1954,7 +1954,7 @@ var MiaodaRuntime = (() => {
1954
1954
  __name(mountDoubaoWatermark, "mountDoubaoWatermark");
1955
1955
 
1956
1956
  // src/doubao-runtime.ts
1957
- var version = "0.0.21-beta.0";
1957
+ var version = "0.0.21";
1958
1958
  var name = "@lark-apaas/miaoda-coding-sdk";
1959
1959
  if (isOnlineEnv()) {
1960
1960
  reportPageView();
@@ -20,4 +20,4 @@
20
20
  align-items: flex-end;
21
21
  gap: 8px;
22
22
  }
23
- `;let g=document.createElement("div");return g.className="watermark-root",u.append(m,g),{host:o,container:g}}i(Ae,"createWatermarkRoot");function yt(t){let{host:e,container:o}=Ae(t),u=[];t==="doubao"?u.push(B({icon:"download",label:"\u4E0B\u8F7D\u8C46\u5305\u5DE5\u4F5C",fontSize:14,onClick:i(()=>window.open(W.doubao.downloadUrl,"_blank","noopener,noreferrer"),"onClick")})):u.push(B({icon:"efficiency",label:"\u4E86\u89E3\u5999\u642D",fontSize:14,onClick:i(()=>window.open(W.miaoda.landingUrl,"_blank","noopener,noreferrer"),"onClick")})),Se&&u.push(B({icon:t==="doubao"?"report":"feedback",label:"\u6295\u8BC9\u4E0E\u4E3E\u62A5",fontSize:14,onClick:Le}));let f=Te({items:u,minWidth:160,itemGap:8});f.style.display="none";let m=Ie(t,"desktop",()=>e.remove()),g=m.querySelector("[data-watermark-close]");o.append(f,m);let b=null;return o.addEventListener("mouseenter",()=>{b&&clearTimeout(b),f.style.display="flex",g&&(g.style.display="inline-flex")}),o.addEventListener("mouseleave",()=>{b=setTimeout(()=>{f.style.display="none",g&&(g.style.display="none")},100)}),e}i(yt,"buildDesktopWatermark");function Ct(t){let{host:e,container:o}=Ae(t,!0);o.style.cursor="pointer";let u=[];t==="miaoda"&&u.push(B({icon:"efficiency",label:"\u4E86\u89E3\u5999\u642D",fontSize:16,onClick:i(()=>window.open(W.miaoda.landingUrl,"_blank","noopener,noreferrer"),"onClick")})),Se&&u.push(B({icon:t==="doubao"?"report":"feedback",label:"\u6295\u8BC9\u4E0E\u4E3E\u62A5",fontSize:16,onClick:Le}));let f=[B({icon:"close",label:"\u4E0D\u518D\u5C55\u793A",fontSize:16,onClick:i(v=>{v.stopPropagation(),document.removeEventListener("click",b),e.remove()},"onClick")})],m=Te({items:u,extraItems:f,minWidth:160});m.style.display="none";let g=Ie(t,"mobile");o.append(m,g),o.addEventListener("click",v=>{v.stopPropagation(),m.style.display=m.style.display==="none"?"flex":"none"});let b=i(()=>{m.style.display="none"},"onOutsideClick");return document.addEventListener("click",b),e}i(Ct,"buildMobileWatermark");var xe=!1,X=!1;async function Oe(t){if(xe||X||typeof document=="undefined")return;if(document.readyState==="loading"){document.addEventListener("DOMContentLoaded",()=>Oe(t),{once:!0});return}X=!0;let e=await se();if(xe=!0,X=!1,!e)return;let o=U()?Ct(t):yt(t);document.body.appendChild(o)}i(Oe,"mountWatermark");function Me(){return Oe("doubao")}i(Me,"mountDoubaoWatermark");var xt="0.0.21-beta.0",kt="@lark-apaas/miaoda-coding-sdk";ae()&&(fe(),be());Me();Ce();return Ne(St);})();
23
+ `;let g=document.createElement("div");return g.className="watermark-root",u.append(m,g),{host:o,container:g}}i(Ae,"createWatermarkRoot");function yt(t){let{host:e,container:o}=Ae(t),u=[];t==="doubao"?u.push(B({icon:"download",label:"\u4E0B\u8F7D\u8C46\u5305\u5DE5\u4F5C",fontSize:14,onClick:i(()=>window.open(W.doubao.downloadUrl,"_blank","noopener,noreferrer"),"onClick")})):u.push(B({icon:"efficiency",label:"\u4E86\u89E3\u5999\u642D",fontSize:14,onClick:i(()=>window.open(W.miaoda.landingUrl,"_blank","noopener,noreferrer"),"onClick")})),Se&&u.push(B({icon:t==="doubao"?"report":"feedback",label:"\u6295\u8BC9\u4E0E\u4E3E\u62A5",fontSize:14,onClick:Le}));let f=Te({items:u,minWidth:160,itemGap:8});f.style.display="none";let m=Ie(t,"desktop",()=>e.remove()),g=m.querySelector("[data-watermark-close]");o.append(f,m);let b=null;return o.addEventListener("mouseenter",()=>{b&&clearTimeout(b),f.style.display="flex",g&&(g.style.display="inline-flex")}),o.addEventListener("mouseleave",()=>{b=setTimeout(()=>{f.style.display="none",g&&(g.style.display="none")},100)}),e}i(yt,"buildDesktopWatermark");function Ct(t){let{host:e,container:o}=Ae(t,!0);o.style.cursor="pointer";let u=[];t==="miaoda"&&u.push(B({icon:"efficiency",label:"\u4E86\u89E3\u5999\u642D",fontSize:16,onClick:i(()=>window.open(W.miaoda.landingUrl,"_blank","noopener,noreferrer"),"onClick")})),Se&&u.push(B({icon:t==="doubao"?"report":"feedback",label:"\u6295\u8BC9\u4E0E\u4E3E\u62A5",fontSize:16,onClick:Le}));let f=[B({icon:"close",label:"\u4E0D\u518D\u5C55\u793A",fontSize:16,onClick:i(v=>{v.stopPropagation(),document.removeEventListener("click",b),e.remove()},"onClick")})],m=Te({items:u,extraItems:f,minWidth:160});m.style.display="none";let g=Ie(t,"mobile");o.append(m,g),o.addEventListener("click",v=>{v.stopPropagation(),m.style.display=m.style.display==="none"?"flex":"none"});let b=i(()=>{m.style.display="none"},"onOutsideClick");return document.addEventListener("click",b),e}i(Ct,"buildMobileWatermark");var xe=!1,X=!1;async function Oe(t){if(xe||X||typeof document=="undefined")return;if(document.readyState==="loading"){document.addEventListener("DOMContentLoaded",()=>Oe(t),{once:!0});return}X=!0;let e=await se();if(xe=!0,X=!1,!e)return;let o=U()?Ct(t):yt(t);document.body.appendChild(o)}i(Oe,"mountWatermark");function Me(){return Oe("doubao")}i(Me,"mountDoubaoWatermark");var xt="0.0.21",kt="@lark-apaas/miaoda-coding-sdk";ae()&&(fe(),be());Me();Ce();return Ne(St);})();
@@ -2003,7 +2003,7 @@ var MiaodaRuntime = (() => {
2003
2003
  __name(mountMiaodaWatermark, "mountMiaodaWatermark");
2004
2004
 
2005
2005
  // src/runtime.ts
2006
- var version = "0.0.21-beta.0";
2006
+ var version = "0.0.21";
2007
2007
  var name = "@lark-apaas/miaoda-coding-sdk";
2008
2008
  if (isOnlineEnv()) {
2009
2009
  reportPageView();
package/dist/runtime.js CHANGED
@@ -2003,7 +2003,7 @@ var MiaodaRuntime = (() => {
2003
2003
  __name(mountMiaodaWatermark, "mountMiaodaWatermark");
2004
2004
 
2005
2005
  // src/runtime.ts
2006
- var version = "0.0.21-beta.0";
2006
+ var version = "0.0.21";
2007
2007
  var name = "@lark-apaas/miaoda-coding-sdk";
2008
2008
  if (isOnlineEnv()) {
2009
2009
  reportPageView();
@@ -20,4 +20,4 @@
20
20
  align-items: flex-end;
21
21
  gap: 8px;
22
22
  }
23
- `;let h=document.createElement("div");return h.className="watermark-root",s.append(m,h),{host:o,container:h}}i(Ie,"createWatermarkRoot");function Ct(t){let{host:e,container:o}=Ie(t),s=[];t==="doubao"?s.push(M({icon:"download",label:"\u4E0B\u8F7D\u8C46\u5305\u5DE5\u4F5C",fontSize:14,onClick:i(()=>window.open($.doubao.downloadUrl,"_blank","noopener,noreferrer"),"onClick")})):s.push(M({icon:"efficiency",label:"\u4E86\u89E3\u5999\u642D",fontSize:14,onClick:i(()=>window.open($.miaoda.landingUrl,"_blank","noopener,noreferrer"),"onClick")})),ke&&s.push(M({icon:t==="doubao"?"report":"feedback",label:"\u6295\u8BC9\u4E0E\u4E3E\u62A5",fontSize:14,onClick:Ee}));let f=Ae({items:s,minWidth:160,itemGap:8});f.style.display="none";let m=Te(t,"desktop",()=>e.remove()),h=m.querySelector("[data-watermark-close]");o.append(f,m);let v=null;return o.addEventListener("mouseenter",()=>{v&&clearTimeout(v),f.style.display="flex",h&&(h.style.display="inline-flex")}),o.addEventListener("mouseleave",()=>{v=setTimeout(()=>{f.style.display="none",h&&(h.style.display="none")},100)}),e}i(Ct,"buildDesktopWatermark");function xt(t){let{host:e,container:o}=Ie(t,!0);o.style.cursor="pointer";let s=[];t==="miaoda"&&s.push(M({icon:"efficiency",label:"\u4E86\u89E3\u5999\u642D",fontSize:16,onClick:i(()=>window.open($.miaoda.landingUrl,"_blank","noopener,noreferrer"),"onClick")})),ke&&s.push(M({icon:t==="doubao"?"report":"feedback",label:"\u6295\u8BC9\u4E0E\u4E3E\u62A5",fontSize:16,onClick:Ee}));let f=[M({icon:"close",label:"\u4E0D\u518D\u5C55\u793A",fontSize:16,onClick:i(b=>{b.stopPropagation(),document.removeEventListener("click",v),e.remove()},"onClick")})],m=Ae({items:s,extraItems:f,minWidth:160});m.style.display="none";let h=Te(t,"mobile");o.append(m,h),o.addEventListener("click",b=>{b.stopPropagation(),m.style.display=m.style.display==="none"?"flex":"none"});let v=i(()=>{m.style.display="none"},"onOutsideClick");return document.addEventListener("click",v),e}i(xt,"buildMobileWatermark");var xe=!1,K=!1;async function Oe(t){if(xe||K||typeof document=="undefined")return;if(document.readyState==="loading"){document.addEventListener("DOMContentLoaded",()=>Oe(t),{once:!0});return}K=!0;let e=await ue();if(xe=!0,K=!1,!e)return;let o=U()?xt(t):Ct(t);document.body.appendChild(o)}i(Oe,"mountWatermark");function Be(){return Oe("miaoda")}i(Be,"mountMiaodaWatermark");var St="0.0.21-beta.0",kt="@lark-apaas/miaoda-coding-sdk";de()&&(me(),Ce());Be();ne();return Ne(Et);})();
23
+ `;let h=document.createElement("div");return h.className="watermark-root",s.append(m,h),{host:o,container:h}}i(Ie,"createWatermarkRoot");function Ct(t){let{host:e,container:o}=Ie(t),s=[];t==="doubao"?s.push(M({icon:"download",label:"\u4E0B\u8F7D\u8C46\u5305\u5DE5\u4F5C",fontSize:14,onClick:i(()=>window.open($.doubao.downloadUrl,"_blank","noopener,noreferrer"),"onClick")})):s.push(M({icon:"efficiency",label:"\u4E86\u89E3\u5999\u642D",fontSize:14,onClick:i(()=>window.open($.miaoda.landingUrl,"_blank","noopener,noreferrer"),"onClick")})),ke&&s.push(M({icon:t==="doubao"?"report":"feedback",label:"\u6295\u8BC9\u4E0E\u4E3E\u62A5",fontSize:14,onClick:Ee}));let f=Ae({items:s,minWidth:160,itemGap:8});f.style.display="none";let m=Te(t,"desktop",()=>e.remove()),h=m.querySelector("[data-watermark-close]");o.append(f,m);let v=null;return o.addEventListener("mouseenter",()=>{v&&clearTimeout(v),f.style.display="flex",h&&(h.style.display="inline-flex")}),o.addEventListener("mouseleave",()=>{v=setTimeout(()=>{f.style.display="none",h&&(h.style.display="none")},100)}),e}i(Ct,"buildDesktopWatermark");function xt(t){let{host:e,container:o}=Ie(t,!0);o.style.cursor="pointer";let s=[];t==="miaoda"&&s.push(M({icon:"efficiency",label:"\u4E86\u89E3\u5999\u642D",fontSize:16,onClick:i(()=>window.open($.miaoda.landingUrl,"_blank","noopener,noreferrer"),"onClick")})),ke&&s.push(M({icon:t==="doubao"?"report":"feedback",label:"\u6295\u8BC9\u4E0E\u4E3E\u62A5",fontSize:16,onClick:Ee}));let f=[M({icon:"close",label:"\u4E0D\u518D\u5C55\u793A",fontSize:16,onClick:i(b=>{b.stopPropagation(),document.removeEventListener("click",v),e.remove()},"onClick")})],m=Ae({items:s,extraItems:f,minWidth:160});m.style.display="none";let h=Te(t,"mobile");o.append(m,h),o.addEventListener("click",b=>{b.stopPropagation(),m.style.display=m.style.display==="none"?"flex":"none"});let v=i(()=>{m.style.display="none"},"onOutsideClick");return document.addEventListener("click",v),e}i(xt,"buildMobileWatermark");var xe=!1,K=!1;async function Oe(t){if(xe||K||typeof document=="undefined")return;if(document.readyState==="loading"){document.addEventListener("DOMContentLoaded",()=>Oe(t),{once:!0});return}K=!0;let e=await ue();if(xe=!0,K=!1,!e)return;let o=U()?xt(t):Ct(t);document.body.appendChild(o)}i(Oe,"mountWatermark");function Be(){return Oe("miaoda")}i(Be,"mountMiaodaWatermark");var St="0.0.21",kt="@lark-apaas/miaoda-coding-sdk";de()&&(me(),Ce());Be();ne();return Ne(Et);})();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lark-apaas/miaoda-coding-sdk",
3
- "version": "0.0.21-beta.0",
3
+ "version": "0.0.21",
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",