@lark-apaas/miaoda-coding-sdk 0.0.13 → 0.0.14-alpha.20260918065040
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/design-runtime.dev.js +1 -1
- package/dist/design-runtime.js +1 -1
- package/dist/design-runtime.min.js +1 -1
- package/dist/doubao-runtime.dev.js +80 -43
- package/dist/doubao-runtime.js +80 -43
- package/dist/doubao-runtime.min.js +23 -1
- package/dist/runtime.dev.js +80 -43
- package/dist/runtime.js +80 -43
- package/dist/runtime.min.js +23 -1
- package/package.json +1 -1
|
@@ -761,7 +761,7 @@ var MiaodaRuntime = (() => {
|
|
|
761
761
|
__name(initCreativePvTracking, "initCreativePvTracking");
|
|
762
762
|
|
|
763
763
|
// src/design-runtime.ts
|
|
764
|
-
var version = "0.0.
|
|
764
|
+
var version = "0.0.14-alpha.20260918065040";
|
|
765
765
|
var name = "@lark-apaas/miaoda-coding-sdk";
|
|
766
766
|
if (!window.__CREATIVITY_RUNTIME__) {
|
|
767
767
|
window.__CREATIVITY_RUNTIME__ = true;
|
package/dist/design-runtime.js
CHANGED
|
@@ -761,7 +761,7 @@ var MiaodaRuntime = (() => {
|
|
|
761
761
|
__name(initCreativePvTracking, "initCreativePvTracking");
|
|
762
762
|
|
|
763
763
|
// src/design-runtime.ts
|
|
764
|
-
var version = "0.0.
|
|
764
|
+
var version = "0.0.14-alpha.20260918065040";
|
|
765
765
|
var name = "@lark-apaas/miaoda-coding-sdk";
|
|
766
766
|
if (!window.__CREATIVITY_RUNTIME__) {
|
|
767
767
|
window.__CREATIVITY_RUNTIME__ = true;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var MiaodaRuntime=(()=>{var y=Object.defineProperty;var U=Object.getOwnPropertyDescriptor;var V=Object.getOwnPropertyNames;var j=Object.prototype.hasOwnProperty;var i=(t,e)=>y(t,"name",{value:e,configurable:!0});var H=(t,e)=>{for(var r in e)y(t,r,{get:e[r],enumerable:!0})},K=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of V(e))!j.call(t,o)&&o!==r&&y(t,o,{get:()=>e[o],enumerable:!(n=U(e,o))||n.enumerable});return t};var J=t=>K(y({},"__esModule",{value:!0}),t);var _e={};H(_e,{name:()=>me,version:()=>he});var X=new Set(["text/babel","text/jsx"]),z=3e3,Y=15e3,q=1e3,G=20,P=!1;function A(){P||(P=!0,document.addEventListener("DOMContentLoaded",Q,{once:!0}))}i(A,"initCreativeBabelStages");function Q(){let t=W();if(!t.length)return;let e={fetchDur:0,transformDur:0,evalDur:0,externalCount:t.filter(o=>o.src).length},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,m(e,r);return}try{n.disableScriptTags()}catch{r.scriptsDone=!0,m(e,r);return}r.takeover=!0,r.totalStart=performance.now(),r.hardTimer=setTimeout(()=>m(e,r),Y),te(e,r),ee(n,t,e,r)}i(Q,"onDomContentLoaded");function W(){let t=document.getElementsByTagName("script"),e=[];for(let r=0;r<t.length;r++){let n=t[r];X.has((n.type||"").split(";")[0])&&e.push(n)}return e}i(W,"collectBabelScripts");function T(t,e){let r=t.getAttribute(e);return r===""?[]:r?r.split(",").map(n=>n.trim()):null}i(T,"attrList");function Z(t,e){var o,a,c;let r=t.getAttribute("data-type"),n={browsers:(o=T(t,"data-targets"))!=null?o:void 0};return r==="module"&&(n.esmodules="intersect"),{filename:e,presets:(a=T(t,"data-presets"))!=null?a:r==="module"?["react",["env",{modules:!1}]]:["react","env"],plugins:(c=T(t,"data-plugins"))!=null?c:["transform-class-properties","transform-object-rest-spread","transform-flow-strip-types"],sourceMaps:"inline",sourceFileName:e,targets:n}}i(Z,"buildOptions");function ee(t,e,r,n){let o=0,a=i((l,d)=>{var h;let p;if(l.src)p=l.src;else{let f=l.getAttribute("data-module");f?p=f:(o++,p=o===1?"Inline Babel script":`Inline Babel script (${o})`)}try{let f=performance.now(),g=t.transform(d,Z(l,p)),b=performance.now(),v=document.createElement("script"),w=l.getAttribute("data-type");w&&v.setAttribute("type",w),l.nonce&&(v.nonce=l.nonce),v.text=(h=g==null?void 0:g.code)!=null?h:"",document.head.appendChild(v),r.transformDur+=b-f,r.evalDur+=performance.now()-b}catch(f){console.error("[creative-babel-stages] script failed:",p,f)}},"runOne"),c=0;for(;c<e.length&&!e[c].src;)a(e[c],e[c].innerHTML),c++;if(c>=e.length){D(r,n);return}let u=e.slice(c),s=u.map(l=>{if(!l.src)return Promise.resolve(l.innerHTML);let d=performance.now();return fetch(l.src).then(p=>{if(!p.ok)throw new Error(`HTTP ${p.status}`);return p.text()}).then(p=>(r.fetchDur+=performance.now()-d,p))});(async()=>{for(let l=0;l<u.length;l++){let d=null;try{d=await s[l]}catch(p){console.error("[creative-babel-stages] load failed:",u[l].src,p);continue}a(u[l],d)}D(r,n)})()}i(ee,"runScripts");function te(t,e){let r=window.ReactDOM;if(!r)return;let n=i(c=>{if(e.renderStart===null){e.renderStart=performance.now();try{let u=new MutationObserver(()=>{u.disconnect(),e.renderDur=performance.now()-e.renderStart,e.scriptsDone&&m(t,e)});u.observe(c,{childList:!0,subtree:!0})}catch{}}},"observeCommit"),o=r.createRoot;typeof o=="function"&&(r.createRoot=(c,u)=>{let s=o.call(r,c,u),l=s.render.bind(s);return s.render=d=>(n(c),l(d)),s});let a=r.render;typeof a=="function"&&(r.render=(c,u,s)=>(n(u),a.call(r,c,u,s)))}i(te,"instrumentRender");function D(t,e){e.scriptsDone=!0,e.scriptsDoneAt=performance.now(),e.renderStart===null||e.renderDur!==null?m(t,e):setTimeout(()=>m(t,e),z)}i(D,"onScriptsDone");function m(t,e){var a;if(e.sent)return;let r=window.Slardar;if(!r){e.retries++<G&&setTimeout(()=>m(t,e),q);return}e.sent=!0,e.hardTimer!==null&&clearTimeout(e.hardTimer);let n=e.renderDur!==null&&e.renderStart!==null?e.renderStart+e.renderDur:(a=e.scriptsDoneAt)!=null?a:performance.now(),o=e.totalStart===null?0:Math.max(0,n-e.totalStart);r("sendEvent",{name:"creative_babel_stages",metrics:{babel_total_dur:Math.round(o),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)}})}i(m,"trySend");var re="https://lf3-short.ibytedapm.com/slardar/fe/sdk-web/browser.cn.js",R=!1;function M(){if(R)return;if(R=!0,window.Slardar){x();return}let t=document.createElement("script");t.src=re,t.onload=()=>{window.Slardar&&x()},t.onerror=()=>{},document.head.appendChild(t)}i(M,"initCreativePerf");function x(){var o,a,c;let t=window.Slardar;if(!t)return;let e=null;t("context.merge",{app_id:(o=window.__appId__)!=null?o:"",creative_type:(a=window.__creativeType__)!=null?a:"unknown",is_public:String((c=window.__isExternallyVisible__)!=null?c:!1)}),t("init",{bid:"apaas_miaoda",env:window.ENVIRONMENT||"online"}),t("start");try{new PerformanceObserver(u=>{for(let s of u.getEntries())if(s.name==="first-contentful-paint"){e=s.startTime,t("context.merge",{has_painted:"true"});break}}).observe({type:"paint",buffered:!0})}catch{}let r=!1,n=i(()=>{if(r||!window.Slardar)return;r=!0;let u=performance.getEntriesByType("resource"),s=performance.getEntriesByType("navigation")[0],l=e!=null?e:ne(),d={transfer_size:u.reduce((p,h)=>{var f;return p+((f=h.transferSize)!=null?f:0)},0)};s&&s.domContentLoadedEventEnd>=s.responseStart&&(d.ttfb_to_dom_ready_dur=Math.round(s.domContentLoadedEventEnd-s.responseStart)),s&&l!==null&&l>=s.domContentLoadedEventEnd&&(d.render_to_fcp_dur=Math.round(l-s.domContentLoadedEventEnd)),window.Slardar("sendEvent",{name:"creative_perf",metrics:d})},"send");window.addEventListener("load",()=>setTimeout(n,500)),setTimeout(n,15e3)}i(x,"bootstrap");function ne(){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}i(ne,"getBufferedFcpStartTime");function k(){let t="inspector-id";document.addEventListener("DOMContentLoaded",()=>{let e=window.Babel;if(!e||!e.registerPlugin)return;let r=null,n=i(()=>{let a={},c=0;return document.querySelectorAll('script[type="text/babel"],script[type="text/jsx"]').forEach(u=>{let s=u.getAttribute("src");if(s){let l=s.split("?")[0],d=l.split("/").pop()||l;a[d]=d in a?"":l}else{c++;let l=c===1?"Inline Babel script":`Inline Babel script (${c})`;a[l]=u.getAttribute("data-filename")||`inline-${c-1}`}}),a},"buildFileMap");e.availablePlugins&&delete e.availablePlugins[t],e.registerPlugin(t,({types:a})=>({visitor:{JSXOpeningElement(c,u){let s=c.node;if(s.name&&s.name.type==="JSXMemberExpression")return;for(let E=0;E<s.attributes.length;E++){let S=s.attributes[E];if(S.type==="JSXAttribute"&&S.name&&S.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],p=d.split("/").pop()||d,h=r[l]||r[p]||d.replace(/^\/?[a-z][a-z0-9+.-]*:\/{1,2}[^/]+/i,"").replace(/^\/+/,"")||l,f=s.loc&&s.loc.start,g=f?f.line:0,b=f?f.column+1:0,v=s.name&&s.name.type==="JSXIdentifier"?s.name.name:h,w=`jsx:${h}:${v}:${g}:${b}`;s.attributes.push(a.jsxAttribute(a.jsxIdentifier("data-inspector-id"),a.stringLiteral(w)))}}}));let o="";try{let a=document.getElementById("__srcmap");if(a&&a.textContent){let c=JSON.parse(a.textContent),u=c==null?void 0:c.file;typeof u=="string"&&(o=u)}}catch{}document.querySelectorAll('script[type="text/babel"],script[type="text/jsx"]').forEach((a,c)=>{let u=a.getAttribute("data-plugins")||"";if(u.indexOf(t)<0&&a.setAttribute("data-plugins",u?`${u},${t}`:t),!a.hasAttribute("data-filename")){let s=o?`${o}#inline-${c}`:`inline-${c}`;a.setAttribute("data-filename",a.getAttribute("src")||s)}})})}i(k,"registerInspectorIdPlugin");function C(){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}i(C,"generateUUID");var L="x_sdk_device_id";function ie(){try{let t=localStorage.getItem(L);return t||(t=C(),localStorage.setItem(L,t)),t}catch{return C()}}i(ie,"getDeviceId");function oe(){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"}i(oe,"getDeviceType");var se="pageSessionID";function ae(){try{return new URLSearchParams(window.location.search).get(se)||""}catch{return""}}i(ae,"getPvId");function ce(t={}){let e=t.pvId||ae();return{app_id:window.appId||"",tenant_id:window.tenantId||"",user_id:window.userId||"",did:ie(),module:"app_web",app_env:"runtime",source_type:"user",device_type:oe(),release_commit_id:window.__RELEASE_COMMIT_ID__||"",...e?{pv_id:e}:{}}}i(ce,"getDefaultAttributes");function N(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))}i(N,"toNanoString");var le="1.0.2";function ue(t,e){let r=ce(e),n=N(Date.now());return{metricsData:{resource:{attributes:{sdk_version:le,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(o=>({attributes:{...r,url:o.url,path:o.path,referrer:o.referrer},startTimeUnixNano:N(o.timestampMs),timeUnixNano:n,asDouble:1}))}}]}}}i(ue,"buildPayload");function de(t,e,r={},n){if(e.length===0)return;let o;try{o=JSON.stringify(ue(e,n))}catch{return}try{fetch(t,{method:"POST",headers:{"Content-Type":"application/json","X-Suda-Csrf-Token":window.csrfToken||"",...r},body:o,keepalive:!0}).catch(()=>{})}catch{}}i(de,"sendPvData");var I="__APAAS_PV_TRACKER_STARTED__";function pe(){try{let t=window;return t[I]?!1:(t[I]=!0,!0)}catch{return!0}}i(pe,"claimPvReporting");function B(){try{window[I]=!1}catch{}}i(B,"releasePvReporting");var _,fe=(_=class{constructor(){this.started=!1,this.disposers=[],this.holdsPvReporting=!1,this.buffer=[]}static get instance(){return this._instance||(this._instance=new _),this._instance}start(e){var r;if(!this.started&&pe()){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,B(),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,B())}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);de(this.config.collectorUrl,e,this.config.headers,{pvId:this.config.pvId})}listenRouteChanges(){this.recordPv();let e=i(()=>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=i(()=>this.recordPv(),"recordPv");history[e]=function(...o){let a=r.apply(this,o);return n(),a},this.disposers.push(()=>{history[e]=r})}registerLifecycleListeners(){let e=i(()=>{document.visibilityState==="hidden"&&this.flush()},"onVisibilityChange");document.addEventListener("visibilitychange",e),this.disposers.push(()=>document.removeEventListener("visibilitychange",e));let r=i(()=>this.flush(),"onPageHide");window.addEventListener("pagehide",r),this.disposers.push(()=>window.removeEventListener("pagehide",r))}},i(_,"_PvTracker"),_),O=fe.instance;function F(){return window.appId||null}i(F,"getAppId");function $(){var e;let t=(e=F())!=null?e:"";O.start({collectorUrl:`/app/${t}/__runtime__/api/v1/observability/metrics/collect`,firstFlushDelayMs:1e3})}i($,"initCreativePvTracking");var he="0.0.13",me="@lark-apaas/miaoda-coding-sdk";window.__CREATIVITY_RUNTIME__||(window.__CREATIVITY_RUNTIME__=!0,k(),M(),$(),A());return J(_e);})();
|
|
1
|
+
"use strict";var MiaodaRuntime=(()=>{var y=Object.defineProperty;var U=Object.getOwnPropertyDescriptor;var V=Object.getOwnPropertyNames;var j=Object.prototype.hasOwnProperty;var i=(t,e)=>y(t,"name",{value:e,configurable:!0});var H=(t,e)=>{for(var r in e)y(t,r,{get:e[r],enumerable:!0})},K=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of V(e))!j.call(t,o)&&o!==r&&y(t,o,{get:()=>e[o],enumerable:!(n=U(e,o))||n.enumerable});return t};var X=t=>K(y({},"__esModule",{value:!0}),t);var _e={};H(_e,{name:()=>me,version:()=>he});var J=new Set(["text/babel","text/jsx"]),z=3e3,Y=15e3,q=1e3,G=20,P=!1;function A(){P||(P=!0,document.addEventListener("DOMContentLoaded",Q,{once:!0}))}i(A,"initCreativeBabelStages");function Q(){let t=W();if(!t.length)return;let e={fetchDur:0,transformDur:0,evalDur:0,externalCount:t.filter(o=>o.src).length},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,m(e,r);return}try{n.disableScriptTags()}catch{r.scriptsDone=!0,m(e,r);return}r.takeover=!0,r.totalStart=performance.now(),r.hardTimer=setTimeout(()=>m(e,r),Y),te(e,r),ee(n,t,e,r)}i(Q,"onDomContentLoaded");function W(){let t=document.getElementsByTagName("script"),e=[];for(let r=0;r<t.length;r++){let n=t[r];J.has((n.type||"").split(";")[0])&&e.push(n)}return e}i(W,"collectBabelScripts");function E(t,e){let r=t.getAttribute(e);return r===""?[]:r?r.split(",").map(n=>n.trim()):null}i(E,"attrList");function Z(t,e){var o,a,c;let r=t.getAttribute("data-type"),n={browsers:(o=E(t,"data-targets"))!=null?o:void 0};return r==="module"&&(n.esmodules="intersect"),{filename:e,presets:(a=E(t,"data-presets"))!=null?a:r==="module"?["react",["env",{modules:!1}]]:["react","env"],plugins:(c=E(t,"data-plugins"))!=null?c:["transform-class-properties","transform-object-rest-spread","transform-flow-strip-types"],sourceMaps:"inline",sourceFileName:e,targets:n}}i(Z,"buildOptions");function ee(t,e,r,n){let o=0,a=i((l,d)=>{var h;let p;if(l.src)p=l.src;else{let f=l.getAttribute("data-module");f?p=f:(o++,p=o===1?"Inline Babel script":`Inline Babel script (${o})`)}try{let f=performance.now(),v=t.transform(d,Z(l,p)),b=performance.now(),g=document.createElement("script"),w=l.getAttribute("data-type");w&&g.setAttribute("type",w),l.nonce&&(g.nonce=l.nonce),g.text=(h=v==null?void 0:v.code)!=null?h:"",document.head.appendChild(g),r.transformDur+=b-f,r.evalDur+=performance.now()-b}catch(f){console.error("[creative-babel-stages] script failed:",p,f)}},"runOne"),c=0;for(;c<e.length&&!e[c].src;)a(e[c],e[c].innerHTML),c++;if(c>=e.length){D(r,n);return}let u=e.slice(c),s=u.map(l=>{if(!l.src)return Promise.resolve(l.innerHTML);let d=performance.now();return fetch(l.src).then(p=>{if(!p.ok)throw new Error(`HTTP ${p.status}`);return p.text()}).then(p=>(r.fetchDur+=performance.now()-d,p))});(async()=>{for(let l=0;l<u.length;l++){let d=null;try{d=await s[l]}catch(p){console.error("[creative-babel-stages] load failed:",u[l].src,p);continue}a(u[l],d)}D(r,n)})()}i(ee,"runScripts");function te(t,e){let r=window.ReactDOM;if(!r)return;let n=i(c=>{if(e.renderStart===null){e.renderStart=performance.now();try{let u=new MutationObserver(()=>{u.disconnect(),e.renderDur=performance.now()-e.renderStart,e.scriptsDone&&m(t,e)});u.observe(c,{childList:!0,subtree:!0})}catch{}}},"observeCommit"),o=r.createRoot;typeof o=="function"&&(r.createRoot=(c,u)=>{let s=o.call(r,c,u),l=s.render.bind(s);return s.render=d=>(n(c),l(d)),s});let a=r.render;typeof a=="function"&&(r.render=(c,u,s)=>(n(u),a.call(r,c,u,s)))}i(te,"instrumentRender");function D(t,e){e.scriptsDone=!0,e.scriptsDoneAt=performance.now(),e.renderStart===null||e.renderDur!==null?m(t,e):setTimeout(()=>m(t,e),z)}i(D,"onScriptsDone");function m(t,e){var a;if(e.sent)return;let r=window.Slardar;if(!r){e.retries++<G&&setTimeout(()=>m(t,e),q);return}e.sent=!0,e.hardTimer!==null&&clearTimeout(e.hardTimer);let n=e.renderDur!==null&&e.renderStart!==null?e.renderStart+e.renderDur:(a=e.scriptsDoneAt)!=null?a:performance.now(),o=e.totalStart===null?0:Math.max(0,n-e.totalStart);r("sendEvent",{name:"creative_babel_stages",metrics:{babel_total_dur:Math.round(o),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)}})}i(m,"trySend");var re="https://lf3-short.ibytedapm.com/slardar/fe/sdk-web/browser.cn.js",R=!1;function M(){if(R)return;if(R=!0,window.Slardar){x();return}let t=document.createElement("script");t.src=re,t.onload=()=>{window.Slardar&&x()},t.onerror=()=>{},document.head.appendChild(t)}i(M,"initCreativePerf");function x(){var o,a,c;let t=window.Slardar;if(!t)return;let e=null;t("context.merge",{app_id:(o=window.__appId__)!=null?o:"",creative_type:(a=window.__creativeType__)!=null?a:"unknown",is_public:String((c=window.__isExternallyVisible__)!=null?c:!1)}),t("init",{bid:"apaas_miaoda",env:window.ENVIRONMENT||"online"}),t("start");try{new PerformanceObserver(u=>{for(let s of u.getEntries())if(s.name==="first-contentful-paint"){e=s.startTime,t("context.merge",{has_painted:"true"});break}}).observe({type:"paint",buffered:!0})}catch{}let r=!1,n=i(()=>{if(r||!window.Slardar)return;r=!0;let u=performance.getEntriesByType("resource"),s=performance.getEntriesByType("navigation")[0],l=e!=null?e:ne(),d={transfer_size:u.reduce((p,h)=>{var f;return p+((f=h.transferSize)!=null?f:0)},0)};s&&s.domContentLoadedEventEnd>=s.responseStart&&(d.ttfb_to_dom_ready_dur=Math.round(s.domContentLoadedEventEnd-s.responseStart)),s&&l!==null&&l>=s.domContentLoadedEventEnd&&(d.render_to_fcp_dur=Math.round(l-s.domContentLoadedEventEnd)),window.Slardar("sendEvent",{name:"creative_perf",metrics:d})},"send");window.addEventListener("load",()=>setTimeout(n,500)),setTimeout(n,15e3)}i(x,"bootstrap");function ne(){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}i(ne,"getBufferedFcpStartTime");function k(){let t="inspector-id";document.addEventListener("DOMContentLoaded",()=>{let e=window.Babel;if(!e||!e.registerPlugin)return;let r=null,n=i(()=>{let a={},c=0;return document.querySelectorAll('script[type="text/babel"],script[type="text/jsx"]').forEach(u=>{let s=u.getAttribute("src");if(s){let l=s.split("?")[0],d=l.split("/").pop()||l;a[d]=d in a?"":l}else{c++;let l=c===1?"Inline Babel script":`Inline Babel script (${c})`;a[l]=u.getAttribute("data-filename")||`inline-${c-1}`}}),a},"buildFileMap");e.availablePlugins&&delete e.availablePlugins[t],e.registerPlugin(t,({types:a})=>({visitor:{JSXOpeningElement(c,u){let s=c.node;if(s.name&&s.name.type==="JSXMemberExpression")return;for(let S=0;S<s.attributes.length;S++){let T=s.attributes[S];if(T.type==="JSXAttribute"&&T.name&&T.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],p=d.split("/").pop()||d,h=r[l]||r[p]||d.replace(/^\/?[a-z][a-z0-9+.-]*:\/{1,2}[^/]+/i,"").replace(/^\/+/,"")||l,f=s.loc&&s.loc.start,v=f?f.line:0,b=f?f.column+1:0,g=s.name&&s.name.type==="JSXIdentifier"?s.name.name:h,w=`jsx:${h}:${g}:${v}:${b}`;s.attributes.push(a.jsxAttribute(a.jsxIdentifier("data-inspector-id"),a.stringLiteral(w)))}}}));let o="";try{let a=document.getElementById("__srcmap");if(a&&a.textContent){let c=JSON.parse(a.textContent),u=c==null?void 0:c.file;typeof u=="string"&&(o=u)}}catch{}document.querySelectorAll('script[type="text/babel"],script[type="text/jsx"]').forEach((a,c)=>{let u=a.getAttribute("data-plugins")||"";if(u.indexOf(t)<0&&a.setAttribute("data-plugins",u?`${u},${t}`:t),!a.hasAttribute("data-filename")){let s=o?`${o}#inline-${c}`:`inline-${c}`;a.setAttribute("data-filename",a.getAttribute("src")||s)}})})}i(k,"registerInspectorIdPlugin");function C(){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}i(C,"generateUUID");var L="x_sdk_device_id";function ie(){try{let t=localStorage.getItem(L);return t||(t=C(),localStorage.setItem(L,t)),t}catch{return C()}}i(ie,"getDeviceId");function oe(){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"}i(oe,"getDeviceType");var se="pageSessionID";function ae(){try{return new URLSearchParams(window.location.search).get(se)||""}catch{return""}}i(ae,"getPvId");function ce(t={}){let e=t.pvId||ae();return{app_id:window.appId||"",tenant_id:window.tenantId||"",user_id:window.userId||"",did:ie(),module:"app_web",app_env:"runtime",source_type:"user",device_type:oe(),release_commit_id:window.__RELEASE_COMMIT_ID__||"",...e?{pv_id:e}:{}}}i(ce,"getDefaultAttributes");function N(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))}i(N,"toNanoString");var le="1.0.2";function ue(t,e){let r=ce(e),n=N(Date.now());return{metricsData:{resource:{attributes:{sdk_version:le,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(o=>({attributes:{...r,url:o.url,path:o.path,referrer:o.referrer},startTimeUnixNano:N(o.timestampMs),timeUnixNano:n,asDouble:1}))}}]}}}i(ue,"buildPayload");function de(t,e,r={},n){if(e.length===0)return;let o;try{o=JSON.stringify(ue(e,n))}catch{return}try{fetch(t,{method:"POST",headers:{"Content-Type":"application/json","X-Suda-Csrf-Token":window.csrfToken||"",...r},body:o,keepalive:!0}).catch(()=>{})}catch{}}i(de,"sendPvData");var I="__APAAS_PV_TRACKER_STARTED__";function pe(){try{let t=window;return t[I]?!1:(t[I]=!0,!0)}catch{return!0}}i(pe,"claimPvReporting");function B(){try{window[I]=!1}catch{}}i(B,"releasePvReporting");var _,fe=(_=class{constructor(){this.started=!1,this.disposers=[],this.holdsPvReporting=!1,this.buffer=[]}static get instance(){return this._instance||(this._instance=new _),this._instance}start(e){var r;if(!this.started&&pe()){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,B(),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,B())}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);de(this.config.collectorUrl,e,this.config.headers,{pvId:this.config.pvId})}listenRouteChanges(){this.recordPv();let e=i(()=>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=i(()=>this.recordPv(),"recordPv");history[e]=function(...o){let a=r.apply(this,o);return n(),a},this.disposers.push(()=>{history[e]=r})}registerLifecycleListeners(){let e=i(()=>{document.visibilityState==="hidden"&&this.flush()},"onVisibilityChange");document.addEventListener("visibilitychange",e),this.disposers.push(()=>document.removeEventListener("visibilitychange",e));let r=i(()=>this.flush(),"onPageHide");window.addEventListener("pagehide",r),this.disposers.push(()=>window.removeEventListener("pagehide",r))}},i(_,"_PvTracker"),_),O=fe.instance;function $(){return window.appId||null}i($,"getAppId");function F(){var e;let t=(e=$())!=null?e:"";O.start({collectorUrl:`/app/${t}/__runtime__/api/v1/observability/metrics/collect`,firstFlushDelayMs:1e3})}i(F,"initCreativePvTracking");var he="0.0.14-alpha.20260918065040",me="@lark-apaas/miaoda-coding-sdk";window.__CREATIVITY_RUNTIME__||(window.__CREATIVITY_RUNTIME__=!0,k(),M(),F(),A());return X(_e);})();
|
|
@@ -1005,6 +1005,26 @@ var MiaodaRuntime = (() => {
|
|
|
1005
1005
|
return isPhone || isIpad;
|
|
1006
1006
|
}
|
|
1007
1007
|
__name(isMobile, "isMobile");
|
|
1008
|
+
async function fetchShowBadge() {
|
|
1009
|
+
var _a2, _b, _c;
|
|
1010
|
+
try {
|
|
1011
|
+
const appId = getAppId();
|
|
1012
|
+
if (!appId) return true;
|
|
1013
|
+
const url = isNewPathEnabled() ? `/app/${appId}/__runtime__/api/v1/studio/get_published` : `/spark/b/${appId}/get_published`;
|
|
1014
|
+
const response = await fetch(url, {
|
|
1015
|
+
headers: {
|
|
1016
|
+
"X-Suda-Csrf-Token": (_a2 = getCsrfToken()) != null ? _a2 : ""
|
|
1017
|
+
}
|
|
1018
|
+
});
|
|
1019
|
+
const res = await response.json();
|
|
1020
|
+
if (res.code === 0 || res.status_code === "0") {
|
|
1021
|
+
return ((_c = (_b = res.data) == null ? void 0 : _b.app_info) == null ? void 0 : _c.show_badge) !== false;
|
|
1022
|
+
}
|
|
1023
|
+
} catch {
|
|
1024
|
+
}
|
|
1025
|
+
return true;
|
|
1026
|
+
}
|
|
1027
|
+
__name(fetchShowBadge, "fetchShowBadge");
|
|
1008
1028
|
async function getLarkUserInfo() {
|
|
1009
1029
|
var _a2;
|
|
1010
1030
|
const appId = getAppId();
|
|
@@ -1642,19 +1662,47 @@ var MiaodaRuntime = (() => {
|
|
|
1642
1662
|
return card;
|
|
1643
1663
|
}
|
|
1644
1664
|
__name(buildMenuCard, "buildMenuCard");
|
|
1645
|
-
function
|
|
1646
|
-
const
|
|
1647
|
-
|
|
1648
|
-
|
|
1649
|
-
|
|
1650
|
-
right: "12px",
|
|
1651
|
-
bottom: "12px",
|
|
1652
|
-
zIndex: "9999",
|
|
1653
|
-
display: "flex",
|
|
1654
|
-
flexDirection: "column",
|
|
1655
|
-
alignItems: "flex-end",
|
|
1656
|
-
gap: "8px"
|
|
1665
|
+
function createWatermarkRoot(variant, mobile = false) {
|
|
1666
|
+
const host = document.createElement("div");
|
|
1667
|
+
host.setAttribute("data-custom-element", `${variant}-watermark${mobile ? "-mobile" : ""}`);
|
|
1668
|
+
const shadow = host.attachShadow({
|
|
1669
|
+
mode: "open"
|
|
1657
1670
|
});
|
|
1671
|
+
const style = document.createElement("style");
|
|
1672
|
+
style.textContent = `
|
|
1673
|
+
:host {
|
|
1674
|
+
all: initial !important;
|
|
1675
|
+
display: block !important;
|
|
1676
|
+
position: fixed !important;
|
|
1677
|
+
right: 12px !important;
|
|
1678
|
+
bottom: 12px !important;
|
|
1679
|
+
z-index: 9999 !important;
|
|
1680
|
+
direction: ltr !important;
|
|
1681
|
+
unicode-bidi: isolate !important;
|
|
1682
|
+
}
|
|
1683
|
+
:host::before, :host::after { content: none !important; }
|
|
1684
|
+
.watermark-root {
|
|
1685
|
+
all: initial;
|
|
1686
|
+
direction: ltr;
|
|
1687
|
+
unicode-bidi: isolate;
|
|
1688
|
+
font-family: ${FONT_FAMILY};
|
|
1689
|
+
display: flex;
|
|
1690
|
+
flex-direction: column;
|
|
1691
|
+
align-items: flex-end;
|
|
1692
|
+
gap: 8px;
|
|
1693
|
+
}
|
|
1694
|
+
`;
|
|
1695
|
+
const container = document.createElement("div");
|
|
1696
|
+
container.className = "watermark-root";
|
|
1697
|
+
shadow.append(style, container);
|
|
1698
|
+
return {
|
|
1699
|
+
host,
|
|
1700
|
+
container
|
|
1701
|
+
};
|
|
1702
|
+
}
|
|
1703
|
+
__name(createWatermarkRoot, "createWatermarkRoot");
|
|
1704
|
+
function buildDesktopWatermark(variant) {
|
|
1705
|
+
const { host, container } = createWatermarkRoot(variant);
|
|
1658
1706
|
const items = [];
|
|
1659
1707
|
if (variant === "doubao") {
|
|
1660
1708
|
items.push(buildMenuRow({
|
|
@@ -1685,7 +1733,7 @@ var MiaodaRuntime = (() => {
|
|
|
1685
1733
|
itemGap: 8
|
|
1686
1734
|
});
|
|
1687
1735
|
menu.style.display = "none";
|
|
1688
|
-
const pill = buildPill(variant, "desktop", () =>
|
|
1736
|
+
const pill = buildPill(variant, "desktop", () => host.remove());
|
|
1689
1737
|
const close = pill.querySelector("[data-watermark-close]");
|
|
1690
1738
|
container.append(menu, pill);
|
|
1691
1739
|
let timer = null;
|
|
@@ -1700,32 +1748,14 @@ var MiaodaRuntime = (() => {
|
|
|
1700
1748
|
if (close) close.style.display = "none";
|
|
1701
1749
|
}, 100);
|
|
1702
1750
|
});
|
|
1703
|
-
return
|
|
1751
|
+
return host;
|
|
1704
1752
|
}
|
|
1705
1753
|
__name(buildDesktopWatermark, "buildDesktopWatermark");
|
|
1706
1754
|
function buildMobileWatermark(variant) {
|
|
1707
|
-
const wrapper =
|
|
1708
|
-
wrapper.
|
|
1709
|
-
Object.assign(wrapper.style, {
|
|
1710
|
-
position: "fixed",
|
|
1711
|
-
right: "12px",
|
|
1712
|
-
bottom: "12px",
|
|
1713
|
-
zIndex: "9999",
|
|
1714
|
-
display: "flex",
|
|
1715
|
-
flexDirection: "column",
|
|
1716
|
-
alignItems: "flex-end",
|
|
1717
|
-
gap: "8px",
|
|
1718
|
-
cursor: "pointer"
|
|
1719
|
-
});
|
|
1755
|
+
const { host, container: wrapper } = createWatermarkRoot(variant, true);
|
|
1756
|
+
wrapper.style.cursor = "pointer";
|
|
1720
1757
|
const items = [];
|
|
1721
|
-
if (variant === "
|
|
1722
|
-
items.push(buildMenuRow({
|
|
1723
|
-
icon: "download",
|
|
1724
|
-
label: "\u4E0B\u8F7D\u8C46\u5305\u5DE5\u4F5C",
|
|
1725
|
-
fontSize: 16,
|
|
1726
|
-
onClick: /* @__PURE__ */ __name(() => window.open(VARIANT_CONFIG.doubao.downloadUrl, "_blank", "noopener,noreferrer"), "onClick")
|
|
1727
|
-
}));
|
|
1728
|
-
} else {
|
|
1758
|
+
if (variant === "miaoda") {
|
|
1729
1759
|
items.push(buildMenuRow({
|
|
1730
1760
|
icon: "efficiency",
|
|
1731
1761
|
label: "\u4E86\u89E3\u5999\u642D",
|
|
@@ -1748,7 +1778,8 @@ var MiaodaRuntime = (() => {
|
|
|
1748
1778
|
fontSize: 16,
|
|
1749
1779
|
onClick: /* @__PURE__ */ __name((e) => {
|
|
1750
1780
|
e.stopPropagation();
|
|
1751
|
-
|
|
1781
|
+
document.removeEventListener("click", onOutsideClick);
|
|
1782
|
+
host.remove();
|
|
1752
1783
|
}, "onClick")
|
|
1753
1784
|
})
|
|
1754
1785
|
];
|
|
@@ -1764,33 +1795,39 @@ var MiaodaRuntime = (() => {
|
|
|
1764
1795
|
e.stopPropagation();
|
|
1765
1796
|
menu.style.display = menu.style.display === "none" ? "flex" : "none";
|
|
1766
1797
|
});
|
|
1767
|
-
|
|
1798
|
+
const onOutsideClick = /* @__PURE__ */ __name(() => {
|
|
1768
1799
|
menu.style.display = "none";
|
|
1769
|
-
});
|
|
1770
|
-
|
|
1800
|
+
}, "onOutsideClick");
|
|
1801
|
+
document.addEventListener("click", onOutsideClick);
|
|
1802
|
+
return host;
|
|
1771
1803
|
}
|
|
1772
1804
|
__name(buildMobileWatermark, "buildMobileWatermark");
|
|
1773
1805
|
var mounted = false;
|
|
1774
|
-
|
|
1775
|
-
|
|
1806
|
+
var pending = false;
|
|
1807
|
+
async function mountWatermark(variant) {
|
|
1808
|
+
if (mounted || pending || typeof document === "undefined") return;
|
|
1776
1809
|
if (document.readyState === "loading") {
|
|
1777
1810
|
document.addEventListener("DOMContentLoaded", () => mountWatermark(variant), {
|
|
1778
1811
|
once: true
|
|
1779
1812
|
});
|
|
1780
1813
|
return;
|
|
1781
1814
|
}
|
|
1815
|
+
pending = true;
|
|
1816
|
+
const shouldShow = await fetchShowBadge();
|
|
1782
1817
|
mounted = true;
|
|
1818
|
+
pending = false;
|
|
1819
|
+
if (!shouldShow) return;
|
|
1783
1820
|
const el = isMobile() ? buildMobileWatermark(variant) : buildDesktopWatermark(variant);
|
|
1784
1821
|
document.body.appendChild(el);
|
|
1785
1822
|
}
|
|
1786
1823
|
__name(mountWatermark, "mountWatermark");
|
|
1787
1824
|
function mountDoubaoWatermark() {
|
|
1788
|
-
mountWatermark("doubao");
|
|
1825
|
+
return mountWatermark("doubao");
|
|
1789
1826
|
}
|
|
1790
1827
|
__name(mountDoubaoWatermark, "mountDoubaoWatermark");
|
|
1791
1828
|
|
|
1792
1829
|
// src/doubao-runtime.ts
|
|
1793
|
-
var version = "0.0.
|
|
1830
|
+
var version = "0.0.14-alpha.20260918065040";
|
|
1794
1831
|
var name = "@lark-apaas/miaoda-coding-sdk";
|
|
1795
1832
|
if (isOnlineEnv()) {
|
|
1796
1833
|
reportPageView();
|
package/dist/doubao-runtime.js
CHANGED
|
@@ -1005,6 +1005,26 @@ var MiaodaRuntime = (() => {
|
|
|
1005
1005
|
return isPhone || isIpad;
|
|
1006
1006
|
}
|
|
1007
1007
|
__name(isMobile, "isMobile");
|
|
1008
|
+
async function fetchShowBadge() {
|
|
1009
|
+
var _a2, _b, _c;
|
|
1010
|
+
try {
|
|
1011
|
+
const appId = getAppId();
|
|
1012
|
+
if (!appId) return true;
|
|
1013
|
+
const url = isNewPathEnabled() ? `/app/${appId}/__runtime__/api/v1/studio/get_published` : `/spark/b/${appId}/get_published`;
|
|
1014
|
+
const response = await fetch(url, {
|
|
1015
|
+
headers: {
|
|
1016
|
+
"X-Suda-Csrf-Token": (_a2 = getCsrfToken()) != null ? _a2 : ""
|
|
1017
|
+
}
|
|
1018
|
+
});
|
|
1019
|
+
const res = await response.json();
|
|
1020
|
+
if (res.code === 0 || res.status_code === "0") {
|
|
1021
|
+
return ((_c = (_b = res.data) == null ? void 0 : _b.app_info) == null ? void 0 : _c.show_badge) !== false;
|
|
1022
|
+
}
|
|
1023
|
+
} catch {
|
|
1024
|
+
}
|
|
1025
|
+
return true;
|
|
1026
|
+
}
|
|
1027
|
+
__name(fetchShowBadge, "fetchShowBadge");
|
|
1008
1028
|
async function getLarkUserInfo() {
|
|
1009
1029
|
var _a2;
|
|
1010
1030
|
const appId = getAppId();
|
|
@@ -1642,19 +1662,47 @@ var MiaodaRuntime = (() => {
|
|
|
1642
1662
|
return card;
|
|
1643
1663
|
}
|
|
1644
1664
|
__name(buildMenuCard, "buildMenuCard");
|
|
1645
|
-
function
|
|
1646
|
-
const
|
|
1647
|
-
|
|
1648
|
-
|
|
1649
|
-
|
|
1650
|
-
right: "12px",
|
|
1651
|
-
bottom: "12px",
|
|
1652
|
-
zIndex: "9999",
|
|
1653
|
-
display: "flex",
|
|
1654
|
-
flexDirection: "column",
|
|
1655
|
-
alignItems: "flex-end",
|
|
1656
|
-
gap: "8px"
|
|
1665
|
+
function createWatermarkRoot(variant, mobile = false) {
|
|
1666
|
+
const host = document.createElement("div");
|
|
1667
|
+
host.setAttribute("data-custom-element", `${variant}-watermark${mobile ? "-mobile" : ""}`);
|
|
1668
|
+
const shadow = host.attachShadow({
|
|
1669
|
+
mode: "open"
|
|
1657
1670
|
});
|
|
1671
|
+
const style = document.createElement("style");
|
|
1672
|
+
style.textContent = `
|
|
1673
|
+
:host {
|
|
1674
|
+
all: initial !important;
|
|
1675
|
+
display: block !important;
|
|
1676
|
+
position: fixed !important;
|
|
1677
|
+
right: 12px !important;
|
|
1678
|
+
bottom: 12px !important;
|
|
1679
|
+
z-index: 9999 !important;
|
|
1680
|
+
direction: ltr !important;
|
|
1681
|
+
unicode-bidi: isolate !important;
|
|
1682
|
+
}
|
|
1683
|
+
:host::before, :host::after { content: none !important; }
|
|
1684
|
+
.watermark-root {
|
|
1685
|
+
all: initial;
|
|
1686
|
+
direction: ltr;
|
|
1687
|
+
unicode-bidi: isolate;
|
|
1688
|
+
font-family: ${FONT_FAMILY};
|
|
1689
|
+
display: flex;
|
|
1690
|
+
flex-direction: column;
|
|
1691
|
+
align-items: flex-end;
|
|
1692
|
+
gap: 8px;
|
|
1693
|
+
}
|
|
1694
|
+
`;
|
|
1695
|
+
const container = document.createElement("div");
|
|
1696
|
+
container.className = "watermark-root";
|
|
1697
|
+
shadow.append(style, container);
|
|
1698
|
+
return {
|
|
1699
|
+
host,
|
|
1700
|
+
container
|
|
1701
|
+
};
|
|
1702
|
+
}
|
|
1703
|
+
__name(createWatermarkRoot, "createWatermarkRoot");
|
|
1704
|
+
function buildDesktopWatermark(variant) {
|
|
1705
|
+
const { host, container } = createWatermarkRoot(variant);
|
|
1658
1706
|
const items = [];
|
|
1659
1707
|
if (variant === "doubao") {
|
|
1660
1708
|
items.push(buildMenuRow({
|
|
@@ -1685,7 +1733,7 @@ var MiaodaRuntime = (() => {
|
|
|
1685
1733
|
itemGap: 8
|
|
1686
1734
|
});
|
|
1687
1735
|
menu.style.display = "none";
|
|
1688
|
-
const pill = buildPill(variant, "desktop", () =>
|
|
1736
|
+
const pill = buildPill(variant, "desktop", () => host.remove());
|
|
1689
1737
|
const close = pill.querySelector("[data-watermark-close]");
|
|
1690
1738
|
container.append(menu, pill);
|
|
1691
1739
|
let timer = null;
|
|
@@ -1700,32 +1748,14 @@ var MiaodaRuntime = (() => {
|
|
|
1700
1748
|
if (close) close.style.display = "none";
|
|
1701
1749
|
}, 100);
|
|
1702
1750
|
});
|
|
1703
|
-
return
|
|
1751
|
+
return host;
|
|
1704
1752
|
}
|
|
1705
1753
|
__name(buildDesktopWatermark, "buildDesktopWatermark");
|
|
1706
1754
|
function buildMobileWatermark(variant) {
|
|
1707
|
-
const wrapper =
|
|
1708
|
-
wrapper.
|
|
1709
|
-
Object.assign(wrapper.style, {
|
|
1710
|
-
position: "fixed",
|
|
1711
|
-
right: "12px",
|
|
1712
|
-
bottom: "12px",
|
|
1713
|
-
zIndex: "9999",
|
|
1714
|
-
display: "flex",
|
|
1715
|
-
flexDirection: "column",
|
|
1716
|
-
alignItems: "flex-end",
|
|
1717
|
-
gap: "8px",
|
|
1718
|
-
cursor: "pointer"
|
|
1719
|
-
});
|
|
1755
|
+
const { host, container: wrapper } = createWatermarkRoot(variant, true);
|
|
1756
|
+
wrapper.style.cursor = "pointer";
|
|
1720
1757
|
const items = [];
|
|
1721
|
-
if (variant === "
|
|
1722
|
-
items.push(buildMenuRow({
|
|
1723
|
-
icon: "download",
|
|
1724
|
-
label: "\u4E0B\u8F7D\u8C46\u5305\u5DE5\u4F5C",
|
|
1725
|
-
fontSize: 16,
|
|
1726
|
-
onClick: /* @__PURE__ */ __name(() => window.open(VARIANT_CONFIG.doubao.downloadUrl, "_blank", "noopener,noreferrer"), "onClick")
|
|
1727
|
-
}));
|
|
1728
|
-
} else {
|
|
1758
|
+
if (variant === "miaoda") {
|
|
1729
1759
|
items.push(buildMenuRow({
|
|
1730
1760
|
icon: "efficiency",
|
|
1731
1761
|
label: "\u4E86\u89E3\u5999\u642D",
|
|
@@ -1748,7 +1778,8 @@ var MiaodaRuntime = (() => {
|
|
|
1748
1778
|
fontSize: 16,
|
|
1749
1779
|
onClick: /* @__PURE__ */ __name((e) => {
|
|
1750
1780
|
e.stopPropagation();
|
|
1751
|
-
|
|
1781
|
+
document.removeEventListener("click", onOutsideClick);
|
|
1782
|
+
host.remove();
|
|
1752
1783
|
}, "onClick")
|
|
1753
1784
|
})
|
|
1754
1785
|
];
|
|
@@ -1764,33 +1795,39 @@ var MiaodaRuntime = (() => {
|
|
|
1764
1795
|
e.stopPropagation();
|
|
1765
1796
|
menu.style.display = menu.style.display === "none" ? "flex" : "none";
|
|
1766
1797
|
});
|
|
1767
|
-
|
|
1798
|
+
const onOutsideClick = /* @__PURE__ */ __name(() => {
|
|
1768
1799
|
menu.style.display = "none";
|
|
1769
|
-
});
|
|
1770
|
-
|
|
1800
|
+
}, "onOutsideClick");
|
|
1801
|
+
document.addEventListener("click", onOutsideClick);
|
|
1802
|
+
return host;
|
|
1771
1803
|
}
|
|
1772
1804
|
__name(buildMobileWatermark, "buildMobileWatermark");
|
|
1773
1805
|
var mounted = false;
|
|
1774
|
-
|
|
1775
|
-
|
|
1806
|
+
var pending = false;
|
|
1807
|
+
async function mountWatermark(variant) {
|
|
1808
|
+
if (mounted || pending || typeof document === "undefined") return;
|
|
1776
1809
|
if (document.readyState === "loading") {
|
|
1777
1810
|
document.addEventListener("DOMContentLoaded", () => mountWatermark(variant), {
|
|
1778
1811
|
once: true
|
|
1779
1812
|
});
|
|
1780
1813
|
return;
|
|
1781
1814
|
}
|
|
1815
|
+
pending = true;
|
|
1816
|
+
const shouldShow = await fetchShowBadge();
|
|
1782
1817
|
mounted = true;
|
|
1818
|
+
pending = false;
|
|
1819
|
+
if (!shouldShow) return;
|
|
1783
1820
|
const el = isMobile() ? buildMobileWatermark(variant) : buildDesktopWatermark(variant);
|
|
1784
1821
|
document.body.appendChild(el);
|
|
1785
1822
|
}
|
|
1786
1823
|
__name(mountWatermark, "mountWatermark");
|
|
1787
1824
|
function mountDoubaoWatermark() {
|
|
1788
|
-
mountWatermark("doubao");
|
|
1825
|
+
return mountWatermark("doubao");
|
|
1789
1826
|
}
|
|
1790
1827
|
__name(mountDoubaoWatermark, "mountDoubaoWatermark");
|
|
1791
1828
|
|
|
1792
1829
|
// src/doubao-runtime.ts
|
|
1793
|
-
var version = "0.0.
|
|
1830
|
+
var version = "0.0.14-alpha.20260918065040";
|
|
1794
1831
|
var name = "@lark-apaas/miaoda-coding-sdk";
|
|
1795
1832
|
if (isOnlineEnv()) {
|
|
1796
1833
|
reportPageView();
|
|
@@ -1 +1,23 @@
|
|
|
1
|
-
"use strict";var MiaodaRuntime=(()=>{var Se=Object.create;var M=Object.defineProperty;var Ee=Object.getOwnPropertyDescriptor;var Ie=Object.getOwnPropertyNames;var Le=Object.getPrototypeOf,Te=Object.prototype.hasOwnProperty;var i=(n,e)=>M(n,"name",{value:e,configurable:!0});var U=(n,e)=>()=>(e||n((e={exports:{}}).exports,e),e.exports),Ae=(n,e)=>{for(var o in e)M(n,o,{get:e[o],enumerable:!0})},Z=(n,e,o,h)=>{if(e&&typeof e=="object"||typeof e=="function")for(let p of Ie(e))!Te.call(n,p)&&p!==o&&M(n,p,{get:()=>e[p],enumerable:!(h=Ee(e,p))||h.enumerable});return n};var J=(n,e,o)=>(o=n!=null?Se(Le(n)):{},Z(e||!n||!n.__esModule?M(o,"default",{value:n,enumerable:!0}):o,n)),Pe=n=>Z(M({},"__esModule",{value:!0}),n);var Y=U((q,R)=>{"use strict";(function(n){"use strict";function e(t,f){var r=(t&65535)+(f&65535),b=(t>>16)+(f>>16)+(r>>16);return b<<16|r&65535}i(e,"safeAdd");function o(t,f){return t<<f|t>>>32-f}i(o,"bitRotateLeft");function h(t,f,r,b,_,S){return e(o(e(e(f,t),e(b,S)),_),r)}i(h,"md5cmn");function p(t,f,r,b,_,S,A){return h(f&r|~f&b,t,f,_,S,A)}i(p,"md5ff");function m(t,f,r,b,_,S,A){return h(f&b|r&~b,t,f,_,S,A)}i(m,"md5gg");function g(t,f,r,b,_,S,A){return h(f^r^b,t,f,_,S,A)}i(g,"md5hh");function y(t,f,r,b,_,S,A){return h(r^(f|~b),t,f,_,S,A)}i(y,"md5ii");function C(t,f){t[f>>5]|=128<<f%32,t[(f+64>>>9<<4)+14]=f;var r,b,_,S,A,a=1732584193,s=-271733879,c=-1732584194,l=271733878;for(r=0;r<t.length;r+=16)b=a,_=s,S=c,A=l,a=p(a,s,c,l,t[r],7,-680876936),l=p(l,a,s,c,t[r+1],12,-389564586),c=p(c,l,a,s,t[r+2],17,606105819),s=p(s,c,l,a,t[r+3],22,-1044525330),a=p(a,s,c,l,t[r+4],7,-176418897),l=p(l,a,s,c,t[r+5],12,1200080426),c=p(c,l,a,s,t[r+6],17,-1473231341),s=p(s,c,l,a,t[r+7],22,-45705983),a=p(a,s,c,l,t[r+8],7,1770035416),l=p(l,a,s,c,t[r+9],12,-1958414417),c=p(c,l,a,s,t[r+10],17,-42063),s=p(s,c,l,a,t[r+11],22,-1990404162),a=p(a,s,c,l,t[r+12],7,1804603682),l=p(l,a,s,c,t[r+13],12,-40341101),c=p(c,l,a,s,t[r+14],17,-1502002290),s=p(s,c,l,a,t[r+15],22,1236535329),a=m(a,s,c,l,t[r+1],5,-165796510),l=m(l,a,s,c,t[r+6],9,-1069501632),c=m(c,l,a,s,t[r+11],14,643717713),s=m(s,c,l,a,t[r],20,-373897302),a=m(a,s,c,l,t[r+5],5,-701558691),l=m(l,a,s,c,t[r+10],9,38016083),c=m(c,l,a,s,t[r+15],14,-660478335),s=m(s,c,l,a,t[r+4],20,-405537848),a=m(a,s,c,l,t[r+9],5,568446438),l=m(l,a,s,c,t[r+14],9,-1019803690),c=m(c,l,a,s,t[r+3],14,-187363961),s=m(s,c,l,a,t[r+8],20,1163531501),a=m(a,s,c,l,t[r+13],5,-1444681467),l=m(l,a,s,c,t[r+2],9,-51403784),c=m(c,l,a,s,t[r+7],14,1735328473),s=m(s,c,l,a,t[r+12],20,-1926607734),a=g(a,s,c,l,t[r+5],4,-378558),l=g(l,a,s,c,t[r+8],11,-2022574463),c=g(c,l,a,s,t[r+11],16,1839030562),s=g(s,c,l,a,t[r+14],23,-35309556),a=g(a,s,c,l,t[r+1],4,-1530992060),l=g(l,a,s,c,t[r+4],11,1272893353),c=g(c,l,a,s,t[r+7],16,-155497632),s=g(s,c,l,a,t[r+10],23,-1094730640),a=g(a,s,c,l,t[r+13],4,681279174),l=g(l,a,s,c,t[r],11,-358537222),c=g(c,l,a,s,t[r+3],16,-722521979),s=g(s,c,l,a,t[r+6],23,76029189),a=g(a,s,c,l,t[r+9],4,-640364487),l=g(l,a,s,c,t[r+12],11,-421815835),c=g(c,l,a,s,t[r+15],16,530742520),s=g(s,c,l,a,t[r+2],23,-995338651),a=y(a,s,c,l,t[r],6,-198630844),l=y(l,a,s,c,t[r+7],10,1126891415),c=y(c,l,a,s,t[r+14],15,-1416354905),s=y(s,c,l,a,t[r+5],21,-57434055),a=y(a,s,c,l,t[r+12],6,1700485571),l=y(l,a,s,c,t[r+3],10,-1894986606),c=y(c,l,a,s,t[r+10],15,-1051523),s=y(s,c,l,a,t[r+1],21,-2054922799),a=y(a,s,c,l,t[r+8],6,1873313359),l=y(l,a,s,c,t[r+15],10,-30611744),c=y(c,l,a,s,t[r+6],15,-1560198380),s=y(s,c,l,a,t[r+13],21,1309151649),a=y(a,s,c,l,t[r+4],6,-145523070),l=y(l,a,s,c,t[r+11],10,-1120210379),c=y(c,l,a,s,t[r+2],15,718787259),s=y(s,c,l,a,t[r+9],21,-343485551),a=e(a,b),s=e(s,_),c=e(c,S),l=e(l,A);return[a,s,c,l]}i(C,"binlMD5");function T(t){var f,r="",b=t.length*32;for(f=0;f<b;f+=8)r+=String.fromCharCode(t[f>>5]>>>f%32&255);return r}i(T,"binl2rstr");function x(t){var f,r=[];for(r[(t.length>>2)-1]=void 0,f=0;f<r.length;f+=1)r[f]=0;var b=t.length*8;for(f=0;f<b;f+=8)r[f>>5]|=(t.charCodeAt(f/8)&255)<<f%32;return r}i(x,"rstr2binl");function I(t){return T(C(x(t),t.length*8))}i(I,"rstrMD5");function E(t,f){var r,b=x(t),_=[],S=[],A;for(_[15]=S[15]=void 0,b.length>16&&(b=C(b,t.length*8)),r=0;r<16;r+=1)_[r]=b[r]^909522486,S[r]=b[r]^1549556828;return A=C(_.concat(x(f)),512+f.length*8),T(C(S.concat(A),640))}i(E,"rstrHMACMD5");function P(t){var f="0123456789abcdef",r="",b,_;for(_=0;_<t.length;_+=1)b=t.charCodeAt(_),r+=f.charAt(b>>>4&15)+f.charAt(b&15);return r}i(P,"rstr2hex");function L(t){return unescape(encodeURIComponent(t))}i(L,"str2rstrUTF8");function d(t){return I(L(t))}i(d,"rawMD5");function u(t){return P(d(t))}i(u,"hexMD5");function w(t,f){return E(L(t),L(f))}i(w,"rawHMACMD5");function v(t,f){return P(w(t,f))}i(v,"hexHMACMD5");function k(t,f,r){return f?r?w(f,t):v(f,t):r?d(t):u(t)}i(k,"md5"),typeof define=="function"&&define.amd?define(function(){return k}):typeof R=="object"&&R.exports?R.exports=k:n.md5=k})(q)});var X=U((F,Q)=>{"use strict";(function(n,e){typeof F=="object"?Q.exports=F=e():typeof define=="function"&&define.amd?define([],e):n.CryptoJS=e()})(F,function(){var n=n||(function(e,o){var h=Object.create||(function(){function d(){}return i(d,"F"),function(u){var w;return d.prototype=u,w=new d,d.prototype=null,w}})(),p={},m=p.lib={},g=m.Base=(function(){return{extend:i(function(d){var u=h(this);return d&&u.mixIn(d),(!u.hasOwnProperty("init")||this.init===u.init)&&(u.init=function(){u.$super.init.apply(this,arguments)}),u.init.prototype=u,u.$super=this,u},"extend"),create:i(function(){var d=this.extend();return d.init.apply(d,arguments),d},"create"),init:i(function(){},"init"),mixIn:i(function(d){for(var u in d)d.hasOwnProperty(u)&&(this[u]=d[u]);d.hasOwnProperty("toString")&&(this.toString=d.toString)},"mixIn"),clone:i(function(){return this.init.prototype.extend(this)},"clone")}})(),y=m.WordArray=g.extend({init:i(function(d,u){d=this.words=d||[],u!=o?this.sigBytes=u:this.sigBytes=d.length*4},"init"),toString:i(function(d){return(d||T).stringify(this)},"toString"),concat:i(function(d){var u=this.words,w=d.words,v=this.sigBytes,k=d.sigBytes;if(this.clamp(),v%4)for(var t=0;t<k;t++){var f=w[t>>>2]>>>24-t%4*8&255;u[v+t>>>2]|=f<<24-(v+t)%4*8}else for(var t=0;t<k;t+=4)u[v+t>>>2]=w[t>>>2];return this.sigBytes+=k,this},"concat"),clamp:i(function(){var d=this.words,u=this.sigBytes;d[u>>>2]&=4294967295<<32-u%4*8,d.length=e.ceil(u/4)},"clamp"),clone:i(function(){var d=g.clone.call(this);return d.words=this.words.slice(0),d},"clone"),random:i(function(d){for(var u=[],w=i(function(r){var r=r,b=987654321,_=4294967295;return function(){b=36969*(b&65535)+(b>>16)&_,r=18e3*(r&65535)+(r>>16)&_;var S=(b<<16)+r&_;return S/=4294967296,S+=.5,S*(e.random()>.5?1:-1)}},"r"),v=0,k;v<d;v+=4){var t=w((k||e.random())*4294967296);k=t()*987654071,u.push(t()*4294967296|0)}return new y.init(u,d)},"random")}),C=p.enc={},T=C.Hex={stringify:i(function(d){for(var u=d.words,w=d.sigBytes,v=[],k=0;k<w;k++){var t=u[k>>>2]>>>24-k%4*8&255;v.push((t>>>4).toString(16)),v.push((t&15).toString(16))}return v.join("")},"stringify"),parse:i(function(d){for(var u=d.length,w=[],v=0;v<u;v+=2)w[v>>>3]|=parseInt(d.substr(v,2),16)<<24-v%8*4;return new y.init(w,u/2)},"parse")},x=C.Latin1={stringify:i(function(d){for(var u=d.words,w=d.sigBytes,v=[],k=0;k<w;k++){var t=u[k>>>2]>>>24-k%4*8&255;v.push(String.fromCharCode(t))}return v.join("")},"stringify"),parse:i(function(d){for(var u=d.length,w=[],v=0;v<u;v++)w[v>>>2]|=(d.charCodeAt(v)&255)<<24-v%4*8;return new y.init(w,u)},"parse")},I=C.Utf8={stringify:i(function(d){try{return decodeURIComponent(escape(x.stringify(d)))}catch{throw new Error("Malformed UTF-8 data")}},"stringify"),parse:i(function(d){return x.parse(unescape(encodeURIComponent(d)))},"parse")},E=m.BufferedBlockAlgorithm=g.extend({reset:i(function(){this._data=new y.init,this._nDataBytes=0},"reset"),_append:i(function(d){typeof d=="string"&&(d=I.parse(d)),this._data.concat(d),this._nDataBytes+=d.sigBytes},"_append"),_process:i(function(d){var u=this._data,w=u.words,v=u.sigBytes,k=this.blockSize,t=k*4,f=v/t;d?f=e.ceil(f):f=e.max((f|0)-this._minBufferSize,0);var r=f*k,b=e.min(r*4,v);if(r){for(var _=0;_<r;_+=k)this._doProcessBlock(w,_);var S=w.splice(0,r);u.sigBytes-=b}return new y.init(S,b)},"_process"),clone:i(function(){var d=g.clone.call(this);return d._data=this._data.clone(),d},"clone"),_minBufferSize:0}),P=m.Hasher=E.extend({cfg:g.extend(),init:i(function(d){this.cfg=this.cfg.extend(d),this.reset()},"init"),reset:i(function(){E.reset.call(this),this._doReset()},"reset"),update:i(function(d){return this._append(d),this._process(),this},"update"),finalize:i(function(d){d&&this._append(d);var u=this._doFinalize();return u},"finalize"),blockSize:512/32,_createHelper:i(function(d){return function(u,w){return new d.init(w).finalize(u)}},"_createHelper"),_createHmacHelper:i(function(d){return function(u,w){return new L.HMAC.init(d,w).finalize(u)}},"_createHmacHelper")}),L=p.algo={};return p})(Math);return n})});var te=U((N,ee)=>{"use strict";(function(n,e){typeof N=="object"?ee.exports=N=e(X()):typeof define=="function"&&define.amd?define(["./core"],e):e(n.CryptoJS)})(N,function(n){return(function(){var e=n,o=e.lib,h=o.WordArray,p=o.Hasher,m=e.algo,g=[],y=m.SHA1=p.extend({_doReset:i(function(){this._hash=new h.init([1732584193,4023233417,2562383102,271733878,3285377520])},"_doReset"),_doProcessBlock:i(function(C,T){for(var x=this._hash.words,I=x[0],E=x[1],P=x[2],L=x[3],d=x[4],u=0;u<80;u++){if(u<16)g[u]=C[T+u]|0;else{var w=g[u-3]^g[u-8]^g[u-14]^g[u-16];g[u]=w<<1|w>>>31}var v=(I<<5|I>>>27)+d+g[u];u<20?v+=(E&P|~E&L)+1518500249:u<40?v+=(E^P^L)+1859775393:u<60?v+=(E&P|E&L|P&L)-1894007588:v+=(E^P^L)-899497514,d=L,L=P,P=E<<30|E>>>2,E=I,I=v}x[0]=x[0]+I|0,x[1]=x[1]+E|0,x[2]=x[2]+P|0,x[3]=x[3]+L|0,x[4]=x[4]+d|0},"_doProcessBlock"),_doFinalize:i(function(){var C=this._data,T=C.words,x=this._nDataBytes*8,I=C.sigBytes*8;return T[I>>>5]|=128<<24-I%32,T[(I+64>>>9<<4)+14]=Math.floor(x/4294967296),T[(I+64>>>9<<4)+15]=x,C.sigBytes=T.length*4,this._process(),this._hash},"_doFinalize"),clone:i(function(){var C=p.clone.call(this);return C._hash=this._hash.clone(),C},"clone")});e.SHA1=p._createHelper(y),e.HmacSHA1=p._createHmacHelper(y)})(),n.SHA1})});var ct={};Ae(ct,{TrackKey:()=>z,name:()=>st,reportTeaEvent:()=>G,version:()=>at});var oe=J(Y(),1),ae=J(te(),1);function O(){return window.appId||null}i(O,"getAppId");function Oe(){var o;let n="suda-csrf-token",e=document.cookie.split("; ");for(let h of e){let[p,m]=h.split("=");if(p===n)return decodeURIComponent(m)}return(o=window.csrfToken)!=null?o:null}i(Oe,"getCsrfToken");function $(){let n=globalThis.CLIENT_BASE_PATH||"/";return/^\/app\/[^/]/.test(n)}i($,"isNewPathEnabled");function W(){switch(globalThis.ENVIRONMENT){case"gray":return"PRE";case"online":return"ONLINE";default:return"BOE"}}i(W,"getEnv");function ne(){return window.appEnv!=null?window.appEnv==="runtime":!0}i(ne,"isOnlineEnv");function j(){let n=navigator.userAgent,e=/(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i.test(n),o=/iPad|Tab|Tablet/i.test(n)&&navigator.maxTouchPoints>1;return e||o}i(j,"isMobile");async function re(){var h;let n=O();if(!n)return{code:1,msg:"appId is required",data:{}};let e=$()?`/app/${n}/__runtime__/api/v1/studio/lark/user_info`:`/spark/b/${n}/lark/user_info`;return await(await fetch(e,{headers:{"X-Suda-Csrf-Token":(h=Oe())!=null?h:""}})).json()}i(re,"getLarkUserInfo");var z={VIEW:"aily_agent_artifact_page_view"},Be="08a441",De="42b91e";function ie(n){let e=String(n);return(0,ae.default)(Be+(0,oe.default)(e+De)).toString()}i(ie,"encryptTea");var V=!1;async function Me(){var m,g,y,C;let{data:n}=await re(),{tenantID:e,userID:o}=n||{},h=o&&o!=="0"?ie(o):void 0,p=e&&e!=="0"?ie(e):void 0;(m=window.collectEvent)==null||m.call(window,"init",{app_id:788827,channel:"cn",disable_auto_pv:!1,enable_ab_test:!1,enable_debug:!1,enable_stay_duration:!0,reportTime:1e3}),(y=window.collectEvent)==null||y.call(window,"config",{user_unique_id:h,device_type:j()?"mobile":"pc",evtParams:{open_from:(g=new URLSearchParams(window.location.search).get("open-from"))!=null?g:void 0,env:W(),user_id:h,tenant_id:p}}),V=!0,(C=window.collectEvent)==null||C.call(window,"start")}i(Me,"createTracker");async function G({trackKey:n,trackParams:e={}}){var o;try{V||(V=!0,await Me()),(o=window.collectEvent)==null||o.call(window,n,e)}catch(h){console.error(h)}}i(G,"reportTeaEvent");function se(){return G({trackKey:z.VIEW,trackParams:{artifact_uid:O(),agent_id:"agent_miaoda",url:window.location.href}})}i(se,"reportPageView");function ce(){if(typeof crypto!="undefined"&&crypto.getRandomValues){let e=new Uint8Array(8);return crypto.getRandomValues(e),Array.from(e).map(o=>o.toString(16).padStart(2,"0")).join("")}let n="";for(let e=0;e<16;e++)n+=Math.floor(Math.random()*16).toString(16);return n}i(ce,"generateUUID");var le="x_sdk_device_id";function He(){try{let n=localStorage.getItem(le);return n||(n=ce(),localStorage.setItem(le,n)),n}catch{return ce()}}i(He,"getDeviceId");function Re(){let n=typeof navigator!="undefined"?navigator.userAgent:"";return n&&(/Android/i.test(n)&&/Mobile/i.test(n)||/iPhone|iPod/i.test(n)||/BlackBerry|IEMobile|Opera Mini/i.test(n))?"mobile":"desktop"}i(Re,"getDeviceType");var Fe="pageSessionID";function Ne(){try{return new URLSearchParams(window.location.search).get(Fe)||""}catch{return""}}i(Ne,"getPvId");function We(n={}){let e=n.pvId||Ne();return{app_id:window.appId||"",tenant_id:window.tenantId||"",user_id:window.userId||"",did:He(),module:"app_web",app_env:"runtime",source_type:"user",device_type:Re(),release_commit_id:window.__RELEASE_COMMIT_ID__||"",...e?{pv_id:e}:{}}}i(We,"getDefaultAttributes");function de(n){let e=Math.round(n);if(!Number.isFinite(e))throw new RangeError(`toNanoString: \u975E\u6CD5\u65F6\u95F4\u6233 ${n}`);return typeof BigInt!="function"?e===0?"0":`${e}000000`:String(BigInt(e)*BigInt(1e6))}i(de,"toNanoString");var je="1.0.2";function Ue(n,e){let o=We(e),h=de(Date.now());return{metricsData:{resource:{attributes:{sdk_version:je,sdk_lang:"javascript",sdk_type:"client-frontend"}},metrics:[{name:"apaas_internal_metrics_pv_uv",description:"Count of page views",unit:"",scopeName:"apaas_internal_metrics_pv_uv",sum:{aggregationTemporality:1,isMonotonic:!0,dataPoints:n.map(p=>({attributes:{...o,url:p.url,path:p.path,referrer:p.referrer},startTimeUnixNano:de(p.timestampMs),timeUnixNano:h,asDouble:1}))}}]}}}i(Ue,"buildPayload");function $e(n,e,o={},h){if(e.length===0)return;let p;try{p=JSON.stringify(Ue(e,h))}catch{return}try{fetch(n,{method:"POST",headers:{"Content-Type":"application/json","X-Suda-Csrf-Token":window.csrfToken||"",...o},body:p,keepalive:!0}).catch(()=>{})}catch{}}i($e,"sendPvData");var K="__APAAS_PV_TRACKER_STARTED__";function Ve(){try{let n=window;return n[K]?!1:(n[K]=!0,!0)}catch{return!0}}i(Ve,"claimPvReporting");function ue(){try{window[K]=!1}catch{}}i(ue,"releasePvReporting");var B,ze=(B=class{constructor(){this.started=!1,this.disposers=[],this.holdsPvReporting=!1,this.buffer=[]}static get instance(){return this._instance||(this._instance=new B),this._instance}start(e){var o;if(!this.started&&Ve()){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,ue(),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,ue())}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);$e(this.config.collectorUrl,e,this.config.headers,{pvId:this.config.pvId})}listenRouteChanges(){this.recordPv();let e=i(()=>this.recordPv(),"onPopState");window.addEventListener("popstate",e),this.disposers.push(()=>window.removeEventListener("popstate",e)),this.patchHistory("pushState"),this.patchHistory("replaceState")}patchHistory(e){let o=history[e],h=i(()=>this.recordPv(),"recordPv");history[e]=function(...p){let m=o.apply(this,p);return h(),m},this.disposers.push(()=>{history[e]=o})}registerLifecycleListeners(){let e=i(()=>{document.visibilityState==="hidden"&&this.flush()},"onVisibilityChange");document.addEventListener("visibilitychange",e),this.disposers.push(()=>document.removeEventListener("visibilitychange",e));let o=i(()=>this.flush(),"onPageHide");window.addEventListener("pagehide",o),this.disposers.push(()=>window.removeEventListener("pagehide",o))}},i(B,"_PvTracker"),B),fe=ze.instance;function pe(){var o;let n=(o=O())!=null?o:"",e=$()?`/app/${n}/__runtime__/api/v1/observability/metrics/collect`:`/spark/app/${n}/runtime/api/v1/observability/metrics/collect`;fe.start({collectorUrl:e})}i(pe,"initPvTracking");var ge="https://lf3-static.bytednsdoc.com/obj/eden-cn/LMfspH/ljhwZthlaukjlkulzlp",Ge=`${ge}/miaoda-ui/doubao.svg`,Ke=`${ge}/logo/miaodalogo.svg`,me='<svg viewBox="0 0 10 10" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M8.08312 8.08298C8.2384 7.92769 8.23953 7.67705 8.08424 7.52176L5.3625 4.80002L8.08422 2.07829C8.23951 1.92301 8.23839 1.67236 8.0831 1.51708C7.92781 1.36179 7.67717 1.36066 7.52188 1.51595C7.36659 1.67124 4.80016 4.23767 4.80016 4.23767L2.07841 1.51593C1.92313 1.36064 1.67248 1.36177 1.5172 1.51705C1.36191 1.67234 1.36078 1.92298 1.51607 2.07827L4.23782 4.80002L1.51605 7.52178C1.36076 7.67707 1.36189 7.92771 1.51718 8.083C1.67246 8.23829 1.92311 8.23941 2.07839 8.08412L4.80016 5.36236L7.5219 8.0841C7.67719 8.23939 7.92783 8.23826 8.08312 8.08298Z" fill="currentColor"/></svg>',Ze='<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M12.6667 2H3.33333V14H6.66667V15.3334H3.33333C2.59695 15.3334 2 14.7364 2 14V2C2 1.26364 2.59695 0.666687 3.33333 0.666687H12.6667C13.403 0.666687 14 1.26364 14 2V7.33335H12.6667V2Z" fill="currentColor"/><path d="M5.33333 4.66669C4.96514 4.66669 4.66667 4.96516 4.66667 5.33335C4.66667 5.70154 4.96514 6 5.33333 6H10.6667C11.0349 6 11.3333 5.70154 11.3333 5.33335C11.3333 4.96516 11.0349 4.66669 10.6667 4.66669H5.33333Z" fill="currentColor"/><path d="M4.66667 8.33335C4.66667 7.96516 4.96514 7.66669 5.33333 7.66669H8C8.36819 7.66669 8.66667 7.96516 8.66667 8.33335C8.66667 8.70154 8.36819 9 8 9H5.33333C4.96514 9 4.66667 8.70154 4.66667 8.33335Z" fill="currentColor"/><path d="M13.5523 8.70017C13.9428 8.30964 14.576 8.30964 14.9665 8.70017C15.357 9.09069 15.357 9.72386 14.9665 10.1144L14.2594 10.8215L12.8452 9.40728L13.5523 8.70017Z" fill="currentColor"/><path d="M12.1381 10.1144L13.5523 11.5286L10.2309 14.85C10.0916 14.9892 9.91229 15.0815 9.71798 15.1138L8.45737 15.3234C8.42136 15.3294 8.38467 15.3177 8.35885 15.2918C8.33271 15.2657 8.32099 15.2284 8.32749 15.192L8.55128 13.9374C8.58465 13.7502 8.6746 13.5779 8.80901 13.4435L12.1381 10.1144Z" fill="currentColor"/></svg>',Je='<svg width="16" height="16" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M11.9922 1.99221C12.5445 1.98895 12.9958 2.43407 12.999 2.98634L13.0762 16.1943L14.6387 14.6328L17.8926 11.3789C18.2831 10.9884 18.9171 10.9885 19.3076 11.3789C19.6977 11.7695 19.6979 12.4026 19.3076 12.793L16.0527 16.0479L12.7979 19.3018C12.7111 19.3884 12.6098 19.4566 12.5 19.5059H20.375C20.9271 19.5059 21.3748 19.9538 21.375 20.5059C21.375 21.0581 20.9273 21.5059 20.375 21.5059H3.625C3.07272 21.5059 2.625 21.0581 2.625 20.5059C2.62523 19.9538 3.07286 19.5059 3.625 19.5059H11.6816C11.572 19.4566 11.4704 19.3884 11.3838 19.3018L4.87402 12.793C4.48372 12.4026 4.4839 11.7694 4.87402 11.3789C5.26452 10.9884 5.89756 10.9885 6.28809 11.3789L11.0762 16.166L10.999 2.99806C10.9958 2.44603 11.4402 1.99582 11.9922 1.99221Z" fill="currentColor"/></svg>',qe='<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M2.0754 7.57153C2.23188 9.44922 3.49231 11.053 5.27982 11.6488C5.31351 11.6601 5.33994 11.6865 5.35117 11.7202L5.72076 12.8289C5.88752 13.3292 6.3557 13.6667 6.88304 13.6667H9.11696C9.6443 13.6667 10.1125 13.3292 10.2792 12.8289L10.6488 11.7202C10.6601 11.6865 10.6865 11.6601 10.7202 11.6488C12.5077 11.053 13.7681 9.44922 13.9246 7.57153L14 6.66667C14 3.35296 11.3137 0.666668 8 0.666668C4.68629 0.666668 2 3.35296 2 6.66667L2.0754 7.57153ZM9.38392 11.2985L9.03899 12.3333H6.96101L6.61608 11.2985C6.47214 10.8667 6.13328 10.5279 5.70146 10.3839C4.41995 9.95675 3.51631 8.80696 3.40413 7.4608L3.33362 6.61462C3.36152 4.06127 5.44004 2 8 2C10.56 2 12.6385 4.06127 12.6664 6.61462L12.5959 7.4608C12.4837 8.80696 11.5801 9.95675 10.2985 10.3839C9.86672 10.5279 9.52786 10.8667 9.38392 11.2985Z" fill="currentColor"/><path d="M6.66667 14.3333C6.29848 14.3333 6 14.6318 6 15C6 15.3682 6.29848 15.6667 6.66667 15.6667H9.33333C9.70152 15.6667 10 15.3682 10 15C10 14.6318 9.70152 14.3333 9.33333 14.3333H6.66667Z" fill="currentColor"/><path d="M8.00864 4.13208L5.44578 6.94049C5.20258 7.18228 5.37835 7.56531 5.74361 7.58951L7.2181 7.6872L7.21814 9.60852C7.21814 9.96788 7.72139 10.1366 7.99168 9.86792C8.26197 9.59921 10.5545 7.05951 10.5545 7.05951C10.7977 6.81772 10.622 6.43469 10.2567 6.41049L8.78222 6.3128L8.78219 4.39148C8.78218 4.03212 8.27893 3.86336 8.00864 4.13208Z" fill="currentColor"/></svg>',ve=!0,Ye="0px 8px 32px rgba(0,0,0,0.08), 0px 4px 16px rgba(0,0,0,0.04), 0px 2px 4px rgba(0,0,0,0.02)",Qe="0px 4px 16px rgba(0,0,0,0.03), 0px 4px 10px rgba(0,0,0,0.03), 0px 2px 4px rgba(0,0,0,0.02)",be="'PingFang SC', -apple-system, BlinkMacSystemFont, sans-serif",H={doubao:{brandText:"\u8C46\u5305\u5DE5\u4F5C\u751F\u6210",logoSrc:Ge,downloadUrl:"https://ugapk.com/FCtLH"},miaoda:{brandText:"\u5999\u642D\u751F\u6210",logoSrc:Ke,landingUrl:"https://miaoda.feishu.cn/landing"}},Xe={BOE:"tns.feishu-boe.cn",PRE:"tns.feishu-pre.cn",ONLINE:"tns.feishu.cn"};function ye(){var o;let n=JSON.stringify({scene:"miaoda_app_report",entity_id:(o=O())!=null?o:"",entity_type:"miaoda_app",extra:""}),e=`https://${Xe[W()]}/cust/lark_report/?type=common¶ms=${encodeURIComponent(n)}&lang=zh-CN`;window.open(e,"_blank","noopener,noreferrer")}i(ye,"openReport");var et={feedback:Ze,close:me,download:Je,efficiency:qe};function we(n){let e=document.createElement("span");Object.assign(e.style,{display:"inline-flex",width:`${n}px`,height:`${n}px`,flexShrink:"0"}),e.innerHTML=me;let o=e.firstElementChild;return o&&(o.setAttribute("width",String(n)),o.setAttribute("height",String(n)),o.style.display="block"),e}i(we,"makeCloseIcon");function tt(n,e=16){if(n==="close")return we(e);let o=document.createElement("span");Object.assign(o.style,{display:"inline-flex",width:`${e}px`,height:`${e}px`,flexShrink:"0"}),o.innerHTML=et[n];let h=o.firstElementChild;return h&&(h.style.display="block"),o}i(tt,"makeIcon");function nt(n,e){let o=document.createElement("img");return o.src=n,o.width=e,o.height=e,o.alt="",Object.assign(o.style,{width:`${e}px`,height:`${e}px`,maxWidth:"none",maxHeight:"none",borderRadius:"100px",flexShrink:"0",display:"block"}),o}i(nt,"makeLogo");function _e(n,e,o){let h=e==="desktop",p=H[n],m=document.createElement("div");Object.assign(m.style,{boxSizing:"border-box",display:"inline-flex",alignItems:"center",gap:"4px",padding:h?"6px 12px 6px 8px":"5px 12px 5px 8px",background:"#363636",border:"0.5px solid rgba(255,255,255,0.1)",borderRadius:"100px",boxShadow:Ye,cursor:"pointer"});let g=nt(p.logoSrc,16),y=document.createElement("span");if(y.textContent=p.brandText,Object.assign(y.style,{fontFamily:be,fontSize:h?"12px":"14px",lineHeight:h?"18px":"22px",color:"rgba(255,255,255,0.85)",whiteSpace:"nowrap"}),m.append(g,y),h&&o){let C=document.createElement("span");C.setAttribute("role","button"),C.setAttribute("aria-label","\u5173\u95ED"),C.setAttribute("data-watermark-close",""),Object.assign(C.style,{display:"none",alignItems:"center",cursor:"pointer",flexShrink:"0",color:"rgba(255,255,255,0.5)"}),C.appendChild(we(10)),C.addEventListener("click",T=>{T.stopPropagation(),o()}),m.appendChild(C)}return m}i(_e,"buildPill");function D(n){let e=document.createElement("div");e.setAttribute("role","menuitem"),e.setAttribute("data-label",n.label),Object.assign(e.style,{boxSizing:"border-box",display:"flex",alignItems:"center",gap:"8px",minHeight:"38px",padding:"4px 10px",borderRadius:"6px",cursor:"pointer",color:"#000000"});let o=document.createElement("span");Object.assign(o.style,{display:"inline-flex",width:"16px",height:"16px",flexShrink:"0",color:"#000000"}),o.appendChild(tt(n.icon));let h=document.createElement("span");return h.textContent=n.label,Object.assign(h.style,{fontFamily:be,fontSize:`${n.fontSize}px`,lineHeight:`${n.fontSize+8}px`,color:"#000000",whiteSpace:"nowrap"}),e.append(o,h),e.addEventListener("mouseenter",()=>{e.style.background="rgba(0,0,0,0.04)"}),e.addEventListener("mouseleave",()=>{e.style.background="transparent"}),e.addEventListener("click",n.onClick),e}i(D,"buildMenuRow");function rt(){let n=document.createElement("div");return Object.assign(n.style,{height:"1px",background:"rgba(0,0,0,0.08)",margin:"0 10px"}),n}i(rt,"buildDivider");function Ce(n){var o;let e=document.createElement("div");if(Object.assign(e.style,{boxSizing:"border-box",display:"flex",flexDirection:"column",minWidth:`${n.minWidth}px`,background:"#ffffff",border:"0.5px solid rgba(0,0,0,0.1)",borderRadius:"10px",boxShadow:Qe,overflow:"hidden",outline:"none"}),n.items.length){let h=document.createElement("div");Object.assign(h.style,{boxSizing:"border-box",padding:"4px",display:"flex",flexDirection:"column",gap:`${(o=n.itemGap)!=null?o:0}px`}),n.items.forEach(p=>h.appendChild(p)),e.appendChild(h)}if(n.extraItems&&n.extraItems.length){e.appendChild(rt());let h=document.createElement("div");Object.assign(h.style,{boxSizing:"border-box",padding:"4px"}),n.extraItems.forEach(p=>h.appendChild(p)),e.appendChild(h)}return e}i(Ce,"buildMenuCard");function it(n){let e=document.createElement("div");e.setAttribute("data-custom-element",`${n}-watermark`),Object.assign(e.style,{position:"fixed",right:"12px",bottom:"12px",zIndex:"9999",display:"flex",flexDirection:"column",alignItems:"flex-end",gap:"8px"});let o=[];n==="doubao"?o.push(D({icon:"download",label:"\u4E0B\u8F7D\u8C46\u5305\u5DE5\u4F5C",fontSize:14,onClick:i(()=>window.open(H.doubao.downloadUrl,"_blank","noopener,noreferrer"),"onClick")})):o.push(D({icon:"efficiency",label:"\u4E86\u89E3\u5999\u642D",fontSize:14,onClick:i(()=>window.open(H.miaoda.landingUrl,"_blank","noopener,noreferrer"),"onClick")})),ve&&o.push(D({icon:"feedback",label:"\u6295\u8BC9\u4E0E\u4E3E\u62A5",fontSize:14,onClick:ye}));let h=Ce({items:o,minWidth:160,itemGap:8});h.style.display="none";let p=_e(n,"desktop",()=>e.remove()),m=p.querySelector("[data-watermark-close]");e.append(h,p);let g=null;return e.addEventListener("mouseenter",()=>{g&&clearTimeout(g),h.style.display="flex",m&&(m.style.display="inline-flex")}),e.addEventListener("mouseleave",()=>{g=setTimeout(()=>{h.style.display="none",m&&(m.style.display="none")},100)}),e}i(it,"buildDesktopWatermark");function ot(n){let e=document.createElement("div");e.setAttribute("data-custom-element",`${n}-watermark-mobile`),Object.assign(e.style,{position:"fixed",right:"12px",bottom:"12px",zIndex:"9999",display:"flex",flexDirection:"column",alignItems:"flex-end",gap:"8px",cursor:"pointer"});let o=[];n==="doubao"?o.push(D({icon:"download",label:"\u4E0B\u8F7D\u8C46\u5305\u5DE5\u4F5C",fontSize:16,onClick:i(()=>window.open(H.doubao.downloadUrl,"_blank","noopener,noreferrer"),"onClick")})):o.push(D({icon:"efficiency",label:"\u4E86\u89E3\u5999\u642D",fontSize:16,onClick:i(()=>window.open(H.miaoda.landingUrl,"_blank","noopener,noreferrer"),"onClick")})),ve&&o.push(D({icon:"feedback",label:"\u6295\u8BC9\u4E0E\u4E3E\u62A5",fontSize:16,onClick:ye}));let h=[D({icon:"close",label:"\u4E0D\u518D\u5C55\u793A",fontSize:16,onClick:i(g=>{g.stopPropagation(),e.remove()},"onClick")})],p=Ce({items:o,extraItems:h,minWidth:160});p.style.display="none";let m=_e(n,"mobile");return e.append(p,m),e.addEventListener("click",g=>{g.stopPropagation(),p.style.display=p.style.display==="none"?"flex":"none"}),document.addEventListener("click",()=>{p.style.display="none"}),e}i(ot,"buildMobileWatermark");var he=!1;function xe(n){if(he||typeof document=="undefined")return;if(document.readyState==="loading"){document.addEventListener("DOMContentLoaded",()=>xe(n),{once:!0});return}he=!0;let e=j()?ot(n):it(n);document.body.appendChild(e)}i(xe,"mountWatermark");function ke(){xe("doubao")}i(ke,"mountDoubaoWatermark");var at="0.0.13",st="@lark-apaas/miaoda-coding-sdk";ne()&&(se(),pe());ke();return Pe(ct);})();
|
|
1
|
+
"use strict";var MiaodaRuntime=(()=>{var Te=Object.create;var H=Object.defineProperty;var Ae=Object.getOwnPropertyDescriptor;var Pe=Object.getOwnPropertyNames;var Be=Object.getPrototypeOf,Oe=Object.prototype.hasOwnProperty;var i=(n,e)=>H(n,"name",{value:e,configurable:!0});var U=(n,e)=>()=>(e||n((e={exports:{}}).exports,e),e.exports),Me=(n,e)=>{for(var o in e)H(n,o,{get:e[o],enumerable:!0})},q=(n,e,o,u)=>{if(e&&typeof e=="object"||typeof e=="function")for(let p of Pe(e))!Oe.call(n,p)&&p!==o&&H(n,p,{get:()=>e[p],enumerable:!(u=Ae(e,p))||u.enumerable});return n};var X=(n,e,o)=>(o=n!=null?Te(Be(n)):{},q(e||!n||!n.__esModule?H(o,"default",{value:n,enumerable:!0}):o,n)),He=n=>q(H({},"__esModule",{value:!0}),n);var Q=U((Y,D)=>{"use strict";(function(n){"use strict";function e(t,h){var r=(t&65535)+(h&65535),y=(t>>16)+(h>>16)+(r>>16);return y<<16|r&65535}i(e,"safeAdd");function o(t,h){return t<<h|t>>>32-h}i(o,"bitRotateLeft");function u(t,h,r,y,C,S){return e(o(e(e(h,t),e(y,S)),C),r)}i(u,"md5cmn");function p(t,h,r,y,C,S,A){return u(h&r|~h&y,t,h,C,S,A)}i(p,"md5ff");function m(t,h,r,y,C,S,A){return u(h&y|r&~y,t,h,C,S,A)}i(m,"md5gg");function g(t,h,r,y,C,S,A){return u(h^r^y,t,h,C,S,A)}i(g,"md5hh");function v(t,h,r,y,C,S,A){return u(r^(h|~y),t,h,C,S,A)}i(v,"md5ii");function w(t,h){t[h>>5]|=128<<h%32,t[(h+64>>>9<<4)+14]=h;var r,y,C,S,A,a=1732584193,s=-271733879,c=-1732584194,l=271733878;for(r=0;r<t.length;r+=16)y=a,C=s,S=c,A=l,a=p(a,s,c,l,t[r],7,-680876936),l=p(l,a,s,c,t[r+1],12,-389564586),c=p(c,l,a,s,t[r+2],17,606105819),s=p(s,c,l,a,t[r+3],22,-1044525330),a=p(a,s,c,l,t[r+4],7,-176418897),l=p(l,a,s,c,t[r+5],12,1200080426),c=p(c,l,a,s,t[r+6],17,-1473231341),s=p(s,c,l,a,t[r+7],22,-45705983),a=p(a,s,c,l,t[r+8],7,1770035416),l=p(l,a,s,c,t[r+9],12,-1958414417),c=p(c,l,a,s,t[r+10],17,-42063),s=p(s,c,l,a,t[r+11],22,-1990404162),a=p(a,s,c,l,t[r+12],7,1804603682),l=p(l,a,s,c,t[r+13],12,-40341101),c=p(c,l,a,s,t[r+14],17,-1502002290),s=p(s,c,l,a,t[r+15],22,1236535329),a=m(a,s,c,l,t[r+1],5,-165796510),l=m(l,a,s,c,t[r+6],9,-1069501632),c=m(c,l,a,s,t[r+11],14,643717713),s=m(s,c,l,a,t[r],20,-373897302),a=m(a,s,c,l,t[r+5],5,-701558691),l=m(l,a,s,c,t[r+10],9,38016083),c=m(c,l,a,s,t[r+15],14,-660478335),s=m(s,c,l,a,t[r+4],20,-405537848),a=m(a,s,c,l,t[r+9],5,568446438),l=m(l,a,s,c,t[r+14],9,-1019803690),c=m(c,l,a,s,t[r+3],14,-187363961),s=m(s,c,l,a,t[r+8],20,1163531501),a=m(a,s,c,l,t[r+13],5,-1444681467),l=m(l,a,s,c,t[r+2],9,-51403784),c=m(c,l,a,s,t[r+7],14,1735328473),s=m(s,c,l,a,t[r+12],20,-1926607734),a=g(a,s,c,l,t[r+5],4,-378558),l=g(l,a,s,c,t[r+8],11,-2022574463),c=g(c,l,a,s,t[r+11],16,1839030562),s=g(s,c,l,a,t[r+14],23,-35309556),a=g(a,s,c,l,t[r+1],4,-1530992060),l=g(l,a,s,c,t[r+4],11,1272893353),c=g(c,l,a,s,t[r+7],16,-155497632),s=g(s,c,l,a,t[r+10],23,-1094730640),a=g(a,s,c,l,t[r+13],4,681279174),l=g(l,a,s,c,t[r],11,-358537222),c=g(c,l,a,s,t[r+3],16,-722521979),s=g(s,c,l,a,t[r+6],23,76029189),a=g(a,s,c,l,t[r+9],4,-640364487),l=g(l,a,s,c,t[r+12],11,-421815835),c=g(c,l,a,s,t[r+15],16,530742520),s=g(s,c,l,a,t[r+2],23,-995338651),a=v(a,s,c,l,t[r],6,-198630844),l=v(l,a,s,c,t[r+7],10,1126891415),c=v(c,l,a,s,t[r+14],15,-1416354905),s=v(s,c,l,a,t[r+5],21,-57434055),a=v(a,s,c,l,t[r+12],6,1700485571),l=v(l,a,s,c,t[r+3],10,-1894986606),c=v(c,l,a,s,t[r+10],15,-1051523),s=v(s,c,l,a,t[r+1],21,-2054922799),a=v(a,s,c,l,t[r+8],6,1873313359),l=v(l,a,s,c,t[r+15],10,-30611744),c=v(c,l,a,s,t[r+6],15,-1560198380),s=v(s,c,l,a,t[r+13],21,1309151649),a=v(a,s,c,l,t[r+4],6,-145523070),l=v(l,a,s,c,t[r+11],10,-1120210379),c=v(c,l,a,s,t[r+2],15,718787259),s=v(s,c,l,a,t[r+9],21,-343485551),a=e(a,y),s=e(s,C),c=e(c,S),l=e(l,A);return[a,s,c,l]}i(w,"binlMD5");function T(t){var h,r="",y=t.length*32;for(h=0;h<y;h+=8)r+=String.fromCharCode(t[h>>5]>>>h%32&255);return r}i(T,"binl2rstr");function x(t){var h,r=[];for(r[(t.length>>2)-1]=void 0,h=0;h<r.length;h+=1)r[h]=0;var y=t.length*8;for(h=0;h<y;h+=8)r[h>>5]|=(t.charCodeAt(h/8)&255)<<h%32;return r}i(x,"rstr2binl");function L(t){return T(w(x(t),t.length*8))}i(L,"rstrMD5");function E(t,h){var r,y=x(t),C=[],S=[],A;for(C[15]=S[15]=void 0,y.length>16&&(y=w(y,t.length*8)),r=0;r<16;r+=1)C[r]=y[r]^909522486,S[r]=y[r]^1549556828;return A=w(C.concat(x(h)),512+h.length*8),T(w(S.concat(A),640))}i(E,"rstrHMACMD5");function P(t){var h="0123456789abcdef",r="",y,C;for(C=0;C<t.length;C+=1)y=t.charCodeAt(C),r+=h.charAt(y>>>4&15)+h.charAt(y&15);return r}i(P,"rstr2hex");function I(t){return unescape(encodeURIComponent(t))}i(I,"str2rstrUTF8");function d(t){return L(I(t))}i(d,"rawMD5");function f(t){return P(d(t))}i(f,"hexMD5");function _(t,h){return E(I(t),I(h))}i(_,"rawHMACMD5");function b(t,h){return P(_(t,h))}i(b,"hexHMACMD5");function k(t,h,r){return h?r?_(h,t):b(h,t):r?d(t):f(t)}i(k,"md5"),typeof define=="function"&&define.amd?define(function(){return k}):typeof D=="object"&&D.exports?D.exports=k:n.md5=k})(Y)});var te=U((R,ee)=>{"use strict";(function(n,e){typeof R=="object"?ee.exports=R=e():typeof define=="function"&&define.amd?define([],e):n.CryptoJS=e()})(R,function(){var n=n||(function(e,o){var u=Object.create||(function(){function d(){}return i(d,"F"),function(f){var _;return d.prototype=f,_=new d,d.prototype=null,_}})(),p={},m=p.lib={},g=m.Base=(function(){return{extend:i(function(d){var f=u(this);return d&&f.mixIn(d),(!f.hasOwnProperty("init")||this.init===f.init)&&(f.init=function(){f.$super.init.apply(this,arguments)}),f.init.prototype=f,f.$super=this,f},"extend"),create:i(function(){var d=this.extend();return d.init.apply(d,arguments),d},"create"),init:i(function(){},"init"),mixIn:i(function(d){for(var f in d)d.hasOwnProperty(f)&&(this[f]=d[f]);d.hasOwnProperty("toString")&&(this.toString=d.toString)},"mixIn"),clone:i(function(){return this.init.prototype.extend(this)},"clone")}})(),v=m.WordArray=g.extend({init:i(function(d,f){d=this.words=d||[],f!=o?this.sigBytes=f:this.sigBytes=d.length*4},"init"),toString:i(function(d){return(d||T).stringify(this)},"toString"),concat:i(function(d){var f=this.words,_=d.words,b=this.sigBytes,k=d.sigBytes;if(this.clamp(),b%4)for(var t=0;t<k;t++){var h=_[t>>>2]>>>24-t%4*8&255;f[b+t>>>2]|=h<<24-(b+t)%4*8}else for(var t=0;t<k;t+=4)f[b+t>>>2]=_[t>>>2];return this.sigBytes+=k,this},"concat"),clamp:i(function(){var d=this.words,f=this.sigBytes;d[f>>>2]&=4294967295<<32-f%4*8,d.length=e.ceil(f/4)},"clamp"),clone:i(function(){var d=g.clone.call(this);return d.words=this.words.slice(0),d},"clone"),random:i(function(d){for(var f=[],_=i(function(r){var r=r,y=987654321,C=4294967295;return function(){y=36969*(y&65535)+(y>>16)&C,r=18e3*(r&65535)+(r>>16)&C;var S=(y<<16)+r&C;return S/=4294967296,S+=.5,S*(e.random()>.5?1:-1)}},"r"),b=0,k;b<d;b+=4){var t=_((k||e.random())*4294967296);k=t()*987654071,f.push(t()*4294967296|0)}return new v.init(f,d)},"random")}),w=p.enc={},T=w.Hex={stringify:i(function(d){for(var f=d.words,_=d.sigBytes,b=[],k=0;k<_;k++){var t=f[k>>>2]>>>24-k%4*8&255;b.push((t>>>4).toString(16)),b.push((t&15).toString(16))}return b.join("")},"stringify"),parse:i(function(d){for(var f=d.length,_=[],b=0;b<f;b+=2)_[b>>>3]|=parseInt(d.substr(b,2),16)<<24-b%8*4;return new v.init(_,f/2)},"parse")},x=w.Latin1={stringify:i(function(d){for(var f=d.words,_=d.sigBytes,b=[],k=0;k<_;k++){var t=f[k>>>2]>>>24-k%4*8&255;b.push(String.fromCharCode(t))}return b.join("")},"stringify"),parse:i(function(d){for(var f=d.length,_=[],b=0;b<f;b++)_[b>>>2]|=(d.charCodeAt(b)&255)<<24-b%4*8;return new v.init(_,f)},"parse")},L=w.Utf8={stringify:i(function(d){try{return decodeURIComponent(escape(x.stringify(d)))}catch{throw new Error("Malformed UTF-8 data")}},"stringify"),parse:i(function(d){return x.parse(unescape(encodeURIComponent(d)))},"parse")},E=m.BufferedBlockAlgorithm=g.extend({reset:i(function(){this._data=new v.init,this._nDataBytes=0},"reset"),_append:i(function(d){typeof d=="string"&&(d=L.parse(d)),this._data.concat(d),this._nDataBytes+=d.sigBytes},"_append"),_process:i(function(d){var f=this._data,_=f.words,b=f.sigBytes,k=this.blockSize,t=k*4,h=b/t;d?h=e.ceil(h):h=e.max((h|0)-this._minBufferSize,0);var r=h*k,y=e.min(r*4,b);if(r){for(var C=0;C<r;C+=k)this._doProcessBlock(_,C);var S=_.splice(0,r);f.sigBytes-=y}return new v.init(S,y)},"_process"),clone:i(function(){var d=g.clone.call(this);return d._data=this._data.clone(),d},"clone"),_minBufferSize:0}),P=m.Hasher=E.extend({cfg:g.extend(),init:i(function(d){this.cfg=this.cfg.extend(d),this.reset()},"init"),reset:i(function(){E.reset.call(this),this._doReset()},"reset"),update:i(function(d){return this._append(d),this._process(),this},"update"),finalize:i(function(d){d&&this._append(d);var f=this._doFinalize();return f},"finalize"),blockSize:512/32,_createHelper:i(function(d){return function(f,_){return new d.init(_).finalize(f)}},"_createHelper"),_createHmacHelper:i(function(d){return function(f,_){return new I.HMAC.init(d,_).finalize(f)}},"_createHmacHelper")}),I=p.algo={};return p})(Math);return n})});var re=U((F,ne)=>{"use strict";(function(n,e){typeof F=="object"?ne.exports=F=e(te()):typeof define=="function"&&define.amd?define(["./core"],e):e(n.CryptoJS)})(F,function(n){return(function(){var e=n,o=e.lib,u=o.WordArray,p=o.Hasher,m=e.algo,g=[],v=m.SHA1=p.extend({_doReset:i(function(){this._hash=new u.init([1732584193,4023233417,2562383102,271733878,3285377520])},"_doReset"),_doProcessBlock:i(function(w,T){for(var x=this._hash.words,L=x[0],E=x[1],P=x[2],I=x[3],d=x[4],f=0;f<80;f++){if(f<16)g[f]=w[T+f]|0;else{var _=g[f-3]^g[f-8]^g[f-14]^g[f-16];g[f]=_<<1|_>>>31}var b=(L<<5|L>>>27)+d+g[f];f<20?b+=(E&P|~E&I)+1518500249:f<40?b+=(E^P^I)+1859775393:f<60?b+=(E&P|E&I|P&I)-1894007588:b+=(E^P^I)-899497514,d=I,I=P,P=E<<30|E>>>2,E=L,L=b}x[0]=x[0]+L|0,x[1]=x[1]+E|0,x[2]=x[2]+P|0,x[3]=x[3]+I|0,x[4]=x[4]+d|0},"_doProcessBlock"),_doFinalize:i(function(){var w=this._data,T=w.words,x=this._nDataBytes*8,L=w.sigBytes*8;return T[L>>>5]|=128<<24-L%32,T[(L+64>>>9<<4)+14]=Math.floor(x/4294967296),T[(L+64>>>9<<4)+15]=x,w.sigBytes=T.length*4,this._process(),this._hash},"_doFinalize"),clone:i(function(){var w=p.clone.call(this);return w._hash=this._hash.clone(),w},"clone")});e.SHA1=p._createHelper(v),e.HmacSHA1=p._createHmacHelper(v)})(),n.SHA1})});var ut={};Me(ut,{TrackKey:()=>z,name:()=>dt,reportTeaEvent:()=>G,version:()=>lt});var le=X(Q(),1),de=X(re(),1);function B(){return window.appId||null}i(B,"getAppId");function ie(){var o;let n="suda-csrf-token",e=document.cookie.split("; ");for(let u of e){let[p,m]=u.split("=");if(p===n)return decodeURIComponent(m)}return(o=window.csrfToken)!=null?o:null}i(ie,"getCsrfToken");function N(){let n=globalThis.CLIENT_BASE_PATH||"/";return/^\/app\/[^/]/.test(n)}i(N,"isNewPathEnabled");function $(){switch(globalThis.ENVIRONMENT){case"gray":return"PRE";case"online":return"ONLINE";default:return"BOE"}}i($,"getEnv");function oe(){return window.appEnv!=null?window.appEnv==="runtime":!0}i(oe,"isOnlineEnv");function W(){let n=navigator.userAgent,e=/(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i.test(n),o=/iPad|Tab|Tablet/i.test(n)&&navigator.maxTouchPoints>1;return e||o}i(W,"isMobile");async function ae(){var n,e,o;try{let u=B();if(!u)return!0;let p=N()?`/app/${u}/__runtime__/api/v1/studio/get_published`:`/spark/b/${u}/get_published`,g=await(await fetch(p,{headers:{"X-Suda-Csrf-Token":(n=ie())!=null?n:""}})).json();if(g.code===0||g.status_code==="0")return((o=(e=g.data)==null?void 0:e.app_info)==null?void 0:o.show_badge)!==!1}catch{}return!0}i(ae,"fetchShowBadge");async function se(){var u;let n=B();if(!n)return{code:1,msg:"appId is required",data:{}};let e=N()?`/app/${n}/__runtime__/api/v1/studio/lark/user_info`:`/spark/b/${n}/lark/user_info`;return await(await fetch(e,{headers:{"X-Suda-Csrf-Token":(u=ie())!=null?u:""}})).json()}i(se,"getLarkUserInfo");var z={VIEW:"aily_agent_artifact_page_view"},De="08a441",Re="42b91e";function ce(n){let e=String(n);return(0,de.default)(De+(0,le.default)(e+Re)).toString()}i(ce,"encryptTea");var V=!1;async function Fe(){var m,g,v,w;let{data:n}=await se(),{tenantID:e,userID:o}=n||{},u=o&&o!=="0"?ce(o):void 0,p=e&&e!=="0"?ce(e):void 0;(m=window.collectEvent)==null||m.call(window,"init",{app_id:788827,channel:"cn",disable_auto_pv:!1,enable_ab_test:!1,enable_debug:!1,enable_stay_duration:!0,reportTime:1e3}),(v=window.collectEvent)==null||v.call(window,"config",{user_unique_id:u,device_type:W()?"mobile":"pc",evtParams:{open_from:(g=new URLSearchParams(window.location.search).get("open-from"))!=null?g:void 0,env:$(),user_id:u,tenant_id:p}}),V=!0,(w=window.collectEvent)==null||w.call(window,"start")}i(Fe,"createTracker");async function G({trackKey:n,trackParams:e={}}){var o;try{V||(V=!0,await Fe()),(o=window.collectEvent)==null||o.call(window,n,e)}catch(u){console.error(u)}}i(G,"reportTeaEvent");function ue(){return G({trackKey:z.VIEW,trackParams:{artifact_uid:B(),agent_id:"agent_miaoda",url:window.location.href}})}i(ue,"reportPageView");function fe(){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 n="";for(let e=0;e<16;e++)n+=Math.floor(Math.random()*16).toString(16);return n}i(fe,"generateUUID");var pe="x_sdk_device_id";function Ne(){try{let n=localStorage.getItem(pe);return n||(n=fe(),localStorage.setItem(pe,n)),n}catch{return fe()}}i(Ne,"getDeviceId");function $e(){let n=typeof navigator!="undefined"?navigator.userAgent:"";return n&&(/Android/i.test(n)&&/Mobile/i.test(n)||/iPhone|iPod/i.test(n)||/BlackBerry|IEMobile|Opera Mini/i.test(n))?"mobile":"desktop"}i($e,"getDeviceType");var We="pageSessionID";function je(){try{return new URLSearchParams(window.location.search).get(We)||""}catch{return""}}i(je,"getPvId");function Ue(n={}){let e=n.pvId||je();return{app_id:window.appId||"",tenant_id:window.tenantId||"",user_id:window.userId||"",did:Ne(),module:"app_web",app_env:"runtime",source_type:"user",device_type:$e(),release_commit_id:window.__RELEASE_COMMIT_ID__||"",...e?{pv_id:e}:{}}}i(Ue,"getDefaultAttributes");function he(n){let e=Math.round(n);if(!Number.isFinite(e))throw new RangeError(`toNanoString: \u975E\u6CD5\u65F6\u95F4\u6233 ${n}`);return typeof BigInt!="function"?e===0?"0":`${e}000000`:String(BigInt(e)*BigInt(1e6))}i(he,"toNanoString");var Ve="1.0.2";function ze(n,e){let o=Ue(e),u=he(Date.now());return{metricsData:{resource:{attributes:{sdk_version:Ve,sdk_lang:"javascript",sdk_type:"client-frontend"}},metrics:[{name:"apaas_internal_metrics_pv_uv",description:"Count of page views",unit:"",scopeName:"apaas_internal_metrics_pv_uv",sum:{aggregationTemporality:1,isMonotonic:!0,dataPoints:n.map(p=>({attributes:{...o,url:p.url,path:p.path,referrer:p.referrer},startTimeUnixNano:he(p.timestampMs),timeUnixNano:u,asDouble:1}))}}]}}}i(ze,"buildPayload");function Ge(n,e,o={},u){if(e.length===0)return;let p;try{p=JSON.stringify(ze(e,u))}catch{return}try{fetch(n,{method:"POST",headers:{"Content-Type":"application/json","X-Suda-Csrf-Token":window.csrfToken||"",...o},body:p,keepalive:!0}).catch(()=>{})}catch{}}i(Ge,"sendPvData");var K="__APAAS_PV_TRACKER_STARTED__";function Ke(){try{let n=window;return n[K]?!1:(n[K]=!0,!0)}catch{return!0}}i(Ke,"claimPvReporting");function me(){try{window[K]=!1}catch{}}i(me,"releasePvReporting");var O,Ze=(O=class{constructor(){this.started=!1,this.disposers=[],this.holdsPvReporting=!1,this.buffer=[]}static get instance(){return this._instance||(this._instance=new O),this._instance}start(e){var o;if(!this.started&&Ke()){this.holdsPvReporting=!0,this.config=e,this.started=!0;try{this.listenRouteChanges(),this.registerLifecycleListeners();let u=(o=e.flushIntervalMs)!=null?o:1e4;this.flushTimer=setInterval(()=>this.flush(),u)}catch(u){throw this.started=!1,this.flushTimer&&(clearInterval(this.flushTimer),this.flushTimer=void 0),this.holdsPvReporting=!1,me(),u}}}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,me())}pageKey(){let{origin:e,pathname:o,search:u}=window.location;return`${e}${o}${u}`}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=i(()=>this.recordPv(),"onPopState");window.addEventListener("popstate",e),this.disposers.push(()=>window.removeEventListener("popstate",e)),this.patchHistory("pushState"),this.patchHistory("replaceState")}patchHistory(e){let o=history[e],u=i(()=>this.recordPv(),"recordPv");history[e]=function(...p){let m=o.apply(this,p);return u(),m},this.disposers.push(()=>{history[e]=o})}registerLifecycleListeners(){let e=i(()=>{document.visibilityState==="hidden"&&this.flush()},"onVisibilityChange");document.addEventListener("visibilitychange",e),this.disposers.push(()=>document.removeEventListener("visibilitychange",e));let o=i(()=>this.flush(),"onPageHide");window.addEventListener("pagehide",o),this.disposers.push(()=>window.removeEventListener("pagehide",o))}},i(O,"_PvTracker"),O),ge=Ze.instance;function ve(){var o;let n=(o=B())!=null?o:"",e=N()?`/app/${n}/__runtime__/api/v1/observability/metrics/collect`:`/spark/app/${n}/runtime/api/v1/observability/metrics/collect`;ge.start({collectorUrl:e})}i(ve,"initPvTracking");var ye="https://lf3-static.bytednsdoc.com/obj/eden-cn/LMfspH/ljhwZthlaukjlkulzlp",Je=`${ye}/miaoda-ui/doubao.svg`,qe=`${ye}/logo/miaodalogo.svg`,we='<svg viewBox="0 0 10 10" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M8.08312 8.08298C8.2384 7.92769 8.23953 7.67705 8.08424 7.52176L5.3625 4.80002L8.08422 2.07829C8.23951 1.92301 8.23839 1.67236 8.0831 1.51708C7.92781 1.36179 7.67717 1.36066 7.52188 1.51595C7.36659 1.67124 4.80016 4.23767 4.80016 4.23767L2.07841 1.51593C1.92313 1.36064 1.67248 1.36177 1.5172 1.51705C1.36191 1.67234 1.36078 1.92298 1.51607 2.07827L4.23782 4.80002L1.51605 7.52178C1.36076 7.67707 1.36189 7.92771 1.51718 8.083C1.67246 8.23829 1.92311 8.23941 2.07839 8.08412L4.80016 5.36236L7.5219 8.0841C7.67719 8.23939 7.92783 8.23826 8.08312 8.08298Z" fill="currentColor"/></svg>',Xe='<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M12.6667 2H3.33333V14H6.66667V15.3334H3.33333C2.59695 15.3334 2 14.7364 2 14V2C2 1.26364 2.59695 0.666687 3.33333 0.666687H12.6667C13.403 0.666687 14 1.26364 14 2V7.33335H12.6667V2Z" fill="currentColor"/><path d="M5.33333 4.66669C4.96514 4.66669 4.66667 4.96516 4.66667 5.33335C4.66667 5.70154 4.96514 6 5.33333 6H10.6667C11.0349 6 11.3333 5.70154 11.3333 5.33335C11.3333 4.96516 11.0349 4.66669 10.6667 4.66669H5.33333Z" fill="currentColor"/><path d="M4.66667 8.33335C4.66667 7.96516 4.96514 7.66669 5.33333 7.66669H8C8.36819 7.66669 8.66667 7.96516 8.66667 8.33335C8.66667 8.70154 8.36819 9 8 9H5.33333C4.96514 9 4.66667 8.70154 4.66667 8.33335Z" fill="currentColor"/><path d="M13.5523 8.70017C13.9428 8.30964 14.576 8.30964 14.9665 8.70017C15.357 9.09069 15.357 9.72386 14.9665 10.1144L14.2594 10.8215L12.8452 9.40728L13.5523 8.70017Z" fill="currentColor"/><path d="M12.1381 10.1144L13.5523 11.5286L10.2309 14.85C10.0916 14.9892 9.91229 15.0815 9.71798 15.1138L8.45737 15.3234C8.42136 15.3294 8.38467 15.3177 8.35885 15.2918C8.33271 15.2657 8.32099 15.2284 8.32749 15.192L8.55128 13.9374C8.58465 13.7502 8.6746 13.5779 8.80901 13.4435L12.1381 10.1144Z" fill="currentColor"/></svg>',Ye='<svg width="16" height="16" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M11.9922 1.99221C12.5445 1.98895 12.9958 2.43407 12.999 2.98634L13.0762 16.1943L14.6387 14.6328L17.8926 11.3789C18.2831 10.9884 18.9171 10.9885 19.3076 11.3789C19.6977 11.7695 19.6979 12.4026 19.3076 12.793L16.0527 16.0479L12.7979 19.3018C12.7111 19.3884 12.6098 19.4566 12.5 19.5059H20.375C20.9271 19.5059 21.3748 19.9538 21.375 20.5059C21.375 21.0581 20.9273 21.5059 20.375 21.5059H3.625C3.07272 21.5059 2.625 21.0581 2.625 20.5059C2.62523 19.9538 3.07286 19.5059 3.625 19.5059H11.6816C11.572 19.4566 11.4704 19.3884 11.3838 19.3018L4.87402 12.793C4.48372 12.4026 4.4839 11.7694 4.87402 11.3789C5.26452 10.9884 5.89756 10.9885 6.28809 11.3789L11.0762 16.166L10.999 2.99806C10.9958 2.44603 11.4402 1.99582 11.9922 1.99221Z" fill="currentColor"/></svg>',Qe='<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M2.0754 7.57153C2.23188 9.44922 3.49231 11.053 5.27982 11.6488C5.31351 11.6601 5.33994 11.6865 5.35117 11.7202L5.72076 12.8289C5.88752 13.3292 6.3557 13.6667 6.88304 13.6667H9.11696C9.6443 13.6667 10.1125 13.3292 10.2792 12.8289L10.6488 11.7202C10.6601 11.6865 10.6865 11.6601 10.7202 11.6488C12.5077 11.053 13.7681 9.44922 13.9246 7.57153L14 6.66667C14 3.35296 11.3137 0.666668 8 0.666668C4.68629 0.666668 2 3.35296 2 6.66667L2.0754 7.57153ZM9.38392 11.2985L9.03899 12.3333H6.96101L6.61608 11.2985C6.47214 10.8667 6.13328 10.5279 5.70146 10.3839C4.41995 9.95675 3.51631 8.80696 3.40413 7.4608L3.33362 6.61462C3.36152 4.06127 5.44004 2 8 2C10.56 2 12.6385 4.06127 12.6664 6.61462L12.5959 7.4608C12.4837 8.80696 11.5801 9.95675 10.2985 10.3839C9.86672 10.5279 9.52786 10.8667 9.38392 11.2985Z" fill="currentColor"/><path d="M6.66667 14.3333C6.29848 14.3333 6 14.6318 6 15C6 15.3682 6.29848 15.6667 6.66667 15.6667H9.33333C9.70152 15.6667 10 15.3682 10 15C10 14.6318 9.70152 14.3333 9.33333 14.3333H6.66667Z" fill="currentColor"/><path d="M8.00864 4.13208L5.44578 6.94049C5.20258 7.18228 5.37835 7.56531 5.74361 7.58951L7.2181 7.6872L7.21814 9.60852C7.21814 9.96788 7.72139 10.1366 7.99168 9.86792C8.26197 9.59921 10.5545 7.05951 10.5545 7.05951C10.7977 6.81772 10.622 6.43469 10.2567 6.41049L8.78222 6.3128L8.78219 4.39148C8.78218 4.03212 8.27893 3.86336 8.00864 4.13208Z" fill="currentColor"/></svg>',_e=!0,et="0px 8px 32px rgba(0,0,0,0.08), 0px 4px 16px rgba(0,0,0,0.04), 0px 2px 4px rgba(0,0,0,0.02)",tt="0px 4px 16px rgba(0,0,0,0.03), 0px 4px 10px rgba(0,0,0,0.03), 0px 2px 4px rgba(0,0,0,0.02)",J="'PingFang SC', -apple-system, BlinkMacSystemFont, sans-serif",j={doubao:{brandText:"\u8C46\u5305\u5DE5\u4F5C\u751F\u6210",logoSrc:Je,downloadUrl:"https://ugapk.com/FCtLH"},miaoda:{brandText:"\u5999\u642D\u751F\u6210",logoSrc:qe,landingUrl:"https://miaoda.feishu.cn/landing"}},nt={BOE:"tns.feishu-boe.cn",PRE:"tns.feishu-pre.cn",ONLINE:"tns.feishu.cn"};function Ce(){var o;let n=JSON.stringify({scene:"miaoda_app_report",entity_id:(o=B())!=null?o:"",entity_type:"miaoda_app",extra:""}),e=`https://${nt[$()]}/cust/lark_report/?type=common¶ms=${encodeURIComponent(n)}&lang=zh-CN`;window.open(e,"_blank","noopener,noreferrer")}i(Ce,"openReport");var rt={feedback:Xe,close:we,download:Ye,efficiency:Qe};function xe(n){let e=document.createElement("span");Object.assign(e.style,{display:"inline-flex",width:`${n}px`,height:`${n}px`,flexShrink:"0"}),e.innerHTML=we;let o=e.firstElementChild;return o&&(o.setAttribute("width",String(n)),o.setAttribute("height",String(n)),o.style.display="block"),e}i(xe,"makeCloseIcon");function it(n,e=16){if(n==="close")return xe(e);let o=document.createElement("span");Object.assign(o.style,{display:"inline-flex",width:`${e}px`,height:`${e}px`,flexShrink:"0"}),o.innerHTML=rt[n];let u=o.firstElementChild;return u&&(u.style.display="block"),o}i(it,"makeIcon");function ot(n,e){let o=document.createElement("img");return o.src=n,o.width=e,o.height=e,o.alt="",Object.assign(o.style,{width:`${e}px`,height:`${e}px`,maxWidth:"none",maxHeight:"none",borderRadius:"100px",flexShrink:"0",display:"block"}),o}i(ot,"makeLogo");function ke(n,e,o){let u=e==="desktop",p=j[n],m=document.createElement("div");Object.assign(m.style,{boxSizing:"border-box",display:"inline-flex",alignItems:"center",gap:"4px",padding:u?"6px 12px 6px 8px":"5px 12px 5px 8px",background:"#363636",border:"0.5px solid rgba(255,255,255,0.1)",borderRadius:"100px",boxShadow:et,cursor:"pointer"});let g=ot(p.logoSrc,16),v=document.createElement("span");if(v.textContent=p.brandText,Object.assign(v.style,{fontFamily:J,fontSize:u?"12px":"14px",lineHeight:u?"18px":"22px",color:"rgba(255,255,255,0.85)",whiteSpace:"nowrap"}),m.append(g,v),u&&o){let w=document.createElement("span");w.setAttribute("role","button"),w.setAttribute("aria-label","\u5173\u95ED"),w.setAttribute("data-watermark-close",""),Object.assign(w.style,{display:"none",alignItems:"center",cursor:"pointer",flexShrink:"0",color:"rgba(255,255,255,0.5)"}),w.appendChild(xe(10)),w.addEventListener("click",T=>{T.stopPropagation(),o()}),m.appendChild(w)}return m}i(ke,"buildPill");function M(n){let e=document.createElement("div");e.setAttribute("role","menuitem"),e.setAttribute("data-label",n.label),Object.assign(e.style,{boxSizing:"border-box",display:"flex",alignItems:"center",gap:"8px",minHeight:"38px",padding:"4px 10px",borderRadius:"6px",cursor:"pointer",color:"#000000"});let o=document.createElement("span");Object.assign(o.style,{display:"inline-flex",width:"16px",height:"16px",flexShrink:"0",color:"#000000"}),o.appendChild(it(n.icon));let u=document.createElement("span");return u.textContent=n.label,Object.assign(u.style,{fontFamily:J,fontSize:`${n.fontSize}px`,lineHeight:`${n.fontSize+8}px`,color:"#000000",whiteSpace:"nowrap"}),e.append(o,u),e.addEventListener("mouseenter",()=>{e.style.background="rgba(0,0,0,0.04)"}),e.addEventListener("mouseleave",()=>{e.style.background="transparent"}),e.addEventListener("click",n.onClick),e}i(M,"buildMenuRow");function at(){let n=document.createElement("div");return Object.assign(n.style,{height:"1px",background:"rgba(0,0,0,0.08)",margin:"0 10px"}),n}i(at,"buildDivider");function Se(n){var o;let e=document.createElement("div");if(Object.assign(e.style,{boxSizing:"border-box",display:"flex",flexDirection:"column",minWidth:`${n.minWidth}px`,background:"#ffffff",border:"0.5px solid rgba(0,0,0,0.1)",borderRadius:"10px",boxShadow:tt,overflow:"hidden",outline:"none"}),n.items.length){let u=document.createElement("div");Object.assign(u.style,{boxSizing:"border-box",padding:"4px",display:"flex",flexDirection:"column",gap:`${(o=n.itemGap)!=null?o:0}px`}),n.items.forEach(p=>u.appendChild(p)),e.appendChild(u)}if(n.extraItems&&n.extraItems.length){e.appendChild(at());let u=document.createElement("div");Object.assign(u.style,{boxSizing:"border-box",padding:"4px"}),n.extraItems.forEach(p=>u.appendChild(p)),e.appendChild(u)}return e}i(Se,"buildMenuCard");function Ee(n,e=!1){let o=document.createElement("div");o.setAttribute("data-custom-element",`${n}-watermark${e?"-mobile":""}`);let u=o.attachShadow({mode:"open"}),p=document.createElement("style");p.textContent=`
|
|
2
|
+
:host {
|
|
3
|
+
all: initial !important;
|
|
4
|
+
display: block !important;
|
|
5
|
+
position: fixed !important;
|
|
6
|
+
right: 12px !important;
|
|
7
|
+
bottom: 12px !important;
|
|
8
|
+
z-index: 9999 !important;
|
|
9
|
+
direction: ltr !important;
|
|
10
|
+
unicode-bidi: isolate !important;
|
|
11
|
+
}
|
|
12
|
+
:host::before, :host::after { content: none !important; }
|
|
13
|
+
.watermark-root {
|
|
14
|
+
all: initial;
|
|
15
|
+
direction: ltr;
|
|
16
|
+
unicode-bidi: isolate;
|
|
17
|
+
font-family: ${J};
|
|
18
|
+
display: flex;
|
|
19
|
+
flex-direction: column;
|
|
20
|
+
align-items: flex-end;
|
|
21
|
+
gap: 8px;
|
|
22
|
+
}
|
|
23
|
+
`;let m=document.createElement("div");return m.className="watermark-root",u.append(p,m),{host:o,container:m}}i(Ee,"createWatermarkRoot");function st(n){let{host:e,container:o}=Ee(n),u=[];n==="doubao"?u.push(M({icon:"download",label:"\u4E0B\u8F7D\u8C46\u5305\u5DE5\u4F5C",fontSize:14,onClick:i(()=>window.open(j.doubao.downloadUrl,"_blank","noopener,noreferrer"),"onClick")})):u.push(M({icon:"efficiency",label:"\u4E86\u89E3\u5999\u642D",fontSize:14,onClick:i(()=>window.open(j.miaoda.landingUrl,"_blank","noopener,noreferrer"),"onClick")})),_e&&u.push(M({icon:"feedback",label:"\u6295\u8BC9\u4E0E\u4E3E\u62A5",fontSize:14,onClick:Ce}));let p=Se({items:u,minWidth:160,itemGap:8});p.style.display="none";let m=ke(n,"desktop",()=>e.remove()),g=m.querySelector("[data-watermark-close]");o.append(p,m);let v=null;return o.addEventListener("mouseenter",()=>{v&&clearTimeout(v),p.style.display="flex",g&&(g.style.display="inline-flex")}),o.addEventListener("mouseleave",()=>{v=setTimeout(()=>{p.style.display="none",g&&(g.style.display="none")},100)}),e}i(st,"buildDesktopWatermark");function ct(n){let{host:e,container:o}=Ee(n,!0);o.style.cursor="pointer";let u=[];n==="miaoda"&&u.push(M({icon:"efficiency",label:"\u4E86\u89E3\u5999\u642D",fontSize:16,onClick:i(()=>window.open(j.miaoda.landingUrl,"_blank","noopener,noreferrer"),"onClick")})),_e&&u.push(M({icon:"feedback",label:"\u6295\u8BC9\u4E0E\u4E3E\u62A5",fontSize:16,onClick:Ce}));let p=[M({icon:"close",label:"\u4E0D\u518D\u5C55\u793A",fontSize:16,onClick:i(w=>{w.stopPropagation(),document.removeEventListener("click",v),e.remove()},"onClick")})],m=Se({items:u,extraItems:p,minWidth:160});m.style.display="none";let g=ke(n,"mobile");o.append(m,g),o.addEventListener("click",w=>{w.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(ct,"buildMobileWatermark");var be=!1,Z=!1;async function Le(n){if(be||Z||typeof document=="undefined")return;if(document.readyState==="loading"){document.addEventListener("DOMContentLoaded",()=>Le(n),{once:!0});return}Z=!0;let e=await ae();if(be=!0,Z=!1,!e)return;let o=W()?ct(n):st(n);document.body.appendChild(o)}i(Le,"mountWatermark");function Ie(){return Le("doubao")}i(Ie,"mountDoubaoWatermark");var lt="0.0.14-alpha.20260918065040",dt="@lark-apaas/miaoda-coding-sdk";oe()&&(ue(),ve());Ie();return He(ut);})();
|
package/dist/runtime.dev.js
CHANGED
|
@@ -1005,6 +1005,26 @@ var MiaodaRuntime = (() => {
|
|
|
1005
1005
|
return isPhone || isIpad;
|
|
1006
1006
|
}
|
|
1007
1007
|
__name(isMobile, "isMobile");
|
|
1008
|
+
async function fetchShowBadge() {
|
|
1009
|
+
var _a2, _b, _c;
|
|
1010
|
+
try {
|
|
1011
|
+
const appId = getAppId();
|
|
1012
|
+
if (!appId) return true;
|
|
1013
|
+
const url = isNewPathEnabled() ? `/app/${appId}/__runtime__/api/v1/studio/get_published` : `/spark/b/${appId}/get_published`;
|
|
1014
|
+
const response = await fetch(url, {
|
|
1015
|
+
headers: {
|
|
1016
|
+
"X-Suda-Csrf-Token": (_a2 = getCsrfToken()) != null ? _a2 : ""
|
|
1017
|
+
}
|
|
1018
|
+
});
|
|
1019
|
+
const res = await response.json();
|
|
1020
|
+
if (res.code === 0 || res.status_code === "0") {
|
|
1021
|
+
return ((_c = (_b = res.data) == null ? void 0 : _b.app_info) == null ? void 0 : _c.show_badge) !== false;
|
|
1022
|
+
}
|
|
1023
|
+
} catch {
|
|
1024
|
+
}
|
|
1025
|
+
return true;
|
|
1026
|
+
}
|
|
1027
|
+
__name(fetchShowBadge, "fetchShowBadge");
|
|
1008
1028
|
async function getLarkUserInfo() {
|
|
1009
1029
|
var _a2;
|
|
1010
1030
|
const appId = getAppId();
|
|
@@ -1642,19 +1662,47 @@ var MiaodaRuntime = (() => {
|
|
|
1642
1662
|
return card;
|
|
1643
1663
|
}
|
|
1644
1664
|
__name(buildMenuCard, "buildMenuCard");
|
|
1645
|
-
function
|
|
1646
|
-
const
|
|
1647
|
-
|
|
1648
|
-
|
|
1649
|
-
|
|
1650
|
-
right: "12px",
|
|
1651
|
-
bottom: "12px",
|
|
1652
|
-
zIndex: "9999",
|
|
1653
|
-
display: "flex",
|
|
1654
|
-
flexDirection: "column",
|
|
1655
|
-
alignItems: "flex-end",
|
|
1656
|
-
gap: "8px"
|
|
1665
|
+
function createWatermarkRoot(variant, mobile = false) {
|
|
1666
|
+
const host = document.createElement("div");
|
|
1667
|
+
host.setAttribute("data-custom-element", `${variant}-watermark${mobile ? "-mobile" : ""}`);
|
|
1668
|
+
const shadow = host.attachShadow({
|
|
1669
|
+
mode: "open"
|
|
1657
1670
|
});
|
|
1671
|
+
const style = document.createElement("style");
|
|
1672
|
+
style.textContent = `
|
|
1673
|
+
:host {
|
|
1674
|
+
all: initial !important;
|
|
1675
|
+
display: block !important;
|
|
1676
|
+
position: fixed !important;
|
|
1677
|
+
right: 12px !important;
|
|
1678
|
+
bottom: 12px !important;
|
|
1679
|
+
z-index: 9999 !important;
|
|
1680
|
+
direction: ltr !important;
|
|
1681
|
+
unicode-bidi: isolate !important;
|
|
1682
|
+
}
|
|
1683
|
+
:host::before, :host::after { content: none !important; }
|
|
1684
|
+
.watermark-root {
|
|
1685
|
+
all: initial;
|
|
1686
|
+
direction: ltr;
|
|
1687
|
+
unicode-bidi: isolate;
|
|
1688
|
+
font-family: ${FONT_FAMILY};
|
|
1689
|
+
display: flex;
|
|
1690
|
+
flex-direction: column;
|
|
1691
|
+
align-items: flex-end;
|
|
1692
|
+
gap: 8px;
|
|
1693
|
+
}
|
|
1694
|
+
`;
|
|
1695
|
+
const container = document.createElement("div");
|
|
1696
|
+
container.className = "watermark-root";
|
|
1697
|
+
shadow.append(style, container);
|
|
1698
|
+
return {
|
|
1699
|
+
host,
|
|
1700
|
+
container
|
|
1701
|
+
};
|
|
1702
|
+
}
|
|
1703
|
+
__name(createWatermarkRoot, "createWatermarkRoot");
|
|
1704
|
+
function buildDesktopWatermark(variant) {
|
|
1705
|
+
const { host, container } = createWatermarkRoot(variant);
|
|
1658
1706
|
const items = [];
|
|
1659
1707
|
if (variant === "doubao") {
|
|
1660
1708
|
items.push(buildMenuRow({
|
|
@@ -1685,7 +1733,7 @@ var MiaodaRuntime = (() => {
|
|
|
1685
1733
|
itemGap: 8
|
|
1686
1734
|
});
|
|
1687
1735
|
menu.style.display = "none";
|
|
1688
|
-
const pill = buildPill(variant, "desktop", () =>
|
|
1736
|
+
const pill = buildPill(variant, "desktop", () => host.remove());
|
|
1689
1737
|
const close = pill.querySelector("[data-watermark-close]");
|
|
1690
1738
|
container.append(menu, pill);
|
|
1691
1739
|
let timer = null;
|
|
@@ -1700,32 +1748,14 @@ var MiaodaRuntime = (() => {
|
|
|
1700
1748
|
if (close) close.style.display = "none";
|
|
1701
1749
|
}, 100);
|
|
1702
1750
|
});
|
|
1703
|
-
return
|
|
1751
|
+
return host;
|
|
1704
1752
|
}
|
|
1705
1753
|
__name(buildDesktopWatermark, "buildDesktopWatermark");
|
|
1706
1754
|
function buildMobileWatermark(variant) {
|
|
1707
|
-
const wrapper =
|
|
1708
|
-
wrapper.
|
|
1709
|
-
Object.assign(wrapper.style, {
|
|
1710
|
-
position: "fixed",
|
|
1711
|
-
right: "12px",
|
|
1712
|
-
bottom: "12px",
|
|
1713
|
-
zIndex: "9999",
|
|
1714
|
-
display: "flex",
|
|
1715
|
-
flexDirection: "column",
|
|
1716
|
-
alignItems: "flex-end",
|
|
1717
|
-
gap: "8px",
|
|
1718
|
-
cursor: "pointer"
|
|
1719
|
-
});
|
|
1755
|
+
const { host, container: wrapper } = createWatermarkRoot(variant, true);
|
|
1756
|
+
wrapper.style.cursor = "pointer";
|
|
1720
1757
|
const items = [];
|
|
1721
|
-
if (variant === "
|
|
1722
|
-
items.push(buildMenuRow({
|
|
1723
|
-
icon: "download",
|
|
1724
|
-
label: "\u4E0B\u8F7D\u8C46\u5305\u5DE5\u4F5C",
|
|
1725
|
-
fontSize: 16,
|
|
1726
|
-
onClick: /* @__PURE__ */ __name(() => window.open(VARIANT_CONFIG.doubao.downloadUrl, "_blank", "noopener,noreferrer"), "onClick")
|
|
1727
|
-
}));
|
|
1728
|
-
} else {
|
|
1758
|
+
if (variant === "miaoda") {
|
|
1729
1759
|
items.push(buildMenuRow({
|
|
1730
1760
|
icon: "efficiency",
|
|
1731
1761
|
label: "\u4E86\u89E3\u5999\u642D",
|
|
@@ -1748,7 +1778,8 @@ var MiaodaRuntime = (() => {
|
|
|
1748
1778
|
fontSize: 16,
|
|
1749
1779
|
onClick: /* @__PURE__ */ __name((e) => {
|
|
1750
1780
|
e.stopPropagation();
|
|
1751
|
-
|
|
1781
|
+
document.removeEventListener("click", onOutsideClick);
|
|
1782
|
+
host.remove();
|
|
1752
1783
|
}, "onClick")
|
|
1753
1784
|
})
|
|
1754
1785
|
];
|
|
@@ -1764,33 +1795,39 @@ var MiaodaRuntime = (() => {
|
|
|
1764
1795
|
e.stopPropagation();
|
|
1765
1796
|
menu.style.display = menu.style.display === "none" ? "flex" : "none";
|
|
1766
1797
|
});
|
|
1767
|
-
|
|
1798
|
+
const onOutsideClick = /* @__PURE__ */ __name(() => {
|
|
1768
1799
|
menu.style.display = "none";
|
|
1769
|
-
});
|
|
1770
|
-
|
|
1800
|
+
}, "onOutsideClick");
|
|
1801
|
+
document.addEventListener("click", onOutsideClick);
|
|
1802
|
+
return host;
|
|
1771
1803
|
}
|
|
1772
1804
|
__name(buildMobileWatermark, "buildMobileWatermark");
|
|
1773
1805
|
var mounted = false;
|
|
1774
|
-
|
|
1775
|
-
|
|
1806
|
+
var pending = false;
|
|
1807
|
+
async function mountWatermark(variant) {
|
|
1808
|
+
if (mounted || pending || typeof document === "undefined") return;
|
|
1776
1809
|
if (document.readyState === "loading") {
|
|
1777
1810
|
document.addEventListener("DOMContentLoaded", () => mountWatermark(variant), {
|
|
1778
1811
|
once: true
|
|
1779
1812
|
});
|
|
1780
1813
|
return;
|
|
1781
1814
|
}
|
|
1815
|
+
pending = true;
|
|
1816
|
+
const shouldShow = await fetchShowBadge();
|
|
1782
1817
|
mounted = true;
|
|
1818
|
+
pending = false;
|
|
1819
|
+
if (!shouldShow) return;
|
|
1783
1820
|
const el = isMobile() ? buildMobileWatermark(variant) : buildDesktopWatermark(variant);
|
|
1784
1821
|
document.body.appendChild(el);
|
|
1785
1822
|
}
|
|
1786
1823
|
__name(mountWatermark, "mountWatermark");
|
|
1787
1824
|
function mountMiaodaWatermark() {
|
|
1788
|
-
mountWatermark("miaoda");
|
|
1825
|
+
return mountWatermark("miaoda");
|
|
1789
1826
|
}
|
|
1790
1827
|
__name(mountMiaodaWatermark, "mountMiaodaWatermark");
|
|
1791
1828
|
|
|
1792
1829
|
// src/runtime.ts
|
|
1793
|
-
var version = "0.0.
|
|
1830
|
+
var version = "0.0.14-alpha.20260918065040";
|
|
1794
1831
|
var name = "@lark-apaas/miaoda-coding-sdk";
|
|
1795
1832
|
if (isOnlineEnv()) {
|
|
1796
1833
|
reportPageView();
|
package/dist/runtime.js
CHANGED
|
@@ -1005,6 +1005,26 @@ var MiaodaRuntime = (() => {
|
|
|
1005
1005
|
return isPhone || isIpad;
|
|
1006
1006
|
}
|
|
1007
1007
|
__name(isMobile, "isMobile");
|
|
1008
|
+
async function fetchShowBadge() {
|
|
1009
|
+
var _a2, _b, _c;
|
|
1010
|
+
try {
|
|
1011
|
+
const appId = getAppId();
|
|
1012
|
+
if (!appId) return true;
|
|
1013
|
+
const url = isNewPathEnabled() ? `/app/${appId}/__runtime__/api/v1/studio/get_published` : `/spark/b/${appId}/get_published`;
|
|
1014
|
+
const response = await fetch(url, {
|
|
1015
|
+
headers: {
|
|
1016
|
+
"X-Suda-Csrf-Token": (_a2 = getCsrfToken()) != null ? _a2 : ""
|
|
1017
|
+
}
|
|
1018
|
+
});
|
|
1019
|
+
const res = await response.json();
|
|
1020
|
+
if (res.code === 0 || res.status_code === "0") {
|
|
1021
|
+
return ((_c = (_b = res.data) == null ? void 0 : _b.app_info) == null ? void 0 : _c.show_badge) !== false;
|
|
1022
|
+
}
|
|
1023
|
+
} catch {
|
|
1024
|
+
}
|
|
1025
|
+
return true;
|
|
1026
|
+
}
|
|
1027
|
+
__name(fetchShowBadge, "fetchShowBadge");
|
|
1008
1028
|
async function getLarkUserInfo() {
|
|
1009
1029
|
var _a2;
|
|
1010
1030
|
const appId = getAppId();
|
|
@@ -1642,19 +1662,47 @@ var MiaodaRuntime = (() => {
|
|
|
1642
1662
|
return card;
|
|
1643
1663
|
}
|
|
1644
1664
|
__name(buildMenuCard, "buildMenuCard");
|
|
1645
|
-
function
|
|
1646
|
-
const
|
|
1647
|
-
|
|
1648
|
-
|
|
1649
|
-
|
|
1650
|
-
right: "12px",
|
|
1651
|
-
bottom: "12px",
|
|
1652
|
-
zIndex: "9999",
|
|
1653
|
-
display: "flex",
|
|
1654
|
-
flexDirection: "column",
|
|
1655
|
-
alignItems: "flex-end",
|
|
1656
|
-
gap: "8px"
|
|
1665
|
+
function createWatermarkRoot(variant, mobile = false) {
|
|
1666
|
+
const host = document.createElement("div");
|
|
1667
|
+
host.setAttribute("data-custom-element", `${variant}-watermark${mobile ? "-mobile" : ""}`);
|
|
1668
|
+
const shadow = host.attachShadow({
|
|
1669
|
+
mode: "open"
|
|
1657
1670
|
});
|
|
1671
|
+
const style = document.createElement("style");
|
|
1672
|
+
style.textContent = `
|
|
1673
|
+
:host {
|
|
1674
|
+
all: initial !important;
|
|
1675
|
+
display: block !important;
|
|
1676
|
+
position: fixed !important;
|
|
1677
|
+
right: 12px !important;
|
|
1678
|
+
bottom: 12px !important;
|
|
1679
|
+
z-index: 9999 !important;
|
|
1680
|
+
direction: ltr !important;
|
|
1681
|
+
unicode-bidi: isolate !important;
|
|
1682
|
+
}
|
|
1683
|
+
:host::before, :host::after { content: none !important; }
|
|
1684
|
+
.watermark-root {
|
|
1685
|
+
all: initial;
|
|
1686
|
+
direction: ltr;
|
|
1687
|
+
unicode-bidi: isolate;
|
|
1688
|
+
font-family: ${FONT_FAMILY};
|
|
1689
|
+
display: flex;
|
|
1690
|
+
flex-direction: column;
|
|
1691
|
+
align-items: flex-end;
|
|
1692
|
+
gap: 8px;
|
|
1693
|
+
}
|
|
1694
|
+
`;
|
|
1695
|
+
const container = document.createElement("div");
|
|
1696
|
+
container.className = "watermark-root";
|
|
1697
|
+
shadow.append(style, container);
|
|
1698
|
+
return {
|
|
1699
|
+
host,
|
|
1700
|
+
container
|
|
1701
|
+
};
|
|
1702
|
+
}
|
|
1703
|
+
__name(createWatermarkRoot, "createWatermarkRoot");
|
|
1704
|
+
function buildDesktopWatermark(variant) {
|
|
1705
|
+
const { host, container } = createWatermarkRoot(variant);
|
|
1658
1706
|
const items = [];
|
|
1659
1707
|
if (variant === "doubao") {
|
|
1660
1708
|
items.push(buildMenuRow({
|
|
@@ -1685,7 +1733,7 @@ var MiaodaRuntime = (() => {
|
|
|
1685
1733
|
itemGap: 8
|
|
1686
1734
|
});
|
|
1687
1735
|
menu.style.display = "none";
|
|
1688
|
-
const pill = buildPill(variant, "desktop", () =>
|
|
1736
|
+
const pill = buildPill(variant, "desktop", () => host.remove());
|
|
1689
1737
|
const close = pill.querySelector("[data-watermark-close]");
|
|
1690
1738
|
container.append(menu, pill);
|
|
1691
1739
|
let timer = null;
|
|
@@ -1700,32 +1748,14 @@ var MiaodaRuntime = (() => {
|
|
|
1700
1748
|
if (close) close.style.display = "none";
|
|
1701
1749
|
}, 100);
|
|
1702
1750
|
});
|
|
1703
|
-
return
|
|
1751
|
+
return host;
|
|
1704
1752
|
}
|
|
1705
1753
|
__name(buildDesktopWatermark, "buildDesktopWatermark");
|
|
1706
1754
|
function buildMobileWatermark(variant) {
|
|
1707
|
-
const wrapper =
|
|
1708
|
-
wrapper.
|
|
1709
|
-
Object.assign(wrapper.style, {
|
|
1710
|
-
position: "fixed",
|
|
1711
|
-
right: "12px",
|
|
1712
|
-
bottom: "12px",
|
|
1713
|
-
zIndex: "9999",
|
|
1714
|
-
display: "flex",
|
|
1715
|
-
flexDirection: "column",
|
|
1716
|
-
alignItems: "flex-end",
|
|
1717
|
-
gap: "8px",
|
|
1718
|
-
cursor: "pointer"
|
|
1719
|
-
});
|
|
1755
|
+
const { host, container: wrapper } = createWatermarkRoot(variant, true);
|
|
1756
|
+
wrapper.style.cursor = "pointer";
|
|
1720
1757
|
const items = [];
|
|
1721
|
-
if (variant === "
|
|
1722
|
-
items.push(buildMenuRow({
|
|
1723
|
-
icon: "download",
|
|
1724
|
-
label: "\u4E0B\u8F7D\u8C46\u5305\u5DE5\u4F5C",
|
|
1725
|
-
fontSize: 16,
|
|
1726
|
-
onClick: /* @__PURE__ */ __name(() => window.open(VARIANT_CONFIG.doubao.downloadUrl, "_blank", "noopener,noreferrer"), "onClick")
|
|
1727
|
-
}));
|
|
1728
|
-
} else {
|
|
1758
|
+
if (variant === "miaoda") {
|
|
1729
1759
|
items.push(buildMenuRow({
|
|
1730
1760
|
icon: "efficiency",
|
|
1731
1761
|
label: "\u4E86\u89E3\u5999\u642D",
|
|
@@ -1748,7 +1778,8 @@ var MiaodaRuntime = (() => {
|
|
|
1748
1778
|
fontSize: 16,
|
|
1749
1779
|
onClick: /* @__PURE__ */ __name((e) => {
|
|
1750
1780
|
e.stopPropagation();
|
|
1751
|
-
|
|
1781
|
+
document.removeEventListener("click", onOutsideClick);
|
|
1782
|
+
host.remove();
|
|
1752
1783
|
}, "onClick")
|
|
1753
1784
|
})
|
|
1754
1785
|
];
|
|
@@ -1764,33 +1795,39 @@ var MiaodaRuntime = (() => {
|
|
|
1764
1795
|
e.stopPropagation();
|
|
1765
1796
|
menu.style.display = menu.style.display === "none" ? "flex" : "none";
|
|
1766
1797
|
});
|
|
1767
|
-
|
|
1798
|
+
const onOutsideClick = /* @__PURE__ */ __name(() => {
|
|
1768
1799
|
menu.style.display = "none";
|
|
1769
|
-
});
|
|
1770
|
-
|
|
1800
|
+
}, "onOutsideClick");
|
|
1801
|
+
document.addEventListener("click", onOutsideClick);
|
|
1802
|
+
return host;
|
|
1771
1803
|
}
|
|
1772
1804
|
__name(buildMobileWatermark, "buildMobileWatermark");
|
|
1773
1805
|
var mounted = false;
|
|
1774
|
-
|
|
1775
|
-
|
|
1806
|
+
var pending = false;
|
|
1807
|
+
async function mountWatermark(variant) {
|
|
1808
|
+
if (mounted || pending || typeof document === "undefined") return;
|
|
1776
1809
|
if (document.readyState === "loading") {
|
|
1777
1810
|
document.addEventListener("DOMContentLoaded", () => mountWatermark(variant), {
|
|
1778
1811
|
once: true
|
|
1779
1812
|
});
|
|
1780
1813
|
return;
|
|
1781
1814
|
}
|
|
1815
|
+
pending = true;
|
|
1816
|
+
const shouldShow = await fetchShowBadge();
|
|
1782
1817
|
mounted = true;
|
|
1818
|
+
pending = false;
|
|
1819
|
+
if (!shouldShow) return;
|
|
1783
1820
|
const el = isMobile() ? buildMobileWatermark(variant) : buildDesktopWatermark(variant);
|
|
1784
1821
|
document.body.appendChild(el);
|
|
1785
1822
|
}
|
|
1786
1823
|
__name(mountWatermark, "mountWatermark");
|
|
1787
1824
|
function mountMiaodaWatermark() {
|
|
1788
|
-
mountWatermark("miaoda");
|
|
1825
|
+
return mountWatermark("miaoda");
|
|
1789
1826
|
}
|
|
1790
1827
|
__name(mountMiaodaWatermark, "mountMiaodaWatermark");
|
|
1791
1828
|
|
|
1792
1829
|
// src/runtime.ts
|
|
1793
|
-
var version = "0.0.
|
|
1830
|
+
var version = "0.0.14-alpha.20260918065040";
|
|
1794
1831
|
var name = "@lark-apaas/miaoda-coding-sdk";
|
|
1795
1832
|
if (isOnlineEnv()) {
|
|
1796
1833
|
reportPageView();
|
package/dist/runtime.min.js
CHANGED
|
@@ -1 +1,23 @@
|
|
|
1
|
-
"use strict";var MiaodaRuntime=(()=>{var Se=Object.create;var D=Object.defineProperty;var Ee=Object.getOwnPropertyDescriptor;var Ie=Object.getOwnPropertyNames;var Le=Object.getPrototypeOf,Te=Object.prototype.hasOwnProperty;var i=(n,e)=>D(n,"name",{value:e,configurable:!0});var U=(n,e)=>()=>(e||n((e={exports:{}}).exports,e),e.exports),Ae=(n,e)=>{for(var o in e)D(n,o,{get:e[o],enumerable:!0})},Z=(n,e,o,h)=>{if(e&&typeof e=="object"||typeof e=="function")for(let p of Ie(e))!Te.call(n,p)&&p!==o&&D(n,p,{get:()=>e[p],enumerable:!(h=Ee(e,p))||h.enumerable});return n};var J=(n,e,o)=>(o=n!=null?Se(Le(n)):{},Z(e||!n||!n.__esModule?D(o,"default",{value:n,enumerable:!0}):o,n)),Pe=n=>Z(D({},"__esModule",{value:!0}),n);var Y=U((q,R)=>{"use strict";(function(n){"use strict";function e(t,f){var r=(t&65535)+(f&65535),b=(t>>16)+(f>>16)+(r>>16);return b<<16|r&65535}i(e,"safeAdd");function o(t,f){return t<<f|t>>>32-f}i(o,"bitRotateLeft");function h(t,f,r,b,_,S){return e(o(e(e(f,t),e(b,S)),_),r)}i(h,"md5cmn");function p(t,f,r,b,_,S,A){return h(f&r|~f&b,t,f,_,S,A)}i(p,"md5ff");function m(t,f,r,b,_,S,A){return h(f&b|r&~b,t,f,_,S,A)}i(m,"md5gg");function g(t,f,r,b,_,S,A){return h(f^r^b,t,f,_,S,A)}i(g,"md5hh");function y(t,f,r,b,_,S,A){return h(r^(f|~b),t,f,_,S,A)}i(y,"md5ii");function C(t,f){t[f>>5]|=128<<f%32,t[(f+64>>>9<<4)+14]=f;var r,b,_,S,A,a=1732584193,s=-271733879,c=-1732584194,l=271733878;for(r=0;r<t.length;r+=16)b=a,_=s,S=c,A=l,a=p(a,s,c,l,t[r],7,-680876936),l=p(l,a,s,c,t[r+1],12,-389564586),c=p(c,l,a,s,t[r+2],17,606105819),s=p(s,c,l,a,t[r+3],22,-1044525330),a=p(a,s,c,l,t[r+4],7,-176418897),l=p(l,a,s,c,t[r+5],12,1200080426),c=p(c,l,a,s,t[r+6],17,-1473231341),s=p(s,c,l,a,t[r+7],22,-45705983),a=p(a,s,c,l,t[r+8],7,1770035416),l=p(l,a,s,c,t[r+9],12,-1958414417),c=p(c,l,a,s,t[r+10],17,-42063),s=p(s,c,l,a,t[r+11],22,-1990404162),a=p(a,s,c,l,t[r+12],7,1804603682),l=p(l,a,s,c,t[r+13],12,-40341101),c=p(c,l,a,s,t[r+14],17,-1502002290),s=p(s,c,l,a,t[r+15],22,1236535329),a=m(a,s,c,l,t[r+1],5,-165796510),l=m(l,a,s,c,t[r+6],9,-1069501632),c=m(c,l,a,s,t[r+11],14,643717713),s=m(s,c,l,a,t[r],20,-373897302),a=m(a,s,c,l,t[r+5],5,-701558691),l=m(l,a,s,c,t[r+10],9,38016083),c=m(c,l,a,s,t[r+15],14,-660478335),s=m(s,c,l,a,t[r+4],20,-405537848),a=m(a,s,c,l,t[r+9],5,568446438),l=m(l,a,s,c,t[r+14],9,-1019803690),c=m(c,l,a,s,t[r+3],14,-187363961),s=m(s,c,l,a,t[r+8],20,1163531501),a=m(a,s,c,l,t[r+13],5,-1444681467),l=m(l,a,s,c,t[r+2],9,-51403784),c=m(c,l,a,s,t[r+7],14,1735328473),s=m(s,c,l,a,t[r+12],20,-1926607734),a=g(a,s,c,l,t[r+5],4,-378558),l=g(l,a,s,c,t[r+8],11,-2022574463),c=g(c,l,a,s,t[r+11],16,1839030562),s=g(s,c,l,a,t[r+14],23,-35309556),a=g(a,s,c,l,t[r+1],4,-1530992060),l=g(l,a,s,c,t[r+4],11,1272893353),c=g(c,l,a,s,t[r+7],16,-155497632),s=g(s,c,l,a,t[r+10],23,-1094730640),a=g(a,s,c,l,t[r+13],4,681279174),l=g(l,a,s,c,t[r],11,-358537222),c=g(c,l,a,s,t[r+3],16,-722521979),s=g(s,c,l,a,t[r+6],23,76029189),a=g(a,s,c,l,t[r+9],4,-640364487),l=g(l,a,s,c,t[r+12],11,-421815835),c=g(c,l,a,s,t[r+15],16,530742520),s=g(s,c,l,a,t[r+2],23,-995338651),a=y(a,s,c,l,t[r],6,-198630844),l=y(l,a,s,c,t[r+7],10,1126891415),c=y(c,l,a,s,t[r+14],15,-1416354905),s=y(s,c,l,a,t[r+5],21,-57434055),a=y(a,s,c,l,t[r+12],6,1700485571),l=y(l,a,s,c,t[r+3],10,-1894986606),c=y(c,l,a,s,t[r+10],15,-1051523),s=y(s,c,l,a,t[r+1],21,-2054922799),a=y(a,s,c,l,t[r+8],6,1873313359),l=y(l,a,s,c,t[r+15],10,-30611744),c=y(c,l,a,s,t[r+6],15,-1560198380),s=y(s,c,l,a,t[r+13],21,1309151649),a=y(a,s,c,l,t[r+4],6,-145523070),l=y(l,a,s,c,t[r+11],10,-1120210379),c=y(c,l,a,s,t[r+2],15,718787259),s=y(s,c,l,a,t[r+9],21,-343485551),a=e(a,b),s=e(s,_),c=e(c,S),l=e(l,A);return[a,s,c,l]}i(C,"binlMD5");function T(t){var f,r="",b=t.length*32;for(f=0;f<b;f+=8)r+=String.fromCharCode(t[f>>5]>>>f%32&255);return r}i(T,"binl2rstr");function x(t){var f,r=[];for(r[(t.length>>2)-1]=void 0,f=0;f<r.length;f+=1)r[f]=0;var b=t.length*8;for(f=0;f<b;f+=8)r[f>>5]|=(t.charCodeAt(f/8)&255)<<f%32;return r}i(x,"rstr2binl");function I(t){return T(C(x(t),t.length*8))}i(I,"rstrMD5");function E(t,f){var r,b=x(t),_=[],S=[],A;for(_[15]=S[15]=void 0,b.length>16&&(b=C(b,t.length*8)),r=0;r<16;r+=1)_[r]=b[r]^909522486,S[r]=b[r]^1549556828;return A=C(_.concat(x(f)),512+f.length*8),T(C(S.concat(A),640))}i(E,"rstrHMACMD5");function P(t){var f="0123456789abcdef",r="",b,_;for(_=0;_<t.length;_+=1)b=t.charCodeAt(_),r+=f.charAt(b>>>4&15)+f.charAt(b&15);return r}i(P,"rstr2hex");function L(t){return unescape(encodeURIComponent(t))}i(L,"str2rstrUTF8");function d(t){return I(L(t))}i(d,"rawMD5");function u(t){return P(d(t))}i(u,"hexMD5");function w(t,f){return E(L(t),L(f))}i(w,"rawHMACMD5");function v(t,f){return P(w(t,f))}i(v,"hexHMACMD5");function k(t,f,r){return f?r?w(f,t):v(f,t):r?d(t):u(t)}i(k,"md5"),typeof define=="function"&&define.amd?define(function(){return k}):typeof R=="object"&&R.exports?R.exports=k:n.md5=k})(q)});var X=U((F,Q)=>{"use strict";(function(n,e){typeof F=="object"?Q.exports=F=e():typeof define=="function"&&define.amd?define([],e):n.CryptoJS=e()})(F,function(){var n=n||(function(e,o){var h=Object.create||(function(){function d(){}return i(d,"F"),function(u){var w;return d.prototype=u,w=new d,d.prototype=null,w}})(),p={},m=p.lib={},g=m.Base=(function(){return{extend:i(function(d){var u=h(this);return d&&u.mixIn(d),(!u.hasOwnProperty("init")||this.init===u.init)&&(u.init=function(){u.$super.init.apply(this,arguments)}),u.init.prototype=u,u.$super=this,u},"extend"),create:i(function(){var d=this.extend();return d.init.apply(d,arguments),d},"create"),init:i(function(){},"init"),mixIn:i(function(d){for(var u in d)d.hasOwnProperty(u)&&(this[u]=d[u]);d.hasOwnProperty("toString")&&(this.toString=d.toString)},"mixIn"),clone:i(function(){return this.init.prototype.extend(this)},"clone")}})(),y=m.WordArray=g.extend({init:i(function(d,u){d=this.words=d||[],u!=o?this.sigBytes=u:this.sigBytes=d.length*4},"init"),toString:i(function(d){return(d||T).stringify(this)},"toString"),concat:i(function(d){var u=this.words,w=d.words,v=this.sigBytes,k=d.sigBytes;if(this.clamp(),v%4)for(var t=0;t<k;t++){var f=w[t>>>2]>>>24-t%4*8&255;u[v+t>>>2]|=f<<24-(v+t)%4*8}else for(var t=0;t<k;t+=4)u[v+t>>>2]=w[t>>>2];return this.sigBytes+=k,this},"concat"),clamp:i(function(){var d=this.words,u=this.sigBytes;d[u>>>2]&=4294967295<<32-u%4*8,d.length=e.ceil(u/4)},"clamp"),clone:i(function(){var d=g.clone.call(this);return d.words=this.words.slice(0),d},"clone"),random:i(function(d){for(var u=[],w=i(function(r){var r=r,b=987654321,_=4294967295;return function(){b=36969*(b&65535)+(b>>16)&_,r=18e3*(r&65535)+(r>>16)&_;var S=(b<<16)+r&_;return S/=4294967296,S+=.5,S*(e.random()>.5?1:-1)}},"r"),v=0,k;v<d;v+=4){var t=w((k||e.random())*4294967296);k=t()*987654071,u.push(t()*4294967296|0)}return new y.init(u,d)},"random")}),C=p.enc={},T=C.Hex={stringify:i(function(d){for(var u=d.words,w=d.sigBytes,v=[],k=0;k<w;k++){var t=u[k>>>2]>>>24-k%4*8&255;v.push((t>>>4).toString(16)),v.push((t&15).toString(16))}return v.join("")},"stringify"),parse:i(function(d){for(var u=d.length,w=[],v=0;v<u;v+=2)w[v>>>3]|=parseInt(d.substr(v,2),16)<<24-v%8*4;return new y.init(w,u/2)},"parse")},x=C.Latin1={stringify:i(function(d){for(var u=d.words,w=d.sigBytes,v=[],k=0;k<w;k++){var t=u[k>>>2]>>>24-k%4*8&255;v.push(String.fromCharCode(t))}return v.join("")},"stringify"),parse:i(function(d){for(var u=d.length,w=[],v=0;v<u;v++)w[v>>>2]|=(d.charCodeAt(v)&255)<<24-v%4*8;return new y.init(w,u)},"parse")},I=C.Utf8={stringify:i(function(d){try{return decodeURIComponent(escape(x.stringify(d)))}catch{throw new Error("Malformed UTF-8 data")}},"stringify"),parse:i(function(d){return x.parse(unescape(encodeURIComponent(d)))},"parse")},E=m.BufferedBlockAlgorithm=g.extend({reset:i(function(){this._data=new y.init,this._nDataBytes=0},"reset"),_append:i(function(d){typeof d=="string"&&(d=I.parse(d)),this._data.concat(d),this._nDataBytes+=d.sigBytes},"_append"),_process:i(function(d){var u=this._data,w=u.words,v=u.sigBytes,k=this.blockSize,t=k*4,f=v/t;d?f=e.ceil(f):f=e.max((f|0)-this._minBufferSize,0);var r=f*k,b=e.min(r*4,v);if(r){for(var _=0;_<r;_+=k)this._doProcessBlock(w,_);var S=w.splice(0,r);u.sigBytes-=b}return new y.init(S,b)},"_process"),clone:i(function(){var d=g.clone.call(this);return d._data=this._data.clone(),d},"clone"),_minBufferSize:0}),P=m.Hasher=E.extend({cfg:g.extend(),init:i(function(d){this.cfg=this.cfg.extend(d),this.reset()},"init"),reset:i(function(){E.reset.call(this),this._doReset()},"reset"),update:i(function(d){return this._append(d),this._process(),this},"update"),finalize:i(function(d){d&&this._append(d);var u=this._doFinalize();return u},"finalize"),blockSize:512/32,_createHelper:i(function(d){return function(u,w){return new d.init(w).finalize(u)}},"_createHelper"),_createHmacHelper:i(function(d){return function(u,w){return new L.HMAC.init(d,w).finalize(u)}},"_createHmacHelper")}),L=p.algo={};return p})(Math);return n})});var te=U((N,ee)=>{"use strict";(function(n,e){typeof N=="object"?ee.exports=N=e(X()):typeof define=="function"&&define.amd?define(["./core"],e):e(n.CryptoJS)})(N,function(n){return(function(){var e=n,o=e.lib,h=o.WordArray,p=o.Hasher,m=e.algo,g=[],y=m.SHA1=p.extend({_doReset:i(function(){this._hash=new h.init([1732584193,4023233417,2562383102,271733878,3285377520])},"_doReset"),_doProcessBlock:i(function(C,T){for(var x=this._hash.words,I=x[0],E=x[1],P=x[2],L=x[3],d=x[4],u=0;u<80;u++){if(u<16)g[u]=C[T+u]|0;else{var w=g[u-3]^g[u-8]^g[u-14]^g[u-16];g[u]=w<<1|w>>>31}var v=(I<<5|I>>>27)+d+g[u];u<20?v+=(E&P|~E&L)+1518500249:u<40?v+=(E^P^L)+1859775393:u<60?v+=(E&P|E&L|P&L)-1894007588:v+=(E^P^L)-899497514,d=L,L=P,P=E<<30|E>>>2,E=I,I=v}x[0]=x[0]+I|0,x[1]=x[1]+E|0,x[2]=x[2]+P|0,x[3]=x[3]+L|0,x[4]=x[4]+d|0},"_doProcessBlock"),_doFinalize:i(function(){var C=this._data,T=C.words,x=this._nDataBytes*8,I=C.sigBytes*8;return T[I>>>5]|=128<<24-I%32,T[(I+64>>>9<<4)+14]=Math.floor(x/4294967296),T[(I+64>>>9<<4)+15]=x,C.sigBytes=T.length*4,this._process(),this._hash},"_doFinalize"),clone:i(function(){var C=p.clone.call(this);return C._hash=this._hash.clone(),C},"clone")});e.SHA1=p._createHelper(y),e.HmacSHA1=p._createHmacHelper(y)})(),n.SHA1})});var ct={};Ae(ct,{TrackKey:()=>z,name:()=>st,reportTeaEvent:()=>G,version:()=>at});var oe=J(Y(),1),ae=J(te(),1);function O(){return window.appId||null}i(O,"getAppId");function Oe(){var o;let n="suda-csrf-token",e=document.cookie.split("; ");for(let h of e){let[p,m]=h.split("=");if(p===n)return decodeURIComponent(m)}return(o=window.csrfToken)!=null?o:null}i(Oe,"getCsrfToken");function $(){let n=globalThis.CLIENT_BASE_PATH||"/";return/^\/app\/[^/]/.test(n)}i($,"isNewPathEnabled");function W(){switch(globalThis.ENVIRONMENT){case"gray":return"PRE";case"online":return"ONLINE";default:return"BOE"}}i(W,"getEnv");function ne(){return window.appEnv!=null?window.appEnv==="runtime":!0}i(ne,"isOnlineEnv");function j(){let n=navigator.userAgent,e=/(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i.test(n),o=/iPad|Tab|Tablet/i.test(n)&&navigator.maxTouchPoints>1;return e||o}i(j,"isMobile");async function re(){var h;let n=O();if(!n)return{code:1,msg:"appId is required",data:{}};let e=$()?`/app/${n}/__runtime__/api/v1/studio/lark/user_info`:`/spark/b/${n}/lark/user_info`;return await(await fetch(e,{headers:{"X-Suda-Csrf-Token":(h=Oe())!=null?h:""}})).json()}i(re,"getLarkUserInfo");var z={VIEW:"aily_agent_artifact_page_view"},Be="08a441",Me="42b91e";function ie(n){let e=String(n);return(0,ae.default)(Be+(0,oe.default)(e+Me)).toString()}i(ie,"encryptTea");var V=!1;async function De(){var m,g,y,C;let{data:n}=await re(),{tenantID:e,userID:o}=n||{},h=o&&o!=="0"?ie(o):void 0,p=e&&e!=="0"?ie(e):void 0;(m=window.collectEvent)==null||m.call(window,"init",{app_id:788827,channel:"cn",disable_auto_pv:!1,enable_ab_test:!1,enable_debug:!1,enable_stay_duration:!0,reportTime:1e3}),(y=window.collectEvent)==null||y.call(window,"config",{user_unique_id:h,device_type:j()?"mobile":"pc",evtParams:{open_from:(g=new URLSearchParams(window.location.search).get("open-from"))!=null?g:void 0,env:W(),user_id:h,tenant_id:p}}),V=!0,(C=window.collectEvent)==null||C.call(window,"start")}i(De,"createTracker");async function G({trackKey:n,trackParams:e={}}){var o;try{V||(V=!0,await De()),(o=window.collectEvent)==null||o.call(window,n,e)}catch(h){console.error(h)}}i(G,"reportTeaEvent");function se(){return G({trackKey:z.VIEW,trackParams:{artifact_uid:O(),agent_id:"agent_miaoda",url:window.location.href}})}i(se,"reportPageView");function ce(){if(typeof crypto!="undefined"&&crypto.getRandomValues){let e=new Uint8Array(8);return crypto.getRandomValues(e),Array.from(e).map(o=>o.toString(16).padStart(2,"0")).join("")}let n="";for(let e=0;e<16;e++)n+=Math.floor(Math.random()*16).toString(16);return n}i(ce,"generateUUID");var le="x_sdk_device_id";function He(){try{let n=localStorage.getItem(le);return n||(n=ce(),localStorage.setItem(le,n)),n}catch{return ce()}}i(He,"getDeviceId");function Re(){let n=typeof navigator!="undefined"?navigator.userAgent:"";return n&&(/Android/i.test(n)&&/Mobile/i.test(n)||/iPhone|iPod/i.test(n)||/BlackBerry|IEMobile|Opera Mini/i.test(n))?"mobile":"desktop"}i(Re,"getDeviceType");var Fe="pageSessionID";function Ne(){try{return new URLSearchParams(window.location.search).get(Fe)||""}catch{return""}}i(Ne,"getPvId");function We(n={}){let e=n.pvId||Ne();return{app_id:window.appId||"",tenant_id:window.tenantId||"",user_id:window.userId||"",did:He(),module:"app_web",app_env:"runtime",source_type:"user",device_type:Re(),release_commit_id:window.__RELEASE_COMMIT_ID__||"",...e?{pv_id:e}:{}}}i(We,"getDefaultAttributes");function de(n){let e=Math.round(n);if(!Number.isFinite(e))throw new RangeError(`toNanoString: \u975E\u6CD5\u65F6\u95F4\u6233 ${n}`);return typeof BigInt!="function"?e===0?"0":`${e}000000`:String(BigInt(e)*BigInt(1e6))}i(de,"toNanoString");var je="1.0.2";function Ue(n,e){let o=We(e),h=de(Date.now());return{metricsData:{resource:{attributes:{sdk_version:je,sdk_lang:"javascript",sdk_type:"client-frontend"}},metrics:[{name:"apaas_internal_metrics_pv_uv",description:"Count of page views",unit:"",scopeName:"apaas_internal_metrics_pv_uv",sum:{aggregationTemporality:1,isMonotonic:!0,dataPoints:n.map(p=>({attributes:{...o,url:p.url,path:p.path,referrer:p.referrer},startTimeUnixNano:de(p.timestampMs),timeUnixNano:h,asDouble:1}))}}]}}}i(Ue,"buildPayload");function $e(n,e,o={},h){if(e.length===0)return;let p;try{p=JSON.stringify(Ue(e,h))}catch{return}try{fetch(n,{method:"POST",headers:{"Content-Type":"application/json","X-Suda-Csrf-Token":window.csrfToken||"",...o},body:p,keepalive:!0}).catch(()=>{})}catch{}}i($e,"sendPvData");var K="__APAAS_PV_TRACKER_STARTED__";function Ve(){try{let n=window;return n[K]?!1:(n[K]=!0,!0)}catch{return!0}}i(Ve,"claimPvReporting");function ue(){try{window[K]=!1}catch{}}i(ue,"releasePvReporting");var B,ze=(B=class{constructor(){this.started=!1,this.disposers=[],this.holdsPvReporting=!1,this.buffer=[]}static get instance(){return this._instance||(this._instance=new B),this._instance}start(e){var o;if(!this.started&&Ve()){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,ue(),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,ue())}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);$e(this.config.collectorUrl,e,this.config.headers,{pvId:this.config.pvId})}listenRouteChanges(){this.recordPv();let e=i(()=>this.recordPv(),"onPopState");window.addEventListener("popstate",e),this.disposers.push(()=>window.removeEventListener("popstate",e)),this.patchHistory("pushState"),this.patchHistory("replaceState")}patchHistory(e){let o=history[e],h=i(()=>this.recordPv(),"recordPv");history[e]=function(...p){let m=o.apply(this,p);return h(),m},this.disposers.push(()=>{history[e]=o})}registerLifecycleListeners(){let e=i(()=>{document.visibilityState==="hidden"&&this.flush()},"onVisibilityChange");document.addEventListener("visibilitychange",e),this.disposers.push(()=>document.removeEventListener("visibilitychange",e));let o=i(()=>this.flush(),"onPageHide");window.addEventListener("pagehide",o),this.disposers.push(()=>window.removeEventListener("pagehide",o))}},i(B,"_PvTracker"),B),fe=ze.instance;function pe(){var o;let n=(o=O())!=null?o:"",e=$()?`/app/${n}/__runtime__/api/v1/observability/metrics/collect`:`/spark/app/${n}/runtime/api/v1/observability/metrics/collect`;fe.start({collectorUrl:e})}i(pe,"initPvTracking");var ge="https://lf3-static.bytednsdoc.com/obj/eden-cn/LMfspH/ljhwZthlaukjlkulzlp",Ge=`${ge}/miaoda-ui/doubao.svg`,Ke=`${ge}/logo/miaodalogo.svg`,me='<svg viewBox="0 0 10 10" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M8.08312 8.08298C8.2384 7.92769 8.23953 7.67705 8.08424 7.52176L5.3625 4.80002L8.08422 2.07829C8.23951 1.92301 8.23839 1.67236 8.0831 1.51708C7.92781 1.36179 7.67717 1.36066 7.52188 1.51595C7.36659 1.67124 4.80016 4.23767 4.80016 4.23767L2.07841 1.51593C1.92313 1.36064 1.67248 1.36177 1.5172 1.51705C1.36191 1.67234 1.36078 1.92298 1.51607 2.07827L4.23782 4.80002L1.51605 7.52178C1.36076 7.67707 1.36189 7.92771 1.51718 8.083C1.67246 8.23829 1.92311 8.23941 2.07839 8.08412L4.80016 5.36236L7.5219 8.0841C7.67719 8.23939 7.92783 8.23826 8.08312 8.08298Z" fill="currentColor"/></svg>',Ze='<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M12.6667 2H3.33333V14H6.66667V15.3334H3.33333C2.59695 15.3334 2 14.7364 2 14V2C2 1.26364 2.59695 0.666687 3.33333 0.666687H12.6667C13.403 0.666687 14 1.26364 14 2V7.33335H12.6667V2Z" fill="currentColor"/><path d="M5.33333 4.66669C4.96514 4.66669 4.66667 4.96516 4.66667 5.33335C4.66667 5.70154 4.96514 6 5.33333 6H10.6667C11.0349 6 11.3333 5.70154 11.3333 5.33335C11.3333 4.96516 11.0349 4.66669 10.6667 4.66669H5.33333Z" fill="currentColor"/><path d="M4.66667 8.33335C4.66667 7.96516 4.96514 7.66669 5.33333 7.66669H8C8.36819 7.66669 8.66667 7.96516 8.66667 8.33335C8.66667 8.70154 8.36819 9 8 9H5.33333C4.96514 9 4.66667 8.70154 4.66667 8.33335Z" fill="currentColor"/><path d="M13.5523 8.70017C13.9428 8.30964 14.576 8.30964 14.9665 8.70017C15.357 9.09069 15.357 9.72386 14.9665 10.1144L14.2594 10.8215L12.8452 9.40728L13.5523 8.70017Z" fill="currentColor"/><path d="M12.1381 10.1144L13.5523 11.5286L10.2309 14.85C10.0916 14.9892 9.91229 15.0815 9.71798 15.1138L8.45737 15.3234C8.42136 15.3294 8.38467 15.3177 8.35885 15.2918C8.33271 15.2657 8.32099 15.2284 8.32749 15.192L8.55128 13.9374C8.58465 13.7502 8.6746 13.5779 8.80901 13.4435L12.1381 10.1144Z" fill="currentColor"/></svg>',Je='<svg width="16" height="16" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M11.9922 1.99221C12.5445 1.98895 12.9958 2.43407 12.999 2.98634L13.0762 16.1943L14.6387 14.6328L17.8926 11.3789C18.2831 10.9884 18.9171 10.9885 19.3076 11.3789C19.6977 11.7695 19.6979 12.4026 19.3076 12.793L16.0527 16.0479L12.7979 19.3018C12.7111 19.3884 12.6098 19.4566 12.5 19.5059H20.375C20.9271 19.5059 21.3748 19.9538 21.375 20.5059C21.375 21.0581 20.9273 21.5059 20.375 21.5059H3.625C3.07272 21.5059 2.625 21.0581 2.625 20.5059C2.62523 19.9538 3.07286 19.5059 3.625 19.5059H11.6816C11.572 19.4566 11.4704 19.3884 11.3838 19.3018L4.87402 12.793C4.48372 12.4026 4.4839 11.7694 4.87402 11.3789C5.26452 10.9884 5.89756 10.9885 6.28809 11.3789L11.0762 16.166L10.999 2.99806C10.9958 2.44603 11.4402 1.99582 11.9922 1.99221Z" fill="currentColor"/></svg>',qe='<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M2.0754 7.57153C2.23188 9.44922 3.49231 11.053 5.27982 11.6488C5.31351 11.6601 5.33994 11.6865 5.35117 11.7202L5.72076 12.8289C5.88752 13.3292 6.3557 13.6667 6.88304 13.6667H9.11696C9.6443 13.6667 10.1125 13.3292 10.2792 12.8289L10.6488 11.7202C10.6601 11.6865 10.6865 11.6601 10.7202 11.6488C12.5077 11.053 13.7681 9.44922 13.9246 7.57153L14 6.66667C14 3.35296 11.3137 0.666668 8 0.666668C4.68629 0.666668 2 3.35296 2 6.66667L2.0754 7.57153ZM9.38392 11.2985L9.03899 12.3333H6.96101L6.61608 11.2985C6.47214 10.8667 6.13328 10.5279 5.70146 10.3839C4.41995 9.95675 3.51631 8.80696 3.40413 7.4608L3.33362 6.61462C3.36152 4.06127 5.44004 2 8 2C10.56 2 12.6385 4.06127 12.6664 6.61462L12.5959 7.4608C12.4837 8.80696 11.5801 9.95675 10.2985 10.3839C9.86672 10.5279 9.52786 10.8667 9.38392 11.2985Z" fill="currentColor"/><path d="M6.66667 14.3333C6.29848 14.3333 6 14.6318 6 15C6 15.3682 6.29848 15.6667 6.66667 15.6667H9.33333C9.70152 15.6667 10 15.3682 10 15C10 14.6318 9.70152 14.3333 9.33333 14.3333H6.66667Z" fill="currentColor"/><path d="M8.00864 4.13208L5.44578 6.94049C5.20258 7.18228 5.37835 7.56531 5.74361 7.58951L7.2181 7.6872L7.21814 9.60852C7.21814 9.96788 7.72139 10.1366 7.99168 9.86792C8.26197 9.59921 10.5545 7.05951 10.5545 7.05951C10.7977 6.81772 10.622 6.43469 10.2567 6.41049L8.78222 6.3128L8.78219 4.39148C8.78218 4.03212 8.27893 3.86336 8.00864 4.13208Z" fill="currentColor"/></svg>',ve=!0,Ye="0px 8px 32px rgba(0,0,0,0.08), 0px 4px 16px rgba(0,0,0,0.04), 0px 2px 4px rgba(0,0,0,0.02)",Qe="0px 4px 16px rgba(0,0,0,0.03), 0px 4px 10px rgba(0,0,0,0.03), 0px 2px 4px rgba(0,0,0,0.02)",be="'PingFang SC', -apple-system, BlinkMacSystemFont, sans-serif",H={doubao:{brandText:"\u8C46\u5305\u5DE5\u4F5C\u751F\u6210",logoSrc:Ge,downloadUrl:"https://ugapk.com/FCtLH"},miaoda:{brandText:"\u5999\u642D\u751F\u6210",logoSrc:Ke,landingUrl:"https://miaoda.feishu.cn/landing"}},Xe={BOE:"tns.feishu-boe.cn",PRE:"tns.feishu-pre.cn",ONLINE:"tns.feishu.cn"};function ye(){var o;let n=JSON.stringify({scene:"miaoda_app_report",entity_id:(o=O())!=null?o:"",entity_type:"miaoda_app",extra:""}),e=`https://${Xe[W()]}/cust/lark_report/?type=common¶ms=${encodeURIComponent(n)}&lang=zh-CN`;window.open(e,"_blank","noopener,noreferrer")}i(ye,"openReport");var et={feedback:Ze,close:me,download:Je,efficiency:qe};function we(n){let e=document.createElement("span");Object.assign(e.style,{display:"inline-flex",width:`${n}px`,height:`${n}px`,flexShrink:"0"}),e.innerHTML=me;let o=e.firstElementChild;return o&&(o.setAttribute("width",String(n)),o.setAttribute("height",String(n)),o.style.display="block"),e}i(we,"makeCloseIcon");function tt(n,e=16){if(n==="close")return we(e);let o=document.createElement("span");Object.assign(o.style,{display:"inline-flex",width:`${e}px`,height:`${e}px`,flexShrink:"0"}),o.innerHTML=et[n];let h=o.firstElementChild;return h&&(h.style.display="block"),o}i(tt,"makeIcon");function nt(n,e){let o=document.createElement("img");return o.src=n,o.width=e,o.height=e,o.alt="",Object.assign(o.style,{width:`${e}px`,height:`${e}px`,maxWidth:"none",maxHeight:"none",borderRadius:"100px",flexShrink:"0",display:"block"}),o}i(nt,"makeLogo");function _e(n,e,o){let h=e==="desktop",p=H[n],m=document.createElement("div");Object.assign(m.style,{boxSizing:"border-box",display:"inline-flex",alignItems:"center",gap:"4px",padding:h?"6px 12px 6px 8px":"5px 12px 5px 8px",background:"#363636",border:"0.5px solid rgba(255,255,255,0.1)",borderRadius:"100px",boxShadow:Ye,cursor:"pointer"});let g=nt(p.logoSrc,16),y=document.createElement("span");if(y.textContent=p.brandText,Object.assign(y.style,{fontFamily:be,fontSize:h?"12px":"14px",lineHeight:h?"18px":"22px",color:"rgba(255,255,255,0.85)",whiteSpace:"nowrap"}),m.append(g,y),h&&o){let C=document.createElement("span");C.setAttribute("role","button"),C.setAttribute("aria-label","\u5173\u95ED"),C.setAttribute("data-watermark-close",""),Object.assign(C.style,{display:"none",alignItems:"center",cursor:"pointer",flexShrink:"0",color:"rgba(255,255,255,0.5)"}),C.appendChild(we(10)),C.addEventListener("click",T=>{T.stopPropagation(),o()}),m.appendChild(C)}return m}i(_e,"buildPill");function M(n){let e=document.createElement("div");e.setAttribute("role","menuitem"),e.setAttribute("data-label",n.label),Object.assign(e.style,{boxSizing:"border-box",display:"flex",alignItems:"center",gap:"8px",minHeight:"38px",padding:"4px 10px",borderRadius:"6px",cursor:"pointer",color:"#000000"});let o=document.createElement("span");Object.assign(o.style,{display:"inline-flex",width:"16px",height:"16px",flexShrink:"0",color:"#000000"}),o.appendChild(tt(n.icon));let h=document.createElement("span");return h.textContent=n.label,Object.assign(h.style,{fontFamily:be,fontSize:`${n.fontSize}px`,lineHeight:`${n.fontSize+8}px`,color:"#000000",whiteSpace:"nowrap"}),e.append(o,h),e.addEventListener("mouseenter",()=>{e.style.background="rgba(0,0,0,0.04)"}),e.addEventListener("mouseleave",()=>{e.style.background="transparent"}),e.addEventListener("click",n.onClick),e}i(M,"buildMenuRow");function rt(){let n=document.createElement("div");return Object.assign(n.style,{height:"1px",background:"rgba(0,0,0,0.08)",margin:"0 10px"}),n}i(rt,"buildDivider");function Ce(n){var o;let e=document.createElement("div");if(Object.assign(e.style,{boxSizing:"border-box",display:"flex",flexDirection:"column",minWidth:`${n.minWidth}px`,background:"#ffffff",border:"0.5px solid rgba(0,0,0,0.1)",borderRadius:"10px",boxShadow:Qe,overflow:"hidden",outline:"none"}),n.items.length){let h=document.createElement("div");Object.assign(h.style,{boxSizing:"border-box",padding:"4px",display:"flex",flexDirection:"column",gap:`${(o=n.itemGap)!=null?o:0}px`}),n.items.forEach(p=>h.appendChild(p)),e.appendChild(h)}if(n.extraItems&&n.extraItems.length){e.appendChild(rt());let h=document.createElement("div");Object.assign(h.style,{boxSizing:"border-box",padding:"4px"}),n.extraItems.forEach(p=>h.appendChild(p)),e.appendChild(h)}return e}i(Ce,"buildMenuCard");function it(n){let e=document.createElement("div");e.setAttribute("data-custom-element",`${n}-watermark`),Object.assign(e.style,{position:"fixed",right:"12px",bottom:"12px",zIndex:"9999",display:"flex",flexDirection:"column",alignItems:"flex-end",gap:"8px"});let o=[];n==="doubao"?o.push(M({icon:"download",label:"\u4E0B\u8F7D\u8C46\u5305\u5DE5\u4F5C",fontSize:14,onClick:i(()=>window.open(H.doubao.downloadUrl,"_blank","noopener,noreferrer"),"onClick")})):o.push(M({icon:"efficiency",label:"\u4E86\u89E3\u5999\u642D",fontSize:14,onClick:i(()=>window.open(H.miaoda.landingUrl,"_blank","noopener,noreferrer"),"onClick")})),ve&&o.push(M({icon:"feedback",label:"\u6295\u8BC9\u4E0E\u4E3E\u62A5",fontSize:14,onClick:ye}));let h=Ce({items:o,minWidth:160,itemGap:8});h.style.display="none";let p=_e(n,"desktop",()=>e.remove()),m=p.querySelector("[data-watermark-close]");e.append(h,p);let g=null;return e.addEventListener("mouseenter",()=>{g&&clearTimeout(g),h.style.display="flex",m&&(m.style.display="inline-flex")}),e.addEventListener("mouseleave",()=>{g=setTimeout(()=>{h.style.display="none",m&&(m.style.display="none")},100)}),e}i(it,"buildDesktopWatermark");function ot(n){let e=document.createElement("div");e.setAttribute("data-custom-element",`${n}-watermark-mobile`),Object.assign(e.style,{position:"fixed",right:"12px",bottom:"12px",zIndex:"9999",display:"flex",flexDirection:"column",alignItems:"flex-end",gap:"8px",cursor:"pointer"});let o=[];n==="doubao"?o.push(M({icon:"download",label:"\u4E0B\u8F7D\u8C46\u5305\u5DE5\u4F5C",fontSize:16,onClick:i(()=>window.open(H.doubao.downloadUrl,"_blank","noopener,noreferrer"),"onClick")})):o.push(M({icon:"efficiency",label:"\u4E86\u89E3\u5999\u642D",fontSize:16,onClick:i(()=>window.open(H.miaoda.landingUrl,"_blank","noopener,noreferrer"),"onClick")})),ve&&o.push(M({icon:"feedback",label:"\u6295\u8BC9\u4E0E\u4E3E\u62A5",fontSize:16,onClick:ye}));let h=[M({icon:"close",label:"\u4E0D\u518D\u5C55\u793A",fontSize:16,onClick:i(g=>{g.stopPropagation(),e.remove()},"onClick")})],p=Ce({items:o,extraItems:h,minWidth:160});p.style.display="none";let m=_e(n,"mobile");return e.append(p,m),e.addEventListener("click",g=>{g.stopPropagation(),p.style.display=p.style.display==="none"?"flex":"none"}),document.addEventListener("click",()=>{p.style.display="none"}),e}i(ot,"buildMobileWatermark");var he=!1;function xe(n){if(he||typeof document=="undefined")return;if(document.readyState==="loading"){document.addEventListener("DOMContentLoaded",()=>xe(n),{once:!0});return}he=!0;let e=j()?ot(n):it(n);document.body.appendChild(e)}i(xe,"mountWatermark");function ke(){xe("miaoda")}i(ke,"mountMiaodaWatermark");var at="0.0.13",st="@lark-apaas/miaoda-coding-sdk";ne()&&(se(),pe());ke();return Pe(ct);})();
|
|
1
|
+
"use strict";var MiaodaRuntime=(()=>{var Te=Object.create;var H=Object.defineProperty;var Ae=Object.getOwnPropertyDescriptor;var Pe=Object.getOwnPropertyNames;var Be=Object.getPrototypeOf,Oe=Object.prototype.hasOwnProperty;var i=(n,e)=>H(n,"name",{value:e,configurable:!0});var U=(n,e)=>()=>(e||n((e={exports:{}}).exports,e),e.exports),Me=(n,e)=>{for(var o in e)H(n,o,{get:e[o],enumerable:!0})},q=(n,e,o,u)=>{if(e&&typeof e=="object"||typeof e=="function")for(let p of Pe(e))!Oe.call(n,p)&&p!==o&&H(n,p,{get:()=>e[p],enumerable:!(u=Ae(e,p))||u.enumerable});return n};var X=(n,e,o)=>(o=n!=null?Te(Be(n)):{},q(e||!n||!n.__esModule?H(o,"default",{value:n,enumerable:!0}):o,n)),He=n=>q(H({},"__esModule",{value:!0}),n);var Q=U((Y,D)=>{"use strict";(function(n){"use strict";function e(t,h){var r=(t&65535)+(h&65535),y=(t>>16)+(h>>16)+(r>>16);return y<<16|r&65535}i(e,"safeAdd");function o(t,h){return t<<h|t>>>32-h}i(o,"bitRotateLeft");function u(t,h,r,y,C,S){return e(o(e(e(h,t),e(y,S)),C),r)}i(u,"md5cmn");function p(t,h,r,y,C,S,A){return u(h&r|~h&y,t,h,C,S,A)}i(p,"md5ff");function m(t,h,r,y,C,S,A){return u(h&y|r&~y,t,h,C,S,A)}i(m,"md5gg");function g(t,h,r,y,C,S,A){return u(h^r^y,t,h,C,S,A)}i(g,"md5hh");function v(t,h,r,y,C,S,A){return u(r^(h|~y),t,h,C,S,A)}i(v,"md5ii");function w(t,h){t[h>>5]|=128<<h%32,t[(h+64>>>9<<4)+14]=h;var r,y,C,S,A,a=1732584193,s=-271733879,c=-1732584194,l=271733878;for(r=0;r<t.length;r+=16)y=a,C=s,S=c,A=l,a=p(a,s,c,l,t[r],7,-680876936),l=p(l,a,s,c,t[r+1],12,-389564586),c=p(c,l,a,s,t[r+2],17,606105819),s=p(s,c,l,a,t[r+3],22,-1044525330),a=p(a,s,c,l,t[r+4],7,-176418897),l=p(l,a,s,c,t[r+5],12,1200080426),c=p(c,l,a,s,t[r+6],17,-1473231341),s=p(s,c,l,a,t[r+7],22,-45705983),a=p(a,s,c,l,t[r+8],7,1770035416),l=p(l,a,s,c,t[r+9],12,-1958414417),c=p(c,l,a,s,t[r+10],17,-42063),s=p(s,c,l,a,t[r+11],22,-1990404162),a=p(a,s,c,l,t[r+12],7,1804603682),l=p(l,a,s,c,t[r+13],12,-40341101),c=p(c,l,a,s,t[r+14],17,-1502002290),s=p(s,c,l,a,t[r+15],22,1236535329),a=m(a,s,c,l,t[r+1],5,-165796510),l=m(l,a,s,c,t[r+6],9,-1069501632),c=m(c,l,a,s,t[r+11],14,643717713),s=m(s,c,l,a,t[r],20,-373897302),a=m(a,s,c,l,t[r+5],5,-701558691),l=m(l,a,s,c,t[r+10],9,38016083),c=m(c,l,a,s,t[r+15],14,-660478335),s=m(s,c,l,a,t[r+4],20,-405537848),a=m(a,s,c,l,t[r+9],5,568446438),l=m(l,a,s,c,t[r+14],9,-1019803690),c=m(c,l,a,s,t[r+3],14,-187363961),s=m(s,c,l,a,t[r+8],20,1163531501),a=m(a,s,c,l,t[r+13],5,-1444681467),l=m(l,a,s,c,t[r+2],9,-51403784),c=m(c,l,a,s,t[r+7],14,1735328473),s=m(s,c,l,a,t[r+12],20,-1926607734),a=g(a,s,c,l,t[r+5],4,-378558),l=g(l,a,s,c,t[r+8],11,-2022574463),c=g(c,l,a,s,t[r+11],16,1839030562),s=g(s,c,l,a,t[r+14],23,-35309556),a=g(a,s,c,l,t[r+1],4,-1530992060),l=g(l,a,s,c,t[r+4],11,1272893353),c=g(c,l,a,s,t[r+7],16,-155497632),s=g(s,c,l,a,t[r+10],23,-1094730640),a=g(a,s,c,l,t[r+13],4,681279174),l=g(l,a,s,c,t[r],11,-358537222),c=g(c,l,a,s,t[r+3],16,-722521979),s=g(s,c,l,a,t[r+6],23,76029189),a=g(a,s,c,l,t[r+9],4,-640364487),l=g(l,a,s,c,t[r+12],11,-421815835),c=g(c,l,a,s,t[r+15],16,530742520),s=g(s,c,l,a,t[r+2],23,-995338651),a=v(a,s,c,l,t[r],6,-198630844),l=v(l,a,s,c,t[r+7],10,1126891415),c=v(c,l,a,s,t[r+14],15,-1416354905),s=v(s,c,l,a,t[r+5],21,-57434055),a=v(a,s,c,l,t[r+12],6,1700485571),l=v(l,a,s,c,t[r+3],10,-1894986606),c=v(c,l,a,s,t[r+10],15,-1051523),s=v(s,c,l,a,t[r+1],21,-2054922799),a=v(a,s,c,l,t[r+8],6,1873313359),l=v(l,a,s,c,t[r+15],10,-30611744),c=v(c,l,a,s,t[r+6],15,-1560198380),s=v(s,c,l,a,t[r+13],21,1309151649),a=v(a,s,c,l,t[r+4],6,-145523070),l=v(l,a,s,c,t[r+11],10,-1120210379),c=v(c,l,a,s,t[r+2],15,718787259),s=v(s,c,l,a,t[r+9],21,-343485551),a=e(a,y),s=e(s,C),c=e(c,S),l=e(l,A);return[a,s,c,l]}i(w,"binlMD5");function T(t){var h,r="",y=t.length*32;for(h=0;h<y;h+=8)r+=String.fromCharCode(t[h>>5]>>>h%32&255);return r}i(T,"binl2rstr");function x(t){var h,r=[];for(r[(t.length>>2)-1]=void 0,h=0;h<r.length;h+=1)r[h]=0;var y=t.length*8;for(h=0;h<y;h+=8)r[h>>5]|=(t.charCodeAt(h/8)&255)<<h%32;return r}i(x,"rstr2binl");function L(t){return T(w(x(t),t.length*8))}i(L,"rstrMD5");function E(t,h){var r,y=x(t),C=[],S=[],A;for(C[15]=S[15]=void 0,y.length>16&&(y=w(y,t.length*8)),r=0;r<16;r+=1)C[r]=y[r]^909522486,S[r]=y[r]^1549556828;return A=w(C.concat(x(h)),512+h.length*8),T(w(S.concat(A),640))}i(E,"rstrHMACMD5");function P(t){var h="0123456789abcdef",r="",y,C;for(C=0;C<t.length;C+=1)y=t.charCodeAt(C),r+=h.charAt(y>>>4&15)+h.charAt(y&15);return r}i(P,"rstr2hex");function I(t){return unescape(encodeURIComponent(t))}i(I,"str2rstrUTF8");function d(t){return L(I(t))}i(d,"rawMD5");function f(t){return P(d(t))}i(f,"hexMD5");function _(t,h){return E(I(t),I(h))}i(_,"rawHMACMD5");function b(t,h){return P(_(t,h))}i(b,"hexHMACMD5");function k(t,h,r){return h?r?_(h,t):b(h,t):r?d(t):f(t)}i(k,"md5"),typeof define=="function"&&define.amd?define(function(){return k}):typeof D=="object"&&D.exports?D.exports=k:n.md5=k})(Y)});var te=U((R,ee)=>{"use strict";(function(n,e){typeof R=="object"?ee.exports=R=e():typeof define=="function"&&define.amd?define([],e):n.CryptoJS=e()})(R,function(){var n=n||(function(e,o){var u=Object.create||(function(){function d(){}return i(d,"F"),function(f){var _;return d.prototype=f,_=new d,d.prototype=null,_}})(),p={},m=p.lib={},g=m.Base=(function(){return{extend:i(function(d){var f=u(this);return d&&f.mixIn(d),(!f.hasOwnProperty("init")||this.init===f.init)&&(f.init=function(){f.$super.init.apply(this,arguments)}),f.init.prototype=f,f.$super=this,f},"extend"),create:i(function(){var d=this.extend();return d.init.apply(d,arguments),d},"create"),init:i(function(){},"init"),mixIn:i(function(d){for(var f in d)d.hasOwnProperty(f)&&(this[f]=d[f]);d.hasOwnProperty("toString")&&(this.toString=d.toString)},"mixIn"),clone:i(function(){return this.init.prototype.extend(this)},"clone")}})(),v=m.WordArray=g.extend({init:i(function(d,f){d=this.words=d||[],f!=o?this.sigBytes=f:this.sigBytes=d.length*4},"init"),toString:i(function(d){return(d||T).stringify(this)},"toString"),concat:i(function(d){var f=this.words,_=d.words,b=this.sigBytes,k=d.sigBytes;if(this.clamp(),b%4)for(var t=0;t<k;t++){var h=_[t>>>2]>>>24-t%4*8&255;f[b+t>>>2]|=h<<24-(b+t)%4*8}else for(var t=0;t<k;t+=4)f[b+t>>>2]=_[t>>>2];return this.sigBytes+=k,this},"concat"),clamp:i(function(){var d=this.words,f=this.sigBytes;d[f>>>2]&=4294967295<<32-f%4*8,d.length=e.ceil(f/4)},"clamp"),clone:i(function(){var d=g.clone.call(this);return d.words=this.words.slice(0),d},"clone"),random:i(function(d){for(var f=[],_=i(function(r){var r=r,y=987654321,C=4294967295;return function(){y=36969*(y&65535)+(y>>16)&C,r=18e3*(r&65535)+(r>>16)&C;var S=(y<<16)+r&C;return S/=4294967296,S+=.5,S*(e.random()>.5?1:-1)}},"r"),b=0,k;b<d;b+=4){var t=_((k||e.random())*4294967296);k=t()*987654071,f.push(t()*4294967296|0)}return new v.init(f,d)},"random")}),w=p.enc={},T=w.Hex={stringify:i(function(d){for(var f=d.words,_=d.sigBytes,b=[],k=0;k<_;k++){var t=f[k>>>2]>>>24-k%4*8&255;b.push((t>>>4).toString(16)),b.push((t&15).toString(16))}return b.join("")},"stringify"),parse:i(function(d){for(var f=d.length,_=[],b=0;b<f;b+=2)_[b>>>3]|=parseInt(d.substr(b,2),16)<<24-b%8*4;return new v.init(_,f/2)},"parse")},x=w.Latin1={stringify:i(function(d){for(var f=d.words,_=d.sigBytes,b=[],k=0;k<_;k++){var t=f[k>>>2]>>>24-k%4*8&255;b.push(String.fromCharCode(t))}return b.join("")},"stringify"),parse:i(function(d){for(var f=d.length,_=[],b=0;b<f;b++)_[b>>>2]|=(d.charCodeAt(b)&255)<<24-b%4*8;return new v.init(_,f)},"parse")},L=w.Utf8={stringify:i(function(d){try{return decodeURIComponent(escape(x.stringify(d)))}catch{throw new Error("Malformed UTF-8 data")}},"stringify"),parse:i(function(d){return x.parse(unescape(encodeURIComponent(d)))},"parse")},E=m.BufferedBlockAlgorithm=g.extend({reset:i(function(){this._data=new v.init,this._nDataBytes=0},"reset"),_append:i(function(d){typeof d=="string"&&(d=L.parse(d)),this._data.concat(d),this._nDataBytes+=d.sigBytes},"_append"),_process:i(function(d){var f=this._data,_=f.words,b=f.sigBytes,k=this.blockSize,t=k*4,h=b/t;d?h=e.ceil(h):h=e.max((h|0)-this._minBufferSize,0);var r=h*k,y=e.min(r*4,b);if(r){for(var C=0;C<r;C+=k)this._doProcessBlock(_,C);var S=_.splice(0,r);f.sigBytes-=y}return new v.init(S,y)},"_process"),clone:i(function(){var d=g.clone.call(this);return d._data=this._data.clone(),d},"clone"),_minBufferSize:0}),P=m.Hasher=E.extend({cfg:g.extend(),init:i(function(d){this.cfg=this.cfg.extend(d),this.reset()},"init"),reset:i(function(){E.reset.call(this),this._doReset()},"reset"),update:i(function(d){return this._append(d),this._process(),this},"update"),finalize:i(function(d){d&&this._append(d);var f=this._doFinalize();return f},"finalize"),blockSize:512/32,_createHelper:i(function(d){return function(f,_){return new d.init(_).finalize(f)}},"_createHelper"),_createHmacHelper:i(function(d){return function(f,_){return new I.HMAC.init(d,_).finalize(f)}},"_createHmacHelper")}),I=p.algo={};return p})(Math);return n})});var re=U((F,ne)=>{"use strict";(function(n,e){typeof F=="object"?ne.exports=F=e(te()):typeof define=="function"&&define.amd?define(["./core"],e):e(n.CryptoJS)})(F,function(n){return(function(){var e=n,o=e.lib,u=o.WordArray,p=o.Hasher,m=e.algo,g=[],v=m.SHA1=p.extend({_doReset:i(function(){this._hash=new u.init([1732584193,4023233417,2562383102,271733878,3285377520])},"_doReset"),_doProcessBlock:i(function(w,T){for(var x=this._hash.words,L=x[0],E=x[1],P=x[2],I=x[3],d=x[4],f=0;f<80;f++){if(f<16)g[f]=w[T+f]|0;else{var _=g[f-3]^g[f-8]^g[f-14]^g[f-16];g[f]=_<<1|_>>>31}var b=(L<<5|L>>>27)+d+g[f];f<20?b+=(E&P|~E&I)+1518500249:f<40?b+=(E^P^I)+1859775393:f<60?b+=(E&P|E&I|P&I)-1894007588:b+=(E^P^I)-899497514,d=I,I=P,P=E<<30|E>>>2,E=L,L=b}x[0]=x[0]+L|0,x[1]=x[1]+E|0,x[2]=x[2]+P|0,x[3]=x[3]+I|0,x[4]=x[4]+d|0},"_doProcessBlock"),_doFinalize:i(function(){var w=this._data,T=w.words,x=this._nDataBytes*8,L=w.sigBytes*8;return T[L>>>5]|=128<<24-L%32,T[(L+64>>>9<<4)+14]=Math.floor(x/4294967296),T[(L+64>>>9<<4)+15]=x,w.sigBytes=T.length*4,this._process(),this._hash},"_doFinalize"),clone:i(function(){var w=p.clone.call(this);return w._hash=this._hash.clone(),w},"clone")});e.SHA1=p._createHelper(v),e.HmacSHA1=p._createHmacHelper(v)})(),n.SHA1})});var ut={};Me(ut,{TrackKey:()=>z,name:()=>dt,reportTeaEvent:()=>G,version:()=>lt});var le=X(Q(),1),de=X(re(),1);function B(){return window.appId||null}i(B,"getAppId");function ie(){var o;let n="suda-csrf-token",e=document.cookie.split("; ");for(let u of e){let[p,m]=u.split("=");if(p===n)return decodeURIComponent(m)}return(o=window.csrfToken)!=null?o:null}i(ie,"getCsrfToken");function N(){let n=globalThis.CLIENT_BASE_PATH||"/";return/^\/app\/[^/]/.test(n)}i(N,"isNewPathEnabled");function $(){switch(globalThis.ENVIRONMENT){case"gray":return"PRE";case"online":return"ONLINE";default:return"BOE"}}i($,"getEnv");function oe(){return window.appEnv!=null?window.appEnv==="runtime":!0}i(oe,"isOnlineEnv");function W(){let n=navigator.userAgent,e=/(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i.test(n),o=/iPad|Tab|Tablet/i.test(n)&&navigator.maxTouchPoints>1;return e||o}i(W,"isMobile");async function ae(){var n,e,o;try{let u=B();if(!u)return!0;let p=N()?`/app/${u}/__runtime__/api/v1/studio/get_published`:`/spark/b/${u}/get_published`,g=await(await fetch(p,{headers:{"X-Suda-Csrf-Token":(n=ie())!=null?n:""}})).json();if(g.code===0||g.status_code==="0")return((o=(e=g.data)==null?void 0:e.app_info)==null?void 0:o.show_badge)!==!1}catch{}return!0}i(ae,"fetchShowBadge");async function se(){var u;let n=B();if(!n)return{code:1,msg:"appId is required",data:{}};let e=N()?`/app/${n}/__runtime__/api/v1/studio/lark/user_info`:`/spark/b/${n}/lark/user_info`;return await(await fetch(e,{headers:{"X-Suda-Csrf-Token":(u=ie())!=null?u:""}})).json()}i(se,"getLarkUserInfo");var z={VIEW:"aily_agent_artifact_page_view"},De="08a441",Re="42b91e";function ce(n){let e=String(n);return(0,de.default)(De+(0,le.default)(e+Re)).toString()}i(ce,"encryptTea");var V=!1;async function Fe(){var m,g,v,w;let{data:n}=await se(),{tenantID:e,userID:o}=n||{},u=o&&o!=="0"?ce(o):void 0,p=e&&e!=="0"?ce(e):void 0;(m=window.collectEvent)==null||m.call(window,"init",{app_id:788827,channel:"cn",disable_auto_pv:!1,enable_ab_test:!1,enable_debug:!1,enable_stay_duration:!0,reportTime:1e3}),(v=window.collectEvent)==null||v.call(window,"config",{user_unique_id:u,device_type:W()?"mobile":"pc",evtParams:{open_from:(g=new URLSearchParams(window.location.search).get("open-from"))!=null?g:void 0,env:$(),user_id:u,tenant_id:p}}),V=!0,(w=window.collectEvent)==null||w.call(window,"start")}i(Fe,"createTracker");async function G({trackKey:n,trackParams:e={}}){var o;try{V||(V=!0,await Fe()),(o=window.collectEvent)==null||o.call(window,n,e)}catch(u){console.error(u)}}i(G,"reportTeaEvent");function ue(){return G({trackKey:z.VIEW,trackParams:{artifact_uid:B(),agent_id:"agent_miaoda",url:window.location.href}})}i(ue,"reportPageView");function fe(){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 n="";for(let e=0;e<16;e++)n+=Math.floor(Math.random()*16).toString(16);return n}i(fe,"generateUUID");var pe="x_sdk_device_id";function Ne(){try{let n=localStorage.getItem(pe);return n||(n=fe(),localStorage.setItem(pe,n)),n}catch{return fe()}}i(Ne,"getDeviceId");function $e(){let n=typeof navigator!="undefined"?navigator.userAgent:"";return n&&(/Android/i.test(n)&&/Mobile/i.test(n)||/iPhone|iPod/i.test(n)||/BlackBerry|IEMobile|Opera Mini/i.test(n))?"mobile":"desktop"}i($e,"getDeviceType");var We="pageSessionID";function je(){try{return new URLSearchParams(window.location.search).get(We)||""}catch{return""}}i(je,"getPvId");function Ue(n={}){let e=n.pvId||je();return{app_id:window.appId||"",tenant_id:window.tenantId||"",user_id:window.userId||"",did:Ne(),module:"app_web",app_env:"runtime",source_type:"user",device_type:$e(),release_commit_id:window.__RELEASE_COMMIT_ID__||"",...e?{pv_id:e}:{}}}i(Ue,"getDefaultAttributes");function he(n){let e=Math.round(n);if(!Number.isFinite(e))throw new RangeError(`toNanoString: \u975E\u6CD5\u65F6\u95F4\u6233 ${n}`);return typeof BigInt!="function"?e===0?"0":`${e}000000`:String(BigInt(e)*BigInt(1e6))}i(he,"toNanoString");var Ve="1.0.2";function ze(n,e){let o=Ue(e),u=he(Date.now());return{metricsData:{resource:{attributes:{sdk_version:Ve,sdk_lang:"javascript",sdk_type:"client-frontend"}},metrics:[{name:"apaas_internal_metrics_pv_uv",description:"Count of page views",unit:"",scopeName:"apaas_internal_metrics_pv_uv",sum:{aggregationTemporality:1,isMonotonic:!0,dataPoints:n.map(p=>({attributes:{...o,url:p.url,path:p.path,referrer:p.referrer},startTimeUnixNano:he(p.timestampMs),timeUnixNano:u,asDouble:1}))}}]}}}i(ze,"buildPayload");function Ge(n,e,o={},u){if(e.length===0)return;let p;try{p=JSON.stringify(ze(e,u))}catch{return}try{fetch(n,{method:"POST",headers:{"Content-Type":"application/json","X-Suda-Csrf-Token":window.csrfToken||"",...o},body:p,keepalive:!0}).catch(()=>{})}catch{}}i(Ge,"sendPvData");var K="__APAAS_PV_TRACKER_STARTED__";function Ke(){try{let n=window;return n[K]?!1:(n[K]=!0,!0)}catch{return!0}}i(Ke,"claimPvReporting");function me(){try{window[K]=!1}catch{}}i(me,"releasePvReporting");var O,Ze=(O=class{constructor(){this.started=!1,this.disposers=[],this.holdsPvReporting=!1,this.buffer=[]}static get instance(){return this._instance||(this._instance=new O),this._instance}start(e){var o;if(!this.started&&Ke()){this.holdsPvReporting=!0,this.config=e,this.started=!0;try{this.listenRouteChanges(),this.registerLifecycleListeners();let u=(o=e.flushIntervalMs)!=null?o:1e4;this.flushTimer=setInterval(()=>this.flush(),u)}catch(u){throw this.started=!1,this.flushTimer&&(clearInterval(this.flushTimer),this.flushTimer=void 0),this.holdsPvReporting=!1,me(),u}}}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,me())}pageKey(){let{origin:e,pathname:o,search:u}=window.location;return`${e}${o}${u}`}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=i(()=>this.recordPv(),"onPopState");window.addEventListener("popstate",e),this.disposers.push(()=>window.removeEventListener("popstate",e)),this.patchHistory("pushState"),this.patchHistory("replaceState")}patchHistory(e){let o=history[e],u=i(()=>this.recordPv(),"recordPv");history[e]=function(...p){let m=o.apply(this,p);return u(),m},this.disposers.push(()=>{history[e]=o})}registerLifecycleListeners(){let e=i(()=>{document.visibilityState==="hidden"&&this.flush()},"onVisibilityChange");document.addEventListener("visibilitychange",e),this.disposers.push(()=>document.removeEventListener("visibilitychange",e));let o=i(()=>this.flush(),"onPageHide");window.addEventListener("pagehide",o),this.disposers.push(()=>window.removeEventListener("pagehide",o))}},i(O,"_PvTracker"),O),ge=Ze.instance;function ve(){var o;let n=(o=B())!=null?o:"",e=N()?`/app/${n}/__runtime__/api/v1/observability/metrics/collect`:`/spark/app/${n}/runtime/api/v1/observability/metrics/collect`;ge.start({collectorUrl:e})}i(ve,"initPvTracking");var ye="https://lf3-static.bytednsdoc.com/obj/eden-cn/LMfspH/ljhwZthlaukjlkulzlp",Je=`${ye}/miaoda-ui/doubao.svg`,qe=`${ye}/logo/miaodalogo.svg`,we='<svg viewBox="0 0 10 10" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M8.08312 8.08298C8.2384 7.92769 8.23953 7.67705 8.08424 7.52176L5.3625 4.80002L8.08422 2.07829C8.23951 1.92301 8.23839 1.67236 8.0831 1.51708C7.92781 1.36179 7.67717 1.36066 7.52188 1.51595C7.36659 1.67124 4.80016 4.23767 4.80016 4.23767L2.07841 1.51593C1.92313 1.36064 1.67248 1.36177 1.5172 1.51705C1.36191 1.67234 1.36078 1.92298 1.51607 2.07827L4.23782 4.80002L1.51605 7.52178C1.36076 7.67707 1.36189 7.92771 1.51718 8.083C1.67246 8.23829 1.92311 8.23941 2.07839 8.08412L4.80016 5.36236L7.5219 8.0841C7.67719 8.23939 7.92783 8.23826 8.08312 8.08298Z" fill="currentColor"/></svg>',Xe='<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M12.6667 2H3.33333V14H6.66667V15.3334H3.33333C2.59695 15.3334 2 14.7364 2 14V2C2 1.26364 2.59695 0.666687 3.33333 0.666687H12.6667C13.403 0.666687 14 1.26364 14 2V7.33335H12.6667V2Z" fill="currentColor"/><path d="M5.33333 4.66669C4.96514 4.66669 4.66667 4.96516 4.66667 5.33335C4.66667 5.70154 4.96514 6 5.33333 6H10.6667C11.0349 6 11.3333 5.70154 11.3333 5.33335C11.3333 4.96516 11.0349 4.66669 10.6667 4.66669H5.33333Z" fill="currentColor"/><path d="M4.66667 8.33335C4.66667 7.96516 4.96514 7.66669 5.33333 7.66669H8C8.36819 7.66669 8.66667 7.96516 8.66667 8.33335C8.66667 8.70154 8.36819 9 8 9H5.33333C4.96514 9 4.66667 8.70154 4.66667 8.33335Z" fill="currentColor"/><path d="M13.5523 8.70017C13.9428 8.30964 14.576 8.30964 14.9665 8.70017C15.357 9.09069 15.357 9.72386 14.9665 10.1144L14.2594 10.8215L12.8452 9.40728L13.5523 8.70017Z" fill="currentColor"/><path d="M12.1381 10.1144L13.5523 11.5286L10.2309 14.85C10.0916 14.9892 9.91229 15.0815 9.71798 15.1138L8.45737 15.3234C8.42136 15.3294 8.38467 15.3177 8.35885 15.2918C8.33271 15.2657 8.32099 15.2284 8.32749 15.192L8.55128 13.9374C8.58465 13.7502 8.6746 13.5779 8.80901 13.4435L12.1381 10.1144Z" fill="currentColor"/></svg>',Ye='<svg width="16" height="16" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M11.9922 1.99221C12.5445 1.98895 12.9958 2.43407 12.999 2.98634L13.0762 16.1943L14.6387 14.6328L17.8926 11.3789C18.2831 10.9884 18.9171 10.9885 19.3076 11.3789C19.6977 11.7695 19.6979 12.4026 19.3076 12.793L16.0527 16.0479L12.7979 19.3018C12.7111 19.3884 12.6098 19.4566 12.5 19.5059H20.375C20.9271 19.5059 21.3748 19.9538 21.375 20.5059C21.375 21.0581 20.9273 21.5059 20.375 21.5059H3.625C3.07272 21.5059 2.625 21.0581 2.625 20.5059C2.62523 19.9538 3.07286 19.5059 3.625 19.5059H11.6816C11.572 19.4566 11.4704 19.3884 11.3838 19.3018L4.87402 12.793C4.48372 12.4026 4.4839 11.7694 4.87402 11.3789C5.26452 10.9884 5.89756 10.9885 6.28809 11.3789L11.0762 16.166L10.999 2.99806C10.9958 2.44603 11.4402 1.99582 11.9922 1.99221Z" fill="currentColor"/></svg>',Qe='<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M2.0754 7.57153C2.23188 9.44922 3.49231 11.053 5.27982 11.6488C5.31351 11.6601 5.33994 11.6865 5.35117 11.7202L5.72076 12.8289C5.88752 13.3292 6.3557 13.6667 6.88304 13.6667H9.11696C9.6443 13.6667 10.1125 13.3292 10.2792 12.8289L10.6488 11.7202C10.6601 11.6865 10.6865 11.6601 10.7202 11.6488C12.5077 11.053 13.7681 9.44922 13.9246 7.57153L14 6.66667C14 3.35296 11.3137 0.666668 8 0.666668C4.68629 0.666668 2 3.35296 2 6.66667L2.0754 7.57153ZM9.38392 11.2985L9.03899 12.3333H6.96101L6.61608 11.2985C6.47214 10.8667 6.13328 10.5279 5.70146 10.3839C4.41995 9.95675 3.51631 8.80696 3.40413 7.4608L3.33362 6.61462C3.36152 4.06127 5.44004 2 8 2C10.56 2 12.6385 4.06127 12.6664 6.61462L12.5959 7.4608C12.4837 8.80696 11.5801 9.95675 10.2985 10.3839C9.86672 10.5279 9.52786 10.8667 9.38392 11.2985Z" fill="currentColor"/><path d="M6.66667 14.3333C6.29848 14.3333 6 14.6318 6 15C6 15.3682 6.29848 15.6667 6.66667 15.6667H9.33333C9.70152 15.6667 10 15.3682 10 15C10 14.6318 9.70152 14.3333 9.33333 14.3333H6.66667Z" fill="currentColor"/><path d="M8.00864 4.13208L5.44578 6.94049C5.20258 7.18228 5.37835 7.56531 5.74361 7.58951L7.2181 7.6872L7.21814 9.60852C7.21814 9.96788 7.72139 10.1366 7.99168 9.86792C8.26197 9.59921 10.5545 7.05951 10.5545 7.05951C10.7977 6.81772 10.622 6.43469 10.2567 6.41049L8.78222 6.3128L8.78219 4.39148C8.78218 4.03212 8.27893 3.86336 8.00864 4.13208Z" fill="currentColor"/></svg>',_e=!0,et="0px 8px 32px rgba(0,0,0,0.08), 0px 4px 16px rgba(0,0,0,0.04), 0px 2px 4px rgba(0,0,0,0.02)",tt="0px 4px 16px rgba(0,0,0,0.03), 0px 4px 10px rgba(0,0,0,0.03), 0px 2px 4px rgba(0,0,0,0.02)",J="'PingFang SC', -apple-system, BlinkMacSystemFont, sans-serif",j={doubao:{brandText:"\u8C46\u5305\u5DE5\u4F5C\u751F\u6210",logoSrc:Je,downloadUrl:"https://ugapk.com/FCtLH"},miaoda:{brandText:"\u5999\u642D\u751F\u6210",logoSrc:qe,landingUrl:"https://miaoda.feishu.cn/landing"}},nt={BOE:"tns.feishu-boe.cn",PRE:"tns.feishu-pre.cn",ONLINE:"tns.feishu.cn"};function Ce(){var o;let n=JSON.stringify({scene:"miaoda_app_report",entity_id:(o=B())!=null?o:"",entity_type:"miaoda_app",extra:""}),e=`https://${nt[$()]}/cust/lark_report/?type=common¶ms=${encodeURIComponent(n)}&lang=zh-CN`;window.open(e,"_blank","noopener,noreferrer")}i(Ce,"openReport");var rt={feedback:Xe,close:we,download:Ye,efficiency:Qe};function xe(n){let e=document.createElement("span");Object.assign(e.style,{display:"inline-flex",width:`${n}px`,height:`${n}px`,flexShrink:"0"}),e.innerHTML=we;let o=e.firstElementChild;return o&&(o.setAttribute("width",String(n)),o.setAttribute("height",String(n)),o.style.display="block"),e}i(xe,"makeCloseIcon");function it(n,e=16){if(n==="close")return xe(e);let o=document.createElement("span");Object.assign(o.style,{display:"inline-flex",width:`${e}px`,height:`${e}px`,flexShrink:"0"}),o.innerHTML=rt[n];let u=o.firstElementChild;return u&&(u.style.display="block"),o}i(it,"makeIcon");function ot(n,e){let o=document.createElement("img");return o.src=n,o.width=e,o.height=e,o.alt="",Object.assign(o.style,{width:`${e}px`,height:`${e}px`,maxWidth:"none",maxHeight:"none",borderRadius:"100px",flexShrink:"0",display:"block"}),o}i(ot,"makeLogo");function ke(n,e,o){let u=e==="desktop",p=j[n],m=document.createElement("div");Object.assign(m.style,{boxSizing:"border-box",display:"inline-flex",alignItems:"center",gap:"4px",padding:u?"6px 12px 6px 8px":"5px 12px 5px 8px",background:"#363636",border:"0.5px solid rgba(255,255,255,0.1)",borderRadius:"100px",boxShadow:et,cursor:"pointer"});let g=ot(p.logoSrc,16),v=document.createElement("span");if(v.textContent=p.brandText,Object.assign(v.style,{fontFamily:J,fontSize:u?"12px":"14px",lineHeight:u?"18px":"22px",color:"rgba(255,255,255,0.85)",whiteSpace:"nowrap"}),m.append(g,v),u&&o){let w=document.createElement("span");w.setAttribute("role","button"),w.setAttribute("aria-label","\u5173\u95ED"),w.setAttribute("data-watermark-close",""),Object.assign(w.style,{display:"none",alignItems:"center",cursor:"pointer",flexShrink:"0",color:"rgba(255,255,255,0.5)"}),w.appendChild(xe(10)),w.addEventListener("click",T=>{T.stopPropagation(),o()}),m.appendChild(w)}return m}i(ke,"buildPill");function M(n){let e=document.createElement("div");e.setAttribute("role","menuitem"),e.setAttribute("data-label",n.label),Object.assign(e.style,{boxSizing:"border-box",display:"flex",alignItems:"center",gap:"8px",minHeight:"38px",padding:"4px 10px",borderRadius:"6px",cursor:"pointer",color:"#000000"});let o=document.createElement("span");Object.assign(o.style,{display:"inline-flex",width:"16px",height:"16px",flexShrink:"0",color:"#000000"}),o.appendChild(it(n.icon));let u=document.createElement("span");return u.textContent=n.label,Object.assign(u.style,{fontFamily:J,fontSize:`${n.fontSize}px`,lineHeight:`${n.fontSize+8}px`,color:"#000000",whiteSpace:"nowrap"}),e.append(o,u),e.addEventListener("mouseenter",()=>{e.style.background="rgba(0,0,0,0.04)"}),e.addEventListener("mouseleave",()=>{e.style.background="transparent"}),e.addEventListener("click",n.onClick),e}i(M,"buildMenuRow");function at(){let n=document.createElement("div");return Object.assign(n.style,{height:"1px",background:"rgba(0,0,0,0.08)",margin:"0 10px"}),n}i(at,"buildDivider");function Se(n){var o;let e=document.createElement("div");if(Object.assign(e.style,{boxSizing:"border-box",display:"flex",flexDirection:"column",minWidth:`${n.minWidth}px`,background:"#ffffff",border:"0.5px solid rgba(0,0,0,0.1)",borderRadius:"10px",boxShadow:tt,overflow:"hidden",outline:"none"}),n.items.length){let u=document.createElement("div");Object.assign(u.style,{boxSizing:"border-box",padding:"4px",display:"flex",flexDirection:"column",gap:`${(o=n.itemGap)!=null?o:0}px`}),n.items.forEach(p=>u.appendChild(p)),e.appendChild(u)}if(n.extraItems&&n.extraItems.length){e.appendChild(at());let u=document.createElement("div");Object.assign(u.style,{boxSizing:"border-box",padding:"4px"}),n.extraItems.forEach(p=>u.appendChild(p)),e.appendChild(u)}return e}i(Se,"buildMenuCard");function Ee(n,e=!1){let o=document.createElement("div");o.setAttribute("data-custom-element",`${n}-watermark${e?"-mobile":""}`);let u=o.attachShadow({mode:"open"}),p=document.createElement("style");p.textContent=`
|
|
2
|
+
:host {
|
|
3
|
+
all: initial !important;
|
|
4
|
+
display: block !important;
|
|
5
|
+
position: fixed !important;
|
|
6
|
+
right: 12px !important;
|
|
7
|
+
bottom: 12px !important;
|
|
8
|
+
z-index: 9999 !important;
|
|
9
|
+
direction: ltr !important;
|
|
10
|
+
unicode-bidi: isolate !important;
|
|
11
|
+
}
|
|
12
|
+
:host::before, :host::after { content: none !important; }
|
|
13
|
+
.watermark-root {
|
|
14
|
+
all: initial;
|
|
15
|
+
direction: ltr;
|
|
16
|
+
unicode-bidi: isolate;
|
|
17
|
+
font-family: ${J};
|
|
18
|
+
display: flex;
|
|
19
|
+
flex-direction: column;
|
|
20
|
+
align-items: flex-end;
|
|
21
|
+
gap: 8px;
|
|
22
|
+
}
|
|
23
|
+
`;let m=document.createElement("div");return m.className="watermark-root",u.append(p,m),{host:o,container:m}}i(Ee,"createWatermarkRoot");function st(n){let{host:e,container:o}=Ee(n),u=[];n==="doubao"?u.push(M({icon:"download",label:"\u4E0B\u8F7D\u8C46\u5305\u5DE5\u4F5C",fontSize:14,onClick:i(()=>window.open(j.doubao.downloadUrl,"_blank","noopener,noreferrer"),"onClick")})):u.push(M({icon:"efficiency",label:"\u4E86\u89E3\u5999\u642D",fontSize:14,onClick:i(()=>window.open(j.miaoda.landingUrl,"_blank","noopener,noreferrer"),"onClick")})),_e&&u.push(M({icon:"feedback",label:"\u6295\u8BC9\u4E0E\u4E3E\u62A5",fontSize:14,onClick:Ce}));let p=Se({items:u,minWidth:160,itemGap:8});p.style.display="none";let m=ke(n,"desktop",()=>e.remove()),g=m.querySelector("[data-watermark-close]");o.append(p,m);let v=null;return o.addEventListener("mouseenter",()=>{v&&clearTimeout(v),p.style.display="flex",g&&(g.style.display="inline-flex")}),o.addEventListener("mouseleave",()=>{v=setTimeout(()=>{p.style.display="none",g&&(g.style.display="none")},100)}),e}i(st,"buildDesktopWatermark");function ct(n){let{host:e,container:o}=Ee(n,!0);o.style.cursor="pointer";let u=[];n==="miaoda"&&u.push(M({icon:"efficiency",label:"\u4E86\u89E3\u5999\u642D",fontSize:16,onClick:i(()=>window.open(j.miaoda.landingUrl,"_blank","noopener,noreferrer"),"onClick")})),_e&&u.push(M({icon:"feedback",label:"\u6295\u8BC9\u4E0E\u4E3E\u62A5",fontSize:16,onClick:Ce}));let p=[M({icon:"close",label:"\u4E0D\u518D\u5C55\u793A",fontSize:16,onClick:i(w=>{w.stopPropagation(),document.removeEventListener("click",v),e.remove()},"onClick")})],m=Se({items:u,extraItems:p,minWidth:160});m.style.display="none";let g=ke(n,"mobile");o.append(m,g),o.addEventListener("click",w=>{w.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(ct,"buildMobileWatermark");var be=!1,Z=!1;async function Le(n){if(be||Z||typeof document=="undefined")return;if(document.readyState==="loading"){document.addEventListener("DOMContentLoaded",()=>Le(n),{once:!0});return}Z=!0;let e=await ae();if(be=!0,Z=!1,!e)return;let o=W()?ct(n):st(n);document.body.appendChild(o)}i(Le,"mountWatermark");function Ie(){return Le("miaoda")}i(Ie,"mountMiaodaWatermark");var lt="0.0.14-alpha.20260918065040",dt="@lark-apaas/miaoda-coding-sdk";oe()&&(ue(),ve());Ie();return He(ut);})();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lark-apaas/miaoda-coding-sdk",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.14-alpha.20260918065040",
|
|
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",
|