uni-answer-sheet 1.0.6 → 2.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,202 @@
1
+ var jM=Object.defineProperty;var Y1=nt=>{throw TypeError(nt)};var AM=(nt,ct,kt)=>ct in nt?jM(nt,ct,{enumerable:!0,configurable:!0,writable:!0,value:kt}):nt[ct]=kt;var cm=(nt,ct,kt)=>AM(nt,typeof ct!="symbol"?ct+"":ct,kt),X1=(nt,ct,kt)=>ct.has(nt)||Y1("Cannot "+kt);var Ut=(nt,ct,kt)=>(X1(nt,ct,"read from private field"),kt?kt.call(nt):ct.get(nt)),K1=(nt,ct,kt)=>ct.has(nt)?Y1("Cannot add the same private member more than once"):ct instanceof WeakSet?ct.add(nt):ct.set(nt,kt),um=(nt,ct,kt,zs)=>(X1(nt,ct,"write to private field"),zs?zs.call(nt,kt):ct.set(nt,kt),kt);var UniAnswerSheet=(function(nt){"use strict";var pt,un;function ct(t,r){for(var i=0;i<r.length;i++){const a=r[i];if(typeof a!="string"&&!Array.isArray(a)){for(const c in a)if(c!=="default"&&!(c in t)){const l=Object.getOwnPropertyDescriptor(a,c);l&&Object.defineProperty(t,c,l.get?l:{enumerable:!0,get:()=>a[c]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}const kt=["pagination","content-identity","choice-fill","answer-regions","html-codec","status"];function zs(t){const r=t.filter(a=>a?.kind==="answer-sheet-editor");if(r.length!==1)throw new Error("请显式注册一个富文本插件:plugins: [createEditorPlugin()]");const i=r[0];if(i.apiVersion!==1||i.documentVersion!==1||kt.some(a=>!i.capabilities?.includes(a))||typeof i.prepare!="function"||typeof i.create!="function"||typeof i.validateDocument!="function"||typeof i.html?.parse!="function"||typeof i.html?.serialize!="function")throw new Error("富文本插件协议不兼容,需要支持制卡协议 v1 的 uni-editor/plugin");return i}function Bs(t){const r=[],i=a=>{if(a.type==="choiceGroup"){typeof a.attrs?.id=="string"&&r.push({id:a.attrs.id,label:a.attrs.label||String(r.length+1),options:(a.content||[]).map((c,l)=>({id:c.attrs?.id,label:String.fromCharCode(65+l)})).filter(c=>typeof c.id=="string")});return}a.content?.forEach(i)};return i(t.content),r}class Wc extends Error{constructor(r,i){super(i),this.path=r}}const $n=(t,r)=>{throw new Wc(t,r)},Hs={语文:"CHINESE",数学:"MATHS",英语:"ENGLISH",科学:"SCIENCE",物理:"PHYSICAL",化学:"CHEMICAL",生物:"BIOLOGICAL",地理:"GEOGRAPHIC",历史:"HISTORY",政治:"POLITICAL",思想政治:"POLITICAL",道德与法治:"POLITICAL",信息科技:"IT",信息技术:"IT",日语:"JAPANESE"},Q1={P:["语文","数学","英语","科学","道德与法治"],J:["语文","数学","英语","物理","化学","生物","地理","历史","道德与法治","信息科技"],S:["语文","数学","英语","物理","化学","生物","政治","历史","地理","信息技术","日语"]},F1=["一年级","二年级","三年级","四年级","五年级","六年级","初一","初二","初三","高一","高二","高三"].map((t,r)=>{const i=r<6?"P":r<9?"J":"S";return{label:t,value:`${i}0${r<6?r+1:(r-6)%3+1}`,classify:i}}),ta=(t,r)=>typeof t=="string"&&t.trim()?t.trim():$n(r,"字典编码和名称必须是非空字符串"),Ps=(t,r)=>t&&typeof t=="object"&&!Array.isArray(t)?t:$n(r,"字典必须是对象"),dm=t=>t.classify||(/^[PJS]/.test(t.value)?t.value[0]:void 0);function Jc(t={}){const r=Ps(t,"dictionaries"),i=(x,S)=>{if(!Array.isArray(x))return $n(S,"字典选项必须是数组");const w=new Set;return x.map((T,j)=>{const R=Ps(T,`${S}.${j}`),O=ta(R.value,`${S}.${j}.value`),M=ta(R.label,`${S}.${j}.label`);return w.has(O)&&$n(`${S}.${j}.value`,"字典编码重复"),w.add(O),{...R,value:O,label:M}})},a=i(r.grades===void 0?F1:r.grades,"dictionaries.grades").map((x,S)=>(x.classify!==void 0&&!["P","J","S"].includes(String(x.classify))&&$n(`dictionaries.grades.${S}.classify`,"学段为 P、J 或 S"),{value:x.value,label:x.label,classify:x.classify})),c=r.gradeCourseMap===void 0?void 0:Ps(r.gradeCourseMap,"dictionaries.gradeCourseMap"),l=r.courseCodeToSubjectCode===void 0?{}:Ps(r.courseCodeToSubjectCode,"dictionaries.courseCodeToSubjectCode");for(const[x,S]of Object.entries(l))ta(S,`dictionaries.courseCodeToSubjectCode.${x}`);const u=new Map,d=Object.fromEntries(a.map(x=>{const S=dm(x),w=(S?Q1[S]:[]).map(R=>({value:Hs[R],label:R,subjectCode:Hs[R]})),T=`dictionaries.gradeCourseMap.${x.value}`,j=i(c?c[x.value]??[]:w,T).map((R,O)=>{const M=l[R.value];R.subjectCode!==void 0&&M!==void 0&&R.subjectCode!==M&&$n(`${T}.${O}.subjectCode`,"课程对应的学科编码冲突");const D=ta(R.subjectCode??M??(Object.values(Hs).includes(R.value)?R.value:void 0),`${T}.${O}.subjectCode`);return u.has(R.value)&&u.get(R.value)!==D&&$n(`${T}.${O}.subjectCode`,"同一课程不能对应不同学科"),u.set(R.value,D),R.custom!==void 0&&typeof R.custom!="boolean"&&$n(`${T}.${O}.custom`,"custom 必须是布尔值"),{value:R.value,label:R.label,subjectCode:D,...R.custom===void 0?{}:{custom:R.custom}}});return[x.value,j]})),m=a.filter(x=>d[x.value].length),p=r.defaultGradeCode===void 0?void 0:ta(r.defaultGradeCode,"dictionaries.defaultGradeCode"),C=m.find(x=>x.value===p)?.value||m[0]?.value||"",g=r.defaultCourseCode===void 0?void 0:ta(r.defaultCourseCode,"dictionaries.defaultCourseCode"),b=d[C]||[],v=b.find(x=>x.value===g)?.value||b[0]?.value||"";return{grades:m,gradeCourseMap:d,defaultGradeCode:C,defaultCourseCode:v}}function hi(t,r,i){const a=t.grades.find(l=>l.value===r);if(!a)return $n("initialization.gradeCode","年级不在可用字典中");const c=t.gradeCourseMap[r]?.find(l=>l.value===i);return c?{grade:a.label,subject:c.label,gradeCode:r,courseCode:i,subjectCode:c.subjectCode,phaseCode:dm(a)}:$n("initialization.courseCode","当前年级没有此课程")}function fm(t,r={}){const a=t.grades.find(u=>u.value===r.gradeCode||!r.gradeCode&&u.label===r.grade)?.value||t.defaultGradeCode,c=t.gradeCourseMap[a]||[],l=c.find(u=>u.value===r.courseCode||!r.courseCode&&u.label===r.subject)?.value||(a===t.defaultGradeCode?t.defaultCourseCode:c[0]?.value)||"";return a&&l?hi(t,a,l):{grade:"",subject:"",gradeCode:"",courseCode:""}}function hm(t){return t?.subjectCode||Hs[t?.subject||""]}const bn={questions:200,options:12,score:15},Z1=t=>t.multiple?t.indefinite?"indefinite":"multiple":"single",Gn=t=>Number.isFinite(t)&&Number.isInteger(t*2),mi=t=>!!(hm(t)==="MATHS"&&(t?.phaseCode?t.phaseCode==="S":t?.gradeCode?t.gradeCode.startsWith("S"):/^高[一二三]/.test(t?.grade||"")));function W1(t){const r=typeof t.score=="number"&&Gn(t.score)&&t.score>=.5&&t.score<=bn.score?t.score:null,i=[...new Set(t.correctIds)].filter(a=>t.options.some(c=>c.id===a));return{...t,indefinite:!!(t.multiple&&t.indefinite),score:r,scoreType:t.multiple&&t.scoreType==="ITEM_SCORE"?"ITEM_SCORE":"LESS_SCORE",lessScore:t.multiple&&r!==null&&Gn(t.lessScore??0)?Math.max(0,Math.min(r,t.lessScore??0)):0,correctIds:t.multiple?i:i.slice(0,1)}}function eu(t,r,i){let a={...t};if(r.kind!==void 0){const c=r.kind!=="single";c&&!t.multiple&&(a.scoreType=mi(i)?"ITEM_SCORE":"LESS_SCORE",typeof a.score!="number"&&mi(i)&&(a.score=6)),a.multiple=c,a.indefinite=r.kind==="indefinite"}if(r.optionCount!==void 0){const c=Math.max(2,Math.min(bn.options,Math.round(r.optionCount)));a.options=Array.from({length:c},(l,u)=>t.options[u]||{id:crypto.randomUUID(),label:String.fromCharCode(65+u)})}return r.score!==void 0&&(a.score=r.score),r.scoreType!==void 0&&(a.scoreType=r.scoreType),r.lessScore!==void 0&&(a.lessScore=r.lessScore),W1(a)}function tu(t){return typeof t.score=="number"&&(!Gn(t.score)||t.score<.5||t.score>bn.score)?"每题分值须为 0.5–15 分,按 0.5 分递增":t.multiple&&t.scoreType==="LESS_SCORE"&&typeof t.score=="number"&&(!Gn(t.lessScore??0)||(t.lessScore??0)<0||(t.lessScore??0)>t.score)?"少选得分须为 0.5 的倍数,且不能超过本题分值":t.multiple&&t.scoreType==="ITEM_SCORE"&&typeof t.score=="number"&&t.correctIds.length&&!Gn(t.score/t.correctIds.length)?"答案个数与分值不匹配,每个正确选项的得分须为 0.5 的倍数":null}function J1(t){return t.multiple&&t.scoreType==="ITEM_SCORE"&&typeof t.score=="number"&&t.correctIds.length&&!tu(t)?t.score/t.correctIds.length:null}function nu(t){const r=t.map(c=>Number(c.label)).filter(c=>Number.isSafeInteger(c)&&c>0&&c<1e5);let i=String(Math.max(0,...r)+1);const a=new Set(t.map(c=>c.label));for(;a.has(i);)i=String(Number(i)+1);return i}function eS(t,r){const i=new Map(t.options.map(a=>[a.id,crypto.randomUUID()]));return{...t,id:crypto.randomUUID(),label:r,breakBefore:!1,contentTarget:null,options:t.options.map(a=>({...a,id:i.get(a.id)})),correctIds:t.correctIds.map(a=>i.get(a)).filter(Boolean)}}function mm(t,r,i){return i.trim()?t.some(a=>a.id!==r&&a.label.trim()===i.trim())?"题组内题号不能重复":null:"题号不能为空"}function tS(t,r,i,a){const c=t.questions.filter(m=>r.includes(m.id));if(!c.length)return{error:"请选择要修改的题目"};let l;if(i.type==="settings"){if(!Object.keys(i.patch).length)return{error:"请设置需要修改的属性"};const{optionCount:m,score:p,lessScore:C}=i.patch;if(m!==void 0&&(!Number.isInteger(m)||m<2||m>bn.options))return{error:"选项个数须为 2–12 的整数"};if(typeof p=="number"&&(!Gn(p)||p<.5||p>bn.score))return{error:"每题分值须为 0.5–15 分,按 0.5 分递增"};if(C!==void 0&&(!Gn(C)||C<0))return{error:"少选得分须为非负的 0.5 倍数"};if(l=c.map(g=>eu(g,i.patch,a)),C!==void 0&&l.some(g=>g.multiple&&g.scoreType!=="ITEM_SCORE"&&C>(g.score??0)))return{error:"少选得分不能超过所选题目的分值"}}else if(i.type==="numbering"){if(!Number.isInteger(i.start)||i.start<1||i.start+c.length-1>1e3)return{error:"连续题号须在 1–1000 内"};l=c.map((m,p)=>({...m,label:String(i.start+p)}))}else if(i.type==="average"){const m=i.total/c.length;if(!Gn(m)||m<.5||m>bn.score)return{error:"总分无法平均分配,每题须为 0.5–15 分且为 0.5 的倍数"};l=c.map(p=>eu(p,{score:m}))}else{const m=i.text.toUpperCase().trim().split(/[\s,,;;]+/).filter(Boolean);if(m.length!==c.length)return{error:`需要 ${c.length} 组答案,当前为 ${m.length} 组`};l=[];for(let p=0;p<c.length;p++){const C=c[p],g=m[p];if(g!=="-"&&(!/^[A-T]+$/.test(g)||new Set(g).size!==g.length||[...g].some(v=>!C.options.some(x=>x.label===v))))return{error:`第 ${C.label} 题包含无效或重复选项`};const b=g==="-"?[]:[...g].map(v=>C.options.find(x=>x.label===v).id);if(!C.multiple&&b.length>1)return{error:`第 ${C.label} 题为单选,只能设置一个答案`};l.push({...C,correctIds:b})}}const u=new Map(l.map(m=>[m.id,m])),d=t.questions.map(m=>u.get(m.id)||m);for(const m of l){const p=mm(d,m.id,m.label)||tu(m);if(p)return{error:`第 ${m.label} 题:${p}`}}return{value:{...t,questions:d}}}const nS={layout:"natural",columns:2,indent:!1,rowGap:0,columnGap:32,marker:"letter"},ru=t=>`question:${t}`,ou=t=>t.presentation==="stem"?"stem":["option","distributed"].includes(t.presentation)?"option":"concentrated";function au(t,r,i){const a=Bs(r),c=new Map,l=(d,m)=>{const p=d.attrs?.contentId||m;d.type==="choiceGroup"&&p&&c.set(d.attrs.id,p),d.content?.forEach(C=>l(C,p))};l(r.content);const u=new Set(t.questions.map(d=>d.contentTarget?.groupId));return{...t,presentation:i,questions:t.questions.map((d,m)=>{const p=a.find(C=>c.get(C.id)===d.id)||(c.size?void 0:a[m]);return i==="concentrated"||d.contentTarget!==void 0||!p||u.has(p.id)?d:(u.add(p.id),{...d,contentTarget:{groupId:p.id,optionIds:p.options.map(C=>C.id)}})})}}function na(t,r,i){const a=ou(t),c=new Map(Bs(r).map(b=>[b.id,b])),l=new Set,u=new Map,d=new Map,m=(b,v)=>{const x=b.attrs?.contentId||v;b.type==="choiceGroup"&&x&&(u.set(x,[...u.get(x)||[],b.attrs.id]),d.set(b.attrs.id,x)),b.type==="choiceStemAnchor"&&typeof b.attrs?.groupId=="string"&&l.add(b.attrs.groupId),b.content?.forEach(S=>m(S,x))};m(r.content);const p=[],C=new Set,g=t.questions.filter(b=>{if(!i||a==="concentrated")return!0;if(a==="stem"&&l.has(ru(b.id)))return p.push({groupId:ru(b.id),questionId:b.id,options:b.options.map(j=>({...j,contentOptionId:j.id}))}),!1;const v=u.get(b.id),x=v?.length===1?c.get(v[0]):void 0,S=x?{groupId:x.id,optionIds:x.options.map(j=>j.id)}:b.contentTarget,w=S&&c.get(S.groupId);if(!S||!w||C.has(w.id)||a==="stem"&&!l.has(w.id)||d.has(w.id)&&d.get(w.id)!==b.id)return!0;const T=S.optionIds.slice(0,b.options.length);return T.length!==b.options.length||new Set(T).size!==T.length||T.some(j=>!w.options.some(R=>R.id===j))?!0:(C.add(w.id),p.push({groupId:w.id,questionId:b.id,options:b.options.map((j,R)=>({...j,contentOptionId:T[R]}))}),!1)});return{position:a==="concentrated"?void 0:a,bindings:p,concentrated:{...t,questions:g}}}function ra(t,r=4){return{id:crypto.randomUUID(),label:String(t+1),multiple:!1,indefinite:!1,score:null,scoreType:"LESS_SCORE",lessScore:0,correctIds:[],breakBefore:!1,options:Array.from({length:r},(i,a)=>({id:crypto.randomUUID(),label:String.fromCharCode(65+a)}))}}function iu(t=8){return{source:"manual",presentation:"concentrated",direction:"row",rowsPerColumn:5,marker:"box",rowGap:0,columnGap:0,questions:Array.from({length:t},(r,i)=>ra(i))}}function su(t){return new Set(t.questions.map(r=>r.options.length)).size>1?"column":t.direction}function rS(t){const r=[];for(const i of t.questions){const a=r.at(-1);(!a||a.length>=t.rowsPerColumn||i.breakBefore||a[0].options.length!==i.options.length)&&r.push([]),r[r.length-1].push(i)}return r}function oS(t){const r=[];for(const i of rS(t))(!r.length||i[0].breakBefore)&&r.push([]),r[r.length-1].push(i);return r}const aS={judge:"判断题",fill:"填空题",answer:"解答题",calculation:"计算/证明",matching:"信息匹配/连线",ordering:"排序/分类",correction:"改错题",drawing:"作图题",table:"表格填答",writing:"语文作文",english:"外语写作",reading:"阅读理解",cloze:"完形填空",completion:"语法填空",chunk:"断句题",composite:"材料/复合题",optional:"选做题组",practice:"实践评价"},iS={choice:"选择",judge:"判断",fill:"填空",answer:"简答",calculation:"计算/证明",correction:"改错",drawing:"作图",table:"表格",writing:"作文",english:"外语写作"},pm=["reading","cloze","completion","composite","optional"],$t=()=>({version:1,content:{type:"doc",content:[{type:"paragraph"}]}}),gm={symbols:["√","×"],letters:["T","F"],words:["正确","错误"]},Us=t=>["writing","english"].includes(t)?70:["answer","calculation","drawing","table","correction"].includes(t)?60:15,ym=t=>t==="judge"?200:t==="fill"?50:["reading","cloze","completion"].includes(t)?20:t==="matching"?9:100;function bm(t=0){return{id:crypto.randomUUID(),label:String(t+1),width:50,style:"line",characters:6,score:null,answers:[],prefix:"",suffix:"",breakAfter:!1}}function lu(t,r="1"){const i=crypto.randomUUID();return{id:i,label:r,kind:t,document:$t(),reference:$t(),explanation:$t(),score:null,choice:{...ra(0,t==="judge"?2:4),id:i,label:r},presentation:"concentrated",blanks:[bm()],steps:[],needsReason:!1,judgment:null,targets:[],area:{style:t==="writing"?"characters":t==="english"?"lines":t==="drawing"?"grid":"blank",rows:t==="writing"?20:6,columns:20,rowHeight:t==="writing"?40:28,wordMark:100,title:!1,backgroundUrl:""}}}function cu(t){return["reading","cloze","chunk"].includes(t)?"choice":["matching","completion"].includes(t)?"fill":["ordering","composite","optional","practice"].includes(t)?"answer":t}function sS(t){return{items:[lu(cu(t))],judgeLabels:"symbols",fillNewLine:!0,pool:[],relation:"one",reuseOptions:!0,matchingDisplay:"letters",ordering:"sequence",sequence:[],categories:[],assignments:{},chooseCount:1,groupScore:null,chunkText:"",chunkPoints:[],chunkCorrect:[],chunkMax:3,chunkScore:null,attachmentUrl:""}}function Ir(t){return String(Math.max(0,...t.map(r=>/^\d+$/.test(r.label)?Number(r.label):0))+1)}function vo(t){const r=structuredClone(t),i=new Map,a=l=>{!l||typeof l!="object"||Object.entries(l).forEach(([u,d])=>{["id","answerId"].includes(u)&&typeof d=="string"?i.set(d,crypto.randomUUID()):a(d)})};a(r);const c=l=>typeof l=="string"?i.get(l)||l:Array.isArray(l)?l.map(c):l&&typeof l=="object"?Object.fromEntries(Object.entries(l).map(([u,d])=>[i.get(u)||u,c(d)])):l;return c(r)}function lS(t,r){const i=vo(t);return{...i,label:r,choice:{...i.choice,label:r}}}function oa(t,r,i){const a=t.findIndex(u=>u.id===r),c=a+i;if(a<0||c<0||c>=t.length)return t;const l=[...t];return l.splice(c,0,...l.splice(a,1)),l}function cS(t,r){return{...t,pool:t.pool.filter(i=>i.id!==r),sequence:t.sequence.filter(i=>i!==r),assignments:Object.fromEntries(Object.entries(t.assignments).filter(([i])=>i!==r)),items:t.items.map(i=>({...i,targets:i.targets.filter(a=>a!==r)}))}}function uS(t,r,i){const a=[...new Set(i)].filter(l=>t.pool.some(u=>u.id===l)),c=t.relation==="one"?a.slice(-1):a;return{...t,items:t.items.map(l=>l.id===r?{...l,targets:c}:t.reuseOptions?l:{...l,targets:l.targets.filter(u=>!c.includes(u))})}}function dS(t,r){let i=0;for(;i<r.length&&i<t.chunkText.length&&r[i]===t.chunkText[i];)i++;let a=0;for(;a<r.length-i&&a<t.chunkText.length-i&&r[r.length-1-a]===t.chunkText[t.chunkText.length-1-a];)a++;const c=t.chunkText.length-a,l=new Set,u=t.chunkPoints.filter(d=>d.offset<=i||d.offset>=c).map(d=>({...d,offset:d.offset<=i?d.offset:d.offset+r.length-t.chunkText.length})).filter(d=>d.offset<=0||d.offset>=r.length||l.has(d.offset)?!1:(l.add(d.offset),!0));return{...t,chunkText:r,chunkPoints:u,chunkCorrect:t.chunkCorrect.filter(d=>u.some(m=>m.id===d))}}function fS(t,r){const i=[],a=t.items.map(c=>c.label.trim());(a.some(c=>!c)||new Set(a).size!==a.length)&&i.push("题号不能为空或重复");for(const c of t.items){c.score!==null&&(!Number.isFinite(c.score)||c.score<.5||c.score>Us(c.kind)||!Number.isInteger(c.score*2))&&i.push(`${c.label} 题分值超出范围或不是 0.5 的倍数`);const u=(c.kind==="fill"?c.blanks:c.steps).map(d=>d.score);u.length&&c.score!==null&&u.every(d=>d!==null)&&u.reduce((d,m)=>d+(m||0),0)!==c.score&&i.push(`${c.label} 题分项分值之和与题分不一致`)}if(["matching","ordering"].includes(r)){const c=t.pool.map(l=>l.label.trim());(c.some(l=>!l)||new Set(c).size!==c.length)&&i.push("共享选项编号不能为空或重复")}return r==="optional"&&t.chooseCount>t.items.length&&i.push("选做数量不能超过题目数量"),r==="chunk"&&t.chunkCorrect.length>t.chunkMax&&i.push("正确断点数不能超过最多选择数"),i}function hS(t=3,r=3){return{version:1,content:{type:"doc",content:[{type:"table",content:Array.from({length:t},()=>({type:"tableRow",content:Array.from({length:r},()=>({type:"tableCell",content:[{type:"paragraph"}]}))}))}]}}}function xn(t){const r=i=>!!(i.text||i.type&&!["doc","paragraph","choiceStemAnchor"].includes(i.type)||i.content?.some(r));return!r(t.content)}const xm={choice:"选择题",area:"空白区域",...aS};function mS(t){return{id:crypto.randomUUID(),kind:"area",areaType:t,title:t==="forbiden"?"禁止答题区":"空白答题区",answerHeight:t==="forbiden"?100:200,document:{version:1,content:{type:"doc",content:t==="forbiden"?["请勿在此区域作答","或者做任何标记"].map(r=>({type:"paragraph",attrs:{textAlign:"center",lineSpacing:0},content:[{type:"text",text:r}]})):[{type:"paragraph"}]}}}}function vm(){return{version:1,title:"",questionCard:!1,preset:"a3-two",margin:15,gap:10,blocks:[]}}function pS(t=""){return{id:crypto.randomUUID(),height:70,document:{version:1,content:{type:"doc",content:[{type:"paragraph",attrs:{textAlign:"center",lineSpacing:9},...t?{content:[{type:"text",text:t,marks:[{type:"textStyle",attrs:{fontFamily:"SimSun, 宋体, serif",fontSize:"22px"}}]}]}:{}}]}}}}function uu(t){return{...vm(),title:t.name,creation:t,paperTitle:pS(t.name),header:{focusText:!0,writeKaohao:!1,missExam:!1,mifeng:!1,kaohao:"school",weishu:8}}}function So(t,r=96){return t*r/25.4}const pi={a4:{label:"A4 单栏",width:210,height:297,columns:1},"a3-two":{label:"A3 双栏",width:420,height:297,columns:2},"a3-three":{label:"A3 三栏",width:420,height:297,columns:3}},Co=44,gi=16;function du(t,r){const i=pi[t.preset],a=So(i.width),c=So(i.height),l=So(t.margin),u=So(t.gap),d=t.usage!=="homework"&&t.header?.mifeng?So(t.header.kaohao==="code"?26:14):0,m=a-l*2-d,p=(m-u*(i.columns-1))/i.columns,C=Math.max(l,t.header?t.recognition?.examQrCode?64:39:0),g=Math.max(l,t.header?56:0),b=c-C-g,v=b-gi,x=t.header?p:m,S=r&&r.id===t.paperTitle?.id&&Math.abs(r.width-x)<1?r:void 0,w=t.paperTitle?Math.min(b,S?.height??t.paperTitle.height+(t.header?260:gi)):0,T=(M,D=0)=>!!t.paperTitle&&(t.header?M%2===0&&D===0:M===0),j=(M,D=0)=>T(M,D)?w:0;return{...i,width:a,height:c,margin:l,topInset:C,bottomInset:g,gap:u,sealWidth:d,contentWidth:m,contentHeight:b,columnWidth:p,columnX:(M,D)=>l+(M%2===0?d:0)+D*(p+u),titleWidth:x,titleMaxHeight:v,hasHeader:T,headerHeight:j,capacity:(M,D=0)=>b-j(M,D)}}function gS(t,r,i){const a=du(t,i);let c=0,l=0,u=0;const d=()=>{l++,l===a.columns&&(l=0,c++),u=0},m=t.blocks.map(C=>{const g=r[C.id],b=g&&Math.abs(g.width-a.columnWidth)<1?g.height:100+C.answerHeight,v=g&&Math.abs(g.width-a.columnWidth)<1?[...new Set([...g.breaks||[],b].filter(O=>Number.isFinite(O)&&O>0&&O<=b))].sort((O,M)=>O-M):[],x=C.reference?.type==="CCOMPOSITION",S=O=>x&&O>0?Math.max(0,6-Math.max(0,(g?.compositionStart||0)-O)):0;if(v.length>1&&v.every((O,M)=>{const D=v[M-1]||0;return O-D+S(D)<=a.capacity(1)+.5})){const O=[];let M=0;for(;M<b-.5;){const _=a.capacity(c,l)-u,I=M,z=S(M),H=Y=>g?.markingFrames?.some(U=>U.from>=I-.5&&U.from<Y-.5&&U.to>Y+.5)?22:0,L=v.filter(Y=>Y>I+.5&&Y+H(Y)<=I+_-z+.5).at(-1);if(L===void 0){d();continue}const $=x&&L<b-.5?Math.max(H(L),_-z-(L-M)):H(L);O.push({page:c,column:l,x:a.columnX(c,l),y:c*(a.height+Co)+a.topInset+a.headerHeight(c,l)+u,from:M,to:L,...z?{topPadding:z}:{},...$?{bottomPadding:$}:{}}),u+=L-M+z,M=L,M<b-.5&&d()}u+=gi;const D=O[0];return{id:C.id,...D,height:b,available:a.capacity(D.page,D.column),overflowing:!1,fragments:O}}for(;u+b>a.capacity(c,l)+.5&&(u>0||a.headerHeight(c,l)>0);)d();const T=a.capacity(c,l),j=b>T+.5,R={id:C.id,page:c,column:l,x:a.columnX(c,l),y:c*(a.height+Co)+a.topInset+a.headerHeight(c,l)+u,height:b,available:T,overflowing:j,fragments:[{page:c,column:l,x:a.columnX(c,l),y:c*(a.height+Co)+a.topInset+a.headerHeight(c,l)+u,from:0,to:Math.min(b,T)}]};return u+=Math.min(b,T)+gi,R}),p=new Map;return m.forEach((C,g)=>C.fragments.forEach(b=>{const v=`${b.page}/${b.column}`,x=p.get(v)||[];x.push({fragment:b,placement:C,blockIndex:g}),p.set(v,x)})),p.forEach(C=>{const g=C.filter(S=>["answer","writing","english","composite","area"].includes(t.blocks[S.blockIndex].kind)).at(-1);if(!g||t.blocks[g.blockIndex].reference?.type!=="CCOMPOSITION"&&t.blocks[g.blockIndex].kind!=="area")return;const b=C.at(-1).fragment,x=b.page*(a.height+Co)+a.height-a.bottomInset-b.y-(b.to-b.from)-(b.topPadding||0)-(b.bottomPadding||0);x<=0||x>30||(g.fragment.bottomPadding=(g.fragment.bottomPadding||0)+x,C.slice(C.indexOf(g)+1).forEach(({fragment:S,placement:w})=>{S.y+=x,w.fragments[0]===S&&(w.y=S.y)}))}),{geometry:a,placements:m,pageCount:c+1}}function yi(t,r){return{version:1,content:{type:"doc",content:[{type:"paragraph",content:[{type:"text",text:`${t}.`,marks:[{type:"documentLabel",attrs:{kind:"number"}}]},...r?[{type:"text",text:`(${r}分)`,marks:[{type:"documentLabel",attrs:{kind:"score"}}]}]:[]]}]}}}function vn(t,r,i){const a=c=>{if(!c.content)return c;let l;const u=c.content.flatMap(m=>{const p=m.type==="text"&&m.marks?.find(b=>b.type==="documentLabel")?.attrs?.kind,C=p&&p===l;if(l=p,C)return[];if(!p)return[a(m)];const g=p==="number"?`${r}.`:i?`(${i}分)`:"";return g?[{...m,text:g}]:[]}),d=u.findIndex(m=>m.marks?.some(p=>p.type==="documentLabel"&&p.attrs?.kind==="number"));return i&&d>=0&&!u.some(m=>m.marks?.some(p=>p.type==="documentLabel"&&p.attrs?.kind==="score"))&&u.splice(d+1,0,{type:"text",text:`(${i}分)`,marks:[{type:"documentLabel",attrs:{kind:"score"}}]}),{...c,content:u}};return{...t,content:a(t.content)}}const nr={SCHOICE:"单选题",MCHOICE:"多选题",JUDGE:"判断题",FILLBLANK:"填空题",SHORTANSWER:"解答题",MIXED:"复合题",CLOZE:"完形填空",READTHENANSWER:"阅读理解",INFO_MATCHING:"信息匹配",TEXT_COMPLETION:"语法填空",ECOMPOSITION:"英语作文",CCOMPOSITION:"语文作文",CHUNK_CHOICE:"断句题"},Sm=["SCHOICE","MCHOICE","JUDGE","FILLBLANK","SHORTANSWER","MIXED"];function Cm(t,r=!1){const i=hm(t),a=r?Sm.filter(c=>c!=="MIXED"):Sm;return r?["CHINESE","JAPANESE"].includes(i||"")?[...a,"CHUNK_CHOICE"]:a:i==="CHINESE"?[...a,"CCOMPOSITION","CHUNK_CHOICE"]:i==="ENGLISH"?[...a,"CLOZE","READTHENANSWER","INFO_MATCHING","TEXT_COMPLETION","ECOMPOSITION"]:i==="JAPANESE"?Object.keys(nr):["POLITICAL","HISTORY"].includes(i||"")?[...a,"CCOMPOSITION"]:a}const yS=t=>["CLOZE","READTHENANSWER","INFO_MATCHING","TEXT_COMPLETION"].includes(t),bS=t=>["SCHOICE","MCHOICE","CLOZE","READTHENANSWER","INFO_MATCHING","JUDGE"].includes(t),kr=t=>({version:1,content:{type:"doc",content:t.length?t:[{type:"paragraph"}]}});function bi(t,r,i=!1){return{content:$t(),numbered:!i,groupId:`options:${r.id}`,layout:{...nS,columns:t==="CLOZE"?4:2,...t==="READTHENANSWER"?{layout:"fixed",columnGap:0}:{}},itemsContent:!i&&bS(t)?r.options.map(a=>({id:a.id,key:a.label,content:$t()})):[]}}const $s=t=>{if(t.type==="choiceStemAnchor"||t.type==="text"&&t.marks?.some(a=>a.type==="documentLabel"&&a.attrs?.kind==="number"))return null;const{contentId:r,...i}=t.attrs||{};return{...t,...t.attrs?{attrs:i}:{},...t.content?{content:t.content.map($s).filter(a=>a!==null)}:{}}};function Gs(t,r,i){const c=(t.content.content.content||[{type:"paragraph"}]).map(l=>({...l,attrs:{...l.attrs,contentId:r}}));if(t.numbered){const l={type:"text",text:`${i}.`,marks:[{type:"documentLabel",attrs:{kind:"number"}}]};["paragraph","heading"].includes(c[0]?.type||"")||c.unshift({type:"paragraph",attrs:{contentId:r},content:[]}),c[0]={...c[0],content:[l,...c[0].content||[]]}}return t.itemsContent.length&&c.push({type:"choiceGroup",attrs:{id:t.groupId,contentId:r,...t.layout},content:t.itemsContent.map(l=>({type:"choiceOption",attrs:{id:l.id,label:l.key,sourceKey:l.key,marker:"letter"},content:l.content.content.content||[{type:"paragraph"}]}))}),c}function wm(t,r){const i=r.filter(d=>d.type==="choiceGroup"),a=i.find(d=>d.attrs?.id===t.groupId)||(i.length===1?i[0]:void 0),c=r.filter(d=>d!==a);let l=!1;const u=d=>{d.marks?.some(m=>m.type==="documentLabel"&&m.attrs?.kind==="number")&&(l=!0),d.content?.forEach(u)};return c.forEach(u),{...t,numbered:l,content:kr(c.map($s).filter(d=>d!==null)),groupId:a?.attrs?.id||t.groupId,layout:a?Object.fromEntries(Object.entries(t.layout).map(([d,m])=>[d,a.attrs?.[d]??m])):t.layout,itemsContent:(a?.content||[]).map((d,m)=>({id:d.attrs?.id||t.itemsContent[m]?.id||crypto.randomUUID(),key:d.attrs?.label||String.fromCharCode(65+m),content:kr((d.content||[]).map($s).filter(p=>p!==null))}))}}function Em(t,r,i,a){const c=new Map;r.content.content?.forEach(d=>{d.attrs?.contentId&&c.set(d.attrs.contentId,[...c.get(d.attrs.contentId)||[],d])});const l=new Set(a?.content.content?.map(d=>d.attrs?.contentId).filter(Boolean)),u=(d,m)=>m&&(c.has(d)||l.has(d))?wm(m,c.get(d)||[]):m;return{...t,...c.has(i)?{material:kr(c.get(i).map(d=>$s(d)))}:{},questions:t.questions.map(d=>({...d,text:u(d.id,d.text),parts:d.parts.map(m=>({...m,text:u(m.id,m.text)}))}))}}function fu(t){const r=t.reference,i=[];r.type==="MIXED"&&i.push(...(r.material||$t()).content.content.map(c=>({...c,attrs:{...c.attrs,contentId:t.id}}))),r.questions.forEach(c=>{c.text&&i.push(...Gs(c.text,c.id,c.label)),yS(c.type)&&c.parts.forEach(l=>{l.text&&i.push(...Gs(l.text,l.id,l.label))})});const a=(t.document.content.content||[]).filter(c=>!c.attrs?.contentId);return xn(kr(a))||i.push(...a),kr(i)}function xS(t,r){const i=(a,c,l)=>!a||!l||c.options.map(u=>u.id).join()===l.options.map(u=>u.id).join()?a:{...a,itemsContent:c.options.map(u=>({...a.itemsContent.find(d=>d.id===u.id),id:u.id,key:u.label,content:a.itemsContent.find(d=>d.id===u.id)?.content||$t()}))};return{...t,questions:t.questions.map(a=>{const c=r.questions.find(l=>l.id===a.id);return{...a,text:i(a.text,a.choice,c?.choice),parts:a.parts.map(l=>({...l,text:i(l.text,l.choice,c?.parts.find(u=>u.id===l.id)?.choice)}))}})}}function vS(t,r,i){if(t.reference?.textVersion!==1)return t;let a=t.reference;if(!r&&!xn(t.document)&&!t.document.content.content?.some(l=>l.attrs?.contentId))return{...t,reference:{...a,textVersion:void 0}};if(r?.reference===a&&r.document===t.document&&!xn(t.document))return t;if(t.document!==r?.document&&(!xn(t.document)||r)&&(a=Em(a,t.document,t.id,r?.document),r&&t.reference===r.reference))return{...t,reference:a};r?.reference&&t.reference!==r.reference&&(a=xS(a,r.reference));const c={...t,reference:a};return i||!xn(t.document)?{...c,document:fu(c)}:c}const aa={SCHOICE:{count:200,options:[2,12],parts:1,score:15},MCHOICE:{count:200,options:[2,12],parts:1,score:15},JUDGE:{count:200,options:[2,2],parts:1,score:15},CHUNK_CHOICE:{count:100,options:[2,26],parts:1,score:10},FILLBLANK:{count:50,options:[0,0],parts:20,score:15},SHORTANSWER:{count:100,options:[0,0],parts:10,score:60},CLOZE:{count:20,options:[4,4],parts:20,score:15},READTHENANSWER:{count:20,options:[2,12],parts:20,score:15},INFO_MATCHING:{count:20,options:[1,9],parts:9,score:15},TEXT_COMPLETION:{count:20,options:[0,0],parts:20,score:15},CCOMPOSITION:{count:1,options:[0,0],parts:1,score:70},ECOMPOSITION:{count:1,options:[0,0],parts:1,score:70}},wt=t=>["SCHOICE","MCHOICE","JUDGE","CHUNK_CHOICE","CLOZE","READTHENANSWER","INFO_MATCHING"].includes(t),Le=t=>["CLOZE","READTHENANSWER","INFO_MATCHING","TEXT_COMPLETION"].includes(t),xi=t=>t==="FILLBLANK"||t==="TEXT_COMPLETION",vi=t=>t==="CCOMPOSITION"||t==="ECOMPOSITION",SS={SCHOICE:"choice",MCHOICE:"choice",JUDGE:"judge",FILLBLANK:"fill",SHORTANSWER:"answer",MIXED:"composite",CLOZE:"cloze",READTHENANSWER:"reading",INFO_MATCHING:"matching",TEXT_COMPLETION:"completion",ECOMPOSITION:"english",CCOMPOSITION:"writing",CHUNK_CHOICE:"chunk"};function hu(t){return{type:t,textVersion:1,questions:[],layout:iu(0),fillNewLine:!1,optional:!1,choose:1,optionalHeight:200,scoreType:"LESS_SCORE"}}function Tm(t){return{id:crypto.randomUUID(),kind:SS[t],title:nr[t],answerHeight:0,document:$t(),reference:hu(t)}}function mu(t,r=1,i){const a=t==="MCHOICE"&&mi(i);return{type:t,start:r,end:r,optionCount:t==="INFO_MATCHING"?null:t==="CHUNK_CHOICE"?12:t==="JUDGE"?2:4,partCount:Le(t)?null:1,score:a?6:null,scoreType:a?"ITEM_SCORE":"LESS_SCORE",lessScore:0,characters:1e3,lines:10,rightAnswers:null,singleScore:1}}function ia(t,r,i){const a=Array.from({length:i},(c,l)=>({...t.options[l]||{id:crypto.randomUUID()},label:r==="JUDGE"?["T","F"][l]:String.fromCharCode(65+l)}));return{...t,options:a,multiple:r==="MCHOICE"||r==="CHUNK_CHOICE",indefinite:!1,correctIds:t.correctIds.filter(c=>a.some(l=>l.id===c)).slice(0,r==="MCHOICE"||r==="CHUNK_CHOICE"?i:1)}}function Si(t,r,i,a=4){const c=crypto.randomUUID(),l={...ia(ra(0),i,a),id:c,label:t,score:r};return{id:c,label:t,score:r,width:25,breakAfter:!1,height:100,document:i==="SHORTANSWER"?yi(t,r):$t(),choice:l,...Le(i)&&i!=="TEXT_COMPLETION"?{text:bi(i,l)}:{}}}function pu(t,r){const i=crypto.randomUUID(),{type:a,score:c}=t,l=String(r),u=t.partCount||1,d=Array.from({length:Le(a)||["FILLBLANK","SHORTANSWER"].includes(a)?u:0},(p,C)=>Si(Le(a)?String(r+C):u===1?l:`${l}.${C+1}`,c,a,t.optionCount||4)),m={...ia(ra(0),a,t.optionCount||4),id:i,label:l,score:c,scoreType:t.scoreType,lessScore:t.lessScore};return{id:i,type:a,label:l,score:d.length?Vn(d):c,choice:m,text:bi(a,m,Le(a)),parts:d,document:a==="ECOMPOSITION"?{version:1,content:{type:"doc",content:[...yi(l,c).content.content,...jS(t.lines,t.paperWidth||600).content.content]}}:a==="CCOMPOSITION"?yi(l,c):$t(),height:a==="ECOMPOSITION"?50*t.lines+40:100,contentHeight:38,characters:t.characters,lines:t.lines,halfPoint:!1,rightAnswers:t.rightAnswers,singleScore:t.singleScore}}const Vn=t=>t.some(r=>r.score===null)?null:t.reduce((r,i)=>r+(i.score||0),0);function gu(t){return t.questions.flatMap(r=>Le(r.type)?r.parts.map(i=>i.label):[r.label])}function Vs(t){return Math.max(0,...gu(t).map(Number).filter(Number.isFinite))+1}function CS(t,r,i=!1,a=!1){const c=aa[r.type],l=vi(r.type)?1:r.end-r.start+1;if(!Number.isInteger(r.start)||r.start<1||r.end>1e3||!Number.isInteger(l)||l<1||l>c.count)return`题号须为 1–1000,单次题数为 1–${c.count}`;if(t.type==="CCOMPOSITION"&&t.questions.length)return"语文作文每组只能有一道题";if(t.optional)return"选做题组不能追加题目";const u=gu(t);if(Array.from({length:l},(d,m)=>String(r.start+m)).some(d=>u.includes(d)))return"同一分组内,题号不能重复";if(wt(r.type)&&(r.optionCount===null||!Number.isInteger(r.optionCount)||r.optionCount<c.options[0]||r.optionCount>c.options[1]))return`选项个数须为 ${c.options[0]}–${c.options[1]}`;if((Le(r.type)||["FILLBLANK","SHORTANSWER"].includes(r.type))&&(!r.partCount||!Number.isInteger(r.partCount)||r.partCount<1||r.partCount>c.parts))return`子题/空数须为 1–${c.parts}`;if(Le(r.type)&&l%r.partCount!==0)return"题目数量无法按子题数量均分,请重新设置";if(r.type==="INFO_MATCHING"&&r.partCount>r.optionCount)return"选项个数需大于等于子题数量";if(r.type==="SHORTANSWER"&&(i||t.optional)&&r.partCount!==1)return"网阅或选做题不支持小题";if(r.score!==null&&(!Number.isFinite(r.score)||r.score<(a?0:.5)||r.score>c.score||!Number.isInteger(r.score*2)))return`分值须为 ${a?0:.5}–${c.score} 分,按 0.5 分递增`;if(r.type==="MCHOICE"&&(r.lessScore<0||!Number.isInteger(r.lessScore*2)||r.lessScore>(r.score||0)))return"少选得分不能超过本题分值";if(r.type==="CHUNK_CHOICE"){if(!r.rightAnswers||!Number.isInteger(r.rightAnswers)||r.rightAnswers>=r.optionCount)return"正确答案个数需小于选项个数";if(r.singleScore===null||r.singleScore<.5||!Number.isInteger(r.singleScore*2)||r.score!==null&&r.score!==0&&r.singleScore*r.rightAnswers>r.score)return"每处得分乘以正确答案个数不可大于每题分数"}return r.type==="CCOMPOSITION"&&(!Number.isInteger(r.characters)||r.characters<1||r.characters>1200)?"作文格数须为 1–1200":r.type==="ECOMPOSITION"&&(!Number.isInteger(r.lines)||r.lines<1||r.lines>100)?"作文行数须为 1–100":r.score===null?"请输入分值":null}function wS(t,r,i){const a=Le(r.type)?r.partCount:1,c=[];for(let d=r.start;d<=(vi(r.type)?r.start:r.end);d+=a)c.push(pu(r,d));const l=[...t.questions],u=l.findIndex(d=>d.id===i||d.parts.some(m=>m.id===i));return l.splice(u<0?l.length:u+1,0,...c),{...t,questions:l}}function qs(t){return t.questions.flatMap(r=>[r,...r.parts])}function sa(t){return t.questions.filter(r=>wt(r.type)).flatMap(r=>Le(r.type)?r.parts.map(i=>({...i.choice,label:i.label,score:i.score})):[{...r.choice,label:r.label,score:r.score}])}function ES(t,r){const i=vo(t);return i.referenceData&&(i.referenceData={...i.referenceData,questionId:i.id}),i.text&&(i.text.groupId=`options:${i.id}`),i.label=String(r),i.choice.label=i.label,i.choice.contentTarget=null,i.choice.breakBefore=!1,i.parts.forEach((a,c)=>{a.label=Le(i.type)?String(r+c):i.parts.length===1?i.label:`${r}.${c+1}`,a.choice.label=a.label,a.choice.contentTarget=null,a.choice.breakBefore=!1}),i.parts.forEach(a=>{a.text&&(a.text.groupId=`options:${a.id}`),a.referenceData&&(a.referenceData={...a.referenceData,questionId:a.id,questionPid:i.id})}),i.document=vn(i.document,i.label,i.score),i.parts=i.parts.map(a=>({...a,document:vn(a.document,a.label,a.score)})),i}function TS(t){return Math.max(1,Math.floor((t-6)/31))}function jS(t,r){return{version:1,content:{type:"doc",content:Array.from({length:t},()=>({type:"paragraph",attrs:{fixedLineHeight:45.35433070866142},content:[{type:"text",text:" ".repeat(Math.max(1,Math.floor((r-24)/3))),marks:[{type:"underline"},{type:"textStyle",attrs:{fontFamily:"Times New Roman, serif",fontSize:"12px"}}]}]}))}}}function AS(t,r,i=!1){const a=t.questions.reduce((l,u)=>l+(u.parts.length||1),0),c=r/a;return!a||!Number.isFinite(c)||c<(i?0:.5)||!Number.isInteger(c*2)||t.questions.some(l=>c>aa[l.type].score||c!==0&&l.type==="CHUNK_CHOICE"&&(l.rightAnswers||0)*(l.singleScore||0)>c)?null:{...t,questions:t.questions.map(l=>({...l,score:c*(l.parts.length||1),document:vn(l.document,l.label,c*(l.parts.length||1)),choice:{...l.choice,score:c,lessScore:Math.min(l.choice.lessScore||0,c)},parts:l.parts.map(u=>({...u,score:c,document:vn(u.document,u.label,c),choice:{...u.choice,score:c}}))}))}}function RS(t,r){return[...t<=17?Array.from({length:18},(i,a)=>17-a<=t?String(17-a):""):[...Array.from({length:7},(i,a)=>7-a<=Math.floor(t/10)?`${7-a}0`:""),"",...Array.from({length:10},(i,a)=>String(9-a))],r?"0.5":""]}const OS=["000","100","110","111","101","010","011","001"],NS=t=>OS[t-1],yu={CHINESE:[1],MATHS:[2],ENGLISH:[3],PHYSICAL:[4],CHEMICAL:[1,2],POLITICAL:[1,3],BIOLOGICAL:[1,4],GEOGRAPHIC:[2,3],JAPANESE:[2,4],IT:[3,4],GYM:[1,2,3],MUSIC:[1,2,4],ART:[1,3,4],SCIENCE:[2,3,4],HISTORY:[1,2,3,4]},MS={语文:"CHINESE",数学:"MATHS",英语:"ENGLISH",物理:"PHYSICAL",化学:"CHEMICAL",政治:"POLITICAL",思想政治:"POLITICAL",道德与法治:"POLITICAL",生物:"BIOLOGICAL",地理:"GEOGRAPHIC",日语:"JAPANESE",信息科技:"IT",信息技术:"IT",体育:"GYM",音乐:"MUSIC",美术:"ART",科学:"SCIENCE",历史:"HISTORY"};function jm(t){return t?.subjectCode||(t?.courseCode&&yu[t.courseCode]?t.courseCode:MS[t?.subject||""])}const qn=t=>Math.round(t*1e3)/1e3,Am=t=>({x:qn(t.x),y:qn(t.y),width:qn(t.width),height:qn(t.height)});function Rm(t,r){const i=Math.max(t.x,r.x),a=Math.max(t.y,r.y),c=Math.min(t.x+t.width,r.x+r.width)-i,l=Math.min(t.y+t.height,r.y+r.height)-a;return c>.01&&l>.01?{x:i,y:a,width:c,height:l}:void 0}const la=function(t,r){let c=t;const l=Ci[r];let u=null,d=0,m=null;const p=[],C={},g=function(_,I){d=c*4+17,u=(function(z){const H=new Array(z);for(let L=0;L<z;L+=1){H[L]=new Array(z);for(let $=0;$<z;$+=1)H[L][$]=null}return H})(d),b(0,0),b(d-7,0),b(0,d-7),S(),x(),T(_,I),c>=7&&w(_),m==null&&(m=O(c,l,p)),j(m,I)},b=function(_,I){for(let z=-1;z<=7;z+=1)if(!(_+z<=-1||d<=_+z))for(let H=-1;H<=7;H+=1)I+H<=-1||d<=I+H||(0<=z&&z<=6&&(H==0||H==6)||0<=H&&H<=6&&(z==0||z==6)||2<=z&&z<=4&&2<=H&&H<=4?u[_+z][I+H]=!0:u[_+z][I+H]=!1)},v=function(){let _=0,I=0;for(let z=0;z<8;z+=1){g(!0,z);const H=zr.getLostPoint(C);(z==0||_>H)&&(_=H,I=z)}return I},x=function(){for(let _=8;_<d-8;_+=1)u[_][6]==null&&(u[_][6]=_%2==0);for(let _=8;_<d-8;_+=1)u[6][_]==null&&(u[6][_]=_%2==0)},S=function(){const _=zr.getPatternPosition(c);for(let I=0;I<_.length;I+=1)for(let z=0;z<_.length;z+=1){const H=_[I],L=_[z];if(u[H][L]==null)for(let $=-2;$<=2;$+=1)for(let Y=-2;Y<=2;Y+=1)$==-2||$==2||Y==-2||Y==2||$==0&&Y==0?u[H+$][L+Y]=!0:u[H+$][L+Y]=!1}},w=function(_){const I=zr.getBCHTypeNumber(c);for(let z=0;z<18;z+=1){const H=!_&&(I>>z&1)==1;u[Math.floor(z/3)][z%3+d-8-3]=H}for(let z=0;z<18;z+=1){const H=!_&&(I>>z&1)==1;u[z%3+d-8-3][Math.floor(z/3)]=H}},T=function(_,I){const z=l<<3|I,H=zr.getBCHTypeInfo(z);for(let L=0;L<15;L+=1){const $=!_&&(H>>L&1)==1;L<6?u[L][8]=$:L<8?u[L+1][8]=$:u[d-15+L][8]=$}for(let L=0;L<15;L+=1){const $=!_&&(H>>L&1)==1;L<8?u[8][d-L-1]=$:L<9?u[8][15-L-1+1]=$:u[8][15-L-1]=$}u[d-8][8]=!_},j=function(_,I){let z=-1,H=d-1,L=7,$=0;const Y=zr.getMaskFunction(I);for(let U=d-1;U>0;U-=2)for(U==6&&(U-=1);;){for(let q=0;q<2;q+=1)if(u[H][U-q]==null){let P=!1;$<_.length&&(P=(_[$]>>>L&1)==1),Y(H,U-q)&&(P=!P),u[H][U-q]=P,L-=1,L==-1&&($+=1,L=7)}if(H+=z,H<0||d<=H){H-=z,z=-z;break}}},R=function(_,I){let z=0,H=0,L=0;const $=new Array(I.length),Y=new Array(I.length);for(let G=0;G<I.length;G+=1){const B=I[G].dataCount,Q=I[G].totalCount-B;H=Math.max(H,B),L=Math.max(L,Q),$[G]=new Array(B);for(let te=0;te<$[G].length;te+=1)$[G][te]=255&_.getBuffer()[te+z];z+=B;const N=zr.getErrorCorrectPolynomial(Q),ne=wi($[G],N.getLength()-1).mod(N);Y[G]=new Array(N.getLength()-1);for(let te=0;te<Y[G].length;te+=1){const le=te+ne.getLength()-Y[G].length;Y[G][te]=le>=0?ne.getAt(le):0}}let U=0;for(let G=0;G<I.length;G+=1)U+=I[G].totalCount;const q=new Array(U);let P=0;for(let G=0;G<H;G+=1)for(let B=0;B<I.length;B+=1)G<$[B].length&&(q[P]=$[B][G],P+=1);for(let G=0;G<L;G+=1)for(let B=0;B<I.length;B+=1)G<Y[B].length&&(q[P]=Y[B][G],P+=1);return q},O=function(_,I,z){const H=Om.getRSBlocks(_,I),L=Nm();for(let Y=0;Y<z.length;Y+=1){const U=z[Y];L.put(U.getMode(),4),L.put(U.getLength(),zr.getLengthInBits(U.getMode(),_)),U.write(L)}let $=0;for(let Y=0;Y<H.length;Y+=1)$+=H[Y].dataCount;if(L.getLengthInBits()>$*8)throw"code length overflow. ("+L.getLengthInBits()+">"+$*8+")";for(L.getLengthInBits()+4<=$*8&&L.put(0,4);L.getLengthInBits()%8!=0;)L.putBit(!1);for(;!(L.getLengthInBits()>=$*8||(L.put(236,8),L.getLengthInBits()>=$*8));)L.put(17,8);return R(L,H)};C.addData=function(_,I){I=I||"Byte";let z=null;switch(I){case"Numeric":z=_S(_);break;case"Alphanumeric":z=DS(_);break;case"Byte":z=IS(_);break;case"Kanji":z=kS(_);break;default:throw"mode:"+I}p.push(z),m=null},C.isDark=function(_,I){if(_<0||d<=_||I<0||d<=I)throw _+","+I;return u[_][I]},C.getModuleCount=function(){return d},C.make=function(){if(c<1){let _=1;for(;_<40;_++){const I=Om.getRSBlocks(_,l),z=Nm();for(let L=0;L<p.length;L++){const $=p[L];z.put($.getMode(),4),z.put($.getLength(),zr.getLengthInBits($.getMode(),_)),$.write(z)}let H=0;for(let L=0;L<I.length;L++)H+=I[L].dataCount;if(z.getLengthInBits()<=H*8)break}c=_}g(!1,v())},C.createTableTag=function(_,I){_=_||2,I=typeof I>"u"?_*4:I;let z="";z+='<table style="',z+=" border-width: 0px; border-style: none;",z+=" border-collapse: collapse;",z+=" padding: 0px; margin: "+I+"px;",z+='">',z+="<tbody>";for(let H=0;H<C.getModuleCount();H+=1){z+="<tr>";for(let L=0;L<C.getModuleCount();L+=1)z+='<td style="',z+=" border-width: 0px; border-style: none;",z+=" border-collapse: collapse;",z+=" padding: 0px; margin: 0px;",z+=" width: "+_+"px;",z+=" height: "+_+"px;",z+=" background-color: ",z+=C.isDark(H,L)?"#000000":"#ffffff",z+=";",z+='"/>';z+="</tr>"}return z+="</tbody>",z+="</table>",z},C.createSvgTag=function(_,I,z,H){let L={};typeof arguments[0]=="object"&&(L=arguments[0],_=L.cellSize,I=L.margin,z=L.alt,H=L.title),_=_||2,I=typeof I>"u"?_*4:I,z=typeof z=="string"?{text:z}:z||{},z.text=z.text||null,z.id=z.text?z.id||"qrcode-description":null,H=typeof H=="string"?{text:H}:H||{},H.text=H.text||null,H.id=H.text?H.id||"qrcode-title":null;const $=C.getModuleCount()*_+I*2;let Y,U,q,P,G="",B;for(B="l"+_+",0 0,"+_+" -"+_+",0 0,-"+_+"z ",G+='<svg version="1.1" xmlns="http://www.w3.org/2000/svg"',G+=L.scalable?"":' width="'+$+'px" height="'+$+'px"',G+=' viewBox="0 0 '+$+" "+$+'" ',G+=' preserveAspectRatio="xMinYMin meet"',G+=H.text||z.text?' role="img" aria-labelledby="'+M([H.id,z.id].join(" ").trim())+'"':"",G+=">",G+=H.text?'<title id="'+M(H.id)+'">'+M(H.text)+"</title>":"",G+=z.text?'<description id="'+M(z.id)+'">'+M(z.text)+"</description>":"",G+='<rect width="100%" height="100%" fill="white" cx="0" cy="0"/>',G+='<path d="',q=0;q<C.getModuleCount();q+=1)for(P=q*_+I,Y=0;Y<C.getModuleCount();Y+=1)C.isDark(q,Y)&&(U=Y*_+I,G+="M"+U+","+P+B);return G+='" stroke="transparent" fill="black"/>',G+="</svg>",G},C.createDataURL=function(_,I){_=_||2,I=typeof I>"u"?_*4:I;const z=C.getModuleCount()*_+I*2,H=I,L=z-I;return HS(z,z,function($,Y){if(H<=$&&$<L&&H<=Y&&Y<L){const U=Math.floor(($-H)/_),q=Math.floor((Y-H)/_);return C.isDark(q,U)?0:1}else return 1})},C.createImgTag=function(_,I,z){_=_||2,I=typeof I>"u"?_*4:I;const H=C.getModuleCount()*_+I*2;let L="";return L+="<img",L+=' src="',L+=C.createDataURL(_,I),L+='"',L+=' width="',L+=H,L+='"',L+=' height="',L+=H,L+='"',z&&(L+=' alt="',L+=M(z),L+='"'),L+="/>",L};const M=function(_){let I="";for(let z=0;z<_.length;z+=1){const H=_.charAt(z);switch(H){case"<":I+="&lt;";break;case">":I+="&gt;";break;case"&":I+="&amp;";break;case'"':I+="&quot;";break;default:I+=H;break}}return I},D=function(_){_=typeof _>"u"?2:_;const z=C.getModuleCount()*1+_*2,H=_,L=z-_;let $,Y,U,q,P;const G={"██":"█","█ ":"▀"," █":"▄"," ":" "},B={"██":"▀","█ ":"▀"," █":" "," ":" "};let Q="";for($=0;$<z;$+=2){for(U=Math.floor(($-H)/1),q=Math.floor(($+1-H)/1),Y=0;Y<z;Y+=1)P="█",H<=Y&&Y<L&&H<=$&&$<L&&C.isDark(U,Math.floor((Y-H)/1))&&(P=" "),H<=Y&&Y<L&&H<=$+1&&$+1<L&&C.isDark(q,Math.floor((Y-H)/1))?P+=" ":P+="█",Q+=_<1&&$+1>=L?B[P]:G[P];Q+=`
2
+ `}return z%2&&_>0?Q.substring(0,Q.length-z-1)+Array(z+1).join("▀"):Q.substring(0,Q.length-1)};return C.createASCII=function(_,I){if(_=_||1,_<2)return D(I);_-=1,I=typeof I>"u"?_*2:I;const z=C.getModuleCount()*_+I*2,H=I,L=z-I;let $,Y,U,q;const P=Array(_+1).join("██"),G=Array(_+1).join(" ");let B="",Q="";for($=0;$<z;$+=1){for(U=Math.floor(($-H)/_),Q="",Y=0;Y<z;Y+=1)q=1,H<=Y&&Y<L&&H<=$&&$<L&&C.isDark(U,Math.floor((Y-H)/_))&&(q=0),Q+=q?P:G;for(U=0;U<_;U+=1)B+=Q+`
3
+ `}return B.substring(0,B.length-1)},C.renderTo2dContext=function(_,I){I=I||2;const z=C.getModuleCount();for(let H=0;H<z;H++)for(let L=0;L<z;L++)_.fillStyle=C.isDark(H,L)?"black":"white",_.fillRect(L*I,H*I,I,I)},C};la.stringToBytes=function(t){const r=[];for(let i=0;i<t.length;i+=1){const a=t.charCodeAt(i);r.push(a&255)}return r},la.createStringToBytes=function(t,r){const i=(function(){const c=zS(t),l=function(){const m=c.read();if(m==-1)throw"eof";return m};let u=0;const d={};for(;;){const m=c.read();if(m==-1)break;const p=l(),C=l(),g=l(),b=String.fromCharCode(m<<8|p),v=C<<8|g;d[b]=v,u+=1}if(u!=r)throw u+" != "+r;return d})(),a=63;return function(c){const l=[];for(let u=0;u<c.length;u+=1){const d=c.charCodeAt(u);if(d<128)l.push(d);else{const m=i[c.charAt(u)];typeof m=="number"?(m&255)==m?l.push(m):(l.push(m>>>8),l.push(m&255)):l.push(a)}}return l}};const Gt={MODE_NUMBER:1,MODE_ALPHA_NUM:2,MODE_8BIT_BYTE:4,MODE_KANJI:8},Ci={L:1,M:0,Q:3,H:2},Lr={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7},zr=(function(){const t=[[],[6,18],[6,22],[6,26],[6,30],[6,34],[6,22,38],[6,24,42],[6,26,46],[6,28,50],[6,30,54],[6,32,58],[6,34,62],[6,26,46,66],[6,26,48,70],[6,26,50,74],[6,30,54,78],[6,30,56,82],[6,30,58,86],[6,34,62,90],[6,28,50,72,94],[6,26,50,74,98],[6,30,54,78,102],[6,28,54,80,106],[6,32,58,84,110],[6,30,58,86,114],[6,34,62,90,118],[6,26,50,74,98,122],[6,30,54,78,102,126],[6,26,52,78,104,130],[6,30,56,82,108,134],[6,34,60,86,112,138],[6,30,58,86,114,142],[6,34,62,90,118,146],[6,30,54,78,102,126,150],[6,24,50,76,102,128,154],[6,28,54,80,106,132,158],[6,32,58,84,110,136,162],[6,26,54,82,110,138,166],[6,30,58,86,114,142,170]],r=1335,i=7973,a=21522,c={},l=function(u){let d=0;for(;u!=0;)d+=1,u>>>=1;return d};return c.getBCHTypeInfo=function(u){let d=u<<10;for(;l(d)-l(r)>=0;)d^=r<<l(d)-l(r);return(u<<10|d)^a},c.getBCHTypeNumber=function(u){let d=u<<12;for(;l(d)-l(i)>=0;)d^=i<<l(d)-l(i);return u<<12|d},c.getPatternPosition=function(u){return t[u-1]},c.getMaskFunction=function(u){switch(u){case Lr.PATTERN000:return function(d,m){return(d+m)%2==0};case Lr.PATTERN001:return function(d,m){return d%2==0};case Lr.PATTERN010:return function(d,m){return m%3==0};case Lr.PATTERN011:return function(d,m){return(d+m)%3==0};case Lr.PATTERN100:return function(d,m){return(Math.floor(d/2)+Math.floor(m/3))%2==0};case Lr.PATTERN101:return function(d,m){return d*m%2+d*m%3==0};case Lr.PATTERN110:return function(d,m){return(d*m%2+d*m%3)%2==0};case Lr.PATTERN111:return function(d,m){return(d*m%3+(d+m)%2)%2==0};default:throw"bad maskPattern:"+u}},c.getErrorCorrectPolynomial=function(u){let d=wi([1],0);for(let m=0;m<u;m+=1)d=d.multiply(wi([1,Br.gexp(m)],0));return d},c.getLengthInBits=function(u,d){if(1<=d&&d<10)switch(u){case Gt.MODE_NUMBER:return 10;case Gt.MODE_ALPHA_NUM:return 9;case Gt.MODE_8BIT_BYTE:return 8;case Gt.MODE_KANJI:return 8;default:throw"mode:"+u}else if(d<27)switch(u){case Gt.MODE_NUMBER:return 12;case Gt.MODE_ALPHA_NUM:return 11;case Gt.MODE_8BIT_BYTE:return 16;case Gt.MODE_KANJI:return 10;default:throw"mode:"+u}else if(d<41)switch(u){case Gt.MODE_NUMBER:return 14;case Gt.MODE_ALPHA_NUM:return 13;case Gt.MODE_8BIT_BYTE:return 16;case Gt.MODE_KANJI:return 12;default:throw"mode:"+u}else throw"type:"+d},c.getLostPoint=function(u){const d=u.getModuleCount();let m=0;for(let g=0;g<d;g+=1)for(let b=0;b<d;b+=1){let v=0;const x=u.isDark(g,b);for(let S=-1;S<=1;S+=1)if(!(g+S<0||d<=g+S))for(let w=-1;w<=1;w+=1)b+w<0||d<=b+w||S==0&&w==0||x==u.isDark(g+S,b+w)&&(v+=1);v>5&&(m+=3+v-5)}for(let g=0;g<d-1;g+=1)for(let b=0;b<d-1;b+=1){let v=0;u.isDark(g,b)&&(v+=1),u.isDark(g+1,b)&&(v+=1),u.isDark(g,b+1)&&(v+=1),u.isDark(g+1,b+1)&&(v+=1),(v==0||v==4)&&(m+=3)}for(let g=0;g<d;g+=1)for(let b=0;b<d-6;b+=1)u.isDark(g,b)&&!u.isDark(g,b+1)&&u.isDark(g,b+2)&&u.isDark(g,b+3)&&u.isDark(g,b+4)&&!u.isDark(g,b+5)&&u.isDark(g,b+6)&&(m+=40);for(let g=0;g<d;g+=1)for(let b=0;b<d-6;b+=1)u.isDark(b,g)&&!u.isDark(b+1,g)&&u.isDark(b+2,g)&&u.isDark(b+3,g)&&u.isDark(b+4,g)&&!u.isDark(b+5,g)&&u.isDark(b+6,g)&&(m+=40);let p=0;for(let g=0;g<d;g+=1)for(let b=0;b<d;b+=1)u.isDark(b,g)&&(p+=1);const C=Math.abs(100*p/d/d-50)/5;return m+=C*10,m},c})(),Br=(function(){const t=new Array(256),r=new Array(256);for(let a=0;a<8;a+=1)t[a]=1<<a;for(let a=8;a<256;a+=1)t[a]=t[a-4]^t[a-5]^t[a-6]^t[a-8];for(let a=0;a<255;a+=1)r[t[a]]=a;const i={};return i.glog=function(a){if(a<1)throw"glog("+a+")";return r[a]},i.gexp=function(a){for(;a<0;)a+=255;for(;a>=256;)a-=255;return t[a]},i})(),wi=function(t,r){if(typeof t.length>"u")throw t.length+"/"+r;const i=(function(){let c=0;for(;c<t.length&&t[c]==0;)c+=1;const l=new Array(t.length-c+r);for(let u=0;u<t.length-c;u+=1)l[u]=t[u+c];return l})(),a={};return a.getAt=function(c){return i[c]},a.getLength=function(){return i.length},a.multiply=function(c){const l=new Array(a.getLength()+c.getLength()-1);for(let u=0;u<a.getLength();u+=1)for(let d=0;d<c.getLength();d+=1)l[u+d]^=Br.gexp(Br.glog(a.getAt(u))+Br.glog(c.getAt(d)));return wi(l,0)},a.mod=function(c){if(a.getLength()-c.getLength()<0)return a;const l=Br.glog(a.getAt(0))-Br.glog(c.getAt(0)),u=new Array(a.getLength());for(let d=0;d<a.getLength();d+=1)u[d]=a.getAt(d);for(let d=0;d<c.getLength();d+=1)u[d]^=Br.gexp(Br.glog(c.getAt(d))+l);return wi(u,0).mod(c)},a},Om=(function(){const t=[[1,26,19],[1,26,16],[1,26,13],[1,26,9],[1,44,34],[1,44,28],[1,44,22],[1,44,16],[1,70,55],[1,70,44],[2,35,17],[2,35,13],[1,100,80],[2,50,32],[2,50,24],[4,25,9],[1,134,108],[2,67,43],[2,33,15,2,34,16],[2,33,11,2,34,12],[2,86,68],[4,43,27],[4,43,19],[4,43,15],[2,98,78],[4,49,31],[2,32,14,4,33,15],[4,39,13,1,40,14],[2,121,97],[2,60,38,2,61,39],[4,40,18,2,41,19],[4,40,14,2,41,15],[2,146,116],[3,58,36,2,59,37],[4,36,16,4,37,17],[4,36,12,4,37,13],[2,86,68,2,87,69],[4,69,43,1,70,44],[6,43,19,2,44,20],[6,43,15,2,44,16],[4,101,81],[1,80,50,4,81,51],[4,50,22,4,51,23],[3,36,12,8,37,13],[2,116,92,2,117,93],[6,58,36,2,59,37],[4,46,20,6,47,21],[7,42,14,4,43,15],[4,133,107],[8,59,37,1,60,38],[8,44,20,4,45,21],[12,33,11,4,34,12],[3,145,115,1,146,116],[4,64,40,5,65,41],[11,36,16,5,37,17],[11,36,12,5,37,13],[5,109,87,1,110,88],[5,65,41,5,66,42],[5,54,24,7,55,25],[11,36,12,7,37,13],[5,122,98,1,123,99],[7,73,45,3,74,46],[15,43,19,2,44,20],[3,45,15,13,46,16],[1,135,107,5,136,108],[10,74,46,1,75,47],[1,50,22,15,51,23],[2,42,14,17,43,15],[5,150,120,1,151,121],[9,69,43,4,70,44],[17,50,22,1,51,23],[2,42,14,19,43,15],[3,141,113,4,142,114],[3,70,44,11,71,45],[17,47,21,4,48,22],[9,39,13,16,40,14],[3,135,107,5,136,108],[3,67,41,13,68,42],[15,54,24,5,55,25],[15,43,15,10,44,16],[4,144,116,4,145,117],[17,68,42],[17,50,22,6,51,23],[19,46,16,6,47,17],[2,139,111,7,140,112],[17,74,46],[7,54,24,16,55,25],[34,37,13],[4,151,121,5,152,122],[4,75,47,14,76,48],[11,54,24,14,55,25],[16,45,15,14,46,16],[6,147,117,4,148,118],[6,73,45,14,74,46],[11,54,24,16,55,25],[30,46,16,2,47,17],[8,132,106,4,133,107],[8,75,47,13,76,48],[7,54,24,22,55,25],[22,45,15,13,46,16],[10,142,114,2,143,115],[19,74,46,4,75,47],[28,50,22,6,51,23],[33,46,16,4,47,17],[8,152,122,4,153,123],[22,73,45,3,74,46],[8,53,23,26,54,24],[12,45,15,28,46,16],[3,147,117,10,148,118],[3,73,45,23,74,46],[4,54,24,31,55,25],[11,45,15,31,46,16],[7,146,116,7,147,117],[21,73,45,7,74,46],[1,53,23,37,54,24],[19,45,15,26,46,16],[5,145,115,10,146,116],[19,75,47,10,76,48],[15,54,24,25,55,25],[23,45,15,25,46,16],[13,145,115,3,146,116],[2,74,46,29,75,47],[42,54,24,1,55,25],[23,45,15,28,46,16],[17,145,115],[10,74,46,23,75,47],[10,54,24,35,55,25],[19,45,15,35,46,16],[17,145,115,1,146,116],[14,74,46,21,75,47],[29,54,24,19,55,25],[11,45,15,46,46,16],[13,145,115,6,146,116],[14,74,46,23,75,47],[44,54,24,7,55,25],[59,46,16,1,47,17],[12,151,121,7,152,122],[12,75,47,26,76,48],[39,54,24,14,55,25],[22,45,15,41,46,16],[6,151,121,14,152,122],[6,75,47,34,76,48],[46,54,24,10,55,25],[2,45,15,64,46,16],[17,152,122,4,153,123],[29,74,46,14,75,47],[49,54,24,10,55,25],[24,45,15,46,46,16],[4,152,122,18,153,123],[13,74,46,32,75,47],[48,54,24,14,55,25],[42,45,15,32,46,16],[20,147,117,4,148,118],[40,75,47,7,76,48],[43,54,24,22,55,25],[10,45,15,67,46,16],[19,148,118,6,149,119],[18,75,47,31,76,48],[34,54,24,34,55,25],[20,45,15,61,46,16]],r=function(c,l){const u={};return u.totalCount=c,u.dataCount=l,u},i={},a=function(c,l){switch(l){case Ci.L:return t[(c-1)*4+0];case Ci.M:return t[(c-1)*4+1];case Ci.Q:return t[(c-1)*4+2];case Ci.H:return t[(c-1)*4+3];default:return}};return i.getRSBlocks=function(c,l){const u=a(c,l);if(typeof u>"u")throw"bad rs block @ typeNumber:"+c+"/errorCorrectionLevel:"+l;const d=u.length/3,m=[];for(let p=0;p<d;p+=1){const C=u[p*3+0],g=u[p*3+1],b=u[p*3+2];for(let v=0;v<C;v+=1)m.push(r(g,b))}return m},i})(),Nm=function(){const t=[];let r=0;const i={};return i.getBuffer=function(){return t},i.getAt=function(a){const c=Math.floor(a/8);return(t[c]>>>7-a%8&1)==1},i.put=function(a,c){for(let l=0;l<c;l+=1)i.putBit((a>>>c-l-1&1)==1)},i.getLengthInBits=function(){return r},i.putBit=function(a){const c=Math.floor(r/8);t.length<=c&&t.push(0),a&&(t[c]|=128>>>r%8),r+=1},i},_S=function(t){const r=Gt.MODE_NUMBER,i=t,a={};a.getMode=function(){return r},a.getLength=function(u){return i.length},a.write=function(u){const d=i;let m=0;for(;m+2<d.length;)u.put(c(d.substring(m,m+3)),10),m+=3;m<d.length&&(d.length-m==1?u.put(c(d.substring(m,m+1)),4):d.length-m==2&&u.put(c(d.substring(m,m+2)),7))};const c=function(u){let d=0;for(let m=0;m<u.length;m+=1)d=d*10+l(u.charAt(m));return d},l=function(u){if("0"<=u&&u<="9")return u.charCodeAt(0)-48;throw"illegal char :"+u};return a},DS=function(t){const r=Gt.MODE_ALPHA_NUM,i=t,a={};a.getMode=function(){return r},a.getLength=function(l){return i.length},a.write=function(l){const u=i;let d=0;for(;d+1<u.length;)l.put(c(u.charAt(d))*45+c(u.charAt(d+1)),11),d+=2;d<u.length&&l.put(c(u.charAt(d)),6)};const c=function(l){if("0"<=l&&l<="9")return l.charCodeAt(0)-48;if("A"<=l&&l<="Z")return l.charCodeAt(0)-65+10;switch(l){case" ":return 36;case"$":return 37;case"%":return 38;case"*":return 39;case"+":return 40;case"-":return 41;case".":return 42;case"/":return 43;case":":return 44;default:throw"illegal char :"+l}};return a},IS=function(t){const r=Gt.MODE_8BIT_BYTE,i=la.stringToBytes(t),a={};return a.getMode=function(){return r},a.getLength=function(c){return i.length},a.write=function(c){for(let l=0;l<i.length;l+=1)c.put(i[l],8)},a},kS=function(t){const r=Gt.MODE_KANJI,i=la.stringToBytes;(function(l,u){const d=i(l);if(d.length!=2||(d[0]<<8|d[1])!=u)throw"sjis not supported."})("友",38726);const a=i(t),c={};return c.getMode=function(){return r},c.getLength=function(l){return~~(a.length/2)},c.write=function(l){const u=a;let d=0;for(;d+1<u.length;){let m=(255&u[d])<<8|255&u[d+1];if(33088<=m&&m<=40956)m-=33088;else if(57408<=m&&m<=60351)m-=49472;else throw"illegal char at "+(d+1)+"/"+m;m=(m>>>8&255)*192+(m&255),l.put(m,13),d+=2}if(d<u.length)throw"illegal char at "+(d+1)},c},Mm=function(){const t=[],r={};return r.writeByte=function(i){t.push(i&255)},r.writeShort=function(i){r.writeByte(i),r.writeByte(i>>>8)},r.writeBytes=function(i,a,c){a=a||0,c=c||i.length;for(let l=0;l<c;l+=1)r.writeByte(i[l+a])},r.writeString=function(i){for(let a=0;a<i.length;a+=1)r.writeByte(i.charCodeAt(a))},r.toByteArray=function(){return t},r.toString=function(){let i="";i+="[";for(let a=0;a<t.length;a+=1)a>0&&(i+=","),i+=t[a];return i+="]",i},r},LS=function(){let t=0,r=0,i=0,a="";const c={},l=function(d){a+=String.fromCharCode(u(d&63))},u=function(d){if(d<0)throw"n:"+d;if(d<26)return 65+d;if(d<52)return 97+(d-26);if(d<62)return 48+(d-52);if(d==62)return 43;if(d==63)return 47;throw"n:"+d};return c.writeByte=function(d){for(t=t<<8|d&255,r+=8,i+=1;r>=6;)l(t>>>r-6),r-=6},c.flush=function(){if(r>0&&(l(t<<6-r),t=0,r=0),i%3!=0){const d=3-i%3;for(let m=0;m<d;m+=1)a+="="}},c.toString=function(){return a},c},zS=function(t){const r=t;let i=0,a=0,c=0;const l={};l.read=function(){for(;c<8;){if(i>=r.length){if(c==0)return-1;throw"unexpected end of file./"+c}const m=r.charAt(i);if(i+=1,m=="=")return c=0,-1;if(m.match(/^\s$/))continue;a=a<<6|u(m.charCodeAt(0)),c+=6}const d=a>>>c-8&255;return c-=8,d};const u=function(d){if(65<=d&&d<=90)return d-65;if(97<=d&&d<=122)return d-97+26;if(48<=d&&d<=57)return d-48+52;if(d==43)return 62;if(d==47)return 63;throw"c:"+d};return l},BS=function(t,r){const i=t,a=r,c=new Array(t*r),l={};l.setPixel=function(p,C,g){c[C*i+p]=g},l.write=function(p){p.writeString("GIF87a"),p.writeShort(i),p.writeShort(a),p.writeByte(128),p.writeByte(0),p.writeByte(0),p.writeByte(0),p.writeByte(0),p.writeByte(0),p.writeByte(255),p.writeByte(255),p.writeByte(255),p.writeString(","),p.writeShort(0),p.writeShort(0),p.writeShort(i),p.writeShort(a),p.writeByte(0);const C=2,g=d(C);p.writeByte(C);let b=0;for(;g.length-b>255;)p.writeByte(255),p.writeBytes(g,b,255),b+=255;p.writeByte(g.length-b),p.writeBytes(g,b,g.length-b),p.writeByte(0),p.writeString(";")};const u=function(p){const C=p;let g=0,b=0;const v={};return v.write=function(x,S){if(x>>>S)throw"length over";for(;g+S>=8;)C.writeByte(255&(x<<g|b)),S-=8-g,x>>>=8-g,b=0,g=0;b=x<<g|b,g=g+S},v.flush=function(){g>0&&C.writeByte(b)},v},d=function(p){const C=1<<p,g=(1<<p)+1;let b=p+1;const v=m();for(let j=0;j<C;j+=1)v.add(String.fromCharCode(j));v.add(String.fromCharCode(C)),v.add(String.fromCharCode(g));const x=Mm(),S=u(x);S.write(C,b);let w=0,T=String.fromCharCode(c[w]);for(w+=1;w<c.length;){const j=String.fromCharCode(c[w]);w+=1,v.contains(T+j)?T=T+j:(S.write(v.indexOf(T),b),v.size()<4095&&(v.size()==1<<b&&(b+=1),v.add(T+j)),T=j)}return S.write(v.indexOf(T),b),S.write(g,b),S.flush(),x.toByteArray()},m=function(){const p={};let C=0;const g={};return g.add=function(b){if(g.contains(b))throw"dup key:"+b;p[b]=C,C+=1},g.size=function(){return C},g.indexOf=function(b){return p[b]},g.contains=function(b){return typeof p[b]<"u"},g};return l},HS=function(t,r,i){const a=BS(t,r);for(let d=0;d<r;d+=1)for(let m=0;m<t;m+=1)a.setPixel(m,d,i(m,d));const c=Mm();a.write(c);const l=LS(),u=c.toByteArray();for(let d=0;d<u.length;d+=1)l.writeByte(u[d]);return l.flush(),"data:image/gif;base64,"+l};la.stringToBytes;function _m(t){const r=la(0,"M"),i=Array.from(new TextEncoder().encode(t),l=>String.fromCharCode(l)).join("");r.addData(i,/^\d+$/.test(t)?"Numeric":"Byte"),r.make();const a=r.getModuleCount();let c="";for(let l=0;l<a;l++)for(let u=0;u<a;u++)r.isDark(l,u)&&(c+=`M${u} ${l}h1v1h-1z`);return{count:a,path:c}}class ca extends Error{constructor(i){super(i[0]?.message||"题卡数据无效");cm(this,"issues");this.name="AnswerSheetDataError",this.issues=i}}function bu(t,r){const i=(x,S="题卡数据结构无效")=>{throw new ca([{code:"INVALID_DATA",path:x,message:S}])},a=(x,S)=>!x||typeof x!="object"||Array.isArray(x)?i(S):x,c=(x,S)=>Array.isArray(x)?x:i(S),l=(x,S)=>{typeof x!="string"&&i(S)},u=(x,S,w=0,T=1e5)=>{(typeof x!="number"||!Number.isFinite(x)||x<w||x>T)&&i(S)},d=(x,S)=>{a(x,S);const w=r.validateDocument(x);w.length&&i(S,w[0])},m=(x,S)=>{const w=a(x,S);if(l(w.id,`${S}.id`),l(w.label,`${S}.label`),(typeof w.multiple!="boolean"||typeof w.breakBefore!="boolean")&&i(S),w.contentTarget!==void 0&&w.contentTarget!==null){const T=a(w.contentTarget,`${S}.contentTarget`);l(T.groupId,`${S}.contentTarget.groupId`),c(T.optionIds,`${S}.contentTarget.optionIds`).forEach((j,R)=>l(j,`${S}.contentTarget.optionIds.${R}`))}c(w.options,`${S}.options`).forEach((T,j)=>{const R=a(T,`${S}.options.${j}`);l(R.id,`${S}.options.${j}.id`),l(R.label,`${S}.options.${j}.label`)}),c(w.correctIds,`${S}.correctIds`).forEach((T,j)=>l(T,`${S}.correctIds.${j}`))},p=(x,S)=>{const w=a(x,S);(!["row","column"].includes(String(w.direction))||!["concentrated","distributed","stem","option"].includes(String(w.presentation))||!["box","check","bubble"].includes(String(w.marker)))&&i(S),u(w.rowsPerColumn,`${S}.rowsPerColumn`,1,5),u(w.rowGap,`${S}.rowGap`,0,64),u(w.columnGap,`${S}.columnGap`,0,64),c(w.questions,`${S}.questions`).forEach((T,j)=>m(T,`${S}.questions.${j}`))},C=new WeakSet,g=(x,S)=>{if(!(!x||typeof x!="object")){if(C.has(x))return i(S,"题卡必须是无循环引用的 JSON 数据");C.add(x),Object.entries(x).forEach(([w,T])=>g(T,`${S}.${w}`)),C.delete(x)}},b=a(t,"");if(b.version!==1&&i("version","不支持的题卡数据版本"),l(b.title,"title"),b.usage!==void 0&&!["exam","homework"].includes(String(b.usage))&&i("usage"),["questionCard","scanMarking","halfPoint","mergeObjective"].forEach(x=>{b[x]!==void 0&&typeof b[x]!="boolean"&&i(x)}),["a4","a3-two","a3-three"].includes(String(b.preset))||i("preset"),u(b.margin,"margin",0,100),u(b.gap,"gap",0,100),b.creation){const x=a(b.creation,"creation");["template","exam"].includes(String(x.mode))||i("creation.mode"),["name","grade","subject"].forEach(S=>l(x[S],`creation.${S}`));for(const S of["gradeCode","courseCode","subjectCode"])x[S]!==void 0&&(typeof x[S]!="string"||!x[S].trim())&&i(`creation.${S}`);x.phaseCode!==void 0&&!["P","J","S"].includes(String(x.phaseCode))&&i("creation.phaseCode"),x.createMode!==void 0&&!["MANUALLY","IMPORTED","THIRD"].includes(String(x.createMode))&&i("creation.createMode");for(const S of["id","exampaperId"])if(x[S]!==void 0){const w=x[S];typeof w=="string"&&w.trim()||typeof w=="number"&&Number.isSafeInteger(w)&&w>=0||i(`creation.${S}`)}}if(b.paperTitle){const x=a(b.paperTitle,"paperTitle");l(x.id,"paperTitle.id"),u(x.height,"paperTitle.height",1,1e3),d(x.document,"paperTitle.document")}if(b.header){const x=a(b.header,"header");["code","school"].includes(String(x.kaohao))||i("header.kaohao"),u(x.weishu,"header.weishu",1,20),x.tiaomaStyle!==void 0&&![1,2].includes(x.tiaomaStyle)&&i("header.tiaomaStyle"),x.classText!==void 0&&typeof x.classText!="boolean"&&i("header.classText")}if(b.recognition!==void 0){const x=a(b.recognition,"recognition");for(const S of["examQrCode","subjectMarkers","pointBlack"])x[S]!==void 0&&typeof x[S]!="boolean"&&i(`recognition.${S}`)}c(b.blocks,"blocks").forEach((x,S)=>{const w=`blocks.${S}`,T=a(x,w);if(l(T.id,`${w}.id`),l(T.title,`${w}.title`),u(T.answerHeight,`${w}.answerHeight`),d(T.document,`${w}.document`),T.kind==="area"){(!["forbiden","editArea"].includes(String(T.areaType))||T.reference||T.choices||T.exercise)&&i(`${w}.areaType`),u(T.answerHeight,`${w}.answerHeight`,100,4e3);return}if(!T.reference){if(T.choices){p(T.choices,`${w}.choices`);return}i(`${w}.reference`,"请使用包含 reference 题目结构的制卡数据")}const j=a(T.reference,`${w}.reference`);j.material!==void 0&&d(j.material,`${w}.reference.material`),j.textVersion!==void 0&&j.textVersion!==1&&i(`${w}.reference.textVersion`),Object.hasOwn(nr,String(j.type))||i(`${w}.reference.type`),p(j.layout,`${w}.reference.layout`),u(j.optionalHeight,`${w}.reference.optionalHeight`),c(j.questions,`${w}.reference.questions`).forEach((R,O)=>{const M=`${w}.reference.questions.${O}`,D=a(R,M);Object.hasOwn(aa,String(D.type))||i(`${M}.type`),l(D.id,`${M}.id`),l(D.label,`${M}.label`),m(D.choice,`${M}.choice`),["height","contentHeight","characters","lines"].forEach(I=>u(D[I],`${M}.${I}`)),d(D.document,`${M}.document`);const _=(I,z)=>{if(!I)return;const H=a(I,z);d(H.content,`${z}.content`),a(H.layout,`${z}.layout`),l(H.groupId,`${z}.groupId`),c(H.itemsContent,`${z}.itemsContent`).forEach((L,$)=>{const Y=a(L,`${z}.itemsContent.${$}`);l(Y.id,`${z}.itemsContent.${$}.id`),l(Y.key,`${z}.itemsContent.${$}.key`),d(Y.content,`${z}.itemsContent.${$}.content`)})};_(D.text,`${M}.text`),c(D.parts,`${M}.parts`).forEach((I,z)=>{const H=`${M}.parts.${z}`,L=a(I,H);l(L.id,`${H}.id`),l(L.label,`${H}.label`),u(L.width,`${H}.width`),u(L.height,`${H}.height`),d(L.document,`${H}.document`),m(L.choice,`${H}.choice`),_(L.text,`${H}.text`)})})}),g(t,"");const v=du(t);(v.columnWidth<100||v.contentHeight<100)&&i("margin","边距或栏间距过大,纸张没有足够的作答区域")}function Ys(t){return!t||t.marks?.some(r=>r.type==="documentLabel")?!1:t.type==="text"?!!t.text?.trim():t.type==="image"?!!t.attrs?.src:t.type==="formula"||t.type==="blockFormula"?!!t.attrs?.latex?.trim():!!t.content?.some(Ys)}function PS(t,r){try{bu(t,r)}catch(v){return{valid:!1,issues:v instanceof ca?v.issues:[{code:"INVALID_DATA",path:"",message:"题卡数据无法读取"}]}}const i=[];let a={};const c=(v,x,S)=>i.push({code:v,path:x,message:S,...a}),l=new Set,u=(v,x)=>{(!v.trim()||l.has(v))&&c("DUPLICATE_ID",x,"题块、题目和选项 ID 必须非空且唯一"),l.add(v)},d=(v,x,S)=>{(v===null||!Number.isFinite(v)||v<(t.usage==="homework"?0:.5)||v>x||!Number.isInteger(v*2))&&c("INVALID_SCORE",S,`分值须为 ${t.usage==="homework"?0:.5}–${x} 分,按 0.5 分递增`)},m=(v,x,S)=>{(v.options.length<x[0]||v.options.length>x[1])&&c("INVALID_OPTIONS",`${S}.options`,`选项个数须为 ${x[0]}–${x[1]}`),v.options.forEach((w,T)=>u(w.id,`${S}.options.${T}.id`)),(new Set(v.correctIds).size!==v.correctIds.length||v.correctIds.some(w=>!v.options.some(T=>T.id===w)))&&c("INVALID_ANSWER_REFERENCE",`${S}.correctIds`,"答案引用了不存在或重复的选项")},p=(v,x,S,w=0,T=!0)=>{T&&!Ys(v?.content.content)&&c("MISSING_CONTENT",`${x}.content`,"请填写题干或材料"),S&&(v?.itemsContent.length!==w||v.itemsContent.some(j=>!Ys(j.content.content)))&&c("MISSING_OPTION_CONTENT",`${x}.itemsContent`,"请补全每个选项的内容")};if(t.title.trim()||c("MISSING_TITLE","title","请填写题卡名称"),t.recognition?.examQrCode){const v=String(t.creation?.exampaperId??"").trim();if(!v)c("MISSING_EXAM_ID","creation.exampaperId","显示试卷二维码需要填写试卷 ID");else try{_m(v)}catch{c("INVALID_QR_PAYLOAD","creation.exampaperId","试卷 ID 太长,无法生成二维码")}}t.header&&t.recognition?.subjectMarkers!==!1&&!yu[jm(t.creation)||""]&&c("UNKNOWN_SUBJECT_MARK","creation.subjectCode","当前学科没有参考识别编码,请配置标准学科或关闭学科标记"),(!t.creation?.grade.trim()||!t.creation.subject.trim())&&c("MISSING_CREATION","creation","请选择年级和学科"),(!t.paperTitle||!Ys(t.paperTitle.document.content))&&c("MISSING_PAPER_TITLE","paperTitle","请填写纸面标题"),t.blocks.some(v=>v.kind!=="area")||c("EMPTY_CARD","blocks","请至少添加一个题块和一道题目"),t.paperTitle&&u(t.paperTitle.id,"paperTitle.id"),t.blocks.forEach((v,x)=>{a={blockId:v.id};const S=`blocks.${x}`;if(u(v.id,`${S}.id`),v.kind==="area"){v.areaType===(t.questionCard?"forbiden":"editArea")&&c("INVALID_AREA_MODE",`${S}.areaType`,"题卡合一使用空白答题区,独立答题卡使用禁止答题区");return}v.title.trim()||c("MISSING_BLOCK_TITLE",`${S}.title`,"请填写题块标题"),v.id==="reference-merged-objective"&&c("RESERVED_ID",`${S}.id`,"题块使用了系统保留 ID");const w=v.reference;if(!w){v.choices?.questions.length||c("EMPTY_BLOCK",S,"题块中没有题目"),v.choices?.questions.forEach((j,R)=>{a={blockId:v.id,questionId:j.id},u(j.id,`${S}.choices.questions.${R}.id`),m(j,[2,12],`${S}.choices.questions.${R}`),d(j.score??null,15,`${S}.choices.questions.${R}.score`)});return}w.questions.length||c("EMPTY_BLOCK",`${S}.reference.questions`,"题块中没有题目");const T=gu(w);if((T.some(j=>!j.trim())||new Set(T).size!==T.length)&&c("INVALID_QUESTION_NUMBER",`${S}.reference.questions`,"同一题块内的题号须非空且不能重复"),w.optional&&(w.type!=="SHORTANSWER"||!Number.isInteger(w.choose)||w.choose<1||w.choose>=w.questions.length)&&c("INVALID_OPTIONAL",`${S}.reference.choose`,"选做题须为解答题,且选做数量小于总题数"),w.type==="CCOMPOSITION"&&w.questions.length>1&&c("INVALID_COUNT",`${S}.reference.questions`,"语文作文每组只能有一道题"),w.questions.forEach((j,R)=>{a={blockId:v.id,questionId:j.id};const O=`${S}.reference.questions.${R}`,M=aa[j.type];u(j.id,`${O}.id`),w.type!=="MIXED"&&w.type!==j.type&&c("TYPE_MISMATCH",`${O}.type`,"题目类型与题块不一致"),j.choice.id!==j.id&&c("INVALID_BINDING",`${O}.choice.id`,"题目与填涂项 ID 不一致");const D=Le(j.type)||["FILLBLANK","SHORTANSWER"].includes(j.type);(D&&(j.parts.length<1||j.parts.length>M.parts)||!D&&j.parts.length)&&c("INVALID_PARTS",`${O}.parts`,`子题/空数须为 ${D?`1–${M.parts}`:"0"}`),j.parts.length?j.score!==Vn(j.parts)&&c("SCORE_MISMATCH",`${O}.score`,"总分与子题分值之和不一致"):d(j.score,M.score,`${O}.score`),wt(j.type)&&!Le(j.type)&&m(j.choice,M.options,`${O}.choice`),j.type==="INFO_MATCHING"&&(m(j.choice,M.options,`${O}.choice`),j.parts.length>j.choice.options.length&&c("INVALID_OPTIONS",`${O}.choice.options`,"信息匹配的选项数不能少于子题数")),j.type==="MCHOICE"&&(!Number.isFinite(j.choice.lessScore)||j.choice.lessScore<0||j.choice.lessScore>(j.score||0)||!Number.isInteger(j.choice.lessScore*2))&&c("INVALID_LESS_SCORE",`${O}.choice.lessScore`,"少选得分须按 0.5 分递增且不能超过本题分值"),j.type==="CHUNK_CHOICE"&&(!j.rightAnswers||!Number.isInteger(j.rightAnswers)||j.rightAnswers>=j.choice.options.length||!j.singleScore||j.singleScore<.5||!Number.isInteger(j.singleScore*2)||j.score!==0&&j.singleScore*j.rightAnswers>(j.score||0))&&c("INVALID_CHUNK_SCORE",O,"请检查正确答案个数及每处得分"),j.type==="CCOMPOSITION"&&(!Number.isInteger(j.characters)||j.characters<1||j.characters>1200)&&c("INVALID_GRID_COUNT",`${O}.characters`,"作文格数须为 1–1200"),j.type==="ECOMPOSITION"&&(!Number.isInteger(j.lines)||j.lines<1||j.lines>100)&&c("INVALID_LINE_COUNT",`${O}.lines`,"作文行数须为 1–100"),t.questionCard&&p(j.text,`${O}.text`,["SCHOICE","MCHOICE"].includes(j.type),j.choice.options.length),j.parts.forEach((_,I)=>{const z=`${O}.parts.${I}`;a={blockId:v.id,questionId:_.id},u(_.id,`${z}.id`),d(_.score,M.score,`${z}.score`),Le(j.type)&&wt(j.type)&&(m(_.choice,M.options,`${z}.choice`),_.choice.id!==_.id&&c("INVALID_BINDING",`${z}.choice.id`,"子题与填涂项 ID 不一致")),t.questionCard&&["CLOZE","READTHENANSWER"].includes(j.type)&&p(_.text,`${z}.text`,!0,_.choice.options.length,j.type==="READTHENANSWER")})}),a={blockId:v.id},t.questionCard&&w.layout.presentation!=="concentrated"){const j=w.questions.filter(O=>wt(O.type)).flatMap(O=>Le(O.type)?O.parts.map(M=>M.choice):[O.choice]);na({...w.layout,questions:j},v.document,!0).concentrated.questions.length&&c("MISSING_FILL_TARGET",`${S}.reference.layout.presentation`,"部分填涂框没有对应的题干或选项位置")}}),a={};const C=(v,x)=>{v.type==="image"&&(!v.attrs?.src||/^blob:/i.test(v.attrs.src))&&c("INVALID_IMAGE_URL",x,"图片缺少可保存的地址,请上传后使用持久 URL 或内嵌图片"),["formula","blockFormula"].includes(v.type||"")&&!String(v.attrs?.latex||"").trim()&&c("EMPTY_FORMULA",x,"请填写公式或删除空公式"),v.content?.forEach((S,w)=>C(S,`${x}.content.${w}`))},g=(v,x)=>{v&&C(v.content,`${x}.content`)},b=(v,x)=>{g(v?.content,`${x}.content`),v?.itemsContent.forEach((S,w)=>g(S.content,`${x}.itemsContent.${w}.content`))};return g(t.paperTitle?.document,"paperTitle.document"),t.blocks.forEach((v,x)=>{a={blockId:v.id};const S=`blocks.${x}`;g(v.document,`${S}.document`),g(v.reference?.material,`${S}.reference.material`),v.reference?.questions.forEach((w,T)=>{a={blockId:v.id,questionId:w.id};const j=`blocks.${x}.reference.questions.${T}`;g(w.document,`${j}.document`),b(w.text,`${j}.text`),w.parts.forEach((R,O)=>{a={blockId:v.id,questionId:R.id},g(R.document,`${j}.parts.${O}.document`),b(R.text,`${j}.parts.${O}.text`)})})}),{valid:i.length===0,issues:i}}function xu(t){if(t!==void 0)try{const r=Jc(t);return{grades:r.grades,gradeCourseMap:r.gradeCourseMap,defaultGradeCode:r.defaultGradeCode||void 0,defaultCourseCode:r.defaultCourseCode||void 0}}catch(r){throw r instanceof Wc?new ca([{code:"INVALID_DICTIONARIES",path:r.path,message:r.message}]):r}}function US(t,r){const i=(M,D)=>{throw new ca([{code:"INVALID_INITIALIZATION",path:M,message:D}])},a=(M,D,_)=>{if(!M||typeof M!="object"||Array.isArray(M))return i(D,"初始化配置必须是对象");const I=Object.entries(M);for(const[z]of I)_.includes(z)||i(`${D}.${z}`,"不支持的初始化字段");return Object.fromEntries(I.filter(([,z])=>z!==void 0))},c=(M,D)=>typeof M!="string"||!M.trim()?i(D,"请提供非空的试卷名称、年级和学科"):M.trim(),l=(M,D,_)=>{M!==void 0&&!_.includes(M)&&i(D,`可选值为 ${_.join("、")}`)},u=(M,D)=>{M!==void 0&&typeof M!="boolean"&&i(D,"请使用布尔值")},d=(M,D,_,I)=>{M!==void 0&&(typeof M!="number"||!Number.isFinite(M)||M<_||M>I)&&i(D,`数值必须在 ${_}–${I} 之间`)},m=a(t,"initialization",["name","grade","subject","gradeCode","courseCode","subjectCode","mode","id","exampaperId","createMode","layout","header","recognition"]),p=c(m.name,"initialization.name");p.length>30&&i("initialization.name","试卷名称最多 30 个字符");const C=Jc(xu(r)),g=m.gradeCode!==void 0||m.courseCode!==void 0||m.subjectCode!==void 0;let b;if(g){try{b=hi(C,c(m.gradeCode,"initialization.gradeCode"),c(m.courseCode,"initialization.courseCode"))}catch(M){if(M instanceof Wc)return i(M.path,M.message);throw M}for(const M of["grade","subject","subjectCode"])m[M]!==void 0&&c(m[M],`initialization.${M}`)!==b[M]&&i(`initialization.${M}`,"名称或学科编码与课程字典不一致")}else{const M=c(m.grade,"initialization.grade"),D=c(m.subject,"initialization.subject"),_=C.grades.filter(H=>H.label===M);_.length>1&&i("initialization.grade","同名年级不唯一,请使用 gradeCode");const I=_[0],z=I?C.gradeCourseMap[I.value].filter(H=>H.label===D):[];z.length>1&&i("initialization.subject","同名课程不唯一,请使用 courseCode"),r&&(!I||!z.length)&&i(I?"initialization.subject":"initialization.grade","名称不在可用字典中,请使用年级和课程编码"),b=I&&z.length?hi(C,I.value,z[0].value):{grade:M,subject:D}}l(m.mode,"initialization.mode",["template","exam"]),l(m.createMode,"initialization.createMode",["MANUALLY","IMPORTED","THIRD"]);const v={};for(const M of["id","exampaperId"])if(m[M]!==void 0){const D=m[M];typeof D=="string"?v[M]=c(D,`initialization.${M}`):typeof D=="number"&&Number.isSafeInteger(D)&&D>=0?v[M]=D:i(`initialization.${M}`,"ID 必须是非空字符串或非负安全整数")}m.createMode!==void 0&&(v.createMode=m.createMode);const x=m.layout===void 0?{}:a(m.layout,"initialization.layout",["usage","preset","margin","gap","questionCard","scanMarking","halfPoint","choiceDirection","mergeObjective","pageNum","quesCard","scoreType","choiceType","mixOb"]),S=(M,D,_)=>{x[M]!==void 0&&(x[D]!==void 0&&x[D]!==_&&i(`initialization.layout.${M}`,`与 ${D} 设置冲突`),x[D]=_,delete x[M])};x.pageNum!==void 0&&![1,2,3].includes(x.pageNum)&&i("initialization.layout.pageNum","分栏数为 1、2 或 3"),S("pageNum","preset",{1:"a4",2:"a3-two",3:"a3-three"}[x.pageNum]);for(const[M,D]of[["quesCard","questionCard"],["scoreType","halfPoint"],["mixOb","mergeObjective"],["choiceType","choiceDirection"]])u(x[M],`initialization.layout.${M}`),S(M,D,M==="choiceType"?x[M]?"column":"row":x[M]);l(x.preset,"initialization.layout.preset",["a4","a3-two","a3-three"]),l(x.usage,"initialization.layout.usage",["exam","homework"]),l(x.choiceDirection,"initialization.layout.choiceDirection",["row","column"]),d(x.margin,"initialization.layout.margin",0,100),d(x.gap,"initialization.layout.gap",0,100);for(const M of["questionCard","scanMarking","halfPoint","mergeObjective"])u(x[M],`initialization.layout.${M}`);const w=m.header===void 0?{}:a(m.header,"initialization.header",["focusText","writeKaohao","missExam","mifeng","kaohao","weishu","tiaomaStyle","classText"]);for(const M of["focusText","writeKaohao","missExam","mifeng","classText"])u(w[M],`initialization.header.${M}`);w.tiaomaStyle!==void 0&&![1,2].includes(w.tiaomaStyle)&&i("initialization.header.tiaomaStyle","考号版式为 1(填涂)或 2(条形码)"),l(w.kaohao,"initialization.header.kaohao",["school","code"]),d(w.weishu,"initialization.header.weishu",4,12),w.weishu!==void 0&&!Number.isInteger(w.weishu)&&i("initialization.header.weishu","考号位数必须是整数");const T=uu({name:p,...b,...v,mode:m.mode??"template"}),j=m.recognition===void 0?void 0:a(m.recognition,"initialization.recognition",["examQrCode","subjectMarkers","pointBlack"]);if(j)for(const M of["examQrCode","subjectMarkers","pointBlack"])u(j[M],`initialization.recognition.${M}`);const R={...T,...x,header:{...T.header,...w},...j?{recognition:j}:{}},O=du(R);return(O.columnWidth<100||O.contentHeight<100)&&i("initialization.layout","边距或栏间距过大,纸张没有足够的作答区域"),R}function $S(t,r){if(typeof document>"u")throw new Error("请在浏览器挂载后创建制卡实例");const i=zs(r?.plugins||[]),a=xu(r.dictionaries),c=typeof t=="string"?document.querySelector(t):t;if(!(c instanceof HTMLElement)||c.ownerDocument!==document||/^(INPUT|TEXTAREA|SELECT|BUTTON|IMG|CANVAS|IFRAME)$/.test(c.tagName))throw new Error("制卡需要一个空的 HTML 容器,例如 div");if(document.querySelector("[data-uni-answer-sheet-mount], #uni-answer-sheet"))throw new Error("当前文档已挂载制卡工作区;切换容器前请先 destroy()");if(c.textContent?.trim()||c.children.length)throw new Error("请提供空容器,已有题卡请通过 initialValue 传入");const l=document.createElement("div");l.className="uni-answer-sheet-host",l.dataset.uniAnswerSheetMount="",l.style.height="100%",c.append(l);let u=!1,d={...r,dictionaries:a},m,p,C;const g=new Promise((S,w)=>{p=S,C=w});g.catch(()=>{});const b=()=>{if(u)throw new Error("制卡实例已销毁");if(!m?.isReady())throw new Error("请先等待 sheet.ready");return m},v=async()=>(await g,b()),x={ready:g,async initialize(S){if(u)throw new Error("制卡实例已销毁");const w=US(S,d.dictionaries);m||(d={...d,initialValue:w}),await(await v()).setDocument(w)},getDocument:()=>b().getDocument(),load:async S=>(await v()).setDocument(S),setDocument:async S=>(await v()).setDocument(S),newDocument:async S=>(await v()).newDocument(S),getReferenceData:()=>b().getReferenceData(),setReferenceData:async S=>(await v()).setReferenceData(S),validate:async()=>(await v()).validate(),save:async()=>(await v()).save(),getRecognitionData:async()=>(await v()).getRecognitionData(),focusIssue:S=>b().focusIssue(S),setOptions(S){if(u)throw new Error("制卡实例已销毁");const w=Object.hasOwn(S,"dictionaries")?xu(S.dictionaries):d.dictionaries;d={...d,...S,dictionaries:w},m?.update(d)},destroy(){u||(u=!0,m?.destroy(),l.remove(),C(new DOMException("制卡实例已销毁","AbortError")))}};return Promise.all([i.prepare(),Promise.resolve().then(()=>hO)]).then(([,{mountAnswerSheet:S}])=>{u||(m=S(l,i,d,p,w=>{C(w),x.destroy(),d.onError?.(w instanceof Error?w:new Error(String(w)))}))}).catch(S=>{C(S),x.destroy(),d.onError?.(S instanceof Error?S:new Error(String(S)))}),x}function Dm(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var vu={exports:{}},Ei={};/**
4
+ * @license React
5
+ * react-jsx-runtime.production.js
6
+ *
7
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
8
+ *
9
+ * This source code is licensed under the MIT license found in the
10
+ * LICENSE file in the root directory of this source tree.
11
+ */var Im;function GS(){if(Im)return Ei;Im=1;var t=Symbol.for("react.transitional.element"),r=Symbol.for("react.fragment");function i(a,c,l){var u=null;if(l!==void 0&&(u=""+l),c.key!==void 0&&(u=""+c.key),"key"in c){l={};for(var d in c)d!=="key"&&(l[d]=c[d])}else l=c;return c=l.ref,{$$typeof:t,type:a,key:u,ref:c!==void 0?c:null,props:l}}return Ei.Fragment=r,Ei.jsx=i,Ei.jsxs=i,Ei}var km;function VS(){return km||(km=1,vu.exports=GS()),vu.exports}var f=VS(),Su={exports:{}},Ne={};/**
12
+ * @license React
13
+ * react.production.js
14
+ *
15
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
16
+ *
17
+ * This source code is licensed under the MIT license found in the
18
+ * LICENSE file in the root directory of this source tree.
19
+ */var Lm;function qS(){if(Lm)return Ne;Lm=1;var t=Symbol.for("react.transitional.element"),r=Symbol.for("react.portal"),i=Symbol.for("react.fragment"),a=Symbol.for("react.strict_mode"),c=Symbol.for("react.profiler"),l=Symbol.for("react.consumer"),u=Symbol.for("react.context"),d=Symbol.for("react.forward_ref"),m=Symbol.for("react.suspense"),p=Symbol.for("react.memo"),C=Symbol.for("react.lazy"),g=Symbol.iterator;function b(N){return N===null||typeof N!="object"?null:(N=g&&N[g]||N["@@iterator"],typeof N=="function"?N:null)}var v={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},x=Object.assign,S={};function w(N,K,ne){this.props=N,this.context=K,this.refs=S,this.updater=ne||v}w.prototype.isReactComponent={},w.prototype.setState=function(N,K){if(typeof N!="object"&&typeof N!="function"&&N!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,N,K,"setState")},w.prototype.forceUpdate=function(N){this.updater.enqueueForceUpdate(this,N,"forceUpdate")};function T(){}T.prototype=w.prototype;function j(N,K,ne){this.props=N,this.context=K,this.refs=S,this.updater=ne||v}var R=j.prototype=new T;R.constructor=j,x(R,w.prototype),R.isPureReactComponent=!0;var O=Array.isArray,M={H:null,A:null,T:null,S:null,V:null},D=Object.prototype.hasOwnProperty;function _(N,K,ne,te,le,oe){return ne=oe.ref,{$$typeof:t,type:N,key:K,ref:ne!==void 0?ne:null,props:oe}}function I(N,K){return _(N.type,K,void 0,void 0,void 0,N.props)}function z(N){return typeof N=="object"&&N!==null&&N.$$typeof===t}function H(N){var K={"=":"=0",":":"=2"};return"$"+N.replace(/[=:]/g,function(ne){return K[ne]})}var L=/\/+/g;function $(N,K){return typeof N=="object"&&N!==null&&N.key!=null?H(""+N.key):K.toString(36)}function Y(){}function U(N){switch(N.status){case"fulfilled":return N.value;case"rejected":throw N.reason;default:switch(typeof N.status=="string"?N.then(Y,Y):(N.status="pending",N.then(function(K){N.status==="pending"&&(N.status="fulfilled",N.value=K)},function(K){N.status==="pending"&&(N.status="rejected",N.reason=K)})),N.status){case"fulfilled":return N.value;case"rejected":throw N.reason}}throw N}function q(N,K,ne,te,le){var oe=typeof N;(oe==="undefined"||oe==="boolean")&&(N=null);var ae=!1;if(N===null)ae=!0;else switch(oe){case"bigint":case"string":case"number":ae=!0;break;case"object":switch(N.$$typeof){case t:case r:ae=!0;break;case C:return ae=N._init,q(ae(N._payload),K,ne,te,le)}}if(ae)return le=le(N),ae=te===""?"."+$(N,0):te,O(le)?(ne="",ae!=null&&(ne=ae.replace(L,"$&/")+"/"),q(le,K,ne,"",function(ge){return ge})):le!=null&&(z(le)&&(le=I(le,ne+(le.key==null||N&&N.key===le.key?"":(""+le.key).replace(L,"$&/")+"/")+ae)),K.push(le)),1;ae=0;var xe=te===""?".":te+":";if(O(N))for(var we=0;we<N.length;we++)te=N[we],oe=xe+$(te,we),ae+=q(te,K,ne,oe,le);else if(we=b(N),typeof we=="function")for(N=we.call(N),we=0;!(te=N.next()).done;)te=te.value,oe=xe+$(te,we++),ae+=q(te,K,ne,oe,le);else if(oe==="object"){if(typeof N.then=="function")return q(U(N),K,ne,te,le);throw K=String(N),Error("Objects are not valid as a React child (found: "+(K==="[object Object]"?"object with keys {"+Object.keys(N).join(", ")+"}":K)+"). If you meant to render a collection of children, use an array instead.")}return ae}function P(N,K,ne){if(N==null)return N;var te=[],le=0;return q(N,te,"","",function(oe){return K.call(ne,oe,le++)}),te}function G(N){if(N._status===-1){var K=N._result;K=K(),K.then(function(ne){(N._status===0||N._status===-1)&&(N._status=1,N._result=ne)},function(ne){(N._status===0||N._status===-1)&&(N._status=2,N._result=ne)}),N._status===-1&&(N._status=0,N._result=K)}if(N._status===1)return N._result.default;throw N._result}var B=typeof reportError=="function"?reportError:function(N){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var K=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof N=="object"&&N!==null&&typeof N.message=="string"?String(N.message):String(N),error:N});if(!window.dispatchEvent(K))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",N);return}console.error(N)};function Q(){}return Ne.Children={map:P,forEach:function(N,K,ne){P(N,function(){K.apply(this,arguments)},ne)},count:function(N){var K=0;return P(N,function(){K++}),K},toArray:function(N){return P(N,function(K){return K})||[]},only:function(N){if(!z(N))throw Error("React.Children.only expected to receive a single React element child.");return N}},Ne.Component=w,Ne.Fragment=i,Ne.Profiler=c,Ne.PureComponent=j,Ne.StrictMode=a,Ne.Suspense=m,Ne.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=M,Ne.__COMPILER_RUNTIME={__proto__:null,c:function(N){return M.H.useMemoCache(N)}},Ne.cache=function(N){return function(){return N.apply(null,arguments)}},Ne.cloneElement=function(N,K,ne){if(N==null)throw Error("The argument must be a React element, but you passed "+N+".");var te=x({},N.props),le=N.key,oe=void 0;if(K!=null)for(ae in K.ref!==void 0&&(oe=void 0),K.key!==void 0&&(le=""+K.key),K)!D.call(K,ae)||ae==="key"||ae==="__self"||ae==="__source"||ae==="ref"&&K.ref===void 0||(te[ae]=K[ae]);var ae=arguments.length-2;if(ae===1)te.children=ne;else if(1<ae){for(var xe=Array(ae),we=0;we<ae;we++)xe[we]=arguments[we+2];te.children=xe}return _(N.type,le,void 0,void 0,oe,te)},Ne.createContext=function(N){return N={$$typeof:u,_currentValue:N,_currentValue2:N,_threadCount:0,Provider:null,Consumer:null},N.Provider=N,N.Consumer={$$typeof:l,_context:N},N},Ne.createElement=function(N,K,ne){var te,le={},oe=null;if(K!=null)for(te in K.key!==void 0&&(oe=""+K.key),K)D.call(K,te)&&te!=="key"&&te!=="__self"&&te!=="__source"&&(le[te]=K[te]);var ae=arguments.length-2;if(ae===1)le.children=ne;else if(1<ae){for(var xe=Array(ae),we=0;we<ae;we++)xe[we]=arguments[we+2];le.children=xe}if(N&&N.defaultProps)for(te in ae=N.defaultProps,ae)le[te]===void 0&&(le[te]=ae[te]);return _(N,oe,void 0,void 0,null,le)},Ne.createRef=function(){return{current:null}},Ne.forwardRef=function(N){return{$$typeof:d,render:N}},Ne.isValidElement=z,Ne.lazy=function(N){return{$$typeof:C,_payload:{_status:-1,_result:N},_init:G}},Ne.memo=function(N,K){return{$$typeof:p,type:N,compare:K===void 0?null:K}},Ne.startTransition=function(N){var K=M.T,ne={};M.T=ne;try{var te=N(),le=M.S;le!==null&&le(ne,te),typeof te=="object"&&te!==null&&typeof te.then=="function"&&te.then(Q,B)}catch(oe){B(oe)}finally{M.T=K}},Ne.unstable_useCacheRefresh=function(){return M.H.useCacheRefresh()},Ne.use=function(N){return M.H.use(N)},Ne.useActionState=function(N,K,ne){return M.H.useActionState(N,K,ne)},Ne.useCallback=function(N,K){return M.H.useCallback(N,K)},Ne.useContext=function(N){return M.H.useContext(N)},Ne.useDebugValue=function(){},Ne.useDeferredValue=function(N,K){return M.H.useDeferredValue(N,K)},Ne.useEffect=function(N,K,ne){var te=M.H;if(typeof ne=="function")throw Error("useEffect CRUD overload is not enabled in this build of React.");return te.useEffect(N,K)},Ne.useId=function(){return M.H.useId()},Ne.useImperativeHandle=function(N,K,ne){return M.H.useImperativeHandle(N,K,ne)},Ne.useInsertionEffect=function(N,K){return M.H.useInsertionEffect(N,K)},Ne.useLayoutEffect=function(N,K){return M.H.useLayoutEffect(N,K)},Ne.useMemo=function(N,K){return M.H.useMemo(N,K)},Ne.useOptimistic=function(N,K){return M.H.useOptimistic(N,K)},Ne.useReducer=function(N,K,ne){return M.H.useReducer(N,K,ne)},Ne.useRef=function(N){return M.H.useRef(N)},Ne.useState=function(N){return M.H.useState(N)},Ne.useSyncExternalStore=function(N,K,ne){return M.H.useSyncExternalStore(N,K,ne)},Ne.useTransition=function(){return M.H.useTransition()},Ne.version="19.1.1",Ne}var zm;function Cu(){return zm||(zm=1,Su.exports=qS()),Su.exports}var E=Cu();const Ti=Dm(E),wo=ct({__proto__:null,default:Ti},[E]);var wu={exports:{}},ji={},Eu={exports:{}},Tu={};/**
20
+ * @license React
21
+ * scheduler.production.js
22
+ *
23
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
24
+ *
25
+ * This source code is licensed under the MIT license found in the
26
+ * LICENSE file in the root directory of this source tree.
27
+ */var Bm;function YS(){return Bm||(Bm=1,(function(t){function r(P,G){var B=P.length;P.push(G);e:for(;0<B;){var Q=B-1>>>1,N=P[Q];if(0<c(N,G))P[Q]=G,P[B]=N,B=Q;else break e}}function i(P){return P.length===0?null:P[0]}function a(P){if(P.length===0)return null;var G=P[0],B=P.pop();if(B!==G){P[0]=B;e:for(var Q=0,N=P.length,K=N>>>1;Q<K;){var ne=2*(Q+1)-1,te=P[ne],le=ne+1,oe=P[le];if(0>c(te,B))le<N&&0>c(oe,te)?(P[Q]=oe,P[le]=B,Q=le):(P[Q]=te,P[ne]=B,Q=ne);else if(le<N&&0>c(oe,B))P[Q]=oe,P[le]=B,Q=le;else break e}}return G}function c(P,G){var B=P.sortIndex-G.sortIndex;return B!==0?B:P.id-G.id}if(t.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var l=performance;t.unstable_now=function(){return l.now()}}else{var u=Date,d=u.now();t.unstable_now=function(){return u.now()-d}}var m=[],p=[],C=1,g=null,b=3,v=!1,x=!1,S=!1,w=!1,T=typeof setTimeout=="function"?setTimeout:null,j=typeof clearTimeout=="function"?clearTimeout:null,R=typeof setImmediate<"u"?setImmediate:null;function O(P){for(var G=i(p);G!==null;){if(G.callback===null)a(p);else if(G.startTime<=P)a(p),G.sortIndex=G.expirationTime,r(m,G);else break;G=i(p)}}function M(P){if(S=!1,O(P),!x)if(i(m)!==null)x=!0,D||(D=!0,$());else{var G=i(p);G!==null&&q(M,G.startTime-P)}}var D=!1,_=-1,I=5,z=-1;function H(){return w?!0:!(t.unstable_now()-z<I)}function L(){if(w=!1,D){var P=t.unstable_now();z=P;var G=!0;try{e:{x=!1,S&&(S=!1,j(_),_=-1),v=!0;var B=b;try{t:{for(O(P),g=i(m);g!==null&&!(g.expirationTime>P&&H());){var Q=g.callback;if(typeof Q=="function"){g.callback=null,b=g.priorityLevel;var N=Q(g.expirationTime<=P);if(P=t.unstable_now(),typeof N=="function"){g.callback=N,O(P),G=!0;break t}g===i(m)&&a(m),O(P)}else a(m);g=i(m)}if(g!==null)G=!0;else{var K=i(p);K!==null&&q(M,K.startTime-P),G=!1}}break e}finally{g=null,b=B,v=!1}G=void 0}}finally{G?$():D=!1}}}var $;if(typeof R=="function")$=function(){R(L)};else if(typeof MessageChannel<"u"){var Y=new MessageChannel,U=Y.port2;Y.port1.onmessage=L,$=function(){U.postMessage(null)}}else $=function(){T(L,0)};function q(P,G){_=T(function(){P(t.unstable_now())},G)}t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(P){P.callback=null},t.unstable_forceFrameRate=function(P){0>P||125<P?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):I=0<P?Math.floor(1e3/P):5},t.unstable_getCurrentPriorityLevel=function(){return b},t.unstable_next=function(P){switch(b){case 1:case 2:case 3:var G=3;break;default:G=b}var B=b;b=G;try{return P()}finally{b=B}},t.unstable_requestPaint=function(){w=!0},t.unstable_runWithPriority=function(P,G){switch(P){case 1:case 2:case 3:case 4:case 5:break;default:P=3}var B=b;b=P;try{return G()}finally{b=B}},t.unstable_scheduleCallback=function(P,G,B){var Q=t.unstable_now();switch(typeof B=="object"&&B!==null?(B=B.delay,B=typeof B=="number"&&0<B?Q+B:Q):B=Q,P){case 1:var N=-1;break;case 2:N=250;break;case 5:N=1073741823;break;case 4:N=1e4;break;default:N=5e3}return N=B+N,P={id:C++,callback:G,priorityLevel:P,startTime:B,expirationTime:N,sortIndex:-1},B>Q?(P.sortIndex=B,r(p,P),i(m)===null&&P===i(p)&&(S?(j(_),_=-1):S=!0,q(M,B-Q))):(P.sortIndex=N,r(m,P),x||v||(x=!0,D||(D=!0,$()))),P},t.unstable_shouldYield=H,t.unstable_wrapCallback=function(P){var G=b;return function(){var B=b;b=G;try{return P.apply(this,arguments)}finally{b=B}}}})(Tu)),Tu}var Hm;function XS(){return Hm||(Hm=1,Eu.exports=YS()),Eu.exports}var ju={exports:{}},Vt={};/**
28
+ * @license React
29
+ * react-dom.production.js
30
+ *
31
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
32
+ *
33
+ * This source code is licensed under the MIT license found in the
34
+ * LICENSE file in the root directory of this source tree.
35
+ */var Pm;function KS(){if(Pm)return Vt;Pm=1;var t=Cu();function r(m){var p="https://react.dev/errors/"+m;if(1<arguments.length){p+="?args[]="+encodeURIComponent(arguments[1]);for(var C=2;C<arguments.length;C++)p+="&args[]="+encodeURIComponent(arguments[C])}return"Minified React error #"+m+"; visit "+p+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function i(){}var a={d:{f:i,r:function(){throw Error(r(522))},D:i,C:i,L:i,m:i,X:i,S:i,M:i},p:0,findDOMNode:null},c=Symbol.for("react.portal");function l(m,p,C){var g=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:c,key:g==null?null:""+g,children:m,containerInfo:p,implementation:C}}var u=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function d(m,p){if(m==="font")return"";if(typeof p=="string")return p==="use-credentials"?p:""}return Vt.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=a,Vt.createPortal=function(m,p){var C=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!p||p.nodeType!==1&&p.nodeType!==9&&p.nodeType!==11)throw Error(r(299));return l(m,p,null,C)},Vt.flushSync=function(m){var p=u.T,C=a.p;try{if(u.T=null,a.p=2,m)return m()}finally{u.T=p,a.p=C,a.d.f()}},Vt.preconnect=function(m,p){typeof m=="string"&&(p?(p=p.crossOrigin,p=typeof p=="string"?p==="use-credentials"?p:"":void 0):p=null,a.d.C(m,p))},Vt.prefetchDNS=function(m){typeof m=="string"&&a.d.D(m)},Vt.preinit=function(m,p){if(typeof m=="string"&&p&&typeof p.as=="string"){var C=p.as,g=d(C,p.crossOrigin),b=typeof p.integrity=="string"?p.integrity:void 0,v=typeof p.fetchPriority=="string"?p.fetchPriority:void 0;C==="style"?a.d.S(m,typeof p.precedence=="string"?p.precedence:void 0,{crossOrigin:g,integrity:b,fetchPriority:v}):C==="script"&&a.d.X(m,{crossOrigin:g,integrity:b,fetchPriority:v,nonce:typeof p.nonce=="string"?p.nonce:void 0})}},Vt.preinitModule=function(m,p){if(typeof m=="string")if(typeof p=="object"&&p!==null){if(p.as==null||p.as==="script"){var C=d(p.as,p.crossOrigin);a.d.M(m,{crossOrigin:C,integrity:typeof p.integrity=="string"?p.integrity:void 0,nonce:typeof p.nonce=="string"?p.nonce:void 0})}}else p==null&&a.d.M(m)},Vt.preload=function(m,p){if(typeof m=="string"&&typeof p=="object"&&p!==null&&typeof p.as=="string"){var C=p.as,g=d(C,p.crossOrigin);a.d.L(m,C,{crossOrigin:g,integrity:typeof p.integrity=="string"?p.integrity:void 0,nonce:typeof p.nonce=="string"?p.nonce:void 0,type:typeof p.type=="string"?p.type:void 0,fetchPriority:typeof p.fetchPriority=="string"?p.fetchPriority:void 0,referrerPolicy:typeof p.referrerPolicy=="string"?p.referrerPolicy:void 0,imageSrcSet:typeof p.imageSrcSet=="string"?p.imageSrcSet:void 0,imageSizes:typeof p.imageSizes=="string"?p.imageSizes:void 0,media:typeof p.media=="string"?p.media:void 0})}},Vt.preloadModule=function(m,p){if(typeof m=="string")if(p){var C=d(p.as,p.crossOrigin);a.d.m(m,{as:typeof p.as=="string"&&p.as!=="script"?p.as:void 0,crossOrigin:C,integrity:typeof p.integrity=="string"?p.integrity:void 0})}else a.d.m(m)},Vt.requestFormReset=function(m){a.d.r(m)},Vt.unstable_batchedUpdates=function(m,p){return m(p)},Vt.useFormState=function(m,p,C){return u.H.useFormState(m,p,C)},Vt.useFormStatus=function(){return u.H.useHostTransitionStatus()},Vt.version="19.1.1",Vt}var Um;function $m(){if(Um)return ju.exports;Um=1;function t(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(r){console.error(r)}}return t(),ju.exports=KS(),ju.exports}/**
36
+ * @license React
37
+ * react-dom-client.production.js
38
+ *
39
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
40
+ *
41
+ * This source code is licensed under the MIT license found in the
42
+ * LICENSE file in the root directory of this source tree.
43
+ */var Gm;function QS(){if(Gm)return ji;Gm=1;var t=XS(),r=Cu(),i=$m();function a(e){var n="https://react.dev/errors/"+e;if(1<arguments.length){n+="?args[]="+encodeURIComponent(arguments[1]);for(var o=2;o<arguments.length;o++)n+="&args[]="+encodeURIComponent(arguments[o])}return"Minified React error #"+e+"; visit "+n+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function c(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function l(e){var n=e,o=e;if(e.alternate)for(;n.return;)n=n.return;else{e=n;do n=e,(n.flags&4098)!==0&&(o=n.return),e=n.return;while(e)}return n.tag===3?o:null}function u(e){if(e.tag===13){var n=e.memoizedState;if(n===null&&(e=e.alternate,e!==null&&(n=e.memoizedState)),n!==null)return n.dehydrated}return null}function d(e){if(l(e)!==e)throw Error(a(188))}function m(e){var n=e.alternate;if(!n){if(n=l(e),n===null)throw Error(a(188));return n!==e?null:e}for(var o=e,s=n;;){var h=o.return;if(h===null)break;var y=h.alternate;if(y===null){if(s=h.return,s!==null){o=s;continue}break}if(h.child===y.child){for(y=h.child;y;){if(y===o)return d(h),e;if(y===s)return d(h),n;y=y.sibling}throw Error(a(188))}if(o.return!==s.return)o=h,s=y;else{for(var A=!1,k=h.child;k;){if(k===o){A=!0,o=h,s=y;break}if(k===s){A=!0,s=h,o=y;break}k=k.sibling}if(!A){for(k=y.child;k;){if(k===o){A=!0,o=y,s=h;break}if(k===s){A=!0,s=y,o=h;break}k=k.sibling}if(!A)throw Error(a(189))}}if(o.alternate!==s)throw Error(a(190))}if(o.tag!==3)throw Error(a(188));return o.stateNode.current===o?e:n}function p(e){var n=e.tag;if(n===5||n===26||n===27||n===6)return e;for(e=e.child;e!==null;){if(n=p(e),n!==null)return n;e=e.sibling}return null}var C=Object.assign,g=Symbol.for("react.element"),b=Symbol.for("react.transitional.element"),v=Symbol.for("react.portal"),x=Symbol.for("react.fragment"),S=Symbol.for("react.strict_mode"),w=Symbol.for("react.profiler"),T=Symbol.for("react.provider"),j=Symbol.for("react.consumer"),R=Symbol.for("react.context"),O=Symbol.for("react.forward_ref"),M=Symbol.for("react.suspense"),D=Symbol.for("react.suspense_list"),_=Symbol.for("react.memo"),I=Symbol.for("react.lazy"),z=Symbol.for("react.activity"),H=Symbol.for("react.memo_cache_sentinel"),L=Symbol.iterator;function $(e){return e===null||typeof e!="object"?null:(e=L&&e[L]||e["@@iterator"],typeof e=="function"?e:null)}var Y=Symbol.for("react.client.reference");function U(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===Y?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case x:return"Fragment";case w:return"Profiler";case S:return"StrictMode";case M:return"Suspense";case D:return"SuspenseList";case z:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case v:return"Portal";case R:return(e.displayName||"Context")+".Provider";case j:return(e._context.displayName||"Context")+".Consumer";case O:var n=e.render;return e=e.displayName,e||(e=n.displayName||n.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case _:return n=e.displayName||null,n!==null?n:U(e.type)||"Memo";case I:n=e._payload,e=e._init;try{return U(e(n))}catch{}}return null}var q=Array.isArray,P=r.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,G=i.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,B={pending:!1,data:null,method:null,action:null},Q=[],N=-1;function K(e){return{current:e}}function ne(e){0>N||(e.current=Q[N],Q[N]=null,N--)}function te(e,n){N++,Q[N]=e.current,e.current=n}var le=K(null),oe=K(null),ae=K(null),xe=K(null);function we(e,n){switch(te(ae,n),te(oe,e),te(le,null),n.nodeType){case 9:case 11:e=(e=n.documentElement)&&(e=e.namespaceURI)?v1(e):0;break;default:if(e=n.tagName,n=n.namespaceURI)n=v1(n),e=S1(n,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}ne(le),te(le,e)}function ge(){ne(le),ne(oe),ne(ae)}function de(e){e.memoizedState!==null&&te(xe,e);var n=le.current,o=S1(n,e.type);n!==o&&(te(oe,e),te(le,o))}function Me(e){oe.current===e&&(ne(le),ne(oe)),xe.current===e&&(ne(xe),_s._currentValue=B)}var Be=Object.prototype.hasOwnProperty,Ae=t.unstable_scheduleCallback,Se=t.unstable_cancelCallback,Ce=t.unstable_shouldYield,Ot=t.unstable_requestPaint,dt=t.unstable_now,be=t.unstable_getCurrentPriorityLevel,gt=t.unstable_ImmediatePriority,ot=t.unstable_UserBlockingPriority,Wt=t.unstable_NormalPriority,yr=t.unstable_LowPriority,ja=t.unstable_IdlePriority,Aa=t.log,Kr=t.unstable_setDisableYieldValue,br=null,zt=null;function zn(e){if(typeof Aa=="function"&&Kr(e),zt&&typeof zt.setStrictMode=="function")try{zt.setStrictMode(br,e)}catch{}}var Yt=Math.clz32?Math.clz32:he,fe=Math.log,ue=Math.LN2;function he(e){return e>>>=0,e===0?32:31-(fe(e)/ue|0)|0}var $e=256,Ze=4194304;function Oe(e){var n=e&42;if(n!==0)return n;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194048;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function Nt(e,n,o){var s=e.pendingLanes;if(s===0)return 0;var h=0,y=e.suspendedLanes,A=e.pingedLanes;e=e.warmLanes;var k=s&134217727;return k!==0?(s=k&~y,s!==0?h=Oe(s):(A&=k,A!==0?h=Oe(A):o||(o=k&~e,o!==0&&(h=Oe(o))))):(k=s&~y,k!==0?h=Oe(k):A!==0?h=Oe(A):o||(o=s&~e,o!==0&&(h=Oe(o)))),h===0?0:n!==0&&n!==h&&(n&y)===0&&(y=h&-h,o=n&-n,y>=o||y===32&&(o&4194048)!==0)?n:h}function Xt(e,n){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&n)===0}function Ul(e,n){switch(e){case 1:case 2:case 4:case 8:case 64:return n+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return n+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function $i(){var e=$e;return $e<<=1,($e&4194048)===0&&($e=256),e}function Qr(){var e=Ze;return Ze<<=1,(Ze&62914560)===0&&(Ze=4194304),e}function Bn(e){for(var n=[],o=0;31>o;o++)n.push(e);return n}function zo(e,n){e.pendingLanes|=n,n!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function mO(e,n,o,s,h,y){var A=e.pendingLanes;e.pendingLanes=o,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=o,e.entangledLanes&=o,e.errorRecoveryDisabledLanes&=o,e.shellSuspendCounter=0;var k=e.entanglements,V=e.expirationTimes,W=e.hiddenUpdates;for(o=A&~o;0<o;){var re=31-Yt(o),se=1<<re;k[re]=0,V[re]=-1;var J=W[re];if(J!==null)for(W[re]=null,re=0;re<J.length;re++){var ee=J[re];ee!==null&&(ee.lane&=-536870913)}o&=~se}s!==0&&ab(e,s,0),y!==0&&h===0&&e.tag!==0&&(e.suspendedLanes|=y&~(A&~n))}function ab(e,n,o){e.pendingLanes|=n,e.suspendedLanes&=~n;var s=31-Yt(n);e.entangledLanes|=n,e.entanglements[s]=e.entanglements[s]|1073741824|o&4194090}function ib(e,n){var o=e.entangledLanes|=n;for(e=e.entanglements;o;){var s=31-Yt(o),h=1<<s;h&n|e[s]&n&&(e[s]|=n),o&=~h}}function Wd(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function Jd(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function sb(){var e=G.p;return e!==0?e:(e=window.event,e===void 0?32:P1(e.type))}function pO(e,n){var o=G.p;try{return G.p=e,n()}finally{G.p=o}}var Fr=Math.random().toString(36).slice(2),Kt="__reactFiber$"+Fr,nn="__reactProps$"+Fr,Ra="__reactContainer$"+Fr,ef="__reactEvents$"+Fr,gO="__reactListeners$"+Fr,yO="__reactHandles$"+Fr,lb="__reactResources$"+Fr,Gi="__reactMarker$"+Fr;function tf(e){delete e[Kt],delete e[nn],delete e[ef],delete e[gO],delete e[yO]}function Oa(e){var n=e[Kt];if(n)return n;for(var o=e.parentNode;o;){if(n=o[Ra]||o[Kt]){if(o=n.alternate,n.child!==null||o!==null&&o.child!==null)for(e=T1(e);e!==null;){if(o=e[Kt])return o;e=T1(e)}return n}e=o,o=e.parentNode}return null}function Na(e){if(e=e[Kt]||e[Ra]){var n=e.tag;if(n===5||n===6||n===13||n===26||n===27||n===3)return e}return null}function Vi(e){var n=e.tag;if(n===5||n===26||n===27||n===6)return e.stateNode;throw Error(a(33))}function Ma(e){var n=e[lb];return n||(n=e[lb]={hoistableStyles:new Map,hoistableScripts:new Map}),n}function Mt(e){e[Gi]=!0}var cb=new Set,ub={};function Bo(e,n){_a(e,n),_a(e+"Capture",n)}function _a(e,n){for(ub[e]=n,e=0;e<n.length;e++)cb.add(n[e])}var bO=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),db={},fb={};function xO(e){return Be.call(fb,e)?!0:Be.call(db,e)?!1:bO.test(e)?fb[e]=!0:(db[e]=!0,!1)}function $l(e,n,o){if(xO(n))if(o===null)e.removeAttribute(n);else{switch(typeof o){case"undefined":case"function":case"symbol":e.removeAttribute(n);return;case"boolean":var s=n.toLowerCase().slice(0,5);if(s!=="data-"&&s!=="aria-"){e.removeAttribute(n);return}}e.setAttribute(n,""+o)}}function Gl(e,n,o){if(o===null)e.removeAttribute(n);else{switch(typeof o){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(n);return}e.setAttribute(n,""+o)}}function xr(e,n,o,s){if(s===null)e.removeAttribute(o);else{switch(typeof s){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(o);return}e.setAttributeNS(n,o,""+s)}}var nf,hb;function Da(e){if(nf===void 0)try{throw Error()}catch(o){var n=o.stack.trim().match(/\n( *(at )?)/);nf=n&&n[1]||"",hb=-1<o.stack.indexOf(`
44
+ at`)?" (<anonymous>)":-1<o.stack.indexOf("@")?"@unknown:0:0":""}return`
45
+ `+nf+e+hb}var rf=!1;function of(e,n){if(!e||rf)return"";rf=!0;var o=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var s={DetermineComponentFrameRoot:function(){try{if(n){var se=function(){throw Error()};if(Object.defineProperty(se.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(se,[])}catch(ee){var J=ee}Reflect.construct(e,[],se)}else{try{se.call()}catch(ee){J=ee}e.call(se.prototype)}}else{try{throw Error()}catch(ee){J=ee}(se=e())&&typeof se.catch=="function"&&se.catch(function(){})}}catch(ee){if(ee&&J&&typeof ee.stack=="string")return[ee.stack,J.stack]}return[null,null]}};s.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var h=Object.getOwnPropertyDescriptor(s.DetermineComponentFrameRoot,"name");h&&h.configurable&&Object.defineProperty(s.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var y=s.DetermineComponentFrameRoot(),A=y[0],k=y[1];if(A&&k){var V=A.split(`
46
+ `),W=k.split(`
47
+ `);for(h=s=0;s<V.length&&!V[s].includes("DetermineComponentFrameRoot");)s++;for(;h<W.length&&!W[h].includes("DetermineComponentFrameRoot");)h++;if(s===V.length||h===W.length)for(s=V.length-1,h=W.length-1;1<=s&&0<=h&&V[s]!==W[h];)h--;for(;1<=s&&0<=h;s--,h--)if(V[s]!==W[h]){if(s!==1||h!==1)do if(s--,h--,0>h||V[s]!==W[h]){var re=`
48
+ `+V[s].replace(" at new "," at ");return e.displayName&&re.includes("<anonymous>")&&(re=re.replace("<anonymous>",e.displayName)),re}while(1<=s&&0<=h);break}}}finally{rf=!1,Error.prepareStackTrace=o}return(o=e?e.displayName||e.name:"")?Da(o):""}function vO(e){switch(e.tag){case 26:case 27:case 5:return Da(e.type);case 16:return Da("Lazy");case 13:return Da("Suspense");case 19:return Da("SuspenseList");case 0:case 15:return of(e.type,!1);case 11:return of(e.type.render,!1);case 1:return of(e.type,!0);case 31:return Da("Activity");default:return""}}function mb(e){try{var n="";do n+=vO(e),e=e.return;while(e);return n}catch(o){return`
49
+ Error generating stack: `+o.message+`
50
+ `+o.stack}}function Tn(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function pb(e){var n=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(n==="checkbox"||n==="radio")}function SO(e){var n=pb(e)?"checked":"value",o=Object.getOwnPropertyDescriptor(e.constructor.prototype,n),s=""+e[n];if(!e.hasOwnProperty(n)&&typeof o<"u"&&typeof o.get=="function"&&typeof o.set=="function"){var h=o.get,y=o.set;return Object.defineProperty(e,n,{configurable:!0,get:function(){return h.call(this)},set:function(A){s=""+A,y.call(this,A)}}),Object.defineProperty(e,n,{enumerable:o.enumerable}),{getValue:function(){return s},setValue:function(A){s=""+A},stopTracking:function(){e._valueTracker=null,delete e[n]}}}}function Vl(e){e._valueTracker||(e._valueTracker=SO(e))}function gb(e){if(!e)return!1;var n=e._valueTracker;if(!n)return!0;var o=n.getValue(),s="";return e&&(s=pb(e)?e.checked?"true":"false":e.value),e=s,e!==o?(n.setValue(e),!0):!1}function ql(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}var CO=/[\n"\\]/g;function jn(e){return e.replace(CO,function(n){return"\\"+n.charCodeAt(0).toString(16)+" "})}function af(e,n,o,s,h,y,A,k){e.name="",A!=null&&typeof A!="function"&&typeof A!="symbol"&&typeof A!="boolean"?e.type=A:e.removeAttribute("type"),n!=null?A==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+Tn(n)):e.value!==""+Tn(n)&&(e.value=""+Tn(n)):A!=="submit"&&A!=="reset"||e.removeAttribute("value"),n!=null?sf(e,A,Tn(n)):o!=null?sf(e,A,Tn(o)):s!=null&&e.removeAttribute("value"),h==null&&y!=null&&(e.defaultChecked=!!y),h!=null&&(e.checked=h&&typeof h!="function"&&typeof h!="symbol"),k!=null&&typeof k!="function"&&typeof k!="symbol"&&typeof k!="boolean"?e.name=""+Tn(k):e.removeAttribute("name")}function yb(e,n,o,s,h,y,A,k){if(y!=null&&typeof y!="function"&&typeof y!="symbol"&&typeof y!="boolean"&&(e.type=y),n!=null||o!=null){if(!(y!=="submit"&&y!=="reset"||n!=null))return;o=o!=null?""+Tn(o):"",n=n!=null?""+Tn(n):o,k||n===e.value||(e.value=n),e.defaultValue=n}s=s??h,s=typeof s!="function"&&typeof s!="symbol"&&!!s,e.checked=k?e.checked:!!s,e.defaultChecked=!!s,A!=null&&typeof A!="function"&&typeof A!="symbol"&&typeof A!="boolean"&&(e.name=A)}function sf(e,n,o){n==="number"&&ql(e.ownerDocument)===e||e.defaultValue===""+o||(e.defaultValue=""+o)}function Ia(e,n,o,s){if(e=e.options,n){n={};for(var h=0;h<o.length;h++)n["$"+o[h]]=!0;for(o=0;o<e.length;o++)h=n.hasOwnProperty("$"+e[o].value),e[o].selected!==h&&(e[o].selected=h),h&&s&&(e[o].defaultSelected=!0)}else{for(o=""+Tn(o),n=null,h=0;h<e.length;h++){if(e[h].value===o){e[h].selected=!0,s&&(e[h].defaultSelected=!0);return}n!==null||e[h].disabled||(n=e[h])}n!==null&&(n.selected=!0)}}function bb(e,n,o){if(n!=null&&(n=""+Tn(n),n!==e.value&&(e.value=n),o==null)){e.defaultValue!==n&&(e.defaultValue=n);return}e.defaultValue=o!=null?""+Tn(o):""}function xb(e,n,o,s){if(n==null){if(s!=null){if(o!=null)throw Error(a(92));if(q(s)){if(1<s.length)throw Error(a(93));s=s[0]}o=s}o==null&&(o=""),n=o}o=Tn(n),e.defaultValue=o,s=e.textContent,s===o&&s!==""&&s!==null&&(e.value=s)}function ka(e,n){if(n){var o=e.firstChild;if(o&&o===e.lastChild&&o.nodeType===3){o.nodeValue=n;return}}e.textContent=n}var wO=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function vb(e,n,o){var s=n.indexOf("--")===0;o==null||typeof o=="boolean"||o===""?s?e.setProperty(n,""):n==="float"?e.cssFloat="":e[n]="":s?e.setProperty(n,o):typeof o!="number"||o===0||wO.has(n)?n==="float"?e.cssFloat=o:e[n]=(""+o).trim():e[n]=o+"px"}function Sb(e,n,o){if(n!=null&&typeof n!="object")throw Error(a(62));if(e=e.style,o!=null){for(var s in o)!o.hasOwnProperty(s)||n!=null&&n.hasOwnProperty(s)||(s.indexOf("--")===0?e.setProperty(s,""):s==="float"?e.cssFloat="":e[s]="");for(var h in n)s=n[h],n.hasOwnProperty(h)&&o[h]!==s&&vb(e,h,s)}else for(var y in n)n.hasOwnProperty(y)&&vb(e,y,n[y])}function lf(e){if(e.indexOf("-")===-1)return!1;switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var EO=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),TO=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function Yl(e){return TO.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}var cf=null;function uf(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var La=null,za=null;function Cb(e){var n=Na(e);if(n&&(e=n.stateNode)){var o=e[nn]||null;e:switch(e=n.stateNode,n.type){case"input":if(af(e,o.value,o.defaultValue,o.defaultValue,o.checked,o.defaultChecked,o.type,o.name),n=o.name,o.type==="radio"&&n!=null){for(o=e;o.parentNode;)o=o.parentNode;for(o=o.querySelectorAll('input[name="'+jn(""+n)+'"][type="radio"]'),n=0;n<o.length;n++){var s=o[n];if(s!==e&&s.form===e.form){var h=s[nn]||null;if(!h)throw Error(a(90));af(s,h.value,h.defaultValue,h.defaultValue,h.checked,h.defaultChecked,h.type,h.name)}}for(n=0;n<o.length;n++)s=o[n],s.form===e.form&&gb(s)}break e;case"textarea":bb(e,o.value,o.defaultValue);break e;case"select":n=o.value,n!=null&&Ia(e,!!o.multiple,n,!1)}}}var df=!1;function wb(e,n,o){if(df)return e(n,o);df=!0;try{var s=e(n);return s}finally{if(df=!1,(La!==null||za!==null)&&(Mc(),La&&(n=La,e=za,za=La=null,Cb(n),e)))for(n=0;n<e.length;n++)Cb(e[n])}}function qi(e,n){var o=e.stateNode;if(o===null)return null;var s=o[nn]||null;if(s===null)return null;o=s[n];e:switch(n){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(s=!s.disabled)||(e=e.type,s=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!s;break e;default:e=!1}if(e)return null;if(o&&typeof o!="function")throw Error(a(231,n,typeof o));return o}var vr=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),ff=!1;if(vr)try{var Yi={};Object.defineProperty(Yi,"passive",{get:function(){ff=!0}}),window.addEventListener("test",Yi,Yi),window.removeEventListener("test",Yi,Yi)}catch{ff=!1}var Zr=null,hf=null,Xl=null;function Eb(){if(Xl)return Xl;var e,n=hf,o=n.length,s,h="value"in Zr?Zr.value:Zr.textContent,y=h.length;for(e=0;e<o&&n[e]===h[e];e++);var A=o-e;for(s=1;s<=A&&n[o-s]===h[y-s];s++);return Xl=h.slice(e,1<s?1-s:void 0)}function Kl(e){var n=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&n===13&&(e=13)):e=n,e===10&&(e=13),32<=e||e===13?e:0}function Ql(){return!0}function Tb(){return!1}function rn(e){function n(o,s,h,y,A){this._reactName=o,this._targetInst=h,this.type=s,this.nativeEvent=y,this.target=A,this.currentTarget=null;for(var k in e)e.hasOwnProperty(k)&&(o=e[k],this[k]=o?o(y):y[k]);return this.isDefaultPrevented=(y.defaultPrevented!=null?y.defaultPrevented:y.returnValue===!1)?Ql:Tb,this.isPropagationStopped=Tb,this}return C(n.prototype,{preventDefault:function(){this.defaultPrevented=!0;var o=this.nativeEvent;o&&(o.preventDefault?o.preventDefault():typeof o.returnValue!="unknown"&&(o.returnValue=!1),this.isDefaultPrevented=Ql)},stopPropagation:function(){var o=this.nativeEvent;o&&(o.stopPropagation?o.stopPropagation():typeof o.cancelBubble!="unknown"&&(o.cancelBubble=!0),this.isPropagationStopped=Ql)},persist:function(){},isPersistent:Ql}),n}var Ho={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Fl=rn(Ho),Xi=C({},Ho,{view:0,detail:0}),jO=rn(Xi),mf,pf,Ki,Zl=C({},Xi,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:yf,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==Ki&&(Ki&&e.type==="mousemove"?(mf=e.screenX-Ki.screenX,pf=e.screenY-Ki.screenY):pf=mf=0,Ki=e),mf)},movementY:function(e){return"movementY"in e?e.movementY:pf}}),jb=rn(Zl),AO=C({},Zl,{dataTransfer:0}),RO=rn(AO),OO=C({},Xi,{relatedTarget:0}),gf=rn(OO),NO=C({},Ho,{animationName:0,elapsedTime:0,pseudoElement:0}),MO=rn(NO),_O=C({},Ho,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),DO=rn(_O),IO=C({},Ho,{data:0}),Ab=rn(IO),kO={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},LO={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},zO={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function BO(e){var n=this.nativeEvent;return n.getModifierState?n.getModifierState(e):(e=zO[e])?!!n[e]:!1}function yf(){return BO}var HO=C({},Xi,{key:function(e){if(e.key){var n=kO[e.key]||e.key;if(n!=="Unidentified")return n}return e.type==="keypress"?(e=Kl(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?LO[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:yf,charCode:function(e){return e.type==="keypress"?Kl(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Kl(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),PO=rn(HO),UO=C({},Zl,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Rb=rn(UO),$O=C({},Xi,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:yf}),GO=rn($O),VO=C({},Ho,{propertyName:0,elapsedTime:0,pseudoElement:0}),qO=rn(VO),YO=C({},Zl,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),XO=rn(YO),KO=C({},Ho,{newState:0,oldState:0}),QO=rn(KO),FO=[9,13,27,32],bf=vr&&"CompositionEvent"in window,Qi=null;vr&&"documentMode"in document&&(Qi=document.documentMode);var ZO=vr&&"TextEvent"in window&&!Qi,Ob=vr&&(!bf||Qi&&8<Qi&&11>=Qi),Nb=" ",Mb=!1;function _b(e,n){switch(e){case"keyup":return FO.indexOf(n.keyCode)!==-1;case"keydown":return n.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Db(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Ba=!1;function WO(e,n){switch(e){case"compositionend":return Db(n);case"keypress":return n.which!==32?null:(Mb=!0,Nb);case"textInput":return e=n.data,e===Nb&&Mb?null:e;default:return null}}function JO(e,n){if(Ba)return e==="compositionend"||!bf&&_b(e,n)?(e=Eb(),Xl=hf=Zr=null,Ba=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(n.ctrlKey||n.altKey||n.metaKey)||n.ctrlKey&&n.altKey){if(n.char&&1<n.char.length)return n.char;if(n.which)return String.fromCharCode(n.which)}return null;case"compositionend":return Ob&&n.locale!=="ko"?null:n.data;default:return null}}var eN={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function Ib(e){var n=e&&e.nodeName&&e.nodeName.toLowerCase();return n==="input"?!!eN[e.type]:n==="textarea"}function kb(e,n,o,s){La?za?za.push(s):za=[s]:La=s,n=zc(n,"onChange"),0<n.length&&(o=new Fl("onChange","change",null,o,s),e.push({event:o,listeners:n}))}var Fi=null,Zi=null;function tN(e){p1(e,0)}function Wl(e){var n=Vi(e);if(gb(n))return e}function Lb(e,n){if(e==="change")return n}var zb=!1;if(vr){var xf;if(vr){var vf="oninput"in document;if(!vf){var Bb=document.createElement("div");Bb.setAttribute("oninput","return;"),vf=typeof Bb.oninput=="function"}xf=vf}else xf=!1;zb=xf&&(!document.documentMode||9<document.documentMode)}function Hb(){Fi&&(Fi.detachEvent("onpropertychange",Pb),Zi=Fi=null)}function Pb(e){if(e.propertyName==="value"&&Wl(Zi)){var n=[];kb(n,Zi,e,uf(e)),wb(tN,n)}}function nN(e,n,o){e==="focusin"?(Hb(),Fi=n,Zi=o,Fi.attachEvent("onpropertychange",Pb)):e==="focusout"&&Hb()}function rN(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Wl(Zi)}function oN(e,n){if(e==="click")return Wl(n)}function aN(e,n){if(e==="input"||e==="change")return Wl(n)}function iN(e,n){return e===n&&(e!==0||1/e===1/n)||e!==e&&n!==n}var dn=typeof Object.is=="function"?Object.is:iN;function Wi(e,n){if(dn(e,n))return!0;if(typeof e!="object"||e===null||typeof n!="object"||n===null)return!1;var o=Object.keys(e),s=Object.keys(n);if(o.length!==s.length)return!1;for(s=0;s<o.length;s++){var h=o[s];if(!Be.call(n,h)||!dn(e[h],n[h]))return!1}return!0}function Ub(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function $b(e,n){var o=Ub(e);e=0;for(var s;o;){if(o.nodeType===3){if(s=e+o.textContent.length,e<=n&&s>=n)return{node:o,offset:n-e};e=s}e:{for(;o;){if(o.nextSibling){o=o.nextSibling;break e}o=o.parentNode}o=void 0}o=Ub(o)}}function Gb(e,n){return e&&n?e===n?!0:e&&e.nodeType===3?!1:n&&n.nodeType===3?Gb(e,n.parentNode):"contains"in e?e.contains(n):e.compareDocumentPosition?!!(e.compareDocumentPosition(n)&16):!1:!1}function Vb(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var n=ql(e.document);n instanceof e.HTMLIFrameElement;){try{var o=typeof n.contentWindow.location.href=="string"}catch{o=!1}if(o)e=n.contentWindow;else break;n=ql(e.document)}return n}function Sf(e){var n=e&&e.nodeName&&e.nodeName.toLowerCase();return n&&(n==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||n==="textarea"||e.contentEditable==="true")}var sN=vr&&"documentMode"in document&&11>=document.documentMode,Ha=null,Cf=null,Ji=null,wf=!1;function qb(e,n,o){var s=o.window===o?o.document:o.nodeType===9?o:o.ownerDocument;wf||Ha==null||Ha!==ql(s)||(s=Ha,"selectionStart"in s&&Sf(s)?s={start:s.selectionStart,end:s.selectionEnd}:(s=(s.ownerDocument&&s.ownerDocument.defaultView||window).getSelection(),s={anchorNode:s.anchorNode,anchorOffset:s.anchorOffset,focusNode:s.focusNode,focusOffset:s.focusOffset}),Ji&&Wi(Ji,s)||(Ji=s,s=zc(Cf,"onSelect"),0<s.length&&(n=new Fl("onSelect","select",null,n,o),e.push({event:n,listeners:s}),n.target=Ha)))}function Po(e,n){var o={};return o[e.toLowerCase()]=n.toLowerCase(),o["Webkit"+e]="webkit"+n,o["Moz"+e]="moz"+n,o}var Pa={animationend:Po("Animation","AnimationEnd"),animationiteration:Po("Animation","AnimationIteration"),animationstart:Po("Animation","AnimationStart"),transitionrun:Po("Transition","TransitionRun"),transitionstart:Po("Transition","TransitionStart"),transitioncancel:Po("Transition","TransitionCancel"),transitionend:Po("Transition","TransitionEnd")},Ef={},Yb={};vr&&(Yb=document.createElement("div").style,"AnimationEvent"in window||(delete Pa.animationend.animation,delete Pa.animationiteration.animation,delete Pa.animationstart.animation),"TransitionEvent"in window||delete Pa.transitionend.transition);function Uo(e){if(Ef[e])return Ef[e];if(!Pa[e])return e;var n=Pa[e],o;for(o in n)if(n.hasOwnProperty(o)&&o in Yb)return Ef[e]=n[o];return e}var Xb=Uo("animationend"),Kb=Uo("animationiteration"),Qb=Uo("animationstart"),lN=Uo("transitionrun"),cN=Uo("transitionstart"),uN=Uo("transitioncancel"),Fb=Uo("transitionend"),Zb=new Map,Tf="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");Tf.push("scrollEnd");function Hn(e,n){Zb.set(e,n),Bo(n,[e])}var Wb=new WeakMap;function An(e,n){if(typeof e=="object"&&e!==null){var o=Wb.get(e);return o!==void 0?o:(n={value:e,source:n,stack:mb(n)},Wb.set(e,n),n)}return{value:e,source:n,stack:mb(n)}}var Rn=[],Ua=0,jf=0;function Jl(){for(var e=Ua,n=jf=Ua=0;n<e;){var o=Rn[n];Rn[n++]=null;var s=Rn[n];Rn[n++]=null;var h=Rn[n];Rn[n++]=null;var y=Rn[n];if(Rn[n++]=null,s!==null&&h!==null){var A=s.pending;A===null?h.next=h:(h.next=A.next,A.next=h),s.pending=h}y!==0&&Jb(o,h,y)}}function ec(e,n,o,s){Rn[Ua++]=e,Rn[Ua++]=n,Rn[Ua++]=o,Rn[Ua++]=s,jf|=s,e.lanes|=s,e=e.alternate,e!==null&&(e.lanes|=s)}function Af(e,n,o,s){return ec(e,n,o,s),tc(e)}function $a(e,n){return ec(e,null,null,n),tc(e)}function Jb(e,n,o){e.lanes|=o;var s=e.alternate;s!==null&&(s.lanes|=o);for(var h=!1,y=e.return;y!==null;)y.childLanes|=o,s=y.alternate,s!==null&&(s.childLanes|=o),y.tag===22&&(e=y.stateNode,e===null||e._visibility&1||(h=!0)),e=y,y=y.return;return e.tag===3?(y=e.stateNode,h&&n!==null&&(h=31-Yt(o),e=y.hiddenUpdates,s=e[h],s===null?e[h]=[n]:s.push(n),n.lane=o|536870912),y):null}function tc(e){if(50<Es)throw Es=0,Dh=null,Error(a(185));for(var n=e.return;n!==null;)e=n,n=e.return;return e.tag===3?e.stateNode:null}var Ga={};function dN(e,n,o,s){this.tag=e,this.key=o,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=n,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=s,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function fn(e,n,o,s){return new dN(e,n,o,s)}function Rf(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Sr(e,n){var o=e.alternate;return o===null?(o=fn(e.tag,n,e.key,e.mode),o.elementType=e.elementType,o.type=e.type,o.stateNode=e.stateNode,o.alternate=e,e.alternate=o):(o.pendingProps=n,o.type=e.type,o.flags=0,o.subtreeFlags=0,o.deletions=null),o.flags=e.flags&65011712,o.childLanes=e.childLanes,o.lanes=e.lanes,o.child=e.child,o.memoizedProps=e.memoizedProps,o.memoizedState=e.memoizedState,o.updateQueue=e.updateQueue,n=e.dependencies,o.dependencies=n===null?null:{lanes:n.lanes,firstContext:n.firstContext},o.sibling=e.sibling,o.index=e.index,o.ref=e.ref,o.refCleanup=e.refCleanup,o}function ex(e,n){e.flags&=65011714;var o=e.alternate;return o===null?(e.childLanes=0,e.lanes=n,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=o.childLanes,e.lanes=o.lanes,e.child=o.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=o.memoizedProps,e.memoizedState=o.memoizedState,e.updateQueue=o.updateQueue,e.type=o.type,n=o.dependencies,e.dependencies=n===null?null:{lanes:n.lanes,firstContext:n.firstContext}),e}function nc(e,n,o,s,h,y){var A=0;if(s=e,typeof e=="function")Rf(e)&&(A=1);else if(typeof e=="string")A=hM(e,o,le.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case z:return e=fn(31,o,n,h),e.elementType=z,e.lanes=y,e;case x:return $o(o.children,h,y,n);case S:A=8,h|=24;break;case w:return e=fn(12,o,n,h|2),e.elementType=w,e.lanes=y,e;case M:return e=fn(13,o,n,h),e.elementType=M,e.lanes=y,e;case D:return e=fn(19,o,n,h),e.elementType=D,e.lanes=y,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case T:case R:A=10;break e;case j:A=9;break e;case O:A=11;break e;case _:A=14;break e;case I:A=16,s=null;break e}A=29,o=Error(a(130,e===null?"null":typeof e,"")),s=null}return n=fn(A,o,n,h),n.elementType=e,n.type=s,n.lanes=y,n}function $o(e,n,o,s){return e=fn(7,e,s,n),e.lanes=o,e}function Of(e,n,o){return e=fn(6,e,null,n),e.lanes=o,e}function Nf(e,n,o){return n=fn(4,e.children!==null?e.children:[],e.key,n),n.lanes=o,n.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},n}var Va=[],qa=0,rc=null,oc=0,On=[],Nn=0,Go=null,Cr=1,wr="";function Vo(e,n){Va[qa++]=oc,Va[qa++]=rc,rc=e,oc=n}function tx(e,n,o){On[Nn++]=Cr,On[Nn++]=wr,On[Nn++]=Go,Go=e;var s=Cr;e=wr;var h=32-Yt(s)-1;s&=~(1<<h),o+=1;var y=32-Yt(n)+h;if(30<y){var A=h-h%5;y=(s&(1<<A)-1).toString(32),s>>=A,h-=A,Cr=1<<32-Yt(n)+h|o<<h|s,wr=y+e}else Cr=1<<y|o<<h|s,wr=e}function Mf(e){e.return!==null&&(Vo(e,1),tx(e,1,0))}function _f(e){for(;e===rc;)rc=Va[--qa],Va[qa]=null,oc=Va[--qa],Va[qa]=null;for(;e===Go;)Go=On[--Nn],On[Nn]=null,wr=On[--Nn],On[Nn]=null,Cr=On[--Nn],On[Nn]=null}var Jt=null,ft=null,Ke=!1,qo=null,Zn=!1,Df=Error(a(519));function Yo(e){var n=Error(a(418,""));throw ns(An(n,e)),Df}function nx(e){var n=e.stateNode,o=e.type,s=e.memoizedProps;switch(n[Kt]=e,n[nn]=s,o){case"dialog":Pe("cancel",n),Pe("close",n);break;case"iframe":case"object":case"embed":Pe("load",n);break;case"video":case"audio":for(o=0;o<js.length;o++)Pe(js[o],n);break;case"source":Pe("error",n);break;case"img":case"image":case"link":Pe("error",n),Pe("load",n);break;case"details":Pe("toggle",n);break;case"input":Pe("invalid",n),yb(n,s.value,s.defaultValue,s.checked,s.defaultChecked,s.type,s.name,!0),Vl(n);break;case"select":Pe("invalid",n);break;case"textarea":Pe("invalid",n),xb(n,s.value,s.defaultValue,s.children),Vl(n)}o=s.children,typeof o!="string"&&typeof o!="number"&&typeof o!="bigint"||n.textContent===""+o||s.suppressHydrationWarning===!0||x1(n.textContent,o)?(s.popover!=null&&(Pe("beforetoggle",n),Pe("toggle",n)),s.onScroll!=null&&Pe("scroll",n),s.onScrollEnd!=null&&Pe("scrollend",n),s.onClick!=null&&(n.onclick=Bc),n=!0):n=!1,n||Yo(e)}function rx(e){for(Jt=e.return;Jt;)switch(Jt.tag){case 5:case 13:Zn=!1;return;case 27:case 3:Zn=!0;return;default:Jt=Jt.return}}function es(e){if(e!==Jt)return!1;if(!Ke)return rx(e),Ke=!0,!1;var n=e.tag,o;if((o=n!==3&&n!==27)&&((o=n===5)&&(o=e.type,o=!(o!=="form"&&o!=="button")||Qh(e.type,e.memoizedProps)),o=!o),o&&ft&&Yo(e),rx(e),n===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(a(317));e:{for(e=e.nextSibling,n=0;e;){if(e.nodeType===8)if(o=e.data,o==="/$"){if(n===0){ft=Un(e.nextSibling);break e}n--}else o!=="$"&&o!=="$!"&&o!=="$?"||n++;e=e.nextSibling}ft=null}}else n===27?(n=ft,mo(e.type)?(e=Jh,Jh=null,ft=e):ft=n):ft=Jt?Un(e.stateNode.nextSibling):null;return!0}function ts(){ft=Jt=null,Ke=!1}function ox(){var e=qo;return e!==null&&(sn===null?sn=e:sn.push.apply(sn,e),qo=null),e}function ns(e){qo===null?qo=[e]:qo.push(e)}var If=K(null),Xo=null,Er=null;function Wr(e,n,o){te(If,n._currentValue),n._currentValue=o}function Tr(e){e._currentValue=If.current,ne(If)}function kf(e,n,o){for(;e!==null;){var s=e.alternate;if((e.childLanes&n)!==n?(e.childLanes|=n,s!==null&&(s.childLanes|=n)):s!==null&&(s.childLanes&n)!==n&&(s.childLanes|=n),e===o)break;e=e.return}}function Lf(e,n,o,s){var h=e.child;for(h!==null&&(h.return=e);h!==null;){var y=h.dependencies;if(y!==null){var A=h.child;y=y.firstContext;e:for(;y!==null;){var k=y;y=h;for(var V=0;V<n.length;V++)if(k.context===n[V]){y.lanes|=o,k=y.alternate,k!==null&&(k.lanes|=o),kf(y.return,o,e),s||(A=null);break e}y=k.next}}else if(h.tag===18){if(A=h.return,A===null)throw Error(a(341));A.lanes|=o,y=A.alternate,y!==null&&(y.lanes|=o),kf(A,o,e),A=null}else A=h.child;if(A!==null)A.return=h;else for(A=h;A!==null;){if(A===e){A=null;break}if(h=A.sibling,h!==null){h.return=A.return,A=h;break}A=A.return}h=A}}function rs(e,n,o,s){e=null;for(var h=n,y=!1;h!==null;){if(!y){if((h.flags&524288)!==0)y=!0;else if((h.flags&262144)!==0)break}if(h.tag===10){var A=h.alternate;if(A===null)throw Error(a(387));if(A=A.memoizedProps,A!==null){var k=h.type;dn(h.pendingProps.value,A.value)||(e!==null?e.push(k):e=[k])}}else if(h===xe.current){if(A=h.alternate,A===null)throw Error(a(387));A.memoizedState.memoizedState!==h.memoizedState.memoizedState&&(e!==null?e.push(_s):e=[_s])}h=h.return}e!==null&&Lf(n,e,o,s),n.flags|=262144}function ac(e){for(e=e.firstContext;e!==null;){if(!dn(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Ko(e){Xo=e,Er=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Qt(e){return ax(Xo,e)}function ic(e,n){return Xo===null&&Ko(e),ax(e,n)}function ax(e,n){var o=n._currentValue;if(n={context:n,memoizedValue:o,next:null},Er===null){if(e===null)throw Error(a(308));Er=n,e.dependencies={lanes:0,firstContext:n},e.flags|=524288}else Er=Er.next=n;return o}var fN=typeof AbortController<"u"?AbortController:function(){var e=[],n=this.signal={aborted:!1,addEventListener:function(o,s){e.push(s)}};this.abort=function(){n.aborted=!0,e.forEach(function(o){return o()})}},hN=t.unstable_scheduleCallback,mN=t.unstable_NormalPriority,jt={$$typeof:R,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function zf(){return{controller:new fN,data:new Map,refCount:0}}function os(e){e.refCount--,e.refCount===0&&hN(mN,function(){e.controller.abort()})}var as=null,Bf=0,Ya=0,Xa=null;function pN(e,n){if(as===null){var o=as=[];Bf=0,Ya=Ph(),Xa={status:"pending",value:void 0,then:function(s){o.push(s)}}}return Bf++,n.then(ix,ix),n}function ix(){if(--Bf===0&&as!==null){Xa!==null&&(Xa.status="fulfilled");var e=as;as=null,Ya=0,Xa=null;for(var n=0;n<e.length;n++)(0,e[n])()}}function gN(e,n){var o=[],s={status:"pending",value:null,reason:null,then:function(h){o.push(h)}};return e.then(function(){s.status="fulfilled",s.value=n;for(var h=0;h<o.length;h++)(0,o[h])(n)},function(h){for(s.status="rejected",s.reason=h,h=0;h<o.length;h++)(0,o[h])(void 0)}),s}var sx=P.S;P.S=function(e,n){typeof n=="object"&&n!==null&&typeof n.then=="function"&&pN(e,n),sx!==null&&sx(e,n)};var Qo=K(null);function Hf(){var e=Qo.current;return e!==null?e:rt.pooledCache}function sc(e,n){n===null?te(Qo,Qo.current):te(Qo,n.pool)}function lx(){var e=Hf();return e===null?null:{parent:jt._currentValue,pool:e}}var is=Error(a(460)),cx=Error(a(474)),lc=Error(a(542)),Pf={then:function(){}};function ux(e){return e=e.status,e==="fulfilled"||e==="rejected"}function cc(){}function dx(e,n,o){switch(o=e[o],o===void 0?e.push(n):o!==n&&(n.then(cc,cc),n=o),n.status){case"fulfilled":return n.value;case"rejected":throw e=n.reason,hx(e),e;default:if(typeof n.status=="string")n.then(cc,cc);else{if(e=rt,e!==null&&100<e.shellSuspendCounter)throw Error(a(482));e=n,e.status="pending",e.then(function(s){if(n.status==="pending"){var h=n;h.status="fulfilled",h.value=s}},function(s){if(n.status==="pending"){var h=n;h.status="rejected",h.reason=s}})}switch(n.status){case"fulfilled":return n.value;case"rejected":throw e=n.reason,hx(e),e}throw ss=n,is}}var ss=null;function fx(){if(ss===null)throw Error(a(459));var e=ss;return ss=null,e}function hx(e){if(e===is||e===lc)throw Error(a(483))}var Jr=!1;function Uf(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function $f(e,n){e=e.updateQueue,n.updateQueue===e&&(n.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function eo(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function to(e,n,o){var s=e.updateQueue;if(s===null)return null;if(s=s.shared,(Qe&2)!==0){var h=s.pending;return h===null?n.next=n:(n.next=h.next,h.next=n),s.pending=n,n=tc(e),Jb(e,null,o),n}return ec(e,s,n,o),tc(e)}function ls(e,n,o){if(n=n.updateQueue,n!==null&&(n=n.shared,(o&4194048)!==0)){var s=n.lanes;s&=e.pendingLanes,o|=s,n.lanes=o,ib(e,o)}}function Gf(e,n){var o=e.updateQueue,s=e.alternate;if(s!==null&&(s=s.updateQueue,o===s)){var h=null,y=null;if(o=o.firstBaseUpdate,o!==null){do{var A={lane:o.lane,tag:o.tag,payload:o.payload,callback:null,next:null};y===null?h=y=A:y=y.next=A,o=o.next}while(o!==null);y===null?h=y=n:y=y.next=n}else h=y=n;o={baseState:s.baseState,firstBaseUpdate:h,lastBaseUpdate:y,shared:s.shared,callbacks:s.callbacks},e.updateQueue=o;return}e=o.lastBaseUpdate,e===null?o.firstBaseUpdate=n:e.next=n,o.lastBaseUpdate=n}var Vf=!1;function cs(){if(Vf){var e=Xa;if(e!==null)throw e}}function us(e,n,o,s){Vf=!1;var h=e.updateQueue;Jr=!1;var y=h.firstBaseUpdate,A=h.lastBaseUpdate,k=h.shared.pending;if(k!==null){h.shared.pending=null;var V=k,W=V.next;V.next=null,A===null?y=W:A.next=W,A=V;var re=e.alternate;re!==null&&(re=re.updateQueue,k=re.lastBaseUpdate,k!==A&&(k===null?re.firstBaseUpdate=W:k.next=W,re.lastBaseUpdate=V))}if(y!==null){var se=h.baseState;A=0,re=W=V=null,k=y;do{var J=k.lane&-536870913,ee=J!==k.lane;if(ee?(Ge&J)===J:(s&J)===J){J!==0&&J===Ya&&(Vf=!0),re!==null&&(re=re.next={lane:0,tag:k.tag,payload:k.payload,callback:null,next:null});e:{var Re=e,Te=k;J=n;var et=o;switch(Te.tag){case 1:if(Re=Te.payload,typeof Re=="function"){se=Re.call(et,se,J);break e}se=Re;break e;case 3:Re.flags=Re.flags&-65537|128;case 0:if(Re=Te.payload,J=typeof Re=="function"?Re.call(et,se,J):Re,J==null)break e;se=C({},se,J);break e;case 2:Jr=!0}}J=k.callback,J!==null&&(e.flags|=64,ee&&(e.flags|=8192),ee=h.callbacks,ee===null?h.callbacks=[J]:ee.push(J))}else ee={lane:J,tag:k.tag,payload:k.payload,callback:k.callback,next:null},re===null?(W=re=ee,V=se):re=re.next=ee,A|=J;if(k=k.next,k===null){if(k=h.shared.pending,k===null)break;ee=k,k=ee.next,ee.next=null,h.lastBaseUpdate=ee,h.shared.pending=null}}while(!0);re===null&&(V=se),h.baseState=V,h.firstBaseUpdate=W,h.lastBaseUpdate=re,y===null&&(h.shared.lanes=0),co|=A,e.lanes=A,e.memoizedState=se}}function mx(e,n){if(typeof e!="function")throw Error(a(191,e));e.call(n)}function px(e,n){var o=e.callbacks;if(o!==null)for(e.callbacks=null,e=0;e<o.length;e++)mx(o[e],n)}var Ka=K(null),uc=K(0);function gx(e,n){e=_r,te(uc,e),te(Ka,n),_r=e|n.baseLanes}function qf(){te(uc,_r),te(Ka,Ka.current)}function Yf(){_r=uc.current,ne(Ka),ne(uc)}var no=0,Ie=null,We=null,St=null,dc=!1,Qa=!1,Fo=!1,fc=0,ds=0,Fa=null,yN=0;function yt(){throw Error(a(321))}function Xf(e,n){if(n===null)return!1;for(var o=0;o<n.length&&o<e.length;o++)if(!dn(e[o],n[o]))return!1;return!0}function Kf(e,n,o,s,h,y){return no=y,Ie=n,n.memoizedState=null,n.updateQueue=null,n.lanes=0,P.H=e===null||e.memoizedState===null?Jx:ev,Fo=!1,y=o(s,h),Fo=!1,Qa&&(y=bx(n,o,s,h)),yx(e),y}function yx(e){P.H=bc;var n=We!==null&&We.next!==null;if(no=0,St=We=Ie=null,dc=!1,ds=0,Fa=null,n)throw Error(a(300));e===null||_t||(e=e.dependencies,e!==null&&ac(e)&&(_t=!0))}function bx(e,n,o,s){Ie=e;var h=0;do{if(Qa&&(Fa=null),ds=0,Qa=!1,25<=h)throw Error(a(301));if(h+=1,St=We=null,e.updateQueue!=null){var y=e.updateQueue;y.lastEffect=null,y.events=null,y.stores=null,y.memoCache!=null&&(y.memoCache.index=0)}P.H=EN,y=n(o,s)}while(Qa);return y}function bN(){var e=P.H,n=e.useState()[0];return n=typeof n.then=="function"?fs(n):n,e=e.useState()[0],(We!==null?We.memoizedState:null)!==e&&(Ie.flags|=1024),n}function Qf(){var e=fc!==0;return fc=0,e}function Ff(e,n,o){n.updateQueue=e.updateQueue,n.flags&=-2053,e.lanes&=~o}function Zf(e){if(dc){for(e=e.memoizedState;e!==null;){var n=e.queue;n!==null&&(n.pending=null),e=e.next}dc=!1}no=0,St=We=Ie=null,Qa=!1,ds=fc=0,Fa=null}function on(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return St===null?Ie.memoizedState=St=e:St=St.next=e,St}function Ct(){if(We===null){var e=Ie.alternate;e=e!==null?e.memoizedState:null}else e=We.next;var n=St===null?Ie.memoizedState:St.next;if(n!==null)St=n,We=e;else{if(e===null)throw Ie.alternate===null?Error(a(467)):Error(a(310));We=e,e={memoizedState:We.memoizedState,baseState:We.baseState,baseQueue:We.baseQueue,queue:We.queue,next:null},St===null?Ie.memoizedState=St=e:St=St.next=e}return St}function Wf(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function fs(e){var n=ds;return ds+=1,Fa===null&&(Fa=[]),e=dx(Fa,e,n),n=Ie,(St===null?n.memoizedState:St.next)===null&&(n=n.alternate,P.H=n===null||n.memoizedState===null?Jx:ev),e}function hc(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return fs(e);if(e.$$typeof===R)return Qt(e)}throw Error(a(438,String(e)))}function Jf(e){var n=null,o=Ie.updateQueue;if(o!==null&&(n=o.memoCache),n==null){var s=Ie.alternate;s!==null&&(s=s.updateQueue,s!==null&&(s=s.memoCache,s!=null&&(n={data:s.data.map(function(h){return h.slice()}),index:0})))}if(n==null&&(n={data:[],index:0}),o===null&&(o=Wf(),Ie.updateQueue=o),o.memoCache=n,o=n.data[n.index],o===void 0)for(o=n.data[n.index]=Array(e),s=0;s<e;s++)o[s]=H;return n.index++,o}function jr(e,n){return typeof n=="function"?n(e):n}function mc(e){var n=Ct();return eh(n,We,e)}function eh(e,n,o){var s=e.queue;if(s===null)throw Error(a(311));s.lastRenderedReducer=o;var h=e.baseQueue,y=s.pending;if(y!==null){if(h!==null){var A=h.next;h.next=y.next,y.next=A}n.baseQueue=h=y,s.pending=null}if(y=e.baseState,h===null)e.memoizedState=y;else{n=h.next;var k=A=null,V=null,W=n,re=!1;do{var se=W.lane&-536870913;if(se!==W.lane?(Ge&se)===se:(no&se)===se){var J=W.revertLane;if(J===0)V!==null&&(V=V.next={lane:0,revertLane:0,action:W.action,hasEagerState:W.hasEagerState,eagerState:W.eagerState,next:null}),se===Ya&&(re=!0);else if((no&J)===J){W=W.next,J===Ya&&(re=!0);continue}else se={lane:0,revertLane:W.revertLane,action:W.action,hasEagerState:W.hasEagerState,eagerState:W.eagerState,next:null},V===null?(k=V=se,A=y):V=V.next=se,Ie.lanes|=J,co|=J;se=W.action,Fo&&o(y,se),y=W.hasEagerState?W.eagerState:o(y,se)}else J={lane:se,revertLane:W.revertLane,action:W.action,hasEagerState:W.hasEagerState,eagerState:W.eagerState,next:null},V===null?(k=V=J,A=y):V=V.next=J,Ie.lanes|=se,co|=se;W=W.next}while(W!==null&&W!==n);if(V===null?A=y:V.next=k,!dn(y,e.memoizedState)&&(_t=!0,re&&(o=Xa,o!==null)))throw o;e.memoizedState=y,e.baseState=A,e.baseQueue=V,s.lastRenderedState=y}return h===null&&(s.lanes=0),[e.memoizedState,s.dispatch]}function th(e){var n=Ct(),o=n.queue;if(o===null)throw Error(a(311));o.lastRenderedReducer=e;var s=o.dispatch,h=o.pending,y=n.memoizedState;if(h!==null){o.pending=null;var A=h=h.next;do y=e(y,A.action),A=A.next;while(A!==h);dn(y,n.memoizedState)||(_t=!0),n.memoizedState=y,n.baseQueue===null&&(n.baseState=y),o.lastRenderedState=y}return[y,s]}function xx(e,n,o){var s=Ie,h=Ct(),y=Ke;if(y){if(o===void 0)throw Error(a(407));o=o()}else o=n();var A=!dn((We||h).memoizedState,o);A&&(h.memoizedState=o,_t=!0),h=h.queue;var k=Cx.bind(null,s,h,e);if(hs(2048,8,k,[e]),h.getSnapshot!==n||A||St!==null&&St.memoizedState.tag&1){if(s.flags|=2048,Za(9,pc(),Sx.bind(null,s,h,o,n),null),rt===null)throw Error(a(349));y||(no&124)!==0||vx(s,n,o)}return o}function vx(e,n,o){e.flags|=16384,e={getSnapshot:n,value:o},n=Ie.updateQueue,n===null?(n=Wf(),Ie.updateQueue=n,n.stores=[e]):(o=n.stores,o===null?n.stores=[e]:o.push(e))}function Sx(e,n,o,s){n.value=o,n.getSnapshot=s,wx(n)&&Ex(e)}function Cx(e,n,o){return o(function(){wx(n)&&Ex(e)})}function wx(e){var n=e.getSnapshot;e=e.value;try{var o=n();return!dn(e,o)}catch{return!0}}function Ex(e){var n=$a(e,2);n!==null&&yn(n,e,2)}function nh(e){var n=on();if(typeof e=="function"){var o=e;if(e=o(),Fo){zn(!0);try{o()}finally{zn(!1)}}}return n.memoizedState=n.baseState=e,n.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:jr,lastRenderedState:e},n}function Tx(e,n,o,s){return e.baseState=o,eh(e,We,typeof s=="function"?s:jr)}function xN(e,n,o,s,h){if(yc(e))throw Error(a(485));if(e=n.action,e!==null){var y={payload:h,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(A){y.listeners.push(A)}};P.T!==null?o(!0):y.isTransition=!1,s(y),o=n.pending,o===null?(y.next=n.pending=y,jx(n,y)):(y.next=o.next,n.pending=o.next=y)}}function jx(e,n){var o=n.action,s=n.payload,h=e.state;if(n.isTransition){var y=P.T,A={};P.T=A;try{var k=o(h,s),V=P.S;V!==null&&V(A,k),Ax(e,n,k)}catch(W){rh(e,n,W)}finally{P.T=y}}else try{y=o(h,s),Ax(e,n,y)}catch(W){rh(e,n,W)}}function Ax(e,n,o){o!==null&&typeof o=="object"&&typeof o.then=="function"?o.then(function(s){Rx(e,n,s)},function(s){return rh(e,n,s)}):Rx(e,n,o)}function Rx(e,n,o){n.status="fulfilled",n.value=o,Ox(n),e.state=o,n=e.pending,n!==null&&(o=n.next,o===n?e.pending=null:(o=o.next,n.next=o,jx(e,o)))}function rh(e,n,o){var s=e.pending;if(e.pending=null,s!==null){s=s.next;do n.status="rejected",n.reason=o,Ox(n),n=n.next;while(n!==s)}e.action=null}function Ox(e){e=e.listeners;for(var n=0;n<e.length;n++)(0,e[n])()}function Nx(e,n){return n}function Mx(e,n){if(Ke){var o=rt.formState;if(o!==null){e:{var s=Ie;if(Ke){if(ft){t:{for(var h=ft,y=Zn;h.nodeType!==8;){if(!y){h=null;break t}if(h=Un(h.nextSibling),h===null){h=null;break t}}y=h.data,h=y==="F!"||y==="F"?h:null}if(h){ft=Un(h.nextSibling),s=h.data==="F!";break e}}Yo(s)}s=!1}s&&(n=o[0])}}return o=on(),o.memoizedState=o.baseState=n,s={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Nx,lastRenderedState:n},o.queue=s,o=Fx.bind(null,Ie,s),s.dispatch=o,s=nh(!1),y=lh.bind(null,Ie,!1,s.queue),s=on(),h={state:n,dispatch:null,action:e,pending:null},s.queue=h,o=xN.bind(null,Ie,h,y,o),h.dispatch=o,s.memoizedState=e,[n,o,!1]}function _x(e){var n=Ct();return Dx(n,We,e)}function Dx(e,n,o){if(n=eh(e,n,Nx)[0],e=mc(jr)[0],typeof n=="object"&&n!==null&&typeof n.then=="function")try{var s=fs(n)}catch(A){throw A===is?lc:A}else s=n;n=Ct();var h=n.queue,y=h.dispatch;return o!==n.memoizedState&&(Ie.flags|=2048,Za(9,pc(),vN.bind(null,h,o),null)),[s,y,e]}function vN(e,n){e.action=n}function Ix(e){var n=Ct(),o=We;if(o!==null)return Dx(n,o,e);Ct(),n=n.memoizedState,o=Ct();var s=o.queue.dispatch;return o.memoizedState=e,[n,s,!1]}function Za(e,n,o,s){return e={tag:e,create:o,deps:s,inst:n,next:null},n=Ie.updateQueue,n===null&&(n=Wf(),Ie.updateQueue=n),o=n.lastEffect,o===null?n.lastEffect=e.next=e:(s=o.next,o.next=e,e.next=s,n.lastEffect=e),e}function pc(){return{destroy:void 0,resource:void 0}}function kx(){return Ct().memoizedState}function gc(e,n,o,s){var h=on();s=s===void 0?null:s,Ie.flags|=e,h.memoizedState=Za(1|n,pc(),o,s)}function hs(e,n,o,s){var h=Ct();s=s===void 0?null:s;var y=h.memoizedState.inst;We!==null&&s!==null&&Xf(s,We.memoizedState.deps)?h.memoizedState=Za(n,y,o,s):(Ie.flags|=e,h.memoizedState=Za(1|n,y,o,s))}function Lx(e,n){gc(8390656,8,e,n)}function zx(e,n){hs(2048,8,e,n)}function Bx(e,n){return hs(4,2,e,n)}function Hx(e,n){return hs(4,4,e,n)}function Px(e,n){if(typeof n=="function"){e=e();var o=n(e);return function(){typeof o=="function"?o():n(null)}}if(n!=null)return e=e(),n.current=e,function(){n.current=null}}function Ux(e,n,o){o=o!=null?o.concat([e]):null,hs(4,4,Px.bind(null,n,e),o)}function oh(){}function $x(e,n){var o=Ct();n=n===void 0?null:n;var s=o.memoizedState;return n!==null&&Xf(n,s[1])?s[0]:(o.memoizedState=[e,n],e)}function Gx(e,n){var o=Ct();n=n===void 0?null:n;var s=o.memoizedState;if(n!==null&&Xf(n,s[1]))return s[0];if(s=e(),Fo){zn(!0);try{e()}finally{zn(!1)}}return o.memoizedState=[s,n],s}function ah(e,n,o){return o===void 0||(no&1073741824)!==0?e.memoizedState=n:(e.memoizedState=o,e=Yv(),Ie.lanes|=e,co|=e,o)}function Vx(e,n,o,s){return dn(o,n)?o:Ka.current!==null?(e=ah(e,o,s),dn(e,n)||(_t=!0),e):(no&42)===0?(_t=!0,e.memoizedState=o):(e=Yv(),Ie.lanes|=e,co|=e,n)}function qx(e,n,o,s,h){var y=G.p;G.p=y!==0&&8>y?y:8;var A=P.T,k={};P.T=k,lh(e,!1,n,o);try{var V=h(),W=P.S;if(W!==null&&W(k,V),V!==null&&typeof V=="object"&&typeof V.then=="function"){var re=gN(V,s);ms(e,n,re,gn(e))}else ms(e,n,s,gn(e))}catch(se){ms(e,n,{then:function(){},status:"rejected",reason:se},gn())}finally{G.p=y,P.T=A}}function SN(){}function ih(e,n,o,s){if(e.tag!==5)throw Error(a(476));var h=Yx(e).queue;qx(e,h,n,B,o===null?SN:function(){return Xx(e),o(s)})}function Yx(e){var n=e.memoizedState;if(n!==null)return n;n={memoizedState:B,baseState:B,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:jr,lastRenderedState:B},next:null};var o={};return n.next={memoizedState:o,baseState:o,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:jr,lastRenderedState:o},next:null},e.memoizedState=n,e=e.alternate,e!==null&&(e.memoizedState=n),n}function Xx(e){var n=Yx(e).next.queue;ms(e,n,{},gn())}function sh(){return Qt(_s)}function Kx(){return Ct().memoizedState}function Qx(){return Ct().memoizedState}function CN(e){for(var n=e.return;n!==null;){switch(n.tag){case 24:case 3:var o=gn();e=eo(o);var s=to(n,e,o);s!==null&&(yn(s,n,o),ls(s,n,o)),n={cache:zf()},e.payload=n;return}n=n.return}}function wN(e,n,o){var s=gn();o={lane:s,revertLane:0,action:o,hasEagerState:!1,eagerState:null,next:null},yc(e)?Zx(n,o):(o=Af(e,n,o,s),o!==null&&(yn(o,e,s),Wx(o,n,s)))}function Fx(e,n,o){var s=gn();ms(e,n,o,s)}function ms(e,n,o,s){var h={lane:s,revertLane:0,action:o,hasEagerState:!1,eagerState:null,next:null};if(yc(e))Zx(n,h);else{var y=e.alternate;if(e.lanes===0&&(y===null||y.lanes===0)&&(y=n.lastRenderedReducer,y!==null))try{var A=n.lastRenderedState,k=y(A,o);if(h.hasEagerState=!0,h.eagerState=k,dn(k,A))return ec(e,n,h,0),rt===null&&Jl(),!1}catch{}finally{}if(o=Af(e,n,h,s),o!==null)return yn(o,e,s),Wx(o,n,s),!0}return!1}function lh(e,n,o,s){if(s={lane:2,revertLane:Ph(),action:s,hasEagerState:!1,eagerState:null,next:null},yc(e)){if(n)throw Error(a(479))}else n=Af(e,o,s,2),n!==null&&yn(n,e,2)}function yc(e){var n=e.alternate;return e===Ie||n!==null&&n===Ie}function Zx(e,n){Qa=dc=!0;var o=e.pending;o===null?n.next=n:(n.next=o.next,o.next=n),e.pending=n}function Wx(e,n,o){if((o&4194048)!==0){var s=n.lanes;s&=e.pendingLanes,o|=s,n.lanes=o,ib(e,o)}}var bc={readContext:Qt,use:hc,useCallback:yt,useContext:yt,useEffect:yt,useImperativeHandle:yt,useLayoutEffect:yt,useInsertionEffect:yt,useMemo:yt,useReducer:yt,useRef:yt,useState:yt,useDebugValue:yt,useDeferredValue:yt,useTransition:yt,useSyncExternalStore:yt,useId:yt,useHostTransitionStatus:yt,useFormState:yt,useActionState:yt,useOptimistic:yt,useMemoCache:yt,useCacheRefresh:yt},Jx={readContext:Qt,use:hc,useCallback:function(e,n){return on().memoizedState=[e,n===void 0?null:n],e},useContext:Qt,useEffect:Lx,useImperativeHandle:function(e,n,o){o=o!=null?o.concat([e]):null,gc(4194308,4,Px.bind(null,n,e),o)},useLayoutEffect:function(e,n){return gc(4194308,4,e,n)},useInsertionEffect:function(e,n){gc(4,2,e,n)},useMemo:function(e,n){var o=on();n=n===void 0?null:n;var s=e();if(Fo){zn(!0);try{e()}finally{zn(!1)}}return o.memoizedState=[s,n],s},useReducer:function(e,n,o){var s=on();if(o!==void 0){var h=o(n);if(Fo){zn(!0);try{o(n)}finally{zn(!1)}}}else h=n;return s.memoizedState=s.baseState=h,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:h},s.queue=e,e=e.dispatch=wN.bind(null,Ie,e),[s.memoizedState,e]},useRef:function(e){var n=on();return e={current:e},n.memoizedState=e},useState:function(e){e=nh(e);var n=e.queue,o=Fx.bind(null,Ie,n);return n.dispatch=o,[e.memoizedState,o]},useDebugValue:oh,useDeferredValue:function(e,n){var o=on();return ah(o,e,n)},useTransition:function(){var e=nh(!1);return e=qx.bind(null,Ie,e.queue,!0,!1),on().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,n,o){var s=Ie,h=on();if(Ke){if(o===void 0)throw Error(a(407));o=o()}else{if(o=n(),rt===null)throw Error(a(349));(Ge&124)!==0||vx(s,n,o)}h.memoizedState=o;var y={value:o,getSnapshot:n};return h.queue=y,Lx(Cx.bind(null,s,y,e),[e]),s.flags|=2048,Za(9,pc(),Sx.bind(null,s,y,o,n),null),o},useId:function(){var e=on(),n=rt.identifierPrefix;if(Ke){var o=wr,s=Cr;o=(s&~(1<<32-Yt(s)-1)).toString(32)+o,n="«"+n+"R"+o,o=fc++,0<o&&(n+="H"+o.toString(32)),n+="»"}else o=yN++,n="«"+n+"r"+o.toString(32)+"»";return e.memoizedState=n},useHostTransitionStatus:sh,useFormState:Mx,useActionState:Mx,useOptimistic:function(e){var n=on();n.memoizedState=n.baseState=e;var o={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return n.queue=o,n=lh.bind(null,Ie,!0,o),o.dispatch=n,[e,n]},useMemoCache:Jf,useCacheRefresh:function(){return on().memoizedState=CN.bind(null,Ie)}},ev={readContext:Qt,use:hc,useCallback:$x,useContext:Qt,useEffect:zx,useImperativeHandle:Ux,useInsertionEffect:Bx,useLayoutEffect:Hx,useMemo:Gx,useReducer:mc,useRef:kx,useState:function(){return mc(jr)},useDebugValue:oh,useDeferredValue:function(e,n){var o=Ct();return Vx(o,We.memoizedState,e,n)},useTransition:function(){var e=mc(jr)[0],n=Ct().memoizedState;return[typeof e=="boolean"?e:fs(e),n]},useSyncExternalStore:xx,useId:Kx,useHostTransitionStatus:sh,useFormState:_x,useActionState:_x,useOptimistic:function(e,n){var o=Ct();return Tx(o,We,e,n)},useMemoCache:Jf,useCacheRefresh:Qx},EN={readContext:Qt,use:hc,useCallback:$x,useContext:Qt,useEffect:zx,useImperativeHandle:Ux,useInsertionEffect:Bx,useLayoutEffect:Hx,useMemo:Gx,useReducer:th,useRef:kx,useState:function(){return th(jr)},useDebugValue:oh,useDeferredValue:function(e,n){var o=Ct();return We===null?ah(o,e,n):Vx(o,We.memoizedState,e,n)},useTransition:function(){var e=th(jr)[0],n=Ct().memoizedState;return[typeof e=="boolean"?e:fs(e),n]},useSyncExternalStore:xx,useId:Kx,useHostTransitionStatus:sh,useFormState:Ix,useActionState:Ix,useOptimistic:function(e,n){var o=Ct();return We!==null?Tx(o,We,e,n):(o.baseState=e,[e,o.queue.dispatch])},useMemoCache:Jf,useCacheRefresh:Qx},Wa=null,ps=0;function xc(e){var n=ps;return ps+=1,Wa===null&&(Wa=[]),dx(Wa,e,n)}function gs(e,n){n=n.props.ref,e.ref=n!==void 0?n:null}function vc(e,n){throw n.$$typeof===g?Error(a(525)):(e=Object.prototype.toString.call(n),Error(a(31,e==="[object Object]"?"object with keys {"+Object.keys(n).join(", ")+"}":e)))}function tv(e){var n=e._init;return n(e._payload)}function nv(e){function n(F,X){if(e){var Z=F.deletions;Z===null?(F.deletions=[X],F.flags|=16):Z.push(X)}}function o(F,X){if(!e)return null;for(;X!==null;)n(F,X),X=X.sibling;return null}function s(F){for(var X=new Map;F!==null;)F.key!==null?X.set(F.key,F):X.set(F.index,F),F=F.sibling;return X}function h(F,X){return F=Sr(F,X),F.index=0,F.sibling=null,F}function y(F,X,Z){return F.index=Z,e?(Z=F.alternate,Z!==null?(Z=Z.index,Z<X?(F.flags|=67108866,X):Z):(F.flags|=67108866,X)):(F.flags|=1048576,X)}function A(F){return e&&F.alternate===null&&(F.flags|=67108866),F}function k(F,X,Z,ie){return X===null||X.tag!==6?(X=Of(Z,F.mode,ie),X.return=F,X):(X=h(X,Z),X.return=F,X)}function V(F,X,Z,ie){var ye=Z.type;return ye===x?re(F,X,Z.props.children,ie,Z.key):X!==null&&(X.elementType===ye||typeof ye=="object"&&ye!==null&&ye.$$typeof===I&&tv(ye)===X.type)?(X=h(X,Z.props),gs(X,Z),X.return=F,X):(X=nc(Z.type,Z.key,Z.props,null,F.mode,ie),gs(X,Z),X.return=F,X)}function W(F,X,Z,ie){return X===null||X.tag!==4||X.stateNode.containerInfo!==Z.containerInfo||X.stateNode.implementation!==Z.implementation?(X=Nf(Z,F.mode,ie),X.return=F,X):(X=h(X,Z.children||[]),X.return=F,X)}function re(F,X,Z,ie,ye){return X===null||X.tag!==7?(X=$o(Z,F.mode,ie,ye),X.return=F,X):(X=h(X,Z),X.return=F,X)}function se(F,X,Z){if(typeof X=="string"&&X!==""||typeof X=="number"||typeof X=="bigint")return X=Of(""+X,F.mode,Z),X.return=F,X;if(typeof X=="object"&&X!==null){switch(X.$$typeof){case b:return Z=nc(X.type,X.key,X.props,null,F.mode,Z),gs(Z,X),Z.return=F,Z;case v:return X=Nf(X,F.mode,Z),X.return=F,X;case I:var ie=X._init;return X=ie(X._payload),se(F,X,Z)}if(q(X)||$(X))return X=$o(X,F.mode,Z,null),X.return=F,X;if(typeof X.then=="function")return se(F,xc(X),Z);if(X.$$typeof===R)return se(F,ic(F,X),Z);vc(F,X)}return null}function J(F,X,Z,ie){var ye=X!==null?X.key:null;if(typeof Z=="string"&&Z!==""||typeof Z=="number"||typeof Z=="bigint")return ye!==null?null:k(F,X,""+Z,ie);if(typeof Z=="object"&&Z!==null){switch(Z.$$typeof){case b:return Z.key===ye?V(F,X,Z,ie):null;case v:return Z.key===ye?W(F,X,Z,ie):null;case I:return ye=Z._init,Z=ye(Z._payload),J(F,X,Z,ie)}if(q(Z)||$(Z))return ye!==null?null:re(F,X,Z,ie,null);if(typeof Z.then=="function")return J(F,X,xc(Z),ie);if(Z.$$typeof===R)return J(F,X,ic(F,Z),ie);vc(F,Z)}return null}function ee(F,X,Z,ie,ye){if(typeof ie=="string"&&ie!==""||typeof ie=="number"||typeof ie=="bigint")return F=F.get(Z)||null,k(X,F,""+ie,ye);if(typeof ie=="object"&&ie!==null){switch(ie.$$typeof){case b:return F=F.get(ie.key===null?Z:ie.key)||null,V(X,F,ie,ye);case v:return F=F.get(ie.key===null?Z:ie.key)||null,W(X,F,ie,ye);case I:var ke=ie._init;return ie=ke(ie._payload),ee(F,X,Z,ie,ye)}if(q(ie)||$(ie))return F=F.get(Z)||null,re(X,F,ie,ye,null);if(typeof ie.then=="function")return ee(F,X,Z,xc(ie),ye);if(ie.$$typeof===R)return ee(F,X,Z,ic(X,ie),ye);vc(X,ie)}return null}function Re(F,X,Z,ie){for(var ye=null,ke=null,ve=X,je=X=0,It=null;ve!==null&&je<Z.length;je++){ve.index>je?(It=ve,ve=null):It=ve.sibling;var Xe=J(F,ve,Z[je],ie);if(Xe===null){ve===null&&(ve=It);break}e&&ve&&Xe.alternate===null&&n(F,ve),X=y(Xe,X,je),ke===null?ye=Xe:ke.sibling=Xe,ke=Xe,ve=It}if(je===Z.length)return o(F,ve),Ke&&Vo(F,je),ye;if(ve===null){for(;je<Z.length;je++)ve=se(F,Z[je],ie),ve!==null&&(X=y(ve,X,je),ke===null?ye=ve:ke.sibling=ve,ke=ve);return Ke&&Vo(F,je),ye}for(ve=s(ve);je<Z.length;je++)It=ee(ve,F,je,Z[je],ie),It!==null&&(e&&It.alternate!==null&&ve.delete(It.key===null?je:It.key),X=y(It,X,je),ke===null?ye=It:ke.sibling=It,ke=It);return e&&ve.forEach(function(xo){return n(F,xo)}),Ke&&Vo(F,je),ye}function Te(F,X,Z,ie){if(Z==null)throw Error(a(151));for(var ye=null,ke=null,ve=X,je=X=0,It=null,Xe=Z.next();ve!==null&&!Xe.done;je++,Xe=Z.next()){ve.index>je?(It=ve,ve=null):It=ve.sibling;var xo=J(F,ve,Xe.value,ie);if(xo===null){ve===null&&(ve=It);break}e&&ve&&xo.alternate===null&&n(F,ve),X=y(xo,X,je),ke===null?ye=xo:ke.sibling=xo,ke=xo,ve=It}if(Xe.done)return o(F,ve),Ke&&Vo(F,je),ye;if(ve===null){for(;!Xe.done;je++,Xe=Z.next())Xe=se(F,Xe.value,ie),Xe!==null&&(X=y(Xe,X,je),ke===null?ye=Xe:ke.sibling=Xe,ke=Xe);return Ke&&Vo(F,je),ye}for(ve=s(ve);!Xe.done;je++,Xe=Z.next())Xe=ee(ve,F,je,Xe.value,ie),Xe!==null&&(e&&Xe.alternate!==null&&ve.delete(Xe.key===null?je:Xe.key),X=y(Xe,X,je),ke===null?ye=Xe:ke.sibling=Xe,ke=Xe);return e&&ve.forEach(function(TM){return n(F,TM)}),Ke&&Vo(F,je),ye}function et(F,X,Z,ie){if(typeof Z=="object"&&Z!==null&&Z.type===x&&Z.key===null&&(Z=Z.props.children),typeof Z=="object"&&Z!==null){switch(Z.$$typeof){case b:e:{for(var ye=Z.key;X!==null;){if(X.key===ye){if(ye=Z.type,ye===x){if(X.tag===7){o(F,X.sibling),ie=h(X,Z.props.children),ie.return=F,F=ie;break e}}else if(X.elementType===ye||typeof ye=="object"&&ye!==null&&ye.$$typeof===I&&tv(ye)===X.type){o(F,X.sibling),ie=h(X,Z.props),gs(ie,Z),ie.return=F,F=ie;break e}o(F,X);break}else n(F,X);X=X.sibling}Z.type===x?(ie=$o(Z.props.children,F.mode,ie,Z.key),ie.return=F,F=ie):(ie=nc(Z.type,Z.key,Z.props,null,F.mode,ie),gs(ie,Z),ie.return=F,F=ie)}return A(F);case v:e:{for(ye=Z.key;X!==null;){if(X.key===ye)if(X.tag===4&&X.stateNode.containerInfo===Z.containerInfo&&X.stateNode.implementation===Z.implementation){o(F,X.sibling),ie=h(X,Z.children||[]),ie.return=F,F=ie;break e}else{o(F,X);break}else n(F,X);X=X.sibling}ie=Nf(Z,F.mode,ie),ie.return=F,F=ie}return A(F);case I:return ye=Z._init,Z=ye(Z._payload),et(F,X,Z,ie)}if(q(Z))return Re(F,X,Z,ie);if($(Z)){if(ye=$(Z),typeof ye!="function")throw Error(a(150));return Z=ye.call(Z),Te(F,X,Z,ie)}if(typeof Z.then=="function")return et(F,X,xc(Z),ie);if(Z.$$typeof===R)return et(F,X,ic(F,Z),ie);vc(F,Z)}return typeof Z=="string"&&Z!==""||typeof Z=="number"||typeof Z=="bigint"?(Z=""+Z,X!==null&&X.tag===6?(o(F,X.sibling),ie=h(X,Z),ie.return=F,F=ie):(o(F,X),ie=Of(Z,F.mode,ie),ie.return=F,F=ie),A(F)):o(F,X)}return function(F,X,Z,ie){try{ps=0;var ye=et(F,X,Z,ie);return Wa=null,ye}catch(ve){if(ve===is||ve===lc)throw ve;var ke=fn(29,ve,null,F.mode);return ke.lanes=ie,ke.return=F,ke}finally{}}}var Ja=nv(!0),rv=nv(!1),Mn=K(null),Wn=null;function ro(e){var n=e.alternate;te(At,At.current&1),te(Mn,e),Wn===null&&(n===null||Ka.current!==null||n.memoizedState!==null)&&(Wn=e)}function ov(e){if(e.tag===22){if(te(At,At.current),te(Mn,e),Wn===null){var n=e.alternate;n!==null&&n.memoizedState!==null&&(Wn=e)}}else oo()}function oo(){te(At,At.current),te(Mn,Mn.current)}function Ar(e){ne(Mn),Wn===e&&(Wn=null),ne(At)}var At=K(0);function Sc(e){for(var n=e;n!==null;){if(n.tag===13){var o=n.memoizedState;if(o!==null&&(o=o.dehydrated,o===null||o.data==="$?"||Wh(o)))return n}else if(n.tag===19&&n.memoizedProps.revealOrder!==void 0){if((n.flags&128)!==0)return n}else if(n.child!==null){n.child.return=n,n=n.child;continue}if(n===e)break;for(;n.sibling===null;){if(n.return===null||n.return===e)return null;n=n.return}n.sibling.return=n.return,n=n.sibling}return null}function ch(e,n,o,s){n=e.memoizedState,o=o(s,n),o=o==null?n:C({},n,o),e.memoizedState=o,e.lanes===0&&(e.updateQueue.baseState=o)}var uh={enqueueSetState:function(e,n,o){e=e._reactInternals;var s=gn(),h=eo(s);h.payload=n,o!=null&&(h.callback=o),n=to(e,h,s),n!==null&&(yn(n,e,s),ls(n,e,s))},enqueueReplaceState:function(e,n,o){e=e._reactInternals;var s=gn(),h=eo(s);h.tag=1,h.payload=n,o!=null&&(h.callback=o),n=to(e,h,s),n!==null&&(yn(n,e,s),ls(n,e,s))},enqueueForceUpdate:function(e,n){e=e._reactInternals;var o=gn(),s=eo(o);s.tag=2,n!=null&&(s.callback=n),n=to(e,s,o),n!==null&&(yn(n,e,o),ls(n,e,o))}};function av(e,n,o,s,h,y,A){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(s,y,A):n.prototype&&n.prototype.isPureReactComponent?!Wi(o,s)||!Wi(h,y):!0}function iv(e,n,o,s){e=n.state,typeof n.componentWillReceiveProps=="function"&&n.componentWillReceiveProps(o,s),typeof n.UNSAFE_componentWillReceiveProps=="function"&&n.UNSAFE_componentWillReceiveProps(o,s),n.state!==e&&uh.enqueueReplaceState(n,n.state,null)}function Zo(e,n){var o=n;if("ref"in n){o={};for(var s in n)s!=="ref"&&(o[s]=n[s])}if(e=e.defaultProps){o===n&&(o=C({},o));for(var h in e)o[h]===void 0&&(o[h]=e[h])}return o}var Cc=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var n=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(n))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)};function sv(e){Cc(e)}function lv(e){console.error(e)}function cv(e){Cc(e)}function wc(e,n){try{var o=e.onUncaughtError;o(n.value,{componentStack:n.stack})}catch(s){setTimeout(function(){throw s})}}function uv(e,n,o){try{var s=e.onCaughtError;s(o.value,{componentStack:o.stack,errorBoundary:n.tag===1?n.stateNode:null})}catch(h){setTimeout(function(){throw h})}}function dh(e,n,o){return o=eo(o),o.tag=3,o.payload={element:null},o.callback=function(){wc(e,n)},o}function dv(e){return e=eo(e),e.tag=3,e}function fv(e,n,o,s){var h=o.type.getDerivedStateFromError;if(typeof h=="function"){var y=s.value;e.payload=function(){return h(y)},e.callback=function(){uv(n,o,s)}}var A=o.stateNode;A!==null&&typeof A.componentDidCatch=="function"&&(e.callback=function(){uv(n,o,s),typeof h!="function"&&(uo===null?uo=new Set([this]):uo.add(this));var k=s.stack;this.componentDidCatch(s.value,{componentStack:k!==null?k:""})})}function TN(e,n,o,s,h){if(o.flags|=32768,s!==null&&typeof s=="object"&&typeof s.then=="function"){if(n=o.alternate,n!==null&&rs(n,o,h,!0),o=Mn.current,o!==null){switch(o.tag){case 13:return Wn===null?kh():o.alternate===null&&ht===0&&(ht=3),o.flags&=-257,o.flags|=65536,o.lanes=h,s===Pf?o.flags|=16384:(n=o.updateQueue,n===null?o.updateQueue=new Set([s]):n.add(s),zh(e,s,h)),!1;case 22:return o.flags|=65536,s===Pf?o.flags|=16384:(n=o.updateQueue,n===null?(n={transitions:null,markerInstances:null,retryQueue:new Set([s])},o.updateQueue=n):(o=n.retryQueue,o===null?n.retryQueue=new Set([s]):o.add(s)),zh(e,s,h)),!1}throw Error(a(435,o.tag))}return zh(e,s,h),kh(),!1}if(Ke)return n=Mn.current,n!==null?((n.flags&65536)===0&&(n.flags|=256),n.flags|=65536,n.lanes=h,s!==Df&&(e=Error(a(422),{cause:s}),ns(An(e,o)))):(s!==Df&&(n=Error(a(423),{cause:s}),ns(An(n,o))),e=e.current.alternate,e.flags|=65536,h&=-h,e.lanes|=h,s=An(s,o),h=dh(e.stateNode,s,h),Gf(e,h),ht!==4&&(ht=2)),!1;var y=Error(a(520),{cause:s});if(y=An(y,o),ws===null?ws=[y]:ws.push(y),ht!==4&&(ht=2),n===null)return!0;s=An(s,o),o=n;do{switch(o.tag){case 3:return o.flags|=65536,e=h&-h,o.lanes|=e,e=dh(o.stateNode,s,e),Gf(o,e),!1;case 1:if(n=o.type,y=o.stateNode,(o.flags&128)===0&&(typeof n.getDerivedStateFromError=="function"||y!==null&&typeof y.componentDidCatch=="function"&&(uo===null||!uo.has(y))))return o.flags|=65536,h&=-h,o.lanes|=h,h=dv(h),fv(h,e,o,s),Gf(o,h),!1}o=o.return}while(o!==null);return!1}var hv=Error(a(461)),_t=!1;function Bt(e,n,o,s){n.child=e===null?rv(n,null,o,s):Ja(n,e.child,o,s)}function mv(e,n,o,s,h){o=o.render;var y=n.ref;if("ref"in s){var A={};for(var k in s)k!=="ref"&&(A[k]=s[k])}else A=s;return Ko(n),s=Kf(e,n,o,A,y,h),k=Qf(),e!==null&&!_t?(Ff(e,n,h),Rr(e,n,h)):(Ke&&k&&Mf(n),n.flags|=1,Bt(e,n,s,h),n.child)}function pv(e,n,o,s,h){if(e===null){var y=o.type;return typeof y=="function"&&!Rf(y)&&y.defaultProps===void 0&&o.compare===null?(n.tag=15,n.type=y,gv(e,n,y,s,h)):(e=nc(o.type,null,s,n,n.mode,h),e.ref=n.ref,e.return=n,n.child=e)}if(y=e.child,!xh(e,h)){var A=y.memoizedProps;if(o=o.compare,o=o!==null?o:Wi,o(A,s)&&e.ref===n.ref)return Rr(e,n,h)}return n.flags|=1,e=Sr(y,s),e.ref=n.ref,e.return=n,n.child=e}function gv(e,n,o,s,h){if(e!==null){var y=e.memoizedProps;if(Wi(y,s)&&e.ref===n.ref)if(_t=!1,n.pendingProps=s=y,xh(e,h))(e.flags&131072)!==0&&(_t=!0);else return n.lanes=e.lanes,Rr(e,n,h)}return fh(e,n,o,s,h)}function yv(e,n,o){var s=n.pendingProps,h=s.children,y=e!==null?e.memoizedState:null;if(s.mode==="hidden"){if((n.flags&128)!==0){if(s=y!==null?y.baseLanes|o:o,e!==null){for(h=n.child=e.child,y=0;h!==null;)y=y|h.lanes|h.childLanes,h=h.sibling;n.childLanes=y&~s}else n.childLanes=0,n.child=null;return bv(e,n,s,o)}if((o&536870912)!==0)n.memoizedState={baseLanes:0,cachePool:null},e!==null&&sc(n,y!==null?y.cachePool:null),y!==null?gx(n,y):qf(),ov(n);else return n.lanes=n.childLanes=536870912,bv(e,n,y!==null?y.baseLanes|o:o,o)}else y!==null?(sc(n,y.cachePool),gx(n,y),oo(),n.memoizedState=null):(e!==null&&sc(n,null),qf(),oo());return Bt(e,n,h,o),n.child}function bv(e,n,o,s){var h=Hf();return h=h===null?null:{parent:jt._currentValue,pool:h},n.memoizedState={baseLanes:o,cachePool:h},e!==null&&sc(n,null),qf(),ov(n),e!==null&&rs(e,n,s,!0),null}function Ec(e,n){var o=n.ref;if(o===null)e!==null&&e.ref!==null&&(n.flags|=4194816);else{if(typeof o!="function"&&typeof o!="object")throw Error(a(284));(e===null||e.ref!==o)&&(n.flags|=4194816)}}function fh(e,n,o,s,h){return Ko(n),o=Kf(e,n,o,s,void 0,h),s=Qf(),e!==null&&!_t?(Ff(e,n,h),Rr(e,n,h)):(Ke&&s&&Mf(n),n.flags|=1,Bt(e,n,o,h),n.child)}function xv(e,n,o,s,h,y){return Ko(n),n.updateQueue=null,o=bx(n,s,o,h),yx(e),s=Qf(),e!==null&&!_t?(Ff(e,n,y),Rr(e,n,y)):(Ke&&s&&Mf(n),n.flags|=1,Bt(e,n,o,y),n.child)}function vv(e,n,o,s,h){if(Ko(n),n.stateNode===null){var y=Ga,A=o.contextType;typeof A=="object"&&A!==null&&(y=Qt(A)),y=new o(s,y),n.memoizedState=y.state!==null&&y.state!==void 0?y.state:null,y.updater=uh,n.stateNode=y,y._reactInternals=n,y=n.stateNode,y.props=s,y.state=n.memoizedState,y.refs={},Uf(n),A=o.contextType,y.context=typeof A=="object"&&A!==null?Qt(A):Ga,y.state=n.memoizedState,A=o.getDerivedStateFromProps,typeof A=="function"&&(ch(n,o,A,s),y.state=n.memoizedState),typeof o.getDerivedStateFromProps=="function"||typeof y.getSnapshotBeforeUpdate=="function"||typeof y.UNSAFE_componentWillMount!="function"&&typeof y.componentWillMount!="function"||(A=y.state,typeof y.componentWillMount=="function"&&y.componentWillMount(),typeof y.UNSAFE_componentWillMount=="function"&&y.UNSAFE_componentWillMount(),A!==y.state&&uh.enqueueReplaceState(y,y.state,null),us(n,s,y,h),cs(),y.state=n.memoizedState),typeof y.componentDidMount=="function"&&(n.flags|=4194308),s=!0}else if(e===null){y=n.stateNode;var k=n.memoizedProps,V=Zo(o,k);y.props=V;var W=y.context,re=o.contextType;A=Ga,typeof re=="object"&&re!==null&&(A=Qt(re));var se=o.getDerivedStateFromProps;re=typeof se=="function"||typeof y.getSnapshotBeforeUpdate=="function",k=n.pendingProps!==k,re||typeof y.UNSAFE_componentWillReceiveProps!="function"&&typeof y.componentWillReceiveProps!="function"||(k||W!==A)&&iv(n,y,s,A),Jr=!1;var J=n.memoizedState;y.state=J,us(n,s,y,h),cs(),W=n.memoizedState,k||J!==W||Jr?(typeof se=="function"&&(ch(n,o,se,s),W=n.memoizedState),(V=Jr||av(n,o,V,s,J,W,A))?(re||typeof y.UNSAFE_componentWillMount!="function"&&typeof y.componentWillMount!="function"||(typeof y.componentWillMount=="function"&&y.componentWillMount(),typeof y.UNSAFE_componentWillMount=="function"&&y.UNSAFE_componentWillMount()),typeof y.componentDidMount=="function"&&(n.flags|=4194308)):(typeof y.componentDidMount=="function"&&(n.flags|=4194308),n.memoizedProps=s,n.memoizedState=W),y.props=s,y.state=W,y.context=A,s=V):(typeof y.componentDidMount=="function"&&(n.flags|=4194308),s=!1)}else{y=n.stateNode,$f(e,n),A=n.memoizedProps,re=Zo(o,A),y.props=re,se=n.pendingProps,J=y.context,W=o.contextType,V=Ga,typeof W=="object"&&W!==null&&(V=Qt(W)),k=o.getDerivedStateFromProps,(W=typeof k=="function"||typeof y.getSnapshotBeforeUpdate=="function")||typeof y.UNSAFE_componentWillReceiveProps!="function"&&typeof y.componentWillReceiveProps!="function"||(A!==se||J!==V)&&iv(n,y,s,V),Jr=!1,J=n.memoizedState,y.state=J,us(n,s,y,h),cs();var ee=n.memoizedState;A!==se||J!==ee||Jr||e!==null&&e.dependencies!==null&&ac(e.dependencies)?(typeof k=="function"&&(ch(n,o,k,s),ee=n.memoizedState),(re=Jr||av(n,o,re,s,J,ee,V)||e!==null&&e.dependencies!==null&&ac(e.dependencies))?(W||typeof y.UNSAFE_componentWillUpdate!="function"&&typeof y.componentWillUpdate!="function"||(typeof y.componentWillUpdate=="function"&&y.componentWillUpdate(s,ee,V),typeof y.UNSAFE_componentWillUpdate=="function"&&y.UNSAFE_componentWillUpdate(s,ee,V)),typeof y.componentDidUpdate=="function"&&(n.flags|=4),typeof y.getSnapshotBeforeUpdate=="function"&&(n.flags|=1024)):(typeof y.componentDidUpdate!="function"||A===e.memoizedProps&&J===e.memoizedState||(n.flags|=4),typeof y.getSnapshotBeforeUpdate!="function"||A===e.memoizedProps&&J===e.memoizedState||(n.flags|=1024),n.memoizedProps=s,n.memoizedState=ee),y.props=s,y.state=ee,y.context=V,s=re):(typeof y.componentDidUpdate!="function"||A===e.memoizedProps&&J===e.memoizedState||(n.flags|=4),typeof y.getSnapshotBeforeUpdate!="function"||A===e.memoizedProps&&J===e.memoizedState||(n.flags|=1024),s=!1)}return y=s,Ec(e,n),s=(n.flags&128)!==0,y||s?(y=n.stateNode,o=s&&typeof o.getDerivedStateFromError!="function"?null:y.render(),n.flags|=1,e!==null&&s?(n.child=Ja(n,e.child,null,h),n.child=Ja(n,null,o,h)):Bt(e,n,o,h),n.memoizedState=y.state,e=n.child):e=Rr(e,n,h),e}function Sv(e,n,o,s){return ts(),n.flags|=256,Bt(e,n,o,s),n.child}var hh={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function mh(e){return{baseLanes:e,cachePool:lx()}}function ph(e,n,o){return e=e!==null?e.childLanes&~o:0,n&&(e|=_n),e}function Cv(e,n,o){var s=n.pendingProps,h=!1,y=(n.flags&128)!==0,A;if((A=y)||(A=e!==null&&e.memoizedState===null?!1:(At.current&2)!==0),A&&(h=!0,n.flags&=-129),A=(n.flags&32)!==0,n.flags&=-33,e===null){if(Ke){if(h?ro(n):oo(),Ke){var k=ft,V;if(V=k){e:{for(V=k,k=Zn;V.nodeType!==8;){if(!k){k=null;break e}if(V=Un(V.nextSibling),V===null){k=null;break e}}k=V}k!==null?(n.memoizedState={dehydrated:k,treeContext:Go!==null?{id:Cr,overflow:wr}:null,retryLane:536870912,hydrationErrors:null},V=fn(18,null,null,0),V.stateNode=k,V.return=n,n.child=V,Jt=n,ft=null,V=!0):V=!1}V||Yo(n)}if(k=n.memoizedState,k!==null&&(k=k.dehydrated,k!==null))return Wh(k)?n.lanes=32:n.lanes=536870912,null;Ar(n)}return k=s.children,s=s.fallback,h?(oo(),h=n.mode,k=Tc({mode:"hidden",children:k},h),s=$o(s,h,o,null),k.return=n,s.return=n,k.sibling=s,n.child=k,h=n.child,h.memoizedState=mh(o),h.childLanes=ph(e,A,o),n.memoizedState=hh,s):(ro(n),gh(n,k))}if(V=e.memoizedState,V!==null&&(k=V.dehydrated,k!==null)){if(y)n.flags&256?(ro(n),n.flags&=-257,n=yh(e,n,o)):n.memoizedState!==null?(oo(),n.child=e.child,n.flags|=128,n=null):(oo(),h=s.fallback,k=n.mode,s=Tc({mode:"visible",children:s.children},k),h=$o(h,k,o,null),h.flags|=2,s.return=n,h.return=n,s.sibling=h,n.child=s,Ja(n,e.child,null,o),s=n.child,s.memoizedState=mh(o),s.childLanes=ph(e,A,o),n.memoizedState=hh,n=h);else if(ro(n),Wh(k)){if(A=k.nextSibling&&k.nextSibling.dataset,A)var W=A.dgst;A=W,s=Error(a(419)),s.stack="",s.digest=A,ns({value:s,source:null,stack:null}),n=yh(e,n,o)}else if(_t||rs(e,n,o,!1),A=(o&e.childLanes)!==0,_t||A){if(A=rt,A!==null&&(s=o&-o,s=(s&42)!==0?1:Wd(s),s=(s&(A.suspendedLanes|o))!==0?0:s,s!==0&&s!==V.retryLane))throw V.retryLane=s,$a(e,s),yn(A,e,s),hv;k.data==="$?"||kh(),n=yh(e,n,o)}else k.data==="$?"?(n.flags|=192,n.child=e.child,n=null):(e=V.treeContext,ft=Un(k.nextSibling),Jt=n,Ke=!0,qo=null,Zn=!1,e!==null&&(On[Nn++]=Cr,On[Nn++]=wr,On[Nn++]=Go,Cr=e.id,wr=e.overflow,Go=n),n=gh(n,s.children),n.flags|=4096);return n}return h?(oo(),h=s.fallback,k=n.mode,V=e.child,W=V.sibling,s=Sr(V,{mode:"hidden",children:s.children}),s.subtreeFlags=V.subtreeFlags&65011712,W!==null?h=Sr(W,h):(h=$o(h,k,o,null),h.flags|=2),h.return=n,s.return=n,s.sibling=h,n.child=s,s=h,h=n.child,k=e.child.memoizedState,k===null?k=mh(o):(V=k.cachePool,V!==null?(W=jt._currentValue,V=V.parent!==W?{parent:W,pool:W}:V):V=lx(),k={baseLanes:k.baseLanes|o,cachePool:V}),h.memoizedState=k,h.childLanes=ph(e,A,o),n.memoizedState=hh,s):(ro(n),o=e.child,e=o.sibling,o=Sr(o,{mode:"visible",children:s.children}),o.return=n,o.sibling=null,e!==null&&(A=n.deletions,A===null?(n.deletions=[e],n.flags|=16):A.push(e)),n.child=o,n.memoizedState=null,o)}function gh(e,n){return n=Tc({mode:"visible",children:n},e.mode),n.return=e,e.child=n}function Tc(e,n){return e=fn(22,e,null,n),e.lanes=0,e.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null},e}function yh(e,n,o){return Ja(n,e.child,null,o),e=gh(n,n.pendingProps.children),e.flags|=2,n.memoizedState=null,e}function wv(e,n,o){e.lanes|=n;var s=e.alternate;s!==null&&(s.lanes|=n),kf(e.return,n,o)}function bh(e,n,o,s,h){var y=e.memoizedState;y===null?e.memoizedState={isBackwards:n,rendering:null,renderingStartTime:0,last:s,tail:o,tailMode:h}:(y.isBackwards=n,y.rendering=null,y.renderingStartTime=0,y.last=s,y.tail=o,y.tailMode=h)}function Ev(e,n,o){var s=n.pendingProps,h=s.revealOrder,y=s.tail;if(Bt(e,n,s.children,o),s=At.current,(s&2)!==0)s=s&1|2,n.flags|=128;else{if(e!==null&&(e.flags&128)!==0)e:for(e=n.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&wv(e,o,n);else if(e.tag===19)wv(e,o,n);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===n)break e;for(;e.sibling===null;){if(e.return===null||e.return===n)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}s&=1}switch(te(At,s),h){case"forwards":for(o=n.child,h=null;o!==null;)e=o.alternate,e!==null&&Sc(e)===null&&(h=o),o=o.sibling;o=h,o===null?(h=n.child,n.child=null):(h=o.sibling,o.sibling=null),bh(n,!1,h,o,y);break;case"backwards":for(o=null,h=n.child,n.child=null;h!==null;){if(e=h.alternate,e!==null&&Sc(e)===null){n.child=h;break}e=h.sibling,h.sibling=o,o=h,h=e}bh(n,!0,o,null,y);break;case"together":bh(n,!1,null,null,void 0);break;default:n.memoizedState=null}return n.child}function Rr(e,n,o){if(e!==null&&(n.dependencies=e.dependencies),co|=n.lanes,(o&n.childLanes)===0)if(e!==null){if(rs(e,n,o,!1),(o&n.childLanes)===0)return null}else return null;if(e!==null&&n.child!==e.child)throw Error(a(153));if(n.child!==null){for(e=n.child,o=Sr(e,e.pendingProps),n.child=o,o.return=n;e.sibling!==null;)e=e.sibling,o=o.sibling=Sr(e,e.pendingProps),o.return=n;o.sibling=null}return n.child}function xh(e,n){return(e.lanes&n)!==0?!0:(e=e.dependencies,!!(e!==null&&ac(e)))}function jN(e,n,o){switch(n.tag){case 3:we(n,n.stateNode.containerInfo),Wr(n,jt,e.memoizedState.cache),ts();break;case 27:case 5:de(n);break;case 4:we(n,n.stateNode.containerInfo);break;case 10:Wr(n,n.type,n.memoizedProps.value);break;case 13:var s=n.memoizedState;if(s!==null)return s.dehydrated!==null?(ro(n),n.flags|=128,null):(o&n.child.childLanes)!==0?Cv(e,n,o):(ro(n),e=Rr(e,n,o),e!==null?e.sibling:null);ro(n);break;case 19:var h=(e.flags&128)!==0;if(s=(o&n.childLanes)!==0,s||(rs(e,n,o,!1),s=(o&n.childLanes)!==0),h){if(s)return Ev(e,n,o);n.flags|=128}if(h=n.memoizedState,h!==null&&(h.rendering=null,h.tail=null,h.lastEffect=null),te(At,At.current),s)break;return null;case 22:case 23:return n.lanes=0,yv(e,n,o);case 24:Wr(n,jt,e.memoizedState.cache)}return Rr(e,n,o)}function Tv(e,n,o){if(e!==null)if(e.memoizedProps!==n.pendingProps)_t=!0;else{if(!xh(e,o)&&(n.flags&128)===0)return _t=!1,jN(e,n,o);_t=(e.flags&131072)!==0}else _t=!1,Ke&&(n.flags&1048576)!==0&&tx(n,oc,n.index);switch(n.lanes=0,n.tag){case 16:e:{e=n.pendingProps;var s=n.elementType,h=s._init;if(s=h(s._payload),n.type=s,typeof s=="function")Rf(s)?(e=Zo(s,e),n.tag=1,n=vv(null,n,s,e,o)):(n.tag=0,n=fh(null,n,s,e,o));else{if(s!=null){if(h=s.$$typeof,h===O){n.tag=11,n=mv(null,n,s,e,o);break e}else if(h===_){n.tag=14,n=pv(null,n,s,e,o);break e}}throw n=U(s)||s,Error(a(306,n,""))}}return n;case 0:return fh(e,n,n.type,n.pendingProps,o);case 1:return s=n.type,h=Zo(s,n.pendingProps),vv(e,n,s,h,o);case 3:e:{if(we(n,n.stateNode.containerInfo),e===null)throw Error(a(387));s=n.pendingProps;var y=n.memoizedState;h=y.element,$f(e,n),us(n,s,null,o);var A=n.memoizedState;if(s=A.cache,Wr(n,jt,s),s!==y.cache&&Lf(n,[jt],o,!0),cs(),s=A.element,y.isDehydrated)if(y={element:s,isDehydrated:!1,cache:A.cache},n.updateQueue.baseState=y,n.memoizedState=y,n.flags&256){n=Sv(e,n,s,o);break e}else if(s!==h){h=An(Error(a(424)),n),ns(h),n=Sv(e,n,s,o);break e}else{switch(e=n.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName==="HTML"?e.ownerDocument.body:e}for(ft=Un(e.firstChild),Jt=n,Ke=!0,qo=null,Zn=!0,o=rv(n,null,s,o),n.child=o;o;)o.flags=o.flags&-3|4096,o=o.sibling}else{if(ts(),s===h){n=Rr(e,n,o);break e}Bt(e,n,s,o)}n=n.child}return n;case 26:return Ec(e,n),e===null?(o=O1(n.type,null,n.pendingProps,null))?n.memoizedState=o:Ke||(o=n.type,e=n.pendingProps,s=Hc(ae.current).createElement(o),s[Kt]=n,s[nn]=e,Pt(s,o,e),Mt(s),n.stateNode=s):n.memoizedState=O1(n.type,e.memoizedProps,n.pendingProps,e.memoizedState),null;case 27:return de(n),e===null&&Ke&&(s=n.stateNode=j1(n.type,n.pendingProps,ae.current),Jt=n,Zn=!0,h=ft,mo(n.type)?(Jh=h,ft=Un(s.firstChild)):ft=h),Bt(e,n,n.pendingProps.children,o),Ec(e,n),e===null&&(n.flags|=4194304),n.child;case 5:return e===null&&Ke&&((h=s=ft)&&(s=eM(s,n.type,n.pendingProps,Zn),s!==null?(n.stateNode=s,Jt=n,ft=Un(s.firstChild),Zn=!1,h=!0):h=!1),h||Yo(n)),de(n),h=n.type,y=n.pendingProps,A=e!==null?e.memoizedProps:null,s=y.children,Qh(h,y)?s=null:A!==null&&Qh(h,A)&&(n.flags|=32),n.memoizedState!==null&&(h=Kf(e,n,bN,null,null,o),_s._currentValue=h),Ec(e,n),Bt(e,n,s,o),n.child;case 6:return e===null&&Ke&&((e=o=ft)&&(o=tM(o,n.pendingProps,Zn),o!==null?(n.stateNode=o,Jt=n,ft=null,e=!0):e=!1),e||Yo(n)),null;case 13:return Cv(e,n,o);case 4:return we(n,n.stateNode.containerInfo),s=n.pendingProps,e===null?n.child=Ja(n,null,s,o):Bt(e,n,s,o),n.child;case 11:return mv(e,n,n.type,n.pendingProps,o);case 7:return Bt(e,n,n.pendingProps,o),n.child;case 8:return Bt(e,n,n.pendingProps.children,o),n.child;case 12:return Bt(e,n,n.pendingProps.children,o),n.child;case 10:return s=n.pendingProps,Wr(n,n.type,s.value),Bt(e,n,s.children,o),n.child;case 9:return h=n.type._context,s=n.pendingProps.children,Ko(n),h=Qt(h),s=s(h),n.flags|=1,Bt(e,n,s,o),n.child;case 14:return pv(e,n,n.type,n.pendingProps,o);case 15:return gv(e,n,n.type,n.pendingProps,o);case 19:return Ev(e,n,o);case 31:return s=n.pendingProps,o=n.mode,s={mode:s.mode,children:s.children},e===null?(o=Tc(s,o),o.ref=n.ref,n.child=o,o.return=n,n=o):(o=Sr(e.child,s),o.ref=n.ref,n.child=o,o.return=n,n=o),n;case 22:return yv(e,n,o);case 24:return Ko(n),s=Qt(jt),e===null?(h=Hf(),h===null&&(h=rt,y=zf(),h.pooledCache=y,y.refCount++,y!==null&&(h.pooledCacheLanes|=o),h=y),n.memoizedState={parent:s,cache:h},Uf(n),Wr(n,jt,h)):((e.lanes&o)!==0&&($f(e,n),us(n,null,null,o),cs()),h=e.memoizedState,y=n.memoizedState,h.parent!==s?(h={parent:s,cache:s},n.memoizedState=h,n.lanes===0&&(n.memoizedState=n.updateQueue.baseState=h),Wr(n,jt,s)):(s=y.cache,Wr(n,jt,s),s!==h.cache&&Lf(n,[jt],o,!0))),Bt(e,n,n.pendingProps.children,o),n.child;case 29:throw n.pendingProps}throw Error(a(156,n.tag))}function Or(e){e.flags|=4}function jv(e,n){if(n.type!=="stylesheet"||(n.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!I1(n)){if(n=Mn.current,n!==null&&((Ge&4194048)===Ge?Wn!==null:(Ge&62914560)!==Ge&&(Ge&536870912)===0||n!==Wn))throw ss=Pf,cx;e.flags|=8192}}function jc(e,n){n!==null&&(e.flags|=4),e.flags&16384&&(n=e.tag!==22?Qr():536870912,e.lanes|=n,ri|=n)}function ys(e,n){if(!Ke)switch(e.tailMode){case"hidden":n=e.tail;for(var o=null;n!==null;)n.alternate!==null&&(o=n),n=n.sibling;o===null?e.tail=null:o.sibling=null;break;case"collapsed":o=e.tail;for(var s=null;o!==null;)o.alternate!==null&&(s=o),o=o.sibling;s===null?n||e.tail===null?e.tail=null:e.tail.sibling=null:s.sibling=null}}function lt(e){var n=e.alternate!==null&&e.alternate.child===e.child,o=0,s=0;if(n)for(var h=e.child;h!==null;)o|=h.lanes|h.childLanes,s|=h.subtreeFlags&65011712,s|=h.flags&65011712,h.return=e,h=h.sibling;else for(h=e.child;h!==null;)o|=h.lanes|h.childLanes,s|=h.subtreeFlags,s|=h.flags,h.return=e,h=h.sibling;return e.subtreeFlags|=s,e.childLanes=o,n}function AN(e,n,o){var s=n.pendingProps;switch(_f(n),n.tag){case 31:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return lt(n),null;case 1:return lt(n),null;case 3:return o=n.stateNode,s=null,e!==null&&(s=e.memoizedState.cache),n.memoizedState.cache!==s&&(n.flags|=2048),Tr(jt),ge(),o.pendingContext&&(o.context=o.pendingContext,o.pendingContext=null),(e===null||e.child===null)&&(es(n)?Or(n):e===null||e.memoizedState.isDehydrated&&(n.flags&256)===0||(n.flags|=1024,ox())),lt(n),null;case 26:return o=n.memoizedState,e===null?(Or(n),o!==null?(lt(n),jv(n,o)):(lt(n),n.flags&=-16777217)):o?o!==e.memoizedState?(Or(n),lt(n),jv(n,o)):(lt(n),n.flags&=-16777217):(e.memoizedProps!==s&&Or(n),lt(n),n.flags&=-16777217),null;case 27:Me(n),o=ae.current;var h=n.type;if(e!==null&&n.stateNode!=null)e.memoizedProps!==s&&Or(n);else{if(!s){if(n.stateNode===null)throw Error(a(166));return lt(n),null}e=le.current,es(n)?nx(n):(e=j1(h,s,o),n.stateNode=e,Or(n))}return lt(n),null;case 5:if(Me(n),o=n.type,e!==null&&n.stateNode!=null)e.memoizedProps!==s&&Or(n);else{if(!s){if(n.stateNode===null)throw Error(a(166));return lt(n),null}if(e=le.current,es(n))nx(n);else{switch(h=Hc(ae.current),e){case 1:e=h.createElementNS("http://www.w3.org/2000/svg",o);break;case 2:e=h.createElementNS("http://www.w3.org/1998/Math/MathML",o);break;default:switch(o){case"svg":e=h.createElementNS("http://www.w3.org/2000/svg",o);break;case"math":e=h.createElementNS("http://www.w3.org/1998/Math/MathML",o);break;case"script":e=h.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild);break;case"select":e=typeof s.is=="string"?h.createElement("select",{is:s.is}):h.createElement("select"),s.multiple?e.multiple=!0:s.size&&(e.size=s.size);break;default:e=typeof s.is=="string"?h.createElement(o,{is:s.is}):h.createElement(o)}}e[Kt]=n,e[nn]=s;e:for(h=n.child;h!==null;){if(h.tag===5||h.tag===6)e.appendChild(h.stateNode);else if(h.tag!==4&&h.tag!==27&&h.child!==null){h.child.return=h,h=h.child;continue}if(h===n)break e;for(;h.sibling===null;){if(h.return===null||h.return===n)break e;h=h.return}h.sibling.return=h.return,h=h.sibling}n.stateNode=e;e:switch(Pt(e,o,s),o){case"button":case"input":case"select":case"textarea":e=!!s.autoFocus;break e;case"img":e=!0;break e;default:e=!1}e&&Or(n)}}return lt(n),n.flags&=-16777217,null;case 6:if(e&&n.stateNode!=null)e.memoizedProps!==s&&Or(n);else{if(typeof s!="string"&&n.stateNode===null)throw Error(a(166));if(e=ae.current,es(n)){if(e=n.stateNode,o=n.memoizedProps,s=null,h=Jt,h!==null)switch(h.tag){case 27:case 5:s=h.memoizedProps}e[Kt]=n,e=!!(e.nodeValue===o||s!==null&&s.suppressHydrationWarning===!0||x1(e.nodeValue,o)),e||Yo(n)}else e=Hc(e).createTextNode(s),e[Kt]=n,n.stateNode=e}return lt(n),null;case 13:if(s=n.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(h=es(n),s!==null&&s.dehydrated!==null){if(e===null){if(!h)throw Error(a(318));if(h=n.memoizedState,h=h!==null?h.dehydrated:null,!h)throw Error(a(317));h[Kt]=n}else ts(),(n.flags&128)===0&&(n.memoizedState=null),n.flags|=4;lt(n),h=!1}else h=ox(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=h),h=!0;if(!h)return n.flags&256?(Ar(n),n):(Ar(n),null)}if(Ar(n),(n.flags&128)!==0)return n.lanes=o,n;if(o=s!==null,e=e!==null&&e.memoizedState!==null,o){s=n.child,h=null,s.alternate!==null&&s.alternate.memoizedState!==null&&s.alternate.memoizedState.cachePool!==null&&(h=s.alternate.memoizedState.cachePool.pool);var y=null;s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(y=s.memoizedState.cachePool.pool),y!==h&&(s.flags|=2048)}return o!==e&&o&&(n.child.flags|=8192),jc(n,n.updateQueue),lt(n),null;case 4:return ge(),e===null&&Vh(n.stateNode.containerInfo),lt(n),null;case 10:return Tr(n.type),lt(n),null;case 19:if(ne(At),h=n.memoizedState,h===null)return lt(n),null;if(s=(n.flags&128)!==0,y=h.rendering,y===null)if(s)ys(h,!1);else{if(ht!==0||e!==null&&(e.flags&128)!==0)for(e=n.child;e!==null;){if(y=Sc(e),y!==null){for(n.flags|=128,ys(h,!1),e=y.updateQueue,n.updateQueue=e,jc(n,e),n.subtreeFlags=0,e=o,o=n.child;o!==null;)ex(o,e),o=o.sibling;return te(At,At.current&1|2),n.child}e=e.sibling}h.tail!==null&&dt()>Oc&&(n.flags|=128,s=!0,ys(h,!1),n.lanes=4194304)}else{if(!s)if(e=Sc(y),e!==null){if(n.flags|=128,s=!0,e=e.updateQueue,n.updateQueue=e,jc(n,e),ys(h,!0),h.tail===null&&h.tailMode==="hidden"&&!y.alternate&&!Ke)return lt(n),null}else 2*dt()-h.renderingStartTime>Oc&&o!==536870912&&(n.flags|=128,s=!0,ys(h,!1),n.lanes=4194304);h.isBackwards?(y.sibling=n.child,n.child=y):(e=h.last,e!==null?e.sibling=y:n.child=y,h.last=y)}return h.tail!==null?(n=h.tail,h.rendering=n,h.tail=n.sibling,h.renderingStartTime=dt(),n.sibling=null,e=At.current,te(At,s?e&1|2:e&1),n):(lt(n),null);case 22:case 23:return Ar(n),Yf(),s=n.memoizedState!==null,e!==null?e.memoizedState!==null!==s&&(n.flags|=8192):s&&(n.flags|=8192),s?(o&536870912)!==0&&(n.flags&128)===0&&(lt(n),n.subtreeFlags&6&&(n.flags|=8192)):lt(n),o=n.updateQueue,o!==null&&jc(n,o.retryQueue),o=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(o=e.memoizedState.cachePool.pool),s=null,n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(s=n.memoizedState.cachePool.pool),s!==o&&(n.flags|=2048),e!==null&&ne(Qo),null;case 24:return o=null,e!==null&&(o=e.memoizedState.cache),n.memoizedState.cache!==o&&(n.flags|=2048),Tr(jt),lt(n),null;case 25:return null;case 30:return null}throw Error(a(156,n.tag))}function RN(e,n){switch(_f(n),n.tag){case 1:return e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 3:return Tr(jt),ge(),e=n.flags,(e&65536)!==0&&(e&128)===0?(n.flags=e&-65537|128,n):null;case 26:case 27:case 5:return Me(n),null;case 13:if(Ar(n),e=n.memoizedState,e!==null&&e.dehydrated!==null){if(n.alternate===null)throw Error(a(340));ts()}return e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 19:return ne(At),null;case 4:return ge(),null;case 10:return Tr(n.type),null;case 22:case 23:return Ar(n),Yf(),e!==null&&ne(Qo),e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 24:return Tr(jt),null;case 25:return null;default:return null}}function Av(e,n){switch(_f(n),n.tag){case 3:Tr(jt),ge();break;case 26:case 27:case 5:Me(n);break;case 4:ge();break;case 13:Ar(n);break;case 19:ne(At);break;case 10:Tr(n.type);break;case 22:case 23:Ar(n),Yf(),e!==null&&ne(Qo);break;case 24:Tr(jt)}}function bs(e,n){try{var o=n.updateQueue,s=o!==null?o.lastEffect:null;if(s!==null){var h=s.next;o=h;do{if((o.tag&e)===e){s=void 0;var y=o.create,A=o.inst;s=y(),A.destroy=s}o=o.next}while(o!==h)}}catch(k){tt(n,n.return,k)}}function ao(e,n,o){try{var s=n.updateQueue,h=s!==null?s.lastEffect:null;if(h!==null){var y=h.next;s=y;do{if((s.tag&e)===e){var A=s.inst,k=A.destroy;if(k!==void 0){A.destroy=void 0,h=n;var V=o,W=k;try{W()}catch(re){tt(h,V,re)}}}s=s.next}while(s!==y)}}catch(re){tt(n,n.return,re)}}function Rv(e){var n=e.updateQueue;if(n!==null){var o=e.stateNode;try{px(n,o)}catch(s){tt(e,e.return,s)}}}function Ov(e,n,o){o.props=Zo(e.type,e.memoizedProps),o.state=e.memoizedState;try{o.componentWillUnmount()}catch(s){tt(e,n,s)}}function xs(e,n){try{var o=e.ref;if(o!==null){switch(e.tag){case 26:case 27:case 5:var s=e.stateNode;break;case 30:s=e.stateNode;break;default:s=e.stateNode}typeof o=="function"?e.refCleanup=o(s):o.current=s}}catch(h){tt(e,n,h)}}function Jn(e,n){var o=e.ref,s=e.refCleanup;if(o!==null)if(typeof s=="function")try{s()}catch(h){tt(e,n,h)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof o=="function")try{o(null)}catch(h){tt(e,n,h)}else o.current=null}function Nv(e){var n=e.type,o=e.memoizedProps,s=e.stateNode;try{e:switch(n){case"button":case"input":case"select":case"textarea":o.autoFocus&&s.focus();break e;case"img":o.src?s.src=o.src:o.srcSet&&(s.srcset=o.srcSet)}}catch(h){tt(e,e.return,h)}}function vh(e,n,o){try{var s=e.stateNode;QN(s,e.type,o,n),s[nn]=n}catch(h){tt(e,e.return,h)}}function Mv(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&mo(e.type)||e.tag===4}function Sh(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Mv(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&mo(e.type)||e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Ch(e,n,o){var s=e.tag;if(s===5||s===6)e=e.stateNode,n?(o.nodeType===9?o.body:o.nodeName==="HTML"?o.ownerDocument.body:o).insertBefore(e,n):(n=o.nodeType===9?o.body:o.nodeName==="HTML"?o.ownerDocument.body:o,n.appendChild(e),o=o._reactRootContainer,o!=null||n.onclick!==null||(n.onclick=Bc));else if(s!==4&&(s===27&&mo(e.type)&&(o=e.stateNode,n=null),e=e.child,e!==null))for(Ch(e,n,o),e=e.sibling;e!==null;)Ch(e,n,o),e=e.sibling}function Ac(e,n,o){var s=e.tag;if(s===5||s===6)e=e.stateNode,n?o.insertBefore(e,n):o.appendChild(e);else if(s!==4&&(s===27&&mo(e.type)&&(o=e.stateNode),e=e.child,e!==null))for(Ac(e,n,o),e=e.sibling;e!==null;)Ac(e,n,o),e=e.sibling}function _v(e){var n=e.stateNode,o=e.memoizedProps;try{for(var s=e.type,h=n.attributes;h.length;)n.removeAttributeNode(h[0]);Pt(n,s,o),n[Kt]=e,n[nn]=o}catch(y){tt(e,e.return,y)}}var Nr=!1,bt=!1,wh=!1,Dv=typeof WeakSet=="function"?WeakSet:Set,Dt=null;function ON(e,n){if(e=e.containerInfo,Xh=qc,e=Vb(e),Sf(e)){if("selectionStart"in e)var o={start:e.selectionStart,end:e.selectionEnd};else e:{o=(o=e.ownerDocument)&&o.defaultView||window;var s=o.getSelection&&o.getSelection();if(s&&s.rangeCount!==0){o=s.anchorNode;var h=s.anchorOffset,y=s.focusNode;s=s.focusOffset;try{o.nodeType,y.nodeType}catch{o=null;break e}var A=0,k=-1,V=-1,W=0,re=0,se=e,J=null;t:for(;;){for(var ee;se!==o||h!==0&&se.nodeType!==3||(k=A+h),se!==y||s!==0&&se.nodeType!==3||(V=A+s),se.nodeType===3&&(A+=se.nodeValue.length),(ee=se.firstChild)!==null;)J=se,se=ee;for(;;){if(se===e)break t;if(J===o&&++W===h&&(k=A),J===y&&++re===s&&(V=A),(ee=se.nextSibling)!==null)break;se=J,J=se.parentNode}se=ee}o=k===-1||V===-1?null:{start:k,end:V}}else o=null}o=o||{start:0,end:0}}else o=null;for(Kh={focusedElem:e,selectionRange:o},qc=!1,Dt=n;Dt!==null;)if(n=Dt,e=n.child,(n.subtreeFlags&1024)!==0&&e!==null)e.return=n,Dt=e;else for(;Dt!==null;){switch(n=Dt,y=n.alternate,e=n.flags,n.tag){case 0:break;case 11:case 15:break;case 1:if((e&1024)!==0&&y!==null){e=void 0,o=n,h=y.memoizedProps,y=y.memoizedState,s=o.stateNode;try{var Re=Zo(o.type,h,o.elementType===o.type);e=s.getSnapshotBeforeUpdate(Re,y),s.__reactInternalSnapshotBeforeUpdate=e}catch(Te){tt(o,o.return,Te)}}break;case 3:if((e&1024)!==0){if(e=n.stateNode.containerInfo,o=e.nodeType,o===9)Zh(e);else if(o===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":Zh(e);break;default:e.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((e&1024)!==0)throw Error(a(163))}if(e=n.sibling,e!==null){e.return=n.return,Dt=e;break}Dt=n.return}}function Iv(e,n,o){var s=o.flags;switch(o.tag){case 0:case 11:case 15:io(e,o),s&4&&bs(5,o);break;case 1:if(io(e,o),s&4)if(e=o.stateNode,n===null)try{e.componentDidMount()}catch(A){tt(o,o.return,A)}else{var h=Zo(o.type,n.memoizedProps);n=n.memoizedState;try{e.componentDidUpdate(h,n,e.__reactInternalSnapshotBeforeUpdate)}catch(A){tt(o,o.return,A)}}s&64&&Rv(o),s&512&&xs(o,o.return);break;case 3:if(io(e,o),s&64&&(e=o.updateQueue,e!==null)){if(n=null,o.child!==null)switch(o.child.tag){case 27:case 5:n=o.child.stateNode;break;case 1:n=o.child.stateNode}try{px(e,n)}catch(A){tt(o,o.return,A)}}break;case 27:n===null&&s&4&&_v(o);case 26:case 5:io(e,o),n===null&&s&4&&Nv(o),s&512&&xs(o,o.return);break;case 12:io(e,o);break;case 13:io(e,o),s&4&&zv(e,o),s&64&&(e=o.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(o=BN.bind(null,o),nM(e,o))));break;case 22:if(s=o.memoizedState!==null||Nr,!s){n=n!==null&&n.memoizedState!==null||bt,h=Nr;var y=bt;Nr=s,(bt=n)&&!y?so(e,o,(o.subtreeFlags&8772)!==0):io(e,o),Nr=h,bt=y}break;case 30:break;default:io(e,o)}}function kv(e){var n=e.alternate;n!==null&&(e.alternate=null,kv(n)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(n=e.stateNode,n!==null&&tf(n)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var it=null,an=!1;function Mr(e,n,o){for(o=o.child;o!==null;)Lv(e,n,o),o=o.sibling}function Lv(e,n,o){if(zt&&typeof zt.onCommitFiberUnmount=="function")try{zt.onCommitFiberUnmount(br,o)}catch{}switch(o.tag){case 26:bt||Jn(o,n),Mr(e,n,o),o.memoizedState?o.memoizedState.count--:o.stateNode&&(o=o.stateNode,o.parentNode.removeChild(o));break;case 27:bt||Jn(o,n);var s=it,h=an;mo(o.type)&&(it=o.stateNode,an=!1),Mr(e,n,o),Rs(o.stateNode),it=s,an=h;break;case 5:bt||Jn(o,n);case 6:if(s=it,h=an,it=null,Mr(e,n,o),it=s,an=h,it!==null)if(an)try{(it.nodeType===9?it.body:it.nodeName==="HTML"?it.ownerDocument.body:it).removeChild(o.stateNode)}catch(y){tt(o,n,y)}else try{it.removeChild(o.stateNode)}catch(y){tt(o,n,y)}break;case 18:it!==null&&(an?(e=it,E1(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,o.stateNode),Ls(e)):E1(it,o.stateNode));break;case 4:s=it,h=an,it=o.stateNode.containerInfo,an=!0,Mr(e,n,o),it=s,an=h;break;case 0:case 11:case 14:case 15:bt||ao(2,o,n),bt||ao(4,o,n),Mr(e,n,o);break;case 1:bt||(Jn(o,n),s=o.stateNode,typeof s.componentWillUnmount=="function"&&Ov(o,n,s)),Mr(e,n,o);break;case 21:Mr(e,n,o);break;case 22:bt=(s=bt)||o.memoizedState!==null,Mr(e,n,o),bt=s;break;default:Mr(e,n,o)}}function zv(e,n){if(n.memoizedState===null&&(e=n.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Ls(e)}catch(o){tt(n,n.return,o)}}function NN(e){switch(e.tag){case 13:case 19:var n=e.stateNode;return n===null&&(n=e.stateNode=new Dv),n;case 22:return e=e.stateNode,n=e._retryCache,n===null&&(n=e._retryCache=new Dv),n;default:throw Error(a(435,e.tag))}}function Eh(e,n){var o=NN(e);n.forEach(function(s){var h=HN.bind(null,e,s);o.has(s)||(o.add(s),s.then(h,h))})}function hn(e,n){var o=n.deletions;if(o!==null)for(var s=0;s<o.length;s++){var h=o[s],y=e,A=n,k=A;e:for(;k!==null;){switch(k.tag){case 27:if(mo(k.type)){it=k.stateNode,an=!1;break e}break;case 5:it=k.stateNode,an=!1;break e;case 3:case 4:it=k.stateNode.containerInfo,an=!0;break e}k=k.return}if(it===null)throw Error(a(160));Lv(y,A,h),it=null,an=!1,y=h.alternate,y!==null&&(y.return=null),h.return=null}if(n.subtreeFlags&13878)for(n=n.child;n!==null;)Bv(n,e),n=n.sibling}var Pn=null;function Bv(e,n){var o=e.alternate,s=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:hn(n,e),mn(e),s&4&&(ao(3,e,e.return),bs(3,e),ao(5,e,e.return));break;case 1:hn(n,e),mn(e),s&512&&(bt||o===null||Jn(o,o.return)),s&64&&Nr&&(e=e.updateQueue,e!==null&&(s=e.callbacks,s!==null&&(o=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=o===null?s:o.concat(s))));break;case 26:var h=Pn;if(hn(n,e),mn(e),s&512&&(bt||o===null||Jn(o,o.return)),s&4){var y=o!==null?o.memoizedState:null;if(s=e.memoizedState,o===null)if(s===null)if(e.stateNode===null){e:{s=e.type,o=e.memoizedProps,h=h.ownerDocument||h;t:switch(s){case"title":y=h.getElementsByTagName("title")[0],(!y||y[Gi]||y[Kt]||y.namespaceURI==="http://www.w3.org/2000/svg"||y.hasAttribute("itemprop"))&&(y=h.createElement(s),h.head.insertBefore(y,h.querySelector("head > title"))),Pt(y,s,o),y[Kt]=e,Mt(y),s=y;break e;case"link":var A=_1("link","href",h).get(s+(o.href||""));if(A){for(var k=0;k<A.length;k++)if(y=A[k],y.getAttribute("href")===(o.href==null||o.href===""?null:o.href)&&y.getAttribute("rel")===(o.rel==null?null:o.rel)&&y.getAttribute("title")===(o.title==null?null:o.title)&&y.getAttribute("crossorigin")===(o.crossOrigin==null?null:o.crossOrigin)){A.splice(k,1);break t}}y=h.createElement(s),Pt(y,s,o),h.head.appendChild(y);break;case"meta":if(A=_1("meta","content",h).get(s+(o.content||""))){for(k=0;k<A.length;k++)if(y=A[k],y.getAttribute("content")===(o.content==null?null:""+o.content)&&y.getAttribute("name")===(o.name==null?null:o.name)&&y.getAttribute("property")===(o.property==null?null:o.property)&&y.getAttribute("http-equiv")===(o.httpEquiv==null?null:o.httpEquiv)&&y.getAttribute("charset")===(o.charSet==null?null:o.charSet)){A.splice(k,1);break t}}y=h.createElement(s),Pt(y,s,o),h.head.appendChild(y);break;default:throw Error(a(468,s))}y[Kt]=e,Mt(y),s=y}e.stateNode=s}else D1(h,e.type,e.stateNode);else e.stateNode=M1(h,s,e.memoizedProps);else y!==s?(y===null?o.stateNode!==null&&(o=o.stateNode,o.parentNode.removeChild(o)):y.count--,s===null?D1(h,e.type,e.stateNode):M1(h,s,e.memoizedProps)):s===null&&e.stateNode!==null&&vh(e,e.memoizedProps,o.memoizedProps)}break;case 27:hn(n,e),mn(e),s&512&&(bt||o===null||Jn(o,o.return)),o!==null&&s&4&&vh(e,e.memoizedProps,o.memoizedProps);break;case 5:if(hn(n,e),mn(e),s&512&&(bt||o===null||Jn(o,o.return)),e.flags&32){h=e.stateNode;try{ka(h,"")}catch(ee){tt(e,e.return,ee)}}s&4&&e.stateNode!=null&&(h=e.memoizedProps,vh(e,h,o!==null?o.memoizedProps:h)),s&1024&&(wh=!0);break;case 6:if(hn(n,e),mn(e),s&4){if(e.stateNode===null)throw Error(a(162));s=e.memoizedProps,o=e.stateNode;try{o.nodeValue=s}catch(ee){tt(e,e.return,ee)}}break;case 3:if($c=null,h=Pn,Pn=Pc(n.containerInfo),hn(n,e),Pn=h,mn(e),s&4&&o!==null&&o.memoizedState.isDehydrated)try{Ls(n.containerInfo)}catch(ee){tt(e,e.return,ee)}wh&&(wh=!1,Hv(e));break;case 4:s=Pn,Pn=Pc(e.stateNode.containerInfo),hn(n,e),mn(e),Pn=s;break;case 12:hn(n,e),mn(e);break;case 13:hn(n,e),mn(e),e.child.flags&8192&&e.memoizedState!==null!=(o!==null&&o.memoizedState!==null)&&(Nh=dt()),s&4&&(s=e.updateQueue,s!==null&&(e.updateQueue=null,Eh(e,s)));break;case 22:h=e.memoizedState!==null;var V=o!==null&&o.memoizedState!==null,W=Nr,re=bt;if(Nr=W||h,bt=re||V,hn(n,e),bt=re,Nr=W,mn(e),s&8192)e:for(n=e.stateNode,n._visibility=h?n._visibility&-2:n._visibility|1,h&&(o===null||V||Nr||bt||Wo(e)),o=null,n=e;;){if(n.tag===5||n.tag===26){if(o===null){V=o=n;try{if(y=V.stateNode,h)A=y.style,typeof A.setProperty=="function"?A.setProperty("display","none","important"):A.display="none";else{k=V.stateNode;var se=V.memoizedProps.style,J=se!=null&&se.hasOwnProperty("display")?se.display:null;k.style.display=J==null||typeof J=="boolean"?"":(""+J).trim()}}catch(ee){tt(V,V.return,ee)}}}else if(n.tag===6){if(o===null){V=n;try{V.stateNode.nodeValue=h?"":V.memoizedProps}catch(ee){tt(V,V.return,ee)}}}else if((n.tag!==22&&n.tag!==23||n.memoizedState===null||n===e)&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===e)break e;for(;n.sibling===null;){if(n.return===null||n.return===e)break e;o===n&&(o=null),n=n.return}o===n&&(o=null),n.sibling.return=n.return,n=n.sibling}s&4&&(s=e.updateQueue,s!==null&&(o=s.retryQueue,o!==null&&(s.retryQueue=null,Eh(e,o))));break;case 19:hn(n,e),mn(e),s&4&&(s=e.updateQueue,s!==null&&(e.updateQueue=null,Eh(e,s)));break;case 30:break;case 21:break;default:hn(n,e),mn(e)}}function mn(e){var n=e.flags;if(n&2){try{for(var o,s=e.return;s!==null;){if(Mv(s)){o=s;break}s=s.return}if(o==null)throw Error(a(160));switch(o.tag){case 27:var h=o.stateNode,y=Sh(e);Ac(e,y,h);break;case 5:var A=o.stateNode;o.flags&32&&(ka(A,""),o.flags&=-33);var k=Sh(e);Ac(e,k,A);break;case 3:case 4:var V=o.stateNode.containerInfo,W=Sh(e);Ch(e,W,V);break;default:throw Error(a(161))}}catch(re){tt(e,e.return,re)}e.flags&=-3}n&4096&&(e.flags&=-4097)}function Hv(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var n=e;Hv(n),n.tag===5&&n.flags&1024&&n.stateNode.reset(),e=e.sibling}}function io(e,n){if(n.subtreeFlags&8772)for(n=n.child;n!==null;)Iv(e,n.alternate,n),n=n.sibling}function Wo(e){for(e=e.child;e!==null;){var n=e;switch(n.tag){case 0:case 11:case 14:case 15:ao(4,n,n.return),Wo(n);break;case 1:Jn(n,n.return);var o=n.stateNode;typeof o.componentWillUnmount=="function"&&Ov(n,n.return,o),Wo(n);break;case 27:Rs(n.stateNode);case 26:case 5:Jn(n,n.return),Wo(n);break;case 22:n.memoizedState===null&&Wo(n);break;case 30:Wo(n);break;default:Wo(n)}e=e.sibling}}function so(e,n,o){for(o=o&&(n.subtreeFlags&8772)!==0,n=n.child;n!==null;){var s=n.alternate,h=e,y=n,A=y.flags;switch(y.tag){case 0:case 11:case 15:so(h,y,o),bs(4,y);break;case 1:if(so(h,y,o),s=y,h=s.stateNode,typeof h.componentDidMount=="function")try{h.componentDidMount()}catch(W){tt(s,s.return,W)}if(s=y,h=s.updateQueue,h!==null){var k=s.stateNode;try{var V=h.shared.hiddenCallbacks;if(V!==null)for(h.shared.hiddenCallbacks=null,h=0;h<V.length;h++)mx(V[h],k)}catch(W){tt(s,s.return,W)}}o&&A&64&&Rv(y),xs(y,y.return);break;case 27:_v(y);case 26:case 5:so(h,y,o),o&&s===null&&A&4&&Nv(y),xs(y,y.return);break;case 12:so(h,y,o);break;case 13:so(h,y,o),o&&A&4&&zv(h,y);break;case 22:y.memoizedState===null&&so(h,y,o),xs(y,y.return);break;case 30:break;default:so(h,y,o)}n=n.sibling}}function Th(e,n){var o=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(o=e.memoizedState.cachePool.pool),e=null,n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(e=n.memoizedState.cachePool.pool),e!==o&&(e!=null&&e.refCount++,o!=null&&os(o))}function jh(e,n){e=null,n.alternate!==null&&(e=n.alternate.memoizedState.cache),n=n.memoizedState.cache,n!==e&&(n.refCount++,e!=null&&os(e))}function er(e,n,o,s){if(n.subtreeFlags&10256)for(n=n.child;n!==null;)Pv(e,n,o,s),n=n.sibling}function Pv(e,n,o,s){var h=n.flags;switch(n.tag){case 0:case 11:case 15:er(e,n,o,s),h&2048&&bs(9,n);break;case 1:er(e,n,o,s);break;case 3:er(e,n,o,s),h&2048&&(e=null,n.alternate!==null&&(e=n.alternate.memoizedState.cache),n=n.memoizedState.cache,n!==e&&(n.refCount++,e!=null&&os(e)));break;case 12:if(h&2048){er(e,n,o,s),e=n.stateNode;try{var y=n.memoizedProps,A=y.id,k=y.onPostCommit;typeof k=="function"&&k(A,n.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(V){tt(n,n.return,V)}}else er(e,n,o,s);break;case 13:er(e,n,o,s);break;case 23:break;case 22:y=n.stateNode,A=n.alternate,n.memoizedState!==null?y._visibility&2?er(e,n,o,s):vs(e,n):y._visibility&2?er(e,n,o,s):(y._visibility|=2,ei(e,n,o,s,(n.subtreeFlags&10256)!==0)),h&2048&&Th(A,n);break;case 24:er(e,n,o,s),h&2048&&jh(n.alternate,n);break;default:er(e,n,o,s)}}function ei(e,n,o,s,h){for(h=h&&(n.subtreeFlags&10256)!==0,n=n.child;n!==null;){var y=e,A=n,k=o,V=s,W=A.flags;switch(A.tag){case 0:case 11:case 15:ei(y,A,k,V,h),bs(8,A);break;case 23:break;case 22:var re=A.stateNode;A.memoizedState!==null?re._visibility&2?ei(y,A,k,V,h):vs(y,A):(re._visibility|=2,ei(y,A,k,V,h)),h&&W&2048&&Th(A.alternate,A);break;case 24:ei(y,A,k,V,h),h&&W&2048&&jh(A.alternate,A);break;default:ei(y,A,k,V,h)}n=n.sibling}}function vs(e,n){if(n.subtreeFlags&10256)for(n=n.child;n!==null;){var o=e,s=n,h=s.flags;switch(s.tag){case 22:vs(o,s),h&2048&&Th(s.alternate,s);break;case 24:vs(o,s),h&2048&&jh(s.alternate,s);break;default:vs(o,s)}n=n.sibling}}var Ss=8192;function ti(e){if(e.subtreeFlags&Ss)for(e=e.child;e!==null;)Uv(e),e=e.sibling}function Uv(e){switch(e.tag){case 26:ti(e),e.flags&Ss&&e.memoizedState!==null&&pM(Pn,e.memoizedState,e.memoizedProps);break;case 5:ti(e);break;case 3:case 4:var n=Pn;Pn=Pc(e.stateNode.containerInfo),ti(e),Pn=n;break;case 22:e.memoizedState===null&&(n=e.alternate,n!==null&&n.memoizedState!==null?(n=Ss,Ss=16777216,ti(e),Ss=n):ti(e));break;default:ti(e)}}function $v(e){var n=e.alternate;if(n!==null&&(e=n.child,e!==null)){n.child=null;do n=e.sibling,e.sibling=null,e=n;while(e!==null)}}function Cs(e){var n=e.deletions;if((e.flags&16)!==0){if(n!==null)for(var o=0;o<n.length;o++){var s=n[o];Dt=s,Vv(s,e)}$v(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Gv(e),e=e.sibling}function Gv(e){switch(e.tag){case 0:case 11:case 15:Cs(e),e.flags&2048&&ao(9,e,e.return);break;case 3:Cs(e);break;case 12:Cs(e);break;case 22:var n=e.stateNode;e.memoizedState!==null&&n._visibility&2&&(e.return===null||e.return.tag!==13)?(n._visibility&=-3,Rc(e)):Cs(e);break;default:Cs(e)}}function Rc(e){var n=e.deletions;if((e.flags&16)!==0){if(n!==null)for(var o=0;o<n.length;o++){var s=n[o];Dt=s,Vv(s,e)}$v(e)}for(e=e.child;e!==null;){switch(n=e,n.tag){case 0:case 11:case 15:ao(8,n,n.return),Rc(n);break;case 22:o=n.stateNode,o._visibility&2&&(o._visibility&=-3,Rc(n));break;default:Rc(n)}e=e.sibling}}function Vv(e,n){for(;Dt!==null;){var o=Dt;switch(o.tag){case 0:case 11:case 15:ao(8,o,n);break;case 23:case 22:if(o.memoizedState!==null&&o.memoizedState.cachePool!==null){var s=o.memoizedState.cachePool.pool;s!=null&&s.refCount++}break;case 24:os(o.memoizedState.cache)}if(s=o.child,s!==null)s.return=o,Dt=s;else e:for(o=e;Dt!==null;){s=Dt;var h=s.sibling,y=s.return;if(kv(s),s===o){Dt=null;break e}if(h!==null){h.return=y,Dt=h;break e}Dt=y}}}var MN={getCacheForType:function(e){var n=Qt(jt),o=n.data.get(e);return o===void 0&&(o=e(),n.data.set(e,o)),o}},_N=typeof WeakMap=="function"?WeakMap:Map,Qe=0,rt=null,He=null,Ge=0,Fe=0,pn=null,lo=!1,ni=!1,Ah=!1,_r=0,ht=0,co=0,Jo=0,Rh=0,_n=0,ri=0,ws=null,sn=null,Oh=!1,Nh=0,Oc=1/0,Nc=null,uo=null,Ht=0,fo=null,oi=null,ai=0,Mh=0,_h=null,qv=null,Es=0,Dh=null;function gn(){if((Qe&2)!==0&&Ge!==0)return Ge&-Ge;if(P.T!==null){var e=Ya;return e!==0?e:Ph()}return sb()}function Yv(){_n===0&&(_n=(Ge&536870912)===0||Ke?$i():536870912);var e=Mn.current;return e!==null&&(e.flags|=32),_n}function yn(e,n,o){(e===rt&&(Fe===2||Fe===9)||e.cancelPendingCommit!==null)&&(ii(e,0),ho(e,Ge,_n,!1)),zo(e,o),((Qe&2)===0||e!==rt)&&(e===rt&&((Qe&2)===0&&(Jo|=o),ht===4&&ho(e,Ge,_n,!1)),tr(e))}function Xv(e,n,o){if((Qe&6)!==0)throw Error(a(327));var s=!o&&(n&124)===0&&(n&e.expiredLanes)===0||Xt(e,n),h=s?kN(e,n):Lh(e,n,!0),y=s;do{if(h===0){ni&&!s&&ho(e,n,0,!1);break}else{if(o=e.current.alternate,y&&!DN(o)){h=Lh(e,n,!1),y=!1;continue}if(h===2){if(y=n,e.errorRecoveryDisabledLanes&y)var A=0;else A=e.pendingLanes&-536870913,A=A!==0?A:A&536870912?536870912:0;if(A!==0){n=A;e:{var k=e;h=ws;var V=k.current.memoizedState.isDehydrated;if(V&&(ii(k,A).flags|=256),A=Lh(k,A,!1),A!==2){if(Ah&&!V){k.errorRecoveryDisabledLanes|=y,Jo|=y,h=4;break e}y=sn,sn=h,y!==null&&(sn===null?sn=y:sn.push.apply(sn,y))}h=A}if(y=!1,h!==2)continue}}if(h===1){ii(e,0),ho(e,n,0,!0);break}e:{switch(s=e,y=h,y){case 0:case 1:throw Error(a(345));case 4:if((n&4194048)!==n)break;case 6:ho(s,n,_n,!lo);break e;case 2:sn=null;break;case 3:case 5:break;default:throw Error(a(329))}if((n&62914560)===n&&(h=Nh+300-dt(),10<h)){if(ho(s,n,_n,!lo),Nt(s,0,!0)!==0)break e;s.timeoutHandle=C1(Kv.bind(null,s,o,sn,Nc,Oh,n,_n,Jo,ri,lo,y,2,-0,0),h);break e}Kv(s,o,sn,Nc,Oh,n,_n,Jo,ri,lo,y,0,-0,0)}}break}while(!0);tr(e)}function Kv(e,n,o,s,h,y,A,k,V,W,re,se,J,ee){if(e.timeoutHandle=-1,se=n.subtreeFlags,(se&8192||(se&16785408)===16785408)&&(Ms={stylesheets:null,count:0,unsuspend:mM},Uv(n),se=gM(),se!==null)){e.cancelPendingCommit=se(t1.bind(null,e,n,y,o,s,h,A,k,V,re,1,J,ee)),ho(e,y,A,!W);return}t1(e,n,y,o,s,h,A,k,V)}function DN(e){for(var n=e;;){var o=n.tag;if((o===0||o===11||o===15)&&n.flags&16384&&(o=n.updateQueue,o!==null&&(o=o.stores,o!==null)))for(var s=0;s<o.length;s++){var h=o[s],y=h.getSnapshot;h=h.value;try{if(!dn(y(),h))return!1}catch{return!1}}if(o=n.child,n.subtreeFlags&16384&&o!==null)o.return=n,n=o;else{if(n===e)break;for(;n.sibling===null;){if(n.return===null||n.return===e)return!0;n=n.return}n.sibling.return=n.return,n=n.sibling}}return!0}function ho(e,n,o,s){n&=~Rh,n&=~Jo,e.suspendedLanes|=n,e.pingedLanes&=~n,s&&(e.warmLanes|=n),s=e.expirationTimes;for(var h=n;0<h;){var y=31-Yt(h),A=1<<y;s[y]=-1,h&=~A}o!==0&&ab(e,o,n)}function Mc(){return(Qe&6)===0?(Ts(0),!1):!0}function Ih(){if(He!==null){if(Fe===0)var e=He.return;else e=He,Er=Xo=null,Zf(e),Wa=null,ps=0,e=He;for(;e!==null;)Av(e.alternate,e),e=e.return;He=null}}function ii(e,n){var o=e.timeoutHandle;o!==-1&&(e.timeoutHandle=-1,ZN(o)),o=e.cancelPendingCommit,o!==null&&(e.cancelPendingCommit=null,o()),Ih(),rt=e,He=o=Sr(e.current,null),Ge=n,Fe=0,pn=null,lo=!1,ni=Xt(e,n),Ah=!1,ri=_n=Rh=Jo=co=ht=0,sn=ws=null,Oh=!1,(n&8)!==0&&(n|=n&32);var s=e.entangledLanes;if(s!==0)for(e=e.entanglements,s&=n;0<s;){var h=31-Yt(s),y=1<<h;n|=e[h],s&=~y}return _r=n,Jl(),o}function Qv(e,n){Ie=null,P.H=bc,n===is||n===lc?(n=fx(),Fe=3):n===cx?(n=fx(),Fe=4):Fe=n===hv?8:n!==null&&typeof n=="object"&&typeof n.then=="function"?6:1,pn=n,He===null&&(ht=1,wc(e,An(n,e.current)))}function Fv(){var e=P.H;return P.H=bc,e===null?bc:e}function Zv(){var e=P.A;return P.A=MN,e}function kh(){ht=4,lo||(Ge&4194048)!==Ge&&Mn.current!==null||(ni=!0),(co&134217727)===0&&(Jo&134217727)===0||rt===null||ho(rt,Ge,_n,!1)}function Lh(e,n,o){var s=Qe;Qe|=2;var h=Fv(),y=Zv();(rt!==e||Ge!==n)&&(Nc=null,ii(e,n)),n=!1;var A=ht;e:do try{if(Fe!==0&&He!==null){var k=He,V=pn;switch(Fe){case 8:Ih(),A=6;break e;case 3:case 2:case 9:case 6:Mn.current===null&&(n=!0);var W=Fe;if(Fe=0,pn=null,si(e,k,V,W),o&&ni){A=0;break e}break;default:W=Fe,Fe=0,pn=null,si(e,k,V,W)}}IN(),A=ht;break}catch(re){Qv(e,re)}while(!0);return n&&e.shellSuspendCounter++,Er=Xo=null,Qe=s,P.H=h,P.A=y,He===null&&(rt=null,Ge=0,Jl()),A}function IN(){for(;He!==null;)Wv(He)}function kN(e,n){var o=Qe;Qe|=2;var s=Fv(),h=Zv();rt!==e||Ge!==n?(Nc=null,Oc=dt()+500,ii(e,n)):ni=Xt(e,n);e:do try{if(Fe!==0&&He!==null){n=He;var y=pn;t:switch(Fe){case 1:Fe=0,pn=null,si(e,n,y,1);break;case 2:case 9:if(ux(y)){Fe=0,pn=null,Jv(n);break}n=function(){Fe!==2&&Fe!==9||rt!==e||(Fe=7),tr(e)},y.then(n,n);break e;case 3:Fe=7;break e;case 4:Fe=5;break e;case 7:ux(y)?(Fe=0,pn=null,Jv(n)):(Fe=0,pn=null,si(e,n,y,7));break;case 5:var A=null;switch(He.tag){case 26:A=He.memoizedState;case 5:case 27:var k=He;if(!A||I1(A)){Fe=0,pn=null;var V=k.sibling;if(V!==null)He=V;else{var W=k.return;W!==null?(He=W,_c(W)):He=null}break t}}Fe=0,pn=null,si(e,n,y,5);break;case 6:Fe=0,pn=null,si(e,n,y,6);break;case 8:Ih(),ht=6;break e;default:throw Error(a(462))}}LN();break}catch(re){Qv(e,re)}while(!0);return Er=Xo=null,P.H=s,P.A=h,Qe=o,He!==null?0:(rt=null,Ge=0,Jl(),ht)}function LN(){for(;He!==null&&!Ce();)Wv(He)}function Wv(e){var n=Tv(e.alternate,e,_r);e.memoizedProps=e.pendingProps,n===null?_c(e):He=n}function Jv(e){var n=e,o=n.alternate;switch(n.tag){case 15:case 0:n=xv(o,n,n.pendingProps,n.type,void 0,Ge);break;case 11:n=xv(o,n,n.pendingProps,n.type.render,n.ref,Ge);break;case 5:Zf(n);default:Av(o,n),n=He=ex(n,_r),n=Tv(o,n,_r)}e.memoizedProps=e.pendingProps,n===null?_c(e):He=n}function si(e,n,o,s){Er=Xo=null,Zf(n),Wa=null,ps=0;var h=n.return;try{if(TN(e,h,n,o,Ge)){ht=1,wc(e,An(o,e.current)),He=null;return}}catch(y){if(h!==null)throw He=h,y;ht=1,wc(e,An(o,e.current)),He=null;return}n.flags&32768?(Ke||s===1?e=!0:ni||(Ge&536870912)!==0?e=!1:(lo=e=!0,(s===2||s===9||s===3||s===6)&&(s=Mn.current,s!==null&&s.tag===13&&(s.flags|=16384))),e1(n,e)):_c(n)}function _c(e){var n=e;do{if((n.flags&32768)!==0){e1(n,lo);return}e=n.return;var o=AN(n.alternate,n,_r);if(o!==null){He=o;return}if(n=n.sibling,n!==null){He=n;return}He=n=e}while(n!==null);ht===0&&(ht=5)}function e1(e,n){do{var o=RN(e.alternate,e);if(o!==null){o.flags&=32767,He=o;return}if(o=e.return,o!==null&&(o.flags|=32768,o.subtreeFlags=0,o.deletions=null),!n&&(e=e.sibling,e!==null)){He=e;return}He=e=o}while(e!==null);ht=6,He=null}function t1(e,n,o,s,h,y,A,k,V){e.cancelPendingCommit=null;do Dc();while(Ht!==0);if((Qe&6)!==0)throw Error(a(327));if(n!==null){if(n===e.current)throw Error(a(177));if(y=n.lanes|n.childLanes,y|=jf,mO(e,o,y,A,k,V),e===rt&&(He=rt=null,Ge=0),oi=n,fo=e,ai=o,Mh=y,_h=h,qv=s,(n.subtreeFlags&10256)!==0||(n.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,PN(Wt,function(){return i1(),null})):(e.callbackNode=null,e.callbackPriority=0),s=(n.flags&13878)!==0,(n.subtreeFlags&13878)!==0||s){s=P.T,P.T=null,h=G.p,G.p=2,A=Qe,Qe|=4;try{ON(e,n,o)}finally{Qe=A,G.p=h,P.T=s}}Ht=1,n1(),r1(),o1()}}function n1(){if(Ht===1){Ht=0;var e=fo,n=oi,o=(n.flags&13878)!==0;if((n.subtreeFlags&13878)!==0||o){o=P.T,P.T=null;var s=G.p;G.p=2;var h=Qe;Qe|=4;try{Bv(n,e);var y=Kh,A=Vb(e.containerInfo),k=y.focusedElem,V=y.selectionRange;if(A!==k&&k&&k.ownerDocument&&Gb(k.ownerDocument.documentElement,k)){if(V!==null&&Sf(k)){var W=V.start,re=V.end;if(re===void 0&&(re=W),"selectionStart"in k)k.selectionStart=W,k.selectionEnd=Math.min(re,k.value.length);else{var se=k.ownerDocument||document,J=se&&se.defaultView||window;if(J.getSelection){var ee=J.getSelection(),Re=k.textContent.length,Te=Math.min(V.start,Re),et=V.end===void 0?Te:Math.min(V.end,Re);!ee.extend&&Te>et&&(A=et,et=Te,Te=A);var F=$b(k,Te),X=$b(k,et);if(F&&X&&(ee.rangeCount!==1||ee.anchorNode!==F.node||ee.anchorOffset!==F.offset||ee.focusNode!==X.node||ee.focusOffset!==X.offset)){var Z=se.createRange();Z.setStart(F.node,F.offset),ee.removeAllRanges(),Te>et?(ee.addRange(Z),ee.extend(X.node,X.offset)):(Z.setEnd(X.node,X.offset),ee.addRange(Z))}}}}for(se=[],ee=k;ee=ee.parentNode;)ee.nodeType===1&&se.push({element:ee,left:ee.scrollLeft,top:ee.scrollTop});for(typeof k.focus=="function"&&k.focus(),k=0;k<se.length;k++){var ie=se[k];ie.element.scrollLeft=ie.left,ie.element.scrollTop=ie.top}}qc=!!Xh,Kh=Xh=null}finally{Qe=h,G.p=s,P.T=o}}e.current=n,Ht=2}}function r1(){if(Ht===2){Ht=0;var e=fo,n=oi,o=(n.flags&8772)!==0;if((n.subtreeFlags&8772)!==0||o){o=P.T,P.T=null;var s=G.p;G.p=2;var h=Qe;Qe|=4;try{Iv(e,n.alternate,n)}finally{Qe=h,G.p=s,P.T=o}}Ht=3}}function o1(){if(Ht===4||Ht===3){Ht=0,Ot();var e=fo,n=oi,o=ai,s=qv;(n.subtreeFlags&10256)!==0||(n.flags&10256)!==0?Ht=5:(Ht=0,oi=fo=null,a1(e,e.pendingLanes));var h=e.pendingLanes;if(h===0&&(uo=null),Jd(o),n=n.stateNode,zt&&typeof zt.onCommitFiberRoot=="function")try{zt.onCommitFiberRoot(br,n,void 0,(n.current.flags&128)===128)}catch{}if(s!==null){n=P.T,h=G.p,G.p=2,P.T=null;try{for(var y=e.onRecoverableError,A=0;A<s.length;A++){var k=s[A];y(k.value,{componentStack:k.stack})}}finally{P.T=n,G.p=h}}(ai&3)!==0&&Dc(),tr(e),h=e.pendingLanes,(o&4194090)!==0&&(h&42)!==0?e===Dh?Es++:(Es=0,Dh=e):Es=0,Ts(0)}}function a1(e,n){(e.pooledCacheLanes&=n)===0&&(n=e.pooledCache,n!=null&&(e.pooledCache=null,os(n)))}function Dc(e){return n1(),r1(),o1(),i1()}function i1(){if(Ht!==5)return!1;var e=fo,n=Mh;Mh=0;var o=Jd(ai),s=P.T,h=G.p;try{G.p=32>o?32:o,P.T=null,o=_h,_h=null;var y=fo,A=ai;if(Ht=0,oi=fo=null,ai=0,(Qe&6)!==0)throw Error(a(331));var k=Qe;if(Qe|=4,Gv(y.current),Pv(y,y.current,A,o),Qe=k,Ts(0,!1),zt&&typeof zt.onPostCommitFiberRoot=="function")try{zt.onPostCommitFiberRoot(br,y)}catch{}return!0}finally{G.p=h,P.T=s,a1(e,n)}}function s1(e,n,o){n=An(o,n),n=dh(e.stateNode,n,2),e=to(e,n,2),e!==null&&(zo(e,2),tr(e))}function tt(e,n,o){if(e.tag===3)s1(e,e,o);else for(;n!==null;){if(n.tag===3){s1(n,e,o);break}else if(n.tag===1){var s=n.stateNode;if(typeof n.type.getDerivedStateFromError=="function"||typeof s.componentDidCatch=="function"&&(uo===null||!uo.has(s))){e=An(o,e),o=dv(2),s=to(n,o,2),s!==null&&(fv(o,s,n,e),zo(s,2),tr(s));break}}n=n.return}}function zh(e,n,o){var s=e.pingCache;if(s===null){s=e.pingCache=new _N;var h=new Set;s.set(n,h)}else h=s.get(n),h===void 0&&(h=new Set,s.set(n,h));h.has(o)||(Ah=!0,h.add(o),e=zN.bind(null,e,n,o),n.then(e,e))}function zN(e,n,o){var s=e.pingCache;s!==null&&s.delete(n),e.pingedLanes|=e.suspendedLanes&o,e.warmLanes&=~o,rt===e&&(Ge&o)===o&&(ht===4||ht===3&&(Ge&62914560)===Ge&&300>dt()-Nh?(Qe&2)===0&&ii(e,0):Rh|=o,ri===Ge&&(ri=0)),tr(e)}function l1(e,n){n===0&&(n=Qr()),e=$a(e,n),e!==null&&(zo(e,n),tr(e))}function BN(e){var n=e.memoizedState,o=0;n!==null&&(o=n.retryLane),l1(e,o)}function HN(e,n){var o=0;switch(e.tag){case 13:var s=e.stateNode,h=e.memoizedState;h!==null&&(o=h.retryLane);break;case 19:s=e.stateNode;break;case 22:s=e.stateNode._retryCache;break;default:throw Error(a(314))}s!==null&&s.delete(n),l1(e,o)}function PN(e,n){return Ae(e,n)}var Ic=null,li=null,Bh=!1,kc=!1,Hh=!1,ea=0;function tr(e){e!==li&&e.next===null&&(li===null?Ic=li=e:li=li.next=e),kc=!0,Bh||(Bh=!0,$N())}function Ts(e,n){if(!Hh&&kc){Hh=!0;do for(var o=!1,s=Ic;s!==null;){if(e!==0){var h=s.pendingLanes;if(h===0)var y=0;else{var A=s.suspendedLanes,k=s.pingedLanes;y=(1<<31-Yt(42|e)+1)-1,y&=h&~(A&~k),y=y&201326741?y&201326741|1:y?y|2:0}y!==0&&(o=!0,f1(s,y))}else y=Ge,y=Nt(s,s===rt?y:0,s.cancelPendingCommit!==null||s.timeoutHandle!==-1),(y&3)===0||Xt(s,y)||(o=!0,f1(s,y));s=s.next}while(o);Hh=!1}}function UN(){c1()}function c1(){kc=Bh=!1;var e=0;ea!==0&&(FN()&&(e=ea),ea=0);for(var n=dt(),o=null,s=Ic;s!==null;){var h=s.next,y=u1(s,n);y===0?(s.next=null,o===null?Ic=h:o.next=h,h===null&&(li=o)):(o=s,(e!==0||(y&3)!==0)&&(kc=!0)),s=h}Ts(e)}function u1(e,n){for(var o=e.suspendedLanes,s=e.pingedLanes,h=e.expirationTimes,y=e.pendingLanes&-62914561;0<y;){var A=31-Yt(y),k=1<<A,V=h[A];V===-1?((k&o)===0||(k&s)!==0)&&(h[A]=Ul(k,n)):V<=n&&(e.expiredLanes|=k),y&=~k}if(n=rt,o=Ge,o=Nt(e,e===n?o:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),s=e.callbackNode,o===0||e===n&&(Fe===2||Fe===9)||e.cancelPendingCommit!==null)return s!==null&&s!==null&&Se(s),e.callbackNode=null,e.callbackPriority=0;if((o&3)===0||Xt(e,o)){if(n=o&-o,n===e.callbackPriority)return n;switch(s!==null&&Se(s),Jd(o)){case 2:case 8:o=ot;break;case 32:o=Wt;break;case 268435456:o=ja;break;default:o=Wt}return s=d1.bind(null,e),o=Ae(o,s),e.callbackPriority=n,e.callbackNode=o,n}return s!==null&&s!==null&&Se(s),e.callbackPriority=2,e.callbackNode=null,2}function d1(e,n){if(Ht!==0&&Ht!==5)return e.callbackNode=null,e.callbackPriority=0,null;var o=e.callbackNode;if(Dc()&&e.callbackNode!==o)return null;var s=Ge;return s=Nt(e,e===rt?s:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),s===0?null:(Xv(e,s,n),u1(e,dt()),e.callbackNode!=null&&e.callbackNode===o?d1.bind(null,e):null)}function f1(e,n){if(Dc())return null;Xv(e,n,!0)}function $N(){WN(function(){(Qe&6)!==0?Ae(gt,UN):c1()})}function Ph(){return ea===0&&(ea=$i()),ea}function h1(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:Yl(""+e)}function m1(e,n){var o=n.ownerDocument.createElement("input");return o.name=n.name,o.value=n.value,e.id&&o.setAttribute("form",e.id),n.parentNode.insertBefore(o,n),e=new FormData(e),o.parentNode.removeChild(o),e}function GN(e,n,o,s,h){if(n==="submit"&&o&&o.stateNode===h){var y=h1((h[nn]||null).action),A=s.submitter;A&&(n=(n=A[nn]||null)?h1(n.formAction):A.getAttribute("formAction"),n!==null&&(y=n,A=null));var k=new Fl("action","action",null,s,h);e.push({event:k,listeners:[{instance:null,listener:function(){if(s.defaultPrevented){if(ea!==0){var V=A?m1(h,A):new FormData(h);ih(o,{pending:!0,data:V,method:h.method,action:y},null,V)}}else typeof y=="function"&&(k.preventDefault(),V=A?m1(h,A):new FormData(h),ih(o,{pending:!0,data:V,method:h.method,action:y},y,V))},currentTarget:h}]})}}for(var Uh=0;Uh<Tf.length;Uh++){var $h=Tf[Uh],VN=$h.toLowerCase(),qN=$h[0].toUpperCase()+$h.slice(1);Hn(VN,"on"+qN)}Hn(Xb,"onAnimationEnd"),Hn(Kb,"onAnimationIteration"),Hn(Qb,"onAnimationStart"),Hn("dblclick","onDoubleClick"),Hn("focusin","onFocus"),Hn("focusout","onBlur"),Hn(lN,"onTransitionRun"),Hn(cN,"onTransitionStart"),Hn(uN,"onTransitionCancel"),Hn(Fb,"onTransitionEnd"),_a("onMouseEnter",["mouseout","mouseover"]),_a("onMouseLeave",["mouseout","mouseover"]),_a("onPointerEnter",["pointerout","pointerover"]),_a("onPointerLeave",["pointerout","pointerover"]),Bo("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Bo("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Bo("onBeforeInput",["compositionend","keypress","textInput","paste"]),Bo("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Bo("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Bo("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var js="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),YN=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(js));function p1(e,n){n=(n&4)!==0;for(var o=0;o<e.length;o++){var s=e[o],h=s.event;s=s.listeners;e:{var y=void 0;if(n)for(var A=s.length-1;0<=A;A--){var k=s[A],V=k.instance,W=k.currentTarget;if(k=k.listener,V!==y&&h.isPropagationStopped())break e;y=k,h.currentTarget=W;try{y(h)}catch(re){Cc(re)}h.currentTarget=null,y=V}else for(A=0;A<s.length;A++){if(k=s[A],V=k.instance,W=k.currentTarget,k=k.listener,V!==y&&h.isPropagationStopped())break e;y=k,h.currentTarget=W;try{y(h)}catch(re){Cc(re)}h.currentTarget=null,y=V}}}}function Pe(e,n){var o=n[ef];o===void 0&&(o=n[ef]=new Set);var s=e+"__bubble";o.has(s)||(g1(n,e,2,!1),o.add(s))}function Gh(e,n,o){var s=0;n&&(s|=4),g1(o,e,s,n)}var Lc="_reactListening"+Math.random().toString(36).slice(2);function Vh(e){if(!e[Lc]){e[Lc]=!0,cb.forEach(function(o){o!=="selectionchange"&&(YN.has(o)||Gh(o,!1,e),Gh(o,!0,e))});var n=e.nodeType===9?e:e.ownerDocument;n===null||n[Lc]||(n[Lc]=!0,Gh("selectionchange",!1,n))}}function g1(e,n,o,s){switch(P1(n)){case 2:var h=xM;break;case 8:h=vM;break;default:h=om}o=h.bind(null,n,o,e),h=void 0,!ff||n!=="touchstart"&&n!=="touchmove"&&n!=="wheel"||(h=!0),s?h!==void 0?e.addEventListener(n,o,{capture:!0,passive:h}):e.addEventListener(n,o,!0):h!==void 0?e.addEventListener(n,o,{passive:h}):e.addEventListener(n,o,!1)}function qh(e,n,o,s,h){var y=s;if((n&1)===0&&(n&2)===0&&s!==null)e:for(;;){if(s===null)return;var A=s.tag;if(A===3||A===4){var k=s.stateNode.containerInfo;if(k===h)break;if(A===4)for(A=s.return;A!==null;){var V=A.tag;if((V===3||V===4)&&A.stateNode.containerInfo===h)return;A=A.return}for(;k!==null;){if(A=Oa(k),A===null)return;if(V=A.tag,V===5||V===6||V===26||V===27){s=y=A;continue e}k=k.parentNode}}s=s.return}wb(function(){var W=y,re=uf(o),se=[];e:{var J=Zb.get(e);if(J!==void 0){var ee=Fl,Re=e;switch(e){case"keypress":if(Kl(o)===0)break e;case"keydown":case"keyup":ee=PO;break;case"focusin":Re="focus",ee=gf;break;case"focusout":Re="blur",ee=gf;break;case"beforeblur":case"afterblur":ee=gf;break;case"click":if(o.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":ee=jb;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ee=RO;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ee=GO;break;case Xb:case Kb:case Qb:ee=MO;break;case Fb:ee=qO;break;case"scroll":case"scrollend":ee=jO;break;case"wheel":ee=XO;break;case"copy":case"cut":case"paste":ee=DO;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":ee=Rb;break;case"toggle":case"beforetoggle":ee=QO}var Te=(n&4)!==0,et=!Te&&(e==="scroll"||e==="scrollend"),F=Te?J!==null?J+"Capture":null:J;Te=[];for(var X=W,Z;X!==null;){var ie=X;if(Z=ie.stateNode,ie=ie.tag,ie!==5&&ie!==26&&ie!==27||Z===null||F===null||(ie=qi(X,F),ie!=null&&Te.push(As(X,ie,Z))),et)break;X=X.return}0<Te.length&&(J=new ee(J,Re,null,o,re),se.push({event:J,listeners:Te}))}}if((n&7)===0){e:{if(J=e==="mouseover"||e==="pointerover",ee=e==="mouseout"||e==="pointerout",J&&o!==cf&&(Re=o.relatedTarget||o.fromElement)&&(Oa(Re)||Re[Ra]))break e;if((ee||J)&&(J=re.window===re?re:(J=re.ownerDocument)?J.defaultView||J.parentWindow:window,ee?(Re=o.relatedTarget||o.toElement,ee=W,Re=Re?Oa(Re):null,Re!==null&&(et=l(Re),Te=Re.tag,Re!==et||Te!==5&&Te!==27&&Te!==6)&&(Re=null)):(ee=null,Re=W),ee!==Re)){if(Te=jb,ie="onMouseLeave",F="onMouseEnter",X="mouse",(e==="pointerout"||e==="pointerover")&&(Te=Rb,ie="onPointerLeave",F="onPointerEnter",X="pointer"),et=ee==null?J:Vi(ee),Z=Re==null?J:Vi(Re),J=new Te(ie,X+"leave",ee,o,re),J.target=et,J.relatedTarget=Z,ie=null,Oa(re)===W&&(Te=new Te(F,X+"enter",Re,o,re),Te.target=Z,Te.relatedTarget=et,ie=Te),et=ie,ee&&Re)t:{for(Te=ee,F=Re,X=0,Z=Te;Z;Z=ci(Z))X++;for(Z=0,ie=F;ie;ie=ci(ie))Z++;for(;0<X-Z;)Te=ci(Te),X--;for(;0<Z-X;)F=ci(F),Z--;for(;X--;){if(Te===F||F!==null&&Te===F.alternate)break t;Te=ci(Te),F=ci(F)}Te=null}else Te=null;ee!==null&&y1(se,J,ee,Te,!1),Re!==null&&et!==null&&y1(se,et,Re,Te,!0)}}e:{if(J=W?Vi(W):window,ee=J.nodeName&&J.nodeName.toLowerCase(),ee==="select"||ee==="input"&&J.type==="file")var ye=Lb;else if(Ib(J))if(zb)ye=aN;else{ye=rN;var ke=nN}else ee=J.nodeName,!ee||ee.toLowerCase()!=="input"||J.type!=="checkbox"&&J.type!=="radio"?W&&lf(W.elementType)&&(ye=Lb):ye=oN;if(ye&&(ye=ye(e,W))){kb(se,ye,o,re);break e}ke&&ke(e,J,W),e==="focusout"&&W&&J.type==="number"&&W.memoizedProps.value!=null&&sf(J,"number",J.value)}switch(ke=W?Vi(W):window,e){case"focusin":(Ib(ke)||ke.contentEditable==="true")&&(Ha=ke,Cf=W,Ji=null);break;case"focusout":Ji=Cf=Ha=null;break;case"mousedown":wf=!0;break;case"contextmenu":case"mouseup":case"dragend":wf=!1,qb(se,o,re);break;case"selectionchange":if(sN)break;case"keydown":case"keyup":qb(se,o,re)}var ve;if(bf)e:{switch(e){case"compositionstart":var je="onCompositionStart";break e;case"compositionend":je="onCompositionEnd";break e;case"compositionupdate":je="onCompositionUpdate";break e}je=void 0}else Ba?_b(e,o)&&(je="onCompositionEnd"):e==="keydown"&&o.keyCode===229&&(je="onCompositionStart");je&&(Ob&&o.locale!=="ko"&&(Ba||je!=="onCompositionStart"?je==="onCompositionEnd"&&Ba&&(ve=Eb()):(Zr=re,hf="value"in Zr?Zr.value:Zr.textContent,Ba=!0)),ke=zc(W,je),0<ke.length&&(je=new Ab(je,e,null,o,re),se.push({event:je,listeners:ke}),ve?je.data=ve:(ve=Db(o),ve!==null&&(je.data=ve)))),(ve=ZO?WO(e,o):JO(e,o))&&(je=zc(W,"onBeforeInput"),0<je.length&&(ke=new Ab("onBeforeInput","beforeinput",null,o,re),se.push({event:ke,listeners:je}),ke.data=ve)),GN(se,e,W,o,re)}p1(se,n)})}function As(e,n,o){return{instance:e,listener:n,currentTarget:o}}function zc(e,n){for(var o=n+"Capture",s=[];e!==null;){var h=e,y=h.stateNode;if(h=h.tag,h!==5&&h!==26&&h!==27||y===null||(h=qi(e,o),h!=null&&s.unshift(As(e,h,y)),h=qi(e,n),h!=null&&s.push(As(e,h,y))),e.tag===3)return s;e=e.return}return[]}function ci(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function y1(e,n,o,s,h){for(var y=n._reactName,A=[];o!==null&&o!==s;){var k=o,V=k.alternate,W=k.stateNode;if(k=k.tag,V!==null&&V===s)break;k!==5&&k!==26&&k!==27||W===null||(V=W,h?(W=qi(o,y),W!=null&&A.unshift(As(o,W,V))):h||(W=qi(o,y),W!=null&&A.push(As(o,W,V)))),o=o.return}A.length!==0&&e.push({event:n,listeners:A})}var XN=/\r\n?/g,KN=/\u0000|\uFFFD/g;function b1(e){return(typeof e=="string"?e:""+e).replace(XN,`
51
+ `).replace(KN,"")}function x1(e,n){return n=b1(n),b1(e)===n}function Bc(){}function Je(e,n,o,s,h,y){switch(o){case"children":typeof s=="string"?n==="body"||n==="textarea"&&s===""||ka(e,s):(typeof s=="number"||typeof s=="bigint")&&n!=="body"&&ka(e,""+s);break;case"className":Gl(e,"class",s);break;case"tabIndex":Gl(e,"tabindex",s);break;case"dir":case"role":case"viewBox":case"width":case"height":Gl(e,o,s);break;case"style":Sb(e,s,y);break;case"data":if(n!=="object"){Gl(e,"data",s);break}case"src":case"href":if(s===""&&(n!=="a"||o!=="href")){e.removeAttribute(o);break}if(s==null||typeof s=="function"||typeof s=="symbol"||typeof s=="boolean"){e.removeAttribute(o);break}s=Yl(""+s),e.setAttribute(o,s);break;case"action":case"formAction":if(typeof s=="function"){e.setAttribute(o,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof y=="function"&&(o==="formAction"?(n!=="input"&&Je(e,n,"name",h.name,h,null),Je(e,n,"formEncType",h.formEncType,h,null),Je(e,n,"formMethod",h.formMethod,h,null),Je(e,n,"formTarget",h.formTarget,h,null)):(Je(e,n,"encType",h.encType,h,null),Je(e,n,"method",h.method,h,null),Je(e,n,"target",h.target,h,null)));if(s==null||typeof s=="symbol"||typeof s=="boolean"){e.removeAttribute(o);break}s=Yl(""+s),e.setAttribute(o,s);break;case"onClick":s!=null&&(e.onclick=Bc);break;case"onScroll":s!=null&&Pe("scroll",e);break;case"onScrollEnd":s!=null&&Pe("scrollend",e);break;case"dangerouslySetInnerHTML":if(s!=null){if(typeof s!="object"||!("__html"in s))throw Error(a(61));if(o=s.__html,o!=null){if(h.children!=null)throw Error(a(60));e.innerHTML=o}}break;case"multiple":e.multiple=s&&typeof s!="function"&&typeof s!="symbol";break;case"muted":e.muted=s&&typeof s!="function"&&typeof s!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(s==null||typeof s=="function"||typeof s=="boolean"||typeof s=="symbol"){e.removeAttribute("xlink:href");break}o=Yl(""+s),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",o);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":s!=null&&typeof s!="function"&&typeof s!="symbol"?e.setAttribute(o,""+s):e.removeAttribute(o);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":s&&typeof s!="function"&&typeof s!="symbol"?e.setAttribute(o,""):e.removeAttribute(o);break;case"capture":case"download":s===!0?e.setAttribute(o,""):s!==!1&&s!=null&&typeof s!="function"&&typeof s!="symbol"?e.setAttribute(o,s):e.removeAttribute(o);break;case"cols":case"rows":case"size":case"span":s!=null&&typeof s!="function"&&typeof s!="symbol"&&!isNaN(s)&&1<=s?e.setAttribute(o,s):e.removeAttribute(o);break;case"rowSpan":case"start":s==null||typeof s=="function"||typeof s=="symbol"||isNaN(s)?e.removeAttribute(o):e.setAttribute(o,s);break;case"popover":Pe("beforetoggle",e),Pe("toggle",e),$l(e,"popover",s);break;case"xlinkActuate":xr(e,"http://www.w3.org/1999/xlink","xlink:actuate",s);break;case"xlinkArcrole":xr(e,"http://www.w3.org/1999/xlink","xlink:arcrole",s);break;case"xlinkRole":xr(e,"http://www.w3.org/1999/xlink","xlink:role",s);break;case"xlinkShow":xr(e,"http://www.w3.org/1999/xlink","xlink:show",s);break;case"xlinkTitle":xr(e,"http://www.w3.org/1999/xlink","xlink:title",s);break;case"xlinkType":xr(e,"http://www.w3.org/1999/xlink","xlink:type",s);break;case"xmlBase":xr(e,"http://www.w3.org/XML/1998/namespace","xml:base",s);break;case"xmlLang":xr(e,"http://www.w3.org/XML/1998/namespace","xml:lang",s);break;case"xmlSpace":xr(e,"http://www.w3.org/XML/1998/namespace","xml:space",s);break;case"is":$l(e,"is",s);break;case"innerText":case"textContent":break;default:(!(2<o.length)||o[0]!=="o"&&o[0]!=="O"||o[1]!=="n"&&o[1]!=="N")&&(o=EO.get(o)||o,$l(e,o,s))}}function Yh(e,n,o,s,h,y){switch(o){case"style":Sb(e,s,y);break;case"dangerouslySetInnerHTML":if(s!=null){if(typeof s!="object"||!("__html"in s))throw Error(a(61));if(o=s.__html,o!=null){if(h.children!=null)throw Error(a(60));e.innerHTML=o}}break;case"children":typeof s=="string"?ka(e,s):(typeof s=="number"||typeof s=="bigint")&&ka(e,""+s);break;case"onScroll":s!=null&&Pe("scroll",e);break;case"onScrollEnd":s!=null&&Pe("scrollend",e);break;case"onClick":s!=null&&(e.onclick=Bc);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!ub.hasOwnProperty(o))e:{if(o[0]==="o"&&o[1]==="n"&&(h=o.endsWith("Capture"),n=o.slice(2,h?o.length-7:void 0),y=e[nn]||null,y=y!=null?y[o]:null,typeof y=="function"&&e.removeEventListener(n,y,h),typeof s=="function")){typeof y!="function"&&y!==null&&(o in e?e[o]=null:e.hasAttribute(o)&&e.removeAttribute(o)),e.addEventListener(n,s,h);break e}o in e?e[o]=s:s===!0?e.setAttribute(o,""):$l(e,o,s)}}}function Pt(e,n,o){switch(n){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Pe("error",e),Pe("load",e);var s=!1,h=!1,y;for(y in o)if(o.hasOwnProperty(y)){var A=o[y];if(A!=null)switch(y){case"src":s=!0;break;case"srcSet":h=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(a(137,n));default:Je(e,n,y,A,o,null)}}h&&Je(e,n,"srcSet",o.srcSet,o,null),s&&Je(e,n,"src",o.src,o,null);return;case"input":Pe("invalid",e);var k=y=A=h=null,V=null,W=null;for(s in o)if(o.hasOwnProperty(s)){var re=o[s];if(re!=null)switch(s){case"name":h=re;break;case"type":A=re;break;case"checked":V=re;break;case"defaultChecked":W=re;break;case"value":y=re;break;case"defaultValue":k=re;break;case"children":case"dangerouslySetInnerHTML":if(re!=null)throw Error(a(137,n));break;default:Je(e,n,s,re,o,null)}}yb(e,y,k,V,W,A,h,!1),Vl(e);return;case"select":Pe("invalid",e),s=A=y=null;for(h in o)if(o.hasOwnProperty(h)&&(k=o[h],k!=null))switch(h){case"value":y=k;break;case"defaultValue":A=k;break;case"multiple":s=k;default:Je(e,n,h,k,o,null)}n=y,o=A,e.multiple=!!s,n!=null?Ia(e,!!s,n,!1):o!=null&&Ia(e,!!s,o,!0);return;case"textarea":Pe("invalid",e),y=h=s=null;for(A in o)if(o.hasOwnProperty(A)&&(k=o[A],k!=null))switch(A){case"value":s=k;break;case"defaultValue":h=k;break;case"children":y=k;break;case"dangerouslySetInnerHTML":if(k!=null)throw Error(a(91));break;default:Je(e,n,A,k,o,null)}xb(e,s,h,y),Vl(e);return;case"option":for(V in o)if(o.hasOwnProperty(V)&&(s=o[V],s!=null))switch(V){case"selected":e.selected=s&&typeof s!="function"&&typeof s!="symbol";break;default:Je(e,n,V,s,o,null)}return;case"dialog":Pe("beforetoggle",e),Pe("toggle",e),Pe("cancel",e),Pe("close",e);break;case"iframe":case"object":Pe("load",e);break;case"video":case"audio":for(s=0;s<js.length;s++)Pe(js[s],e);break;case"image":Pe("error",e),Pe("load",e);break;case"details":Pe("toggle",e);break;case"embed":case"source":case"link":Pe("error",e),Pe("load",e);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(W in o)if(o.hasOwnProperty(W)&&(s=o[W],s!=null))switch(W){case"children":case"dangerouslySetInnerHTML":throw Error(a(137,n));default:Je(e,n,W,s,o,null)}return;default:if(lf(n)){for(re in o)o.hasOwnProperty(re)&&(s=o[re],s!==void 0&&Yh(e,n,re,s,o,void 0));return}}for(k in o)o.hasOwnProperty(k)&&(s=o[k],s!=null&&Je(e,n,k,s,o,null))}function QN(e,n,o,s){switch(n){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var h=null,y=null,A=null,k=null,V=null,W=null,re=null;for(ee in o){var se=o[ee];if(o.hasOwnProperty(ee)&&se!=null)switch(ee){case"checked":break;case"value":break;case"defaultValue":V=se;default:s.hasOwnProperty(ee)||Je(e,n,ee,null,s,se)}}for(var J in s){var ee=s[J];if(se=o[J],s.hasOwnProperty(J)&&(ee!=null||se!=null))switch(J){case"type":y=ee;break;case"name":h=ee;break;case"checked":W=ee;break;case"defaultChecked":re=ee;break;case"value":A=ee;break;case"defaultValue":k=ee;break;case"children":case"dangerouslySetInnerHTML":if(ee!=null)throw Error(a(137,n));break;default:ee!==se&&Je(e,n,J,ee,s,se)}}af(e,A,k,V,W,re,y,h);return;case"select":ee=A=k=J=null;for(y in o)if(V=o[y],o.hasOwnProperty(y)&&V!=null)switch(y){case"value":break;case"multiple":ee=V;default:s.hasOwnProperty(y)||Je(e,n,y,null,s,V)}for(h in s)if(y=s[h],V=o[h],s.hasOwnProperty(h)&&(y!=null||V!=null))switch(h){case"value":J=y;break;case"defaultValue":k=y;break;case"multiple":A=y;default:y!==V&&Je(e,n,h,y,s,V)}n=k,o=A,s=ee,J!=null?Ia(e,!!o,J,!1):!!s!=!!o&&(n!=null?Ia(e,!!o,n,!0):Ia(e,!!o,o?[]:"",!1));return;case"textarea":ee=J=null;for(k in o)if(h=o[k],o.hasOwnProperty(k)&&h!=null&&!s.hasOwnProperty(k))switch(k){case"value":break;case"children":break;default:Je(e,n,k,null,s,h)}for(A in s)if(h=s[A],y=o[A],s.hasOwnProperty(A)&&(h!=null||y!=null))switch(A){case"value":J=h;break;case"defaultValue":ee=h;break;case"children":break;case"dangerouslySetInnerHTML":if(h!=null)throw Error(a(91));break;default:h!==y&&Je(e,n,A,h,s,y)}bb(e,J,ee);return;case"option":for(var Re in o)if(J=o[Re],o.hasOwnProperty(Re)&&J!=null&&!s.hasOwnProperty(Re))switch(Re){case"selected":e.selected=!1;break;default:Je(e,n,Re,null,s,J)}for(V in s)if(J=s[V],ee=o[V],s.hasOwnProperty(V)&&J!==ee&&(J!=null||ee!=null))switch(V){case"selected":e.selected=J&&typeof J!="function"&&typeof J!="symbol";break;default:Je(e,n,V,J,s,ee)}return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var Te in o)J=o[Te],o.hasOwnProperty(Te)&&J!=null&&!s.hasOwnProperty(Te)&&Je(e,n,Te,null,s,J);for(W in s)if(J=s[W],ee=o[W],s.hasOwnProperty(W)&&J!==ee&&(J!=null||ee!=null))switch(W){case"children":case"dangerouslySetInnerHTML":if(J!=null)throw Error(a(137,n));break;default:Je(e,n,W,J,s,ee)}return;default:if(lf(n)){for(var et in o)J=o[et],o.hasOwnProperty(et)&&J!==void 0&&!s.hasOwnProperty(et)&&Yh(e,n,et,void 0,s,J);for(re in s)J=s[re],ee=o[re],!s.hasOwnProperty(re)||J===ee||J===void 0&&ee===void 0||Yh(e,n,re,J,s,ee);return}}for(var F in o)J=o[F],o.hasOwnProperty(F)&&J!=null&&!s.hasOwnProperty(F)&&Je(e,n,F,null,s,J);for(se in s)J=s[se],ee=o[se],!s.hasOwnProperty(se)||J===ee||J==null&&ee==null||Je(e,n,se,J,s,ee)}var Xh=null,Kh=null;function Hc(e){return e.nodeType===9?e:e.ownerDocument}function v1(e){switch(e){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function S1(e,n){if(e===0)switch(n){case"svg":return 1;case"math":return 2;default:return 0}return e===1&&n==="foreignObject"?0:e}function Qh(e,n){return e==="textarea"||e==="noscript"||typeof n.children=="string"||typeof n.children=="number"||typeof n.children=="bigint"||typeof n.dangerouslySetInnerHTML=="object"&&n.dangerouslySetInnerHTML!==null&&n.dangerouslySetInnerHTML.__html!=null}var Fh=null;function FN(){var e=window.event;return e&&e.type==="popstate"?e===Fh?!1:(Fh=e,!0):(Fh=null,!1)}var C1=typeof setTimeout=="function"?setTimeout:void 0,ZN=typeof clearTimeout=="function"?clearTimeout:void 0,w1=typeof Promise=="function"?Promise:void 0,WN=typeof queueMicrotask=="function"?queueMicrotask:typeof w1<"u"?function(e){return w1.resolve(null).then(e).catch(JN)}:C1;function JN(e){setTimeout(function(){throw e})}function mo(e){return e==="head"}function E1(e,n){var o=n,s=0,h=0;do{var y=o.nextSibling;if(e.removeChild(o),y&&y.nodeType===8)if(o=y.data,o==="/$"){if(0<s&&8>s){o=s;var A=e.ownerDocument;if(o&1&&Rs(A.documentElement),o&2&&Rs(A.body),o&4)for(o=A.head,Rs(o),A=o.firstChild;A;){var k=A.nextSibling,V=A.nodeName;A[Gi]||V==="SCRIPT"||V==="STYLE"||V==="LINK"&&A.rel.toLowerCase()==="stylesheet"||o.removeChild(A),A=k}}if(h===0){e.removeChild(y),Ls(n);return}h--}else o==="$"||o==="$?"||o==="$!"?h++:s=o.charCodeAt(0)-48;else s=0;o=y}while(o);Ls(n)}function Zh(e){var n=e.firstChild;for(n&&n.nodeType===10&&(n=n.nextSibling);n;){var o=n;switch(n=n.nextSibling,o.nodeName){case"HTML":case"HEAD":case"BODY":Zh(o),tf(o);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(o.rel.toLowerCase()==="stylesheet")continue}e.removeChild(o)}}function eM(e,n,o,s){for(;e.nodeType===1;){var h=o;if(e.nodeName.toLowerCase()!==n.toLowerCase()){if(!s&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(s){if(!e[Gi])switch(n){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(y=e.getAttribute("rel"),y==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(y!==h.rel||e.getAttribute("href")!==(h.href==null||h.href===""?null:h.href)||e.getAttribute("crossorigin")!==(h.crossOrigin==null?null:h.crossOrigin)||e.getAttribute("title")!==(h.title==null?null:h.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(y=e.getAttribute("src"),(y!==(h.src==null?null:h.src)||e.getAttribute("type")!==(h.type==null?null:h.type)||e.getAttribute("crossorigin")!==(h.crossOrigin==null?null:h.crossOrigin))&&y&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(n==="input"&&e.type==="hidden"){var y=h.name==null?null:""+h.name;if(h.type==="hidden"&&e.getAttribute("name")===y)return e}else return e;if(e=Un(e.nextSibling),e===null)break}return null}function tM(e,n,o){if(n==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!o||(e=Un(e.nextSibling),e===null))return null;return e}function Wh(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState==="complete"}function nM(e,n){var o=e.ownerDocument;if(e.data!=="$?"||o.readyState==="complete")n();else{var s=function(){n(),o.removeEventListener("DOMContentLoaded",s)};o.addEventListener("DOMContentLoaded",s),e._reactRetry=s}}function Un(e){for(;e!=null;e=e.nextSibling){var n=e.nodeType;if(n===1||n===3)break;if(n===8){if(n=e.data,n==="$"||n==="$!"||n==="$?"||n==="F!"||n==="F")break;if(n==="/$")return null}}return e}var Jh=null;function T1(e){e=e.previousSibling;for(var n=0;e;){if(e.nodeType===8){var o=e.data;if(o==="$"||o==="$!"||o==="$?"){if(n===0)return e;n--}else o==="/$"&&n++}e=e.previousSibling}return null}function j1(e,n,o){switch(n=Hc(o),e){case"html":if(e=n.documentElement,!e)throw Error(a(452));return e;case"head":if(e=n.head,!e)throw Error(a(453));return e;case"body":if(e=n.body,!e)throw Error(a(454));return e;default:throw Error(a(451))}}function Rs(e){for(var n=e.attributes;n.length;)e.removeAttributeNode(n[0]);tf(e)}var Dn=new Map,A1=new Set;function Pc(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var Dr=G.d;G.d={f:rM,r:oM,D:aM,C:iM,L:sM,m:lM,X:uM,S:cM,M:dM};function rM(){var e=Dr.f(),n=Mc();return e||n}function oM(e){var n=Na(e);n!==null&&n.tag===5&&n.type==="form"?Xx(n):Dr.r(e)}var ui=typeof document>"u"?null:document;function R1(e,n,o){var s=ui;if(s&&typeof n=="string"&&n){var h=jn(n);h='link[rel="'+e+'"][href="'+h+'"]',typeof o=="string"&&(h+='[crossorigin="'+o+'"]'),A1.has(h)||(A1.add(h),e={rel:e,crossOrigin:o,href:n},s.querySelector(h)===null&&(n=s.createElement("link"),Pt(n,"link",e),Mt(n),s.head.appendChild(n)))}}function aM(e){Dr.D(e),R1("dns-prefetch",e,null)}function iM(e,n){Dr.C(e,n),R1("preconnect",e,n)}function sM(e,n,o){Dr.L(e,n,o);var s=ui;if(s&&e&&n){var h='link[rel="preload"][as="'+jn(n)+'"]';n==="image"&&o&&o.imageSrcSet?(h+='[imagesrcset="'+jn(o.imageSrcSet)+'"]',typeof o.imageSizes=="string"&&(h+='[imagesizes="'+jn(o.imageSizes)+'"]')):h+='[href="'+jn(e)+'"]';var y=h;switch(n){case"style":y=di(e);break;case"script":y=fi(e)}Dn.has(y)||(e=C({rel:"preload",href:n==="image"&&o&&o.imageSrcSet?void 0:e,as:n},o),Dn.set(y,e),s.querySelector(h)!==null||n==="style"&&s.querySelector(Os(y))||n==="script"&&s.querySelector(Ns(y))||(n=s.createElement("link"),Pt(n,"link",e),Mt(n),s.head.appendChild(n)))}}function lM(e,n){Dr.m(e,n);var o=ui;if(o&&e){var s=n&&typeof n.as=="string"?n.as:"script",h='link[rel="modulepreload"][as="'+jn(s)+'"][href="'+jn(e)+'"]',y=h;switch(s){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":y=fi(e)}if(!Dn.has(y)&&(e=C({rel:"modulepreload",href:e},n),Dn.set(y,e),o.querySelector(h)===null)){switch(s){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(o.querySelector(Ns(y)))return}s=o.createElement("link"),Pt(s,"link",e),Mt(s),o.head.appendChild(s)}}}function cM(e,n,o){Dr.S(e,n,o);var s=ui;if(s&&e){var h=Ma(s).hoistableStyles,y=di(e);n=n||"default";var A=h.get(y);if(!A){var k={loading:0,preload:null};if(A=s.querySelector(Os(y)))k.loading=5;else{e=C({rel:"stylesheet",href:e,"data-precedence":n},o),(o=Dn.get(y))&&em(e,o);var V=A=s.createElement("link");Mt(V),Pt(V,"link",e),V._p=new Promise(function(W,re){V.onload=W,V.onerror=re}),V.addEventListener("load",function(){k.loading|=1}),V.addEventListener("error",function(){k.loading|=2}),k.loading|=4,Uc(A,n,s)}A={type:"stylesheet",instance:A,count:1,state:k},h.set(y,A)}}}function uM(e,n){Dr.X(e,n);var o=ui;if(o&&e){var s=Ma(o).hoistableScripts,h=fi(e),y=s.get(h);y||(y=o.querySelector(Ns(h)),y||(e=C({src:e,async:!0},n),(n=Dn.get(h))&&tm(e,n),y=o.createElement("script"),Mt(y),Pt(y,"link",e),o.head.appendChild(y)),y={type:"script",instance:y,count:1,state:null},s.set(h,y))}}function dM(e,n){Dr.M(e,n);var o=ui;if(o&&e){var s=Ma(o).hoistableScripts,h=fi(e),y=s.get(h);y||(y=o.querySelector(Ns(h)),y||(e=C({src:e,async:!0,type:"module"},n),(n=Dn.get(h))&&tm(e,n),y=o.createElement("script"),Mt(y),Pt(y,"link",e),o.head.appendChild(y)),y={type:"script",instance:y,count:1,state:null},s.set(h,y))}}function O1(e,n,o,s){var h=(h=ae.current)?Pc(h):null;if(!h)throw Error(a(446));switch(e){case"meta":case"title":return null;case"style":return typeof o.precedence=="string"&&typeof o.href=="string"?(n=di(o.href),o=Ma(h).hoistableStyles,s=o.get(n),s||(s={type:"style",instance:null,count:0,state:null},o.set(n,s)),s):{type:"void",instance:null,count:0,state:null};case"link":if(o.rel==="stylesheet"&&typeof o.href=="string"&&typeof o.precedence=="string"){e=di(o.href);var y=Ma(h).hoistableStyles,A=y.get(e);if(A||(h=h.ownerDocument||h,A={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},y.set(e,A),(y=h.querySelector(Os(e)))&&!y._p&&(A.instance=y,A.state.loading=5),Dn.has(e)||(o={rel:"preload",as:"style",href:o.href,crossOrigin:o.crossOrigin,integrity:o.integrity,media:o.media,hrefLang:o.hrefLang,referrerPolicy:o.referrerPolicy},Dn.set(e,o),y||fM(h,e,o,A.state))),n&&s===null)throw Error(a(528,""));return A}if(n&&s!==null)throw Error(a(529,""));return null;case"script":return n=o.async,o=o.src,typeof o=="string"&&n&&typeof n!="function"&&typeof n!="symbol"?(n=fi(o),o=Ma(h).hoistableScripts,s=o.get(n),s||(s={type:"script",instance:null,count:0,state:null},o.set(n,s)),s):{type:"void",instance:null,count:0,state:null};default:throw Error(a(444,e))}}function di(e){return'href="'+jn(e)+'"'}function Os(e){return'link[rel="stylesheet"]['+e+"]"}function N1(e){return C({},e,{"data-precedence":e.precedence,precedence:null})}function fM(e,n,o,s){e.querySelector('link[rel="preload"][as="style"]['+n+"]")?s.loading=1:(n=e.createElement("link"),s.preload=n,n.addEventListener("load",function(){return s.loading|=1}),n.addEventListener("error",function(){return s.loading|=2}),Pt(n,"link",o),Mt(n),e.head.appendChild(n))}function fi(e){return'[src="'+jn(e)+'"]'}function Ns(e){return"script[async]"+e}function M1(e,n,o){if(n.count++,n.instance===null)switch(n.type){case"style":var s=e.querySelector('style[data-href~="'+jn(o.href)+'"]');if(s)return n.instance=s,Mt(s),s;var h=C({},o,{"data-href":o.href,"data-precedence":o.precedence,href:null,precedence:null});return s=(e.ownerDocument||e).createElement("style"),Mt(s),Pt(s,"style",h),Uc(s,o.precedence,e),n.instance=s;case"stylesheet":h=di(o.href);var y=e.querySelector(Os(h));if(y)return n.state.loading|=4,n.instance=y,Mt(y),y;s=N1(o),(h=Dn.get(h))&&em(s,h),y=(e.ownerDocument||e).createElement("link"),Mt(y);var A=y;return A._p=new Promise(function(k,V){A.onload=k,A.onerror=V}),Pt(y,"link",s),n.state.loading|=4,Uc(y,o.precedence,e),n.instance=y;case"script":return y=fi(o.src),(h=e.querySelector(Ns(y)))?(n.instance=h,Mt(h),h):(s=o,(h=Dn.get(y))&&(s=C({},o),tm(s,h)),e=e.ownerDocument||e,h=e.createElement("script"),Mt(h),Pt(h,"link",s),e.head.appendChild(h),n.instance=h);case"void":return null;default:throw Error(a(443,n.type))}else n.type==="stylesheet"&&(n.state.loading&4)===0&&(s=n.instance,n.state.loading|=4,Uc(s,o.precedence,e));return n.instance}function Uc(e,n,o){for(var s=o.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),h=s.length?s[s.length-1]:null,y=h,A=0;A<s.length;A++){var k=s[A];if(k.dataset.precedence===n)y=k;else if(y!==h)break}y?y.parentNode.insertBefore(e,y.nextSibling):(n=o.nodeType===9?o.head:o,n.insertBefore(e,n.firstChild))}function em(e,n){e.crossOrigin==null&&(e.crossOrigin=n.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=n.referrerPolicy),e.title==null&&(e.title=n.title)}function tm(e,n){e.crossOrigin==null&&(e.crossOrigin=n.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=n.referrerPolicy),e.integrity==null&&(e.integrity=n.integrity)}var $c=null;function _1(e,n,o){if($c===null){var s=new Map,h=$c=new Map;h.set(o,s)}else h=$c,s=h.get(o),s||(s=new Map,h.set(o,s));if(s.has(e))return s;for(s.set(e,null),o=o.getElementsByTagName(e),h=0;h<o.length;h++){var y=o[h];if(!(y[Gi]||y[Kt]||e==="link"&&y.getAttribute("rel")==="stylesheet")&&y.namespaceURI!=="http://www.w3.org/2000/svg"){var A=y.getAttribute(n)||"";A=e+A;var k=s.get(A);k?k.push(y):s.set(A,[y])}}return s}function D1(e,n,o){e=e.ownerDocument||e,e.head.insertBefore(o,n==="title"?e.querySelector("head > title"):null)}function hM(e,n,o){if(o===1||n.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof n.precedence!="string"||typeof n.href!="string"||n.href==="")break;return!0;case"link":if(typeof n.rel!="string"||typeof n.href!="string"||n.href===""||n.onLoad||n.onError)break;switch(n.rel){case"stylesheet":return e=n.disabled,typeof n.precedence=="string"&&e==null;default:return!0}case"script":if(n.async&&typeof n.async!="function"&&typeof n.async!="symbol"&&!n.onLoad&&!n.onError&&n.src&&typeof n.src=="string")return!0}return!1}function I1(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}var Ms=null;function mM(){}function pM(e,n,o){if(Ms===null)throw Error(a(475));var s=Ms;if(n.type==="stylesheet"&&(typeof o.media!="string"||matchMedia(o.media).matches!==!1)&&(n.state.loading&4)===0){if(n.instance===null){var h=di(o.href),y=e.querySelector(Os(h));if(y){e=y._p,e!==null&&typeof e=="object"&&typeof e.then=="function"&&(s.count++,s=Gc.bind(s),e.then(s,s)),n.state.loading|=4,n.instance=y,Mt(y);return}y=e.ownerDocument||e,o=N1(o),(h=Dn.get(h))&&em(o,h),y=y.createElement("link"),Mt(y);var A=y;A._p=new Promise(function(k,V){A.onload=k,A.onerror=V}),Pt(y,"link",o),n.instance=y}s.stylesheets===null&&(s.stylesheets=new Map),s.stylesheets.set(n,e),(e=n.state.preload)&&(n.state.loading&3)===0&&(s.count++,n=Gc.bind(s),e.addEventListener("load",n),e.addEventListener("error",n))}}function gM(){if(Ms===null)throw Error(a(475));var e=Ms;return e.stylesheets&&e.count===0&&nm(e,e.stylesheets),0<e.count?function(n){var o=setTimeout(function(){if(e.stylesheets&&nm(e,e.stylesheets),e.unsuspend){var s=e.unsuspend;e.unsuspend=null,s()}},6e4);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(o)}}:null}function Gc(){if(this.count--,this.count===0){if(this.stylesheets)nm(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Vc=null;function nm(e,n){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Vc=new Map,n.forEach(yM,e),Vc=null,Gc.call(e))}function yM(e,n){if(!(n.state.loading&4)){var o=Vc.get(e);if(o)var s=o.get(null);else{o=new Map,Vc.set(e,o);for(var h=e.querySelectorAll("link[data-precedence],style[data-precedence]"),y=0;y<h.length;y++){var A=h[y];(A.nodeName==="LINK"||A.getAttribute("media")!=="not all")&&(o.set(A.dataset.precedence,A),s=A)}s&&o.set(null,s)}h=n.instance,A=h.getAttribute("data-precedence"),y=o.get(A)||s,y===s&&o.set(null,h),o.set(A,h),this.count++,s=Gc.bind(this),h.addEventListener("load",s),h.addEventListener("error",s),y?y.parentNode.insertBefore(h,y.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(h,e.firstChild)),n.state.loading|=4}}var _s={$$typeof:R,Provider:null,Consumer:null,_currentValue:B,_currentValue2:B,_threadCount:0};function bM(e,n,o,s,h,y,A,k){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=Bn(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Bn(0),this.hiddenUpdates=Bn(null),this.identifierPrefix=s,this.onUncaughtError=h,this.onCaughtError=y,this.onRecoverableError=A,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=k,this.incompleteTransitions=new Map}function k1(e,n,o,s,h,y,A,k,V,W,re,se){return e=new bM(e,n,o,A,k,V,W,se),n=1,y===!0&&(n|=24),y=fn(3,null,null,n),e.current=y,y.stateNode=e,n=zf(),n.refCount++,e.pooledCache=n,n.refCount++,y.memoizedState={element:s,isDehydrated:o,cache:n},Uf(y),e}function L1(e){return e?(e=Ga,e):Ga}function z1(e,n,o,s,h,y){h=L1(h),s.context===null?s.context=h:s.pendingContext=h,s=eo(n),s.payload={element:o},y=y===void 0?null:y,y!==null&&(s.callback=y),o=to(e,s,n),o!==null&&(yn(o,e,n),ls(o,e,n))}function B1(e,n){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var o=e.retryLane;e.retryLane=o!==0&&o<n?o:n}}function rm(e,n){B1(e,n),(e=e.alternate)&&B1(e,n)}function H1(e){if(e.tag===13){var n=$a(e,67108864);n!==null&&yn(n,e,67108864),rm(e,67108864)}}var qc=!0;function xM(e,n,o,s){var h=P.T;P.T=null;var y=G.p;try{G.p=2,om(e,n,o,s)}finally{G.p=y,P.T=h}}function vM(e,n,o,s){var h=P.T;P.T=null;var y=G.p;try{G.p=8,om(e,n,o,s)}finally{G.p=y,P.T=h}}function om(e,n,o,s){if(qc){var h=am(s);if(h===null)qh(e,n,s,Yc,o),U1(e,s);else if(CM(h,e,n,o,s))s.stopPropagation();else if(U1(e,s),n&4&&-1<SM.indexOf(e)){for(;h!==null;){var y=Na(h);if(y!==null)switch(y.tag){case 3:if(y=y.stateNode,y.current.memoizedState.isDehydrated){var A=Oe(y.pendingLanes);if(A!==0){var k=y;for(k.pendingLanes|=2,k.entangledLanes|=2;A;){var V=1<<31-Yt(A);k.entanglements[1]|=V,A&=~V}tr(y),(Qe&6)===0&&(Oc=dt()+500,Ts(0))}}break;case 13:k=$a(y,2),k!==null&&yn(k,y,2),Mc(),rm(y,2)}if(y=am(s),y===null&&qh(e,n,s,Yc,o),y===h)break;h=y}h!==null&&s.stopPropagation()}else qh(e,n,s,null,o)}}function am(e){return e=uf(e),im(e)}var Yc=null;function im(e){if(Yc=null,e=Oa(e),e!==null){var n=l(e);if(n===null)e=null;else{var o=n.tag;if(o===13){if(e=u(n),e!==null)return e;e=null}else if(o===3){if(n.stateNode.current.memoizedState.isDehydrated)return n.tag===3?n.stateNode.containerInfo:null;e=null}else n!==e&&(e=null)}}return Yc=e,null}function P1(e){switch(e){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(be()){case gt:return 2;case ot:return 8;case Wt:case yr:return 32;case ja:return 268435456;default:return 32}default:return 32}}var sm=!1,po=null,go=null,yo=null,Ds=new Map,Is=new Map,bo=[],SM="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function U1(e,n){switch(e){case"focusin":case"focusout":po=null;break;case"dragenter":case"dragleave":go=null;break;case"mouseover":case"mouseout":yo=null;break;case"pointerover":case"pointerout":Ds.delete(n.pointerId);break;case"gotpointercapture":case"lostpointercapture":Is.delete(n.pointerId)}}function ks(e,n,o,s,h,y){return e===null||e.nativeEvent!==y?(e={blockedOn:n,domEventName:o,eventSystemFlags:s,nativeEvent:y,targetContainers:[h]},n!==null&&(n=Na(n),n!==null&&H1(n)),e):(e.eventSystemFlags|=s,n=e.targetContainers,h!==null&&n.indexOf(h)===-1&&n.push(h),e)}function CM(e,n,o,s,h){switch(n){case"focusin":return po=ks(po,e,n,o,s,h),!0;case"dragenter":return go=ks(go,e,n,o,s,h),!0;case"mouseover":return yo=ks(yo,e,n,o,s,h),!0;case"pointerover":var y=h.pointerId;return Ds.set(y,ks(Ds.get(y)||null,e,n,o,s,h)),!0;case"gotpointercapture":return y=h.pointerId,Is.set(y,ks(Is.get(y)||null,e,n,o,s,h)),!0}return!1}function $1(e){var n=Oa(e.target);if(n!==null){var o=l(n);if(o!==null){if(n=o.tag,n===13){if(n=u(o),n!==null){e.blockedOn=n,pO(e.priority,function(){if(o.tag===13){var s=gn();s=Wd(s);var h=$a(o,s);h!==null&&yn(h,o,s),rm(o,s)}});return}}else if(n===3&&o.stateNode.current.memoizedState.isDehydrated){e.blockedOn=o.tag===3?o.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Xc(e){if(e.blockedOn!==null)return!1;for(var n=e.targetContainers;0<n.length;){var o=am(e.nativeEvent);if(o===null){o=e.nativeEvent;var s=new o.constructor(o.type,o);cf=s,o.target.dispatchEvent(s),cf=null}else return n=Na(o),n!==null&&H1(n),e.blockedOn=o,!1;n.shift()}return!0}function G1(e,n,o){Xc(e)&&o.delete(n)}function wM(){sm=!1,po!==null&&Xc(po)&&(po=null),go!==null&&Xc(go)&&(go=null),yo!==null&&Xc(yo)&&(yo=null),Ds.forEach(G1),Is.forEach(G1)}function Kc(e,n){e.blockedOn===n&&(e.blockedOn=null,sm||(sm=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,wM)))}var Qc=null;function V1(e){Qc!==e&&(Qc=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){Qc===e&&(Qc=null);for(var n=0;n<e.length;n+=3){var o=e[n],s=e[n+1],h=e[n+2];if(typeof s!="function"){if(im(s||o)===null)continue;break}var y=Na(o);y!==null&&(e.splice(n,3),n-=3,ih(y,{pending:!0,data:h,method:o.method,action:s},s,h))}}))}function Ls(e){function n(V){return Kc(V,e)}po!==null&&Kc(po,e),go!==null&&Kc(go,e),yo!==null&&Kc(yo,e),Ds.forEach(n),Is.forEach(n);for(var o=0;o<bo.length;o++){var s=bo[o];s.blockedOn===e&&(s.blockedOn=null)}for(;0<bo.length&&(o=bo[0],o.blockedOn===null);)$1(o),o.blockedOn===null&&bo.shift();if(o=(e.ownerDocument||e).$$reactFormReplay,o!=null)for(s=0;s<o.length;s+=3){var h=o[s],y=o[s+1],A=h[nn]||null;if(typeof y=="function")A||V1(o);else if(A){var k=null;if(y&&y.hasAttribute("formAction")){if(h=y,A=y[nn]||null)k=A.formAction;else if(im(h)!==null)continue}else k=A.action;typeof k=="function"?o[s+1]=k:(o.splice(s,3),s-=3),V1(o)}}}function lm(e){this._internalRoot=e}Fc.prototype.render=lm.prototype.render=function(e){var n=this._internalRoot;if(n===null)throw Error(a(409));var o=n.current,s=gn();z1(o,s,e,n,null,null)},Fc.prototype.unmount=lm.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var n=e.containerInfo;z1(e.current,2,null,e,null,null),Mc(),n[Ra]=null}};function Fc(e){this._internalRoot=e}Fc.prototype.unstable_scheduleHydration=function(e){if(e){var n=sb();e={blockedOn:null,target:e,priority:n};for(var o=0;o<bo.length&&n!==0&&n<bo[o].priority;o++);bo.splice(o,0,e),o===0&&$1(e)}};var q1=r.version;if(q1!=="19.1.1")throw Error(a(527,q1,"19.1.1"));G.findDOMNode=function(e){var n=e._reactInternals;if(n===void 0)throw typeof e.render=="function"?Error(a(188)):(e=Object.keys(e).join(","),Error(a(268,e)));return e=m(n),e=e!==null?p(e):null,e=e===null?null:e.stateNode,e};var EM={bundleType:0,version:"19.1.1",rendererPackageName:"react-dom",currentDispatcherRef:P,reconcilerVersion:"19.1.1"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Zc=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Zc.isDisabled&&Zc.supportsFiber)try{br=Zc.inject(EM),zt=Zc}catch{}}return ji.createRoot=function(e,n){if(!c(e))throw Error(a(299));var o=!1,s="",h=sv,y=lv,A=cv,k=null;return n!=null&&(n.unstable_strictMode===!0&&(o=!0),n.identifierPrefix!==void 0&&(s=n.identifierPrefix),n.onUncaughtError!==void 0&&(h=n.onUncaughtError),n.onCaughtError!==void 0&&(y=n.onCaughtError),n.onRecoverableError!==void 0&&(A=n.onRecoverableError),n.unstable_transitionCallbacks!==void 0&&(k=n.unstable_transitionCallbacks)),n=k1(e,1,!1,null,null,o,s,h,y,A,k,null),e[Ra]=n.current,Vh(e),new lm(n)},ji.hydrateRoot=function(e,n,o){if(!c(e))throw Error(a(299));var s=!1,h="",y=sv,A=lv,k=cv,V=null,W=null;return o!=null&&(o.unstable_strictMode===!0&&(s=!0),o.identifierPrefix!==void 0&&(h=o.identifierPrefix),o.onUncaughtError!==void 0&&(y=o.onUncaughtError),o.onCaughtError!==void 0&&(A=o.onCaughtError),o.onRecoverableError!==void 0&&(k=o.onRecoverableError),o.unstable_transitionCallbacks!==void 0&&(V=o.unstable_transitionCallbacks),o.formState!==void 0&&(W=o.formState)),n=k1(e,1,!0,n,o??null,s,h,y,A,k,V,W),n.context=L1(null),o=n.current,s=gn(),s=Wd(s),h=eo(s),h.callback=null,to(o,h,s),o=s,n.current.lanes=o,zo(n,o),tr(n),e[Ra]=n.current,Vh(e),new Fc(n)},ji.version="19.1.1",ji}var Vm;function FS(){if(Vm)return wu.exports;Vm=1;function t(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(r){console.error(r)}}return t(),wu.exports=QS(),wu.exports}var ZS=FS(),Hr=$m();function qm(t){var r,i,a="";if(typeof t=="string"||typeof t=="number")a+=t;else if(typeof t=="object")if(Array.isArray(t)){var c=t.length;for(r=0;r<c;r++)t[r]&&(i=qm(t[r]))&&(a&&(a+=" "),a+=i)}else for(i in t)t[i]&&(a&&(a+=" "),a+=i);return a}function Ym(){for(var t,r,i=0,a="",c=arguments.length;i<c;i++)(t=arguments[i])&&(r=qm(t))&&(a&&(a+=" "),a+=r);return a}const WS=(t,r)=>{const i=new Array(t.length+r.length);for(let a=0;a<t.length;a++)i[a]=t[a];for(let a=0;a<r.length;a++)i[t.length+a]=r[a];return i},JS=(t,r)=>({classGroupId:t,validator:r}),Xm=(t=new Map,r=null,i)=>({nextPart:t,validators:r,classGroupId:i}),Xs="-",Km=[],eC="arbitrary..",tC=t=>{const r=rC(t),{conflictingClassGroups:i,conflictingClassGroupModifiers:a}=t;return{getClassGroupId:u=>{if(u.startsWith("[")&&u.endsWith("]"))return nC(u);const d=u.split(Xs),m=d[0]===""&&d.length>1?1:0;return Qm(d,m,r)},getConflictingClassGroupIds:(u,d)=>{if(d){const m=a[u],p=i[u];return m?p?WS(p,m):m:p||Km}return i[u]||Km}}},Qm=(t,r,i)=>{if(t.length-r===0)return i.classGroupId;const c=t[r],l=i.nextPart.get(c);if(l){const p=Qm(t,r+1,l);if(p)return p}const u=i.validators;if(u===null)return;const d=r===0?t.join(Xs):t.slice(r).join(Xs),m=u.length;for(let p=0;p<m;p++){const C=u[p];if(C.validator(d))return C.classGroupId}},nC=t=>t.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const r=t.slice(1,-1),i=r.indexOf(":"),a=r.slice(0,i);return a?eC+a:void 0})(),rC=t=>{const{theme:r,classGroups:i}=t;return oC(i,r)},oC=(t,r)=>{const i=Xm();for(const a in t){const c=t[a];Au(c,i,a,r)}return i},Au=(t,r,i,a)=>{const c=t.length;for(let l=0;l<c;l++){const u=t[l];aC(u,r,i,a)}},aC=(t,r,i,a)=>{if(typeof t=="string"){iC(t,r,i);return}if(typeof t=="function"){sC(t,r,i,a);return}lC(t,r,i,a)},iC=(t,r,i)=>{const a=t===""?r:Fm(r,t);a.classGroupId=i},sC=(t,r,i,a)=>{if(cC(t)){Au(t(a),r,i,a);return}r.validators===null&&(r.validators=[]),r.validators.push(JS(i,t))},lC=(t,r,i,a)=>{const c=Object.entries(t),l=c.length;for(let u=0;u<l;u++){const[d,m]=c[u];Au(m,Fm(r,d),i,a)}},Fm=(t,r)=>{let i=t;const a=r.split(Xs),c=a.length;for(let l=0;l<c;l++){const u=a[l];let d=i.nextPart.get(u);d||(d=Xm(),i.nextPart.set(u,d)),i=d}return i},cC=t=>"isThemeGetter"in t&&t.isThemeGetter===!0,uC=t=>{if(t<1)return{get:()=>{},set:()=>{}};let r=0,i=Object.create(null),a=Object.create(null);const c=(l,u)=>{i[l]=u,r++,r>t&&(r=0,a=i,i=Object.create(null))};return{get(l){let u=i[l];if(u!==void 0)return u;if((u=a[l])!==void 0)return c(l,u),u},set(l,u){l in i?i[l]=u:c(l,u)}}},Ru="!",Zm=":",dC=[],Wm=(t,r,i,a,c)=>({modifiers:t,hasImportantModifier:r,baseClassName:i,maybePostfixModifierPosition:a,isExternal:c}),fC=t=>{const{prefix:r,experimentalParseClassName:i}=t;let a=c=>{const l=[];let u=0,d=0,m=0,p;const C=c.length;for(let S=0;S<C;S++){const w=c[S];if(u===0&&d===0){if(w===Zm){l.push(c.slice(m,S)),m=S+1;continue}if(w==="/"){p=S;continue}}w==="["?u++:w==="]"?u--:w==="("?d++:w===")"&&d--}const g=l.length===0?c:c.slice(m);let b=g,v=!1;g.endsWith(Ru)?(b=g.slice(0,-1),v=!0):g.startsWith(Ru)&&(b=g.slice(1),v=!0);const x=p&&p>m?p-m:void 0;return Wm(l,v,b,x)};if(r){const c=r+Zm,l=a;a=u=>u.startsWith(c)?l(u.slice(c.length)):Wm(dC,!1,u,void 0,!0)}if(i){const c=a;a=l=>i({className:l,parseClassName:c})}return a},hC=t=>{const r=new Map;return t.orderSensitiveModifiers.forEach((i,a)=>{r.set(i,1e6+a)}),i=>{const a=[];let c=[];for(let l=0;l<i.length;l++){const u=i[l],d=u[0]==="[",m=r.has(u);d||m?(c.length>0&&(c.sort(),a.push(...c),c=[]),a.push(u)):c.push(u)}return c.length>0&&(c.sort(),a.push(...c)),a}},mC=t=>({cache:uC(t.cacheSize),parseClassName:fC(t),sortModifiers:hC(t),postfixLookupClassGroupIds:pC(t),...tC(t)}),pC=t=>{const r=Object.create(null),i=t.postfixLookupClassGroups;if(i)for(let a=0;a<i.length;a++)r[i[a]]=!0;return r},gC=/\s+/,yC=(t,r)=>{const{parseClassName:i,getClassGroupId:a,getConflictingClassGroupIds:c,sortModifiers:l,postfixLookupClassGroupIds:u}=r,d=[],m=t.trim().split(gC);let p="";for(let C=m.length-1;C>=0;C-=1){const g=m[C],{isExternal:b,modifiers:v,hasImportantModifier:x,baseClassName:S,maybePostfixModifierPosition:w}=i(g);if(b){p=g+(p.length>0?" "+p:p);continue}let T=!!w,j;if(T){const _=S.substring(0,w);j=a(_);const I=j&&u[j]?a(S):void 0;I&&I!==j&&(j=I,T=!1)}else j=a(S);if(!j){if(!T){p=g+(p.length>0?" "+p:p);continue}if(j=a(S),!j){p=g+(p.length>0?" "+p:p);continue}T=!1}const R=v.length===0?"":v.length===1?v[0]:l(v).join(":"),O=x?R+Ru:R,M=O+j;if(d.indexOf(M)>-1)continue;d.push(M);const D=c(j,T);for(let _=0;_<D.length;++_){const I=D[_];d.push(O+I)}p=g+(p.length>0?" "+p:p)}return p},bC=(...t)=>{let r=0,i,a,c="";for(;r<t.length;)(i=t[r++])&&(a=Jm(i))&&(c&&(c+=" "),c+=a);return c},Jm=t=>{if(typeof t=="string")return t;let r,i="";for(let a=0;a<t.length;a++)t[a]&&(r=Jm(t[a]))&&(i&&(i+=" "),i+=r);return i},xC=(t,...r)=>{let i,a,c,l;const u=m=>{const p=r.reduce((C,g)=>g(C),t());return i=mC(p),a=i.cache.get,c=i.cache.set,l=d,d(m)},d=m=>{const p=a(m);if(p)return p;const C=yC(m,i);return c(m,C),C};return l=u,(...m)=>l(bC(...m))},vC=[],Et=t=>{const r=i=>i[t]||vC;return r.isThemeGetter=!0,r.themeKey=t,r},ep=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,tp=/^\((?:(\w[\w-]*):)?(.+)\)$/i,SC=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,CC=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,wC=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,EC=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix|color|light-dark)\(.+\)$/,TC=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,jC=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Pr=t=>SC.test(t),_e=t=>!!t&&!Number.isNaN(Number(t)),Yn=t=>!!t&&Number.isInteger(Number(t)),Ou=t=>t.endsWith("%")&&_e(t.slice(0,-1)),rr=t=>CC.test(t),np=()=>!0,AC=t=>wC.test(t)&&!EC.test(t),Nu=()=>!1,RC=t=>TC.test(t),OC=t=>jC.test(t),NC=t=>!me(t)&&!pe(t),MC=t=>t.startsWith("@container")&&(t[10]==="/"&&t[11]!==void 0||t[11]==="s"&&t[16]!==void 0&&t.startsWith("-size/",10)||t[11]==="n"&&t[18]!==void 0&&t.startsWith("-normal/",10)),_C=t=>Ur(t,lp,Nu),me=t=>ep.test(t),Eo=t=>Ur(t,cp,AC),rp=t=>Ur(t,PC,_e),DC=t=>Ur(t,dp,np),IC=t=>Ur(t,up,Nu),op=t=>Ur(t,ip,Nu),kC=t=>Ur(t,sp,OC),Ks=t=>Ur(t,fp,RC),pe=t=>tp.test(t),Ai=t=>To(t,cp),LC=t=>To(t,up),ap=t=>To(t,ip),zC=t=>To(t,lp),BC=t=>To(t,sp),Qs=t=>To(t,fp,!0),HC=t=>To(t,dp,!0),Ur=(t,r,i)=>{const a=ep.exec(t);return a?a[1]?r(a[1]):i(a[2]):!1},To=(t,r,i=!1)=>{const a=tp.exec(t);return a?a[1]?r(a[1]):i:!1},ip=t=>t==="position"||t==="percentage",sp=t=>t==="image"||t==="url",lp=t=>t==="length"||t==="size"||t==="bg-size",cp=t=>t==="length",PC=t=>t==="number",up=t=>t==="family-name",dp=t=>t==="number"||t==="weight",fp=t=>t==="shadow",UC=xC(()=>{const t=Et("color"),r=Et("font"),i=Et("text"),a=Et("font-weight"),c=Et("tracking"),l=Et("leading"),u=Et("breakpoint"),d=Et("container"),m=Et("spacing"),p=Et("radius"),C=Et("shadow"),g=Et("inset-shadow"),b=Et("text-shadow"),v=Et("drop-shadow"),x=Et("blur"),S=Et("perspective"),w=Et("aspect"),T=Et("ease"),j=Et("animate"),R=()=>["auto","avoid","all","avoid-page","page","left","right","column"],O=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],M=()=>[...O(),pe,me],D=()=>["auto","hidden","clip","visible","scroll"],_=()=>["auto","contain","none"],I=()=>[pe,me,m],z=()=>[Pr,"full","auto",...I()],H=()=>[Yn,"none","subgrid",pe,me],L=()=>["auto",{span:["full",Yn,pe,me]},Yn,pe,me],$=()=>[Yn,"auto",pe,me],Y=()=>["auto","min","max","fr",pe,me],U=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],q=()=>["start","end","center","stretch","center-safe","end-safe"],P=()=>["auto",...I()],G=()=>[Pr,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...I()],B=()=>[d,Pr,"screen","full","dvw","lvw","svw","min","max","fit",...I()],Q=()=>[Pr,"screen","full","lh","dvh","lvh","svh","min","max","fit",...I()],N=()=>[t,pe,me],K=()=>[...O(),ap,op,{position:[pe,me]}],ne=()=>["no-repeat",{repeat:["","x","y","space","round"]}],te=()=>["auto","cover","contain",zC,_C,{size:[pe,me]}],le=()=>[Ou,Ai,Eo],oe=()=>["","none","full",p,pe,me],ae=()=>["",_e,Ai,Eo],xe=()=>["solid","dashed","dotted","double"],we=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],ge=()=>[_e,Ou,ap,op],de=()=>["","none",x,pe,me],Me=()=>["none",_e,pe,me],Be=()=>["none",_e,pe,me],Ae=()=>[_e,pe,me],Se=()=>[Pr,"full",...I()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[rr],breakpoint:[rr],color:[np],container:[rr],"drop-shadow":[rr],ease:["in","out","in-out"],font:[NC],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[rr],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[rr],shadow:[rr],spacing:["px",_e],text:[rr],"text-shadow":[rr],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Pr,me,pe,w]}],container:["container"],"container-type":[{"@container":["","normal","size",pe,me]}],"container-named":[MC],columns:[{columns:[_e,"auto",me,pe,d]}],"break-after":[{"break-after":R()}],"break-before":[{"break-before":R()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:M()}],overflow:[{overflow:D()}],"overflow-x":[{"overflow-x":D()}],"overflow-y":[{"overflow-y":D()}],overscroll:[{overscroll:_()}],"overscroll-x":[{"overscroll-x":_()}],"overscroll-y":[{"overscroll-y":_()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:z()}],"inset-x":[{"inset-x":z()}],"inset-y":[{"inset-y":z()}],start:[{"inset-s":z(),start:z()}],end:[{"inset-e":z(),end:z()}],"inset-bs":[{"inset-bs":z()}],"inset-be":[{"inset-be":z()}],top:[{top:z()}],right:[{right:z()}],bottom:[{bottom:z()}],left:[{left:z()}],visibility:["visible","invisible","collapse"],z:[{z:[Yn,"auto",pe,me]}],basis:[{basis:[Pr,"full","auto",d,...I()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[_e,Pr,"auto","initial","none",me]}],grow:[{grow:["",_e,pe,me]}],shrink:[{shrink:["",_e,pe,me]}],order:[{order:[Yn,"first","last","none",pe,me]}],"grid-cols":[{"grid-cols":H()}],"col-start-end":[{col:L()}],"col-start":[{"col-start":$()}],"col-end":[{"col-end":$()}],"grid-rows":[{"grid-rows":H()}],"row-start-end":[{row:L()}],"row-start":[{"row-start":$()}],"row-end":[{"row-end":$()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":Y()}],"auto-rows":[{"auto-rows":Y()}],gap:[{gap:I()}],"gap-x":[{"gap-x":I()}],"gap-y":[{"gap-y":I()}],"justify-content":[{justify:[...U(),"normal"]}],"justify-items":[{"justify-items":[...q(),"normal"]}],"justify-self":[{"justify-self":["auto",...q()]}],"align-content":[{content:["normal",...U()]}],"align-items":[{items:[...q(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...q(),{baseline:["","last"]}]}],"place-content":[{"place-content":U()}],"place-items":[{"place-items":[...q(),"baseline"]}],"place-self":[{"place-self":["auto",...q()]}],p:[{p:I()}],px:[{px:I()}],py:[{py:I()}],ps:[{ps:I()}],pe:[{pe:I()}],pbs:[{pbs:I()}],pbe:[{pbe:I()}],pt:[{pt:I()}],pr:[{pr:I()}],pb:[{pb:I()}],pl:[{pl:I()}],m:[{m:P()}],mx:[{mx:P()}],my:[{my:P()}],ms:[{ms:P()}],me:[{me:P()}],mbs:[{mbs:P()}],mbe:[{mbe:P()}],mt:[{mt:P()}],mr:[{mr:P()}],mb:[{mb:P()}],ml:[{ml:P()}],"space-x":[{"space-x":I()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":I()}],"space-y-reverse":["space-y-reverse"],size:[{size:G()}],"inline-size":[{inline:["auto",...B()]}],"min-inline-size":[{"min-inline":["auto",...B()]}],"max-inline-size":[{"max-inline":["none",...B()]}],"block-size":[{block:["auto",...Q()]}],"min-block-size":[{"min-block":["auto",...Q()]}],"max-block-size":[{"max-block":["none",...Q()]}],w:[{w:[d,"screen",...G()]}],"min-w":[{"min-w":[d,"screen","none",...G()]}],"max-w":[{"max-w":[d,"screen","none","prose",{screen:[u]},...G()]}],h:[{h:["screen","lh",...G()]}],"min-h":[{"min-h":["screen","lh","none",...G()]}],"max-h":[{"max-h":["screen","lh","none",...G()]}],"font-size":[{text:["base",i,Ai,Eo]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[a,HC,DC]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Ou,me]}],"font-family":[{font:[LC,IC,r]}],"font-features":[{"font-features":[me]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[c,pe,me]}],"line-clamp":[{"line-clamp":[_e,"none",pe,rp]}],leading:[{leading:["none",l,...I()]}],"list-image":[{"list-image":["none",pe,me]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",pe,me]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:N()}],"text-color":[{text:N()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...xe(),"wavy"]}],"text-decoration-thickness":[{decoration:[_e,"from-font","auto",pe,Eo]}],"text-decoration-color":[{decoration:N()}],"underline-offset":[{"underline-offset":[_e,"auto",pe,me]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:I()}],"tab-size":[{tab:[Yn,pe,me]}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",pe,me]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",pe,me]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:K()}],"bg-repeat":[{bg:ne()}],"bg-size":[{bg:te()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Yn,pe,me],radial:["",pe,me],conic:["",Yn,pe,me]},BC,kC]}],"bg-color":[{bg:N()}],"gradient-from-pos":[{from:le()}],"gradient-via-pos":[{via:le()}],"gradient-to-pos":[{to:le()}],"gradient-from":[{from:N()}],"gradient-via":[{via:N()}],"gradient-to":[{to:N()}],rounded:[{rounded:oe()}],"rounded-s":[{"rounded-s":oe()}],"rounded-e":[{"rounded-e":oe()}],"rounded-t":[{"rounded-t":oe()}],"rounded-r":[{"rounded-r":oe()}],"rounded-b":[{"rounded-b":oe()}],"rounded-l":[{"rounded-l":oe()}],"rounded-ss":[{"rounded-ss":oe()}],"rounded-se":[{"rounded-se":oe()}],"rounded-ee":[{"rounded-ee":oe()}],"rounded-es":[{"rounded-es":oe()}],"rounded-tl":[{"rounded-tl":oe()}],"rounded-tr":[{"rounded-tr":oe()}],"rounded-br":[{"rounded-br":oe()}],"rounded-bl":[{"rounded-bl":oe()}],"border-w":[{border:ae()}],"border-w-x":[{"border-x":ae()}],"border-w-y":[{"border-y":ae()}],"border-w-s":[{"border-s":ae()}],"border-w-e":[{"border-e":ae()}],"border-w-bs":[{"border-bs":ae()}],"border-w-be":[{"border-be":ae()}],"border-w-t":[{"border-t":ae()}],"border-w-r":[{"border-r":ae()}],"border-w-b":[{"border-b":ae()}],"border-w-l":[{"border-l":ae()}],"divide-x":[{"divide-x":ae()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":ae()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...xe(),"hidden","none"]}],"divide-style":[{divide:[...xe(),"hidden","none"]}],"border-color":[{border:N()}],"border-color-x":[{"border-x":N()}],"border-color-y":[{"border-y":N()}],"border-color-s":[{"border-s":N()}],"border-color-e":[{"border-e":N()}],"border-color-bs":[{"border-bs":N()}],"border-color-be":[{"border-be":N()}],"border-color-t":[{"border-t":N()}],"border-color-r":[{"border-r":N()}],"border-color-b":[{"border-b":N()}],"border-color-l":[{"border-l":N()}],"divide-color":[{divide:N()}],"outline-style":[{outline:[...xe(),"none","hidden"]}],"outline-offset":[{"outline-offset":[_e,pe,me]}],"outline-w":[{outline:["",_e,Ai,Eo]}],"outline-color":[{outline:N()}],shadow:[{shadow:["","inner","none",C,Qs,Ks]}],"shadow-color":[{shadow:N()}],"inset-shadow":[{"inset-shadow":["none",g,Qs,Ks]}],"inset-shadow-color":[{"inset-shadow":N()}],"ring-w":[{ring:ae()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:N()}],"ring-offset-w":[{"ring-offset":[_e,Eo]}],"ring-offset-color":[{"ring-offset":N()}],"inset-ring-w":[{"inset-ring":ae()}],"inset-ring-color":[{"inset-ring":N()}],"text-shadow":[{"text-shadow":["none",b,Qs,Ks]}],"text-shadow-color":[{"text-shadow":N()}],opacity:[{opacity:[_e,pe,me]}],"mix-blend":[{"mix-blend":[...we(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":we()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[_e]}],"mask-image-linear-from-pos":[{"mask-linear-from":ge()}],"mask-image-linear-to-pos":[{"mask-linear-to":ge()}],"mask-image-linear-from-color":[{"mask-linear-from":N()}],"mask-image-linear-to-color":[{"mask-linear-to":N()}],"mask-image-t-from-pos":[{"mask-t-from":ge()}],"mask-image-t-to-pos":[{"mask-t-to":ge()}],"mask-image-t-from-color":[{"mask-t-from":N()}],"mask-image-t-to-color":[{"mask-t-to":N()}],"mask-image-r-from-pos":[{"mask-r-from":ge()}],"mask-image-r-to-pos":[{"mask-r-to":ge()}],"mask-image-r-from-color":[{"mask-r-from":N()}],"mask-image-r-to-color":[{"mask-r-to":N()}],"mask-image-b-from-pos":[{"mask-b-from":ge()}],"mask-image-b-to-pos":[{"mask-b-to":ge()}],"mask-image-b-from-color":[{"mask-b-from":N()}],"mask-image-b-to-color":[{"mask-b-to":N()}],"mask-image-l-from-pos":[{"mask-l-from":ge()}],"mask-image-l-to-pos":[{"mask-l-to":ge()}],"mask-image-l-from-color":[{"mask-l-from":N()}],"mask-image-l-to-color":[{"mask-l-to":N()}],"mask-image-x-from-pos":[{"mask-x-from":ge()}],"mask-image-x-to-pos":[{"mask-x-to":ge()}],"mask-image-x-from-color":[{"mask-x-from":N()}],"mask-image-x-to-color":[{"mask-x-to":N()}],"mask-image-y-from-pos":[{"mask-y-from":ge()}],"mask-image-y-to-pos":[{"mask-y-to":ge()}],"mask-image-y-from-color":[{"mask-y-from":N()}],"mask-image-y-to-color":[{"mask-y-to":N()}],"mask-image-radial":[{"mask-radial":[pe,me]}],"mask-image-radial-from-pos":[{"mask-radial-from":ge()}],"mask-image-radial-to-pos":[{"mask-radial-to":ge()}],"mask-image-radial-from-color":[{"mask-radial-from":N()}],"mask-image-radial-to-color":[{"mask-radial-to":N()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":O()}],"mask-image-conic-pos":[{"mask-conic":[_e]}],"mask-image-conic-from-pos":[{"mask-conic-from":ge()}],"mask-image-conic-to-pos":[{"mask-conic-to":ge()}],"mask-image-conic-from-color":[{"mask-conic-from":N()}],"mask-image-conic-to-color":[{"mask-conic-to":N()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:K()}],"mask-repeat":[{mask:ne()}],"mask-size":[{mask:te()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",pe,me]}],filter:[{filter:["","none",pe,me]}],blur:[{blur:de()}],brightness:[{brightness:[_e,pe,me]}],contrast:[{contrast:[_e,pe,me]}],"drop-shadow":[{"drop-shadow":["","none",v,Qs,Ks]}],"drop-shadow-color":[{"drop-shadow":N()}],grayscale:[{grayscale:["",_e,pe,me]}],"hue-rotate":[{"hue-rotate":[_e,pe,me]}],invert:[{invert:["",_e,pe,me]}],saturate:[{saturate:[_e,pe,me]}],sepia:[{sepia:["",_e,pe,me]}],"backdrop-filter":[{"backdrop-filter":["","none",pe,me]}],"backdrop-blur":[{"backdrop-blur":de()}],"backdrop-brightness":[{"backdrop-brightness":[_e,pe,me]}],"backdrop-contrast":[{"backdrop-contrast":[_e,pe,me]}],"backdrop-grayscale":[{"backdrop-grayscale":["",_e,pe,me]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[_e,pe,me]}],"backdrop-invert":[{"backdrop-invert":["",_e,pe,me]}],"backdrop-opacity":[{"backdrop-opacity":[_e,pe,me]}],"backdrop-saturate":[{"backdrop-saturate":[_e,pe,me]}],"backdrop-sepia":[{"backdrop-sepia":["",_e,pe,me]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":I()}],"border-spacing-x":[{"border-spacing-x":I()}],"border-spacing-y":[{"border-spacing-y":I()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",pe,me]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[_e,"initial",pe,me]}],ease:[{ease:["linear","initial",T,pe,me]}],delay:[{delay:[_e,pe,me]}],animate:[{animate:["none",j,pe,me]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[S,pe,me]}],"perspective-origin":[{"perspective-origin":M()}],rotate:[{rotate:Me()}],"rotate-x":[{"rotate-x":Me()}],"rotate-y":[{"rotate-y":Me()}],"rotate-z":[{"rotate-z":Me()}],scale:[{scale:Be()}],"scale-x":[{"scale-x":Be()}],"scale-y":[{"scale-y":Be()}],"scale-z":[{"scale-z":Be()}],"scale-3d":["scale-3d"],skew:[{skew:Ae()}],"skew-x":[{"skew-x":Ae()}],"skew-y":[{"skew-y":Ae()}],transform:[{transform:[pe,me,"","none","gpu","cpu"]}],"transform-origin":[{origin:M()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Se()}],"translate-x":[{"translate-x":Se()}],"translate-y":[{"translate-y":Se()}],"translate-z":[{"translate-z":Se()}],"translate-none":["translate-none"],zoom:[{zoom:[Yn,pe,me]}],accent:[{accent:N()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:N()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",pe,me]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scrollbar-thumb-color":[{"scrollbar-thumb":N()}],"scrollbar-track-color":[{"scrollbar-track":N()}],"scrollbar-gutter":[{"scrollbar-gutter":["auto","stable","both"]}],"scrollbar-w":[{scrollbar:["auto","thin","none"]}],"scroll-m":[{"scroll-m":I()}],"scroll-mx":[{"scroll-mx":I()}],"scroll-my":[{"scroll-my":I()}],"scroll-ms":[{"scroll-ms":I()}],"scroll-me":[{"scroll-me":I()}],"scroll-mbs":[{"scroll-mbs":I()}],"scroll-mbe":[{"scroll-mbe":I()}],"scroll-mt":[{"scroll-mt":I()}],"scroll-mr":[{"scroll-mr":I()}],"scroll-mb":[{"scroll-mb":I()}],"scroll-ml":[{"scroll-ml":I()}],"scroll-p":[{"scroll-p":I()}],"scroll-px":[{"scroll-px":I()}],"scroll-py":[{"scroll-py":I()}],"scroll-ps":[{"scroll-ps":I()}],"scroll-pe":[{"scroll-pe":I()}],"scroll-pbs":[{"scroll-pbs":I()}],"scroll-pbe":[{"scroll-pbe":I()}],"scroll-pt":[{"scroll-pt":I()}],"scroll-pr":[{"scroll-pr":I()}],"scroll-pb":[{"scroll-pb":I()}],"scroll-pl":[{"scroll-pl":I()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",pe,me]}],fill:[{fill:["none",...N()]}],"stroke-w":[{stroke:[_e,Ai,Eo,rp]}],stroke:[{stroke:["none",...N()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{"container-named":["container-type"],overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","start","end","top","right","bottom","left"],"inset-x":["start","end","right","left"],"inset-y":["inset-bs","inset-be","top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pbs","pbe","pt","pr","pb","pl"],px:["ps","pe","pr","pl"],py:["pbs","pbe","pt","pb"],m:["mx","my","ms","me","mbs","mbe","mt","mr","mb","ml"],mx:["ms","me","mr","ml"],my:["mbs","mbe","mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-s","border-w-e","border-w-r","border-w-l"],"border-w-y":["border-w-bs","border-w-be","border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-s","border-color-e","border-color-r","border-color-l"],"border-color-y":["border-color-bs","border-color-be","border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-ms","scroll-me","scroll-mr","scroll-ml"],"scroll-my":["scroll-mbs","scroll-mbe","scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pbs","scroll-pbe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-ps","scroll-pe","scroll-pr","scroll-pl"],"scroll-py":["scroll-pbs","scroll-pbe","scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},postfixLookupClassGroups:["container-type"],orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}});function Ve(...t){return UC(Ym(t))}var $C=Object.defineProperty,Mu=(t,r)=>$C(t,"name",{value:r,configurable:!0});function _u(t,r){if(typeof t=="function")return t(r);t!=null&&(t.current=r)}Mu(_u,"setRef");function hp(...t){return r=>{let i=!1;const a=t.map(c=>{const l=_u(c,r);return!i&&typeof l=="function"&&(i=!0),l});if(i)return()=>{for(let c=0;c<a.length;c++){const l=a[c];typeof l=="function"?l():_u(t[c],null)}}}}Mu(hp,"composeRefs");function De(...t){return E.useCallback(hp(...t),t)}Mu(De,"useComposedRefs");var GC=Object.defineProperty,ln=(t,r)=>GC(t,"name",{value:r,configurable:!0});function or(t){const r=E.forwardRef((i,a)=>{let{children:c,...l}=i,u=null,d=!1;const m=[];c=vp(c),E.Children.forEach(c,b=>{if(bp(b)){d=!0;const v=b;let x="child"in v.props?v.props.child:v.props.children;for(;Du(x)&&typeof Fs=="function";)x=Fs(x._payload);u=qC(v,x),m.push(u?.props?.children)}else m.push(b)}),u?u=E.cloneElement(u,void 0,m):!d&&E.Children.count(c)===1&&E.isValidElement(c)&&(u=c);const p=u?yp(u):void 0,C=De(a,p);if(!u){if(c||c===0)throw new Error(d?KC(t):XC(t));return c}const g=gp(l,u.props??{});return u.type!==E.Fragment&&(g.ref=a?C:p),E.cloneElement(u,g)});return r.displayName=`${t}.Slot`,r}ln(or,"createSlot");var VC=or("Slot"),mp=Symbol.for("radix.slottable");function pp(t){const r=ln(i=>"child"in i?i.children(i.child):i.children,"Slottable");return r.displayName=`${t}.Slottable`,r.__radixId=mp,r}ln(pp,"createSlottable");var qC=ln((t,r)=>"child"in t.props?E.isValidElement(r)?E.cloneElement(r,void 0,t.props.children(r.props.children)):null:E.isValidElement(r)?r:null,"getSlottableElementFromSlottable");function gp(t,r){const i={...r};for(const a in r){const c=t[a],l=r[a];/^on[A-Z]/.test(a)?c&&l?i[a]=(...d)=>{const m=l(...d);return c(...d),m}:c&&(i[a]=c):a==="style"?i[a]={...c,...l}:a==="className"?i[a]=[c,l].filter(Boolean).join(" "):a==="aria-describedby"&&(i[a]=Sp(l,c))}return{...t,...i}}ln(gp,"mergeProps");function yp(t){let r=Object.getOwnPropertyDescriptor(t.props,"ref")?.get,i=r&&"isReactWarning"in r&&r.isReactWarning;return i?t.ref:(r=Object.getOwnPropertyDescriptor(t,"ref")?.get,i=r&&"isReactWarning"in r&&r.isReactWarning,i?t.props.ref:t.props.ref||t.ref)}ln(yp,"getElementRef");function bp(t){return E.isValidElement(t)&&typeof t.type=="function"&&"__radixId"in t.type&&t.type.__radixId===mp}ln(bp,"isSlottable");var YC=Symbol.for("react.lazy");function Du(t){return t!=null&&typeof t=="object"&&"$$typeof"in t&&t.$$typeof===YC&&"_payload"in t&&xp(t._payload)}ln(Du,"isLazyComponent");function xp(t){return typeof t=="object"&&t!==null&&"then"in t}ln(xp,"isPromiseLike");function vp(t){let r=t;for(;Du(r)&&typeof Fs=="function";)r=Fs(r._payload);return r}ln(vp,"useUnwrappedLazy");function Sp(...t){const r=new Set;for(const i of t)if(typeof i=="string")for(const a of String(i).trim().split(/\s+/))a&&r.add(a);return r.size>0?Array.from(r).join(" "):void 0}ln(Sp,"concatAriaDescribedby");var XC=ln(t=>`${t} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,"createSlotError"),KC=ln(t=>`${t} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,"createSlottableError"),Fs=wo[" use ".trim().toString()],QC=Object.defineProperty,FC=(t,r)=>QC(t,"name",{value:r,configurable:!0}),ZC=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],ze=ZC.reduce((t,r)=>{const i=or(`Primitive.${r}`),a=E.forwardRef((c,l)=>{const{asChild:u,...d}=c,m=u?i:r;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),f.jsx(m,{...d,ref:l})});return a.displayName=`Primitive.${r}`,{...t,[r]:a}},{});function Cp(t,r){t&&Hr.flushSync(()=>t.dispatchEvent(r))}FC(Cp,"dispatchDiscreteCustomEvent");var WC=Object.defineProperty,JC=(t,r)=>WC(t,"name",{value:r,configurable:!0}),wp=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),ew=E.forwardRef(JC(function(r,i){return f.jsx(ze.span,{...r,ref:i,style:{...wp,...r.style}})},"VisuallyHidden")),tw=Object.defineProperty,Sn=(t,r)=>tw(t,"name",{value:r,configurable:!0});function nw(t,r){const i=E.createContext(r);i.displayName=t+"Context";const a=Sn(l=>{const{children:u,...d}=l,m=E.useMemo(()=>d,Object.values(d));return f.jsx(i.Provider,{value:m,children:u})},"Provider");a.displayName=t+"Provider";function c(l,u={}){const{optional:d=!1}=u,m=E.useContext(i);if(m)return m;if(r!==void 0)return r;if(!d)throw new Error(`\`${l}\` must be used within \`${t}\``)}return Sn(c,"useContext"),[a,c]}Sn(nw,"createContext");function Cn(t,r=[]){let i=[];function a(l,u){const d=E.createContext(u);d.displayName=l+"Context";const m=i.length;i=[...i,u];const p=Sn(g=>{const{scope:b,children:v,...x}=g,S=b?.[t]?.[m]||d,w=E.useMemo(()=>x,Object.values(x));return f.jsx(S.Provider,{value:w,children:v})},"Provider");p.displayName=l+"Provider";function C(g,b,v={}){const{optional:x=!1}=v,S=b?.[t]?.[m]||d,w=E.useContext(S);if(w)return w;if(u!==void 0)return u;if(!x)throw new Error(`\`${g}\` must be used within \`${l}\``)}return Sn(C,"useContext"),[p,C]}Sn(a,"createContext");const c=Sn(()=>{const l=i.map(u=>E.createContext(u));return Sn(function(d){const m=d?.[t]||l;return E.useMemo(()=>({[`__scope${t}`]:{...d,[t]:m}}),[d,m])},"useScope")},"createScope");return c.scopeName=t,[a,Ep(c,...r)]}Sn(Cn,"createContextScope");function Ep(...t){const r=t[0];if(t.length===1)return r;const i=Sn(()=>{const a=t.map(c=>({useScope:c(),scopeName:c.scopeName}));return Sn(function(l){const u=a.reduce((d,{useScope:m,scopeName:p})=>{const g=m(l)[`__scope${p}`];return{...d,...g}},{});return E.useMemo(()=>({[`__scope${r.scopeName}`]:u}),[u])},"useComposedScopes")},"createScope");return i.scopeName=r.scopeName,i}Sn(Ep,"composeContextScopes");var st=globalThis?.document?E.useLayoutEffect:()=>{},rw=Object.defineProperty,Tt=(t,r)=>rw(t,"name",{value:r,configurable:!0});function Zs(t){const r=t+"CollectionProvider",[i,a]=Cn(r),[c,l]=i(r,{collectionRef:{current:null},itemMap:new Map}),u=Tt(S=>{const{scope:w,children:T}=S,j=E.useRef(null),R=E.useRef(new Map).current;return f.jsx(c,{scope:w,itemMap:R,collectionRef:j,children:T})},"CollectionProvider");u.displayName=r;const d=t+"CollectionSlot",m=or(d),p=E.forwardRef((S,w)=>{const{scope:T,children:j}=S,R=l(d,T),O=De(w,R.collectionRef);return f.jsx(m,{ref:O,children:j})});p.displayName=d;const C=t+"CollectionItemSlot",g="data-radix-collection-item",b=or(C),v=E.forwardRef((S,w)=>{const{scope:T,children:j,...R}=S,O=E.useRef(null),M=De(w,O),D=l(C,T);return E.useEffect(()=>(D.itemMap.set(O,{ref:O,...R}),()=>void D.itemMap.delete(O))),f.jsx(b,{[g]:"",ref:M,children:j})});v.displayName=C;function x(S){const w=l(t+"CollectionConsumer",S);return E.useCallback(()=>{const j=w.collectionRef.current;if(!j)return[];const R=Array.from(j.querySelectorAll(`[${g}]`));return Array.from(w.itemMap.values()).sort((D,_)=>R.indexOf(D.ref.current)-R.indexOf(_.ref.current))},[w.collectionRef,w.itemMap])}return Tt(x,"useCollection"),[{Provider:u,Slot:p,ItemSlot:v},x,a]}Tt(Zs,"createCollection");var Tp=new WeakMap,Ws=(un=class extends Map{constructor(i){super(i);K1(this,pt);um(this,pt,[...super.keys()]),Tp.set(this,!0)}set(i,a){return Tp.get(this)&&!this.has(i)&&Ut(this,pt).push(i),super.set(i,a),this}insert(i,a,c){const l=this.has(a),u=l?this.size:this.size+1,d=Iu(i),m=d>=0?Math.min(d,u-1):Math.max(u+d,0);if(l?Ut(this,pt).indexOf(a)===m:m===this.size)return this.set(a,c),this;const p=Ut(this,pt).filter(g=>g!==a);p.splice(m,0,a);const C=p.map(g=>[g,g===a?c:this.get(g)]);this.clear();for(const[g,b]of C)this.set(g,b);return this}with(i,a,c){const l=new un(this);return l.insert(i,a,c),l}before(i){const a=Ut(this,pt).indexOf(i)-1;if(!(a<0))return this.entryAt(a)}setBefore(i,a,c){const l=Ut(this,pt).indexOf(i);if(l===-1)return this;const u=Ut(this,pt).indexOf(a),d=u!==-1&&u<l?l-1:l;return this.insert(d,a,c)}after(i){let a=Ut(this,pt).indexOf(i);if(a=a===-1||a===this.size-1?-1:a+1,a!==-1)return this.entryAt(a)}setAfter(i,a,c){const l=Ut(this,pt).indexOf(i);if(l===-1)return this;const u=Ut(this,pt).indexOf(a),d=u!==-1&&u<=l?l:l+1;return this.insert(d,a,c)}first(){return this.entryAt(0)}last(){return this.entryAt(-1)}clear(){return um(this,pt,[]),super.clear()}delete(i){const a=super.delete(i);return a&&Ut(this,pt).splice(Ut(this,pt).indexOf(i),1),a}deleteAt(i){const a=this.keyAt(i);return a!==void 0?this.delete(a):!1}at(i){const a=Js(Ut(this,pt),i);if(a!==void 0)return this.get(a)}entryAt(i){const a=Js(Ut(this,pt),i);if(a!==void 0)return[a,this.get(a)]}indexOf(i){return Ut(this,pt).indexOf(i)}keyAt(i){return Js(Ut(this,pt),i)}from(i,a){const c=this.indexOf(i);if(c===-1)return;let l=c+a;return l<0&&(l=0),l>=this.size&&(l=this.size-1),this.at(l)}keyFrom(i,a){const c=this.indexOf(i);if(c===-1)return;let l=c+a;return l<0&&(l=0),l>=this.size&&(l=this.size-1),this.keyAt(l)}find(i,a){let c=0;for(const l of this){if(Reflect.apply(i,a,[l,c,this]))return l;c++}}findIndex(i,a){let c=0;for(const l of this){if(Reflect.apply(i,a,[l,c,this]))return c;c++}return-1}filter(i,a){const c=[];let l=0;for(const u of this)Reflect.apply(i,a,[u,l,this])&&c.push(u),l++;return new un(c)}map(i,a){const c=[];let l=0;for(const u of this)c.push([u[0],Reflect.apply(i,a,[u,l,this])]),l++;return new un(c)}reduce(...i){const[a,c]=i,l=i.length>1;if(!l&&this.size===0)throw new TypeError("Reduce of empty OrderedDict with no initial value");let u=0,d=c;for(const m of this)u===0&&!l?d=m:d=Reflect.apply(a,this,[d,m,u,this]),u++;return d}reduceRight(...i){const[a,c]=i,l=i.length>1;if(!l&&this.size===0)throw new TypeError("Reduce of empty OrderedDict with no initial value");let u=c;for(let d=this.size-1;d>=0;d--){const m=this.entryAt(d);d===this.size-1&&!l?u=m:u=Reflect.apply(a,this,[u,m,d,this])}return u}sort(i){if(typeof i!="function")throw new TypeError("OrderedDict.sort requires a compare function");const a=[...this.entries()].sort(i);this.clear();for(const[c,l]of a)this.set(c,l);return this}toSorted(i){if(typeof i!="function")throw new TypeError("OrderedDict.toSorted requires a compare function");const a=[...this.entries()].sort(i);return new un(a)}toReversed(){const i=new un;for(let a=this.size-1;a>=0;a--){const c=this.keyAt(a),l=this.get(c);i.set(c,l)}return i}toSpliced(...i){const a=[...this.entries()];return a.splice(...i),new un(a)}slice(i,a){const c=new un;for(const l of Ut(this,pt).slice(i,a))c.set(l,this.get(l));return c}every(i,a){let c=0;for(const l of this){if(!Reflect.apply(i,a,[l,c,this]))return!1;c++}return!0}some(i,a){let c=0;for(const l of this){if(Reflect.apply(i,a,[l,c,this]))return!0;c++}return!1}},pt=new WeakMap,Tt(un,"OrderedDict"),un);function Js(t,r){if("at"in Array.prototype)return Array.prototype.at.call(t,r);const i=jp(t,r);return i===-1?void 0:t[i]}Tt(Js,"at");function jp(t,r){const i=t.length,a=Iu(r),c=a>=0?a:i+a;return c<0||c>=i?-1:c}Tt(jp,"toSafeIndex");function Iu(t){return t!==t||t===0?0:Math.trunc(t)}Tt(Iu,"toSafeInteger");function ow(t){const r=t+"CollectionProvider",[i,a]=Cn(r),[c,l]=i(r);c.displayName=t+"CollectionStableContextProvider";const[u,d]=i(r);u.displayName=t+"CollectionStatefulContextProvider";const m=Tt(({state:D,..._})=>D?f.jsx(C,{..._,state:D}):f.jsx(p,{..._}),"CollectionProvider");m.displayName=r;const p=Tt(D=>{const _=j();return f.jsx(C,{...D,state:_})},"CollectionInit");p.displayName=t+"CollectionInit";const C=Tt(D=>{const{scope:_,children:I,state:z}=D,H=E.useRef(null),[L,$]=E.useState(null),Y=De(H,$),[U,q]=z,P=E.useRef(new Ws),G=E.useCallback(()=>{const B=P.current;return Op(B)||B.sort(el),B},[]);return E.useEffect(()=>{if(!L)return;const B=Np(()=>{q(Q=>{const N=Q.toSorted(el);return N.some(([ne],te)=>Q.keyAt(te)!==ne)?N:Q})});return B.observe(L,{childList:!0,subtree:!0}),()=>{B.disconnect()}},[L,q]),f.jsx(c,{scope:_,collectionElementRef:Y,collectionElementRefObject:H,getCollection:G,setCollection:q,registryRef:P,children:f.jsx(u,{scope:_,collectionElement:L,collection:U,children:I})})},"CollectionProviderImpl");C.displayName=t+"CollectionProviderImpl";const g=t+"CollectionSlot",b=or(g),v=E.forwardRef((D,_)=>{const{scope:I,children:z}=D,H=l(g,I),L=De(_,H.collectionElementRef);return f.jsx(b,{ref:L,children:z})});v.displayName=g;const x=t+"CollectionItemSlot",S="data-radix-collection-item",w=or(x),T=E.forwardRef((D,_)=>{const{scope:I,children:z,...H}=D,L=E.useRef(null),$=l(x,I),{setCollection:Y,registryRef:U}=$,q=E.useRef(H);Ap(q.current,H)||(q.current=H);const P=q.current,G=E.useCallback(N=>{const K=U.current;N?K.set(N,{...q.current,element:N}):L.current&&K.delete(L.current)},[U]),B=De(_,G,L);st(()=>{const N=L.current,K=U.current;N&&K.has(N)&&K.set(N,{...P,element:N})},[P,U]);const Q=E.useRef(null);return E.useEffect(()=>{const N=L.current,K=Q.current;(K?.element??null)===N&&(!N||K?.itemData===P)||(Q.current=N?{element:N,itemData:P}:null,Y(ne=>{const te=new Ws(ne);return K&&K.element!==N&&te.delete(K.element),N&&te.set(N,{...P,element:N}),te.sort(el)}))}),E.useEffect(()=>()=>{const N=Q.current;Q.current=null,N&&Y(K=>{if(!K.has(N.element))return K;const ne=new Ws(K);return ne.delete(N.element),ne})},[Y]),f.jsx(w,{[S]:"",ref:B,children:z})});T.displayName=x;function j(){return E.useState(new Ws)}Tt(j,"useInitCollection");function R(D){const{collection:_}=d(t+"CollectionConsumer",D);return _}Tt(R,"useCollection");function O(D){const{getCollection:_}=l(t+"CollectionConsumer",D);return _}return Tt(O,"useGetCollection"),[{Provider:m,Slot:v,ItemSlot:T},{createCollectionScope:a,useCollection:R,useGetCollection:O,useInitCollection:j}]}Tt(ow,"createCollection");function Ap(t,r){if(t===r)return!0;if(typeof t!="object"||typeof r!="object"||t==null||r==null)return!1;const i=Object.keys(t),a=Object.keys(r);if(i.length!==a.length)return!1;for(const c of i)if(!Object.prototype.hasOwnProperty.call(r,c)||t[c]!==r[c])return!1;return!0}Tt(Ap,"shallowEqual");function Rp(t,r){return!!(r.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_PRECEDING)}Tt(Rp,"isElementPreceding");function Op(t){let r;for(const i of t.keys()){if(r){const a=r.compareDocumentPosition(i);if(!(a&Node.DOCUMENT_POSITION_DISCONNECTED)&&a&Node.DOCUMENT_POSITION_PRECEDING)return!1}r=i}return!0}Tt(Op,"isInDocumentOrder");function el(t,r){return!t[1].element||!r[1].element?0:Rp(t[1].element,r[1].element)?-1:1}Tt(el,"sortByDocumentPosition");function Np(t){return new MutationObserver(i=>{for(const a of i)if(a.type==="childList"){t();return}})}Tt(Np,"getChildListObserver");var aw=Object.defineProperty,ua=(t,r)=>aw(t,"name",{value:r,configurable:!0}),Mp=!!(typeof window<"u"&&window.document&&window.document.createElement);function Ee(t,r,{checkForDefaultPrevented:i=!0}={}){return ua(function(c){if(t?.(c),i===!1||!c||!c.defaultPrevented)return r?.(c)},"handleEvent")}ua(Ee,"composeEventHandlers");function iw(t){if(!Mp)throw new Error("Cannot access window outside of the DOM");return t?.ownerDocument?.defaultView??window}ua(iw,"getOwnerWindow");function ku(t){if(!Mp)throw new Error("Cannot access document outside of the DOM");return t?.ownerDocument??document}ua(ku,"getOwnerDocument");function _p(t,r=!1){const{activeElement:i}=ku(t);if(!i?.nodeName)return null;if(Dp(i)&&i.contentDocument)return _p(i.contentDocument.body,r);if(r){const a=i.getAttribute("aria-activedescendant");if(a){const c=ku(i).getElementById(a);if(c)return c}}return i}ua(_p,"getActiveElement");function Dp(t){return t.tagName==="IFRAME"}ua(Dp,"isFrame");var sw=Object.defineProperty,lw=(t,r)=>sw(t,"name",{value:r,configurable:!0}),Ip=wo[" useEffectEvent ".trim().toString()],kp=wo[" useInsertionEffect ".trim().toString()];function Lp(t){if(typeof Ip=="function")return Ip(t);const r=E.useRef(()=>{throw new Error("Cannot call an event handler while rendering.")});return typeof kp=="function"?kp(()=>{r.current=t}):st(()=>{r.current=t}),E.useMemo(()=>((...i)=>r.current?.(...i)),[])}lw(Lp,"useEffectEvent");var cw=Object.defineProperty,Ri=(t,r)=>cw(t,"name",{value:r,configurable:!0}),uw=wo[" useInsertionEffect ".trim().toString()]||st;function ar({prop:t,defaultProp:r,onChange:i=Ri(()=>{},"onChange"),caller:a}){const[c,l,u]=zp({defaultProp:r,onChange:i}),d=t!==void 0,m=d?t:c,p=E.useCallback(C=>{if(d){const g=Bp(C)?C(t):C;g!==t&&u.current?.(g)}else l(C)},[d,t,l,u]);return[m,p]}Ri(ar,"useControllableState");function zp({defaultProp:t,onChange:r}){const[i,a]=E.useState(t),c=E.useRef(i),l=E.useRef(r);return uw(()=>{l.current=r},[r]),E.useEffect(()=>{c.current!==i&&(l.current?.(i),c.current=i)},[i,c]),[i,a,l]}Ri(zp,"useUncontrolledState");function Bp(t){return typeof t=="function"}Ri(Bp,"isFunction");var Hp=Symbol("RADIX:SYNC_STATE");function dw(t,r,i,a){const{prop:c,defaultProp:l,onChange:u,caller:d}=r,m=c!==void 0,p=Lp(u),C=[{...i,state:l}];a&&C.push(a);const[g,b]=E.useReducer((w,T)=>{if(T.type===Hp)return{...w,state:T.state};const j=t(w,T);return m&&!Object.is(j.state,w.state)&&p(j.state),j},...C),v=g.state,x=E.useRef(v);E.useEffect(()=>{x.current!==v&&(x.current=v,m||p(v))},[v,x,m]);const S=E.useMemo(()=>c!==void 0?{...g,state:c}:g,[g,c]);return E.useEffect(()=>{m&&!Object.is(c,g.state)&&b({type:Hp,state:c})},[c,g.state,m]),[S,b]}Ri(dw,"useControllableStateReducer");var fw=Object.defineProperty,ir=(t,r)=>fw(t,"name",{value:r,configurable:!0});function Pp(t,r){return E.useReducer((i,a)=>r[i][a]??i,t)}ir(Pp,"useStateMachine");var $r=ir(t=>{const{present:r,children:i}=t,a=Up(r),c=typeof i=="function"?i({present:a.isPresent}):E.Children.only(i),l=$p(a.ref,Gp(c));return typeof i=="function"||a.isPresent?E.cloneElement(c,{ref:l}):null},"Presence");function Up(t){const[r,i]=E.useState(),a=E.useRef(null),c=E.useRef(t),l=E.useRef("none"),u=E.useRef(void 0),d=t?"mounted":"unmounted",[m,p]=Pp(d,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return E.useEffect(()=>{m==="mounted"?(l.current=u.current??da(a.current),u.current=void 0):l.current="none"},[m]),st(()=>{const C=a.current,g=c.current;if(g!==t){const v=l.current,x=da(C);t?(u.current=x,p("MOUNT")):x==="none"||C?.display==="none"?p("UNMOUNT"):p(g&&v!==x?"ANIMATION_OUT":"UNMOUNT"),c.current=t}},[t,p]),st(()=>{if(r){let C;const g=r.ownerDocument.defaultView??window,b=ir(x=>{const w=da(a.current).includes(CSS.escape(x.animationName));if(x.target===r&&w&&(p("ANIMATION_END"),!c.current)){const T=r.style.animationFillMode;r.style.animationFillMode="forwards",C=g.setTimeout(()=>{r.style.animationFillMode==="forwards"&&(r.style.animationFillMode=T)})}},"handleAnimationEnd"),v=ir(x=>{x.target===r&&(l.current=da(a.current))},"handleAnimationStart");return r.addEventListener("animationstart",v),r.addEventListener("animationcancel",b),r.addEventListener("animationend",b),()=>{g.clearTimeout(C),r.removeEventListener("animationstart",v),r.removeEventListener("animationcancel",b),r.removeEventListener("animationend",b)}}else p("ANIMATION_END")},[r,p]),{isPresent:["mounted","unmountSuspended"].includes(m),ref:E.useCallback(C=>{if(C){const g=getComputedStyle(C);a.current=g,u.current=da(g)}else a.current=null;i(C)},[])}}ir(Up,"usePresence");function Lu(t,r){if(typeof t=="function")return t(r);t!=null&&(t.current=r)}ir(Lu,"setRef");function $p(...t){const r=E.useRef(t);return r.current=t,E.useCallback(i=>{const a=r.current;let c=!1;const l=a.map(u=>{const d=Lu(u,i);return!c&&typeof d=="function"&&(c=!0),d});if(c)return()=>{for(let u=0;u<l.length;u++){const d=l[u];typeof d=="function"?d():Lu(a[u],null)}}},[])}ir($p,"useStableComposedRefs");function da(t){return t?.animationName||"none"}ir(da,"getAnimationName");function Gp(t){let r=Object.getOwnPropertyDescriptor(t.props,"ref")?.get,i=r&&"isReactWarning"in r&&r.isReactWarning;return i?t.ref:(r=Object.getOwnPropertyDescriptor(t,"ref")?.get,i=r&&"isReactWarning"in r&&r.isReactWarning,i?t.props.ref:t.props.ref||t.ref)}ir(Gp,"getElementRef");var hw=Object.defineProperty,mw=(t,r)=>hw(t,"name",{value:r,configurable:!0}),pw=wo[" useId ".trim().toString()]||(()=>{}),gw=0;function sr(t){const[r,i]=E.useState(pw());return st(()=>{t||i(a=>a??String(gw++))},[t]),t||(r?`radix-${r}`:"")}mw(sr,"useId");var yw=Object.defineProperty,bw=(t,r)=>yw(t,"name",{value:r,configurable:!0}),xw={LTR:"ltr"},vw=E.createContext(void 0);function Oi(t){const r=E.useContext(vw);return t||r||xw.LTR}bw(Oi,"useDirection");var Sw=Object.defineProperty,Cw=(t,r)=>Sw(t,"name",{value:r,configurable:!0}),Vp=wo[" useInsertionEffect ".trim().toString()];function In(t){const r=E.useRef(t);return typeof Vp=="function"?Vp(()=>{r.current=t}):st(()=>{r.current=t}),E.useMemo(()=>((...i)=>r.current?.(...i)),[])}Cw(In,"useCallbackRef");var ww=Object.defineProperty,Rt=(t,r)=>ww(t,"name",{value:r,configurable:!0}),zu="dismissableLayer.update",Ew="dismissableLayer.pointerDownOutside",Tw="dismissableLayer.focusOutside",qp,Yp=E.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),Bu=E.forwardRef(Rt(function(r,i){const{disableOutsidePointerEvents:a=!1,deferPointerDownOutside:c=!1,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:m,onDismiss:p,...C}=r,g=E.useContext(Yp),[b,v]=E.useState(null),x=b?.ownerDocument??globalThis?.document,[,S]=E.useState({}),w=De(i,v),T=Array.from(g.layers),[j]=[...g.layersWithOutsidePointerEventsDisabled].slice(-1),R=j?T.indexOf(j):-1,O=b?T.indexOf(b):-1,M=g.layersWithOutsidePointerEventsDisabled.size>0,D=O>=R,_=E.useRef(!1),I=Kp($=>{u?.($),m?.($),$.defaultPrevented||p?.()},{ownerDocument:x,deferPointerDownOutside:c,isDeferredPointerDownOutsideRef:_,dismissableSurfaces:g.dismissableSurfaces,shouldHandlePointerDownOutside:E.useCallback($=>{if(!($ instanceof Node))return!1;const Y=[...g.branches].some(U=>U.contains($));return D&&!Y},[g.branches,D])}),z=Qp($=>{if(c&&_.current)return;const Y=$.target;[...g.branches].some(q=>q.contains(Y))||(d?.($),m?.($),$.defaultPrevented||p?.())},x),H=b?O===T.length-1:!1,L=In($=>{$.key==="Escape"&&(l?.($),!$.defaultPrevented&&p&&($.preventDefault(),p()))});return E.useEffect(()=>{if(H)return x.addEventListener("keydown",L,{capture:!0}),()=>x.removeEventListener("keydown",L,{capture:!0})},[x,H,L]),E.useEffect(()=>{if(b)return a&&(g.layersWithOutsidePointerEventsDisabled.size===0&&(qp=x.body.style.pointerEvents,x.body.style.pointerEvents="none"),g.layersWithOutsidePointerEventsDisabled.add(b)),g.layers.add(b),Hu(),()=>{a&&(g.layersWithOutsidePointerEventsDisabled.delete(b),g.layersWithOutsidePointerEventsDisabled.size===0&&(x.body.style.pointerEvents=qp))}},[b,x,a,g]),E.useEffect(()=>()=>{b&&(g.layers.delete(b),g.layersWithOutsidePointerEventsDisabled.delete(b),Hu())},[b,g]),E.useEffect(()=>{const $=Rt(()=>S({}),"handleUpdate");return document.addEventListener(zu,$),()=>document.removeEventListener(zu,$)},[]),f.jsx(ze.div,{...C,ref:w,style:{pointerEvents:M?D?"auto":"none":void 0,...r.style},onFocusCapture:Ee(r.onFocusCapture,z.onFocusCapture),onBlurCapture:Ee(r.onBlurCapture,z.onBlurCapture),onPointerDownCapture:Ee(r.onPointerDownCapture,I.onPointerDownCapture)})},"DismissableLayer"));function Xp(){const t=E.useContext(Yp),[r,i]=E.useState(null);return E.useEffect(()=>{if(r)return t.dismissableSurfaces.add(r),()=>{t.dismissableSurfaces.delete(r)}},[r,t.dismissableSurfaces]),i}Rt(Xp,"useDismissableLayerSurface");var jw=Rt(()=>!0,"IS_TRUE");function Kp(t,r){const{ownerDocument:i=globalThis?.document,deferPointerDownOutside:a=!1,isDeferredPointerDownOutsideRef:c,dismissableSurfaces:l,shouldHandlePointerDownOutside:u=jw}=r,d=In(t),m=E.useRef(!1),p=E.useRef(!1),C=E.useRef(new Map),g=E.useRef(()=>{});return E.useEffect(()=>{function b(){p.current=!1,c.current=!1,C.current.clear()}Rt(b,"resetOutsideInteraction");function v(){return Array.from(C.current.values()).some(Boolean)}Rt(v,"isOutsideInteractionIntercepted");function x(R){if(!p.current)return;const O=R.target;O instanceof Node&&[...l].some(D=>D.contains(O))||C.current.set(R.type,!0),R.type==="click"&&window.setTimeout(()=>{p.current&&g.current()},0)}Rt(x,"handleInteractionCapture");function S(R){p.current&&C.current.set(R.type,!1)}Rt(S,"handleInteractionBubble");const w=Rt(R=>{if(R.target&&!m.current){let O=function(){i.removeEventListener("click",g.current);const D=v();b(),D||Pu(Ew,d,M,{discrete:!0})};if(Rt(O,"handleAndDispatchPointerDownOutsideEvent"),!u(R.target)){i.removeEventListener("click",g.current),b(),m.current=!1;return}const M={originalEvent:R};p.current=!0,c.current=a&&R.button===0,C.current.clear(),!a||R.button!==0?O():(i.removeEventListener("click",g.current),g.current=O,i.addEventListener("click",g.current,{once:!0}))}else i.removeEventListener("click",g.current),b();m.current=!1},"handlePointerDown"),T=["pointerup","mousedown","mouseup","touchstart","touchend","click"];for(const R of T)i.addEventListener(R,x,!0),i.addEventListener(R,S);const j=window.setTimeout(()=>{i.addEventListener("pointerdown",w)},0);return()=>{window.clearTimeout(j),i.removeEventListener("pointerdown",w),i.removeEventListener("click",g.current);for(const R of T)i.removeEventListener(R,x,!0),i.removeEventListener(R,S)}},[i,d,a,c,l,u]),{onPointerDownCapture:Rt(()=>m.current=!0,"onPointerDownCapture")}}Rt(Kp,"usePointerDownOutside");function Qp(t,r=globalThis?.document){const i=In(t),a=E.useRef(!1);return E.useEffect(()=>{const c=Rt(l=>{l.target&&!a.current&&Pu(Tw,i,{originalEvent:l},{discrete:!1})},"handleFocus");return r.addEventListener("focusin",c),()=>r.removeEventListener("focusin",c)},[r,i]),{onFocusCapture:Rt(()=>a.current=!0,"onFocusCapture"),onBlurCapture:Rt(()=>a.current=!1,"onBlurCapture")}}Rt(Qp,"useFocusOutside");function Hu(){const t=new CustomEvent(zu);document.dispatchEvent(t)}Rt(Hu,"dispatchUpdate");function Pu(t,r,i,{discrete:a}){const c=i.originalEvent.target,l=new CustomEvent(t,{bubbles:!1,cancelable:!0,detail:i});r&&c.addEventListener(t,r,{once:!0}),a?Cp(c,l):c.dispatchEvent(l)}Rt(Pu,"handleAndDispatchCustomEvent");var Aw=Object.defineProperty,xt=(t,r)=>Aw(t,"name",{value:r,configurable:!0}),Uu="focusScope.autoFocusOnMount",$u="focusScope.autoFocusOnUnmount",Fp={bubbles:!1,cancelable:!0},Zp=E.forwardRef(xt(function(r,i){const{loop:a=!1,trapped:c=!1,branches:l,onMountAutoFocus:u,onUnmountAutoFocus:d,...m}=r,[p,C]=E.useState(null),g=In(u),b=In(d),v=E.useRef(null),x=De(i,C),S=E.useRef(l);E.useEffect(()=>{S.current=l});const w=E.useCallback(R=>R?p?.contains(R)?!0:!!S.current?.some(O=>O.contains(R)):!1,[p]),T=E.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;E.useEffect(()=>{if(c){let R=function(_){if(T.paused||!p)return;const I=_.target;w(I)?v.current=I:lr(v.current,{select:!0})},O=function(_){if(T.paused||!p)return;const I=_.relatedTarget;I!==null&&(w(I)||lr(v.current,{select:!0}))},M=function(_){if(document.activeElement===document.body)for(const z of _)z.removedNodes.length>0&&lr(p)};xt(R,"handleFocusIn"),xt(O,"handleFocusOut"),xt(M,"handleMutations"),document.addEventListener("focusin",R),document.addEventListener("focusout",O);const D=new MutationObserver(M);return p&&D.observe(p,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",R),document.removeEventListener("focusout",O),D.disconnect()}}},[c,p,T.paused,w]),E.useEffect(()=>{if(p){ig.add(T);const R=document.activeElement;if(!p.contains(R)){const M=new CustomEvent(Uu,Fp);p.addEventListener(Uu,g),p.dispatchEvent(M),M.defaultPrevented||(ng(lg(Gu(p)),{select:!0}),document.activeElement===R&&lr(p))}return()=>{p.removeEventListener(Uu,g);const M=p.ownerDocument,D=CustomEvent;setTimeout(()=>{const _=new D($u,Fp);p.addEventListener($u,b),p.dispatchEvent(_),_.defaultPrevented||lr(R??M.body,{select:!0}),p.removeEventListener($u,b),ig.remove(T)},0)}}},[p,g,b,T]);const j=E.useCallback(R=>{if(!a&&!c||T.paused)return;const O=R.key==="Tab"&&!R.altKey&&!R.ctrlKey&&!R.metaKey,M=document.activeElement;if(O&&M){const D=R.currentTarget,[_,I]=rg(D);_&&I?!R.shiftKey&&M===I?(R.preventDefault(),a&&lr(_,{select:!0})):R.shiftKey&&M===_&&(R.preventDefault(),a&&lr(I,{select:!0})):M===D&&R.preventDefault()}},[a,c,T.paused]);return f.jsx(ze.div,{tabIndex:-1,...m,ref:x,onKeyDown:j})},"FocusScope")),Wp=E.createContext(null);function Jp({registry:t,children:r}){return t?f.jsx(Wp.Provider,{value:t,children:r}):r}xt(Jp,"FocusScopeBranchProvider");function eg(){const[t,r]=E.useState([]),i=E.useMemo(()=>({add:xt(a=>r(c=>c.includes(a)?c:[...c,a]),"add"),remove:xt(a=>r(c=>c.filter(l=>l!==a)),"remove")}),[]);return{nodes:t,registry:i}}xt(eg,"useFocusScopeBranchRegistry");function tg(t){const r=E.useContext(Wp);E.useEffect(()=>{if(!(!t||!r))return r.add(t),()=>r.remove(t)},[t,r])}xt(tg,"useFocusScopeBranch");function ng(t,{select:r=!1}={}){const i=document.activeElement;for(const a of t)if(lr(a,{select:r}),document.activeElement!==i)return}xt(ng,"focusFirst");function rg(t){const r=Gu(t),i=Vu(r,t),a=Vu(r.reverse(),t);return[i,a]}xt(rg,"getTabbableEdges");function Gu(t){const r=[],a=t.ownerDocument.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:xt(c=>{const l=c.tagName==="INPUT"&&c.type==="hidden";return c.disabled||c.hidden||l?NodeFilter.FILTER_SKIP:c.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP},"acceptNode")});for(;a.nextNode();)r.push(a.currentNode);return r}xt(Gu,"getTabbableCandidates");function Vu(t,r){const i=typeof r.checkVisibility=="function"&&r.checkVisibility({checkVisibilityCSS:!0});for(const a of t)if(!(i?!a.checkVisibility({checkVisibilityCSS:!0}):og(a,{upTo:r})))return a}xt(Vu,"findVisible");function og(t,{upTo:r}){if(getComputedStyle(t).visibility==="hidden")return!0;for(;t;){if(r!==void 0&&t===r)return!1;if(getComputedStyle(t).display==="none")return!0;t=t.parentElement}return!1}xt(og,"isHidden");function ag(t){return t.tagName==="INPUT"&&typeof t.select=="function"}xt(ag,"isSelectableInput");function lr(t,{select:r=!1}={}){if(t&&t.focus){const a=(t.ownerDocument??document).activeElement;t.focus({preventScroll:!0}),t!==a&&ag(t)&&r&&t.select()}}xt(lr,"focus");var ig=sg();function sg(){let t=[];return{add(r){const i=t[0];r!==i&&i?.pause(),t=qu(t,r),t.unshift(r)},remove(r){t=qu(t,r),t[0]?.resume()}}}xt(sg,"createFocusScopesStack");function qu(t,r){const i=[...t],a=i.indexOf(r);return a!==-1&&i.splice(a,1),i}xt(qu,"arrayRemove");function lg(t){return t.filter(r=>r.tagName!=="A")}xt(lg,"removeLinks");var Rw=Object.defineProperty,Ow=(t,r)=>Rw(t,"name",{value:r,configurable:!0}),Yu=E.forwardRef(Ow(function(r,i){const{container:a,...c}=r,[l,u]=E.useState(!1);st(()=>u(!0),[]);const d=a||l&&globalThis?.document?.body;return d?Hr.createPortal(f.jsx(ze.div,{...c,ref:i}),d):null},"Portal")),Nw=Object.defineProperty,Xu=(t,r)=>Nw(t,"name",{value:r,configurable:!0}),tl=0,fa=null;function Mw(t){return nl(),t.children}Xu(Mw,"FocusGuards");function nl(){E.useEffect(()=>{fa||(fa={start:Ku(),end:Ku()});const{start:t,end:r}=fa;return document.body.firstElementChild!==t&&document.body.insertAdjacentElement("afterbegin",t),document.body.lastElementChild!==r&&document.body.insertAdjacentElement("beforeend",r),tl++,()=>{tl===1&&(fa?.start.remove(),fa?.end.remove(),fa=null),tl=Math.max(0,tl-1)}},[])}Xu(nl,"useFocusGuards");function Ku(){const t=document.createElement("span");return t.setAttribute("data-radix-focus-guard",""),t.tabIndex=0,t.style.outline="none",t.style.opacity="0",t.style.position="fixed",t.style.pointerEvents="none",t}Xu(Ku,"createFocusGuard");var Xn=function(){return Xn=Object.assign||function(r){for(var i,a=1,c=arguments.length;a<c;a++){i=arguments[a];for(var l in i)Object.prototype.hasOwnProperty.call(i,l)&&(r[l]=i[l])}return r},Xn.apply(this,arguments)};function cg(t,r){var i={};for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&r.indexOf(a)<0&&(i[a]=t[a]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var c=0,a=Object.getOwnPropertySymbols(t);c<a.length;c++)r.indexOf(a[c])<0&&Object.prototype.propertyIsEnumerable.call(t,a[c])&&(i[a[c]]=t[a[c]]);return i}function _w(t,r,i){if(i||arguments.length===2)for(var a=0,c=r.length,l;a<c;a++)(l||!(a in r))&&(l||(l=Array.prototype.slice.call(r,0,a)),l[a]=r[a]);return t.concat(l||Array.prototype.slice.call(r))}typeof SuppressedError=="function"&&SuppressedError;var rl="right-scroll-bar-position",ol="width-before-scroll-bar",Dw="with-scroll-bars-hidden",Iw="--removed-body-scroll-bar-size";function Qu(t,r){return typeof t=="function"?t(r):t&&(t.current=r),t}function kw(t,r){var i=E.useState(function(){return{value:t,callback:r,facade:{get current(){return i.value},set current(a){var c=i.value;c!==a&&(i.value=a,i.callback(a,c))}}}})[0];return i.callback=r,i.facade}var Lw=typeof window<"u"?E.useLayoutEffect:E.useEffect,ug=new WeakMap;function zw(t,r){var i=kw(null,function(a){return t.forEach(function(c){return Qu(c,a)})});return Lw(function(){var a=ug.get(i);if(a){var c=new Set(a),l=new Set(t),u=i.current;c.forEach(function(d){l.has(d)||Qu(d,null)}),l.forEach(function(d){c.has(d)||Qu(d,u)})}ug.set(i,t)},[t]),i}function Bw(t){return t}function Hw(t,r){r===void 0&&(r=Bw);var i=[],a=!1,c={read:function(){if(a)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return i.length?i[i.length-1]:t},useMedium:function(l){var u=r(l,a);return i.push(u),function(){i=i.filter(function(d){return d!==u})}},assignSyncMedium:function(l){for(a=!0;i.length;){var u=i;i=[],u.forEach(l)}i={push:function(d){return l(d)},filter:function(){return i}}},assignMedium:function(l){a=!0;var u=[];if(i.length){var d=i;i=[],d.forEach(l),u=i}var m=function(){var C=u;u=[],C.forEach(l)},p=function(){return Promise.resolve().then(m)};p(),i={push:function(C){u.push(C),p()},filter:function(C){return u=u.filter(C),i}}}};return c}function Pw(t){t===void 0&&(t={});var r=Hw(null);return r.options=Xn({async:!0,ssr:!1},t),r}var dg=function(t){var r=t.sideCar,i=cg(t,["sideCar"]);if(!r)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var a=r.read();if(!a)throw new Error("Sidecar medium not found");return E.createElement(a,Xn({},i))};dg.isSideCarExport=!0;function Uw(t,r){return t.useMedium(r),dg}var fg=Pw(),Fu=function(){},al=E.forwardRef(function(t,r){var i=E.useRef(null),a=E.useState({onScrollCapture:Fu,onWheelCapture:Fu,onTouchMoveCapture:Fu}),c=a[0],l=a[1],u=t.forwardProps,d=t.children,m=t.className,p=t.removeScrollBar,C=t.enabled,g=t.shards,b=t.sideCar,v=t.noRelative,x=t.noIsolation,S=t.inert,w=t.allowPinchZoom,T=t.as,j=T===void 0?"div":T,R=t.gapMode,O=cg(t,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),M=b,D=zw([i,r]),_=Xn(Xn({},O),c);return E.createElement(E.Fragment,null,C&&E.createElement(M,{sideCar:fg,removeScrollBar:p,shards:g,noRelative:v,noIsolation:x,inert:S,setCallbacks:l,allowPinchZoom:!!w,lockRef:i,gapMode:R}),u?E.cloneElement(E.Children.only(d),Xn(Xn({},_),{ref:D})):E.createElement(j,Xn({},_,{className:m,ref:D}),d))});al.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},al.classNames={fullWidth:ol,zeroRight:rl};var $w=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function Gw(){if(!document)return null;var t=document.createElement("style");t.type="text/css";var r=$w();return r&&t.setAttribute("nonce",r),t}function Vw(t,r){t.styleSheet?t.styleSheet.cssText=r:t.appendChild(document.createTextNode(r))}function qw(t){var r=document.head||document.getElementsByTagName("head")[0];r.appendChild(t)}var Yw=function(){var t=0,r=null;return{add:function(i){t==0&&(r=Gw())&&(Vw(r,i),qw(r)),t++},remove:function(){t--,!t&&r&&(r.parentNode&&r.parentNode.removeChild(r),r=null)}}},Xw=function(){var t=Yw();return function(r,i){E.useEffect(function(){return t.add(r),function(){t.remove()}},[r&&i])}},hg=function(){var t=Xw(),r=function(i){var a=i.styles,c=i.dynamic;return t(a,c),null};return r},Kw={left:0,top:0,right:0,gap:0},Zu=function(t){return parseInt(t||"",10)||0},Qw=function(t){var r=window.getComputedStyle(document.body),i=r[t==="padding"?"paddingLeft":"marginLeft"],a=r[t==="padding"?"paddingTop":"marginTop"],c=r[t==="padding"?"paddingRight":"marginRight"];return[Zu(i),Zu(a),Zu(c)]},Fw=function(t){if(t===void 0&&(t="margin"),typeof window>"u")return Kw;var r=Qw(t),i=document.documentElement.clientWidth,a=window.innerWidth;return{left:r[0],top:r[1],right:r[2],gap:Math.max(0,a-i+r[2]-r[0])}},Zw=hg(),ha="data-scroll-locked",Ww=function(t,r,i,a){var c=t.left,l=t.top,u=t.right,d=t.gap;return i===void 0&&(i="margin"),`
52
+ .`.concat(Dw,` {
53
+ overflow: hidden `).concat(a,`;
54
+ padding-right: `).concat(d,"px ").concat(a,`;
55
+ }
56
+ body[`).concat(ha,`] {
57
+ overflow: hidden `).concat(a,`;
58
+ overscroll-behavior: contain;
59
+ `).concat([r&&"position: relative ".concat(a,";"),i==="margin"&&`
60
+ padding-left: `.concat(c,`px;
61
+ padding-top: `).concat(l,`px;
62
+ padding-right: `).concat(u,`px;
63
+ margin-left:0;
64
+ margin-top:0;
65
+ margin-right: `).concat(d,"px ").concat(a,`;
66
+ `),i==="padding"&&"padding-right: ".concat(d,"px ").concat(a,";")].filter(Boolean).join(""),`
67
+ }
68
+
69
+ .`).concat(rl,` {
70
+ right: `).concat(d,"px ").concat(a,`;
71
+ }
72
+
73
+ .`).concat(ol,` {
74
+ margin-right: `).concat(d,"px ").concat(a,`;
75
+ }
76
+
77
+ .`).concat(rl," .").concat(rl,` {
78
+ right: 0 `).concat(a,`;
79
+ }
80
+
81
+ .`).concat(ol," .").concat(ol,` {
82
+ margin-right: 0 `).concat(a,`;
83
+ }
84
+
85
+ body[`).concat(ha,`] {
86
+ `).concat(Iw,": ").concat(d,`px;
87
+ }
88
+ `)},mg=function(){var t=parseInt(document.body.getAttribute(ha)||"0",10);return isFinite(t)?t:0},Jw=function(){E.useEffect(function(){return document.body.setAttribute(ha,(mg()+1).toString()),function(){var t=mg()-1;t<=0?document.body.removeAttribute(ha):document.body.setAttribute(ha,t.toString())}},[])},eE=function(t){var r=t.noRelative,i=t.noImportant,a=t.gapMode,c=a===void 0?"margin":a;Jw();var l=E.useMemo(function(){return Fw(c)},[c]);return E.createElement(Zw,{styles:Ww(l,!r,c,i?"":"!important")})},Wu=!1;if(typeof window<"u")try{var il=Object.defineProperty({},"passive",{get:function(){return Wu=!0,!0}});window.addEventListener("test",il,il),window.removeEventListener("test",il,il)}catch{Wu=!1}var ma=Wu?{passive:!1}:!1,tE=function(t){return t.tagName==="TEXTAREA"},pg=function(t,r){if(!(t instanceof Element))return!1;var i=window.getComputedStyle(t);return i[r]!=="hidden"&&!(i.overflowY===i.overflowX&&!tE(t)&&i[r]==="visible")},nE=function(t){return pg(t,"overflowY")},rE=function(t){return pg(t,"overflowX")},gg=function(t,r){var i=r.ownerDocument,a=r;do{typeof ShadowRoot<"u"&&a instanceof ShadowRoot&&(a=a.host);var c=yg(t,a);if(c){var l=bg(t,a),u=l[1],d=l[2];if(u>d)return!0}a=a.parentNode}while(a&&a!==i.body);return!1},oE=function(t){var r=t.scrollTop,i=t.scrollHeight,a=t.clientHeight;return[r,i,a]},aE=function(t){var r=t.scrollLeft,i=t.scrollWidth,a=t.clientWidth;return[r,i,a]},yg=function(t,r){return t==="v"?nE(r):rE(r)},bg=function(t,r){return t==="v"?oE(r):aE(r)},iE=function(t,r){return t==="h"&&r==="rtl"?-1:1},sE=function(t,r,i,a,c){var l=iE(t,window.getComputedStyle(r).direction),u=l*a,d=i.target,m=r.contains(d),p=!1,C=u>0,g=0,b=0;do{if(!d)break;var v=bg(t,d),x=v[0],S=v[1],w=v[2],T=S-w-l*x;(x||T)&&yg(t,d)&&(g+=T,b+=x);var j=d.parentNode;d=j&&j.nodeType===Node.DOCUMENT_FRAGMENT_NODE?j.host:j}while(!m&&d!==document.body||m&&(r.contains(d)||r===d));return(C&&Math.abs(g)<1||!C&&Math.abs(b)<1)&&(p=!0),p},sl=function(t){return"changedTouches"in t?[t.changedTouches[0].clientX,t.changedTouches[0].clientY]:[0,0]},xg=function(t){return[t.deltaX,t.deltaY]},vg=function(t){return t&&"current"in t?t.current:t},lE=function(t,r){return t[0]===r[0]&&t[1]===r[1]},cE=function(t){return`
89
+ .block-interactivity-`.concat(t,` {pointer-events: none;}
90
+ .allow-interactivity-`).concat(t,` {pointer-events: all;}
91
+ `)},uE=0,pa=[];function dE(t){var r=E.useRef([]),i=E.useRef([0,0]),a=E.useRef(),c=E.useState(uE++)[0],l=E.useState(hg)[0],u=E.useRef(t);E.useEffect(function(){u.current=t},[t]),E.useEffect(function(){if(t.inert){document.body.classList.add("block-interactivity-".concat(c));var S=_w([t.lockRef.current],(t.shards||[]).map(vg),!0).filter(Boolean);return S.forEach(function(w){return w.classList.add("allow-interactivity-".concat(c))}),function(){document.body.classList.remove("block-interactivity-".concat(c)),S.forEach(function(w){return w.classList.remove("allow-interactivity-".concat(c))})}}},[t.inert,t.lockRef.current,t.shards]);var d=E.useCallback(function(S,w){if("touches"in S&&S.touches.length===2||S.type==="wheel"&&S.ctrlKey)return!u.current.allowPinchZoom;var T=sl(S),j=i.current,R="deltaX"in S?S.deltaX:j[0]-T[0],O="deltaY"in S?S.deltaY:j[1]-T[1],M,D=S.target,_=Math.abs(R)>Math.abs(O)?"h":"v";if("touches"in S&&_==="h"&&D.type==="range")return!1;var I=window.getSelection(),z=I&&I.anchorNode,H=z?z===D||z.contains(D):!1;if(H)return!1;var L=gg(_,D);if(!L)return!0;if(L?M=_:(M=_==="v"?"h":"v",L=gg(_,D)),!L)return!1;if(!a.current&&"changedTouches"in S&&(R||O)&&(a.current=M),!M)return!0;var $=a.current||M;return sE($,w,S,$==="h"?R:O)},[]),m=E.useCallback(function(S){var w=S;if(!(!pa.length||pa[pa.length-1]!==l)){var T="deltaY"in w?xg(w):sl(w),j=r.current.filter(function(M){return M.name===w.type&&(M.target===w.target||w.target===M.shadowParent)&&lE(M.delta,T)})[0];if(j&&j.should){w.cancelable&&w.preventDefault();return}if(!j){var R=(u.current.shards||[]).map(vg).filter(Boolean).filter(function(M){return M.contains(w.target)}),O=R.length>0?d(w,R[0]):!u.current.noIsolation;O&&w.cancelable&&w.preventDefault()}}},[]),p=E.useCallback(function(S,w,T,j){var R={name:S,delta:w,target:T,should:j,shadowParent:fE(T)};r.current.push(R),setTimeout(function(){r.current=r.current.filter(function(O){return O!==R})},1)},[]),C=E.useCallback(function(S){i.current=sl(S),a.current=void 0},[]),g=E.useCallback(function(S){p(S.type,xg(S),S.target,d(S,t.lockRef.current))},[]),b=E.useCallback(function(S){p(S.type,sl(S),S.target,d(S,t.lockRef.current))},[]);E.useEffect(function(){return pa.push(l),t.setCallbacks({onScrollCapture:g,onWheelCapture:g,onTouchMoveCapture:b}),document.addEventListener("wheel",m,ma),document.addEventListener("touchmove",m,ma),document.addEventListener("touchstart",C,ma),function(){pa=pa.filter(function(S){return S!==l}),document.removeEventListener("wheel",m,ma),document.removeEventListener("touchmove",m,ma),document.removeEventListener("touchstart",C,ma)}},[]);var v=t.removeScrollBar,x=t.inert;return E.createElement(E.Fragment,null,x?E.createElement(l,{styles:cE(c)}):null,v?E.createElement(eE,{noRelative:t.noRelative,gapMode:t.gapMode}):null)}function fE(t){for(var r=null;t!==null;)t instanceof ShadowRoot&&(r=t.host,t=t.host),t=t.parentNode;return r}const hE=Uw(fg,dE);var Ju=E.forwardRef(function(t,r){return E.createElement(al,Xn({},t,{ref:r,sideCar:hE}))});Ju.classNames=al.classNames;var mE=function(t){if(typeof document>"u")return null;var r=Array.isArray(t)?t[0]:t;return r.ownerDocument.body},ga=new WeakMap,ll=new WeakMap,cl={},ed=0,Sg=function(t){return t&&(t.host||Sg(t.parentNode))},pE=function(t,r){return r.map(function(i){if(t.contains(i))return i;var a=Sg(i);return a&&t.contains(a)?a:(console.error("aria-hidden",i,"in not contained inside",t,". Doing nothing"),null)}).filter(function(i){return!!i})},gE=function(t,r,i,a){var c=pE(r,Array.isArray(t)?t:[t]);cl[i]||(cl[i]=new WeakMap);var l=cl[i],u=[],d=new Set,m=new Set(c),p=function(g){!g||d.has(g)||(d.add(g),p(g.parentNode))};c.forEach(p);var C=function(g){!g||m.has(g)||Array.prototype.forEach.call(g.children,function(b){if(d.has(b))C(b);else try{var v=b.getAttribute(a),x=v!==null&&v!=="false",S=(ga.get(b)||0)+1,w=(l.get(b)||0)+1;ga.set(b,S),l.set(b,w),u.push(b),S===1&&x&&ll.set(b,!0),w===1&&b.setAttribute(i,"true"),x||b.setAttribute(a,"true")}catch(T){console.error("aria-hidden: cannot operate on ",b,T)}})};return C(r),d.clear(),ed++,function(){u.forEach(function(g){var b=ga.get(g)-1,v=l.get(g)-1;ga.set(g,b),l.set(g,v),b||(ll.has(g)||g.removeAttribute(a),ll.delete(g)),v||g.removeAttribute(i)}),ed--,ed||(ga=new WeakMap,ga=new WeakMap,ll=new WeakMap,cl={})}},Cg=function(t,r,i){i===void 0&&(i="data-aria-hidden");var a=Array.from(Array.isArray(t)?t:[t]),c=mE(t);return c?(a.push.apply(a,Array.from(c.querySelectorAll("[aria-live], script"))),gE(a,c,i,"aria-hidden")):function(){return null}},yE=Object.defineProperty,wn=(t,r)=>yE(t,"name",{value:r,configurable:!0}),td="Dialog",[wg,NM]=Cn(td),[bE,cr]=wg(td),xE=wn(t=>{const{__scopeDialog:r,children:i,open:a,defaultOpen:c,onOpenChange:l,modal:u=!0}=t,d=E.useRef(null),m=E.useRef(null),{nodes:p,registry:C}=eg(),[g,b]=ar({prop:a,defaultProp:c??!1,onChange:l,caller:td}),[v,x]=E.useState(0),[S,w]=E.useState(0);return f.jsx(bE,{scope:r,triggerRef:d,contentRef:m,contentId:sr(),titleId:sr(),descriptionId:sr(),titlePresent:v>0,descriptionPresent:S>0,setTitleCount:x,setDescriptionCount:w,open:g,onOpenChange:b,onOpenToggle:E.useCallback(()=>b(T=>!T),[b]),modal:u,branchNodes:p,branchRegistry:C,children:i})},"Dialog"),Eg="DialogPortal",[vE,Tg]=wg(Eg,{forceMount:void 0}),SE=wn(t=>{const{__scopeDialog:r,forceMount:i,children:a,container:c}=t,l=cr(Eg,r);return f.jsx(vE,{scope:r,forceMount:i,children:E.Children.map(a,u=>f.jsx($r,{present:i||l.open,children:f.jsx(Yu,{asChild:!0,container:c,children:u})}))})},"DialogPortal"),nd="DialogOverlay",CE=E.forwardRef(wn(function(r,i){const a=Tg(nd,r.__scopeDialog),{forceMount:c=a.forceMount,...l}=r,u=cr(nd,r.__scopeDialog);return u.modal?f.jsx($r,{present:c||u.open,children:f.jsx(EE,{...l,ref:i})}):null},"DialogOverlay")),wE=or("DialogOverlay.RemoveScroll"),EE=E.forwardRef(wn(function(r,i){const{__scopeDialog:a,...c}=r,l=cr(nd,a),u=Xp(),d=De(i,u);return f.jsx(Ju,{as:wE,allowPinchZoom:!0,shards:E.useMemo(()=>[l.contentRef,...l.branchNodes.map(m=>({current:m}))],[l.contentRef,l.branchNodes]),children:f.jsx(ze.div,{"data-state":od(l.open),...c,ref:d,style:{pointerEvents:"auto",...c.style}})})},"DialogOverlayImpl")),Ni="DialogContent",TE=E.forwardRef(wn(function(r,i){const a=Tg(Ni,r.__scopeDialog),{forceMount:c=a.forceMount,...l}=r,u=cr(Ni,r.__scopeDialog);return f.jsx($r,{present:c||u.open,children:u.modal?f.jsx(jE,{...l,ref:i}):f.jsx(AE,{...l,ref:i})})},"DialogContent")),jE=E.forwardRef(wn(function(r,i){const a=cr(Ni,r.__scopeDialog),c=E.useRef(null),l=De(i,a.contentRef,c);return E.useEffect(()=>{const u=c.current;if(u)return Cg(u)},[]),f.jsx(jg,{...r,ref:l,trapFocus:a.open,disableOutsidePointerEvents:a.open,onCloseAutoFocus:Ee(r.onCloseAutoFocus,u=>{u.preventDefault(),a.triggerRef.current?.focus()}),onPointerDownOutside:Ee(r.onPointerDownOutside,u=>{const d=u.detail.originalEvent,m=d.button===0&&d.ctrlKey===!0;(d.button===2||m)&&u.preventDefault()}),onFocusOutside:Ee(r.onFocusOutside,u=>u.preventDefault())})},"DialogContentModal")),AE=E.forwardRef(wn(function(r,i){const a=cr(Ni,r.__scopeDialog),c=E.useRef(!1),l=E.useRef(!1);return f.jsx(jg,{...r,ref:i,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:u=>{r.onCloseAutoFocus?.(u),u.defaultPrevented||(c.current||a.triggerRef.current?.focus(),u.preventDefault()),c.current=!1,l.current=!1},onInteractOutside:u=>{r.onInteractOutside?.(u),u.defaultPrevented||(c.current=!0,u.detail.originalEvent.type==="pointerdown"&&(l.current=!0));const d=u.target;a.triggerRef.current?.contains(d)&&u.preventDefault(),u.detail.originalEvent.type==="focusin"&&l.current&&u.preventDefault()}})},"DialogContentNonModal")),jg=E.forwardRef(wn(function(r,i){const{__scopeDialog:a,trapFocus:c,onOpenAutoFocus:l,onCloseAutoFocus:u,"aria-describedby":d,children:m,...p}=r,C=cr(Ni,a);return nl(),f.jsx(Jp,{registry:C.branchRegistry,children:f.jsx(Zp,{asChild:!0,loop:!0,trapped:c,branches:C.branchNodes,onMountAutoFocus:l,onUnmountAutoFocus:u,children:f.jsx(Bu,{role:"dialog",id:C.contentId,"aria-labelledby":C.titlePresent?C.titleId:void 0,"aria-describedby":C.descriptionPresent?Ag(d,C.descriptionId):d,"data-state":od(C.open),...p,ref:i,deferPointerDownOutside:!0,onDismiss:()=>C.onOpenChange(!1),children:m})})})},"DialogContentImpl")),RE=E.forwardRef(wn(function(r,i){const{__scopeDialog:a,...c}=r,l=cr("DialogTitle",a),{setTitleCount:u}=l;return st(()=>(u(d=>d+1),()=>u(d=>d-1)),[u]),f.jsx(ze.h2,{id:l.titleId,...c,ref:i})},"DialogTitle")),OE="DialogClose",rd=E.forwardRef(wn(function(r,i){const{__scopeDialog:a,...c}=r,l=cr(OE,a);return f.jsx(ze.button,{type:"button",...c,ref:i,onClick:Ee(r.onClick,()=>l.onOpenChange(!1))})},"DialogClose"));function Ag(...t){const r=new Set;for(const i of t)if(typeof i=="string")for(const a of String(i).trim().split(/\s+/))a&&r.add(a);return r.size>0?Array.from(r).join(" "):void 0}wn(Ag,"concatAriaDescribedby");function od(t){return t?"open":"closed"}wn(od,"getState");var NE=Object.defineProperty,ME=(t,r)=>NE(t,"name",{value:r,configurable:!0});function Mi(t){const[r,i]=E.useState(void 0);return st(()=>{if(t){i({width:t.offsetWidth,height:t.offsetHeight});let a=0;const c=new ResizeObserver(l=>{if(!Array.isArray(l)||!l.length)return;const u=l[0];window.cancelAnimationFrame(a),a=window.requestAnimationFrame(()=>{let d,m;if("borderBoxSize"in u){const p=u.borderBoxSize,C=Array.isArray(p)?p[0]:p;d=C.inlineSize,m=C.blockSize}else d=t.offsetWidth,m=t.offsetHeight;i({width:d,height:m})})});return c.observe(t,{box:"border-box"}),()=>{window.cancelAnimationFrame(a),c.unobserve(t)}}else i(void 0)},[t]),r}ME(Mi,"useSize");var _E=Object.defineProperty,ur=(t,r)=>_E(t,"name",{value:r,configurable:!0}),ad="Checkbox",[DE,MM]=Cn(ad),[IE,id]=DE(ad);function Rg(t){const{__scopeCheckbox:r,checked:i,children:a,defaultChecked:c,disabled:l,form:u,name:d,onCheckedChange:m,required:p,value:C="on",internal_do_not_use_render:g}=t,[b,v]=ar({prop:i,defaultProp:c??!1,onChange:m,caller:ad}),[x,S]=E.useState(null),[w,T]=E.useState(null),[j,R]=E.useState(null),O=x?!!u||!!x.closest("form"):!0,M={checked:b,disabled:l,setChecked:v,control:x,setControl:S,name:d,form:u,value:C,userClick:j,onUserClick:R,required:p,defaultChecked:En(c)?!1:c,isFormControl:O,bubbleInput:w,setBubbleInput:T};return f.jsx(IE,{scope:r,...M,children:Og(g)?g(M):a})}ur(Rg,"CheckboxProvider");var kE="CheckboxTrigger",LE=E.forwardRef(ur(function({__scopeCheckbox:r,onKeyDown:i,onClick:a,...c},l){const{control:u,value:d,disabled:m,checked:p,required:C,setControl:g,setChecked:b,onUserClick:v,isFormControl:x,bubbleInput:S}=id(kE,r),w=De(l,g),T=E.useRef(p);return E.useEffect(()=>{const j=u?.form;if(j){const R=ur(()=>b(T.current),"reset");return j.addEventListener("reset",R),()=>j.removeEventListener("reset",R)}},[u,b]),f.jsx(ze.button,{type:"button",role:"checkbox","aria-checked":En(p)?"mixed":p,"aria-required":C,"data-state":sd(p),"data-disabled":m?"":void 0,disabled:m,value:d,...c,ref:w,onKeyDown:Ee(i,j=>{j.key==="Enter"&&j.preventDefault()}),onClick:Ee(a,j=>{const R=j.isPropagationStopped();v({requestedChecked:En(p)?!0:!p,hasConsumerStoppedPropagation:R}),b(O=>En(O)?!0:!O),S&&x&&(R||j.stopPropagation())})})},"CheckboxTrigger")),zE=E.forwardRef(ur(function(r,i){const{__scopeCheckbox:a,name:c,checked:l,defaultChecked:u,required:d,disabled:m,value:p,onCheckedChange:C,form:g,...b}=r;return f.jsx(Rg,{__scopeCheckbox:a,checked:l,defaultChecked:u,disabled:m,required:d,onCheckedChange:C,name:c,form:g,value:p,internal_do_not_use_render:({isFormControl:v})=>f.jsxs(f.Fragment,{children:[f.jsx(LE,{...b,ref:i,__scopeCheckbox:a}),v&&f.jsx(UE,{__scopeCheckbox:a})]})})},"Checkbox")),BE="CheckboxIndicator",HE=E.forwardRef(ur(function(r,i){const{__scopeCheckbox:a,forceMount:c,...l}=r,u=id(BE,a);return f.jsx($r,{present:c||En(u.checked)||u.checked===!0,children:f.jsx(ze.span,{"data-state":sd(u.checked),"data-disabled":u.disabled?"":void 0,...l,ref:i,style:{pointerEvents:"none",...r.style}})})},"CheckboxIndicator")),PE="CheckboxBubbleInput",UE=E.forwardRef(ur(function({__scopeCheckbox:r,onClick:i,...a},c){const{control:l,userClick:u,checked:d,defaultChecked:m,required:p,disabled:C,name:g,value:b,form:v,bubbleInput:x,setBubbleInput:S}=id(PE,r),w=De(c,S),T=Mi(l),j=E.useRef(!1),R=E.useRef(d),O=E.useRef(u),M=E.useRef(null);E.useEffect(()=>{const _=x;if(!_)return;const I=window.HTMLInputElement.prototype,H=Object.getOwnPropertyDescriptor(I,"checked").set;if(!H)return;const L=R.current!==d;R.current=d;const $=u!==null&&u!==O.current;if(O.current=u,$)M.current=L?null:u,L&&(_.indeterminate=En(d),H.call(_,En(d)?!1:d)),_.dispatchEvent(new Event("click",{bubbles:!u.hasConsumerStoppedPropagation}));else if(L){const Y=M.current;M.current=null;const U=Y?.requestedChecked===d;j.current=!0,_.indeterminate=En(d),H.call(_,En(d)?!1:d),_.dispatchEvent(new Event("click",{bubbles:!(U&&Y.hasConsumerStoppedPropagation)})),j.current=!1}},[x,d,u]);const D=E.useRef(En(d)?!1:d);return f.jsx(ze.input,{type:"checkbox","aria-hidden":!0,defaultChecked:m??D.current,required:p,disabled:C,name:g,value:b,form:v,...a,tabIndex:-1,ref:w,onClick:Ee(i,_=>{j.current&&_.stopPropagation()}),style:{...a.style,...T,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})},"CheckboxBubbleInput"));function Og(t){return typeof t=="function"}ur(Og,"isFunction");function En(t){return t==="indeterminate"}ur(En,"isIndeterminate");function sd(t){return En(t)?"indeterminate":t?"checked":"unchecked"}ur(sd,"getState");const $E=["top","right","bottom","left"],Gr=Math.min,dr=Math.max,ul=Math.round,dl=Math.floor,fr=t=>({x:t,y:t}),GE={left:"right",right:"left",bottom:"top",top:"bottom"};function Ng(t,r,i){return dr(t,Gr(r,i))}function hr(t,r){return typeof t=="function"?t(r):t}function Vr(t){return t.split("-")[0]}function ya(t){return t.split("-")[1]}function ld(t){return t==="x"?"y":"x"}function cd(t){return t==="y"?"height":"width"}function Kn(t){const r=t[0];return r==="t"||r==="b"?"y":"x"}function ud(t){return ld(Kn(t))}function VE(t,r,i){i===void 0&&(i=!1);const a=ya(t),c=ud(t),l=cd(c);let u=c==="x"?a===(i?"end":"start")?"right":"left":a==="start"?"bottom":"top";return r.reference[l]>r.floating[l]&&(u=fl(u)),[u,fl(u)]}function qE(t){const r=fl(t);return[dd(t),r,dd(r)]}function dd(t){return t.includes("start")?t.replace("start","end"):t.replace("end","start")}const Mg=["left","right"],_g=["right","left"],YE=["top","bottom"],XE=["bottom","top"];function KE(t,r,i){switch(t){case"top":case"bottom":return i?r?_g:Mg:r?Mg:_g;case"left":case"right":return r?YE:XE;default:return[]}}function QE(t,r,i,a){const c=ya(t);let l=KE(Vr(t),i==="start",a);return c&&(l=l.map(u=>u+"-"+c),r&&(l=l.concat(l.map(dd)))),l}function fl(t){const r=Vr(t);return GE[r]+t.slice(r.length)}function FE(t){var r,i,a,c;return{top:(r=t.top)!=null?r:0,right:(i=t.right)!=null?i:0,bottom:(a=t.bottom)!=null?a:0,left:(c=t.left)!=null?c:0}}function Dg(t){return typeof t!="number"?FE(t):{top:t,right:t,bottom:t,left:t}}function hl(t){const{x:r,y:i,width:a,height:c}=t;return{width:a,height:c,top:i,left:r,right:r+a,bottom:i+c,x:r,y:i}}function Ig(t,r,i){let{reference:a,floating:c}=t;const l=Kn(r),u=ud(r),d=cd(u),m=Vr(r),p=l==="y",C=a.x+a.width/2-c.width/2,g=a.y+a.height/2-c.height/2,b=a[d]/2-c[d]/2;let v;switch(m){case"top":v={x:C,y:a.y-c.height};break;case"bottom":v={x:C,y:a.y+a.height};break;case"right":v={x:a.x+a.width,y:g};break;case"left":v={x:a.x-c.width,y:g};break;default:v={x:a.x,y:a.y}}const x=ya(r);return x&&(v[u]+=b*(x==="end"?1:-1)*(i&&p?-1:1)),v}async function ZE(t,r){var i;r===void 0&&(r={});const{x:a,y:c,platform:l,rects:u,elements:d,strategy:m}=t,{boundary:p="clippingAncestors",rootBoundary:C="viewport",elementContext:g="floating",altBoundary:b=!1,padding:v=0}=hr(r,t),x=Dg(v),w=d[b?g==="floating"?"reference":"floating":g],T=hl(await l.getClippingRect({element:(i=await(l.isElement==null?void 0:l.isElement(w)))==null||i?w:w.contextElement||await(l.getDocumentElement==null?void 0:l.getDocumentElement(d.floating)),boundary:p,rootBoundary:C,strategy:m})),j=g==="floating"?{x:a,y:c,width:u.floating.width,height:u.floating.height}:u.reference,R=await(l.getOffsetParent==null?void 0:l.getOffsetParent(d.floating)),O=await(l.isElement==null?void 0:l.isElement(R))&&await(l.getScale==null?void 0:l.getScale(R))||{x:1,y:1},M=hl(l.convertOffsetParentRelativeRectToViewportRelativeRect?await l.convertOffsetParentRelativeRectToViewportRelativeRect({elements:d,rect:j,offsetParent:R,strategy:m}):j);return{top:(T.top-M.top+x.top)/O.y,bottom:(M.bottom-T.bottom+x.bottom)/O.y,left:(T.left-M.left+x.left)/O.x,right:(M.right-T.right+x.right)/O.x}}const WE=50,JE=async(t,r,i)=>{const{placement:a="bottom",strategy:c="absolute",middleware:l=[],platform:u}=i,d=u.detectOverflow?u:{...u,detectOverflow:ZE},m=await(u.isRTL==null?void 0:u.isRTL(r));let p=await u.getElementRects({reference:t,floating:r,strategy:c}),{x:C,y:g}=Ig(p,a,m),b=a,v=0;const x={};for(let S=0;S<l.length;S++){const w=l[S];if(!w)continue;const{name:T,fn:j}=w,{x:R,y:O,data:M,reset:D}=await j({x:C,y:g,initialPlacement:a,placement:b,strategy:c,middlewareData:x,rects:p,platform:d,elements:{reference:t,floating:r}});C=R??C,g=O??g,x[T]={...x[T],...M},D&&v<WE&&(v++,typeof D=="object"&&(D.placement&&(b=D.placement),D.rects&&(p=D.rects===!0?await u.getElementRects({reference:t,floating:r,strategy:c}):D.rects),{x:C,y:g}=Ig(p,b,m)),S=-1)}return{x:C,y:g,placement:b,strategy:c,middlewareData:x}},eT=t=>({name:"arrow",options:t,async fn(r){const{x:i,y:a,placement:c,rects:l,platform:u,elements:d,middlewareData:m}=r,{element:p,padding:C=0}=hr(t,r)||{};if(p==null)return{};const g=Dg(C),b={x:i,y:a},v=ud(c),x=cd(v),S=await u.getDimensions(p),w=v==="y",T=w?"top":"left",j=w?"bottom":"right",R=w?"clientHeight":"clientWidth",O=l.reference[x]+l.reference[v]-b[v]-l.floating[x],M=b[v]-l.reference[v],D=await(u.getOffsetParent==null?void 0:u.getOffsetParent(p));let _=D?D[R]:0;(!_||!await(u.isElement==null?void 0:u.isElement(D)))&&(_=d.floating[R]||l.floating[x]);const I=O/2-M/2,z=_/2-S[x]/2-1,H=Gr(g[T],z),L=Gr(g[j],z),$=_-S[x]-L,Y=_/2-S[x]/2+I,U=Ng(H,Y,$),q=!m.arrow&&ya(c)!=null&&Y!==U&&l.reference[x]/2-(Y<H?H:L)-S[x]/2<0,P=q?Y<H?Y-H:Y-$:0;return{[v]:b[v]+P,data:{[v]:U,centerOffset:Y-U-P,...q&&{alignmentOffset:P}},reset:q}}}),tT=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(r){var i,a;const{placement:c,middlewareData:l,rects:u,initialPlacement:d,platform:m,elements:p}=r,{mainAxis:C=!0,crossAxis:g=!0,fallbackPlacements:b,fallbackStrategy:v="bestFit",fallbackAxisSideDirection:x="none",flipAlignment:S=!0,...w}=hr(t,r);if((i=l.arrow)!=null&&i.alignmentOffset)return{};const T=Vr(c),j=Kn(d),R=Vr(d)===d,O=await(m.isRTL==null?void 0:m.isRTL(p.floating)),M=b||(R||!S?[fl(d)]:qE(d)),D=x!=="none";!b&&D&&M.push(...QE(d,S,x,O));const _=[d,...M],I=await m.detectOverflow(r,w),z=[];let H=((a=l.flip)==null?void 0:a.overflows)||[];if(C&&z.push(I[T]),g){const U=VE(c,u,O);z.push(I[U[0]],I[U[1]])}if(H=[...H,{placement:c,overflows:z}],!z.every(U=>U<=0)){var L,$;const U=(((L=l.flip)==null?void 0:L.index)||0)+1,q=_[U];if(q&&(!(g==="alignment"?j!==Kn(q):!1)||H.every(B=>Kn(B.placement)===j?B.overflows[0]>0:!0)))return{data:{index:U,overflows:H},reset:{placement:q}};let P=($=H.filter(G=>G.overflows[0]<=0).sort((G,B)=>G.overflows[1]-B.overflows[1])[0])==null?void 0:$.placement;if(!P)switch(v){case"bestFit":{var Y;const G=(Y=H.filter(B=>{if(D){const Q=Kn(B.placement);return Q===j||Q==="y"}return!0}).map(B=>[B.placement,B.overflows.filter(Q=>Q>0).reduce((Q,N)=>Q+N,0)]).sort((B,Q)=>B[1]-Q[1])[0])==null?void 0:Y[0];G&&(P=G);break}case"initialPlacement":P=d;break}if(c!==P)return{reset:{placement:P}}}return{}}}};function kg(t,r){return{top:t.top-r.height,right:t.right-r.width,bottom:t.bottom-r.height,left:t.left-r.width}}function Lg(t){return $E.some(r=>t[r]>=0)}const nT=function(t){return t===void 0&&(t={}),{name:"hide",options:t,async fn(r){const{rects:i,platform:a}=r,{strategy:c="referenceHidden",...l}=hr(t,r);switch(c){case"referenceHidden":{const u=await a.detectOverflow(r,{...l,elementContext:"reference"}),d=kg(u,i.reference);return{data:{referenceHiddenOffsets:d,referenceHidden:Lg(d)}}}case"escaped":{const u=await a.detectOverflow(r,{...l,altBoundary:!0}),d=kg(u,i.floating);return{data:{escapedOffsets:d,escaped:Lg(d)}}}default:return{}}}}},zg=new Set(["left","top"]);async function rT(t,r){const{placement:i,platform:a,elements:c}=t,l=await(a.isRTL==null?void 0:a.isRTL(c.floating)),u=Vr(i),d=ya(i),m=Kn(i)==="y",p=zg.has(u)?-1:1,C=l&&m?-1:1,g=hr(r,t);let{mainAxis:b,crossAxis:v,alignmentAxis:x}=typeof g=="number"?{mainAxis:g,crossAxis:0,alignmentAxis:null}:{mainAxis:g.mainAxis||0,crossAxis:g.crossAxis||0,alignmentAxis:g.alignmentAxis};return d&&typeof x=="number"&&(v=d==="end"?x*-1:x),m?{x:v*C,y:b*p}:{x:b*p,y:v*C}}const oT=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(r){var i,a;const{x:c,y:l,placement:u,middlewareData:d}=r,m=await rT(r,t);return u===((i=d.offset)==null?void 0:i.placement)&&(a=d.arrow)!=null&&a.alignmentOffset?{}:{x:c+m.x,y:l+m.y,data:{...m,placement:u}}}}},aT=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(r){const{x:i,y:a,placement:c,platform:l}=r,{mainAxis:u=!0,crossAxis:d=!1,limiter:m={fn:j=>{let{x:R,y:O}=j;return{x:R,y:O}}},...p}=hr(t,r),C={x:i,y:a},g=await l.detectOverflow(r,p),b=Kn(c),v=ld(b);let x=C[v],S=C[b];const w=(j,R)=>Ng(R+g[j==="y"?"top":"left"],R,R-g[j==="y"?"bottom":"right"]);u&&(x=w(v,x)),d&&(S=w(b,S));const T=m.fn({...r,[v]:x,[b]:S});return{...T,data:{x:T.x-i,y:T.y-a,enabled:{[v]:u,[b]:d}}}}}},iT=function(t){return t===void 0&&(t={}),{options:t,fn(r){var i,a;const{x:c,y:l,placement:u,rects:d,middlewareData:m}=r,{offset:p=0,mainAxis:C=!0,crossAxis:g=!0}=hr(t,r),b={x:c,y:l},v=Kn(u),x=ld(v);let S=b[x],w=b[v];const T=hr(p,r),j=typeof T=="number"?{mainAxis:T,crossAxis:0}:{mainAxis:(i=T.mainAxis)!=null?i:0,crossAxis:(a=T.crossAxis)!=null?a:0};if(C){const M=x==="y"?"height":"width",D=d.reference[x]-d.floating[M]+j.mainAxis,_=d.reference[x]+d.reference[M]-j.mainAxis;S<D?S=D:S>_&&(S=_)}if(g){var R,O;const M=x==="y"?"width":"height",D=zg.has(Vr(u)),_=d.reference[v]-d.floating[M]+(D&&((R=m.offset)==null?void 0:R[v])||0)+(D?0:j.crossAxis),I=d.reference[v]+d.reference[M]+(D?0:((O=m.offset)==null?void 0:O[v])||0)-(D?j.crossAxis:0);w<_?w=_:w>I&&(w=I)}return{[x]:S,[v]:w}}}},sT=function(t){return t===void 0&&(t={}),{name:"size",options:t,async fn(r){const{placement:i,rects:a,platform:c,elements:l}=r,{apply:u=()=>{},...d}=hr(t,r),m=await c.detectOverflow(r,d),p=Vr(i),C=ya(i),g=Kn(i)==="y",{width:b,height:v}=a.floating;let x,S;p==="top"||p==="bottom"?(x=p,S=C===(await(c.isRTL==null?void 0:c.isRTL(l.floating))?"start":"end")?"left":"right"):(S=p,x=C==="end"?"top":"bottom");const w=v-m.top-m.bottom,T=b-m.left-m.right,j=Gr(v-m[x],w),R=Gr(b-m[S],T),O=r.middlewareData.shift,M=!O;let D=j,_=R;O!=null&&O.enabled.x&&(_=T),O!=null&&O.enabled.y&&(D=w),M&&!C&&(g?_=b-2*dr(m.left,m.right):D=v-2*dr(m.top,m.bottom)),await u({...r,availableWidth:_,availableHeight:D});const I=await c.getDimensions(l.floating);return b!==I.width||v!==I.height?{reset:{rects:!0}}:{}}}};function ml(){return typeof window<"u"}function ba(t){return Bg(t)?(t.nodeName||"").toLowerCase():"#document"}function en(t){var r;return(t==null||(r=t.ownerDocument)==null?void 0:r.defaultView)||window}function mr(t){var r;return(r=(Bg(t)?t.ownerDocument:t.document)||window.document)==null?void 0:r.documentElement}function Bg(t){return ml()?t instanceof Node||t instanceof en(t).Node:!1}function Qn(t){return ml()?t instanceof Element||t instanceof en(t).Element:!1}function qr(t){return ml()?t instanceof HTMLElement||t instanceof en(t).HTMLElement:!1}function Hg(t){return!ml()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof en(t).ShadowRoot}function pl(t){const{overflow:r,overflowX:i,overflowY:a,display:c}=Fn(t);return/auto|scroll|overlay|hidden|clip/.test(r+a+i)&&c!=="inline"&&c!=="contents"}function lT(t){return/^(table|td|th)$/.test(ba(t))}function gl(t){try{if(t.matches(":popover-open"))return!0}catch{}try{return t.matches(":modal")}catch{return!1}}const cT=/transform|translate|scale|rotate|perspective|filter/,uT=/paint|layout|strict|content/,jo=t=>!!t&&t!=="none";let fd;function hd(t){const r=Qn(t)?Fn(t):t;return jo(r.transform)||jo(r.translate)||jo(r.scale)||jo(r.rotate)||jo(r.perspective)||!md()&&(jo(r.backdropFilter)||jo(r.filter))||cT.test(r.willChange||"")||uT.test(r.contain||"")}function dT(t){let r=Ao(t);for(;qr(r)&&!_i(r);){if(hd(r))return r;if(gl(r))return null;r=Ao(r)}return null}function md(){return fd==null&&(fd=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),fd}function _i(t){return/^(html|body|#document)$/.test(ba(t))}function Fn(t){return en(t).getComputedStyle(t)}function yl(t){return Qn(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function Ao(t){if(ba(t)==="html")return t;const r=t.assignedSlot||t.parentNode||Hg(t)&&t.host||mr(t);return Hg(r)?r.host:r}function Pg(t){const r=Ao(t);return _i(r)?(t.ownerDocument||t).body:qr(r)&&pl(r)?r:Pg(r)}function Di(t,r,i){var a;r===void 0&&(r=[]),i===void 0&&(i=!0);const c=Pg(t),l=c===((a=t.ownerDocument)==null?void 0:a.body),u=en(c);if(l){const d=pd(u);return r.concat(u,u.visualViewport||[],pl(c)?c:[],d&&i?Di(d):[])}else return r.concat(c,Di(c,[],i))}function pd(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function Ug(t){const r=Fn(t);let i=parseFloat(r.width)||0,a=parseFloat(r.height)||0;const c=qr(t),l=c?t.offsetWidth:i,u=c?t.offsetHeight:a,d=ul(i)!==l||ul(a)!==u;return d&&(i=l,a=u),{width:i,height:a,$:d}}function gd(t){return Qn(t)?t:t.contextElement}function xa(t){const r=gd(t);if(!qr(r))return fr(1);const i=r.getBoundingClientRect(),{width:a,height:c,$:l}=Ug(r);let u=(l?ul(i.width):i.width)/a,d=(l?ul(i.height):i.height)/c;return(!u||!Number.isFinite(u))&&(u=1),(!d||!Number.isFinite(d))&&(d=1),{x:u,y:d}}const fT=fr(0);function $g(t){const r=en(t);return!md()||!r.visualViewport?fT:{x:r.visualViewport.offsetLeft,y:r.visualViewport.offsetTop}}function hT(t,r,i){return r===void 0&&(r=!1),!!i&&r&&i===en(t)}function Ro(t,r,i,a){r===void 0&&(r=!1),i===void 0&&(i=!1);const c=t.getBoundingClientRect(),l=gd(t);let u=fr(1);r&&(a?Qn(a)&&(u=xa(a)):u=xa(t));const d=hT(l,i,a)?$g(l):fr(0);let m=(c.left+d.x)/u.x,p=(c.top+d.y)/u.y,C=c.width/u.x,g=c.height/u.y;if(l&&a){const b=en(l),v=Qn(a)?en(a):a;let x=b,S=pd(x);for(;S&&v!==x;){const w=xa(S),T=S.getBoundingClientRect(),j=Fn(S),R=T.left+(S.clientLeft+parseFloat(j.paddingLeft))*w.x,O=T.top+(S.clientTop+parseFloat(j.paddingTop))*w.y;m*=w.x,p*=w.y,C*=w.x,g*=w.y,m+=R,p+=O,x=en(S),S=pd(x)}}return hl({width:C,height:g,x:m,y:p})}function bl(t,r){const i=yl(t).scrollLeft;return r?r.left+i:Ro(mr(t)).left+i}function Gg(t,r){const i=t.getBoundingClientRect(),a=i.left+r.scrollLeft-bl(t,i),c=i.top+r.scrollTop;return{x:a,y:c}}function mT(t){let{elements:r,rect:i,offsetParent:a,strategy:c}=t;const l=c==="fixed",u=mr(a),d=r?gl(r.floating):!1;if(a===u||d&&l)return i;let m={scrollLeft:0,scrollTop:0},p=fr(1);const C=fr(0),g=qr(a);if((g||!l)&&((ba(a)!=="body"||pl(u))&&(m=yl(a)),g)){const v=Ro(a);p=xa(a),C.x=v.x+a.clientLeft,C.y=v.y+a.clientTop}const b=u&&!g&&!l?Gg(u,m):fr(0);return{width:i.width*p.x,height:i.height*p.y,x:i.x*p.x-m.scrollLeft*p.x+C.x+b.x,y:i.y*p.y-m.scrollTop*p.y+C.y+b.y}}function pT(t){return t.getClientRects?Array.from(t.getClientRects()):[]}function gT(t){const r=yl(t),i=t.ownerDocument.body,a=dr(t.scrollWidth,t.clientWidth,i.scrollWidth,i.clientWidth),c=dr(t.scrollHeight,t.clientHeight,i.scrollHeight,i.clientHeight);let l=-r.scrollLeft+bl(t);const u=-r.scrollTop;return Fn(i).direction==="rtl"&&(l+=dr(t.clientWidth,i.clientWidth)-a),{width:a,height:c,x:l,y:u}}const yT=25;function bT(t,r,i){i===void 0&&(i="viewport");const a=i==="layoutViewport",c=en(t),l=mr(t),u=c.visualViewport;let d=l.clientWidth,m=l.clientHeight,p=0,C=0;if(u){const b=!md()||r==="fixed";a?b||(p=-u.offsetLeft,C=-u.offsetTop):(d=u.width,m=u.height,b&&(p=u.offsetLeft,C=u.offsetTop))}if(bl(l)<=0){const b=l.ownerDocument,v=b.body,x=getComputedStyle(v),S=b.compatMode==="CSS1Compat"&&parseFloat(x.marginLeft)+parseFloat(x.marginRight)||0,w=Math.abs(l.clientWidth-v.clientWidth-S),T=getComputedStyle(l).scrollbarGutter==="stable both-edges"?w/2:w;T<=yT&&(d-=T)}return{width:d,height:m,x:p,y:C}}function xT(t,r){const i=Ro(t,!0,r==="fixed"),a=i.top+t.clientTop,c=i.left+t.clientLeft,l=xa(t),u=t.clientWidth*l.x,d=t.clientHeight*l.y,m=c*l.x,p=a*l.y;return{width:u,height:d,x:m,y:p}}function Vg(t,r,i){let a;if(r==="viewport"||r==="layoutViewport")a=bT(t,i,r);else if(r==="document")a=gT(mr(t));else if(Qn(r))a=xT(r,i);else{const c=$g(t);a={x:r.x-c.x,y:r.y-c.y,width:r.width,height:r.height}}return hl(a)}function vT(t,r){const i=r.get(t);if(i)return i;let a=Di(t,[],!1).filter(d=>Qn(d)&&ba(d)!=="body"),c=null;const l=Fn(t).position==="fixed";let u=l?Ao(t):t;for(;Qn(u)&&!_i(u);){const d=Fn(u),m=hd(u),p=c?c.position:l?"fixed":"";!m&&(p==="fixed"||p==="absolute"&&d.position==="static")?a=a.filter(g=>g!==u):c=d,u=Ao(u)}return r.set(t,a),a}function ST(t){let{element:r,boundary:i,rootBoundary:a,strategy:c}=t;const u=[...i==="clippingAncestors"?gl(r)?[]:vT(r,this._c):[].concat(i),a],d=Vg(r,u[0],c);let m=d.top,p=d.right,C=d.bottom,g=d.left;for(let b=1;b<u.length;b++){const v=Vg(r,u[b],c);m=dr(v.top,m),p=Gr(v.right,p),C=Gr(v.bottom,C),g=dr(v.left,g)}return{width:p-g,height:C-m,x:g,y:m}}function CT(t){const{width:r,height:i}=Ug(t);return{width:r,height:i}}function wT(t,r,i){const a=qr(r),c=mr(r),l=i==="fixed",u=Ro(t,!0,l,r);let d={scrollLeft:0,scrollTop:0};const m=fr(0);if((a||!l)&&((ba(r)!=="body"||pl(c))&&(d=yl(r)),a)){const b=Ro(r,!0,l,r);m.x=b.x+r.clientLeft,m.y=b.y+r.clientTop}!a&&c&&(m.x=bl(c));const p=c&&!a&&!l?Gg(c,d):fr(0),C=u.left+d.scrollLeft-m.x-p.x,g=u.top+d.scrollTop-m.y-p.y;return{x:C,y:g,width:u.width,height:u.height}}function yd(t){return Fn(t).position==="static"}function qg(t,r){if(!qr(t)||Fn(t).position==="fixed")return null;if(r)return r(t);let i=t.offsetParent;return mr(t)===i&&(i=i.ownerDocument.body),i}function Yg(t,r){const i=en(t);if(gl(t))return i;if(!qr(t)){let c=Ao(t);for(;c&&!_i(c);){if(Qn(c)&&!yd(c))return c;c=Ao(c)}return i}let a=qg(t,r);for(;a&&lT(a)&&yd(a);)a=qg(a,r);return a&&_i(a)&&yd(a)&&!hd(a)?i:a||dT(t)||i}const ET=async function(t){const r=this.getOffsetParent||Yg,i=this.getDimensions,a=await i(t.floating);return{reference:wT(t.reference,await r(t.floating),t.strategy),floating:{x:0,y:0,width:a.width,height:a.height}}};function TT(t){return Fn(t).direction==="rtl"}const jT={convertOffsetParentRelativeRectToViewportRelativeRect:mT,getDocumentElement:mr,getClippingRect:ST,getOffsetParent:Yg,getElementRects:ET,getClientRects:pT,getDimensions:CT,getScale:xa,isElement:Qn,isRTL:TT};function Xg(t,r){return t.x===r.x&&t.y===r.y&&t.width===r.width&&t.height===r.height}function AT(t,r,i){let a=null,c;const l=mr(t);function u(){var C;clearTimeout(c),(C=a)==null||C.disconnect(),a=null}function d(C,g){C===void 0&&(C=!1),g===void 0&&(g=1),u();const b=t.getBoundingClientRect(),{left:v,top:x,width:S,height:w}=b;if(C||r(),!S||!w)return;const T=dl(x),j=dl(l.clientWidth-(v+S)),R=dl(l.clientHeight-(x+w)),O=dl(v),D={rootMargin:-T+"px "+-j+"px "+-R+"px "+-O+"px",threshold:dr(0,Gr(1,g))||1};let _=!0;function I(z){const H=z[0].intersectionRatio;if(!Xg(b,t.getBoundingClientRect()))return d();if(H!==g){if(!_)return d();H?d(!1,H):c=setTimeout(()=>{d(!1,1e-7)},1e3)}_=!1}try{a=new IntersectionObserver(I,{...D,root:l.ownerDocument})}catch{a=new IntersectionObserver(I,D)}a.observe(t)}const m=en(t),p=()=>d(i);return m.addEventListener("resize",p),d(!0),()=>{m.removeEventListener("resize",p),u()}}function RT(t,r,i,a){a===void 0&&(a={});const{ancestorScroll:c=!0,ancestorResize:l=!0,elementResize:u=typeof ResizeObserver=="function",layoutShift:d=typeof IntersectionObserver=="function",animationFrame:m=!1}=a,p=gd(t),C=c||l?[...p?Di(p):[],...r?Di(r):[]]:[];C.forEach(T=>{c&&T.addEventListener("scroll",i),l&&T.addEventListener("resize",i)});const g=p&&d?AT(p,i,l):null;let b=-1,v=null;u&&(v=new ResizeObserver(T=>{let[j]=T;j&&j.target===p&&v&&r&&(v.unobserve(r),cancelAnimationFrame(b),b=requestAnimationFrame(()=>{var R;(R=v)==null||R.observe(r)})),i()}),p&&!m&&v.observe(p),r&&v.observe(r));let x,S=m?Ro(t):null;m&&w();function w(){const T=Ro(t);S&&!Xg(S,T)&&i(),S=T,x=requestAnimationFrame(w)}return i(),()=>{var T;C.forEach(j=>{c&&j.removeEventListener("scroll",i),l&&j.removeEventListener("resize",i)}),g?.(),(T=v)==null||T.disconnect(),v=null,m&&cancelAnimationFrame(x)}}const OT=oT,NT=aT,MT=tT,_T=sT,DT=nT,Kg=eT,IT=iT,kT=(t,r,i)=>{const a=new Map,c=i??{},l={...jT,...c.platform,_c:a};return JE(t,r,{...c,platform:l})};var LT=typeof document<"u",zT=function(){},xl=LT?E.useLayoutEffect:zT;function vl(t,r){if(t===r)return!0;if(typeof t!=typeof r)return!1;if(typeof t=="function"&&t.toString()===r.toString())return!0;let i,a,c;if(t&&r&&typeof t=="object"){if(Array.isArray(t)){if(i=t.length,i!==r.length)return!1;for(a=i;a--!==0;)if(!vl(t[a],r[a]))return!1;return!0}if(c=Object.keys(t),i=c.length,i!==Object.keys(r).length)return!1;for(a=i;a--!==0;)if(!{}.hasOwnProperty.call(r,c[a]))return!1;for(a=i;a--!==0;){const l=c[a];if(!(l==="_owner"&&t.$$typeof)&&!vl(t[l],r[l]))return!1}return!0}return t!==t&&r!==r}function Qg(t){return typeof window>"u"?1:(t.ownerDocument.defaultView||window).devicePixelRatio||1}function Fg(t,r){const i=Qg(t);return Math.round(r*i)/i}function bd(t){const r=E.useRef(t);return xl(()=>{r.current=t}),r}function BT(t){t===void 0&&(t={});const{placement:r="bottom",strategy:i="absolute",middleware:a=[],platform:c,elements:{reference:l,floating:u}={},transform:d=!0,whileElementsMounted:m,open:p}=t,[C,g]=E.useState({x:0,y:0,strategy:i,placement:r,middlewareData:{},isPositioned:!1}),[b,v]=E.useState(a);vl(b,a)||v(a);const[x,S]=E.useState(null),[w,T]=E.useState(null),j=E.useCallback(B=>{B!==D.current&&(D.current=B,S(B))},[]),R=E.useCallback(B=>{B!==_.current&&(_.current=B,T(B))},[]),O=l||x,M=u||w,D=E.useRef(null),_=E.useRef(null),I=E.useRef(C),z=m!=null,H=bd(m),L=bd(c),$=bd(p),Y=E.useCallback(()=>{if(!D.current||!_.current)return;const B={placement:r,strategy:i,middleware:b};L.current&&(B.platform=L.current),kT(D.current,_.current,B).then(Q=>{const N={...Q,isPositioned:$.current!==!1};U.current&&!vl(I.current,N)&&(I.current=N,Hr.flushSync(()=>{g(N)}))})},[b,r,i,L,$]);xl(()=>{p===!1&&I.current.isPositioned&&(I.current.isPositioned=!1,g(B=>({...B,isPositioned:!1})))},[p]);const U=E.useRef(!1);xl(()=>(U.current=!0,()=>{U.current=!1}),[]),xl(()=>{if(O&&(D.current=O),M&&(_.current=M),O&&M){if(H.current)return H.current(O,M,Y);Y()}},[O,M,Y,H,z]);const q=E.useMemo(()=>({reference:D,floating:_,setReference:j,setFloating:R}),[j,R]),P=E.useMemo(()=>({reference:O,floating:M}),[O,M]),G=E.useMemo(()=>{const B={position:i,left:0,top:0};if(!P.floating)return B;const Q=Fg(P.floating,C.x),N=Fg(P.floating,C.y);return d?{...B,transform:"translate("+Q+"px, "+N+"px)",...Qg(P.floating)>=1.5&&{willChange:"transform"}}:{position:i,left:Q,top:N}},[i,d,P.floating,C.x,C.y]);return E.useMemo(()=>({...C,update:Y,refs:q,elements:P,floatingStyles:G}),[C,Y,q,P,G])}const HT=t=>{function r(i){return{}.hasOwnProperty.call(i,"current")}return{name:"arrow",options:t,fn(i){const{element:a,padding:c}=typeof t=="function"?t(i):t;return a&&r(a)?a.current!=null?Kg({element:a.current,padding:c}).fn(i):{}:a?Kg({element:a,padding:c}).fn(i):{}}}},PT=(t,r)=>{const i=OT(t);return{name:i.name,fn:i.fn,options:[t,r]}},UT=(t,r)=>{const i=NT(t);return{name:i.name,fn:i.fn,options:[t,r]}},$T=(t,r)=>({fn:IT(t).fn,options:[t,r]}),GT=(t,r)=>{const i=MT(t);return{name:i.name,fn:i.fn,options:[t,r]}},VT=(t,r)=>{const i=_T(t);return{name:i.name,fn:i.fn,options:[t,r]}},qT=(t,r)=>{const i=DT(t);return{name:i.name,fn:i.fn,options:[t,r]}},YT=(t,r)=>{const i=HT(t);return{name:i.name,fn:i.fn,options:[t,r]}};var XT=Object.defineProperty,KT=(t,r)=>XT(t,"name",{value:r,configurable:!0}),QT=E.forwardRef(KT(function(r,i){const{children:a,width:c=10,height:l=5,...u}=r;return f.jsx(ze.svg,{...u,ref:i,width:c,height:l,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:r.asChild?a:f.jsx("polygon",{points:"0,0 30,0 15,10"})})},"Arrow")),FT=Object.defineProperty,pr=(t,r)=>FT(t,"name",{value:r,configurable:!0}),Zg={Partial:"partial"},Wg={Optimized:"optimized",Always:"always"},Jg="Popper",[ey,Sl]=Cn(Jg),[ZT,ty]=ey(Jg),ny=pr(t=>{const{__scopePopper:r,children:i}=t,[a,c]=E.useState(null),[l,u]=E.useState(void 0);return f.jsx(ZT,{scope:r,anchor:a,onAnchorChange:c,placementState:l,setPlacementState:u,children:i})},"Popper"),WT="PopperAnchor",ry=E.forwardRef(pr(function(r,i){const{__scopePopper:a,virtualRef:c,...l}=r,u=ty(WT,a),d=E.useRef(null),m=u.onAnchorChange,p=E.useCallback(S=>{d.current=S,S&&m(S)},[m]),C=De(i,p),g=E.useRef(null);E.useEffect(()=>{if(!c)return;const S=g.current;g.current=c.current,S!==g.current&&m(g.current)});const b=u.placementState&&Cl(u.placementState),v=b?.[0],x=b?.[1];return c?null:f.jsx(ze.div,{"data-radix-popper-side":v,"data-radix-popper-align":x,...l,ref:C})},"PopperAnchor")),oy="PopperContent",[JT,ej]=ey(oy),ay=E.forwardRef(pr(function(r,i){const{__scopePopper:a,side:c="bottom",sideOffset:l=0,align:u="center",alignOffset:d=0,arrowPadding:m=0,avoidCollisions:p=!0,collisionBoundary:C=[],collisionPadding:g=0,sticky:b=Zg.Partial,hideWhenDetached:v=!1,updatePositionStrategy:x=Wg.Optimized,onPlaced:S,...w}=r,T=ty(oy,a),[j,R]=E.useState(null),O=De(i,R),[M,D]=E.useState(null),_=Mi(M),I=_?.width??0,z=_?.height??0,H=c+(u!=="center"?"-"+u:""),L=typeof g=="number"?g:{top:0,right:0,bottom:0,left:0,...g},$=Array.isArray(C)?C:[C],Y=$.length>0,U={padding:L,boundary:$.filter(iy),altBoundary:Y},{refs:q,floatingStyles:P,placement:G,isPositioned:B,middlewareData:Q}=BT({strategy:"fixed",placement:H,whileElementsMounted:pr((...ge)=>RT(...ge,{animationFrame:x===Wg.Always}),"whileElementsMounted"),elements:{reference:T.anchor},middleware:[PT({mainAxis:l+z,alignmentAxis:d}),p&&UT({mainAxis:!0,crossAxis:!1,...b===Zg.Partial?{limiter:$T()}:{},...U}),p&&GT({...U}),VT({...U,apply:pr(({elements:ge,rects:de,availableWidth:Me,availableHeight:Be})=>{const{width:Ae,height:Se}=de.reference,Ce=ge.floating.style;Ce.setProperty("--radix-popper-available-width",`${Me}px`),Ce.setProperty("--radix-popper-available-height",`${Be}px`),Ce.setProperty("--radix-popper-anchor-width",`${Ae}px`),Ce.setProperty("--radix-popper-anchor-height",`${Se}px`)},"apply")}),M&&YT({element:M,padding:m}),oj({arrowWidth:I,arrowHeight:z}),v&&qT(Y?{strategy:"referenceHidden",...U}:{strategy:"referenceHidden",padding:U.padding,altBoundary:U.altBoundary})]}),N=T.setPlacementState;st(()=>(N(G),()=>{N(void 0)}),[G,N]);const[K,ne]=Cl(G),te=In(S);st(()=>{B&&te?.()},[B,te]);const le=Q.arrow?.x,oe=Q.arrow?.y,ae=Q.arrow?.centerOffset!==0,[xe,we]=E.useState();return st(()=>{j&&we(window.getComputedStyle(j).zIndex)},[j]),f.jsx("div",{ref:q.setFloating,"data-radix-popper-content-wrapper":"",style:{...P,transform:B?P.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:xe,"--radix-popper-transform-origin":[Q.transformOrigin?.x,Q.transformOrigin?.y].join(" "),...Q.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:r.dir,children:f.jsx(JT,{scope:a,placedSide:K,placedAlign:ne,onArrowChange:D,arrowX:le,arrowY:oe,shouldHideArrow:ae,children:f.jsx(ze.div,{"data-side":K,"data-align":ne,...w,ref:O,style:{...w.style,animation:B?w.style?.animation:"none"}})})})},"PopperContent")),tj="PopperArrow",nj={top:"bottom",right:"left",bottom:"top",left:"right"},rj=E.forwardRef(pr(function(r,i){const{__scopePopper:a,...c}=r,l=ej(tj,a),u=nj[l.placedSide];return f.jsx("span",{ref:l.onArrowChange,style:{position:"absolute",left:l.arrowX,top:l.arrowY,[u]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[l.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[l.placedSide],visibility:l.shouldHideArrow?"hidden":void 0},children:f.jsx(QT,{...c,ref:i,style:{...c.style,display:"block"}})})},"PopperArrow"));function iy(t){return t!==null}pr(iy,"isNotNull");var oj=pr(t=>({name:"transformOrigin",options:t,fn(r){const{placement:i,rects:a,middlewareData:c}=r,u=c.arrow?.centerOffset!==0,d=u?0:t.arrowWidth,m=u?0:t.arrowHeight,[p,C]=Cl(i),g={start:"0%",center:"50%",end:"100%"}[C],b=(c.arrow?.x??0)+d/2,v=(c.arrow?.y??0)+m/2;let x="",S="";return p==="bottom"?(x=u?g:`${b}px`,S=`${-m}px`):p==="top"?(x=u?g:`${b}px`,S=`${a.floating.height+m}px`):p==="right"?(x=`${-m}px`,S=u?g:`${v}px`):p==="left"&&(x=`${a.floating.width+m}px`,S=u?g:`${v}px`),{data:{x,y:S}}}}),"transformOrigin");function Cl(t){const[r,i="center"]=t.split("-");return[r,i]}pr(Cl,"getSideAndAlignFromPlacement");var aj=Object.defineProperty,xd=(t,r)=>aj(t,"name",{value:r,configurable:!0}),vd=!1;function sy(){const[t,r]=E.useState(vd);return E.useEffect(()=>{vd||(vd=!0,r(!0))},[]),t}xd(sy,"useIsHydrated");var ly=wo[" useSyncExternalStore ".trim().toString()];function cy(){return()=>{}}xd(cy,"subscribe");function uy(){return ly(cy,()=>!0,()=>!1)}xd(uy,"useIsHydratedModern");var ij=typeof ly=="function"?uy:sy,sj=Object.defineProperty,Oo=(t,r)=>sj(t,"name",{value:r,configurable:!0}),Sd="rovingFocusGroup.onEntryFocus",lj={bubbles:!1,cancelable:!0},wl="RovingFocusGroup",[Cd,dy,cj]=Zs(wl),[uj,fy]=Cn(wl,[cj]),hy={Vertical:"vertical",Horizontal:"horizontal"},dj={RTL:"rtl"},[fj,hj]=uj(wl),mj=E.forwardRef(Oo(function(r,i){return f.jsx(Cd.Provider,{scope:r.__scopeRovingFocusGroup,children:f.jsx(Cd.Slot,{scope:r.__scopeRovingFocusGroup,children:f.jsx(pj,{...r,ref:i})})})},"RovingFocusGroup")),pj=E.forwardRef(Oo(function(r,i){const{__scopeRovingFocusGroup:a,orientation:c,loop:l=!1,dir:u,currentTabStopId:d,defaultCurrentTabStopId:m,onCurrentTabStopIdChange:p,onEntryFocus:C,preventScrollOnEntryFocus:g=!1,...b}=r,v=E.useRef(null),x=De(i,v),S=Oi(u),[w,T]=ar({prop:d,defaultProp:m??null,onChange:p,caller:wl}),[j,R]=E.useState(!1),O=In(C),M=dy(a),D=E.useRef(!1),[_,I]=E.useState(0);return E.useEffect(()=>{const z=v.current;if(z)return z.addEventListener(Sd,O),()=>z.removeEventListener(Sd,O)},[O]),f.jsx(fj,{scope:a,orientation:c,dir:S,loop:l,currentTabStopId:w,onItemFocus:E.useCallback(z=>T(z),[T]),onItemShiftTab:E.useCallback(()=>R(!0),[]),onFocusableItemAdd:E.useCallback(()=>I(z=>z+1),[]),onFocusableItemRemove:E.useCallback(()=>I(z=>z-1),[]),children:f.jsx(ze.div,{tabIndex:j||_===0?-1:0,"data-orientation":c,...b,ref:x,style:{outline:"none",...r.style},onMouseDown:Ee(r.onMouseDown,()=>{D.current=!0}),onFocus:Ee(r.onFocus,z=>{const H=!D.current;if(z.target===z.currentTarget&&H&&!j){const L=new CustomEvent(Sd,lj);if(z.currentTarget.dispatchEvent(L),!L.defaultPrevented){const $=M().filter(G=>G.focusable),Y=$.find(G=>G.active),U=$.find(G=>G.id===w),P=[Y,U,...$].filter(Boolean).map(G=>G.ref.current);wd(P,g)}}D.current=!1}),onBlur:Ee(r.onBlur,()=>R(!1))})})},"RovingFocusGroupImpl")),gj="RovingFocusGroupItem",yj=E.forwardRef(Oo(function(r,i){const{__scopeRovingFocusGroup:a,focusable:c=!0,active:l=!1,tabStopId:u,children:d,...m}=r,p=sr(),C=u||p,g=hj(gj,a),b=g.currentTabStopId===C,v=dy(a),{onFocusableItemAdd:x,onFocusableItemRemove:S,currentTabStopId:w}=g,T=ij();return st(()=>{if(!(!T||!c))return x(),()=>S()},[T,c,x,S]),E.useEffect(()=>{if(!(T||!c))return x(),()=>S()},[T,c,x,S]),f.jsx(Cd.ItemSlot,{scope:a,id:C,focusable:c,active:l,children:f.jsx(ze.span,{tabIndex:b?0:-1,"data-orientation":g.orientation,...m,ref:i,onMouseDown:Ee(r.onMouseDown,j=>{c?g.onItemFocus(C):j.preventDefault()}),onFocus:Ee(r.onFocus,()=>g.onItemFocus(C)),onKeyDown:Ee(r.onKeyDown,j=>{if(j.key==="Tab"&&j.shiftKey){g.onItemShiftTab();return}if(j.target!==j.currentTarget)return;const R=py(j,g.orientation,g.dir);if(R!==void 0){if(j.metaKey||j.ctrlKey||j.altKey||j.shiftKey)return;j.preventDefault();let M=v().filter(D=>D.focusable).map(D=>D.ref.current);if(R==="last")M.reverse();else if(R==="prev"||R==="next"){R==="prev"&&M.reverse();const D=M.indexOf(j.currentTarget);M=g.loop?gy(M,D+1):M.slice(D+1)}setTimeout(()=>wd(M))}}),children:typeof d=="function"?d({isCurrentTabStop:b,hasTabStop:w!=null}):d})})},"RovingFocusGroupItem")),bj={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function my(t,r){return r!==dj.RTL?t:t==="ArrowLeft"?"ArrowRight":t==="ArrowRight"?"ArrowLeft":t}Oo(my,"getDirectionAwareKey");function py(t,r,i){const a=my(t.key,i);if(!(r===hy.Vertical&&["ArrowLeft","ArrowRight"].includes(a))&&!(r===hy.Horizontal&&["ArrowUp","ArrowDown"].includes(a)))return bj[a]}Oo(py,"getFocusIntent");function wd(t,r=!1){const i=document.activeElement;for(const a of t)if(a===i||(a.focus({preventScroll:r}),document.activeElement!==i))return}Oo(wd,"focusFirst");function gy(t,r){return t.map((i,a)=>t[(r+a)%t.length])}Oo(gy,"wrapArray");var xj=Object.defineProperty,vj=(t,r)=>xj(t,"name",{value:r,configurable:!0});function va(t,[r,i]){return Math.min(i,Math.max(r,t))}vj(va,"clamp");var Sj=Object.defineProperty,qt=(t,r)=>Sj(t,"name",{value:r,configurable:!0}),yy="Radio",[Cj,by]=Cn(yy),[wj,El]=Cj(yy);function xy(t){const{__scopeRadio:r,checked:i=!1,children:a,disabled:c,form:l,name:u,onCheck:d,required:m,value:p="on",internal_do_not_use_render:C}=t,[g,b]=E.useState(null),[v,x]=E.useState(null),[S,w]=E.useState(null),T=g?!!l||!!g.closest("form"):!0,j={checked:i,disabled:c,required:m,name:u,form:l,value:p,control:g,setControl:b,userClick:S,onUserClick:w,isFormControl:T,bubbleInput:v,setBubbleInput:x,onCheck:qt(()=>d?.(),"onCheck")};return f.jsx(wj,{scope:r,...j,children:vy(C)?C(j):a})}qt(xy,"RadioProvider");var Ej="RadioTrigger",Tj=E.forwardRef(qt(function({__scopeRadio:r,onClick:i,...a},c){const{checked:l,disabled:u,value:d,setControl:m,onCheck:p,onUserClick:C,isFormControl:g,bubbleInput:b}=El(Ej,r),v=De(c,m);return f.jsx(ze.button,{type:"button",role:"radio","aria-checked":l,"data-state":Ed(l),"data-disabled":u?"":void 0,disabled:u,value:d,...a,ref:v,onClick:Ee(i,x=>{const S=x.isPropagationStopped();l||(C({hasConsumerStoppedPropagation:S}),p()),b&&g&&(S||x.stopPropagation())})})},"RadioTrigger")),jj="RadioIndicator",Aj=E.forwardRef(qt(function(r,i){const{__scopeRadio:a,forceMount:c,...l}=r,u=El(jj,a);return f.jsx($r,{present:c||u.checked,children:f.jsx(ze.span,{"data-state":Ed(u.checked),"data-disabled":u.disabled?"":void 0,...l,ref:i})})},"RadioIndicator")),Rj="RadioBubbleInput",Oj=E.forwardRef(qt(function({__scopeRadio:r,onClick:i,...a},c){const{control:l,checked:u,required:d,disabled:m,name:p,value:C,form:g,bubbleInput:b,setBubbleInput:v,userClick:x}=El(Rj,r),S=De(c,v),w=Mi(l),T=E.useRef(!1),j=E.useRef(u),R=E.useRef(x),O=E.useRef(null);E.useEffect(()=>{const D=b;if(!D)return;const _=window.HTMLInputElement.prototype,z=Object.getOwnPropertyDescriptor(_,"checked").set;if(!z)return;const H=j.current!==u;j.current=u;const L=x!==null&&x!==R.current;if(R.current=x,L)O.current=H?null:x,H&&z.call(D,u),D.dispatchEvent(new Event("click",{bubbles:!x.hasConsumerStoppedPropagation}));else if(H){const $=O.current;O.current=null;const Y=u&&$!==null;T.current=!0,z.call(D,u),D.dispatchEvent(new Event("click",{bubbles:!(Y&&$.hasConsumerStoppedPropagation)})),T.current=!1}},[b,u,x]);const M=E.useRef(u);return f.jsx(ze.input,{type:"radio","aria-hidden":!0,defaultChecked:M.current,required:d,disabled:m,name:p,value:C,form:g,...a,tabIndex:-1,ref:S,onClick:Ee(i,D=>{T.current&&D.stopPropagation()}),style:{...a.style,...w,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})},"RadioBubbleInput"));function vy(t){return typeof t=="function"}qt(vy,"isFunction");function Ed(t){return t?"checked":"unchecked"}qt(Ed,"getState");var Nj=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],Td="RadioGroup",[Mj,_M]=Cn(Td,[fy,by]),Sy=fy(),Tl=by(),[_j,Dj]=Mj(Td),Ij=E.forwardRef(qt(function(r,i){const{__scopeRadioGroup:a,name:c,form:l,defaultValue:u,value:d,required:m=!1,disabled:p=!1,orientation:C,dir:g,loop:b=!0,onValueChange:v,...x}=r,S=Sy(a),w=Oi(g),[T,j]=ar({prop:d,defaultProp:u??null,onChange:v,caller:Td}),[R,O]=E.useState(null),M=De(i,O),D=E.useRef(T);return E.useEffect(()=>{const _=l?R?.ownerDocument.getElementById(l):R?.closest("form");if(_ instanceof HTMLFormElement){const I=qt(()=>j(D.current),"reset");return _.addEventListener("reset",I),()=>_.removeEventListener("reset",I)}},[R,l,j]),f.jsx(_j,{scope:a,name:c,form:l,required:m,disabled:p,value:T,onValueChange:j,children:f.jsx(mj,{asChild:!0,...S,orientation:C,dir:w,loop:b,children:f.jsx(ze.div,{role:"radiogroup","aria-required":m,"aria-orientation":C,"data-disabled":p?"":void 0,dir:w,...x,ref:M})})})},"RadioGroup")),kj="RadioGroupItemProvider",Lj="RadioGroupItemTrigger";function Cy(t){const{__scopeRadioGroup:r,value:i,disabled:a,children:c,internal_do_not_use_render:l}=t,u=Dj(kj,r),d=Tl(r),m=u.disabled||a;return f.jsx(xy,{...d,checked:u.value===i,disabled:m,required:u.required,name:u.name,form:u.form,value:i,onCheck:()=>u.onValueChange(i),internal_do_not_use_render:l,children:c})}qt(Cy,"RadioGroupItemProvider");var zj=E.forwardRef(qt(function(r,i){const{__scopeRadioGroup:a,...c}=r,l=Sy(a),u=Tl(a),{checked:d,disabled:m}=El(Lj,u.__scopeRadio),p=E.useRef(null),C=De(i,p),g=E.useRef(!1);return E.useEffect(()=>{const b=qt(x=>{Nj.includes(x.key)&&(g.current=!0)},"handleKeyDown"),v=qt(()=>g.current=!1,"handleKeyUp");return document.addEventListener("keydown",b),document.addEventListener("keyup",v),()=>{document.removeEventListener("keydown",b),document.removeEventListener("keyup",v)}},[]),f.jsx(yj,{asChild:!0,...l,focusable:!m,active:d,children:f.jsx(Tj,{...u,...c,ref:C,onKeyDown:Ee(c.onKeyDown,b=>{b.key==="Enter"&&b.preventDefault()}),onFocus:Ee(c.onFocus,()=>{g.current&&p.current?.click()})})})},"RadioGroupItemTrigger")),Bj=E.forwardRef(qt(function(r,i){const{__scopeRadioGroup:a,value:c,disabled:l,...u}=r;return f.jsx(Cy,{__scopeRadioGroup:a,value:c,disabled:l,internal_do_not_use_render:({isFormControl:d})=>f.jsxs(f.Fragment,{children:[f.jsx(zj,{...u,ref:i,__scopeRadioGroup:a}),d&&f.jsx(Hj,{__scopeRadioGroup:a})]})})},"RadioGroupItem")),Hj=E.forwardRef(qt(function(r,i){const{__scopeRadioGroup:a,...c}=r,l=Tl(a);return f.jsx(Oj,{...l,...c,ref:i})},"RadioGroupItemBubbleInput")),Pj=E.forwardRef(qt(function(r,i){const{__scopeRadioGroup:a,...c}=r,l=Tl(a);return f.jsx(Aj,{...l,...c,ref:i})},"RadioGroupIndicator")),Uj=Object.defineProperty,Ue=(t,r)=>Uj(t,"name",{value:r,configurable:!0}),wy={ItemAligned:"item-aligned",Popper:"popper"},$j={RTL:"rtl"},Gj=[" ","Enter","ArrowUp","ArrowDown"],Vj=[" ","Enter"],Sa="Select",[jl,Al,qj]=Zs(Sa),[No,DM]=Cn(Sa,[qj,Sl]),jd=Sl(),[Yj,Yr]=No(Sa),[Xj,Kj]=No(Sa);function Ey(t){const{__scopeSelect:r,children:i,open:a,defaultOpen:c,onOpenChange:l,value:u,defaultValue:d,onValueChange:m,dir:p,name:C,autoComplete:g,disabled:b,required:v,form:x,internal_do_not_use_render:S}=t,w=jd(r),[T,j]=E.useState(null),[R,O]=E.useState(null),[M,D]=E.useState(!1),_=Oi(p),[I,z]=ar({prop:a,defaultProp:c??!1,onChange:l,caller:Sa}),[H,L]=ar({prop:u,defaultProp:d,onChange:m,caller:Sa}),$=E.useRef(null),Y=E.useRef(!1),[U,q]=E.useState(null),P=Ue(ae=>{q({value:ae,hasConsumerStoppedPropagation:Y.current}),L(ae)},"handleUserSelect"),G=E.useRef(H);E.useEffect(()=>{const ae=x?T?.ownerDocument.getElementById(x):T?.form;if(ae instanceof HTMLFormElement){const xe=Ue(()=>L(G.current),"reset");return ae.addEventListener("reset",xe),()=>ae.removeEventListener("reset",xe)}},[x,T,L]);const B=T?!!x||!!T.closest("form"):!0,[Q,N]=E.useState(new Set),K=sr(),ne=Array.from(Q).map(ae=>ae.props.value).join(";"),te=E.useCallback(ae=>{N(xe=>new Set(xe).add(ae))},[]),le=E.useCallback(ae=>{N(xe=>{const we=new Set(xe);return we.delete(ae),we})},[]),oe={required:v,trigger:T,onTriggerChange:j,valueNode:R,onValueNodeChange:O,valueNodeHasChildren:M,onValueNodeHasChildrenChange:D,contentId:K,value:H,onValueChange:L,hasConsumerStoppedPropagationRef:Y,userSelection:U,onUserSelect:P,open:I,onOpenChange:z,dir:_,triggerPointerDownPosRef:$,disabled:b,name:C,autoComplete:g,form:x,nativeOptions:Q,nativeSelectKey:ne,isFormControl:B};return f.jsx(ny,{...w,children:f.jsx(Yj,{scope:r,...oe,children:f.jsx(jl.Provider,{scope:r,children:f.jsx(Xj,{scope:r,onNativeOptionAdd:te,onNativeOptionRemove:le,children:_y(S)?S(oe):i})})})})}Ue(Ey,"SelectProvider");var Qj=Ue(t=>{const{__scopeSelect:r,children:i,...a}=t;return f.jsx(Ey,{__scopeSelect:r,...a,internal_do_not_use_render:({isFormControl:c})=>f.jsxs(f.Fragment,{children:[i,c?f.jsx(j2,{__scopeSelect:r}):null]})})},"Select"),Fj="SelectTrigger",Zj=E.forwardRef(Ue(function(r,i){const{__scopeSelect:a,disabled:c=!1,...l}=r,u=jd(a),d=Yr(Fj,a),m=d.disabled||c,p=De(i,d.onTriggerChange),C=Al(a),g=E.useRef("touch"),[b,v,x]=Od(w=>{const T=C().filter(O=>!O.disabled),j=T.find(O=>O.value===d.value),R=Nd(T,w,j);R!==void 0&&d.onUserSelect(R.value)}),S=Ue(w=>{m||(d.onOpenChange(!0),x()),w&&(d.triggerPointerDownPosRef.current={x:Math.round(w.pageX),y:Math.round(w.pageY)})},"handleOpen");return f.jsx(ry,{asChild:!0,...u,children:f.jsx(ze.button,{type:"button",role:"combobox","aria-controls":d.open?d.contentId:void 0,"aria-expanded":d.open,"aria-required":d.required,"aria-autocomplete":"none",dir:d.dir,"data-state":d.open?"open":"closed",disabled:m,"data-disabled":m?"":void 0,"data-placeholder":Ii(d.value)?"":void 0,...l,ref:p,onClick:Ee(l.onClick,w=>{w.currentTarget.focus(),g.current!=="mouse"&&S(w)}),onPointerDown:Ee(l.onPointerDown,w=>{g.current=w.pointerType;const T=w.target;T.hasPointerCapture(w.pointerId)&&T.releasePointerCapture(w.pointerId),w.button===0&&w.ctrlKey===!1&&w.pointerType==="mouse"&&(S(w),w.preventDefault())}),onKeyDown:Ee(l.onKeyDown,w=>{const T=b.current!=="";!(w.ctrlKey||w.altKey||w.metaKey)&&w.key.length===1&&(d.hasConsumerStoppedPropagationRef.current=w.isPropagationStopped(),v(w.key)),!(T&&w.key===" ")&&Gj.includes(w.key)&&(S(),w.preventDefault())})})})},"SelectTrigger")),Wj="SelectValue",Jj=E.forwardRef(Ue(function(r,i){const{__scopeSelect:a,className:c,style:l,children:u,placeholder:d="",...m}=r,p=Yr(Wj,a),{onValueNodeHasChildrenChange:C}=p,g=u!==void 0,b=De(i,p.onValueNodeChange);st(()=>{C(g)},[C,g]);const v=Ii(p.value);return f.jsx(ze.span,{...m,asChild:v?!1:m.asChild,ref:b,style:{pointerEvents:"none"},children:f.jsx(E.Fragment,{children:v?d:u},v?"placeholder":"value")})},"SelectValue")),e2=E.forwardRef(Ue(function(r,i){const{__scopeSelect:a,children:c,...l}=r;return f.jsx(ze.span,{"aria-hidden":!0,...l,ref:i,children:c||"▼"})},"SelectIcon")),t2="SelectPortal",[n2,r2]=No(t2,{forceMount:void 0}),o2=Ue(t=>{const{__scopeSelect:r,forceMount:i,...a}=t;return f.jsx(n2,{scope:t.__scopeSelect,forceMount:i,children:f.jsx(Yu,{asChild:!0,...a})})},"SelectPortal"),Mo="SelectContent",a2=E.forwardRef(Ue(function(r,i){const a=r2(Mo,r.__scopeSelect),{forceMount:c=a.forceMount,...l}=r,u=Yr(Mo,r.__scopeSelect),[d,m]=E.useState();return st(()=>{m(new DocumentFragment)},[]),f.jsx($r,{present:c||u.open,children:({present:p})=>p?f.jsx(l2,{...l,ref:i}):f.jsx(i2,{...l,fragment:d})})},"SelectContent")),i2=E.forwardRef(Ue(function(r,i){const{__scopeSelect:a,children:c,fragment:l}=r;return l?Hr.createPortal(f.jsx(Ty,{scope:a,children:f.jsx(jl.Slot,{scope:a,children:f.jsx("div",{ref:i,children:c})})}),l):null},"SelectContentFragment")),kn=10,[Ty,_o]=No(Mo),s2=or("SelectContent.RemoveScroll"),l2=E.forwardRef(Ue(function(r,i){const{__scopeSelect:a}=r,{position:c=wy.ItemAligned,onCloseAutoFocus:l,onEscapeKeyDown:u,onPointerDownOutside:d,side:m,sideOffset:p,align:C,alignOffset:g,arrowPadding:b,collisionBoundary:v,collisionPadding:x,sticky:S,hideWhenDetached:w,avoidCollisions:T,...j}=r,R=Yr(Mo,a),[O,M]=E.useState(null),[D,_]=E.useState(null),I=De(i,M),[z,H]=E.useState(null),[L,$]=E.useState(null),Y=Al(a),[U,q]=E.useState(!1),P=E.useRef(!1),G=E.useRef(!1),B=E.useRef(!1);E.useEffect(()=>{if(O)return Cg(O)},[O]),nl();const Q=E.useCallback(de=>{const[Me,...Be]=Y().map(Ce=>Ce.ref.current),[Ae]=Be.slice(-1),Se=document.activeElement;for(const Ce of de)if(Ce===Se||(Ce?.scrollIntoView({block:"nearest"}),Ce===Me&&D&&(D.scrollTop=0),Ce===Ae&&D&&(D.scrollTop=D.scrollHeight),Ce?.focus(),document.activeElement!==Se))return},[Y,D]),N=E.useCallback(()=>Q([z,O]),[Q,z,O]);E.useEffect(()=>{U&&N()},[U,N]);const{onOpenChange:K,triggerPointerDownPosRef:ne}=R;E.useEffect(()=>{if(O){let de={x:0,y:0};const Me=Ue(Ae=>{de={x:Math.abs(Math.round(Ae.pageX)-(ne.current?.x??0)),y:Math.abs(Math.round(Ae.pageY)-(ne.current?.y??0))}},"handlePointerMove"),Be=Ue(Ae=>{de.x<=10&&de.y<=10?Ae.preventDefault():Ae.composedPath().includes(O)||K(!1),document.removeEventListener("pointermove",Me),ne.current=null},"handlePointerUp");return ne.current!==null&&(document.addEventListener("pointermove",Me),document.addEventListener("pointerup",Be,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",Me),document.removeEventListener("pointerup",Be,{capture:!0})}}},[O,K,ne]),E.useEffect(()=>{const de=Ue(()=>K(!1),"close");return window.addEventListener("blur",de),window.addEventListener("resize",de),()=>{window.removeEventListener("blur",de),window.removeEventListener("resize",de)}},[K]);const[te,le]=Od(de=>{const Me=Y().filter(Se=>!Se.disabled),Be=Me.find(Se=>Se.ref.current===document.activeElement),Ae=Nd(Me,de,Be);Ae&&setTimeout(()=>Ae.ref.current?.focus())}),oe=E.useCallback((de,Me,Be)=>{const Ae=!G.current;Ae&&(G.current=!0);const Se=!P.current&&!Be;R.value!==void 0&&R.value===Me||Se?(H(de),Se&&(P.current=!0)):Ae&&H(de)},[R.value]),ae=E.useCallback(()=>O?.focus(),[O]),xe=E.useCallback((de,Me,Be)=>{if(!de)return;const Ae=!B.current;Ae&&(B.current=!0);const Se=!P.current&&!Be;(R.value!==void 0&&R.value===Me||Se||Ae)&&$(de)},[R.value]),we=c===wy.Popper?jy:c2,ge=we===jy?{side:m,sideOffset:p,align:C,alignOffset:g,arrowPadding:b,collisionBoundary:v,collisionPadding:x,sticky:S,hideWhenDetached:w,avoidCollisions:T}:{};return f.jsx(Ty,{scope:a,content:O,viewport:D,onViewportChange:_,itemRefCallback:oe,selectedItem:z,onItemLeave:ae,itemTextRefCallback:xe,focusSelectedItem:N,selectedItemText:L,position:c,isPositioned:U,searchRef:te,children:f.jsx(Ju,{as:s2,allowPinchZoom:!0,children:f.jsx(Zp,{asChild:!0,trapped:R.open,onMountAutoFocus:de=>{de.preventDefault()},onUnmountAutoFocus:Ee(l,de=>{R.trigger?.focus({preventScroll:!0}),de.preventDefault()}),children:f.jsx(Bu,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:u,onPointerDownOutside:d,onFocusOutside:de=>de.preventDefault(),onDismiss:()=>R.onOpenChange(!1),children:f.jsx(we,{role:"listbox",id:R.contentId,"data-state":R.open?"open":"closed",dir:R.dir,onContextMenu:de=>de.preventDefault(),...j,...ge,onPlaced:()=>q(!0),ref:I,style:{display:"flex",flexDirection:"column",outline:"none",...j.style},onKeyDown:Ee(j.onKeyDown,de=>{const Me=de.ctrlKey||de.altKey||de.metaKey;if(de.key==="Tab"&&de.preventDefault(),!Me&&de.key.length===1&&le(de.key),["ArrowUp","ArrowDown","Home","End"].includes(de.key)){let Ae=Y().filter(Se=>!Se.disabled).map(Se=>Se.ref.current);if(["ArrowUp","End"].includes(de.key)&&(Ae=Ae.slice().reverse()),["ArrowUp","ArrowDown"].includes(de.key)){const Se=de.target,Ce=Ae.indexOf(Se);Ae=Ae.slice(Ce+1)}setTimeout(()=>Q(Ae)),de.preventDefault()}})})})})})})},"SelectContentImpl")),c2=E.forwardRef(Ue(function(r,i){const{__scopeSelect:a,onPlaced:c,...l}=r,u=Yr(Mo,a),d=_o(Mo,a),[m,p]=E.useState(null),[C,g]=E.useState(null),b=De(i,g),v=Al(a),x=E.useRef(!1),S=E.useRef(!0),{viewport:w,selectedItem:T,selectedItemText:j,focusSelectedItem:R}=d,O=E.useCallback(()=>{if(u.trigger&&u.valueNode&&m&&C&&w&&T&&j){const I=u.trigger.getBoundingClientRect(),z=C.getBoundingClientRect(),H=u.valueNode.getBoundingClientRect(),L=j.getBoundingClientRect();if(u.dir!==$j.RTL){const Be=L.left-z.left,Ae=H.left-Be,Se=I.left-Ae,Ce=I.width+Se,Ot=Math.max(Ce,z.width),dt=window.innerWidth-kn,be=va(Ae,[kn,Math.max(kn,dt-Ot)]);m.style.minWidth=Ce+"px",m.style.left=be+"px"}else{const Be=z.right-L.right,Ae=window.innerWidth-H.right-Be,Se=window.innerWidth-I.right-Ae,Ce=I.width+Se,Ot=Math.max(Ce,z.width),dt=window.innerWidth-kn,be=va(Ae,[kn,Math.max(kn,dt-Ot)]);m.style.minWidth=Ce+"px",m.style.right=be+"px"}const $=v(),Y=window.innerHeight-kn*2,U=w.scrollHeight,q=window.getComputedStyle(C),P=parseInt(q.borderTopWidth,10),G=parseInt(q.paddingTop,10),B=parseInt(q.borderBottomWidth,10),Q=parseInt(q.paddingBottom,10),N=P+G+U+Q+B,K=Math.min(T.offsetHeight*5,N),ne=window.getComputedStyle(w),te=parseInt(ne.paddingTop,10),le=parseInt(ne.paddingBottom,10),oe=I.top+I.height/2-kn,ae=Y-oe,xe=T.offsetHeight/2,we=T.offsetTop+xe,ge=P+G+we,de=N-ge;if(ge<=oe){const Be=$.length>0&&T===$[$.length-1].ref.current;m.style.bottom="0px";const Ae=C.clientHeight-w.offsetTop-w.offsetHeight,Se=Math.max(ae,xe+(Be?le:0)+Ae+B),Ce=ge+Se;m.style.height=Ce+"px"}else{const Be=$.length>0&&T===$[0].ref.current;m.style.top="0px";const Se=Math.max(oe,P+w.offsetTop+(Be?te:0)+xe)+de;m.style.height=Se+"px",w.scrollTop=ge-oe+w.offsetTop}m.style.margin=`${kn}px 0`,m.style.minHeight=K+"px",m.style.maxHeight=Y+"px",c?.(),requestAnimationFrame(()=>x.current=!0)}},[v,u.trigger,u.valueNode,m,C,w,T,j,u.dir,c]);st(()=>O(),[O]);const[M,D]=E.useState();st(()=>{C&&D(window.getComputedStyle(C).zIndex)},[C]);const _=E.useCallback(I=>{I&&S.current===!0&&(O(),R?.(),S.current=!1)},[O,R]);return f.jsx(u2,{scope:a,contentWrapper:m,shouldExpandOnScrollRef:x,onScrollButtonChange:_,children:f.jsx("div",{ref:p,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:M},children:f.jsx(ze.div,{...l,ref:b,style:{boxSizing:"border-box",maxHeight:"100%",...l.style}})})})},"SelectItemAlignedPosition")),jy=E.forwardRef(Ue(function(r,i){const{__scopeSelect:a,align:c="start",collisionPadding:l=kn,...u}=r,d=jd(a);return f.jsx(ay,{...d,...u,ref:i,align:c,collisionPadding:l,style:{boxSizing:"border-box",...u.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})},"SelectPopperPosition")),[u2,Ad]=No(Mo,{}),Ay="SelectViewport",d2=E.forwardRef(Ue(function(r,i){const{__scopeSelect:a,nonce:c,...l}=r,u=_o(Ay,a),d=Ad(Ay,a),m=De(i,u.onViewportChange),p=E.useRef(0);return f.jsxs(f.Fragment,{children:[f.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:c}),f.jsx(jl.Slot,{scope:a,children:f.jsx(ze.div,{"data-radix-select-viewport":"",role:"presentation",...l,ref:m,style:{position:"relative",flex:1,overflow:"hidden auto",...l.style},onScroll:Ee(l.onScroll,C=>{const g=C.currentTarget,{contentWrapper:b,shouldExpandOnScrollRef:v}=d;if(v?.current&&b){const x=Math.abs(p.current-g.scrollTop);if(x>0){const S=window.innerHeight-kn*2,w=parseFloat(b.style.minHeight),T=parseFloat(b.style.height),j=Math.max(w,T);if(j<S){const R=j+x,O=Math.min(S,R),M=R-O;b.style.height=O+"px",b.style.bottom==="0px"&&(g.scrollTop=M>0?M:0,b.style.justifyContent="flex-end")}}}p.current=g.scrollTop})})})]})},"SelectViewport")),f2="SelectGroup",[h2,m2]=No(f2),p2=E.forwardRef(Ue(function(r,i){const{__scopeSelect:a,...c}=r,l=sr();return f.jsx(h2,{scope:a,id:l,children:f.jsx(ze.div,{role:"group","aria-labelledby":l,...c,ref:i})})},"SelectGroup")),g2="SelectLabel",y2=E.forwardRef(Ue(function(r,i){const{__scopeSelect:a,...c}=r,l=m2(g2,a);return f.jsx(ze.div,{id:l.id,...c,ref:i})},"SelectLabel")),Rd="SelectItem",[b2,Ry]=No(Rd),x2=E.forwardRef(Ue(function(r,i){const{__scopeSelect:a,value:c,disabled:l=!1,textValue:u,...d}=r,m=Yr(Rd,a),p=_o(Rd,a),C=m.value===c,[g,b]=E.useState(u??""),[v,x]=E.useState(!1),S=In(O=>p.itemRefCallback?.(O,c,l)),w=De(i,S),T=sr(),j=E.useRef("touch");function R(O){m.hasConsumerStoppedPropagationRef.current=O.isPropagationStopped(),m.onUserSelect(c),m.onOpenChange(!1)}return Ue(R,"handleSelect"),f.jsx(b2,{scope:a,value:c,disabled:l,textId:T,isSelected:C,onItemTextChange:E.useCallback(O=>{b(M=>M||(O?.textContent??"").trim())},[]),children:f.jsx(jl.ItemSlot,{scope:a,value:c,disabled:l,textValue:g,children:f.jsx(ze.div,{role:"option","aria-labelledby":T,"data-highlighted":v?"":void 0,"aria-selected":C&&v,"data-state":C?"checked":"unchecked","aria-disabled":l||void 0,"data-disabled":l?"":void 0,tabIndex:l?void 0:-1,...d,ref:w,onFocus:Ee(d.onFocus,()=>x(!0)),onBlur:Ee(d.onBlur,()=>x(!1)),onClick:Ee(d.onClick,O=>{l||j.current!=="mouse"&&R(O)}),onPointerUp:Ee(d.onPointerUp,O=>{l||j.current==="mouse"&&R(O)}),onPointerDown:Ee(d.onPointerDown,O=>{j.current=O.pointerType}),onPointerMove:Ee(d.onPointerMove,O=>{j.current=O.pointerType,l?p.onItemLeave?.():j.current==="mouse"&&O.currentTarget.focus({preventScroll:!0})}),onPointerLeave:Ee(d.onPointerLeave,O=>{O.currentTarget===document.activeElement&&p.onItemLeave?.()}),onKeyDown:Ee(d.onKeyDown,O=>{l||O.target!==O.currentTarget||p.searchRef?.current!==""&&O.key===" "||(Vj.includes(O.key)&&R(O),O.key===" "&&O.preventDefault())})})})})},"SelectItem")),Rl="SelectItemText",v2=E.forwardRef(Ue(function(r,i){const{__scopeSelect:a,className:c,style:l,...u}=r,d=Yr(Rl,a),m=_o(Rl,a),p=Ry(Rl,a),C=Kj(Rl,a),[g,b]=E.useState(null),v=In(R=>m.itemTextRefCallback?.(R,p.value,p.disabled)),x=De(i,b,p.onItemTextChange,v),S=g?.textContent,w=E.useMemo(()=>f.jsx("option",{value:p.value,disabled:p.disabled,children:S},p.value),[p.disabled,p.value,S]),{onNativeOptionAdd:T,onNativeOptionRemove:j}=C;return st(()=>(T(w),()=>j(w)),[T,j,w]),f.jsxs(f.Fragment,{children:[f.jsx(ze.span,{id:p.textId,...u,ref:x}),p.isSelected&&d.valueNode&&!d.valueNodeHasChildren&&!Ii(d.value)?Hr.createPortal(u.children,d.valueNode):null]})},"SelectItemText")),S2="SelectItemIndicator",C2=E.forwardRef(Ue(function(r,i){const{__scopeSelect:a,...c}=r;return Ry(S2,a).isSelected?f.jsx(ze.span,{"aria-hidden":!0,...c,ref:i}):null},"SelectItemIndicator")),Oy="SelectScrollUpButton",w2=E.forwardRef(Ue(function(r,i){const a=_o(Oy,r.__scopeSelect),c=Ad(Oy,r.__scopeSelect),[l,u]=E.useState(!1),d=De(i,c.onScrollButtonChange);return st(()=>{if(a.viewport&&a.isPositioned){let m=function(){const C=p.scrollTop>0;u(C)};Ue(m,"handleScroll");const p=a.viewport;return m(),p.addEventListener("scroll",m),()=>p.removeEventListener("scroll",m)}},[a.viewport,a.isPositioned]),l?f.jsx(My,{...r,ref:d,onAutoScroll:()=>{const{viewport:m,selectedItem:p}=a;m&&p&&(m.scrollTop=m.scrollTop-p.offsetHeight)}}):null},"SelectScrollUpButton")),Ny="SelectScrollDownButton",E2=E.forwardRef(Ue(function(r,i){const a=_o(Ny,r.__scopeSelect),c=Ad(Ny,r.__scopeSelect),[l,u]=E.useState(!1),d=De(i,c.onScrollButtonChange);return st(()=>{if(a.viewport&&a.isPositioned){let m=function(){const C=p.scrollHeight-p.clientHeight,g=Math.ceil(p.scrollTop)<C;u(g)};Ue(m,"handleScroll");const p=a.viewport;return m(),p.addEventListener("scroll",m),()=>p.removeEventListener("scroll",m)}},[a.viewport,a.isPositioned]),l?f.jsx(My,{...r,ref:d,onAutoScroll:()=>{const{viewport:m,selectedItem:p}=a;m&&p&&(m.scrollTop=m.scrollTop+p.offsetHeight)}}):null},"SelectScrollDownButton")),My=E.forwardRef(Ue(function(r,i){const{__scopeSelect:a,onAutoScroll:c,...l}=r,u=_o("SelectScrollButton",a),d=E.useRef(null),m=Al(a),p=E.useCallback(()=>{d.current!==null&&(window.clearInterval(d.current),d.current=null)},[]);return E.useEffect(()=>()=>p(),[p]),st(()=>{m().find(g=>g.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[m]),f.jsx(ze.div,{"aria-hidden":!0,...l,ref:i,style:{flexShrink:0,...l.style},onPointerDown:Ee(l.onPointerDown,()=>{d.current===null&&(d.current=window.setInterval(c,50))}),onPointerMove:Ee(l.onPointerMove,()=>{u.onItemLeave?.(),d.current===null&&(d.current=window.setInterval(c,50))}),onPointerLeave:Ee(l.onPointerLeave,()=>{p()})})},"SelectScrollButtonImpl")),T2="SelectBubbleInput",j2=E.forwardRef(Ue(function({__scopeSelect:r,...i},a){const c=Yr(T2,r),{value:l,onValueChange:u,required:d,disabled:m,name:p,autoComplete:C,form:g,userSelection:b}=c,{nativeOptions:v,nativeSelectKey:x}=c,S=E.useRef(null),w=De(a,S),T=l??"",j=E.useRef(T),R=E.useRef(b),O=E.useRef(!1),M=Array.from(v).some(D=>(D.props.value??"")==="");return E.useEffect(()=>{const D=S.current;if(!D)return;const _=window.HTMLSelectElement.prototype,z=Object.getOwnPropertyDescriptor(_,"value").set,H=b!==null&&b!==R.current;R.current=b;const L=j.current!==T;j.current=T;const $=H&&L;if(H&&!L&&b.value!==T&&!b.hasConsumerStoppedPropagation&&z){O.current=!0;try{z.call(D,b.value),D.dispatchEvent(new Event("change",{bubbles:!0}))}finally{O.current=!1,z.call(D,T)}return}const Y=$&&!b.hasConsumerStoppedPropagation;if(L&&z){const U=new Event("change",{bubbles:Y});z.call(D,T),D.dispatchEvent(U)}},[T,b]),f.jsxs(ze.select,{"aria-hidden":!0,required:d,tabIndex:-1,name:p,autoComplete:C,disabled:m,form:g,onChange:D=>{O.current||u(D.target.value)},...i,style:{...wp,...i.style},ref:w,defaultValue:T,children:[Ii(l)&&!M?f.jsx("option",{value:""}):null,Array.from(v)]},x)},"SelectBubbleInput"));function _y(t){return typeof t=="function"}Ue(_y,"isFunction");function Ii(t){return t===""||t===void 0}Ue(Ii,"shouldShowPlaceholder");function Od(t){const r=In(t),i=E.useRef(""),a=E.useRef(0),c=E.useCallback(u=>{const d=i.current+u;r(d);function m(p){i.current=p,window.clearTimeout(a.current),p!==""&&(a.current=window.setTimeout(()=>m(""),1e3))}Ue(m,"updateSearch"),m(d)},[r]),l=E.useCallback(()=>{i.current="",window.clearTimeout(a.current)},[]);return E.useEffect(()=>()=>window.clearTimeout(a.current),[]),[i,c,l]}Ue(Od,"useTypeaheadSearch");function Nd(t,r,i){const c=r.length>1&&Array.from(r).every(p=>p===r[0])?r[0]:r,l=i?t.indexOf(i):-1;let u=Dy(t,Math.max(l,0));c.length===1&&(u=u.filter(p=>p!==i));const m=u.find(p=>p.textValue.toLowerCase().startsWith(c.toLowerCase()));return m!==i?m:void 0}Ue(Nd,"findNextItem");function Dy(t,r){return t.map((i,a)=>t[(r+a)%t.length])}Ue(Dy,"wrapArray");var A2=Object.defineProperty,qe=(t,r)=>A2(t,"name",{value:r,configurable:!0}),Iy={Horizontal:"horizontal"},R2={LTR:"ltr"},ky=["PageUp","PageDown"],Ly=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],zy={"from-left":["Home","PageDown","ArrowDown","ArrowLeft"],"from-right":["Home","PageDown","ArrowDown","ArrowRight"],"from-bottom":["Home","PageDown","ArrowDown","ArrowLeft"],"from-top":["Home","PageDown","ArrowUp","ArrowLeft"]},ki="Slider",[Md,O2,N2]=Zs(ki),[_d,IM]=Cn(ki,[N2]),[M2,Ca]=_d(ki),_2=E.forwardRef(qe(function(r,i){const{name:a,min:c=0,max:l=100,step:u=1,orientation:d=Iy.Horizontal,disabled:m=!1,minStepsBetweenThumbs:p=0,preserveThumbOrder:C=!1,defaultValue:g=[c],value:b,onValueChange:v=qe(()=>{},"onValueChange"),onValueCommit:x=qe(()=>{},"onValueCommit"),inverted:S=!1,form:w,...T}=r,j=E.useRef(new Set),R=E.useRef(0),O=E.useRef(!1),[M,D]=E.useState(null),I=d===Iy.Horizontal?D2:I2,[z,H]=E.useState(null),L=De(i,H),[$=[],Y]=ar({prop:b,defaultProp:g,onChange:qe(N=>{[...j.current][R.current]?.focus({preventScroll:!0,focusVisible:O.current}),O.current=!1,v(N)},"onChange")}),U=E.useRef($),q=E.useRef($);E.useEffect(()=>{const N=w?z?.ownerDocument.getElementById(w):z?.closest("form");if(N instanceof HTMLFormElement){const K=qe(()=>Y(q.current),"reset");return N.addEventListener("reset",K),()=>N.removeEventListener("reset",K)}},[z,w,Y]);function P(N){const K=Xy($,N);Q(N,K)}qe(P,"handleSlideStart");function G(N){Q(N,R.current)}qe(G,"handleSlideMove");function B(){String($)!==String(U.current)&&x($)}qe(B,"handleSlideEnd");function Q(N,K,{commit:ne}={commit:!1}){const te=kd(u),le=Li(Math.round((N-c)/u)*u+c,te),oe=va(le,[c,l]),ae=p*u;function xe(ge){const de=C?va(oe,[ge[K-1]===void 0?c:ge[K-1]+ae,ge[K+1]===void 0?l:ge[K+1]-ae]):oe,Me=qy(ge,de,K);return Fy(Me,ae)?{nextValues:Me,changedIndex:C?K:Me.indexOf(de),hasChanged:String(Me)!==String(ge)}:null}qe(xe,"getNextValues");const we=xe($);we?.hasChanged&&D(we.nextValues),Y((ge=[])=>{const de=xe(ge);return de?(R.current=de.changedIndex,de.hasChanged&&ne&&x(de.nextValues),de.hasChanged?de.nextValues:ge):ge})}return qe(Q,"updateValues"),f.jsx(M2,{scope:r.__scopeSlider,name:a,disabled:m,min:c,max:l,valueIndexToChangeRef:R,thumbs:j.current,values:$,orientation:d,form:w,userRequestedValues:M,children:f.jsx(Md.Provider,{scope:r.__scopeSlider,children:f.jsx(Md.Slot,{scope:r.__scopeSlider,children:f.jsx(I,{"aria-disabled":m,"data-disabled":m?"":void 0,...T,ref:L,onPointerDown:Ee(T.onPointerDown,()=>{m||(U.current=$,O.current=!1)}),min:c,max:l,inverted:S,onSlideStart:m?void 0:P,onSlideMove:m?void 0:G,onSlideEnd:m?void 0:B,onHomeKeyDown:()=>{m||(O.current=!0,Q(c,0,{commit:!0}))},onEndKeyDown:()=>{m||(O.current=!0,Q(l,$.length-1,{commit:!0}))},onStepKeyDown:({event:N,direction:K})=>{if(!m){O.current=!0;const le=ky.includes(N.key)||N.shiftKey&&Ly.includes(N.key)?10:1,oe=R.current,ae=$[oe],xe=Zy(ae,{min:c,step:u,direction:K,multiplier:le});Q(xe,oe,{commit:!0})}}})})})})},"Slider")),[By,Hy]=_d(ki,{startEdge:"left",endEdge:"right",size:"width",direction:1}),D2=E.forwardRef(qe(function(r,i){const{min:a,max:c,dir:l,inverted:u,onSlideStart:d,onSlideMove:m,onSlideEnd:p,onStepKeyDown:C,...g}=r,[b,v]=E.useState(null),x=De(i,v),S=E.useRef(void 0),w=Oi(l),T=w===R2.LTR,j=T&&!u||!T&&u;function R(O){const M=S.current||b.getBoundingClientRect(),D=[0,M.width],I=Ol(D,j?[a,c]:[c,a]);return S.current=M,I(O-M.left)}return qe(R,"getValueFromPointer"),f.jsx(By,{scope:r.__scopeSlider,startEdge:j?"left":"right",endEdge:j?"right":"left",direction:j?1:-1,size:"width",children:f.jsx(Py,{dir:w,"data-orientation":"horizontal",...g,ref:x,style:{...g.style,"--radix-slider-thumb-transform":"translateX(-50%)"},onSlideStart:O=>{const M=R(O.clientX);d?.(M)},onSlideMove:O=>{const M=R(O.clientX);m?.(M)},onSlideEnd:()=>{S.current=void 0,p?.()},onStepKeyDown:O=>{const D=zy[j?"from-left":"from-right"].includes(O.key);C?.({event:O,direction:D?-1:1})}})})},"SliderHorizontal")),I2=E.forwardRef(qe(function(r,i){const{min:a,max:c,inverted:l,onSlideStart:u,onSlideMove:d,onSlideEnd:m,onStepKeyDown:p,...C}=r,g=E.useRef(null),b=De(i,g),v=E.useRef(void 0),x=!l;function S(w){const T=v.current||g.current.getBoundingClientRect(),j=[0,T.height],O=Ol(j,x?[c,a]:[a,c]);return v.current=T,O(w-T.top)}return qe(S,"getValueFromPointer"),f.jsx(By,{scope:r.__scopeSlider,startEdge:x?"bottom":"top",endEdge:x?"top":"bottom",size:"height",direction:x?1:-1,children:f.jsx(Py,{"data-orientation":"vertical",...C,ref:b,style:{...C.style,"--radix-slider-thumb-transform":"translateY(50%)"},onSlideStart:w=>{const T=S(w.clientY);u?.(T)},onSlideMove:w=>{const T=S(w.clientY);d?.(T)},onSlideEnd:()=>{v.current=void 0,m?.()},onStepKeyDown:w=>{const j=zy[x?"from-bottom":"from-top"].includes(w.key);p?.({event:w,direction:j?-1:1})}})})},"SliderVertical")),Py=E.forwardRef(qe(function(r,i){const{__scopeSlider:a,onSlideStart:c,onSlideMove:l,onSlideEnd:u,onHomeKeyDown:d,onEndKeyDown:m,onStepKeyDown:p,...C}=r,g=Ca(ki,a);return f.jsx(ze.span,{...C,ref:i,onKeyDown:Ee(r.onKeyDown,b=>{b.key==="Home"?(d(b),b.preventDefault()):b.key==="End"?(m(b),b.preventDefault()):ky.concat(Ly).includes(b.key)&&(p(b),b.preventDefault())}),onPointerDown:Ee(r.onPointerDown,b=>{const v=b.target;v.setPointerCapture(b.pointerId),b.preventDefault(),g.thumbs.has(v)?v.focus({preventScroll:!0,focusVisible:!1}):c(b)}),onPointerMove:Ee(r.onPointerMove,b=>{b.target.hasPointerCapture(b.pointerId)&&l(b)}),onPointerUp:Ee(r.onPointerUp,b=>{const v=b.target;v.hasPointerCapture(b.pointerId)&&(v.releasePointerCapture(b.pointerId),u(b))})})},"SliderImpl")),k2="SliderTrack",L2=E.forwardRef(qe(function(r,i){const{__scopeSlider:a,...c}=r,l=Ca(k2,a);return f.jsx(ze.span,{"data-disabled":l.disabled?"":void 0,"data-orientation":l.orientation,...c,ref:i})},"SliderTrack")),Uy="SliderRange",z2=E.forwardRef(qe(function(r,i){const{__scopeSlider:a,...c}=r,l=Ca(Uy,a),u=Hy(Uy,a),d=E.useRef(null),m=De(i,d),p=l.values.length,C=l.values.map(v=>Id(v,l.min,l.max)),g=p>1?Math.min(...C):0,b=100-Math.max(...C);return f.jsx(ze.span,{"data-orientation":l.orientation,"data-disabled":l.disabled?"":void 0,...c,ref:m,style:{...r.style,[u.startEdge]:g+"%",[u.endEdge]:b+"%"}})},"SliderRange")),B2="SliderThumb",[H2,$y]=_d(B2),P2="SliderThumbProvider";function Gy(t){const{__scopeSlider:r,name:i,children:a,internal_do_not_use_render:c}=t,l=Ca(P2,r),u=O2(r),[d,m]=E.useState(null),p=E.useMemo(()=>d?u().findIndex(w=>w.ref.current===d):-1,[u,d]),C=Mi(d),g=d?!!l.form||!!d.closest("form"):!0,b=l.values[p],v=i??(l.name?l.name+(l.values.length>1?"[]":""):void 0),x=b===void 0?0:Id(b,l.min,l.max);E.useEffect(()=>{if(d)return l.thumbs.add(d),()=>{l.thumbs.delete(d)}},[d,l.thumbs]);const S={value:b,name:v,form:l.form,isFormControl:g,index:p,thumb:d,onThumbChange:m,percent:x,size:C};return f.jsx(H2,{scope:r,...S,children:Wy(c)?c(S):a})}qe(Gy,"SliderThumbProvider");var Dd="SliderThumbTrigger",U2=E.forwardRef(qe(function(r,i){const{__scopeSlider:a,...c}=r,l=Ca(Dd,a),u=Hy(Dd,a),{index:d,value:m,percent:p,size:C,onThumbChange:g}=$y(Dd,a),b=De(i,g),v=Yy(d,l.values.length),x=C?.[u.size],S=x?Ky(x,p,u.direction):0;return f.jsx("span",{style:{transform:"var(--radix-slider-thumb-transform)",position:"absolute",[u.startEdge]:`calc(${p}% + ${S}px)`},children:f.jsx(Md.ItemSlot,{scope:a,children:f.jsx(ze.span,{role:"slider","aria-label":r["aria-label"]||v,"aria-valuemin":l.min,"aria-valuenow":m,"aria-valuemax":l.max,"aria-orientation":l.orientation,"data-orientation":l.orientation,"data-disabled":l.disabled?"":void 0,tabIndex:l.disabled?void 0:0,...c,ref:b,style:m===void 0?{display:"none"}:r.style,onFocus:Ee(r.onFocus,()=>{l.valueIndexToChangeRef.current=d})})})})},"SliderThumbTrigger")),$2=E.forwardRef(qe(function(r,i){const{__scopeSlider:a,name:c,...l}=r;return f.jsx(Gy,{__scopeSlider:a,name:c,internal_do_not_use_render:({index:u,isFormControl:d})=>f.jsxs(f.Fragment,{children:[f.jsx(U2,{...l,ref:i,__scopeSlider:a}),d?f.jsx(G2,{__scopeSlider:a},u):null]})})},"SliderThumb")),Vy="SliderBubbleInput",G2=E.forwardRef(qe(function({__scopeSlider:r,onInput:i,...a},c){const{index:l,value:u,name:d,form:m}=$y(Vy,r),{userRequestedValues:p}=Ca(Vy,r),C=E.useRef(null),g=De(C,c),b=E.useRef(!1),v=E.useRef(u),x=E.useRef(p),S=E.useRef(p);return E.useEffect(()=>{const w=C.current;if(!w)return;const T=window.HTMLInputElement.prototype,R=Object.getOwnPropertyDescriptor(T,"value").set,O=v.current,M=O!==u;v.current=u;const D=p!==S.current;if(S.current=p,M&&R){const _=p!==x.current;x.current=p;const I=p?.[l],z=_&&(D&&I!==O||I===u);b.current=!z;const H=new Event("input",{bubbles:!0});R.call(w,u),w.dispatchEvent(H),b.current=!1}},[l,u,p]),f.jsx(ze.input,{style:{display:"none"},name:d,form:m,...a,ref:g,defaultValue:u,onInput:Ee(i,w=>{b.current&&w.stopPropagation()})})},"SliderBubbleInput"));function qy(t=[],r,i){const a=[...t];return a[i]=r,a.sort((c,l)=>c-l)}qe(qy,"getNextSortedValues");function Id(t,r,i){const l=100/(i-r)*(t-r);return va(l,[0,100])}qe(Id,"convertValueToPercentage");function Yy(t,r){return r>2?`Value ${t+1} of ${r}`:r===2?["Minimum","Maximum"][t]:void 0}qe(Yy,"getLabel");function Xy(t,r){if(t.length===1)return 0;const i=t.map(c=>Math.abs(c-r)),a=Math.min(...i);return i.indexOf(a)}qe(Xy,"getClosestValueIndex");function Ky(t,r,i){const a=t/2,l=Ol([0,50],[0,a]);return(a-l(r)*i)*i}qe(Ky,"getThumbInBoundsOffset");function Qy(t){return t.slice(0,-1).map((r,i)=>t[i+1]-r)}qe(Qy,"getStepsBetweenValues");function Fy(t,r){if(r>0){const i=Qy(t);return Math.min(...i)>=r}return!0}qe(Fy,"hasMinStepsBetweenValues");function Ol(t,r){return i=>{if(t[0]===t[1]||r[0]===r[1])return r[0];const a=(r[1]-r[0])/(t[1]-t[0]);return r[0]+a*(i-t[0])}}qe(Ol,"linearScale");function kd(t){if(!Number.isFinite(t))return 0;const r=t.toString();if(r.includes("e")){const[a,c]=r.split("e"),l=a.split(".")[1]||"",u=Number(c);return Math.max(0,l.length-u)}const i=r.split(".")[1];return i?i.length:0}qe(kd,"getDecimalCount");function Li(t,r){const i=Math.pow(10,r);return Math.round(t*i)/i}qe(Li,"roundValue");function Zy(t,{min:r,step:i,direction:a,multiplier:c}){const l=kd(i),u=(t-r)/i,d=Math.round(u),m=Li(d*i+r,l)===Li(t,l);let p;return m?p=d+c*a:a>0?p=Math.ceil(u):p=Math.floor(u),Li(p*i+r,l)}qe(Zy,"getNextStepValue");function Wy(t){return typeof t=="function"}qe(Wy,"isFunction");var V2=Object.defineProperty,vt=(t,r)=>V2(t,"name",{value:r,configurable:!0}),[Ld,kM]=Cn("Tooltip",[Sl]),Nl=Sl(),q2="TooltipProvider",Y2=700,zd="tooltip.open",[X2,Bd]=Ld(q2),K2=vt(t=>{const{__scopeTooltip:r,delayDuration:i=Y2,skipDelayDuration:a=300,disableHoverableContent:c=!1,children:l}=t,u=E.useRef(!0),d=E.useRef(!1),m=E.useRef(0);return E.useEffect(()=>{const p=m.current;return()=>window.clearTimeout(p)},[]),f.jsx(X2,{scope:r,isOpenDelayedRef:u,delayDuration:i,onOpen:E.useCallback(()=>{a<=0||(window.clearTimeout(m.current),u.current=!1)},[a]),onClose:E.useCallback(()=>{a<=0||(window.clearTimeout(m.current),m.current=window.setTimeout(()=>u.current=!0,a))},[a]),isPointerInTransitRef:d,onPointerInTransitChange:E.useCallback(p=>{d.current=p},[]),disableHoverableContent:c,children:l})},"TooltipProvider"),Hd="Tooltip",[Q2,zi]=Ld(Hd),F2=vt(t=>{const{__scopeTooltip:r,children:i,open:a,defaultOpen:c,onOpenChange:l,disableHoverableContent:u,delayDuration:d}=t,m=Bd(Hd,t.__scopeTooltip),p=Nl(r),[C,g]=E.useState(null),[b,v]=E.useState(void 0),x=sr(),S=E.useRef(0),w=u??m.disableHoverableContent,T=d??m.delayDuration,j=E.useRef(!1),[R,O]=ar({prop:a,defaultProp:c??!1,onChange:vt(H=>{H?(m.onOpen(),document.dispatchEvent(new CustomEvent(zd))):m.onClose(),l?.(H)},"onChange"),caller:Hd}),M=E.useMemo(()=>R?j.current?"delayed-open":"instant-open":"closed",[R]),D=E.useCallback(()=>{window.clearTimeout(S.current),S.current=0,j.current=!1,O(!0)},[O]),_=E.useCallback(()=>{window.clearTimeout(S.current),S.current=0,O(!1)},[O]),I=E.useCallback(()=>{window.clearTimeout(S.current),S.current=window.setTimeout(()=>{j.current=!0,O(!0),S.current=0},T)},[T,O]);E.useEffect(()=>()=>{S.current&&(window.clearTimeout(S.current),S.current=0)},[]);const z=b??x;return f.jsx(ny,{...p,children:f.jsx(Q2,{scope:r,contentId:z,setContentId:v,open:R,stateAttribute:M,trigger:C,onTriggerChange:g,onTriggerEnter:E.useCallback(()=>{m.isOpenDelayedRef.current?I():D()},[m.isOpenDelayedRef,I,D]),onTriggerLeave:E.useCallback(()=>{w?_():(window.clearTimeout(S.current),S.current=0)},[_,w]),onOpen:D,onClose:_,disableHoverableContent:w,children:i})})},"Tooltip"),Jy="TooltipTrigger",Z2=E.forwardRef(vt(function(r,i){const{__scopeTooltip:a,"aria-describedby":c,...l}=r,u=zi(Jy,a),d=Bd(Jy,a),m=Nl(a),p=E.useRef(null),C=De(i,p,u.onTriggerChange),g=E.useRef(!1),b=E.useRef(!1),v=E.useCallback(()=>g.current=!1,[]);return E.useEffect(()=>()=>document.removeEventListener("pointerup",v),[v]),f.jsx(ry,{asChild:!0,...m,children:f.jsx(ze.button,{"aria-describedby":u.open?l0(c,u.contentId):c,"data-state":u.stateAttribute,...l,ref:C,onPointerMove:Ee(r.onPointerMove,x=>{x.pointerType!=="touch"&&!b.current&&!d.isPointerInTransitRef.current&&(u.onTriggerEnter(),b.current=!0)}),onPointerLeave:Ee(r.onPointerLeave,()=>{u.onTriggerLeave(),b.current=!1}),onPointerDown:Ee(r.onPointerDown,()=>{u.open&&u.onClose(),g.current=!0,document.addEventListener("pointerup",v,{once:!0})}),onFocus:Ee(r.onFocus,()=>{g.current||u.onOpen()}),onBlur:Ee(r.onBlur,u.onClose),onClick:Ee(r.onClick,u.onClose)})})},"TooltipTrigger")),e0="TooltipPortal",[W2,J2]=Ld(e0,{forceMount:void 0}),eA=vt(t=>{const{__scopeTooltip:r,forceMount:i,children:a,container:c}=t,l=zi(e0,r);return f.jsx(W2,{scope:r,forceMount:i,children:f.jsx($r,{present:i||l.open,children:f.jsx(Yu,{asChild:!0,container:c,children:a})})})},"TooltipPortal"),Bi="TooltipContent",tA=E.forwardRef(vt(function(r,i){const a=J2(Bi,r.__scopeTooltip),{forceMount:c=a.forceMount,side:l="top",...u}=r,d=zi(Bi,r.__scopeTooltip);return f.jsx($r,{present:c||d.open,children:d.disableHoverableContent?f.jsx(t0,{side:l,...u,ref:i}):f.jsx(nA,{side:l,...u,ref:i})})},"TooltipContent")),nA=E.forwardRef(vt(function(r,i){const a=zi(Bi,r.__scopeTooltip),c=Bd(Bi,r.__scopeTooltip),l=E.useRef(null),u=De(i,l),[d,m]=E.useState(null),{trigger:p,onClose:C}=a,g=l.current,{onPointerInTransitChange:b}=c,v=E.useCallback(()=>{m(null),b(!1)},[b]),x=E.useCallback((S,w)=>{const T=S.currentTarget,j={x:S.clientX,y:S.clientY},R=n0(j,T.getBoundingClientRect()),O=r0(j,R),M=o0(w.getBoundingClientRect()),D=i0([...O,...M]);m(D),b(!0)},[b]);return E.useEffect(()=>()=>v(),[v]),E.useEffect(()=>{if(p&&g){const S=vt(T=>x(T,g),"handleTriggerLeave"),w=vt(T=>x(T,p),"handleContentLeave");return p.addEventListener("pointerleave",S),g.addEventListener("pointerleave",w),()=>{p.removeEventListener("pointerleave",S),g.removeEventListener("pointerleave",w)}}},[p,g,x,v]),E.useEffect(()=>{if(d){const S=vt(w=>{const T=w.target,j={x:w.clientX,y:w.clientY},R=p?.contains(T)||g?.contains(T),O=!a0(j,d);R?v():O&&(v(),C())},"handleTrackPointerGrace");return document.addEventListener("pointermove",S),()=>document.removeEventListener("pointermove",S)}},[p,g,d,C,v]),f.jsx(t0,{...r,ref:u})},"TooltipContentHoverable")),rA=pp("TooltipContent"),t0=E.forwardRef(vt(function(r,i){const{__scopeTooltip:a,children:c,"aria-label":l,id:u,onEscapeKeyDown:d,onPointerDownOutside:m,...p}=r,C=zi(Bi,a),g=Nl(a),{onClose:b}=C,[v,x]=E.useState(null),S=De(i,x);tg(v),E.useEffect(()=>(document.addEventListener(zd,b),()=>document.removeEventListener(zd,b)),[b]),E.useEffect(()=>{if(C.trigger){const T=vt(j=>{j.target instanceof Node&&j.target.contains(C.trigger)&&b()},"handleScroll");return window.addEventListener("scroll",T,{capture:!0}),()=>window.removeEventListener("scroll",T,{capture:!0})}},[C.trigger,b]);const{setContentId:w}=C;return st(()=>(w(u),()=>{w(void 0)}),[u,w]),f.jsx(Bu,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:d,onPointerDownOutside:m,onFocusOutside:T=>T.preventDefault(),onDismiss:b,children:f.jsxs(ay,{"data-state":C.stateAttribute,role:l?void 0:"tooltip",id:l?void 0:C.contentId,...g,...p,ref:S,style:{...p.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[f.jsx(rA,{children:c}),l?f.jsx(ew,{id:C.contentId,role:"tooltip",children:l}):null]})})},"TooltipContentImpl")),oA=E.forwardRef(vt(function(r,i){const{__scopeTooltip:a,...c}=r,l=Nl(a);return f.jsx(rj,{...l,...c,ref:i})},"TooltipArrow"));function n0(t,r){const i=Math.abs(r.top-t.y),a=Math.abs(r.bottom-t.y),c=Math.abs(r.right-t.x),l=Math.abs(r.left-t.x);switch(Math.min(i,a,c,l)){case l:return"left";case c:return"right";case i:return"top";case a:return"bottom";default:throw new Error("unreachable")}}vt(n0,"getExitSideFromRect");function r0(t,r,i=5){const a=[];switch(r){case"top":a.push({x:t.x-i,y:t.y+i},{x:t.x+i,y:t.y+i});break;case"bottom":a.push({x:t.x-i,y:t.y-i},{x:t.x+i,y:t.y-i});break;case"left":a.push({x:t.x+i,y:t.y-i},{x:t.x+i,y:t.y+i});break;case"right":a.push({x:t.x-i,y:t.y-i},{x:t.x-i,y:t.y+i});break}return a}vt(r0,"getPaddedExitPoints");function o0(t){const{top:r,right:i,bottom:a,left:c}=t;return[{x:c,y:r},{x:i,y:r},{x:i,y:a},{x:c,y:a}]}vt(o0,"getPointsFromRect");function a0(t,r){const{x:i,y:a}=t;let c=!1;for(let l=0,u=r.length-1;l<r.length;u=l++){const d=r[l],m=r[u],p=d.x,C=d.y,g=m.x,b=m.y;C>a!=b>a&&i<(g-p)*(a-C)/(b-C)+p&&(c=!c)}return c}vt(a0,"isPointInPolygon");function i0(t){const r=t.slice();return r.sort((i,a)=>i.x<a.x?-1:i.x>a.x?1:i.y<a.y?-1:i.y>a.y?1:0),s0(r)}vt(i0,"getHull");function s0(t){if(t.length<=1)return t.slice();const r=[];for(let a=0;a<t.length;a++){const c=t[a];for(;r.length>=2;){const l=r[r.length-1],u=r[r.length-2];if((l.x-u.x)*(c.y-u.y)>=(l.y-u.y)*(c.x-u.x))r.pop();else break}r.push(c)}r.pop();const i=[];for(let a=t.length-1;a>=0;a--){const c=t[a];for(;i.length>=2;){const l=i[i.length-1],u=i[i.length-2];if((l.x-u.x)*(c.y-u.y)>=(l.y-u.y)*(c.x-u.x))i.pop();else break}i.push(c)}return i.pop(),r.length===1&&i.length===1&&r[0].x===i[0].x&&r[0].y===i[0].y?r:r.concat(i)}vt(s0,"getHullPresorted");function l0(...t){const r=new Set;for(const i of t)if(typeof i=="string")for(const a of String(i).trim().split(/\s+/))a&&r.add(a);return r.size>0?Array.from(r).join(" "):void 0}vt(l0,"concatAriaDescribedby");function aA({delayDuration:t=0,...r}){return f.jsx(K2,{"data-slot":"tooltip-provider",delayDuration:t,...r})}function iA({...t}){return f.jsx(F2,{"data-slot":"tooltip",...t})}function sA({...t}){return f.jsx(Z2,{"data-slot":"tooltip-trigger",...t})}function lA({container:t,className:r,sideOffset:i=0,children:a,...c}){return f.jsx(eA,{container:t,children:f.jsxs(tA,{"data-slot":"tooltip-content",sideOffset:i,className:Ve("z-50 w-fit origin-(--radix-tooltip-content-transform-origin) animate-in rounded-md bg-foreground px-3 py-1.5 text-xs text-balance text-background fade-in-0 zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95",r),...c,children:[a,f.jsx(oA,{className:"z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px] bg-foreground fill-foreground"})]})})}function c0(t){return t?.closest(".rt-menu-root, .rt-main-menu-root, .ui-dialog")||document.fullscreenElement||document.getElementById("uni-answer-sheet")||document.body}function cA({children:t}){return f.jsx(aA,{delayDuration:400,children:t})}const uA={"portal-wrapper":"_portal-wrapper_1eief_1"},dA={footer:"_footer_yp9z4_1"};/**
92
+ * @license lucide-react v1.58.0 - ISC
93
+ *
94
+ * This source code is licensed under the ISC license.
95
+ * See the LICENSE file in the root directory of this source tree.
96
+ */const fA=t=>t?.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();/**
97
+ * @license lucide-react v1.58.0 - ISC
98
+ *
99
+ * This source code is licensed under the ISC license.
100
+ * See the LICENSE file in the root directory of this source tree.
101
+ */function hA(t,r,i=[]){if(r==null)throw new Error("[lucide]: iconNode is required when icon name is used");return{name:fA(t),size:24,node:r,...i.length>0?{aliases:i}:{}}}/**
102
+ * @license lucide-react v1.58.0 - ISC
103
+ *
104
+ * This source code is licensed under the ISC license.
105
+ * See the LICENSE file in the root directory of this source tree.
106
+ */const mA=t=>{let r="",i=!1;for(const a of t){if(a==="-"||a==="_"||a<=" "){i=r.length>0;continue}r.length===0?r+=a.toLowerCase():r+=i?a.toUpperCase():a,i=!1}return r};/**
107
+ * @license lucide-react v1.58.0 - ISC
108
+ *
109
+ * This source code is licensed under the ISC license.
110
+ * See the LICENSE file in the root directory of this source tree.
111
+ */const pA=t=>{const r=mA(t);return r.charAt(0).toUpperCase()+r.slice(1)};/**
112
+ * @license lucide-react v1.58.0 - ISC
113
+ *
114
+ * This source code is licensed under the ISC license.
115
+ * See the LICENSE file in the root directory of this source tree.
116
+ */const Pd=(...t)=>t.filter((r,i,a)=>!!r&&r.trim()!==""&&a.indexOf(r)===i).join(" ").trim();/**
117
+ * @license lucide-react v1.58.0 - ISC
118
+ *
119
+ * This source code is licensed under the ISC license.
120
+ * See the LICENSE file in the root directory of this source tree.
121
+ */const Do={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":2,"stroke-linecap":"round","stroke-linejoin":"round"};/**
122
+ * @license lucide-react v1.58.0 - ISC
123
+ *
124
+ * This source code is licensed under the ISC license.
125
+ * See the LICENSE file in the root directory of this source tree.
126
+ */function Ud(t){return t!=null}function gA(t,r={}){const i=r.attributeNames??{},a=b=>i[b]??b,c=t.size??t.width??Do.width,l=t.size??t.height??Do.height,u=t.aliases?.filter(b=>typeof b=="string"&&b.trim()!=="").map(b=>`lucide-${b}`)??[],d=[...t.name?[`lucide-${t.name}`]:[],...u],m=r.className?.split(" ").filter(Boolean)??[],p=r.includeDefaultClasses===!1?Pd(...m):Pd("lucide",...d,...m),C=r.absoluteStrokeWidth?Number(r.strokeWidth??Do["stroke-width"])*Number(t.size??t.width??Do.width)/Number(r.size??r.width??Do.width):r.strokeWidth??Do["stroke-width"];return["svg",{...Object.entries(Do).reduce((b,[v,x])=>(b[a(v)]=x,b),{}),..."color"in r&&r.color&&{[a("stroke")]:r.color},..."size"in r&&Ud(r.size)&&{[a("width")]:r.size,[a("height")]:r.size},..."width"in r&&Ud(r.width)&&{[a("width")]:r.width},..."height"in r&&Ud(r.height)&&{[a("height")]:r.height},[a("stroke-width")]:C,...p&&{[a("class")]:p},[a("viewBox")]:`0 0 ${c} ${l}`,...r.hasA11yProp===!1?{[a("aria-hidden")]:"true"}:{},..."attributes"in r&&r.attributes},t.node.map(b=>{const[v,x,S]=b,w=r.nonScalingStroke?{[a("vector-effect")]:"non-scaling-stroke",...x}:x;return S?[v,w,S]:[v,w]})]}/**
127
+ * @license lucide-react v1.58.0 - ISC
128
+ *
129
+ * This source code is licensed under the ISC license.
130
+ * See the LICENSE file in the root directory of this source tree.
131
+ */function yA(t,r={}){return gA(t,{...r,attributeNames:{...r.attributeNames,class:"className","stroke-width":"strokeWidth","stroke-linecap":"strokeLinecap","stroke-linejoin":"strokeLinejoin","vector-effect":"vectorEffect"}})}/**
132
+ * @license lucide-react v1.58.0 - ISC
133
+ *
134
+ * This source code is licensed under the ISC license.
135
+ * See the LICENSE file in the root directory of this source tree.
136
+ */const bA=t=>{for(const r in t)if(r.startsWith("aria-")||r==="role"||r==="title")return!0;return!1},xA=E.createContext({}),vA=()=>E.useContext(xA),SA=E.forwardRef(({color:t,size:r,width:i,height:a,strokeWidth:c,absoluteStrokeWidth:l,nonScalingStroke:u,className:d="",children:m,iconNode:p=[],icon:C={node:p,aliases:[],size:24},...g},b)=>{const{size:v=24,strokeWidth:x=2,absoluteStrokeWidth:S=!1,nonScalingStroke:w=!1,color:T="currentColor",className:j=""}=vA()??{},R=!!m||bA(g),[O,M,D=[]]=yA(C,{color:t??T,width:i??r??v,height:a??r??v,strokeWidth:c??x,absoluteStrokeWidth:l??S,nonScalingStroke:u??w,className:Pd(j,d),hasA11yProp:R,attributes:g});return E.createElement(O,{ref:b,...M},[...D.map(([_,I])=>E.createElement(_,I)),...Array.isArray(m)?m:[m]])});/**
137
+ * @license lucide-react v1.58.0 - ISC
138
+ *
139
+ * This source code is licensed under the ISC license.
140
+ * See the LICENSE file in the root directory of this source tree.
141
+ */function Ln(t,r=[],i=[]){const a=typeof t=="string"?hA(t,r,i):t,c=E.forwardRef(({className:l,...u},d)=>E.createElement(SA,{ref:d,icon:a,className:l,...u}));return a.name&&(c.displayName=pA(a.name)),c}/**
142
+ * @license lucide-react v1.58.0 - ISC
143
+ *
144
+ * This source code is licensed under the ISC license.
145
+ * See the LICENSE file in the root directory of this source tree.
146
+ */const u0={name:"check",size:24,node:[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]};u0.node;const d0=Ln(u0);/**
147
+ * @license lucide-react v1.58.0 - ISC
148
+ *
149
+ * This source code is licensed under the ISC license.
150
+ * See the LICENSE file in the root directory of this source tree.
151
+ */const f0={name:"chevron-down",size:24,node:[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]};f0.node;const h0=Ln(f0);/**
152
+ * @license lucide-react v1.58.0 - ISC
153
+ *
154
+ * This source code is licensed under the ISC license.
155
+ * See the LICENSE file in the root directory of this source tree.
156
+ */const m0={name:"chevron-up",size:24,node:[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]};m0.node;const CA=Ln(m0);/**
157
+ * @license lucide-react v1.58.0 - ISC
158
+ *
159
+ * This source code is licensed under the ISC license.
160
+ * See the LICENSE file in the root directory of this source tree.
161
+ */const p0={name:"circle",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]};p0.node;const wA=Ln(p0);/**
162
+ * @license lucide-react v1.58.0 - ISC
163
+ *
164
+ * This source code is licensed under the ISC license.
165
+ * See the LICENSE file in the root directory of this source tree.
166
+ */const g0={name:"loader-circle",size:24,node:[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],aliases:["loader-2"]};g0.node;const EA=Ln(g0);/**
167
+ * @license lucide-react v1.58.0 - ISC
168
+ *
169
+ * This source code is licensed under the ISC license.
170
+ * See the LICENSE file in the root directory of this source tree.
171
+ */const y0={name:"maximize",size:24,node:[["path",{d:"M8 3H5a2 2 0 0 0-2 2v3",key:"1dcmit"}],["path",{d:"M21 8V5a2 2 0 0 0-2-2h-3",key:"1e4gt3"}],["path",{d:"M3 16v3a2 2 0 0 0 2 2h3",key:"wsl5sc"}],["path",{d:"M16 21h3a2 2 0 0 0 2-2v-3",key:"18trek"}]]};y0.node;const TA=Ln(y0);/**
172
+ * @license lucide-react v1.58.0 - ISC
173
+ *
174
+ * This source code is licensed under the ISC license.
175
+ * See the LICENSE file in the root directory of this source tree.
176
+ */const b0={name:"minimize",size:24,node:[["path",{d:"M8 3v3a2 2 0 0 1-2 2H3",key:"hohbtr"}],["path",{d:"M21 8h-3a2 2 0 0 1-2-2V3",key:"5jw1f3"}],["path",{d:"M3 16h3a2 2 0 0 1 2 2v3",key:"198tvr"}],["path",{d:"M16 21v-3a2 2 0 0 1 2-2h3",key:"ph8mxp"}]]};b0.node;const jA=Ln(b0);/**
177
+ * @license lucide-react v1.58.0 - ISC
178
+ *
179
+ * This source code is licensed under the ISC license.
180
+ * See the LICENSE file in the root directory of this source tree.
181
+ */const x0={name:"minus",size:24,node:[["path",{d:"M5 12h14",key:"1ays0h"}]]};x0.node;const AA=Ln(x0);/**
182
+ * @license lucide-react v1.58.0 - ISC
183
+ *
184
+ * This source code is licensed under the ISC license.
185
+ * See the LICENSE file in the root directory of this source tree.
186
+ */const v0={name:"panels-top-left",size:24,node:[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M3 9h18",key:"1pudct"}],["path",{d:"M9 21V9",key:"1oto5p"}]],aliases:["layout"]};v0.node;const RA=Ln(v0);/**
187
+ * @license lucide-react v1.58.0 - ISC
188
+ *
189
+ * This source code is licensed under the ISC license.
190
+ * See the LICENSE file in the root directory of this source tree.
191
+ */const S0={name:"plus",size:24,node:[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]};S0.node;const OA=Ln(S0);/**
192
+ * @license lucide-react v1.58.0 - ISC
193
+ *
194
+ * This source code is licensed under the ISC license.
195
+ * See the LICENSE file in the root directory of this source tree.
196
+ */const C0={name:"x",size:24,node:[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]};C0.node;const NA=Ln(C0),$d={"scale-wrapper":"_scale-wrapper_qmn4q_1",bar:"_bar_qmn4q_8",percent:"_percent_qmn4q_19"},w0={"press-wrapper":"_press-wrapper_1m46f_1",active:"_active_1m46f_8"};var Gd={exports:{}};/*!
197
+ Copyright (c) 2018 Jed Watson.
198
+ Licensed under the MIT License (MIT), see
199
+ http://jedwatson.github.io/classnames
200
+ */var E0;function MA(){return E0||(E0=1,(function(t){(function(){var r={}.hasOwnProperty;function i(){for(var l="",u=0;u<arguments.length;u++){var d=arguments[u];d&&(l=c(l,a(d)))}return l}function a(l){if(typeof l=="string"||typeof l=="number")return l;if(typeof l!="object")return"";if(Array.isArray(l))return i.apply(null,l);if(l.toString!==Object.prototype.toString&&!l.toString.toString().includes("[native code]"))return l.toString();var u="";for(var d in l)r.call(l,d)&&l[d]&&(u=c(u,d));return u}function c(l,u){return u?l?l+" "+u:l+u:l}t.exports?(i.default=i,t.exports=i):window.classNames=i})()})(Gd)),Gd.exports}var _A=MA();const T0=Dm(_A),j0=t=>{const{padding:r="",active:i=!1,className:a,...c}=t,l=E.useMemo(()=>{if(!r)return"unset";if(typeof r=="string")return r;if(typeof r=="number")return r+"px";if(Array.isArray(r))return r.map(u=>u+"px").join(" ")},[r]);return f.jsx("div",{...c,className:T0(a,w0["press-wrapper"],i?w0.active:""),style:{padding:l},children:t.children})};function A0({title:t,children:r}){const[i,a]=E.useState(null);return f.jsxs(iA,{children:[f.jsx(sA,{asChild:!0,children:f.jsx("span",{ref:a,className:"ui-tooltip-trigger",children:r})}),f.jsx(lA,{container:c0(i),className:"ui-tooltip",side:"top",sideOffset:6,children:t})]})}const DA={"icon-quanping":TA,"icon-quxiaoquanping":jA,"icon-shitudaohang":RA},R0=t=>{const{type:r,children:i,tooltip:a,...c}=t,l=DA[r];return a?f.jsx(A0,{title:a,children:f.jsx(j0,{...c,children:f.jsx(l,{size:14,"aria-hidden":"true"})})}):f.jsx(j0,{...c,children:f.jsx(l,{size:14,"aria-hidden":"true"})})};function IA({className:t,type:r,...i}){return f.jsx("input",{type:r,"data-slot":"input",className:Ve("h-9 w-full min-w-0 rounded-md border border-input bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none selection:bg-primary selection:text-primary-foreground file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm dark:bg-input/30","focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50","aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40",t),...i})}function kA({className:t,...r}){return f.jsx("textarea",{"data-slot":"textarea",className:Ve("flex field-sizing-content min-h-16 w-full rounded-md border border-input bg-transparent px-3 py-2 text-base shadow-xs transition-[color,box-shadow] outline-none placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:aria-invalid:ring-destructive/40",t),...r})}const wa=E.forwardRef(function({className:r,controlSize:i,size:a,status:c,...l},u){return f.jsx(IA,{...l,ref:u,"aria-invalid":c==="error"||l["aria-invalid"],"data-control-size":i||(a==="small"?"compact":a),className:Ve("ui-control ui-input",r)})});function Ml({autoSize:t,className:r,...i}){const a=E.useRef(null);return E.useLayoutEffect(()=>{const c=a.current;if(!c||!t)return;const l=getComputedStyle(c),u=parseFloat(l.lineHeight)||20,d=parseFloat(l.paddingTop)+parseFloat(l.paddingBottom)+2;c.style.height="0px",c.style.height=`${Math.max(t.minRows*u+d,Math.min(t.maxRows*u+d,c.scrollHeight+2))}px`},[i.value,t]),f.jsx(kA,{...i,ref:a,className:Ve("ui-control ui-textarea",r)})}function LA({...t}){return f.jsx(Qj,{"data-slot":"select",...t})}function zA({...t}){return f.jsx(p2,{"data-slot":"select-group",...t})}function BA({...t}){return f.jsx(Jj,{"data-slot":"select-value",...t})}function HA({className:t,size:r="default",children:i,...a}){return f.jsxs(Zj,{"data-slot":"select-trigger","data-size":r,className:Ve("flex w-fit items-center justify-between gap-2 rounded-md border border-input bg-transparent px-3 py-2 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 data-[placeholder]:text-muted-foreground data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 dark:bg-input/30 dark:hover:bg-input/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground",t),...a,children:[i,f.jsx(e2,{asChild:!0,children:f.jsx(h0,{className:"size-4 opacity-50"})})]})}function PA({container:t,className:r,children:i,position:a="item-aligned",align:c="center",...l}){return f.jsx(o2,{container:t,children:f.jsxs(a2,{"data-slot":"select-content",className:Ve("relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border bg-popover text-popover-foreground shadow-md data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95",a==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",r),position:a,align:c,...l,children:[f.jsx(GA,{}),f.jsx(d2,{className:Ve("p-1",a==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"),children:i}),f.jsx(VA,{})]})})}function UA({className:t,...r}){return f.jsx(y2,{"data-slot":"select-label",className:Ve("px-2 py-1.5 text-xs text-muted-foreground",t),...r})}function $A({className:t,children:r,...i}){return f.jsxs(x2,{"data-slot":"select-item",className:Ve("relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",t),...i,children:[f.jsx("span",{"data-slot":"select-item-indicator",className:"absolute right-2 flex size-3.5 items-center justify-center",children:f.jsx(C2,{children:f.jsx(d0,{className:"size-4"})})}),f.jsx(v2,{children:r})]})}function GA({className:t,...r}){return f.jsx(w2,{"data-slot":"select-scroll-up-button",className:Ve("flex cursor-default items-center justify-center py-1",t),...r,children:f.jsx(CA,{className:"size-4"})})}function VA({className:t,...r}){return f.jsx(E2,{"data-slot":"select-scroll-down-button",className:Ve("flex cursor-default items-center justify-center py-1",t),...r,children:f.jsx(h0,{className:"size-4"})})}function Vd(t){return E.Children.toArray(t).flatMap(r=>E.isValidElement(r)?r.type===E.Fragment?Vd(r.props.children):r.type==="optgroup"?[{label:r.props.label,options:Vd(r.props.children)}]:[{value:String(r.props.value??r.props.children??""),label:r.props.children,disabled:r.props.disabled}]:[])}const _l="__empty_option__";function O0(t,r){return t.map((i,a)=>i.options?f.jsxs(zA,{children:[f.jsx(UA,{children:i.label}),O0(i.options,r)]},a):f.jsx($A,{value:String(i.value)||_l,disabled:i.disabled,"data-option-value":i.value,onKeyDown:c=>{c.key==="Enter"&&!i.disabled&&(c.preventDefault(),r(String(i.value)||_l))},children:i.label},String(i.value)))}function Ft({className:t,controlSize:r,size:i,children:a,options:c,value:l,onChange:u,disabled:d,...m}){const p=E.useRef(null),[C,g]=E.useState(!1),b=x=>{if(x){g(!0);return}const S=!!document.activeElement?.closest('[data-slot="select-content"]');Hr.flushSync(()=>g(!1)),S&&p.current?.focus({preventScroll:!0})},v=x=>{b(!1),u?.(x===_l?"":x)};return f.jsxs(LA,{value:l===void 0?void 0:String(l)||_l,onValueChange:v,disabled:d,open:C,onOpenChange:b,children:[f.jsx(HA,{...m,ref:p,className:Ve("ui-control ui-select",t),"data-value":l===void 0?"":String(l),"data-control-size":r||(i==="small"?"compact":i),children:f.jsx(BA,{})}),f.jsx(PA,{container:c0(p.current),position:"popper",align:"start",className:"ui-select-popup",onCloseAutoFocus:x=>x.preventDefault(),onEscapeKeyDown:x=>{x.preventDefault(),x.stopPropagation(),b(!1)},children:O0(c||Vd(a),v)})]})}const N0=t=>typeof t=="boolean"?`${t}`:t===0?"0":t,M0=Ym,qA=((t,r)=>i=>{var a;if(r?.variants==null)return M0(t,i?.class,i?.className);const{variants:c,defaultVariants:l}=r,u=Object.keys(c).map(p=>{const C=i?.[p],g=l?.[p];if(C===null)return null;const b=N0(C)||N0(g);return c[p][b]}),d=i&&Object.entries(i).reduce((p,C)=>{let[g,b]=C;return b===void 0||(p[g]=b),p},{}),m=r==null||(a=r.compoundVariants)===null||a===void 0?void 0:a.reduce((p,C)=>{let{class:g,className:b,...v}=C;return Object.entries(v).every(x=>{let[S,w]=x;return Array.isArray(w)?w.includes({...l,...d}[S]):{...l,...d}[S]===w})?[...p,g,b]:p},[]);return M0(t,u,m,i?.class,i?.className)})("inline-flex shrink-0 items-center justify-center gap-2 rounded-md text-sm font-medium whitespace-nowrap transition-all outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-white hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:bg-destructive/60 dark:focus-visible:ring-destructive/40",outline:"border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",xs:"h-6 gap-1 rounded-md px-2 text-xs has-[>svg]:px-1.5 [&_svg:not([class*='size-'])]:size-3",sm:"h-8 gap-1.5 rounded-md px-3 has-[>svg]:px-2.5",lg:"h-10 rounded-md px-6 has-[>svg]:px-4",icon:"size-9","icon-xs":"size-6 rounded-md [&_svg:not([class*='size-'])]:size-3","icon-sm":"size-8","icon-lg":"size-10"}},defaultVariants:{variant:"default",size:"default"}});function _0({className:t,variant:r="default",size:i="default",asChild:a=!1,...c}){const l=a?VC:"button";return f.jsx(l,{"data-slot":"button","data-variant":r,"data-size":i,className:Ve(qA({variant:r,size:i,className:t})),...c})}function ce({type:t="default",htmlType:r="button",size:i="middle",danger:a,loading:c,className:l,children:u,...d}){return f.jsxs(_0,{variant:t==="primary"?"default":t==="text"?"ghost":"outline",size:i==="small"?"xs":i==="large"?"lg":"sm",...d,type:r,disabled:d.disabled||c,"aria-busy":c||void 0,className:Ve("ui-button",a&&"ui-danger",l),children:[c&&f.jsx(EA,{className:"animate-spin","aria-hidden":"true"}),u]})}function YA({className:t,...r}){return f.jsx(zE,{"data-slot":"checkbox",className:Ve("peer size-4 shrink-0 rounded-[4px] border border-input shadow-xs transition-shadow outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 data-[state=checked]:border-primary data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:bg-input/30 dark:aria-invalid:ring-destructive/40 dark:data-[state=checked]:bg-primary",t),...r,children:f.jsx(HE,{"data-slot":"checkbox-indicator",className:"grid place-content-center text-current transition-none",children:f.jsx(d0,{className:"size-3.5"})})})}function Lt({children:t,className:r,onChange:i,id:a,...c}){const l=E.useId();return f.jsxs("label",{className:Ve("ui-checkbox-label",r),htmlFor:a||l,children:[f.jsx(YA,{...c,id:a||l,className:"ui-checkbox",onCheckedChange:u=>i?.({target:{checked:u===!0}})}),t&&f.jsx("span",{children:t})]})}function Ea({value:t,onChange:r,precision:i,className:a,onBlur:c,...l}){const[u,d]=E.useState(t==null?"":String(t));return E.useEffect(()=>{d(t==null?"":String(t))},[t]),f.jsx(wa,{...l,type:"number",inputMode:"decimal",className:Ve("ui-number",a),value:u,onChange:m=>{const p=m.target.value;d(p),p?Number.isFinite(Number(p))&&r?.(Number(p)):r?.(null)},onBlur:m=>{const p=Number(u),C=u&&Number.isFinite(p)&&i!==void 0?String(Number(p.toFixed(i))):u;d(t==null?"":C||String(t)),c?.(m)}})}function XA({...t}){return f.jsx(xE,{"data-slot":"dialog",...t})}function KA({...t}){return f.jsx(SE,{"data-slot":"dialog-portal",...t})}function QA({...t}){return f.jsx(rd,{"data-slot":"dialog-close",...t})}function FA({className:t,...r}){return f.jsx(CE,{"data-slot":"dialog-overlay",className:Ve("fixed inset-0 z-50 bg-black/50 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:animate-in data-[state=open]:fade-in-0",t),...r})}function ZA({className:t,children:r,showCloseButton:i=!0,portal:a=!0,overlay:c=!0,...l}){const u=f.jsxs(E.Fragment,{children:[c&&f.jsx(FA,{className:"ui-dialog-overlay"}),f.jsxs(TE,{"data-slot":"dialog-content",className:Ve("fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border bg-background p-6 shadow-lg duration-200 outline-none data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95 sm:max-w-lg",t),...l,children:[r,i&&f.jsxs(rd,{"data-slot":"dialog-close",className:"absolute top-4 right-4 rounded-xs opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:ring-2 focus:ring-ring focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",children:[f.jsx(NA,{}),f.jsx("span",{className:"sr-only",children:"Close"})]})]})]});return a?f.jsx(KA,{children:u}):u}function WA({className:t,...r}){return f.jsx("div",{"data-slot":"dialog-header",className:Ve("flex flex-col gap-2 text-center sm:text-left",t),...r})}function JA({className:t,showCloseButton:r=!1,children:i,...a}){return f.jsxs("div",{"data-slot":"dialog-footer",className:Ve("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",t),...a,children:[i,r&&f.jsx(rd,{asChild:!0,children:f.jsx(_0,{variant:"outline",children:"Close"})})]})}function eR({className:t,...r}){return f.jsx(RE,{"data-slot":"dialog-title",className:Ve("text-lg leading-none font-semibold",t),...r})}function Dl({open:t,modal:r=!0,panelRef:i,width:a=460,zIndex:c=900,className:l,title:u,footer:d,children:m,classNames:p,closeLabel:C,closeIcon:g,onCancel:b,onOpenAutoFocus:v,onEscapeKeyDown:x,wrapProps:S}){const w=E.useId(),T=E.useRef(document.activeElement instanceof HTMLElement?document.activeElement:null);return f.jsx(XA,{open:t,modal:r,onOpenChange:j=>{j||b()},children:f.jsxs(ZA,{...S,ref:i,portal:!1,overlay:r,showCloseButton:!1,"aria-describedby":void 0,"aria-labelledby":w,"aria-modal":r,className:Ve("ui-dialog",l),style:{width:a,zIndex:c},onInteractOutside:j=>j.preventDefault(),onOpenAutoFocus:v,onEscapeKeyDown:j=>{if(!r&&j.target instanceof Element&&!j.target.closest(".ui-dialog")){j.preventDefault();return}x?.(j)},onCloseAutoFocus:j=>{j.preventDefault(),r&&T.current?.isConnected&&T.current.focus({preventScroll:!0})},children:[f.jsxs("div",{className:"ui-dialog-surface",children:[f.jsx(WA,{className:Ve("ui-dialog-header",p?.header),children:f.jsx(eR,{asChild:!0,id:w,children:f.jsx("div",{className:"ui-dialog-title",children:u})})}),f.jsx("div",{className:Ve("ui-dialog-body",p?.body),children:m}),d&&f.jsx(JA,{className:Ve("ui-dialog-footer",p?.footer),children:d})]}),f.jsx(QA,{"aria-label":C,className:"ui-dialog-close",children:g})]})})}function tR({className:t,...r}){return f.jsx(Ij,{"data-slot":"radio-group",className:Ve("grid gap-3",t),...r})}function nR({children:t,indicator:r=!0,className:i,...a}){return f.jsxs(Bj,{"data-slot":"radio-group-item",className:Ve("aspect-square size-4 shrink-0 rounded-full border border-input text-primary shadow-xs transition-[color,box-shadow] outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:bg-input/30 dark:aria-invalid:ring-destructive/40",i),...a,children:[r&&f.jsx(Pj,{"data-slot":"radio-group-indicator",className:"relative flex items-center justify-center",children:f.jsx(wA,{className:"absolute top-1/2 left-1/2 size-2 -translate-x-1/2 -translate-y-1/2 fill-primary"})}),t]})}function rR(t){return null}function oR({value:t,onChange:r,children:i,className:a,name:c,disabled:l}){const u=E.Children.toArray(i).filter(E.isValidElement);return f.jsx(tR,{name:c,disabled:l,className:Ve("ui-radio-group",a),value:String(t),onValueChange:d=>{const m=u.find(p=>String(p.props.value)===d);m&&r({target:{value:m.props.value}})},children:u.map(({props:d})=>f.jsx(nR,{value:String(d.value),disabled:d.disabled,className:"ui-radio-option",indicator:!1,children:d.children},String(d.value)))})}const Ye={Group:oR,Button:rR};function aR({thumbLabel:t,className:r,defaultValue:i,value:a,min:c=0,max:l=100,...u}){const d=E.useMemo(()=>Array.isArray(a)?a:Array.isArray(i)?i:[c,l],[a,i,c,l]);return f.jsxs(_2,{"data-slot":"slider",defaultValue:i,value:a,min:c,max:l,className:Ve("relative flex w-full touch-none items-center select-none data-[disabled]:opacity-50 data-[orientation=vertical]:h-full data-[orientation=vertical]:min-h-44 data-[orientation=vertical]:w-auto data-[orientation=vertical]:flex-col",r),...u,children:[f.jsx(L2,{"data-slot":"slider-track",className:Ve("relative grow overflow-hidden rounded-full bg-muted data-[orientation=horizontal]:h-1.5 data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-1.5"),children:f.jsx(z2,{"data-slot":"slider-range",className:Ve("absolute bg-primary data-[orientation=horizontal]:h-full data-[orientation=vertical]:w-full")})}),Array.from({length:d.length},(m,p)=>f.jsx($2,{"data-slot":"slider-thumb","aria-label":t,className:"block size-4 shrink-0 rounded-full border border-primary bg-white shadow-sm ring-ring/50 transition-[color,box-shadow] hover:ring-4 focus-visible:ring-4 focus-visible:outline-hidden disabled:pointer-events-none disabled:opacity-50"},p))]})}function D0({value:t,onChange:r,ariaLabelForHandle:i,...a}){return f.jsx(aR,{...a,value:[t],onValueChange:c=>r(c[0]),thumbLabel:i})}const I0=t=>{let r;const i=new Set,a=(p,C)=>{const g=typeof p=="function"?p(r):p;if(!Object.is(g,r)){const b=r;r=C??(typeof g!="object"||g===null)?g:Object.assign({},r,g),i.forEach(v=>v(r,b))}},c=()=>r,d={setState:a,getState:c,getInitialState:()=>m,subscribe:p=>(i.add(p),()=>i.delete(p))},m=r=t(a,c,d);return d},iR=(t=>t?I0(t):I0),sR=t=>t;function lR(t,r=sR){const i=Ti.useSyncExternalStore(t.subscribe,Ti.useCallback(()=>r(t.getState()),[t,r]),Ti.useCallback(()=>r(t.getInitialState()),[t,r]));return Ti.useDebugValue(i),i}const k0=t=>{const r=iR(t),i=a=>lR(r,a);return Object.assign(i,r),i},cR=(t=>t?k0(t):k0),Il={min:20,max:150},L0={width:4e3,height:2e3},z0={width:210,height:297},Io=cR((t,r)=>({scale:100,navigatorVisible:!0,setScale:i=>t(a=>({...a,scale:Math.max(Il.min,Math.min(Il.max,Math.round(i)))})),getScale:()=>r().scale,setNavigatorVisible:i=>t(a=>({...a,navigatorVisible:i}))})),uR=()=>{const{scale:t,setScale:r,getScale:i}=Io(),a=c=>r(i()+c);return E.useEffect(()=>{const c=document.getElementById("answer-sheet-stadio"),l=d=>{if(!d.ctrlKey)return;d.preventDefault();const m=document.getElementById("answer-sheet"),p=m.getBoundingClientRect(),C=(d.clientX-p.left)/p.width,g=(d.clientY-p.top)/p.height;Hr.flushSync(()=>r(i()+(d.deltaY<0?5:-5)));const b=m.getBoundingClientRect();c.scrollLeft+=b.left+C*b.width-d.clientX,c.scrollTop+=b.top+g*b.height-d.clientY},u=d=>{(d.ctrlKey||d.metaKey)&&(d.key==="+"||d.key==="="||d.key==="-")&&(d.preventDefault(),r(i()+(d.key==="-"?-10:10)))};return c.addEventListener("wheel",l,{passive:!1}),window.addEventListener("keydown",u),()=>{c.removeEventListener("wheel",l),window.removeEventListener("keydown",u)}},[i,r]),f.jsxs("div",{className:$d["scale-wrapper"],"aria-label":"工作区缩放",children:[f.jsx(ce,{type:"text",size:"small","aria-label":"缩小",onClick:()=>a(-2),children:f.jsx(AA,{})}),f.jsx(D0,{className:$d.bar,ariaLabelForHandle:"缩放比例",min:Il.min,max:Il.max,step:1,value:t,onChange:r}),f.jsx(ce,{type:"text",size:"small","aria-label":"放大",onClick:()=>a(2),children:f.jsx(OA,{})}),f.jsx(A0,{title:"重置缩放",children:f.jsxs("div",{role:"button",tabIndex:0,"aria-label":"重置缩放",onClick:()=>r(100),onKeyDown:c=>{c.key==="Enter"&&r(100)},className:T0("font-12 grey ml-5 pointer",$d.percent),children:[t,"%"]})})]})},dR=()=>{const[t,r]=E.useState(!1);E.useEffect(()=>{const a=()=>r(document.fullscreenElement===document.getElementById("uni-answer-sheet"));return document.addEventListener("fullscreenchange",a),()=>document.removeEventListener("fullscreenchange",a)},[]);const i=async()=>{try{document.fullscreenElement?await document.exitFullscreen():await document.getElementById("uni-answer-sheet").requestFullscreen()}catch{}};return f.jsx(R0,{type:t?"icon-quxiaoquanping":"icon-quanping",className:"ml-5",padding:[0,5],role:"button",tabIndex:0,"aria-label":t?"取消全屏":"全屏",tooltip:t?"取消全屏":"全屏",onKeyDown:a=>{(a.key==="Enter"||a.key===" ")&&(a.preventDefault(),i())},onClick:i})},fR=({summary:t})=>{const{navigatorVisible:r,setNavigatorVisible:i}=Io();return f.jsxs("div",{className:dA.footer,"aria-label":"工作区底栏",children:[f.jsx("div",{className:"font-12 grey",children:t}),f.jsxs("div",{children:[f.jsx(R0,{type:"icon-shitudaohang",padding:[0,5],tooltip:(r?"隐藏":"显示")+"视图导航",active:r,role:"button",tabIndex:0,"aria-label":(r?"隐藏":"显示")+"视图导航",onKeyDown:a=>{(a.key==="Enter"||a.key===" ")&&(a.preventDefault(),i(!r))},className:"mr-5",onClick:()=>i(!r)}),f.jsx(uR,{}),f.jsx(dR,{})]})]})},B0={"stadio-wrapper":"_stadio-wrapper_jknpq_1",container:"_container_jknpq_15"},hR=({width:t=So(z0.width),height:r=So(z0.height),children:i})=>{const{scale:a}=Io();return f.jsx("div",{id:"answer-sheet",style:{transform:`scale(${a/100})`,height:r,width:t},children:i})};var Hi=(t=>(t.STADIO_SCROLL_CHANGE="STADIO_SCROLL_CHANGE",t))(Hi||{});class mR{constructor(){cm(this,"callbacks",new Map)}on(r,i){this.callbacks.set(r,i)}emit(r,...i){const a=this.callbacks.get(r);a&&a(i)}depose(r){this.callbacks.delete(r)}}const kl=new mR,pR=({width:t,height:r,children:i,onBackgroundClick:a})=>{const c=E.useRef(null),l=E.useRef(null),{scale:u}=Io(),d=u/100,m=Math.max(L0.width,t*d+600),p=Math.max(L0.height,r*d+600),C=E.useRef(null);return E.useLayoutEffect(()=>{const g=l.current,b=(m-t*d)/2,v=(p-r*d)/2,x=C.current;if(!x||x.width!==t)g.scrollLeft=Math.max(0,b+t*d/2-g.clientWidth/2),g.scrollTop=Math.max(0,v-54);else{const S=(g.scrollLeft+g.clientWidth/2-x.left)/x.zoom,w=(g.scrollTop+g.clientHeight/2-x.top)/x.zoom;g.scrollLeft=b+S*d-g.clientWidth/2,g.scrollTop=v+w*d-g.clientHeight/2}C.current={left:b,top:v,zoom:d,width:t},kl.emit(Hi.STADIO_SCROLL_CHANGE)},[m,p,t,r,d]),E.useEffect(()=>{const g=l.current,b=c.current;let v=()=>{};const x=w=>{if(w.button!==1)return;w.preventDefault(),v();const T=w.clientX,j=w.clientY,R=g.scrollLeft,O=g.scrollTop,M=document.body.style.cursor;document.body.style.cursor="grabbing";const D=I=>g.scrollTo({left:R-I.clientX+T,top:O-I.clientY+j}),_=I=>{I.button===1&&v()};v=()=>{document.body.style.cursor=M,window.removeEventListener("mousemove",D),window.removeEventListener("mouseup",_),window.removeEventListener("blur",v)},window.addEventListener("mousemove",D),window.addEventListener("mouseup",_),window.addEventListener("blur",v)},S=()=>kl.emit(Hi.STADIO_SCROLL_CHANGE);return b.addEventListener("mousedown",x),g.addEventListener("scroll",S),()=>{v(),b.removeEventListener("mousedown",x),g.removeEventListener("scroll",S)}},[]),f.jsx("div",{className:B0["stadio-wrapper"],ref:l,id:"answer-sheet-stadio","aria-label":"制卡工作区",children:f.jsx("div",{className:B0.container,ref:c,id:"answer-sheet-container",style:{height:p,width:m},onPointerDown:g=>{g.target===g.currentTarget&&a?.()},children:f.jsx(hR,{width:t,height:r,children:i})})})},qd={"navigator-wrapper":"_navigator-wrapper_rb3fn_1","fake-page":"_fake-page_rb3fn_12",viewport:"_viewport_rb3fn_17"},gR=()=>{const{scale:t}=Io(),[r,i]=E.useState({ratio:20,width:200,height:100,view:{x:0,y:0,width:0,height:0},pages:[]}),a=E.useRef(null),c=E.useRef(()=>{});return E.useEffect(()=>{const l=document.getElementById("answer-sheet-stadio"),u=document.getElementById("answer-sheet-container"),d=document.getElementById("answer-sheet");let m=0;const p=()=>{const b=Math.max(20,u.offsetWidth/200,u.offsetHeight/160),v=u.getBoundingClientRect(),x=Array.from(d.querySelectorAll("[data-paper-page]")),S=(x.length?x:[d]).map(T=>{const j=T.getBoundingClientRect();return{x:(j.left-v.left)/b,y:(j.top-v.top)/b,width:j.width/b,height:j.height/b}}),w={ratio:b,width:u.offsetWidth/b,height:u.offsetHeight/b,view:{x:l.scrollLeft/b,y:l.scrollTop/b,width:l.clientWidth/b,height:l.clientHeight/b},pages:S};i(T=>JSON.stringify(T)===JSON.stringify(w)?T:w)},C=()=>{cancelAnimationFrame(m),m=requestAnimationFrame(p)};c.current=C;const g=new ResizeObserver(C);return[l,u,d].forEach(b=>g.observe(b)),kl.on(Hi.STADIO_SCROLL_CHANGE,C),C(),()=>{c.current=()=>{},cancelAnimationFrame(m),g.disconnect(),kl.depose(Hi.STADIO_SCROLL_CHANGE)}},[]),E.useLayoutEffect(()=>{c.current()},[t]),f.jsxs("div",{className:qd["navigator-wrapper"],"aria-label":"视图导航",style:{width:r.width,height:r.height},children:[r.pages.map((l,u)=>f.jsx("div",{className:qd["fake-page"],"data-nav-page":u+1,style:{left:l.x,top:l.y,width:l.width,height:l.height}},u)),f.jsx("div",{className:qd.viewport,role:"button",tabIndex:0,"aria-label":"拖动导航视口",style:{left:r.view.x,top:r.view.y,width:r.view.width,height:r.view.height},onPointerDown:l=>{if(l.button!==0)return;l.preventDefault();const u=document.getElementById("answer-sheet-stadio");a.current={x:l.clientX,y:l.clientY,left:u.scrollLeft,top:u.scrollTop},l.currentTarget.setPointerCapture(l.pointerId)},onPointerMove:l=>{if(!a.current)return;document.getElementById("answer-sheet-stadio").scrollTo({left:a.current.left+(l.clientX-a.current.x)*r.ratio,top:a.current.top+(l.clientY-a.current.y)*r.ratio})},onPointerUp:l=>{a.current=null,l.currentTarget.releasePointerCapture(l.pointerId)},onLostPointerCapture:()=>{a.current=null},onKeyDown:l=>{const d={ArrowLeft:[-80,0],ArrowRight:[80,0],ArrowUp:[0,-80],ArrowDown:[0,80]}[l.key];d&&(l.preventDefault(),document.getElementById("answer-sheet-stadio").scrollBy({left:d[0],top:d[1]}))}})]})},Yd=new WeakMap;function yR(t){return Array.from(t.querySelectorAll("[data-card-editor-host]")).flatMap(r=>{const i=Yd.get(r),a=r.querySelector(".rt-content");if(!i||!a||a.closest("[hidden]")||!a.getClientRects().length)return[];const c=a.getBoundingClientRect(),l=c.width/a.offsetWidth,u=[...i.getAnswerRegions()],d=new Set(u.map(m=>m.id));return a.querySelectorAll(".rt-choice-stem-glyph").forEach(m=>{const p=m.dataset.optionId,C=m.getBoundingClientRect();!p||d.has(p)||C.width<=0||C.height<=0||(d.add(p),u.push({id:p,pos:-1,type:"choiceOption",attrs:{label:m.textContent||"",questionId:m.dataset.fillQuestionId},x:(C.x-c.x)/l,y:(C.y-c.y)/l,width:C.width/l,height:C.height/l}))}),u.map(m=>({element:a,region:m,rect:{x:c.x+m.x*l,y:c.y+m.y*l,width:m.width*l,height:m.height*l}}))})}const H0=E.createContext(null),Ll=E.forwardRef((t,r)=>{const i=E.useContext(H0);if(!i)throw new Error("制卡需要显式注册富文本插件");const a=E.useRef(null),c=E.useRef(null),l=E.useRef(t);l.current=t;const u=E.useRef(null),d=E.useRef(null),m=E.useRef(!1),p=E.useRef(0),C=()=>({...l.current,onChange:b=>l.current.onChange?.(b),onLayout:b=>l.current.onLayout?.(b),onContentSelect:b=>l.current.onContentSelect?.(b)}),g=b=>{const v=c.current,x=++p.current;v&&v.ready.then(()=>{let S=0;const w=()=>{x!==p.current||c.current!==v||l.current.readOnly||(v.getStatus().editable?b(v):++S<120&&requestAnimationFrame(w))};requestAnimationFrame(w)}).catch(S=>{d.current=S})};return E.useImperativeHandle(r,()=>({getDocument:()=>m.current?c.current.getDocument():null,getAnswerRegions:()=>m.current?c.current.getAnswerRegions():[],setDocument(b){m.current?c.current.setDocument(b):u.current=b},syncDocument(b){m.current?c.current.syncDocument(b):u.current=b},focus:b=>g(v=>v.focus(b)),focusContent:b=>l.current.contentTargets?.some(v=>v.id===b)?(g(v=>{v.focusContent(b)||v.focus("start")}),!0):!1,insertAnswerRegion:(b,v,x)=>g(S=>S.insertAnswerRegion(b,v,x)),getStatus(){if(d.current)throw d.current;return m.current?c.current.getStatus():{ready:!1,editable:!1,composing:!1,uploading:!1,layoutPending:!0}}}),[]),E.useEffect(()=>{let b=!0;d.current=null;const v=document.createElement("div");v.style.display="contents",a.current.append(v);const x=i.create(v,C()),S=a.current;return Yd.set(S,x),c.current=x,x.ready.then(()=>{b&&(m.current=!0,x.setOptions(C()),u.current&&(x.syncDocument(u.current),u.current=null))}).catch(w=>{b&&(d.current=w)}),()=>{b=!1,m.current=!1,c.current=null,p.current++,Yd.delete(S),v.remove(),queueMicrotask(()=>x.destroy())}},[i]),E.useEffect(()=>{c.current?.setOptions(C())}),f.jsx("div",{ref:a,"data-card-editor-host":"",style:{display:"contents"}})}),P0={judge:"JUDGE",fill:"FILLBLANK",answer:"SHORTANSWER",writing:"CCOMPOSITION",english:"ECOMPOSITION",reading:"READTHENANSWER",cloze:"CLOZE",completion:"TEXT_COMPLETION",matching:"INFO_MATCHING",chunk:"CHUNK_CHOICE",composite:"MIXED",optional:"SHORTANSWER"};function bR(t){if(t.reference||!t.exercise)return t;const r=t.exercise,i=P0[t.kind]||"SHORTANSWER",a=hu(i);return a.fillNewLine=r.fillNewLine,a.optional=t.kind==="optional"&&r.items.length>1,a.choose=Math.max(1,Math.min(r.chooseCount,r.items.length-1)),a.questions=r.items.map(c=>{const l=i==="MIXED"?c.kind==="choice"?c.choice.multiple?"MCHOICE":"SCHOICE":P0[c.kind]||"SHORTANSWER":i,u=l==="MIXED"?"SHORTANSWER":l,d=pu({...mu(u),partCount:1,optionCount:u==="JUDGE"?2:c.choice.options.length,score:c.score},Number(c.label)||1);if(d.id=c.id,d.label=c.label,d.document=c.document,d.choice={...ia(c.choice,u,u==="JUDGE"?2:Math.min(u==="CHUNK_CHOICE"?26:12,c.choice.options.length)),id:c.id,label:c.label},d.characters=Math.min(1200,Math.max(1,c.area.rows*c.area.columns)),d.lines=Math.min(100,Math.max(1,c.area.rows)),d.height=Math.max(30,c.area.rows*c.area.rowHeight),u==="FILLBLANK"||u==="TEXT_COMPLETION")d.parts=c.blanks.map((m,p)=>({...Si(c.blanks.length===1?c.label:`${c.label}.${p+1}`,m.score,u),id:m.id,width:m.width,breakAfter:m.breakAfter})),d.score=Vn(d.parts);else if(u==="SHORTANSWER")d.parts=[{...Si(c.label,c.score,u),document:c.document,height:d.height}];else if(Le(u)){const m=Si(c.label,c.score,u,c.choice.options.length);d.parts=[{...m,choice:{...d.choice,id:m.id}}]}return["SHORTANSWER","CCOMPOSITION","ECOMPOSITION"].includes(u)&&(d.document={...d.document,content:{...d.document.content,content:[...yi(d.label,d.score).content.content,...d.document.content.content||[]]}},d.parts=d.parts.map(m=>({...m,document:{...m.document,content:{...m.document.content,content:[...yi(m.label,m.score).content.content,...m.document.content.content||[]]}}}))),d}),{...t,reference:a}}const gr="reference-merged-objective";function xR(t,r){const i=t.blocks.map(d=>d.reference&&t.choiceDirection&&t.choiceDirection!==d.reference.layout.direction?{...d,reference:{...d.reference,layout:{...d.reference.layout,direction:t.choiceDirection}}}:d);if(!t.mergeObjective)return i;const a=i.find(d=>d.reference?.questions.some(m=>wt(m.type)));if(!a?.reference)return i;const c=i.flatMap(d=>{if(!d.reference)return[];const m=na({...d.reference.layout,questions:sa(d.reference)},d.document,t.questionCard!==!1||r===d.id).concentrated,p=new Set(m.questions.map(C=>C.id));return d.reference.questions.filter(C=>wt(C.type)).flatMap(C=>{if(!Le(C.type))return p.has(C.id)?[C]:[];const g=C.parts.filter(b=>p.has(b.id));return g.length?[{...C,parts:g}]:[]})});if(!c.length)return i;const l={...a,id:gr,document:$t(),reference:{...hu("MIXED"),layout:{...a.reference.layout,presentation:"concentrated"},questions:c}},u=i.flatMap(d=>{if(!d.reference)return[d];const m=d.reference.questions.filter(C=>!wt(C.type)),p=t.questionCard!==!1&&!xn(d.document)||r===d.id;return!m.length&&!p&&d.reference.questions.length?[]:[d]});return[l,...u]}function U0(t){const r=t.reference;if(!r)return[];const i=r.type==="MIXED"?[{id:t.id,label:"公共材料",kind:"material"}]:[];return r.questions.forEach(a=>{const c=Le(a.type);i.push({id:a.id,label:c?`第 ${a.parts.map(l=>l.label).join("、")} 题材料`:`第 ${a.label} 题题干`,kind:c?"material":"question",choice:!c&&wt(a.type),hideOptionsAtStem:r.textVersion===1&&a.type==="JUDGE"}),a.parts.filter(l=>r.textVersion!==1||l.text).forEach(l=>i.push({id:l.id,label:`第 ${l.label} ${a.type==="FILLBLANK"?"空":"题"}`,kind:"question",parentId:a.id,choice:c&&wt(a.type),hideOptionsAtStem:r.textVersion===1&&a.type==="INFO_MATCHING",inlineOptions:r.textVersion===1&&["CLOZE","INFO_MATCHING"].includes(a.type),optionWidth:r.textVersion===1&&a.type==="INFO_MATCHING"?70:void 0}))}),i}function $0(t,r){return{...t,attrs:{...t.attrs,contentId:r}}}function vR(t,r,i){const a=new Map(r.questions.filter(u=>xi(u.type)).flatMap(u=>u.parts).map(u=>[u.id,u])),c=u=>{const d=u.type==="answerLine"&&a.get(u.attrs?.id),m=d&&Math.max(24,Math.min(600,i*d.width/100));if(d&&(u.attrs?.label!==d.label||u.attrs?.width!==m))return{...u,attrs:{...u.attrs,label:d.label,width:m}};const p=u.content?.map(c);return p?.some((C,g)=>C!==u.content[g])?{...u,content:p}:u},l=c(t.content);return l===t.content?t:{...t,content:l}}function SR(t){if(!t.reference)return t.document;const r=new Map;t.reference.questions.forEach(c=>{[c.choice,...c.parts.map(l=>l.choice)].forEach(l=>{l.contentTarget&&r.set(l.contentTarget.groupId,l.id)})});let i=!1;const a=t.document.content.content?.map(c=>{if(c.attrs?.contentId)return c;let l;const u=d=>{d.type==="choiceGroup"&&(l=r.get(d.attrs?.id)||l),d.type==="choiceStemAnchor"&&(l=r.get(d.attrs?.groupId)||l),d.content?.forEach(u)};return u(c),l?(i=!0,$0(c,l)):c});return i?{...t.document,content:{...t.document.content,content:a}}:t.document}function CR(t,r,i){const a=w=>w.questions.flatMap(T=>[T.id,...T.parts.map(j=>j.id)]),c=new Set(a(r)),l=new Set(a(i)),u=new Set([...c].filter(w=>!l.has(w)));let d=!1;const m=w=>{if(u.has(w.attrs?.contentId)||w.type==="answerLine"&&u.has(w.attrs?.id))return d=!0,null;const T=w.content?.map(m).filter(j=>j!==null);return T?{...w,content:T}:w},p=m(t.content),C=p.content||[],g=a(i),b=C.filter(w=>l.has(w.attrs?.contentId)),v=[...b].sort((w,T)=>g.indexOf(w.attrs.contentId)-g.indexOf(T.attrs.contentId));let x=0;const S=C.map(w=>l.has(w.attrs?.contentId)?v[x++]:w);return b.some((w,T)=>w!==v[T])&&(d=!0),d?{...t,content:{...p,content:S.length?S:$t().content.content}}:t}function wR(t,r,i){const a=new Map([[r.id,i.id],...r.parts.map((v,x)=>[v.id,i.parts[x].id])]),c=new Map([...r.choice.options.map((v,x)=>[v.id,i.choice.options[x].id]),...r.parts.flatMap((v,x)=>v.choice.options.map((S,w)=>[S.id,i.parts[x].choice.options[w].id]))]),l=new Map([[r.text?.groupId,i.text?.groupId],...r.parts.map((v,x)=>[v.text?.groupId,i.parts[x].text?.groupId])].filter(v=>!!(v[0]&&v[1]))),u=t.content.content||[],d=u.filter(v=>a.has(v.attrs?.contentId));if(!d.length)return t;const m=vo(d),p=(v,x)=>({...v,...v.attrs?{attrs:{...v.attrs,...v.type==="choiceOption"&&c.has(x.attrs?.id)?{id:c.get(x.attrs.id)}:{},...v.type==="choiceGroup"&&l.has(x.attrs?.id)?{id:l.get(x.attrs.id)}:{},...a.has(x.attrs?.contentId)?{contentId:a.get(x.attrs.contentId)}:{},...v.type==="choiceStemAnchor"&&a.has(String(x.attrs?.groupId).slice(9))?{groupId:ru(a.get(String(x.attrs.groupId).slice(9)))}:{}}}:{},...v.content?{content:v.content.map((S,w)=>p(S,x.content[w]))}:{}}),C=new Map(r.parts.map((v,x)=>[v.id,i.parts[x].id])),g=(v,x)=>({...v,...x.type==="answerLine"&&C.has(x.attrs?.id)?{attrs:{...v.attrs,id:C.get(x.attrs.id)}}:{},...v.content?{content:v.content.map((S,w)=>g(S,x.content[w]))}:{}}),b=Math.max(...d.map(v=>u.indexOf(v)));return{...t,content:{...t.content,content:[...u.slice(0,b+1),...m.map((v,x)=>g(p(v,d[x]),d[x])),...u.slice(b+1)]}}}function ER(t,r){const i=t.content.content||[],a=new Set(i.map(l=>l.attrs?.contentId).filter(Boolean)),c=(r.content.content||[]).filter(l=>l.attrs?.contentId&&!a.has(l.attrs.contentId));return c.length?{...t,content:{...t.content,content:[...xn(t)?[]:i,...c]}}:t}function TR(t,r){const i={};let a=1;return{sectionInfoList:t.filter(l=>l.reference).map((l,u)=>{const d=l.reference,m=d.textVersion===1?d:Em({...d,questions:d.questions.map(x=>({...x,text:x.text||{...bi(x.type,x.choice,Le(x.type)),numbered:!1,itemsContent:[]},parts:x.parts.map(S=>({...S,text:S.text||{...bi(x.type,S.choice),numbered:!1,itemsContent:[]}}))}))},l.document,l.id),p=m.sectionSeq??u+1,C=x=>x?.itemsContent.map(S=>({id:S.id,key:S.key,content:r.serialize(S.content)}))||[],g=x=>r.serialize(x?.content||$t()),b=(x,S,w)=>{const T=x?Gs({...x,itemsContent:[]},S,w):[],j=r.serialize(kr(T)),R=r.unwrapParagraphs||(O=>O.replace(/^<p\b[^>]*>([\s\S]*)<\/p>$/,"$1"));return{content:R(j,!0),contentNoP:R(j),items:C(x).map(O=>`${O.key}.${R(O.content)}`)}},v=m.questions.map(x=>{const S=Le(x.type),w=a;a+=S?x.parts.length:1;const T=x.referenceData||{},j=T.questionId??x.id,R=S?x.parts.map((D,_)=>({...D.referenceData,questionId:D.referenceData?.questionId??D.id,questionPid:j,questiontypeCode:x.type,seq:w+_,showSeq:D.label,itemShowNames:[D.label],score:D.score,itemcount:D.choice.options.length,content:g(D.text),itemsContent:C(D.text)})):void 0,O={...T,questionId:j,questiontypeCode:x.type,seq:w,showSeq:x.label,showSeqs:S?x.parts.map(D=>D.label):null,itemShowNames:x.parts.length?x.parts.map(D=>D.label):[x.label],itemcount:wt(x.type)?x.choice.options.length:x.parts.length||1,childNum:S?x.parts.length:void 0,score:x.score,itemScores:x.parts.length?x.parts.map(D=>D.score):[x.score],content:g(x.text),itemsContent:C(x.text),...R?{items:R}:{},lessScore:x.choice.lessScore,scoreType:x.choice.scoreType,rightAnswers:x.rightAnswers,singleScore:x.singleScore,extension:{...T.extension||{},...x.type==="CCOMPOSITION"?{kong:x.characters}:{},...x.type==="ECOMPOSITION"?{hang:x.lines}:{},uniEditor:{text:x.text,choice:x.choice,height:x.height,contentHeight:x.contentHeight,halfPoint:x.halfPoint,parts:x.parts.map(D=>({id:D.id,text:D.text,width:D.width,height:D.height,breakAfter:D.breakAfter,choice:D.choice,document:D.document})),document:x.document}}},M=b(x.text,x.id,x.label);return i[String(j)]=S?{...M,items:x.parts.map((D,_)=>({seq:w+_,...b(D.text,D.id,D.label)}))}:M,m.type==="MIXED"&&(i[`secContent${j}`]=r.serialize(m.material||$t())),O});return{...m.referenceData,sectionSeq:p,sectionName:l.title,sectionQuestionType:m.type,questionInfolist:v,...m.type==="MIXED"?{content:r.serialize(m.material||$t())}:{},extension:{...m.referenceData?.extension||{},uniEditor:{id:l.id,layout:m.layout,material:m.material,document:l.document,optional:m.optional,choose:m.choose,optionalHeight:m.optionalHeight,scoreType:m.scoreType,fillNewLine:m.fillNewLine}}}}),quesTextMap:i}}function G0(t,r){const i=Array.isArray(t)?t:t.sectionInfoList;if(!Array.isArray(i))throw new Error("缺少 sectionInfoList");const a=new Set,c=l=>{const u=l==null||l===""?crypto.randomUUID():String(l);if(a.has(u))throw new Error(`题目 ID 重复:${u}`);return a.add(u),u};return i.map(l=>{if(!(l.sectionQuestionType in nr)||!Array.isArray(l.questionInfolist))throw new Error("题块类型或 questionInfolist 无效");const u=Tm(l.sectionQuestionType),d=l.extension;d?.uniEditor?.id&&(u.id=d.uniEditor.id),u.title=l.sectionName;const{questionInfolist:m,...p}=l,C=[],g=new Map;m.forEach(v=>{if(v.questionPid!==void 0&&v.questionPid!==null&&Le(v.questiontypeCode)){const x=String(v.questionPid);let S=g.get(x);S||(S={...v,questionId:v.questionPid,questionPid:void 0,content:String(v.parentContent||""),items:[],showSeqs:[]},g.set(x,S),C.push(S)),S.items.push(v),S.showSeqs.push(v.showSeq??v.seq??S.items.length)}else C.push(v)}),g.forEach(v=>{v.itemScores=v.items.map(x=>x.score??null),v.score=v.itemScores.some(x=>x===null)?null:v.itemScores.reduce((x,S)=>x+(S||0),0)});const b=C.map((v,x)=>{if(!(v.questiontypeCode in nr)||v.questiontypeCode==="MIXED")throw new Error("子题类型无效");const S=v.questiontypeCode,w=Le(S),T=w?v.items?.length||v.showSeqs?.length||v.childNum||1:["FILLBLANK","SHORTANSWER"].includes(S)&&(v.itemScores?.length||v.itemcount)||1;if(!Number.isInteger(T)||T<1||T>200)throw new Error("子题数量无效");const j=v.score??null,R=mu(S),O=pu({...R,characters:Number(v.extension?.kong)||R.characters,lines:Number(v.extension?.hang)||R.lines,partCount:T,score:w||["FILLBLANK","SHORTANSWER"].includes(S)?v.itemScores?.[0]??(j===null?null:j/T):j,optionCount:v.itemcount||v.itemsContent?.length||4},Number(v.seq)||x+1);O.id=c(v.questionId??v.id),O.label=String(v.showSeq??v.itemShowNames?.[0]??v.seq??x+1),O.choice.id=O.id,O.choice.label=O.label,O.choice.score=j,O.choice.scoreType=v.scoreType||O.choice.scoreType,O.choice.lessScore=v.lessScore??O.choice.lessScore,O.rightAnswers=v.rightAnswers??O.rightAnswers,O.singleScore=v.singleScore??O.singleScore,O.score=j,O.referenceData=v;const M=v.extension?.uniEditor;M?.choice&&(O.choice={...M.choice,id:O.id,label:O.label,score:j}),O.height=M?.height??O.height,O.contentHeight=M?.contentHeight??O.contentHeight,O.halfPoint=M?.halfPoint??O.halfPoint;const D=(_,I,z,H=!1,L)=>{if(L)return structuredClone(L);const $=bi(S,{...z,id:I},H);return{...$,content:r.parse(_.content||""),itemsContent:!H&&_.itemsContent?_.itemsContent.map((Y,U)=>({id:Y.id===void 0?z.options[U]?.id||crypto.randomUUID():String(Y.id),key:Y.key,content:r.parse(Y.content||"")})):$.itemsContent}};return O.text=D(v,O.id,O.choice,w,M?.text),O.text.itemsContent.length&&(O.choice.options=O.text.itemsContent.map(_=>({id:_.id,label:_.key}))),O.document=M?.document||vn(O.document,O.label,O.score),O.parts=O.parts.map((_,I)=>{const z=v.items?.[I],H=M?.parts?.[I];return _.id=c(H?.id??z?.questionId??z?.id),_.referenceData=z,_.label=String(z?.showSeq??v.itemShowNames?.[I]??v.showSeqs?.[I]??(w?Number(v.seq||1)+I:T===1?O.label:`${O.label}.${I+1}`)),_.score=z?.score??v.itemScores?.[I]??_.score,_.choice={...H?.choice||_.choice,id:_.id,label:_.label,score:_.score,scoreType:z?.scoreType||v.scoreType||_.choice.scoreType,lessScore:z?.lessScore??v.lessScore??_.choice.lessScore},w&&S!=="TEXT_COMPLETION"&&(_.text=D(z||{itemsContent:v.itemsContent?.map(({key:L,content:$})=>({key:L,content:$}))},_.id,_.choice,!1,H?.text)),_.text?.itemsContent.length&&(_.choice.options=_.text.itemsContent.map(L=>({id:L.id,label:L.key}))),_.document=H?.document||vn(_.document,_.label,_.score),{..._,...H?{width:H.width??_.width,height:H.height??_.height,breakAfter:H.breakAfter??_.breakAfter}:{}}}),O.characters=Number(v.extension?.kong)||O.characters,O.lines=Number(v.extension?.hang)||O.lines,O});return u.reference={...u.reference,textVersion:1,sectionSeq:l.sectionSeq,referenceData:p,questions:b,material:d?.uniEditor?.material||r.parse(l.content||""),...d?.uniEditor?{layout:d.uniEditor.layout||u.reference.layout,optional:!!d.uniEditor.optional,choose:d.uniEditor.choose||1,optionalHeight:d.uniEditor.optionalHeight??200,scoreType:d.uniEditor.scoreType||u.reference.scoreType,fillNewLine:!!d.uniEditor.fillNewLine}:{}},d?.uniEditor?.document&&(u.document=d.uniEditor.document),u.document=fu(u),u})}class Xr extends Error{constructor(r,i){super(i),this.code=r}}const V0=t=>!t.closest("[hidden]")&&t.getClientRects().length>0;function jR(t,r,i){const a=t.getBoundingClientRect(),c=a.width/i.width;if(!t.isConnected||!(c>0))throw new Xr("LAYOUT_UNAVAILABLE","请显示题卡后再获取识别坐标");const l=g=>({x:(g.x-a.x)/c,y:(g.y-a.y)/c,width:g.width/c,height:g.height/c}),u=Array.from(t.querySelectorAll(".card-sheet[data-paper-page]")).map(g=>{const b=l(g.getBoundingClientRect()),v=Object.fromEntries(Array.from(g.querySelectorAll("[data-anchor]")).map(j=>[j.dataset.anchor,l(j.getBoundingClientRect())]));if(Object.keys(v).length!==4)throw new Xr("MISSING_ANCHORS","缺少纸面定位点,请先完成题卡初始化");const x=v.topLeft,S=j=>Am({...j,x:j.x-b.x,y:j.y-b.y}),w={pageNumber:Number(g.dataset.paperPage),pageSize:{width:qn(i.width),height:qn(i.height)},anchorOrigin:{x:qn(x.x-b.x),y:qn(x.y-b.y)},anchorSize:{width:26,height:13},panelSize:{width:qn(v.topRight.x+v.topRight.width-x.x),height:qn(v.bottomRight.y+v.bottomRight.height-x.y)},anchors:{topLeft:S(v.topLeft),topRight:S(v.topRight),bottomLeft:S(v.bottomLeft),bottomRight:S(v.bottomRight)},regions:[]};for(const j of Object.values(v))if(j.x<b.x-.1||j.y<b.y-.1||j.x+j.width>b.x+b.width+.1||j.y+j.height>b.y+b.height+.1)throw new Xr("MARK_OUTSIDE_PAPER","定位点超出纸面,请调整边距");const T=Array.from(g.querySelectorAll("[data-anchor], .card-code-marks, .card-exam-qr, .card-paper-footer > span")).map(j=>l(j.getBoundingClientRect()));return T.forEach((j,R)=>T.slice(R+1).forEach(O=>{const M=Rm(j,O);if(M&&M.width>.3&&M.height>.3)throw new Xr("OVERLAPPING_PAPER_MARKS","纸面识别标记与页码重叠,请调整边距或版式")})),{data:w,paper:b,toPaper:S}});if(u.length>8)throw new Xr("PAGE_CODE_LIMIT","参考纸面编码最多支持 8 个纸面,请减少页数或调整版式");const d=new Map;r.blocks.forEach(g=>{g.reference?.questions.forEach(b=>{const v={blockId:g.id,questionId:b.id,answerId:b.id};d.set(b.id,v),b.choice.options.forEach(x=>d.set(x.id,v)),b.parts.forEach(x=>{const S={...v,partId:x.id,answerId:x.id};d.set(x.id,S),x.choice.options.forEach(w=>d.set(w.id,S))})}),g.choices?.questions.forEach(b=>{const v={blockId:g.id,questionId:b.id,answerId:b.id};d.set(b.id,v),b.options.forEach(x=>d.set(x.id,v))})});const m=new Map,p=(g,b,v)=>{if(![g.x,g.y,g.width,g.height].every(Number.isFinite)||g.width<=0||g.height<=0)throw new Xr("INVALID_RECOGNITION_RECT","识别区域尺寸无效,请检查内容是否已完成布局");const x=u.flatMap(M=>{const D=Rm(g,M.paper);return D?[{page:M,rect:D}]:[]}),S=x.reduce((M,D)=>M+D.rect.width*D.rect.height,0);if(!x.length||g.width*g.height-S>Math.max(g.width,g.height)*.2||x.length!==1)throw new Xr("REGION_OUTSIDE_PAPER","识别区域超出纸面,请调整内容或版式");const{page:w}=x[0],T=`${w.data.pageNumber}/${v}`,j=m.get(T)||0;m.set(T,j+1);const R=Array.from({length:i.columns},(M,D)=>D).find(M=>g.x>=i.columnX(w.data.pageNumber-1,M)-1&&g.x<i.columnX(w.data.pageNumber-1,M)+i.columnWidth+1),O={...b,id:`${T}/${j}`,rect:w.toPaper(g),...R!==void 0?{columnNumber:R+1}:{}};return w.data.regions.push(O),O},C=(g,b)=>{const v=g.closest("[data-exercise-item], [data-exercise-id], [data-question-id]"),x=v?.dataset.exerciseItem||v?.dataset.exerciseId||v?.dataset.questionId;return{blockId:g.closest("[data-block-id]")?.dataset.blockId,...d.get(b||"")||d.get(x||"")}};return t.querySelectorAll("[data-recognition]").forEach(g=>{if(!V0(g))return;const b=g.dataset.recognition,v=g.dataset.answerId,x=C(g,g.dataset.optionId||v),S=g.dataset.recognitionRole||"region",w={...x,sectionType:b,role:S,...g.dataset.recognitionScope==="section"?{scope:"section"}:{},...v?{answerId:v}:{},...g.dataset.optionId?{optionId:g.dataset.optionId}:{},...g.dataset.value!==void 0?{value:g.dataset.value}:{},...g.dataset.questionIds?{questionIds:g.dataset.questionIds.split(",")}:{}},T=`${b}/${x.blockId||"paper"}/${v||""}/${g.dataset.optionId||""}/${S}/${g.dataset.value||""}/${g.dataset.fragment||""}`,j=p(l(g.getBoundingClientRect()),w,T);g.querySelectorAll("[data-recognition-cell]").forEach(R=>{R.closest("[data-recognition]")!==g||!V0(R)||p(l(R.getBoundingClientRect()),{...w,role:"cell",parentId:j.id,value:R.dataset.recognitionCell},`${T}/cell/${R.dataset.recognitionCell}`)})}),yR(t).forEach(({element:g,region:b,rect:v})=>{const x=b.id||`position-${b.pos}`,S=C(g,x),w=b.type==="choiceOption"||b.type==="choiceMarker",T=w?"MultiChoice":"Checkbox";p(l(v),{...S,sectionType:T,role:b.type==="answerLine"?"line":"cell",answerId:d.get(x)?.answerId||x,...w?{optionId:x}:{},...b.attrs.label?{value:String(b.attrs.label)}:{}},`editor/${S.blockId||"paper"}/${x}/${b.pos}`)}),u.forEach(({data:g})=>{const b=new Map;g.regions.filter(v=>v.sectionType==="MultiChoice"&&v.role==="cell").forEach(v=>{const x=`${v.blockId||""}/${v.answerId||""}/${v.columnNumber||""}`,S=b.get(x)||[];S.push(v),b.set(x,S)}),b.forEach((v,x)=>{const S=v[0],w=Math.min(...v.map(M=>M.rect.x)),T=Math.min(...v.map(M=>M.rect.y)),j=Math.max(...v.map(M=>M.rect.x+M.rect.width)),R=Math.max(...v.map(M=>M.rect.y+M.rect.height)),O=`${g.pageNumber}/MultiChoice/group/${x}`;g.regions.push({id:O,sectionType:"MultiChoice",role:"region",blockId:S.blockId,questionId:S.questionId,partId:S.partId,answerId:S.answerId,columnNumber:S.columnNumber,rect:Am({x:w,y:T,width:j-w,height:R-T})}),v.forEach(M=>{M.parentId=O})}),g.regions.filter(v=>!v.parentId&&v.scope!=="section").forEach(v=>{const x=g.regions.filter(S=>S!==v&&S.role==="region"&&(v.role!=="region"||S.scope==="section")&&(S.blockId===v.blockId||S.questionIds?.includes(v.questionId||""))&&(S.answerId===v.answerId||S.questionIds?.includes(v.questionId||"")||S.questionId&&S.questionId===v.questionId&&!S.partId)&&v.rect.x>=S.rect.x-.1&&v.rect.y>=S.rect.y-.1&&v.rect.x+v.rect.width<=S.rect.x+S.rect.width+.1&&v.rect.y+v.rect.height<=S.rect.y+S.rect.height+.1).sort((S,w)=>S.rect.width*S.rect.height-w.rect.width*w.rect.height)[0];x&&(v.parentId=x.id)})}),{version:2,unit:"px",dpi:96,origin:"topLeftPaper",singlePagePartition:i.columns,pages:u.map(g=>g.data)}}function AR({uploadImage:t,editorPlugin:r,initialValue:i,onSave:a,dictionaries:c}){const l=E.useMemo(()=>Jc(c),[c]),u=r.html,[d,m]=E.useState(i||vm),p=E.useCallback(fe=>m(ue=>{let he=typeof fe=="function"?fe(ue):fe;he.blocks.some(Oe=>Oe.exercise&&!Oe.reference)&&(he={...he,blocks:he.blocks.map(bR)}),he={...he,blocks:he.blocks.map(Oe=>{const Nt=ue.blocks.find(Qr=>Qr.id===Oe.id);if(Oe.reference?.textVersion===1)return vS(Oe,Nt,!!he.questionCard);if(!Oe.reference||Nt?.reference===Oe.reference)return Oe;let Xt=Nt?.reference?CR(Oe.document,Nt.reference,Oe.reference):Oe.document;if(Xt.content.content?.length===1&&Xt.content.content[0].type==="paragraph"&&!Xt.content.content[0].content?.length&&!Xt.content.content[0].attrs?.contentId&&Oe.reference.questions.length){const Qr=Oe.reference.questions[0],Bn=Oe.reference.type==="MIXED"?Oe.id:Qr.id;Xt={...Xt,content:{...Xt.content,content:[$0(Xt.content.content[0],Bn)]}}}const Ul=Qr=>JSON.stringify(Qr.reference?.questions.flatMap(Bn=>[Bn.choice,...Bn.parts.map(zo=>zo.choice)]).map(Bn=>[Bn.id,Bn.contentTarget])),$i=!Nt||Ul(Nt)!==Ul(Oe)?SR({...Oe,document:Xt}):Xt;return $i===Oe.document?Oe:{...Oe,document:$i}})};const $e=he.blocks.filter(Oe=>Oe.reference).map(Oe=>sa(Oe.reference));return(he.mergeObjective?[$e.flat()]:$e).some(Oe=>new Set(Oe.map(Nt=>Nt.options.length)).size>1)&&he.choiceDirection!=="column"?{...he,choiceDirection:"column"}:he}),[]),[C,g]=E.useState(""),[b,v]=E.useState(!i),[x,S]=E.useState(null),[w,T]=E.useState(null),[j,R]=E.useState(null),[O,M]=E.useState(!0),[D,_]=E.useState({}),I=fe=>{const ue=fe.reference?qs(fe.reference):fe.exercise?.items||fe.choices?.questions;return ue?.find(he=>he.id===D[fe.id])?.id||ue?.[0]?.id},z=(fe,ue)=>_(he=>he[fe]===ue?he:{...he,[fe]:ue}),H=fe=>{S(fe),fe===null&&T(null),fe&&R(ue=>ue===null?null:fe)},[L,$]=E.useState({}),[Y,U]=E.useState(),[q,P]=E.useState(!1),G=fe=>{fe&&T(null),P(fe)},[B,Q]=E.useState(null),N=E.useRef(new Map),K=E.useRef(null),ne=E.useCallback((fe,ue)=>{ue?N.current.set(fe,ue):N.current.delete(fe)},[]),{scale:te,setScale:le}=Io(),oe=te/100,ae=E.useMemo(()=>xR(d,w),[d,w]),xe=JSON.stringify([d.usage,d.preset,d.margin,d.gap,d.header,d.recognition,d.paperTitle?.id,d.paperTitle?.height,ae.map(fe=>[fe.id,fe.answerHeight])]),{geometry:we,placements:ge,pageCount:de}=E.useMemo(()=>gS({...d,blocks:ae},L,Y),[xe,L,Y]),Me=d.paperTitle?.id===Y?.id&&Y?.overflowing,Be=de*we.height+(de-1)*Co,Ae=ge.filter(fe=>fe.overflowing),Se=new Map(ge.map(fe=>[fe.id,fe])),Ce=Se.get(gr);Ce&&d.blocks.forEach(fe=>{Se.has(fe.id)||Se.set(fe.id,Ce)});const Ot=()=>{const fe=document.getElementById("answer-sheet-stadio");fe&&le(Math.max(20,Math.min(100,Math.floor((fe.clientWidth-96)/we.width*100))))};E.useEffect(()=>{Ot()},[d.preset]);const dt=(fe,ue)=>p(he=>({...he,blocks:he.blocks.map($e=>$e.id===fe?{...$e,...ue}:$e)})),be=(fe,ue)=>p(he=>{const $e=[...he.blocks],Ze=$e.findIndex(Nt=>Nt.id===fe);if(Ze<0||ue<0||ue>=$e.length||Ze===ue)return he;const[Oe]=$e.splice(Ze,1);return $e.splice(ue,0,Oe),{...he,blocks:$e}}),gt=(fe,ue=!1)=>{if(H(fe),!ue)return;const he=document.getElementById("answer-sheet-stadio"),$e=Array.from(document.querySelectorAll("[data-block-id]")),Ze=$e.find(Oe=>Oe.dataset.blockId===fe&&!Oe.hidden)||$e.find(Oe=>Oe.dataset.blockId===gr);if(he&&Ze){const Oe=Ze.getBoundingClientRect(),Nt=he.getBoundingClientRect();he.scrollTo({left:Math.max(0,he.scrollLeft+Oe.left-Nt.left-40),top:Math.max(0,he.scrollTop+Oe.top-Nt.top-90),behavior:"smooth"})}},ot=()=>TR(d.blocks,u),Wt=()=>{if(!K.current)throw new Error("题卡尚未完成渲染");return jR(K.current,d,we)};return{card:d,paperRoot:K,creationDictionary:l,saveMessage:C,setSaveMessage:g,saveAction:a?"保存":"导出",editors:N,measurements:L,titleMeasurement:Y,paperBlocks:ae,setCard:p,uploadImage:t,setQuestionCard:fe=>{T(null),p(ue=>({...ue,questionCard:fe,blocks:ue.blocks.filter(he=>he.areaType!==(fe?"forbiden":"editArea"))}))},editQuestion:(fe,ue)=>{H(fe),T(fe),R(null);const he=d.blocks.find(Ze=>Ze.id===fe),$e=ue||he&&I(he);he?.reference?.textVersion===1&&xn(he.document)&&dt(fe,{document:fu(he)}),requestAnimationFrame(()=>{const Ze=N.current.get(`content/${$e}`)||N.current.get(fe);(!$e||!Ze?.focusContent($e))&&Ze?.focus("start")})},finishQuestionEditing:()=>T(null),insertMaterialBlank:(fe,ue,he,$e)=>{H(fe),T(fe),requestAnimationFrame(()=>N.current.get(fe)?.insertAnswerRegion(ue,he,$e))},editingQuestionId:w,registerEditor:ne,creationOpen:b,setCreationOpen:v,newCard:fe=>{p(uu(fe)),H(null),R(null),Q(null),$({}),U(void 0),_({}),G(!1),v(!1)},selectedId:x,setSelectedId:H,selectedChoiceId:I,selectChoice:z,settingsId:j,setSettingsId:R,settingsAutoFocus:O,openSettings:(fe,ue=!0)=>{q||(H(fe),R(fe),M(ue))},setMeasurements:$,setTitleMeasurement:U,titleOverflow:Me,readOnly:q,setReadOnly:G,deleted:B,setDeleted:Q,scale:oe,geometry:we,placements:ge,pageCount:de,totalHeight:Be,overflow:Ae,placementById:Se,fitPage:Ot,updateBlock:dt,moveBlock:be,selectBlock:gt,download:()=>{if(a){a();return}let fe;try{fe=Wt()}catch($e){g($e instanceof Error?$e.message:"识别坐标生成失败");return}const ue=URL.createObjectURL(new Blob([JSON.stringify({...d,...ot(),recognitionData:fe},null,2)],{type:"application/json"})),he=document.createElement("a");he.href=ue,he.download=`${d.title||"答题卡"}.json`,he.click(),setTimeout(()=>URL.revokeObjectURL(ue),1e3)},getReferenceData:ot,getRecognitionData:Wt,setReferenceData:fe=>{const ue=G0(fe,u);p(he=>({...he,blocks:ue})),H(null),R(null),_({})}}}const q0=E.createContext(null);function RR({children:t,...r}){return f.jsx(H0.Provider,{value:r.editorPlugin,children:f.jsx(q0.Provider,{value:AR(r),children:t})})}function mt(){const t=E.useContext(q0);if(!t)throw new Error("制卡内容需要 CardProvider");return t}const OR={undo:"M9 5 4 10l5 5M4 10h10a6 6 0 0 1 0 12",redo:"m15 5 5 5-5 5m5-5H10a6 6 0 0 0 0 12",image:"M4 4h16v16H4zM4 16l5-5 4 4 3-3 4 4M16 8h.01",table:"M4 4h16v16H4zM4 10h16M10 4v16M4 15h16",check:"m5 12 4 4L19 6",back:"m14 5-7 7 7 7",close:"m6 6 12 12M6 18 18 6",upload:"M12 16V3m-4 4 4-4 4 4M5 13v7h14v-7",download:"M12 3v13m-4-4 4 4 4-4M5 17v4h14v-4",settings:"M4 7h16M4 17h16M8 4v6m8 4v6",chevronUp:"m7 14 5-5 5 5",answerLine:"M4 17h16M5 10h2m4 0h2m4 0h2",alignLeft:"M4 5h16M4 10h10M4 15h16M4 20h10",alignCenter:"M4 5h16M7 10h10M4 15h16M7 20h10",alignRight:"M4 5h16M10 10h10M4 15h16M10 20h10",alignJustify:"M4 5h16M4 10h16M4 15h16M4 20h16",document:"M6 3h8l4 4v14H6zM14 3v5h4M9 12h6m-6 4h6",trash:"M4 6h16M9 6V3h6v3M6 6l1 15h10l1-15M10 10v7m4-7v7",list:"M8 6h12M8 12h12M8 18h12M4 6h.01M4 12h.01M4 18h.01",listOrdered:"M10 6h10M10 12h10M10 18h10M3 4h1v5M3 9h2M3 15a1.5 1.5 0 0 1 3 0c0 1-3 3-3 4h3"};function ko({name:t,size:r=18}){return f.jsx("svg",{width:r,height:r,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:f.jsx("path",{d:OR[t]})})}function Xd(t){const[r,i]=E.useState(null),a=E.useRef(t);a.current=t;const c=E.useRef(null),l=(C,g)=>{if(!r)return;const b=r.getBoundingClientRect();r.style.left=`${Math.max(8,Math.min(window.innerWidth-b.width-8,C))}px`,r.style.top=`${Math.max(8,Math.min(window.innerHeight-b.height-8,g))}px`},u=()=>{if(!r)return;const C=r.getBoundingClientRect(),g=a.current?.(r)||{left:(window.innerWidth-C.width)/2,top:(window.innerHeight-C.height)/2};l(g.left,g.top)},d=()=>{const C=c.current;c.current=null,r&&delete r.dataset.dragging,C?.target.hasPointerCapture(C.pointerId)&&C.target.releasePointerCapture(C.pointerId)},m=()=>c.current?(l(c.current.left,c.current.top),d(),!0):!1;return E.useLayoutEffect(()=>{if(!r)return;u();const C=()=>{const b=r.getBoundingClientRect();l(b.left,b.top)},g=new ResizeObserver(C);return g.observe(r),window.addEventListener("resize",C),document.addEventListener("fullscreenchange",C),window.addEventListener("blur",m),()=>{d(),g.disconnect(),window.removeEventListener("resize",C),document.removeEventListener("fullscreenchange",C),window.removeEventListener("blur",m)}},[r]),{dialog:r,setDialog:i,titleProps:{role:"button",tabIndex:0,onPointerDown:C=>{if(C.button!==0||!C.isPrimary||!r)return;C.preventDefault(),C.stopPropagation(),C.currentTarget.focus({preventScroll:!0});const{left:g,top:b}=r.getBoundingClientRect();c.current={x:C.clientX,y:C.clientY,left:g,top:b,target:C.currentTarget,pointerId:C.pointerId},r.dataset.dragging="true",C.currentTarget.setPointerCapture(C.pointerId)},onPointerMove:C=>{const g=c.current;g?.pointerId===C.pointerId&&l(g.left+C.clientX-g.x,g.top+C.clientY-g.y)},onPointerUp:d,onPointerCancel:m,onLostPointerCapture:d,onKeyDown:C=>{if(C.key==="Escape"&&m()&&(C.preventDefault(),C.stopPropagation()),C.key==="Home"&&(C.preventDefault(),C.stopPropagation(),u()),!r||!["ArrowLeft","ArrowRight","ArrowUp","ArrowDown"].includes(C.key))return;C.preventDefault(),C.stopPropagation();const g=C.shiftKey?50:10,b=r.getBoundingClientRect();l(b.left+(C.key==="ArrowRight"?g:C.key==="ArrowLeft"?-g:0),b.top+(C.key==="ArrowDown"?g:C.key==="ArrowUp"?-g:0))}},cancelDrag:m}}function NR({creation:t,questionCard:r,onAdd:i,onClose:a}){const[c,l]=E.useState(null),u=Cm(t),d=r?"editArea":"forbiden",m=[...u,d],p={...nr,forbiden:"禁止答题区",editArea:"空白答题区"},C=E.useId(),{dialog:g,setDialog:b,titleProps:v,cancelDrag:x}=Xd();E.useLayoutEffect(()=>{g?.setAttribute("aria-labelledby",C)},[g,C]);const S=f.jsx("div",{...v,className:"card-modal-drag","aria-label":"拖动添加题块",title:"拖动移动;方向键微调,Home 居中",children:f.jsx("h2",{id:C,children:"添加题块"})});return f.jsxs(Dl,{open:!0,panelRef:b,width:460,zIndex:910,className:"card-modal card-add-block-modal",title:S,closeLabel:"关闭添加题块",closeIcon:f.jsx(ko,{name:"close",size:16}),onCancel:a,onEscapeKeyDown:w=>{x()&&(w.preventDefault(),w.stopPropagation())},footer:f.jsxs("div",{className:"card-create-actions",children:[f.jsx(ce,{onClick:a,children:"取消"}),f.jsx(ce,{type:"primary",disabled:!c||!m.includes(c),onClick:()=>{c&&m.includes(c)&&i(c)},children:"添加"})]}),children:[f.jsx("div",{className:"card-question-types",role:"group","aria-label":"选择题型",children:u.map(w=>f.jsx(ce,{"aria-pressed":c===w,onClick:()=>l(w),children:p[w]},w))}),f.jsx("div",{className:"card-question-types card-area-types",role:"group","aria-label":"纸面区域",children:f.jsx(ce,{"aria-pressed":c===d,onClick:()=>l(d),children:p[d]})})]})}function zl({label:t,value:r,min:i,max:a,onChange:c}){const[l,u]=E.useState();return f.jsx(Ea,{className:"ui-control ui-number","aria-label":t,min:i,max:a,precision:0,value:l===void 0?r:l,onChange:d=>{u(d),d!==null&&d>=i&&d<=a&&d!==r&&c(d)},onBlur:()=>{if(l!==void 0){const d=Math.max(i,Math.min(a,l??i));d!==r&&c(d),u(void 0)}}})}function Pi({label:t,value:r,min:i=.5,max:a=15,placeholder:c,onChange:l}){const[u,d]=E.useState(),m=u==null||Gn(u)&&u>=i&&u<=a;return f.jsx(Ea,{className:"ui-control ui-number","aria-label":t,value:u===void 0?r:u,min:i,max:a,step:.5,placeholder:c,status:m?void 0:"error",onChange:p=>{d(p),(p===null||Gn(p)&&p>=i&&p<=a)&&l(p)},onBlur:()=>d(void 0)})}function MR({value:t,creation:r,onChange:i}){const[a,c]=E.useState("all"),[l,u]=E.useState([]),[d,m]=E.useState("settings"),[p,C]=E.useState("keep"),[g,b]=E.useState(null),[v,x]=E.useState(null),[S,w]=E.useState("keep"),[T,j]=E.useState(null),[R,O]=E.useState(1),[M,D]=E.useState(null),[_,I]=E.useState(""),[z,H]=E.useState(""),L=t.questions.filter(Y=>a==="all"||l.includes(Y.id)).map(Y=>Y.id),$=()=>{const Y={};p!=="keep"&&(Y.kind=p),g!==null&&(Y.optionCount=g),v!==null&&(Y.score=v),S!=="keep"&&(Y.scoreType=S),T!==null&&S!=="ITEM_SCORE"&&(Y.lessScore=T);let U;d==="settings"?U={type:d,patch:Y}:d==="numbering"?U={type:d,start:R}:d==="average"?U={type:d,total:M??0}:U={type:d,text:_};const q=tS(t,L,U,r);H(q.error||""),q.value&&i(q.value)};return f.jsxs("details",{className:"card-choice-batch",children:[f.jsx("summary",{children:"批量设置"}),f.jsxs("div",{className:"card-choice-batch-fields",children:[f.jsxs("label",{className:"card-field",children:["范围",f.jsxs(Ft,{"aria-label":"批量修改范围",value:a,onChange:c,children:[f.jsx("option",{value:"all",children:"全部题目"}),f.jsx("option",{value:"selected",children:"指定题目"})]})]}),f.jsxs("label",{className:"card-field",children:["操作",f.jsxs(Ft,{"aria-label":"选择题批量操作",value:d,onChange:Y=>{m(Y),H("")},children:[f.jsx("option",{value:"settings",children:"修改属性"}),f.jsx("option",{value:"numbering",children:"连续题号"}),f.jsx("option",{value:"average",children:"平均分配总分"}),f.jsx("option",{value:"answers",children:"录入答案"})]})]}),a==="selected"&&f.jsx("div",{className:"card-choice-batch-selection",role:"group","aria-label":"选择批量修改题目",children:t.questions.map(Y=>f.jsxs(Lt,{checked:L.includes(Y.id),onChange:U=>u(q=>U.target.checked?[...q,Y.id]:q.filter(P=>P!==Y.id)),children:["第 ",Y.label," 题"]},Y.id))}),d==="settings"&&f.jsxs("div",{className:"card-choice-batch-properties",children:[f.jsxs("label",{className:"card-field",children:["题型",f.jsxs(Ft,{"aria-label":"批量选择题类型",value:p,onChange:C,children:[f.jsx("option",{value:"keep",children:"保持不变"}),f.jsx("option",{value:"single",children:"单选"}),f.jsx("option",{value:"multiple",children:"多选"})]})]}),f.jsxs("label",{className:"card-field",children:["选项个数",f.jsx(Ea,{className:"ui-control ui-number","aria-label":"批量选项个数",placeholder:"保持不变",min:2,max:bn.options,precision:0,value:g,onChange:b})]}),f.jsxs("label",{className:"card-field",children:["每题分值",f.jsx(Pi,{label:"批量每题分值",value:v,placeholder:"保持不变",onChange:x})]}),f.jsxs("label",{className:"card-field",children:["少选计分",f.jsxs(Ft,{"aria-label":"批量少选计分",value:S,onChange:w,children:[f.jsx("option",{value:"keep",children:"保持不变"}),f.jsx("option",{value:"LESS_SCORE",children:"少选得分"}),f.jsx("option",{value:"ITEM_SCORE",children:"选项得分"})]})]}),S!=="ITEM_SCORE"&&f.jsxs("label",{className:"card-field",children:["少选得分",f.jsx(Pi,{label:"批量少选得分",min:0,value:T,placeholder:"保持不变",onChange:j})]})]}),d==="numbering"&&f.jsxs("label",{className:"card-field",children:["起始题号",f.jsx(zl,{label:"批量起始题号",min:1,max:1e3,value:R,onChange:O})]}),d==="average"&&f.jsxs("label",{className:"card-field",children:["所选题目总分",f.jsx(Pi,{label:"平均分配总分",max:bn.score*L.length,value:M,onChange:D})]}),d==="answers"&&f.jsxs("label",{className:"card-field card-choice-batch-answers",children:["按题目顺序录入",f.jsx(Ml,{"aria-label":"批量选择题答案",value:_,rows:3,placeholder:"每题一组,如 A BC D;- 表示清空",onChange:Y=>I(Y.target.value)})]}),z&&f.jsx("div",{className:"card-choice-error",role:"alert",children:z}),f.jsxs(ce,{className:"card-choice-batch-apply",type:"primary",disabled:!L.length,onClick:$,children:["应用到 ",L.length," 题"]})]})]})}function Y0({value:t,document:r,creation:i,selectedId:a,onSelect:c,onChange:l,singleQuestion:u=!1}){const[d,m]=E.useState([]),[p,C]=E.useState([]),g=t.questions.find(L=>L.id===a)||t.questions[0],b=t.questions.indexOf(g),v=su(t),x=ou(t),S=Bs(r),w=new Set(t.questions.map(L=>L.options.length)).size>1,T=()=>({value:t,selectedId:g?.id}),j=(L,$=g?.id)=>{m(U=>[...U.slice(-49),T()]),C([]),l({...L,source:"manual"});const Y=L.questions.find(U=>U.id===$)||L.questions[Math.max(0,Math.min(b,L.questions.length-1))];Y&&c(Y.id)},R=L=>{l(L.value),L.selectedId&&c(L.selectedId)},O=L=>j({...t,questions:t.questions.map($=>$.id===g.id?{...$,...L}:$)}),M=L=>O(eu(g,L,i)),D=L=>{const $=[...t.questions];$.splice(b,1),$.splice(b+L,0,g),j({...t,questions:$})},_=(L=!1)=>{const $=L&&g?eS(g,nu(t.questions)):{...ra(0),label:nu(t.questions)},Y=[...t.questions];Y.splice(b+1,0,$),j({...t,questions:Y},$.id)},I=t.questions.reduce((L,$)=>L+($.score??0),0),z=t.questions.filter(L=>typeof L.score!="number").length,H=g&&(mm(t.questions,g.id,g.label)||tu(g));return f.jsxs("div",{className:"card-choice-settings","aria-label":"选择题设置",children:[u&&f.jsxs("label",{className:"card-field",children:["选项位置",f.jsxs(Ft,{"aria-label":"选择题填涂位置",value:x,onChange:L=>j(au(t,r,L)),children:[f.jsx("option",{value:"concentrated",children:"集中填涂"}),f.jsx("option",{value:"stem",children:"题干前整组字母框"}),f.jsx("option",{value:"option",children:"各选项前空方框"})]})]}),!u&&f.jsxs("div",{children:[f.jsxs("div",{className:"card-choice-summary","aria-label":"选择题配置概况",children:[t.questions.length," 题 · ",z===t.questions.length?"未设分":`${I} 分${z?` · ${z} 题未设分`:""}`]}),f.jsxs("label",{className:"card-field",children:["选项位置",f.jsxs(Ft,{"aria-label":"选择题填涂位置",value:x,onChange:L=>j(au(t,r,L)),children:[f.jsx("option",{value:"concentrated",children:"集中填涂"}),f.jsx("option",{value:"stem",children:"题干前整组字母框"}),f.jsx("option",{value:"option",children:"各选项前空方框"})]})]}),f.jsxs("label",{className:"card-field",children:["题目数量",f.jsx(zl,{label:"选择题数量",min:1,max:bn.questions,value:t.questions.length,onChange:L=>{const $=t.questions.slice(0,L);for(;$.length<L;)$.push({...ra(0),label:nu($)});j({...t,questions:$})}})]}),f.jsxs("div",{className:"card-choice-layout-fields",children:[f.jsxs("label",{className:"card-field",children:["题目排列方向",f.jsxs(Ft,{"aria-label":"填涂排列方向",value:v,onChange:L=>j({...t,direction:L}),children:[f.jsx("option",{value:"row",disabled:w,children:"横排(先右后下)"}),f.jsx("option",{value:"column",children:w?"竖排(选项数不同)":"竖排(先下后右)"})]})]}),v==="column"&&f.jsxs("label",{className:"card-field",children:["每列题数",f.jsx(zl,{label:"每列题数",min:1,max:5,value:t.rowsPerColumn,onChange:L=>j({...t,rowsPerColumn:L})})]})]})]}),g&&f.jsxs("div",{className:"card-choice-question-settings",children:[!u&&f.jsxs("label",{className:"card-field",children:["当前题目",f.jsx(Ft,{"aria-label":"当前选择题",value:g.id,onChange:c,children:t.questions.map(L=>f.jsxs("option",{value:L.id,children:["第 ",L.label," 题"]},L.id))})]}),x!=="concentrated"&&f.jsxs("label",{className:"card-field",children:["对应正文选项",f.jsxs(Ft,{"aria-label":"填涂对应正文选项",value:S.some(L=>L.id===g.contentTarget?.groupId)?g.contentTarget.groupId:"",onChange:L=>{const $=S.find(Y=>Y.id===L);O({contentTarget:$?{groupId:$.id,optionIds:$.options.map(Y=>Y.id)}:null})},children:[f.jsx("option",{value:"",children:"未指定(集中显示)"}),S.map((L,$)=>f.jsxs("option",{value:L.id,disabled:t.questions.some(Y=>Y.id!==g.id&&Y.contentTarget?.groupId===L.id),children:["第 ",L.label||$+1," 组选项(",L.options.length," 项)"]},L.id))]})]}),!u&&f.jsxs("label",{className:"card-field",children:["题号",f.jsx(wa,{"aria-label":"选择题题号",value:g.label,maxLength:12,onChange:L=>O({label:L.target.value})})]}),f.jsxs("label",{className:"card-field",children:["选项个数",f.jsx(zl,{label:"选择题选项个数",min:2,max:Math.max(bn.options,g.options.length),value:g.options.length,onChange:L=>M({optionCount:L})})]}),f.jsxs("label",{className:"card-field",children:["题型",f.jsxs(Ft,{"aria-label":"选择题类型",value:Z1(g),onChange:L=>M({kind:L}),children:[f.jsx("option",{value:"single",children:"单选"}),f.jsx("option",{value:"multiple",children:"多选"})]})]}),!u&&f.jsxs("label",{className:"card-field",children:["本题分值",f.jsx(Pi,{label:"选择题分值",value:g.score??null,placeholder:"未设置",onChange:L=>M({score:L})})]}),g.multiple&&f.jsxs("label",{className:"card-field",children:["少选计分",f.jsxs(Ft,{"aria-label":"选择题少选计分",value:g.scoreType||"LESS_SCORE",onChange:L=>M({scoreType:L,lessScore:0}),children:[f.jsx("option",{value:"LESS_SCORE",children:"少选得分"}),f.jsx("option",{value:"ITEM_SCORE",children:"选项得分"})]})]}),g.multiple&&g.scoreType!=="ITEM_SCORE"&&typeof g.score=="number"&&f.jsxs("label",{className:"card-field",children:["少选得分",f.jsx(Pi,{label:"选择题少选得分",min:0,max:g.score,value:g.lessScore??0,onChange:L=>M({lessScore:L??0})})]}),f.jsxs("div",{className:"card-answer-key",role:"group","aria-label":"正确答案设置",children:[f.jsx("span",{children:"正确答案"}),f.jsx("div",{children:g.options.map(L=>f.jsx(ce,{type:"text","aria-label":`正确答案 ${L.label}`,"aria-pressed":g.correctIds.includes(L.id),onClick:()=>O({correctIds:g.correctIds.includes(L.id)?g.correctIds.filter($=>$!==L.id):g.multiple?[...g.correctIds,L.id]:[L.id]}),children:L.label},L.id))})]}),g.multiple&&g.scoreType==="ITEM_SCORE"&&f.jsxs("div",{className:"card-choice-rule","aria-label":"选项得分说明",children:["每项 ",J1(g)??"—"," 分 · 错选、不选 0 分"]}),H&&f.jsx("div",{className:"card-choice-error",role:"alert",children:H}),!u&&f.jsx(Lt,{className:"card-choice-break",checked:g.breakBefore,onChange:L=>O({breakBefore:L.target.checked}),children:"此题前换行"}),!u&&f.jsxs("div",{className:"card-choice-actions",role:"group","aria-label":"选择题操作",children:[f.jsx(ce,{type:"text","aria-label":"新增选择题",title:"在当前题后新增",disabled:t.questions.length>=bn.questions,onClick:()=>_(),children:"新增"}),f.jsx(ce,{type:"text","aria-label":"复制选择题配置",title:"复制当前题的填涂与计分配置,放在其后",disabled:t.questions.length>=bn.questions,onClick:()=>_(!0),children:"复制"}),f.jsx(ce,{type:"text","aria-label":"上移选择题",disabled:b<=0,onClick:()=>D(-1),children:"上移"}),f.jsx(ce,{type:"text","aria-label":"下移选择题",disabled:b>=t.questions.length-1,onClick:()=>D(1),children:"下移"}),f.jsx(ce,{type:"text",danger:!0,"aria-label":"删除当前选择题",disabled:t.questions.length<=1,onClick:()=>{const L=t.questions.filter($=>$.id!==g.id);j({...t,questions:L},L[Math.min(b,L.length-1)]?.id)},children:"删除"})]})]},g.id),!g&&f.jsx(ce,{className:"card-choice-actions",onClick:()=>_(),children:"新增选择题"}),!u&&f.jsx(MR,{value:t,creation:i,onChange:j}),!u&&(d.length>0||p.length>0)&&f.jsxs("div",{className:"card-choice-history",children:[f.jsx(ce,{type:"text",className:"card-choice-undo",disabled:!d.length,onClick:()=>{const L=d.at(-1);m(d.slice(0,-1)),C($=>[...$,T()]),R(L)},children:"撤销选择题设置"}),f.jsx(ce,{type:"text",disabled:!p.length,onClick:()=>{const L=p.at(-1);C(p.slice(0,-1)),m($=>[...$,T()]),R(L)},children:"重做"})]})]})}function Zt({label:t,children:r}){return f.jsxs("div",{className:"card-field",children:[f.jsx("span",{children:t}),r]})}function ut({label:t,value:r,min:i=0,max:a=200,step:c=1,onChange:l}){return f.jsx(Zt,{label:t,children:f.jsx(Ea,{"aria-label":t,value:r,min:i,max:a,step:c,precision:c===1?0:1,onChange:u=>{u!==null&&Number.isFinite(u)&&l(Math.max(i,Math.min(a,Math.round(u/c)*c)))}})})}function tn({label:t,value:r,min:i=.5,max:a=70,onChange:c}){return f.jsx(Zt,{label:t,children:f.jsx(Ea,{"aria-label":t,placeholder:"未设置",min:i,max:a,step:.5,precision:1,value:r,onChange:l=>c(l===null?null:Math.max(i,Math.min(a,Math.round(l*2)/2)))})})}function cn({label:t,value:r,onChange:i,maxLength:a=200}){return f.jsx(Zt,{label:t,children:f.jsx(wa,{"aria-label":t,value:r,maxLength:a,onChange:c=>i(c.target.value)})})}function at({label:t,value:r,options:i,onChange:a}){return f.jsx(Zt,{label:t,children:f.jsx(Ft,{"aria-label":t,value:r,onChange:a,children:Object.entries(i).map(([c,l])=>f.jsx("option",{value:c,children:l},c))})})}function Bl({index:t,count:r,onAdd:i,onCopy:a,onDelete:c,onMove:l,name:u="小题",maximum:d=200}){return f.jsxs("div",{className:"exercise-actions",children:[f.jsx(ce,{size:"small","aria-label":`新增${u}`,disabled:r>=d,onClick:i,children:"新增"}),f.jsx(ce,{size:"small","aria-label":`复制当前${u}`,disabled:t<0||r>=d,onClick:a,children:"复制"}),f.jsx(ce,{size:"small","aria-label":`上移当前${u}`,disabled:t<=0,onClick:()=>l(-1),children:"↑"}),f.jsx(ce,{size:"small","aria-label":`下移当前${u}`,disabled:t<0||t>=r-1,onClick:()=>l(1),children:"↓"}),f.jsx(ce,{size:"small",danger:!0,"aria-label":`删除当前${u}`,disabled:t<0,onClick:c,children:"删除"})]})}function Ui({value:t,onEditor:r,...i}){const a=E.useRef(null),c=E.useCallback(u=>{a.current=u,r?.(u)},[r]),l=E.useRef(JSON.stringify(t));return E.useEffect(()=>{const u=JSON.stringify(t);u!==l.current&&(l.current=u,a.current&&JSON.stringify(a.current.getDocument())!==u&&a.current.syncDocument(t))},[t]),f.jsx(Ll,{ref:c,initialValue:t,...i})}function X0({value:t,onChange:r,drawing:i=!1}){const{uploadImage:a}=mt(),c=E.useRef(null),[l,u]=E.useState(!1),[d,m]=E.useState(""),p=E.useRef(!0),C=E.useRef({value:t,onChange:r});C.current={value:t,onChange:r},E.useEffect(()=>(p.current=!0,()=>{p.current=!1}),[]);const g=b=>r({...t,...b});return f.jsxs("div",{children:[f.jsxs("div",{className:"exercise-fields",children:[f.jsx(at,{label:"作答区样式",value:t.style,options:{blank:"空白",lines:"横线",grid:"方格纸",characters:"作文格","four-lines":"四线三格",coordinates:"坐标网格"},onChange:b=>g({style:b})}),f.jsx(ut,{label:"作答行数",value:t.rows,min:0,max:120,onChange:b=>g({rows:b})}),f.jsx(ut,{label:"作答行高",value:t.rowHeight,min:16,max:80,onChange:b=>g({rowHeight:b})}),["characters","grid","coordinates"].includes(t.style)&&f.jsx(ut,{label:"每行格数",value:t.columns,min:4,max:40,onChange:b=>g({columns:b})}),t.style==="characters"&&f.jsx(ut,{label:"字数标记间隔",value:t.wordMark,min:0,max:500,onChange:b=>g({wordMark:b})})]}),f.jsx(Lt,{checked:t.title,onChange:b=>g({title:b.target.checked}),children:"标题填写区"}),i&&f.jsxs("div",{children:[f.jsx(cn,{label:"作图底图 URL",value:t.backgroundUrl,maxLength:4096,onChange:b=>g({backgroundUrl:b})}),f.jsx("input",{ref:c,type:"file",accept:"image/*",hidden:!0,onChange:async b=>{const v=b.target.files?.[0];if(b.target.value="",!!v){u(!0),m("");try{const x=a?await a(v):await new Promise((S,w)=>{const T=new FileReader;T.onload=()=>S(String(T.result)),T.onerror=()=>w(new Error("读取失败")),T.readAsDataURL(v)});if(!/^(https?:\/\/|data:image\/|blob:|\/)/i.test(x))throw new Error("图片地址无效");p.current&&C.current.onChange({...C.current.value,backgroundUrl:x})}catch{p.current&&m("图片上传失败,请重试")}finally{p.current&&u(!1)}}}}),f.jsx(ce,{size:"small",loading:l,onClick:()=>c.current?.click(),children:"上传底图"}),d&&f.jsx("p",{role:"alert",children:d})]})]})}function _R({value:t,onChange:r,correction:i=!1,practice:a=!1}){const[c,l]=E.useState(t[0]?.id),u=t.find(g=>g.id===c)||t[0],d=t.indexOf(u),m=i?"改错位置":a?"评价项":"评分点",p=g=>r(t.map(b=>b.id===u.id?{...b,...g}:b)),C=g=>{const b=g&&u?{...vo(u),label:Ir(t)}:{id:crypto.randomUUID(),label:Ir(t),score:null,prompt:"",answer:""},v=[...t];v.splice(d+1,0,b),r(v),l(b.id)};return f.jsxs("div",{children:[f.jsx("div",{className:"exercise-tabs","aria-label":`选择${m}`,children:t.map(g=>f.jsx(ce,{size:"small","aria-pressed":g.id===u?.id,onClick:()=>l(g.id),children:g.label},g.id))}),f.jsx(Bl,{name:m,maximum:20,index:d,count:t.length,onAdd:()=>C(!1),onCopy:()=>C(!0),onMove:g=>r(oa(t,u.id,g)),onDelete:()=>r(t.filter(g=>g.id!==u.id))}),u&&f.jsxs("div",{children:[f.jsxs("div",{className:"exercise-fields",children:[f.jsx(cn,{label:`${m}编号`,value:u.label,onChange:g=>p({label:g})}),f.jsx(tn,{label:`${m}分值`,value:u.score,onChange:g=>p({score:g})})]}),f.jsx(cn,{label:i?"原文位置/待改文字":a?"评价维度":"作答步骤提示",value:u.prompt,onChange:g=>p({prompt:g})}),f.jsx(Zt,{label:i?"改正答案":a?"评价标准":"评分要点",children:f.jsx(Ml,{"aria-label":i?"改正答案":a?"评价标准":"评分要点",value:u.answer,autoSize:{minRows:2,maxRows:5},onChange:g=>p({answer:g.target.value})})})]})]})}function DR({value:t,onChange:r,onInsert:i}){const[a,c]=E.useState(t[0]?.id),l=t.find(p=>p.id===a)||t[0],u=t.indexOf(l),d=p=>r(t.map(C=>C.id===l.id?{...C,...p}:C)),m=p=>{const C=p&&l?{...vo(l),label:Ir(t)}:{...bm(),label:Ir(t)},g=[...t];g.splice(u+1,0,C),r(g),c(C.id)};return f.jsxs("div",{className:"exercise-blank-settings",children:[f.jsx("div",{className:"exercise-tabs","aria-label":"选择空位",children:t.map(p=>f.jsx(ce,{size:"small","aria-pressed":p.id===l?.id,onClick:()=>c(p.id),children:p.label},p.id))}),f.jsx(Bl,{name:"空位",maximum:20,index:u,count:t.length,onAdd:()=>m(!1),onCopy:()=>m(!0),onMove:p=>r(oa(t,l.id,p)),onDelete:()=>{r(t.filter(p=>p.id!==l.id)),c(t[Math.max(0,u-1)]?.id)}}),l&&f.jsxs("div",{children:[f.jsxs("div",{className:"exercise-fields",children:[f.jsx(cn,{label:"空位编号",value:l.label,onChange:p=>d({label:p})}),f.jsx(tn,{label:"每空分值",value:l.score,max:15,onChange:p=>d({score:p})}),f.jsx(at,{label:"空位样式",value:l.style,options:{line:"横线",brackets:"括号",box:"方框",characters:"字格"},onChange:p=>d({style:p})}),f.jsx(at,{label:"空位宽度",value:String(l.width),options:{20:"1/5 行",25:"1/4 行",33:"1/3 行",50:"1/2 行",66:"2/3 行",75:"3/4 行",100:"整行"},onChange:p=>d({width:Number(p)})}),l.style==="characters"&&f.jsx(ut,{label:"字格数量",value:l.characters,min:1,max:40,onChange:p=>d({characters:p})}),f.jsx(cn,{label:"空前提示",value:l.prefix,onChange:p=>d({prefix:p})}),f.jsx(cn,{label:"空后单位",value:l.suffix,onChange:p=>d({suffix:p})})]}),f.jsxs("div",{className:"exercise-actions",children:[f.jsx(Lt,{checked:l.breakAfter,onChange:p=>d({breakAfter:p.target.checked}),children:"此空后换行"}),f.jsx(ce,{size:"small",onClick:()=>r(t.map(p=>({...p,width:l.width,style:l.style,characters:l.characters}))),children:"统一空位样式"})]}),f.jsx(ce,{size:"small",onClick:()=>i(l),children:"插入此空到题干"}),f.jsx(Zt,{label:"可接受答案(每行一个)",children:f.jsx(Ml,{"aria-label":"可接受答案",value:l.answers.join(`
201
+ `),autoSize:{minRows:2,maxRows:5},onChange:p=>d({answers:p.target.value.split(`
202
+ `)})})})]})]})}function K0({value:t,onChange:r,onRemove:i,category:a=!1}){const{uploadImage:c}=mt(),[l,u]=E.useState(t[0]?.id),d=t.find(g=>g.id===l)||t[0],m=t.indexOf(d),p=a?"类别":"共享选项",C=g=>{const b=g&&d?vo(d):{id:crypto.randomUUID(),label:"",text:""},v=new Set(t.map(S=>S.label));b.label=Array.from({length:26},(S,w)=>String.fromCharCode(65+w)).find(S=>!v.has(S))||Ir(t);const x=[...t];x.splice(m+1,0,b),r(x),u(b.id)};return f.jsxs("div",{children:[f.jsx("div",{className:"exercise-tabs",children:t.map(g=>f.jsx(ce,{size:"small","aria-pressed":g.id===d?.id,onClick:()=>u(g.id),children:g.label},g.id))}),f.jsx(Bl,{name:p,maximum:26,index:m,count:t.length,onAdd:()=>C(!1),onCopy:()=>C(!0),onMove:g=>r(oa(t,d.id,g)),onDelete:()=>i(d.id)}),d&&f.jsxs("div",{className:"exercise-fields",children:[f.jsx(cn,{label:`${p}编号`,value:d.label,onChange:g=>r(t.map(b=>b.id===d.id?{...b,label:g}:b))}),f.jsx(cn,{label:`${p}内容`,value:d.text,onChange:g=>r(t.map(b=>b.id===d.id?{...b,text:g}:b))})]}),d&&!a&&f.jsxs("details",{children:[f.jsx("summary",{children:"选项图文/公式"}),f.jsx(Ui,{value:d.document||$t(),ariaLabel:`共享选项 ${d.label} 图文内容`,uploadImage:c,onChange:g=>r(t.map(b=>b.id===d.id?{...b,document:g}:b))},d.id)]})]})}function IR({value:t,kind:r,item:i,onChange:a}){const c=l=>a({...t,...l});return f.jsxs("div",{children:[f.jsxs("details",{open:!0,children:[f.jsx("summary",{children:r==="ordering"?"待排序/分类项目":"共享选项池"}),f.jsx(K0,{value:t.pool,onChange:l=>c({pool:l,sequence:[...t.sequence.filter(u=>l.some(d=>d.id===u)),...l.filter(u=>!t.sequence.includes(u.id)).map(u=>u.id)]}),onRemove:l=>a(cS(t,l))})]}),r==="matching"&&f.jsxs("div",{children:[f.jsxs("div",{className:"exercise-fields",children:[f.jsx(at,{label:"匹配呈现",value:t.matchingDisplay,options:{letters:"字母填答",lines:"左右连线"},onChange:l=>c({matchingDisplay:l})}),f.jsx(at,{label:"对应关系",value:t.relation,options:{one:"一对一",many:"一对多"},onChange:l=>c({relation:l,items:t.items.map(u=>({...u,targets:l==="one"?u.targets.slice(0,1):u.targets}))})})]}),f.jsx(Lt,{checked:t.reuseOptions,onChange:l=>{const u=new Set;c({reuseOptions:l.target.checked,items:t.items.map(d=>({...d,targets:d.targets.filter(m=>l.target.checked?!0:u.has(m)?!1:(u.add(m),!0))}))})},children:"允许选项重复使用"}),i&&f.jsx(Zt,{label:"当前题匹配答案",children:f.jsx("div",{className:"exercise-tabs",children:t.pool.map(l=>f.jsx(ce,{size:"small","aria-pressed":i.targets.includes(l.id),onClick:()=>a(uS(t,i.id,i.targets.includes(l.id)?i.targets.filter(u=>u!==l.id):[...i.targets,l.id])),children:l.label},l.id))})})]}),r==="ordering"&&f.jsxs("div",{children:[f.jsx(at,{label:"排序或分类",value:t.ordering,options:{sequence:"排序",category:"分类"},onChange:l=>c({ordering:l})}),t.ordering==="sequence"?f.jsx("div",{className:"exercise-fields",children:t.sequence.map((l,u)=>f.jsx(at,{label:`第 ${u+1} 位答案`,value:l,options:Object.fromEntries(t.pool.map(d=>[d.id,`${d.label}. ${d.text}`])),onChange:d=>{const m=[...t.sequence],p=m.indexOf(d);p>=0&&(m[p]=l),m[u]=d,c({sequence:m})}},u))}):f.jsxs("div",{children:[f.jsx(K0,{category:!0,value:t.categories,onChange:l=>c({categories:l}),onRemove:l=>c({categories:t.categories.filter(u=>u.id!==l),assignments:Object.fromEntries(Object.entries(t.assignments).filter(([,u])=>u!==l))})}),t.pool.map(l=>f.jsx(at,{label:`${l.label} 所属类别`,value:t.assignments[l.id]||"",options:{"":"未设置",...Object.fromEntries(t.categories.map(u=>[u.id,`${u.label}. ${u.text}`]))},onChange:u=>c({assignments:{...t.assignments,[l.id]:u}})},l.id))]})]})]})}function kR({value:t,onChange:r}){const[i,a]=E.useState(0),c=l=>r({...t,...l});return f.jsxs("div",{children:[f.jsx(Zt,{label:"待断句原文",children:f.jsx(Ml,{"aria-label":"待断句原文",value:t.chunkText,autoSize:{minRows:3,maxRows:8},onSelect:l=>a(l.currentTarget.selectionStart),onChange:l=>r(dS(t,l.target.value))})}),f.jsx(ce,{size:"small",disabled:i<=0||i>=t.chunkText.length||t.chunkPoints.length>=26||t.chunkPoints.some(l=>l.offset===i),onClick:()=>{const l=new Set(t.chunkPoints.map(d=>d.label)),u=Array.from({length:26},(d,m)=>String.fromCharCode(65+m)).find(d=>!l.has(d));c({chunkPoints:[...t.chunkPoints,{id:crypto.randomUUID(),offset:i,label:u}].sort((d,m)=>d.offset-m.offset)})},children:"在光标处添加断点"}),f.jsx("div",{className:"exercise-chunk-points",children:t.chunkPoints.map(l=>f.jsxs("div",{children:[f.jsxs(Lt,{checked:t.chunkCorrect.includes(l.id),onChange:u=>c({chunkCorrect:u.target.checked?[...t.chunkCorrect,l.id]:t.chunkCorrect.filter(d=>d!==l.id)}),children:[l.label," · ",t.chunkText.slice(Math.max(0,l.offset-4),l.offset),"|",t.chunkText.slice(l.offset,l.offset+4)]}),f.jsx(ce,{size:"small",type:"text","aria-label":`删除断点 ${l.label}`,onClick:()=>c({chunkPoints:t.chunkPoints.filter(u=>u.id!==l.id),chunkCorrect:t.chunkCorrect.filter(u=>u!==l.id)}),children:"删除"})]},l.id))}),f.jsxs("div",{className:"exercise-fields",children:[f.jsx(ut,{label:"最多选择断点数",value:t.chunkMax,min:1,max:26,onChange:l=>c({chunkMax:l})}),f.jsx(tn,{label:"断句满分",value:t.groupScore,max:10,onChange:l=>c({groupScore:l})}),f.jsx(tn,{label:"每个正确断点分值",value:t.chunkScore,max:10,onChange:l=>c({chunkScore:l})})]})]})}function LR({value:t,kind:r,blockId:i,selectedId:a,onSelect:c,onChange:l}){const{card:u,uploadImage:d,insertMaterialBlank:m,geometry:p}=mt(),C=E.useRef([]),g=E.useRef([]),[,b]=E.useState(0),[v,x]=E.useState(1),[S,w]=E.useState(1),[T,j]=E.useState(null),R=t.items.find(U=>U.id===a)||t.items[0],O=t.items.indexOf(R),M=(U,q=R?.id)=>{JSON.stringify(t)!==JSON.stringify(U)&&(C.current.push({value:t,id:R?.id}),C.current=C.current.slice(-50),g.current=[],l(U),q&&c(q),b(P=>P+1))},D=U=>M({...t,...U}),_=U=>D({items:t.items.map(q=>q.id===R.id?{...q,...U}:q)}),I=U=>l({...t,items:t.items.map(q=>q.id===R.id?{...q,...U}:q)}),z=U=>{const q=U&&R?lS(R,Ir(t.items)):lu(R?.kind||cu(r),Ir(t.items)),P=[...t.items];P.splice(O+1,0,q),M({...t,items:P},q.id)},H=U=>{const q=U?g.current:C.current,P=U?C.current:g.current,G=q.pop();if(!G)return;P.push({value:t,id:R?.id});const B=G.value.items.map(Q=>{const N=t.items.find(K=>K.id===Q.id);return N?{...Q,document:N.document,reference:N.reference,explanation:N.explanation}:Q});l({...G.value,items:B}),G.id&&c(G.id),b(Q=>Q+1)},L=pm.includes(r),$=R&&["answer","calculation","correction","drawing","writing","english"].includes(R.kind),Y=fS(t,r);return f.jsxs("div",{className:"exercise-panel",children:[r!=="chunk"&&f.jsxs("div",{children:[f.jsx("div",{className:"exercise-tabs","aria-label":"选择当前小题",children:t.items.map(U=>f.jsx(ce,{size:"small","aria-pressed":R?.id===U.id,onClick:()=>c(U.id),children:U.label},U.id))}),f.jsx(Bl,{index:O,count:t.items.length,maximum:ym(r),onAdd:()=>z(!1),onCopy:()=>z(!0),onMove:U=>D({items:oa(t.items,R.id,U)}),onDelete:()=>{const U=t.items.filter(q=>q.id!==R.id);M({...t,items:U,chooseCount:Math.min(t.chooseCount,Math.max(1,U.length))},U[Math.max(0,O-1)]?.id)}}),f.jsxs("details",{children:[f.jsx("summary",{children:"批量配置"}),f.jsxs("div",{className:"exercise-fields",children:[f.jsx(ut,{label:"追加题数",value:v,min:1,max:50,onChange:x}),f.jsx(ut,{label:"起始题号",value:S,min:1,max:1e3,onChange:w}),f.jsx(tn,{label:"统一题分",value:T,max:Math.min(70,...t.items.map(U=>Us(U.kind))),onChange:j})]}),f.jsxs("div",{className:"exercise-actions",children:[f.jsx(ce,{size:"small",disabled:t.items.length+v>ym(r),onClick:()=>{const U=[...t.items],q=[];for(let P=0;P<v;P++)q.push(lu(R?.kind||cu(r),Ir([...U,...q])));U.splice(O+1,0,...q),M({...t,items:U},q[0].id)},children:"追加空白题"}),f.jsx(ce,{size:"small",onClick:()=>D({items:t.items.map((U,q)=>({...U,label:String(S+q),choice:{...U.choice,label:String(S+q)}}))}),children:"连续编号"}),f.jsx(ce,{size:"small",disabled:T!==null&&t.items.some(U=>T>Us(U.kind)),onClick:()=>D({items:t.items.map(U=>({...U,score:T,choice:{...U.choice,score:T}}))}),children:"统一分值"})]})]})]}),f.jsxs("div",{className:"exercise-actions",children:[f.jsx(ce,{size:"small",disabled:!C.current.length,onClick:()=>H(!1),children:"撤销题型配置"}),f.jsx(ce,{size:"small",disabled:!g.current.length,onClick:()=>H(!0),children:"重做题型配置"})]}),r==="chunk"&&f.jsx(kR,{value:t,onChange:M}),r==="optional"&&f.jsxs("div",{className:"exercise-fields",children:[f.jsx(ut,{label:"选做题数",value:t.chooseCount,min:1,max:Math.max(1,t.items.length),onChange:U=>D({chooseCount:U})}),f.jsx(tn,{label:"选做题组总分",value:t.groupScore,max:200,onChange:U=>D({groupScore:U})})]}),R&&r!=="chunk"&&f.jsxs("div",{children:[f.jsxs("div",{className:"exercise-fields",children:[f.jsx(cn,{label:"当前题号",value:R.label,onChange:U=>_({label:U,choice:{...R.choice,label:U}})}),f.jsx(tn,{label:"当前题分",value:R.score,max:Us(R.kind),onChange:U=>_({score:U,choice:{...R.choice,score:U}})}),L&&r!=="cloze"&&r!=="completion"&&f.jsx(at,{label:"小题题型",value:R.kind,options:iS,onChange:U=>_({kind:U})})]}),r==="cloze"&&f.jsx(ce,{size:"small",onClick:()=>m(i,R.id,R.label,60),children:"插入题号到公共材料"}),R.kind==="judge"&&f.jsxs("div",{children:[f.jsx(at,{label:"判断标记",value:t.judgeLabels,options:{symbols:"√/×",letters:"T/F",words:"正确/错误"},onChange:U=>D({judgeLabels:U})}),f.jsx(Zt,{label:"正确判断",children:f.jsx("div",{className:"exercise-tabs",children:gm[t.judgeLabels].map((U,q)=>f.jsx(ce,{size:"small","aria-pressed":R.judgment===(q===0),onClick:()=>_({judgment:R.judgment===(q===0)?null:q===0}),children:U},q))})}),f.jsx(Lt,{checked:R.needsReason,onChange:U=>_({needsReason:U.target.checked}),children:"判断后改正/说明理由"}),R.needsReason&&f.jsx(X0,{value:R.area,onChange:U=>_({area:U})})]}),R.kind==="choice"&&f.jsxs("details",{children:[f.jsx("summary",{children:"选项与计分规则"}),f.jsx(Y0,{value:{...iu(0),presentation:R.presentation,questions:[R.choice]},document:R.document,creation:u.creation,selectedId:R.choice.id,onSelect:()=>{},onChange:U=>{const q=U.questions.find(P=>P.id===R.choice.id);q&&_({choice:q,presentation:U.presentation,score:q.score??null})},singleQuestion:!0})]}),R.kind==="fill"&&r!=="matching"&&f.jsxs("div",{children:[f.jsx(Lt,{checked:t.fillNewLine,onChange:U=>D({fillNewLine:U.target.checked}),children:"每题一行"}),f.jsx(DR,{value:R.blanks,onChange:U=>_({blanks:U}),onInsert:U=>m(i,U.id,`${R.label}.${U.label}`,p.columnWidth*U.width/100-30)})]}),$&&r!=="ordering"&&f.jsxs("details",{open:!0,children:[f.jsx("summary",{children:"作答区域"}),f.jsx(X0,{value:R.area,drawing:R.kind==="drawing",onChange:U=>_({area:U})})]}),["answer","calculation","correction"].includes(R.kind)&&r!=="ordering"&&f.jsxs("details",{children:[f.jsx("summary",{children:r==="practice"?"评价量表":R.kind==="correction"?"改错位置与答案":"分步作答与评分点"}),f.jsx(_R,{value:R.steps,correction:R.kind==="correction",practice:r==="practice",onChange:U=>_({steps:U})})]}),R.kind==="table"&&f.jsx(ce,{size:"small",disabled:!xn(R.document),onClick:()=>_({document:hS()}),children:"建立空白表格"}),["matching","ordering"].includes(r)&&f.jsx(IR,{value:t,kind:r,item:R,onChange:M}),f.jsxs("details",{children:[f.jsx("summary",{children:r==="matching"?"左侧项目内容":"小题正文"}),f.jsx(Ui,{value:R.document,ariaLabel:`小题 ${R.label} 正文设置`,uploadImage:d,onChange:U=>I({document:U})})]}),f.jsxs("details",{children:[f.jsx("summary",{children:"参考答案与解析"}),f.jsx(Zt,{label:"参考答案",children:f.jsx(Ui,{value:R.reference,ariaLabel:"参考答案",uploadImage:d,onChange:U=>I({reference:U})})}),f.jsx(Zt,{label:"解析",children:f.jsx(Ui,{value:R.explanation,ariaLabel:"答案解析",uploadImage:d,onChange:U=>I({explanation:U})})})]})]},R.id),r==="practice"&&f.jsx(cn,{label:"作品/音视频引用 URL",value:t.attachmentUrl,maxLength:4096,onChange:U=>D({attachmentUrl:U})}),Y.length>0&&f.jsx("p",{className:"exercise-error",role:"alert",children:Y.join(";")})]})}function zR({group:t,creation:r,start:i,scanMarking:a,onAdd:c}){const{card:l}=mt(),u=l.usage==="homework",d=w=>{const T=mu(w,i,r);return t.type==="MIXED"&&w==="MCHOICE"?{...T,scoreType:t.scoreType||"LESS_SCORE",score:t.scoreType==="ITEM_SCORE"?T.score:null}:T},[m,p]=E.useState(()=>d(t.type==="MIXED"?"SCHOICE":t.type)),[C,g]=E.useState(null),[b,v]=E.useState({start:null,end:null}),x=w=>{g(null),p(T=>({...T,...w}))},S=aa[m.type];return f.jsxs("div",{className:"reference-add-panel",children:[t.type==="MIXED"&&f.jsx(at,{label:"子题题型",value:m.type,options:Object.fromEntries(Cm(r,!0).map(w=>[w,nr[w]])),onChange:w=>{p(d(w)),v({start:null,end:null}),g(null)}}),f.jsxs("div",{className:"exercise-fields",children:[f.jsx(Ta,{label:"起始题号",value:b.start,min:1,max:1e3,onChange:w=>v(T=>({...T,start:w}))}),!vi(m.type)&&f.jsx(Ta,{label:"结束题号",value:b.end,min:b.start||1,max:Math.min(1e3,(b.start||1)+S.count-1),onChange:w=>v(T=>({...T,end:w}))}),wt(m.type)&&(S.options[0]===S.options[1]?f.jsxs("div",{className:"card-field",children:[f.jsx("span",{children:"选项个数"}),f.jsx("span",{children:S.options[0]})]}):f.jsx(Ta,{label:"选项个数",value:m.optionCount,min:S.options[0],max:S.options[1],onChange:w=>x({optionCount:w})})),Le(m.type)&&f.jsx(Ta,{label:"子题数量",value:m.partCount,min:1,max:S.parts,onChange:w=>x({partCount:w})}),["FILLBLANK","SHORTANSWER"].includes(m.type)&&f.jsx(ut,{label:m.type==="FILLBLANK"?"每题空数":"每题小题数",value:m.partCount||1,min:1,max:m.type==="SHORTANSWER"&&(a||t.optional)?1:S.parts,onChange:w=>x({partCount:w})}),u&&f.jsx(Lt,{checked:m.score===0,onChange:w=>x({score:w.target.checked?0:null,lessScore:0}),children:"无分值"}),f.jsx(tn,{min:u?0:.5,label:m.type==="FILLBLANK"?"每空分值":m.type==="SHORTANSWER"?"每小题分值":"每题分值",value:m.score,max:S.score,onChange:w=>x({score:w,lessScore:0})}),m.type==="MCHOICE"&&f.jsxs(E.Fragment,{children:[t.type!=="MIXED"&&f.jsx(at,{label:"少选计分",value:m.scoreType,options:{LESS_SCORE:"少选得分",ITEM_SCORE:"选项得分"},onChange:w=>x({scoreType:w,lessScore:0})}),m.scoreType==="LESS_SCORE"&&f.jsx(ut,{label:"少选得分",value:m.lessScore,min:0,max:m.score||0,step:.5,onChange:w=>x({lessScore:w})})]}),m.type==="CHUNK_CHOICE"&&f.jsxs(E.Fragment,{children:[f.jsx(Ta,{label:"正确答案个数",value:m.rightAnswers,min:1,max:(m.optionCount||2)-1,onChange:w=>x({rightAnswers:w})}),f.jsx(tn,{label:"每涂对一处得分",value:m.singleScore,max:m.score||10,onChange:w=>x({singleScore:w})})]}),m.type==="CCOMPOSITION"&&f.jsx(ut,{label:"作文格数",value:m.characters,min:1,max:1200,onChange:w=>x({characters:w})}),m.type==="ECOMPOSITION"&&f.jsx(ut,{label:"作文行数",value:m.lines,min:1,max:100,onChange:w=>x({lines:w})})]}),C&&f.jsx("p",{role:"alert",className:"card-choice-error",children:C}),f.jsx(ce,{size:"small",type:"primary",onClick:()=>{if(b.start===null||!vi(m.type)&&b.end===null){g("请输入起始题号和结束题号");return}const w={...m,start:b.start,end:vi(m.type)?b.start:b.end},T=CS(t,w,a,u);g(T),T||c(w)},children:"添加题目"})]})}function Ta({label:t,value:r,min:i,max:a,onChange:c}){return f.jsx(Zt,{label:t,children:f.jsx(Ea,{"aria-label":t,value:r,min:i,max:a,precision:0,placeholder:"请输入",onChange:c})})}function BR({value:t,onChange:r,onClose:i}){const a=t.questions.filter(v=>wt(v.type)).flatMap(v=>Le(v.type)?v.parts:[v]),[c,l]=E.useState([]),[u,d]=E.useState(!1),[m,p]=E.useState(!1),[C,g]=E.useState(2),b=()=>{const v=(x,S)=>!c.includes(x.id)||!x.text?x:{...x,text:{...x.text,layout:{...x.text.layout,indent:u,layout:m?"fixed":"natural",columns:m?C:S?4:2}}};r({...t,questions:t.questions.map(x=>({...v(x,x.type==="CLOZE"),parts:x.parts.map(S=>v(S,x.type==="CLOZE"))}))}),i()};return f.jsx(Dl,{open:!0,title:"客观题选项排版设置",width:400,className:"card-modal",closeLabel:"关闭选项排版",closeIcon:f.jsx(ko,{name:"close"}),onCancel:i,footer:f.jsxs(f.Fragment,{children:[f.jsx(ce,{onClick:i,children:"取消"}),f.jsx(ce,{type:"primary",disabled:!c.length,onClick:b,children:"确定"})]}),children:f.jsxs("div",{className:"exercise-panel",children:[f.jsx(Lt,{checked:c.length===a.length,onChange:v=>l(v.target.checked?a.map(x=>x.id):[]),children:"全选"}),f.jsx("div",{className:"exercise-fields",children:a.map(v=>f.jsxs(Lt,{checked:c.includes(v.id),onChange:x=>l(S=>x.target.checked?[...S,v.id]:S.filter(w=>w!==v.id)),children:["第 ",v.label," 题"]},v.id))}),f.jsx(at,{label:"首行缩进",value:String(u),options:{false:"否",true:"是"},onChange:v=>d(v==="true")}),f.jsx(at,{label:"个数排版",value:String(m),options:{false:"否",true:"是"},onChange:v=>p(v==="true")}),m&&f.jsx(at,{label:"排版方式",value:String(C),options:{4:"一行4个",2:"一行2个",1:"一行1个"},onChange:v=>g(Number(v))})]})})}function HR({block:t,value:r,selectedId:i,onSelect:a,onChange:c}){const{card:l,geometry:u,setCard:d,editQuestion:m,insertMaterialBlank:p}=mt(),[C,g]=E.useState(null),[b,v]=E.useState(!1),[x,S]=E.useState([]),[w,T]=E.useState([]),[j,R]=E.useState(""),[O,M]=E.useState(!1),D=r.questions.find(B=>B.id===i||B.parts.some(Q=>Q.id===i))||r.questions[0],_=r.questions.indexOf(D),I=(B,Q)=>{S(N=>[...N.slice(-49),{value:r,document:t.document}]),T([]),R(""),g(null),c(B,Q)},z=B=>I({...r,questions:r.questions.map(Q=>Q.id===B.id?B:Q)}),H=sa(r),L=ou(r.layout),$=Bs(t.document),Y={...r.layout,direction:l.choiceDirection||r.layout.direction,questions:H},U=su(Y),q=L!=="concentrated"?na(Y,t.document,!0).concentrated.questions:[],P=U0(t),G=B=>{const Q=B.value;c({...Q,questions:Q.questions.map(N=>{const K=r.questions.find(ne=>ne.id===N.id);return K?{...N,text:K.text||N.text,document:vn(K.document,N.label,N.score),parts:N.parts.map(ne=>({...ne,text:K.parts.find(te=>te.id===ne.id)?.text||ne.text,document:vn(K.parts.find(te=>te.id===ne.id)?.document||ne.document,ne.label,ne.score)}))}:N})},ER(t.document,B.document))};return f.jsxs("div",{className:"exercise-panel reference-panel",children:[r.type==="MIXED"&&f.jsx(at,{label:"复合题少选计分",value:r.scoreType||"LESS_SCORE",options:{LESS_SCORE:"少选得分",ITEM_SCORE:"选项得分"},onChange:B=>I({...r,scoreType:B,questions:r.questions.map(Q=>Q.type==="MCHOICE"?{...Q,choice:{...Q.choice,scoreType:B,lessScore:B==="ITEM_SCORE"?0:Q.choice.lessScore}}:Q)})}),H.length>0&&f.jsxs("div",{className:"exercise-fields",children:[f.jsx(at,{label:"选择题填涂位置",value:L,options:r.questions.some(B=>B.type==="CHUNK_CHOICE")?{concentrated:"集中填涂",stem:"题干前整组字母框"}:{concentrated:"集中填涂",stem:"题干前整组字母框",option:"各选项前空方框"},onChange:B=>{const Q=au(Y,t.document,B),N=new Map(Q.questions.map(K=>[K.id,K]));I({...r,layout:{...Q,questions:[]},questions:r.questions.map(K=>({...K,choice:N.get(K.id)||K.choice,parts:K.parts.map(ne=>({...ne,choice:N.get(ne.id)||ne.choice}))}))})}}),f.jsx(at,{label:"填涂排列方向",value:U,options:new Set(H.map(B=>B.options.length)).size>1?{column:"竖排(选项数不同)"}:{row:"横排(先右后下)",column:"竖排(先下后右)"},onChange:B=>d(Q=>({...Q,choiceDirection:B}))}),U==="column"&&f.jsx(ut,{label:"每列题数",value:r.layout.rowsPerColumn,min:1,max:5,onChange:B=>I({...r,layout:{...r.layout,rowsPerColumn:B}})}),r.textVersion===1&&l.questionCard&&r.type!=="INFO_MATCHING"&&f.jsx(ce,{size:"small",onClick:()=>M(!0),children:"选项排版"})]}),r.questions.length>0&&f.jsxs(E.Fragment,{children:[f.jsx(at,{label:"当前题目",value:D.id,options:Object.fromEntries(r.questions.map(B=>[B.id,`${Le(B.type)?B.parts.map(Q=>Q.label).join("、"):B.label} · ${nr[B.type]}`])),onChange:a}),f.jsxs("div",{className:"exercise-actions",children:[f.jsx(ce,{size:"small",disabled:r.type==="CCOMPOSITION"||r.optional,onClick:()=>v(B=>!B),children:"新增题目"}),f.jsx(ce,{size:"small",disabled:r.type==="CCOMPOSITION"||r.optional||Vs(r)+D.parts.length-1>1e3,onClick:()=>{if(r.type==="CCOMPOSITION"||r.optional)return;const B=ES(D,Vs(r)),Q=[...r.questions];Q.splice(_+1,0,B),I({...r,questions:Q},wR(t.document,D,B)),a(B.id)},children:"复制当前题目"}),f.jsx(ce,{size:"small","aria-label":"上移当前题目",disabled:_<=0,onClick:()=>I({...r,questions:oa(r.questions,D.id,-1)}),children:"↑"}),f.jsx(ce,{size:"small","aria-label":"下移当前题目",disabled:_>=r.questions.length-1,onClick:()=>I({...r,questions:oa(r.questions,D.id,1)}),children:"↓"}),f.jsx(ce,{size:"small",danger:!0,onClick:()=>{const B=r.questions.filter(Q=>Q.id!==D.id);I({...r,questions:B,optional:r.optional&&B.length>1,choose:Math.max(1,Math.min(r.choose,B.length-1))}),B.length&&a(B[Math.max(0,_-1)].id)},children:"删除当前题目"})]})]}),(!r.questions.length||b)&&f.jsx(zR,{group:r,creation:l.creation,start:Vs(r),scanMarking:!!l.scanMarking,onAdd:B=>{const Q=wS(r,{...B,paperWidth:u.columnWidth},D?.id);I({...Q,questions:Q.questions.map(N=>r.questions.some(K=>K.id===N.id)?N:{...N,halfPoint:!!l.halfPoint})}),a(Q.questions.find(N=>!r.questions.some(K=>K.id===N.id)).id),v(!1)}},`${r.type}/${Vs(r)}/${r.scoreType}`),r.type==="SHORTANSWER"&&r.questions.length>1&&f.jsxs(E.Fragment,{children:[f.jsx(Lt,{checked:r.optional,disabled:r.questions.some(B=>B.parts.length>1),onChange:B=>I({...r,optional:B.target.checked,choose:1}),children:"是否选做"}),r.optional&&f.jsx(ut,{label:`${r.questions.length} 选`,value:r.choose,min:1,max:l.scanMarking?r.questions.length-1:1,onChange:B=>I({...r,choose:B})})]}),r.questions.length>0&&!r.optional&&r.type!=="MIXED"&&f.jsxs("div",{className:"exercise-fields",children:[f.jsx(tn,{label:"分组总分",min:l.usage==="homework"?0:.5,value:C??Vn(r.questions),max:1e4,onChange:g}),f.jsx(ce,{size:"small",disabled:(C??Vn(r.questions))===null,onClick:()=>{const B=AS(r,C??Vn(r.questions),l.usage==="homework");B?I(B):R("总分无法平均分配,每题/空的分值须符合题型范围且为 0.5 的倍数")},children:"平均分配"})]}),D&&f.jsxs("div",{className:"exercise-fields",children:[f.jsx(at,{label:"编辑正文",value:P.some(B=>B.id===i)?i:D.id,options:Object.fromEntries(P.map(B=>[B.id,B.label])),onChange:B=>{a(B),m(t.id,B)}}),f.jsx(ce,{size:"small",onClick:()=>m(t.id,i||D.id),children:"编辑当前正文"})]}),q.length>0&&f.jsxs("p",{className:"card-choice-error",role:"status",children:["第 ",q.map(B=>B.label).join("、")," 题",L==="stem"?"尚未关联题干":"尚未关联完整选项",",暂保留集中填涂。"]}),D&&f.jsx(PR,{value:D,group:r,scanMarking:!!l.scanMarking,onApply:B=>{const Q=r.questions.find(te=>te.id===B.id),N={...B,document:vn(Q.document,B.label,B.score),parts:B.parts.map(te=>({...te,document:vn(Q.parts.find(le=>le.id===te.id)?.document||te.document,te.label,te.score)}))},K=r.questions.filter(te=>te.id!==N.id).flatMap(te=>Le(te.type)?te.parts.map(le=>le.label):[te.label]),ne=Le(N.type)?N.parts.map(te=>te.label):[N.label];return ne.some(te=>!te.trim()||K.includes(te))||new Set(ne).size!==ne.length?(R("题号不能为空或重复"),!1):(r.optional?I({...r,questions:r.questions.map(te=>te.id===N.id?N:{...te,score:N.score,document:vn(te.document,te.label,N.score),parts:te.parts.map(le=>({...le,score:N.score,document:vn(le.document,le.label,N.score)}))})}):z(N),!0)}},D.id),D&&xi(D.type)&&f.jsxs(E.Fragment,{children:[f.jsx(Lt,{checked:r.fillNewLine,onChange:B=>I({...r,fillNewLine:B.target.checked}),children:"每题一行"}),f.jsx("div",{className:"reference-part-settings",children:D.parts.map(B=>f.jsxs("div",{children:[f.jsxs("div",{className:"exercise-fields",children:[f.jsx(cn,{label:`空位 ${B.label} 显示题号`,maxLength:10,value:B.label,onChange:Q=>z({...D,parts:D.parts.map(N=>N.id===B.id?{...N,label:Q}:N)})}),f.jsx(at,{label:`空位 ${B.label} 宽度`,value:String(B.width),options:{...l.scanMarking?{20:"1/5 行"}:{},25:"1/4 行",33:"1/3 行",50:"1/2 行",66:"2/3 行",75:"3/4 行",100:"整行"},onChange:Q=>z({...D,parts:D.parts.map(N=>N.id===B.id?{...N,width:Number(Q)}:N)})})]}),f.jsxs("div",{className:"exercise-actions",children:[f.jsx(ce,{size:"small",onClick:()=>p(t.id,B.id,B.label,u.columnWidth*B.width/100),children:"插入此空到正文"}),f.jsx(Lt,{checked:B.breakAfter,onChange:Q=>z({...D,parts:D.parts.map(N=>N.id===B.id?{...N,breakAfter:Q.target.checked}:N)}),children:"此空后换行"}),f.jsx(ce,{size:"small",onClick:()=>I({...r,questions:r.questions.map(Q=>xi(Q.type)?{...Q,parts:Q.parts.map(N=>({...N,width:B.width}))}:Q)}),children:"宽度统一设置"})]})]},B.id))})]}),D&&wt(D.type)&&f.jsx(E.Fragment,{children:(Le(D.type)?D.parts.map(B=>B.choice):[D.choice]).map(B=>f.jsxs("div",{children:[f.jsxs(Lt,{checked:B.breakBefore,onChange:Q=>{const N={...B,breakBefore:Q.target.checked};z({...D,choice:D.choice.id===B.id?N:D.choice,parts:D.parts.map(K=>K.choice.id===B.id?{...K,choice:N}:K)})},children:[B.label," 题前换行"]}),L==="option"&&r.textVersion!==1&&f.jsx(at,{label:`${B.label} 题对应正文选项`,value:B.contentTarget?.groupId||"",options:{"":"按正文归属匹配",...Object.fromEntries($.map((Q,N)=>[Q.id,`第 ${Q.label||N+1} 组选项`]))},onChange:Q=>{const N=$.find(ne=>ne.id===Q),K={...B,contentTarget:N?{groupId:Q,optionIds:N.options.map(ne=>ne.id)}:null};z({...D,choice:D.choice.id===B.id?K:D.choice,parts:D.parts.map(ne=>ne.choice.id===B.id?{...ne,choice:K}:ne)})}})]},B.id))}),j&&f.jsx("p",{className:"card-choice-error",role:"alert",children:j}),O&&f.jsx(BR,{value:r,onChange:I,onClose:()=>M(!1)}),(x.length>0||w.length>0)&&f.jsxs("div",{className:"exercise-actions",children:[f.jsx(ce,{size:"small",disabled:!x.length,onClick:()=>{const B=x.at(-1);S(x.slice(0,-1)),T(Q=>[...Q,{value:r,document:t.document}]),G(B)},children:"撤销题型配置"}),f.jsx(ce,{size:"small",disabled:!w.length,onClick:()=>{const B=w.at(-1);T(w.slice(0,-1)),S(Q=>[...Q,{value:r,document:t.document}]),G(B)},children:"重做题型配置"})]})]})}function PR({value:t,group:r,scanMarking:i,onApply:a}){const{card:c}=mt(),[l,u]=E.useState(null),[d,m]=E.useState(""),p=l||t,C=w=>{u({...p,...w}),m("")},g=p.type,b=aa[g],v=p.choice.options.length,x=p.parts.length,S=w=>{const T=Array.from({length:w},(j,R)=>p.parts[R]||Si(Le(g)?String(Number(p.parts[0]?.label||p.label)+R):w===1?p.label:`${p.label}.${R+1}`,p.parts[0]?.score??null,g,p.choice.options.length));Le(g)||T.forEach((j,R)=>{T[R]={...j,label:w===1?p.label:`${p.label}.${R+1}`}}),C({parts:T,score:Vn(T)})};return f.jsxs("div",{className:"reference-question-settings",children:[f.jsxs("div",{className:"exercise-fields",children:[r.type!=="MIXED"&&["SCHOICE","MCHOICE"].includes(g)&&f.jsx(at,{label:"题型",value:g,options:{SCHOICE:"单选题",MCHOICE:"多选题"},onChange:w=>{const T=w==="MCHOICE"&&mi(c.creation)&&p.score===null?6:p.score;C({type:w,score:T,choice:{...ia(p.choice,w,v),score:T,scoreType:w==="MCHOICE"&&mi(c.creation)?"ITEM_SCORE":"LESS_SCORE",lessScore:0}})}}),!Le(g)&&f.jsx(cn,{label:"题目题号",value:p.label,maxLength:10,onChange:w=>C({label:w,choice:{...p.choice,label:w},parts:p.parts.map((T,j)=>({...T,label:p.parts.length===1?w:`${w}.${j+1}`}))})}),wt(g)&&f.jsx(ut,{label:"选项个数",min:b.options[0],max:b.options[1],value:v,onChange:w=>C({choice:ia(p.choice,g,w),parts:p.parts.map(T=>({...T,choice:ia(T.choice,g,w)}))})}),x>0&&(g==="INFO_MATCHING"||r.type==="MIXED")&&f.jsx(Zt,{label:"子题数量",children:f.jsx("span",{children:x})}),x>0&&g!=="INFO_MATCHING"&&r.type!=="MIXED"&&f.jsx(ut,{label:Le(g)?"子题数量":g==="FILLBLANK"?"每题空数":"每题小题数",value:x,min:1,max:g==="SHORTANSWER"&&(i||r.optional)?1:b.parts,onChange:S}),c.usage==="homework"&&f.jsx(Lt,{checked:p.score===0,onChange:w=>{const T=w.target.checked?0:null;C({score:T,choice:{...p.choice,score:T,lessScore:0},parts:p.parts.map(j=>({...j,score:T,choice:{...j.choice,score:T,lessScore:0}}))})},children:"无分值"}),!x&&f.jsx(tn,{min:c.usage==="homework"?0:.5,label:"本题分值",value:p.score,max:b.score,onChange:w=>C({score:w,choice:{...p.choice,score:w,lessScore:0}})}),Le(g)&&f.jsx(tn,{min:c.usage==="homework"?0:.5,label:"每题分值",value:p.parts[0]?.score??null,max:b.score,onChange:w=>{const T=p.parts.map(j=>({...j,score:w,choice:{...j.choice,score:w}}));C({parts:T,score:Vn(T)})}}),g==="MCHOICE"&&f.jsxs(E.Fragment,{children:[r.type!=="MIXED"&&f.jsx(at,{label:"少选计分",value:p.choice.scoreType||"LESS_SCORE",options:{LESS_SCORE:"少选得分",ITEM_SCORE:"选项得分"},onChange:w=>C({choice:{...p.choice,scoreType:w,lessScore:0}})}),p.choice.scoreType!=="ITEM_SCORE"&&f.jsx(ut,{label:"少选得分",min:0,max:p.score||0,step:.5,value:p.choice.lessScore||0,onChange:w=>C({choice:{...p.choice,lessScore:w}})})]}),g==="CHUNK_CHOICE"&&f.jsxs(E.Fragment,{children:[f.jsx(Ta,{label:"正确答案个数",value:p.rightAnswers,min:1,max:v-1,onChange:w=>C({rightAnswers:w})}),f.jsx(tn,{label:"每涂对一处得分",value:p.singleScore,max:p.score||10,onChange:w=>C({singleScore:w})})]}),g==="CCOMPOSITION"&&f.jsx(ut,{label:"作文格数",value:p.characters,min:1,max:1200,onChange:w=>C({characters:w})}),g==="ECOMPOSITION"&&f.jsx(Zt,{label:"初始作文行数",children:f.jsx("span",{children:p.lines})}),g==="CCOMPOSITION"&&f.jsx(ut,{label:"题干区域高度",value:p.contentHeight,min:38,max:Number.MAX_SAFE_INTEGER,onChange:w=>C({contentHeight:w})})]}),p.parts.map((w,T)=>f.jsxs("div",{className:"exercise-fields",children:[f.jsx(cn,{label:`第 ${T+1} ${g==="FILLBLANK"?"空":"小题"}题号`,value:w.label,maxLength:10,onChange:j=>C({parts:p.parts.map(R=>R.id===w.id?{...R,label:j,choice:{...R.choice,label:j}}:R)})}),!Le(g)&&f.jsx(tn,{min:c.usage==="homework"?0:.5,label:`第 ${T+1} ${g==="FILLBLANK"?"空":"小题"}分值`,value:w.score,max:b.score,onChange:j=>{const R=p.parts.map(O=>O.id===w.id?{...O,score:j,choice:{...O.choice,score:j}}:O);C({parts:R,score:Vn(R)})}}),["FILLBLANK","SHORTANSWER"].includes(g)&&r.type!=="MIXED"&&!r.optional&&x>1&&f.jsx(ce,{size:"small",danger:!0,"aria-label":`删除第 ${T+1} ${g==="FILLBLANK"?"空":"小题"}`,onClick:()=>{const j=p.parts.filter(R=>R.id!==w.id).map((R,O)=>({...R,label:x===2?p.label:`${p.label}.${O+1}`}));C({parts:j,score:Vn(j)})},children:"删除"}),g==="SHORTANSWER"&&!r.optional&&f.jsx(ut,{label:`第 ${T+1} 小题作答高度`,value:w.height,min:30,max:Number.MAX_SAFE_INTEGER,onChange:j=>C({parts:p.parts.map(R=>R.id===w.id?{...R,height:j}:R)})})]},w.id)),p.parts.length>0&&f.jsx(Zt,{label:"本题总分",children:f.jsx("span",{children:p.score??"未设置"})}),!wt(g)&&!xi(g)&&f.jsx(Lt,{checked:p.halfPoint,onChange:w=>C({halfPoint:w.target.checked}),children:"计分栏显示 0.5"}),d&&f.jsx("p",{className:"card-choice-error",role:"alert",children:d}),f.jsx(ce,{size:"small",disabled:!l,onClick:()=>{if((x?p.parts:[p]).some(w=>w.score===null||w.score<(c.usage==="homework"?0:.5)||w.score>b.score)){m("请填写符合题型范围的分值");return}if(p.parts.some(w=>!w.label.trim())){m("题号不能为空");return}if(g==="INFO_MATCHING"&&x>v){m("选项个数需大于等于子题数量");return}if(g==="CHUNK_CHOICE"&&(!p.rightAnswers||p.rightAnswers>=v||p.singleScore===null||p.score!==null&&p.score!==0&&p.rightAnswers*p.singleScore>p.score)){m("正确答案个数须小于选项数,且每处得分之和不能超过题分");return}if(g==="MCHOICE"&&(p.choice.lessScore||0)>(p.score||0)){m("少选得分不能超过本题分值");return}a(p)&&u(null)},children:"应用配置"})]})}function UR({block:t,autoFocus:r,onClose:i}){const{card:a,geometry:c,setCard:l,setSelectedId:u,setDeleted:d,updateBlock:m,editQuestion:p,selectedChoiceId:C,selectChoice:g}=mt(),{dialog:b,setDialog:v,titleProps:x,cancelDrag:S}=Xd(O=>{const M=O.closest(".card-workspace")?.querySelector(".card-sidebar")?.getBoundingClientRect();return{left:(M?.left??window.innerWidth)-O.getBoundingClientRect().width-12,top:(M?.top??0)+12}}),w=E.useRef(document.activeElement instanceof HTMLElement?document.activeElement:null);E.useLayoutEffect(()=>{if(!b)return;const O=b;O.setAttribute("aria-modal","false"),O.setAttribute("aria-labelledby","card-block-modal-title");let M=document.activeElement instanceof HTMLElement?document.activeElement:null;const D=_=>{_.target instanceof HTMLElement&&!O.contains(_.target)&&(M=_.target)};return document.addEventListener("focusin",D),()=>{document.removeEventListener("focusin",D),O.contains(document.activeElement)&&M?.isConnected&&M.focus({preventScroll:!0})}},[b]),E.useLayoutEffect(()=>{b&&(b.dataset.settingsBlock=t.id)},[b,t.id]);const T=f.jsxs("div",{...x,className:"card-modal-drag","aria-label":"拖动题块设置",title:"拖动移动;方向键微调,Home 复位","data-editor-menu-avoid":!0,children:[f.jsx("h2",{id:"card-block-modal-title",children:"题块设置"}),f.jsx("p",{"aria-hidden":"true",children:t.reference?nr[t.reference.type]:xm[t.kind]})]}),j=()=>{d({block:t,index:a.blocks.findIndex(O=>O.id===t.id)}),l(O=>({...O,blocks:O.blocks.filter(M=>M.id!==t.id)})),u(null),i()},R=f.jsxs("div",{className:"card-modal-actions",children:[f.jsxs(ce,{type:"text",danger:!0,className:"card-delete","aria-label":"删除选中题块",onClick:j,children:[f.jsx(ko,{name:"trash",size:16}),"删除题块"]}),f.jsx(ce,{type:"text",onClick:()=>{const O=vo(t);l(M=>{const D=[...M.blocks];return D.splice(D.findIndex(_=>_.id===t.id)+1,0,O),{...M,blocks:D}}),u(O.id)},children:"复制题块"}),f.jsx(ce,{type:"primary",className:"card-edit-question",onClick:()=>p(t.id),children:t.areaType?"编辑文字":"编辑题目"})]});return f.jsx(Dl,{open:!0,modal:!1,panelRef:v,className:"card-modal card-block-modal",width:400,zIndex:900,classNames:{header:"card-modal-header",body:"card-modal-body card-inspector",footer:"card-modal-footer"},closeLabel:"关闭题块设置",closeIcon:f.jsx(ko,{name:"close",size:16}),onCancel:i,onOpenAutoFocus:O=>{O.preventDefault(),r?b?.querySelector(".ui-dialog-close")?.focus({preventScroll:!0}):w.current?.focus({preventScroll:!0})},onEscapeKeyDown:O=>{O.preventDefault(),O.stopPropagation(),S()||i()},title:T,footer:R,children:f.jsxs("div",{children:[f.jsxs("label",{className:"card-field",children:["标题",f.jsx(wa,{"aria-label":"题块标题",value:t.title,maxLength:300,onChange:O=>m(t.id,{title:O.target.value})})]}),t.reference&&f.jsx(HR,{block:t,value:t.reference,selectedId:C(t),onSelect:O=>g(t.id,O),onChange:(O,M)=>m(t.id,{reference:O,...M?{document:M}:{}})}),!t.reference&&t.kind==="choice"&&t.choices&&f.jsx(Y0,{value:t.choices,document:t.document,creation:a.creation,selectedId:C(t),onSelect:O=>g(t.id,O),onChange:O=>m(t.id,{choices:O})}),t.kind==="area"&&f.jsx(ut,{label:"区域高度",min:100,max:t.areaType==="forbiden"?Math.floor(c.contentHeight):4e3,value:t.answerHeight,onChange:O=>m(t.id,{answerHeight:O})}),!t.reference&&t.kind!=="choice"&&t.kind!=="area"&&t.exercise&&f.jsx(LR,{value:t.exercise,kind:t.kind,blockId:t.id,selectedId:C(t),onSelect:O=>g(t.id,O),onChange:O=>m(t.id,{exercise:O})}),!t.reference&&t.kind!=="choice"&&t.kind!=="area"&&!t.exercise&&f.jsxs("div",{className:"card-range",children:["作答区高度 ",f.jsxs("b",{children:[t.answerHeight," px"]}),f.jsx(D0,{className:"ui-slider",ariaLabelForHandle:"作答区高度",min:0,max:800,step:10,value:t.answerHeight,onChange:O=>m(t.id,{answerHeight:O})}),f.jsx(ce,{size:"small",onClick:()=>{if(t.kind==="choice"||t.kind==="area")return;const O=sS(t.kind);O.items[0].area.rows=Math.ceil(t.answerHeight/O.items[0].area.rowHeight),m(t.id,{exercise:O})},children:"启用题型配置"})]})]},t.id)})}function $R(t){const r=new URLSearchParams(location.search);return{mode:r.get("mode")==="exam"?"exam":"template",name:(r.get("name")||"").slice(0,30),...fm(t,{gradeCode:r.get("gradeCode")||void 0,courseCode:r.get("courseCode")||void 0,grade:r.get("grade")||void 0,subject:r.get("subject")||void 0}),...r.get("id")?{id:r.get("id")}:{},...r.get("exampaperId")?{exampaperId:r.get("exampaperId")}:{}}}function GR({initial:t,dictionary:r,replacing:i,onCreate:a,onClose:c}){const[l,u]=E.useState(t),d={...l,...fm(r,l)},m=r.gradeCourseMap[d.gradeCode]||[],[p,C]=E.useState(""),g=E.useId(),b=E.useRef(null),{dialog:v,setDialog:x,titleProps:S}=Xd();E.useLayoutEffect(()=>{v?.setAttribute("aria-labelledby",`${g}-title`)},[v,g]);const w=f.jsx("div",{...S,className:"card-modal-drag","aria-label":"拖动新建答题卡",title:"拖动移动;方向键微调,Home 居中",children:f.jsx("h2",{id:`${g}-title`,children:"新建答题卡"})});return f.jsx(Dl,{open:!0,panelRef:x,width:460,className:"card-modal card-create-modal",title:w,closeLabel:"关闭新建答题卡",closeIcon:f.jsx(ko,{name:"close",size:16}),onCancel:c,onOpenAutoFocus:T=>{T.preventDefault(),b.current?.focus({preventScroll:!0})},footer:f.jsxs("div",{className:"card-create-actions",children:[f.jsx(ce,{onClick:c,children:"取消"}),f.jsx(ce,{type:"primary",htmlType:"submit",form:g,disabled:!d.gradeCode||!d.courseCode,children:"确定"})]}),children:f.jsxs("form",{id:g,onSubmit:T=>{if(T.preventDefault(),!d.name.trim()){C("请输入题卡名称"),b.current?.focus();return}if(!d.gradeCode||!d.courseCode){C("没有可用的年级和课程");return}a({...d,name:d.name.trim()})},children:[f.jsx("div",{className:"card-create-mode",role:"group","aria-label":"创建用途",children:["template","exam"].map(T=>f.jsx(ce,{type:d.mode===T?"primary":"default","aria-pressed":d.mode===T,onClick:()=>u(j=>({...j,mode:T})),children:T==="template"?"答题卡模板":"考试答题卡"},T))}),f.jsxs("label",{className:"card-field",children:["题卡名称",f.jsx(wa,{ref:b,"aria-label":"题卡名称",status:p?"error":void 0,"aria-invalid":!!p,"aria-describedby":p?"card-create-error":void 0,placeholder:"请输入题卡名称",maxLength:30,value:d.name,onChange:T=>{u(j=>({...j,name:T.target.value})),C("")}})]}),f.jsxs("div",{className:"card-create-subject",children:[f.jsxs("label",{className:"card-field",children:["年级",f.jsx(Ft,{"aria-label":"年级",value:d.gradeCode,disabled:!r.grades.length,onChange:T=>u(j=>({...j,...hi(r,T,r.gradeCourseMap[T][0].value)})),children:r.grades.map(T=>f.jsx("option",{value:T.value,children:T.label},T.value))})]}),f.jsxs("label",{className:"card-field",children:["科目",f.jsx(Ft,{"aria-label":"科目",value:d.courseCode,disabled:!m.length,onChange:T=>u(j=>({...j,...hi(r,d.gradeCode,T)})),children:m.map(T=>f.jsx("option",{value:T.value,children:T.label},T.value))})]})]}),!r.grades.length&&f.jsx("p",{className:"card-create-error",role:"alert",children:"没有可用的年级和课程"}),p&&f.jsx("p",{id:"card-create-error",className:"card-create-error",role:"alert",children:p}),i&&f.jsx("p",{className:"card-section-note",children:"确定后将新建空白题卡并替换当前内容。"})]})})}function VR(){const{card:t,setCard:r,setQuestionCard:i,readOnly:a,geometry:c}=mt(),l=u=>r(d=>d.header?{...d,header:{...d.header,...u}}:d);return f.jsxs("div",{className:"card-sidebar-section card-paper-settings",children:[f.jsx("h1",{children:"页面布局"}),f.jsx("div",{className:"card-preset-grid",children:Object.keys(pi).map((u,d)=>f.jsxs(ce,{type:"text","aria-label":pi[u].label,"aria-pressed":t.preset===u,disabled:a,onClick:()=>r(m=>({...m,preset:u})),children:[f.jsx("span",{className:`card-paper-icon cols-${pi[u].columns}`,children:Array.from({length:pi[u].columns},(m,p)=>f.jsx("i",{},p))}),f.jsx("span",{children:["一栏","两栏","三栏"][d]})]},u))}),f.jsx("p",{className:"card-section-note",children:c.columns===1?"一栏适用于 A4、16K 纸张":`${c.columns===2?"二":"三"}栏适用于 A3、8K 纸张`}),f.jsxs("div",{className:"card-paper-options",children:[f.jsxs("fieldset",{className:"card-setting-row",disabled:a,children:[f.jsx("legend",{children:"题卡用途"}),f.jsxs(Ye.Group,{className:"card-radio-options",size:"small",disabled:a,value:t.usage||"exam",onChange:u=>r(d=>({...d,usage:u.target.value})),children:[f.jsx(Ye.Button,{value:"exam",children:"考试"}),f.jsx(Ye.Button,{value:"homework",children:"作业"})]})]}),f.jsxs("fieldset",{className:"card-setting-row",disabled:a,children:[f.jsx("legend",{children:"批阅模式"}),f.jsxs(Ye.Group,{className:"card-radio-options",size:"small",disabled:a,value:!!t.scanMarking,onChange:u=>r(d=>({...d,scanMarking:u.target.value,blocks:d.blocks.map(m=>m.reference?.optional&&!u.target.value?{...m,reference:{...m.reference,choose:1}}:m)})),children:[f.jsx(Ye.Button,{value:!1,children:"手阅"}),f.jsx(Ye.Button,{value:!0,children:"网阅"})]})]}),f.jsxs("fieldset",{className:"card-setting-row",disabled:a,children:[f.jsx("legend",{children:"分值 0.5"}),f.jsxs(Ye.Group,{className:"card-radio-options",size:"small",disabled:a,value:!!t.halfPoint,onChange:u=>r(d=>({...d,halfPoint:u.target.value,blocks:d.blocks.map(m=>m.reference?{...m,reference:{...m.reference,questions:m.reference.questions.map(p=>({...p,halfPoint:u.target.value}))}}:m)})),children:[f.jsx(Ye.Button,{value:!0,children:"显示"}),f.jsx(Ye.Button,{value:!1,children:"不显示"})]})]}),f.jsxs("fieldset",{className:"card-setting-row",disabled:a,children:[f.jsx("legend",{children:"题卡合一"}),f.jsxs(Ye.Group,{className:"card-radio-options",size:"small",name:"question-card",disabled:a,value:t.questionCard!==!1,onChange:u=>i(u.target.value),children:[f.jsx(Ye.Button,{value:!0,children:"是"}),f.jsx(Ye.Button,{value:!1,children:"否"})]})]}),f.jsxs("fieldset",{className:"card-setting-row",disabled:a,children:[f.jsx("legend",{children:"客观题排列"}),f.jsxs(Ye.Group,{className:"card-radio-options",size:"small",disabled:a,value:t.choiceDirection||"row",onChange:u=>r(d=>({...d,choiceDirection:u.target.value})),children:[f.jsx(Ye.Button,{value:"row",children:"横排"}),f.jsx(Ye.Button,{value:"column",children:"竖排"})]})]}),f.jsxs("fieldset",{className:"card-setting-row",disabled:a,children:[f.jsx("legend",{children:"客观题合并"}),f.jsxs(Ye.Group,{className:"card-radio-options",size:"small",disabled:a,value:!!t.mergeObjective,onChange:u=>r(d=>({...d,mergeObjective:u.target.value})),children:[f.jsx(Ye.Button,{value:!1,children:"不合并"}),f.jsx(Ye.Button,{value:!0,children:"合并"})]})]}),t.header&&f.jsxs(E.Fragment,{children:[[["subjectMarkers","学科标记"],["pointBlack","辅助识别点"],["examQrCode","试卷二维码"]].filter(([u])=>u!=="pointBlack"||t.usage!=="homework").map(([u,d])=>f.jsxs("fieldset",{className:"card-setting-row",disabled:a,children:[f.jsx("legend",{children:d}),f.jsxs(Ye.Group,{className:"card-radio-options",size:"small",disabled:a,value:u==="subjectMarkers"?t.recognition?.[u]!==!1:!!t.recognition?.[u],onChange:m=>r(p=>({...p,recognition:{...p.recognition,[u]:m.target.value}})),children:[f.jsx(Ye.Button,{value:!0,children:"显示"}),f.jsx(Ye.Button,{value:!1,children:"不显示"})]})]},u)),t.recognition?.examQrCode&&f.jsxs("label",{className:"card-number-digits",children:[f.jsx("span",{children:"试卷 ID"}),f.jsx(wa,{"aria-label":"二维码试卷 ID",value:String(t.creation?.exampaperId??""),disabled:a,maxLength:128,onChange:u=>r(d=>d.creation?{...d,creation:{...d.creation,exampaperId:u.target.value||void 0}}:d)})]}),t.usage!=="homework"&&f.jsxs(E.Fragment,{children:[[["focusText","注意事项"],["writeKaohao","考场/座位号"],["missExam","填涂标记"],["mifeng","密封线"]].map(([u,d])=>f.jsxs("fieldset",{className:"card-setting-row",disabled:a,children:[f.jsx("legend",{children:d}),f.jsxs(Ye.Group,{className:"card-radio-options",size:"small",name:`header-${u}`,disabled:a,value:t.header[u],onChange:m=>l({[u]:m.target.value}),children:[f.jsx(Ye.Button,{value:!0,children:"显示"}),f.jsx(Ye.Button,{value:!1,children:"不显示"})]})]},u)),f.jsxs("fieldset",{className:"card-setting-row card-exam-number-setting",disabled:a,children:[f.jsx("legend",{children:"考号版式"}),f.jsxs(Ye.Group,{className:"card-radio-options",size:"small",name:"header-kaohao",disabled:a,value:t.header.kaohao,onChange:u=>l({kaohao:u.target.value}),children:[f.jsx(Ye.Button,{value:"code",children:"条形码"}),f.jsx(Ye.Button,{value:"school",children:"校内准考证号"})]})]}),t.header.kaohao==="school"&&f.jsxs("label",{className:"card-number-digits",children:[f.jsx("span",{children:"考号位数"}),f.jsx(Ft,{"aria-label":"准考证号位数",size:"small",disabled:a,value:t.header.weishu,onChange:u=>l({weishu:Number(u)}),children:Array.from({length:9},(u,d)=>f.jsxs("option",{value:d+4,children:[d+4,"位"]},d))})]})]}),t.usage==="homework"&&f.jsxs(E.Fragment,{children:[f.jsxs("fieldset",{className:"card-setting-row",disabled:a,children:[f.jsx("legend",{children:"作业考号版式"}),f.jsxs(Ye.Group,{className:"card-radio-options",size:"small",value:t.header.tiaomaStyle||1,onChange:u=>l({tiaomaStyle:u.target.value}),children:[f.jsx(Ye.Button,{value:1,children:"填涂"}),f.jsx(Ye.Button,{value:2,children:"条形码"})]})]}),t.header.tiaomaStyle!==2&&f.jsxs("fieldset",{className:"card-setting-row",disabled:a,children:[f.jsx("legend",{children:"班级填涂"}),f.jsxs(Ye.Group,{className:"card-radio-options",size:"small",value:t.header.classText!==!1,onChange:u=>l({classText:u.target.value}),children:[f.jsx(Ye.Button,{value:!0,children:"显示"}),f.jsx(Ye.Button,{value:!1,children:"不显示"})]})]})]})]})]})]})}function qR(){const{card:t,creationDictionary:r,saveMessage:i,saveAction:a,setCard:c,creationOpen:l,setCreationOpen:u,newCard:d,selectedId:m,setSelectedId:p,settingsId:C,setSettingsId:g,settingsAutoFocus:b,openSettings:v,readOnly:x,setReadOnly:S,titleOverflow:w,deleted:T,setDeleted:j,overflow:R,placementById:O,fitPage:M,moveBlock:D,selectBlock:_,download:I}=mt(),z=t.blocks.find(U=>U.id===C),[H,L]=E.useState(!1),[$,Y]=E.useState(null);return f.jsxs("div",{className:"card-controls",children:[f.jsxs("aside",{className:"card-sidebar","aria-label":"制卡设置",children:[f.jsxs("div",{className:"card-panel-header",children:[f.jsx("strong",{children:"制卡设置"}),f.jsx("a",{"data-card-demo-link":"",href:"/rich-text",children:"富文本编辑 ↗"})]}),f.jsxs("div",{className:"card-panel-actions",children:[f.jsxs("div",{className:"card-mode","aria-label":"制卡模式",children:[f.jsx(ce,{type:"text","aria-pressed":!x,onClick:()=>S(!1),children:"编辑"}),f.jsx(ce,{type:"text","aria-pressed":x,onClick:()=>S(!0),children:"预览"})]}),f.jsxs(ce,{type:"text",onClick:I,className:"card-export",children:[f.jsx(ko,{name:"upload",size:15}),a]})]}),i&&f.jsx("div",{className:"card-overflow-notice",role:"status",children:i}),f.jsx("div",{className:"card-panel-fit",children:f.jsx(ce,{type:"text",onClick:M,children:"适合宽度"})}),R.length>0&&f.jsxs("div",{className:"card-overflow-notice",role:"alert",children:[R.length," 个题块超出单栏,内容可滚动查看。请调整版式、正文或作答高度。"]}),w&&f.jsx("div",{className:"card-overflow-notice",role:"alert",children:"卷头内容超出可用区域,请拖高标题或调整内容、版式。"}),f.jsxs("div",{className:"card-sidebar-section card-document-section",children:[f.jsx("strong",{className:"card-document-name",children:t.title||"未新建答题卡"}),t.creation&&f.jsxs("p",{className:"card-section-note",children:[t.creation.mode==="template"?"答题卡模板":"考试答题卡"," · ",t.creation.grade," · ",t.creation.subject]}),f.jsx(ce,{type:"text",className:"card-add-component",onClick:()=>u(!0),children:"新建答题卡"})]}),f.jsx(VR,{}),f.jsxs("div",{className:"card-sidebar-section card-outline-section",children:[f.jsxs("div",{className:"card-section-heading",children:[f.jsx("h2",{children:"题块"}),f.jsxs("span",{children:[t.blocks.length," 个"]})]}),f.jsx("p",{className:"card-section-note",children:"拖动列表调整顺序,点击打开题块设置"}),!t.blocks.length&&f.jsx("p",{className:"card-section-note",children:"从一道题开始,添加空白题块后编辑内容。"}),f.jsx("ol",{className:"card-outline",children:t.blocks.map((U,q)=>{const P=O.get(U.id);return f.jsxs("li",{className:m===U.id?"active":"",draggable:!x,onDragStart:G=>{Y(U.id),G.dataTransfer.effectAllowed="move",G.dataTransfer.setData("text/plain",U.id)},onDragEnd:()=>Y(null),onDragOver:G=>{!x&&$&&G.preventDefault()},onDrop:G=>{G.preventDefault(),$&&!x&&D($,q),Y(null)},children:[f.jsxs(ce,{type:"text",className:"card-outline-item","aria-haspopup":x?void 0:"dialog",onClick:()=>{x?_(U.id,!0):v(U.id)},children:[f.jsx("span",{className:"card-outline-number",children:String(q+1).padStart(2,"0")}),f.jsxs("span",{children:[f.jsx("strong",{children:U.title||xm[U.kind]}),f.jsxs("small",{children:["第 ",P.page+1," 页 · 第 ",P.column+1," 栏",P.overflowing?" · 超出":""]})]})]}),!x&&f.jsxs("div",{className:"card-reorder",children:[f.jsx(ce,{type:"text","aria-label":`上移题块 ${q+1}`,title:"上移",disabled:q===0,onClick:()=>D(U.id,q-1),children:"↑"}),f.jsx(ce,{type:"text","aria-label":`下移题块 ${q+1}`,title:"下移",disabled:q===t.blocks.length-1,onClick:()=>D(U.id,q+1),children:"↓"})]})]},U.id)})}),!x&&f.jsx("div",{className:"card-add",children:f.jsx(ce,{type:"text","aria-haspopup":"dialog",onClick:()=>L(!0),children:"+ 添加题块"})})]}),f.jsxs("div",{className:"card-sidebar-bottom",children:[f.jsx("span",{className:"card-version-dot"}),"自动排版已开启",f.jsx("span",{children:"连续换栏"})]})]}),l&&f.jsx(GR,{initial:$R(r),dictionary:r,replacing:!!(t.paperTitle||t.blocks.length),onCreate:d,onClose:()=>u(!1)}),z&&!x&&f.jsx(UR,{block:z,autoFocus:b,onClose:()=>g(null)}),H&&!x&&!l&&f.jsx(NR,{creation:t.creation,questionCard:t.questionCard,onClose:()=>L(!1),onAdd:U=>{const q=U==="forbiden"||U==="editArea"?mS(U):Tm(U);c(P=>{const G=[...P.blocks],B=G.findIndex(Q=>Q.id===m);return G.splice(B>=0?B+1:G.length,0,q),{...P,blocks:G}}),L(!1),v(q.id)}}),T&&f.jsxs("div",{className:"card-toast",role:"status",children:["题块已删除",f.jsx(ce,{type:"text",onClick:()=>{c(U=>{const q=[...U.blocks];return q.splice(T.index,0,T.block),{...U,blocks:q}}),p(T.block.id),j(null)},children:"撤销"}),f.jsx(ce,{type:"text","aria-label":"关闭删除提示",onClick:()=>j(null),children:f.jsx(ko,{name:"close",size:14})})]})]})}function Q0({settings:t,activeQuestionId:r}){if(!t.questions.length)return null;const i=su(t),a=l=>f.jsxs("div",{className:`card-choice-row${l.id===r?" is-current-choice":""}`,"data-question-id":l.id,"aria-current":l.id===r?"true":void 0,children:[f.jsxs("b",{children:[l.label,"."]}),f.jsx("div",{className:"card-choice-options","data-marker":t.marker,children:l.options.map(u=>f.jsx("span",{className:"card-choice-glyph","data-recognition":"MultiChoice","data-recognition-role":"cell","data-answer-id":l.id,"data-option-id":u.id,"data-value":u.label,"data-marker":t.marker,children:t.marker==="check"?`○ ${u.label}.`:u.label},u.id))})]},l.id),c=[[]];for(const l of t.questions)l.breakBefore&&c[c.length-1].length&&c.push([]),c[c.length-1].push(l);return f.jsx("div",{className:"card-choice-grid","aria-label":"选择题填涂区",style:{rowGap:t.rowGap,columnGap:t.columnGap},"data-direction":i,children:i==="column"?oS(t).map((l,u)=>f.jsx("div",{className:"card-choice-band",style:{columnGap:t.columnGap,rowGap:t.rowGap},children:l.map(d=>f.jsx("div",{className:"card-choice-column",style:{gap:t.rowGap,minHeight:t.rowsPerColumn*20+(t.rowsPerColumn-1)*t.rowGap},children:d.map(a)},d[0].id))},u)):c.map((l,u)=>f.jsx("div",{className:"card-choice-band",style:{rowGap:t.rowGap,columnGap:t.columnGap},children:l.map(a)},u))})}function F0(t){const r=t.getBoundingClientRect(),i=getComputedStyle(t),a=u=>Math.round(u*64)/64,c=a(parseFloat(i.width)+(i.boxSizing==="border-box"?0:parseFloat(i.paddingLeft)+parseFloat(i.paddingRight)+parseFloat(i.borderLeftWidth)+parseFloat(i.borderRightWidth))),l=c>0&&r.width>0?r.width/c:1;return u=>{const d=u.getBoundingClientRect();let m=0;for(let p=u;p&&p!==t;p=p.parentElement)m+=parseFloat(p.style.translate.split(/\s+/)[1])||0;return{top:a((d.top-r.top)/l-m),height:a(d.height/l),width:a(d.width/l)}}}function Z0(t){return F0(t.closest(".card-question")||t)(t)}function YR(t){return Z0(t).top}function Hl({id:t,label:r,value:i,visible:a,readOnly:c,placement:l,onUnits:u,onChange:d,onActiveFragment:m,uploadImage:p,choiceFillPosition:C,choiceFillBindings:g,activeChoiceQuestionId:b,contentTargets:v,editorKeys:x,onContentSelect:S}){const{geometry:w,registerEditor:T}=mt(),j=JSON.stringify(x||[]),R=E.useCallback(Y=>{JSON.parse(j).forEach(U=>T(`content/${U}`,Y))},[j,T]),O=E.useRef(null),M=E.useRef(!1);a&&(M.current=!0);const D=E.useRef([]),[_,I]=E.useState(0),z=E.useRef({id:t,visible:a,onUnits:u});z.current={id:t,visible:a,onUnits:u};const H=E.useCallback(()=>{const Y=O.current?.querySelector(".rt-content"),U=Y?YR(Y):0;I(q=>Math.abs(q-U)<.5?q:U),z.current.onUnits(z.current.id,z.current.visible?D.current.map(q=>({top:q.top+U,bottom:q.bottom+U})):[])},[]),L=E.useCallback(Y=>{D.current=Y,H()},[H]);E.useLayoutEffect(()=>{H()},[H,a,l.fragments,i]),E.useLayoutEffect(()=>()=>z.current.onUnits(z.current.id,[]),[]);const $=E.useMemo(()=>l.fragments.map(Y=>({from:Y.from-_,to:Y.to-_,x:Y.x-l.x,y:Y.y-l.y-Y.from+(Y.topPadding||0)})),[l.fragments,l.x,l.y,_]);return f.jsx("div",{ref:O,className:"exercise-text",hidden:!a,children:M.current&&f.jsx(Ui,{value:i,readOnly:c||!a,uploadImage:p,ariaLabel:r,onChange:d,onEditor:R,contentTargets:v,allowContentAssignment:!1,onContentSelect:S,pagination:{slices:$,maxUnitHeight:w.contentHeight-80,onMeasure:L,onActiveSliceChange:m},choiceFillPosition:C,choiceFillBindings:g,activeChoiceQuestionId:b})})}function XR({rows:t,rowHeight:r,label:i,onChange:a}){const{scale:c}=mt(),l=E.useRef(null),u=()=>{l.current&&a(l.current.rows),l.current=null};return f.jsx("button",{className:"exercise-area-resize","data-exercise-resize":!0,"aria-label":`调整 ${i} 题作答高度`,title:"拖动调整作答高度",onPointerDown:d=>{d.preventDefault(),d.stopPropagation(),d.currentTarget.focus(),l.current={y:d.clientY,rows:t},d.currentTarget.setPointerCapture(d.pointerId)},onPointerMove:d=>{l.current&&a(Math.max(1,Math.min(120,l.current.rows+Math.round((d.clientY-l.current.y)/c/r))))},onPointerUp:d=>{l.current=null,d.currentTarget.releasePointerCapture(d.pointerId)},onPointerCancel:u,onLostPointerCapture:()=>{l.current=null},onKeyDown:d=>{d.key==="Escape"&&(d.preventDefault(),u()),["ArrowUp","ArrowDown"].includes(d.key)&&(d.preventDefault(),a(Math.max(1,Math.min(120,t+(d.key==="ArrowDown"?1:-1)))))}})}function W0({blank:t,item:r,active:i,fullLabel:a=!1}){return f.jsxs("div",{style:{width:`${t.width}%`},className:`exercise-flow-unit exercise-blank${i?" is-current":""}`,"data-exercise-id":r.id,"data-answer-id":t.id,children:[f.jsxs("span",{children:[a?`${r.label}.${t.label}`:`(${t.label})`," ",t.prefix]}),f.jsx("span",{className:`exercise-blank-space ${t.style}`,children:t.style==="characters"&&Array.from({length:t.characters},(c,l)=>f.jsx("i",{},l))}),f.jsx("span",{children:t.suffix})]})}function KR({area:t,item:r,active:i,readOnly:a,onResize:c,prefix:l=""}){const u={"--area-columns":t.columns,"--area-line":`${t.rowHeight}px`};return f.jsxs("div",{className:"exercise-area","data-style":t.style,style:u,children:[t.title&&f.jsxs("div",{className:`exercise-flow-unit exercise-title-line${i?" is-current":""}`,"data-exercise-id":r.id,children:["题目:",f.jsx("span",{})]}),Array.from({length:t.rows},(d,m)=>f.jsxs("div",{className:`exercise-flow-unit exercise-area-row${i?" is-current":""}`,"data-exercise-id":r.id,"data-area-row":m,style:{height:t.rowHeight,...t.backgroundUrl?{backgroundImage:`url(${JSON.stringify(t.backgroundUrl)})`,backgroundSize:`100% ${t.rows*t.rowHeight}px`,backgroundPosition:`0 -${m*t.rowHeight}px`}:{}},children:[l&&m===0&&f.jsx("span",{className:"exercise-area-prefix",children:l}),t.style==="characters"&&Array.from({length:t.columns},(p,C)=>{const g=m*t.columns+C+1;return f.jsx("span",{className:"exercise-character",children:t.wordMark>0&&g%t.wordMark===0&&f.jsxs("small",{children:[g,"字"]})},C)}),t.style==="coordinates"&&m===Math.floor(t.rows/2)&&f.jsx("span",{className:"exercise-axis-x",children:"x →"}),t.style==="coordinates"&&m===0&&f.jsx("span",{className:"exercise-axis-y",children:"↑ y"})]},m)),!a&&t.rows>0&&f.jsx(XR,{rows:t.rows,rowHeight:t.rowHeight,label:r.label,onChange:c})]})}function QR({value:t,kind:r,placement:i,showQuestion:a,readOnly:c,activeId:l,onUnits:u,onChange:d,onActiveFragment:m,uploadImage:p}){const C=(S,w="")=>`exercise-flow-unit ${w}${S===l?" is-current":""}`,g=t.pool,b=E.useMemo(()=>new Map(t.items.filter(S=>S.kind==="choice").map(S=>[S.id,na({...iu(0),presentation:S.presentation,questions:[S.choice]},S.document,a)])),[t.items,a]),v=(S=!1)=>g.map(w=>f.jsxs("div",{className:"exercise-pool-entry",children:[f.jsxs("div",{className:"exercise-flow-unit exercise-pool-option","data-pool-id":w.id,children:[S?"● ":"",w.label,". ",a?w.text:""]}),w.document&&f.jsx(Hl,{id:`pool/${w.id}`,label:`共享选项 ${w.label} 正文`,value:w.document,visible:a,readOnly:c,placement:i,uploadImage:p,onUnits:u,onActiveFragment:m,onChange:T=>d({...t,pool:t.pool.map(j=>j.id===w.id?{...j,document:T}:j)})})]},w.id)),x=["fill","completion"].includes(r)&&(!a||t.items.every(S=>xn(S.document)));if(r==="chunk"){let S=0;const w=t.chunkPoints.map(T=>{const j=t.chunkText.slice(S,T.offset);return S=T.offset,{text:j,...T}});return f.jsxs("div",{className:"exercise-content",children:[f.jsx(Hl,{id:"chunk-material",label:"断句题面",value:{version:1,content:{type:"doc",content:[{type:"paragraph",content:[{type:"text",text:w.map(T=>`${T.text}〔${T.label}〕`).join("")+t.chunkText.slice(S)||" "}]}]}},visible:a,readOnly:!0,placement:i,onUnits:u,onChange:()=>{},onActiveFragment:m}),f.jsxs("div",{className:"exercise-flow-unit exercise-chunk-answer",children:[t.chunkPoints.map(T=>f.jsx("span",{className:"exercise-mark","data-answer-id":T.id,children:T.label},T.id)),f.jsxs("span",{children:["(最多选 ",t.chunkMax," 处)"]})]})]})}return f.jsxs("div",{className:"exercise-content","data-exercise-kind":r,children:[x&&f.jsx("div",{className:"exercise-blanks",children:t.items.map(S=>f.jsxs(E.Fragment,{children:[S.blanks.map(w=>f.jsxs(E.Fragment,{children:[f.jsx(W0,{blank:w,item:S,active:S.id===l,fullLabel:!0}),w.breakAfter&&f.jsx("span",{className:"exercise-line-break"})]},w.id)),t.fillNewLine&&f.jsx("span",{className:"exercise-line-break"})]},S.id))}),r==="optional"&&f.jsxs("div",{className:"exercise-flow-unit exercise-optional-head",children:["从以下 ",t.items.length," 题中选做 ",t.chooseCount," 题",t.groupScore!==null?`,共 ${t.groupScore} 分`:"","。",f.jsxs("span",{children:["选做题号:",t.items.map(S=>f.jsx("span",{className:"exercise-mark","data-exercise-id":S.id,children:S.label},S.id))]})]}),["matching","ordering"].includes(r)&&a&&(r!=="matching"||t.matchingDisplay==="letters")&&v(),f.jsxs("div",{hidden:x,className:r==="matching"&&t.matchingDisplay==="lines"?"exercise-matching-layout":void 0,children:[f.jsx("div",{children:r==="ordering"?f.jsx("div",{children:t.ordering==="sequence"?f.jsxs("div",{className:"exercise-flow-unit exercise-sequence",children:["排序:",g.map((S,w)=>f.jsxs("span",{children:[f.jsx("span",{className:"exercise-order-slot","data-answer-id":S.id}),w<g.length-1?"→":""]},S.id))]}):t.categories.map(S=>f.jsxs("div",{className:"exercise-flow-unit exercise-category","data-category-id":S.id,children:[f.jsxs("span",{children:[S.label,". ",S.text]}),f.jsx("span",{})]},S.id))}):t.items.map(S=>{const w=S.id===l,T=b.get(S.id),j=!x&&(S.kind==="table"||a&&(!xn(S.document)||!c&&(pm.includes(r)||t.items.length>1||r==="matching")));return f.jsxs("div",{className:"exercise-item","data-exercise-item":S.id,children:[f.jsxs("div",{className:C(S.id,"exercise-item-heading"),"data-exercise-id":S.id,children:[f.jsxs("b",{children:[S.label,"."]}),S.score!==null&&f.jsxs("span",{children:["(",S.score," 分)"]}),r==="matching"&&t.matchingDisplay==="lines"&&f.jsx("span",{className:"exercise-connector",children:"●"})]}),f.jsx(Hl,{id:S.id,label:`小题 ${S.label} 正文`,value:S.document,visible:j,readOnly:c,placement:i,uploadImage:p,onUnits:u,onActiveFragment:m,onChange:R=>d({...t,items:t.items.map(O=>O.id===S.id?{...O,document:R}:O)}),choiceFillPosition:T?.position,choiceFillBindings:T?.bindings,activeChoiceQuestionId:w?S.id:void 0}),(S.kind==="judge"||S.kind==="choice"&&!!T?.concentrated.questions.length)&&f.jsx("div",{className:C(S.id,"exercise-choices"),"data-exercise-id":S.id,children:(S.kind==="judge"?S.choice.options.slice(0,2):S.choice.options).map((R,O)=>f.jsx("span",{className:`exercise-mark${S.kind==="choice"||t.judgeLabels!=="words"?" exercise-choice-mark":""}`,"data-answer-id":R.id,children:S.kind==="judge"?gm[t.judgeLabels][O]:R.label},R.id))}),r==="matching"&&t.matchingDisplay==="letters"&&f.jsx("div",{className:C(S.id,"exercise-match-letters"),"data-exercise-id":S.id,children:f.jsx("span",{className:"exercise-order-slot"})}),r!=="matching"&&S.kind==="fill"&&!x&&f.jsx("div",{className:"exercise-blanks","data-new-line":t.fillNewLine,children:S.blanks.map(R=>f.jsxs(E.Fragment,{children:[f.jsx(W0,{blank:R,item:S,active:w}),R.breakAfter&&f.jsx("span",{className:"exercise-line-break"})]},R.id))}),S.steps.map(R=>f.jsxs("div",{className:C(S.id,"exercise-step"),"data-exercise-id":S.id,"data-step-id":R.id,children:[f.jsxs("span",{children:["(",R.label,") ",R.prompt,R.score!==null?`(${R.score} 分)`:""]}),f.jsx("span",{className:"exercise-step-answer"})]},R.id)),(["answer","calculation","correction","drawing","writing","english"].includes(S.kind)||S.kind==="judge"&&S.needsReason)&&f.jsx(KR,{area:S.area,item:S,active:w,readOnly:c,onResize:R=>d({...t,items:t.items.map(O=>O.id===S.id?{...O,area:{...O.area,rows:R}}:O)})})]},S.id)})}),r==="matching"&&t.matchingDisplay==="lines"&&f.jsx("div",{children:v(!0)})]}),r==="practice"&&f.jsxs("div",{className:"exercise-flow-unit exercise-evaluation",children:["评价意见:",f.jsx("span",{})]})]})}function J0({height:t,min:r,label:i,onChange:a}){const{scale:c}=mt(),l=E.useRef(null);return f.jsx("button",{className:"exercise-area-resize","data-exercise-resize":!0,"aria-label":i,onPointerDown:u=>{u.preventDefault(),u.stopPropagation(),l.current={y:u.clientY,height:t},u.currentTarget.setPointerCapture(u.pointerId)},onPointerMove:u=>{l.current&&a(Math.max(r,Math.round(l.current.height+(u.clientY-l.current.y)/c)))},onPointerUp:u=>{l.current=null,u.currentTarget.releasePointerCapture(u.pointerId)},onLostPointerCapture:()=>{l.current=null},onPointerCancel:()=>{l.current&&a(l.current.height),l.current=null},onKeyDown:u=>{u.key==="Escape"&&l.current&&(a(l.current.height),l.current=null),["ArrowUp","ArrowDown"].includes(u.key)&&(u.preventDefault(),a(Math.max(r,t+(u.key==="ArrowDown"?10:-10))))}})}const FR="M1009 734Q994 750 972 750Q950 750 935 734L694 479L522 661Q507 677 485.5 677Q464 677 449 661Q434 645 434 622.5Q434 600 449 584L621 402L383 151L91 462Q76 478 54 478Q32 478 17 462Q2 446 1 423.5Q0 401 15 384L346 34Q361 19 382.5 19Q404 19 419 34L693 327L810 201Q825 186 847 186Q869 186 884 201.5Q899 217 899 239.5Q899 262 884 279L768 402L1009 656Q1024 672 1024 694.5Q1024 717 1009 734Z",ZR="M585 384 860 659Q869 675 867 693Q865 711 852 724Q839 737 821 739Q803 741 787 732L512 457L237 734Q221 744 203 741.5Q185 739 172 726Q159 713 157 695Q155 677 164 661L439 384L162 109Q152 93 154.5 75Q157 57 170 44Q183 31 201 29Q219 27 235 36L512 311L787 36Q803 27 821 29Q839 31 852 44Q865 57 867 75Q869 93 860 109Z";function WR({question:t,part:r}){const i=!r&&t.parts.length>1;return f.jsx("div",{className:"reference-homework-marking",children:i?t.parts.map((a,c)=>f.jsxs("span",{"data-recognition":"Checkbox","data-recognition-role":"cell","data-answer-id":a.id,"data-value":String(c+1),children:["(",c+1,")"]},a.id)):[FR,ZR].map((a,c)=>f.jsx("span",{"data-recognition":"ScoreBox","data-recognition-role":"cell","data-answer-id":r?.id||t.parts[0]?.id||t.id,"data-value":c===0?"partial":"incorrect",children:f.jsx("svg",{"aria-hidden":"true",viewBox:"0 -128 1024 1024",children:f.jsx("path",{transform:"translate(0 768) scale(1 -1)",d:a,fill:"currentColor"})})},c))})}function Kd({placement:t,children:r,className:i="",answerId:a,sectionType:c,questionIds:l,scope:u,footer:d}){const m=E.useRef(null),[p,C]=E.useState({top:0,height:0});return E.useLayoutEffect(()=>{const g=()=>{const{top:v,height:x}=Z0(m.current);C(S=>S.top===v&&S.height===x?S:{top:v,height:x})};g();const b=new ResizeObserver(g);return b.observe(m.current),()=>b.disconnect()},[t.fragments,r]),f.jsxs("div",{ref:m,className:`reference-paper-frame ${i}`,"data-marking-frame":d?"":void 0,children:[r,d&&f.jsx("div",{className:"exercise-flow-unit reference-marking-space"}),t.fragments.map((g,b)=>{const v=Math.max(p.top,g.from),x=Math.min(p.top+p.height,g.to),S=v<=p.top+.5;return x>v&&f.jsx("div",{"aria-hidden":"true",className:"reference-paper-border","data-recognition":!S&&u!=="section"&&c?"FrameOnly":c,"data-recognition-scope":u,"data-answer-id":a,"data-question-ids":l?.join(","),"data-fragment":b,style:{left:g.x-t.x,top:v-p.top+g.y-t.y-g.from+(v>g.from&&g.topPadding||0),height:x-v+(v===g.from&&g.topPadding||0)+(x===g.to&&g.bottomPadding||0)},children:S&&d},b)})]})}function JR({score:t,halfPoint:r,active:i,id:a}){const{card:c}=mt();return!c.scanMarking&&t!==null&&t>0&&f.jsx("div",{className:`exercise-flow-unit reference-score-row${i?" is-current":""}`,"data-exercise-id":a,children:RS(t,r).map((l,u)=>f.jsx("span",{"data-recognition":l?"ScoreBox":void 0,"data-answer-id":a,"data-recognition-role":"cell","data-value":l,children:l},u))})}function Qd({question:t,part:r,props:i,optional:a=!1}){const{card:c,geometry:l,scale:u,selectChoice:d}=mt(),{value:m,placement:p,width:C,readOnly:g,activeId:b,uploadImage:v,onUnits:x,onActiveFragment:S,onChange:w}=i,T=r?.id||t.id,j=r?.label||t.label,R=r?.score??t.score,O=c.usage==="homework"&&R===0,M=O&&!r&&t.type==="SHORTANSWER"&&!a,D=O&&!c.scanMarking,_=b===T||b===t.id,I=E.useRef(null),[z,H]=E.useState(0),[L,$]=E.useState(()=>window.devicePixelRatio||1);E.useEffect(()=>{if(t.type!=="CCOMPOSITION")return;const oe=()=>$(window.devicePixelRatio||1);return window.addEventListener("resize",oe),()=>window.removeEventListener("resize",oe)},[t.type]);const Y=r?.document||t.document,U=oe=>w({...m,questions:m.questions.map(ae=>ae.id===t.id?{...ae,...oe}:ae)}),q=oe=>U(r?{parts:t.parts.map(ae=>ae.id===r.id?{...ae,document:oe}:ae)}:{document:oe}),P=a?m.optionalHeight:r?.height||t.height;E.useLayoutEffect(()=>{const oe=I.current.querySelector(".reference-answer-body"),ae=()=>H(oe.offsetHeight);ae();const xe=new ResizeObserver(ae);return xe.observe(oe),()=>xe.disconnect()},[]);const G=(oe="")=>`exercise-flow-unit ${oe}${_?" is-current":""}`,B=Math.max(0,P-z-(D?22:!c.scanMarking&&R!==null&&R>0?18:0)),Q=TS(C),N=Q*31+1,K=Math.max(1,Math.round(L))/(L*u),ne=`M.5 .5H${N-.5}V32.5H.5Z`+Array.from({length:Q-1},(oe,ae)=>`M${(ae+1)*31+.5} .5V32.5`).join(""),te=t.type==="CCOMPOSITION"?Math.ceil(t.characters/Q):Math.ceil(B/40),le=oe=>a?w({...m,optionalHeight:oe}):U(r?{parts:t.parts.map(ae=>ae.id===r.id?{...ae,height:oe}:ae)}:{height:oe});return f.jsx("div",{ref:I,className:"reference-answer","data-exercise-item":T,children:f.jsxs(Kd,{placement:p,answerId:T,sectionType:c.scanMarking?"FrameOnly":M&&t.parts.length>1?"Checkbox":"ScoreBox",questionIds:a?m.questions.map(oe=>oe.id):void 0,className:t.type==="CCOMPOSITION"?"reference-composition":"",footer:D?f.jsx(WR,{question:t,part:r}):void 0,children:[f.jsx(JR,{score:R,halfPoint:t.halfPoint,active:_,id:T}),f.jsxs("div",{className:"reference-answer-body",children:[a&&f.jsxs("div",{className:G("reference-optional-head"),style:{minHeight:l.columns===3?104:82},"data-exercise-id":T,children:[f.jsxs("p",{children:[f.jsx("b",{children:"选做题"}),"  请考生从给出的第",m.questions.map(oe=>oe.label).join("、"),Fd(m.questions.length),"题中任选",Fd(m.choose),"题作答,并用2B铅笔在答题卡上把所选题目对应的题号涂黑,注意所做题目的题号必须与所涂题号一致,如果多做,则按所做的",m.choose===1?"第一题":`前${Fd(m.choose)}题`,"计分。"]}),f.jsxs("p",{children:["我选做的题号是:",m.questions.map(oe=>f.jsx("span",{"data-exercise-id":oe.id,"data-recognition":"QuestionChoice","data-answer-id":oe.id,"data-recognition-role":"cell","data-value":oe.label,children:oe.label},oe.id))]})]}),f.jsx("div",{className:"reference-answer-text",style:{minHeight:t.type==="CCOMPOSITION"?t.contentHeight:void 0},children:(a?m.questions.map(oe=>({item:oe,entryPart:void 0})):M?t.parts.map(oe=>({item:t,entryPart:oe})):[{item:t,entryPart:r}]).map(({item:oe,entryPart:ae})=>{const xe=a?oe.parts[0]?.id||oe.id:ae?.id||T,we=a?oe.label:ae?.label||j,ge=a||!ae||oe.parts[0]?.id===ae.id,de=m.textVersion===1&&m.type!=="MIXED"&&ge,Me=de&&i.showQuestion&&oe.text,Be=a?oe.parts[0]?.document||oe.document:ae?.document||Y,Ae=Me?kr([...Gs(oe.text,oe.id,oe.label),...oe.type==="ECOMPOSITION"?(Be.content.content||[]).slice(1):[]]):Be;return f.jsx("div",{"data-exercise-id":xe,className:"reference-answer-entry",children:f.jsx(Hl,{id:`reference/${xe}`,label:`第 ${we} 题作答内容`,value:Ae,editorKeys:de?[oe.id,xe]:[xe],contentTargets:Me?[{id:oe.id,label:`第 ${oe.label} 题题干`,kind:"question"}]:void 0,onContentSelect:Se=>d(i.blockId,Se),visible:!0,readOnly:g,placement:p,uploadImage:v,onUnits:x,onActiveFragment:S,onChange:Me?Se=>w({...m,questions:m.questions.map(Ce=>Ce.id===oe.id?{...Ce,text:wm(Ce.text,(Se.content.content||[]).filter(Ot=>Ce.type!=="ECOMPOSITION"||Ot.attrs?.contentId===Ce.id)),...Ce.type==="ECOMPOSITION"?{document:kr([Ce.document.content.content[0],...(Se.content.content||[]).filter(Ot=>Ot.attrs?.contentId!==Ce.id)])}:{}}:Ce)}):a?Se=>w({...m,questions:m.questions.map(Ce=>Ce.id===oe.id?{...Ce,document:Se,parts:Ce.parts.map((Ot,dt)=>dt===0?{...Ot,document:Se}:Ot)}:Ce)}):M&&ae?Se=>U({parts:t.parts.map(Ce=>Ce.id===ae.id?{...Ce,document:Se}:Ce)}):q})},xe)})})]}),Array.from({length:te},(oe,ae)=>f.jsx("div",{className:G(`reference-answer-row ${t.type==="CCOMPOSITION"?"reference-character-row":""}`),"data-exercise-id":T,style:{height:t.type==="CCOMPOSITION"?39.5:Math.min(40,B-ae*40)},children:t.type==="CCOMPOSITION"&&f.jsxs("div",{className:"reference-character-grid",children:[f.jsx("svg",{"aria-hidden":"true",className:"reference-character-lines",width:N,height:"33",viewBox:`0 0 ${N} 33`,children:f.jsx("path",{d:ne,fill:"none",stroke:"#000",strokeWidth:K,vectorEffect:"non-scaling-stroke",shapeRendering:"crispEdges"})}),Array.from({length:Q},(xe,we)=>{const ge=ae*Q+we+1;return f.jsx("span",{className:"reference-character","data-character":ge<=t.characters?ge:void 0,"data-padding":ge>t.characters||void 0,children:ge<=t.characters&&ge%100===0&&f.jsxs("small",{children:[ge,"字"]})},we)})]})},ae)),!g&&t.type!=="CCOMPOSITION"&&f.jsx(J0,{height:P,min:30,label:`调整第 ${j} 题作答高度`,onChange:le})]})})}function Fd(t){const r="零一二三四五六七八九";return t<10?r[t]:t<100?`${t<20?"":r[Math.floor(t/10)]}十${t%10?r[t%10]:""}`:t===100?"一百":String(t)}function eO(t){const{value:r,placement:i,activeId:a,concentrated:c}=t,{card:l}=mt(),u=new Set(c.questions.map(m=>m.id)),d=E.useMemo(()=>{const m=[];return r.questions.forEach(p=>{const C=wt(p.type)?"choice":xi(p.type)?"fill":"answer",g=m.at(-1);C!=="answer"&&g?.category===C?g.questions.push(p):m.push({category:C,questions:[p]})}),m},[r.questions]);return r.optional&&r.questions.length>1?f.jsx("div",{className:"reference-content",children:f.jsx(Qd,{question:r.questions[0],props:t,optional:!0})}):f.jsx("div",{className:"reference-content",children:d.map((m,p)=>f.jsxs(E.Fragment,{children:[m.category==="choice"&&sa({...r,questions:m.questions}).some(C=>u.has(C.id))&&f.jsx(Kd,{placement:i,className:"reference-choice-frame",sectionType:"MultiChoice",scope:"section",answerId:`${t.blockId}/choice/${p}`,questionIds:m.questions.map(C=>C.id),children:f.jsx(Q0,{activeQuestionId:m.questions.find(C=>C.id===a&&Le(C.type))?.parts[0]?.id||a,settings:{...c,questions:sa({...r,questions:m.questions}).filter(C=>u.has(C.id))}})}),m.category==="fill"&&f.jsx(Kd,{placement:i,className:"reference-fill-frame",sectionType:"Checkbox",scope:"section",answerId:`${t.blockId}/fill/${p}`,questionIds:m.questions.map(C=>C.id),children:f.jsx("div",{className:"reference-fill-grid",children:m.questions.map(C=>f.jsxs(E.Fragment,{children:[C.parts.map(g=>f.jsxs(E.Fragment,{children:[f.jsxs("div",{className:`exercise-flow-unit reference-blank${l.scanMarking?" is-online":""}${a===C.id||a===g.id?" is-current":""}`,style:{width:`${g.width}%`},"data-exercise-id":g.id,"data-answer-id":g.id,"data-recognition":"Checkbox",children:[f.jsxs("span",{className:"reference-blank-number",children:[g.label,"."]}),f.jsx("span",{className:"reference-blank-line","data-recognition":"Checkbox","data-recognition-role":"line","data-answer-id":g.id}),!l.scanMarking&&f.jsx("span",{className:"reference-blank-score","data-recognition":"ScoreBox","data-recognition-role":"cell","data-answer-id":g.id})]}),g.breakAfter&&f.jsx("span",{className:"exercise-line-break"}),r.fillNewLine&&Le(C.type)&&f.jsx("span",{className:"exercise-line-break"})]},g.id)),r.fillNewLine&&!Le(C.type)&&f.jsx("span",{className:"exercise-line-break"})]},C.id))})}),m.category==="answer"&&m.questions.map(C=>C.type==="SHORTANSWER"&&!(l.usage==="homework"&&C.score===0)?C.parts.map(g=>f.jsx(Qd,{question:C,part:g,props:t},g.id)):f.jsx(Qd,{question:C,props:t},C.id)),p<d.length-1&&f.jsx("div",{className:"reference-section-gap"})]},m.questions[0].id))})}function tO({hidden:t=!1,block:r,index:i,placement:a,width:c,scale:l,selected:u,readOnly:d,showQuestion:m,activeChoiceId:p,uploadImage:C,registerEditor:g,onSelect:b,onActiveFragment:v,onSettings:x,onMeasure:S,onDocument:w,onHeight:T,onExercise:j,onReference:R}){const{card:O,geometry:M,selectChoice:D}=mt(),_=E.useMemo(()=>r.reference?U0(r):void 0,[r.id,r.reference]),I=E.useMemo(()=>r.reference?na({...r.reference.layout,questions:sa(r.reference)},r.document,m):r.kind==="choice"&&r.choices?na(r.choices,r.document,m):void 0,[r.reference,r.kind,r.choices,r.document,m]),H=!(r.reference?.textVersion===1&&r.reference.questions.length>0&&["SHORTANSWER","ECOMPOSITION","CCOMPOSITION"].includes(r.reference.type))&&!t&&r.id!==gr&&m&&(!d||!(r.exercise||r.reference)||!xn(r.document)||!!I?.bindings.length),L=E.useRef(null),$=E.useCallback(be=>{L.current=be,g(r.id,be)},[r.id,g]),Y=E.useMemo(()=>r.reference?vR(r.document,r.reference,c):r.document,[r.document,r.reference,c]);E.useEffect(()=>{L.current?.syncDocument(Y)},[Y]);const U=E.useRef(null),q=E.useRef(S);q.current=S;const P=E.useRef([]),G=E.useRef(new Map),[B,Q]=E.useState(0),[N,K]=E.useState(0),ne=E.useRef(()=>{}),te=be=>{const gt=a.fragments.find(ot=>be>=ot.from-.5&&be<ot.to-.5);return gt?{x:gt.x-a.x,y:gt.y-a.y-gt.from+(gt.topPadding||0)}:{x:0,y:0}};ne.current=()=>{const be=U.current,gt=be?.querySelector(".card-question-document .rt-content");if(t||!be||!gt)return;const ot=F0(be.parentElement),Wt=H?ot(gt).top:0;Q(ue=>Math.abs(ue-Wt)<.5?ue:Wt);const yr=H?P.current.map(ue=>({top:Wt+ue.top,bottom:Wt+ue.bottom})):[];G.current.forEach(ue=>yr.push(...ue)),be.querySelectorAll(".card-choice-row, .exercise-flow-unit").forEach(ue=>{if(ue.offsetParent===null)return;const{top:he,height:$e}=ot(ue);yr.push({top:he,bottom:he+$e});const Ze=te(he);ue.style.translate=`${Ze.x}px ${Ze.y}px`}),be.querySelectorAll("[data-exercise-resize]").forEach(ue=>{const he=te(ot(ue).top);ue.style.translate=`${he.x}px ${he.y}px`});const ja=be.querySelector(".card-answer-space:not(.card-answer-fragment)");if(ja){const{top:ue,height:he}=ot(ja);K(Ze=>Math.abs(Ze-ue)<.5?Ze:ue);const $e=r.kind==="fill"?40:28;for(let Ze=ue;Ze<ue+he;Ze+=$e)yr.push({top:Ze,bottom:Math.min(Ze+$e,ue+he)})}const Aa=ot(be),Kr=be.querySelectorAll(".reference-character-row"),br=Kr.length?ot(Kr[0]).top:void 0,zt=Kr.length?ot(Kr[Kr.length-1]).top:void 0,zn=Math.min(...yr.map(ue=>ue.bottom)),Yt=[...new Set(yr.flatMap(ue=>[ue.top,ue.bottom]))].filter(ue=>ue>=zn&&ue<Aa.height&&!yr.some(he=>ue>he.top+.5&&ue<he.bottom-.5)).filter(ue=>zt===void 0||ue<=zt).sort((ue,he)=>ue-he),fe=Array.from(be.querySelectorAll("[data-marking-frame]")).map(ue=>{const{top:he,height:$e}=ot(ue);return{from:he,to:he+$e}});q.current({width:Aa.width,height:Aa.height,breaks:Yt,markingFrames:fe,...br!==void 0?{compositionStart:br}:{}})};const le=E.useCallback(be=>{P.current=be,ne.current()},[]),oe=E.useCallback((be,gt)=>{G.current.set(be,gt),ne.current()},[]),ae=E.useMemo(()=>a.fragments.map(be=>({from:be.from-B,to:be.to-B,x:be.x-a.x,y:be.y-a.y-be.from+(be.topPadding||0)})),[a.fragments,a.x,a.y,B]);E.useLayoutEffect(()=>{ne.current()},[a.fragments,r.answerHeight,r.choices,r.exercise,r.reference,m,H,t]);const xe=E.useRef(null),we=be=>{be.preventDefault(),be.stopPropagation(),be.currentTarget.focus(),xe.current={y:be.clientY,height:r.answerHeight},be.currentTarget.setPointerCapture(be.pointerId)},ge=be=>{xe.current&&T(Math.max(0,Math.min(800,Math.round(xe.current.height+(be.clientY-xe.current.y)/l))))},de=be=>{xe.current=null,be.currentTarget.releasePointerCapture(be.pointerId)},Me=()=>{xe.current&&T(xe.current.height),xe.current=null},Be=be=>{be.key==="Escape"&&xe.current&&Me(),(be.key==="ArrowUp"||be.key==="ArrowDown")&&(be.preventDefault(),T(Math.max(0,Math.min(800,r.answerHeight+(be.key==="ArrowDown"?10:-10)))))};E.useEffect(()=>{const be=U.current;let gt=0;const ot=new ResizeObserver(()=>{cancelAnimationFrame(gt),gt=requestAnimationFrame(()=>ne.current())});return ot.observe(be),()=>{ot.disconnect(),cancelAnimationFrame(gt)}},[]);const Ae=te(N+r.answerHeight-1),Se=`${Ae.x}px ${Ae.y}px`,Ce=a.fragments.length>1,Ot=r.reference&&I&&f.jsx(eO,{blockId:r.id,showQuestion:m,value:r.reference,concentrated:O.mergeObjective&&r.id!==gr?{...I.concentrated,questions:[]}:I.concentrated,placement:a,width:c,readOnly:d,activeId:p,onUnits:oe,onChange:R,onActiveFragment:v,uploadImage:C}),dt=r.reference&&(wt(r.reference.type)||r.id===gr);return f.jsx("article",{hidden:t,className:`card-question${u&&!d?" is-selected":""}${a.overflowing?" is-overflowing":""}${Ce?" is-fragmented":""}${r.reference?.type==="CCOMPOSITION"?" is-composition":""}`,"data-block-id":r.id,"data-page":a.page+1,"data-column":a.column+1,style:{left:a.x,top:a.y,width:c,minHeight:!Ce&&a.fragments[0]?.bottomPadding?a.height+a.fragments[0].bottomPadding:void 0,maxHeight:a.overflowing?a.available:void 0},onPointerDownCapture:()=>{d||b()},onFocusCapture:()=>{d||b()},"aria-label":r.title||`题块 ${i+1}`,children:f.jsxs("div",{className:"card-question-content",ref:U,children:[f.jsxs("div",{className:"card-question-heading",children:[f.jsx("h2",{children:d?r.title||`题块 ${i+1}`:f.jsx("button",{className:"card-question-title","aria-label":`设置题块 ${i+1}`,"aria-haspopup":"dialog",title:"打开题块设置",onClick:x,children:r.title||`题块 ${i+1}`})}),f.jsx("span",{children:String(i+1).padStart(2,"0")})]}),I&&!r.reference&&f.jsx(Q0,{settings:I.concentrated,activeQuestionId:p}),dt&&Ot,f.jsx("div",{className:"card-question-document",hidden:!H,children:f.jsx(Ll,{ref:$,initialValue:r.document,readOnly:d||!H,uploadImage:C,ariaLabel:`题块 ${i+1} 正文`,onChange:w,pagination:{slices:ae,maxUnitHeight:M.contentHeight-80,onMeasure:le,onActiveSliceChange:v},choiceFillPosition:I?.position,choiceFillBindings:I?.bindings,activeChoiceQuestionId:p,contentTargets:_,allowContentAssignment:r.reference?.textVersion!==1,onContentSelect:be=>{be!==r.id&&D(r.id,be)}})}),!dt&&Ot,!r.reference&&r.exercise&&r.kind!=="choice"&&r.kind!=="area"&&f.jsx(QR,{value:r.exercise,kind:r.kind,placement:a,showQuestion:m,readOnly:d,activeId:p,onUnits:oe,onChange:j,onActiveFragment:v,uploadImage:C}),!r.reference&&!r.exercise&&r.kind!=="choice"&&f.jsx("div",{className:`card-answer-space ${r.kind}${Ce?" is-paginated-space":""}`,style:{height:r.answerHeight},"data-answer-height":r.answerHeight,children:!d&&f.jsxs("div",{className:"card-answer-controls",children:[f.jsx("span",{className:"card-answer-caption",style:{translate:Se},children:r.kind==="writing"?"作文格":"作答区域"}),f.jsx("button",{className:"card-height-handle","aria-label":`调整题块 ${i+1} 作答高度`,title:"上下拖动调整作答区;方向键微调,Esc 取消",style:{translate:Se},onPointerDown:we,onPointerMove:ge,onPointerUp:de,onPointerCancel:Me,onLostPointerCapture:()=>{xe.current=null},onKeyDown:Be,children:f.jsx("span",{})})]})}),Ce&&!r.reference&&!r.exercise&&r.kind!=="choice"&&a.fragments.map((be,gt)=>{const ot=Math.max(be.from,N),Wt=Math.min(be.to,N+r.answerHeight);return Wt>ot&&f.jsx("div",{"aria-hidden":"true",className:`card-answer-space card-answer-fragment ${r.kind}`,style:{left:be.x-a.x,top:ot+be.y-a.y-be.from,width:c,height:Wt-ot,backgroundPositionY:`${N-ot-1}px`}},gt)})]})})}function eb({seat:t=!1}){return f.jsx("div",{className:"card-student-fields",children:["姓名","班级","学号",...t?["考场/座位号"]:[]].map(r=>f.jsxs("div",{children:[f.jsxs("span",{children:[r,":"]}),f.jsx("i",{})]},r))})}function Zd(){return f.jsxs("div",{className:"card-barcode-area","data-recognition":"StudentId","data-value":"barcode",children:[f.jsx("div",{children:"贴条形码区"}),f.jsx("small",{children:"正面朝上,切勿贴出虚线方框"})]})}function Pl(){return f.jsxs("div",{className:"card-header-marks",children:[f.jsxs("div",{children:["正确填涂:",f.jsx("i",{className:"filled"})]}),f.jsxs("div",{"data-recognition":"IgnoreFlag",children:["缺考标记:",f.jsx("i",{"data-recognition-cell":"absent"})]})]})}function tb({marks:t,focusText:r}){return f.jsxs("div",{className:"card-attentions",children:[r&&f.jsxs("div",{className:"card-attention-box",children:[f.jsx("div",{children:"注意事项"}),f.jsxs("section",{children:[f.jsx("p",{children:"1.答题前请将姓名、班级和准考证号(或学号)填写清楚并填涂完整。"}),f.jsx("p",{children:"2.客观题答题必须使用2B铅笔填涂,修改时用橡皮擦干净。主观题答题必须使用黑色签字笔书写。"}),f.jsx("p",{children:"3.请在规定区域内答题,超出答题区域书写无效。"})]})]}),t&&f.jsx(Pl,{})]})}function nO({settings:t,columns:r,pointBlack:i}){const a=t.kaohao==="school"&&t.weishu>9,c=!t.mifeng&&r===3||a,l=r!==3&&t.focusText&&t.missExam&&!t.mifeng&&t.kaohao==="code",u=r===3&&t.missExam&&!t.mifeng&&t.kaohao==="code",d=r===3&&t.missExam&&!t.mifeng&&t.kaohao==="school"&&[8,9].includes(t.weishu),m=r===3&&t.focusText&&t.missExam&&t.mifeng&&t.kaohao==="school"&&[8,9].includes(t.weishu),p=r!==3&&t.missExam&&!t.mifeng&&a,C=t.missExam&&!l&&!u&&!d&&!m&&!p,g=t.focusText||C;return f.jsxs("div",{className:"card-header-fields",children:[f.jsxs("div",{className:`card-header-left${t.mifeng&&(t.kaohao==="code"||a)?" full-width":""}`,children:[!t.mifeng&&f.jsx(eb,{seat:t.writeKaohao}),(d||p)&&f.jsx(Pl,{}),!c&&g&&f.jsx(tb,{focusText:t.focusText,marks:C})]}),f.jsxs("div",{className:"card-header-number",children:[t.kaohao==="school"&&f.jsxs("div",{className:`card-exam-number${i&&t.weishu>=8?" with-reference-points":""}`,"data-recognition":"StudentId","data-value":String(t.weishu),"aria-label":`${t.weishu}位准考证号码`,children:[f.jsx("div",{className:"card-exam-number-heading",children:"准考证号码"}),f.jsx("div",{className:"card-exam-number-columns",children:Array.from({length:t.weishu},(b,v)=>f.jsxs("div",{className:"card-exam-number-column",children:[f.jsx("div",{className:"card-exam-number-input"}),Array.from({length:10},(x,S)=>f.jsxs("div",{className:"card-exam-number-digit","data-recognition-cell":`${v+1}:${S}`,children:["[",f.jsx("span",{children:S}),"]",i&&v===7&&(S===0||S===9)&&f.jsx("i",{className:`card-reference-point ${S===0?"top":"bottom"}`,"data-recognition":"ReferencePoint"})]},S))]},v))})]}),t.kaohao==="code"&&!t.mifeng&&f.jsx(Zd,{}),(l||u)&&f.jsx(Pl,{})]}),m&&f.jsx(Pl,{}),c&&g&&f.jsx(tb,{focusText:t.focusText,marks:C})]})}function rO({settings:t,back:r}){return f.jsxs("div",{className:`card-seal-line${r?" back":""}`,children:[f.jsx("span",{className:"card-seal-label",children:"密封线"}),!r&&f.jsxs("div",{className:`card-seal-details${t.kaohao==="code"?" with-barcode":""}`,children:[f.jsx(eb,{seat:t.writeKaohao}),t.kaohao==="code"&&f.jsx(Zd,{})]})]})}function nb({kind:t}){const r=t==="ClassId"?"班级":"学号";return f.jsxs("div",{className:"card-homework-id","data-recognition":t,"data-value":"2","aria-label":`${r}填涂区`,children:[f.jsxs("span",{className:"card-homework-id-label",children:[r,f.jsx("br",{}),"填涂:"]}),f.jsx("div",{className:"card-homework-digits",children:["十位","个位"].map((i,a)=>f.jsxs("div",{className:"card-homework-digit-row",children:[f.jsx("span",{className:"card-homework-place",children:i}),Array.from({length:10},(c,l)=>f.jsx("span",{className:"card-homework-digit",children:f.jsxs("i",{"data-recognition-cell":`${a+1}:${9-l}`,children:["[",f.jsx("span",{children:9-l}),"]"]})},l))]},i))})]})}function oO({settings:t,columns:r}){return f.jsxs("div",{className:`card-homework-header${r===3?" three":""}`,children:[f.jsx("div",{className:"card-homework-student",children:["姓名","班级","学号"].map(i=>f.jsxs("div",{children:[i,":",f.jsx("i",{})]},i))}),t.tiaomaStyle===2?f.jsx(Zd,{}):f.jsxs("div",{className:"card-homework-number",children:[t.classText!==!1&&f.jsx(nb,{kind:"ClassId"}),f.jsx(nb,{kind:"StudentId"})]})]})}function aO({title:t,page:r=0}){const{card:i,setCard:a,readOnly:c,geometry:l,scale:u,setTitleMeasurement:d,uploadImage:m,registerEditor:p}=mt(),C=E.useRef(null),g=E.useRef(null),b=E.useRef(null);E.useEffect(()=>{const w=`title/${t.id}/${r}`;return p(w,b.current),()=>p(w,null)},[t.id,r,p]);const v=E.useRef(null),x=E.useCallback(()=>{const w=C.current,T=g.current;if(!w||!T||r!==0)return;const j={id:t.id,width:w.offsetWidth,height:w.offsetHeight,overflowing:w.scrollHeight>w.clientHeight+1||T.scrollHeight>T.clientHeight+1};d(R=>R?.id===j.id&&R.width===j.width&&R.height===j.height&&R.overflowing===j.overflowing?R:j)},[t.id,r,d]);E.useLayoutEffect(()=>{const w=new ResizeObserver(x);return w.observe(C.current),w.observe(g.current),x(),()=>w.disconnect()},[x]),E.useEffect(()=>{b.current?.getDocument()&&JSON.stringify(b.current.getDocument())!==JSON.stringify(t.document)&&b.current.setDocument(t.document)},[t.document]);const S=w=>a(T=>T.paperTitle?.id===t.id?{...T,paperTitle:{...T.paperTitle,height:Math.max(24,Math.min(90,Math.round(w)))}}:T);return f.jsxs("div",{ref:C,className:"card-paper-header","data-header-page":r+1,style:{top:r*(l.height+Co)+l.topInset,left:l.columnX(r,0),width:l.titleWidth,maxHeight:l.contentHeight,paddingBottom:i.header?10:gi},children:[f.jsxs("div",{className:"card-paper-title",style:{height:t.height},children:[f.jsx("div",{ref:g,className:"card-paper-title-body",children:f.jsx(Ll,{ref:b,initialValue:t.document,readOnly:c,uploadImage:m,ariaLabel:r?`第 ${r+1} 面纸面标题`:"纸面标题",onLayout:x,onChange:w=>a(T=>T.paperTitle?.id===t.id&&JSON.stringify(T.paperTitle.document)!==JSON.stringify(w)?{...T,paperTitle:{...T.paperTitle,document:w}}:T)})}),!c&&f.jsx("button",{className:"card-title-height-handle","aria-label":"调整标题高度",title:"调整输入框高度",onPointerDown:w=>{w.button===0&&(w.preventDefault(),w.stopPropagation(),v.current={y:w.clientY,height:t.height},w.currentTarget.setPointerCapture(w.pointerId))},onPointerMove:w=>{v.current&&S(v.current.height+(w.clientY-v.current.y)/u)},onPointerUp:w=>{v.current=null,w.currentTarget.hasPointerCapture(w.pointerId)&&w.currentTarget.releasePointerCapture(w.pointerId)},onPointerCancel:()=>{v.current&&S(v.current.height),v.current=null},onLostPointerCapture:()=>{v.current=null},onKeyDown:w=>{w.key==="Escape"&&v.current&&(S(v.current.height),v.current=null),(w.key==="ArrowUp"||w.key==="ArrowDown")&&(w.preventDefault(),S(t.height+(w.key==="ArrowDown"?2:-2)))},children:f.jsx("span",{children:"↕"})})]}),i.header&&(i.usage==="homework"?f.jsx(oO,{settings:i.header,columns:l.columns}):f.jsx(nO,{settings:i.header,columns:l.columns,pointBlack:i.recognition?.pointBlack}))]})}function iO({value:t,left:r,top:i}){const a=E.useMemo(()=>{try{return _m(t)}catch{return null}},[t]);return a&&f.jsxs("svg",{className:"card-exam-qr","data-recognition":"ExamQrCode","data-value":t,"aria-label":"试卷二维码",style:{left:r,top:i},width:"40",height:"40",viewBox:`0 0 ${a.count} ${a.count}`,shapeRendering:"crispEdges",children:[f.jsx("rect",{width:a.count,height:a.count,fill:"white"}),f.jsx("path",{d:a.path,fill:"black"})]})}const sO=["topLeft","topRight","bottomLeft","bottomRight"];function lO({card:t,geometry:r,page:i,pageCount:a}){const c=r.columnX(i,0),l=r.columnX(i,r.columns-1)+r.columnWidth,u=r.topInset-31,d=r.height-r.bottomInset+16,m=NS(i+1),p=jm(t.creation),C=p&&yu[p],g=t.recognition?.examQrCode&&t.creation?.exampaperId!==void 0&&i%2===0,b=v=>({left:v%2?l-(v<2?26:13):c,top:v<2?u:d,width:v<2?26:13,height:v<2?13:26});return f.jsxs(E.Fragment,{children:[sO.map((v,x)=>f.jsx("div",{className:"card-registration-mark","data-anchor":v,style:b(x)},v)),a>1&&m&&f.jsx("div",{className:"card-code-marks","data-recognition":"PageCode","data-value":String(i+1),"aria-label":`纸面识别 ${i+1}`,style:{left:c+Math.max(30,r.columnWidth-180),top:d-14},children:[...m].map((v,x)=>f.jsx("i",{"data-value":v,"data-recognition-cell":String(x+1),className:v==="1"?"is-filled":""},x))}),i%2===0&&t.recognition?.subjectMarkers!==!1&&C&&f.jsx("div",{className:"card-code-marks","data-recognition":"SubjectCode","data-value":p,"aria-label":"学科识别标记",style:{left:r.columnX(i,r.columns>1?1:0)+Math.min(100,Math.max(30,r.columnWidth-140)),top:d-14},children:[1,2,3,4].map(v=>f.jsx("i",{"data-value":C.includes(v)?"1":"0","data-recognition-cell":String(v),className:C.includes(v)?"is-filled":""},v))}),g&&f.jsx(iO,{value:String(t.creation.exampaperId),left:r.columns===1?c+(r.columnWidth-40)/2:c+r.columnWidth-40,top:r.topInset-56})]})}function cO({block:t,index:r,placement:i,onMeasure:a,onActiveFragment:c}){const{geometry:l,readOnly:u,selectedId:d,setSelectedId:m,updateBlock:p,registerEditor:C,uploadImage:g}=mt(),b=E.useRef(null),[v,x]=E.useState([]),S=E.useRef(null),w=E.useCallback(M=>{S.current=M,C(t.id,M)},[t.id,C]);E.useEffect(()=>{JSON.stringify(S.current?.getDocument())!==JSON.stringify(t.document)&&S.current?.syncDocument(t.document)},[t.document]);const T=Math.max(t.answerHeight,(v.at(-1)?.bottom||0)+12),j=E.useRef(a);j.current=a,E.useLayoutEffect(()=>{const M=(v.at(-1)?.bottom||0)+6,D=[...v.map(_=>_.bottom+6),...Array.from({length:Math.max(0,Math.floor((T-M)/40))},(_,I)=>M+(I+1)*40)];j.current({width:l.columnWidth,height:T,breaks:t.areaType==="forbiden"?[]:D})},[l.columnWidth,T,v,t.areaType]);const R=E.useMemo(()=>i.fragments.map(M=>({from:M.from-6,to:M.to-6,x:M.x-i.x,y:M.y-i.y-M.from})),[i]),O=i.fragments.at(-1);return f.jsxs("article",{className:`card-question card-area-block${d===t.id&&!u?" is-selected":""}${i.overflowing?" is-overflowing":""}${i.fragments.length>1?" is-fragmented":""}`,"data-block-id":t.id,"data-page":i.page+1,"data-column":i.column+1,"data-area-type":t.areaType,"aria-label":t.title,style:{left:i.x,top:i.y,width:l.columnWidth,height:T+(i.fragments.length===1&&O.bottomPadding||0),maxHeight:i.overflowing?i.available:void 0},onPointerDownCapture:()=>{u||m(t.id)},children:[i.fragments.map((M,D)=>f.jsx("div",{className:"card-area-border","data-recognition":t.areaType==="forbiden"?"Blank":"FrameOnly","data-answer-id":t.id,"data-fragment":D,style:{left:M.x-i.x,top:M.y-i.y,height:M.to-M.from+(M.bottomPadding||0),width:l.columnWidth}},D)),f.jsx("div",{className:"card-area-text",ref:b,children:f.jsx(Ll,{ref:w,initialValue:t.document,readOnly:u,ariaLabel:`题块 ${r+1} 区域文字`,uploadImage:g,onChange:M=>p(t.id,{document:M}),pagination:{slices:R,maxUnitHeight:l.contentHeight-12,onMeasure:x,onActiveSliceChange:c}})}),!u&&f.jsx("div",{className:"card-area-resize",style:{left:O.x-i.x,top:O.y-i.y+O.to-O.from+(O.bottomPadding||0)-12,width:l.columnWidth},children:f.jsx(J0,{height:t.answerHeight,min:100,label:"调整区域高度",onChange:M=>p(t.id,{answerHeight:Math.min(t.areaType==="forbiden"?l.contentHeight:4e3,M)})})})]})}function uO(){const{card:t,paperRoot:r,paperBlocks:i,selectedId:a,setSelectedId:c,selectedChoiceId:l,selectChoice:u,settingsId:d,openSettings:m,registerEditor:p,editingQuestionId:C,setMeasurements:g,readOnly:b,scale:v,geometry:x,pageCount:S,totalHeight:w,placementById:T,updateBlock:j,uploadImage:R}=mt(),O=E.useRef(null),[M,D]=E.useState(null),_=(q,P)=>D(G=>G?.id===q&&G.index===P?G:{id:q,index:P}),I=q=>{const P=q instanceof Element?q.closest("[data-block-id], [data-block-fragment]"):null;return P?.dataset.blockId||P?.dataset.blockFragment},z=t.blocks.find(q=>q.id===d),H=z&&l(z),L=i.find(q=>q.id===gr),$=L?.reference&&H&&qs(L.reference).some(q=>q.id===H)?z:t.blocks.find(q=>q.reference?.questions.some(P=>wt(P.type))),Y=L?[L,...t.blocks.map(q=>i.find(P=>P.id===q.id)||q)]:i,U=q=>q===gr&&$?.id||q;return f.jsxs("div",{ref:r,className:"card-sheet-stack",style:{width:x.width,height:w},onPointerDownCapture:q=>{const P=I(q.target);O.current=!b&&q.button===0&&P?{id:P,x:q.clientX,y:q.clientY}:null},onPointerCancelCapture:()=>{O.current=null},onClickCapture:q=>{const P=O.current;if(O.current=null,!b&&q.button===0&&P&&I(q.target)===P.id&&Math.hypot(q.clientX-P.x,q.clientY-P.y)<5){const G=q.target instanceof Element?q.target.closest("[data-question-id], [data-fill-question-id], [data-exercise-id], [data-exercise-item], [data-answer-id], [data-content-id]"):null,B=G?.dataset.answerId||G?.dataset.questionId||G?.dataset.fillQuestionId||G?.dataset.exerciseId||G?.dataset.exerciseItem||G?.dataset.contentId,Q=t.blocks.find(N=>B&&N.reference&&qs(N.reference).some(K=>K.id===B))||t.blocks.find(N=>N.id===U(P.id));B&&(Q?.reference?qs(Q.reference):Q?.choices?.questions||Q?.exercise?.items)?.some(N=>N.id===B)&&u(Q.id,B),m(Q?.id||U(P.id),!1)}},children:[Array.from({length:S},(q,P)=>f.jsxs("div",{className:"card-sheet","data-paper-page":P+1,style:{top:P*(x.height+Co),width:x.width,height:x.height},children:[t.header&&f.jsx(lO,{card:t,geometry:x,page:P,pageCount:S}),t.header&&!b&&Array.from({length:x.columns},(G,B)=>f.jsx("div",{className:"card-column-guide",style:{left:x.columnX(P,B),width:x.columnWidth,top:x.topInset,bottom:x.bottomInset}},B)),t.usage!=="homework"&&t.header?.mifeng&&f.jsx("div",{className:"card-seal",style:{left:P%2===0?x.margin:x.width-x.margin-x.sealWidth,width:x.sealWidth},children:f.jsx(rO,{settings:t.header,back:P%2!==0})}),t.header&&Array.from({length:x.columns},(G,B)=>f.jsx("div",{className:"card-paper-footer",style:{left:x.columnX(P,B),width:x.columnWidth,bottom:20},children:f.jsxs("span",{children:["第",P*x.columns+B+1,"页   共",S*x.columns,"页"]})},B))]},P)),t.paperTitle&&Array.from({length:S},(q,P)=>x.hasHeader(P)&&f.jsx(aO,{title:t.paperTitle,page:P},`${t.paperTitle.id}/${P}`)),i.flatMap(q=>{const P=T.get(q.id).fragments,G=M?.id===q.id?Math.min(M.index,P.length-1):0;return P.length>1?P.map((B,Q)=>f.jsx("div",{className:`card-fragment-frame${a===U(q.id)&&!b&&Q===G?" is-selected":""}`,"data-block-fragment":q.id,"data-page":B.page+1,"data-column":B.column+1,style:{left:B.x,top:B.y,width:x.columnWidth,height:B.to-B.from+(B.topPadding||0)+(B.bottomPadding||0)},onPointerDown:()=>{b||(_(q.id,Q),c(U(q.id)))}},`${q.id}/${Q}`)):[]}),Y.map((q,P)=>{const G=B=>g(Q=>{const N=Q[q.id];return N&&N.compositionStart===B.compositionStart&&JSON.stringify(N.markingFrames)===JSON.stringify(B.markingFrames)&&Math.abs(N.width-B.width)<.5&&Math.abs(N.height-B.height)<.5&&JSON.stringify(N.breaks)===JSON.stringify(B.breaks)?Q:{...Q,[q.id]:B}});return q.kind==="area"?f.jsx(cO,{block:q,index:P,placement:T.get(q.id),onMeasure:G,onActiveFragment:B=>_(q.id,B)},q.id):f.jsx(tO,{hidden:!i.some(B=>B.id===q.id),block:q,index:P,placement:T.get(q.id),width:x.columnWidth,scale:v,selected:a===U(q.id),readOnly:b,activeChoiceId:!b&&d===U(q.id)?l(t.blocks.find(B=>B.id===U(q.id))||q):void 0,showQuestion:t.questionCard!==!1||!b&&C===q.id,registerEditor:p,uploadImage:R,onSelect:()=>c(U(q.id)),onActiveFragment:B=>_(q.id,B),onSettings:()=>{_(q.id,0),m(U(q.id))},onDocument:B=>j(q.id,{document:B}),onHeight:B=>j(q.id,{answerHeight:B}),onExercise:B=>j(q.id,{exercise:B}),onReference:B=>{q.id!==gr&&j(q.id,{reference:B})},onMeasure:G},q.id)})]})}const dO=()=>{const{navigatorVisible:t}=Io(),{geometry:r,totalHeight:i,readOnly:a,pageCount:c,card:l,setSelectedId:u}=mt();return f.jsxs("div",{className:`${uA["portal-wrapper"]} card-workspace`,id:"uni-answer-sheet","data-mode":a?"preview":"edit",children:[f.jsx(pR,{width:r.width,height:i,onBackgroundClick:()=>u(null),children:f.jsx(uO,{})}),f.jsx(qR,{}),f.jsx(fR,{summary:`${c} 页 · ${l.blocks.length} 个题块`}),t&&f.jsx(gR,{})]})},Lo=t=>structuredClone(t),rb=t=>{const r=Lo(t);return delete r.recognitionData,r};function ob(){return new Promise(t=>{const r=()=>{clearTimeout(a),cancelAnimationFrame(i),t()},i=requestAnimationFrame(r),a=setTimeout(r,50)})}function fO(t,r,i,a,c){i.initialValue&&bu(i.initialValue,r);let l=i,u=i.initialValue&&rb(i.initialValue),d=0,m,p,C=!1,g;const b=ZS.createRoot(t,{onUncaughtError:c});function v({readOnly:D}){const _=mt();return E.useLayoutEffect(()=>{m=_,a()}),E.useEffect(()=>{_.setReadOnly(!!D)},[D]),E.useEffect(()=>{if(p===_.card)return;const I=!p;p=_.card,I||l.onChange?.(Lo(_.card))},[_.card]),null}const x=()=>{if(C||!m)throw new Error("制卡实例尚未就绪或已经销毁");return m},S=(D,_,I)=>({code:D,path:"",message:_,...I}),w=async()=>{const D=Date.now()+8e3;let _="",I=0,z="LAYOUT_PENDING";for(;Date.now()<D;){await ob();const H=x();if(!t.isConnected||t.clientWidth<100||t.clientHeight<100)return{value:H,issues:[S("LAYOUT_UNAVAILABLE","请显示制卡容器并为其设置有效的宽高后再保存")]};const L=[...new Set(H.editors.current.values())].map(G=>G.getStatus());z=L.some(G=>G.composing||G.uploading)?"EDITOR_BUSY":"LAYOUT_PENDING";const $=L.every(G=>G.ready&&!G.composing&&!G.uploading&&!G.layoutPending);if($&&H.editingQuestionId&&!H.card.questionCard){H.finishQuestionEditing(),I=0;continue}const Y=H.paperBlocks.every(G=>{const B=H.measurements[G.id];return B&&Math.abs(B.width-H.geometry.columnWidth)<1&&B.height>0})&&(!H.card.paperTitle||H.titleMeasurement?.id===H.card.paperTitle.id&&Math.abs(H.titleMeasurement.width-H.geometry.titleWidth)<1),U=Array.from(t.querySelectorAll("img[src], img[srcset]")).filter(G=>G.getClientRects().length),q=U.every(G=>G.complete),P=JSON.stringify([H.card,H.measurements,H.titleMeasurement,H.placements]);if($&&Y&&q&&document.fonts.status==="loaded"&&P===_?I++:I=0,_=P,I>=4){const G=[];return L.forEach(B=>{B.uploadError&&G.push(S("IMAGE_UPLOAD_FAILED",B.uploadError))}),U.some(B=>!B.naturalWidth)&&G.push(S("IMAGE_LOAD_FAILED","有图片加载失败,请检查图片地址")),H.titleOverflow&&G.push(S("TITLE_OVERFLOW","纸面标题超出可用区域",{path:"paperTitle"})),H.overflow.forEach(B=>G.push(S("CONTENT_OVERFLOW","题块中存在无法放入一栏的内容,请调整尺寸或版式",{path:"blocks",blockId:B.id}))),t.querySelectorAll(".rt-content").forEach(B=>{if(!B.getClientRects().length||B.closest("[hidden]"))return;const Q=B.closest("[data-block-id]")?.dataset.blockId,N=Q&&H.placementById.get(Q);(!N||N.fragments.length===1)&&B.scrollWidth>B.clientWidth+2&&G.push(S("CONTENT_OVERFLOW","内容超过输入区域宽度",{path:"blocks",...Q?{blockId:Q}:{}}))}),{value:H,issues:G}}}return{value:x(),issues:[S(z,z==="EDITOR_BUSY"?"输入法输入或图片上传尚未结束,请完成后再保存":"字体、图片或分页尚未稳定,请稍后重试")]}},T=async()=>{try{const{issues:D,value:_}=await w(),z=[...PS(_.card,r).issues,...D];let H;if(!z.length)try{H=_.getRecognitionData()}catch(L){z.push(S(L instanceof Xr?L.code:"RECOGNITION_FAILED",L instanceof Error?L.message:"识别坐标生成失败"))}return{value:_,recognitionData:H,result:{valid:z.length===0,issues:z}}}catch(D){if(C)throw D;return{value:x(),result:{valid:!1,issues:[S("EDITOR_ERROR",D instanceof Error?D.message:"编辑器或数据校验失败")]}}}},j=async()=>(await T()).result,R=()=>g||(g=(async()=>{const{result:D,value:_,recognitionData:I}=await T();if(x(),!D.valid)return{ok:!1,issues:D.issues};try{return{ok:!0,data:Lo({..._.card,..._.getReferenceData(),recognitionData:I})}}catch(z){return{ok:!1,issues:[S("EXPORT_FAILED",z instanceof Error?z.message:"题卡数据转换失败")]}}})().finally(()=>{g=void 0})),O=()=>b.render(f.jsx(cA,{children:f.jsxs(RR,{editorPlugin:r,uploadImage:l.uploadImage,dictionaries:l.dictionaries,initialValue:u,onSave:()=>{x().setSaveMessage("正在校验…"),R().then(D=>{x().setSaveMessage(D.ok?"已生成保存数据":D.issues[0].message),l.onSave?.(D)}).catch(D=>{C||x().setSaveMessage("保存失败"),l.onError?.(D)})},children:[f.jsx(v,{readOnly:l.readOnly}),f.jsx(dO,{})]},d)}));O();const M=async D=>{bu(D,r);const _=rb(D);x(),u=_;const I=++d;Hr.flushSync(O);const z=Date.now()+8e3;do{await ob();const H=x();if(I!==d)throw new DOMException("回显已被另一张题卡替换","AbortError");if([...H.editors.current.values()].every(L=>L.getStatus().ready))return}while(Date.now()<z);throw new Error("题卡数据已载入,但编辑器未能及时就绪")};return{isReady:()=>!!m&&!C,getDocument:()=>Lo(x().card),setDocument:M,newDocument:D=>M(uu(D)),getReferenceData:()=>Lo(x().getReferenceData()),setReferenceData:D=>M({...x().card,blocks:G0(Lo(D),r.html)}),validate:j,save:R,async getRecognitionData(){const D=await T();if(!D.result.valid)throw new ca(D.result.issues);return Lo(D.recognitionData)},focusIssue:D=>{D.blockId&&(x().selectBlock(D.blockId,!0),x().openSettings(D.blockId,!1))},update(D){l=D,O()},destroy(){C||(C=!0,b.unmount(),m=void 0)}}}const hO=Object.freeze(Object.defineProperty({__proto__:null,mountAnswerSheet:fO},Symbol.toStringTag,{value:"Module"}));return nt.AnswerSheetDataError=ca,nt.createAnswerSheet=$S,Object.defineProperty(nt,Symbol.toStringTag,{value:"Module"}),nt})({});