1import{_ as La}from"./index-bf4c1f57.js";import{v as Fa,y as za,z as f,A as X,B as Da,a4 as Va,F as y,G as b,N as p,O as z,H as c,I as u,Q as he,L as Y,K as _,M as Ne,J as ut,P as ge,V as ve,R as Ua,cA as ja,W as E,C as w,Y as P}from"./head-ed4e7f32.js";import{m as Ga,n as Ba,g as Ja,o as $a}from"./llm-5e5fcb05.js";import{d as Ka,f as _e,L as dt,e as Ya,g as Wa,a as Ha,h as qa}from"./llmBizType-6e24b77b.js";import{_ as le}from"./Input.vue_vue_type_script_setup_true_lang-35193508.js";import{_ as Xa}from"./Textarea.vue_vue_type_script_setup_true_lang-4cc3b591.js";import{U as Me}from"./UiSelect-3aa8c56e.js";import Za from"./DocumentSelectModal-605e8186.js";import Qa from"./PromptContextConfigEditor-3efad5fb.js";import{_ as en}from"./PromptTemplateOptimizeModal.vue_vue_type_script_setup_true_lang-b395ffc5.js";import{P as tn,s as mt,i as pt}from"./promptTemplateTaxonomy-77b3808f.js";import an from"./AiAvatarPickerModal-6f4087a0.js";import{u as nn}from"./avatarStore-151882b9.js";import{S as sn}from"./sparkles-3ceaec48.js";import{S as ft}from"./search-5eabff58.js";import{X as ht}from"./x-bfce1282.js";import{F as Z}from"./file-text-5a7e230d.js";import{U as on}from"./upload-a0936a89.js";import{c as Ee}from"./createLucideIcon-1b00ea2d.js";import{C as rn}from"./circle-alert-8f01d4a6.js";import{F as gt}from"./file-ee9910fd.js";import{F as ln}from"./index-05b7c264.js";import{M as cn}from"./index-5b23bafe.js";import{F as Le,a as D}from"./FileIcon.vue_vue_type_script_setup_true_lang-77f38cb0.js";import{F as Fe}from"./file-headphone-9a836d8a.js";import{F as ze}from"./file-play-966fa5af.js";import{_ as un}from"./FormItem-a4d6142c.js";import{_ as dn}from"./index-94da77ce.js";import{_ as mn}from"./_plugin-vue_export-helper-c27b6911.js";/** 2 * @license lucide-vue-next v0.562.0 - ISC 3 * 4 * This source code is licensed under the ISC license. 5 * See the LICENSE file in the root directory of this source tree. 6 */const pn=Ee("code",[["path",{d:"m16 18 6-6-6-6",key:"eg8j8"}],["path",{d:"m8 6-6 6 6 6",key:"ppft3o"}]]);/** 7 * @license lucide-vue-next v0.562.0 - ISC 8 * 9 * This source code is licensed under the ISC license. 10 * See the LICENSE file in the root directory of this source tree. 11 */const ie=Ee("file-archive",[["path",{d:"M13.659 22H18a2 2 0 0 0 2-2V8a2.4 2.4 0 0 0-.706-1.706l-3.588-3.588A2.4 2.4 0 0 0 14 2H6a2 2 0 0 0-2 2v11.5",key:"4pqfef"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M8 12v-1",key:"1ej8lb"}],["path",{d:"M8 18v-2",key:"qcmpov"}],["path",{d:"M8 7V6",key:"1nbb54"}],["circle",{cx:"8",cy:"20",r:"2",key:"ckkr5m"}]]);/** 12 * @license lucide-vue-next v0.562.0 - ISC 13 * 14 * This source code is licensed under the ISC license. 15 * See the LICENSE file in the root directory of this source tree. 16 */const vt=Ee("file-chart-pie",[["path",{d:"M15.941 22H18a2 2 0 0 0 2-2V8a2.4 2.4 0 0 0-.706-1.704l-3.588-3.588A2.4 2.4 0 0 0 14 2H6a2 2 0 0 0-2 2v3.512",key:"13hoie"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M4.017 11.512a6 6 0 1 0 8.466 8.475",key:"s6vs5t"}],["path",{d:"M9 16a1 1 0 0 1-1-1v-4c0-.552.45-1.008.995-.917a6 6 0 0 1 4.922 4.922c.091.544-.365.995-.917.995z",key:"1dl6s6"}]]);/** 17 * @license lucide-vue-next v0.562.0 - ISC 18 * 19 * This source code is licensed under the ISC license. 20 * See the LICENSE file in the root directory of this source tree. 21 */const Q=Ee("file-image",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["circle",{cx:"10",cy:"12",r:"2",key:"737tya"}],["path",{d:"m20 17-1.296-1.296a2.41 2.41 0 0 0-3.408 0L9 22",key:"wt3hpn"}]]);function fn(h){return JSON.parse(JSON.stringify(h))}function hn(h,T,v){const l=Ka(h);if(!l||Object.keys(l).length===0)return{};const k=fn(l);return gn(h,k,T,v),k}function gn(h,T,v,l){const k=`dashboard.llmResponseJsonSchema.${h}`,A=(x,g)=>{if(x==null)return;if(Array.isArray(x)){x.forEach((R,C)=>A(R,[...g,String(C)]));return}if(typeof x!="object")return;const S=x;for(const[R,C]of Object.entries(S))if(R==="description"&&typeof C=="string"){const N=`${k}.${[...g,"description"].join(".")}`;l(N)&&(S[R]=v(N))}else A(C,[...g,R])};A(T,[])}const vn={ç³»ç»é»è®¤:[{name:"è¾å ¥JSON",key:"inputJson"},{name:"å¼ä¸ç¶ææä¸¾",key:"openingStatusEnum"},{name:"æ§ç §ç¶ææä¸¾",key:"licenseStatusEnum"},{name:"æ¶é´å¨ææä¸¾",key:"periodTypeEnum"},{name:"æ¶é´ç²åº¦æä¸¾",key:"granularityEnum"},{name:"æææä¸¾",key:"weekdayEnum"},{name:"åç±»æä¸¾",key:"categoryEnum"},{name:"æ§½ä½ç»æé ç½®",key:"slotResultConfig"},{name:"è·¯ç±å¨ä½å表",key:"actions"},{name:"ç¥è¯åºåéå表",key:"kbList"},{name:"弿¾å·¥åå表",key:"openSupportTickets"},{name:"ææ°æ¶æ¯å表",key:"msgList"},{name:"å ¨é¨åå¹å 容",key:"srtContent"},{name:"æçº²è¯",key:"outlineKeywords"},{name:"éç¹è¯",key:"keyPointsKeywords"},{name:"ç´ æ",key:"materialDesc"},{name:"åºæ¿è§é¢",key:"baseMaterialDesc"},{name:"å¾ æ¹åææ¡",key:"originalText"},{name:"è¿10æ¡ææ¡",key:"recentCopyList"},{name:"åèå¾ç´ ææè¿°",key:"referenceImageDescriptions"},{name:"æ¯è¡å广忮µæ°",key:"partCount"},{name:"æååå广大忰",key:"maxPartLength"},{name:"æ¯è¡å广æ¬",key:"text"},{name:"AIå·²çæææ¡",key:"generatedText"},{name:"åºæ¿ç´ æå©ä½ææ¡",key:"remainingGeneratedText"},{name:"åºæ¿ç´ æå©ä½ææ¡ï¼ç²¾æï¼",key:"sceneMaterialRemainingText"},{name:"ç´ ææ ç¾åº",key:"assetTagLibrary"},{name:"æå¥ææ ç¾ç»æ",key:"segmentTaggingJson"},{name:"åå¥åéç´ æå表",key:"segmentCandidatesJson"},{name:"å°é¢æ é¢",key:"coverTitle"},{name:"æ é¢",key:"title"},{name:"å¾çæåï¼ç¬¬1å¼ ï¼",key:"imageText1"},{name:"客æ·ç»å",key:"customerProfile"},{name:"æè¿è天ä¸ä¸æ",key:"historyMsgList"},{name:"ç³»ç»åç»å¨ä½ä»»å¡",key:"followUpTasks"},{name:"å¯å³æ¶è§¦åçç¥å表",key:"availableImmediateStrategies"},{name:"å½åæ´»å¨è·è¿ä»»å¡",key:"activeFollowUpTasks"},{name:"æ¶é´å¨ææä¸¾å表",key:"periodTypeEnums"},{name:"æ¶é´ç²åº¦æä¸¾å表",key:"granularityEnums"},{name:"æææä¸¾å表",key:"weekdayEnums"},{name:"ä»·æ ¼ä¸ä¸æ",key:"pricingContext"},{name:"é®é¢åç±»å表",key:"categoryList"}
21,{name:"é®é¢å
容",key:"issueContent"},{name:"åéè·è¿æ¨¡æ¿",key:"candidateTemplates"},{name:"åå§æ¨¡æ¿ææ¡",key:"templateContent"},{name:"触åç±»åç¼ç ",key:"triggerTypeCode"},{name:"触åç±»åID",key:"triggerTypeId"},{name:"ä»»å¡ç±»å",key:"taskType"},{name:"å½ä¸æ¨¡æ¿ID",key:"followupTemplateId"}],ç鿡件:[{name:"ç´ æåç§°å
³é®è¯",key:"nameKeyword"},{name:"æç´¢å
³é®è¯",key:"searchKeywords"},{name:"ç´ æåç±»",key:"materialCategory"},{name:"ææ¡£åç±»",key:"documentCategory"},{name:"æ ç¾å",key:"tagDomain"},{name:"æ ç¾åç±»",key:"tagCategory"},{name:"æ ç¾",key:"tag"},{name:"æç¤ºè¯å ä½ç¬¦",key:"promptPlaceholder"}]},De=(h,T)=>h.startsWith("zh")?T.zh:T.en,_n={materialDesc:{section:{zh:"ææ¡ä¸ç´ æ",en:"Copywriting and assets"},description:{zh:"æå
¥å½åå½ä¸çè¾
å©ç´ æè¯´æï¼éå让模ååèç´ æå
容ãéå¤´ä¿¡æ¯æç»é¢æ°è´¨ç»§ç»çæææ¡ã",en:"Injects the matched asset descriptions so the model can continue from actual visual references."},example:{zh:"示ä¾å¼ï¼å欧客å
è¿æ¯ï¼æ¨è´¨å°æ¿ï¼æå
ï¼èªç¶éå
ï¼äººç©ä»å·¦åå³èµ°å
¥ç»é¢ã",en:"Example value: Wide Nordic living room shot, wood floor, warm light, natural daylight, person entering from left to right."},keywords:["ç´ æ","é头","ç»é¢","asset","visual"]},baseMaterialDesc:{section:{zh:"ææ¡ä¸ç´ æ",en:"Copywriting and assets"},description:{zh:"æå
¥åºæ¿ç´ æçæè¿°ä¿¡æ¯ï¼é常ç¨äºè®©æ¨¡åå´ç»åºæ¿é头å»è¡¥å
æ é¢ãå£æææ¹åææ¡ã",en:"Injects the base material description, useful when the prompt should follow the base footage."},example:{zh:"示ä¾å¼ï¼ç«å±å®¶å±
åºæ¿è§é¢ï¼é头平移å±ç¤ºå®¢å
æ¶çº³æï¼æ¶é¿ 8 ç§ã",en:"Example value: Vertical home-living base video, panning across a storage cabinet, 8 seconds."}},originalText:{section:{zh:"ææ¡ä¸ç´ æ",en:"Copywriting and assets"},description:{zh:"æå
¥å¾
æ¹åæå¾
ä¼åçåå§ææ¡ï¼éåæ¹åã缩åã飿 ¼è°æ´çåºæ¯ã",en:"Injects the original copy to rewrite, shorten, or restyle."},example:{zh:"示ä¾å¼ï¼è¿æ¬¾æ¶çº³æçç太è½è£
äºï¼å°æ·åä¹è½è½»æ¾è
¾åºç©ºé´ã",en:"Example value: This storage cabinet holds far more than you expect and frees up space even in small rooms."}},generatedText:{section:{zh:"ææ¡ä¸ç´ æ",en:"Copywriting and assets"},description:{zh:"æå
¥ç³»ç»å䏿¥å·²ç»çæçææ¡ç»æï¼éå串èå¤é¶æ®µæµç¨ç»§ç»æ¶¦è²æç»æåè¾åºã",en:"Injects the copy already generated in an earlier step so the next step can refine or restructure it."},example:{zh:"示ä¾å¼ï¼åæ¨è²æ¶çº³æï¼è®©å®¢å
仿乱忴æ´ï¼é¢å¼åæ¶çº³å䏿¬¡å°ä½ã",en:"Example value: A natural wood storage cabinet that turns a cluttered living room into a tidy one with both style and capacity."}},remainingGeneratedText:{section:{zh:"ææ¡ä¸ç´ æ",en:"Copywriting and assets"},description:{zh:"æå
¥å°æªè¢«åºæ¿é头æ¶èæçå©ä½ææ¡ï¼éåç»§ç»è¡¥å
¨èæ¬æåäºæ¬¡åé
ã",en:"Injects the remaining generated copy that has not yet been allocated to base footage."},example:{zh:"示ä¾å¼ï¼è¿æ³å¼ºè°é鳿»è½¨ãåç±»æ¶çº³å䏿å¤ç¨çåç¹ã",en:"Example value: Still needs to emphasize silent rails, categorized storage, and multi-purpose usage."}},sceneMaterialRemainingText:{section:{zh:"ææ¡ä¸ç´ æ",en:"Copywriting and assets"},description:{zh:"æå
¥ç²¾ææ¨¡å¼ä¸åé¤å·²å½ä¸ææ¡åçå©ä½åºæ¿ææ¡ï¼éåç»§ç»ååç»ç²æã",en:"Injects the remaining base-material copy after precise-mode matched sentences are removed."},example:{zh:"示ä¾å¼ï¼è¿éè¦è¡¥ä¸æ´»å¨ä¸å¿é
ç½®åç»å°¾å·å¬é¨åã",en:"Example value: Still needs the activity-center setup and the closing call-to-action."}},title:{section:{zh:"æ é¢ä¸å°é¢",en:"Titles and covers"},description:{zh:"æå
¥å½åä»»å¡çæ é¢å
容ï¼éåæ é¢æ©åãæ é¢æ ¡å¯¹åç»æåè¾åºã",en:"Injects the current title, useful for title refinement or structured output."},example:{zh:"示ä¾å¼ï¼å®¢å
æ¶çº³ç¿»åçå°æå·§",en:"Example value: Small tricks to double living-room storage"}},coverTitle:{section:{zh:"æ é¢ä¸å°é¢",en:"Titles and covers"},description:{zh:"æå
¥å°é¢æ é¢ï¼é常ç¨äºå°é¢ææ¡ä¼åæè®©æ£æä¸å°é¢ä¸»é¢ä¿æä¸è´ã",en:"Injects the cover title so the prompt c
21an align the body with the cover theme."},example:{zh:"示ä¾å¼ï¼3 æå好客å
æ¶çº³",en:"Example value: 3 ways to fix living-room storage"}},referenceImageDescriptions:{section:{zh:"å¾åçè§£",en:"Image understanding"},description:{zh:"æå
¥åèå¾ç»è¿è§è§æ¨¡åæååçæè¿°ç»æï¼éå徿æ¹åã飿 ¼è·éææç¤ºè¯å¢å¼ºã",en:"Injects descriptions extracted from reference images, useful for style-following or prompt enhancement."},example:{zh:"示ä¾å¼ï¼ç»é¢ä¸ºå¥¶æ²¹é£å§å®¤ï¼ä¸»è²åç±³ç½ï¼åºå¤´ææè²æ°å´ç¯ï¼æ´ä½æå温æã",en:"Example value: The image shows a cream-style bedroom with warm ambient lighting and a soft cozy palette."}},srtContent:{section:{zh:"åå¹å¤ç",en:"Subtitle processing"},description:{zh:"æå
¥å®æ´åå¹å
容ï¼éååå广 ¡å¯¹ãæªçãå奿æ ç¾æåã",en:"Injects the full subtitle text for proofreading, shortening, splitting, or tagging."},example:{zh:"示ä¾å¼ï¼å¤§å®¶å¥½ï¼ä»å¤©å¸¦ä½ 们ççè¿å¥å°æ·åæ¯æä¹ææ¶çº³å满çâ¦â¦",en:"Example value: Hi everyone, today we will walk through how this small apartment maximizes storage..."}},partCount:{section:{zh:"åå¹å¤ç",en:"Subtitle processing"},description:{zh:"æå
¥å½ååå¹éè¦ææå 段ç约æå¼ï¼å¸¸ç¨äºå广ªç䏿å¥ä»»å¡ã",en:"Injects how many parts the current subtitle line should be split into."},example:{zh:"示ä¾å¼ï¼2",en:"Example value: 2"}},maxPartLength:{section:{zh:"åå¹å¤ç",en:"Subtitle processing"},description:{zh:"æå
¥æååæ¯æ®µå
许çæå¤§åæ°ï¼ç¨äºæ§å¶åå¹é¿åº¦ã",en:"Injects the maximum length allowed for each subtitle segment."},example:{zh:"示ä¾å¼ï¼12",en:"Example value: 12"}},text:{section:{zh:"åå¹å¤ç",en:"Subtitle processing"},description:{zh:"æå
¥å½åå¤ççåè¡å广æ¬ï¼éåé奿¹åãçº éæå缩ã",en:"Injects the current subtitle line for per-line rewrite, correction, or compression."},example:{zh:"示ä¾å¼ï¼è¿ä¸ªæåæé¶ç¢æç©é½èèµ·æ¥äºã",en:"Example value: This cabinet hides away all the small clutter."}},segmentTaggingJson:{section:{zh:"ç´ æåæ",en:"Asset analysis"},description:{zh:"æå
¥æå¥åçæ ç¾ç»æï¼éåç»§ç»åç´ æè·¯ç±ãç´ ææéææ ¡éªã",en:"Injects tagging results for split sentences, useful for routing and selecting assets."},example:{zh:'示ä¾å¼ï¼[{"segment":"客å
æ´æ´æ´","tags":["æ¶çº³","客å
"]}]',en:'Example value: [{"segment":"Living room becomes tidier","tags":["storage","living room"]}]'}},segmentCandidatesJson:{section:{zh:"ç´ æåæ",en:"Asset analysis"},description:{zh:"æå
¥æ¯ä¸ªåå¥å¹é
å°çåéç´ æå表ï¼éåç»§ç»æåºãçéæè§£ééæ©åå ã",en:"Injects candidate assets per sentence segment for ranking, filtering, or rationale generation."},example:{zh:'示ä¾å¼ï¼[{"segment":"æ¶çº³æ´å¼º","candidates":[{"assetId":101,"score":0.92}]}]',en:'Example value: [{"segment":"stronger storage","candidates":[{"assetId":101,"score":0.92}]}]'}},assetTagLibrary:{section:{zh:"ç´ æåæ",en:"Asset analysis"},description:{zh:"æå
¥å½åå¯ç¨çç´ ææ ç¾åºï¼æ¹ä¾¿æ¨¡åæç
§æ ç¾ä½ç³»è¾åºç»æåç»æã",en:"Injects the available asset tag library so the model can respond against the known taxonomy."},example:{zh:"示ä¾å¼ï¼é£æ ¼ï¼ç°ä»£/奶油/忍ï¼ç©ºé´ï¼å®¢å
/å§å®¤ï¼åè½ï¼æ¶çº³/å±ç¤ºã",en:"Example value: Style: modern/cream/natural wood; Space: living room/bedroom; Function: storage/display."}},customerProfile:{section:{zh:"å®å对è¯",en:"Pre-sale dialogue"},description:{zh:"æå
¥å®¢æ·ç»åä¿¡æ¯ï¼éåçææ´è´´è¿å®¢æ·èæ¯çè·è¿è¯æ¯æçç¥ã",en:"Injects the customer profile so follow-up messages can match the customer context."},example:{zh:"示ä¾å¼ï¼æ°æ¿è£
ä¿®ç¨æ·ï¼é¢ç®ä¸é«ï¼å
³æ³¨ç¯ä¿åå¨ç©è½åï¼å³ç卿 2 å¨ã",en:"Example value: New-home renovation customer, mid-to-high budget, cares about eco-friendliness and storage, decision cycle two weeks."}}
21,historyMsgList:{section:{zh:"å®å对è¯",en:"Pre-sale dialogue"},description:{zh:"æå
¥æè¿è天记å½ï¼éååä¸ä¸æç»åãæå¾å¤æåè·è¿å»ºè®®ã",en:"Injects recent chat history for contextual follow-up, intent detection, or strategy advice."},example:{zh:"示ä¾å¼ï¼ç¨æ·ï¼ææ²¡æéåå°æ·åçï¼é¡¾é®ï¼æï¼è¿è¾¹å
çå æ¬¾å¸¦æ½å±çæ¹æ¡â¦â¦",en:"Example value: User: Do you have options for small apartments? Agent: Yes, here are several drawer-based layouts..."}},issueContent:{section:{zh:"å®å对è¯",en:"Pre-sale dialogue"},description:{zh:"æå
¥å½å客æ·é®é¢æ£æï¼éååé®é¢å½ç±»ãçå¤çææè·è¿æ¨¡æ¿å¹é
ã",en:"Injects the current customer issue content for classification or reply generation."},example:{zh:"示ä¾å¼ï¼ææ³ç¥éè¿æ¬¾æåè½ä¸è½å®å¶å°ºå¯¸ï¼å¤ä¹
è½å®è£
ï¼",en:"Example value: Can this cabinet be customized in size, and how long does installation take?"}},candidateTemplates:{section:{zh:"å®å对è¯",en:"Pre-sale dialogue"},description:{zh:"æå
¥åéè·è¿æ¨¡æ¿ï¼éå让模åä»å¤ä¸ªæ¨¡æ¿ä¸åéæ©æäºæ¬¡æ¹åã",en:"Injects candidate follow-up templates so the model can choose or adapt one."},example:{zh:"示ä¾å¼ï¼æ¨¡æ¿ Aï¼ä»·æ ¼å¨è¯¢ï¼æ¨¡æ¿ Bï¼é¢çº¦å°åºï¼æ¨¡æ¿ Cï¼å°ºå¯¸å®å¶ã",en:"Example value: Template A: pricing inquiry; Template B: store visit booking; Template C: size customization."}},pricingContext:{section:{zh:"å®å对è¯",en:"Pre-sale dialogue"},description:{zh:"æå
¥ä»·æ ¼ç¸å
³ä¸ä¸æï¼éååæ¥ä»·è¯´æãä»·æ ¼è§£éæä¼æ çç¥å»ºè®®ã",en:"Injects pricing context for quote explanations or discount strategy suggestions."},example:{zh:"示ä¾å¼ï¼å½åæ´»å¨æ»¡ 5000 å 500ï¼å®è£
è´¹å
å«å¨å¥é¤å
ã",en:"Example value: Current promotion offers 500 off orders above 5000, with installation included."}}
21,promptPlaceholder:{section:{zh:"è¿è¡æ¶çé",en:"Runtime filters"},description:{zh:"æå
¥å¶ä½é¡µå¡«åçæç¤ºè¯å ä½ç¬¦æ¡ä»¶ï¼éå让模ååèç¨æ·æå¨è¾å
¥çè¡¥å
ä¿¡æ¯ã",en:"Injects prompt-placeholder inputs collected at runtime so the model can use manual hints from the creator."},example:{zh:"示ä¾å¼ï¼éç¹çªåºâç¯ä¿æ¿æââéåå°æ·åââ忍é£âã",en:"Example value: Emphasize eco-friendly boards, small-space fit, and natural wood style."}}},yn=new Set(["inputJson","openingStatusEnum","licenseStatusEnum","periodTypeEnum","granularityEnum","weekdayEnum","categoryEnum","slotResultConfig","periodTypeEnums","granularityEnums","weekdayEnums","triggerTypeCode","triggerTypeId","taskType"]),Tn=new Set(["nameKeyword","searchKeywords","materialCategory","documentCategory","tagDomain","tagCategory","tag","promptPlaceholder"]),En=new Set(["actions","kbList","openSupportTickets","msgList","customerProfile","historyMsgList","followUpTasks","availableImmediateStrategies","activeFollowUpTasks","pricingContext","categoryList","issueContent","candidateTemplates","templateContent","followupTemplateId"]),In=/^imageText\d+$/i,bn=(h,T,v)=>In.test(h)?{section:{zh:"å¾åçè§£",en:"Image understanding"},description:{zh:"æå
¥å¯¹åºå¾çä¸çè¯å«æåï¼éå徿æ¹åãå°é¢ææ¡æ ¡å¯¹æä»å¾ç䏿½åå
³é®ä¿¡æ¯ã",en:"Injects OCR text from the corresponding image, useful for copy adaptation or key-info extraction."},example:{zh:"示ä¾å¼ï¼æ¶çº³ä¸å¤ï¼è¿ä¸æç´æ¥å¤åº 30% 空é´",en:"Example value: Not enough storage? This one trick adds 30% more space"}}:Tn.has(h)||T==="ç鿡件"?{section:{zh:"è¿è¡æ¶çé",en:"Runtime filters"},description:{zh:`å¼ç¨è¿è¡æ¶å¡«åçã${v}ãæ¡ä»¶ï¼é常ç¨äºçº¦æç´ ææææ¡£çå¹é
èå´ã`,en:`Uses the runtime value of "${v}" to constrain asset or document matching.`},example:{zh:"示ä¾å¼ï¼ç°ä»£ã忍é£ã客å
æ¶çº³",en:"Example value: modern, natural wood, living-room storage"}}:En.has(h)?{section:{zh:"å®å对è¯",en:"Pre-sale dialogue"},description:{zh:`æå
¥ä¸ã${v}ãç¸å
³çä¸å¡ä¸ä¸æï¼éåå®åé®çãè·è¿çç¥å模æ¿éæ©ã`,en:`Injects "${v}" business context for pre-sale replies, strategy, or template selection.`},example:{zh:"示ä¾å¼ï¼ææµç¨æ³¨å
¥çä¼è¯ä¸ä¸ææä¸å¡é
ç½®æ°æ®ã",en:"Example value: Conversation context or business configuration injected by the workflow."}}:yn.has(h)?{section:{zh:"ç³»ç»é
ç½®",en:"System configuration"},description:{zh:`æå
¥ç³»ç»ç»´æ¤çã${v}ãé
ç½®ææä¸¾å¼ï¼éåè¦æ±æ¨¡åææ¢å®èå´è¾åºã`,en:`Injects the system-managed "${v}" config or enum values so the model stays within allowed ranges.`},example:{zh:'示ä¾å¼ï¼["å¯ç¨","ç¦ç¨"] æ JSON é
置对象',en:'Example value: ["enabled", "disabled"] or a JSON config object'}}:T==="ç´ æ"?{section:{zh:"èªå®ä¹ç´ æå ä½ç¬¦",en:"Custom asset placeholders"},description:{zh:`æå
¥èªå®ä¹ç´ æå ä½ç¬¦ã${v}ã对åºçæ£ç´¢ç»æï¼éåæç¹å®ç´ æéåæ³¨å
¥æç¤ºè¯ã`,en:`Injects the matched result for custom asset placeholder "${v}".`},example:{zh:"示ä¾å¼ï¼ç¬¦åç鿡件çç´ æè¯´ææè¦ã",en:"Example value: A summary of matched asset descriptions."}}:T==="åç"?{section:{zh:"èªå®ä¹åçå ä½ç¬¦",en:"Custom slice placeholders"},description:{zh:`æå
¥èªå®ä¹åçå ä½ç¬¦ã${v}ã对åºçæ£ç´¢ç»æï¼éåæç¹å®åçéåæ³¨å
¥æç¤ºè¯ã`,en:`Injects the matched result for custom slice placeholder "${v}".`},example:{zh:"示ä¾å¼ï¼ç¬¦åç鿡件çåç说ææè¦ã",en:"Example value: A summary of matched slice descriptions."}}:T==="ææ¡£"?{section:{zh:"èªå®ä¹ææ¡£å ä½ç¬¦",en:"Custom document placeholders"},description:{zh:`æå
¥èªå®ä¹ææ¡£å ä½ç¬¦ã${v}ãå¹é
å°çææ¡£å
容ï¼éåæç¥è¯ææ¡£æ³¨å
¥æç¤ºè¯ã`,en:`Injects the matched result for custom document placeholder "${v}".`},example:{zh:"示ä¾å¼ï¼å½ä¸ææ¡£ä¸çæè¦æ®µè½æå
³é®è¯´æã",en:"Example value: Key excerpts or summary paragraphs from matched documents."}}:{section:{zh:"ç³»ç»ä¸ä¸æ",en:"System context"},description:{zh:`è¿è¡æ¶ä¼å°ã${v}ã对åºçæ°æ®æ¿æ¢å°è¿éï¼éå让模å使ç¨å½åæµç¨ä¸çä¸ä¸æä¿¡æ¯ã`,en:`At runtime, "${v}" data is injected here so the model can use the current workflow context.`},example:{zh:"示ä¾å¼ï¼ç±ç³»ç»æµç¨çæçä¸ä¸æææ¬æç»æåæ°æ®ã",en:"Example value: Context text or structured data generated by the workflow."}};function An(h){var N,O;const T=String(h.rawKey||"").trim(),v=h.category,l=h.label||T,k=_n[T]??bn(T,v,l),A=De(h.locale,k.section),x=((N=h.customDescription)==null?void 0:N.trim())||De(h.locale,k.description),g=De(h.locale,k.example),S=(O=h.sceneLabel)==null?void 0:O.trim(),R=h.locale.startsWith("zh")?S?`å¨å½åå
21ºæ¯ã${S}ãä¸ï¼æ§è¡æ¶ä¼å è§£æã${l}ã对åºçæ°æ®ï¼åæ¿æ¢å°è¿ä¸ªå ä½ç¬¦ä½ç½®ã`:`æ§è¡æ¶ä¼å è§£æã${l}ã对åºçæ°æ®ï¼åæ¿æ¢å°è¿ä¸ªå ä½ç¬¦ä½ç½®ã`:S?`In the current scene "${S}", the runtime resolves "${l}" first and then replaces this placeholder.`:`At runtime, "${l}" is resolved first and then replaces this placeholder.`,C=[T,l,A,x,g,...k.keywords||[]].join(" ").toLowerCase();return{section:A,description:x,example:g,sceneHint:R,searchText:C}}function Ve(h,T=!0){const v=(k,A=!1)=>{var C,N;let x="",g=!1,S=!1;const R=Array.from(k.childNodes).filter(O=>O.nodeType===1||O.nodeType===3);A&&((C=R[R.length-1])==null?void 0:C.tagName)==="BR"&&R.pop();for(const O of R){const $=O,o=(N=$.dataset)==null?void 0:N.placeholderKey,V=!o&&($.tagName==="DIV"||$.tagName==="P"),I=O.nodeType===3?O.textContent||"":o?`{{${o}}}`:$.tagName==="BR"?` 22`:v(O,V);!V&&!I||(S&&(g||V&&!x.endsWith(` 23`))&&(x+=` 24`),x+=I,S=!0,g=V)}return x},l=v(h);return T?l.replace(/\n+$/,""):l}const xn={class:"llm-prompt-template-form"},Sn={class:"grid grid-cols-1 md:grid-cols-3 gap-6"},Pn={key:0,class:"flex gap-2"},Rn={class:"mb-6 rounded-2xl border border-slate-100 bg-slate-50/60 px-4 py-4"},kn={class:"flex flex-col gap-3 md:flex-row md:items-center md:justify-between"},Cn={class:"min-w-0"},On={class:"text-sm font-semibold text-slate-900"},wn={class:"mt-1 text-xs leading-5 text-slate-500"},Nn={class:"mb-3 flex flex-wrap items-center justify-between gap-3 rounded-xl border border-slate-100 bg-slate-50/70 px-4 py-3"},Mn={class:"text-sm font-semibold text-slate-900"},Ln={class:"text-xs text-slate-500"},Fn={class:"rounded-xl border border-slate-100 bg-white overflow-hidden"},zn={class:"prompt-content-layout"},Dn={class:"prompt-editor-wrap flex-1 min-w-0 p-1"},Vn=["data-placeholder"],Un={class:"prompt-placeholder-panel"},jn={class:"border-b border-slate-100 px-3 py-3"},Gn={class:"flex items-center justify-between gap-2"},Bn={class:"text-sm font-semibold text-slate-900"},Jn={class:"rounded-full bg-slate-100 px-2 py-0.5 text-[11px] font-semibold text-slate-500"},$n={class:"relative mt-3"},Kn={class:"prompt-placeholder-panel__list custom-scrollbar"},Yn=["onClick"],Wn={class:"block min-w-0 truncate text-xs font-semibold text-slate-700"},Hn={key:0,class:"ml-1 shrink-0 rounded-full bg-emerald-50 px-1.5 py-0.5 text-[10px] font-semibold leading-none text-emerald-600"},qn={key:1,class:"flex h-full items-center justify-center px-3 text-center text-xs text-slate-400"},Xn={class:"rounded-xl border border-slate-100 overflow-hidden bg-white"},Zn={class:"bg-slate-50/80 px-4 py-2 flex items-center justify-between border-b border-slate-100"},Qn={class:"flex items-center gap-2"},es={class:"text-xs text-slate-500 font-medium italic"},ts={key:0,class:"text-[10px] bg-slate-200 text-slate-600 px-1.5 py-0.5 rounded-full font-bold"},as={class:"p-4 bg-slate-50/30 min-h-[100px]"},ns={key:0,class:"flex flex-col items-center justify-center py-8 text-slate-400"},ss={class:"text-xs"},os={key:1,class:"flex flex-col gap-2"},rs={class:"flex items-center gap-3 min-w-0"},ls={class:"w-8 h-8 rounded bg-slate-100 flex items-center justify-center flex-shrink-0 group-hover:bg-emerald-50 transition-colors"},is={class:"min-w-0"},cs=["title"],us={class:"text-[10px] text-slate-400"},ds=["onClick"],ms={class:"rounded-xl border border-slate-100 overflow-hidden bg-white"},ps={class:"bg-slate-50/80 px-4 py-2 flex items-center justify-between border-b border-slate-100"},fs={class:"text-xs text-slate-500 font-medium italic"},hs={key:0,class:"mt-2 flex items-center gap-1.5 text-red-500 text-xs animate-in slide-in-from-top-1"},gs={class:"flex items-center justify-between pt-4 border-t border-slate-50"},vs={class:"flex items-center gap-2"},_s={class:"text-sm font-medium text-slate-700"},ys={class:"text-xs text-slate-400"},Ts={class:"mb-4"},Es={class:"relative"},Is={class:"space-y-5 max-h-[60vh] overflow-y-auto pr-1 custom-scrollbar"},bs={class:"text-[11px] font-bold text-slate-400 uppercase tracking-widest mb-2 px-1"},As={class:"flex flex-wrap gap-2"},xs=["onClick"],Ss={class:"text-sm leading-snug"},Ps={key:0,class:"py-8 text-center text-slate-400 text-sm"},_t="AI_ASSET_LIBRARY_GENERATE_MATERIAL",Rs="AI_ASSET_LIBRARY_MATERIAL_CONTENT_PARSE",ks="AI_ASSET_LIBRARY_VIDEO_VARIANT_PROMPT_GENERATE",Cs="AI_ASSET_LIBRARY_VIDEO_VARIANT_PARSE",yt="__ai_virtual_avatar__",ye="sys.",Tt="custom.",Te="promptContextBlocks",Et="BEFORE_OUTPUT_REQUIREMENTS",It=20,Os=Fa({__name:"LlmPromptTemplateForm",props:{category:{},initialData:{default:()=>({})},templateId:{default:void 0},lockScene:{type:Boolean,default:!1},copyAsNew:{type:Boolean,default:!1},adminAppRegion:{default:void 0}},emits:["saved","cancel"],setup(h,{expose:T,emit:v}){const{t:l,te:k,locale:A}=za(),x=e=>e==="ç³»ç»é»è®¤"?l("dashboard.llmPromptTemplateFormPage.catSystem"):e==="ç´ æ"?l("dashboard.llmPromptTemplateFormPage.catMaterial"):e==="åç"?l("dashboard.llmPromptTemplateFormPage.catSlice"):e==="ææ¡£"?l("dashboard.llmPromptTemplateFormPage.catDocument"):e==="ç鿡件"?l("dashboard.llmPromptTemplateFormPage.catFilter"):e,g=h,S=f(()=>{var e;return((e=g.adminAppRegion)==null?void 0:e.trim())||void 0}),R=f(()=>(g.category||"MARKET")==="MARKET"),C=f(()=>S.value?{appRegion:S.value}:void 0),N=v,O=E(!1),$=E(0),o=E({id:void 0,name:"",scene:"",promptGroup:"",promptSubgroup:"",modelId:void 0,content:"",status:!0,responseJson:"",documentIds:[],enableThinking:!1,structuredInput:""}),V=E([]),I=E([]),ee=E(!1),U=E(null),te=E(""),M=E(""),Ie=E(!1),be=E(!1),ce=e=>e===1||e==="1"||e===!0||e==="true",bt=e=>({...e,id:e==null?void 0:e.id,name:(e==null?void 0:e.name)||"",platformId:(e==null?void 0:e.platformId)??(e==null?void 0:e.platform_id)??"",platformModelId:(e==null?void 0:e.platformModelId)??(e==null?void 0:e.platform_model_id)??(e==null?void 0:e.platformId)??(e==null?void 0:e.platform_id)??"",supportStructuredOutput:ce((e==null?void 0:e.supportStructuredOutput)??(e==null?void 0:e.support_structured_output)??0),supportThinking:ce((e==null?void 0:e.supportThinking)??(e==null?void 0:e.support_thinking)??0),supportStructuredOutputWhenThinking:ce((e==null?void 0:e.supportStructuredOutputWhenThinking)??(e==null?void 0:e.support_structured_output_when_thinking)??1)}),Ue=(e={})=>{const t=pt(e.scene,e.name);return{...e,promptGroup:e.promptGroup||e.prompt_group||t.promptGroup,promptSubgroup:e.promptSubgroup||e.prompt_subgroup||t.promptSubgroup,enableThinking:ce(e.enableThinking??e.enable_thinking??!1)}},At=tn.map(e=>({value:e.value,label:e.label})),xt=f(()=>mt(o.value.promptGroup).map(e=>({value:e.value,label:e.label})));X(()=>o.value.promptGroup,(e,t)=>{var n;if(!t||e===t)return;const a=mt(e);a.some(s=>s.value===o.value.promptSubgroup)||(o.value.promptSubgroup=((n=a[0])==null?void 0:n.value)||"")});const St=()=>{const e=g.category||"MARKET",t=Wa(e),a=Ha(qa(t)),n=["MARKET_DEBUG","PRE_SALE_DEBUG","AFTER_SALE_DEBUG"];return a.filter(s=>!n.includes(s)).map(s=>({value:s,label:_e(s)}))},Pt=f(()=>($.value,A.value,St())),ae=E(!1),ue=E(""),Ae=E(!1),je=E(""),Ge=nn(),Rt=f(()=>Ge.avatars.value),kt=[{key:"AIè§é¢",label:"AI è§é¢"},{key:"AI徿",label:"AI 徿"},{key:"AIç´ æåº",label:"AI ç´ æåº"},{key:"AIçå§",label:"AI çå§"},{key:"çè§é¢",label:"çè§é¢"},{key:"æç¤ºè¯æ¨¡æ¿ä¼å",label:"æç¤ºè¯æ¨¡æ¿ä¼å"},{key:"AIå 容éé¢",label:"AI å 容éé¢"},{key:"AIéé¢",label:"AI å 容éé¢"},{key:"AIå¿«éè¯ç¨",label:"AI å¿«éè¯ç¨"},{key:"AIæ ç¾",label:"AI æ ç¾"},{key:"æµè§å¨æä»¶",label:"æµè§å¨æä»¶"}],Be=f(()=>{const e=Pt.value,t=ue.value.toLowerCase().trim(),a=t?e.filter(r=>r.label.toLowerCase().includes(t)||r.value.toLowerCase().includes(t)):e,n=new Map,s=new Set;for(const r of kt){const m=a.filter(d=>!s.has(d.value)&&d.label.startsWith(r.key)).map(d=>({value:d.value,label:d.label,shortLabel:d.label.startsWith(r.key+"-")?d.label.slice(r.key.length+1):d.label}));if(m.length>0){const d=n.get(r.label);d?d.items.push(...m):n.set(r.label,{label:r.label,items:m}),m.forEach(j=>s.add(j.value))}}const i=a.filter(r=>!s.has(r.value)).map(r=>({value:r.value,label:r.label,shortLabel:r.label}));return i.length>0&&n.set("å ¶ä»",{label:"å ¶ä»",items:i}),Array.from(n.values())}),Ct=e=>{o.value.scene=e;const t=pt(e,o.value.name);o.value.promptGroup=t.promptGroup,o.value.promptSubgroup=t.promptSubgroup,ae.value=!1,ue.value=""},Ot=f(()=>V.value.map(e=>({value:e.id,label:e.platformModelId||e.platformId?`${e.name} (${e.platformModelId||e.platformId})`:e.name??String(e.id)}))),L=f(()=>{const e=o.value.modelId;return e==null||e===""?null:V.value.find(t=>String(t.id)===String(e))||null}),wt=f(()=>!L.value||!L.value.supportThinking),Je=f(()=>{var e,t,a;return!!(o.value.enableThinking&&((e=L.value)!=null&&e.supportThinking)&&((t=L.value)!=null&&t.supportStructuredOutput)&&!((a=L.value)!=null&&a.supportStructuredOutputWhenThinking))}),Nt=f(()=>!o.value.modelId||!L.value?l("dashboard.llmPromptTemplateFormPage.reasoningNeedsModel"):L.value.supportThinking?Je.value?l("dashboard.llmPromptTemplateFormPage.reasoningStructuredFallback"):o.value.enableThinking?l("dashboard.llmPromptTemplateFormPage.reasoningEnabledHint"):l("dashboard.llmPromptTemplateFormPage.reasoningDisabledHint"):l("dashboard.llmPromptTemplateFormPage.reasoningUnsupported")),xe=new Set(["AI_VIDEO_MATERIAL_TIME_MATCH","AI_VIDEO_BACKGROUND_TIME_MATCH","AI_COPYWRITING_CONTENT_PACKAGING_COPY_ALIGN","AI_VIDEO_BASE_MATERIAL_COPY_ALIGN","AI_VIDEO_BASE_MATERIAL_INVALID_ID_RESELECT","AI_VIDEO_ASSIST_MATERIAL_COPY_ALIGN","AI_VIDEO_ASSIST_MATERIAL_INVALID_ID_RESELECT","AI_ASSET_LIBRARY_GENERATE_SYSTEM_DESCRIPTION","AI_ASSET_LIBRARY_GENERATE_INTERFACE_DESCRIPTION","AI_ASSET_LIBRARY_MATERIAL_CONTENT_PARSE","AI_ASSET_LIBRARY_VIDEO_VARIANT_PROMPT_GENERATE","AI_ASSET_LIBRARY_VIDEO_VARIANT_PARSE","AI_ASSET_LIBRARY_AUTO_TAGGING","AI_ASSET_LIBRARY_DESCRIBE_AND_AUTO_TAGGING_BATCH","AI_TERM_AUTO_CLASSIFY","AI_TERM_AUTO_CLASSIFY_IN_DOMAIN","PROMPT_TEMPLATE_OPTIMIZE_GENERATE_NEW","PROMPT_TEMPLATE_OPTIMIZE_REFINE","AI_QUICK_PREVIEW_BUSINESS_SUMMARY","AI_QUICK_PREVIEW_PROMPT_ENHANCE","AI_QUICK_PREVIEW_GENERATION_PROMPT","BROWSER_PLUGIN_TRANSLATE","AI_VIDEO_SUBTITLE_TRUNCATION","AI_VIDEO_SUBTITLE_TRUNCATION_BATCH","AI_VIDEO_AUTO_CROP_SEMANTIC_MATCH","AI_COPYWRITING_ORIGINAL_VOICE_MATERIAL","AI_COPYWRITING_GENERATE_SCENE_MATERIAL","AI_COPYWRITING_GENERATE_SCENE_MATERIAL_TAG_ROUTING","AI_COPYWRITING_GENERATE_SCENE_MATERIAL_CANDIDATE_SELECT","AI_SHORT_DRAMA_EPISODE_OUTLINE_GENERATION_ZH_CN","AI_SHORT_DRAMA_EPISODE_OUTLINE_GENERATION_EN","AI_SHORT_DRAMA_EPISODE_OUTLINE_REVIEW_ZH_CN","AI_SHORT_DRAMA_EPISODE_OUTLINE_REVISION_ZH_CN","AI_SHORT_DRAMA_EPISODE_SCRIPT_GENERATION_EN","AI_SHORT_DRAMA_EPISODE_SCRIPT_REVIEW_EN","AI_SHORT_DRAMA_EPISODE_SCRIPT_REVISION_EN","AI_SHORT_DRAMA_STORYBOARD_GENERATION_EN","AI_SHORT_DRAMA_STORYBOARD_REVIEW_EN","AI_SHORT_DRAMA_STORYBOARD_REVISION_EN","AI_SHORT_DRAMA_CODEX_REVIEW","AI_CONTENT_MONITOR_FRAME_BATCH_ANALYSIS","AI_CONTENT_MONITOR_FRAME_FINAL_ANALYSIS","AI_CONTENT_MONITOR_REWRITE_REFERENCE_REFINE","AI_CONTENT_REWRITE_STORY_STRUCTURE","AI_CONTENT_REWRITE_STORY_DETAIL","FLOW_PLAYBOOK_EDIT_PRE_SALE"]),Mt=f(()=>xe.has(String(o.value.scene||"").trim())),de=f(()=>Mt.value);function G(e){if(!e)return"";const t=hn(e,l,k);return Object.keys(t).length===0?"":JSON.stringify(t,null,2)}const Lt=new Set(["AI_IMAGE_TEXT_ORIGINAL_COPYWRITING","AI_IMAGE_TEXT_COPYWRITING_REWRITE"]);function Ft(e,t){var d;const a=String(e||"").trim();if(!Lt.has(a))return!1;const n=String(t||"").trim();if(!n)return!1;let s;try{s=JSON.parse(n)}catch{return!1}const i=s.required;if(!Array.isArray(i)||!i.includes("new_copy"))return!1;if(i.includes("image_modifications")||!i.includes("title")||!i.includes("cover_title"))return!0;const r=s.properties;return((d=r==null?void 0:r.cover_title)==null?void 0:d.type)==="string"}function zt(e,t){var rt;if(String(e||"").trim()!=="AI_IMAGE_TEXT_INTERLEAVED_ORIGINAL_COPYWRITING")return!1;const n=String(t||"").trim();if(!n)return!1;let s;try{s=JSON.parse(n)}catch{return!1}const i=s.required;if(Array.isArray(i)&&i.includes("article_html"))return!0;const r=s.properties;if(r&&"article_html"in r&&!("article_blocks"in r))return!0;const m=r==null?void 0:r.article_blocks,d=m==null?void 0:m.items,j=Array.isArray(d==null?void 0:d.oneOf)?d==null?void 0:d.oneOf:[];if(!j.length)return!0;const q=j.flatMap(re=>{var it,ct;const lt=(ct=(it=re==null?void 0:re.properties)==null?void 0:it.type)==null?void 0:ct.enum;return Array.isArray(lt)?lt.map(Ma=>String(Ma)):[]});return!["heading","paragraph","image","list","blockquote","divider"].every(re=>q.includes(re))||((rt=r==null?void 0:r.subtitle)==null?void 0:rt.type)!=="str
24ing"}function $e(e){if(!e)return;if(xe.has(e)){const a=G(e);a&&(o.value.responseJson=a);return}const t=String(o.value.responseJson||"").trim();if(!t){const a=G(e);a&&(o.value.responseJson=a);return}if(Ft(e,t)){const a=G(e);a&&(o.value.responseJson=a)}if(zt(e,t)){const a=G(e);a&&(o.value.responseJson=a)}}X(()=>o.value.scene,e=>{if(Ie.value){Ie.value=!1;return}o.value.responseJson=G(e),M.value=""}),X(A,()=>{const e=String(o.value.scene||"").trim();if(!e||!xe.has(e))return;const t=G(e);t&&(o.value.responseJson=t)});const Dt=vn,Se=e=>e?e.startsWith(ye)?e.slice(ye.length):e.startsWith(Tt)?e.slice(Tt.length):e:"",Ke=(e,t)=>{const a=Se(e);if(!a)return t;if(/^imageText\d+$/i.test(a)){const s=a.match(/^imageText(\d+)$/i),i=s?Number(s[1]):1;if(Number.isFinite(i)&&i>=1)return l("dashboard.llmPromptTemplateFormPage.imageTextNth",{n:i})}const n=`dashboard.promptPlaceholders.${a}`;return k(n)?l(n):t},Pe=e=>{if((e==null?void 0:e.id)!=null&&e.id!=="")return String(e.name||e.key||"");const t=String(e.rawKey||"").trim();return t?Ke(t,String(e.name||t)):String(e.name||e.key||"")},Vt=e=>e?e.startsWith(ye)?e:`${ye}${e}`:"",Ye=f(()=>g.category||"MARKET"),Ut=new Set(["inputJson","openingStatusEnum","licenseStatusEnum","periodTypeEnum","granularityEnum","weekdayEnum","categoryEnum","slotResultConfig","actions","kbList","o
24penSupportTickets","msgList","customerProfile","historyMsgList","followUpTasks","availableImmediateStrategies","activeFollowUpTasks","periodTypeEnums","granularityEnums","weekdayEnums","pricingContext","categoryList","issueContent","candidateTemplates","templateContent","triggerTypeCode","triggerTypeId","taskType","followupTemplateId"]),jt=(e,t)=>{if(!t)return!1;const a=Ut.has(t);return e==="PRE_SALE"?a:!a},Gt=f(()=>{var e;return!!g.lockScene||!g.templateId&&!!((e=g.initialData)!=null&&e.scene)}),Bt=f(()=>{const e={};return Object.entries(Dt).forEach(([t,a])=>{e[t]=a.map(n=>{const s=Se(String(n.key||""));return{...n,key:Vt(s),rawKey:s}}).filter(n=>jt(Ye.value,n.rawKey))}),e}),me=f(()=>{const e={};return Object.entries(Bt.value).forEach(([t,a])=>{e[t]=[...a]}),e}),Jt=f(()=>{A.value;const e=new Map;Object.values(me.value).forEach(t=>{t.forEach(a=>{const n=Pe(a);a!=null&&a.key&&e.set(a.key,n),a!=null&&a.rawKey&&e.set(a.rawKey,n)})});for(let t=1;t<=50;t+=1){const a=l("dashboard.llmPromptTemplateFormPage.imageTextNth",{n:t});e.set(`sys.imageText${t}`,a),e.set(`imageText${t}`,a)}return e}),W=E([]),$t=f(()=>W.value.filter(e=>e.enabled)),We=e=>e==="DOCUMENT"?"ææ¡£":e==="SLICE"?"åç":"ç´ æ",He=e=>e==="DOCUMENT"?"请åèä»¥ä¸ææ¡£å
å®¹ï¼æåä¸å½åä»»å¡ç¸å
³çä¿¡æ¯ã":e==="SLICE"?"请åè以ä¸åçåå¹åéï¼æè¯ä¹æéå¯å¤ç¨ç段ã":"请åè以ä¸ç´ æåºåéä¿¡æ¯ï¼ä¼å
使ç¨ä¸å½åä»»å¡å¹é
çå
容ã",Kt=(e,t)=>{const a=String(e||"").trim().toUpperCase();return a==="DOCUMENT"?"DOCUMENT":a==="SLICE"?"SLICE":t==="ææ¡£"?"DOCUMENT":t==="åç"?"SLICE":"ASSET"},Yt=f(()=>{const e=String(o.value.scene||"").trim();return e?_e(e):""}),Wt=f(()=>String(o.value.scene||"").trim()===_t),Ht=e=>{const t=new Set,a=/{{\s*([^{}]+?)\s*}}/g;let n;for(;n=a.exec(e||"");){const s=String(n[1]||"").trim();s&&t.add(s)}return Array.from(t)},qt=f(()=>Ht(o.value.content||"")),qe=f(()=>{const e=new Map,t=o.value.content||"",a=/{{\s*([^{}]+?)\s*}}/g;let n;for(;n=a.exec(t);){const s=n[1].trim();e.set(s,(e.get(s)||0)+1)}return e}),Xt=f(()=>{A.value;const e=[];if(Object.entries(me.value).forEach(([t,a])=>{(a||[]).forEach(n=>{const s=Pe(n),i=Se(String((n==null?void 0:n.rawKey)||(n==null?void 0:n.key)||"")),r=String((n==null?void 0:n.key)||i||"").trim();if(!i||!r)return;const m=An({rawKey:i,locale:A.value,category:t,label:s,customDescription:String((n==null?void 0:n.description)||""),sceneLabel:Yt.value}),d=(qe.value.get(r)||0)+(i!==r&&qe.value.get(i)||0);e.push({id:n==null?void 0:n.id,key:r,insertKey:r,rawKey:i,label:s,category:t,sectionKey:`${t}-${m.section}`,sectionLabel:m.section,description:m.description,sceneHint:m.sceneHint,example:m.example,count:d,searchText:m.searchText,interactionType:"default"})})}),Wt.value){const t=A.value.startsWith("zh");e.push({key:yt,insertKey:yt,rawKey:"aiVirtualAvatarId",label:"AIèæäººå",category:"ç´ æ",sectionKey:"ç´ æ-ai-virtual-avatar",sectionLabel:t?"AI ç´ æåº":"AI Asset Library",description:t?"ç¹å»åæå¼ AI èæäººåå¼¹çªï¼éä¸åæå¯¹åºèæäººå ID ç´æ¥æå
¥å°æç¤ºè¯ä¸ã":"Open the AI avatar picker and insert the selected avatar ID into the prompt.",sceneHint:t?"éåå¨ AIç´ æåº åºæ¯éæåºå®èæäººåèµäº§ ID åµå
¥å°æ¨¡æ¿æ£æã":"Use this to inject a fixed AI avatar asset ID into AI asset library prompts.",example:t?"示ä¾å¼ï¼avatar-luna":"Example value: avatar-luna",count:0,searchText:t?"AIèæäººå èæäººå avatar id ç´ æåº":"AI avatar virtual human asset id",interactionType:"avatar-picker"})}return e.sort((t,a)=>{const n=x(t.category).localeCompare(x(a.category),A.value);return n!==0?n:t.label.localeCompare(a.label,A.value)})}),Zt=e=>{const t=te.value.trim().toLowerCase();return t?[e.label,e.rawKey,e.insertKey,e.sectionLabel,e.description,e.searchText].some(a=>String(a||"").toLowerCase().includes(t)):!0},Re=f(()=>Xt.value.filter(Zt)),Xe=e=>{if(!e)return{};if(typeof e=="object"&&!Array.isArray(e))return{...e};if(typeof e!="string")return{};const t=e.trim();if(!t||t==="null")return{};try{const a=JSON.parse(t);return a&&typeof a=="object"&&!Array.isArray(a)?a:{}}catch{return{}}},K=e=>Array.isArray(e)?Array.from(new Set(e.map(t=>Number(t)).filter(t=>Number.isFinite(t)&&t>0))):[],ke=e=>Array.isArray(e)?Array.from(new Set(e.map(t=>
24String(t||"").trim()).filter(Boolean))):[],Ce=e=>Array.isArray(e)?e.map(t=>({conditions:(Array.isArray(t==null?void 0:t.conditions)?t.conditions:[]).map(s=>({field:["typeIds","tagDomainId","tagCategoryId","tagIds"].includes(s==null?void 0:s.field)?s.field:"typeIds",values:K(s==null?void 0:s.values),runtimeMode:(s==null?void 0:s.runtimeMode)==="FIXED_ONLY"?"FIXED_ONLY":"FOLLOW_RUNTIME"})).filter(s=>s.values.length>0),ignoreRuntimeTermFilters:(t==null?void 0:t.ignoreRuntimeTermFilters)===!0})).filter(t=>t.conditions.length>0):[],Qt=e=>{const t={typeIds:"FOLLOW_RUNTIME",tagDomainId:"FOLLOW_RUNTIME",tagCategoryId:"FOLLOW_RUNTIME",tagIds:"FOLLOW_RUNTIME"},a=e.flatMap(n=>n.conditions||[]);return Object.keys(t).forEach(n=>{const s=a.filter(i=>i.field===n&&i.values.length>0);s.length>0&&s.every(i=>i.runtimeMode==="FIXED_ONLY")&&(t[n]="FIXED_ONLY")}),t},ea=e=>{const t={};if(e.type==="DOCUMENT"){const n=ke(e.nameKeyword),s=K(e.documentCategoryId),i=K(e.tagIds);return n.length>0&&(t.nameKeyword=n),s.length>0&&(t.documentCategoryId=s),i.length>0&&(t.tagIds=i),JSON.stringify({filters:t})}const a=Ce(e.advancedAssetFilterGroups);return a.length>0&&(t.advancedTermFilter={enabled:!0,groups:a.map(n=>{const s={conditions:n.conditions.map(r=>({field:r.field,values:r.values,runtimeMode:r.runtimeMode}))};return(n.ignoreRuntimeTermFilters===!0||n.conditions.every(r=>r.runtimeMode==="FIXED_ONLY"))&&(s.ignoreRuntimeTermFilters=!0),s})},t.filterModeConfig=Qt(a)),(e.assetMediaType==="IMAGE"||e.assetMediaType==="VIDEO")&&(t.mediaType=e.assetMediaType),JSON.stringify({filters:t})},ta=e=>{if(!e||typeof e!="object")return null;const t=Kt(e.type,e.category);return{id:String(e.id||`ctx_${Date.now()}_${Math.random().toString(36).slice(2,8)}`),enabled:!0,type:t,instruction:He(t),placement:Et,limitSize:It,assetMediaType:e.assetMediaType==="IMAGE"||e.assetMediaType==="VIDEO"?e.assetMediaType:"",nameKeyword:t==="DOCUMENT"?ke(e.nameKeyword):[],documentCategoryId:K(e.documentCategoryId),tagIds:K(e.tagIds),advancedAssetFilterGroups:Ce(e.advancedAssetFilterGroups)}},Ze=()=>{const e=Xe(o.value.structuredInput),t=Array.isArray(e[Te])?e[Te]:[];W.value=t.map(ta).filter(a=>a!=null)},aa=()=>W.value.filter(e=>e.type).map(e=>({id:e.id,enabled:!0,type:e.type,instruction:He(e.type),placement:Et,limitSize:It,assetMediaType:e.assetMediaType||"",nameKeyword:e.type==="DOCUMENT"?ke(e.nameKeyword):[],documentCategoryId:K(e.documentCategoryId),tagIds:K(e.tagIds),advancedAssetFilterGroups:Ce(e.advancedAssetFilterGroups),filterConditions:ea(e)})),na=()=>{const e=Xe(o.value.structuredInput),t=String(o.value.scene||"").trim();t===_t?e.aiMaterialConfigType="AI_MATERIAL_TEMPLATE":t===Rs?e.aiMaterialConfigType="AI_MATERIAL_CONTENT_PARSE":(t===ks||t===Cs)&&(e.aiMaterialConfigType="AI_MATERIAL_VIDEO_VARIANT_PROMPT_GENERATE");const a=aa();return a.length>0?e[Te]=a:delete e[Te],Object.keys(e).length>0?JSON.stringify(e):null},sa=e=>{const t=e.filter(n=>n.enabled);if(t.length===0)return"";const a=["ãä¸ä¸æå¯¹è±¡ã"];return t.forEach((n,s)=>{a.push(""),a.push(`${s+1}. ${We(n.type)}`),n.instruction&&a.push(`使ç¨è¯´æï¼${n.instruction}`),a.push(`æ°æ®ï¼[è¿è¡æ¶æ³¨å ¥${We(n.type)}çéç»æ]`)}),a.join(` 25`)},oa=(e,t)=>{const n=["ãè¾åºè¦æ±ã","## è¾åºè¦æ±","### è¾åºè¦æ±","è¾åºè¦æ±ï¼","è¾åºæ ¼å¼ï¼","ãè¾åºæ ¼å¼ã"].map(i=>e.indexOf(i)).filter(i=>i>=0);if(n.length===0)return`${e} 26 27${t}`.trim();const s=Math.min(...n);return`${e.slice(0,s).trimEnd()} 28 29${t} 30 31${e.slice(s).trimStart()}`.trim()},ra=f(()=>{const e=String(o.value.content||"").trim(),t=sa($t.value);let a=e;return t&&(a=oa(a,t)),a||"ææ æç¤ºè¯å 容"}),la=f(()=>{const e=new Set,t=[];return Object.values(me.value).forEach(a=>{(a||[]).forEach(n=>{const s=String((n==null?void 0:n.key)||(n==null?void 0:n.rawKey)||"").trim();!s||e.has(s)||(e.add(s),t.push({key:s,name:Pe(n)}))})}),t}),F=E(null),ne=E(null),se=e=>e.replace(/[&<>"']/g,t=>({"&":"&","<":"<",">":">",'"':""","'":"'"})[t]||t),ia=e=>{for(const[t,a]of Object.entries(me.value))if(a.some(n=>n.key===e||n.rawKey===e))return t;return"ç³»ç»é»è®¤"},ca=e=>e==="ç´ æ"?"background: #ecfdf5; border-color: #a7f3d0; color: #059669;":e==="åç"?"background: #ecfeff; border-color: #a5f3fc; color: #0891b2;":e==="ææ¡£"?"background: #eff6ff; border-color: #bfdbfe; color: #2563eb;":e==="ç鿡件"?"background: #fff7ed; border-color: #fed7aa; color: #ea580c;":"background: #f1f5f9; border-color: #e2e8f0; color: #475569;",ua=e=>e==="ç´ æ"?"background: #059669;":e==="åç"?"background: #0891b2;":e==="ææ¡£"?"background: #2563eb;":e==="ç鿡件"?"background: #ea580c;":"background: #475569;",B=()=>{const e=U.value;if(!e)return;const t=o.value.content||"",a=/{{\s*([^{}]+?)\s*}}/g;let n=0,s="",i;for(;i=a.exec(t);){const m=t.slice(n,i.index);m&&(s+=se(m).replace(/\n/g,"<br/>"));const d=i[1].trim(),j=Jt.value.get(d)||Ke(d,d),q=ia(d);s+=`<span class="placeholder-tag" style="${ca(q)}" data-placeholder-key="${se(d)}" contenteditable="false"><span class="placeholder-name">${se(j)}</span><span class="placeholder-remove" style="${ua(q)}">Ã</span></span>`,n=i.index+i[0].length}const r=t.slice(n);r&&(s+=se(r).replace(/\n/g,"<br/>")),e.innerHTML=s||""},pe=()=>{const e=U.value;if(!e)return null;const t=window.getSelection();if(!t||t.rangeCount===0)return null;const a=t.getRangeAt(0);if(!e.contains(a.startContainer))return null;const n=a.cloneRange();return n.selectNodeContents(e),n.setEnd(a.startContainer,a.startOffset),Ve(n.cloneContents(),!1).length},Qe=()=>{const e=U.value;return e?Ve(e):""},da=e=>Ve(e),fe=()=>{o.value.content=Qe()},ma=async(e,t)=>{await w();const a=o.value.content||"",n=t??pe()??F.value??a.length,s=`{{${e}}}`;o.value.content=a.slice(0,n)+s+a.slice(n),B(),await w();const i=n+s.length;return oe(i),F.value=i,ne.value=null,i},pa=async(e,t)=>{await w();const a=o.value.content||"",n=t??pe()??F.value??a.length;o.value.content=a.slice(0,n)+e+a.slice(n),B(),await w();const s=n+e.length;return oe(s),F.value=s,ne.value=null,s},fa=()=>{be.value=!0},ha=async e=>{o.value.content=e,await w(),B(),await w(),oe((o.value.content||"").length),P.success(l("dashboard.llmPromptTemplateFormPage.optimizeApplied"))},ga=async e=>{var a;if(e.interactionType==="avatar-picker"){Ae.value=!0;return}const t=await ma(e.insertKey,ne.value??F.value);await w(),(a=U.value)==null||a.focus(),oe(t)},va=async e=>{var n;const t=String(e||"").trim();if(!t)return;je.value=t;
31const a=await pa(t,ne.value??F.value);await w(),(n=U.value)==null||n.focus(),oe(a)},H=()=>{const e=pe();e!=null&&(F.value=e)},_a=()=>{H(),ne.value=F.value??Qe().length},ya=()=>{fe(),H()},Ta=()=>{H(),fe(),B()},Ea=e=>{const t=e.target;if(t)if(t.classList.contains("placeholder-remove")){const a=t.closest(".placeholder-tag");a&&(a.remove(),fe())}else H()},Ia=()=>{H()},ba=()=>{H()},et=(e,t)=>{const a=da(t.cloneContents());e.setData("text/plain",a);const n=se(a).replace(/\n/g,"<br/>");e.setData("text/html",`<div>${n}</div>`)},Aa=e=>{const t=U.value,a=e.clipboardData;if(!t||!a)return;const n=window.getSelection();if(!n||n.rangeCount===0)return;const s=n.getRangeAt(0);s.collapsed||t.contains(s.commonAncestorContainer)&&(e.preventDefault(),et(a,s))},xa=async e=>{const t=U.value,a=e.clipboardData;if(!t||!a)return;const n=window.getSelection();if(!n||n.rangeCount===0)return;const s=n.getRangeAt(0);s.collapsed||t.contains(s.commonAncestorContainer)&&(e.preventDefault(),et(a,s),s.deleteContents(),fe(),await w(),B(),await w(),F.value=pe())},oe=e=>{const t=U.value;if(!t)return;const a=window.getSelection();if(!a)return;const n=document.createRange();let s=e,i=!1;const r=m=>{var we;if(i)return;if(m.nodeType===Node.TEXT_NODE){const J=((we=m.textContent)==null?void 0:we.length)??0;if(s<=J){n.setStart(m,s),n.collapse(!0),i=!0;return}s-=J;return}if(m.nodeType!==Node.ELEMENT_NODE)return;const d=m,j=d.dataset.placeholderKey;if(j){const J=`{{${j}}}`.length;if(s<=J){n.setStartAfter(d),n.collapse(!0),i=!0;return}s-=J;return}if(d.tagName==="BR"){if(s<=1){n.setStartAfter(d),n.collapse(!0),i=!0;return}s-=1;return}const q=d.tagName==="DIV"||d.tagName==="P";if(d.childNodes.forEach(J=>r(J)),!i&&q){if(s<=1){n.setStartAfter(d),n.collapse(!0),i=!0;return}s-=1}};t.childNodes.forEach(m=>r(m)),i||(n.selectNodeContents(t),n.collapse(!1)),a.removeAllRanges(),a.addRange(n),F.value=e},Oe=()=>{if(!o.value.responseJson){M.value="";return}try{const e=JSON.parse(o.value.responseJson);o.value.responseJson=JSON.stringify(e,null,2),M.value=""}catch{M.value=l("dashboard.llmPromptTemplateFormPage.jsonInvalid")}},tt=()=>{if(!o.value.responseJson)return M.value="",!0;try{return JSON.parse(o.value.responseJson),M.value="",!0}catch{return M.value=l("dashboard.llmPromptTemplateFormPage.jsonInvalid"),!1}},Sa=()=>{if(o.value.responseJson)try{const e=JSON.parse(o.value.responseJson);o.value.responseJson=JSON.stringify(e)}catch{}},Pa=()=>{ee.value=!0},Ra=e=>{if(!e||e.length===0)return;const t=e.map(s=>({id:s.id,name:s.name||s.fileName||"",fileName:s.name||s.fileName||"",url:s.url||s.path||"",path:s.url||s.path||"",fileId:s.fileId||"",status:"done",originalDoc:s})),a=I.value.map(s=>s.id).filter(Boolean),n=t.filter(s=>s.id&&!a.includes(s.id));n.length>0?(I.value.push(...n),o.value.documentIds=I.value.map(s=>s.id).filter(Boolean),P.success(l("dashboard.llmPromptTemplateFormPage.docsAdded",{n:n.length}))):t.length>0&&P.warning(l("dashboard.llmPromptTemplateFormPage.docsExist")),ee.value=!1},ka=()=>{ee.value=!1},Ca=e=>{var n;if(!e)return gt;const t=(n=e.split(".").pop())==null?void 0:n.toLowerCase();return(t?{pdf:Z,doc:Z,docx:Z,txt:Z,md:Z,xls:Le,xlsx:Le,csv:Le,ppt:vt,pptx:vt,png:Q,jpg:Q,jpeg:Q,gif:Q,webp:Q,svg:Q,js:D,ts:D,html:D,css:D,json:D,py:D,java:D,c:D,cpp:D,go:D,zip:ie,rar:ie,"7z":ie,tar:ie,gz:ie,mp3:Fe,wav:Fe,ogg:Fe,mp4:ze,mov:ze,avi:ze}[t]:void 0)||gt},Oa=(e,t)=>{t>=0&&t<I.value.length&&(I.value.splice(t,1),o.value.documentIds=I.value.map(a=>a.id).filter(Boolean))},wa=async e=>{var t;try{const a=await $a(e,C.value);if(a.data&&a.data.code===0&&a.data.data){Ie.value=!0,Object.assign(o.value,Ue(a.data.data)),Ze();{const n=String(o.value.scene||"").trim();$e(n)}if(o.value.documentIds&&Array.isArray(o.value.documentIds)&&o.value.documentIds.length>0){const{batchGetDocuments:n}=await La(()=>import("./document-d3d35d4d.js"),["assets/document-d3d35d4d.js","assets/base-dd5e669f.js","assets/head-ed4e7f32.js","assets/head-1783e53e.css"]);try{const s=await n(o.value.documentIds);if(s.data&&(s.data.code===0||s.data.code===200)&&s.data.data){const i=s.data.data.documents||[];I.value=i.map(r=>({id:r.id,name:r.name||"",fileName:r.name||"",url:r.url||"",path:r.url||"",fileId:r.fileId||"",status:"done",originalDoc:r}))}else I.value=[]}catch{I.value=[]}}else I.value=[];
31if(w(()=>{Oe(),B()}),g.copyAsNew){o.value.id=void 0;const n=String(o.value.name||"").trim(),s="ï¼å¯æ¬ï¼",i=n.includes(s)||n.includes(" (copy)")||n.includes(" (Copy)");o.value.name=i?n:`${n||l("dashboard.llmPromptTemplateFormPage.defaultTplName")}${l("dashboard.llmPromptTemplateFormPage.copySuffix")}`}}else P.error(((t=a.data)==null?void 0:t.msg)||l("dashboard.llmPromptTemplateFormPage.msgLoadFail"))}catch{P.error(l("dashboard.llmPromptTemplateFormPage.msgLoadFail"))}};X(()=>o.value.responseJson,()=>{o.value.responseJson?tt():M.value=""});async function Na(){var t,a;if(!o.value.name){P.error(l("dashboard.llmPromptTemplateFormPage.errTplName"));return}if(!o.value.modelId){P.error(l("dashboard.llmPromptTemplateFormPage.errModel"));return}if(o.value.enableThinking&&(!L.value||!L.value.supportThinking)){P.error(l("dashboard.llmPromptTemplateFormPage.errReasoningUnsupported")),o.value.enableThinking=!1;return}if(!o.value.scene){P.error(l("dashboard.llmPromptTemplateFormPage.errScene"));return}if(R.value&&(!o.value.promptGroup||!o.value.promptSubgroup)){P.error("è¯·éæ©ä¸çº§ä¸å¡åç±»åäºçº§æµç¨ç¯è");return}if(!o.value.content){P.error(l("dashboard.llmPromptTemplateFormPage.errContent"));return}if(o.value.responseJson&&!tt()){P.error(l("dashboard.llmPromptTemplateFormPage.errJson"));return}const e=String(o.value.scene||"").trim();if(de.value)o.value.responseJson=G(e);else if(!String(o.value.responseJson||"").trim()){const n=G(e);n&&(o.value.responseJson=n)}Sa(),O.value=!0;try{const n=g.category||"MARKET",s={...o.value,category:n,structuredInput:na()};if(S.value&&(s.appRegion=S.value),o.value.id){const i=await Ga(s,C.value);i.data&&i.data.code===0?(P.success(l("dashboard.llmPromptTemplateFormPage.updateOk")),N("saved",i.data.data??s)):P.error(((t=i.data)==null?void 0:t.msg)||l("dashboard.llmPromptTemplateFormPage.updateFail"))}else{const i=await Ba(s,C.value);if(i.data&&i.data.code===0){P.success(l("dashboard.llmPromptTemplateFormPage.addOk"));const r=i.data.data??{id:i.data.id,name:o.value.name,...s};N("saved",r)}else P.error(((a=i.data)==null?void 0:a.msg)||l("dashboard.llmPromptTemplateFormPage.addFail"))}}catch(n){P.error((n==null?void 0:n.message)||l("dashboard.llmPromptTemplateFormPage.saveFail"))}finally{O.value=!1}}const at=async()=>{var e;try{const t=await Ja({page:0,size:200,status:1},C.value);t.data&&t.data.code===0&&(V.value=Array.isArray((e=t.data.data)==null?void 0:e.content)?t.data.data.content.map(a=>bt(a)):[])}catch{V.value=[]}};function nt(){o.value={id:void 0,name:"",scene:"",promptGroup:"",promptSubgroup:"",modelId:void 0,content:"",status:!0,responseJson:"",documentIds:[],enableThinking:!1,structuredInput:""},I.value=[],W.value=[],M.value=""}const st=E(!1);async function ot(){var t;const e=g.templateId??((t=g.initialData)==null?void 0:t.id);if(e!=null&&e!=="")await wa(String(e));else if(g.initialData&&Object.keys(g.initialData).length>0){Object.assign(o.value,Ue(g.initialData)),Ze();{const a=String(o.value.scene||"").trim();$e(a)}w(()=>{Oe(),B()})}else w(()=>B())}return Da(async()=>{typeof window<"u"&&window.addEventListener(dt,()=>{$.value+=1}),await Ya(),await at(),await Ge.ensureLoaded().catch(()=>{}),await ot(),st.value=!0}),X(()=>[g.templateId,g.copyAsNew,S.value],async()=>{st.value&&(nt(),await w(),await at(),await ot())}),Va(()=>{typeof window<"u"&&window.removeEventListener(dt,()=>{})}),X(L,e=>{e!=null&&e.supportThinking||o.value.enableThinking&&(o.value.enableThinking=!1)},{immediate:!0}),T({submit:Na,submitting:O,resetForm:nt,form:o}),(e,t)=>{const a=un,n=dn,s=ln,i=cn;return y(),b("div",xn,[p(s,{model:o.value,layout:"vertical",class:"modern-form"},{default:z(()=>[c("div",Sn,[p(a,{label:u(l)("dashboard.llmPromptTemplateFormPage.tplName"),name:"name",rules:[{required:!0,message:u(l)("dashboard.llmPromptTemplateFormPage.tplNameRequired")}]},{default:z(()=>[p(le,{modelValue:o.value.name,"onUpdate:modelValue":t[0]||(t[0]=r=>o.value.name=r),placeholder:u(l)("dashboard.llmPromptTemplateFormPage.phTplName"),class:"modern-input"},null,8,["modelValue","placeholder"])]),_:1},8,["label","rules"]),p(a,{label:u(l)("dashboard.llmPromptTemplateFormPage.bindModel"),name:"modelId",rules:[{required:!0,message:u(l)("dashboard.llmPromptTemplateFormPage.bindModelRequired")}]},{default:z(()=>[p(Me,{modelValue:o.value.modelId,"onUpdate:modelValue":t[1]||(t[1]=r=>o.value.modelId=r),placeholder:u(l)("dashboard.llmPromptTemplateFormPage.phBindModel"),class:"modern-select",options:Ot.value,"allow-clear":"","show-search":"","append-to-body":""},null,8,["modelValue","placeholder","options"])]),_:1},8,["label","rules"]),p(a,{label:u(l)("dashboard.llmPromptTemplateFormPage.scene"),name:"scene",rules:[{required:!0,message:u(l)("dashboard.llmPromptTemplateFormPage.sceneRequired")}]},{default:z(()=>[Gt.value?(y(),he(le,{key:1,"model-value":o.value.scene?u(_e)(o.value.scene):o.value.scene,disabled:"",class:"modern-input bg-slate-50"},null,8,["model-value"])):(y(),b("div",Pn,[p(le,{"model-value":o.value.scene?u(_e)(o.value.scene):"",readonly:"",placeholder:u(l)("dashboard.llmPromptTemplateFormPage.phScene"),class:"modern-input flex-1 cursor-pointer !bg-slate-50",onClick:t[2]||(t[2]=r=>ae.value=!0)},null,8,["model-value","placeholder"]),c("button",{type:"button",class:"flex-shrink-0 px-3 py-1.5 rounded-lg border border-slate-200 text-sm text-slate-600 hover:bg-slate-50 hover:border-emerald-300 hover:text-emerald-600 transition-all whitespace-nowrap",onClick:t[3]||(t[3]=r=>ae.value=!0)}," éæ©åºæ¯ ")]))]),_:1},8,["label","rules"]),R.value?(y(),he(a,{key:0,label:"ä¸çº§ä¸å¡åç±»",name:"promptGroup",rules:[{required:!0,message:"è¯·éæ©ä¸çº§ä¸å¡åç±»"}]},{default:z(()=>[p(Me,{modelValue:o.value.promptGroup,"onUpdate:modelValue":t[4]||(t[4]=r=>o.value.promptGroup=r),placeholder:"éæ©çå§ãæ··åªãèå® çä¸å¡",class:"modern-select",options:u(At),"append-to-body":""},null,8,["modelValue","options"])]),_:1})):Y("",!0),R.value?(y(),he(a,{key:1,label:"äºçº§æµç¨ç¯è",name:"promptSubgroup",rules:[{required:!0,message:"è¯·éæ©äºçº§æµç¨ç¯è"}]},{default:z(()=>[p(Me,{modelValue:o.value.promptSubgroup,"onUpdate:modelValue":t[5]||(t[5]=r=>o.value.promptSubgroup=r),placeholder:"éæ©æ
äºæ ¸ãåä¸åæçç¯è",class:"modern-select",options:xt.value,"append-to-body":""},null,8,["modelValue","options"])]),_:1})):Y("",!0)]),c("div",Rn,[c("div",kn,[c("div",Cn,[c("div",On,_(u(l)("dashboard.llmPromptTemplateFormPage.reasoningMode")),1),c("p",wn,_(u(l)("dashboard.llmPromptTemplateFormPage.reasoningModeDesc")),1
31)]),p(n,{checked:o.value.enableThinking,"onUpdate:checked":t[6]||(t[6]=r=>o.value.enableThinking=r),"checked-children":u(l)("dashboard.llmPromptTemplateFormPage.switchOn"),"un-checked-children":u(l)("dashboard.llmPromptTemplateFormPage.switchOff"),disabled:wt.value},null,8,["checked","checked-children","un-checked-children","disabled"])]),c("div",{class:Ne(["mt-3 rounded-xl border px-3 py-2 text-xs leading-5",Je.value?"border-amber-200 bg-amber-50 text-amber-700":o.value.enableThinking?"border-emerald-200 bg-emerald-50 text-emerald-700":"border-slate-200 bg-white text-slate-500"])},_(Nt.value),3)]),p(a,{label:u(l)("dashboard.llmPromptTemplateFormPage.content"),name:"content",rules:[{required:!0,message:u(l)("dashboard.llmPromptTemplateFormPage.contentRequired")}]},{default:z(()=>[c("div",Nn,[c("div",null,[c("div",Mn,_(u(l)("dashboard.llmPromptTemplateFormPage.optimizeTitle")),1),c("p",Ln,_(u(l)("dashboard.llmPromptTemplateFormPage.optimizeDesc")),1)]),c("button",{type:"button",class:"inline-flex items-center gap-2 rounded-lg bg-emerald-600 px-4 py-2 text-sm font-medium text-white transition hover:bg-emerald-700",onClick:fa},[p(u(sn),{size:16}),ut(" "+_(u(l)("dashboard.llmPromptTemplateFormPage.optimizeBtn")),1)])]),c("div",Fn,[c("div",zn,[c("div",Dn,[c("div",{ref_key:"contentEditorRef",ref:U,class:"prompt-content-editor min-h-[500px] p-4 bg-white rounded-lg focus:outline-none focus:ring-2 focus:ring-emerald-500/10 transition-all",contenteditable:"true","data-placeholder":u(l)("dashboard.llmPromptTemplateFormPage.editorPh"),onInput:ya,onCopy:Aa,onCut:xa,onBlur:Ta,onClick:Ea,onKeyup:Ia,onMouseup:ba}
31,null,40,Vn)]),c("aside",Un,[c("div",jn,[c("div",Gn,[c("div",null,[c("div",Bn,_(u(l)("dashboard.llmPromptTemplateFormPage.insertPh")),1),t[17]||(t[17]=c("p",{class:"mt-0.5 text-[11px] text-slate-500"},"ç¹å»åç§°æå
¥å°å½åå
æ ",-1))]),c("span",Jn,_(Re.value.length),1)]),c("div",$n,[p(u(ft),{size:13,class:"pointer-events-none absolute left-3 top-1/2 -translate-y-1/2 text-slate-400"}),p(le,{modelValue:te.value,"onUpdate:modelValue":t[7]||(t[7]=r=>te.value=r),placeholder:u(l)("dashboard.llmPromptTemplateFormPage.phSearchPh"),class:"modern-input placeholder-side-search pl-8 pr-8 text-xs"},null,8,["modelValue","placeholder"]),te.value?(y(),b("button",{key:0,type:"button",class:"absolute right-2 top-1/2 -translate-y-1/2 rounded p-1 text-slate-400 transition-colors hover:bg-slate-100 hover:text-slate-600",onClick:t[8]||(t[8]=r=>te.value="")},[p(u(ht),{size:12})])):Y("",!0)])]),c("div",Kn,[Re.value.length>0?(y(!0),b(ge,{key:0},ve(Re.value,r=>(y(),b("button",{key:`side-ph-${r.key}`,type:"button",class:"placeholder-side-item",onMousedown:Ua(_a,["prevent"]),onClick:m=>ga(r)},[c("span",Wn,_(r.label),1),r.count>0?(y(),b("span",Hn,_(r.count),1)):Y("",!0)],40,Yn))),128)):(y(),b("div",qn,_(u(l)("dashboard.llmPromptTemplateFormPage.noPlaceholderMatch")),1))])])])]),p(Qa,{modelValue:W.value,"onUpdate:modelValue":t[9]||(t[9]=r=>W.value=r),class:"mt-4","final-prompt-preview":ra.value},null,8,["modelValue","final-prompt-preview"])]),_:1},8,["label","rules"]),p(a,{label:u(l)("dashboard.llmPromptTemplateFormPage.tplDocs"),name:"documentIds"},{default:z(()=>[c("div",Xn,[c("div",Zn,[c("div",Qn,[c("span",es,_(u(l)("dashboard.llmPromptTemplateFormPage.docHint")),1),I.value.length>0?(y(),b("span",ts,_(I.value.length),1)):Y("",!0)]),c("button",{onClick:Pa,class:"flex items-center gap-1.5 text-emerald-600 hover:text-emerald-700 transition-colors text-xs font-medium"},[p(u(Z),{size:14}),c("span",null,_(u(l)("dashboard.llmPromptTemplateFormPage.pickFromLibrary")),1)])]),c("div",as,[I.value.length===0?(y(),b("div",ns,[p(u(on),{size:32,class:"mb-2 opacity-20"}),c("p",ss,_(u(l)("dashboard.llmPromptTemplateFormPage.noDocs")),1)])):(y(),b("div",os,[(y(!0),b(ge,null,ve(I.value,(r,m)=>(y(),b("div",{key:r.id||m,class:"flex items-center justify-between p-3 bg-white border border-slate-100 rounded-lg shadow-sm group hover:border-emerald-200 transition-all"},[c("div",rs,[c("div",ls,[(y(),he(ja(Ca(r.name||r.fileName)),{size:16,class:"text-slate-400 group-hover:text-emerald-500"}))]),c("div",is,[c("p",{class:"text-xs font-medium text-slate-700 truncate",title:r.name||r.fileName},_(r.name||r.fileName),9,cs),c("p",us,_(u(l)("dashboard.llmPromptTemplateFormPage.selected")),1)])]),c("button",{onClick:d=>Oa(r,m),class:"p-1.5 text-slate-300 hover:text-red-500 hover:bg-red-50 rounded-md transition-all"},[p(u(ht),{size:14})],8,ds)]))),128))]))])])]),_:1},8,["label"]),p(a,{label:u(l)("dashboard.llmPromptTemplateFormPage.responseJson"),name:"responseJson"},{default:z(()=>[c("div",ms,[c("div",ps,[c("span",fs,_(de.value?u(l)("dashboard.llmPromptTemplateFormPage.jsonHintSystem"):u(l)("dashboard.llmPromptTemplateFormPage.jsonHintEditable")),1),c("button",{class:"flex items-center gap-1.5 text-slate-600 hover:text-slate-900 transition-colors text-xs font-medium flex-shrink-0 whitespace-nowrap",onClick:Oe},[p(u(pn),{size:14}),c("span",null,_(u(l)("dashboard.llmPromptTemplateFormPage.formatJson")),1)])]),p(Xa,{modelValue:o.value.responseJson,"onUpdate:modelValue":t[10]||(t[10]=r=>o.value.responseJson=r),rows:12,readonly:de.value,placeholder:de.value?u(l)("dashboard.llmPromptTemplateFormPage.jsonPhSystem"):u(l)("dashboard.llmPromptTemplateFormPage.jsonPhEditable"),class:"modern-textarea !border-none !rounded-none !bg-slate-50/50 !p-4 !font-mono !text-sm !shadow-none focus-visible:!ring-0"},null,8,["modelValue","readonly","placeholder"])]),M.value?(y(),b("div",hs,[p(u(rn),{size:14}),ut(" "+_(M.value),1)])):Y("",!0)]),_:1},8,["label"]),c("div",gs,[c("div",vs,[c("span",_s,_(u(l)("dashboard.llmPromptTemplateFormPage.statusLabel")),1),c("span",ys,_(u(l)("dashboard.llmPromptTemplateFormPage.statusDesc")),1
31)]),p(n,{checked:o.value.status,"onUpdate:checked":t[11]||(t[11]=r=>o.value.status=r),"checked-children":u(l)("dashboard.llmPromptTemplateFormPage.switchOn"),"un-checked-children":u(l)("dashboard.llmPromptTemplateFormPage.switchOff")},null,8,["checked","checked-children","un-checked-children"])])]),_:1},8,["model"]),p(Za,{visible:ee.value,"onUpdate:visible":t[12]||(t[12]=r=>ee.value=r),multiple:!0,"selected-ids":[],onConfirm:Ra,onCancel:ka},null,8,["visible"]),p(en,{open:be.value,scene:o.value.scene,category:Ye.value,"current-content":o.value.content,"response-json":o.value.responseJson,"preserve-placeholder-keys":qt.value,"available-placeholders":la.value,"app-region":S.value,"onUpdate:open":t[13]||(t[13]=r=>be.value=r),onApply:ha},null,8,["open","scene","category","current-content","response-json","preserve-placeholder-keys","available-placeholders","app-region"]),p(i,{visible:ae.value,"onUpdate:visible":t[15]||(t[15]=r=>ae.value=r),title:"éæ©ä¸å¡åºæ¯",width:1300,footer:null,destroyOnClose:!0},{default:z(()=>[c("div",Ts,[c("div",Es,[p(u(ft),{size:14,class:"pointer-events-none absolute left-3 top-1/2 -translate-y-1/2 text-slate-400"}),p(le,{modelValue:ue.value,"onUpdate:modelValue":t[14]||(t[14]=r=>ue.value=r),placeholder:"æç´¢åºæ¯...",class:"modern-input pl-8"},null,8,["modelValue"])])]),c("div",Is,[(y(!0),b(ge,null,ve(Be.value,r=>(y(),b("div",{key:r.label},[c("div",bs,_(r.label),1),c("div",As,[(y(!0),b(ge,null,ve(r.items,m=>(y(),b("button",{key:m.value,type:"button",class:Ne(["flex flex-col items-start px-3 py-2 rounded-lg border text-left transition-all",o.value.scene===m.value?"bg-emerald-600 text-white border-emerald-600 shadow-sm":"border-slate-200 text-slate-700 hover:border-emerald-300 hover:text-emerald-600 hover:bg-emerald-50"]),onClick:d=>Ct(m.value)},[c("span",Ss,_(m.shortLabel),1),c("span",{class:Ne(["text-[10px] font-mono leading-snug mt-0.5",o.value.scene===m.value?"text-emerald-100":"text-slate-400"])},_(m.value),3)],10,xs))),128))])]))),128)),Be.value.length===0?(y(),b("div",Ps," æªæ¾å°å¹é
çåºæ¯ ")):Y("",!0)])]),_:1},8,["visible"]),p(an,{open:Ae.value,avatars:Rt.value,"selected-id":je.value,title:"éæ©AIèæäººå",description:"éä¸å伿èæäººå ID ç´æ¥æå
¥å°å½åæç¤ºè¯å
æ ä½ç½®ã","onUpdate:open":t[16]||(t[16]=r=>Ae.value=r),onSelect:va},null,8,["open","avatars","selected-id"])])}}});const ws=mn(Os,[["__scopeId","data-v-ca064bcf"]]),io=Object.freeze(Object.defineProperty({__proto__:null,default:ws},Symbol.toStringTag,{value:"Module"}));export{ws as L,io as a,hn as g};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.